{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/@stimulus/core/dist/event_listener.js","webpack:///./node_modules/@stimulus/core/dist/dispatcher.js","webpack:///./node_modules/@stimulus/core/dist/action_descriptor.js","webpack:///./node_modules/@stimulus/core/dist/action.js","webpack:///./node_modules/@stimulus/core/dist/binding.js","webpack:///./node_modules/@stimulus/mutation-observers/dist/element_observer.js","webpack:///./node_modules/@stimulus/mutation-observers/dist/attribute_observer.js","webpack:///./node_modules/@stimulus/mutation-observers/dist/string_map_observer.js","webpack:///./node_modules/@stimulus/multimap/dist/set_operations.js","webpack:///./node_modules/@stimulus/multimap/dist/multimap.js","webpack:///./node_modules/@stimulus/multimap/dist/indexed_multimap.js","webpack:///./node_modules/@stimulus/mutation-observers/dist/token_list_observer.js","webpack:///./node_modules/@stimulus/mutation-observers/dist/value_list_observer.js","webpack:///./node_modules/@stimulus/core/dist/binding_observer.js","webpack:///./node_modules/@stimulus/core/dist/value_observer.js","webpack:///./node_modules/@stimulus/core/dist/context.js","webpack:///./node_modules/@stimulus/core/dist/inheritable_statics.js","webpack:///./node_modules/@stimulus/core/dist/blessing.js","webpack:///./node_modules/@stimulus/core/dist/module.js","webpack:///./node_modules/@stimulus/core/dist/definition.js","webpack:///./node_modules/@stimulus/core/dist/class_map.js","webpack:///./node_modules/@stimulus/core/dist/string_helpers.js","webpack:///./node_modules/@stimulus/core/dist/data_map.js","webpack:///./node_modules/@stimulus/core/dist/guide.js","webpack:///./node_modules/@stimulus/core/dist/selectors.js","webpack:///./node_modules/@stimulus/core/dist/target_set.js","webpack:///./node_modules/@stimulus/core/dist/scope.js","webpack:///./node_modules/@stimulus/core/dist/scope_observer.js","webpack:///./node_modules/@stimulus/core/dist/router.js","webpack:///./node_modules/@stimulus/core/dist/schema.js","webpack:///./node_modules/@stimulus/core/dist/application.js","webpack:///./node_modules/@stimulus/core/dist/class_properties.js","webpack:///./node_modules/@stimulus/core/dist/target_properties.js","webpack:///./node_modules/@stimulus/core/dist/value_properties.js","webpack:///./node_modules/@stimulus/core/dist/controller.js","webpack:///./app/javascript/controllers sync _controller\\.js$","webpack:///./app/javascript/controllers/entry_form_controller.js","webpack:///./app/javascript/controllers/hello_controller.js","webpack:///./app/javascript/controllers/landing_controller.js","webpack:///./app/javascript/controllers/lightbox_controller.js","webpack:///./app/javascript/controllers/messages_controller.js","webpack:///./app/javascript/controllers/post_form_controller.js","webpack:///./app/javascript/controllers/settings_controller.js","webpack:///./node_modules/@rails/ujs/app/assets/javascripts/rails-ujs.esm.js","webpack:///./node_modules/@rails/activestorage/app/assets/javascripts/activestorage.esm.js","webpack:///./app/javascript/channels/index.js","webpack:///./app/javascript/channels sync _channel\\.js$","webpack:///./node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js","webpack:///./node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable.js","webpack:///./node_modules/@hotwired/turbo-rails/app/javascript/turbo/snakeize.js","webpack:///./node_modules/@hotwired/turbo-rails/app/javascript/turbo/cable_stream_source_element.js","webpack:///./node_modules/@hotwired/turbo-rails/app/javascript/turbo/index.js","webpack:///./node_modules/@hotwired/turbo-rails/app/javascript/turbo/fetch_requests.js","webpack:///./app/javascript/controllers/index.js","webpack:///./node_modules/@stimulus/webpack-helpers/dist/index.js","webpack:///./app/javascript/packs/application.js"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","installedModules","__webpack_require__","exports","module","l","e","promises","installedChunkData","promise","Promise","resolve","reject","onScriptComplete","script","document","createElement","charset","timeout","nc","setAttribute","src","p","jsonpScriptSrc","error","Error","event","onerror","onload","clearTimeout","chunk","errorType","type","realSrc","target","message","name","request","undefined","setTimeout","head","appendChild","all","m","c","d","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","oe","err","console","jsonpArray","window","oldJsonpFunction","slice","s","EventListener","eventTarget","eventName","eventOptions","this","unorderedBindings","Set","connect","addEventListener","disconnect","removeEventListener","bindingConnected","binding","add","bindingDisconnected","delete","handleEvent","extendedEvent","stopImmediatePropagation_1","stopImmediatePropagation","assign","immediatePropagationStopped","extendEvent","_i","_a","bindings","Array","from","sort","left","right","leftIndex","index","rightIndex","configurable","Dispatcher","application","eventListenerMaps","Map","started","start","eventListeners","forEach","eventListener","stop","values","reduce","listeners","map","concat","fetchEventListenerForBinding","handleError","detail","fetchEventListener","eventListenerMap","fetchEventListenerMapForEventTarget","cacheKey","createEventListener","set","parts","keys","join","descriptorPattern","parseEventTarget","eventTargetName","Action","element","descriptor","tagName","toLowerCase","defaultEventNames","getDefaultEventNameForElement","identifier","methodName","forToken","token","descriptorString","content","matches","trim","match","split","options","replace","test","toString","eventNameSuffix","getAttribute","Binding","context","action","willBeInvokedByEvent","invokeWithEvent","method","controller","Element","contains","scope","containsElement","ElementObserver","delegate","_this","elements","mutationObserver","MutationObserver","mutations","processMutations","observe","attributes","childList","subtree","refresh","takeRecords","matchElementsInTree","has","removeElement","_b","_c","addElement","mutations_1","mutation","processMutation","processAttributeChange","attributeName","processRemovedNodes","removedNodes","processAddedNodes","addedNodes","node","elementAttributeChanged","matchElement","nodes","elementFromNode","processTree","elementIsActive","tree","processor","nodeType","Node","ELEMENT_NODE","isConnected","elementMatched","elementUnmatched","AttributeObserver","elementObserver","hasAttribute","querySelectorAll","selector","elementMatchedAttribute","elementUnmatchedAttribute","elementAttributeValueChanged","StringMapObserver","stringMap","knownAttributeNames","refreshAttribute","getStringMapKeyForAttribute","stringMapKeyAdded","stringMapValueChanged","stringMapKeyRemoved","currentAttributeNames","recordedAttributeNames","attribute","fetch","del","size","prune","extendStatics","Multimap","valuesByKey","hasKey","hasValue","some","getValuesForKey","getKeysForValue","filter","__extends","b","setPrototypeOf","__proto__","__","constructor","_super","IndexedMultimap","keysByValue","TokenListObserver","attributeObserver","tokensByElement","tokensMatched","readTokensForElement","refreshTokensForElement","unmatchedTokens","matchedTokens","tokensUnmatched","tokens","tokenMatched","tokenUnmatched","previousTokens","currentTokens","firstDifferingIndex","Math","max","_","findIndex","tokensAreEqual","tokenString","parseTokenString","ValueListObserver","tokenListObserver","parseResultsByToken","WeakMap","valuesByTokenByElement","fetchParseResultForToken","fetchValuesByTokenForElement","elementMatchedValue","elementUnmatchedValue","parseResult","parseToken","valuesByToken","parseValueForToken","BindingObserver","bindingsByAction","valueListObserver","actionAttribute","disconnectAllActions","schema","connectAction","disconnectAction","clear","ValueObserver","receiver","stringMapObserver","valueDescriptorMap","invokeChangedCallbacksForDefaultValues","attributeValue","invokeChangedCallbackForValue","valueDescriptors","name_1","defaultValue","Context","controllerConstructor","bindingObserver","dispatcher","valueObserver","initialize","parentElement","readInheritableStaticArrayValues","propertyName","ancestors","getAncestorsForConstructor","definition","isArray","getOwnStaticArrayValues","readInheritableStaticObjectPairs","pairs","apply","getOwnStaticObjectPairs","getPrototypeOf","reverse","__spreadArrays","il","arguments","k","a","j","jl","bless","properties","shadowConstructor","extend","shadowProperties","getOwnKeys","shadowingDescriptor","getOwnPropertyDescriptor","getShadowedDescriptor","getShadowProperties","defineProperties","shadow","blessings","blessedProperties","blessing","getBlessedProperties","getOwnPropertySymbols","getOwnPropertyNames","extendWithReflect","extended","_newTarget","Reflect","construct","Module","blessDefinition","contextsByScope","connectedContexts","connectContextForScope","fetchContextForScope","disconnectContextForScope","ClassMap","getDataKey","getAttributeName","getAttributeNameForKey","camelize","char","toUpperCase","capitalize","charAt","dasherize","DataMap","removeAttribute","Guide","logger","warnedKeysByObject","warn","warnedKeys","attributeValueContainsToken","TargetSet","targetName","find","targetNames","findTarget","findLegacyTarget","findAll","targets","findAllTargets","findAllLegacyTargets","getSelectorForTargetName","findElement","findAllElements","getLegacySelectorForTargetName","deprecate","targetDescriptor","targetAttribute","guide","Scope","classes","closest","controllerSelector","queryElements","controllerAttribute","ScopeObserver","scopesByIdentifierByElement","scopeReferenceCounts","scopesByIdentifier","fetchScopesByIdentifierForElement","createScopeForElementAndIdentifier","referenceCount","scopeConnected","scopeDisconnected","Router","scopeObserver","modulesByIdentifier","contexts","loadDefinition","unloadIdentifier","connectModule","disconnectModule","getContextForElementAndIdentifier","defaultSchema","__awaiter","thisArg","_arguments","P","generator","fulfilled","step","next","rejected","result","done","then","__generator","body","f","y","g","label","sent","trys","ops","verb","iterator","v","op","TypeError","pop","Application","documentElement","router","readyState","register","load","rest","unload","getControllerForElementAndIdentifier","ClassPropertiesBlessing","classDefinition","TargetPropertiesBlessing","targetDefinition","ValuePropertiesBlessing","valueDefinitionPairs","propertyDescriptorMap","valueDefinitionPair","valueDescriptor","parseValueDefinitionPair","read","readers","write","writers","default","propertiesForValueDefinitionPair","typeConstant","Boolean","Number","String","parseValueTypeConstant","defaultValuesByType","valueDescriptorForTokenAndType","array","boolean","number","string","JSON","parse","parseFloat","writeJSON","stringify","Controller","webpackContext","req","id","webpackContextResolve","code","EntryFormController","_Controller","_inherits","_createSuper","_classCallCheck","_lastEventTimestamp","Date","getTime","updatePrompt","promptDelayMilliseconds","_placeCursorAtEnd","_this2","replacePrompt","_this3","promptTarget","classList","textContent","randomPrompt","remove","transitionMilliseconds","list","encouragementPrompts","floor","random","ctrlKey","save","updateProgressBar","submit","words","bodyTarget","wordCount","progressTarget","progressMeterTarget","min","submitButtonTarget","progressMeterTextWordCountTarget","progressMeterTextTarget","textarea","selectionStart","selectionEnd","scrollTop","scrollHeight","_default","LandingController","location","entryUrl","date","dateString","offsetQueryParam","year","getFullYear","month","getMonth","dayOfMonth","getDate","getTimezoneOffset","LightboxController","getElementById","style","display","PostFormController","inputTarget","setSelectionRange","SettingsController","autoScrambleTarget","checked","confirm","preventDefault","linkClickSelector","buttonClickSelector","exclude","inputChangeSelector","formSubmitSelector","formInputClickSelector","formDisableSelector","formEnableSelector","linkDisableSelector","buttonDisableSelector","nonce","loadCSPNonce","metaTag","querySelector","cspNonce","matchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","webkitMatchesSelector","EXPANDO","getData","setData","$","isContentEditable","isEditable","csrfToken","meta","csrfParam","CSRFProtection","xhr","setRequestHeader","refreshCSRFTokens","param","input","AcceptHeaders","text","html","xml","json","ajax","prepareOptions","createXHR","response","processResponse","responseText","getResponseHeader","status","success","statusText","complete","beforeSend","XMLHttpRequest","OPENED","send","url","href","indexOf","dataType","accept","open","crossDomain","withCredentials","onreadystatechange","DONE","parentNode","removeChild","parser","DOMParser","parseFromString","error1","isCrossDomain","originAnchor","urlAnchor","protocol","host","CustomEvent","params","evt","createEvent","initCustomEvent","bubbles","cancelable","Event","defaultPrevented","fire","obj","dispatchEvent","stopEverything","stopPropagation","eventType","handler","toArray","serializeElement","additionalParam","inputs","disabled","option","selected","encodeURIComponent","formElements","form","el","allowAction","rails","callback","answer","handleDisabledElement","enableElement","isXhrRedirect","enableLinkElement","enableFormElement","enableFormElements","disableElement","disableLinkElement","disableFormElement","disableFormElements","replacement","innerHTML","originalText","formSubmitButtonClick","button","formNoValidate","preventInsignificantClick","insignificantMetaClick","metaKey","Rails","fileInputSelector","handleConfirm","handleMethod","link","csrfToken$1","csrfParam$1","formContent","click","handleMethodWithRails","handleRemote","isRemote","enctype","FormData","append","_len","args","_key","_len2","_key2","_len3","_key3","handleRemoteWithRails","_rails_loaded","jQuery","ajaxPrefilter","originalOptions","sparkMd5","undefined$1","hex_chr","md5cycle","x","md5blk","md5blks","charCodeAt","md5blk_array","md51","tail","tmp","lo","hi","state","substring","parseInt","md51_array","subarray","Uint8Array","rhex","hex","toUtf8","str","unescape","utf8Str2ArrayBuffer","returnUInt8Array","buff","ArrayBuffer","arr","arrayBuffer2Utf8Str","fromCharCode","concatenateArrayBuffers","first","second","byteLength","buffer","hexToBinaryString","bytes","substr","SparkMD5","reset","clamp","val","to","num","targetArray","sourceArray","begin","end","appendBinary","contents","_buff","_length","_hash","raw","ret","_finish","getState","hash","setState","destroy","hashBinary","factory","fileSlice","File","mozSlice","webkitSlice","FileChecksum","file","chunkSize","chunkCount","ceil","chunkIndex","md5Buffer","fileReader","FileReader","fileReaderDidLoad","fileReaderDidError","readNextChunk","binaryDigest","base64digest","btoa","readAsArrayBuffer","root","eventInit","initEvent","BlobRecord","checksum","customHeaders","filename","content_type","byte_size","responseType","headerKey","getMetaValue","requestDidLoad","requestDidError","_this$xhr","blob","direct_upload","directUploadData","toJSON","BlobUpload","_blob$directUploadDat","headers","_this$xhr2","DirectUpload","notify","upload","messages","DirectUploadController","directUpload","dispatch","hiddenInput","insertAdjacentElement","dispatchError","signed_id","uploadRequestDidProgress","progress","loaded","total","alert","directUploadWillCreateBlobWithXHR","directUploadWillStoreFileWithXHR","DirectUploadsController","files","controllers","createDirectUploadControllers","startNextController","processingAttribute","submitButtonsByForm","didClick","didSubmitForm","didSubmitRemoteElement","handleFormSubmissionEvent","disable","enable","focus","submitForm","ActiveStorage","channels","require","webpackEmptyContext","_slicedToArray","_arrayWithHoles","u","return","_iterableToArrayLimit","minLen","_arrayLikeToArray","_unsupportedIterableToArray","_nonIterableRest","len","arr2","customElements","polyfillWrapFlushCallback","BuiltInHTMLElement","HTMLElement","wrapperForTheName","raise","errorConstructor","requestSubmit","submitter","DOMException","validateSubmitter","hidden","HTMLFormElement","submittersByForm","clickCaptured","candidate","findSubmitterFromClickTarget","FrameLoadingStyle","FetchMethod","FormSubmissionState","FormEnctype","TimingMetric","VisitState","navigator","vendor","SubmitEvent","FrameElement","observedAttributes","super","delegateConstructor","connectedCallback","disconnectedCallback","reload","sourceURLReloaded","attributeChangedCallback","loadingStyleChanged","completeChanged","sourceURLChanged","disabledChanged","loading","lazy","eager","frameLoadingStyleFromString","autoscroll","isLoading","isActive","ownerDocument","isPreview","expandURL","locatable","URL","baseURI","getAnchor","anchorMatch","getAction","getExtension","pathname","getPathComponents","getLastPathComponent","isPrefixedBy","baseURL","prefix","origin","endsWith","getPrefix","startsWith","locationIsVisitable","rootLocation","getRequestURL","anchor","toCacheKey","FetchResponse","succeeded","ok","failed","clientError","statusCode","serverError","redirected","isHTML","contentType","header","clone","responseHTML","activateScriptElement","createdScriptElement","getMetaContent","async","destinationElement","sourceElement","_ref","copyElementAttributes","_ref2","composed","nextAnimationFrame","requestAnimationFrame","parseHTMLDocument","unindent","strings","lines","interpolate","indent","line","uuid","markAsBusy","_len4","_key4","localName","clearBusyState","_len5","_key5","waitForLoad","timeoutInMilliseconds","onComplete","once","getHistoryMethodForAction","history","replaceState","pushState","getVisitAction","_len6","_key6","isAction","getMetaElement","findClosestRecursively","assignedSlot","getRootNode","FetchRequest","URLSearchParams","abortController","AbortController","resolveRequestPromise","_value","defaultHeaders","searchParams","entries","cancel","abort","perform","fetchOptions","prepareRequest","allowRequestToBeIntercepted","requestStarted","receive","willDelegateErrorHandling","requestErrored","requestFinished","fetchResponse","requestPreventedHandlingResponse","requestSucceededWithResponse","requestFailedWithResponse","credentials","redirect","isSafe","signal","abortSignal","referrer","Accept","acceptResponseType","mimeType","requestInterception","resume","AppearanceObserver","intersect","lastEntry","isIntersecting","elementAppearedInViewport","intersectionObserver","IntersectionObserver","unobserve","StreamMessage","wrap","template","createDocumentFragment","fragment","streamElement","importNode","inertScriptElement","templateElement","replaceWith","importStreamElements","FormSubmission","confirmMethod","_element","_submitter","formElement","mustRedirect","initialized","formData","buildFormData","_ref5","_ref6","search","mergeFormDataEntries","fetchRequest","post","put","patch","fetchMethodFromString","formElementAction","urlEncoded","stringFormData","encoding","multipart","plain","formEnctypeFromString","_ref3","_ref4","_FormSubmissionState","requesting","confirmationMessage","_FormSubmissionState2","stopping","stopped","cookieName","cookie","decodeURIComponent","getCookieValue","requestAcceptsTurboStreamResponse","_request","waiting","setSubmitsWith","formSubmission","formSubmissionStarted","formSubmissionFailedWithResponse","requestMustRedirect","responseSucceededWithoutRedirect","formSubmissionErrored","receiving","formSubmissionSucceededWithResponse","resetSubmitterText","formSubmissionFinished","submitsWith","originalSubmitText","Snapshot","activeElement","children","hasAnchor","getElementForAnchor","firstAutofocusableElement","permanentElements","queryPermanentElementsAll","getPermanentElementById","getPermanentElementMapForSnapshot","snapshot","permanentElementMap","currentPermanentElement","newPermanentElement","FormSubmitObserver","submitCaptured","submitBubbled","submissionDoesNotDismissDialog","getElementsByName","HTMLIFrameElement","submissionDoesNotTargetIFrame","willSubmitForm","formSubmitted","View","resolveRenderPromise","resolveInterceptionPromise","scrollToAnchor","scrollToElement","focusElement","scrollToPosition","scrollToAnchorFromLocation","scrollIntoView","_ref7","scrollRoot","scrollTo","scrollToTop","render","renderer","shouldRender","newSnapshot","renderPromise","prepareToRenderSnapshot","renderInterception","renderElement","allowsImmediateRender","renderSnapshot","viewRenderedSnapshot","preloadOnLoadLinksForView","finishRenderingSnapshot","invalidate","reloadReason","reason","viewInvalidated","markAsPreview","prepareToRender","finishRendering","FrameView","missing","LinkInterceptor","clickBubbled","respondsToEventTarget","clickEvent","linkClicked","shouldInterceptLinkClick","originalEvent","linkClickIntercepted","willVisit","_event","LinkClickObserver","MouseEvent","clickEventIsSignificant","composedPath","findLinkFromClickTarget","doesNotTargetIFrame","getLocationForLink","willFollowLinkToLocation","followedLinkToLocation","which","altKey","shiftKey","FormLinkClickObserver","linkInterceptor","willSubmitFormLinkToLocation","_ref8","_ref9","turboFrame","turboAction","turboConfirm","submittedFormLinkToLocation","Bardo","preservingPermanentElements","bardo","enter","leave","_this$permanentElemen","enteringBardo","replaceNewPermanentElementWithPlaceholder","replaceCurrentPermanentElementWithClone","replacePlaceholderWithPermanentElement","leavingBardo","permanentElement","placeholder","createPlaceholderForPermanentElement","cloneNode","getPlaceholderById","placeholders","Renderer","currentSnapshot","willRender","resolvingFunctions","focusFirstAutofocusableElement","connectedSnapshot","elementIsFocusable","currentElement","newElement","FrameRenderer","destinationRange","createRange","selectNodeContents","deleteContents","frameElement","sourceRange","extractContents","loadFrameElement","scrollFrameIntoView","activateScriptElements","willRenderFrame","firstElementChild","block","behavior","readScrollBehavior","newScriptElements","activatedScriptElement","ProgressBar","defaultCSS","animationDuration","hiding","visible","trickle","setValue","stylesheetElement","createStylesheetElement","progressElement","createProgressElement","installStylesheetElement","show","installProgressElement","startTrickling","hide","fadeProgressElement","uninstallProgressElement","stopTrickling","insertBefore","firstChild","width","opacity","trickleInterval","setInterval","clearInterval","className","HeadSnapshot","detailsByOuterHTML","elementIsNoscript","elementWithoutNonce","outerHTML","details","elementType","tracked","elementIsTracked","trackedElementSignature","getScriptElementsNotInSnapshot","getElementsMatchingTypeNotInSnapshot","getStylesheetElementsNotInSnapshot","matchedType","_ref10","_ref11","provisionalElements","_this$detailsByOuterH","findMetaElementByName","elementIsMetaElementWithName","elementIsScript","elementIsStylesheet","PageSnapshot","fromHTMLString","fromDocument","fromElement","_ref12","headSnapshot","clonedElement","selectElements","clonedSelectElements","_ref13","_ref14","source","selectedOptions","clonedPasswordInput","headElement","getSetting","cacheControlValue","isPreviewable","isCacheable","isVisitable","defaultOptions","historyChanged","visitCachedSnapshot","updateHistory","shouldCacheSnapshot","acceptsStreamResponse","SystemStatusCode","PageStage","Visit","restorationIdentifier","timingMetrics","followedRedirect","scrolled","snapshotCached","_Object$assign","snapshotHTML","isSamePage","locationWithActionIsSamePage","adapter","view","restorationData","getRestorationDataForIdentifier","silent","recordTimingMetric","visitStart","visitStarted","cancelRender","canceled","visitEnd","completed","followRedirect","visitCompleted","fail","visitFailed","changeHistory","update","issueRequest","hasPreloadedResponse","simulateRequest","shouldIssueRequest","startRequest","recordResponse","finishRequest","requestStart","visitRequestStarted","isSuccessful","visitRequestCompleted","visitRequestFailedWithStatusCode","requestEnd","visitRequestFinished","loadResponse","_this$response","cacheSnapshot","renderPage","performScroll","visitRendered","renderError","getCachedSnapshot","getCachedSnapshotForLocation","getPreloadedSnapshot","hasCachedSnapshot","loadCachedSnapshot","redirectedToLocation","visitProposedToLocation","goToSamePageAnchor","_response","contentTypeMismatch","_error","networkFailure","forceReloaded","scrollToRestoredPosition","visitScrolledToSamePageLocation","lastRenderedLocation","scrollPosition","metric","getTimingMetrics","frame","cancelAnimationFrame","BrowserAdapter","session","progressBar","showProgressBar","startVisit","visit","showVisitProgressBarAfterDelay","timeoutFailure","_visit","hideVisitProgressBar","pageInvalidated","_formSubmission","showFormProgressBarAfterDelay","hideFormProgressBar","visitProgressBarTimeout","progressBarDelay","formProgressBarTimeout","CacheObserver","deprecatedSelector","removeTemporaryElements","temporaryElements","temporaryElementsWithDeprecation","FrameRedirector","formSubmitObserver","_location","shouldRedirect","findFrameElement","shouldSubmit","submissionIsNavigatable","elementIsNavigatable","History","pageLoaded","onPopState","shouldHandlePopState","turbo","historyPoppedToLocationWithRestorationIdentifier","onPageLoad","updateRestorationData","additionalData","assumeControlOfScrollRestoration","previousScrollRestoration","scrollRestoration","relinquishControlOfScrollRestoration","pageIsLoaded","Navigator","proposeVisit","allowsVisitingLocationWithAction","currentVisit","clearSnapshotCache","visitOptions","getActionForFormSubmission","currentAnchor","isRestorationToTop","oldURL","newURL","_ref16","PageObserver","stage","initial","interpretReadyState","pageIsInteractive","pageIsComplete","pageWillUnload","interactive","pageBecameInteractive","ScrollObserver","onScroll","updatePosition","pageXOffset","pageYOffset","position","scrollPositionChanged","StreamMessageRenderer","_ref17","permanentElementsInDocument","permanentElementInDocument","elementInStream","getPermanentElementMapForFragment","StreamObserver","sources","inspectFetchResponse","fetchResponseFromEvent","fetchResponseIsStream","receiveMessageResponse","receiveMessageEvent","receiveMessageHTML","connectStreamSource","streamSourceIsConnected","disconnectStreamSource","receivedMessageFromStream","ErrorRenderer","_document","replaceChild","replaceHeadAndBody","_document2","newHead","replaceableElement","scriptElements","PageRenderer","HTMLBodyElement","trackedElementsAreIdentical","mergeHead","replaceBody","currentHeadSnapshot","newHeadSnapshot","mergedHeadElements","mergeProvisionalElements","newStylesheetElements","copyNewHeadStylesheetElements","copyNewHeadScriptElements","activateNewBody","assignNewBody","loadingElements","newHeadStylesheetElements","newHeadScriptElements","newHeadElements","newHeadProvisionalElements","currentHeadProvisionalElements","isCurrentElementInElementList","elementList","_ref18","_ref19","splice","isEqualNode","removeCurrentHeadProvisionalElements","copyNewHeadProvisionalElements","adoptNode","activateNewBodyScriptElements","newBodyScriptElements","SnapshotCache","snapshots","touch","unshift","PageView","snapshotCache","viewWillCacheSnapshot","cachedSnapshot","Preloader","preloadURL","extendURLWithDeprecatedProperties","deprecatedLocationPropertyDescriptors","absoluteURL","StreamActions","after","targetElements","templateContent","nextSibling","removeDuplicateTargetChildren","before","prepend","targetElement","preloader","pageObserver","cacheObserver","linkClickObserver","scrollObserver","streamObserver","formLinkClickObserver","frameRedirector","streamMessageRenderer","drive","enabled","formMode","registerAdapter","renderStreamMessage","clearCache","setProgressBarDelay","delay","setFormMode","applicationAllowsFollowingLinkToLocation","getActionForLink","applicationAllowsVisitingLocation","notifyApplicationAfterVisitingLocation","notifyApplicationAfterPageLoad","notifyApplicationAfterVisitingSamePageLocation","notifyApplicationBeforeCachingSnapshot","_ref20","notifyApplicationBeforeRender","_snapshot","_isPreview","notifyApplicationAfterRender","frameLoaded","notifyApplicationAfterFrameLoad","frameRendered","notifyApplicationAfterFrameRender","ev","notifyApplicationAfterClickingLinkToLocation","notifyApplicationBeforeVisitingLocation","newBody","timing","HashChangeEvent","submitterIsNavigatable","container","withinFrame","cache","resetCacheControl","setCacheControl","exemptPageFromCache","exemptPageFromPreview","setMetaContent","navigator$1","Turbo","freeze","setConfirmMethod","TurboFrameMissingError","getFrameElementById","activateElement","currentURL","StreamElement","performAction","beforeRenderEvent","duplicateChildren","existingChildren","flatMap","newChildrenIds","includes","actionFunction","targetElementsById","targetElementsByQuery","HTMLTemplateElement","description","newStream","StreamSourceElement","streamSource","WebSocket","EventSource","consumer","getConsumer","setConsumer","createConsumer","newConsumer","walk","RegExp","acc","ownKeys","_objectSpread","_defineProperty","getOwnPropertyDescriptors","arg","hint","prim","toPrimitive","res","_toPrimitive","_toPropertyKey","writable","fetchResponseLoaded","_fetchResponse","currentFetchRequest","resolveVisitPromise","connected","hasBeenLoaded","ignoredAttributes","_ref21","previousFrameElement","replaceChildren","appearanceObserver","loadingStyle","loadSourceURL","isIgnoringChangesTo","ignoringChangesToAttribute","sourceURL","loadFrameResponse","handleUnvisitableFrameResponse","proposeVisitIfNavigatedWithAction","shouldInterceptNavigation","navigateFrame","currentNavigationElement","_ref22","_ref23","_ref24","newFrame","_newElement","newFrameElement","extractForeignFrameElement","willHandleFrameMissingFromResponse","handleFrameMissingFromResponse","withCurrentNavigationElement","pageSnapshot","visitResponse","Response","throwFrameMissingError","wrapped","CSS","escape","formActionIsVisitable","define","currentScript","subscription","channel","mixin","subscriptions","subscribeTo","received","dispatchMessageEvent","subscriptionConnected","disconnected","subscriptionDisconnected","unsubscribe","MessageEvent","signed_stream_name","dataset","isBodyInit","formMethod","HTMLButtonElement","HTMLInputElement","determineFormMethod","overrideMethod","determineFetchMethod","logicalName","identifierForContextKey","definitionForModuleAndIdentifier","definitionForModuleWithContextAndKey","definitionsFromContext"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GAKAK,EAAI,EAAGC,EAAW,GACpCD,EAAIF,EAASI,OAAQF,IACzBH,EAAUC,EAASE,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBV,IAAYU,EAAgBV,IACpFI,EAASO,KAAKD,EAAgBV,GAAS,IAExCU,EAAgBV,GAAW,EAE5B,IAAID,KAAYG,EACZI,OAAOC,UAAUC,eAAeC,KAAKP,EAAaH,KACpDa,EAAQb,GAAYG,EAAYH,IAKlC,IAFGc,GAAqBA,EAAoBf,GAEtCM,EAASC,QACdD,EAASU,OAATV,EAGF,CAIA,IAAIW,EAAmB,CAAC,EAKpBL,EAAkB,CACrB,EAAG,GAWJ,SAASM,EAAoBjB,GAG5B,GAAGgB,EAAiBhB,GACnB,OAAOgB,EAAiBhB,GAAUkB,QAGnC,IAAIC,EAASH,EAAiBhB,GAAY,CACzCI,EAAGJ,EACHoB,GAAG,EACHF,QAAS,CAAC,GAUX,OANAL,EAAQb,GAAU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AClC,OAKJ,SAA8CsG,EAAStG,GACrD,IAAIqF,EAcC,SAAiCrF,GACtC,IAAI0mD,GAAe1mD,EAAI6F,MAAM,2CAA6C,IAAI,GAC9E,GAAI6gD,EACF,OAAOA,EAAY1gD,QAAQ,KAAM,KAAKA,QAAQ,MAAO,KAEzD,CAnBmB2gD,CAAwB3mD,GACzC,GAAIqF,EACF,OAGJ,SAA0C7I,EAAQ6I,GAChD,IAAIuK,EAAwBpT,EAAO2d,QACnC,GAAoC,mBAAzBvK,EACT,MAAO,CACLvK,WAAYA,EACZuK,sBAAuBA,EAG7B,CAXWg3C,CAAiCtgD,EAAQtG,GAAMqF,EAE1D,CAVWwhD,CAAqCvgD,EAAStG,EACvD,IAAG2L,QAAO,SAAUjM,GAClB,OAAOA,CACT,GACF,CDEiBonD,CAAuBxgD,KESxCgsB,EAAQ,GAAcjvB,QACtBivB,EAAQ,IAAwBjvB,QAChCivB,EAAQ,G","file":"js/application-5f801f80dd347a371b36.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t};\n\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t1: 0\n \t};\n\n\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"js/\" + ({\"0\":\"actioncable\"}[chunkId]||chunkId) + \"-\" + {\"0\":\"7b473aa7014e593e7e6c\"}[chunkId] + \".chunk.js\"\n \t}\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n \t\t\t// a Promise means \"currently loading\".\n \t\t\tif(installedChunkData) {\n \t\t\t\tpromises.push(installedChunkData[2]);\n \t\t\t} else {\n \t\t\t\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n\n \t\t\t\t// create error before stack unwound to get useful stacktrace later\n \t\t\t\tvar error = new Error();\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n \t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\tdocument.head.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/packs/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 13);\n","var EventListener = /** @class */function () {\n function EventListener(eventTarget, eventName, eventOptions) {\n this.eventTarget = eventTarget;\n this.eventName = eventName;\n this.eventOptions = eventOptions;\n this.unorderedBindings = new Set();\n }\n EventListener.prototype.connect = function () {\n this.eventTarget.addEventListener(this.eventName, this, this.eventOptions);\n };\n EventListener.prototype.disconnect = function () {\n this.eventTarget.removeEventListener(this.eventName, this, this.eventOptions);\n };\n // Binding observer delegate\n /** @hidden */\n EventListener.prototype.bindingConnected = function (binding) {\n this.unorderedBindings.add(binding);\n };\n /** @hidden */\n EventListener.prototype.bindingDisconnected = function (binding) {\n this.unorderedBindings.delete(binding);\n };\n EventListener.prototype.handleEvent = function (event) {\n var extendedEvent = extendEvent(event);\n for (var _i = 0, _a = this.bindings; _i < _a.length; _i++) {\n var binding = _a[_i];\n if (extendedEvent.immediatePropagationStopped) {\n break;\n } else {\n binding.handleEvent(extendedEvent);\n }\n }\n };\n Object.defineProperty(EventListener.prototype, \"bindings\", {\n get: function () {\n return Array.from(this.unorderedBindings).sort(function (left, right) {\n var leftIndex = left.index,\n rightIndex = right.index;\n return leftIndex < rightIndex ? -1 : leftIndex > rightIndex ? 1 : 0;\n });\n },\n enumerable: false,\n configurable: true\n });\n return EventListener;\n}();\nexport { EventListener };\nfunction extendEvent(event) {\n if (\"immediatePropagationStopped\" in event) {\n return event;\n } else {\n var stopImmediatePropagation_1 = event.stopImmediatePropagation;\n return Object.assign(event, {\n immediatePropagationStopped: false,\n stopImmediatePropagation: function () {\n this.immediatePropagationStopped = true;\n stopImmediatePropagation_1.call(this);\n }\n });\n }\n}","import { EventListener } from \"./event_listener\";\nvar Dispatcher = /** @class */function () {\n function Dispatcher(application) {\n this.application = application;\n this.eventListenerMaps = new Map();\n this.started = false;\n }\n Dispatcher.prototype.start = function () {\n if (!this.started) {\n this.started = true;\n this.eventListeners.forEach(function (eventListener) {\n return eventListener.connect();\n });\n }\n };\n Dispatcher.prototype.stop = function () {\n if (this.started) {\n this.started = false;\n this.eventListeners.forEach(function (eventListener) {\n return eventListener.disconnect();\n });\n }\n };\n Object.defineProperty(Dispatcher.prototype, \"eventListeners\", {\n get: function () {\n return Array.from(this.eventListenerMaps.values()).reduce(function (listeners, map) {\n return listeners.concat(Array.from(map.values()));\n }, []);\n },\n enumerable: false,\n configurable: true\n });\n // Binding observer delegate\n /** @hidden */\n Dispatcher.prototype.bindingConnected = function (binding) {\n this.fetchEventListenerForBinding(binding).bindingConnected(binding);\n };\n /** @hidden */\n Dispatcher.prototype.bindingDisconnected = function (binding) {\n this.fetchEventListenerForBinding(binding).bindingDisconnected(binding);\n };\n // Error handling\n Dispatcher.prototype.handleError = function (error, message, detail) {\n if (detail === void 0) {\n detail = {};\n }\n this.application.handleError(error, \"Error \" + message, detail);\n };\n Dispatcher.prototype.fetchEventListenerForBinding = function (binding) {\n var eventTarget = binding.eventTarget,\n eventName = binding.eventName,\n eventOptions = binding.eventOptions;\n return this.fetchEventListener(eventTarget, eventName, eventOptions);\n };\n Dispatcher.prototype.fetchEventListener = function (eventTarget, eventName, eventOptions) {\n var eventListenerMap = this.fetchEventListenerMapForEventTarget(eventTarget);\n var cacheKey = this.cacheKey(eventName, eventOptions);\n var eventListener = eventListenerMap.get(cacheKey);\n if (!eventListener) {\n eventListener = this.createEventListener(eventTarget, eventName, eventOptions);\n eventListenerMap.set(cacheKey, eventListener);\n }\n return eventListener;\n };\n Dispatcher.prototype.createEventListener = function (eventTarget, eventName, eventOptions) {\n var eventListener = new EventListener(eventTarget, eventName, eventOptions);\n if (this.started) {\n eventListener.connect();\n }\n return eventListener;\n };\n Dispatcher.prototype.fetchEventListenerMapForEventTarget = function (eventTarget) {\n var eventListenerMap = this.eventListenerMaps.get(eventTarget);\n if (!eventListenerMap) {\n eventListenerMap = new Map();\n this.eventListenerMaps.set(eventTarget, eventListenerMap);\n }\n return eventListenerMap;\n };\n Dispatcher.prototype.cacheKey = function (eventName, eventOptions) {\n var parts = [eventName];\n Object.keys(eventOptions).sort().forEach(function (key) {\n parts.push(\"\" + (eventOptions[key] ? \"\" : \"!\") + key);\n });\n return parts.join(\":\");\n };\n return Dispatcher;\n}();\nexport { Dispatcher };","// capture nos.: 12 23 4 43 1 5 56 7 768 9 98\nvar descriptorPattern = /^((.+?)(@(window|document))?->)?(.+?)(#([^:]+?))(:(.+))?$/;\nexport function parseActionDescriptorString(descriptorString) {\n var source = descriptorString.trim();\n var matches = source.match(descriptorPattern) || [];\n return {\n eventTarget: parseEventTarget(matches[4]),\n eventName: matches[2],\n eventOptions: matches[9] ? parseEventOptions(matches[9]) : {},\n identifier: matches[5],\n methodName: matches[7]\n };\n}\nfunction parseEventTarget(eventTargetName) {\n if (eventTargetName == \"window\") {\n return window;\n } else if (eventTargetName == \"document\") {\n return document;\n }\n}\nfunction parseEventOptions(eventOptions) {\n return eventOptions.split(\":\").reduce(function (options, token) {\n var _a;\n return Object.assign(options, (_a = {}, _a[token.replace(/^!/, \"\")] = !/^!/.test(token), _a));\n }, {});\n}\nexport function stringifyEventTarget(eventTarget) {\n if (eventTarget == window) {\n return \"window\";\n } else if (eventTarget == document) {\n return \"document\";\n }\n}","import { parseActionDescriptorString, stringifyEventTarget } from \"./action_descriptor\";\nvar Action = /** @class */function () {\n function Action(element, index, descriptor) {\n this.element = element;\n this.index = index;\n this.eventTarget = descriptor.eventTarget || element;\n this.eventName = descriptor.eventName || getDefaultEventNameForElement(element) || error(\"missing event name\");\n this.eventOptions = descriptor.eventOptions || {};\n this.identifier = descriptor.identifier || error(\"missing identifier\");\n this.methodName = descriptor.methodName || error(\"missing method name\");\n }\n Action.forToken = function (token) {\n return new this(token.element, token.index, parseActionDescriptorString(token.content));\n };\n Action.prototype.toString = function () {\n var eventNameSuffix = this.eventTargetName ? \"@\" + this.eventTargetName : \"\";\n return \"\" + this.eventName + eventNameSuffix + \"->\" + this.identifier + \"#\" + this.methodName;\n };\n Object.defineProperty(Action.prototype, \"eventTargetName\", {\n get: function () {\n return stringifyEventTarget(this.eventTarget);\n },\n enumerable: false,\n configurable: true\n });\n return Action;\n}();\nexport { Action };\nvar defaultEventNames = {\n \"a\": function (e) {\n return \"click\";\n },\n \"button\": function (e) {\n return \"click\";\n },\n \"form\": function (e) {\n return \"submit\";\n },\n \"input\": function (e) {\n return e.getAttribute(\"type\") == \"submit\" ? \"click\" : \"input\";\n },\n \"select\": function (e) {\n return \"change\";\n },\n \"textarea\": function (e) {\n return \"input\";\n }\n};\nexport function getDefaultEventNameForElement(element) {\n var tagName = element.tagName.toLowerCase();\n if (tagName in defaultEventNames) {\n return defaultEventNames[tagName](element);\n }\n}\nfunction error(message) {\n throw new Error(message);\n}","var Binding = /** @class */function () {\n function Binding(context, action) {\n this.context = context;\n this.action = action;\n }\n Object.defineProperty(Binding.prototype, \"index\", {\n get: function () {\n return this.action.index;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Binding.prototype, \"eventTarget\", {\n get: function () {\n return this.action.eventTarget;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Binding.prototype, \"eventOptions\", {\n get: function () {\n return this.action.eventOptions;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Binding.prototype, \"identifier\", {\n get: function () {\n return this.context.identifier;\n },\n enumerable: false,\n configurable: true\n });\n Binding.prototype.handleEvent = function (event) {\n if (this.willBeInvokedByEvent(event)) {\n this.invokeWithEvent(event);\n }\n };\n Object.defineProperty(Binding.prototype, \"eventName\", {\n get: function () {\n return this.action.eventName;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Binding.prototype, \"method\", {\n get: function () {\n var method = this.controller[this.methodName];\n if (typeof method == \"function\") {\n return method;\n }\n throw new Error(\"Action \\\"\" + this.action + \"\\\" references undefined method \\\"\" + this.methodName + \"\\\"\");\n },\n enumerable: false,\n configurable: true\n });\n Binding.prototype.invokeWithEvent = function (event) {\n try {\n this.method.call(this.controller, event);\n } catch (error) {\n var _a = this,\n identifier = _a.identifier,\n controller = _a.controller,\n element = _a.element,\n index = _a.index;\n var detail = {\n identifier: identifier,\n controller: controller,\n element: element,\n index: index,\n event: event\n };\n this.context.handleError(error, \"invoking action \\\"\" + this.action + \"\\\"\", detail);\n }\n };\n Binding.prototype.willBeInvokedByEvent = function (event) {\n var eventTarget = event.target;\n if (this.element === eventTarget) {\n return true;\n } else if (eventTarget instanceof Element && this.element.contains(eventTarget)) {\n return this.scope.containsElement(eventTarget);\n } else {\n return this.scope.containsElement(this.action.element);\n }\n };\n Object.defineProperty(Binding.prototype, \"controller\", {\n get: function () {\n return this.context.controller;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Binding.prototype, \"methodName\", {\n get: function () {\n return this.action.methodName;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Binding.prototype, \"element\", {\n get: function () {\n return this.scope.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Binding.prototype, \"scope\", {\n get: function () {\n return this.context.scope;\n },\n enumerable: false,\n configurable: true\n });\n return Binding;\n}();\nexport { Binding };","var ElementObserver = /** @class */function () {\n function ElementObserver(element, delegate) {\n var _this = this;\n this.element = element;\n this.started = false;\n this.delegate = delegate;\n this.elements = new Set();\n this.mutationObserver = new MutationObserver(function (mutations) {\n return _this.processMutations(mutations);\n });\n }\n ElementObserver.prototype.start = function () {\n if (!this.started) {\n this.started = true;\n this.mutationObserver.observe(this.element, {\n attributes: true,\n childList: true,\n subtree: true\n });\n this.refresh();\n }\n };\n ElementObserver.prototype.stop = function () {\n if (this.started) {\n this.mutationObserver.takeRecords();\n this.mutationObserver.disconnect();\n this.started = false;\n }\n };\n ElementObserver.prototype.refresh = function () {\n if (this.started) {\n var matches = new Set(this.matchElementsInTree());\n for (var _i = 0, _a = Array.from(this.elements); _i < _a.length; _i++) {\n var element = _a[_i];\n if (!matches.has(element)) {\n this.removeElement(element);\n }\n }\n for (var _b = 0, _c = Array.from(matches); _b < _c.length; _b++) {\n var element = _c[_b];\n this.addElement(element);\n }\n }\n };\n // Mutation record processing\n ElementObserver.prototype.processMutations = function (mutations) {\n if (this.started) {\n for (var _i = 0, mutations_1 = mutations; _i < mutations_1.length; _i++) {\n var mutation = mutations_1[_i];\n this.processMutation(mutation);\n }\n }\n };\n ElementObserver.prototype.processMutation = function (mutation) {\n if (mutation.type == \"attributes\") {\n this.processAttributeChange(mutation.target, mutation.attributeName);\n } else if (mutation.type == \"childList\") {\n this.processRemovedNodes(mutation.removedNodes);\n this.processAddedNodes(mutation.addedNodes);\n }\n };\n ElementObserver.prototype.processAttributeChange = function (node, attributeName) {\n var element = node;\n if (this.elements.has(element)) {\n if (this.delegate.elementAttributeChanged && this.matchElement(element)) {\n this.delegate.elementAttributeChanged(element, attributeName);\n } else {\n this.removeElement(element);\n }\n } else if (this.matchElement(element)) {\n this.addElement(element);\n }\n };\n ElementObserver.prototype.processRemovedNodes = function (nodes) {\n for (var _i = 0, _a = Array.from(nodes); _i < _a.length; _i++) {\n var node = _a[_i];\n var element = this.elementFromNode(node);\n if (element) {\n this.processTree(element, this.removeElement);\n }\n }\n };\n ElementObserver.prototype.processAddedNodes = function (nodes) {\n for (var _i = 0, _a = Array.from(nodes); _i < _a.length; _i++) {\n var node = _a[_i];\n var element = this.elementFromNode(node);\n if (element && this.elementIsActive(element)) {\n this.processTree(element, this.addElement);\n }\n }\n };\n // Element matching\n ElementObserver.prototype.matchElement = function (element) {\n return this.delegate.matchElement(element);\n };\n ElementObserver.prototype.matchElementsInTree = function (tree) {\n if (tree === void 0) {\n tree = this.element;\n }\n return this.delegate.matchElementsInTree(tree);\n };\n ElementObserver.prototype.processTree = function (tree, processor) {\n for (var _i = 0, _a = this.matchElementsInTree(tree); _i < _a.length; _i++) {\n var element = _a[_i];\n processor.call(this, element);\n }\n };\n ElementObserver.prototype.elementFromNode = function (node) {\n if (node.nodeType == Node.ELEMENT_NODE) {\n return node;\n }\n };\n ElementObserver.prototype.elementIsActive = function (element) {\n if (element.isConnected != this.element.isConnected) {\n return false;\n } else {\n return this.element.contains(element);\n }\n };\n // Element tracking\n ElementObserver.prototype.addElement = function (element) {\n if (!this.elements.has(element)) {\n if (this.elementIsActive(element)) {\n this.elements.add(element);\n if (this.delegate.elementMatched) {\n this.delegate.elementMatched(element);\n }\n }\n }\n };\n ElementObserver.prototype.removeElement = function (element) {\n if (this.elements.has(element)) {\n this.elements.delete(element);\n if (this.delegate.elementUnmatched) {\n this.delegate.elementUnmatched(element);\n }\n }\n };\n return ElementObserver;\n}();\nexport { ElementObserver };","import { ElementObserver } from \"./element_observer\";\nvar AttributeObserver = /** @class */function () {\n function AttributeObserver(element, attributeName, delegate) {\n this.attributeName = attributeName;\n this.delegate = delegate;\n this.elementObserver = new ElementObserver(element, this);\n }\n Object.defineProperty(AttributeObserver.prototype, \"element\", {\n get: function () {\n return this.elementObserver.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(AttributeObserver.prototype, \"selector\", {\n get: function () {\n return \"[\" + this.attributeName + \"]\";\n },\n enumerable: false,\n configurable: true\n });\n AttributeObserver.prototype.start = function () {\n this.elementObserver.start();\n };\n AttributeObserver.prototype.stop = function () {\n this.elementObserver.stop();\n };\n AttributeObserver.prototype.refresh = function () {\n this.elementObserver.refresh();\n };\n Object.defineProperty(AttributeObserver.prototype, \"started\", {\n get: function () {\n return this.elementObserver.started;\n },\n enumerable: false,\n configurable: true\n });\n // Element observer delegate\n AttributeObserver.prototype.matchElement = function (element) {\n return element.hasAttribute(this.attributeName);\n };\n AttributeObserver.prototype.matchElementsInTree = function (tree) {\n var match = this.matchElement(tree) ? [tree] : [];\n var matches = Array.from(tree.querySelectorAll(this.selector));\n return match.concat(matches);\n };\n AttributeObserver.prototype.elementMatched = function (element) {\n if (this.delegate.elementMatchedAttribute) {\n this.delegate.elementMatchedAttribute(element, this.attributeName);\n }\n };\n AttributeObserver.prototype.elementUnmatched = function (element) {\n if (this.delegate.elementUnmatchedAttribute) {\n this.delegate.elementUnmatchedAttribute(element, this.attributeName);\n }\n };\n AttributeObserver.prototype.elementAttributeChanged = function (element, attributeName) {\n if (this.delegate.elementAttributeValueChanged && this.attributeName == attributeName) {\n this.delegate.elementAttributeValueChanged(element, attributeName);\n }\n };\n return AttributeObserver;\n}();\nexport { AttributeObserver };","var StringMapObserver = /** @class */function () {\n function StringMapObserver(element, delegate) {\n var _this = this;\n this.element = element;\n this.delegate = delegate;\n this.started = false;\n this.stringMap = new Map();\n this.mutationObserver = new MutationObserver(function (mutations) {\n return _this.processMutations(mutations);\n });\n }\n StringMapObserver.prototype.start = function () {\n if (!this.started) {\n this.started = true;\n this.mutationObserver.observe(this.element, {\n attributes: true\n });\n this.refresh();\n }\n };\n StringMapObserver.prototype.stop = function () {\n if (this.started) {\n this.mutationObserver.takeRecords();\n this.mutationObserver.disconnect();\n this.started = false;\n }\n };\n StringMapObserver.prototype.refresh = function () {\n if (this.started) {\n for (var _i = 0, _a = this.knownAttributeNames; _i < _a.length; _i++) {\n var attributeName = _a[_i];\n this.refreshAttribute(attributeName);\n }\n }\n };\n // Mutation record processing\n StringMapObserver.prototype.processMutations = function (mutations) {\n if (this.started) {\n for (var _i = 0, mutations_1 = mutations; _i < mutations_1.length; _i++) {\n var mutation = mutations_1[_i];\n this.processMutation(mutation);\n }\n }\n };\n StringMapObserver.prototype.processMutation = function (mutation) {\n var attributeName = mutation.attributeName;\n if (attributeName) {\n this.refreshAttribute(attributeName);\n }\n };\n // State tracking\n StringMapObserver.prototype.refreshAttribute = function (attributeName) {\n var key = this.delegate.getStringMapKeyForAttribute(attributeName);\n if (key != null) {\n if (!this.stringMap.has(attributeName)) {\n this.stringMapKeyAdded(key, attributeName);\n }\n var value = this.element.getAttribute(attributeName);\n if (this.stringMap.get(attributeName) != value) {\n this.stringMapValueChanged(value, key);\n }\n if (value == null) {\n this.stringMap.delete(attributeName);\n this.stringMapKeyRemoved(key, attributeName);\n } else {\n this.stringMap.set(attributeName, value);\n }\n }\n };\n StringMapObserver.prototype.stringMapKeyAdded = function (key, attributeName) {\n if (this.delegate.stringMapKeyAdded) {\n this.delegate.stringMapKeyAdded(key, attributeName);\n }\n };\n StringMapObserver.prototype.stringMapValueChanged = function (value, key) {\n if (this.delegate.stringMapValueChanged) {\n this.delegate.stringMapValueChanged(value, key);\n }\n };\n StringMapObserver.prototype.stringMapKeyRemoved = function (key, attributeName) {\n if (this.delegate.stringMapKeyRemoved) {\n this.delegate.stringMapKeyRemoved(key, attributeName);\n }\n };\n Object.defineProperty(StringMapObserver.prototype, \"knownAttributeNames\", {\n get: function () {\n return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)));\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StringMapObserver.prototype, \"currentAttributeNames\", {\n get: function () {\n return Array.from(this.element.attributes).map(function (attribute) {\n return attribute.name;\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StringMapObserver.prototype, \"recordedAttributeNames\", {\n get: function () {\n return Array.from(this.stringMap.keys());\n },\n enumerable: false,\n configurable: true\n });\n return StringMapObserver;\n}();\nexport { StringMapObserver };","export function add(map, key, value) {\n fetch(map, key).add(value);\n}\nexport function del(map, key, value) {\n fetch(map, key).delete(value);\n prune(map, key);\n}\nexport function fetch(map, key) {\n var values = map.get(key);\n if (!values) {\n values = new Set();\n map.set(key, values);\n }\n return values;\n}\nexport function prune(map, key) {\n var values = map.get(key);\n if (values != null && values.size == 0) {\n map.delete(key);\n }\n}","import { add, del } from \"./set_operations\";\nvar Multimap = /** @class */function () {\n function Multimap() {\n this.valuesByKey = new Map();\n }\n Object.defineProperty(Multimap.prototype, \"values\", {\n get: function () {\n var sets = Array.from(this.valuesByKey.values());\n return sets.reduce(function (values, set) {\n return values.concat(Array.from(set));\n }, []);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Multimap.prototype, \"size\", {\n get: function () {\n var sets = Array.from(this.valuesByKey.values());\n return sets.reduce(function (size, set) {\n return size + set.size;\n }, 0);\n },\n enumerable: false,\n configurable: true\n });\n Multimap.prototype.add = function (key, value) {\n add(this.valuesByKey, key, value);\n };\n Multimap.prototype.delete = function (key, value) {\n del(this.valuesByKey, key, value);\n };\n Multimap.prototype.has = function (key, value) {\n var values = this.valuesByKey.get(key);\n return values != null && values.has(value);\n };\n Multimap.prototype.hasKey = function (key) {\n return this.valuesByKey.has(key);\n };\n Multimap.prototype.hasValue = function (value) {\n var sets = Array.from(this.valuesByKey.values());\n return sets.some(function (set) {\n return set.has(value);\n });\n };\n Multimap.prototype.getValuesForKey = function (key) {\n var values = this.valuesByKey.get(key);\n return values ? Array.from(values) : [];\n };\n Multimap.prototype.getKeysForValue = function (value) {\n return Array.from(this.valuesByKey).filter(function (_a) {\n var key = _a[0],\n values = _a[1];\n return values.has(value);\n }).map(function (_a) {\n var key = _a[0],\n values = _a[1];\n return key;\n });\n };\n return Multimap;\n}();\nexport { Multimap };","var __extends = this && this.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\nimport { Multimap } from \"./multimap\";\nimport { add, del } from \"./set_operations\";\nvar IndexedMultimap = /** @class */function (_super) {\n __extends(IndexedMultimap, _super);\n function IndexedMultimap() {\n var _this = _super.call(this) || this;\n _this.keysByValue = new Map();\n return _this;\n }\n Object.defineProperty(IndexedMultimap.prototype, \"values\", {\n get: function () {\n return Array.from(this.keysByValue.keys());\n },\n enumerable: false,\n configurable: true\n });\n IndexedMultimap.prototype.add = function (key, value) {\n _super.prototype.add.call(this, key, value);\n add(this.keysByValue, value, key);\n };\n IndexedMultimap.prototype.delete = function (key, value) {\n _super.prototype.delete.call(this, key, value);\n del(this.keysByValue, value, key);\n };\n IndexedMultimap.prototype.hasValue = function (value) {\n return this.keysByValue.has(value);\n };\n IndexedMultimap.prototype.getKeysForValue = function (value) {\n var set = this.keysByValue.get(value);\n return set ? Array.from(set) : [];\n };\n return IndexedMultimap;\n}(Multimap);\nexport { IndexedMultimap };","import { AttributeObserver } from \"./attribute_observer\";\nimport { Multimap } from \"@stimulus/multimap\";\nvar TokenListObserver = /** @class */function () {\n function TokenListObserver(element, attributeName, delegate) {\n this.attributeObserver = new AttributeObserver(element, attributeName, this);\n this.delegate = delegate;\n this.tokensByElement = new Multimap();\n }\n Object.defineProperty(TokenListObserver.prototype, \"started\", {\n get: function () {\n return this.attributeObserver.started;\n },\n enumerable: false,\n configurable: true\n });\n TokenListObserver.prototype.start = function () {\n this.attributeObserver.start();\n };\n TokenListObserver.prototype.stop = function () {\n this.attributeObserver.stop();\n };\n TokenListObserver.prototype.refresh = function () {\n this.attributeObserver.refresh();\n };\n Object.defineProperty(TokenListObserver.prototype, \"element\", {\n get: function () {\n return this.attributeObserver.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TokenListObserver.prototype, \"attributeName\", {\n get: function () {\n return this.attributeObserver.attributeName;\n },\n enumerable: false,\n configurable: true\n });\n // Attribute observer delegate\n TokenListObserver.prototype.elementMatchedAttribute = function (element) {\n this.tokensMatched(this.readTokensForElement(element));\n };\n TokenListObserver.prototype.elementAttributeValueChanged = function (element) {\n var _a = this.refreshTokensForElement(element),\n unmatchedTokens = _a[0],\n matchedTokens = _a[1];\n this.tokensUnmatched(unmatchedTokens);\n this.tokensMatched(matchedTokens);\n };\n TokenListObserver.prototype.elementUnmatchedAttribute = function (element) {\n this.tokensUnmatched(this.tokensByElement.getValuesForKey(element));\n };\n TokenListObserver.prototype.tokensMatched = function (tokens) {\n var _this = this;\n tokens.forEach(function (token) {\n return _this.tokenMatched(token);\n });\n };\n TokenListObserver.prototype.tokensUnmatched = function (tokens) {\n var _this = this;\n tokens.forEach(function (token) {\n return _this.tokenUnmatched(token);\n });\n };\n TokenListObserver.prototype.tokenMatched = function (token) {\n this.delegate.tokenMatched(token);\n this.tokensByElement.add(token.element, token);\n };\n TokenListObserver.prototype.tokenUnmatched = function (token) {\n this.delegate.tokenUnmatched(token);\n this.tokensByElement.delete(token.element, token);\n };\n TokenListObserver.prototype.refreshTokensForElement = function (element) {\n var previousTokens = this.tokensByElement.getValuesForKey(element);\n var currentTokens = this.readTokensForElement(element);\n var firstDifferingIndex = zip(previousTokens, currentTokens).findIndex(function (_a) {\n var previousToken = _a[0],\n currentToken = _a[1];\n return !tokensAreEqual(previousToken, currentToken);\n });\n if (firstDifferingIndex == -1) {\n return [[], []];\n } else {\n return [previousTokens.slice(firstDifferingIndex), currentTokens.slice(firstDifferingIndex)];\n }\n };\n TokenListObserver.prototype.readTokensForElement = function (element) {\n var attributeName = this.attributeName;\n var tokenString = element.getAttribute(attributeName) || \"\";\n return parseTokenString(tokenString, element, attributeName);\n };\n return TokenListObserver;\n}();\nexport { TokenListObserver };\nfunction parseTokenString(tokenString, element, attributeName) {\n return tokenString.trim().split(/\\s+/).filter(function (content) {\n return content.length;\n }).map(function (content, index) {\n return {\n element: element,\n attributeName: attributeName,\n content: content,\n index: index\n };\n });\n}\nfunction zip(left, right) {\n var length = Math.max(left.length, right.length);\n return Array.from({\n length: length\n }, function (_, index) {\n return [left[index], right[index]];\n });\n}\nfunction tokensAreEqual(left, right) {\n return left && right && left.index == right.index && left.content == right.content;\n}","import { TokenListObserver } from \"./token_list_observer\";\nvar ValueListObserver = /** @class */function () {\n function ValueListObserver(element, attributeName, delegate) {\n this.tokenListObserver = new TokenListObserver(element, attributeName, this);\n this.delegate = delegate;\n this.parseResultsByToken = new WeakMap();\n this.valuesByTokenByElement = new WeakMap();\n }\n Object.defineProperty(ValueListObserver.prototype, \"started\", {\n get: function () {\n return this.tokenListObserver.started;\n },\n enumerable: false,\n configurable: true\n });\n ValueListObserver.prototype.start = function () {\n this.tokenListObserver.start();\n };\n ValueListObserver.prototype.stop = function () {\n this.tokenListObserver.stop();\n };\n ValueListObserver.prototype.refresh = function () {\n this.tokenListObserver.refresh();\n };\n Object.defineProperty(ValueListObserver.prototype, \"element\", {\n get: function () {\n return this.tokenListObserver.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ValueListObserver.prototype, \"attributeName\", {\n get: function () {\n return this.tokenListObserver.attributeName;\n },\n enumerable: false,\n configurable: true\n });\n ValueListObserver.prototype.tokenMatched = function (token) {\n var element = token.element;\n var value = this.fetchParseResultForToken(token).value;\n if (value) {\n this.fetchValuesByTokenForElement(element).set(token, value);\n this.delegate.elementMatchedValue(element, value);\n }\n };\n ValueListObserver.prototype.tokenUnmatched = function (token) {\n var element = token.element;\n var value = this.fetchParseResultForToken(token).value;\n if (value) {\n this.fetchValuesByTokenForElement(element).delete(token);\n this.delegate.elementUnmatchedValue(element, value);\n }\n };\n ValueListObserver.prototype.fetchParseResultForToken = function (token) {\n var parseResult = this.parseResultsByToken.get(token);\n if (!parseResult) {\n parseResult = this.parseToken(token);\n this.parseResultsByToken.set(token, parseResult);\n }\n return parseResult;\n };\n ValueListObserver.prototype.fetchValuesByTokenForElement = function (element) {\n var valuesByToken = this.valuesByTokenByElement.get(element);\n if (!valuesByToken) {\n valuesByToken = new Map();\n this.valuesByTokenByElement.set(element, valuesByToken);\n }\n return valuesByToken;\n };\n ValueListObserver.prototype.parseToken = function (token) {\n try {\n var value = this.delegate.parseValueForToken(token);\n return {\n value: value\n };\n } catch (error) {\n return {\n error: error\n };\n }\n };\n return ValueListObserver;\n}();\nexport { ValueListObserver };","import { Action } from \"./action\";\nimport { Binding } from \"./binding\";\nimport { ValueListObserver } from \"@stimulus/mutation-observers\";\nvar BindingObserver = /** @class */function () {\n function BindingObserver(context, delegate) {\n this.context = context;\n this.delegate = delegate;\n this.bindingsByAction = new Map();\n }\n BindingObserver.prototype.start = function () {\n if (!this.valueListObserver) {\n this.valueListObserver = new ValueListObserver(this.element, this.actionAttribute, this);\n this.valueListObserver.start();\n }\n };\n BindingObserver.prototype.stop = function () {\n if (this.valueListObserver) {\n this.valueListObserver.stop();\n delete this.valueListObserver;\n this.disconnectAllActions();\n }\n };\n Object.defineProperty(BindingObserver.prototype, \"element\", {\n get: function () {\n return this.context.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BindingObserver.prototype, \"identifier\", {\n get: function () {\n return this.context.identifier;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BindingObserver.prototype, \"actionAttribute\", {\n get: function () {\n return this.schema.actionAttribute;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BindingObserver.prototype, \"schema\", {\n get: function () {\n return this.context.schema;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BindingObserver.prototype, \"bindings\", {\n get: function () {\n return Array.from(this.bindingsByAction.values());\n },\n enumerable: false,\n configurable: true\n });\n BindingObserver.prototype.connectAction = function (action) {\n var binding = new Binding(this.context, action);\n this.bindingsByAction.set(action, binding);\n this.delegate.bindingConnected(binding);\n };\n BindingObserver.prototype.disconnectAction = function (action) {\n var binding = this.bindingsByAction.get(action);\n if (binding) {\n this.bindingsByAction.delete(action);\n this.delegate.bindingDisconnected(binding);\n }\n };\n BindingObserver.prototype.disconnectAllActions = function () {\n var _this = this;\n this.bindings.forEach(function (binding) {\n return _this.delegate.bindingDisconnected(binding);\n });\n this.bindingsByAction.clear();\n };\n // Value observer delegate\n BindingObserver.prototype.parseValueForToken = function (token) {\n var action = Action.forToken(token);\n if (action.identifier == this.identifier) {\n return action;\n }\n };\n BindingObserver.prototype.elementMatchedValue = function (element, action) {\n this.connectAction(action);\n };\n BindingObserver.prototype.elementUnmatchedValue = function (element, action) {\n this.disconnectAction(action);\n };\n return BindingObserver;\n}();\nexport { BindingObserver };","import { StringMapObserver } from \"@stimulus/mutation-observers\";\nvar ValueObserver = /** @class */function () {\n function ValueObserver(context, receiver) {\n this.context = context;\n this.receiver = receiver;\n this.stringMapObserver = new StringMapObserver(this.element, this);\n this.valueDescriptorMap = this.controller.valueDescriptorMap;\n this.invokeChangedCallbacksForDefaultValues();\n }\n ValueObserver.prototype.start = function () {\n this.stringMapObserver.start();\n };\n ValueObserver.prototype.stop = function () {\n this.stringMapObserver.stop();\n };\n Object.defineProperty(ValueObserver.prototype, \"element\", {\n get: function () {\n return this.context.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(ValueObserver.prototype, \"controller\", {\n get: function () {\n return this.context.controller;\n },\n enumerable: false,\n configurable: true\n });\n // String map observer delegate\n ValueObserver.prototype.getStringMapKeyForAttribute = function (attributeName) {\n if (attributeName in this.valueDescriptorMap) {\n return this.valueDescriptorMap[attributeName].name;\n }\n };\n ValueObserver.prototype.stringMapValueChanged = function (attributeValue, name) {\n this.invokeChangedCallbackForValue(name);\n };\n ValueObserver.prototype.invokeChangedCallbacksForDefaultValues = function () {\n for (var _i = 0, _a = this.valueDescriptors; _i < _a.length; _i++) {\n var _b = _a[_i],\n key = _b.key,\n name_1 = _b.name,\n defaultValue = _b.defaultValue;\n if (defaultValue != undefined && !this.controller.data.has(key)) {\n this.invokeChangedCallbackForValue(name_1);\n }\n }\n };\n ValueObserver.prototype.invokeChangedCallbackForValue = function (name) {\n var methodName = name + \"Changed\";\n var method = this.receiver[methodName];\n if (typeof method == \"function\") {\n var value = this.receiver[name];\n method.call(this.receiver, value);\n }\n };\n Object.defineProperty(ValueObserver.prototype, \"valueDescriptors\", {\n get: function () {\n var valueDescriptorMap = this.valueDescriptorMap;\n return Object.keys(valueDescriptorMap).map(function (key) {\n return valueDescriptorMap[key];\n });\n },\n enumerable: false,\n configurable: true\n });\n return ValueObserver;\n}();\nexport { ValueObserver };","import { BindingObserver } from \"./binding_observer\";\nimport { ValueObserver } from \"./value_observer\";\nvar Context = /** @class */function () {\n function Context(module, scope) {\n this.module = module;\n this.scope = scope;\n this.controller = new module.controllerConstructor(this);\n this.bindingObserver = new BindingObserver(this, this.dispatcher);\n this.valueObserver = new ValueObserver(this, this.controller);\n try {\n this.controller.initialize();\n } catch (error) {\n this.handleError(error, \"initializing controller\");\n }\n }\n Context.prototype.connect = function () {\n this.bindingObserver.start();\n this.valueObserver.start();\n try {\n this.controller.connect();\n } catch (error) {\n this.handleError(error, \"connecting controller\");\n }\n };\n Context.prototype.disconnect = function () {\n try {\n this.controller.disconnect();\n } catch (error) {\n this.handleError(error, \"disconnecting controller\");\n }\n this.valueObserver.stop();\n this.bindingObserver.stop();\n };\n Object.defineProperty(Context.prototype, \"application\", {\n get: function () {\n return this.module.application;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Context.prototype, \"identifier\", {\n get: function () {\n return this.module.identifier;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Context.prototype, \"schema\", {\n get: function () {\n return this.application.schema;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Context.prototype, \"dispatcher\", {\n get: function () {\n return this.application.dispatcher;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Context.prototype, \"element\", {\n get: function () {\n return this.scope.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Context.prototype, \"parentElement\", {\n get: function () {\n return this.element.parentElement;\n },\n enumerable: false,\n configurable: true\n });\n // Error handling\n Context.prototype.handleError = function (error, message, detail) {\n if (detail === void 0) {\n detail = {};\n }\n var _a = this,\n identifier = _a.identifier,\n controller = _a.controller,\n element = _a.element;\n detail = Object.assign({\n identifier: identifier,\n controller: controller,\n element: element\n }, detail);\n this.application.handleError(error, \"Error \" + message, detail);\n };\n return Context;\n}();\nexport { Context };","export function readInheritableStaticArrayValues(constructor, propertyName) {\n var ancestors = getAncestorsForConstructor(constructor);\n return Array.from(ancestors.reduce(function (values, constructor) {\n getOwnStaticArrayValues(constructor, propertyName).forEach(function (name) {\n return values.add(name);\n });\n return values;\n }, new Set()));\n}\nexport function readInheritableStaticObjectPairs(constructor, propertyName) {\n var ancestors = getAncestorsForConstructor(constructor);\n return ancestors.reduce(function (pairs, constructor) {\n pairs.push.apply(pairs, getOwnStaticObjectPairs(constructor, propertyName));\n return pairs;\n }, []);\n}\nfunction getAncestorsForConstructor(constructor) {\n var ancestors = [];\n while (constructor) {\n ancestors.push(constructor);\n constructor = Object.getPrototypeOf(constructor);\n }\n return ancestors.reverse();\n}\nfunction getOwnStaticArrayValues(constructor, propertyName) {\n var definition = constructor[propertyName];\n return Array.isArray(definition) ? definition : [];\n}\nfunction getOwnStaticObjectPairs(constructor, propertyName) {\n var definition = constructor[propertyName];\n return definition ? Object.keys(definition).map(function (key) {\n return [key, definition[key]];\n }) : [];\n}","var __extends = this && this.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\nvar __spreadArrays = this && this.__spreadArrays || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];\n return r;\n};\nimport { readInheritableStaticArrayValues } from \"./inheritable_statics\";\n/** @hidden */\nexport function bless(constructor) {\n return shadow(constructor, getBlessedProperties(constructor));\n}\nfunction shadow(constructor, properties) {\n var shadowConstructor = extend(constructor);\n var shadowProperties = getShadowProperties(constructor.prototype, properties);\n Object.defineProperties(shadowConstructor.prototype, shadowProperties);\n return shadowConstructor;\n}\nfunction getBlessedProperties(constructor) {\n var blessings = readInheritableStaticArrayValues(constructor, \"blessings\");\n return blessings.reduce(function (blessedProperties, blessing) {\n var properties = blessing(constructor);\n for (var key in properties) {\n var descriptor = blessedProperties[key] || {};\n blessedProperties[key] = Object.assign(descriptor, properties[key]);\n }\n return blessedProperties;\n }, {});\n}\nfunction getShadowProperties(prototype, properties) {\n return getOwnKeys(properties).reduce(function (shadowProperties, key) {\n var _a;\n var descriptor = getShadowedDescriptor(prototype, properties, key);\n if (descriptor) {\n Object.assign(shadowProperties, (_a = {}, _a[key] = descriptor, _a));\n }\n return shadowProperties;\n }, {});\n}\nfunction getShadowedDescriptor(prototype, properties, key) {\n var shadowingDescriptor = Object.getOwnPropertyDescriptor(prototype, key);\n var shadowedByValue = shadowingDescriptor && \"value\" in shadowingDescriptor;\n if (!shadowedByValue) {\n var descriptor = Object.getOwnPropertyDescriptor(properties, key).value;\n if (shadowingDescriptor) {\n descriptor.get = shadowingDescriptor.get || descriptor.get;\n descriptor.set = shadowingDescriptor.set || descriptor.set;\n }\n return descriptor;\n }\n}\nvar getOwnKeys = function () {\n if (typeof Object.getOwnPropertySymbols == \"function\") {\n return function (object) {\n return __spreadArrays(Object.getOwnPropertyNames(object), Object.getOwnPropertySymbols(object));\n };\n } else {\n return Object.getOwnPropertyNames;\n }\n}();\nvar extend = function () {\n function extendWithReflect(constructor) {\n function extended() {\n var _newTarget = this && this instanceof extended ? this.constructor : void 0;\n return Reflect.construct(constructor, arguments, _newTarget);\n }\n extended.prototype = Object.create(constructor.prototype, {\n constructor: {\n value: extended\n }\n });\n Reflect.setPrototypeOf(extended, constructor);\n return extended;\n }\n function testReflectExtension() {\n var a = function () {\n this.a.call(this);\n };\n var b = extendWithReflect(a);\n b.prototype.a = function () {};\n return new b();\n }\n try {\n testReflectExtension();\n return extendWithReflect;\n } catch (error) {\n return function (constructor) {\n return (/** @class */function (_super) {\n __extends(extended, _super);\n function extended() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return extended;\n }(constructor)\n );\n };\n }\n}();","import { Context } from \"./context\";\nimport { blessDefinition } from \"./definition\";\nvar Module = /** @class */function () {\n function Module(application, definition) {\n this.application = application;\n this.definition = blessDefinition(definition);\n this.contextsByScope = new WeakMap();\n this.connectedContexts = new Set();\n }\n Object.defineProperty(Module.prototype, \"identifier\", {\n get: function () {\n return this.definition.identifier;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Module.prototype, \"controllerConstructor\", {\n get: function () {\n return this.definition.controllerConstructor;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Module.prototype, \"contexts\", {\n get: function () {\n return Array.from(this.connectedContexts);\n },\n enumerable: false,\n configurable: true\n });\n Module.prototype.connectContextForScope = function (scope) {\n var context = this.fetchContextForScope(scope);\n this.connectedContexts.add(context);\n context.connect();\n };\n Module.prototype.disconnectContextForScope = function (scope) {\n var context = this.contextsByScope.get(scope);\n if (context) {\n this.connectedContexts.delete(context);\n context.disconnect();\n }\n };\n Module.prototype.fetchContextForScope = function (scope) {\n var context = this.contextsByScope.get(scope);\n if (!context) {\n context = new Context(this, scope);\n this.contextsByScope.set(scope, context);\n }\n return context;\n };\n return Module;\n}();\nexport { Module };","import { bless } from \"./blessing\";\n/** @hidden */\nexport function blessDefinition(definition) {\n return {\n identifier: definition.identifier,\n controllerConstructor: bless(definition.controllerConstructor)\n };\n}","var ClassMap = /** @class */function () {\n function ClassMap(scope) {\n this.scope = scope;\n }\n ClassMap.prototype.has = function (name) {\n return this.data.has(this.getDataKey(name));\n };\n ClassMap.prototype.get = function (name) {\n return this.data.get(this.getDataKey(name));\n };\n ClassMap.prototype.getAttributeName = function (name) {\n return this.data.getAttributeNameForKey(this.getDataKey(name));\n };\n ClassMap.prototype.getDataKey = function (name) {\n return name + \"-class\";\n };\n Object.defineProperty(ClassMap.prototype, \"data\", {\n get: function () {\n return this.scope.data;\n },\n enumerable: false,\n configurable: true\n });\n return ClassMap;\n}();\nexport { ClassMap };","export function camelize(value) {\n return value.replace(/(?:[_-])([a-z0-9])/g, function (_, char) {\n return char.toUpperCase();\n });\n}\nexport function capitalize(value) {\n return value.charAt(0).toUpperCase() + value.slice(1);\n}\nexport function dasherize(value) {\n return value.replace(/([A-Z])/g, function (_, char) {\n return \"-\" + char.toLowerCase();\n });\n}","import { dasherize } from \"./string_helpers\";\nvar DataMap = /** @class */function () {\n function DataMap(scope) {\n this.scope = scope;\n }\n Object.defineProperty(DataMap.prototype, \"element\", {\n get: function () {\n return this.scope.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DataMap.prototype, \"identifier\", {\n get: function () {\n return this.scope.identifier;\n },\n enumerable: false,\n configurable: true\n });\n DataMap.prototype.get = function (key) {\n var name = this.getAttributeNameForKey(key);\n return this.element.getAttribute(name);\n };\n DataMap.prototype.set = function (key, value) {\n var name = this.getAttributeNameForKey(key);\n this.element.setAttribute(name, value);\n return this.get(key);\n };\n DataMap.prototype.has = function (key) {\n var name = this.getAttributeNameForKey(key);\n return this.element.hasAttribute(name);\n };\n DataMap.prototype.delete = function (key) {\n if (this.has(key)) {\n var name_1 = this.getAttributeNameForKey(key);\n this.element.removeAttribute(name_1);\n return true;\n } else {\n return false;\n }\n };\n DataMap.prototype.getAttributeNameForKey = function (key) {\n return \"data-\" + this.identifier + \"-\" + dasherize(key);\n };\n return DataMap;\n}();\nexport { DataMap };","var Guide = /** @class */function () {\n function Guide(logger) {\n this.warnedKeysByObject = new WeakMap();\n this.logger = logger;\n }\n Guide.prototype.warn = function (object, key, message) {\n var warnedKeys = this.warnedKeysByObject.get(object);\n if (!warnedKeys) {\n warnedKeys = new Set();\n this.warnedKeysByObject.set(object, warnedKeys);\n }\n if (!warnedKeys.has(key)) {\n warnedKeys.add(key);\n this.logger.warn(message, object);\n }\n };\n return Guide;\n}();\nexport { Guide };","/** @hidden */\nexport function attributeValueContainsToken(attributeName, token) {\n return \"[\" + attributeName + \"~=\\\"\" + token + \"\\\"]\";\n}","var __spreadArrays = this && this.__spreadArrays || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];\n return r;\n};\nimport { attributeValueContainsToken } from \"./selectors\";\nvar TargetSet = /** @class */function () {\n function TargetSet(scope) {\n this.scope = scope;\n }\n Object.defineProperty(TargetSet.prototype, \"element\", {\n get: function () {\n return this.scope.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TargetSet.prototype, \"identifier\", {\n get: function () {\n return this.scope.identifier;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(TargetSet.prototype, \"schema\", {\n get: function () {\n return this.scope.schema;\n },\n enumerable: false,\n configurable: true\n });\n TargetSet.prototype.has = function (targetName) {\n return this.find(targetName) != null;\n };\n TargetSet.prototype.find = function () {\n var _this = this;\n var targetNames = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n targetNames[_i] = arguments[_i];\n }\n return targetNames.reduce(function (target, targetName) {\n return target || _this.findTarget(targetName) || _this.findLegacyTarget(targetName);\n }, undefined);\n };\n TargetSet.prototype.findAll = function () {\n var _this = this;\n var targetNames = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n targetNames[_i] = arguments[_i];\n }\n return targetNames.reduce(function (targets, targetName) {\n return __spreadArrays(targets, _this.findAllTargets(targetName), _this.findAllLegacyTargets(targetName));\n }, []);\n };\n TargetSet.prototype.findTarget = function (targetName) {\n var selector = this.getSelectorForTargetName(targetName);\n return this.scope.findElement(selector);\n };\n TargetSet.prototype.findAllTargets = function (targetName) {\n var selector = this.getSelectorForTargetName(targetName);\n return this.scope.findAllElements(selector);\n };\n TargetSet.prototype.getSelectorForTargetName = function (targetName) {\n var attributeName = \"data-\" + this.identifier + \"-target\";\n return attributeValueContainsToken(attributeName, targetName);\n };\n TargetSet.prototype.findLegacyTarget = function (targetName) {\n var selector = this.getLegacySelectorForTargetName(targetName);\n return this.deprecate(this.scope.findElement(selector), targetName);\n };\n TargetSet.prototype.findAllLegacyTargets = function (targetName) {\n var _this = this;\n var selector = this.getLegacySelectorForTargetName(targetName);\n return this.scope.findAllElements(selector).map(function (element) {\n return _this.deprecate(element, targetName);\n });\n };\n TargetSet.prototype.getLegacySelectorForTargetName = function (targetName) {\n var targetDescriptor = this.identifier + \".\" + targetName;\n return attributeValueContainsToken(this.schema.targetAttribute, targetDescriptor);\n };\n TargetSet.prototype.deprecate = function (element, targetName) {\n if (element) {\n var identifier = this.identifier;\n var attributeName = this.schema.targetAttribute;\n this.guide.warn(element, \"target:\" + targetName, \"Please replace \" + attributeName + \"=\\\"\" + identifier + \".\" + targetName + \"\\\" with data-\" + identifier + \"-target=\\\"\" + targetName + \"\\\". \" + (\"The \" + attributeName + \" attribute is deprecated and will be removed in a future version of Stimulus.\"));\n }\n return element;\n };\n Object.defineProperty(TargetSet.prototype, \"guide\", {\n get: function () {\n return this.scope.guide;\n },\n enumerable: false,\n configurable: true\n });\n return TargetSet;\n}();\nexport { TargetSet };","var __spreadArrays = this && this.__spreadArrays || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];\n return r;\n};\nimport { ClassMap } from \"./class_map\";\nimport { DataMap } from \"./data_map\";\nimport { Guide } from \"./guide\";\nimport { attributeValueContainsToken } from \"./selectors\";\nimport { TargetSet } from \"./target_set\";\nvar Scope = /** @class */function () {\n function Scope(schema, element, identifier, logger) {\n var _this = this;\n this.targets = new TargetSet(this);\n this.classes = new ClassMap(this);\n this.data = new DataMap(this);\n this.containsElement = function (element) {\n return element.closest(_this.controllerSelector) === _this.element;\n };\n this.schema = schema;\n this.element = element;\n this.identifier = identifier;\n this.guide = new Guide(logger);\n }\n Scope.prototype.findElement = function (selector) {\n return this.element.matches(selector) ? this.element : this.queryElements(selector).find(this.containsElement);\n };\n Scope.prototype.findAllElements = function (selector) {\n return __spreadArrays(this.element.matches(selector) ? [this.element] : [], this.queryElements(selector).filter(this.containsElement));\n };\n Scope.prototype.queryElements = function (selector) {\n return Array.from(this.element.querySelectorAll(selector));\n };\n Object.defineProperty(Scope.prototype, \"controllerSelector\", {\n get: function () {\n return attributeValueContainsToken(this.schema.controllerAttribute, this.identifier);\n },\n enumerable: false,\n configurable: true\n });\n return Scope;\n}();\nexport { Scope };","import { ValueListObserver } from \"@stimulus/mutation-observers\";\nvar ScopeObserver = /** @class */function () {\n function ScopeObserver(element, schema, delegate) {\n this.element = element;\n this.schema = schema;\n this.delegate = delegate;\n this.valueListObserver = new ValueListObserver(this.element, this.controllerAttribute, this);\n this.scopesByIdentifierByElement = new WeakMap();\n this.scopeReferenceCounts = new WeakMap();\n }\n ScopeObserver.prototype.start = function () {\n this.valueListObserver.start();\n };\n ScopeObserver.prototype.stop = function () {\n this.valueListObserver.stop();\n };\n Object.defineProperty(ScopeObserver.prototype, \"controllerAttribute\", {\n get: function () {\n return this.schema.controllerAttribute;\n },\n enumerable: false,\n configurable: true\n });\n // Value observer delegate\n /** @hidden */\n ScopeObserver.prototype.parseValueForToken = function (token) {\n var element = token.element,\n identifier = token.content;\n var scopesByIdentifier = this.fetchScopesByIdentifierForElement(element);\n var scope = scopesByIdentifier.get(identifier);\n if (!scope) {\n scope = this.delegate.createScopeForElementAndIdentifier(element, identifier);\n scopesByIdentifier.set(identifier, scope);\n }\n return scope;\n };\n /** @hidden */\n ScopeObserver.prototype.elementMatchedValue = function (element, value) {\n var referenceCount = (this.scopeReferenceCounts.get(value) || 0) + 1;\n this.scopeReferenceCounts.set(value, referenceCount);\n if (referenceCount == 1) {\n this.delegate.scopeConnected(value);\n }\n };\n /** @hidden */\n ScopeObserver.prototype.elementUnmatchedValue = function (element, value) {\n var referenceCount = this.scopeReferenceCounts.get(value);\n if (referenceCount) {\n this.scopeReferenceCounts.set(value, referenceCount - 1);\n if (referenceCount == 1) {\n this.delegate.scopeDisconnected(value);\n }\n }\n };\n ScopeObserver.prototype.fetchScopesByIdentifierForElement = function (element) {\n var scopesByIdentifier = this.scopesByIdentifierByElement.get(element);\n if (!scopesByIdentifier) {\n scopesByIdentifier = new Map();\n this.scopesByIdentifierByElement.set(element, scopesByIdentifier);\n }\n return scopesByIdentifier;\n };\n return ScopeObserver;\n}();\nexport { ScopeObserver };","import { Module } from \"./module\";\nimport { Multimap } from \"@stimulus/multimap\";\nimport { Scope } from \"./scope\";\nimport { ScopeObserver } from \"./scope_observer\";\nvar Router = /** @class */function () {\n function Router(application) {\n this.application = application;\n this.scopeObserver = new ScopeObserver(this.element, this.schema, this);\n this.scopesByIdentifier = new Multimap();\n this.modulesByIdentifier = new Map();\n }\n Object.defineProperty(Router.prototype, \"element\", {\n get: function () {\n return this.application.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Router.prototype, \"schema\", {\n get: function () {\n return this.application.schema;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Router.prototype, \"logger\", {\n get: function () {\n return this.application.logger;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Router.prototype, \"controllerAttribute\", {\n get: function () {\n return this.schema.controllerAttribute;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Router.prototype, \"modules\", {\n get: function () {\n return Array.from(this.modulesByIdentifier.values());\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Router.prototype, \"contexts\", {\n get: function () {\n return this.modules.reduce(function (contexts, module) {\n return contexts.concat(module.contexts);\n }, []);\n },\n enumerable: false,\n configurable: true\n });\n Router.prototype.start = function () {\n this.scopeObserver.start();\n };\n Router.prototype.stop = function () {\n this.scopeObserver.stop();\n };\n Router.prototype.loadDefinition = function (definition) {\n this.unloadIdentifier(definition.identifier);\n var module = new Module(this.application, definition);\n this.connectModule(module);\n };\n Router.prototype.unloadIdentifier = function (identifier) {\n var module = this.modulesByIdentifier.get(identifier);\n if (module) {\n this.disconnectModule(module);\n }\n };\n Router.prototype.getContextForElementAndIdentifier = function (element, identifier) {\n var module = this.modulesByIdentifier.get(identifier);\n if (module) {\n return module.contexts.find(function (context) {\n return context.element == element;\n });\n }\n };\n // Error handler delegate\n /** @hidden */\n Router.prototype.handleError = function (error, message, detail) {\n this.application.handleError(error, message, detail);\n };\n // Scope observer delegate\n /** @hidden */\n Router.prototype.createScopeForElementAndIdentifier = function (element, identifier) {\n return new Scope(this.schema, element, identifier, this.logger);\n };\n /** @hidden */\n Router.prototype.scopeConnected = function (scope) {\n this.scopesByIdentifier.add(scope.identifier, scope);\n var module = this.modulesByIdentifier.get(scope.identifier);\n if (module) {\n module.connectContextForScope(scope);\n }\n };\n /** @hidden */\n Router.prototype.scopeDisconnected = function (scope) {\n this.scopesByIdentifier.delete(scope.identifier, scope);\n var module = this.modulesByIdentifier.get(scope.identifier);\n if (module) {\n module.disconnectContextForScope(scope);\n }\n };\n // Modules\n Router.prototype.connectModule = function (module) {\n this.modulesByIdentifier.set(module.identifier, module);\n var scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n scopes.forEach(function (scope) {\n return module.connectContextForScope(scope);\n });\n };\n Router.prototype.disconnectModule = function (module) {\n this.modulesByIdentifier.delete(module.identifier);\n var scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n scopes.forEach(function (scope) {\n return module.disconnectContextForScope(scope);\n });\n };\n return Router;\n}();\nexport { Router };","export var defaultSchema = {\n controllerAttribute: \"data-controller\",\n actionAttribute: \"data-action\",\n targetAttribute: \"data-target\"\n};","var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = this && this.__generator || function (thisArg, body) {\n var _ = {\n label: 0,\n sent: function () {\n if (t[0] & 1) throw t[1];\n return t[1];\n },\n trys: [],\n ops: []\n },\n f,\n y,\n t,\n g;\n return g = {\n next: verb(0),\n \"throw\": verb(1),\n \"return\": verb(2)\n }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () {\n return this;\n }), g;\n function verb(n) {\n return function (v) {\n return step([n, v]);\n };\n }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n case 4:\n _.label++;\n return {\n value: op[1],\n done: false\n };\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n case 7:\n op = _.ops.pop();\n _.trys.pop();\n continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {\n _.label = op[1];\n break;\n }\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n if (t && _.label < t[2]) {\n _.label = t[2];\n _.ops.push(op);\n break;\n }\n if (t[2]) _.ops.pop();\n _.trys.pop();\n continue;\n }\n op = body.call(thisArg, _);\n } catch (e) {\n op = [6, e];\n y = 0;\n } finally {\n f = t = 0;\n }\n if (op[0] & 5) throw op[1];\n return {\n value: op[0] ? op[1] : void 0,\n done: true\n };\n }\n};\nvar __spreadArrays = this && this.__spreadArrays || function () {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];\n return r;\n};\nimport { Dispatcher } from \"./dispatcher\";\nimport { Router } from \"./router\";\nimport { defaultSchema } from \"./schema\";\nvar Application = /** @class */function () {\n function Application(element, schema) {\n if (element === void 0) {\n element = document.documentElement;\n }\n if (schema === void 0) {\n schema = defaultSchema;\n }\n this.logger = console;\n this.element = element;\n this.schema = schema;\n this.dispatcher = new Dispatcher(this);\n this.router = new Router(this);\n }\n Application.start = function (element, schema) {\n var application = new Application(element, schema);\n application.start();\n return application;\n };\n Application.prototype.start = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n return [4 /*yield*/, domReady()];\n case 1:\n _a.sent();\n this.dispatcher.start();\n this.router.start();\n return [2 /*return*/];\n }\n });\n });\n };\n\n Application.prototype.stop = function () {\n this.dispatcher.stop();\n this.router.stop();\n };\n Application.prototype.register = function (identifier, controllerConstructor) {\n this.load({\n identifier: identifier,\n controllerConstructor: controllerConstructor\n });\n };\n Application.prototype.load = function (head) {\n var _this = this;\n var rest = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n rest[_i - 1] = arguments[_i];\n }\n var definitions = Array.isArray(head) ? head : __spreadArrays([head], rest);\n definitions.forEach(function (definition) {\n return _this.router.loadDefinition(definition);\n });\n };\n Application.prototype.unload = function (head) {\n var _this = this;\n var rest = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n rest[_i - 1] = arguments[_i];\n }\n var identifiers = Array.isArray(head) ? head : __spreadArrays([head], rest);\n identifiers.forEach(function (identifier) {\n return _this.router.unloadIdentifier(identifier);\n });\n };\n Object.defineProperty(Application.prototype, \"controllers\", {\n // Controllers\n get: function () {\n return this.router.contexts.map(function (context) {\n return context.controller;\n });\n },\n enumerable: false,\n configurable: true\n });\n Application.prototype.getControllerForElementAndIdentifier = function (element, identifier) {\n var context = this.router.getContextForElementAndIdentifier(element, identifier);\n return context ? context.controller : null;\n };\n // Error handling\n Application.prototype.handleError = function (error, message, detail) {\n this.logger.error(\"%s\\n\\n%o\\n\\n%o\", message, error, detail);\n };\n return Application;\n}();\nexport { Application };\nfunction domReady() {\n return new Promise(function (resolve) {\n if (document.readyState == \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", resolve);\n } else {\n resolve();\n }\n });\n}","import { readInheritableStaticArrayValues } from \"./inheritable_statics\";\nimport { capitalize } from \"./string_helpers\";\n/** @hidden */\nexport function ClassPropertiesBlessing(constructor) {\n var classes = readInheritableStaticArrayValues(constructor, \"classes\");\n return classes.reduce(function (properties, classDefinition) {\n return Object.assign(properties, propertiesForClassDefinition(classDefinition));\n }, {});\n}\nfunction propertiesForClassDefinition(key) {\n var _a;\n var name = key + \"Class\";\n return _a = {}, _a[name] = {\n get: function () {\n var classes = this.classes;\n if (classes.has(key)) {\n return classes.get(key);\n } else {\n var attribute = classes.getAttributeName(key);\n throw new Error(\"Missing attribute \\\"\" + attribute + \"\\\"\");\n }\n }\n }, _a[\"has\" + capitalize(name)] = {\n get: function () {\n return this.classes.has(key);\n }\n }, _a;\n}","import { readInheritableStaticArrayValues } from \"./inheritable_statics\";\nimport { capitalize } from \"./string_helpers\";\n/** @hidden */\nexport function TargetPropertiesBlessing(constructor) {\n var targets = readInheritableStaticArrayValues(constructor, \"targets\");\n return targets.reduce(function (properties, targetDefinition) {\n return Object.assign(properties, propertiesForTargetDefinition(targetDefinition));\n }, {});\n}\nfunction propertiesForTargetDefinition(name) {\n var _a;\n return _a = {}, _a[name + \"Target\"] = {\n get: function () {\n var target = this.targets.find(name);\n if (target) {\n return target;\n } else {\n throw new Error(\"Missing target element \\\"\" + this.identifier + \".\" + name + \"\\\"\");\n }\n }\n }, _a[name + \"Targets\"] = {\n get: function () {\n return this.targets.findAll(name);\n }\n }, _a[\"has\" + capitalize(name) + \"Target\"] = {\n get: function () {\n return this.targets.has(name);\n }\n }, _a;\n}","import { readInheritableStaticObjectPairs } from \"./inheritable_statics\";\nimport { camelize, capitalize, dasherize } from \"./string_helpers\";\n/** @hidden */\nexport function ValuePropertiesBlessing(constructor) {\n var valueDefinitionPairs = readInheritableStaticObjectPairs(constructor, \"values\");\n var propertyDescriptorMap = {\n valueDescriptorMap: {\n get: function () {\n var _this = this;\n return valueDefinitionPairs.reduce(function (result, valueDefinitionPair) {\n var _a;\n var valueDescriptor = parseValueDefinitionPair(valueDefinitionPair);\n var attributeName = _this.data.getAttributeNameForKey(valueDescriptor.key);\n return Object.assign(result, (_a = {}, _a[attributeName] = valueDescriptor, _a));\n }, {});\n }\n }\n };\n return valueDefinitionPairs.reduce(function (properties, valueDefinitionPair) {\n return Object.assign(properties, propertiesForValueDefinitionPair(valueDefinitionPair));\n }, propertyDescriptorMap);\n}\n/** @hidden */\nexport function propertiesForValueDefinitionPair(valueDefinitionPair) {\n var _a;\n var definition = parseValueDefinitionPair(valueDefinitionPair);\n var type = definition.type,\n key = definition.key,\n name = definition.name;\n var read = readers[type],\n write = writers[type] || writers.default;\n return _a = {}, _a[name] = {\n get: function () {\n var value = this.data.get(key);\n if (value !== null) {\n return read(value);\n } else {\n return definition.defaultValue;\n }\n },\n set: function (value) {\n if (value === undefined) {\n this.data.delete(key);\n } else {\n this.data.set(key, write(value));\n }\n }\n }, _a[\"has\" + capitalize(name)] = {\n get: function () {\n return this.data.has(key);\n }\n }, _a;\n}\nfunction parseValueDefinitionPair(_a) {\n var token = _a[0],\n typeConstant = _a[1];\n var type = parseValueTypeConstant(typeConstant);\n return valueDescriptorForTokenAndType(token, type);\n}\nfunction parseValueTypeConstant(typeConstant) {\n switch (typeConstant) {\n case Array:\n return \"array\";\n case Boolean:\n return \"boolean\";\n case Number:\n return \"number\";\n case Object:\n return \"object\";\n case String:\n return \"string\";\n }\n throw new Error(\"Unknown value type constant \\\"\" + typeConstant + \"\\\"\");\n}\nfunction valueDescriptorForTokenAndType(token, type) {\n var key = dasherize(token) + \"-value\";\n return {\n type: type,\n key: key,\n name: camelize(key),\n get defaultValue() {\n return defaultValuesByType[type];\n }\n };\n}\nvar defaultValuesByType = {\n get array() {\n return [];\n },\n boolean: false,\n number: 0,\n get object() {\n return {};\n },\n string: \"\"\n};\nvar readers = {\n array: function (value) {\n var array = JSON.parse(value);\n if (!Array.isArray(array)) {\n throw new TypeError(\"Expected array\");\n }\n return array;\n },\n boolean: function (value) {\n return !(value == \"0\" || value == \"false\");\n },\n number: function (value) {\n return parseFloat(value);\n },\n object: function (value) {\n var object = JSON.parse(value);\n if (object === null || typeof object != \"object\" || Array.isArray(object)) {\n throw new TypeError(\"Expected object\");\n }\n return object;\n },\n string: function (value) {\n return value;\n }\n};\nvar writers = {\n default: writeString,\n array: writeJSON,\n object: writeJSON\n};\nfunction writeJSON(value) {\n return JSON.stringify(value);\n}\nfunction writeString(value) {\n return \"\" + value;\n}","import { ClassPropertiesBlessing } from \"./class_properties\";\nimport { TargetPropertiesBlessing } from \"./target_properties\";\nimport { ValuePropertiesBlessing } from \"./value_properties\";\nvar Controller = /** @class */function () {\n function Controller(context) {\n this.context = context;\n }\n Object.defineProperty(Controller.prototype, \"application\", {\n get: function () {\n return this.context.application;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Controller.prototype, \"scope\", {\n get: function () {\n return this.context.scope;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Controller.prototype, \"element\", {\n get: function () {\n return this.scope.element;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Controller.prototype, \"identifier\", {\n get: function () {\n return this.scope.identifier;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Controller.prototype, \"targets\", {\n get: function () {\n return this.scope.targets;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Controller.prototype, \"classes\", {\n get: function () {\n return this.scope.classes;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Controller.prototype, \"data\", {\n get: function () {\n return this.scope.data;\n },\n enumerable: false,\n configurable: true\n });\n Controller.prototype.initialize = function () {\n // Override in your subclass to set up initial controller state\n };\n Controller.prototype.connect = function () {\n // Override in your subclass to respond when the controller is connected to the DOM\n };\n Controller.prototype.disconnect = function () {\n // Override in your subclass to respond when the controller is disconnected from the DOM\n };\n Controller.blessings = [ClassPropertiesBlessing, TargetPropertiesBlessing, ValuePropertiesBlessing];\n Controller.targets = [];\n Controller.values = {};\n return Controller;\n}();\nexport { Controller };","var map = {\n\t\"./entry_form_controller.js\": 2,\n\t\"./hello_controller.js\": 3,\n\t\"./landing_controller.js\": 4,\n\t\"./lightbox_controller.js\": 5,\n\t\"./messages_controller.js\": 6,\n\t\"./post_form_controller.js\": 7,\n\t\"./settings_controller.js\": 8\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 1;","import { Controller } from 'stimulus'\nexport default class EntryFormController extends Controller {\n static targets = ['body', 'prompt', 'progress', 'progressMeter', 'progressMeterText', 'progressMeterTextWordCount', 'submitButton']\n static promptDelayMilliseconds = 4999\n static encouragementPrompts = [\n 'Clear your mind with daily, private, stream-of-consciousness writing to unleash your creative flow.',\n 'Type what you are thinking right now.',\n 'Get in the flow. Write some words!',\n \"Write whatever you want without editing. Doesn't have to be 'good'!\",\n 'Just write whatever is on your mind.',\n 'Whatever I want to accomplish later, getting my mind flowing is the first step.',\n 'This is just for you… Write whatever you want.',\n 'Fill this page with some words!',\n 'Clear out the mind-noise by unleashing some more words!',\n 'Want to save without leaving the keyboard? Control-S saves your progress.'\n ]\n\n static transitionMilliseconds = 500\n\n connect () {\n this._lastEventTimestamp = new Date().getTime()\n setTimeout(() => { this.updatePrompt() }, EntryFormController.promptDelayMilliseconds)\n this._placeCursorAtEnd()\n }\n\n updatePrompt () {\n const delay = new Date().getTime() - this._lastEventTimestamp\n if (delay > EntryFormController.promptDelayMilliseconds) {\n this.replacePrompt()\n } else {\n setTimeout(() => { this.updatePrompt() }, 999)\n }\n }\n\n replacePrompt () {\n this.promptTarget.classList.add('transparent')\n setTimeout(\n () => {\n this.promptTarget.textContent = this.randomPrompt()\n this.promptTarget.classList.remove('transparent')\n this._lastEventTimestamp = new Date().getTime()\n setTimeout(() => { this.updatePrompt() }, EntryFormController.promptDelayMilliseconds)\n },\n EntryFormController.transitionMilliseconds\n )\n }\n\n randomPrompt () {\n const list = EntryFormController.encouragementPrompts\n return list[Math.floor(Math.random() * list.length)]\n }\n\n handleKeyPress (event) {\n if (event.ctrlKey && event.key === 's') { this.save() }\n }\n\n handleInput (event) {\n this._lastEventTimestamp = new Date().getTime()\n this.updateProgressBar()\n }\n\n save () {\n this.element.submit()\n }\n\n updateProgressBar () {\n const wordTarget = 750\n const words = this.bodyTarget.value.trim().match(/\\S+/g)\n const wordCount = (words && words.length) || 0\n const primaryColor = '#072761'\n const fillColor = primaryColor\n\n this.progressTarget.setAttribute('aria-valuenow', wordCount)\n\n this.progressMeterTarget.setAttribute('style', 'width: ' + (Math.min(wordCount / wordTarget, 1) * 100) + '%; background: ' + fillColor)\n if (wordCount < wordTarget) {\n this.submitButtonTarget.value = 'Save'\n this.submitButtonTarget.classList.remove('success')\n if (wordCount > 0) {\n this.progressTarget.setAttribute('style', 'display: block;')\n } else {\n this.progressTarget.setAttribute('style', 'display: none;')\n }\n } else {\n this.submitButtonTarget.value = 'Done'\n this.submitButtonTarget.classList.add('success')\n this.progressTarget.setAttribute('style', 'display: none;')\n }\n this.progressMeterTextWordCountTarget.textContent = wordCount + ' word' + (wordCount !== 1 ? 's' : '')\n this.progressMeterTextTarget.setAttribute('style', 'display: block;')\n }\n\n _placeCursorAtEnd () {\n const textarea = this.bodyTarget\n\n textarea.selectionStart = textarea.selectionEnd = textarea.value.length\n textarea.scrollTop = textarea.scrollHeight\n }\n}\n","import { Controller } from 'stimulus'\n\nexport default class extends Controller {\n connect () {\n this.element.textContent = 'Hello World!'\n }\n}\n","import { Controller } from 'stimulus'\n\nexport default class LandingController extends Controller {\n connect () {\n window.location = this.entryUrl()\n }\n\n entryUrl () {\n const date = new Date()\n return '/entries/' + this.dateString(date) + '?' + this.offsetQueryParam(date)\n }\n\n dateString (date) {\n const year = date.getFullYear()\n\n let month = date.getMonth() + 1\n if (month.toString().length < 2) { month = '0' + month }\n\n let dayOfMonth = date.getDate()\n if (dayOfMonth.toString().length < 2) { dayOfMonth = '0' + dayOfMonth }\n\n return year + '-' + month + '-' + dayOfMonth\n }\n\n offsetQueryParam (date) {\n return 'tzo=' + date.getTimezoneOffset()\n }\n}\n","import { Controller } from 'stimulus'\n\nexport default class LightboxController extends Controller {\n open () {\n document.getElementById('scrim').style.display = 'block'\n document.getElementById('video').src = document.getElementById('video').src.replace('autoplay=0', 'autoplay=1')\n }\n\n close () {\n document.getElementById('scrim').style.display = 'none'\n document.getElementById('video').src = document.getElementById('video').src.replace('autoplay=1', 'autoplay=0')\n }\n}\n","import { Controller } from 'stimulus'\n\nexport default class extends Controller {\n closeCallout (event) {\n event.target.closest('.callout').classList.add('hide')\n }\n}\n","import { Controller } from 'stimulus'\n\nexport default class PostFormController extends Controller {\n static targets = ['input']\n\n connect () {\n const length = this.inputTarget.value.length\n this.inputTarget.setSelectionRange(length, length)\n }\n}\n","import { Controller } from 'stimulus'\n\nexport default class SettingsController extends Controller {\n static targets = ['autoScramble']\n\n save (event) {\n if (!this.autoScrambleTarget.checked) {\n return true\n }\n\n if (!confirm('Permanently scramble all entries older than 14 days?')) {\n event.preventDefault()\n }\n }\n}\n","/*\nUnobtrusive JavaScript\nhttps://github.com/rails/rails/blob/main/actionview/app/javascript\nReleased under the MIT license\n */\nconst linkClickSelector = \"a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]\";\nconst buttonClickSelector = {\n selector: \"button[data-remote]:not([form]), button[data-confirm]:not([form])\",\n exclude: \"form button\"\n};\nconst inputChangeSelector = \"select[data-remote], input[data-remote], textarea[data-remote]\";\nconst formSubmitSelector = \"form:not([data-turbo=true])\";\nconst formInputClickSelector = \"form:not([data-turbo=true]) input[type=submit], form:not([data-turbo=true]) input[type=image], form:not([data-turbo=true]) button[type=submit], form:not([data-turbo=true]) button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])\";\nconst formDisableSelector = \"input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled\";\nconst formEnableSelector = \"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled\";\nconst fileInputSelector = \"input[name][type=file]:not([disabled])\";\nconst linkDisableSelector = \"a[data-disable-with], a[data-disable]\";\nconst buttonDisableSelector = \"button[data-remote][data-disable-with], button[data-remote][data-disable]\";\nlet nonce = null;\nconst loadCSPNonce = () => {\n const metaTag = document.querySelector(\"meta[name=csp-nonce]\");\n return nonce = metaTag && metaTag.content;\n};\nconst cspNonce = () => nonce || loadCSPNonce();\nconst m = Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector;\nconst matches = function (element, selector) {\n if (selector.exclude) {\n return m.call(element, selector.selector) && !m.call(element, selector.exclude);\n } else {\n return m.call(element, selector);\n }\n};\nconst EXPANDO = \"_ujsData\";\nconst getData = (element, key) => element[EXPANDO] ? element[EXPANDO][key] : undefined;\nconst setData = function (element, key, value) {\n if (!element[EXPANDO]) {\n element[EXPANDO] = {};\n }\n return element[EXPANDO][key] = value;\n};\nconst $ = selector => Array.prototype.slice.call(document.querySelectorAll(selector));\nconst isContentEditable = function (element) {\n var isEditable = false;\n do {\n if (element.isContentEditable) {\n isEditable = true;\n break;\n }\n element = element.parentElement;\n } while (element);\n return isEditable;\n};\nconst csrfToken = () => {\n const meta = document.querySelector(\"meta[name=csrf-token]\");\n return meta && meta.content;\n};\nconst csrfParam = () => {\n const meta = document.querySelector(\"meta[name=csrf-param]\");\n return meta && meta.content;\n};\nconst CSRFProtection = xhr => {\n const token = csrfToken();\n if (token) {\n return xhr.setRequestHeader(\"X-CSRF-Token\", token);\n }\n};\nconst refreshCSRFTokens = () => {\n const token = csrfToken();\n const param = csrfParam();\n if (token && param) {\n return $('form input[name=\"' + param + '\"]').forEach(input => input.value = token);\n }\n};\nconst AcceptHeaders = {\n \"*\": \"*/*\",\n text: \"text/plain\",\n html: \"text/html\",\n xml: \"application/xml, text/xml\",\n json: \"application/json, text/javascript\",\n script: \"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\"\n};\nconst ajax = options => {\n options = prepareOptions(options);\n var xhr = createXHR(options, function () {\n const response = processResponse(xhr.response != null ? xhr.response : xhr.responseText, xhr.getResponseHeader(\"Content-Type\"));\n if (Math.floor(xhr.status / 100) === 2) {\n if (typeof options.success === \"function\") {\n options.success(response, xhr.statusText, xhr);\n }\n } else {\n if (typeof options.error === \"function\") {\n options.error(response, xhr.statusText, xhr);\n }\n }\n return typeof options.complete === \"function\" ? options.complete(xhr, xhr.statusText) : undefined;\n });\n if (options.beforeSend && !options.beforeSend(xhr, options)) {\n return false;\n }\n if (xhr.readyState === XMLHttpRequest.OPENED) {\n return xhr.send(options.data);\n }\n};\nvar prepareOptions = function (options) {\n options.url = options.url || location.href;\n options.type = options.type.toUpperCase();\n if (options.type === \"GET\" && options.data) {\n if (options.url.indexOf(\"?\") < 0) {\n options.url += \"?\" + options.data;\n } else {\n options.url += \"&\" + options.data;\n }\n }\n if (!(options.dataType in AcceptHeaders)) {\n options.dataType = \"*\";\n }\n options.accept = AcceptHeaders[options.dataType];\n if (options.dataType !== \"*\") {\n options.accept += \", */*; q=0.01\";\n }\n return options;\n};\nvar createXHR = function (options, done) {\n const xhr = new XMLHttpRequest();\n xhr.open(options.type, options.url, true);\n xhr.setRequestHeader(\"Accept\", options.accept);\n if (typeof options.data === \"string\") {\n xhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded; charset=UTF-8\");\n }\n if (!options.crossDomain) {\n xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n CSRFProtection(xhr);\n }\n xhr.withCredentials = !!options.withCredentials;\n xhr.onreadystatechange = function () {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n return done(xhr);\n }\n };\n return xhr;\n};\nvar processResponse = function (response, type) {\n if (typeof response === \"string\" && typeof type === \"string\") {\n if (type.match(/\\bjson\\b/)) {\n try {\n response = JSON.parse(response);\n } catch (error) {}\n } else if (type.match(/\\b(?:java|ecma)script\\b/)) {\n const script = document.createElement(\"script\");\n script.setAttribute(\"nonce\", cspNonce());\n script.text = response;\n document.head.appendChild(script).parentNode.removeChild(script);\n } else if (type.match(/\\b(xml|html|svg)\\b/)) {\n const parser = new DOMParser();\n type = type.replace(/;.+/, \"\");\n try {\n response = parser.parseFromString(response, type);\n } catch (error1) {}\n }\n }\n return response;\n};\nconst href = element => element.href;\nconst isCrossDomain = function (url) {\n const originAnchor = document.createElement(\"a\");\n originAnchor.href = location.href;\n const urlAnchor = document.createElement(\"a\");\n try {\n urlAnchor.href = url;\n return !((!urlAnchor.protocol || urlAnchor.protocol === \":\") && !urlAnchor.host || originAnchor.protocol + \"//\" + originAnchor.host === urlAnchor.protocol + \"//\" + urlAnchor.host);\n } catch (e) {\n return true;\n }\n};\nlet preventDefault;\nlet _window = window,\n CustomEvent = _window.CustomEvent;\nif (typeof CustomEvent !== \"function\") {\n CustomEvent = function (event, params) {\n const evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return evt;\n };\n CustomEvent.prototype = window.Event.prototype;\n preventDefault = CustomEvent.prototype.preventDefault;\n CustomEvent.prototype.preventDefault = function () {\n const result = preventDefault.call(this);\n if (this.cancelable && !this.defaultPrevented) {\n Object.defineProperty(this, \"defaultPrevented\", {\n get() {\n return true;\n }\n });\n }\n return result;\n };\n}\nconst fire = (obj, name, data) => {\n const event = new CustomEvent(name, {\n bubbles: true,\n cancelable: true,\n detail: data\n });\n obj.dispatchEvent(event);\n return !event.defaultPrevented;\n};\nconst stopEverything = e => {\n fire(e.target, \"ujs:everythingStopped\");\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation();\n};\nconst delegate = (element, selector, eventType, handler) => element.addEventListener(eventType, function (e) {\n let target = e.target;\n while (!!(target instanceof Element) && !matches(target, selector)) {\n target = target.parentNode;\n }\n if (target instanceof Element && handler.call(target, e) === false) {\n e.preventDefault();\n e.stopPropagation();\n }\n});\nconst toArray = e => Array.prototype.slice.call(e);\nconst serializeElement = (element, additionalParam) => {\n let inputs = [element];\n if (matches(element, \"form\")) {\n inputs = toArray(element.elements);\n }\n const params = [];\n inputs.forEach(function (input) {\n if (!input.name || input.disabled) {\n return;\n }\n if (matches(input, \"fieldset[disabled] *\")) {\n return;\n }\n if (matches(input, \"select\")) {\n toArray(input.options).forEach(function (option) {\n if (option.selected) {\n params.push({\n name: input.name,\n value: option.value\n });\n }\n });\n } else if (input.checked || [\"radio\", \"checkbox\", \"submit\"].indexOf(input.type) === -1) {\n params.push({\n name: input.name,\n value: input.value\n });\n }\n });\n if (additionalParam) {\n params.push(additionalParam);\n }\n return params.map(function (param) {\n if (param.name) {\n return `${encodeURIComponent(param.name)}=${encodeURIComponent(param.value)}`;\n } else {\n return param;\n }\n }).join(\"&\");\n};\nconst formElements = (form, selector) => {\n if (matches(form, \"form\")) {\n return toArray(form.elements).filter(el => matches(el, selector));\n } else {\n return toArray(form.querySelectorAll(selector));\n }\n};\nconst handleConfirmWithRails = rails => function (e) {\n if (!allowAction(this, rails)) {\n stopEverything(e);\n }\n};\nconst confirm = (message, element) => window.confirm(message);\nvar allowAction = function (element, rails) {\n let callback;\n const message = element.getAttribute(\"data-confirm\");\n if (!message) {\n return true;\n }\n let answer = false;\n if (fire(element, \"confirm\")) {\n try {\n answer = rails.confirm(message, element);\n } catch (error) {}\n callback = fire(element, \"confirm:complete\", [answer]);\n }\n return answer && callback;\n};\nconst handleDisabledElement = function (e) {\n const element = this;\n if (element.disabled) {\n stopEverything(e);\n }\n};\nconst enableElement = e => {\n let element;\n if (e instanceof Event) {\n if (isXhrRedirect(e)) {\n return;\n }\n element = e.target;\n } else {\n element = e;\n }\n if (isContentEditable(element)) {\n return;\n }\n if (matches(element, linkDisableSelector)) {\n return enableLinkElement(element);\n } else if (matches(element, buttonDisableSelector) || matches(element, formEnableSelector)) {\n return enableFormElement(element);\n } else if (matches(element, formSubmitSelector)) {\n return enableFormElements(element);\n }\n};\nconst disableElement = e => {\n const element = e instanceof Event ? e.target : e;\n if (isContentEditable(element)) {\n return;\n }\n if (matches(element, linkDisableSelector)) {\n return disableLinkElement(element);\n } else if (matches(element, buttonDisableSelector) || matches(element, formDisableSelector)) {\n return disableFormElement(element);\n } else if (matches(element, formSubmitSelector)) {\n return disableFormElements(element);\n }\n};\nvar disableLinkElement = function (element) {\n if (getData(element, \"ujs:disabled\")) {\n return;\n }\n const replacement = element.getAttribute(\"data-disable-with\");\n if (replacement != null) {\n setData(element, \"ujs:enable-with\", element.innerHTML);\n element.innerHTML = replacement;\n }\n element.addEventListener(\"click\", stopEverything);\n return setData(element, \"ujs:disabled\", true);\n};\nvar enableLinkElement = function (element) {\n const originalText = getData(element, \"ujs:enable-with\");\n if (originalText != null) {\n element.innerHTML = originalText;\n setData(element, \"ujs:enable-with\", null);\n }\n element.removeEventListener(\"click\", stopEverything);\n return setData(element, \"ujs:disabled\", null);\n};\nvar disableFormElements = form => formElements(form, formDisableSelector).forEach(disableFormElement);\nvar disableFormElement = function (element) {\n if (getData(element, \"ujs:disabled\")) {\n return;\n }\n const replacement = element.getAttribute(\"data-disable-with\");\n if (replacement != null) {\n if (matches(element, \"button\")) {\n setData(element, \"ujs:enable-with\", element.innerHTML);\n element.innerHTML = replacement;\n } else {\n setData(element, \"ujs:enable-with\", element.value);\n element.value = replacement;\n }\n }\n element.disabled = true;\n return setData(element, \"ujs:disabled\", true);\n};\nvar enableFormElements = form => formElements(form, formEnableSelector).forEach(element => enableFormElement(element));\nvar enableFormElement = function (element) {\n const originalText = getData(element, \"ujs:enable-with\");\n if (originalText != null) {\n if (matches(element, \"button\")) {\n element.innerHTML = originalText;\n } else {\n element.value = originalText;\n }\n setData(element, \"ujs:enable-with\", null);\n }\n element.disabled = false;\n return setData(element, \"ujs:disabled\", null);\n};\nvar isXhrRedirect = function (event) {\n const xhr = event.detail ? event.detail[0] : undefined;\n return xhr && xhr.getResponseHeader(\"X-Xhr-Redirect\");\n};\nconst handleMethodWithRails = rails => function (e) {\n const link = this;\n const method = link.getAttribute(\"data-method\");\n if (!method) {\n return;\n }\n if (isContentEditable(this)) {\n return;\n }\n const href = rails.href(link);\n const csrfToken$1 = csrfToken();\n const csrfParam$1 = csrfParam();\n const form = document.createElement(\"form\");\n let formContent = ``;\n if (csrfParam$1 && csrfToken$1 && !isCrossDomain(href)) {\n formContent += ``;\n }\n formContent += '';\n form.method = \"post\";\n form.action = href;\n form.target = link.target;\n form.innerHTML = formContent;\n form.style.display = \"none\";\n document.body.appendChild(form);\n form.querySelector('[type=\"submit\"]').click();\n stopEverything(e);\n};\nconst isRemote = function (element) {\n const value = element.getAttribute(\"data-remote\");\n return value != null && value !== \"false\";\n};\nconst handleRemoteWithRails = rails => function (e) {\n let data, method, url;\n const element = this;\n if (!isRemote(element)) {\n return true;\n }\n if (!fire(element, \"ajax:before\")) {\n fire(element, \"ajax:stopped\");\n return false;\n }\n if (isContentEditable(element)) {\n fire(element, \"ajax:stopped\");\n return false;\n }\n const withCredentials = element.getAttribute(\"data-with-credentials\");\n const dataType = element.getAttribute(\"data-type\") || \"script\";\n if (matches(element, formSubmitSelector)) {\n const button = getData(element, \"ujs:submit-button\");\n method = getData(element, \"ujs:submit-button-formmethod\") || element.getAttribute(\"method\") || \"get\";\n url = getData(element, \"ujs:submit-button-formaction\") || element.getAttribute(\"action\") || location.href;\n if (method.toUpperCase() === \"GET\") {\n url = url.replace(/\\?.*$/, \"\");\n }\n if (element.enctype === \"multipart/form-data\") {\n data = new FormData(element);\n if (button != null) {\n data.append(button.name, button.value);\n }\n } else {\n data = serializeElement(element, button);\n }\n setData(element, \"ujs:submit-button\", null);\n setData(element, \"ujs:submit-button-formmethod\", null);\n setData(element, \"ujs:submit-button-formaction\", null);\n } else if (matches(element, buttonClickSelector) || matches(element, inputChangeSelector)) {\n method = element.getAttribute(\"data-method\");\n url = element.getAttribute(\"data-url\");\n data = serializeElement(element, element.getAttribute(\"data-params\"));\n } else {\n method = element.getAttribute(\"data-method\");\n url = rails.href(element);\n data = element.getAttribute(\"data-params\");\n }\n ajax({\n type: method || \"GET\",\n url: url,\n data: data,\n dataType: dataType,\n beforeSend(xhr, options) {\n if (fire(element, \"ajax:beforeSend\", [xhr, options])) {\n return fire(element, \"ajax:send\", [xhr]);\n } else {\n fire(element, \"ajax:stopped\");\n return false;\n }\n },\n success() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return fire(element, \"ajax:success\", args);\n },\n error() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return fire(element, \"ajax:error\", args);\n },\n complete() {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n return fire(element, \"ajax:complete\", args);\n },\n crossDomain: isCrossDomain(url),\n withCredentials: withCredentials != null && withCredentials !== \"false\"\n });\n stopEverything(e);\n};\nconst formSubmitButtonClick = function (e) {\n const button = this;\n const form = button.form;\n if (!form) {\n return;\n }\n if (button.name) {\n setData(form, \"ujs:submit-button\", {\n name: button.name,\n value: button.value\n });\n }\n setData(form, \"ujs:formnovalidate-button\", button.formNoValidate);\n setData(form, \"ujs:submit-button-formaction\", button.getAttribute(\"formaction\"));\n return setData(form, \"ujs:submit-button-formmethod\", button.getAttribute(\"formmethod\"));\n};\nconst preventInsignificantClick = function (e) {\n const link = this;\n const method = (link.getAttribute(\"data-method\") || \"GET\").toUpperCase();\n const data = link.getAttribute(\"data-params\");\n const metaClick = e.metaKey || e.ctrlKey;\n const insignificantMetaClick = metaClick && method === \"GET\" && !data;\n const nonPrimaryMouseClick = e.button != null && e.button !== 0;\n if (nonPrimaryMouseClick || insignificantMetaClick) {\n e.stopImmediatePropagation();\n }\n};\nconst Rails = {\n $: $,\n ajax: ajax,\n buttonClickSelector: buttonClickSelector,\n buttonDisableSelector: buttonDisableSelector,\n confirm: confirm,\n cspNonce: cspNonce,\n csrfToken: csrfToken,\n csrfParam: csrfParam,\n CSRFProtection: CSRFProtection,\n delegate: delegate,\n disableElement: disableElement,\n enableElement: enableElement,\n fileInputSelector: fileInputSelector,\n fire: fire,\n formElements: formElements,\n formEnableSelector: formEnableSelector,\n formDisableSelector: formDisableSelector,\n formInputClickSelector: formInputClickSelector,\n formSubmitButtonClick: formSubmitButtonClick,\n formSubmitSelector: formSubmitSelector,\n getData: getData,\n handleDisabledElement: handleDisabledElement,\n href: href,\n inputChangeSelector: inputChangeSelector,\n isCrossDomain: isCrossDomain,\n linkClickSelector: linkClickSelector,\n linkDisableSelector: linkDisableSelector,\n loadCSPNonce: loadCSPNonce,\n matches: matches,\n preventInsignificantClick: preventInsignificantClick,\n refreshCSRFTokens: refreshCSRFTokens,\n serializeElement: serializeElement,\n setData: setData,\n stopEverything: stopEverything\n};\nconst handleConfirm = handleConfirmWithRails(Rails);\nRails.handleConfirm = handleConfirm;\nconst handleMethod = handleMethodWithRails(Rails);\nRails.handleMethod = handleMethod;\nconst handleRemote = handleRemoteWithRails(Rails);\nRails.handleRemote = handleRemote;\nconst start = function () {\n if (window._rails_loaded) {\n throw new Error(\"rails-ujs has already been loaded!\");\n }\n window.addEventListener(\"pageshow\", function () {\n $(formEnableSelector).forEach(function (el) {\n if (getData(el, \"ujs:disabled\")) {\n enableElement(el);\n }\n });\n $(linkDisableSelector).forEach(function (el) {\n if (getData(el, \"ujs:disabled\")) {\n enableElement(el);\n }\n });\n });\n delegate(document, linkDisableSelector, \"ajax:complete\", enableElement);\n delegate(document, linkDisableSelector, \"ajax:stopped\", enableElement);\n delegate(document, buttonDisableSelector, \"ajax:complete\", enableElement);\n delegate(document, buttonDisableSelector, \"ajax:stopped\", enableElement);\n delegate(document, linkClickSelector, \"click\", preventInsignificantClick);\n delegate(document, linkClickSelector, \"click\", handleDisabledElement);\n delegate(document, linkClickSelector, \"click\", handleConfirm);\n delegate(document, linkClickSelector, \"click\", disableElement);\n delegate(document, linkClickSelector, \"click\", handleRemote);\n delegate(document, linkClickSelector, \"click\", handleMethod);\n delegate(document, buttonClickSelector, \"click\", preventInsignificantClick);\n delegate(document, buttonClickSelector, \"click\", handleDisabledElement);\n delegate(document, buttonClickSelector, \"click\", handleConfirm);\n delegate(document, buttonClickSelector, \"click\", disableElement);\n delegate(document, buttonClickSelector, \"click\", handleRemote);\n delegate(document, inputChangeSelector, \"change\", handleDisabledElement);\n delegate(document, inputChangeSelector, \"change\", handleConfirm);\n delegate(document, inputChangeSelector, \"change\", handleRemote);\n delegate(document, formSubmitSelector, \"submit\", handleDisabledElement);\n delegate(document, formSubmitSelector, \"submit\", handleConfirm);\n delegate(document, formSubmitSelector, \"submit\", handleRemote);\n delegate(document, formSubmitSelector, \"submit\", e => setTimeout(() => disableElement(e), 13));\n delegate(document, formSubmitSelector, \"ajax:send\", disableElement);\n delegate(document, formSubmitSelector, \"ajax:complete\", enableElement);\n delegate(document, formInputClickSelector, \"click\", preventInsignificantClick);\n delegate(document, formInputClickSelector, \"click\", handleDisabledElement);\n delegate(document, formInputClickSelector, \"click\", handleConfirm);\n delegate(document, formInputClickSelector, \"click\", formSubmitButtonClick);\n document.addEventListener(\"DOMContentLoaded\", refreshCSRFTokens);\n document.addEventListener(\"DOMContentLoaded\", loadCSPNonce);\n return window._rails_loaded = true;\n};\nRails.start = start;\nif (typeof jQuery !== \"undefined\" && jQuery && jQuery.ajax) {\n if (jQuery.rails) {\n throw new Error(\"If you load both jquery_ujs and rails-ujs, use rails-ujs only.\");\n }\n jQuery.rails = Rails;\n jQuery.ajaxPrefilter(function (options, originalOptions, xhr) {\n if (!options.crossDomain) {\n return CSRFProtection(xhr);\n }\n });\n}\nif (typeof exports !== \"object\" && typeof module === \"undefined\") {\n window.Rails = Rails;\n if (fire(document, \"rails:attachBindings\")) {\n start();\n }\n}\nexport { Rails as default };","var sparkMd5 = {\n exports: {}\n};\n(function (module, exports) {\n (function (factory) {\n {\n module.exports = factory();\n }\n })(function (undefined$1) {\n var hex_chr = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\"];\n function md5cycle(x, k) {\n var a = x[0],\n b = x[1],\n c = x[2],\n d = x[3];\n a += (b & c | ~b & d) + k[0] - 680876936 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[1] - 389564586 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[2] + 606105819 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[3] - 1044525330 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[4] - 176418897 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[5] + 1200080426 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[6] - 1473231341 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[7] - 45705983 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[8] + 1770035416 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[9] - 1958414417 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[10] - 42063 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[11] - 1990404162 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[12] + 1804603682 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[13] - 40341101 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[14] - 1502002290 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[15] + 1236535329 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & d | c & ~d) + k[1] - 165796510 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[6] - 1069501632 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[11] + 643717713 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[0] - 373897302 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[5] - 701558691 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[10] + 38016083 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[15] - 660478335 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[4] - 405537848 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[9] + 568446438 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[14] - 1019803690 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[3] - 187363961 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[8] + 1163531501 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[13] - 1444681467 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[2] - 51403784 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[7] + 1735328473 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[12] - 1926607734 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b ^ c ^ d) + k[5] - 378558 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[8] - 2022574463 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[11] + 1839030562 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[14] - 35309556 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[1] - 1530992060 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[4] + 1272893353 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[7] - 155497632 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[10] - 1094730640 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[13] + 681279174 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[0] - 358537222 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[3] - 722521979 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[6] + 76029189 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[9] - 640364487 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[12] - 421815835 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[15] + 530742520 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[2] - 995338651 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (c ^ (b | ~d)) + k[0] - 198630844 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[5] - 57434055 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[10] - 1051523 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[15] - 30611744 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[4] - 145523070 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[2] + 718787259 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[9] - 343485551 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n x[0] = a + x[0] | 0;\n x[1] = b + x[1] | 0;\n x[2] = c + x[2] | 0;\n x[3] = d + x[3] | 0;\n }\n function md5blk(s) {\n var md5blks = [],\n i;\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);\n }\n return md5blks;\n }\n function md5blk_array(a) {\n var md5blks = [],\n i;\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);\n }\n return md5blks;\n }\n function md51(s) {\n var n = s.length,\n state = [1732584193, -271733879, -1732584194, 271733878],\n i,\n length,\n tail,\n tmp,\n lo,\n hi;\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk(s.substring(i - 64, i)));\n }\n s = s.substring(i - 64);\n length = s.length;\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);\n }\n tail[i >> 2] |= 128 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(state, tail);\n return state;\n }\n function md51_array(a) {\n var n = a.length,\n state = [1732584193, -271733879, -1732584194, 271733878],\n i,\n length,\n tail,\n tmp,\n lo,\n hi;\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk_array(a.subarray(i - 64, i)));\n }\n a = i - 64 < n ? a.subarray(i - 64) : new Uint8Array(0);\n length = a.length;\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= a[i] << (i % 4 << 3);\n }\n tail[i >> 2] |= 128 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(state, tail);\n return state;\n }\n function rhex(n) {\n var s = \"\",\n j;\n for (j = 0; j < 4; j += 1) {\n s += hex_chr[n >> j * 8 + 4 & 15] + hex_chr[n >> j * 8 & 15];\n }\n return s;\n }\n function hex(x) {\n var i;\n for (i = 0; i < x.length; i += 1) {\n x[i] = rhex(x[i]);\n }\n return x.join(\"\");\n }\n if (hex(md51(\"hello\")) !== \"5d41402abc4b2a76b9719d911017c592\") ;\n if (typeof ArrayBuffer !== \"undefined\" && !ArrayBuffer.prototype.slice) {\n (function () {\n function clamp(val, length) {\n val = val | 0 || 0;\n if (val < 0) {\n return Math.max(val + length, 0);\n }\n return Math.min(val, length);\n }\n ArrayBuffer.prototype.slice = function (from, to) {\n var length = this.byteLength,\n begin = clamp(from, length),\n end = length,\n num,\n target,\n targetArray,\n sourceArray;\n if (to !== undefined$1) {\n end = clamp(to, length);\n }\n if (begin > end) {\n return new ArrayBuffer(0);\n }\n num = end - begin;\n target = new ArrayBuffer(num);\n targetArray = new Uint8Array(target);\n sourceArray = new Uint8Array(this, begin, num);\n targetArray.set(sourceArray);\n return target;\n };\n })();\n }\n function toUtf8(str) {\n if (/[\\u0080-\\uFFFF]/.test(str)) {\n str = unescape(encodeURIComponent(str));\n }\n return str;\n }\n function utf8Str2ArrayBuffer(str, returnUInt8Array) {\n var length = str.length,\n buff = new ArrayBuffer(length),\n arr = new Uint8Array(buff),\n i;\n for (i = 0; i < length; i += 1) {\n arr[i] = str.charCodeAt(i);\n }\n return returnUInt8Array ? arr : buff;\n }\n function arrayBuffer2Utf8Str(buff) {\n return String.fromCharCode.apply(null, new Uint8Array(buff));\n }\n function concatenateArrayBuffers(first, second, returnUInt8Array) {\n var result = new Uint8Array(first.byteLength + second.byteLength);\n result.set(new Uint8Array(first));\n result.set(new Uint8Array(second), first.byteLength);\n return returnUInt8Array ? result : result.buffer;\n }\n function hexToBinaryString(hex) {\n var bytes = [],\n length = hex.length,\n x;\n for (x = 0; x < length - 1; x += 2) {\n bytes.push(parseInt(hex.substr(x, 2), 16));\n }\n return String.fromCharCode.apply(String, bytes);\n }\n function SparkMD5() {\n this.reset();\n }\n SparkMD5.prototype.append = function (str) {\n this.appendBinary(toUtf8(str));\n return this;\n };\n SparkMD5.prototype.appendBinary = function (contents) {\n this._buff += contents;\n this._length += contents.length;\n var length = this._buff.length,\n i;\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));\n }\n this._buff = this._buff.substring(i - 64);\n return this;\n };\n SparkMD5.prototype.end = function (raw) {\n var buff = this._buff,\n length = buff.length,\n i,\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n ret;\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff.charCodeAt(i) << (i % 4 << 3);\n }\n this._finish(tail, length);\n ret = hex(this._hash);\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n this.reset();\n return ret;\n };\n SparkMD5.prototype.reset = function () {\n this._buff = \"\";\n this._length = 0;\n this._hash = [1732584193, -271733879, -1732584194, 271733878];\n return this;\n };\n SparkMD5.prototype.getState = function () {\n return {\n buff: this._buff,\n length: this._length,\n hash: this._hash.slice()\n };\n };\n SparkMD5.prototype.setState = function (state) {\n this._buff = state.buff;\n this._length = state.length;\n this._hash = state.hash;\n return this;\n };\n SparkMD5.prototype.destroy = function () {\n delete this._hash;\n delete this._buff;\n delete this._length;\n };\n SparkMD5.prototype._finish = function (tail, length) {\n var i = length,\n tmp,\n lo,\n hi;\n tail[i >> 2] |= 128 << (i % 4 << 3);\n if (i > 55) {\n md5cycle(this._hash, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n tmp = this._length * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(this._hash, tail);\n };\n SparkMD5.hash = function (str, raw) {\n return SparkMD5.hashBinary(toUtf8(str), raw);\n };\n SparkMD5.hashBinary = function (content, raw) {\n var hash = md51(content),\n ret = hex(hash);\n return raw ? hexToBinaryString(ret) : ret;\n };\n SparkMD5.ArrayBuffer = function () {\n this.reset();\n };\n SparkMD5.ArrayBuffer.prototype.append = function (arr) {\n var buff = concatenateArrayBuffers(this._buff.buffer, arr, true),\n length = buff.length,\n i;\n this._length += arr.byteLength;\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));\n }\n this._buff = i - 64 < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0);\n return this;\n };\n SparkMD5.ArrayBuffer.prototype.end = function (raw) {\n var buff = this._buff,\n length = buff.length,\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n i,\n ret;\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff[i] << (i % 4 << 3);\n }\n this._finish(tail, length);\n ret = hex(this._hash);\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n this.reset();\n return ret;\n };\n SparkMD5.ArrayBuffer.prototype.reset = function () {\n this._buff = new Uint8Array(0);\n this._length = 0;\n this._hash = [1732584193, -271733879, -1732584194, 271733878];\n return this;\n };\n SparkMD5.ArrayBuffer.prototype.getState = function () {\n var state = SparkMD5.prototype.getState.call(this);\n state.buff = arrayBuffer2Utf8Str(state.buff);\n return state;\n };\n SparkMD5.ArrayBuffer.prototype.setState = function (state) {\n state.buff = utf8Str2ArrayBuffer(state.buff, true);\n return SparkMD5.prototype.setState.call(this, state);\n };\n SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;\n SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;\n SparkMD5.ArrayBuffer.hash = function (arr, raw) {\n var hash = md51_array(new Uint8Array(arr)),\n ret = hex(hash);\n return raw ? hexToBinaryString(ret) : ret;\n };\n return SparkMD5;\n });\n})(sparkMd5);\nvar SparkMD5 = sparkMd5.exports;\nconst fileSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;\nclass FileChecksum {\n static create(file, callback) {\n const instance = new FileChecksum(file);\n instance.create(callback);\n }\n constructor(file) {\n this.file = file;\n this.chunkSize = 2097152;\n this.chunkCount = Math.ceil(this.file.size / this.chunkSize);\n this.chunkIndex = 0;\n }\n create(callback) {\n this.callback = callback;\n this.md5Buffer = new SparkMD5.ArrayBuffer();\n this.fileReader = new FileReader();\n this.fileReader.addEventListener(\"load\", event => this.fileReaderDidLoad(event));\n this.fileReader.addEventListener(\"error\", event => this.fileReaderDidError(event));\n this.readNextChunk();\n }\n fileReaderDidLoad(event) {\n this.md5Buffer.append(event.target.result);\n if (!this.readNextChunk()) {\n const binaryDigest = this.md5Buffer.end(true);\n const base64digest = btoa(binaryDigest);\n this.callback(null, base64digest);\n }\n }\n fileReaderDidError(event) {\n this.callback(`Error reading ${this.file.name}`);\n }\n readNextChunk() {\n if (this.chunkIndex < this.chunkCount || this.chunkIndex == 0 && this.chunkCount == 0) {\n const start = this.chunkIndex * this.chunkSize;\n const end = Math.min(start + this.chunkSize, this.file.size);\n const bytes = fileSlice.call(this.file, start, end);\n this.fileReader.readAsArrayBuffer(bytes);\n this.chunkIndex++;\n return true;\n } else {\n return false;\n }\n }\n}\nfunction getMetaValue(name) {\n const element = findElement(document.head, `meta[name=\"${name}\"]`);\n if (element) {\n return element.getAttribute(\"content\");\n }\n}\nfunction findElements(root, selector) {\n if (typeof root == \"string\") {\n selector = root;\n root = document;\n }\n const elements = root.querySelectorAll(selector);\n return toArray(elements);\n}\nfunction findElement(root, selector) {\n if (typeof root == \"string\") {\n selector = root;\n root = document;\n }\n return root.querySelector(selector);\n}\nfunction dispatchEvent(element, type) {\n let eventInit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n const disabled = element.disabled;\n const bubbles = eventInit.bubbles,\n cancelable = eventInit.cancelable,\n detail = eventInit.detail;\n const event = document.createEvent(\"Event\");\n event.initEvent(type, bubbles || true, cancelable || true);\n event.detail = detail || {};\n try {\n element.disabled = false;\n element.dispatchEvent(event);\n } finally {\n element.disabled = disabled;\n }\n return event;\n}\nfunction toArray(value) {\n if (Array.isArray(value)) {\n return value;\n } else if (Array.from) {\n return Array.from(value);\n } else {\n return [].slice.call(value);\n }\n}\nclass BlobRecord {\n constructor(file, checksum, url) {\n let customHeaders = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n this.file = file;\n this.attributes = {\n filename: file.name,\n content_type: file.type || \"application/octet-stream\",\n byte_size: file.size,\n checksum: checksum\n };\n this.xhr = new XMLHttpRequest();\n this.xhr.open(\"POST\", url, true);\n this.xhr.responseType = \"json\";\n this.xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n this.xhr.setRequestHeader(\"Accept\", \"application/json\");\n this.xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n Object.keys(customHeaders).forEach(headerKey => {\n this.xhr.setRequestHeader(headerKey, customHeaders[headerKey]);\n });\n const csrfToken = getMetaValue(\"csrf-token\");\n if (csrfToken != undefined) {\n this.xhr.setRequestHeader(\"X-CSRF-Token\", csrfToken);\n }\n this.xhr.addEventListener(\"load\", event => this.requestDidLoad(event));\n this.xhr.addEventListener(\"error\", event => this.requestDidError(event));\n }\n get status() {\n return this.xhr.status;\n }\n get response() {\n const _this$xhr = this.xhr,\n responseType = _this$xhr.responseType,\n response = _this$xhr.response;\n if (responseType == \"json\") {\n return response;\n } else {\n return JSON.parse(response);\n }\n }\n create(callback) {\n this.callback = callback;\n this.xhr.send(JSON.stringify({\n blob: this.attributes\n }));\n }\n requestDidLoad(event) {\n if (this.status >= 200 && this.status < 300) {\n const response = this.response;\n const direct_upload = response.direct_upload;\n delete response.direct_upload;\n this.attributes = response;\n this.directUploadData = direct_upload;\n this.callback(null, this.toJSON());\n } else {\n this.requestDidError(event);\n }\n }\n requestDidError(event) {\n this.callback(`Error creating Blob for \"${this.file.name}\". Status: ${this.status}`);\n }\n toJSON() {\n const result = {};\n for (const key in this.attributes) {\n result[key] = this.attributes[key];\n }\n return result;\n }\n}\nclass BlobUpload {\n constructor(blob) {\n this.blob = blob;\n this.file = blob.file;\n const _blob$directUploadDat = blob.directUploadData,\n url = _blob$directUploadDat.url,\n headers = _blob$directUploadDat.headers;\n this.xhr = new XMLHttpRequest();\n this.xhr.open(\"PUT\", url, true);\n this.xhr.responseType = \"text\";\n for (const key in headers) {\n this.xhr.setRequestHeader(key, headers[key]);\n }\n this.xhr.addEventListener(\"load\", event => this.requestDidLoad(event));\n this.xhr.addEventListener(\"error\", event => this.requestDidError(event));\n }\n create(callback) {\n this.callback = callback;\n this.xhr.send(this.file.slice());\n }\n requestDidLoad(event) {\n const _this$xhr2 = this.xhr,\n status = _this$xhr2.status,\n response = _this$xhr2.response;\n if (status >= 200 && status < 300) {\n this.callback(null, response);\n } else {\n this.requestDidError(event);\n }\n }\n requestDidError(event) {\n this.callback(`Error storing \"${this.file.name}\". Status: ${this.xhr.status}`);\n }\n}\nlet id = 0;\nclass DirectUpload {\n constructor(file, url, delegate) {\n let customHeaders = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n this.id = ++id;\n this.file = file;\n this.url = url;\n this.delegate = delegate;\n this.customHeaders = customHeaders;\n }\n create(callback) {\n FileChecksum.create(this.file, (error, checksum) => {\n if (error) {\n callback(error);\n return;\n }\n const blob = new BlobRecord(this.file, checksum, this.url, this.customHeaders);\n notify(this.delegate, \"directUploadWillCreateBlobWithXHR\", blob.xhr);\n blob.create(error => {\n if (error) {\n callback(error);\n } else {\n const upload = new BlobUpload(blob);\n notify(this.delegate, \"directUploadWillStoreFileWithXHR\", upload.xhr);\n upload.create(error => {\n if (error) {\n callback(error);\n } else {\n callback(null, blob.toJSON());\n }\n });\n }\n });\n });\n }\n}\nfunction notify(object, methodName) {\n if (object && typeof object[methodName] == \"function\") {\n for (var _len = arguments.length, messages = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n messages[_key - 2] = arguments[_key];\n }\n return object[methodName](...messages);\n }\n}\nclass DirectUploadController {\n constructor(input, file) {\n this.input = input;\n this.file = file;\n this.directUpload = new DirectUpload(this.file, this.url, this);\n this.dispatch(\"initialize\");\n }\n start(callback) {\n const hiddenInput = document.createElement(\"input\");\n hiddenInput.type = \"hidden\";\n hiddenInput.name = this.input.name;\n this.input.insertAdjacentElement(\"beforebegin\", hiddenInput);\n this.dispatch(\"start\");\n this.directUpload.create((error, attributes) => {\n if (error) {\n hiddenInput.parentNode.removeChild(hiddenInput);\n this.dispatchError(error);\n } else {\n hiddenInput.value = attributes.signed_id;\n }\n this.dispatch(\"end\");\n callback(error);\n });\n }\n uploadRequestDidProgress(event) {\n const progress = event.loaded / event.total * 100;\n if (progress) {\n this.dispatch(\"progress\", {\n progress: progress\n });\n }\n }\n get url() {\n return this.input.getAttribute(\"data-direct-upload-url\");\n }\n dispatch(name) {\n let detail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n detail.file = this.file;\n detail.id = this.directUpload.id;\n return dispatchEvent(this.input, `direct-upload:${name}`, {\n detail: detail\n });\n }\n dispatchError(error) {\n const event = this.dispatch(\"error\", {\n error: error\n });\n if (!event.defaultPrevented) {\n alert(error);\n }\n }\n directUploadWillCreateBlobWithXHR(xhr) {\n this.dispatch(\"before-blob-request\", {\n xhr: xhr\n });\n }\n directUploadWillStoreFileWithXHR(xhr) {\n this.dispatch(\"before-storage-request\", {\n xhr: xhr\n });\n xhr.upload.addEventListener(\"progress\", event => this.uploadRequestDidProgress(event));\n }\n}\nconst inputSelector = \"input[type=file][data-direct-upload-url]:not([disabled])\";\nclass DirectUploadsController {\n constructor(form) {\n this.form = form;\n this.inputs = findElements(form, inputSelector).filter(input => input.files.length);\n }\n start(callback) {\n const controllers = this.createDirectUploadControllers();\n const startNextController = () => {\n const controller = controllers.shift();\n if (controller) {\n controller.start(error => {\n if (error) {\n callback(error);\n this.dispatch(\"end\");\n } else {\n startNextController();\n }\n });\n } else {\n callback();\n this.dispatch(\"end\");\n }\n };\n this.dispatch(\"start\");\n startNextController();\n }\n createDirectUploadControllers() {\n const controllers = [];\n this.inputs.forEach(input => {\n toArray(input.files).forEach(file => {\n const controller = new DirectUploadController(input, file);\n controllers.push(controller);\n });\n });\n return controllers;\n }\n dispatch(name) {\n let detail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return dispatchEvent(this.form, `direct-uploads:${name}`, {\n detail: detail\n });\n }\n}\nconst processingAttribute = \"data-direct-uploads-processing\";\nconst submitButtonsByForm = new WeakMap();\nlet started = false;\nfunction start() {\n if (!started) {\n started = true;\n document.addEventListener(\"click\", didClick, true);\n document.addEventListener(\"submit\", didSubmitForm, true);\n document.addEventListener(\"ajax:before\", didSubmitRemoteElement);\n }\n}\nfunction didClick(event) {\n const target = event.target;\n if ((target.tagName == \"INPUT\" || target.tagName == \"BUTTON\") && target.type == \"submit\" && target.form) {\n submitButtonsByForm.set(target.form, target);\n }\n}\nfunction didSubmitForm(event) {\n handleFormSubmissionEvent(event);\n}\nfunction didSubmitRemoteElement(event) {\n if (event.target.tagName == \"FORM\") {\n handleFormSubmissionEvent(event);\n }\n}\nfunction handleFormSubmissionEvent(event) {\n const form = event.target;\n if (form.hasAttribute(processingAttribute)) {\n event.preventDefault();\n return;\n }\n const controller = new DirectUploadsController(form);\n const inputs = controller.inputs;\n if (inputs.length) {\n event.preventDefault();\n form.setAttribute(processingAttribute, \"\");\n inputs.forEach(disable);\n controller.start(error => {\n form.removeAttribute(processingAttribute);\n if (error) {\n inputs.forEach(enable);\n } else {\n submitForm(form);\n }\n });\n }\n}\nfunction submitForm(form) {\n let button = submitButtonsByForm.get(form) || findElement(form, \"input[type=submit], button[type=submit]\");\n if (button) {\n const _button = button,\n disabled = _button.disabled;\n button.disabled = false;\n button.focus();\n button.click();\n button.disabled = disabled;\n } else {\n button = document.createElement(\"input\");\n button.type = \"submit\";\n button.style.display = \"none\";\n form.appendChild(button);\n button.click();\n form.removeChild(button);\n }\n submitButtonsByForm.delete(form);\n}\nfunction disable(input) {\n input.disabled = true;\n}\nfunction enable(input) {\n input.disabled = false;\n}\nfunction autostart() {\n if (window.ActiveStorage) {\n start();\n }\n}\nsetTimeout(autostart, 1);\nexport { DirectUpload, DirectUploadController, DirectUploadsController, start };","// Load all the channels within this directory and all subdirectories.\n// Channel files must be named *_channel.js.\n\nconst channels = require.context('.', true, /_channel\\.js$/)\nchannels.keys().forEach(channels)\n","function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = 12;","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n/*\nTurbo 7.3.0\nCopyright © 2023 37signals LLC\n */\n(function () {\n if (window.Reflect === undefined || window.customElements === undefined || window.customElements.polyfillWrapFlushCallback) {\n return;\n }\n const BuiltInHTMLElement = HTMLElement;\n const wrapperForTheName = {\n HTMLElement: function HTMLElement() {\n return Reflect.construct(BuiltInHTMLElement, [], this.constructor);\n }\n };\n window.HTMLElement = wrapperForTheName[\"HTMLElement\"];\n HTMLElement.prototype = BuiltInHTMLElement.prototype;\n HTMLElement.prototype.constructor = HTMLElement;\n Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement);\n})();\n\n/**\n * The MIT License (MIT)\n * \n * Copyright (c) 2019 Javan Makhmali\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\n * all 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\n * THE SOFTWARE.\n */\n\n(function (prototype) {\n if (typeof prototype.requestSubmit == \"function\") return;\n prototype.requestSubmit = function (submitter) {\n if (submitter) {\n validateSubmitter(submitter, this);\n submitter.click();\n } else {\n submitter = document.createElement(\"input\");\n submitter.type = \"submit\";\n submitter.hidden = true;\n this.appendChild(submitter);\n submitter.click();\n this.removeChild(submitter);\n }\n };\n function validateSubmitter(submitter, form) {\n submitter instanceof HTMLElement || raise(TypeError, \"parameter 1 is not of type 'HTMLElement'\");\n submitter.type == \"submit\" || raise(TypeError, \"The specified element is not a submit button\");\n submitter.form == form || raise(DOMException, \"The specified element is not owned by this form element\", \"NotFoundError\");\n }\n function raise(errorConstructor, message, name) {\n throw new errorConstructor(\"Failed to execute 'requestSubmit' on 'HTMLFormElement': \" + message + \".\", name);\n }\n})(HTMLFormElement.prototype);\nconst submittersByForm = new WeakMap();\nfunction findSubmitterFromClickTarget(target) {\n const element = target instanceof Element ? target : target instanceof Node ? target.parentElement : null;\n const candidate = element ? element.closest(\"input, button\") : null;\n return (candidate === null || candidate === void 0 ? void 0 : candidate.type) == \"submit\" ? candidate : null;\n}\nfunction clickCaptured(event) {\n const submitter = findSubmitterFromClickTarget(event.target);\n if (submitter && submitter.form) {\n submittersByForm.set(submitter.form, submitter);\n }\n}\n(function () {\n if (\"submitter\" in Event.prototype) return;\n let prototype = window.Event.prototype;\n if (\"SubmitEvent\" in window && /Apple Computer/.test(navigator.vendor)) {\n prototype = window.SubmitEvent.prototype;\n } else if (\"SubmitEvent\" in window) {\n return;\n }\n addEventListener(\"click\", clickCaptured, true);\n Object.defineProperty(prototype, \"submitter\", {\n get() {\n if (this.type == \"submit\" && this.target instanceof HTMLFormElement) {\n return submittersByForm.get(this.target);\n }\n }\n });\n})();\nvar FrameLoadingStyle;\n(function (FrameLoadingStyle) {\n FrameLoadingStyle[\"eager\"] = \"eager\";\n FrameLoadingStyle[\"lazy\"] = \"lazy\";\n})(FrameLoadingStyle || (FrameLoadingStyle = {}));\nclass FrameElement extends HTMLElement {\n static get observedAttributes() {\n return [\"disabled\", \"complete\", \"loading\", \"src\"];\n }\n constructor() {\n super();\n this.loaded = Promise.resolve();\n this.delegate = new FrameElement.delegateConstructor(this);\n }\n connectedCallback() {\n this.delegate.connect();\n }\n disconnectedCallback() {\n this.delegate.disconnect();\n }\n reload() {\n return this.delegate.sourceURLReloaded();\n }\n attributeChangedCallback(name) {\n if (name == \"loading\") {\n this.delegate.loadingStyleChanged();\n } else if (name == \"complete\") {\n this.delegate.completeChanged();\n } else if (name == \"src\") {\n this.delegate.sourceURLChanged();\n } else {\n this.delegate.disabledChanged();\n }\n }\n get src() {\n return this.getAttribute(\"src\");\n }\n set src(value) {\n if (value) {\n this.setAttribute(\"src\", value);\n } else {\n this.removeAttribute(\"src\");\n }\n }\n get loading() {\n return frameLoadingStyleFromString(this.getAttribute(\"loading\") || \"\");\n }\n set loading(value) {\n if (value) {\n this.setAttribute(\"loading\", value);\n } else {\n this.removeAttribute(\"loading\");\n }\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(value) {\n if (value) {\n this.setAttribute(\"disabled\", \"\");\n } else {\n this.removeAttribute(\"disabled\");\n }\n }\n get autoscroll() {\n return this.hasAttribute(\"autoscroll\");\n }\n set autoscroll(value) {\n if (value) {\n this.setAttribute(\"autoscroll\", \"\");\n } else {\n this.removeAttribute(\"autoscroll\");\n }\n }\n get complete() {\n return !this.delegate.isLoading;\n }\n get isActive() {\n return this.ownerDocument === document && !this.isPreview;\n }\n get isPreview() {\n var _a, _b;\n return (_b = (_a = this.ownerDocument) === null || _a === void 0 ? void 0 : _a.documentElement) === null || _b === void 0 ? void 0 : _b.hasAttribute(\"data-turbo-preview\");\n }\n}\nfunction frameLoadingStyleFromString(style) {\n switch (style.toLowerCase()) {\n case \"lazy\":\n return FrameLoadingStyle.lazy;\n default:\n return FrameLoadingStyle.eager;\n }\n}\nfunction expandURL(locatable) {\n return new URL(locatable.toString(), document.baseURI);\n}\nfunction getAnchor(url) {\n let anchorMatch;\n if (url.hash) {\n return url.hash.slice(1);\n } else if (anchorMatch = url.href.match(/#(.*)$/)) {\n return anchorMatch[1];\n }\n}\nfunction getAction(form, submitter) {\n const action = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"formaction\")) || form.getAttribute(\"action\") || form.action;\n return expandURL(action);\n}\nfunction getExtension(url) {\n return (getLastPathComponent(url).match(/\\.[^.]*$/) || [])[0] || \"\";\n}\nfunction isHTML(url) {\n return !!getExtension(url).match(/^(?:|\\.(?:htm|html|xhtml|php))$/);\n}\nfunction isPrefixedBy(baseURL, url) {\n const prefix = getPrefix(url);\n return baseURL.href === expandURL(prefix).href || baseURL.href.startsWith(prefix);\n}\nfunction locationIsVisitable(location, rootLocation) {\n return isPrefixedBy(location, rootLocation) && isHTML(location);\n}\nfunction getRequestURL(url) {\n const anchor = getAnchor(url);\n return anchor != null ? url.href.slice(0, -(anchor.length + 1)) : url.href;\n}\nfunction toCacheKey(url) {\n return getRequestURL(url);\n}\nfunction urlsAreEqual(left, right) {\n return expandURL(left).href == expandURL(right).href;\n}\nfunction getPathComponents(url) {\n return url.pathname.split(\"/\").slice(1);\n}\nfunction getLastPathComponent(url) {\n return getPathComponents(url).slice(-1)[0];\n}\nfunction getPrefix(url) {\n return addTrailingSlash(url.origin + url.pathname);\n}\nfunction addTrailingSlash(value) {\n return value.endsWith(\"/\") ? value : value + \"/\";\n}\nclass FetchResponse {\n constructor(response) {\n this.response = response;\n }\n get succeeded() {\n return this.response.ok;\n }\n get failed() {\n return !this.succeeded;\n }\n get clientError() {\n return this.statusCode >= 400 && this.statusCode <= 499;\n }\n get serverError() {\n return this.statusCode >= 500 && this.statusCode <= 599;\n }\n get redirected() {\n return this.response.redirected;\n }\n get location() {\n return expandURL(this.response.url);\n }\n get isHTML() {\n return this.contentType && this.contentType.match(/^(?:text\\/([^\\s;,]+\\b)?html|application\\/xhtml\\+xml)\\b/);\n }\n get statusCode() {\n return this.response.status;\n }\n get contentType() {\n return this.header(\"Content-Type\");\n }\n get responseText() {\n return this.response.clone().text();\n }\n get responseHTML() {\n if (this.isHTML) {\n return this.response.clone().text();\n } else {\n return Promise.resolve(undefined);\n }\n }\n header(name) {\n return this.response.headers.get(name);\n }\n}\nfunction activateScriptElement(element) {\n if (element.getAttribute(\"data-turbo-eval\") == \"false\") {\n return element;\n } else {\n const createdScriptElement = document.createElement(\"script\");\n const cspNonce = getMetaContent(\"csp-nonce\");\n if (cspNonce) {\n createdScriptElement.nonce = cspNonce;\n }\n createdScriptElement.textContent = element.textContent;\n createdScriptElement.async = false;\n copyElementAttributes(createdScriptElement, element);\n return createdScriptElement;\n }\n}\nfunction copyElementAttributes(destinationElement, sourceElement) {\n for (const _ref of sourceElement.attributes) {\n const name = _ref.name;\n const value = _ref.value;\n destinationElement.setAttribute(name, value);\n }\n}\nfunction createDocumentFragment(html) {\n const template = document.createElement(\"template\");\n template.innerHTML = html;\n return template.content;\n}\nfunction dispatch(eventName) {\n let _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n target = _ref2.target,\n cancelable = _ref2.cancelable,\n detail = _ref2.detail;\n const event = new CustomEvent(eventName, {\n cancelable,\n bubbles: true,\n composed: true,\n detail\n });\n if (target && target.isConnected) {\n target.dispatchEvent(event);\n } else {\n document.documentElement.dispatchEvent(event);\n }\n return event;\n}\nfunction nextAnimationFrame() {\n return new Promise(resolve => requestAnimationFrame(() => resolve()));\n}\nfunction nextEventLoopTick() {\n return new Promise(resolve => setTimeout(() => resolve(), 0));\n}\nfunction nextMicrotask() {\n return Promise.resolve();\n}\nfunction parseHTMLDocument() {\n let html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"\";\n return new DOMParser().parseFromString(html, \"text/html\");\n}\nfunction unindent(strings) {\n for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n values[_key - 1] = arguments[_key];\n }\n const lines = interpolate(strings, values).replace(/^\\n/, \"\").split(\"\\n\");\n const match = lines[0].match(/^\\s+/);\n const indent = match ? match[0].length : 0;\n return lines.map(line => line.slice(indent)).join(\"\\n\");\n}\nfunction interpolate(strings, values) {\n return strings.reduce((result, string, i) => {\n const value = values[i] == undefined ? \"\" : values[i];\n return result + string + value;\n }, \"\");\n}\nfunction uuid() {\n return Array.from({\n length: 36\n }).map((_, i) => {\n if (i == 8 || i == 13 || i == 18 || i == 23) {\n return \"-\";\n } else if (i == 14) {\n return \"4\";\n } else if (i == 19) {\n return (Math.floor(Math.random() * 4) + 8).toString(16);\n } else {\n return Math.floor(Math.random() * 15).toString(16);\n }\n }).join(\"\");\n}\nfunction getAttribute(attributeName) {\n for (var _len2 = arguments.length, elements = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n elements[_key2 - 1] = arguments[_key2];\n }\n for (const value of elements.map(element => element === null || element === void 0 ? void 0 : element.getAttribute(attributeName))) {\n if (typeof value == \"string\") return value;\n }\n return null;\n}\nfunction hasAttribute(attributeName) {\n for (var _len3 = arguments.length, elements = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n elements[_key3 - 1] = arguments[_key3];\n }\n return elements.some(element => element && element.hasAttribute(attributeName));\n}\nfunction markAsBusy() {\n for (var _len4 = arguments.length, elements = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n elements[_key4] = arguments[_key4];\n }\n for (const element of elements) {\n if (element.localName == \"turbo-frame\") {\n element.setAttribute(\"busy\", \"\");\n }\n element.setAttribute(\"aria-busy\", \"true\");\n }\n}\nfunction clearBusyState() {\n for (var _len5 = arguments.length, elements = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n elements[_key5] = arguments[_key5];\n }\n for (const element of elements) {\n if (element.localName == \"turbo-frame\") {\n element.removeAttribute(\"busy\");\n }\n element.removeAttribute(\"aria-busy\");\n }\n}\nfunction waitForLoad(element) {\n let timeoutInMilliseconds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2000;\n return new Promise(resolve => {\n const onComplete = () => {\n element.removeEventListener(\"error\", onComplete);\n element.removeEventListener(\"load\", onComplete);\n resolve();\n };\n element.addEventListener(\"load\", onComplete, {\n once: true\n });\n element.addEventListener(\"error\", onComplete, {\n once: true\n });\n setTimeout(resolve, timeoutInMilliseconds);\n });\n}\nfunction getHistoryMethodForAction(action) {\n switch (action) {\n case \"replace\":\n return history.replaceState;\n case \"advance\":\n case \"restore\":\n return history.pushState;\n }\n}\nfunction isAction(action) {\n return action == \"advance\" || action == \"replace\" || action == \"restore\";\n}\nfunction getVisitAction() {\n for (var _len6 = arguments.length, elements = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n elements[_key6] = arguments[_key6];\n }\n const action = getAttribute(\"data-turbo-action\", ...elements);\n return isAction(action) ? action : null;\n}\nfunction getMetaElement(name) {\n return document.querySelector(`meta[name=\"${name}\"]`);\n}\nfunction getMetaContent(name) {\n const element = getMetaElement(name);\n return element && element.content;\n}\nfunction setMetaContent(name, content) {\n let element = getMetaElement(name);\n if (!element) {\n element = document.createElement(\"meta\");\n element.setAttribute(\"name\", name);\n document.head.appendChild(element);\n }\n element.setAttribute(\"content\", content);\n return element;\n}\nfunction findClosestRecursively(element, selector) {\n var _a;\n if (element instanceof Element) {\n return element.closest(selector) || findClosestRecursively(element.assignedSlot || ((_a = element.getRootNode()) === null || _a === void 0 ? void 0 : _a.host), selector);\n }\n}\nvar FetchMethod;\n(function (FetchMethod) {\n FetchMethod[FetchMethod[\"get\"] = 0] = \"get\";\n FetchMethod[FetchMethod[\"post\"] = 1] = \"post\";\n FetchMethod[FetchMethod[\"put\"] = 2] = \"put\";\n FetchMethod[FetchMethod[\"patch\"] = 3] = \"patch\";\n FetchMethod[FetchMethod[\"delete\"] = 4] = \"delete\";\n})(FetchMethod || (FetchMethod = {}));\nfunction fetchMethodFromString(method) {\n switch (method.toLowerCase()) {\n case \"get\":\n return FetchMethod.get;\n case \"post\":\n return FetchMethod.post;\n case \"put\":\n return FetchMethod.put;\n case \"patch\":\n return FetchMethod.patch;\n case \"delete\":\n return FetchMethod.delete;\n }\n}\nclass FetchRequest {\n constructor(delegate, method, location) {\n let body = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : new URLSearchParams();\n let target = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;\n this.abortController = new AbortController();\n this.resolveRequestPromise = _value => {};\n this.delegate = delegate;\n this.method = method;\n this.headers = this.defaultHeaders;\n this.body = body;\n this.url = location;\n this.target = target;\n }\n get location() {\n return this.url;\n }\n get params() {\n return this.url.searchParams;\n }\n get entries() {\n return this.body ? Array.from(this.body.entries()) : [];\n }\n cancel() {\n this.abortController.abort();\n }\n async perform() {\n const fetchOptions = this.fetchOptions;\n this.delegate.prepareRequest(this);\n await this.allowRequestToBeIntercepted(fetchOptions);\n try {\n this.delegate.requestStarted(this);\n const response = await fetch(this.url.href, fetchOptions);\n return await this.receive(response);\n } catch (error) {\n if (error.name !== \"AbortError\") {\n if (this.willDelegateErrorHandling(error)) {\n this.delegate.requestErrored(this, error);\n }\n throw error;\n }\n } finally {\n this.delegate.requestFinished(this);\n }\n }\n async receive(response) {\n const fetchResponse = new FetchResponse(response);\n const event = dispatch(\"turbo:before-fetch-response\", {\n cancelable: true,\n detail: {\n fetchResponse\n },\n target: this.target\n });\n if (event.defaultPrevented) {\n this.delegate.requestPreventedHandlingResponse(this, fetchResponse);\n } else if (fetchResponse.succeeded) {\n this.delegate.requestSucceededWithResponse(this, fetchResponse);\n } else {\n this.delegate.requestFailedWithResponse(this, fetchResponse);\n }\n return fetchResponse;\n }\n get fetchOptions() {\n var _a;\n return {\n method: FetchMethod[this.method].toUpperCase(),\n credentials: \"same-origin\",\n headers: this.headers,\n redirect: \"follow\",\n body: this.isSafe ? null : this.body,\n signal: this.abortSignal,\n referrer: (_a = this.delegate.referrer) === null || _a === void 0 ? void 0 : _a.href\n };\n }\n get defaultHeaders() {\n return {\n Accept: \"text/html, application/xhtml+xml\"\n };\n }\n get isSafe() {\n return this.method === FetchMethod.get;\n }\n get abortSignal() {\n return this.abortController.signal;\n }\n acceptResponseType(mimeType) {\n this.headers[\"Accept\"] = [mimeType, this.headers[\"Accept\"]].join(\", \");\n }\n async allowRequestToBeIntercepted(fetchOptions) {\n const requestInterception = new Promise(resolve => this.resolveRequestPromise = resolve);\n const event = dispatch(\"turbo:before-fetch-request\", {\n cancelable: true,\n detail: {\n fetchOptions,\n url: this.url,\n resume: this.resolveRequestPromise\n },\n target: this.target\n });\n if (event.defaultPrevented) await requestInterception;\n }\n willDelegateErrorHandling(error) {\n const event = dispatch(\"turbo:fetch-request-error\", {\n target: this.target,\n cancelable: true,\n detail: {\n request: this,\n error: error\n }\n });\n return !event.defaultPrevented;\n }\n}\nclass AppearanceObserver {\n constructor(delegate, element) {\n this.started = false;\n this.intersect = entries => {\n const lastEntry = entries.slice(-1)[0];\n if (lastEntry === null || lastEntry === void 0 ? void 0 : lastEntry.isIntersecting) {\n this.delegate.elementAppearedInViewport(this.element);\n }\n };\n this.delegate = delegate;\n this.element = element;\n this.intersectionObserver = new IntersectionObserver(this.intersect);\n }\n start() {\n if (!this.started) {\n this.started = true;\n this.intersectionObserver.observe(this.element);\n }\n }\n stop() {\n if (this.started) {\n this.started = false;\n this.intersectionObserver.unobserve(this.element);\n }\n }\n}\nclass StreamMessage {\n static wrap(message) {\n if (typeof message == \"string\") {\n return new this(createDocumentFragment(message));\n } else {\n return message;\n }\n }\n constructor(fragment) {\n this.fragment = importStreamElements(fragment);\n }\n}\nStreamMessage.contentType = \"text/vnd.turbo-stream.html\";\nfunction importStreamElements(fragment) {\n for (const element of fragment.querySelectorAll(\"turbo-stream\")) {\n const streamElement = document.importNode(element, true);\n for (const inertScriptElement of streamElement.templateElement.content.querySelectorAll(\"script\")) {\n inertScriptElement.replaceWith(activateScriptElement(inertScriptElement));\n }\n element.replaceWith(streamElement);\n }\n return fragment;\n}\nvar FormSubmissionState;\n(function (FormSubmissionState) {\n FormSubmissionState[FormSubmissionState[\"initialized\"] = 0] = \"initialized\";\n FormSubmissionState[FormSubmissionState[\"requesting\"] = 1] = \"requesting\";\n FormSubmissionState[FormSubmissionState[\"waiting\"] = 2] = \"waiting\";\n FormSubmissionState[FormSubmissionState[\"receiving\"] = 3] = \"receiving\";\n FormSubmissionState[FormSubmissionState[\"stopping\"] = 4] = \"stopping\";\n FormSubmissionState[FormSubmissionState[\"stopped\"] = 5] = \"stopped\";\n})(FormSubmissionState || (FormSubmissionState = {}));\nvar FormEnctype;\n(function (FormEnctype) {\n FormEnctype[\"urlEncoded\"] = \"application/x-www-form-urlencoded\";\n FormEnctype[\"multipart\"] = \"multipart/form-data\";\n FormEnctype[\"plain\"] = \"text/plain\";\n})(FormEnctype || (FormEnctype = {}));\nfunction formEnctypeFromString(encoding) {\n switch (encoding.toLowerCase()) {\n case FormEnctype.multipart:\n return FormEnctype.multipart;\n case FormEnctype.plain:\n return FormEnctype.plain;\n default:\n return FormEnctype.urlEncoded;\n }\n}\nclass FormSubmission {\n static confirmMethod(message, _element, _submitter) {\n return Promise.resolve(confirm(message));\n }\n constructor(delegate, formElement, submitter) {\n let mustRedirect = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n this.state = FormSubmissionState.initialized;\n this.delegate = delegate;\n this.formElement = formElement;\n this.submitter = submitter;\n this.formData = buildFormData(formElement, submitter);\n this.location = expandURL(this.action);\n if (this.method == FetchMethod.get) {\n mergeFormDataEntries(this.location, [...this.body.entries()]);\n }\n this.fetchRequest = new FetchRequest(this, this.method, this.location, this.body, this.formElement);\n this.mustRedirect = mustRedirect;\n }\n get method() {\n var _a;\n const method = ((_a = this.submitter) === null || _a === void 0 ? void 0 : _a.getAttribute(\"formmethod\")) || this.formElement.getAttribute(\"method\") || \"\";\n return fetchMethodFromString(method.toLowerCase()) || FetchMethod.get;\n }\n get action() {\n var _a;\n const formElementAction = typeof this.formElement.action === \"string\" ? this.formElement.action : null;\n if ((_a = this.submitter) === null || _a === void 0 ? void 0 : _a.hasAttribute(\"formaction\")) {\n return this.submitter.getAttribute(\"formaction\") || \"\";\n } else {\n return this.formElement.getAttribute(\"action\") || formElementAction || \"\";\n }\n }\n get body() {\n if (this.enctype == FormEnctype.urlEncoded || this.method == FetchMethod.get) {\n return new URLSearchParams(this.stringFormData);\n } else {\n return this.formData;\n }\n }\n get enctype() {\n var _a;\n return formEnctypeFromString(((_a = this.submitter) === null || _a === void 0 ? void 0 : _a.getAttribute(\"formenctype\")) || this.formElement.enctype);\n }\n get isSafe() {\n return this.fetchRequest.isSafe;\n }\n get stringFormData() {\n return [...this.formData].reduce((entries, _ref3) => {\n let _ref4 = _slicedToArray(_ref3, 2),\n name = _ref4[0],\n value = _ref4[1];\n return entries.concat(typeof value == \"string\" ? [[name, value]] : []);\n }, []);\n }\n async start() {\n const _FormSubmissionState = FormSubmissionState,\n initialized = _FormSubmissionState.initialized,\n requesting = _FormSubmissionState.requesting;\n const confirmationMessage = getAttribute(\"data-turbo-confirm\", this.submitter, this.formElement);\n if (typeof confirmationMessage === \"string\") {\n const answer = await FormSubmission.confirmMethod(confirmationMessage, this.formElement, this.submitter);\n if (!answer) {\n return;\n }\n }\n if (this.state == initialized) {\n this.state = requesting;\n return this.fetchRequest.perform();\n }\n }\n stop() {\n const _FormSubmissionState2 = FormSubmissionState,\n stopping = _FormSubmissionState2.stopping,\n stopped = _FormSubmissionState2.stopped;\n if (this.state != stopping && this.state != stopped) {\n this.state = stopping;\n this.fetchRequest.cancel();\n return true;\n }\n }\n prepareRequest(request) {\n if (!request.isSafe) {\n const token = getCookieValue(getMetaContent(\"csrf-param\")) || getMetaContent(\"csrf-token\");\n if (token) {\n request.headers[\"X-CSRF-Token\"] = token;\n }\n }\n if (this.requestAcceptsTurboStreamResponse(request)) {\n request.acceptResponseType(StreamMessage.contentType);\n }\n }\n requestStarted(_request) {\n var _a;\n this.state = FormSubmissionState.waiting;\n (_a = this.submitter) === null || _a === void 0 ? void 0 : _a.setAttribute(\"disabled\", \"\");\n this.setSubmitsWith();\n dispatch(\"turbo:submit-start\", {\n target: this.formElement,\n detail: {\n formSubmission: this\n }\n });\n this.delegate.formSubmissionStarted(this);\n }\n requestPreventedHandlingResponse(request, response) {\n this.result = {\n success: response.succeeded,\n fetchResponse: response\n };\n }\n requestSucceededWithResponse(request, response) {\n if (response.clientError || response.serverError) {\n this.delegate.formSubmissionFailedWithResponse(this, response);\n } else if (this.requestMustRedirect(request) && responseSucceededWithoutRedirect(response)) {\n const error = new Error(\"Form responses must redirect to another location\");\n this.delegate.formSubmissionErrored(this, error);\n } else {\n this.state = FormSubmissionState.receiving;\n this.result = {\n success: true,\n fetchResponse: response\n };\n this.delegate.formSubmissionSucceededWithResponse(this, response);\n }\n }\n requestFailedWithResponse(request, response) {\n this.result = {\n success: false,\n fetchResponse: response\n };\n this.delegate.formSubmissionFailedWithResponse(this, response);\n }\n requestErrored(request, error) {\n this.result = {\n success: false,\n error\n };\n this.delegate.formSubmissionErrored(this, error);\n }\n requestFinished(_request) {\n var _a;\n this.state = FormSubmissionState.stopped;\n (_a = this.submitter) === null || _a === void 0 ? void 0 : _a.removeAttribute(\"disabled\");\n this.resetSubmitterText();\n dispatch(\"turbo:submit-end\", {\n target: this.formElement,\n detail: Object.assign({\n formSubmission: this\n }, this.result)\n });\n this.delegate.formSubmissionFinished(this);\n }\n setSubmitsWith() {\n if (!this.submitter || !this.submitsWith) return;\n if (this.submitter.matches(\"button\")) {\n this.originalSubmitText = this.submitter.innerHTML;\n this.submitter.innerHTML = this.submitsWith;\n } else if (this.submitter.matches(\"input\")) {\n const input = this.submitter;\n this.originalSubmitText = input.value;\n input.value = this.submitsWith;\n }\n }\n resetSubmitterText() {\n if (!this.submitter || !this.originalSubmitText) return;\n if (this.submitter.matches(\"button\")) {\n this.submitter.innerHTML = this.originalSubmitText;\n } else if (this.submitter.matches(\"input\")) {\n const input = this.submitter;\n input.value = this.originalSubmitText;\n }\n }\n requestMustRedirect(request) {\n return !request.isSafe && this.mustRedirect;\n }\n requestAcceptsTurboStreamResponse(request) {\n return !request.isSafe || hasAttribute(\"data-turbo-stream\", this.submitter, this.formElement);\n }\n get submitsWith() {\n var _a;\n return (_a = this.submitter) === null || _a === void 0 ? void 0 : _a.getAttribute(\"data-turbo-submits-with\");\n }\n}\nfunction buildFormData(formElement, submitter) {\n const formData = new FormData(formElement);\n const name = submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"name\");\n const value = submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"value\");\n if (name) {\n formData.append(name, value || \"\");\n }\n return formData;\n}\nfunction getCookieValue(cookieName) {\n if (cookieName != null) {\n const cookies = document.cookie ? document.cookie.split(\"; \") : [];\n const cookie = cookies.find(cookie => cookie.startsWith(cookieName));\n if (cookie) {\n const value = cookie.split(\"=\").slice(1).join(\"=\");\n return value ? decodeURIComponent(value) : undefined;\n }\n }\n}\nfunction responseSucceededWithoutRedirect(response) {\n return response.statusCode == 200 && !response.redirected;\n}\nfunction mergeFormDataEntries(url, entries) {\n const searchParams = new URLSearchParams();\n for (const _ref5 of entries) {\n var _ref6 = _slicedToArray(_ref5, 2);\n const name = _ref6[0];\n const value = _ref6[1];\n if (value instanceof File) continue;\n searchParams.append(name, value);\n }\n url.search = searchParams.toString();\n return url;\n}\nclass Snapshot {\n constructor(element) {\n this.element = element;\n }\n get activeElement() {\n return this.element.ownerDocument.activeElement;\n }\n get children() {\n return [...this.element.children];\n }\n hasAnchor(anchor) {\n return this.getElementForAnchor(anchor) != null;\n }\n getElementForAnchor(anchor) {\n return anchor ? this.element.querySelector(`[id='${anchor}'], a[name='${anchor}']`) : null;\n }\n get isConnected() {\n return this.element.isConnected;\n }\n get firstAutofocusableElement() {\n const inertDisabledOrHidden = \"[inert], :disabled, [hidden], details:not([open]), dialog:not([open])\";\n for (const element of this.element.querySelectorAll(\"[autofocus]\")) {\n if (element.closest(inertDisabledOrHidden) == null) return element;else continue;\n }\n return null;\n }\n get permanentElements() {\n return queryPermanentElementsAll(this.element);\n }\n getPermanentElementById(id) {\n return getPermanentElementById(this.element, id);\n }\n getPermanentElementMapForSnapshot(snapshot) {\n const permanentElementMap = {};\n for (const currentPermanentElement of this.permanentElements) {\n const id = currentPermanentElement.id;\n const newPermanentElement = snapshot.getPermanentElementById(id);\n if (newPermanentElement) {\n permanentElementMap[id] = [currentPermanentElement, newPermanentElement];\n }\n }\n return permanentElementMap;\n }\n}\nfunction getPermanentElementById(node, id) {\n return node.querySelector(`#${id}[data-turbo-permanent]`);\n}\nfunction queryPermanentElementsAll(node) {\n return node.querySelectorAll(\"[id][data-turbo-permanent]\");\n}\nclass FormSubmitObserver {\n constructor(delegate, eventTarget) {\n this.started = false;\n this.submitCaptured = () => {\n this.eventTarget.removeEventListener(\"submit\", this.submitBubbled, false);\n this.eventTarget.addEventListener(\"submit\", this.submitBubbled, false);\n };\n this.submitBubbled = event => {\n if (!event.defaultPrevented) {\n const form = event.target instanceof HTMLFormElement ? event.target : undefined;\n const submitter = event.submitter || undefined;\n if (form && submissionDoesNotDismissDialog(form, submitter) && submissionDoesNotTargetIFrame(form, submitter) && this.delegate.willSubmitForm(form, submitter)) {\n event.preventDefault();\n event.stopImmediatePropagation();\n this.delegate.formSubmitted(form, submitter);\n }\n }\n };\n this.delegate = delegate;\n this.eventTarget = eventTarget;\n }\n start() {\n if (!this.started) {\n this.eventTarget.addEventListener(\"submit\", this.submitCaptured, true);\n this.started = true;\n }\n }\n stop() {\n if (this.started) {\n this.eventTarget.removeEventListener(\"submit\", this.submitCaptured, true);\n this.started = false;\n }\n }\n}\nfunction submissionDoesNotDismissDialog(form, submitter) {\n const method = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"formmethod\")) || form.getAttribute(\"method\");\n return method != \"dialog\";\n}\nfunction submissionDoesNotTargetIFrame(form, submitter) {\n if ((submitter === null || submitter === void 0 ? void 0 : submitter.hasAttribute(\"formtarget\")) || form.hasAttribute(\"target\")) {\n const target = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"formtarget\")) || form.target;\n for (const element of document.getElementsByName(target)) {\n if (element instanceof HTMLIFrameElement) return false;\n }\n return true;\n } else {\n return true;\n }\n}\nclass View {\n constructor(delegate, element) {\n this.resolveRenderPromise = _value => {};\n this.resolveInterceptionPromise = _value => {};\n this.delegate = delegate;\n this.element = element;\n }\n scrollToAnchor(anchor) {\n const element = this.snapshot.getElementForAnchor(anchor);\n if (element) {\n this.scrollToElement(element);\n this.focusElement(element);\n } else {\n this.scrollToPosition({\n x: 0,\n y: 0\n });\n }\n }\n scrollToAnchorFromLocation(location) {\n this.scrollToAnchor(getAnchor(location));\n }\n scrollToElement(element) {\n element.scrollIntoView();\n }\n focusElement(element) {\n if (element instanceof HTMLElement) {\n if (element.hasAttribute(\"tabindex\")) {\n element.focus();\n } else {\n element.setAttribute(\"tabindex\", \"-1\");\n element.focus();\n element.removeAttribute(\"tabindex\");\n }\n }\n }\n scrollToPosition(_ref7) {\n let x = _ref7.x,\n y = _ref7.y;\n this.scrollRoot.scrollTo(x, y);\n }\n scrollToTop() {\n this.scrollToPosition({\n x: 0,\n y: 0\n });\n }\n get scrollRoot() {\n return window;\n }\n async render(renderer) {\n const isPreview = renderer.isPreview,\n shouldRender = renderer.shouldRender,\n snapshot = renderer.newSnapshot;\n if (shouldRender) {\n try {\n this.renderPromise = new Promise(resolve => this.resolveRenderPromise = resolve);\n this.renderer = renderer;\n await this.prepareToRenderSnapshot(renderer);\n const renderInterception = new Promise(resolve => this.resolveInterceptionPromise = resolve);\n const options = {\n resume: this.resolveInterceptionPromise,\n render: this.renderer.renderElement\n };\n const immediateRender = this.delegate.allowsImmediateRender(snapshot, options);\n if (!immediateRender) await renderInterception;\n await this.renderSnapshot(renderer);\n this.delegate.viewRenderedSnapshot(snapshot, isPreview);\n this.delegate.preloadOnLoadLinksForView(this.element);\n this.finishRenderingSnapshot(renderer);\n } finally {\n delete this.renderer;\n this.resolveRenderPromise(undefined);\n delete this.renderPromise;\n }\n } else {\n this.invalidate(renderer.reloadReason);\n }\n }\n invalidate(reason) {\n this.delegate.viewInvalidated(reason);\n }\n async prepareToRenderSnapshot(renderer) {\n this.markAsPreview(renderer.isPreview);\n await renderer.prepareToRender();\n }\n markAsPreview(isPreview) {\n if (isPreview) {\n this.element.setAttribute(\"data-turbo-preview\", \"\");\n } else {\n this.element.removeAttribute(\"data-turbo-preview\");\n }\n }\n async renderSnapshot(renderer) {\n await renderer.render();\n }\n finishRenderingSnapshot(renderer) {\n renderer.finishRendering();\n }\n}\nclass FrameView extends View {\n missing() {\n this.element.innerHTML = `Content missing`;\n }\n get snapshot() {\n return new Snapshot(this.element);\n }\n}\nclass LinkInterceptor {\n constructor(delegate, element) {\n this.clickBubbled = event => {\n if (this.respondsToEventTarget(event.target)) {\n this.clickEvent = event;\n } else {\n delete this.clickEvent;\n }\n };\n this.linkClicked = event => {\n if (this.clickEvent && this.respondsToEventTarget(event.target) && event.target instanceof Element) {\n if (this.delegate.shouldInterceptLinkClick(event.target, event.detail.url, event.detail.originalEvent)) {\n this.clickEvent.preventDefault();\n event.preventDefault();\n this.delegate.linkClickIntercepted(event.target, event.detail.url, event.detail.originalEvent);\n }\n }\n delete this.clickEvent;\n };\n this.willVisit = _event => {\n delete this.clickEvent;\n };\n this.delegate = delegate;\n this.element = element;\n }\n start() {\n this.element.addEventListener(\"click\", this.clickBubbled);\n document.addEventListener(\"turbo:click\", this.linkClicked);\n document.addEventListener(\"turbo:before-visit\", this.willVisit);\n }\n stop() {\n this.element.removeEventListener(\"click\", this.clickBubbled);\n document.removeEventListener(\"turbo:click\", this.linkClicked);\n document.removeEventListener(\"turbo:before-visit\", this.willVisit);\n }\n respondsToEventTarget(target) {\n const element = target instanceof Element ? target : target instanceof Node ? target.parentElement : null;\n return element && element.closest(\"turbo-frame, html\") == this.element;\n }\n}\nclass LinkClickObserver {\n constructor(delegate, eventTarget) {\n this.started = false;\n this.clickCaptured = () => {\n this.eventTarget.removeEventListener(\"click\", this.clickBubbled, false);\n this.eventTarget.addEventListener(\"click\", this.clickBubbled, false);\n };\n this.clickBubbled = event => {\n if (event instanceof MouseEvent && this.clickEventIsSignificant(event)) {\n const target = event.composedPath && event.composedPath()[0] || event.target;\n const link = this.findLinkFromClickTarget(target);\n if (link && doesNotTargetIFrame(link)) {\n const location = this.getLocationForLink(link);\n if (this.delegate.willFollowLinkToLocation(link, location, event)) {\n event.preventDefault();\n this.delegate.followedLinkToLocation(link, location);\n }\n }\n }\n };\n this.delegate = delegate;\n this.eventTarget = eventTarget;\n }\n start() {\n if (!this.started) {\n this.eventTarget.addEventListener(\"click\", this.clickCaptured, true);\n this.started = true;\n }\n }\n stop() {\n if (this.started) {\n this.eventTarget.removeEventListener(\"click\", this.clickCaptured, true);\n this.started = false;\n }\n }\n clickEventIsSignificant(event) {\n return !(event.target && event.target.isContentEditable || event.defaultPrevented || event.which > 1 || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey);\n }\n findLinkFromClickTarget(target) {\n return findClosestRecursively(target, \"a[href]:not([target^=_]):not([download])\");\n }\n getLocationForLink(link) {\n return expandURL(link.getAttribute(\"href\") || \"\");\n }\n}\nfunction doesNotTargetIFrame(anchor) {\n if (anchor.hasAttribute(\"target\")) {\n for (const element of document.getElementsByName(anchor.target)) {\n if (element instanceof HTMLIFrameElement) return false;\n }\n return true;\n } else {\n return true;\n }\n}\nclass FormLinkClickObserver {\n constructor(delegate, element) {\n this.delegate = delegate;\n this.linkInterceptor = new LinkClickObserver(this, element);\n }\n start() {\n this.linkInterceptor.start();\n }\n stop() {\n this.linkInterceptor.stop();\n }\n willFollowLinkToLocation(link, location, originalEvent) {\n return this.delegate.willSubmitFormLinkToLocation(link, location, originalEvent) && link.hasAttribute(\"data-turbo-method\");\n }\n followedLinkToLocation(link, location) {\n const form = document.createElement(\"form\");\n const type = \"hidden\";\n for (const _ref8 of location.searchParams) {\n var _ref9 = _slicedToArray(_ref8, 2);\n const name = _ref9[0];\n const value = _ref9[1];\n form.append(Object.assign(document.createElement(\"input\"), {\n type,\n name,\n value\n }));\n }\n const action = Object.assign(location, {\n search: \"\"\n });\n form.setAttribute(\"data-turbo\", \"true\");\n form.setAttribute(\"action\", action.href);\n form.setAttribute(\"hidden\", \"\");\n const method = link.getAttribute(\"data-turbo-method\");\n if (method) form.setAttribute(\"method\", method);\n const turboFrame = link.getAttribute(\"data-turbo-frame\");\n if (turboFrame) form.setAttribute(\"data-turbo-frame\", turboFrame);\n const turboAction = getVisitAction(link);\n if (turboAction) form.setAttribute(\"data-turbo-action\", turboAction);\n const turboConfirm = link.getAttribute(\"data-turbo-confirm\");\n if (turboConfirm) form.setAttribute(\"data-turbo-confirm\", turboConfirm);\n const turboStream = link.hasAttribute(\"data-turbo-stream\");\n if (turboStream) form.setAttribute(\"data-turbo-stream\", \"\");\n this.delegate.submittedFormLinkToLocation(link, location, form);\n document.body.appendChild(form);\n form.addEventListener(\"turbo:submit-end\", () => form.remove(), {\n once: true\n });\n requestAnimationFrame(() => form.requestSubmit());\n }\n}\nclass Bardo {\n static async preservingPermanentElements(delegate, permanentElementMap, callback) {\n const bardo = new this(delegate, permanentElementMap);\n bardo.enter();\n await callback();\n bardo.leave();\n }\n constructor(delegate, permanentElementMap) {\n this.delegate = delegate;\n this.permanentElementMap = permanentElementMap;\n }\n enter() {\n for (const id in this.permanentElementMap) {\n const _this$permanentElemen = _slicedToArray(this.permanentElementMap[id], 2),\n currentPermanentElement = _this$permanentElemen[0],\n newPermanentElement = _this$permanentElemen[1];\n this.delegate.enteringBardo(currentPermanentElement, newPermanentElement);\n this.replaceNewPermanentElementWithPlaceholder(newPermanentElement);\n }\n }\n leave() {\n for (const id in this.permanentElementMap) {\n const _this$permanentElemen2 = _slicedToArray(this.permanentElementMap[id], 1),\n currentPermanentElement = _this$permanentElemen2[0];\n this.replaceCurrentPermanentElementWithClone(currentPermanentElement);\n this.replacePlaceholderWithPermanentElement(currentPermanentElement);\n this.delegate.leavingBardo(currentPermanentElement);\n }\n }\n replaceNewPermanentElementWithPlaceholder(permanentElement) {\n const placeholder = createPlaceholderForPermanentElement(permanentElement);\n permanentElement.replaceWith(placeholder);\n }\n replaceCurrentPermanentElementWithClone(permanentElement) {\n const clone = permanentElement.cloneNode(true);\n permanentElement.replaceWith(clone);\n }\n replacePlaceholderWithPermanentElement(permanentElement) {\n const placeholder = this.getPlaceholderById(permanentElement.id);\n placeholder === null || placeholder === void 0 ? void 0 : placeholder.replaceWith(permanentElement);\n }\n getPlaceholderById(id) {\n return this.placeholders.find(element => element.content == id);\n }\n get placeholders() {\n return [...document.querySelectorAll(\"meta[name=turbo-permanent-placeholder][content]\")];\n }\n}\nfunction createPlaceholderForPermanentElement(permanentElement) {\n const element = document.createElement(\"meta\");\n element.setAttribute(\"name\", \"turbo-permanent-placeholder\");\n element.setAttribute(\"content\", permanentElement.id);\n return element;\n}\nclass Renderer {\n constructor(currentSnapshot, newSnapshot, renderElement, isPreview) {\n let willRender = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n this.activeElement = null;\n this.currentSnapshot = currentSnapshot;\n this.newSnapshot = newSnapshot;\n this.isPreview = isPreview;\n this.willRender = willRender;\n this.renderElement = renderElement;\n this.promise = new Promise((resolve, reject) => this.resolvingFunctions = {\n resolve,\n reject\n });\n }\n get shouldRender() {\n return true;\n }\n get reloadReason() {\n return;\n }\n prepareToRender() {\n return;\n }\n finishRendering() {\n if (this.resolvingFunctions) {\n this.resolvingFunctions.resolve();\n delete this.resolvingFunctions;\n }\n }\n async preservingPermanentElements(callback) {\n await Bardo.preservingPermanentElements(this, this.permanentElementMap, callback);\n }\n focusFirstAutofocusableElement() {\n const element = this.connectedSnapshot.firstAutofocusableElement;\n if (elementIsFocusable(element)) {\n element.focus();\n }\n }\n enteringBardo(currentPermanentElement) {\n if (this.activeElement) return;\n if (currentPermanentElement.contains(this.currentSnapshot.activeElement)) {\n this.activeElement = this.currentSnapshot.activeElement;\n }\n }\n leavingBardo(currentPermanentElement) {\n if (currentPermanentElement.contains(this.activeElement) && this.activeElement instanceof HTMLElement) {\n this.activeElement.focus();\n this.activeElement = null;\n }\n }\n get connectedSnapshot() {\n return this.newSnapshot.isConnected ? this.newSnapshot : this.currentSnapshot;\n }\n get currentElement() {\n return this.currentSnapshot.element;\n }\n get newElement() {\n return this.newSnapshot.element;\n }\n get permanentElementMap() {\n return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot);\n }\n}\nfunction elementIsFocusable(element) {\n return element && typeof element.focus == \"function\";\n}\nclass FrameRenderer extends Renderer {\n static renderElement(currentElement, newElement) {\n var _a;\n const destinationRange = document.createRange();\n destinationRange.selectNodeContents(currentElement);\n destinationRange.deleteContents();\n const frameElement = newElement;\n const sourceRange = (_a = frameElement.ownerDocument) === null || _a === void 0 ? void 0 : _a.createRange();\n if (sourceRange) {\n sourceRange.selectNodeContents(frameElement);\n currentElement.appendChild(sourceRange.extractContents());\n }\n }\n constructor(delegate, currentSnapshot, newSnapshot, renderElement, isPreview) {\n let willRender = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;\n super(currentSnapshot, newSnapshot, renderElement, isPreview, willRender);\n this.delegate = delegate;\n }\n get shouldRender() {\n return true;\n }\n async render() {\n await nextAnimationFrame();\n this.preservingPermanentElements(() => {\n this.loadFrameElement();\n });\n this.scrollFrameIntoView();\n await nextAnimationFrame();\n this.focusFirstAutofocusableElement();\n await nextAnimationFrame();\n this.activateScriptElements();\n }\n loadFrameElement() {\n this.delegate.willRenderFrame(this.currentElement, this.newElement);\n this.renderElement(this.currentElement, this.newElement);\n }\n scrollFrameIntoView() {\n if (this.currentElement.autoscroll || this.newElement.autoscroll) {\n const element = this.currentElement.firstElementChild;\n const block = readScrollLogicalPosition(this.currentElement.getAttribute(\"data-autoscroll-block\"), \"end\");\n const behavior = readScrollBehavior(this.currentElement.getAttribute(\"data-autoscroll-behavior\"), \"auto\");\n if (element) {\n element.scrollIntoView({\n block,\n behavior\n });\n return true;\n }\n }\n return false;\n }\n activateScriptElements() {\n for (const inertScriptElement of this.newScriptElements) {\n const activatedScriptElement = activateScriptElement(inertScriptElement);\n inertScriptElement.replaceWith(activatedScriptElement);\n }\n }\n get newScriptElements() {\n return this.currentElement.querySelectorAll(\"script\");\n }\n}\nfunction readScrollLogicalPosition(value, defaultValue) {\n if (value == \"end\" || value == \"start\" || value == \"center\" || value == \"nearest\") {\n return value;\n } else {\n return defaultValue;\n }\n}\nfunction readScrollBehavior(value, defaultValue) {\n if (value == \"auto\" || value == \"smooth\") {\n return value;\n } else {\n return defaultValue;\n }\n}\nclass ProgressBar {\n static get defaultCSS() {\n return unindent`\n .turbo-progress-bar {\n position: fixed;\n display: block;\n top: 0;\n left: 0;\n height: 3px;\n background: #0076ff;\n z-index: 2147483647;\n transition:\n width ${ProgressBar.animationDuration}ms ease-out,\n opacity ${ProgressBar.animationDuration / 2}ms ${ProgressBar.animationDuration / 2}ms ease-in;\n transform: translate3d(0, 0, 0);\n }\n `;\n }\n constructor() {\n this.hiding = false;\n this.value = 0;\n this.visible = false;\n this.trickle = () => {\n this.setValue(this.value + Math.random() / 100);\n };\n this.stylesheetElement = this.createStylesheetElement();\n this.progressElement = this.createProgressElement();\n this.installStylesheetElement();\n this.setValue(0);\n }\n show() {\n if (!this.visible) {\n this.visible = true;\n this.installProgressElement();\n this.startTrickling();\n }\n }\n hide() {\n if (this.visible && !this.hiding) {\n this.hiding = true;\n this.fadeProgressElement(() => {\n this.uninstallProgressElement();\n this.stopTrickling();\n this.visible = false;\n this.hiding = false;\n });\n }\n }\n setValue(value) {\n this.value = value;\n this.refresh();\n }\n installStylesheetElement() {\n document.head.insertBefore(this.stylesheetElement, document.head.firstChild);\n }\n installProgressElement() {\n this.progressElement.style.width = \"0\";\n this.progressElement.style.opacity = \"1\";\n document.documentElement.insertBefore(this.progressElement, document.body);\n this.refresh();\n }\n fadeProgressElement(callback) {\n this.progressElement.style.opacity = \"0\";\n setTimeout(callback, ProgressBar.animationDuration * 1.5);\n }\n uninstallProgressElement() {\n if (this.progressElement.parentNode) {\n document.documentElement.removeChild(this.progressElement);\n }\n }\n startTrickling() {\n if (!this.trickleInterval) {\n this.trickleInterval = window.setInterval(this.trickle, ProgressBar.animationDuration);\n }\n }\n stopTrickling() {\n window.clearInterval(this.trickleInterval);\n delete this.trickleInterval;\n }\n refresh() {\n requestAnimationFrame(() => {\n this.progressElement.style.width = `${10 + this.value * 90}%`;\n });\n }\n createStylesheetElement() {\n const element = document.createElement(\"style\");\n element.type = \"text/css\";\n element.textContent = ProgressBar.defaultCSS;\n if (this.cspNonce) {\n element.nonce = this.cspNonce;\n }\n return element;\n }\n createProgressElement() {\n const element = document.createElement(\"div\");\n element.className = \"turbo-progress-bar\";\n return element;\n }\n get cspNonce() {\n return getMetaContent(\"csp-nonce\");\n }\n}\nProgressBar.animationDuration = 300;\nclass HeadSnapshot extends Snapshot {\n constructor() {\n super(...arguments);\n this.detailsByOuterHTML = this.children.filter(element => !elementIsNoscript(element)).map(element => elementWithoutNonce(element)).reduce((result, element) => {\n const outerHTML = element.outerHTML;\n const details = outerHTML in result ? result[outerHTML] : {\n type: elementType(element),\n tracked: elementIsTracked(element),\n elements: []\n };\n return Object.assign(Object.assign({}, result), {\n [outerHTML]: Object.assign(Object.assign({}, details), {\n elements: [...details.elements, element]\n })\n });\n }, {});\n }\n get trackedElementSignature() {\n return Object.keys(this.detailsByOuterHTML).filter(outerHTML => this.detailsByOuterHTML[outerHTML].tracked).join(\"\");\n }\n getScriptElementsNotInSnapshot(snapshot) {\n return this.getElementsMatchingTypeNotInSnapshot(\"script\", snapshot);\n }\n getStylesheetElementsNotInSnapshot(snapshot) {\n return this.getElementsMatchingTypeNotInSnapshot(\"stylesheet\", snapshot);\n }\n getElementsMatchingTypeNotInSnapshot(matchedType, snapshot) {\n return Object.keys(this.detailsByOuterHTML).filter(outerHTML => !(outerHTML in snapshot.detailsByOuterHTML)).map(outerHTML => this.detailsByOuterHTML[outerHTML]).filter(_ref10 => {\n let type = _ref10.type;\n return type == matchedType;\n }).map(_ref11 => {\n let _ref11$elements = _slicedToArray(_ref11.elements, 1),\n element = _ref11$elements[0];\n return element;\n });\n }\n get provisionalElements() {\n return Object.keys(this.detailsByOuterHTML).reduce((result, outerHTML) => {\n const _this$detailsByOuterH = this.detailsByOuterHTML[outerHTML],\n type = _this$detailsByOuterH.type,\n tracked = _this$detailsByOuterH.tracked,\n elements = _this$detailsByOuterH.elements;\n if (type == null && !tracked) {\n return [...result, ...elements];\n } else if (elements.length > 1) {\n return [...result, ...elements.slice(1)];\n } else {\n return result;\n }\n }, []);\n }\n getMetaValue(name) {\n const element = this.findMetaElementByName(name);\n return element ? element.getAttribute(\"content\") : null;\n }\n findMetaElementByName(name) {\n return Object.keys(this.detailsByOuterHTML).reduce((result, outerHTML) => {\n const _this$detailsByOuterH2 = _slicedToArray(this.detailsByOuterHTML[outerHTML].elements, 1),\n element = _this$detailsByOuterH2[0];\n return elementIsMetaElementWithName(element, name) ? element : result;\n }, undefined);\n }\n}\nfunction elementType(element) {\n if (elementIsScript(element)) {\n return \"script\";\n } else if (elementIsStylesheet(element)) {\n return \"stylesheet\";\n }\n}\nfunction elementIsTracked(element) {\n return element.getAttribute(\"data-turbo-track\") == \"reload\";\n}\nfunction elementIsScript(element) {\n const tagName = element.localName;\n return tagName == \"script\";\n}\nfunction elementIsNoscript(element) {\n const tagName = element.localName;\n return tagName == \"noscript\";\n}\nfunction elementIsStylesheet(element) {\n const tagName = element.localName;\n return tagName == \"style\" || tagName == \"link\" && element.getAttribute(\"rel\") == \"stylesheet\";\n}\nfunction elementIsMetaElementWithName(element, name) {\n const tagName = element.localName;\n return tagName == \"meta\" && element.getAttribute(\"name\") == name;\n}\nfunction elementWithoutNonce(element) {\n if (element.hasAttribute(\"nonce\")) {\n element.setAttribute(\"nonce\", \"\");\n }\n return element;\n}\nclass PageSnapshot extends Snapshot {\n static fromHTMLString() {\n let html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"\";\n return this.fromDocument(parseHTMLDocument(html));\n }\n static fromElement(element) {\n return this.fromDocument(element.ownerDocument);\n }\n static fromDocument(_ref12) {\n let head = _ref12.head,\n body = _ref12.body;\n return new this(body, new HeadSnapshot(head));\n }\n constructor(element, headSnapshot) {\n super(element);\n this.headSnapshot = headSnapshot;\n }\n clone() {\n const clonedElement = this.element.cloneNode(true);\n const selectElements = this.element.querySelectorAll(\"select\");\n const clonedSelectElements = clonedElement.querySelectorAll(\"select\");\n for (const _ref13 of selectElements.entries()) {\n var _ref14 = _slicedToArray(_ref13, 2);\n const index = _ref14[0];\n const source = _ref14[1];\n const clone = clonedSelectElements[index];\n for (const option of clone.selectedOptions) option.selected = false;\n for (const option of source.selectedOptions) clone.options[option.index].selected = true;\n }\n for (const clonedPasswordInput of clonedElement.querySelectorAll('input[type=\"password\"]')) {\n clonedPasswordInput.value = \"\";\n }\n return new PageSnapshot(clonedElement, this.headSnapshot);\n }\n get headElement() {\n return this.headSnapshot.element;\n }\n get rootLocation() {\n var _a;\n const root = (_a = this.getSetting(\"root\")) !== null && _a !== void 0 ? _a : \"/\";\n return expandURL(root);\n }\n get cacheControlValue() {\n return this.getSetting(\"cache-control\");\n }\n get isPreviewable() {\n return this.cacheControlValue != \"no-preview\";\n }\n get isCacheable() {\n return this.cacheControlValue != \"no-cache\";\n }\n get isVisitable() {\n return this.getSetting(\"visit-control\") != \"reload\";\n }\n getSetting(name) {\n return this.headSnapshot.getMetaValue(`turbo-${name}`);\n }\n}\nvar TimingMetric;\n(function (TimingMetric) {\n TimingMetric[\"visitStart\"] = \"visitStart\";\n TimingMetric[\"requestStart\"] = \"requestStart\";\n TimingMetric[\"requestEnd\"] = \"requestEnd\";\n TimingMetric[\"visitEnd\"] = \"visitEnd\";\n})(TimingMetric || (TimingMetric = {}));\nvar VisitState;\n(function (VisitState) {\n VisitState[\"initialized\"] = \"initialized\";\n VisitState[\"started\"] = \"started\";\n VisitState[\"canceled\"] = \"canceled\";\n VisitState[\"failed\"] = \"failed\";\n VisitState[\"completed\"] = \"completed\";\n})(VisitState || (VisitState = {}));\nconst defaultOptions = {\n action: \"advance\",\n historyChanged: false,\n visitCachedSnapshot: () => {},\n willRender: true,\n updateHistory: true,\n shouldCacheSnapshot: true,\n acceptsStreamResponse: false\n};\nvar SystemStatusCode;\n(function (SystemStatusCode) {\n SystemStatusCode[SystemStatusCode[\"networkFailure\"] = 0] = \"networkFailure\";\n SystemStatusCode[SystemStatusCode[\"timeoutFailure\"] = -1] = \"timeoutFailure\";\n SystemStatusCode[SystemStatusCode[\"contentTypeMismatch\"] = -2] = \"contentTypeMismatch\";\n})(SystemStatusCode || (SystemStatusCode = {}));\nclass Visit {\n constructor(delegate, location, restorationIdentifier) {\n let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n this.identifier = uuid();\n this.timingMetrics = {};\n this.followedRedirect = false;\n this.historyChanged = false;\n this.scrolled = false;\n this.shouldCacheSnapshot = true;\n this.acceptsStreamResponse = false;\n this.snapshotCached = false;\n this.state = VisitState.initialized;\n this.delegate = delegate;\n this.location = location;\n this.restorationIdentifier = restorationIdentifier || uuid();\n const _Object$assign = Object.assign(Object.assign({}, defaultOptions), options),\n action = _Object$assign.action,\n historyChanged = _Object$assign.historyChanged,\n referrer = _Object$assign.referrer,\n snapshot = _Object$assign.snapshot,\n snapshotHTML = _Object$assign.snapshotHTML,\n response = _Object$assign.response,\n visitCachedSnapshot = _Object$assign.visitCachedSnapshot,\n willRender = _Object$assign.willRender,\n updateHistory = _Object$assign.updateHistory,\n shouldCacheSnapshot = _Object$assign.shouldCacheSnapshot,\n acceptsStreamResponse = _Object$assign.acceptsStreamResponse;\n this.action = action;\n this.historyChanged = historyChanged;\n this.referrer = referrer;\n this.snapshot = snapshot;\n this.snapshotHTML = snapshotHTML;\n this.response = response;\n this.isSamePage = this.delegate.locationWithActionIsSamePage(this.location, this.action);\n this.visitCachedSnapshot = visitCachedSnapshot;\n this.willRender = willRender;\n this.updateHistory = updateHistory;\n this.scrolled = !willRender;\n this.shouldCacheSnapshot = shouldCacheSnapshot;\n this.acceptsStreamResponse = acceptsStreamResponse;\n }\n get adapter() {\n return this.delegate.adapter;\n }\n get view() {\n return this.delegate.view;\n }\n get history() {\n return this.delegate.history;\n }\n get restorationData() {\n return this.history.getRestorationDataForIdentifier(this.restorationIdentifier);\n }\n get silent() {\n return this.isSamePage;\n }\n start() {\n if (this.state == VisitState.initialized) {\n this.recordTimingMetric(TimingMetric.visitStart);\n this.state = VisitState.started;\n this.adapter.visitStarted(this);\n this.delegate.visitStarted(this);\n }\n }\n cancel() {\n if (this.state == VisitState.started) {\n if (this.request) {\n this.request.cancel();\n }\n this.cancelRender();\n this.state = VisitState.canceled;\n }\n }\n complete() {\n if (this.state == VisitState.started) {\n this.recordTimingMetric(TimingMetric.visitEnd);\n this.state = VisitState.completed;\n this.followRedirect();\n if (!this.followedRedirect) {\n this.adapter.visitCompleted(this);\n this.delegate.visitCompleted(this);\n }\n }\n }\n fail() {\n if (this.state == VisitState.started) {\n this.state = VisitState.failed;\n this.adapter.visitFailed(this);\n }\n }\n changeHistory() {\n var _a;\n if (!this.historyChanged && this.updateHistory) {\n const actionForHistory = this.location.href === ((_a = this.referrer) === null || _a === void 0 ? void 0 : _a.href) ? \"replace\" : this.action;\n const method = getHistoryMethodForAction(actionForHistory);\n this.history.update(method, this.location, this.restorationIdentifier);\n this.historyChanged = true;\n }\n }\n issueRequest() {\n if (this.hasPreloadedResponse()) {\n this.simulateRequest();\n } else if (this.shouldIssueRequest() && !this.request) {\n this.request = new FetchRequest(this, FetchMethod.get, this.location);\n this.request.perform();\n }\n }\n simulateRequest() {\n if (this.response) {\n this.startRequest();\n this.recordResponse();\n this.finishRequest();\n }\n }\n startRequest() {\n this.recordTimingMetric(TimingMetric.requestStart);\n this.adapter.visitRequestStarted(this);\n }\n recordResponse() {\n let response = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.response;\n this.response = response;\n if (response) {\n const statusCode = response.statusCode;\n if (isSuccessful(statusCode)) {\n this.adapter.visitRequestCompleted(this);\n } else {\n this.adapter.visitRequestFailedWithStatusCode(this, statusCode);\n }\n }\n }\n finishRequest() {\n this.recordTimingMetric(TimingMetric.requestEnd);\n this.adapter.visitRequestFinished(this);\n }\n loadResponse() {\n if (this.response) {\n const _this$response = this.response,\n statusCode = _this$response.statusCode,\n responseHTML = _this$response.responseHTML;\n this.render(async () => {\n if (this.shouldCacheSnapshot) this.cacheSnapshot();\n if (this.view.renderPromise) await this.view.renderPromise;\n if (isSuccessful(statusCode) && responseHTML != null) {\n await this.view.renderPage(PageSnapshot.fromHTMLString(responseHTML), false, this.willRender, this);\n this.performScroll();\n this.adapter.visitRendered(this);\n this.complete();\n } else {\n await this.view.renderError(PageSnapshot.fromHTMLString(responseHTML), this);\n this.adapter.visitRendered(this);\n this.fail();\n }\n });\n }\n }\n getCachedSnapshot() {\n const snapshot = this.view.getCachedSnapshotForLocation(this.location) || this.getPreloadedSnapshot();\n if (snapshot && (!getAnchor(this.location) || snapshot.hasAnchor(getAnchor(this.location)))) {\n if (this.action == \"restore\" || snapshot.isPreviewable) {\n return snapshot;\n }\n }\n }\n getPreloadedSnapshot() {\n if (this.snapshotHTML) {\n return PageSnapshot.fromHTMLString(this.snapshotHTML);\n }\n }\n hasCachedSnapshot() {\n return this.getCachedSnapshot() != null;\n }\n loadCachedSnapshot() {\n const snapshot = this.getCachedSnapshot();\n if (snapshot) {\n const isPreview = this.shouldIssueRequest();\n this.render(async () => {\n this.cacheSnapshot();\n if (this.isSamePage) {\n this.adapter.visitRendered(this);\n } else {\n if (this.view.renderPromise) await this.view.renderPromise;\n await this.view.renderPage(snapshot, isPreview, this.willRender, this);\n this.performScroll();\n this.adapter.visitRendered(this);\n if (!isPreview) {\n this.complete();\n }\n }\n });\n }\n }\n followRedirect() {\n var _a;\n if (this.redirectedToLocation && !this.followedRedirect && ((_a = this.response) === null || _a === void 0 ? void 0 : _a.redirected)) {\n this.adapter.visitProposedToLocation(this.redirectedToLocation, {\n action: \"replace\",\n response: this.response,\n shouldCacheSnapshot: false,\n willRender: false\n });\n this.followedRedirect = true;\n }\n }\n goToSamePageAnchor() {\n if (this.isSamePage) {\n this.render(async () => {\n this.cacheSnapshot();\n this.performScroll();\n this.changeHistory();\n this.adapter.visitRendered(this);\n });\n }\n }\n prepareRequest(request) {\n if (this.acceptsStreamResponse) {\n request.acceptResponseType(StreamMessage.contentType);\n }\n }\n requestStarted() {\n this.startRequest();\n }\n requestPreventedHandlingResponse(_request, _response) {}\n async requestSucceededWithResponse(request, response) {\n const responseHTML = await response.responseHTML;\n const redirected = response.redirected,\n statusCode = response.statusCode;\n if (responseHTML == undefined) {\n this.recordResponse({\n statusCode: SystemStatusCode.contentTypeMismatch,\n redirected\n });\n } else {\n this.redirectedToLocation = response.redirected ? response.location : undefined;\n this.recordResponse({\n statusCode: statusCode,\n responseHTML,\n redirected\n });\n }\n }\n async requestFailedWithResponse(request, response) {\n const responseHTML = await response.responseHTML;\n const redirected = response.redirected,\n statusCode = response.statusCode;\n if (responseHTML == undefined) {\n this.recordResponse({\n statusCode: SystemStatusCode.contentTypeMismatch,\n redirected\n });\n } else {\n this.recordResponse({\n statusCode: statusCode,\n responseHTML,\n redirected\n });\n }\n }\n requestErrored(_request, _error) {\n this.recordResponse({\n statusCode: SystemStatusCode.networkFailure,\n redirected: false\n });\n }\n requestFinished() {\n this.finishRequest();\n }\n performScroll() {\n if (!this.scrolled && !this.view.forceReloaded) {\n if (this.action == \"restore\") {\n this.scrollToRestoredPosition() || this.scrollToAnchor() || this.view.scrollToTop();\n } else {\n this.scrollToAnchor() || this.view.scrollToTop();\n }\n if (this.isSamePage) {\n this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation, this.location);\n }\n this.scrolled = true;\n }\n }\n scrollToRestoredPosition() {\n const scrollPosition = this.restorationData.scrollPosition;\n if (scrollPosition) {\n this.view.scrollToPosition(scrollPosition);\n return true;\n }\n }\n scrollToAnchor() {\n const anchor = getAnchor(this.location);\n if (anchor != null) {\n this.view.scrollToAnchor(anchor);\n return true;\n }\n }\n recordTimingMetric(metric) {\n this.timingMetrics[metric] = new Date().getTime();\n }\n getTimingMetrics() {\n return Object.assign({}, this.timingMetrics);\n }\n getHistoryMethodForAction(action) {\n switch (action) {\n case \"replace\":\n return history.replaceState;\n case \"advance\":\n case \"restore\":\n return history.pushState;\n }\n }\n hasPreloadedResponse() {\n return typeof this.response == \"object\";\n }\n shouldIssueRequest() {\n if (this.isSamePage) {\n return false;\n } else if (this.action == \"restore\") {\n return !this.hasCachedSnapshot();\n } else {\n return this.willRender;\n }\n }\n cacheSnapshot() {\n if (!this.snapshotCached) {\n this.view.cacheSnapshot(this.snapshot).then(snapshot => snapshot && this.visitCachedSnapshot(snapshot));\n this.snapshotCached = true;\n }\n }\n async render(callback) {\n this.cancelRender();\n await new Promise(resolve => {\n this.frame = requestAnimationFrame(() => resolve());\n });\n await callback();\n delete this.frame;\n }\n cancelRender() {\n if (this.frame) {\n cancelAnimationFrame(this.frame);\n delete this.frame;\n }\n }\n}\nfunction isSuccessful(statusCode) {\n return statusCode >= 200 && statusCode < 300;\n}\nclass BrowserAdapter {\n constructor(session) {\n this.progressBar = new ProgressBar();\n this.showProgressBar = () => {\n this.progressBar.show();\n };\n this.session = session;\n }\n visitProposedToLocation(location, options) {\n this.navigator.startVisit(location, (options === null || options === void 0 ? void 0 : options.restorationIdentifier) || uuid(), options);\n }\n visitStarted(visit) {\n this.location = visit.location;\n visit.loadCachedSnapshot();\n visit.issueRequest();\n visit.goToSamePageAnchor();\n }\n visitRequestStarted(visit) {\n this.progressBar.setValue(0);\n if (visit.hasCachedSnapshot() || visit.action != \"restore\") {\n this.showVisitProgressBarAfterDelay();\n } else {\n this.showProgressBar();\n }\n }\n visitRequestCompleted(visit) {\n visit.loadResponse();\n }\n visitRequestFailedWithStatusCode(visit, statusCode) {\n switch (statusCode) {\n case SystemStatusCode.networkFailure:\n case SystemStatusCode.timeoutFailure:\n case SystemStatusCode.contentTypeMismatch:\n return this.reload({\n reason: \"request_failed\",\n context: {\n statusCode\n }\n });\n default:\n return visit.loadResponse();\n }\n }\n visitRequestFinished(_visit) {\n this.progressBar.setValue(1);\n this.hideVisitProgressBar();\n }\n visitCompleted(_visit) {}\n pageInvalidated(reason) {\n this.reload(reason);\n }\n visitFailed(_visit) {}\n visitRendered(_visit) {}\n formSubmissionStarted(_formSubmission) {\n this.progressBar.setValue(0);\n this.showFormProgressBarAfterDelay();\n }\n formSubmissionFinished(_formSubmission) {\n this.progressBar.setValue(1);\n this.hideFormProgressBar();\n }\n showVisitProgressBarAfterDelay() {\n this.visitProgressBarTimeout = window.setTimeout(this.showProgressBar, this.session.progressBarDelay);\n }\n hideVisitProgressBar() {\n this.progressBar.hide();\n if (this.visitProgressBarTimeout != null) {\n window.clearTimeout(this.visitProgressBarTimeout);\n delete this.visitProgressBarTimeout;\n }\n }\n showFormProgressBarAfterDelay() {\n if (this.formProgressBarTimeout == null) {\n this.formProgressBarTimeout = window.setTimeout(this.showProgressBar, this.session.progressBarDelay);\n }\n }\n hideFormProgressBar() {\n this.progressBar.hide();\n if (this.formProgressBarTimeout != null) {\n window.clearTimeout(this.formProgressBarTimeout);\n delete this.formProgressBarTimeout;\n }\n }\n reload(reason) {\n var _a;\n dispatch(\"turbo:reload\", {\n detail: reason\n });\n window.location.href = ((_a = this.location) === null || _a === void 0 ? void 0 : _a.toString()) || window.location.href;\n }\n get navigator() {\n return this.session.navigator;\n }\n}\nclass CacheObserver {\n constructor() {\n this.selector = \"[data-turbo-temporary]\";\n this.deprecatedSelector = \"[data-turbo-cache=false]\";\n this.started = false;\n this.removeTemporaryElements = _event => {\n for (const element of this.temporaryElements) {\n element.remove();\n }\n };\n }\n start() {\n if (!this.started) {\n this.started = true;\n addEventListener(\"turbo:before-cache\", this.removeTemporaryElements, false);\n }\n }\n stop() {\n if (this.started) {\n this.started = false;\n removeEventListener(\"turbo:before-cache\", this.removeTemporaryElements, false);\n }\n }\n get temporaryElements() {\n return [...document.querySelectorAll(this.selector), ...this.temporaryElementsWithDeprecation];\n }\n get temporaryElementsWithDeprecation() {\n const elements = document.querySelectorAll(this.deprecatedSelector);\n if (elements.length) {\n console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`);\n }\n return [...elements];\n }\n}\nclass FrameRedirector {\n constructor(session, element) {\n this.session = session;\n this.element = element;\n this.linkInterceptor = new LinkInterceptor(this, element);\n this.formSubmitObserver = new FormSubmitObserver(this, element);\n }\n start() {\n this.linkInterceptor.start();\n this.formSubmitObserver.start();\n }\n stop() {\n this.linkInterceptor.stop();\n this.formSubmitObserver.stop();\n }\n shouldInterceptLinkClick(element, _location, _event) {\n return this.shouldRedirect(element);\n }\n linkClickIntercepted(element, url, event) {\n const frame = this.findFrameElement(element);\n if (frame) {\n frame.delegate.linkClickIntercepted(element, url, event);\n }\n }\n willSubmitForm(element, submitter) {\n return element.closest(\"turbo-frame\") == null && this.shouldSubmit(element, submitter) && this.shouldRedirect(element, submitter);\n }\n formSubmitted(element, submitter) {\n const frame = this.findFrameElement(element, submitter);\n if (frame) {\n frame.delegate.formSubmitted(element, submitter);\n }\n }\n shouldSubmit(form, submitter) {\n var _a;\n const action = getAction(form, submitter);\n const meta = this.element.ownerDocument.querySelector(`meta[name=\"turbo-root\"]`);\n const rootLocation = expandURL((_a = meta === null || meta === void 0 ? void 0 : meta.content) !== null && _a !== void 0 ? _a : \"/\");\n return this.shouldRedirect(form, submitter) && locationIsVisitable(action, rootLocation);\n }\n shouldRedirect(element, submitter) {\n const isNavigatable = element instanceof HTMLFormElement ? this.session.submissionIsNavigatable(element, submitter) : this.session.elementIsNavigatable(element);\n if (isNavigatable) {\n const frame = this.findFrameElement(element, submitter);\n return frame ? frame != element.closest(\"turbo-frame\") : false;\n } else {\n return false;\n }\n }\n findFrameElement(element, submitter) {\n const id = (submitter === null || submitter === void 0 ? void 0 : submitter.getAttribute(\"data-turbo-frame\")) || element.getAttribute(\"data-turbo-frame\");\n if (id && id != \"_top\") {\n const frame = this.element.querySelector(`#${id}:not([disabled])`);\n if (frame instanceof FrameElement) {\n return frame;\n }\n }\n }\n}\nclass History {\n constructor(delegate) {\n this.restorationIdentifier = uuid();\n this.restorationData = {};\n this.started = false;\n this.pageLoaded = false;\n this.onPopState = event => {\n if (this.shouldHandlePopState()) {\n const _ref15 = event.state || {},\n turbo = _ref15.turbo;\n if (turbo) {\n this.location = new URL(window.location.href);\n const restorationIdentifier = turbo.restorationIdentifier;\n this.restorationIdentifier = restorationIdentifier;\n this.delegate.historyPoppedToLocationWithRestorationIdentifier(this.location, restorationIdentifier);\n }\n }\n };\n this.onPageLoad = async _event => {\n await nextMicrotask();\n this.pageLoaded = true;\n };\n this.delegate = delegate;\n }\n start() {\n if (!this.started) {\n addEventListener(\"popstate\", this.onPopState, false);\n addEventListener(\"load\", this.onPageLoad, false);\n this.started = true;\n this.replace(new URL(window.location.href));\n }\n }\n stop() {\n if (this.started) {\n removeEventListener(\"popstate\", this.onPopState, false);\n removeEventListener(\"load\", this.onPageLoad, false);\n this.started = false;\n }\n }\n push(location, restorationIdentifier) {\n this.update(history.pushState, location, restorationIdentifier);\n }\n replace(location, restorationIdentifier) {\n this.update(history.replaceState, location, restorationIdentifier);\n }\n update(method, location) {\n let restorationIdentifier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : uuid();\n const state = {\n turbo: {\n restorationIdentifier\n }\n };\n method.call(history, state, \"\", location.href);\n this.location = location;\n this.restorationIdentifier = restorationIdentifier;\n }\n getRestorationDataForIdentifier(restorationIdentifier) {\n return this.restorationData[restorationIdentifier] || {};\n }\n updateRestorationData(additionalData) {\n const restorationIdentifier = this.restorationIdentifier;\n const restorationData = this.restorationData[restorationIdentifier];\n this.restorationData[restorationIdentifier] = Object.assign(Object.assign({}, restorationData), additionalData);\n }\n assumeControlOfScrollRestoration() {\n var _a;\n if (!this.previousScrollRestoration) {\n this.previousScrollRestoration = (_a = history.scrollRestoration) !== null && _a !== void 0 ? _a : \"auto\";\n history.scrollRestoration = \"manual\";\n }\n }\n relinquishControlOfScrollRestoration() {\n if (this.previousScrollRestoration) {\n history.scrollRestoration = this.previousScrollRestoration;\n delete this.previousScrollRestoration;\n }\n }\n shouldHandlePopState() {\n return this.pageIsLoaded();\n }\n pageIsLoaded() {\n return this.pageLoaded || document.readyState == \"complete\";\n }\n}\nclass Navigator {\n constructor(delegate) {\n this.delegate = delegate;\n }\n proposeVisit(location) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (this.delegate.allowsVisitingLocationWithAction(location, options.action)) {\n if (locationIsVisitable(location, this.view.snapshot.rootLocation)) {\n this.delegate.visitProposedToLocation(location, options);\n } else {\n window.location.href = location.toString();\n }\n }\n }\n startVisit(locatable, restorationIdentifier) {\n let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n this.stop();\n this.currentVisit = new Visit(this, expandURL(locatable), restorationIdentifier, Object.assign({\n referrer: this.location\n }, options));\n this.currentVisit.start();\n }\n submitForm(form, submitter) {\n this.stop();\n this.formSubmission = new FormSubmission(this, form, submitter, true);\n this.formSubmission.start();\n }\n stop() {\n if (this.formSubmission) {\n this.formSubmission.stop();\n delete this.formSubmission;\n }\n if (this.currentVisit) {\n this.currentVisit.cancel();\n delete this.currentVisit;\n }\n }\n get adapter() {\n return this.delegate.adapter;\n }\n get view() {\n return this.delegate.view;\n }\n get history() {\n return this.delegate.history;\n }\n formSubmissionStarted(formSubmission) {\n if (typeof this.adapter.formSubmissionStarted === \"function\") {\n this.adapter.formSubmissionStarted(formSubmission);\n }\n }\n async formSubmissionSucceededWithResponse(formSubmission, fetchResponse) {\n if (formSubmission == this.formSubmission) {\n const responseHTML = await fetchResponse.responseHTML;\n if (responseHTML) {\n const shouldCacheSnapshot = formSubmission.isSafe;\n if (!shouldCacheSnapshot) {\n this.view.clearSnapshotCache();\n }\n const statusCode = fetchResponse.statusCode,\n redirected = fetchResponse.redirected;\n const action = this.getActionForFormSubmission(formSubmission);\n const visitOptions = {\n action,\n shouldCacheSnapshot,\n response: {\n statusCode,\n responseHTML,\n redirected\n }\n };\n this.proposeVisit(fetchResponse.location, visitOptions);\n }\n }\n }\n async formSubmissionFailedWithResponse(formSubmission, fetchResponse) {\n const responseHTML = await fetchResponse.responseHTML;\n if (responseHTML) {\n const snapshot = PageSnapshot.fromHTMLString(responseHTML);\n if (fetchResponse.serverError) {\n await this.view.renderError(snapshot, this.currentVisit);\n } else {\n await this.view.renderPage(snapshot, false, true, this.currentVisit);\n }\n this.view.scrollToTop();\n this.view.clearSnapshotCache();\n }\n }\n formSubmissionErrored(formSubmission, error) {\n console.error(error);\n }\n formSubmissionFinished(formSubmission) {\n if (typeof this.adapter.formSubmissionFinished === \"function\") {\n this.adapter.formSubmissionFinished(formSubmission);\n }\n }\n visitStarted(visit) {\n this.delegate.visitStarted(visit);\n }\n visitCompleted(visit) {\n this.delegate.visitCompleted(visit);\n }\n locationWithActionIsSamePage(location, action) {\n const anchor = getAnchor(location);\n const currentAnchor = getAnchor(this.view.lastRenderedLocation);\n const isRestorationToTop = action === \"restore\" && typeof anchor === \"undefined\";\n return action !== \"replace\" && getRequestURL(location) === getRequestURL(this.view.lastRenderedLocation) && (isRestorationToTop || anchor != null && anchor !== currentAnchor);\n }\n visitScrolledToSamePageLocation(oldURL, newURL) {\n this.delegate.visitScrolledToSamePageLocation(oldURL, newURL);\n }\n get location() {\n return this.history.location;\n }\n get restorationIdentifier() {\n return this.history.restorationIdentifier;\n }\n getActionForFormSubmission(_ref16) {\n let submitter = _ref16.submitter,\n formElement = _ref16.formElement;\n return getVisitAction(submitter, formElement) || \"advance\";\n }\n}\nvar PageStage;\n(function (PageStage) {\n PageStage[PageStage[\"initial\"] = 0] = \"initial\";\n PageStage[PageStage[\"loading\"] = 1] = \"loading\";\n PageStage[PageStage[\"interactive\"] = 2] = \"interactive\";\n PageStage[PageStage[\"complete\"] = 3] = \"complete\";\n})(PageStage || (PageStage = {}));\nclass PageObserver {\n constructor(delegate) {\n this.stage = PageStage.initial;\n this.started = false;\n this.interpretReadyState = () => {\n const readyState = this.readyState;\n if (readyState == \"interactive\") {\n this.pageIsInteractive();\n } else if (readyState == \"complete\") {\n this.pageIsComplete();\n }\n };\n this.pageWillUnload = () => {\n this.delegate.pageWillUnload();\n };\n this.delegate = delegate;\n }\n start() {\n if (!this.started) {\n if (this.stage == PageStage.initial) {\n this.stage = PageStage.loading;\n }\n document.addEventListener(\"readystatechange\", this.interpretReadyState, false);\n addEventListener(\"pagehide\", this.pageWillUnload, false);\n this.started = true;\n }\n }\n stop() {\n if (this.started) {\n document.removeEventListener(\"readystatechange\", this.interpretReadyState, false);\n removeEventListener(\"pagehide\", this.pageWillUnload, false);\n this.started = false;\n }\n }\n pageIsInteractive() {\n if (this.stage == PageStage.loading) {\n this.stage = PageStage.interactive;\n this.delegate.pageBecameInteractive();\n }\n }\n pageIsComplete() {\n this.pageIsInteractive();\n if (this.stage == PageStage.interactive) {\n this.stage = PageStage.complete;\n this.delegate.pageLoaded();\n }\n }\n get readyState() {\n return document.readyState;\n }\n}\nclass ScrollObserver {\n constructor(delegate) {\n this.started = false;\n this.onScroll = () => {\n this.updatePosition({\n x: window.pageXOffset,\n y: window.pageYOffset\n });\n };\n this.delegate = delegate;\n }\n start() {\n if (!this.started) {\n addEventListener(\"scroll\", this.onScroll, false);\n this.onScroll();\n this.started = true;\n }\n }\n stop() {\n if (this.started) {\n removeEventListener(\"scroll\", this.onScroll, false);\n this.started = false;\n }\n }\n updatePosition(position) {\n this.delegate.scrollPositionChanged(position);\n }\n}\nclass StreamMessageRenderer {\n render(_ref17) {\n let fragment = _ref17.fragment;\n Bardo.preservingPermanentElements(this, getPermanentElementMapForFragment(fragment), () => document.documentElement.appendChild(fragment));\n }\n enteringBardo(currentPermanentElement, newPermanentElement) {\n newPermanentElement.replaceWith(currentPermanentElement.cloneNode(true));\n }\n leavingBardo() {}\n}\nfunction getPermanentElementMapForFragment(fragment) {\n const permanentElementsInDocument = queryPermanentElementsAll(document.documentElement);\n const permanentElementMap = {};\n for (const permanentElementInDocument of permanentElementsInDocument) {\n const id = permanentElementInDocument.id;\n for (const streamElement of fragment.querySelectorAll(\"turbo-stream\")) {\n const elementInStream = getPermanentElementById(streamElement.templateElement.content, id);\n if (elementInStream) {\n permanentElementMap[id] = [permanentElementInDocument, elementInStream];\n }\n }\n }\n return permanentElementMap;\n}\nclass StreamObserver {\n constructor(delegate) {\n this.sources = new Set();\n this.started = false;\n this.inspectFetchResponse = event => {\n const response = fetchResponseFromEvent(event);\n if (response && fetchResponseIsStream(response)) {\n event.preventDefault();\n this.receiveMessageResponse(response);\n }\n };\n this.receiveMessageEvent = event => {\n if (this.started && typeof event.data == \"string\") {\n this.receiveMessageHTML(event.data);\n }\n };\n this.delegate = delegate;\n }\n start() {\n if (!this.started) {\n this.started = true;\n addEventListener(\"turbo:before-fetch-response\", this.inspectFetchResponse, false);\n }\n }\n stop() {\n if (this.started) {\n this.started = false;\n removeEventListener(\"turbo:before-fetch-response\", this.inspectFetchResponse, false);\n }\n }\n connectStreamSource(source) {\n if (!this.streamSourceIsConnected(source)) {\n this.sources.add(source);\n source.addEventListener(\"message\", this.receiveMessageEvent, false);\n }\n }\n disconnectStreamSource(source) {\n if (this.streamSourceIsConnected(source)) {\n this.sources.delete(source);\n source.removeEventListener(\"message\", this.receiveMessageEvent, false);\n }\n }\n streamSourceIsConnected(source) {\n return this.sources.has(source);\n }\n async receiveMessageResponse(response) {\n const html = await response.responseHTML;\n if (html) {\n this.receiveMessageHTML(html);\n }\n }\n receiveMessageHTML(html) {\n this.delegate.receivedMessageFromStream(StreamMessage.wrap(html));\n }\n}\nfunction fetchResponseFromEvent(event) {\n var _a;\n const fetchResponse = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.fetchResponse;\n if (fetchResponse instanceof FetchResponse) {\n return fetchResponse;\n }\n}\nfunction fetchResponseIsStream(response) {\n var _a;\n const contentType = (_a = response.contentType) !== null && _a !== void 0 ? _a : \"\";\n return contentType.startsWith(StreamMessage.contentType);\n}\nclass ErrorRenderer extends Renderer {\n static renderElement(currentElement, newElement) {\n const _document = document,\n documentElement = _document.documentElement,\n body = _document.body;\n documentElement.replaceChild(newElement, body);\n }\n async render() {\n this.replaceHeadAndBody();\n this.activateScriptElements();\n }\n replaceHeadAndBody() {\n const _document2 = document,\n documentElement = _document2.documentElement,\n head = _document2.head;\n documentElement.replaceChild(this.newHead, head);\n this.renderElement(this.currentElement, this.newElement);\n }\n activateScriptElements() {\n for (const replaceableElement of this.scriptElements) {\n const parentNode = replaceableElement.parentNode;\n if (parentNode) {\n const element = activateScriptElement(replaceableElement);\n parentNode.replaceChild(element, replaceableElement);\n }\n }\n }\n get newHead() {\n return this.newSnapshot.headSnapshot.element;\n }\n get scriptElements() {\n return document.documentElement.querySelectorAll(\"script\");\n }\n}\nclass PageRenderer extends Renderer {\n static renderElement(currentElement, newElement) {\n if (document.body && newElement instanceof HTMLBodyElement) {\n document.body.replaceWith(newElement);\n } else {\n document.documentElement.appendChild(newElement);\n }\n }\n get shouldRender() {\n return this.newSnapshot.isVisitable && this.trackedElementsAreIdentical;\n }\n get reloadReason() {\n if (!this.newSnapshot.isVisitable) {\n return {\n reason: \"turbo_visit_control_is_reload\"\n };\n }\n if (!this.trackedElementsAreIdentical) {\n return {\n reason: \"tracked_element_mismatch\"\n };\n }\n }\n async prepareToRender() {\n await this.mergeHead();\n }\n async render() {\n if (this.willRender) {\n await this.replaceBody();\n }\n }\n finishRendering() {\n super.finishRendering();\n if (!this.isPreview) {\n this.focusFirstAutofocusableElement();\n }\n }\n get currentHeadSnapshot() {\n return this.currentSnapshot.headSnapshot;\n }\n get newHeadSnapshot() {\n return this.newSnapshot.headSnapshot;\n }\n get newElement() {\n return this.newSnapshot.element;\n }\n async mergeHead() {\n const mergedHeadElements = this.mergeProvisionalElements();\n const newStylesheetElements = this.copyNewHeadStylesheetElements();\n this.copyNewHeadScriptElements();\n await mergedHeadElements;\n await newStylesheetElements;\n }\n async replaceBody() {\n await this.preservingPermanentElements(async () => {\n this.activateNewBody();\n await this.assignNewBody();\n });\n }\n get trackedElementsAreIdentical() {\n return this.currentHeadSnapshot.trackedElementSignature == this.newHeadSnapshot.trackedElementSignature;\n }\n async copyNewHeadStylesheetElements() {\n const loadingElements = [];\n for (const element of this.newHeadStylesheetElements) {\n loadingElements.push(waitForLoad(element));\n document.head.appendChild(element);\n }\n await Promise.all(loadingElements);\n }\n copyNewHeadScriptElements() {\n for (const element of this.newHeadScriptElements) {\n document.head.appendChild(activateScriptElement(element));\n }\n }\n async mergeProvisionalElements() {\n const newHeadElements = [...this.newHeadProvisionalElements];\n for (const element of this.currentHeadProvisionalElements) {\n if (!this.isCurrentElementInElementList(element, newHeadElements)) {\n document.head.removeChild(element);\n }\n }\n for (const element of newHeadElements) {\n document.head.appendChild(element);\n }\n }\n isCurrentElementInElementList(element, elementList) {\n for (const _ref18 of elementList.entries()) {\n var _ref19 = _slicedToArray(_ref18, 2);\n const index = _ref19[0];\n const newElement = _ref19[1];\n if (element.tagName == \"TITLE\") {\n if (newElement.tagName != \"TITLE\") {\n continue;\n }\n if (element.innerHTML == newElement.innerHTML) {\n elementList.splice(index, 1);\n return true;\n }\n }\n if (newElement.isEqualNode(element)) {\n elementList.splice(index, 1);\n return true;\n }\n }\n return false;\n }\n removeCurrentHeadProvisionalElements() {\n for (const element of this.currentHeadProvisionalElements) {\n document.head.removeChild(element);\n }\n }\n copyNewHeadProvisionalElements() {\n for (const element of this.newHeadProvisionalElements) {\n document.head.appendChild(element);\n }\n }\n activateNewBody() {\n document.adoptNode(this.newElement);\n this.activateNewBodyScriptElements();\n }\n activateNewBodyScriptElements() {\n for (const inertScriptElement of this.newBodyScriptElements) {\n const activatedScriptElement = activateScriptElement(inertScriptElement);\n inertScriptElement.replaceWith(activatedScriptElement);\n }\n }\n async assignNewBody() {\n await this.renderElement(this.currentElement, this.newElement);\n }\n get newHeadStylesheetElements() {\n return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot);\n }\n get newHeadScriptElements() {\n return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot);\n }\n get currentHeadProvisionalElements() {\n return this.currentHeadSnapshot.provisionalElements;\n }\n get newHeadProvisionalElements() {\n return this.newHeadSnapshot.provisionalElements;\n }\n get newBodyScriptElements() {\n return this.newElement.querySelectorAll(\"script\");\n }\n}\nclass SnapshotCache {\n constructor(size) {\n this.keys = [];\n this.snapshots = {};\n this.size = size;\n }\n has(location) {\n return toCacheKey(location) in this.snapshots;\n }\n get(location) {\n if (this.has(location)) {\n const snapshot = this.read(location);\n this.touch(location);\n return snapshot;\n }\n }\n put(location, snapshot) {\n this.write(location, snapshot);\n this.touch(location);\n return snapshot;\n }\n clear() {\n this.snapshots = {};\n }\n read(location) {\n return this.snapshots[toCacheKey(location)];\n }\n write(location, snapshot) {\n this.snapshots[toCacheKey(location)] = snapshot;\n }\n touch(location) {\n const key = toCacheKey(location);\n const index = this.keys.indexOf(key);\n if (index > -1) this.keys.splice(index, 1);\n this.keys.unshift(key);\n this.trim();\n }\n trim() {\n for (const key of this.keys.splice(this.size)) {\n delete this.snapshots[key];\n }\n }\n}\nclass PageView extends View {\n constructor() {\n super(...arguments);\n this.snapshotCache = new SnapshotCache(10);\n this.lastRenderedLocation = new URL(location.href);\n this.forceReloaded = false;\n }\n renderPage(snapshot) {\n let isPreview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n let willRender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n let visit = arguments.length > 3 ? arguments[3] : undefined;\n const renderer = new PageRenderer(this.snapshot, snapshot, PageRenderer.renderElement, isPreview, willRender);\n if (!renderer.shouldRender) {\n this.forceReloaded = true;\n } else {\n visit === null || visit === void 0 ? void 0 : visit.changeHistory();\n }\n return this.render(renderer);\n }\n renderError(snapshot, visit) {\n visit === null || visit === void 0 ? void 0 : visit.changeHistory();\n const renderer = new ErrorRenderer(this.snapshot, snapshot, ErrorRenderer.renderElement, false);\n return this.render(renderer);\n }\n clearSnapshotCache() {\n this.snapshotCache.clear();\n }\n async cacheSnapshot() {\n let snapshot = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.snapshot;\n if (snapshot.isCacheable) {\n this.delegate.viewWillCacheSnapshot();\n const location = this.lastRenderedLocation;\n await nextEventLoopTick();\n const cachedSnapshot = snapshot.clone();\n this.snapshotCache.put(location, cachedSnapshot);\n return cachedSnapshot;\n }\n }\n getCachedSnapshotForLocation(location) {\n return this.snapshotCache.get(location);\n }\n get snapshot() {\n return PageSnapshot.fromElement(this.element);\n }\n}\nclass Preloader {\n constructor(delegate) {\n this.selector = \"a[data-turbo-preload]\";\n this.delegate = delegate;\n }\n get snapshotCache() {\n return this.delegate.navigator.view.snapshotCache;\n }\n start() {\n if (document.readyState === \"loading\") {\n return document.addEventListener(\"DOMContentLoaded\", () => {\n this.preloadOnLoadLinksForView(document.body);\n });\n } else {\n this.preloadOnLoadLinksForView(document.body);\n }\n }\n preloadOnLoadLinksForView(element) {\n for (const link of element.querySelectorAll(this.selector)) {\n this.preloadURL(link);\n }\n }\n async preloadURL(link) {\n const location = new URL(link.href);\n if (this.snapshotCache.has(location)) {\n return;\n }\n try {\n const response = await fetch(location.toString(), {\n headers: {\n \"VND.PREFETCH\": \"true\",\n Accept: \"text/html\"\n }\n });\n const responseText = await response.text();\n const snapshot = PageSnapshot.fromHTMLString(responseText);\n this.snapshotCache.put(location, snapshot);\n } catch (_) {}\n }\n}\nclass Session {\n constructor() {\n this.navigator = new Navigator(this);\n this.history = new History(this);\n this.preloader = new Preloader(this);\n this.view = new PageView(this, document.documentElement);\n this.adapter = new BrowserAdapter(this);\n this.pageObserver = new PageObserver(this);\n this.cacheObserver = new CacheObserver();\n this.linkClickObserver = new LinkClickObserver(this, window);\n this.formSubmitObserver = new FormSubmitObserver(this, document);\n this.scrollObserver = new ScrollObserver(this);\n this.streamObserver = new StreamObserver(this);\n this.formLinkClickObserver = new FormLinkClickObserver(this, document.documentElement);\n this.frameRedirector = new FrameRedirector(this, document.documentElement);\n this.streamMessageRenderer = new StreamMessageRenderer();\n this.drive = true;\n this.enabled = true;\n this.progressBarDelay = 500;\n this.started = false;\n this.formMode = \"on\";\n }\n start() {\n if (!this.started) {\n this.pageObserver.start();\n this.cacheObserver.start();\n this.formLinkClickObserver.start();\n this.linkClickObserver.start();\n this.formSubmitObserver.start();\n this.scrollObserver.start();\n this.streamObserver.start();\n this.frameRedirector.start();\n this.history.start();\n this.preloader.start();\n this.started = true;\n this.enabled = true;\n }\n }\n disable() {\n this.enabled = false;\n }\n stop() {\n if (this.started) {\n this.pageObserver.stop();\n this.cacheObserver.stop();\n this.formLinkClickObserver.stop();\n this.linkClickObserver.stop();\n this.formSubmitObserver.stop();\n this.scrollObserver.stop();\n this.streamObserver.stop();\n this.frameRedirector.stop();\n this.history.stop();\n this.started = false;\n }\n }\n registerAdapter(adapter) {\n this.adapter = adapter;\n }\n visit(location) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const frameElement = options.frame ? document.getElementById(options.frame) : null;\n if (frameElement instanceof FrameElement) {\n frameElement.src = location.toString();\n frameElement.loaded;\n } else {\n this.navigator.proposeVisit(expandURL(location), options);\n }\n }\n connectStreamSource(source) {\n this.streamObserver.connectStreamSource(source);\n }\n disconnectStreamSource(source) {\n this.streamObserver.disconnectStreamSource(source);\n }\n renderStreamMessage(message) {\n this.streamMessageRenderer.render(StreamMessage.wrap(message));\n }\n clearCache() {\n this.view.clearSnapshotCache();\n }\n setProgressBarDelay(delay) {\n this.progressBarDelay = delay;\n }\n setFormMode(mode) {\n this.formMode = mode;\n }\n get location() {\n return this.history.location;\n }\n get restorationIdentifier() {\n return this.history.restorationIdentifier;\n }\n historyPoppedToLocationWithRestorationIdentifier(location, restorationIdentifier) {\n if (this.enabled) {\n this.navigator.startVisit(location, restorationIdentifier, {\n action: \"restore\",\n historyChanged: true\n });\n } else {\n this.adapter.pageInvalidated({\n reason: \"turbo_disabled\"\n });\n }\n }\n scrollPositionChanged(position) {\n this.history.updateRestorationData({\n scrollPosition: position\n });\n }\n willSubmitFormLinkToLocation(link, location) {\n return this.elementIsNavigatable(link) && locationIsVisitable(location, this.snapshot.rootLocation);\n }\n submittedFormLinkToLocation() {}\n willFollowLinkToLocation(link, location, event) {\n return this.elementIsNavigatable(link) && locationIsVisitable(location, this.snapshot.rootLocation) && this.applicationAllowsFollowingLinkToLocation(link, location, event);\n }\n followedLinkToLocation(link, location) {\n const action = this.getActionForLink(link);\n const acceptsStreamResponse = link.hasAttribute(\"data-turbo-stream\");\n this.visit(location.href, {\n action,\n acceptsStreamResponse\n });\n }\n allowsVisitingLocationWithAction(location, action) {\n return this.locationWithActionIsSamePage(location, action) || this.applicationAllowsVisitingLocation(location);\n }\n visitProposedToLocation(location, options) {\n extendURLWithDeprecatedProperties(location);\n this.adapter.visitProposedToLocation(location, options);\n }\n visitStarted(visit) {\n if (!visit.acceptsStreamResponse) {\n markAsBusy(document.documentElement);\n }\n extendURLWithDeprecatedProperties(visit.location);\n if (!visit.silent) {\n this.notifyApplicationAfterVisitingLocation(visit.location, visit.action);\n }\n }\n visitCompleted(visit) {\n clearBusyState(document.documentElement);\n this.notifyApplicationAfterPageLoad(visit.getTimingMetrics());\n }\n locationWithActionIsSamePage(location, action) {\n return this.navigator.locationWithActionIsSamePage(location, action);\n }\n visitScrolledToSamePageLocation(oldURL, newURL) {\n this.notifyApplicationAfterVisitingSamePageLocation(oldURL, newURL);\n }\n willSubmitForm(form, submitter) {\n const action = getAction(form, submitter);\n return this.submissionIsNavigatable(form, submitter) && locationIsVisitable(expandURL(action), this.snapshot.rootLocation);\n }\n formSubmitted(form, submitter) {\n this.navigator.submitForm(form, submitter);\n }\n pageBecameInteractive() {\n this.view.lastRenderedLocation = this.location;\n this.notifyApplicationAfterPageLoad();\n }\n pageLoaded() {\n this.history.assumeControlOfScrollRestoration();\n }\n pageWillUnload() {\n this.history.relinquishControlOfScrollRestoration();\n }\n receivedMessageFromStream(message) {\n this.renderStreamMessage(message);\n }\n viewWillCacheSnapshot() {\n var _a;\n if (!((_a = this.navigator.currentVisit) === null || _a === void 0 ? void 0 : _a.silent)) {\n this.notifyApplicationBeforeCachingSnapshot();\n }\n }\n allowsImmediateRender(_ref20, options) {\n let element = _ref20.element;\n const event = this.notifyApplicationBeforeRender(element, options);\n const defaultPrevented = event.defaultPrevented,\n render = event.detail.render;\n if (this.view.renderer && render) {\n this.view.renderer.renderElement = render;\n }\n return !defaultPrevented;\n }\n viewRenderedSnapshot(_snapshot, _isPreview) {\n this.view.lastRenderedLocation = this.history.location;\n this.notifyApplicationAfterRender();\n }\n preloadOnLoadLinksForView(element) {\n this.preloader.preloadOnLoadLinksForView(element);\n }\n viewInvalidated(reason) {\n this.adapter.pageInvalidated(reason);\n }\n frameLoaded(frame) {\n this.notifyApplicationAfterFrameLoad(frame);\n }\n frameRendered(fetchResponse, frame) {\n this.notifyApplicationAfterFrameRender(fetchResponse, frame);\n }\n applicationAllowsFollowingLinkToLocation(link, location, ev) {\n const event = this.notifyApplicationAfterClickingLinkToLocation(link, location, ev);\n return !event.defaultPrevented;\n }\n applicationAllowsVisitingLocation(location) {\n const event = this.notifyApplicationBeforeVisitingLocation(location);\n return !event.defaultPrevented;\n }\n notifyApplicationAfterClickingLinkToLocation(link, location, event) {\n return dispatch(\"turbo:click\", {\n target: link,\n detail: {\n url: location.href,\n originalEvent: event\n },\n cancelable: true\n });\n }\n notifyApplicationBeforeVisitingLocation(location) {\n return dispatch(\"turbo:before-visit\", {\n detail: {\n url: location.href\n },\n cancelable: true\n });\n }\n notifyApplicationAfterVisitingLocation(location, action) {\n return dispatch(\"turbo:visit\", {\n detail: {\n url: location.href,\n action\n }\n });\n }\n notifyApplicationBeforeCachingSnapshot() {\n return dispatch(\"turbo:before-cache\");\n }\n notifyApplicationBeforeRender(newBody, options) {\n return dispatch(\"turbo:before-render\", {\n detail: Object.assign({\n newBody\n }, options),\n cancelable: true\n });\n }\n notifyApplicationAfterRender() {\n return dispatch(\"turbo:render\");\n }\n notifyApplicationAfterPageLoad() {\n let timing = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return dispatch(\"turbo:load\", {\n detail: {\n url: this.location.href,\n timing\n }\n });\n }\n notifyApplicationAfterVisitingSamePageLocation(oldURL, newURL) {\n dispatchEvent(new HashChangeEvent(\"hashchange\", {\n oldURL: oldURL.toString(),\n newURL: newURL.toString()\n }));\n }\n notifyApplicationAfterFrameLoad(frame) {\n return dispatch(\"turbo:frame-load\", {\n target: frame\n });\n }\n notifyApplicationAfterFrameRender(fetchResponse, frame) {\n return dispatch(\"turbo:frame-render\", {\n detail: {\n fetchResponse\n },\n target: frame,\n cancelable: true\n });\n }\n submissionIsNavigatable(form, submitter) {\n if (this.formMode == \"off\") {\n return false;\n } else {\n const submitterIsNavigatable = submitter ? this.elementIsNavigatable(submitter) : true;\n if (this.formMode == \"optin\") {\n return submitterIsNavigatable && form.closest('[data-turbo=\"true\"]') != null;\n } else {\n return submitterIsNavigatable && this.elementIsNavigatable(form);\n }\n }\n }\n elementIsNavigatable(element) {\n const container = findClosestRecursively(element, \"[data-turbo]\");\n const withinFrame = findClosestRecursively(element, \"turbo-frame\");\n if (this.drive || withinFrame) {\n if (container) {\n return container.getAttribute(\"data-turbo\") != \"false\";\n } else {\n return true;\n }\n } else {\n if (container) {\n return container.getAttribute(\"data-turbo\") == \"true\";\n } else {\n return false;\n }\n }\n }\n getActionForLink(link) {\n return getVisitAction(link) || \"advance\";\n }\n get snapshot() {\n return this.view.snapshot;\n }\n}\nfunction extendURLWithDeprecatedProperties(url) {\n Object.defineProperties(url, deprecatedLocationPropertyDescriptors);\n}\nconst deprecatedLocationPropertyDescriptors = {\n absoluteURL: {\n get() {\n return this.toString();\n }\n }\n};\nclass Cache {\n constructor(session) {\n this.session = session;\n }\n clear() {\n this.session.clearCache();\n }\n resetCacheControl() {\n this.setCacheControl(\"\");\n }\n exemptPageFromCache() {\n this.setCacheControl(\"no-cache\");\n }\n exemptPageFromPreview() {\n this.setCacheControl(\"no-preview\");\n }\n setCacheControl(value) {\n setMetaContent(\"turbo-cache-control\", value);\n }\n}\nconst StreamActions = {\n after() {\n this.targetElements.forEach(e => {\n var _a;\n return (_a = e.parentElement) === null || _a === void 0 ? void 0 : _a.insertBefore(this.templateContent, e.nextSibling);\n });\n },\n append() {\n this.removeDuplicateTargetChildren();\n this.targetElements.forEach(e => e.append(this.templateContent));\n },\n before() {\n this.targetElements.forEach(e => {\n var _a;\n return (_a = e.parentElement) === null || _a === void 0 ? void 0 : _a.insertBefore(this.templateContent, e);\n });\n },\n prepend() {\n this.removeDuplicateTargetChildren();\n this.targetElements.forEach(e => e.prepend(this.templateContent));\n },\n remove() {\n this.targetElements.forEach(e => e.remove());\n },\n replace() {\n this.targetElements.forEach(e => e.replaceWith(this.templateContent));\n },\n update() {\n this.targetElements.forEach(targetElement => {\n targetElement.innerHTML = \"\";\n targetElement.append(this.templateContent);\n });\n }\n};\nconst session = new Session();\nconst cache = new Cache(session);\nconst navigator$1 = session.navigator;\nfunction start() {\n session.start();\n}\nfunction registerAdapter(adapter) {\n session.registerAdapter(adapter);\n}\nfunction visit(location, options) {\n session.visit(location, options);\n}\nfunction connectStreamSource(source) {\n session.connectStreamSource(source);\n}\nfunction disconnectStreamSource(source) {\n session.disconnectStreamSource(source);\n}\nfunction renderStreamMessage(message) {\n session.renderStreamMessage(message);\n}\nfunction clearCache() {\n console.warn(\"Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`\");\n session.clearCache();\n}\nfunction setProgressBarDelay(delay) {\n session.setProgressBarDelay(delay);\n}\nfunction setConfirmMethod(confirmMethod) {\n FormSubmission.confirmMethod = confirmMethod;\n}\nfunction setFormMode(mode) {\n session.setFormMode(mode);\n}\nvar Turbo = /*#__PURE__*/Object.freeze({\n __proto__: null,\n navigator: navigator$1,\n session: session,\n cache: cache,\n PageRenderer: PageRenderer,\n PageSnapshot: PageSnapshot,\n FrameRenderer: FrameRenderer,\n start: start,\n registerAdapter: registerAdapter,\n visit: visit,\n connectStreamSource: connectStreamSource,\n disconnectStreamSource: disconnectStreamSource,\n renderStreamMessage: renderStreamMessage,\n clearCache: clearCache,\n setProgressBarDelay: setProgressBarDelay,\n setConfirmMethod: setConfirmMethod,\n setFormMode: setFormMode,\n StreamActions: StreamActions\n});\nclass TurboFrameMissingError extends Error {}\nclass FrameController {\n constructor(element) {\n this.fetchResponseLoaded = _fetchResponse => {};\n this.currentFetchRequest = null;\n this.resolveVisitPromise = () => {};\n this.connected = false;\n this.hasBeenLoaded = false;\n this.ignoredAttributes = new Set();\n this.action = null;\n this.visitCachedSnapshot = _ref21 => {\n let element = _ref21.element;\n const frame = element.querySelector(\"#\" + this.element.id);\n if (frame && this.previousFrameElement) {\n frame.replaceChildren(...this.previousFrameElement.children);\n }\n delete this.previousFrameElement;\n };\n this.element = element;\n this.view = new FrameView(this, this.element);\n this.appearanceObserver = new AppearanceObserver(this, this.element);\n this.formLinkClickObserver = new FormLinkClickObserver(this, this.element);\n this.linkInterceptor = new LinkInterceptor(this, this.element);\n this.restorationIdentifier = uuid();\n this.formSubmitObserver = new FormSubmitObserver(this, this.element);\n }\n connect() {\n if (!this.connected) {\n this.connected = true;\n if (this.loadingStyle == FrameLoadingStyle.lazy) {\n this.appearanceObserver.start();\n } else {\n this.loadSourceURL();\n }\n this.formLinkClickObserver.start();\n this.linkInterceptor.start();\n this.formSubmitObserver.start();\n }\n }\n disconnect() {\n if (this.connected) {\n this.connected = false;\n this.appearanceObserver.stop();\n this.formLinkClickObserver.stop();\n this.linkInterceptor.stop();\n this.formSubmitObserver.stop();\n }\n }\n disabledChanged() {\n if (this.loadingStyle == FrameLoadingStyle.eager) {\n this.loadSourceURL();\n }\n }\n sourceURLChanged() {\n if (this.isIgnoringChangesTo(\"src\")) return;\n if (this.element.isConnected) {\n this.complete = false;\n }\n if (this.loadingStyle == FrameLoadingStyle.eager || this.hasBeenLoaded) {\n this.loadSourceURL();\n }\n }\n sourceURLReloaded() {\n const src = this.element.src;\n this.ignoringChangesToAttribute(\"complete\", () => {\n this.element.removeAttribute(\"complete\");\n });\n this.element.src = null;\n this.element.src = src;\n return this.element.loaded;\n }\n completeChanged() {\n if (this.isIgnoringChangesTo(\"complete\")) return;\n this.loadSourceURL();\n }\n loadingStyleChanged() {\n if (this.loadingStyle == FrameLoadingStyle.lazy) {\n this.appearanceObserver.start();\n } else {\n this.appearanceObserver.stop();\n this.loadSourceURL();\n }\n }\n async loadSourceURL() {\n if (this.enabled && this.isActive && !this.complete && this.sourceURL) {\n this.element.loaded = this.visit(expandURL(this.sourceURL));\n this.appearanceObserver.stop();\n await this.element.loaded;\n this.hasBeenLoaded = true;\n }\n }\n async loadResponse(fetchResponse) {\n if (fetchResponse.redirected || fetchResponse.succeeded && fetchResponse.isHTML) {\n this.sourceURL = fetchResponse.response.url;\n }\n try {\n const html = await fetchResponse.responseHTML;\n if (html) {\n const document = parseHTMLDocument(html);\n const pageSnapshot = PageSnapshot.fromDocument(document);\n if (pageSnapshot.isVisitable) {\n await this.loadFrameResponse(fetchResponse, document);\n } else {\n await this.handleUnvisitableFrameResponse(fetchResponse);\n }\n }\n } finally {\n this.fetchResponseLoaded = () => {};\n }\n }\n elementAppearedInViewport(element) {\n this.proposeVisitIfNavigatedWithAction(element, element);\n this.loadSourceURL();\n }\n willSubmitFormLinkToLocation(link) {\n return this.shouldInterceptNavigation(link);\n }\n submittedFormLinkToLocation(link, _location, form) {\n const frame = this.findFrameElement(link);\n if (frame) form.setAttribute(\"data-turbo-frame\", frame.id);\n }\n shouldInterceptLinkClick(element, _location, _event) {\n return this.shouldInterceptNavigation(element);\n }\n linkClickIntercepted(element, location) {\n this.navigateFrame(element, location);\n }\n willSubmitForm(element, submitter) {\n return element.closest(\"turbo-frame\") == this.element && this.shouldInterceptNavigation(element, submitter);\n }\n formSubmitted(element, submitter) {\n if (this.formSubmission) {\n this.formSubmission.stop();\n }\n this.formSubmission = new FormSubmission(this, element, submitter);\n const fetchRequest = this.formSubmission.fetchRequest;\n this.prepareRequest(fetchRequest);\n this.formSubmission.start();\n }\n prepareRequest(request) {\n var _a;\n request.headers[\"Turbo-Frame\"] = this.id;\n if ((_a = this.currentNavigationElement) === null || _a === void 0 ? void 0 : _a.hasAttribute(\"data-turbo-stream\")) {\n request.acceptResponseType(StreamMessage.contentType);\n }\n }\n requestStarted(_request) {\n markAsBusy(this.element);\n }\n requestPreventedHandlingResponse(_request, _response) {\n this.resolveVisitPromise();\n }\n async requestSucceededWithResponse(request, response) {\n await this.loadResponse(response);\n this.resolveVisitPromise();\n }\n async requestFailedWithResponse(request, response) {\n await this.loadResponse(response);\n this.resolveVisitPromise();\n }\n requestErrored(request, error) {\n console.error(error);\n this.resolveVisitPromise();\n }\n requestFinished(_request) {\n clearBusyState(this.element);\n }\n formSubmissionStarted(_ref22) {\n let formElement = _ref22.formElement;\n markAsBusy(formElement, this.findFrameElement(formElement));\n }\n formSubmissionSucceededWithResponse(formSubmission, response) {\n const frame = this.findFrameElement(formSubmission.formElement, formSubmission.submitter);\n frame.delegate.proposeVisitIfNavigatedWithAction(frame, formSubmission.formElement, formSubmission.submitter);\n frame.delegate.loadResponse(response);\n if (!formSubmission.isSafe) {\n session.clearCache();\n }\n }\n formSubmissionFailedWithResponse(formSubmission, fetchResponse) {\n this.element.delegate.loadResponse(fetchResponse);\n session.clearCache();\n }\n formSubmissionErrored(formSubmission, error) {\n console.error(error);\n }\n formSubmissionFinished(_ref23) {\n let formElement = _ref23.formElement;\n clearBusyState(formElement, this.findFrameElement(formElement));\n }\n allowsImmediateRender(_ref24, options) {\n let newFrame = _ref24.element;\n const event = dispatch(\"turbo:before-frame-render\", {\n target: this.element,\n detail: Object.assign({\n newFrame\n }, options),\n cancelable: true\n });\n const defaultPrevented = event.defaultPrevented,\n render = event.detail.render;\n if (this.view.renderer && render) {\n this.view.renderer.renderElement = render;\n }\n return !defaultPrevented;\n }\n viewRenderedSnapshot(_snapshot, _isPreview) {}\n preloadOnLoadLinksForView(element) {\n session.preloadOnLoadLinksForView(element);\n }\n viewInvalidated() {}\n willRenderFrame(currentElement, _newElement) {\n this.previousFrameElement = currentElement.cloneNode(true);\n }\n async loadFrameResponse(fetchResponse, document) {\n const newFrameElement = await this.extractForeignFrameElement(document.body);\n if (newFrameElement) {\n const snapshot = new Snapshot(newFrameElement);\n const renderer = new FrameRenderer(this, this.view.snapshot, snapshot, FrameRenderer.renderElement, false, false);\n if (this.view.renderPromise) await this.view.renderPromise;\n this.changeHistory();\n await this.view.render(renderer);\n this.complete = true;\n session.frameRendered(fetchResponse, this.element);\n session.frameLoaded(this.element);\n this.fetchResponseLoaded(fetchResponse);\n } else if (this.willHandleFrameMissingFromResponse(fetchResponse)) {\n this.handleFrameMissingFromResponse(fetchResponse);\n }\n }\n async visit(url) {\n var _a;\n const request = new FetchRequest(this, FetchMethod.get, url, new URLSearchParams(), this.element);\n (_a = this.currentFetchRequest) === null || _a === void 0 ? void 0 : _a.cancel();\n this.currentFetchRequest = request;\n return new Promise(resolve => {\n this.resolveVisitPromise = () => {\n this.resolveVisitPromise = () => {};\n this.currentFetchRequest = null;\n resolve();\n };\n request.perform();\n });\n }\n navigateFrame(element, url, submitter) {\n const frame = this.findFrameElement(element, submitter);\n frame.delegate.proposeVisitIfNavigatedWithAction(frame, element, submitter);\n this.withCurrentNavigationElement(element, () => {\n frame.src = url;\n });\n }\n proposeVisitIfNavigatedWithAction(frame, element, submitter) {\n this.action = getVisitAction(submitter, element, frame);\n if (this.action) {\n const pageSnapshot = PageSnapshot.fromElement(frame).clone();\n const visitCachedSnapshot = frame.delegate.visitCachedSnapshot;\n frame.delegate.fetchResponseLoaded = fetchResponse => {\n if (frame.src) {\n const statusCode = fetchResponse.statusCode,\n redirected = fetchResponse.redirected;\n const responseHTML = frame.ownerDocument.documentElement.outerHTML;\n const response = {\n statusCode,\n redirected,\n responseHTML\n };\n const options = {\n response,\n visitCachedSnapshot,\n willRender: false,\n updateHistory: false,\n restorationIdentifier: this.restorationIdentifier,\n snapshot: pageSnapshot\n };\n if (this.action) options.action = this.action;\n session.visit(frame.src, options);\n }\n };\n }\n }\n changeHistory() {\n if (this.action) {\n const method = getHistoryMethodForAction(this.action);\n session.history.update(method, expandURL(this.element.src || \"\"), this.restorationIdentifier);\n }\n }\n async handleUnvisitableFrameResponse(fetchResponse) {\n console.warn(`The response (${fetchResponse.statusCode}) from is performing a full page visit due to turbo-visit-control.`);\n await this.visitResponse(fetchResponse.response);\n }\n willHandleFrameMissingFromResponse(fetchResponse) {\n var _this = this;\n this.element.setAttribute(\"complete\", \"\");\n const response = fetchResponse.response;\n const visit = async function (url) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (url instanceof Response) {\n _this.visitResponse(url);\n } else {\n session.visit(url, options);\n }\n };\n const event = dispatch(\"turbo:frame-missing\", {\n target: this.element,\n detail: {\n response,\n visit\n },\n cancelable: true\n });\n return !event.defaultPrevented;\n }\n handleFrameMissingFromResponse(fetchResponse) {\n this.view.missing();\n this.throwFrameMissingError(fetchResponse);\n }\n throwFrameMissingError(fetchResponse) {\n const message = `The response (${fetchResponse.statusCode}) did not contain the expected and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;\n throw new TurboFrameMissingError(message);\n }\n async visitResponse(response) {\n const wrapped = new FetchResponse(response);\n const responseHTML = await wrapped.responseHTML;\n const location = wrapped.location,\n redirected = wrapped.redirected,\n statusCode = wrapped.statusCode;\n return session.visit(location, {\n response: {\n redirected,\n statusCode,\n responseHTML\n }\n });\n }\n findFrameElement(element, submitter) {\n var _a;\n const id = getAttribute(\"data-turbo-frame\", submitter, element) || this.element.getAttribute(\"target\");\n return (_a = getFrameElementById(id)) !== null && _a !== void 0 ? _a : this.element;\n }\n async extractForeignFrameElement(container) {\n let element;\n const id = CSS.escape(this.id);\n try {\n element = activateElement(container.querySelector(`turbo-frame#${id}`), this.sourceURL);\n if (element) {\n return element;\n }\n element = activateElement(container.querySelector(`turbo-frame[src][recurse~=${id}]`), this.sourceURL);\n if (element) {\n await element.loaded;\n return await this.extractForeignFrameElement(element);\n }\n } catch (error) {\n console.error(error);\n return new FrameElement();\n }\n return null;\n }\n formActionIsVisitable(form, submitter) {\n const action = getAction(form, submitter);\n return locationIsVisitable(expandURL(action), this.rootLocation);\n }\n shouldInterceptNavigation(element, submitter) {\n const id = getAttribute(\"data-turbo-frame\", submitter, element) || this.element.getAttribute(\"target\");\n if (element instanceof HTMLFormElement && !this.formActionIsVisitable(element, submitter)) {\n return false;\n }\n if (!this.enabled || id == \"_top\") {\n return false;\n }\n if (id) {\n const frameElement = getFrameElementById(id);\n if (frameElement) {\n return !frameElement.disabled;\n }\n }\n if (!session.elementIsNavigatable(element)) {\n return false;\n }\n if (submitter && !session.elementIsNavigatable(submitter)) {\n return false;\n }\n return true;\n }\n get id() {\n return this.element.id;\n }\n get enabled() {\n return !this.element.disabled;\n }\n get sourceURL() {\n if (this.element.src) {\n return this.element.src;\n }\n }\n set sourceURL(sourceURL) {\n this.ignoringChangesToAttribute(\"src\", () => {\n this.element.src = sourceURL !== null && sourceURL !== void 0 ? sourceURL : null;\n });\n }\n get loadingStyle() {\n return this.element.loading;\n }\n get isLoading() {\n return this.formSubmission !== undefined || this.resolveVisitPromise() !== undefined;\n }\n get complete() {\n return this.element.hasAttribute(\"complete\");\n }\n set complete(value) {\n this.ignoringChangesToAttribute(\"complete\", () => {\n if (value) {\n this.element.setAttribute(\"complete\", \"\");\n } else {\n this.element.removeAttribute(\"complete\");\n }\n });\n }\n get isActive() {\n return this.element.isActive && this.connected;\n }\n get rootLocation() {\n var _a;\n const meta = this.element.ownerDocument.querySelector(`meta[name=\"turbo-root\"]`);\n const root = (_a = meta === null || meta === void 0 ? void 0 : meta.content) !== null && _a !== void 0 ? _a : \"/\";\n return expandURL(root);\n }\n isIgnoringChangesTo(attributeName) {\n return this.ignoredAttributes.has(attributeName);\n }\n ignoringChangesToAttribute(attributeName, callback) {\n this.ignoredAttributes.add(attributeName);\n callback();\n this.ignoredAttributes.delete(attributeName);\n }\n withCurrentNavigationElement(element, callback) {\n this.currentNavigationElement = element;\n callback();\n delete this.currentNavigationElement;\n }\n}\nfunction getFrameElementById(id) {\n if (id != null) {\n const element = document.getElementById(id);\n if (element instanceof FrameElement) {\n return element;\n }\n }\n}\nfunction activateElement(element, currentURL) {\n if (element) {\n const src = element.getAttribute(\"src\");\n if (src != null && currentURL != null && urlsAreEqual(src, currentURL)) {\n throw new Error(`Matching element has a source URL which references itself`);\n }\n if (element.ownerDocument !== document) {\n element = document.importNode(element, true);\n }\n if (element instanceof FrameElement) {\n element.connectedCallback();\n element.disconnectedCallback();\n return element;\n }\n }\n}\nclass StreamElement extends HTMLElement {\n static async renderElement(newElement) {\n await newElement.performAction();\n }\n async connectedCallback() {\n try {\n await this.render();\n } catch (error) {\n console.error(error);\n } finally {\n this.disconnect();\n }\n }\n async render() {\n var _a;\n return (_a = this.renderPromise) !== null && _a !== void 0 ? _a : this.renderPromise = (async () => {\n const event = this.beforeRenderEvent;\n if (this.dispatchEvent(event)) {\n await nextAnimationFrame();\n await event.detail.render(this);\n }\n })();\n }\n disconnect() {\n try {\n this.remove();\n } catch (_a) {}\n }\n removeDuplicateTargetChildren() {\n this.duplicateChildren.forEach(c => c.remove());\n }\n get duplicateChildren() {\n var _a;\n const existingChildren = this.targetElements.flatMap(e => [...e.children]).filter(c => !!c.id);\n const newChildrenIds = [...(((_a = this.templateContent) === null || _a === void 0 ? void 0 : _a.children) || [])].filter(c => !!c.id).map(c => c.id);\n return existingChildren.filter(c => newChildrenIds.includes(c.id));\n }\n get performAction() {\n if (this.action) {\n const actionFunction = StreamActions[this.action];\n if (actionFunction) {\n return actionFunction;\n }\n this.raise(\"unknown action\");\n }\n this.raise(\"action attribute is missing\");\n }\n get targetElements() {\n if (this.target) {\n return this.targetElementsById;\n } else if (this.targets) {\n return this.targetElementsByQuery;\n } else {\n this.raise(\"target or targets attribute is missing\");\n }\n }\n get templateContent() {\n return this.templateElement.content.cloneNode(true);\n }\n get templateElement() {\n if (this.firstElementChild === null) {\n const template = this.ownerDocument.createElement(\"template\");\n this.appendChild(template);\n return template;\n } else if (this.firstElementChild instanceof HTMLTemplateElement) {\n return this.firstElementChild;\n }\n this.raise(\"first child element must be a element\");\n }\n get action() {\n return this.getAttribute(\"action\");\n }\n get target() {\n return this.getAttribute(\"target\");\n }\n get targets() {\n return this.getAttribute(\"targets\");\n }\n raise(message) {\n throw new Error(`${this.description}: ${message}`);\n }\n get description() {\n var _a, _b;\n return (_b = ((_a = this.outerHTML.match(/<[^>]+>/)) !== null && _a !== void 0 ? _a : [])[0]) !== null && _b !== void 0 ? _b : \"\";\n }\n get beforeRenderEvent() {\n return new CustomEvent(\"turbo:before-stream-render\", {\n bubbles: true,\n cancelable: true,\n detail: {\n newStream: this,\n render: StreamElement.renderElement\n }\n });\n }\n get targetElementsById() {\n var _a;\n const element = (_a = this.ownerDocument) === null || _a === void 0 ? void 0 : _a.getElementById(this.target);\n if (element !== null) {\n return [element];\n } else {\n return [];\n }\n }\n get targetElementsByQuery() {\n var _a;\n const elements = (_a = this.ownerDocument) === null || _a === void 0 ? void 0 : _a.querySelectorAll(this.targets);\n if (elements.length !== 0) {\n return Array.prototype.slice.call(elements);\n } else {\n return [];\n }\n }\n}\nclass StreamSourceElement extends HTMLElement {\n constructor() {\n super(...arguments);\n this.streamSource = null;\n }\n connectedCallback() {\n this.streamSource = this.src.match(/^ws{1,2}:/) ? new WebSocket(this.src) : new EventSource(this.src);\n connectStreamSource(this.streamSource);\n }\n disconnectedCallback() {\n if (this.streamSource) {\n disconnectStreamSource(this.streamSource);\n }\n }\n get src() {\n return this.getAttribute(\"src\") || \"\";\n }\n}\nFrameElement.delegateConstructor = FrameController;\nif (customElements.get(\"turbo-frame\") === undefined) {\n customElements.define(\"turbo-frame\", FrameElement);\n}\nif (customElements.get(\"turbo-stream\") === undefined) {\n customElements.define(\"turbo-stream\", StreamElement);\n}\nif (customElements.get(\"turbo-stream-source\") === undefined) {\n customElements.define(\"turbo-stream-source\", StreamSourceElement);\n}\n(() => {\n let element = document.currentScript;\n if (!element) return;\n if (element.hasAttribute(\"data-turbo-suppress-warning\")) return;\n element = element.parentElement;\n while (element) {\n if (element == document.body) {\n return console.warn(unindent`\n You are loading Turbo from a