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KAC5B5xC,EAAOpR,KAAOgjD,GAAS,EAAK,GAAM,KAClC5xC,EAAOpR,KAAc,GAARgjD,EAAc,MAKzBA,GAAS,OAAWA,GAAS,SAC/B5xC,EAAOpR,KAAMgjD,GAAS,GAAM,KAC5B5xC,EAAOpR,KAAOgjD,GAAS,GAAM,GAAM,KACnC5xC,EAAOpR,KAAOgjD,GAAS,EAAK,GAAM,KAClC5xC,EAAOpR,KAAc,GAARgjD,EAAc,MAK7B5xC,EAAOpR,KAAK,IAAM,IAAM,IAC1B,CAEA,OAAO,IAAI+oC,WAAW33B,GAAQugC,MAChC","names":["MailerService","_MailerService","constructor","mailerApi","translate","this","sendInviteEmail","token","fromName","fromEmail","toEmail","message","routeId","OnboardingTypes","Projects","returnUrl","projectList","id","tokenId","getEmailTranslatePath","el","Weddings","footer","instant","projectsHtml","projectsText","buildProjectsListMessage","messageNoNewlines","Utils","convertNewlinesToBr","params","tokenQueryParam","TOKEN_QUERY_PARAM","subject","topic","MailTopic","InviteToCrew","messageText","stripHtml","leaveBrTags","heading","buttonLabel","DEBUG_LOGS","sendEmail","pipe","take","sendStackDownloadEmail","stack","title","clips","clipsTxt","messageHtml","buildClipsDownloadMessage","map","getMp4Source","DownloadStack","i0","i1","i2","factory","ɵfac","providedIn","VideoService","_VideoService","alertCtrl","toaster","stacksService","clipsService","store","didSendUpgrade","sendStackForHLSTranscode","_this","_asyncToGenerator","projectId","stackId","Promise","reject","resolve","filter","c","hlsSrc","providerId","youtube_id","length","console","log","watchStackClipsForHLSTranscode","updates","prop","value","hlsMeta","tryParseJSON","HLS_META_UPGRADE","updateStack","then","updatedStack","subStacksUpdated","setTimeout","error","present","_this2","Array","isArray","clip","sendClipForHLSTranscode","lastValueFrom","updateClip","updatedClip","confirmSendClipForHLSTranscode","_this3","create","header","buttons","text","role","handler","cssClass","catch","warn","i3","i4","i5","SHARING_METHOD","CLIPBOARD","FACEBOOK","TWITTER","LINKEDIN","WEB_API","NATIVE","QR","extractSharingParamsFromShareableItem","item","appConfig","sharingParams","url","shareUrl","hashtags","hashTags","itemType","type","ITEM_TYPE","join","isWidgetActive","Stacks","stackShareUrl","stackShareUrlIncludesProject","SocialSharingNativeService","_SocialSharingNativeService","socialSharing","configService","share","event","shareWithOptions","method","Error","shareTo","action","functionName","QrModalComponent","_QrModalComponent","dismiss","data","modal","selectors","viewQuery","rf","ctx","BaseModalComponent","QrCodeComponent","TranslatePipe","SocialSharingPopoverComponent","_SocialSharingPopoverComponent","popoverCtrl","actions","icon","disabled","ENABLE_FACEBOOK","ENABLE_TWITTER","ENABLE_LINKEDIN","onSelected","popover","getTop","inputs","standalone","features","decls","vars","consts","template","$event","ActionPopoverComponent","ctx_r0","copyResult","CopyToClipboardFeedbackPopoverComponent","_CopyToClipboardFeedbackPopoverComponent","CopyToClipboardFeedbackPopoverComponent_ng_container_0_Template","NgIf","IonIcon","styles","changeDetection","SocialSharingWebService","_SocialSharingWebService","modalCtrl","platform","allowSharing","success","is","navigator","openSocialSharingPopover","component","componentProps","onWillDismiss","shareToClipboard","_this4","str","clipboard","writeText","document","createElement","setAttribute","style","position","left","body","appendChild","select","execCommand","removeChild","openCopyToClipboardFeedbackPopover","_this5","shareToQR","_this6","openQRPopover","_this7","shareToFacebook","_this8","sharingLink","encodeURIComponent","win","openWindow","shareToLinkedIn","shareToTwitter","_this9","sharingQuery","windowName","newwindow","window","open","getWindowOptions","opener","focus","innerWidth","width","height","innerHeight","SocialSharingService","_SocialSharingService","socialSharingServiceProvider","provide","useFactory","socialSharingFactory","deps","Platform","SocialSharing","ModalController","PopoverController","ConfigService","ctx_r1","isCapture","project_r3","FormSelectMyProjects_ion_item_0_ng_container_6_ion_select_option_4_Template","recentProjects","project_r4","_r1","projectChanged","FormSelectMyProjects_ion_item_0_div_2_Template","FormSelectMyProjects_ion_item_0_ng_container_6_Template","FormSelectMyProjects_ion_item_0_ion_select_option_7_Template","projectSelected","compareProjectsWith","_c0","showLabel","myProjects","_r5","createProject","FormSelectMyProjects","_FormSelectMyProjects","isProjectSelected","_b","_a","environService","projectService","userService","onlyAdmin","selected","EventEmitter","configProjects","onDestroy$","Subject","ngOnInit","timeout","getRecentProjects","takeUntil","subscribe","projects","userId$","userId","project","isProjectAdmin","combineLatest","activeProjectId$","selectMyProjects","selectRecentProjects","args","activeProjectId","recent","p","wasSelected","sort","sortProjectTitleAlpha","r","findIndex","proj","defaultProjectId","defaultExists","find","activeExists","recentExists","clearTimeout","emit","ngOnDestroy","next","complete","target","p1","p2","getProjectsFromAppConfig","config","allowPublishTo","loadProjectPreviewsByIds","getProjectsFromStoreByIds","_ref","projectCreateModal","ProjectFormComponent","onDidDismiss","res","_x","apply","arguments","i6","i7","outputs","FormSelectMyProjects_ion_item_0_Template","FormSelectMyProjects_ng_template_1_Template","noProjects_r6","NgFor","IonItem","IonSelect","IonSelectOption","IonButton","firstValueFrom","source","hasConfig","subscriber","SafeSubscriber","unsubscribe","defaultValue","EmptyError","StackPopoverActionsComponent","_StackPopoverActionsComponent","navCtrl","mystackService","stackService","videoService","socialSharingService","mailerService","isModerated","doHandleAddToStack","canAddToStack","canShare","canApprove","canFeature","canFlag","isProjectMember","addToStack","didAddUserActions","get","translated","unshift","push","featured","privacy","STACK_PRIVACY","PUBLIC","isApproved","dtePublished","private","PRIVATE","isCollaborative","tooltip","a","userIsGlobalAdmin$","isGlobalAdmin","_c","_d","CollabModalComponent","removeCollaborative","setStackFeatured","setStackIsApproved","chooseStackDraft","description","tags","response","dispatch","stackActions","ModalReportComponent","reportedItem","navigateForward","EDIT_ROUTE","confirmDownload","confirmDelete","confirmTranscode","toName","username$","email$","_","playlist","poster","addToStackDrawer","isCreateNew","confirmAddClipsToStack","addClipIdsToMyStack","currentClip","subHeader","deleteStack","i8","i9","i10","i11","_r3","cancelClick","cancelText","loginUser","LoginFormComponent_form_0_div_5_Template","LoginFormComponent_form_0_fs_button_16_Template","loginForm","loading","isBusy","_r4","submitNewPassword","LoginFormComponent_form_1_div_10_Template","newPasswordForm","LoginFormComponent","_LoginFormComponent","formBuilder","tokensService","analyticsService","loadingCtrl","router","routeOnSuccess","NAV_PAGE_ON_LOGIN","login","group","username","Validators","required","password","newPassword","PasswordValidator","isValid","confirmPassword","validator","checkMatchingPasswords","mode","invalid","loader","controls","toLowerCase","user","cognitoUser","challengeName","challengeAttributes","challengeParam","requiredAttributes","tokenId$","environment","production","applyTokenToCurrentUser","navigate","queryParams","queryParamsHandling","err","navigateByUrl","CONFIRM_AUTH_PAGE","state","completeNewPassword","passwordField","confirmPasswordField","passwordConfirmationInput","setErrors","notMatching","LoginFormComponent_form_0_Template","LoginFormComponent_form_1_Template","FormsModule","ReactiveFormsModule","FormInputComponent","RouterLink","ButtonComponent","FormControlCastPipe","alignments","placements","reduce","acc","side","concat","min","Math","max","round","floor","createCoords","v","x","y","oppositeSideMap","right","bottom","top","oppositeAlignmentMap","start","end","clamp","evaluate","param","getSide","placement","split","getAlignment","getOppositeAxis","axis","getAxisLength","getSideAxis","includes","getAlignmentAxis","getAlignmentSides","rects","rtl","alignment","alignmentAxis","mainAlignmentSide","reference","floating","getOppositePlacement","getOppositeAlignmentPlacement","replace","getPaddingObject","padding","expandPaddingObject","rectToClientRect","rect","computeCoordsFromPlacement","sideAxis","alignLength","isVertical","commonX","commonY","commonAlign","coords","computePosition","_ref2","strategy","middleware","validMiddleware","Boolean","isRTL","getElementRects","statefulPlacement","middlewareData","resetCount","i","name","fn","nextX","nextY","reset","initialPlacement","elements","ct","_x2","_x3","detectOverflow","_x4","_x5","_detectOverflow","options","_await$platform$isEle","boundary","rootBoundary","elementContext","altBoundary","paddingObject","element","clippingClientRect","getClippingRect","isElement","contextElement","getDocumentElement","offsetParent","getOffsetParent","offsetScale","getScale","elementClientRect","convertOffsetParentRelativeRectToViewportRelativeRect","_convertValueToCoords","mainAxisMulti","crossAxisMulti","rawValue","mainAxis","crossAxis","hasWindow","getNodeName","node","isNode","nodeName","getWindow","_node$ownerDocument","ownerDocument","defaultView","documentElement","Node","Element","isHTMLElement","HTMLElement","isShadowRoot","ShadowRoot","isOverflowElement","overflow","overflowX","overflowY","display","getComputedStyle","test","isTableElement","isTopLayer","some","selector","matches","isContainingBlock","elementOrCss","webkit","isWebKit","css","containerType","backdropFilter","willChange","contain","CSS","supports","isLastTraversableNode","getNodeScroll","scrollLeft","scrollTop","scrollX","scrollY","getParentNode","result","assignedSlot","parentNode","host","getNearestOverflowAncestor","getOverflowAncestors","list","traverseIframes","_node$ownerDocument2","scrollableAncestor","isBody","frameElement","getFrameElement","visualViewport","parent","Object","getPrototypeOf","getCssDimensions","parseFloat","hasOffset","offsetWidth","offsetHeight","shouldFallback","$","unwrapElement","domElement","getBoundingClientRect","Number","isFinite","noOffsets","getVisualOffsets","offsetLeft","offsetTop","includeScale","isFixedStrategy","clientRect","scale","visualOffsets","shouldAddVisualOffsets","isFixed","floatingOffsetParent","offsetWin","currentWin","currentIFrame","iframeScale","iframeRect","clientLeft","paddingLeft","clientTop","paddingTop","getWindowScrollBarX","leftScroll","getHTMLOffset","scroll","ignoreScrollbarX","htmlRect","getClientRectFromClippingAncestor","clippingAncestor","getViewportRect","html","clientWidth","clientHeight","visualViewportBased","getDocumentRect","scrollWidth","scrollHeight","direction","getInnerBoundingClientRect","hasFixedPositionAncestor","stopNode","getClippingElementAncestors","cache","cachedResult","currentContainingBlockComputedStyle","elementIsFixed","currentNode","computedStyle","currentNodeIsContaining","ancestor","set","getRectRelativeToOffsetParent","isOffsetParentAnElement","offsets","offsetRect","htmlOffset","isStaticPositioned","getTrueOffsetParent","polyfill","rawOffsetParent","svgOffsetParent","getContainingBlock","topLayer","clippingAncestors","clippingRect","accRect","getOffsetParentFn","getDimensionsFn","getDimensions","floatingDimensions","getClientRects","from","rectsAreEqual","b","offset","_middlewareData$offse","_middlewareData$arrow","diffCoords","convertValueToCoords","_x6","_x7","arrow","alignmentOffset","shift","checkMainAxis","checkCrossAxis","limiter","detectOverflowOptions","mainAxisCoord","crossAxisCoord","limitedCoords","et","enabled","flip","_middlewareData$flip","fallbackPlacements","specifiedFallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment","initialSideAxis","isBasePlacement","getExpandedPlacements","oppositePlacement","hasFallbackAxisSideDirection","getOppositeAxisPlacements","getSideList","isStart","lr","rl","tb","bt","overflows","overflowsData","sides","every","_middlewareData$flip2","_overflowsData$filter","nextIndex","index","nextPlacement","resetPlacement","d","_overflowsData$filter2","currentSideAxis","arrowDimensions","isYAxis","minProp","maxProp","clientProp","endDiff","startDiff","arrowOffsetParent","clientSize","centerToReference","largestPossiblePadding","minPadding","maxPadding","min$1","center","shouldAddOffset","Y","centerOffset","limitShift","rawOffset","computedOffset","len","limitMin","limitMax","_middlewareData$offse2","isOriginSide","_NgxFloatUiContentComponent_div_3_Template","NgxFloatUiPlacements","AUTO","AUTOSTART","AUTOEND","TOP","BOTTOM","LEFT","RIGHT","TOPSTART","BOTTOMSTART","LEFTSTART","RIGHTSTART","TOPEND","BOTTOMEND","LEFTEND","RIGHTEND","NgxFloatUiTriggers","click","hover","mousedown","none","NgxFloatUiContentComponent","_NgxFloatUiContentComponent","_dynamicArrowSides","_sideAxis","_staticArrowSides","elRef","_viewRef","_changeDetectorRef","_defineProperty","disableAnimation","disableDefaultStyling","boundariesElement","trigger","positionFixed","appendToBody","popperModifiers","nextId","_toggleVisibility","clean","toggleVisibility","floatUiSwitch","extractAppliedClassListExpr","classList","klass","hide","onHidden","_destroy$","floatUiOptions","appendTo","nativeElement","detach","onDocumentResize","update","onMouseOver","isMouseOver","show","referenceObject","_resizeCtrl$","_determineArrowColor","autoUpdate","ancestorScroll","ancestorResize","elementResize","ResizeObserver","layoutShift","IntersectionObserver","animationFrame","referenceEl","ancestors","forEach","addEventListener","passive","cleanupIo","observeMove","onMove","timeoutId","io","root","cleanup","_io","disconnect","refresh","skip","threshold","elementRectForRootMargin","rootMargin","isFirstUpdate","handleObserve","entries","ratio","intersectionRatio","observe","reobserveFrame","resizeObserver","firstEntry","unobserve","cancelAnimationFrame","requestAnimationFrame","_resizeObserver","frameId","prevRefRect","frameLoop","nextRefRect","_resizeObserver2","removeEventListener","floatUiViewRef","_computePosition","fromEvent","showOnLeave","hideOnMouseLeave","destroyed","detectChanges","appendToParent","querySelector","arrowElement","arrowLen","floatingOffset","sqrt","parsedAutoAlignment","popperOptions","indexOf","preventOverflow","parentElement","_middlewareData$autoP","_middlewareData$autoP2","_placementsThatFitOnE","allowedPlacements","autoAlignment","placements$1","undefined","getPlacementList","currentIndex","autoPlacement","currentPlacement","alignmentSides","currentOverflows","allOverflows","placementsSortedByMostSpace","slice","mergedOptions","platformWithCache","Map","computePosition$1","staticArrowSide","dynamicArrowSide","dynamicSideAxis","assign","ht","onUpdate","call","_createArrowSelector","arrowColor","ruleValue","backgroundColor","$style","_styleId","styleContent","head","styleSheet","cssText","innerHTML","displayType","opacity","ariaHidden","__ngFactoryType__","_t","first","hostBindings","exportAs","ngContentSelectors","_c1","_NgxFloatUiContentComponent_div_2_Template","applyClass","ariaDescribe","ariaRole","applyArrowClass","dependencies","NgStyle","NgClass","encapsulation","NGX_FLOAT_UI_DEFAULTS","InjectionToken","NgxFloatUiUtils","coerceBooleanProperty","NgxFloatUiDirective","newValue","_applyClass","_checkExisting","arrowClass","_arrowClass","_content","_shown","_disabled","floatUi","_floatUi","hideOnClickOutside","_hideOnClickOutside","_placement","_preventOverflow","showOnStart","_showOnStart","_elementRef","_vcr","_popperDefaults","baseOptions","assignDefined","sources","key","keys","val","applyTriggerListeners","showTrigger","_addListener","toggle","bind","scheduledShow","showDelay","eventName","scheduledHide","hideTimeout","getRefElement","targetElement","_scheduledShowTimeoutCtrl$","_contentRef","instance","_globalEventListenersCtrl$","hideOnClickOutsideHandler","contains","hideOnScrollHandler","hideOnScroll","_constructContent","popperRef","_setContentProperties","_setDefaults","delay","_scheduledHideTimeoutCtrl$","timer","toElement","popperContentView","_applyChanges","onShown","timeoutAfterShow","e","_getScrollParent","cb","markForCheck","createComponent","_contentClass","_onPopperUpdate","disableStyle","provideNgxFloatUiOptions","useValue","_NgxFloatUiDirective","NgxFloatUiModule","_NgxFloatUiModule","forRoot","popperBaseOptions","ngModule","providers","imports","CommonModule","PAGE","FlagService","_FlagService","events","EventActions","FLAG","flag","flaggingDetails","email","addl","addlItemDetails","clipId","clipProjectId","cliptitle","Flag","sendRes","category_r2","ctx_r2","PopperTriggers","PopperPlacements","_c3","ModalReportComponent_div_10_ion_icon_2_Template","category_r4","selectedCategory","reason_r6","ModalReportComponent_div_22_p_1_Template","onSelectReason","ModalReportComponent_div_22_ion_item_8_Template","reasonValue","items","_c2","selectedReason","_r8","back","_r9","_r10","_r11","sendReport","isSending","ModalReportComponent_ion_toolbar_43_fs_button_2_Template","ModalReportComponent_ion_toolbar_43_fs_button_3_Template","ModalReportComponent_ion_toolbar_43_fs_button_4_Template","ModalReportComponent_ion_toolbar_43_fs_button_5_Template","currentStep","STEPS","selection","subSelection","additionalText","idx","sent","_ModalReportComponent","swiper","swiperRef","_reportVideoText","flagService","swiperModules","IonicSlides","allowSlidePrev","allowSlideNext","additionalDetails","categories","onSelectCategory","customEvent","category","detail","reason","initSlider","allowTouchMove","on","slideChange","escapeHtml","ToasterPosition","Top","ToasterColor","Warning","nextSlide","backSlide","slideNext","slidePrev","scrollToTop","getCurrentStep","values","step","ModalReportComponent_div_10_Template","ModalReportComponent_ion_item_13_Template","ModalReportComponent_div_22_Template","ModalReportComponent_p_25_Template","ModalReportComponent_p_26_Template","modal_r7","ModalReportComponent_ion_toolbar_43_Template","IonList","IonRadioGroup","IonRadio","IonTextarea","IonToolbar","IonButtons","SearchbarComponent","_SearchbarComponent","autofocus","showCancelButton","placeholderText","debounceTime","color","responsiveWidth","searchEnter","searchChange","searchCancel","searchBlur","searchbar","setFocus","onSearch","onChange","onClear","onCancel","onBlur","IonSearchbar","fadeIn","animation","animate","fadeOut","slideInOut","fadeInOut","transition","useAnimation","transform","errorMsg","stackCreateForm","valid","FormStackCreate","_FormStackCreate","addToStackPayload","_addToStackPayload","patchValue","emitValid","isFormValid","addToStackPlaylist","payloadProjectId","publishService","showHeading","showSubmit","showErrorTextOnError","createSuccess","formValid","compose","minLength","maxLength","isLoggedIn$","isLoading","checkForm","markAllAsTouched","titleInput","setActiveProjectId","showLoading","_loadingTimeout","createStack","input","credits","createStackDraft","resetForm","FormStackCreate_div_1_Template","FormStackCreate_div_3_Template","FormStackCreate_div_8_Template","label","TopNavbarDrawerComponent_ng_container_3_ng_template_3_ng_template_1_ng_template_1_ng_container_0_Template","TopNavbarDrawerComponent_ng_container_3_ng_template_3_ng_template_1_ng_template_1_ng_template_1_Template","handleActions","selectDraftText_r3","TopNavbarDrawerComponent_ng_container_3_ng_template_3_ng_template_1_span_0_Template","TopNavbarDrawerComponent_ng_container_3_ng_template_3_ng_template_1_ng_template_1_Template","defaultLabel_r4","TopNavbarDrawerComponent_ng_container_3_ng_template_3_span_0_Template","TopNavbarDrawerComponent_ng_container_3_ng_template_3_ng_template_1_Template","showingCreateForm","notShowingCreate_r5","TopNavbarDrawerComponent_ng_container_3_span_1_Template","TopNavbarDrawerComponent_ng_container_3_ng_template_3_Template","loggedInHeading_r6","TopNavbarDrawerComponent_div_8_ng_template_8_ion_fab_button_0_Template","onCreateFormLoading","onCreateFormSuccess","onCreateFormValid","continueNew","TopNavbarDrawerComponent_div_8_ng_container_10_ion_spinner_5_Template","TopNavbarDrawerComponent_div_8_ng_container_10_ng_template_6_Template","addToStackPayload$","isCreateFormValid","isLoadingCreate","defaultContinueIcon_r9","selectItem","publishedItem","TopNavbarDrawerComponent_div_8_div_11_div_2_Template","openPopover","selectedStackDraft$","selectedItemSuccess","popoverOpen$","item_r12","$implicit","TopNavbarDrawerComponent_div_8_div_12_div_2_Template","TopNavbarDrawerComponent_div_8_div_12_div_5_Template","tmp_10_0","_r7","onNewClicked","TopNavbarDrawerComponent_div_8_div_6_Template","TopNavbarDrawerComponent_div_8_ng_template_8_Template","TopNavbarDrawerComponent_div_8_ng_container_10_Template","TopNavbarDrawerComponent_div_8_div_11_Template","TopNavbarDrawerComponent_div_8_div_12_Template","defaultAddButton_r13","TopNavbarDrawerComponent","_TopNavbarDrawerComponent","_items","showFormTimeout","scrollItemIntoView","theme","newItem","closed","selectedStackId","BehaviorSubject","selectAddToStackPayloadMeta","stackDefaultPoster","STACK_DEFAULT_POSTER","selectStackEdit","distinctUntilChanged","s","translatePath","msg","navEditor","startsWith","ROOT_EDIT_URL","animated","hideDrawerOnLoad","evt","preventDefault","showSuccessDrawerItem","thenClose","thenNavEditor","resetElements","closeDrawer","formStackCreate","mystackActions","delayedCloseDrawer","_closeTimeout","selectedId","_itemSelectedTimeout","tryStopPropagation","tryPreventDefault","_scrollTimeout","drawerItems","getElementsByClassName","scrollTo","OFFSET_PADDING","behavior","TopNavbarDrawerComponent_ng_container_3_Template","TopNavbarDrawerComponent_ng_template_6_Template","TopNavbarDrawerComponent_div_8_Template","loginForm_r14","IonSpinner","IonFabButton","EllipsisButtonComponent","AsyncPipe","backButtonReturnUrl","TopNavbarComponent_ion_toolbar_0_ng_container_7_img_1_Template","TopNavbarComponent_ion_toolbar_0_ng_container_7_ng_template_2_Template","fullLogoNoBreakpoints","logoBreakpoints_r2","onToggleDrawerClick","isDrawerExpanded","TopNavbarComponent_ion_toolbar_0_ion_title_9_ng_template_2_a_0_Template","TopNavbarComponent_ion_toolbar_0_ion_title_9_ng_template_2_ng_template_1_Template","drawerEnabled","justTitle_r5","TopNavbarComponent_ion_toolbar_0_ion_title_9_ng_container_1_Template","TopNavbarComponent_ion_toolbar_0_ion_title_9_ng_template_2_Template","showtitleActionButton","noActionButton_r6","setFullWidthSearch","onSearchCancel","onSearchChange","onSearchBlur","searchPlaceholderText","tmp_6_0","filters$","q","TopNavbarComponent_ion_toolbar_0_ng_container_13_div_1_Template","TopNavbarComponent_ion_toolbar_0_ng_container_13_fs_button_2_Template","TopNavbarComponent_ion_toolbar_0_ng_container_13_div_3_Template","TopNavbarComponent_ion_toolbar_0_ng_container_13_fs_button_4_Template","showSignupBtn","showLoginBtn","showSearch","onAvatarError","avatarUrl_r10","TopNavbarComponent_ion_toolbar_0_ng_template_15_fs_button_2_Template","TopNavbarComponent_ion_toolbar_0_ng_template_15_fs_button_4_Template","avatar$","TopNavbarComponent_ion_toolbar_0_ion_back_button_5_Template","TopNavbarComponent_ion_toolbar_0_ng_container_7_Template","TopNavbarComponent_ion_toolbar_0_ng_container_8_Template","TopNavbarComponent_ion_toolbar_0_ion_title_9_Template","TopNavbarComponent_ion_toolbar_0_app_searchbar_10_Template","TopNavbarComponent_ion_toolbar_0_fs_button_12_Template","TopNavbarComponent_ion_toolbar_0_ng_container_13_Template","TopNavbarComponent_ion_toolbar_0_ng_template_15_Template","inFullWidthSearch","loggedIn$","userLoggedIn_r11","_r12","drawerSelected","drawerNewItem","drawerItems$","drawerHandleActions","drawerLabel","drawerShowLabel","drawerShowCreateForm","drawerSelectedItemSuccess","TopNavbarComponent_ng_container_1_app_top_navbar_drawer_1_Template","TopNavbarComponent","_TopNavbarComponent","drawerExpandEvent","showCreateForm","drawerCloseEvent","_returnUrlQueryParam","hasSearchText","_searchText","route","expandSearchIfQuery","ENABLE_SIGNUP","drawerOpenOnLoad","drawerExpand","avatarUrl$","showTopnav","_respondToPlaylistChanges","_placeholderTextDesktop","_placeholderTextPhone","subscriptions","Subscription","onResize","hideTopnav","getStackDrafts","selectAddToStackPlaylist","selectFilter","GLOBAL_QUERY_ID","filt","subResize","RESIZE","add","_closeDrawerTimeout","listId","selectStackListItems","filters","FilterEntityTypes","StackDrafts","isDraft","isTopDrawer","searchText","DISCOVER_PAGE","search","resetFilter","skipLocationChange","logout","setAvatar","avatar","DEFAULT_USER_AVATAR","TopNavbarComponent_ion_toolbar_0_Template","TopNavbarComponent_ng_container_1_Template","NgSwitch","NgSwitchCase","NgSwitchDefault","IonAvatar","IonTitle","IonBackButton","IonMenuToggle","_EllipsisButtonComponent","_CollabModalComponent","descControl","FormControl","defaultDescText","setValue","invite","makeCollaborative","cancel","FormTextareaComponent","StackService","_StackService","selectAndGetPlay","getStackPlayWithClips","fromIdx","toIdx","QRCodeComponent","_QRCodeComponent","renderer","sanitizer","allowEmptyString","colorDark","colorLight","elementType","errorCorrectionLevel","margin","qrdata","qrCodeURL","context","ngOnChanges","createQRCode","isValidQrCodeText","toDataURL","qrCodeConfig","toCanvas","canvas","toSVG","toString","renderElement","qrcElement","childNodes","version","isNaN","dark","light","centerImageSrc","imageSrc","centerImageHeight","imageHeight","centerImageWidth","imageWidth","canvasElement","getContext","ariaLabel","centerImage","Image","src","crossOrigin","onload","drawImage","emitQRCodeURL","svgParentElement","svgString","setProperty","svgElement","firstChild","imgElement","dataUrl","alt","convertBase64ImageUrlToBlob","base64ImageUrl","parts","imageType","decodedData","atob","uInt8Array","Uint8Array","charCodeAt","Blob","className","SVGSVGElement","blob","outerHTML","urlSvg","URL","createObjectURL","urlSanitized","bypassSecurityTrustUrl","urlImage","HTMLCanvasElement","HTMLImageElement","blobData","urlBlob","ɵcmp","QRCodeModule","_QRCodeModule","ɵmod","ɵinj","onChangeURL","qrCode","qrCodeDownloadLink","_QrCodeComponent","showDownload","QrCodeComponent_qrcode_1_Template","QrCodeComponent_a_2_Template","opts","extendParams","slidesParams","effect","initialSlide","loop","parallax","slidesPerView","spaceBetween","speed","slidesPerColumn","slidesPerColumnFill","slidesPerGroup","centeredSlides","slidesOffsetBefore","slidesOffsetAfter","touchEventsTarget","freeMode","freeModeMomentum","freeModeMomentumRatio","freeModeMomentumBounce","freeModeMomentumBounceRatio","freeModeMomentumVelocityRatio","freeModeSticky","freeModeMinimumVelocity","autoHeight","setWrapperSize","zoom","maxRatio","minRatio","touchRatio","touchAngle","simulateTouch","touchStartPreventDefault","shortSwipes","longSwipes","longSwipesRatio","longSwipesMs","followFinger","touchMoveStopPropagation","touchReleaseOnEdges","iOSEdgeSwipeDetection","iOSEdgeSwipeThreshold","resistance","resistanceRatio","watchSlidesProgress","watchSlidesVisibility","preventClicks","preventClicksPropagation","slideToClickedSlide","loopAdditionalSlides","noSwiping","runCallbacksOnInit","coverflowEffect","rotate","stretch","depth","modifier","slideShadows","flipEffect","limitRotation","cubeEffect","shadow","shadowOffset","shadowScale","fadeEffect","crossFade","a11y","prevSlideMessage","nextSlideMessage","firstSlideMessage","lastSlideMessage","pagination","clickable","hideOnClick","scrollbar","canPromise","require","QRCode","CanvasRenderer","SvgRenderer","renderCanvas","renderFunc","argsNum","isLastArgCb","exports","render","renderToDataURL","module","prototype","getSymbolSize","posCount","size","intervals","ceil","positions","reverse","pos","getRowColCoords","posLength","j","Mode","ALPHA_NUM_CHARS","AlphanumericData","ALPHANUMERIC","getBitsLength","getLength","write","bitBuffer","put","BitBuffer","buffer","bufIndex","num","putBit","getLengthInBits","bit","BitMatrix","reservedBit","row","col","reserved","xor","isReserved","encodeUtf8","ByteData","BYTE","l","ECLevel","EC_BLOCKS_TABLE","EC_CODEWORDS_TABLE","L","M","Q","H","level","fromString","string","G15_BCH","getBCHDigit","mask","EXP_TABLE","LOG_TABLE","n","KanjiData","KANJI","toSJIS","PATTERN000","PATTERN001","PATTERN010","PATTERN011","PATTERN100","PATTERN101","PATTERN110","PATTERN111","getMaskAt","maskPattern","Patterns","parseInt","points","sameCountCol","sameCountRow","lastCol","lastRow","last","bitsCol","bitsRow","darkCount","modulesCount","abs","pattern","setupFormatFunc","numPatterns","bestPattern","lowerPenalty","Infinity","applyMask","penalty","getPenaltyN1","getPenaltyN2","getPenaltyN3","getPenaltyN4","VersionCheck","Regex","ccBits","dataStr","testNumeric","NUMERIC","testAlphanumeric","testKanji","NumericData","substr","remainingNum","GF","coeff","mul","divident","divisor","degree","poly","exp","AlignmentPattern","FinderPattern","MaskPattern","ECCode","ReedSolomonEncoder","Version","FormatInfo","Segments","setupFormatInfo","matrix","bits","getEncodedBits","mod","createSymbol","segments","fromArray","estimatedVersion","rawSegments","rawSplit","getBestVersionForData","bestVersion","dataBits","createData","getCharCountIndicator","dataTotalCodewordsBits","getSymbolTotalCodewords","getTotalCodewordsCount","remainingByte","createCodewords","totalCodewords","dataTotalCodewords","ecTotalBlocks","getBlocksCount","blocksInGroup1","totalCodewordsInGroup1","dataCodewordsInGroup1","dataCodewordsInGroup2","ecCount","rs","dcData","ecData","maxDataSize","dataSize","encode","moduleCount","modules","setupFinderPattern","getPositions","setupTimingPattern","setupAlignmentPattern","setupVersionInfo","setupData","inc","bitIndex","byteIndex","getBestMask","toSJISFunc","setToSJISFunction","Polynomial","genPoly","initialize","generateECPolynomial","paddedData","remainder","buff","numeric","kanji","byte","RegExp","TEST_KANJI","TEST_NUMERIC","TEST_ALPHANUMERIC","dijkstra","getStringByteLength","unescape","getSegments","regex","exec","getSegmentsFromString","numSegs","alphaNumSegs","byteSegs","kanjiSegs","isKanjiModeEnabled","BYTE_KANJI","s1","s2","obj","getSegmentBitsLength","buildSingleSegment","modesHint","bestMode","getBestModeForData","array","seg","nodes","buildNodes","segs","graph","buildGraph","table","prevNodeIds","nodeGroup","currentNodeIds","lastCount","prevNodeId","path","find_path","optimizedSegs","mergeSegments","curr","prevSeg","toSJISFunction","CODEWORDS_COUNT","digit","f","G18_BCH","getReservedBitsCount","getTotalBitsFromDataArray","totalBits","reservedBits","MIXED","usableBits","ecl","getBestVersionForMixedData","currentVersion","getCapacity","getBestVersionForDataLength","qrData","canvasEl","getCanvasElement","getOptions","getImageWidth","image","createImageData","qrToImageData","clearCanvas","clearRect","putImageData","rendererOpts","quality","getColorAttrib","attrib","alpha","hex","toFixed","svgCmd","cmd","qrcodesize","bg","qrToPath","moveBy","newRow","lineLength","svgTag","hex2rgba","hexCode","hexValue","g","qrSize","imgData","qr","symbolSize","scaledMargin","palette","posDst","pxColor","single_source_shortest_paths","predecessors","costs","closest","u","cost_of_s_to_u","adjacent_nodes","cost_of_s_to_u_plus_cost_of_e","PriorityQueue","make","empty","pop","cost","hasOwnProperty","extract_shortest_path_from_predecessor_list","T","t","queue","sorter","default_sorter","point","second"],"ignoreList":[],"sourceRoot":"webpack:///","sources":["./src/app/core/services/mailer.service.ts","./src/app/core/services/video.service.ts","./src/app/core/social-sharing/social-sharing.model.ts","./src/app/core/social-sharing/shared/utils.ts","./src/app/core/social-sharing/social-sharing-native.service.ts","./src/app/tokens/shared/components/qr-modal/qr-modal.component.ts","./src/app/tokens/shared/components/qr-modal/qr-modal.component.html","./src/app/core/social-sharing/social-sharing-popover/social-sharing-popover.component.ts","./src/app/core/social-sharing/social-sharing-popover/social-sharing-popover.component.html","./src/app/core/social-sharing/copy-to-clipboard-feedback-popover/copy-to-clipboard-feedback-popover.component.html","./src/app/core/social-sharing/copy-to-clipboard-feedback-popover/copy-to-clipboard-feedback-popover.component.ts","./src/app/core/social-sharing/social-sharing-web.service.ts","./src/app/core/social-sharing/social-sharing.service.ts","./src/app/shared/components/form-select-myprojects/form-select-myprojects.component.html","./src/app/shared/components/form-select-myprojects/form-select-myprojects.component.ts","./node_modules/rxjs/dist/esm/internal/firstValueFrom.js","./src/app/shared/components/fs-carousel/fs-slide/stack-slide/stack-popover-actions/stack-popover-actions.component.ts","./src/app/shared/components/fs-carousel/fs-slide/stack-slide/stack-popover-actions/stack-popover-actions.component.html","./src/app/shared/components/login/login-form.component.html","./src/app/shared/components/login/login-form.component.ts","./node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","./node_modules/@floating-ui/core/dist/floating-ui.core.mjs","./node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","./node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","./node_modules/ngx-float-ui/fesm2022/ngx-float-ui.mjs","./src/app/core/services/flag.service.ts","./src/app/shared/components/modal-report/modal-report.component.html","./src/app/shared/components/modal-report/modal-report.component.ts","./src/app/shared/components/top-navbar/searchbar/searchbar.component.ts","./src/app/shared/components/top-navbar/searchbar/searchbar.component.html","./src/app/animations.ts","./src/app/shared/components/form-stack-create/form-stack-create.component.html","./src/app/shared/components/form-stack-create/form-stack-create.component.ts","./src/app/shared/components/top-navbar/drawer/top-navbar-drawer.component.html","./src/app/shared/components/top-navbar/drawer/top-navbar-drawer.component.ts","./src/app/shared/components/top-navbar/top-navbar.component.html","./src/app/shared/components/top-navbar/top-navbar.component.ts","./src/app/shared/components/ui/buttons/ellipsis-button/ellipsis-button.component.ts","./src/app/shared/components/ui/buttons/ellipsis-button/ellipsis-button.component.html","./src/app/stacks/shared/components/collab-modal/collab-modal.component.ts","./src/app/stacks/shared/components/collab-modal/collab-modal.component.html","./src/app/stacks/shared/services/stack.service.ts","./node_modules/angularx-qrcode/fesm2022/angularx-qrcode.mjs","./src/app/tokens/shared/components/qr-code/qr-code.component.html","./src/app/tokens/shared/components/qr-code/qr-code.component.ts","./node_modules/@ionic/core/components/index.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/browser.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/can-promise.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/alignment-pattern.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/alphanumeric-data.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/bit-buffer.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/bit-matrix.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/byte-data.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/error-correction-code.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/error-correction-level.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/finder-pattern.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/format-info.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/galois-field.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/kanji-data.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/mask-pattern.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/mode.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/numeric-data.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/polynomial.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/qrcode.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/reed-solomon-encoder.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/regex.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/segments.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/utils.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/version-check.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/core/version.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/renderer/canvas.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/renderer/svg-tag.js","./node_modules/angularx-qrcode/node_modules/qrcode/lib/renderer/utils.js","./node_modules/dijkstrajs/dijkstra.js","./node_modules/encode-utf8/index.js"],"sourcesContent":["/**\n * Mailer\n * @format\n */\n\nimport { Injectable } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { take } from 'rxjs/operators';\nimport { OnboardingTypes } from '@app/onboarding/shared/onboarding.model';\nimport { Token, TOKEN_QUERY_PARAM } from '@app/tokens/shared/tokens.model';\nimport { MailerApiService, MailTopic, ProjectListInput, SendMail } from '../api/mailer.api.service';\nimport { getMp4Source } from '@app/shared/models/clip.model';\nimport { Stack } from '@app/shared/models/stack.model';\nimport { Utils } from '@app/shared/utils';\n\nconst DEBUG_LOGS = false;\n\n@Injectable({\n  providedIn: 'root',\n})\nexport class MailerService {\n  constructor(\n    // private store: Store<fromStore.State>,\n    private mailerApi: MailerApiService,\n    private translate: TranslateService\n  ) {}\n\n  /**\n   * Send Invite Email or resend\n   */\n  sendInviteEmail({\n    token,\n    fromName,\n    fromEmail,\n    toEmail,\n    message,\n    routeId = OnboardingTypes.Projects,\n    returnUrl,\n    projectList = [],\n  }: {\n    token: Token;\n    fromName: string;\n    fromEmail: string;\n    toEmail: string;\n    routeId: OnboardingTypes | string;\n    message: string;\n    returnUrl: string;\n    projectList: ProjectListInput[];\n  }) {\n    const { id: tokenId } = token;\n\n    const getEmailTranslatePath = (el) => {\n      switch (routeId) {\n        case OnboardingTypes.Weddings: {\n          return 'EMAILS.ONBOARDING.WEDDINGS.' + el;\n        }\n        default: {\n          return 'EMAILS.ONBOARDING.EVENTS.' + el;\n        }\n      }\n    };\n    const footer = `${this.translate.instant(getEmailTranslatePath('INVITE_INSTRUCTION'))}`;\n\n    const { projectsHtml, projectsText } = this.mailerApi.buildProjectsListMessage(projectList);\n\n    const messageNoNewlines = Utils.convertNewlinesToBr(message);\n\n    const params: SendMail = {\n      tokenId,\n      tokenQueryParam: TOKEN_QUERY_PARAM,\n      toEmail,\n      fromEmail: `${fromName} (${fromEmail})`,\n      // name, // this is the toName... confusing!\n      subject: this.translate.instant(getEmailTranslatePath('INVITE_SUBJECT')),\n      topic: MailTopic.InviteToCrew,\n      // toEmail: 'jd@filmstacker.com',//must be confirmed in AWS SES\n      message: messageNoNewlines + '<br><br>' + projectsHtml,\n      messageText: Utils.stripHtml(messageNoNewlines, { leaveBrTags: true }) + '<br><br>' + projectsText,\n      footer,\n      heading: this.translate.instant(getEmailTranslatePath('INVITE_HEADING')),\n      buttonLabel: this.translate.instant(getEmailTranslatePath('INVITE_CTA')),\n      returnUrl,\n    };\n\n    DEBUG_LOGS &&\n      console.log(`[TOKENS] sendingEmail:`, {\n        toEmail,\n        fromEmail,\n        projectsText,\n        message,\n        footer,\n        returnUrl,\n        params,\n      });\n\n    return this.mailerApi.sendEmail(params).pipe(take(1));\n  }\n\n  /**\n   * Send Download Stack Email\n   */\n  sendStackDownloadEmail({ toName, toEmail, stack = {} }: { toName: string; toEmail: string; stack: Partial<Stack> }) {\n    const { title, clips } = stack;\n    const clipsTxt = this.translate.instant('COMMON.CLIPS');\n\n    const { messageHtml, messageText } = this.mailerApi.buildClipsDownloadMessage(clips.map(getMp4Source), clipsTxt);\n\n    const params: SendMail = {\n      toEmail,\n      fromEmail: '', // info@filmstacker.com\n      subject: this.translate.instant('EMAILS.DOWNLOAD_STACK.SUBJECT'),\n      topic: MailTopic.DownloadStack,\n      heading: this.translate.instant('EMAILS.DOWNLOAD_STACK.HEADING') + ': ' + title,\n      message: this.translate.instant('EMAILS.DOWNLOAD_STACK.MESSAGE') + '<br><br>' + messageHtml,\n      messageText: this.translate.instant('EMAILS.DOWNLOAD_STACK.MESSAGE') + '<br><br>' + messageText,\n      footer: this.translate.instant('EMAILS.DOWNLOAD_STACK.FOOTER'),\n    };\n\n    DEBUG_LOGS &&\n      console.log(`[TOKENS] sendingEmail:`, {\n        params,\n      });\n\n    return this.mailerApi.sendEmail(params).pipe(take(1));\n  }\n}\n","/**\n * HLS Logic\n * Global APP Video Service\n *\n * @note search code for DEV HLS TRANSCODE MVP-742\n *\n * @format\n */\n\nimport { Injectable } from '@angular/core';\nimport { AlertController } from '@ionic/angular/standalone';\nimport { Store } from '@ngrx/store';\nimport { State } from '../store/reducers';\nimport { Clip, HLS_META_UPGRADE } from '@app/shared/models/clip.model';\nimport { Stack } from '@app/shared/models/stack.model';\nimport { Utils } from '@app/shared/utils';\nimport { UpdateParam } from '../api/api-types';\nimport { StacksService } from './stacks.service';\nimport { ClipsCoreService } from './clips.service';\n/** @todo remove these following HLS TRanscode done */\nimport { ToasterService } from './toaster.service';\nimport { lastValueFrom } from 'rxjs';\n\nconst DEBUG_LOGS = false;\nconst PAGE = '[VideoService]'; // eslint-disable-line @typescript-eslint/no-unused-vars\n\n@Injectable({\n  providedIn: 'root',\n})\nexport class VideoService {\n  /** only send sendStackForHLSTranscode once (hacky throttle) */\n  private didSendUpgrade = false;\n\n  constructor(\n    private alertCtrl: AlertController,\n    private toaster: ToasterService,\n    private stacksService: StacksService,\n    private clipsService: ClipsCoreService,\n    private store: Store<State>\n  ) {}\n\n  /**\n   * DEV HLS TRANSCODE MVP-742\n   * Update the Stack props to queue for HLS Transcoding\n   * 2022-10-24 fix: only send this once! this.didSendUpgrade\n   * @param stack\n   */\n  async sendStackForHLSTranscode(stack: Stack): Promise<string | Stack> {\n    if (!stack || !stack.projectId || !stack.stackId) {\n      return Promise.reject('Missing required arguments: stack ids');\n    }\n\n    if (this.didSendUpgrade) {\n      return Promise.resolve('didSendUpgrade');\n    }\n\n    try {\n      // get the clips without a source & not youtube\n      const clips = stack.clips.filter((c) => c && !c.hlsSrc && !c.providerId && !c.youtube_id);\n      if (clips.length > 0) {\n        // clips all need to be HLS first\n        console.log(`sendStackForHLSTranscode first clips:`, clips);\n        return await this.watchStackClipsForHLSTranscode(clips);\n      }\n      const hlsMeta = typeof stack.hlsMeta === 'string' ? Utils.tryParseJSON(stack.hlsMeta) : stack.hlsMeta || {};\n      const updates: UpdateParam[] = [\n        {\n          prop: 'hlsMeta',\n          value: {\n            ...hlsMeta,\n            ...HLS_META_UPGRADE,\n          },\n        },\n      ];\n      DEBUG_LOGS && console.log(`${PAGE} sendStackForHLSTranscode`, { stack, updates });\n      this.didSendUpgrade = true;\n      return this.stacksService.updateStack(stack, updates).then((updatedStack) => {\n        DEBUG_LOGS && console.log(`${PAGE} sendStackForHLSTranscode updatedStack`, { updatedStack, updates });\n        // this.toaster.present(`Submitted Stack for Transcoding...`);\n        // watching the status updates here:\n        this.stacksService.subStacksUpdated(stack.projectId, stack.stackId);\n        setTimeout(() => {\n          this.didSendUpgrade = false;\n        }, 900);\n        return updatedStack;\n      });\n    } catch (error) {\n      console.error(error);\n      this.toaster.present(`Error while sending Stack to Transcoding...`);\n    }\n  }\n\n  /**\n   * Stack Playlist HLS Upgrades MVP-983\n   * Update the Clip props to queue for HLS Transcoding\n   * + Subscribe to updates, awaiting all clips to be done\n   * @param clip\n   */\n  async watchStackClipsForHLSTranscode(clips: Clip[]): Promise<string> {\n    if (!Array.isArray(clips) || clips.length < 1) {\n      return Promise.reject('Missing required arguments: clips');\n    }\n    try {\n      for (const clip of clips) {\n        // send and watch clip in HLS Transcode\n        await this.sendClipForHLSTranscode(clip);\n\n        // ref: await this.clipsService.createClipFromFilestack(res, this.captureToProjectId, this.userId)\n      }\n      return 'success';\n    } catch (error) {\n      console.error(error);\n      this.toaster.present(`Error while sending Clip to Transcoding...`);\n      return 'error';\n    }\n  }\n  /**\n   * DEV HLS TRANSCODE MVP-742\n   * Update the Clip props to queue for HLS Transcoding\n   * @param clip\n   */\n  sendClipForHLSTranscode(clip: Clip): Promise<Clip | string> {\n    if (!clip || !clip.projectId || !clip.id) {\n      return Promise.reject('Missing required arguments: clip ids');\n    }\n    const updates: UpdateParam[] = [\n      {\n        prop: 'hlsMeta',\n        value: HLS_META_UPGRADE,\n      },\n    ];\n    DEBUG_LOGS && console.log(`${PAGE} sendClipForHLSTranscode`, { clip, updates });\n    return lastValueFrom(this.clipsService.updateClip(clip, updates)).then((updatedClip) => {\n      DEBUG_LOGS && console.log(`${PAGE} sendClipForHLSTranscode updatedClip`, { updatedClip, updates });\n      return updatedClip;\n    });\n  }\n  /**\n   * DEV HLS TRANSCODE MVP-742\n   */\n  async confirmSendClipForHLSTranscode(clip: Clip) {\n    const alert = await this.alertCtrl.create({\n      header: 'Add this Clip to the HLS Transcoding queue?',\n      // subHeader: `We'll loop the Clips and create HLS version of them too, if not already done.`,\n      // message: `Note that if this is a Youtube Clip, we're going to cancel this request...`,\n      buttons: [\n        {\n          text: 'Cancel',\n          role: 'cancel',\n          handler: () => {\n            console.log('Confirm Canceled...');\n          },\n        },\n        {\n          text: 'Transcode',\n          cssClass: 'ion-color-secondary',\n          handler: () =>\n            this.sendClipForHLSTranscode(clip)\n              .then(() => {\n                this.toaster.present(`Submitted for Transcoding...`);\n              })\n              .catch((error) => {\n                console.warn(`[ClipPopover] confirmTranscode caught:`, error);\n                this.toaster.present(`Oops! There was an error. Please refresh and try again.`);\n              }),\n        },\n      ],\n    });\n    return await alert.present();\n  }\n}\n","/** @format */\n\nimport { ITEM_TYPE } from '@app/shared/models/layout.model';\n\nexport enum SHARING_METHOD {\n  CLIPBOARD = 'Clipboard',\n  FACEBOOK = 'Facebook',\n  TWITTER = 'Twitter',\n  LINKEDIN = 'LinkedIn',\n  WEB_API = 'navigator.share',\n  NATIVE = 'Native',\n  QR = 'QR',\n}\n\n/**\n * url: A string representing the URL to be shared.\n * title: A string representing the title to be shared, usually document.title.\n * text: Any text you want to include.\n *\n * ref: https://css-tricks.com/how-to-use-the-web-share-api/\n */\nexport interface ShareableItem {\n  id: string;\n  title: string;\n  description?: string;\n  shareUrl: string;\n  type: ITEM_TYPE;\n  tags?: string[];\n  shareCount?: number;\n}\n\nexport interface ShareResponse {\n  shareUrl: string;\n  itemType: ITEM_TYPE; // The type of shared content.\n  method: SHARING_METHOD; // The method in which the content is shared.\n}\n\nexport interface SharingParams {\n  title: string;\n  url: string;\n  text: string;\n  hashtags: string[];\n  itemType?: ITEM_TYPE;\n}\n","/** @format */\n\nimport { AppConfig } from '@app/core/config/config.model';\nimport { ITEM_TYPE } from '@app/shared/models/layout.model';\nimport { ShareableItem, SharingParams } from '../social-sharing.model';\n\nexport const extractSharingParamsFromShareableItem = (\n  item: ShareableItem,\n  appConfig: Partial<AppConfig>\n): SharingParams => {\n  const sharingParams: SharingParams = {\n    title: item.title,\n    url: item.shareUrl,\n    text: item.title,\n    hashtags: appConfig.hashTags,\n    itemType: item.type,\n  };\n\n  switch (item.type) {\n    case ITEM_TYPE.Projects: {\n      sharingParams.text = ['Check out this Filmstacker Project!', item.title].join(' ');\n      if (appConfig.isWidgetActive && appConfig.shareUrl) {\n        sharingParams.url = appConfig.shareUrl;\n      }\n      break;\n    }\n    case ITEM_TYPE.Stacks: {\n      sharingParams.text = ['Check out this Filmstack!', item.title].join(' ');\n      if (appConfig.isWidgetActive && appConfig.stackShareUrl) {\n        if (appConfig.stackShareUrlIncludesProject) {\n          sharingParams.url = [appConfig.stackShareUrl, appConfig.projectId, item.id].join('/');\n        } else {\n          sharingParams.url = [appConfig.stackShareUrl, item.id].join('');\n        }\n      }\n\n      break;\n    }\n    case ITEM_TYPE.Clips: {\n      break;\n    }\n  }\n\n  return sharingParams;\n};\n","/** @format */\n\nimport { Injectable } from '@angular/core';\nimport { SocialSharingService } from './social-sharing.service';\nimport { SocialSharing } from '@awesome-cordova-plugins/social-sharing/ngx';\nimport { ConfigService } from '@app/core/config/config.service';\nimport { ShareableItem, ShareResponse, SHARING_METHOD } from './social-sharing.model';\nimport { extractSharingParamsFromShareableItem } from './shared/utils';\n\nconst DEBUG_LOGS = false;\nconst PAGE = '[SocialSharingNative]';\n@Injectable()\nexport class SocialSharingNativeService implements SocialSharingService {\n  constructor(public socialSharing: SocialSharing, public configService: ConfigService) {}\n\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  async share(item: ShareableItem, event?: MouseEvent): Promise<ShareResponse> {\n    try {\n      const appConfig = await this.configService.appConfig;\n      const sharingParams = extractSharingParamsFromShareableItem(item, appConfig);\n\n      return this.socialSharing\n        .shareWithOptions(sharingParams)\n        .then(() =>\n          Promise.resolve({\n            itemType: sharingParams.itemType,\n            method: SHARING_METHOD.NATIVE,\n            shareUrl: sharingParams.url,\n          })\n        )\n        .catch((error) => {\n          throw new Error(error);\n        });\n    } catch (error) {\n      console.error(error);\n      return Promise.reject({\n        message: 'Sorry, we hit an error while trying to share. Please refresh and try again.',\n      });\n    }\n  }\n\n  async shareTo(item: ShareableItem, action: SHARING_METHOD): Promise<ShareResponse> {\n    DEBUG_LOGS && console.log(`${PAGE} shareTo`, item);\n\n    const functionName = 'shareTo' + action;\n\n    try {\n      const appConfig = await this.configService.appConfig;\n      const sharingParams = extractSharingParamsFromShareableItem(item, appConfig);\n      if (this[functionName]) {\n        // method exists on the component\n        return this[functionName](sharingParams); // call it, for ex. 'shareToFacebook'\n      } else {\n        return this.socialSharing\n          .shareWithOptions(sharingParams)\n          .then(() =>\n            Promise.resolve({\n              itemType: sharingParams.itemType,\n              method: action,\n              shareUrl: sharingParams.url,\n            })\n          )\n          .catch((error) => {\n            throw new Error(error);\n          });\n      }\n    } catch (error) {\n      console.error(error);\n      return Promise.reject({\n        message: 'Sorry, we hit an error while trying to share. Please refresh and try again.',\n      });\n    }\n  }\n}\n","/** @format */\n\nimport { Component, Input, ViewChild } from '@angular/core';\nimport { TranslatePipe } from '@ngx-translate/core';\nimport { BaseModalComponent } from '@app/shared/components/ui/modal/base-modal.component';\nimport { QrCodeComponent } from '../qr-code/qr-code.component';\n\n@Component({\n  selector: 'fs-qr-modal',\n  templateUrl: './qr-modal.component.html',\n  styleUrls: ['./qr-modal.component.scss'],\n  standalone: true,\n  imports: [BaseModalComponent, QrCodeComponent, TranslatePipe],\n})\nexport class QrModalComponent {\n  @Input() shareUrl = 'https://app.filmstacker.com';\n\n  @ViewChild('modal', { static: false, read: BaseModalComponent })\n  modal: BaseModalComponent;\n\n  dismiss(data = {}) {\n    this.modal.dismiss(data);\n    // const modal = await this.ModalCtrl.getTop();\n    // if (modal) {\n    //   modal.dismiss(data);\n    // }\n  }\n}\n","<fs-base-modal #modal [title]=\"'ONBOARDING.COMMON.QR_CODE' | translate\" mode=\"light\" class=\"center\">\n  <div style=\"height: 100%;width: 100%;\">\n    <app-qr-code [qrCode]=\"shareUrl\"></app-qr-code>\n    <p><a href=\"{{shareUrl}}\">{{shareUrl}}</a></p>\n  </div>\n</fs-base-modal>\n","/** @format */\n\nimport { Component, Input } from '@angular/core';\nimport { PopoverController } from '@ionic/angular/standalone';\nimport { SHARING_METHOD } from '../social-sharing.model';\nimport { ENABLE_FACEBOOK, ENABLE_TWITTER, ENABLE_LINKEDIN } from '@app/app.config';\nimport { ShareableItem } from '../social-sharing.model';\nimport { ActionPopoverComponent, PopoverAction } from '@app/shared/components/action-popover/action-popover.component';\n\n@Component({\n  selector: 'app-social-sharing-popover',\n  templateUrl: './social-sharing-popover.component.html',\n  styleUrls: ['./social-sharing-popover.component.scss'],\n  standalone: true,\n  imports: [ActionPopoverComponent],\n})\nexport class SocialSharingPopoverComponent {\n  @Input() item: ShareableItem;\n\n  actions: PopoverAction[] = [\n    { type: SHARING_METHOD.FACEBOOK, text: 'Facebook', icon: 'logo-facebook', disabled: !ENABLE_FACEBOOK },\n    ...(ENABLE_TWITTER \n      ? [{\n          type: SHARING_METHOD.TWITTER,\n          text: 'Twitter',\n          icon: 'logo-twitter',\n          disabled: false\n        }] \n      : []),\n    { type: SHARING_METHOD.LINKEDIN, text: 'LinkedIn', icon: 'logo-linkedin', disabled: !ENABLE_LINKEDIN },\n    { type: SHARING_METHOD.CLIPBOARD, text: 'Copy Link', icon: 'link' },\n    { type: SHARING_METHOD.QR, text: 'QR Code', icon: 'scan' }, // v4:'qr-scanner'\n  ];\n\n  constructor(private popoverCtrl: PopoverController) {}\n\n  async onSelected(action: string) {\n    this.dismiss({ action });\n    // console.log(action);\n  }\n\n  async dismiss(data = { action: 'dismiss' }) {\n    const popover = await this.popoverCtrl.getTop();\n    if (popover) {\n      popover.dismiss(data);\n    }\n  }\n}\n","<app-action-popover\n  [actions]=\"actions\" \n  (selected)=\"onSelected($event)\" \n>\n</app-action-popover>\n","<!-- @format -->\n\n<ng-container *ngIf=\"copyResult\">\n  <div class=\"success-icon ion-text-center ion-padding-horizontal\">\n    <ion-icon size=\"large\" name=\"thumbs-up-sharp\"></ion-icon>\n  </div>\n  <div class=\"success-message ion-text-center ion-padding-horizontal\">\n    {{ 'SOCIAL.COPY_TO_CLIPBOARD_SUCCEED' | translate }}\n  </div>\n  <div class=\"success-message success-url ion-text-center ion-padding-horizontal\">\n    {{ copyResult.shareUrl }}\n  </div>\n</ng-container>\n","/** @format */\n\nimport { ChangeDetectionStrategy, Component, Input } from '@angular/core';\nimport { ShareResponse } from '../social-sharing.model';\nimport { NgIf } from '@angular/common';\nimport { IonIcon } from '@ionic/angular/standalone';\nimport { TranslatePipe } from '@ngx-translate/core';\n\n@Component({\n    selector: 'app-copy-to-clipboard-feedback-popover',\n    changeDetection: ChangeDetectionStrategy.OnPush,\n    templateUrl: './copy-to-clipboard-feedback-popover.component.html',\n    styleUrls: ['./copy-to-clipboard-feedback-popover.component.scss'],\n    standalone: true,\n    imports: [\n        NgIf,\n        IonIcon,\n        TranslatePipe,\n    ],\n})\nexport class CopyToClipboardFeedbackPopoverComponent {\n  @Input() copyResult: ShareResponse;\n}\n","/** @format */\n\nimport { Injectable } from '@angular/core';\nimport { Platform, ModalController, PopoverController } from '@ionic/angular/standalone';\nimport { ConfigService } from '@app/core/config/config.service';\nimport { QrModalComponent } from '@app/tokens/shared/components/qr-modal/qr-modal.component';\nimport { SocialSharingService } from './social-sharing.service';\nimport { SHARING_METHOD, ShareResponse, SharingParams, ShareableItem } from './social-sharing.model';\nimport { SocialSharingPopoverComponent } from './social-sharing-popover/social-sharing-popover.component';\nimport { CopyToClipboardFeedbackPopoverComponent } from './copy-to-clipboard-feedback-popover/copy-to-clipboard-feedback-popover.component';\nimport { extractSharingParamsFromShareableItem } from './shared/utils';\n\nconst DEBUG_LOGS = false;\nconst PAGE = '[SocialSharingWeb]';\n\n// declare let FB;\n\n@Injectable()\nexport class SocialSharingWebService implements SocialSharingService {\n  constructor(\n    private modalCtrl: ModalController,\n    private popoverCtrl: PopoverController,\n    private configService: ConfigService,\n    private platform: Platform\n  ) {}\n\n  async share(item: ShareableItem, event?: MouseEvent): Promise<ShareResponse> {\n    DEBUG_LOGS && console.log('Shared item: ', { item });\n    try {\n      const appConfig = await this.configService.appConfig;\n      DEBUG_LOGS && console.log('Share', { item, appConfig });\n\n      if (!appConfig.allowSharing) {\n        return Promise.reject({ message: 'Sorry, social sharing is disabled.', success: false, item: item.type });\n      }\n      if (!item || !item.shareUrl) {\n        return Promise.reject({ message: 'Sorry, could not find that URL.', success: false, item: item.type });\n      }\n\n      if (this.platform.is('mobile') && navigator && navigator.share) {\n        DEBUG_LOGS && console.log('The Web Share API IS supported...');\n        const sharingParams = extractSharingParamsFromShareableItem(item, appConfig);\n\n        return navigator\n          .share({\n            url: sharingParams.url,\n            text: sharingParams.text,\n            title: sharingParams.title,\n          })\n          .then(() => ({\n            success: true,\n            itemType: item.type,\n            shareUrl: sharingParams.url,\n            method: SHARING_METHOD.WEB_API,\n          }));\n      } else {\n        DEBUG_LOGS && console.log('The Web Share API is not supported in your browser.');\n        return this.openSocialSharingPopover(item, event);\n      }\n    } catch (error) {\n      console.error(error);\n      return Promise.reject({\n        message: 'Sorry, we hit an error while trying to share. Please refresh and try again.',\n      });\n    }\n  }\n\n  async openSocialSharingPopover(item: ShareableItem, event?: MouseEvent): Promise<ShareResponse> {\n    const popover = await this.popoverCtrl.create({\n      component: SocialSharingPopoverComponent,\n      componentProps: {\n        item,\n      },\n      event,\n    });\n    await popover.present();\n    const { data } = await popover.onWillDismiss();\n    if (data && data.action) {\n      return await this.shareTo(item, data.action);\n    } else {\n      // this will happen when the background is clicked to dismiss the popover...\n      // console.log(`${PAGE} no popover action to handle?`, data);\n      return Promise.reject({\n        message: 'Share cancelled',\n      });\n    }\n  }\n\n  async shareTo(item: ShareableItem, action: SHARING_METHOD): Promise<ShareResponse> {\n    DEBUG_LOGS && console.log(`${PAGE} shareTo`, item);\n\n    const functionName = 'shareTo' + action;\n\n    const appConfig = await this.configService.appConfig;\n    const sharingParams = extractSharingParamsFromShareableItem(item, appConfig);\n    if (this[functionName]) {\n      // method exists on the component\n      return this[functionName](sharingParams); // call it, for ex. 'shareToFacebook'\n    } else {\n      console.log(`${PAGE} no popover action to handle?`, action);\n      return Promise.reject({\n        message: 'no action to handle',\n      });\n    }\n  }\n\n  /**\n   * Copy Text to Clipboard\n   * https://www.30secondsofcode.org/blog/s/copy-text-to-clipboard-with-javascript\n   */\n  private async shareToClipboard(sharingParams: SharingParams): Promise<ShareResponse> {\n    try {\n      const str = sharingParams.url;\n      /*\n      DEBUG_LOGS && console.log('Copied on cipboard'); */\n      if (navigator && navigator.clipboard && navigator.clipboard.writeText) {\n        await navigator.clipboard.writeText(str);\n      } else {\n        const el = document.createElement('textarea');\n        el.value = str;\n        el.setAttribute('readonly', '');\n        el.style.position = 'absolute';\n        el.style.left = '-9999px';\n        document.body.appendChild(el);\n        el.select();\n\n        document.execCommand('copy');\n        document.body.removeChild(el);\n      }\n      await this.openCopyToClipboardFeedbackPopover({\n        itemType: sharingParams.itemType,\n        method: SHARING_METHOD.CLIPBOARD,\n        shareUrl: str,\n      });\n\n      return Promise.resolve({\n        itemType: sharingParams.itemType,\n        method: SHARING_METHOD.CLIPBOARD,\n        shareUrl: sharingParams.url,\n      });\n    } catch (error) {\n      console.warn(error);\n      return Promise.reject({\n        message: 'Unable to copy to clipboard...',\n      });\n    }\n  }\n\n  private async openCopyToClipboardFeedbackPopover(copyResult: ShareResponse, event?: MouseEvent) {\n    const popover = await this.popoverCtrl.create({\n      component: CopyToClipboardFeedbackPopoverComponent,\n      componentProps: {\n        copyResult,\n      },\n      event,\n    });\n    await popover.present();\n  }\n\n  /**\n   * Show QR Code Modal\n   */\n  private async shareToQR(sharingParams: SharingParams): Promise<ShareResponse> {\n    try {\n      const str = sharingParams.url;\n      // we will show this in a modal from the popover component\n\n      await this.openQRPopover({\n        itemType: sharingParams.itemType,\n        method: SHARING_METHOD.QR,\n        shareUrl: str,\n      });\n\n      return Promise.resolve({\n        itemType: sharingParams.itemType,\n        method: SHARING_METHOD.QR,\n        shareUrl: sharingParams.url,\n      });\n    } catch (error) {\n      console.warn(error);\n      return Promise.reject({\n        message: 'Unable to copy to clipboard...',\n      });\n    }\n  }\n\n  private async openQRPopover(share: ShareResponse, event?: MouseEvent) {\n    const modal = await this.modalCtrl.create({\n      component: QrModalComponent,\n      componentProps: {\n        shareUrl: share.shareUrl,\n      },\n      cssClass: 'social-sharing-modal', //'modal-lg',\n    });\n    await modal.present();\n  }\n\n  private async shareToFacebook(sharingParams: SharingParams): Promise<ShareResponse> {\n    const pageUrl = encodeURIComponent(sharingParams.url);\n    const sharingLink = `https://www.facebook.com/sharer.php?u=${pageUrl}`;\n    const win = this.openWindow(sharingLink, 'SocialSharingWindow');\n    if (win && win.success) {\n      return Promise.resolve({\n        itemType: sharingParams.itemType,\n        method: SHARING_METHOD.FACEBOOK,\n        shareUrl: sharingParams.url,\n      });\n    } else {\n      return Promise.reject({\n        message: 'Unable to share to Facebook.',\n      });\n    }\n  }\n\n  /**\n   * Share on LinkedIn\n   * Most of the new endpoints require API and Auth\n   * let's try a simple workaround, based on:\n   * https://stackoverflow.com/questions/10713542/how-to-make-a-custom-linkedin-share-button\n   *\n   * https://www.linkedin.com/sharing/share-offsite/?url={url}\n   */\n  private shareToLinkedIn(sharingParams: SharingParams): Promise<ShareResponse> {\n    const pageUrl = encodeURIComponent(sharingParams.url);\n    const sharingLink = `https://www.linkedin.com/sharing/share-offsite/?url=${pageUrl}`;\n    const win = this.openWindow(sharingLink, 'ShareOnLinkedIn');\n    if (win && win.success) {\n      return Promise.resolve({\n        itemType: sharingParams.itemType,\n        method: SHARING_METHOD.LINKEDIN,\n        shareUrl: sharingParams.url,\n      });\n    } else {\n      return Promise.reject({\n        message: 'Unable to share to LinkedIn.',\n      });\n    }\n  }\n\n  private async shareToTwitter(sharingParams: SharingParams): Promise<ShareResponse> {\n    const pageUrl = encodeURIComponent(sharingParams.url);\n    const text = encodeURIComponent(sharingParams.title);\n    let sharingQuery = `url=${pageUrl}&text=${text}`;\n\n    if (sharingParams.hashtags) {\n      sharingQuery += '&hashtags=' + sharingParams.hashtags.join(',');\n    }\n    const sharingLink = `https://twitter.com/intent/tweet?${sharingQuery}`;\n    const win = this.openWindow(sharingLink, 'SocialSharingWindow');\n    if (win && win.success) {\n      return Promise.resolve({\n        itemType: sharingParams.itemType,\n        method: SHARING_METHOD.TWITTER,\n        shareUrl: sharingParams.url,\n      });\n    } else {\n      return Promise.reject({\n        message: 'Unable to share to Twitter.',\n      });\n    }\n  }\n\n  private openWindow(url, windowName) {\n    try {\n      const newwindow = window.open(url, windowName, this.getWindowOptions());\n      newwindow.opener = null;\n      if (window.focus) {\n        newwindow.focus();\n      }\n      return { success: true };\n    } catch (error) {\n      console.warn(error);\n      return { success: false, error };\n    }\n  }\n\n  private getWindowOptions() {\n    if (!window || !window.innerWidth) {\n      return 'resizable,scrollbars,status';\n    }\n    const width = window.innerWidth > 500 ? 500 : window.innerWidth - 20;\n    const height = window.innerHeight > 600 ? 600 : window.innerHeight - 20;\n    const left = window.innerWidth / 2 - width / 2;\n    const top = window.innerHeight / 2 - height / 2;\n\n    return ['resizable,scrollbars,status', 'height=' + height, 'width=' + width, 'left=' + left, 'top=' + top].join();\n  }\n}\n","/** @format */\n\nimport { ModalController, Platform, PopoverController } from '@ionic/angular/standalone';\nimport { Injectable } from '@angular/core';\nimport { SocialSharingNativeService } from './social-sharing-native.service';\nimport { SocialSharingWebService } from './social-sharing-web.service';\nimport { SocialSharing } from '@awesome-cordova-plugins/social-sharing/ngx';\nimport { ConfigService } from '@app/core/config/config.service';\nimport { SHARING_METHOD, ShareResponse, ShareableItem } from './social-sharing.model';\n\n@Injectable({\n  providedIn: 'root',\n})\nexport abstract class SocialSharingService {\n  abstract share(item: ShareableItem, event?: MouseEvent): Promise<ShareResponse>;\n  abstract shareTo?(item: ShareableItem, action: SHARING_METHOD, isReviewedItem?: boolean): Promise<ShareResponse>; // directly share to a service\n}\n\nconst socialSharingFactory = (\n  platform: Platform,\n  socialSharing: SocialSharing,\n  modalCtrl: ModalController,\n  popoverCtrl: PopoverController,\n  configService: ConfigService\n) => {\n  if (platform.is('cordova')) {\n    return new SocialSharingNativeService(socialSharing, configService);\n  } else {\n    return new SocialSharingWebService(modalCtrl, popoverCtrl, configService, platform);\n  }\n};\n\nexport const socialSharingServiceProvider = {\n  provide: SocialSharingService,\n  useFactory: socialSharingFactory,\n  deps: [Platform, SocialSharing, ModalController, PopoverController, ConfigService],\n};\n","<!-- @format -->\n\n<ion-item *ngIf=\"myProjects && myProjects.length > 0 else noProjects\" lines=\"none\" class=\"select-myprojects\">\n  <ion-select label-placement=\"stacked\" interface=\"popover\" [value]=\"projectSelected\" [compareWith]=\"compareProjectsWith\"\n    [interfaceOptions]=\"{ cssClass: 'wide select-with-headings' }\" (ionChange)=\"projectChanged($event)\">\n    <div *ngIf=\"showLabel\" slot=\"label\">\n      {{ (isCapture ? 'CLIP.CAPTURE.SELECT_PROJECT_LABEL' : 'PROJECT.SELECT_PROJECT') | translate }}\n    </div>\n    <ion-select-option [value]=\"-1\" [disabled]=\"true\" class=\"select-heading not-bold\">\n      {{ 'PROJECT.SELECT_PROJECT' | translate }}\n    </ion-select-option>\n    <ng-container *ngIf=\"recentProjects && recentProjects.length > 0\">\n      <ion-select-option [value]=\"-2\" [disabled]=\"true\" class=\"select-heading\">\n        {{ 'PROJECT.RECENT_PROJECTS' | translate }}\n      </ion-select-option>\n      <ion-select-option *ngFor=\"let project of recentProjects\" [value]=\"project\">\n        {{ project?.title || project?.id || ('COMMON.LOADING' | translate) }}\n      </ion-select-option>\n      <ion-select-option [value]=\"-3\" [disabled]=\"true\" class=\"select-heading ion-padding-top\">\n        {{ 'PROJECT.ALL' | translate }}\n      </ion-select-option>\n    </ng-container>\n    <ion-select-option *ngFor=\"let project of myProjects\" [value]=\"project\">\n      {{ project?.title || project?.id || ('COMMON.LOADING' | translate) }}\n    </ion-select-option>\n  </ion-select>\n</ion-item>\n\n<ng-template #noProjects>\n  <!-- {{ 'CLIP.CAPTURE.NO_PROJECTS' | translate }} -->\n  <ion-button class=\"select-myprojects-create-project-btn\" (click)=\"createProject()\">\n    {{ 'STUDIO.FAB.CREATE_PROJECT' | translate }}\n  </ion-button>\n</ng-template>","/**\n * @format\n */\n\nimport { Component, OnInit, OnDestroy, Output, EventEmitter, Input } from '@angular/core';\nimport { NgIf, NgFor } from '@angular/common';\nimport { TranslateService, TranslatePipe } from '@ngx-translate/core';\nimport { IonButton, IonItem, IonSelect, IonSelectOption, ModalController } from '@ionic/angular/standalone';\nimport { combineLatest, Subject } from 'rxjs';\nimport { filter, map, take, takeUntil } from 'rxjs/operators';\nimport { Store } from '@ngrx/store';\nimport { State } from '@store/reducers';\nimport { selectMyProjects, selectRecentProjects } from '@store/selectors/projects.selectors';\nimport { ConfigService } from '@app/core/config/config.service';\nimport { EnvironService } from '@app/core/services/environ.service';\nimport { UserService } from '@app/core/services/user.service';\nimport { Project, sortProjectTitleAlpha } from '@app/projects/shared/project.model';\nimport { ProjectService } from '@app/projects/shared/services/project.service';\nimport { ProjectFormComponent } from '@app/projects/project-form/project-form.component';\n\nconst DEBUG_LOGS = false;\n\n@Component({\n  selector: 'app-form-select-myprojects',\n  templateUrl: './form-select-myprojects.component.html',\n  styleUrls: ['./form-select-myprojects.component.scss'],\n  standalone: true,\n  imports: [NgIf, NgFor, TranslatePipe, IonItem, IonSelect, IonSelectOption, IonButton],\n})\nexport class FormSelectMyProjects implements OnInit, OnDestroy {\n  /** Affects the stacked label */\n  @Input() showLabel = true;\n  @Input() isCapture = false;\n  @Input() onlyAdmin = false;\n  /** If available, use this projectId as the default selected (from stackId) */\n  @Input() defaultProjectId: string;\n  @Output() selected = new EventEmitter<Partial<Project>>();\n\n  projectSelected: Partial<Project> | number = -2;\n  myProjects: Partial<Project>[] = [];\n  recentProjects: Partial<Project>[] = [];\n\n  private get isProjectSelected(): boolean {\n    return (this.projectSelected as Partial<Project>)?.id?.length > 0;\n  }\n  /** @todo widget config */\n  private configProjects: Project[] = [];\n  private onDestroy$ = new Subject<void>();\n\n  constructor(\n    private store: Store<State>,\n    private configService: ConfigService,\n    private environService: EnvironService,\n    private projectService: ProjectService,\n    private userService: UserService,\n    private modalCtrl: ModalController,\n    private translate: TranslateService\n  ) {}\n\n  ngOnInit() {\n    // instead of passing the async to the backend\n    this.projectService\n      .getRecentProjects()\n      .pipe(\n        takeUntil(this.onDestroy$)\n        // if we care about edit access here, which we don't...\n        // map((projects: Project[]) =>\n        //   projects.map((project) => ({ ...project, canEdit: this.projectService.isProjectAdmin(project) }))\n        // )\n      )\n      .subscribe((projects) => {\n        if (this.onlyAdmin) {\n          this.userService.userId$.pipe(take(1)).subscribe((userId) => {\n            this.recentProjects = projects.filter((project) => this.projectService.isProjectAdmin(project, userId));\n          });\n        } else {\n          this.recentProjects = projects;\n        }\n        DEBUG_LOGS && console.log(`FormSelect recentProjects:`, this.recentProjects);\n      });\n\n    let timeout;\n    /**\n     * 1. get the activeProject and select that one if it's mine & is {eventType} template\n     * 2. Filter myProjects by eventType template\n     * 3. auto-select if only one project exists\n     */\n    combineLatest([\n      this.userService.userId$,\n      this.environService.activeProjectId$,\n      this.store.select(selectMyProjects),\n      this.store.select(selectRecentProjects),\n    ])\n      .pipe(\n        takeUntil(this.onDestroy$),\n        map((args) => {\n          DEBUG_LOGS && console.log(`FormSelect pre-filter:`, args);\n          return args;\n        }),\n        filter(\n          // eslint-disable-next-line @typescript-eslint/no-unused-vars\n          ([userId, activeProjectId, projects, recent]) =>\n            Array.isArray(projects) &&\n            projects.length > 0 &&\n            // wait until they're all loaded.. (not undefined in array)\n            projects.filter((p) => p && p.id).length === projects.length\n          // but for recent, we don't care if they are all loaded, just use what's there so far\n          // && recent.filter(p => p && p.id).length === recent.length\n        )\n      )\n      .subscribe(([userId, activeProjectId, projects, recent]) => {\n        const wasSelected = `${this.projectSelected}`;\n        if (this.onlyAdmin) {\n          projects = projects.filter((project) => this.projectService.isProjectAdmin(project, userId));\n        }\n        // projects are array and length > 0 based on filter above\n        this.myProjects = projects.sort(sortProjectTitleAlpha);\n        // we need to make sure that the recent are YOURS!\n        this.recentProjects =\n          Array.isArray(recent) && recent.length > 0\n            ? recent.filter((r) => r?.id && projects.findIndex((proj) => proj.id === r.id) > -1)\n            : [];\n\n        DEBUG_LOGS &&\n          console.log(`FormSelect projects`, {\n            projectSelected: this.projectSelected,\n            activeProjectId,\n            defaultProjectId: this.defaultProjectId,\n            projects,\n            recent: this.recentProjects,\n            isProjectSelected: this.isProjectSelected,\n          });\n        // if (this.isProjectSelected) {\n        //   // already a set value, but we might have just added more projects, so let's check again\n        //   return;\n        // }\n        if (this.defaultProjectId) {\n          const defaultExists = this.myProjects.find((p) => p.id === this.defaultProjectId);\n          if (defaultExists) {\n            DEBUG_LOGS &&\n              console.log(`FormSelect projects defaultExists`, {\n                defaultProjectId: this.defaultProjectId,\n                defaultExists,\n              });\n            this.projectSelected = defaultExists as Partial<Project>;\n          }\n        }\n        if (!this.isProjectSelected && activeProjectId) {\n          const activeExists = this.myProjects.find((p) => p.id === activeProjectId);\n          if (activeExists) {\n            DEBUG_LOGS &&\n              console.log(`FormSelect projects activeExists`, { projectSelected: this.projectSelected, activeExists });\n            this.projectSelected = activeExists as Partial<Project>;\n          }\n        }\n        if (!this.isProjectSelected) {\n          // let's look at recentProjects..\n          const recentExists = this.recentProjects.find(\n            (proj) => proj && proj.id && this.myProjects.find((p) => p.id === proj.id)\n          );\n          DEBUG_LOGS &&\n            console.log(`FormSelect projects recentExists`, { projectSelected: this.projectSelected, recentExists });\n          if (recentExists) {\n            this.projectSelected = recentExists as Partial<Project>;\n          }\n        }\n        if (!this.isProjectSelected && projects.length === 1) {\n          [this.projectSelected] = projects; // Using ES6 destructuring to get 1st element of array, returns undefined array.isEmpty\n        }\n\n        // check to see if we should emit, if it changed\n        if (this.isProjectSelected && this.projectSelected !== wasSelected) {\n          clearTimeout(timeout);\n          // avoid the ExpressionChangedAfterItHasBeenCheckedError\n          timeout = setTimeout(() => {\n            this.selected.emit(this.projectSelected as Partial<Project>);\n          }, 600);\n        }\n        // ...options ready for select\n      });\n  }\n\n  ngOnDestroy() {\n    this.onDestroy$.next();\n    this.onDestroy$.complete();\n  }\n\n  /**\n   * Project was selected, update with this value\n   */\n  projectChanged(event) {\n    if (event && event.target && event.target.value && event.target.value.id) {\n      this.projectSelected = event.target.value as Partial<Project>;\n      // avoid the ExpressionChangedAfterItHasBeenCheckedError\n      setTimeout(() => {\n        this.selected.emit(this.projectSelected as Partial<Project>);\n      }, 600);\n      /**\n       * @todo handle this event in parents?\n       */\n      // set the activeProject in EnvironStore to save it for next Capture\n      // this.environService.setActiveProjectId(event.target.value.id);\n    } else {\n      console.warn(`projectChanged not as expected?`, event);\n    }\n  }\n\n  compareProjectsWith(p1, p2) {\n    return p1 && p2 && typeof p1 !== 'number' && typeof p2 !== 'number' ? p1.id === p2.id : p1 === p2;\n  }\n\n  /**\n   * @todo implement appConfig allowPublishTo for buildProjectOptions\n   */\n  async getProjectsFromAppConfig() {\n    const config = await this.configService.appConfig;\n    if (Array.isArray(config.allowPublishTo) && config.allowPublishTo.length > 0) {\n      this.projectService.loadProjectPreviewsByIds(config.allowPublishTo);\n      this.projectService\n        .getProjectsFromStoreByIds(config.allowPublishTo)\n        .pipe(takeUntil(this.onDestroy$))\n        .subscribe((projects: Project[]) => {\n          this.configProjects = (projects || []).filter((p) => p && p.title && p.id);\n          // this.projects.push(...this.configProjects);\n          // if (this.configProjects.length === 1) {\n          //   this.hideProjectSelect = true;\n          //   setTimeout(() => {\n          //     this.stackForm.patchValue({\n          //       projectId: this.configProjects[0].id,\n          //     });\n          //   }, 900);\n          // }\n        });\n    }\n  }\n\n  async createProject() {\n    this.userService.userId$.pipe(take(1)).subscribe(async (userId) => {\n      const projectCreateModal = await this.modalCtrl.create({\n        component: ProjectFormComponent,\n        componentProps: {\n          userId,\n          // eventType: this.routeId,\n        },\n      });\n      projectCreateModal.present();\n      projectCreateModal.onDidDismiss().then((res) => {\n        if (res?.data?.project?.id) {\n          const projectId = res.data.project.id;\n          this.defaultProjectId = projectId;\n          // this.store.dispatch(environSetActiveProject({ projectId }));\n        }\n      });\n    });\n  }\n}\n","import { EmptyError } from './util/EmptyError';\nimport { SafeSubscriber } from './Subscriber';\nexport function firstValueFrom(source, config) {\n    const hasConfig = typeof config === 'object';\n    return new Promise((resolve, reject) => {\n        const subscriber = new SafeSubscriber({\n            next: (value) => {\n                resolve(value);\n                subscriber.unsubscribe();\n            },\n            error: reject,\n            complete: () => {\n                if (hasConfig) {\n                    resolve(config.defaultValue);\n                }\n                else {\n                    reject(new EmptyError());\n                }\n            },\n        });\n        source.subscribe(subscriber);\n    });\n}\n","/** @format */\n\nimport { Component, Input, OnInit, OnDestroy, Output, EventEmitter } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { PopoverController, AlertController, ModalController, NavController } from '@ionic/angular/standalone';\nimport { Subject, firstValueFrom } from 'rxjs';\nimport { take, takeUntil } from 'rxjs/operators';\nimport { Store } from '@ngrx/store';\nimport { State } from '@store/reducers';\nimport * as stackActions from '@store/actions/stacks.actions';\nimport { addToStackDrawer } from '@store/actions/stacks.actions';\nimport { MyStackService } from '@app/core/services/mystack.service';\nimport { StacksService as StacksCoreService } from '@app/core/services/stacks.service';\nimport { MailerService } from '@app/core/services/mailer.service';\nimport { ToasterService } from '@app/core/services/toaster.service';\nimport { VideoService } from '@app/core/services/video.service';\nimport { UserService } from '@app/core/services/user.service';\nimport { ShareableItem } from '@app/core/social-sharing/social-sharing.model';\nimport { SocialSharingService, socialSharingServiceProvider } from '@app/core/social-sharing/social-sharing.service';\nimport { Clip } from '@app/shared/models/clip.model';\nimport { Stack, STACK_PRIVACY } from '@app/shared/models/stack.model';\nimport { ModalReportComponent } from '@app/shared/components/modal-report/modal-report.component';\nimport { ITEM_TYPE } from '@app/shared/models/layout.model';\nimport { ActionPopoverComponent, PopoverAction } from '@app/shared/components/action-popover/action-popover.component';\nimport { StackService } from '@app/stacks/shared/services/stack.service';\nimport { CollabModalComponent } from '@app/stacks/shared/components/collab-modal/collab-modal.component';\nimport { EDIT_ROUTE } from '@app/app.routes';\n\n@Component({\n  selector: 'app-stack-popover-actions',\n  templateUrl: './stack-popover-actions.component.html',\n  styleUrls: ['./stack-popover-actions.component.scss'],\n  providers: [socialSharingServiceProvider],\n  standalone: true,\n  imports: [ActionPopoverComponent],\n})\nexport class StackPopoverActionsComponent implements OnInit, OnDestroy {\n  @Input() stack: Stack;\n  @Input() currentClip: Clip;\n  /** MVP-1003 Project.isModerated */\n  @Input() isModerated = false;\n  /** allow to skip the embedded handler methods */\n  @Input() doHandleAddToStack = true;\n  @Input() canAddToStack = true;\n  @Input() canShare = true;\n  @Input() canApprove = false;\n  @Input() canFeature = false; // ===canModerate\n  @Input() canFlag = true; // only since Drafts don't need flagged..\n  @Input() isProjectMember = false;\n  @Input() isProjectAdmin = false;\n\n  @Output() addToStack = new EventEmitter();\n\n  actions: PopoverAction[] = [];\n\n  private didAddUserActions = false;\n  private onDestroy$ = new Subject<void>();\n\n  constructor(\n    private store: Store<State>,\n    private navCtrl: NavController,\n    private popoverCtrl: PopoverController,\n    private alertCtrl: AlertController,\n    private modalCtrl: ModalController,\n    private mystackService: MyStackService,\n    private stacksService: StacksCoreService,\n    private stackService: StackService,\n    private userService: UserService,\n    private videoService: VideoService,\n    private socialSharingService: SocialSharingService,\n    private toaster: ToasterService,\n    private mailerService: MailerService,\n    private translate: TranslateService\n  ) {}\n\n  ngOnInit() {\n    // console.log(`isProjectMember='${this.isProjectMember}`)\n    // get the translations\n    this.translate\n      .get([\n        'COMMON.SHARE',\n        'COMMON.EDIT',\n        'COMMON.DELETE',\n        'STACK.ACTIONS.REPORT',\n        'STACK.ACTIONS.ADD_TO_STACK',\n        'STACK.ACTIONS.INVITE_CREW',\n        'STACK.ACTIONS.REMOVE_CREW',\n        'STACK.ACTIONS.REMOVE_CREW_TIP',\n        'STACK.ACTIONS.FEATURE',\n        'STACK.ACTIONS.UNFEATURE',\n        'STACK.ACTIONS.APPROVE',\n        'STACK.ACTIONS.UNAPPROVE',\n        'STACK.ACTIONS.DOWNLOAD',\n      ])\n      .pipe(take(1))\n      .subscribe((translated) => {\n        if (this.canShare) {\n          this.actions.unshift({ type: 'share', text: translated['COMMON.SHARE'], icon: 'share-outline' });\n        }\n        if (this.canAddToStack) {\n          this.actions.unshift({\n            type: 'add-to-stack',\n            text: translated['STACK.ACTIONS.ADD_TO_STACK'],\n            icon: 'add-outline',\n          });\n        }\n        if (this.canFeature) {\n          if (this.stack.featured && this.stack.featured > 0) {\n            this.actions.push({\n              type: 'un-feature',\n              text: translated['STACK.ACTIONS.UNFEATURE'],\n              icon: 'star-outline',\n            });\n          } else {\n            this.actions.push({ type: 'feature', text: translated['STACK.ACTIONS.FEATURE'], icon: 'star' });\n          }\n        }\n        // check moderation\n        if (this.isModerated && this.canApprove && this.stack?.privacy === STACK_PRIVACY.PUBLIC) {\n          if (this.stack.isApproved) {\n            // put it at the end\n            this.actions.push({\n              type: 'un-approve',\n              text: translated['STACK.ACTIONS.UNAPPROVE'],\n              icon: 'lock-closed-outline',\n            });\n          } else {\n            // at the top\n            this.actions.unshift({ type: 'approve', text: translated['STACK.ACTIONS.APPROVE'], icon: 'checkmark' });\n          }\n        }\n        if (this.canFlag) {\n          this.actions.push({ type: 'flag', text: translated['STACK.ACTIONS.REPORT'], icon: 'flag-outline' });\n        }\n\n        this.userService.userId$.pipe(takeUntil(this.onDestroy$)).subscribe((userId) => {\n          // if it's a draft and not private, allow to make collaborative MVP-1176\n          if (!this.stack.dtePublished && !this.stack.private && this.stack.privacy !== STACK_PRIVACY.PRIVATE) {\n            // if it is mine or i'm a projectAdmin (canModerate)\n            if ((userId && this.stack.userId === userId) || this.canFeature) {\n              if (this.stack.isCollaborative) {\n                this.actions.push({\n                  type: 'remove-collab',\n                  text: translated['STACK.ACTIONS.REMOVE_CREW'],\n                  tooltip: translated['STACK.ACTIONS.REMOVE_CREW_TIP'],\n                  icon: 'person-remove-outline',\n                });\n              } else {\n                this.actions.push({\n                  type: 'make-collab',\n                  text: translated['STACK.ACTIONS.INVITE_CREW'],\n                  icon: 'person-add-outline',\n                });\n              }\n            }\n          }\n          if (userId && this.stack && this.stack.userId === userId) {\n            // IS the current user's stack\n            if (!this.didAddUserActions) {\n              this.didAddUserActions = true;\n              this.actions.push({ type: 'edit', text: translated['COMMON.EDIT'], icon: 'create-outline' });\n              this.actions.push({ type: 'delete', text: translated['COMMON.DELETE'], icon: 'trash-outline' });\n            }\n          } else if (this.didAddUserActions) {\n            // they might have just logged off\n            this.actions = this.actions.filter((a) => a.type !== 'delete' && a.type !== 'edit');\n            this.didAddUserActions = false;\n          } else if (userId && this.isProjectMember) {\n            // if i'm a projectMember then allow to edit, removing edit if it was there before\n            this.actions = this.actions.filter((a) => a.type !== 'edit');\n            this.actions.push({ type: 'edit', text: translated['COMMON.EDIT'], icon: 'create-outline' });\n          }\n\n          // DOWNLOAD STACK: check if user is globalAdmin\n          this.userService.userIsGlobalAdmin$.pipe(take(1)).subscribe((isGlobalAdmin) => {\n            if (\n              (userId && this.stack?.userId === userId) ||\n              this.canFeature ||\n              this.isProjectAdmin ||\n              !!isGlobalAdmin\n            ) {\n              console.log(\n                'Before we can Download (v1) we need the stack.clips data, not just playlist (slide preview)'\n              );\n            }\n            // download stack if it's mine, or i am admin (isProjectAdmin), or GLOBAL ADMIN,\n            // we need all stack.clips data, not just playlist (slide preview))\n            // should only show on the Player Page, or if we've watched it already this might show in stack-slide\n            if (\n              this.stack?.clips?.length > 0 &&\n              ((userId && this.stack?.userId === userId) || this.canFeature || this.isProjectAdmin || !!isGlobalAdmin)\n            ) {\n              this.actions.push({\n                type: 'download',\n                text: translated['STACK.ACTIONS.DOWNLOAD'],\n                icon: 'download-outline',\n              });\n            }\n          });\n        });\n      });\n\n    // /**\n    //  * Check currentUser Cognito Groups for Admin access to platform\n    //  */\n    // this.userService.userIsGlobalAdmin$.pipe(\n    //   takeUntil(this.onDestroy$),\n    //   filter((isAdmin) => !!isAdmin)\n    // ).subscribe((isAdmin) => {\n    //   console.log(`sub userGroups isAdmin:`, { isAdmin, stack: this.stack });\n    //   /**\n    //    * DEV HLS TRANSCODE MVP-742\n    //    * @todo implement when ready...\n    //    */\n    //   if (this.stack && !this.stack.hlsSrc) {\n    //     this.actions.push({ type: 'admin_hls', text: 'Transcode HLS', icon: 'aperture-sharp' }); // beer-outline\n    //   }\n    // });\n  }\n\n  ngOnDestroy() {\n    this.onDestroy$.next();\n    this.onDestroy$.complete();\n  }\n\n  async onSelected(type: string) {\n    // console.log('on selected', type, this.stack);\n    const res = { type };\n    switch (type) {\n      case 'make-collab': {\n        const modal = await this.modalCtrl.create({\n          component: CollabModalComponent,\n          componentProps: {\n            stack: this.stack,\n          },\n        });\n        modal.present();\n        // const data = await modal.onWillDismiss();\n        // console.log(`Modal dismissed`, data);\n        break;\n      }\n      case 'remove-collab': {\n        this.stackService.removeCollaborative(this.stack.projectId, this.stack.stackId);\n        break;\n      }\n      case 'feature': {\n        // if can approve moderation & this was not approved, set true, else set whatever it is currently\n        const isApproved = this.isModerated && this.canApprove && !this.stack.isApproved ? true : this.stack.isApproved;\n        this.stackService.setStackFeatured({\n          projectId: this.stack.projectId,\n          stackId: this.stack.stackId,\n          featured: 1,\n          isApproved,\n        });\n        break;\n      }\n      case 'un-feature': {\n        this.stackService.setStackFeatured({\n          projectId: this.stack.projectId,\n          stackId: this.stack.stackId,\n          featured: 0,\n        });\n        break;\n      }\n      case 'approve': {\n        this.stackService.setStackIsApproved({\n          isApproved: true,\n          projectId: this.stack.projectId,\n          stackId: this.stack.stackId,\n        });\n        break;\n      }\n      case 'un-approve': {\n        this.stackService.setStackIsApproved({\n          isApproved: false,\n          projectId: this.stack.projectId,\n          stackId: this.stack.stackId,\n        });\n        break;\n      }\n      case 'add-to-stack': {\n        if (this.doHandleAddToStack) {\n          this.chooseStackDraft();\n        }\n        // instead of confirm here, allow the parent to handle the event\n        // this.confirmAddClipsToStack();\n        this.addToStack.emit();\n        break;\n      }\n      case 'share': {\n        const shareItem: ShareableItem = {\n          title: this.stack.title,\n          description: this.stack.description,\n          shareUrl: this.stack.shareUrl,\n          type: ITEM_TYPE.Stacks,\n          id: this.stack.stackId,\n          tags: this.stack.tags,\n        };\n        this.socialSharingService\n          .share(shareItem)\n          .then((response) => {\n            this.store.dispatch(\n              stackActions.share({ projectId: this.stack.projectId, stackId: this.stack.stackId, response })\n            );\n          })\n          .catch((error) => this.toaster.present(error.message));\n        break;\n      }\n      case 'flag': {\n        const modal = await this.modalCtrl.create({\n          component: ModalReportComponent,\n          componentProps: { reportedItem: this.stack },\n        });\n        await modal.present();\n        break;\n      }\n      case 'edit': {\n        /**\n         * if current route is already editor, open the publish modal & close out the drawer\n         * else nav to editor?\n         */\n        this.navCtrl.navigateForward(`/${EDIT_ROUTE}/${this.stack.projectId}/${this.stack.stackId}`);\n        break;\n      }\n      case 'download': {\n        this.confirmDownload(this.stack);\n        break;\n      }\n      case 'delete': {\n        this.confirmDelete();\n        break;\n      }\n      case 'admin_hls': {\n        this.confirmTranscode();\n        break;\n      }\n      default:\n        console.log(`@todo action ${type}`);\n    }\n    const popover = await this.popoverCtrl.getTop();\n    if (popover) {\n      popover.dismiss(res);\n    }\n  }\n\n  async confirmDownload(stack: Partial<Stack>) {\n    try {\n      const toName = await firstValueFrom(this.userService.username$);\n      const toEmail = await firstValueFrom(this.userService.email$);\n\n      const alert = await this.alertCtrl.create({\n        header: this.translate.instant('STACK.CONFIRM_DOWNLOAD'),\n        message: this.translate.instant('STACK.CONFIRM_DOWNLOAD_MSG'),\n        buttons: [\n          {\n            text: this.translate.instant('COMMON.CANCEL'),\n            role: 'cancel',\n            // eslint-disable-next-line @typescript-eslint/no-unused-vars\n            handler: (_) => {\n              console.log('Confirm Canceled...');\n            },\n          },\n          {\n            text: this.translate.instant('STACK.ACTIONS.DOWNLOAD'),\n            role: 'submit',\n            handler: () =>\n              this.mailerService\n                .sendStackDownloadEmail({\n                  toEmail,\n                  toName,\n                  stack,\n                })\n                .pipe(take(1))\n                // eslint-disable-next-line @typescript-eslint/no-unused-vars\n                .subscribe((res) => {\n                  this.toaster.present(this.translate.instant('EMAILS.EMAIL_SENT'));\n                }),\n          },\n        ],\n      });\n\n      return await alert.present();\n    } catch (error) {\n      console.warn(`[StackPopover] sendDownloadEmail caught:`, error);\n      this.toaster.present(this.translate.instant('ERRORS.GENERIC_OOPS'));\n    }\n  }\n\n  /**\n   * MVP-506\n   * 1. Open StackDrafts topnav Drawer\n   * 2. Choose the Add All or Add this one as an overlay on the draft poster?\n   */\n  async chooseStackDraft() {\n    if (this.stack && Array.isArray(this.stack.playlist) && this.stack.playlist.length > 0) {\n      const { playlist = [], projectId, title, description, poster } = this.stack;\n      // MVP-1342 add title and description if create new (Restack)\n      this.store.dispatch(\n        addToStackDrawer({\n          playlist,\n          isCreateNew: false,\n          projectId,\n          title,\n          description,\n          poster,\n        })\n      );\n    }\n  }\n\n  /**\n   * @deprecated MVP-506\n   */\n  async confirmAddClipsToStack() {\n    // return this.chooseStackDraft();\n\n    const buttons = [];\n    if (this.stack && Array.isArray(this.stack.playlist) && this.stack.playlist.length > 0) {\n      buttons.push({\n        text: this.translate.instant('CLIP.ALL_CLIPS'), //'All Clips',\n        handler: () => {\n          this.mystackService.addClipIdsToMyStack(this.stack.playlist);\n        },\n      });\n    }\n    if (this.currentClip && this.currentClip.id) {\n      buttons.push({\n        text: this.translate.instant('CLIP.THIS_CLIP'), //'This Clip',\n        handler: () => {\n          this.mystackService.addClipIdsToMyStack([{ projectId: this.currentClip.projectId, id: this.currentClip.id }]);\n        },\n      });\n    }\n    const alert = await this.alertCtrl.create({\n      header: this.translate.instant('CLIP.ADD_CLIPS_TO_EDITOR'), //'Add Clips To Stack Editor',\n      // message: 'Add All Clips from this Stack?',\n      buttons: [\n        ...buttons,\n        {\n          text: this.translate.instant('COMMON.CANCEL'),\n          role: 'cancel',\n          handler: () => true,\n        },\n      ],\n    });\n    return await alert.present();\n  }\n\n  async confirmDelete() {\n    const alert = await this.alertCtrl.create({\n      cssClass: 'alert-confirm-delete',\n      header: this.translate.instant('STACK.CONFIRM_DELETE'), // 'Are you sure you want to delete this Stack?',\n      subHeader: this.translate.instant('STACK.ACTION_CONFIRM'), //'This action can not be undone.',\n      message: this.translate.instant('STACK.CONFIRM_DELETE_MSG', {\n        title: this.stack.title\n          ? this.translate.instant('STACK.CONFIRM_DELETE_TITLE', { value: this.stack.title })\n          : this.translate.instant('STACK.CONFIRM_DELETE_NO_TITLE'),\n      }),\n      buttons: [\n        {\n          text: this.translate.instant('COMMON.CANCEL'),\n          role: 'cancel',\n          // eslint-disable-next-line @typescript-eslint/no-unused-vars\n          handler: (_) => {\n            console.log('Confirm Canceled...');\n          },\n        },\n        {\n          text: this.translate.instant('COMMON.DELETE'),\n          role: 'destructive',\n          cssClass: 'alert-button-warning',\n          handler: () =>\n            this.stacksService\n              .deleteStack(this.stack)\n              // eslint-disable-next-line @typescript-eslint/no-unused-vars\n              .then((res) => {\n                this.toaster.present(this.translate.instant('STACK.STACK_DELETED'));\n              })\n              .catch((error) => {\n                console.warn(`[StackPopover] deleteStack caught:`, error);\n                this.toaster.present(this.translate.instant('ERRORS.GENERIC_OOPS'));\n              }),\n        },\n      ],\n    });\n\n    return await alert.present();\n  }\n\n  /**\n   * @deprecated no need to translate, will be removed...\n   * DEV HLS TRANSCODE MVP-742\n   */\n  async confirmTranscode() {\n    const alert = await this.alertCtrl.create({\n      header: 'Add this Stack to the HLS Transcoding queue?',\n      // subHeader: `We'll loop the Clips and create HLS version of them too, if not already done.`,\n      subHeader: `Currently all Clips must be HLS for this to work.`,\n      message: `Note that if there's Youtube Clips included in this Stack, we're going to cancel this request...`,\n      buttons: [\n        {\n          text: 'Cancel',\n          role: 'cancel',\n          // eslint-disable-next-line @typescript-eslint/no-unused-vars\n          handler: (_) => {\n            console.log('Confirm Canceled...');\n          },\n        },\n        {\n          text: 'Transcode',\n          cssClass: 'ion-color-secondary',\n          handler: () =>\n            this.videoService\n              .sendStackForHLSTranscode(this.stack)\n              // eslint-disable-next-line @typescript-eslint/no-unused-vars\n              .then((res) => {\n                this.toaster.present(`Submitted for Transcoding...`);\n              })\n              .catch((error) => {\n                console.warn(`[StackPopover] confirmTranscode caught:`, error);\n                this.toaster.present(`Oops! There was an error. Please refresh and try again.`);\n              }),\n        },\n      ],\n    });\n    return await alert.present();\n  }\n}\n","<app-action-popover [actions]=\"actions\" (selected)=\"onSelected($event)\">\n</app-action-popover>\n","<!-- LOGIN FORM -->\n<form\n  *ngIf=\"mode === 'login'\"\n  class=\"fs-login-form\"\n  [formGroup]=\"loginForm\"\n  (keyup.enter)=\"loginUser()\"\n  (ngSubmit)=\"loginUser()\"\n>\n  <fs-form-input\n    label=\"Username or Email\"\n    [control]=\"loginForm.get('username') | formControlCast\"\n    [disabled]=\"loading\"\n  ></fs-form-input>\n  <fs-form-input\n    label=\"Password\"\n    type=\"password\"\n    [control]=\"loginForm.get('password') | formControlCast\"\n    [disabled]=\"loading\"\n  ></fs-form-input>\n  <div class=\"fs-login-form__error\" *ngIf=\"error\">\n    <div><strong>Error:</strong> {{ error }}</div>\n  </div>\n  <div class=\"ion-text-end\" style=\"margin-top: 10px;margin-right:16px;\">\n    <div><a routerLink=\"/reset-password\">{{ 'AUTH.FORGOT_PASSWORD' | translate }}</a>?</div>\n  </div>\n  <div class=\"fs-login-form__footer\">\n    <fs-button\n      class=\"fs-login-form__footer__submit\"\n      type=\"submit\"\n      size=\"large\"\n      [disabled]=\"isBusy\"\n      >{{ 'COMMON.LOGIN' | translate }}</fs-button\n    >\n    <fs-button\n      *ngIf=\"cancelText?.length > 0\"\n      class=\"fs-login-form__footer__cancel\"\n      buttonStyle=\"outline\"\n      (click)=\"cancelClick.emit()\"\n      >{{ cancelText }}</fs-button\n    >\n  </div>\n</form>\n\n<!-- NEW PASSWORD FORM -->\n<form\n  *ngIf=\"mode === 'new-password'\"\n  class=\"fs-login-form\"\n  [formGroup]=\"newPasswordForm\"\n  (ngSubmit)=\"submitNewPassword()\"\n>\n  <p style=\"margin-left:16px;\">{{ 'AUTH.NEW_PASSWORD_REQUIRED' | translate }}</p>\n  <fs-form-input\n    label=\"Current Password\"\n    type=\"password\"\n    [control]=\"newPasswordForm.get('password') | formControlCast\"\n    [disabled]=\"loading\"\n  ></fs-form-input>\n  <fs-form-input\n    label=\"New Password\"\n    type=\"password\"\n    [control]=\"newPasswordForm.get('newPassword') | formControlCast\"\n    [disabled]=\"loading\"\n  ></fs-form-input>\n  <fs-form-input\n    label=\"Repeat New Password\"\n    type=\"password\"\n    [control]=\"newPasswordForm.get('confirmPassword') | formControlCast\"\n    [disabled]=\"loading\"\n  ></fs-form-input>\n  <div class=\"fs-login-form__error\" *ngIf=\"error\">\n    <div><strong>Error:</strong> {{ error }}</div>\n  </div>\n  <ion-item class=\"fs-login-form__footer\">\n    <fs-button\n      class=\"fs-login-form__footer__submit\"\n      type=\"submit\"\n      [disabled]=\"isBusy\"\n      >Change password and login</fs-button\n    >\n  </ion-item>\n</form>\n","/** @format */\n\nimport { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { NgIf } from '@angular/common';\nimport { UntypedFormBuilder, UntypedFormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { Router, RouterLink } from '@angular/router';\nimport { take } from 'rxjs/operators';\nimport { TranslateService, TranslatePipe } from '@ngx-translate/core';\nimport { IonItem, LoadingController } from '@ionic/angular/standalone';\nimport { CONFIRM_AUTH_PAGE, NAV_PAGE_ON_LOGIN } from '@app/app.routes';\nimport { AnalyticsService } from '@app/core/services/analytics/analytics.service';\nimport { UserService } from '@app/core/services/user.service';\nimport { PasswordValidator } from '@app/shared/validators/password';\nimport { ButtonComponent } from '@app/shared/components/ui/buttons/button/button.component';\nimport { FormInputComponent } from '@app/shared/components/ui/form/form-input/form-input.component';\nimport { FormControlCastPipe } from '@app/shared/pipes/form-control-cast.pipe';\n// import { UsernameValidator } from '@app/shared/validators/username';\nimport { TOKEN_QUERY_PARAM } from '@app/tokens/shared/tokens.model';\nimport { TokensService } from '@app/tokens/shared/services/tokens.service';\nimport { environment } from 'src/environments/environment';\n\n@Component({\n  selector: 'fs-login-form',\n  templateUrl: './login-form.component.html',\n  styleUrls: ['./login-form.component.scss'],\n  standalone: true,\n  imports: [\n    NgIf,\n    FormsModule,\n    ReactiveFormsModule,\n    FormInputComponent,\n    RouterLink,\n    ButtonComponent,\n    TranslatePipe,\n    FormControlCastPipe,\n    IonItem,\n  ],\n})\nexport class LoginFormComponent {\n  @Input() routeOnSuccess: string = `/${NAV_PAGE_ON_LOGIN}`;\n  /** if there's a cancel route, we'll show the cancel button */\n  @Input() cancelText: string;\n  @Output() login = new EventEmitter<void>();\n  @Output() cancelClick = new EventEmitter<void>();\n\n  loginForm = this.formBuilder.group({\n    username: ['', [Validators.required]],\n    password: ['', [Validators.required]],\n  });\n  newPasswordForm = this.formBuilder.group(\n    {\n      password: ['', [Validators.required]],\n      newPassword: ['', [Validators.required, PasswordValidator.isValid]],\n      confirmPassword: [''],\n    },\n    {\n      validator: this.checkMatchingPasswords('newPassword', 'confirmPassword'),\n    }\n  );\n  mode: 'login' | 'new-password' = 'login';\n  error = '';\n  loading = false;\n  challengeAttributes: [Record<string, string>];\n\n  constructor(\n    private formBuilder: UntypedFormBuilder,\n    private translate: TranslateService,\n    private userService: UserService,\n    private tokensService: TokensService,\n    private analyticsService: AnalyticsService,\n    private loadingCtrl: LoadingController,\n    private router: Router\n  ) {}\n\n  get isBusy() {\n    return (\n      this.loading ||\n      (this.mode === 'login' && this.loginForm.invalid) ||\n      (this.mode === 'new-password' && this.newPasswordForm.invalid)\n    );\n  }\n\n  async loginUser() {\n    this.loading = true;\n    this.error = '';\n    const loader = await this.loadingCtrl.create({\n      message: this.translate.instant('AUTH.SIGNING_IN'),\n    });\n    await loader.present();\n    const username = (this.loginForm.controls.username.value || '').toLowerCase();\n    const password = this.loginForm.controls.password.value;\n    try {\n      const user = await this.userService.login(username, password);\n      if (!user) {\n        this.error = 'User not found. Please try again.';\n        console.warn('login no user?');\n        return;\n      }\n      if (user.cognitoUser?.challengeName === 'NEW_PASSWORD_REQUIRED') {\n        this.challengeAttributes =\n          user['challengeParam'] && user['challengeParam'].requiredAttributes\n            ? user['challengeParam'].requiredAttributes\n            : [];\n        throw new Error('NEW_PASSWORD_REQUIRED');\n      }\n      this.analyticsService.login();\n      // apply the token if exists\n      this.tokensService.tokenId$.pipe(take(1)).subscribe((tokenId) => {\n        if (tokenId) {\n          !environment.production && console.log(`[Login] token:`, tokenId);\n          // apply the token & toast success\n          this.tokensService.applyTokenToCurrentUser({ tokenId });\n        }\n      });\n      this.router.navigate([this.routeOnSuccess], {\n        queryParams: {\n          [TOKEN_QUERY_PARAM]: null,\n          returnUrl: null,\n        },\n        queryParamsHandling: 'merge',\n      });\n    } catch (err) {\n      switch (err.message) {\n        case 'User is not confirmed.':\n          this.router.navigateByUrl(`/${CONFIRM_AUTH_PAGE}`, {\n            state: { username },\n          });\n          break;\n        case 'NEW_PASSWORD_REQUIRED':\n          this.mode = 'new-password';\n          console.log(`@todo ${err.message}`);\n          break;\n        default:\n          console.log(`[LoginForm] caught (username: ${username})`, err.message);\n          this.error = err.message;\n      }\n    } finally {\n      this.loading = false;\n      loader.dismiss();\n    }\n  }\n\n  async submitNewPassword() {\n    this.loading = true;\n    this.error = '';\n    const loader = await this.loadingCtrl.create({\n      message: 'Changing password and signing in...',\n    });\n    loader.present();\n\n    const { password, newPassword } = this.newPasswordForm.value;\n    try {\n      if (password === newPassword) {\n        throw new Error('Please do not re-use the provided Password.');\n      }\n      await this.userService.completeNewPassword(newPassword, this.challengeAttributes || []);\n      loader.dismiss();\n      this.router.navigate([this.routeOnSuccess], {\n        queryParams: {\n          returnUrl: null,\n        },\n        queryParamsHandling: 'merge',\n      });\n    } catch (err) {\n      this.error = err.message;\n    }\n  }\n\n  private checkMatchingPasswords(passwordField: string, confirmPasswordField: string) {\n    return (group: UntypedFormGroup) => {\n      const passwordInput = group.controls[passwordField];\n      const passwordConfirmationInput = group.controls[confirmPasswordField];\n      if (passwordInput.value !== passwordConfirmationInput.value) {\n        return passwordConfirmationInput.setErrors({ notMatching: true });\n      } else {\n        return passwordConfirmationInput.setErrors(null);\n      }\n    };\n  }\n}\n","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n  x: v,\n  y: v\n});\nconst oppositeSideMap = {\n  left: 'right',\n  right: 'left',\n  bottom: 'top',\n  top: 'bottom'\n};\nconst oppositeAlignmentMap = {\n  start: 'end',\n  end: 'start'\n};\nfunction clamp(start, value, end) {\n  return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n  return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n  return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n  return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n  return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n  return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n  return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n  return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n  if (rtl === void 0) {\n    rtl = false;\n  }\n  const alignment = getAlignment(placement);\n  const alignmentAxis = getAlignmentAxis(placement);\n  const length = getAxisLength(alignmentAxis);\n  let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n  if (rects.reference[length] > rects.floating[length]) {\n    mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n  }\n  return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n  const oppositePlacement = getOppositePlacement(placement);\n  return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n  return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);\n}\nfunction getSideList(side, isStart, rtl) {\n  const lr = ['left', 'right'];\n  const rl = ['right', 'left'];\n  const tb = ['top', 'bottom'];\n  const bt = ['bottom', 'top'];\n  switch (side) {\n    case 'top':\n    case 'bottom':\n      if (rtl) return isStart ? rl : lr;\n      return isStart ? lr : rl;\n    case 'left':\n    case 'right':\n      return isStart ? tb : bt;\n    default:\n      return [];\n  }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n  const alignment = getAlignment(placement);\n  let list = getSideList(getSide(placement), direction === 'start', rtl);\n  if (alignment) {\n    list = list.map(side => side + \"-\" + alignment);\n    if (flipAlignment) {\n      list = list.concat(list.map(getOppositeAlignmentPlacement));\n    }\n  }\n  return list;\n}\nfunction getOppositePlacement(placement) {\n  return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);\n}\nfunction expandPaddingObject(padding) {\n  return {\n    top: 0,\n    right: 0,\n    bottom: 0,\n    left: 0,\n    ...padding\n  };\n}\nfunction getPaddingObject(padding) {\n  return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n    top: padding,\n    right: padding,\n    bottom: padding,\n    left: padding\n  };\n}\nfunction rectToClientRect(rect) {\n  const {\n    x,\n    y,\n    width,\n    height\n  } = rect;\n  return {\n    width,\n    height,\n    top: y,\n    left: x,\n    right: x + width,\n    bottom: y + height,\n    x,\n    y\n  };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n  let {\n    reference,\n    floating\n  } = _ref;\n  const sideAxis = getSideAxis(placement);\n  const alignmentAxis = getAlignmentAxis(placement);\n  const alignLength = getAxisLength(alignmentAxis);\n  const side = getSide(placement);\n  const isVertical = sideAxis === 'y';\n  const commonX = reference.x + reference.width / 2 - floating.width / 2;\n  const commonY = reference.y + reference.height / 2 - floating.height / 2;\n  const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n  let coords;\n  switch (side) {\n    case 'top':\n      coords = {\n        x: commonX,\n        y: reference.y - floating.height\n      };\n      break;\n    case 'bottom':\n      coords = {\n        x: commonX,\n        y: reference.y + reference.height\n      };\n      break;\n    case 'right':\n      coords = {\n        x: reference.x + reference.width,\n        y: commonY\n      };\n      break;\n    case 'left':\n      coords = {\n        x: reference.x - floating.width,\n        y: commonY\n      };\n      break;\n    default:\n      coords = {\n        x: reference.x,\n        y: reference.y\n      };\n  }\n  switch (getAlignment(placement)) {\n    case 'start':\n      coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n      break;\n    case 'end':\n      coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n      break;\n  }\n  return coords;\n}\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n  const {\n    placement = 'bottom',\n    strategy = 'absolute',\n    middleware = [],\n    platform\n  } = config;\n  const validMiddleware = middleware.filter(Boolean);\n  const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n  let rects = await platform.getElementRects({\n    reference,\n    floating,\n    strategy\n  });\n  let {\n    x,\n    y\n  } = computeCoordsFromPlacement(rects, placement, rtl);\n  let statefulPlacement = placement;\n  let middlewareData = {};\n  let resetCount = 0;\n  for (let i = 0; i < validMiddleware.length; i++) {\n    const {\n      name,\n      fn\n    } = validMiddleware[i];\n    const {\n      x: nextX,\n      y: nextY,\n      data,\n      reset\n    } = await fn({\n      x,\n      y,\n      initialPlacement: placement,\n      placement: statefulPlacement,\n      strategy,\n      middlewareData,\n      rects,\n      platform,\n      elements: {\n        reference,\n        floating\n      }\n    });\n    x = nextX != null ? nextX : x;\n    y = nextY != null ? nextY : y;\n    middlewareData = {\n      ...middlewareData,\n      [name]: {\n        ...middlewareData[name],\n        ...data\n      }\n    };\n    if (reset && resetCount <= 50) {\n      resetCount++;\n      if (typeof reset === 'object') {\n        if (reset.placement) {\n          statefulPlacement = reset.placement;\n        }\n        if (reset.rects) {\n          rects = reset.rects === true ? await platform.getElementRects({\n            reference,\n            floating,\n            strategy\n          }) : reset.rects;\n        }\n        ({\n          x,\n          y\n        } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n      }\n      i = -1;\n    }\n  }\n  return {\n    x,\n    y,\n    placement: statefulPlacement,\n    strategy,\n    middlewareData\n  };\n};\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n  var _await$platform$isEle;\n  if (options === void 0) {\n    options = {};\n  }\n  const {\n    x,\n    y,\n    platform,\n    rects,\n    elements,\n    strategy\n  } = state;\n  const {\n    boundary = 'clippingAncestors',\n    rootBoundary = 'viewport',\n    elementContext = 'floating',\n    altBoundary = false,\n    padding = 0\n  } = evaluate(options, state);\n  const paddingObject = getPaddingObject(padding);\n  const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n  const element = elements[altBoundary ? altContext : elementContext];\n  const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n    element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n    boundary,\n    rootBoundary,\n    strategy\n  }));\n  const rect = elementContext === 'floating' ? {\n    x,\n    y,\n    width: rects.floating.width,\n    height: rects.floating.height\n  } : rects.reference;\n  const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n  const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n    x: 1,\n    y: 1\n  } : {\n    x: 1,\n    y: 1\n  };\n  const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n    elements,\n    rect,\n    offsetParent,\n    strategy\n  }) : rect);\n  return {\n    top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n    bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n    left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n    right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n  };\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n  name: 'arrow',\n  options,\n  async fn(state) {\n    const {\n      x,\n      y,\n      placement,\n      rects,\n      platform,\n      elements,\n      middlewareData\n    } = state;\n    // Since `element` is required, we don't Partial<> the type.\n    const {\n      element,\n      padding = 0\n    } = evaluate(options, state) || {};\n    if (element == null) {\n      return {};\n    }\n    const paddingObject = getPaddingObject(padding);\n    const coords = {\n      x,\n      y\n    };\n    const axis = getAlignmentAxis(placement);\n    const length = getAxisLength(axis);\n    const arrowDimensions = await platform.getDimensions(element);\n    const isYAxis = axis === 'y';\n    const minProp = isYAxis ? 'top' : 'left';\n    const maxProp = isYAxis ? 'bottom' : 'right';\n    const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n    const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n    const startDiff = coords[axis] - rects.reference[axis];\n    const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n    let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n    // DOM platform can return `window` as the `offsetParent`.\n    if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n      clientSize = elements.floating[clientProp] || rects.floating[length];\n    }\n    const centerToReference = endDiff / 2 - startDiff / 2;\n\n    // If the padding is large enough that it causes the arrow to no longer be\n    // centered, modify the padding so that it is centered.\n    const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n    const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n    const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n    // Make sure the arrow doesn't overflow the floating element if the center\n    // point is outside the floating element's bounds.\n    const min$1 = minPadding;\n    const max = clientSize - arrowDimensions[length] - maxPadding;\n    const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n    const offset = clamp(min$1, center, max);\n\n    // If the reference is small enough that the arrow's padding causes it to\n    // to point to nothing for an aligned placement, adjust the offset of the\n    // floating element itself. To ensure `shift()` continues to take action,\n    // a single reset is performed when this is true.\n    const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n    const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n    return {\n      [axis]: coords[axis] + alignmentOffset,\n      data: {\n        [axis]: offset,\n        centerOffset: center - offset - alignmentOffset,\n        ...(shouldAddOffset && {\n          alignmentOffset\n        })\n      },\n      reset: shouldAddOffset\n    };\n  }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n  const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n  return allowedPlacementsSortedByAlignment.filter(placement => {\n    if (alignment) {\n      return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n    }\n    return true;\n  });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n  if (options === void 0) {\n    options = {};\n  }\n  return {\n    name: 'autoPlacement',\n    options,\n    async fn(state) {\n      var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n      const {\n        rects,\n        middlewareData,\n        placement,\n        platform,\n        elements\n      } = state;\n      const {\n        crossAxis = false,\n        alignment,\n        allowedPlacements = placements,\n        autoAlignment = true,\n        ...detectOverflowOptions\n      } = evaluate(options, state);\n      const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n      const overflow = await detectOverflow(state, detectOverflowOptions);\n      const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n      const currentPlacement = placements$1[currentIndex];\n      if (currentPlacement == null) {\n        return {};\n      }\n      const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n      // Make `computeCoords` start from the right place.\n      if (placement !== currentPlacement) {\n        return {\n          reset: {\n            placement: placements$1[0]\n          }\n        };\n      }\n      const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n      const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n        placement: currentPlacement,\n        overflows: currentOverflows\n      }];\n      const nextPlacement = placements$1[currentIndex + 1];\n\n      // There are more placements to check.\n      if (nextPlacement) {\n        return {\n          data: {\n            index: currentIndex + 1,\n            overflows: allOverflows\n          },\n          reset: {\n            placement: nextPlacement\n          }\n        };\n      }\n      const placementsSortedByMostSpace = allOverflows.map(d => {\n        const alignment = getAlignment(d.placement);\n        return [d.placement, alignment && crossAxis ?\n        // Check along the mainAxis and main crossAxis side.\n        d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n        // Check only the mainAxis.\n        d.overflows[0], d.overflows];\n      }).sort((a, b) => a[1] - b[1]);\n      const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n      // Aligned placements should not check their opposite crossAxis\n      // side.\n      getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n      const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n      if (resetPlacement !== placement) {\n        return {\n          data: {\n            index: currentIndex + 1,\n            overflows: allOverflows\n          },\n          reset: {\n            placement: resetPlacement\n          }\n        };\n      }\n      return {};\n    }\n  };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n  if (options === void 0) {\n    options = {};\n  }\n  return {\n    name: 'flip',\n    options,\n    async fn(state) {\n      var _middlewareData$arrow, _middlewareData$flip;\n      const {\n        placement,\n        middlewareData,\n        rects,\n        initialPlacement,\n        platform,\n        elements\n      } = state;\n      const {\n        mainAxis: checkMainAxis = true,\n        crossAxis: checkCrossAxis = true,\n        fallbackPlacements: specifiedFallbackPlacements,\n        fallbackStrategy = 'bestFit',\n        fallbackAxisSideDirection = 'none',\n        flipAlignment = true,\n        ...detectOverflowOptions\n      } = evaluate(options, state);\n\n      // If a reset by the arrow was caused due to an alignment offset being\n      // added, we should skip any logic now since `flip()` has already done its\n      // work.\n      // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n      if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n        return {};\n      }\n      const side = getSide(placement);\n      const initialSideAxis = getSideAxis(initialPlacement);\n      const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n      const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n      const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n      const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n      if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n        fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n      }\n      const placements = [initialPlacement, ...fallbackPlacements];\n      const overflow = await detectOverflow(state, detectOverflowOptions);\n      const overflows = [];\n      let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n      if (checkMainAxis) {\n        overflows.push(overflow[side]);\n      }\n      if (checkCrossAxis) {\n        const sides = getAlignmentSides(placement, rects, rtl);\n        overflows.push(overflow[sides[0]], overflow[sides[1]]);\n      }\n      overflowsData = [...overflowsData, {\n        placement,\n        overflows\n      }];\n\n      // One or more sides is overflowing.\n      if (!overflows.every(side => side <= 0)) {\n        var _middlewareData$flip2, _overflowsData$filter;\n        const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n        const nextPlacement = placements[nextIndex];\n        if (nextPlacement) {\n          // Try next placement and re-run the lifecycle.\n          return {\n            data: {\n              index: nextIndex,\n              overflows: overflowsData\n            },\n            reset: {\n              placement: nextPlacement\n            }\n          };\n        }\n\n        // First, find the candidates that fit on the mainAxis side of overflow,\n        // then find the placement that fits the best on the main crossAxis side.\n        let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n        // Otherwise fallback.\n        if (!resetPlacement) {\n          switch (fallbackStrategy) {\n            case 'bestFit':\n              {\n                var _overflowsData$filter2;\n                const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n                  if (hasFallbackAxisSideDirection) {\n                    const currentSideAxis = getSideAxis(d.placement);\n                    return currentSideAxis === initialSideAxis ||\n                    // Create a bias to the `y` side axis due to horizontal\n                    // reading directions favoring greater width.\n                    currentSideAxis === 'y';\n                  }\n                  return true;\n                }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n                if (placement) {\n                  resetPlacement = placement;\n                }\n                break;\n              }\n            case 'initialPlacement':\n              resetPlacement = initialPlacement;\n              break;\n          }\n        }\n        if (placement !== resetPlacement) {\n          return {\n            reset: {\n              placement: resetPlacement\n            }\n          };\n        }\n      }\n      return {};\n    }\n  };\n};\n\nfunction getSideOffsets(overflow, rect) {\n  return {\n    top: overflow.top - rect.height,\n    right: overflow.right - rect.width,\n    bottom: overflow.bottom - rect.height,\n    left: overflow.left - rect.width\n  };\n}\nfunction isAnySideFullyClipped(overflow) {\n  return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n  if (options === void 0) {\n    options = {};\n  }\n  return {\n    name: 'hide',\n    options,\n    async fn(state) {\n      const {\n        rects\n      } = state;\n      const {\n        strategy = 'referenceHidden',\n        ...detectOverflowOptions\n      } = evaluate(options, state);\n      switch (strategy) {\n        case 'referenceHidden':\n          {\n            const overflow = await detectOverflow(state, {\n              ...detectOverflowOptions,\n              elementContext: 'reference'\n            });\n            const offsets = getSideOffsets(overflow, rects.reference);\n            return {\n              data: {\n                referenceHiddenOffsets: offsets,\n                referenceHidden: isAnySideFullyClipped(offsets)\n              }\n            };\n          }\n        case 'escaped':\n          {\n            const overflow = await detectOverflow(state, {\n              ...detectOverflowOptions,\n              altBoundary: true\n            });\n            const offsets = getSideOffsets(overflow, rects.floating);\n            return {\n              data: {\n                escapedOffsets: offsets,\n                escaped: isAnySideFullyClipped(offsets)\n              }\n            };\n          }\n        default:\n          {\n            return {};\n          }\n      }\n    }\n  };\n};\n\nfunction getBoundingRect(rects) {\n  const minX = min(...rects.map(rect => rect.left));\n  const minY = min(...rects.map(rect => rect.top));\n  const maxX = max(...rects.map(rect => rect.right));\n  const maxY = max(...rects.map(rect => rect.bottom));\n  return {\n    x: minX,\n    y: minY,\n    width: maxX - minX,\n    height: maxY - minY\n  };\n}\nfunction getRectsByLine(rects) {\n  const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n  const groups = [];\n  let prevRect = null;\n  for (let i = 0; i < sortedRects.length; i++) {\n    const rect = sortedRects[i];\n    if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n      groups.push([rect]);\n    } else {\n      groups[groups.length - 1].push(rect);\n    }\n    prevRect = rect;\n  }\n  return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n  if (options === void 0) {\n    options = {};\n  }\n  return {\n    name: 'inline',\n    options,\n    async fn(state) {\n      const {\n        placement,\n        elements,\n        rects,\n        platform,\n        strategy\n      } = state;\n      // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n      // ClientRect's bounds, despite the event listener being triggered. A\n      // padding of 2 seems to handle this issue.\n      const {\n        padding = 2,\n        x,\n        y\n      } = evaluate(options, state);\n      const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n      const clientRects = getRectsByLine(nativeClientRects);\n      const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n      const paddingObject = getPaddingObject(padding);\n      function getBoundingClientRect() {\n        // There are two rects and they are disjoined.\n        if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n          // Find the first rect in which the point is fully inside.\n          return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n        }\n\n        // There are 2 or more connected rects.\n        if (clientRects.length >= 2) {\n          if (getSideAxis(placement) === 'y') {\n            const firstRect = clientRects[0];\n            const lastRect = clientRects[clientRects.length - 1];\n            const isTop = getSide(placement) === 'top';\n            const top = firstRect.top;\n            const bottom = lastRect.bottom;\n            const left = isTop ? firstRect.left : lastRect.left;\n            const right = isTop ? firstRect.right : lastRect.right;\n            const width = right - left;\n            const height = bottom - top;\n            return {\n              top,\n              bottom,\n              left,\n              right,\n              width,\n              height,\n              x: left,\n              y: top\n            };\n          }\n          const isLeftSide = getSide(placement) === 'left';\n          const maxRight = max(...clientRects.map(rect => rect.right));\n          const minLeft = min(...clientRects.map(rect => rect.left));\n          const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n          const top = measureRects[0].top;\n          const bottom = measureRects[measureRects.length - 1].bottom;\n          const left = minLeft;\n          const right = maxRight;\n          const width = right - left;\n          const height = bottom - top;\n          return {\n            top,\n            bottom,\n            left,\n            right,\n            width,\n            height,\n            x: left,\n            y: top\n          };\n        }\n        return fallback;\n      }\n      const resetRects = await platform.getElementRects({\n        reference: {\n          getBoundingClientRect\n        },\n        floating: elements.floating,\n        strategy\n      });\n      if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n        return {\n          reset: {\n            rects: resetRects\n          }\n        };\n      }\n      return {};\n    }\n  };\n};\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n  const {\n    placement,\n    platform,\n    elements\n  } = state;\n  const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n  const side = getSide(placement);\n  const alignment = getAlignment(placement);\n  const isVertical = getSideAxis(placement) === 'y';\n  const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;\n  const crossAxisMulti = rtl && isVertical ? -1 : 1;\n  const rawValue = evaluate(options, state);\n\n  // eslint-disable-next-line prefer-const\n  let {\n    mainAxis,\n    crossAxis,\n    alignmentAxis\n  } = typeof rawValue === 'number' ? {\n    mainAxis: rawValue,\n    crossAxis: 0,\n    alignmentAxis: null\n  } : {\n    mainAxis: rawValue.mainAxis || 0,\n    crossAxis: rawValue.crossAxis || 0,\n    alignmentAxis: rawValue.alignmentAxis\n  };\n  if (alignment && typeof alignmentAxis === 'number') {\n    crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n  }\n  return isVertical ? {\n    x: crossAxis * crossAxisMulti,\n    y: mainAxis * mainAxisMulti\n  } : {\n    x: mainAxis * mainAxisMulti,\n    y: crossAxis * crossAxisMulti\n  };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n  if (options === void 0) {\n    options = 0;\n  }\n  return {\n    name: 'offset',\n    options,\n    async fn(state) {\n      var _middlewareData$offse, _middlewareData$arrow;\n      const {\n        x,\n        y,\n        placement,\n        middlewareData\n      } = state;\n      const diffCoords = await convertValueToCoords(state, options);\n\n      // If the placement is the same and the arrow caused an alignment offset\n      // then we don't need to change the positioning coordinates.\n      if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n        return {};\n      }\n      return {\n        x: x + diffCoords.x,\n        y: y + diffCoords.y,\n        data: {\n          ...diffCoords,\n          placement\n        }\n      };\n    }\n  };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n  if (options === void 0) {\n    options = {};\n  }\n  return {\n    name: 'shift',\n    options,\n    async fn(state) {\n      const {\n        x,\n        y,\n        placement\n      } = state;\n      const {\n        mainAxis: checkMainAxis = true,\n        crossAxis: checkCrossAxis = false,\n        limiter = {\n          fn: _ref => {\n            let {\n              x,\n              y\n            } = _ref;\n            return {\n              x,\n              y\n            };\n          }\n        },\n        ...detectOverflowOptions\n      } = evaluate(options, state);\n      const coords = {\n        x,\n        y\n      };\n      const overflow = await detectOverflow(state, detectOverflowOptions);\n      const crossAxis = getSideAxis(getSide(placement));\n      const mainAxis = getOppositeAxis(crossAxis);\n      let mainAxisCoord = coords[mainAxis];\n      let crossAxisCoord = coords[crossAxis];\n      if (checkMainAxis) {\n        const minSide = mainAxis === 'y' ? 'top' : 'left';\n        const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n        const min = mainAxisCoord + overflow[minSide];\n        const max = mainAxisCoord - overflow[maxSide];\n        mainAxisCoord = clamp(min, mainAxisCoord, max);\n      }\n      if (checkCrossAxis) {\n        const minSide = crossAxis === 'y' ? 'top' : 'left';\n        const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n        const min = crossAxisCoord + overflow[minSide];\n        const max = crossAxisCoord - overflow[maxSide];\n        crossAxisCoord = clamp(min, crossAxisCoord, max);\n      }\n      const limitedCoords = limiter.fn({\n        ...state,\n        [mainAxis]: mainAxisCoord,\n        [crossAxis]: crossAxisCoord\n      });\n      return {\n        ...limitedCoords,\n        data: {\n          x: limitedCoords.x - x,\n          y: limitedCoords.y - y,\n          enabled: {\n            [mainAxis]: checkMainAxis,\n            [crossAxis]: checkCrossAxis\n          }\n        }\n      };\n    }\n  };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n  if (options === void 0) {\n    options = {};\n  }\n  return {\n    options,\n    fn(state) {\n      const {\n        x,\n        y,\n        placement,\n        rects,\n        middlewareData\n      } = state;\n      const {\n        offset = 0,\n        mainAxis: checkMainAxis = true,\n        crossAxis: checkCrossAxis = true\n      } = evaluate(options, state);\n      const coords = {\n        x,\n        y\n      };\n      const crossAxis = getSideAxis(placement);\n      const mainAxis = getOppositeAxis(crossAxis);\n      let mainAxisCoord = coords[mainAxis];\n      let crossAxisCoord = coords[crossAxis];\n      const rawOffset = evaluate(offset, state);\n      const computedOffset = typeof rawOffset === 'number' ? {\n        mainAxis: rawOffset,\n        crossAxis: 0\n      } : {\n        mainAxis: 0,\n        crossAxis: 0,\n        ...rawOffset\n      };\n      if (checkMainAxis) {\n        const len = mainAxis === 'y' ? 'height' : 'width';\n        const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n        const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n        if (mainAxisCoord < limitMin) {\n          mainAxisCoord = limitMin;\n        } else if (mainAxisCoord > limitMax) {\n          mainAxisCoord = limitMax;\n        }\n      }\n      if (checkCrossAxis) {\n        var _middlewareData$offse, _middlewareData$offse2;\n        const len = mainAxis === 'y' ? 'width' : 'height';\n        const isOriginSide = ['top', 'left'].includes(getSide(placement));\n        const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n        const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n        if (crossAxisCoord < limitMin) {\n          crossAxisCoord = limitMin;\n        } else if (crossAxisCoord > limitMax) {\n          crossAxisCoord = limitMax;\n        }\n      }\n      return {\n        [mainAxis]: mainAxisCoord,\n        [crossAxis]: crossAxisCoord\n      };\n    }\n  };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n  if (options === void 0) {\n    options = {};\n  }\n  return {\n    name: 'size',\n    options,\n    async fn(state) {\n      var _state$middlewareData, _state$middlewareData2;\n      const {\n        placement,\n        rects,\n        platform,\n        elements\n      } = state;\n      const {\n        apply = () => {},\n        ...detectOverflowOptions\n      } = evaluate(options, state);\n      const overflow = await detectOverflow(state, detectOverflowOptions);\n      const side = getSide(placement);\n      const alignment = getAlignment(placement);\n      const isYAxis = getSideAxis(placement) === 'y';\n      const {\n        width,\n        height\n      } = rects.floating;\n      let heightSide;\n      let widthSide;\n      if (side === 'top' || side === 'bottom') {\n        heightSide = side;\n        widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n      } else {\n        widthSide = side;\n        heightSide = alignment === 'end' ? 'top' : 'bottom';\n      }\n      const maximumClippingHeight = height - overflow.top - overflow.bottom;\n      const maximumClippingWidth = width - overflow.left - overflow.right;\n      const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n      const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n      const noShift = !state.middlewareData.shift;\n      let availableHeight = overflowAvailableHeight;\n      let availableWidth = overflowAvailableWidth;\n      if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {\n        availableWidth = maximumClippingWidth;\n      }\n      if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {\n        availableHeight = maximumClippingHeight;\n      }\n      if (noShift && !alignment) {\n        const xMin = max(overflow.left, 0);\n        const xMax = max(overflow.right, 0);\n        const yMin = max(overflow.top, 0);\n        const yMax = max(overflow.bottom, 0);\n        if (isYAxis) {\n          availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n        } else {\n          availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n        }\n      }\n      await apply({\n        ...state,\n        availableWidth,\n        availableHeight\n      });\n      const nextDimensions = await platform.getDimensions(elements.floating);\n      if (width !== nextDimensions.width || height !== nextDimensions.height) {\n        return {\n          reset: {\n            rects: true\n          }\n        };\n      }\n      return {};\n    }\n  };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","function hasWindow() {\n  return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n  if (isNode(node)) {\n    return (node.nodeName || '').toLowerCase();\n  }\n  // Mocked nodes in testing environments may not be instances of Node. By\n  // returning `#document` an infinite loop won't occur.\n  // https://github.com/floating-ui/floating-ui/issues/2317\n  return '#document';\n}\nfunction getWindow(node) {\n  var _node$ownerDocument;\n  return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n  var _ref;\n  return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n  if (!hasWindow()) {\n    return false;\n  }\n  return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n  if (!hasWindow()) {\n    return false;\n  }\n  return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n  if (!hasWindow()) {\n    return false;\n  }\n  return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n  if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n    return false;\n  }\n  return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n  const {\n    overflow,\n    overflowX,\n    overflowY,\n    display\n  } = getComputedStyle(element);\n  return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);\n}\nfunction isTableElement(element) {\n  return ['table', 'td', 'th'].includes(getNodeName(element));\n}\nfunction isTopLayer(element) {\n  return [':popover-open', ':modal'].some(selector => {\n    try {\n      return element.matches(selector);\n    } catch (e) {\n      return false;\n    }\n  });\n}\nfunction isContainingBlock(elementOrCss) {\n  const webkit = isWebKit();\n  const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n  // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n  return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));\n}\nfunction getContainingBlock(element) {\n  let currentNode = getParentNode(element);\n  while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n    if (isContainingBlock(currentNode)) {\n      return currentNode;\n    } else if (isTopLayer(currentNode)) {\n      return null;\n    }\n    currentNode = getParentNode(currentNode);\n  }\n  return null;\n}\nfunction isWebKit() {\n  if (typeof CSS === 'undefined' || !CSS.supports) return false;\n  return CSS.supports('-webkit-backdrop-filter', 'none');\n}\nfunction isLastTraversableNode(node) {\n  return ['html', 'body', '#document'].includes(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n  return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n  if (isElement(element)) {\n    return {\n      scrollLeft: element.scrollLeft,\n      scrollTop: element.scrollTop\n    };\n  }\n  return {\n    scrollLeft: element.scrollX,\n    scrollTop: element.scrollY\n  };\n}\nfunction getParentNode(node) {\n  if (getNodeName(node) === 'html') {\n    return node;\n  }\n  const result =\n  // Step into the shadow DOM of the parent of a slotted node.\n  node.assignedSlot ||\n  // DOM Element detected.\n  node.parentNode ||\n  // ShadowRoot detected.\n  isShadowRoot(node) && node.host ||\n  // Fallback.\n  getDocumentElement(node);\n  return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n  const parentNode = getParentNode(node);\n  if (isLastTraversableNode(parentNode)) {\n    return node.ownerDocument ? node.ownerDocument.body : node.body;\n  }\n  if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n    return parentNode;\n  }\n  return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n  var _node$ownerDocument2;\n  if (list === void 0) {\n    list = [];\n  }\n  if (traverseIframes === void 0) {\n    traverseIframes = true;\n  }\n  const scrollableAncestor = getNearestOverflowAncestor(node);\n  const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n  const win = getWindow(scrollableAncestor);\n  if (isBody) {\n    const frameElement = getFrameElement(win);\n    return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n  }\n  return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\nfunction getFrameElement(win) {\n  return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { rectToClientRect, detectOverflow as detectOverflow$1, offset as offset$1, autoPlacement as autoPlacement$1, shift as shift$1, flip as flip$1, size as size$1, hide as hide$1, arrow as arrow$1, inline as inline$1, limitShift as limitShift$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n  const css = getComputedStyle(element);\n  // In testing environments, the `width` and `height` properties are empty\n  // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n  let width = parseFloat(css.width) || 0;\n  let height = parseFloat(css.height) || 0;\n  const hasOffset = isHTMLElement(element);\n  const offsetWidth = hasOffset ? element.offsetWidth : width;\n  const offsetHeight = hasOffset ? element.offsetHeight : height;\n  const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n  if (shouldFallback) {\n    width = offsetWidth;\n    height = offsetHeight;\n  }\n  return {\n    width,\n    height,\n    $: shouldFallback\n  };\n}\n\nfunction unwrapElement(element) {\n  return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n  const domElement = unwrapElement(element);\n  if (!isHTMLElement(domElement)) {\n    return createCoords(1);\n  }\n  const rect = domElement.getBoundingClientRect();\n  const {\n    width,\n    height,\n    $\n  } = getCssDimensions(domElement);\n  let x = ($ ? round(rect.width) : rect.width) / width;\n  let y = ($ ? round(rect.height) : rect.height) / height;\n\n  // 0, NaN, or Infinity should always fallback to 1.\n\n  if (!x || !Number.isFinite(x)) {\n    x = 1;\n  }\n  if (!y || !Number.isFinite(y)) {\n    y = 1;\n  }\n  return {\n    x,\n    y\n  };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n  const win = getWindow(element);\n  if (!isWebKit() || !win.visualViewport) {\n    return noOffsets;\n  }\n  return {\n    x: win.visualViewport.offsetLeft,\n    y: win.visualViewport.offsetTop\n  };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n  if (isFixed === void 0) {\n    isFixed = false;\n  }\n  if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n    return false;\n  }\n  return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n  if (includeScale === void 0) {\n    includeScale = false;\n  }\n  if (isFixedStrategy === void 0) {\n    isFixedStrategy = false;\n  }\n  const clientRect = element.getBoundingClientRect();\n  const domElement = unwrapElement(element);\n  let scale = createCoords(1);\n  if (includeScale) {\n    if (offsetParent) {\n      if (isElement(offsetParent)) {\n        scale = getScale(offsetParent);\n      }\n    } else {\n      scale = getScale(element);\n    }\n  }\n  const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n  let x = (clientRect.left + visualOffsets.x) / scale.x;\n  let y = (clientRect.top + visualOffsets.y) / scale.y;\n  let width = clientRect.width / scale.x;\n  let height = clientRect.height / scale.y;\n  if (domElement) {\n    const win = getWindow(domElement);\n    const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n    let currentWin = win;\n    let currentIFrame = getFrameElement(currentWin);\n    while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n      const iframeScale = getScale(currentIFrame);\n      const iframeRect = currentIFrame.getBoundingClientRect();\n      const css = getComputedStyle(currentIFrame);\n      const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n      const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n      x *= iframeScale.x;\n      y *= iframeScale.y;\n      width *= iframeScale.x;\n      height *= iframeScale.y;\n      x += left;\n      y += top;\n      currentWin = getWindow(currentIFrame);\n      currentIFrame = getFrameElement(currentWin);\n    }\n  }\n  return rectToClientRect({\n    width,\n    height,\n    x,\n    y\n  });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n  const leftScroll = getNodeScroll(element).scrollLeft;\n  if (!rect) {\n    return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n  }\n  return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {\n  if (ignoreScrollbarX === void 0) {\n    ignoreScrollbarX = false;\n  }\n  const htmlRect = documentElement.getBoundingClientRect();\n  const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :\n  // RTL <body> scrollbar.\n  getWindowScrollBarX(documentElement, htmlRect));\n  const y = htmlRect.top + scroll.scrollTop;\n  return {\n    x,\n    y\n  };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n  let {\n    elements,\n    rect,\n    offsetParent,\n    strategy\n  } = _ref;\n  const isFixed = strategy === 'fixed';\n  const documentElement = getDocumentElement(offsetParent);\n  const topLayer = elements ? isTopLayer(elements.floating) : false;\n  if (offsetParent === documentElement || topLayer && isFixed) {\n    return rect;\n  }\n  let scroll = {\n    scrollLeft: 0,\n    scrollTop: 0\n  };\n  let scale = createCoords(1);\n  const offsets = createCoords(0);\n  const isOffsetParentAnElement = isHTMLElement(offsetParent);\n  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n    if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n      scroll = getNodeScroll(offsetParent);\n    }\n    if (isHTMLElement(offsetParent)) {\n      const offsetRect = getBoundingClientRect(offsetParent);\n      scale = getScale(offsetParent);\n      offsets.x = offsetRect.x + offsetParent.clientLeft;\n      offsets.y = offsetRect.y + offsetParent.clientTop;\n    }\n  }\n  const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);\n  return {\n    width: rect.width * scale.x,\n    height: rect.height * scale.y,\n    x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n    y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n  };\n}\n\nfunction getClientRects(element) {\n  return Array.from(element.getClientRects());\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n  const html = getDocumentElement(element);\n  const scroll = getNodeScroll(element);\n  const body = element.ownerDocument.body;\n  const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n  const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n  let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n  const y = -scroll.scrollTop;\n  if (getComputedStyle(body).direction === 'rtl') {\n    x += max(html.clientWidth, body.clientWidth) - width;\n  }\n  return {\n    width,\n    height,\n    x,\n    y\n  };\n}\n\nfunction getViewportRect(element, strategy) {\n  const win = getWindow(element);\n  const html = getDocumentElement(element);\n  const visualViewport = win.visualViewport;\n  let width = html.clientWidth;\n  let height = html.clientHeight;\n  let x = 0;\n  let y = 0;\n  if (visualViewport) {\n    width = visualViewport.width;\n    height = visualViewport.height;\n    const visualViewportBased = isWebKit();\n    if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n      x = visualViewport.offsetLeft;\n      y = visualViewport.offsetTop;\n    }\n  }\n  return {\n    width,\n    height,\n    x,\n    y\n  };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n  const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n  const top = clientRect.top + element.clientTop;\n  const left = clientRect.left + element.clientLeft;\n  const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n  const width = element.clientWidth * scale.x;\n  const height = element.clientHeight * scale.y;\n  const x = left * scale.x;\n  const y = top * scale.y;\n  return {\n    width,\n    height,\n    x,\n    y\n  };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n  let rect;\n  if (clippingAncestor === 'viewport') {\n    rect = getViewportRect(element, strategy);\n  } else if (clippingAncestor === 'document') {\n    rect = getDocumentRect(getDocumentElement(element));\n  } else if (isElement(clippingAncestor)) {\n    rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n  } else {\n    const visualOffsets = getVisualOffsets(element);\n    rect = {\n      x: clippingAncestor.x - visualOffsets.x,\n      y: clippingAncestor.y - visualOffsets.y,\n      width: clippingAncestor.width,\n      height: clippingAncestor.height\n    };\n  }\n  return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n  const parentNode = getParentNode(element);\n  if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n    return false;\n  }\n  return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n  const cachedResult = cache.get(element);\n  if (cachedResult) {\n    return cachedResult;\n  }\n  let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n  let currentContainingBlockComputedStyle = null;\n  const elementIsFixed = getComputedStyle(element).position === 'fixed';\n  let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n  // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n  while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n    const computedStyle = getComputedStyle(currentNode);\n    const currentNodeIsContaining = isContainingBlock(currentNode);\n    if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n      currentContainingBlockComputedStyle = null;\n    }\n    const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n    if (shouldDropCurrentNode) {\n      // Drop non-containing blocks.\n      result = result.filter(ancestor => ancestor !== currentNode);\n    } else {\n      // Record last containing block for next iteration.\n      currentContainingBlockComputedStyle = computedStyle;\n    }\n    currentNode = getParentNode(currentNode);\n  }\n  cache.set(element, result);\n  return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n  let {\n    element,\n    boundary,\n    rootBoundary,\n    strategy\n  } = _ref;\n  const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n  const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n  const firstClippingAncestor = clippingAncestors[0];\n  const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n    const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n    accRect.top = max(rect.top, accRect.top);\n    accRect.right = min(rect.right, accRect.right);\n    accRect.bottom = min(rect.bottom, accRect.bottom);\n    accRect.left = max(rect.left, accRect.left);\n    return accRect;\n  }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n  return {\n    width: clippingRect.right - clippingRect.left,\n    height: clippingRect.bottom - clippingRect.top,\n    x: clippingRect.left,\n    y: clippingRect.top\n  };\n}\n\nfunction getDimensions(element) {\n  const {\n    width,\n    height\n  } = getCssDimensions(element);\n  return {\n    width,\n    height\n  };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n  const isOffsetParentAnElement = isHTMLElement(offsetParent);\n  const documentElement = getDocumentElement(offsetParent);\n  const isFixed = strategy === 'fixed';\n  const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n  let scroll = {\n    scrollLeft: 0,\n    scrollTop: 0\n  };\n  const offsets = createCoords(0);\n  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n    if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n      scroll = getNodeScroll(offsetParent);\n    }\n    if (isOffsetParentAnElement) {\n      const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n      offsets.x = offsetRect.x + offsetParent.clientLeft;\n      offsets.y = offsetRect.y + offsetParent.clientTop;\n    } else if (documentElement) {\n      // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n      // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n      offsets.x = getWindowScrollBarX(documentElement);\n    }\n  }\n  const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n  const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n  const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n  return {\n    x,\n    y,\n    width: rect.width,\n    height: rect.height\n  };\n}\n\nfunction isStaticPositioned(element) {\n  return getComputedStyle(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n  if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {\n    return null;\n  }\n  if (polyfill) {\n    return polyfill(element);\n  }\n  let rawOffsetParent = element.offsetParent;\n\n  // Firefox returns the <html> element as the offsetParent if it's non-static,\n  // while Chrome and Safari return the <body> element. The <body> element must\n  // be used to perform the correct calculations even if the <html> element is\n  // non-static.\n  if (getDocumentElement(element) === rawOffsetParent) {\n    rawOffsetParent = rawOffsetParent.ownerDocument.body;\n  }\n  return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n  const win = getWindow(element);\n  if (isTopLayer(element)) {\n    return win;\n  }\n  if (!isHTMLElement(element)) {\n    let svgOffsetParent = getParentNode(element);\n    while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n      if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n        return svgOffsetParent;\n      }\n      svgOffsetParent = getParentNode(svgOffsetParent);\n    }\n    return win;\n  }\n  let offsetParent = getTrueOffsetParent(element, polyfill);\n  while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n    offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n  }\n  if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n    return win;\n  }\n  return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n  const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n  const getDimensionsFn = this.getDimensions;\n  const floatingDimensions = await getDimensionsFn(data.floating);\n  return {\n    reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n    floating: {\n      x: 0,\n      y: 0,\n      width: floatingDimensions.width,\n      height: floatingDimensions.height\n    }\n  };\n};\n\nfunction isRTL(element) {\n  return getComputedStyle(element).direction === 'rtl';\n}\n\nconst platform = {\n  convertOffsetParentRelativeRectToViewportRelativeRect,\n  getDocumentElement,\n  getClippingRect,\n  getOffsetParent,\n  getElementRects,\n  getClientRects,\n  getDimensions,\n  getScale,\n  isElement,\n  isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n  return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n  let io = null;\n  let timeoutId;\n  const root = getDocumentElement(element);\n  function cleanup() {\n    var _io;\n    clearTimeout(timeoutId);\n    (_io = io) == null || _io.disconnect();\n    io = null;\n  }\n  function refresh(skip, threshold) {\n    if (skip === void 0) {\n      skip = false;\n    }\n    if (threshold === void 0) {\n      threshold = 1;\n    }\n    cleanup();\n    const elementRectForRootMargin = element.getBoundingClientRect();\n    const {\n      left,\n      top,\n      width,\n      height\n    } = elementRectForRootMargin;\n    if (!skip) {\n      onMove();\n    }\n    if (!width || !height) {\n      return;\n    }\n    const insetTop = floor(top);\n    const insetRight = floor(root.clientWidth - (left + width));\n    const insetBottom = floor(root.clientHeight - (top + height));\n    const insetLeft = floor(left);\n    const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n    const options = {\n      rootMargin,\n      threshold: max(0, min(1, threshold)) || 1\n    };\n    let isFirstUpdate = true;\n    function handleObserve(entries) {\n      const ratio = entries[0].intersectionRatio;\n      if (ratio !== threshold) {\n        if (!isFirstUpdate) {\n          return refresh();\n        }\n        if (!ratio) {\n          // If the reference is clipped, the ratio is 0. Throttle the refresh\n          // to prevent an infinite loop of updates.\n          timeoutId = setTimeout(() => {\n            refresh(false, 1e-7);\n          }, 1000);\n        } else {\n          refresh(false, ratio);\n        }\n      }\n      if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n        // It's possible that even though the ratio is reported as 1, the\n        // element is not actually fully within the IntersectionObserver's root\n        // area anymore. This can happen under performance constraints. This may\n        // be a bug in the browser's IntersectionObserver implementation. To\n        // work around this, we compare the element's bounding rect now with\n        // what it was at the time we created the IntersectionObserver. If they\n        // are not equal then the element moved, so we refresh.\n        refresh();\n      }\n      isFirstUpdate = false;\n    }\n\n    // Older browsers don't support a `document` as the root and will throw an\n    // error.\n    try {\n      io = new IntersectionObserver(handleObserve, {\n        ...options,\n        // Handle <iframe>s\n        root: root.ownerDocument\n      });\n    } catch (e) {\n      io = new IntersectionObserver(handleObserve, options);\n    }\n    io.observe(element);\n  }\n  refresh(true);\n  return cleanup;\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n  if (options === void 0) {\n    options = {};\n  }\n  const {\n    ancestorScroll = true,\n    ancestorResize = true,\n    elementResize = typeof ResizeObserver === 'function',\n    layoutShift = typeof IntersectionObserver === 'function',\n    animationFrame = false\n  } = options;\n  const referenceEl = unwrapElement(reference);\n  const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];\n  ancestors.forEach(ancestor => {\n    ancestorScroll && ancestor.addEventListener('scroll', update, {\n      passive: true\n    });\n    ancestorResize && ancestor.addEventListener('resize', update);\n  });\n  const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;\n  let reobserveFrame = -1;\n  let resizeObserver = null;\n  if (elementResize) {\n    resizeObserver = new ResizeObserver(_ref => {\n      let [firstEntry] = _ref;\n      if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {\n        // Prevent update loops when using the `size` middleware.\n        // https://github.com/floating-ui/floating-ui/issues/1740\n        resizeObserver.unobserve(floating);\n        cancelAnimationFrame(reobserveFrame);\n        reobserveFrame = requestAnimationFrame(() => {\n          var _resizeObserver;\n          (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n        });\n      }\n      update();\n    });\n    if (referenceEl && !animationFrame) {\n      resizeObserver.observe(referenceEl);\n    }\n    resizeObserver.observe(floating);\n  }\n  let frameId;\n  let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n  if (animationFrame) {\n    frameLoop();\n  }\n  function frameLoop() {\n    const nextRefRect = getBoundingClientRect(reference);\n    if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n      update();\n    }\n    prevRefRect = nextRefRect;\n    frameId = requestAnimationFrame(frameLoop);\n  }\n  update();\n  return () => {\n    var _resizeObserver2;\n    ancestors.forEach(ancestor => {\n      ancestorScroll && ancestor.removeEventListener('scroll', update);\n      ancestorResize && ancestor.removeEventListener('resize', update);\n    });\n    cleanupIo == null || cleanupIo();\n    (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n    resizeObserver = null;\n    if (animationFrame) {\n      cancelAnimationFrame(frameId);\n    }\n  };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n  // This caches the expensive `getClippingElementAncestors` function so that\n  // multiple lifecycle resets re-use the same result. It only lives for a\n  // single call. If other functions become expensive, we can add them as well.\n  const cache = new Map();\n  const mergedOptions = {\n    platform,\n    ...options\n  };\n  const platformWithCache = {\n    ...mergedOptions.platform,\n    _c: cache\n  };\n  return computePosition$1(reference, floating, {\n    ...mergedOptions,\n    platform: platformWithCache\n  });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n","import { NgStyle, NgClass, NgIf, CommonModule } from '@angular/common';\nimport * as i0 from '@angular/core';\nimport { EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, ViewChild, HostListener, InjectionToken, Directive, Inject, Input, Output, NgModule } from '@angular/core';\nimport { autoUpdate, offset, flip, shift, limitShift, arrow, autoPlacement, computePosition } from '@floating-ui/dom';\nimport { Subject, fromEvent, takeUntil, timer } from 'rxjs';\n\nvar NgxFloatUiPlacements;\n(function (NgxFloatUiPlacements) {\n    NgxFloatUiPlacements[\"AUTO\"] = \"auto\";\n    NgxFloatUiPlacements[\"AUTOSTART\"] = \"auto-start\";\n    NgxFloatUiPlacements[\"AUTOEND\"] = \"auto-end\";\n    NgxFloatUiPlacements[\"TOP\"] = \"top\";\n    NgxFloatUiPlacements[\"BOTTOM\"] = \"bottom\";\n    NgxFloatUiPlacements[\"LEFT\"] = \"left\";\n    NgxFloatUiPlacements[\"RIGHT\"] = \"right\";\n    NgxFloatUiPlacements[\"TOPSTART\"] = \"top-start\";\n    NgxFloatUiPlacements[\"BOTTOMSTART\"] = \"bottom-start\";\n    NgxFloatUiPlacements[\"LEFTSTART\"] = \"left-start\";\n    NgxFloatUiPlacements[\"RIGHTSTART\"] = \"right-start\";\n    NgxFloatUiPlacements[\"TOPEND\"] = \"top-end\";\n    NgxFloatUiPlacements[\"BOTTOMEND\"] = \"bottom-end\";\n    NgxFloatUiPlacements[\"LEFTEND\"] = \"left-end\";\n    NgxFloatUiPlacements[\"RIGHTEND\"] = \"right-end\";\n})(NgxFloatUiPlacements || (NgxFloatUiPlacements = {}));\n\nvar NgxFloatUiTriggers;\n(function (NgxFloatUiTriggers) {\n    NgxFloatUiTriggers[\"click\"] = \"click\";\n    NgxFloatUiTriggers[\"hover\"] = \"hover\";\n    NgxFloatUiTriggers[\"mousedown\"] = \"mousedown\";\n    NgxFloatUiTriggers[\"none\"] = \"none\";\n})(NgxFloatUiTriggers || (NgxFloatUiTriggers = {}));\n\nclass NgxFloatUiContentComponent {\n    elRef;\n    _viewRef;\n    _changeDetectorRef;\n    static nextId = 0;\n    get _dynamicArrowSides() {\n        return {\n            top: \"left\",\n            right: \"top\",\n            bottom: \"left\",\n            left: \"top\"\n        };\n    }\n    get _sideAxis() {\n        return {\n            left: \"x\",\n            top: \"y\",\n            right: \"x\",\n            bottom: \"y\"\n        };\n    }\n    get _staticArrowSides() {\n        return {\n            top: \"bottom\",\n            right: \"left\",\n            bottom: \"top\",\n            left: \"right\"\n        };\n    }\n    ariaHidden;\n    arrowColor = null;\n    displayType;\n    floatUiOptions = {\n        disableAnimation: false,\n        disableDefaultStyling: false,\n        boundariesElement: \"\",\n        trigger: NgxFloatUiTriggers.hover,\n        positionFixed: false,\n        appendToBody: false,\n        popperModifiers: []\n    };\n    floatUiSwitch;\n    floatUiViewRef;\n    id = `ngx_float_ui_${++NgxFloatUiContentComponent.nextId}`;\n    isMouseOver = !1;\n    onHidden = new EventEmitter();\n    onUpdate;\n    opacity;\n    referenceObject;\n    state;\n    text;\n    _destroy$ = new Subject();\n    _resizeCtrl$ = new Subject();\n    _styleId = `${this.id}_style`;\n    constructor(elRef, _viewRef, _changeDetectorRef) {\n        this.elRef = elRef;\n        this._viewRef = _viewRef;\n        this._changeDetectorRef = _changeDetectorRef;\n        this._toggleVisibility(!1);\n    }\n    clean() {\n        this.toggleVisibility(false);\n        if (!this.floatUiSwitch) {\n            return;\n        }\n        this.floatUiSwitch();\n    }\n    extractAppliedClassListExpr(classList = []) {\n        const klassList = Array.isArray(classList) ? classList : typeof classList === typeof \"\" ? classList.replace(/ /, \"\").split(\",\") : [];\n        return klassList.reduce((acc, klass) => {\n            acc[klass] = !0;\n            return acc;\n        }, {});\n    }\n    hide() {\n        if (this.floatUiSwitch) {\n            this.floatUiSwitch();\n        }\n        this.toggleVisibility(!1);\n        this.onHidden.emit();\n    }\n    ngOnDestroy() {\n        this._destroy$.next();\n        this.clean();\n        if (this.floatUiOptions.appendTo && this.elRef && this.elRef.nativeElement && this.elRef.nativeElement.parentNode) {\n            this._viewRef.detach();\n            this.elRef.nativeElement.parentNode.removeChild(this.elRef.nativeElement);\n        }\n    }\n    onDocumentResize() {\n        this.update();\n    }\n    onMouseOver() {\n        this.isMouseOver = true;\n    }\n    show() {\n        if (!this.referenceObject) {\n            return;\n        }\n        this._resizeCtrl$.next();\n        this._determineArrowColor();\n        this.floatUiSwitch = autoUpdate(this.referenceObject, this.floatUiViewRef.nativeElement, () => {\n            this._computePosition();\n        });\n        fromEvent(document, \"resize\")\n            .pipe(takeUntil(this._resizeCtrl$), takeUntil(this._destroy$))\n            .subscribe({\n            next: () => this.onDocumentResize()\n        });\n    }\n    showOnLeave() {\n        this.isMouseOver = false;\n        if (this.floatUiOptions.trigger !== NgxFloatUiTriggers.hover && !this.floatUiOptions.hideOnMouseLeave) {\n            return;\n        }\n        this.hide();\n    }\n    // Toggle visibility and detect changes - Run only after ngOnInit!\n    toggleVisibility(state) {\n        this._toggleVisibility(state);\n        // tslint:disable-next-line:no-string-literal\n        if (!this._changeDetectorRef[\"destroyed\"]) {\n            this._changeDetectorRef.detectChanges();\n        }\n    }\n    update() {\n        this._computePosition();\n    }\n    _computePosition() {\n        const appendToParent = this.floatUiOptions.appendTo && document.querySelector(this.floatUiOptions.appendTo);\n        if (appendToParent) {\n            const parent = this.elRef.nativeElement.parentNode;\n            if (parent !== appendToParent) {\n                parent && parent.removeChild(this.elRef.nativeElement);\n                appendToParent.appendChild(this.elRef.nativeElement);\n            }\n        }\n        const arrowElement = this.elRef.nativeElement.querySelector(\".float-ui-arrow\");\n        const arrowLen = arrowElement.offsetWidth;\n        // Get half the arrow box's hypotenuse length\n        const floatingOffset = Math.sqrt(2 * arrowLen ** 2) / 2;\n        const parsedAutoAlignment = (this.floatUiOptions.placement?.replace(\"auto-\", \"\") || void 0);\n        // Since \"auto\" doesn't really exist in floating-ui we pass undefined to have auto\n        const parsedPlacement = !this.floatUiOptions.placement || this.floatUiOptions.placement.indexOf(NgxFloatUiPlacements.AUTO) === 0\n            ? void 0\n            : this.floatUiOptions.placement;\n        const popperOptions = {\n            placement: parsedPlacement,\n            strategy: this.floatUiOptions.positionFixed ? \"fixed\" : \"absolute\",\n            middleware: [\n                offset(floatingOffset),\n                ...(this.floatUiOptions.preventOverflow\n                    ? [flip()]\n                    : []),\n                shift({ limiter: limitShift() }),\n                arrow({\n                    element: arrowElement,\n                    padding: 4\n                })\n            ]\n        };\n        // Since preventOverflow uses \"flip\" and \"flip\" can't be used with \"autoPlacement\" we get here only if both conditions are falsy\n        if (!this.floatUiOptions.preventOverflow && !popperOptions.placement) {\n            const boundariesElement = this.floatUiOptions.boundariesElement\n                ? document.querySelector(this.floatUiOptions.boundariesElement)\n                : this.referenceObject.parentElement;\n            popperOptions.middleware.push(autoPlacement({\n                crossAxis: !0,\n                alignment: parsedAutoAlignment,\n                autoAlignment: this.floatUiOptions.placement === NgxFloatUiPlacements.AUTO,\n                boundary: boundariesElement\n            }));\n        }\n        computePosition(this.referenceObject, this.floatUiViewRef.nativeElement, {\n            ...popperOptions\n        })\n            .then(({ middlewareData, x, y, placement }) => {\n            const side = placement.split(\"-\")[0];\n            this.floatUiViewRef.nativeElement.setAttribute(\"data-float-ui-placement\", side);\n            if (middlewareData.arrow) {\n                const staticArrowSide = this._staticArrowSides[side];\n                const dynamicArrowSide = this._dynamicArrowSides[side];\n                const dynamicSideAxis = this._sideAxis[dynamicArrowSide];\n                Object.assign(arrowElement.style, {\n                    top: \"\",\n                    bottom: \"\",\n                    left: \"\",\n                    right: \"\",\n                    [dynamicArrowSide]: middlewareData.arrow[dynamicSideAxis] != null ? `${middlewareData.arrow[dynamicSideAxis]}px` : \"\",\n                    [staticArrowSide]: `${-arrowLen / 2}px`\n                });\n            }\n            Object.assign(this.floatUiViewRef.nativeElement.style, {\n                left: `${x}px`,\n                top: `${y}px`\n            });\n            this.toggleVisibility(!0);\n            this.onUpdate?.();\n        });\n    }\n    _createArrowSelector() {\n        return `div#${this.id}.float-ui-container > .float-ui-arrow.ngxp__force-arrow`;\n    }\n    _determineArrowColor() {\n        if (!this.floatUiOptions.styles || this.arrowColor) {\n            return !1;\n        }\n        const ruleValue = this.floatUiOptions.styles[\"background-color\"] || this.floatUiOptions.styles.backgroundColor;\n        if (this.arrowColor === ruleValue) {\n            return !1;\n        }\n        this.arrowColor = ruleValue;\n        let $style = document.querySelector(`#${this._styleId}`);\n        const styleContent = this.arrowColor ?\n            `${this._createArrowSelector()}:before { background-color: ${this.arrowColor}; }` : \"\";\n        if (!$style) {\n            $style = document.createElement(\"style\");\n            $style.id = this._styleId;\n            $style.setAttribute(\"type\", \"text/css\");\n            document.head.appendChild($style);\n        }\n        // tslint:disable-next-line:no-string-literal\n        if ($style[\"styleSheet\"]) {\n            // tslint:disable-next-line:no-string-literal\n            $style[\"styleSheet\"].cssText = styleContent;\n            // This is required for IE8 and below.\n        }\n        else {\n            $style.innerHTML = styleContent;\n        }\n    }\n    _toggleVisibility(state) {\n        this.displayType = [\"none\", \"block\"][+state];\n        this.opacity = +state;\n        this.ariaHidden = `${!state}`;\n        this.state = state;\n    }\n    /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"18.0.4\", ngImport: i0, type: NgxFloatUiContentComponent, deps: [{ token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });\n    /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"14.0.0\", version: \"18.0.4\", type: NgxFloatUiContentComponent, isStandalone: true, selector: \"float-ui-content\", host: { listeners: { \"mouseover\": \"onMouseOver()\", \"mouseleave\": \"showOnLeave()\" } }, viewQueries: [{ propertyName: \"floatUiViewRef\", first: true, predicate: [\"floatUiViewRef\"], descendants: true, static: true }], exportAs: [\"ngxFloatUiContent\"], ngImport: i0, template: \"<div #floatUiViewRef\\n     [attr.id]=\\\"id\\\"\\n     [class.float-ui-container]=\\\"!floatUiOptions.disableDefaultStyling\\\"\\n     [class.float-ui-animation]=\\\"!floatUiOptions.disableAnimation\\\"\\n     [class.float-ui-fixed]=\\\"floatUiOptions.positionFixed\\\"\\n     [style.display]=\\\"displayType\\\"\\n     [style.opacity]=\\\"opacity\\\"\\n     [ngStyle]=\\\"floatUiOptions.styles\\\"\\n     [ngClass]=\\\"extractAppliedClassListExpr(floatUiOptions.applyClass)\\\"\\n     attr.aria-hidden=\\\"{{ariaHidden}}\\\"\\n     [attr.aria-describedby]=\\\"floatUiOptions.ariaDescribe || null\\\"\\n     attr.role=\\\"{{floatUiOptions.ariaRole}}\\\">\\n    <div *ngIf=\\\"text\\\"\\n         class=\\\"ngxp__inner\\\"\\n         [innerHTML]=\\\"text\\\">\\n        <ng-content></ng-content>\\n    </div>\\n    <div *ngIf=\\\"!text\\\"\\n         class=\\\"ngxp__inner\\\">\\n        <ng-content></ng-content>\\n    </div>\\n    <div class=\\\"float-ui-arrow\\\"\\n         [class.ngxp__force-arrow]=\\\"arrowColor\\\"\\n         [ngClass]=\\\"extractAppliedClassListExpr(floatUiOptions.applyArrowClass)\\\"></div>\\n\\n</div>\\n\", styles: [\"float-ui-content{position:relative;display:block}.float-ui-container{display:none;position:absolute;border-radius:3px;border:1px solid grey;box-shadow:0 0 2px #00000080;padding:10px}.float-ui-container.float-ui-fixed{position:fixed}.float-ui-container.float-ui-animation{-webkit-animation:ngxp-fadeIn .15s ease-out;-moz-animation:ngxp-fadeIn .15s ease-out;-o-animation:ngxp-fadeIn .15s ease-out;animation:ngxp-fadeIn .15s ease-out;transition:transform .65s cubic-bezier(.43,.33,.14,1.01) 0s}.float-ui-container>.float-ui-arrow{position:absolute;width:10px;height:10px;z-index:-1;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}@-webkit-keyframes ngxp-fadeIn{0%{display:none;opacity:0}1%{display:block;opacity:0}to{display:block;opacity:1}}@keyframes ngxp-fadeIn{0%{display:none;opacity:0}1%{display:block;opacity:0}to{display:block;opacity:1}}\\n\"], dependencies: [{ kind: \"directive\", type: NgStyle, selector: \"[ngStyle]\", inputs: [\"ngStyle\"] }, { kind: \"directive\", type: NgClass, selector: \"[ngClass]\", inputs: [\"class\", \"ngClass\"] }, { kind: \"directive\", type: NgIf, selector: \"[ngIf]\", inputs: [\"ngIf\", \"ngIfThen\", \"ngIfElse\"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"18.0.4\", ngImport: i0, type: NgxFloatUiContentComponent, decorators: [{\n            type: Component,\n            args: [{ selector: \"float-ui-content\", encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: \"ngxFloatUiContent\", standalone: true, imports: [NgStyle, NgClass, NgIf], template: \"<div #floatUiViewRef\\n     [attr.id]=\\\"id\\\"\\n     [class.float-ui-container]=\\\"!floatUiOptions.disableDefaultStyling\\\"\\n     [class.float-ui-animation]=\\\"!floatUiOptions.disableAnimation\\\"\\n     [class.float-ui-fixed]=\\\"floatUiOptions.positionFixed\\\"\\n     [style.display]=\\\"displayType\\\"\\n     [style.opacity]=\\\"opacity\\\"\\n     [ngStyle]=\\\"floatUiOptions.styles\\\"\\n     [ngClass]=\\\"extractAppliedClassListExpr(floatUiOptions.applyClass)\\\"\\n     attr.aria-hidden=\\\"{{ariaHidden}}\\\"\\n     [attr.aria-describedby]=\\\"floatUiOptions.ariaDescribe || null\\\"\\n     attr.role=\\\"{{floatUiOptions.ariaRole}}\\\">\\n    <div *ngIf=\\\"text\\\"\\n         class=\\\"ngxp__inner\\\"\\n         [innerHTML]=\\\"text\\\">\\n        <ng-content></ng-content>\\n    </div>\\n    <div *ngIf=\\\"!text\\\"\\n         class=\\\"ngxp__inner\\\">\\n        <ng-content></ng-content>\\n    </div>\\n    <div class=\\\"float-ui-arrow\\\"\\n         [class.ngxp__force-arrow]=\\\"arrowColor\\\"\\n         [ngClass]=\\\"extractAppliedClassListExpr(floatUiOptions.applyArrowClass)\\\"></div>\\n\\n</div>\\n\", styles: [\"float-ui-content{position:relative;display:block}.float-ui-container{display:none;position:absolute;border-radius:3px;border:1px solid grey;box-shadow:0 0 2px #00000080;padding:10px}.float-ui-container.float-ui-fixed{position:fixed}.float-ui-container.float-ui-animation{-webkit-animation:ngxp-fadeIn .15s ease-out;-moz-animation:ngxp-fadeIn .15s ease-out;-o-animation:ngxp-fadeIn .15s ease-out;animation:ngxp-fadeIn .15s ease-out;transition:transform .65s cubic-bezier(.43,.33,.14,1.01) 0s}.float-ui-container>.float-ui-arrow{position:absolute;width:10px;height:10px;z-index:-1;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}@-webkit-keyframes ngxp-fadeIn{0%{display:none;opacity:0}1%{display:block;opacity:0}to{display:block;opacity:1}}@keyframes ngxp-fadeIn{0%{display:none;opacity:0}1%{display:block;opacity:0}to{display:block;opacity:1}}\\n\"] }]\n        }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }], propDecorators: { floatUiViewRef: [{\n                type: ViewChild,\n                args: [\"floatUiViewRef\", { static: !0 }]\n            }], onMouseOver: [{\n                type: HostListener,\n                args: [\"mouseover\"]\n            }], showOnLeave: [{\n                type: HostListener,\n                args: [\"mouseleave\"]\n            }] } });\n\nconst NGX_FLOAT_UI_DEFAULTS = new InjectionToken(\"NGX_FLOAT_UI_DEFAULTS\");\n\n/**\n * @private\n */\nclass NgxFloatUiUtils {\n    /** Coerces a data-bound value (typically a string) to a boolean. */\n    static coerceBooleanProperty(value) {\n        return value != null && `${value}` !== \"false\";\n    }\n}\n\nclass NgxFloatUiDirective {\n    _changeDetectorRef;\n    _elementRef;\n    _vcr;\n    _popperDefaults;\n    static baseOptions = {\n        showDelay: 0,\n        hideOnClickOutside: true,\n        hideOnMouseLeave: false,\n        hideOnScroll: false,\n        appendTo: undefined,\n        ariaRole: \"popper\",\n        ariaDescribe: \"\",\n        styles: {},\n        trigger: NgxFloatUiTriggers.click\n    };\n    set applyClass(newValue) {\n        if (newValue === this._applyClass) {\n            return;\n        }\n        this._applyClass = newValue;\n        this._checkExisting(\"applyClass\", newValue);\n    }\n    get applyClass() {\n        return this._applyClass;\n    }\n    set arrowClass(newValue) {\n        if (newValue === this._arrowClass) {\n            return;\n        }\n        this._arrowClass = newValue;\n        if (this._content) {\n            this._content.floatUiOptions.applyArrowClass = newValue;\n            if (!this._shown) {\n                return;\n            }\n            this._content.update();\n        }\n    }\n    get arrowClass() {\n        return this._arrowClass;\n    }\n    set disabled(newValue) {\n        if (newValue === this._disabled) {\n            return;\n        }\n        this._disabled = !!newValue;\n        if (this._shown) {\n            this.hide();\n        }\n    }\n    get disabled() {\n        return this._disabled;\n    }\n    set floatUi(newValue) {\n        if (newValue === this._floatUi) {\n            return;\n        }\n        this._floatUi = newValue;\n        if (this._content) {\n            if (typeof newValue === \"string\") {\n                this._content.text = newValue;\n            }\n            else {\n                this._content = newValue;\n            }\n        }\n    }\n    get floatUi() {\n        return this._floatUi;\n    }\n    set hideOnClickOutside(newValue) {\n        this._hideOnClickOutside = NgxFloatUiUtils.coerceBooleanProperty(newValue);\n    }\n    get hideOnClickOutside() {\n        return this._hideOnClickOutside;\n    }\n    set placement(newValue) {\n        this._placement = newValue;\n        this._checkExisting(\"placement\", newValue);\n    }\n    get placement() {\n        return this._placement;\n    }\n    set preventOverflow(newValue) {\n        this._preventOverflow = NgxFloatUiUtils.coerceBooleanProperty(newValue);\n        this._checkExisting(\"preventOverflow\", this._preventOverflow);\n    }\n    get preventOverflow() {\n        return this._preventOverflow;\n    }\n    set showOnStart(newValue) {\n        this._showOnStart = NgxFloatUiUtils.coerceBooleanProperty(newValue);\n    }\n    get showOnStart() {\n        return this._showOnStart;\n    }\n    appendTo;\n    ariaDescribe;\n    ariaRole;\n    boundariesElement;\n    disableAnimation;\n    disableStyle;\n    hideOnMouseLeave;\n    hideOnScroll;\n    hideTimeout = 0;\n    onHidden = new EventEmitter();\n    onShown = new EventEmitter();\n    onUpdate = new EventEmitter();\n    positionFixed;\n    showDelay;\n    showTrigger;\n    styles;\n    targetElement;\n    timeoutAfterShow = 0;\n    _applyClass;\n    _arrowClass;\n    _content;\n    _contentClass = NgxFloatUiContentComponent;\n    _contentRef;\n    _destroy$ = new Subject();\n    _disabled;\n    _floatUi;\n    _globalEventListenersCtrl$ = new Subject();\n    _hideOnClickOutside = !0;\n    _placement;\n    _preventOverflow;\n    _scheduledHideTimeoutCtrl$ = new Subject();\n    _scheduledShowTimeoutCtrl$ = new Subject();\n    _shown = !1;\n    _showOnStart = !1;\n    constructor(_changeDetectorRef, _elementRef, _vcr, _popperDefaults = {}) {\n        this._changeDetectorRef = _changeDetectorRef;\n        this._elementRef = _elementRef;\n        this._vcr = _vcr;\n        this._popperDefaults = _popperDefaults;\n        NgxFloatUiDirective.baseOptions = { ...NgxFloatUiDirective.baseOptions, ...this._popperDefaults };\n    }\n    static assignDefined(target, ...sources) {\n        for (const source of sources) {\n            for (const key of Object.keys(source)) {\n                const val = source[key];\n                if (val !== undefined) {\n                    target[key] = val;\n                }\n            }\n        }\n        return target;\n    }\n    applyTriggerListeners() {\n        switch (this.showTrigger) {\n            case NgxFloatUiTriggers.click:\n                this._addListener(\"click\", this.toggle.bind(this));\n                break;\n            case NgxFloatUiTriggers.mousedown:\n                this._addListener(\"mousedown\", this.toggle.bind(this));\n                break;\n            case NgxFloatUiTriggers.hover:\n                this._addListener(\"mouseenter\", this.scheduledShow.bind(this, this.showDelay));\n                [\"touchend\", \"touchcancel\", \"mouseleave\"].forEach((eventName) => {\n                    this._addListener(eventName, this.scheduledHide.bind(this, null, this.hideTimeout));\n                });\n                break;\n        }\n        if (this.showTrigger !== NgxFloatUiTriggers.hover && this.hideOnMouseLeave) {\n            [\"touchend\", \"touchcancel\", \"mouseleave\"].forEach((eventName) => {\n                this._addListener(eventName, this.scheduledHide.bind(this, null, this.hideTimeout));\n            });\n        }\n    }\n    getRefElement() {\n        return this.targetElement || this._elementRef.nativeElement;\n    }\n    hide() {\n        if (this.disabled) {\n            return;\n        }\n        if (!this._shown) {\n            this._scheduledShowTimeoutCtrl$.next();\n            return;\n        }\n        this._shown = false;\n        if (this._contentRef) {\n            this._contentRef.instance.hide();\n        }\n        else {\n            this._content.hide();\n        }\n        this.onHidden.emit(this);\n        this._globalEventListenersCtrl$.next();\n    }\n    hideOnClickOutsideHandler($event) {\n        if (this.disabled || !this.hideOnClickOutside || $event.target === this._content.elRef.nativeElement ||\n            this._content.elRef.nativeElement.contains($event.target)) {\n            return;\n        }\n        this.scheduledHide($event, this.hideTimeout);\n    }\n    hideOnScrollHandler($event) {\n        if (this.disabled || !this.hideOnScroll) {\n            return;\n        }\n        this.scheduledHide($event, this.hideTimeout);\n    }\n    ngOnDestroy() {\n        this._destroy$.next();\n        this._destroy$.complete();\n        this._content && this._content.clean();\n    }\n    ngOnInit() {\n        if (typeof this.floatUi === \"string\") {\n            this._content = this._constructContent();\n            this._content.text = this.floatUi;\n        }\n        else if (typeof this.floatUi === typeof void 0) {\n            this._content = this._constructContent();\n            this._content.text = \"\";\n        }\n        else {\n            this._content = this.floatUi;\n        }\n        const popperRef = this._content;\n        popperRef.referenceObject = this.getRefElement();\n        this._setContentProperties(popperRef);\n        this._setDefaults();\n        this.applyTriggerListeners();\n        if (this.showOnStart) {\n            this.scheduledShow();\n        }\n    }\n    scheduledHide($event = null, delay = this.hideTimeout) {\n        if (this.disabled) {\n            return;\n        }\n        this._scheduledHideTimeoutCtrl$.next();\n        timer(delay)\n            .pipe(takeUntil(this._scheduledHideTimeoutCtrl$), takeUntil(this._destroy$))\n            .subscribe({\n            next: () => {\n                // TODO: check\n                const toElement = $event ? $event.toElement : null;\n                const popperContentView = this._content.floatUiViewRef ? this._content.floatUiViewRef.nativeElement : false;\n                if (!popperContentView ||\n                    popperContentView === toElement ||\n                    popperContentView.contains(toElement) ||\n                    (this.floatUi && this.floatUi.isMouseOver)) {\n                    return;\n                }\n                this.hide();\n                this._applyChanges();\n            }\n        });\n    }\n    scheduledShow(delay = this.showDelay) {\n        if (this.disabled) {\n            return;\n        }\n        this._scheduledHideTimeoutCtrl$.next();\n        timer(delay)\n            .pipe(takeUntil(this._scheduledShowTimeoutCtrl$), takeUntil(this._destroy$))\n            .subscribe({\n            next: () => {\n                this.show();\n                this._applyChanges();\n            }\n        });\n    }\n    show() {\n        if (this._shown) {\n            this._scheduledHideTimeoutCtrl$.next();\n            return;\n        }\n        this._shown = true;\n        const popperRef = this._content;\n        const element = this.getRefElement();\n        if (popperRef.referenceObject !== element) {\n            popperRef.referenceObject = element;\n        }\n        this._setContentProperties(popperRef);\n        popperRef.show();\n        this.onShown.emit(this);\n        if (this.timeoutAfterShow > 0) {\n            this.scheduledHide(null, this.timeoutAfterShow);\n        }\n        fromEvent(document, \"click\")\n            .pipe(takeUntil(this._globalEventListenersCtrl$), takeUntil(this._destroy$))\n            .subscribe({\n            next: (e) => this.hideOnClickOutsideHandler(e)\n        });\n        fromEvent(this._getScrollParent(this.getRefElement()), \"scroll\")\n            .pipe(takeUntil(this._globalEventListenersCtrl$), takeUntil(this._destroy$))\n            .subscribe({\n            next: (e) => {\n                this.hideOnScrollHandler(e);\n            }\n        });\n    }\n    toggle() {\n        if (this.disabled) {\n            return;\n        }\n        this._shown ? this.scheduledHide(null, this.hideTimeout) : this.scheduledShow();\n    }\n    _addListener(eventName, cb) {\n        fromEvent(this._elementRef.nativeElement, eventName)\n            .pipe(takeUntil(this._destroy$))\n            .subscribe({\n            next: cb\n        });\n    }\n    _applyChanges() {\n        this._changeDetectorRef.markForCheck();\n        this._changeDetectorRef.detectChanges();\n    }\n    _checkExisting(key, newValue) {\n        if (this._content) {\n            this._content.floatUiOptions[key] = newValue;\n            if (!this._shown) {\n                return;\n            }\n            this._content.update();\n        }\n    }\n    _constructContent() {\n        this._contentRef = this._vcr.createComponent(this._contentClass);\n        return this._contentRef.instance;\n    }\n    _getScrollParent(node) {\n        const isElement = node instanceof HTMLElement;\n        const overflowY = isElement && window.getComputedStyle(node).overflowY;\n        const isScrollable = overflowY !== \"visible\" && overflowY !== \"hidden\";\n        if (!node) {\n            return null;\n        }\n        else if (isScrollable && node.scrollHeight > node.clientHeight) {\n            return node;\n        }\n        return this._getScrollParent(node.parentNode) || document;\n    }\n    _onPopperUpdate() {\n        this.onUpdate.emit();\n    }\n    _setContentProperties(popperRef) {\n        popperRef.floatUiOptions = NgxFloatUiDirective.assignDefined(popperRef.floatUiOptions, NgxFloatUiDirective.baseOptions, {\n            showDelay: this.showDelay,\n            disableAnimation: this.disableAnimation,\n            disableDefaultStyling: this.disableStyle,\n            placement: this.placement,\n            boundariesElement: this.boundariesElement,\n            trigger: this.showTrigger,\n            positionFixed: this.positionFixed,\n            ariaDescribe: this.ariaDescribe,\n            ariaRole: this.ariaRole,\n            applyClass: this.applyClass,\n            applyArrowClass: this.arrowClass,\n            hideOnMouseLeave: this.hideOnMouseLeave,\n            styles: this.styles,\n            appendTo: this.appendTo,\n            preventOverflow: this.preventOverflow,\n        });\n        popperRef.onUpdate = this._onPopperUpdate.bind(this);\n        popperRef.onHidden\n            .pipe(takeUntil(this._destroy$))\n            .subscribe(this.hide.bind(this));\n    }\n    _setDefaults() {\n        [\"showDelay\", \"hideOnScroll\", \"hideOnMouseLeave\", \"hideOnClickOutside\", \"ariaRole\", \"ariaDescribe\"].forEach((key) => {\n            this[key] = this[key] === void 0 ? NgxFloatUiDirective.baseOptions[key] : this[key];\n        });\n        this.showTrigger = this.showTrigger || NgxFloatUiDirective.baseOptions.trigger;\n        this.styles = this.styles === void 0 ? { ...NgxFloatUiDirective.baseOptions.styles } : this.styles;\n    }\n    /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"18.0.4\", ngImport: i0, type: NgxFloatUiDirective, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: NGX_FLOAT_UI_DEFAULTS }], target: i0.ɵɵFactoryTarget.Directive });\n    /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"18.0.4\", type: NgxFloatUiDirective, isStandalone: true, selector: \"[floatUi]\", inputs: { applyClass: \"applyClass\", arrowClass: \"arrowClass\", disabled: \"disabled\", floatUi: \"floatUi\", hideOnClickOutside: \"hideOnClickOutside\", placement: \"placement\", preventOverflow: \"preventOverflow\", showOnStart: \"showOnStart\", appendTo: \"appendTo\", ariaDescribe: \"ariaDescribe\", ariaRole: \"ariaRole\", boundariesElement: \"boundariesElement\", disableAnimation: \"disableAnimation\", disableStyle: \"disableStyle\", hideOnMouseLeave: \"hideOnMouseLeave\", hideOnScroll: \"hideOnScroll\", hideTimeout: \"hideTimeout\", positionFixed: \"positionFixed\", showDelay: \"showDelay\", showTrigger: \"showTrigger\", styles: \"styles\", targetElement: \"targetElement\", timeoutAfterShow: \"timeoutAfterShow\" }, outputs: { onHidden: \"onHidden\", onShown: \"onShown\", onUpdate: \"onUpdate\" }, exportAs: [\"floatUi\"], ngImport: i0 });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"18.0.4\", ngImport: i0, type: NgxFloatUiDirective, decorators: [{\n            type: Directive,\n            args: [{\n                    selector: \"[floatUi]\",\n                    exportAs: \"floatUi\",\n                    standalone: true\n                }]\n        }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{\n                    type: Inject,\n                    args: [NGX_FLOAT_UI_DEFAULTS]\n                }] }], propDecorators: { applyClass: [{\n                type: Input\n            }], arrowClass: [{\n                type: Input\n            }], disabled: [{\n                type: Input\n            }], floatUi: [{\n                type: Input\n            }], hideOnClickOutside: [{\n                type: Input\n            }], placement: [{\n                type: Input\n            }], preventOverflow: [{\n                type: Input\n            }], showOnStart: [{\n                type: Input\n            }], appendTo: [{\n                type: Input\n            }], ariaDescribe: [{\n                type: Input\n            }], ariaRole: [{\n                type: Input\n            }], boundariesElement: [{\n                type: Input\n            }], disableAnimation: [{\n                type: Input\n            }], disableStyle: [{\n                type: Input\n            }], hideOnMouseLeave: [{\n                type: Input\n            }], hideOnScroll: [{\n                type: Input\n            }], hideTimeout: [{\n                type: Input\n            }], onHidden: [{\n                type: Output\n            }], onShown: [{\n                type: Output\n            }], onUpdate: [{\n                type: Output\n            }], positionFixed: [{\n                type: Input\n            }], showDelay: [{\n                type: Input\n            }], showTrigger: [{\n                type: Input\n            }], styles: [{\n                type: Input\n            }], targetElement: [{\n                type: Input\n            }], timeoutAfterShow: [{\n                type: Input\n            }] } });\n\nclass NgxFloatUiLooseDirective extends NgxFloatUiDirective {\n    set floatUiLoose(newValue) {\n        this.floatUi = newValue;\n    }\n    set loosePlacement(newValue) {\n        this.placement = newValue;\n    }\n    set looseTrigger(newValue) {\n        this.showTrigger = newValue;\n    }\n    constructor(changeDetectorRef, elementRef, vcr, popperDefaults = {}) {\n        super(changeDetectorRef, elementRef, vcr, popperDefaults);\n    }\n    /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"18.0.4\", ngImport: i0, type: NgxFloatUiLooseDirective, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: NGX_FLOAT_UI_DEFAULTS }], target: i0.ɵɵFactoryTarget.Directive });\n    /** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"18.0.4\", type: NgxFloatUiLooseDirective, isStandalone: true, selector: \"[floatUiLoose]\", inputs: { floatUiLoose: \"floatUiLoose\", loosePlacement: \"loosePlacement\", looseTrigger: \"looseTrigger\" }, exportAs: [\"floatUiLoose\"], usesInheritance: true, ngImport: i0 });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"18.0.4\", ngImport: i0, type: NgxFloatUiLooseDirective, decorators: [{\n            type: Directive,\n            args: [{\n                    selector: \"[floatUiLoose]\",\n                    exportAs: \"floatUiLoose\",\n                    standalone: true\n                }]\n        }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{\n                    type: Inject,\n                    args: [NGX_FLOAT_UI_DEFAULTS]\n                }] }], propDecorators: { floatUiLoose: [{\n                type: Input\n            }], loosePlacement: [{\n                type: Input\n            }], looseTrigger: [{\n                type: Input\n            }] } });\n\nfunction provideNgxFloatUiOptions(config = {}) {\n    return [\n        { provide: NGX_FLOAT_UI_DEFAULTS, useValue: config },\n    ];\n}\nclass NgxFloatUiModule {\n    static forRoot(popperBaseOptions) {\n        return {\n            ngModule: NgxFloatUiModule,\n            providers: [\n                provideNgxFloatUiOptions(popperBaseOptions)\n            ]\n        };\n    }\n    /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"18.0.4\", ngImport: i0, type: NgxFloatUiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });\n    /** @nocollapse */ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"18.0.4\", ngImport: i0, type: NgxFloatUiModule, imports: [CommonModule,\n            NgxFloatUiContentComponent,\n            NgxFloatUiDirective,\n            NgxFloatUiLooseDirective], exports: [NgxFloatUiContentComponent,\n            NgxFloatUiDirective,\n            NgxFloatUiLooseDirective] });\n    /** @nocollapse */ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"18.0.4\", ngImport: i0, type: NgxFloatUiModule, providers: [\n            provideNgxFloatUiOptions()\n        ], imports: [CommonModule] });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"18.0.4\", ngImport: i0, type: NgxFloatUiModule, decorators: [{\n            type: NgModule,\n            args: [{\n                    imports: [\n                        CommonModule,\n                        NgxFloatUiContentComponent,\n                        NgxFloatUiDirective,\n                        NgxFloatUiLooseDirective\n                    ],\n                    exports: [\n                        NgxFloatUiContentComponent,\n                        NgxFloatUiDirective,\n                        NgxFloatUiLooseDirective\n                    ],\n                    providers: [\n                        provideNgxFloatUiOptions()\n                    ]\n                }]\n        }] });\n\n/*\n * Public API Surface of ngx-float-ui\n */\n// Components\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { NgxFloatUiContentComponent, NgxFloatUiDirective, NgxFloatUiLooseDirective, NgxFloatUiModule, NgxFloatUiPlacements, NgxFloatUiTriggers, provideNgxFloatUiOptions };\n","/** @format */\n\nimport { Injectable } from '@angular/core';\nimport { Clip } from '@app/shared/models/clip.model';\nimport { Stack } from '@app/shared/models/stack.model';\nimport { combineLatest } from 'rxjs';\nimport { take } from 'rxjs/operators';\nimport { MailerApiService, MailTopic, SendMail } from '../api/mailer.api.service';\nimport { EventActions, EventsService } from './events.service';\nimport { UserService } from './user.service';\n\nconst PAGE = '[FlagService]';\n\n@Injectable({\n  providedIn: 'root',\n})\nexport class FlagService {\n  constructor(private mailerApi: MailerApiService, private userService: UserService, private events: EventsService) {\n    this.events.subscribe(EventActions.FLAG, this.flag);\n  }\n\n  flag(item: Clip | Stack, flaggingDetails = '') {\n    return new Promise((resolve, reject) => {\n\n      if (!item) {\n        return reject('No item to flag');\n      }\n      // return resolve('dev');\n      // this appears to work when not auth'd\n      combineLatest([this.userService.userId$, this.userService.email$])\n        .pipe(take(1))\n        .subscribe((res) => {\n          // return resolve(res);\n          const email = res[0] || 'Anonymous';\n          const name = res[1] || 'Anonymous';\n  \n          let itemType = 'unknown';\n          let id = 'unknown';\n          if ((item as Stack).stackId) {\n            itemType = 'Stack';\n            id = (item as Stack).stackId;\n          } else if ((item as Clip).id) {\n            itemType = 'Clip';\n            id = (item as Clip).id;\n          }\n  \n          const addl = [];\n          // eslint-disable-next-line @typescript-eslint/no-explicit-any\n          const addlItemDetails = item as any;\n          if (addlItemDetails.clipId) {\n            addl.push(`clipId: ${addlItemDetails.clipId}`);\n          }\n          if (addlItemDetails.clipProjectId) {\n            addl.push(`clipProjectId: ${addlItemDetails.clipProjectId}`);\n          }\n          if (addlItemDetails.cliptitle) {\n            addl.push(`cliptitle: ${addlItemDetails.cliptitle}`);\n          }\n          if (addlItemDetails.shareUrl) {\n            addl.push(`shareUrl: ${addlItemDetails.shareUrl}`);\n          }\n  \n          /**\n           * Fixed in v2.8.6\n           * This message should now be created correctly\n           */\n          const params: SendMail = {\n            fromEmail: email,\n            name,\n            subject: `FLAGGED: ${itemType}`,\n            topic: MailTopic.Flag,\n            message: `${[\n              flaggingDetails,\n              [`Type: ${itemType}`, `Project ID: ${item.projectId}`, `ID: ${id}`, `Title: ${item.title}`, ...addl].join(\n                '<br>'\n              ),\n            ].join('<br><br>')}`,\n          };\n  \n          // console.log(`flag SendMail params:`, { params });\n  \n          this.mailerApi\n            .sendEmail(params)\n            .pipe(take(1))\n            .subscribe({\n              next: (sendRes) => {\n                console.log(`${PAGE} sendEmail res:`, sendRes);\n                resolve(sendRes);\n              },\n              error: (error) => {\n                console.log(`${PAGE} sendEmail ERROR:`, error);\n                reject(error);\n              },\n            });\n        });\n    });\n  }\n}\n","<fs-base-modal [title]=\"title\" mode=\"light\" #modal>\n  <swiper-container #swiper [allowTouchMove]=\"false\" [allowSlideNext]=\"allowSlideNext\" [allowSlidePrev]=\"allowSlidePrev\" [modules]=\"swiperModules\" (init)=\"initSlider($event)\">\n    <swiper-slide>\n      <div>\n        <p class=\"ion-padding-horizontal\">{{ 'REPORT.HEADING' | translate }}:</p>\n\n        <!-- we need a separate list for the tooltips because doing so within ion-items will cut them off -->\n        <div class=\"tooltip-list\">\n          <div\n            class=\"tooltip-list__item\"\n            *ngFor=\"let category of categories; let i = index\"\n          >\n            <div class=\"tooltip-list__item__icon\">\n              <!-- [showOnStart]=\"i === 1\" -->\n              <ion-icon\n                *ngIf=\"category.tooltip\"\n                [floatUi]=\"category.tooltip\"\n                [showOnStart]=\"false\"\n                [showTrigger]=\"PopperTriggers.hover\"\n                [placement]=\"PopperPlacements.LEFT\"\n                [styles]=\"{ width: '250px' }\"\n                class=\"small-icon\"\n                name=\"information-circle-outline\"\n              ></ion-icon>\n            </div>\n          </div>\n        </div>\n\n        <ion-list lines=\"none\">\n          <ion-radio-group (ionChange)=\"onSelectCategory($event)\" class=\"spaced\">\n            <ion-item *ngFor=\"let category of categories; let i = index\">\n              <ion-radio\n                mode=\"md\"\n                slot=\"start\"\n                labelPlacement=\"end\"\n                [attr.aria-label]=\"category.text\"\n                [value]=\"category.id\"\n              >{{ category.text }}</ion-radio>\n            </ion-item>\n          </ion-radio-group>\n        </ion-list>\n        <div>\n          <p>{{ 'REPORT.CONTENT_1' | translate }}</p>\n          <p>{{ 'REPORT.CONTENT_2' | translate }}</p>\n        </div>\n      </div>\n    </swiper-slide>\n    <swiper-slide>\n      <div *ngIf=\"(selectedCategory?.items || []).length > 0\">\n        <p *ngIf=\"selectedCategory\" class=\"ion-padding-horizontal\">\n          <strong>{{ 'REPORT.CATEGORY' | translate }}:</strong> {{ selectedCategory.text }}\n        </p>\n        <br />\n        <p class=\"ion-padding-horizontal\">{{ 'REPORT.REASONS' | translate }}:</p>\n        <ion-list lines=\"none\">\n          <!-- [allowEmptySelection]=\"true\" -->\n          <ion-radio-group [value]=\"reasonValue\" (ionChange)=\"onSelectReason($event)\">\n            <ion-item *ngFor=\"let reason of selectedCategory?.items || []\">\n              <ion-radio mode=\"md\" slot=\"start\" labelPlacement=\"end\" [value]=\"reason.id\" aria-label=\"{{ reason.text }}\">{{ \n                reason.text \n              }}</ion-radio>\n            </ion-item>\n          </ion-radio-group>\n        </ion-list>\n      </div>\n    </swiper-slide>\n    <swiper-slide>\n      <div>\n        <p *ngIf=\"selectedCategory\">\n          <strong>{{ 'REPORT.CATEGORY' | translate }}:</strong> {{ selectedCategory.text }}\n        </p>\n        <p *ngIf=\"selectedReason\">\n          <strong>{{ 'REPORT.REASON' | translate }}:</strong> {{ selectedReason.text }}\n        </p>\n        <br />\n        <p>{{ 'REPORT.ADDITIONAL' | translate }}:</p>\n        <ion-textarea\n          [(ngModel)]=\"additionalDetails\"\n          rows=\"4\"\n          [placeholder]=\"'REPORT.ADDITIONAL_PLACEHOLDER' | translate\"\n        ></ion-textarea>\n      </div>\n    </swiper-slide>\n    <swiper-slide class=\"centered\">\n      <div>\n        <ion-icon\n          class=\"big-icon\"\n          color=\"primary\"\n          name=\"checkmark-circle-outline\"\n        ></ion-icon>\n        <div>{{ 'REPORT.THANKS' | translate }}</div>\n        <div class=\"ion-padding-top ion-margin-top\">\n          <fs-button\n            buttonStyle=\"primary\"\n            (click)=\"modal.dismiss()\"\n            >{{ 'COMMON.CLOSE' | translate }}</fs-button\n          >\n        </div>\n      </div>\n    </swiper-slide>\n  </swiper-container>\n\n  <ion-toolbar class=\"footer ion-padding\" *ngIf=\"currentStep.id !== 'sent'\">\n    <ion-buttons slot=\"end\">\n      <fs-button\n        *ngIf=\"currentStep.id !== STEPS.selection.id\"\n        style=\"margin-right: 10px\"\n        buttonStyle=\"outline\"\n        (click)=\"back()\"\n        >{{ 'COMMON.PREVIOUS' | translate }}</fs-button\n      >\n      <fs-button\n        *ngIf=\"currentStep.id === STEPS.selection.id\"\n        [disabled]=\"!selectedCategory\"\n        buttonStyle=\"primary\"\n        (click)=\"next(!selectedCategory)\"\n        >{{ 'COMMON.NEXT' | translate }}</fs-button\n      >\n      <fs-button\n        *ngIf=\"currentStep.id === STEPS.subSelection.id\"\n        [disabled]=\"!selectedReason\"\n        buttonStyle=\"primary\"\n        (click)=\"next(!selectedReason)\"\n        >{{ 'COMMON.NEXT' | translate }}</fs-button\n      >\n      <fs-button\n        *ngIf=\"currentStep.id === STEPS.additionalText.id\"\n        [disabled]=\"isSending\"\n        buttonStyle=\"primary\"\n        [loading]=\"isSending\"\n        (click)=\"sendReport(isSending)\"\n        >{{ 'REPORT.SEND' | translate }}</fs-button\n      >\n    </ion-buttons>\n  </ion-toolbar>\n</fs-base-modal>\n","/** @format */\n\nimport { Component, OnInit, ViewChild, Input, ElementRef, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';\nimport { NgFor, NgIf } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { TranslateService, TranslatePipe } from '@ngx-translate/core';\nimport {\n  IonButtons,\n  IonIcon,\n  IonicSlides,\n  IonItem,\n  IonList,\n  IonRadio,\n  IonRadioGroup,\n  IonTextarea,\n  IonToolbar,\n  SelectCustomEvent,\n} from '@ionic/angular/standalone';\nimport { take } from 'rxjs/operators';\nimport { FlagService } from '@app/core/services/flag.service';\nimport { ToasterService, ToasterColor, ToasterPosition } from '@app/core/services/toaster.service';\nimport { Clip } from '@app/shared/models/clip.model';\nimport { Stack } from '@app/shared/models/stack.model';\nimport { ButtonComponent } from '@app/shared/components/ui/buttons/button/button.component';\nimport { BaseModalComponent } from '@app/shared/components/ui/modal/base-modal.component';\nimport { Utils } from '@app/shared/utils';\n/** @todo fix modal report tooltips */\nimport { NgxFloatUiModule, NgxFloatUiTriggers, NgxFloatUiPlacements, NgxFloatUiDirective } from 'ngx-float-ui';\n\nconst STEPS = {\n  selection: { id: 'selection', idx: 0, back: null, next: 'subSelection' },\n  subSelection: {\n    id: 'subSelection',\n    idx: 1,\n    back: 'selection',\n    next: 'additionalText',\n  },\n  additionalText: { id: 'additionalText', idx: 2, back: 'subSelection', next: 'sent' },\n  sent: { id: 'sent', idx: 3, back: null, next: null },\n};\n\n// type Steps = keyof typeof STEPS;\n\ninterface Reason {\n  id: number;\n  text: string;\n  tooltip?: string;\n  items: { id: number; text: string }[];\n}\n\n@Component({\n  selector: 'app-modal-report',\n  templateUrl: './modal-report.component.html',\n  styleUrls: ['./modal-report.component.scss'],\n  standalone: true,\n  imports: [\n    NgFor,\n    NgIf,\n    NgxFloatUiModule,\n    NgxFloatUiDirective,\n    BaseModalComponent,\n    FormsModule,\n    ButtonComponent,\n    TranslatePipe,\n    IonList,\n    IonRadioGroup,\n    IonRadio,\n    IonItem,\n    IonTextarea,\n    IonIcon,\n    IonToolbar,\n    IonButtons,\n  ],\n  // swiper is not a module, so we need to add the CUSTOM_ELEMENTS_SCHEMA\n  // https://forum.ionicframework.com/t/how-to-use-the-swiper-js-with-standalone-components-where-there-is-no-modules-to-put-the-register-code/232522/2\n  schemas: [CUSTOM_ELEMENTS_SCHEMA],\n})\nexport class ModalReportComponent implements OnInit {\n  @Input() reportedItem: Clip | Stack;\n\n  @ViewChild('modal', { static: false, read: BaseModalComponent })\n  modal: BaseModalComponent;\n\n  // https://ionicframework.com/docs/angular/slides\n  @ViewChild('swiper', { static: false }) swiperRef: ElementRef | undefined;\n  swiperModules = [IonicSlides];\n  allowSlidePrev = false;\n  allowSlideNext = false;\n  get swiper() {\n    return this.swiperRef?.nativeElement?.swiper;\n  }\n\n  isSending = false;\n  PopperTriggers = NgxFloatUiTriggers;\n  PopperPlacements = NgxFloatUiPlacements;\n  selectedCategory: Reason;\n  selectedReason: Reason['items'][0];\n  reasonValue = -1;\n  additionalDetails = '';\n  STEPS = STEPS;\n  currentStep = this.STEPS.selection;\n  // build the categories OnInit for translations\n  categories = [];\n\n  get title() {\n    switch (this.currentStep.id) {\n      case STEPS.selection.id:\n      case STEPS.subSelection.id:\n      case STEPS.additionalText.id:\n        return this._reportVideoText;\n    }\n    return '';\n  }\n\n  // translated OnInit\n  private _reportVideoText = 'Report video';\n\n  constructor(private toaster: ToasterService, private flagService: FlagService, private translate: TranslateService) {}\n\n  ngOnInit() {\n    this.translate\n      .get([\n        'REPORT.VIDEO',\n        'REPORT.CHILD_ABUSE',\n        'REPORT.CHILD_ABUSE_DESC',\n        'REPORT.TERRORISM',\n        'REPORT.TERRORISM_DESC',\n        'REPORT.SEXUAL_CONTENT',\n        'REPORT.SEXUAL_CONTENT_DESC',\n        'REPORT.SEXUAL_CONTENT_1',\n        'REPORT.SEXUAL_CONTENT_2',\n        'REPORT.SEXUAL_CONTENT_3',\n        'REPORT.SEXUAL_CONTENT_4',\n        'REPORT.SEXUAL_CONTENT_5',\n        'REPORT.SEXUAL_CONTENT_6',\n        'REPORT.VIOLENT',\n        'REPORT.VIOLENT_DESC',\n        'REPORT.VIOLENT_1',\n        'REPORT.VIOLENT_2',\n        'REPORT.VIOLENT_3',\n        'REPORT.VIOLENT_4',\n        'REPORT.HATEFUL',\n        'REPORT.HATEFUL_DESC',\n        'REPORT.HATEFUL_1',\n        'REPORT.HATEFUL_2',\n        'REPORT.HATEFUL_3',\n        'REPORT.HATEFUL_4',\n        'REPORT.HARMFUL',\n        'REPORT.HARMFUL_DESC',\n        'REPORT.HARMFUL_1',\n        'REPORT.HARMFUL_2',\n        'REPORT.HARMFUL_3',\n        'REPORT.HARMFUL_4',\n        'REPORT.FRAUD',\n        'REPORT.FRAUD_DESC',\n        'REPORT.FRAUD_1',\n        'REPORT.FRAUD_2',\n        'REPORT.FRAUD_3',\n        'REPORT.FRAUD_4',\n        'REPORT.FRAUD_5',\n        'REPORT.FRAUD_6',\n        'REPORT.FRAUD_7',\n        'REPORT.FRAUD_8',\n        'REPORT.INFRINGE',\n        'REPORT.INFRINGE_DESC',\n        'REPORT.INFRINGE_1',\n        'REPORT.INFRINGE_2',\n        'REPORT.INFRINGE_3',\n        'REPORT.CAPTIONS',\n        'REPORT.CAPTIONS_DESC',\n        'REPORT.CAPTIONS_1',\n        'REPORT.CAPTIONS_2',\n        'REPORT.CAPTIONS_3',\n      ])\n      .pipe(take(1))\n      .subscribe((res) => {\n        // console.log(res);\n        this._reportVideoText = res['REPORT.VIDEO'];\n        this.categories = [\n          {\n            id: 1,\n            text: res['REPORT.CHILD_ABUSE'],\n            tooltip: res['REPORT.CHILD_ABUSE_DESC'],\n            items: [],\n          },\n          {\n            id: 2,\n            text: res['REPORT.TERRORISM'],\n            tooltip: res['REPORT.TERRORISM_DESC'],\n            items: [],\n          },\n          {\n            id: 3,\n            text: res['REPORT.SEXUAL_CONTENT'],\n            tooltip: res['REPORT.SEXUAL_CONTENT_DESC'],\n            items: [\n              { id: 301, text: res['REPORT.SEXUAL_CONTENT_1'] },\n              { id: 302, text: res['REPORT.SEXUAL_CONTENT_2'] },\n              { id: 303, text: res['REPORT.SEXUAL_CONTENT_3'] },\n              { id: 304, text: res['REPORT.SEXUAL_CONTENT_4'] },\n              { id: 305, text: res['REPORT.SEXUAL_CONTENT_5'] },\n              { id: 306, text: res['REPORT.SEXUAL_CONTENT_6'] },\n            ],\n          },\n          {\n            id: 4,\n            text: res['REPORT.VIOLENT'],\n            tooltip: res['REPORT.VIOLENT_DESC'],\n            items: [\n              { id: 401, text: res['REPORT.VIOLENT_1'] },\n              { id: 402, text: res['REPORT.VIOLENT_2'] },\n              { id: 403, text: res['REPORT.VIOLENT_3'] },\n              { id: 404, text: res['REPORT.VIOLENT_4'] },\n            ],\n          },\n          {\n            id: 5,\n            text: res['REPORT.HATEFUL'],\n            tooltip: res['REPORT.HATEFUL_DESC'],\n            items: [\n              { id: 501, text: res['REPORT.HATEFUL_1'] },\n              { id: 502, text: res['REPORT.HATEFUL_2'] },\n              { id: 503, text: res['REPORT.HATEFUL_3'] },\n              { id: 504, text: res['REPORT.HATEFUL_4'] },\n            ],\n          },\n          {\n            id: 6,\n            text: res['REPORT.HARMFUL'],\n            tooltip: res['REPORT.HARMFUL_DESC'],\n            items: [\n              { id: 601, text: res['REPORT.HARMFUL_1'] },\n              { id: 602, text: res['REPORT.HARMFUL_2'] },\n              { id: 603, text: res['REPORT.HARMFUL_3'] },\n              { id: 604, text: res['REPORT.HARMFUL_4'] },\n            ],\n          },\n          {\n            id: 7,\n            text: res['REPORT.FRAUD'],\n            tooltip: res['REPORT.FRAUD_DESC'],\n            items: [\n              { id: 701, text: res['REPORT.FRAUD_1'] },\n              { id: 702, text: res['REPORT.FRAUD_2'] },\n              { id: 703, text: res['REPORT.FRAUD_3'] },\n              { id: 704, text: res['REPORT.FRAUD_4'] },\n              { id: 705, text: res['REPORT.FRAUD_5'] },\n              { id: 706, text: res['REPORT.FRAUD_6'] },\n              { id: 707, text: res['REPORT.FRAUD_7'] },\n              { id: 708, text: res['REPORT.FRAUD_8'] },\n            ],\n          },\n          {\n            id: 8,\n            text: res['REPORT.INFRINGE'],\n            tooltip: res['REPORT.INFRINGE_DESC'],\n            items: [\n              { id: 801, text: res['REPORT.INFRINGE_1'] },\n              { id: 802, text: res['REPORT.INFRINGE_2'] },\n              { id: 803, text: res['REPORT.INFRINGE_3'] },\n            ],\n          },\n          {\n            id: 9,\n            text: res['REPORT.CAPTIONS'],\n            tooltip: res['REPORT.CAPTIONS_DESC'],\n            items: [\n              { id: 901, text: res['REPORT.CAPTIONS_1'] },\n              { id: 902, text: res['REPORT.CAPTIONS_2'] },\n              { id: 903, text: res['REPORT.CAPTIONS_3'] },\n            ],\n          },\n        ] as Reason[];\n      });\n  }\n\n  onSelectCategory(event: Event) {\n    const customEvent = event as SelectCustomEvent;\n\n    this.selectedCategory = this.categories\n      .filter((category) => category.id === customEvent.detail.value)\n      .find(Boolean);\n  }\n\n  onSelectReason(event: Event) {\n    const customEvent = event as SelectCustomEvent;\n\n    this.selectedReason = this.selectedCategory.items\n      .filter((reason) => reason.id === customEvent.detail.value)\n      .find(Boolean);\n    this.reasonValue = this.selectedReason.id;\n  }\n\n  initSlider(event) {\n    const { detail = [] } = event;\n    if (detail.length > 0) {\n      const swiper = detail[0];\n      // console.log(swiper);\n      if (swiper) {\n        swiper.allowTouchMove = false;\n        swiper.on('slideChange', () => {\n          // console.log('slideChangeTransitionEnd');\n          this.slideChange();\n        });\n      }\n    }\n  }\n\n  async sendReport(disabled = true) {\n    try {\n      if (disabled) {\n        return console.log('sendReport but disabled.');\n      }\n      this.isSending = true;\n      const res = await this.flagService.flag(\n        this.reportedItem,\n        [\n          `Reported category: ${this.selectedCategory.text}`,\n          `Reported reason: ${this.selectedReason ? this.selectedReason.text : '-'}`,\n          `Additional details: ${Utils.escapeHtml(this.additionalDetails)}`,\n        ].join('<br>')\n      );\n      console.log('sendReport res:', res);\n      this.isSending = false;\n      // this.toaster.present(`${res}`, ToasterPosition.Bottom, 3000, ToasterColor.Dark);\n      this.next();\n      // this.nextSlide();\n      // this.currentStep = this.STEPS.sent;\n    } catch (error) {\n      this.isSending = false;\n      console.error('Error sending report', error);\n      this.toaster.present('Error sending report - please try again.', ToasterPosition.Top, 3000, ToasterColor.Warning);\n    }\n  }\n\n  next(disabled = false) {\n    if (disabled) {\n      return console.log('next but disabled.');\n    }\n    if (this.currentStep.next) {\n      this.nextSlide();\n      // make sure we skip the step, if the user selected a category that has no reasons\n      if (this.currentStep.id === STEPS.subSelection.id && this.selectedCategory.items.length === 0) {\n        // console.log('skipping subSelection', this.currentStep);\n        this.nextSlide();\n      }\n    } else {\n      console.warn('next but no currentStep.next?', this.currentStep);\n    }\n  }\n\n  back() {\n    if (this.currentStep.back) {\n      this.backSlide();\n      // make sure we unselect the reason, in case the user selects a different category\n      if (this.currentStep.id === STEPS.selection.id) {\n        // console.log('unselecting reason', this.selectedReason);\n        this.selectedReason = undefined;\n        this.reasonValue = -1;\n      }\n      // make sure we skip the step, if the user selected a category that has no reasons\n      if (this.currentStep.id === STEPS.subSelection.id && this.selectedCategory.items.length === 0) {\n        // console.log('skipping subSelection', this.currentStep);\n        this.backSlide();\n      }\n    } else {\n      console.warn('back but no currentStep.back?', this.currentStep);\n    }\n  }\n\n  private nextSlide() {\n    this.currentStep = STEPS[this.currentStep.next];\n    if (!this.swiper) {\n      return console.warn('no swiper?', this.swiperRef);\n    }\n    this.swiper.allowSlideNext = true;\n    this.swiper.slideNext();\n  }\n\n  private backSlide() {\n    this.currentStep = STEPS[this.currentStep.back];\n    if (!this.swiper) {\n      return console.warn('no swiper?');\n    }\n    this.swiper.allowSlidePrev = true;\n    this.swiper.slidePrev();\n  }\n\n  private slideChange() {\n    // this.currentStep = this.getCurrentStep(this.swiper.activeIndex);\n    // re-disable the slide in UI\n    this.swiper.allowSlideNext = false;\n    this.swiper.allowSlidePrev = false;\n    this.modal.scrollToTop();\n  }\n\n  private getCurrentStep(index = 0) {\n    return Object.values(STEPS).find((step) => step.idx === index);\n  }\n}\n","/** @format */\n\nimport { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\nimport { IonSearchbar, SearchbarCustomEvent } from '@ionic/angular/standalone';\n\nconst DEBUG_LOGS = false;\n\n@Component({\n  selector: 'app-searchbar',\n  templateUrl: './searchbar.component.html',\n  styleUrls: ['./searchbar.component.scss'],\n  standalone: true,\n  imports: [IonSearchbar],\n})\nexport class SearchbarComponent implements OnInit {\n  // in case the <app-searchbar> is toggled by *ngIf, then this property will determine if it will be autofocussed right away\n  @Input() autofocus = false;\n  @Input() value = '';\n  @Input() showCancelButton: 'always' | 'focus' | 'never' = 'never';\n  @Input() placeholderText = 'Search';\n  @Input() debounceTime = 1000;\n  @Input() color = 'dark';\n  /** Adds css class to enable media query for width to change at breakpoint */\n  @Input() responsiveWidth = false;\n  @Output() searchEnter = new EventEmitter<string>();\n  @Output() searchChange = new EventEmitter<string>();\n  @Output() searchCancel = new EventEmitter<string>();\n  @Output() searchBlur = new EventEmitter<string>();\n  @ViewChild('searchbar') searchbar: IonSearchbar;\n\n  ngOnInit() {\n    DEBUG_LOGS && console.log('search init', { value: this.value, autofocus: this.autofocus });\n    if (this.autofocus) {\n      setTimeout(() => {\n        this.searchbar.setFocus();\n      }, 50);\n    }\n  }\n\n  onSearch() {\n    DEBUG_LOGS &&\n      console.log('onSearch', { value: this.value, searchBar: this.searchbar, searchbarValue: this.searchbar.value });\n    this.searchEnter.emit(this.searchbar.value);\n  }\n\n  onChange(event: Event) {\n    DEBUG_LOGS && console.log('onChange', { searchBar: this.searchbar, value: this.searchbar.value });\n    const customEvent = event as SearchbarCustomEvent;\n    this.searchChange.emit(customEvent.detail.value);\n  }\n\n  onClear() {\n    DEBUG_LOGS && console.log('onClear', { searchBar: this.searchbar, value: this.searchbar.value });\n    this.searchCancel.emit();\n  }\n\n  onCancel() {\n    DEBUG_LOGS && console.log('onCancel', { searchBar: this.searchbar, value: this.searchbar.value });\n    this.searchCancel.emit();\n  }\n\n  onBlur() {\n    DEBUG_LOGS && console.log('onBlur', { searchBar: this.searchbar, value: this.searchbar.value });\n    this.searchBlur.emit();\n  }\n}\n","<ion-searchbar\n  #searchbar\n  mode=\"md\"\n\tinputmode=\"search\"\n\tenterkeyhint=\"search\"\n\t[animated]=\"true\"\n\t[debounce]=\"debounceTime\"\n\t[value]=\"value\"\n\t[placeholder]=\"placeholderText\"\n\t[showCancelButton]=\"showCancelButton\"\n\t[color]=\"color\"\n\t[class.responsive-width]=\"responsiveWidth\"\n\t(keyup.enter)=\"onSearch()\"\n\t(ionChange)=\"onChange($event)\"\n\t(ionClear)=\"onClear()\"\n\t(ionBlur)=\"onBlur()\"\n\t(ionCancel)=\"onCancel()\"\n></ion-searchbar>\n","/*\n  Docs: https://angular.io/guide/animations\n  Original: https://github.com/angular-university/angular-advanced-course/blob/master/animations/src/app/animations.ts\n*/\nimport { animation, style, animate, trigger, transition, useAnimation } from '@angular/animations';\n\nexport const fadeIn = animation([\n    style({opacity:0}),\n    animate(\"{{delay}}\",style({opacity:1}))\n],\n    {params: {delay: '1000ms'}});\n\nexport const fadeOut = animation(\n    animate(\"{{delay}}\", style({opacity:0})),\n    {params: {delay: '1000ms'}}\n);\n\nexport const fadeInOut = trigger('fadeInOut', [\n    transition('void => *', useAnimation(fadeIn, {params: {delay: '500ms'}}) ),\n    transition('* => void', useAnimation(fadeOut, {params: {delay: '500ms'}}) )\n]);\n\nexport const slideInOut = trigger('slideInOut', [\n  transition(':enter', [\n    style({ transform: 'translateY(-204px)', }),\n    animate('450ms ease-in-out', style({ transform: 'translateY(0)' })),\n  ]),\n  transition(':leave', [\n    style({ transform: 'translateY(0)' }),\n    animate('450ms ease-in-out', style({ transform: 'translateY(-204px)' })),\n  ]),\n]);\n","<!-- @format -->\n\n<div class=\"stack-form\">\n  <div *ngIf=\"showHeading\" class=\"stack-form__heading\">\n    <h1>{{ 'EDITOR.START_STACK' | translate }}</h1>\n  </div>\n  \n  <form [formGroup]=\"stackCreateForm\" class=\"stack-form__form\" (ngSubmit)=\"createStack()\">\n    <div *ngIf=\"errorMsg\" class=\"stack-form__error\">\n      <strong>Error:</strong> {{ errorMsg }}\n    </div>\n  \n    <fs-form-input\n      [placeholder]=\"'EDITOR.FORM.TITLE_PLACEHOLDER' | translate\"\n      [control]=\"stackCreateForm.get('title') | formControlCast\"\n      [showErrorTextOnError]=\"showErrorTextOnError\"\n      class=\"stack-form__form__title\"\n      [debounce]=\"1000\"\n      (onInput)=\"titleInput($event)\"\n    ></fs-form-input>\n    <!-- [label]=\"'COMMON.TITLE' | translate\" -->\n    <!-- [hint]=\"'EDITOR.FORM.TITLE_HINT' | translate\" -->\n  \n    <!-- Causing an issue with project.title? -->\n    <app-form-select-myprojects\n      [showLabel]=\"false\"\n      [defaultProjectId]=\"addToStackPayload?.projectId\"\n      (selected)=\"projectChanged($event)\"\n    >\n    </app-form-select-myprojects>\n\n    <!-- <fs-form-select\n      [disabled]=\"projectOptions.length === 1\"\n      [label]=\"'EDITOR.FORM.PROJECT_LABEL' | translate\"\n      [placeholder]=\"'EDITOR.FORM.PROJECT_PLACEHOLDER' | translate\"\n      [hint]=\"'EDITOR.FORM.PROJECT_HINT_CREATE' | translate\"\n      [items]=\"projectOptions\"\n      [control]=\"stackCreateForm.get('projectId')\"\n    ></fs-form-select> -->\n  \n    <div *ngIf=\"showSubmit\" class=\"ion-text-center ion-margin-top ion-padding-top\">\n      <ion-buttons slot=\"end\">\n        <!-- [iconOnly]=\"true\" -->\n        <fs-button\n          type=\"submit\"\n          size=\"default\"\n          [disabled]=\"!stackCreateForm.valid\"\n          icon=\"arrow-forward-outline\"\n        >{{ 'EDITOR.SAVE_STACK_DRAFT' | translate }}</fs-button>\n      </ion-buttons>\n    </div>\n  </form>\n</div>\n","/**\n * Note: This is used in topnav-drawer.component.ts\n * @format\n */\n\nimport { Component, OnDestroy, Output, EventEmitter, Input } from '@angular/core';\nimport { NgIf } from '@angular/common';\nimport { UntypedFormBuilder, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { TranslateService, TranslatePipe } from '@ngx-translate/core';\nimport { IonButtons, ModalController } from '@ionic/angular/standalone';\nimport { combineLatest, Subject } from 'rxjs';\nimport { take, delay } from 'rxjs/operators';\nimport { IAddToStackDrawerPayload } from '@store/actions/stacks.actions';\nimport { ConfigService } from '@app/core/config/config.service';\nimport { EnvironService } from '@app/core/services/environ.service';\nimport { PublishStackService } from '@app/core/services/publish-stack.service';\nimport { UserService } from '@app/core/services/user.service';\nimport { IOrderedClip, StackDraftPublishInput } from '@app/shared/models/stack.model';\nimport { FormInputComponent } from '@app/shared/components/ui/form/form-input/form-input.component';\nimport { FormSelectMyProjects } from '@app/shared/components/form-select-myprojects/form-select-myprojects.component';\nimport { ButtonComponent } from '@app/shared/components/ui/buttons/button/button.component';\nimport { FormControlCastPipe } from '@app/shared/pipes/form-control-cast.pipe';\n\nconst DEBUG_LOGS = false;\n\n@Component({\n  selector: 'app-form-stack-create',\n  templateUrl: './form-stack-create.component.html',\n  styleUrls: ['./form-stack-create.component.scss'],\n  standalone: true,\n  imports: [\n    NgIf,\n    FormsModule,\n    ReactiveFormsModule,\n    FormInputComponent,\n    FormSelectMyProjects,\n    ButtonComponent,\n    TranslatePipe,\n    FormControlCastPipe,\n    IonButtons,\n  ],\n})\nexport class FormStackCreate implements OnDestroy {\n  @Input() showHeading = true;\n  @Input() showSubmit = true;\n  @Input() showErrorTextOnError = true;\n  // @Input() addToStackPlaylist: IOrderedClip[] = [];\n  @Input()\n  set addToStackPayload(value) {\n    this._addToStackPayload = value;\n    const {\n      title = '',\n      projectId = '',\n      // isCreateNew = false,\n      // description = '',\n      // playlist = [],\n      // poster = '',\n    } = value;\n    if (title) {\n      // update the form values\n      this.stackCreateForm.patchValue({\n        title,\n        ...(projectId ? { projectId } : {}),\n      });\n      this.emitValid();\n    }\n  }\n  get addToStackPayload() {\n    return this._addToStackPayload;\n  }\n\n  @Output() loading = new EventEmitter<boolean>();\n  /** { projectId, stackId, title } */\n  @Output() createSuccess = new EventEmitter<{\n    projectId: string;\n    stackId: string;\n    title: string;\n    playlist?: IOrderedClip[];\n  }>();\n  @Output() formValid = new EventEmitter<boolean>();\n\n  stackCreateForm = this.formBuilder.group({\n    title: ['', Validators.compose([Validators.required, Validators.minLength(3), Validators.maxLength(64)])],\n    projectId: ['', Validators.compose([Validators.required])],\n  });\n\n  userId$ = this.userService.userId$;\n  isLoggedIn$ = this.userService.isLoggedIn$;\n\n  errorMsg = '';\n  isLoading = false;\n\n  public get isFormValid(): boolean {\n    return this.stackCreateForm && this.stackCreateForm.valid;\n  }\n\n  get addToStackPlaylist(): IOrderedClip[] {\n    return this._addToStackPayload?.playlist ?? [];\n  }\n  get payloadProjectId() {\n    return this._addToStackPayload?.projectId ?? '';\n  }\n  private _addToStackPayload: IAddToStackDrawerPayload = { playlist: [] };\n  private onDestroy$ = new Subject<void>();\n\n  constructor(\n    private modalCtrl: ModalController,\n    private userService: UserService,\n    private configService: ConfigService,\n    private environService: EnvironService,\n    private publishService: PublishStackService,\n    private formBuilder: UntypedFormBuilder,\n    private translate: TranslateService\n  ) {}\n\n  ngOnDestroy() {\n    this.onDestroy$.next();\n    this.onDestroy$.complete();\n  }\n\n  public checkForm() {\n    this.stackCreateForm.markAllAsTouched();\n    this.emitValid();\n  }\n\n  /**\n   * debounced on each change\n   */\n  titleInput(event) {\n    DEBUG_LOGS && console.log(`[StackCreate] titleInput`, { value: event, stackCreateForm: this.stackCreateForm });\n    this.emitValid();\n  }\n\n  projectChanged(project) {\n    DEBUG_LOGS && console.log(`[StackCreate] projectChanged`, { project, stackCreateForm: this.stackCreateForm });\n    if (project && project.id) {\n      this.stackCreateForm.patchValue({ projectId: project.id });\n      this.environService.setActiveProjectId(project.id);\n      this.emitValid();\n    }\n  }\n\n  // eslint-disable-next-line @typescript-eslint/member-ordering\n  private _loadingTimeout;\n  showLoading(timeout = 900) {\n    this.isLoading = true;\n    this.loading.emit(this.isLoading);\n    clearTimeout(this._loadingTimeout);\n    this._loadingTimeout = setTimeout(() => {\n      // just making it show loading for a bit, since we only dispatched actions here\n      this.isLoading = false;\n      this.loading.emit(this.isLoading);\n    }, timeout);\n  }\n\n  /**\n   * if there are already clips, save those too\n   * if restack, copy our data\n   */\n  createStack() {\n    if (this.stackCreateForm.valid) {\n      this.errorMsg = '';\n      this.isLoading = true;\n      this.loading.emit(this.isLoading);\n\n      // eslint-disable-next-line @typescript-eslint/no-unused-vars\n      const { isCreateNew = false, description = '', poster = '' } = this._addToStackPayload;\n\n      combineLatest([this.userId$, this.userService.username$])\n        .pipe(take(1), delay(2000))\n        .subscribe(async ([userId, username]) => {\n          const input: StackDraftPublishInput = {\n            userId,\n            credits: username,\n            title: this.stackCreateForm.get('title').value,\n            projectId: this.stackCreateForm.get('projectId').value,\n            // if we already have clips, include those\n            playlist: this.addToStackPlaylist?.length > 0 ? this.addToStackPlaylist : [],\n          };\n          // carry the ReStack details if they exist\n          if (description) {\n            input.description = description;\n          }\n          if (poster) {\n            input.poster = poster;\n          }\n          // create the Draft in DB, updating...\n          const stack = await this.publishService.createStackDraft(input);\n\n          this.isLoading = false;\n          this.loading.emit(this.isLoading);\n          /** MVP-1146 */\n          this.createSuccess.emit(stack);\n        });\n    } else {\n      this.checkForm(); // show errors, right?\n    }\n  }\n\n  resetForm() {\n    this.stackCreateForm.reset();\n    this.emitValid();\n  }\n\n  private emitValid() {\n    this.formValid.emit(this.stackCreateForm.valid);\n  }\n}\n","<!-- [@slideInOut] -->\n<ion-toolbar class=\"drawer {{theme}}\">\n\t<div class=\"container\">\n\t\t<h3 class=\"drawer__heading clickable\" (click)=\"closeDrawer()\">\n\t\t\t<ng-container *ngIf=\"showLabel\">\n\t\t\t\t<span *ngIf=\"(isLoggedIn$ | async) !== true else loggedInHeading\">\n\t\t\t\t\t{{ 'AUTH.LOGIN_TO' | translate }}\n\t\t\t\t\t{{ 'EDITOR.START_STACK' | translate }}\n\t\t\t\t</span>\n\t\t\t\t<ng-template #loggedInHeading>\n\t\t\t\t\t<span *ngIf=\"showingCreateForm else notShowingCreate\">\n\t\t\t\t\t\t{{ 'EDITOR.START_STACK' | translate }}\n\t\t\t\t\t</span>\n\t\t\t\t\t<ng-template #notShowingCreate>\n\t\t\t\t\t\t<span *ngIf=\"label else defaultLabel\">{{ label }}</span>\n\t\t\t\t\t\t<ng-template #defaultLabel>\n\t\t\t\t\t\t\t<ng-container *ngIf=\"handleActions else selectDraftText\">\n\t\t\t\t\t\t\t\t{{ 'STACK.STACK_STORY_DRAFTS' | translate }}\n\t\t\t\t\t\t\t</ng-container>\n\t\t\t\t\t\t\t<ng-template #selectDraftText>\n\t\t\t\t\t\t\t\t{{ 'STACK.ACTIONS.ADD_ALL_TO_STACK_DRAFTS' | translate }}\n\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t</ng-template>\n\t\t\t\t</ng-template>\n\t\t\t</ng-container>\n\n\t\t\t<div class=\"float-right\">\n\t\t\t\t<ion-icon name=\"close\"></ion-icon>\n\t\t\t</div>\n\t\t</h3>\n\n\t\t<ng-template #loginForm>\n\t\t\t<div class=\"drawer__items drawer__items--login-form\">\n\t\t\t\t<fs-login-form [routeOnSuccess]=\"returnUrl\"></fs-login-form>\n\t\t\t</div>\n\t\t</ng-template>\n\n\t\t<div #drawerItems *ngIf=\"isLoggedIn$ | async else loginForm\" \n\t\t\tclass=\"drawer__items\"\n\t\t\t[class.drawer__items--showing-login-form]=\"(isLoggedIn$ | async) !== true\"\n\t\t>\n\t\t\t<div class=\"drawer__items__item\" \n\t\t\t\t[class.drawer__items__item--expanded]=\"showingCreateForm\"\n\t\t\t\t[class.drawer__items__item--selected]=\"(selectedStackDraft$ | async) === ''\"\n\t\t\t\t[title]=\"'COMMON.ADD_DRAFT' | translate\" \n\t\t\t\t(click)=\"onNewClicked($event)\"\n\t\t\t>\n\t\t\t\t<div *ngIf=\"selectedItemSuccess && (selectedStackDraft$ | async) === '' else defaultAddButton\"\n\t\t\t\t\tclass=\"success-check\">\n\t\t\t\t\t<ion-icon name=\"checkmark-circle\"></ion-icon>\n\t\t\t\t</div>\n\t\t\t\t<ng-template #defaultAddButton>\n\t\t\t\t\t<ion-fab-button *ngIf=\"!showingCreateForm\">\n\t\t\t\t\t\t<ion-icon name=\"add-outline\"></ion-icon>\n\t\t\t\t\t</ion-fab-button>\n\t\t\t\t</ng-template>\n\t\t\t\t<ng-container *ngIf=\"showingCreateForm\">\n\t\t\t\t\t<div class=\"drawer__items__item__form-wrap\">\n\t\t\t\t\t\t<app-form-stack-create \n\t\t\t\t\t\t\t[showSubmit]=\"false\" \n\t\t\t\t\t\t\t[showHeading]=\"false\"\n\t\t\t\t\t\t\t[showErrorTextOnError]=\"false\" \n\t\t\t\t\t\t\t[addToStackPayload]=\"addToStackPayload$ | async\"\n\t\t\t\t\t\t\t(loading)=\"onCreateFormLoading($event)\"\n\t\t\t\t\t\t\t(createSuccess)=\"onCreateFormSuccess($event)\"\n\t\t\t\t\t\t\t(formValid)=\"onCreateFormValid($event)\"\n\t\t\t\t\t\t></app-form-stack-create>\n\n\t\t\t\t\t</div>\n\t\t\t\t\t<ion-fab-button \n\t\t\t\t\t\t[disabled]=\"!isCreateFormValid || isLoadingCreate\" \n\t\t\t\t\t\t(click)=\"continueNew($event)\"\n\t\t\t\t\t\tclass=\"drawer__items__item__continue-btn\">\n\t\t\t\t\t\t<ion-spinner *ngIf=\"isLoadingCreate else defaultContinueIcon\"></ion-spinner>\n\t\t\t\t\t\t<ng-template #defaultContinueIcon>\n\t\t\t\t\t\t\t<ion-icon name=\"arrow-forward-outline\"></ion-icon>\n\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t</ion-fab-button>\n\t\t\t\t</ng-container>\n\t\t\t</div>\n\t\t\t<!-- here item with current stack if it is not a draft -->\n\t\t\t<div *ngIf=\"publishedItem && publishedItem.stackId\" \n\t\t\t\tclass=\"drawer__items__item\"\n\t\t\t\t[class.drawer__items__item--selected]=\"(selectedStackDraft$ | async) === publishedItem.stackId\"\n\t\t\t\t[style.background-image]=\"'url(' + publishedItem.poster || stackDefaultPoster + ')'\" \n\t\t\t\t(click)=\"selectItem($event, publishedItem)\">\n\t\t\t\t<div *ngIf=\"selectedItemSuccess && (selectedStackDraft$ | async) === publishedItem.stackId\"\n\t\t\t\t\tclass=\"success-check\">\n\t\t\t\t\t<ion-icon name=\"checkmark-circle\"></ion-icon>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"drawer__items__item__bottom\">\n\t\t\t\t\t{{ publishedItem.title }}\n\t\t\t\t\t<div class=\"drawer__items__item__actions\">\n\t\t\t\t\t\t<fs-ellipsis-button class=\"stack-slide__more\"\n\t\t\t\t\t\t\t[class.stack-slide__more--active]=\"(popoverOpen$ | async) === true\"\n\t\t\t\t\t\t\t(click)=\"openPopover($event, publishedItem)\"></fs-ellipsis-button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<!-- draft items... -->\n\t\t\t<div *ngFor=\"let item of items\" class=\"drawer__items__item\"\n\t\t\t\t[class.drawer__items__item--selected]=\"item?.stackId && (selectedStackDraft$ | async) === item.stackId\"\n\t\t\t\t[style.background-image]=\"'url(' + item.poster || stackDefaultPoster + ')'\" \n\t\t\t\t(click)=\"selectItem($event, item)\">\n\t\t\t\t<div *ngIf=\"selectedItemSuccess && item?.stackId && (selectedStackDraft$ | async) === item.stackId\" class=\"success-check\">\n\t\t\t\t\t<ion-icon name=\"checkmark-circle\"></ion-icon>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"drawer__items__item__bottom\">\n\n\t\t\t\t\t<div *ngIf=\"item?.isCollaborative\" class=\"drawer__items__item__indicator\"\n\t\t\t\t\t\t[title]=\"'STACK.COLLABORATIVE_DRAFT' | translate\">\n\t\t\t\t\t\t<ion-icon name=\"people-outline\" class=\"no-pointer-events\"></ion-icon>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t{{ item?.title ?? ('STACK.DRAFT' | translate) }}\n\t\t\t\t\t<!-- TODO: <br><small>{{ item?.projectName ?? 'Get Project Title from ID' }}</small> -->\n\t\t\t\t\t<div class=\"drawer__items__item__actions\">\n\t\t\t\t\t\t<fs-ellipsis-button class=\"stack-slide__more\"\n\t\t\t\t\t\t\t[class.stack-slide__more--active]=\"(popoverOpen$ | async) === true\"\n\t\t\t\t\t\t\t(click)=\"openPopover($event, item)\"></fs-ellipsis-button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</ion-toolbar>","/** @format */\n\nimport { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild } from '@angular/core';\nimport { NgIf, NgFor, AsyncPipe } from '@angular/common';\nimport { Router } from '@angular/router';\nimport { TranslateService, TranslatePipe } from '@ngx-translate/core';\nimport {\n  NavController,\n  PopoverController,\n  IonToolbar,\n  IonIcon,\n  IonFabButton,\n  IonSpinner,\n} from '@ionic/angular/standalone';\nimport { BehaviorSubject, Subject } from 'rxjs';\nimport { distinctUntilChanged, filter, take, takeUntil } from 'rxjs/operators';\nimport { Store } from '@ngrx/store';\nimport { State } from '@store/reducers';\nimport * as mystackActions from '@store/actions/mystack.actions';\nimport * as stackActions from '@store/actions/stacks.actions';\nimport { selectAddToStackPayloadMeta, selectStackEdit } from '@store/selectors/stacks.selectors';\nimport { slideInOut } from '@app/animations';\nimport { UserService } from '@app/core/services/user.service';\nimport { EllipsisButtonComponent } from '@app/shared/components/ui/buttons/ellipsis-button/ellipsis-button.component';\nimport { Stack, STACK_DEFAULT_POSTER } from '@app/shared/models/stack.model';\nimport { FormStackCreate } from '@app/shared/components/form-stack-create/form-stack-create.component';\nimport { StackPopoverActionsComponent } from '@app/shared/components/fs-carousel/fs-slide/stack-slide/stack-popover-actions/stack-popover-actions.component';\nimport { LoginFormComponent } from '@app/shared/components/login/login-form.component';\nimport { Utils } from '@app/shared/utils';\nimport { ROOT_EDIT_URL } from '@app/app.routes';\nimport { environment } from 'src/environments/environment';\n\nconst DEBUG_LOGS = false;\n/** allow you to stay where you were, watching or discovering without navigating, the flash_mystack should get your attn? */\nconst NAV_AFTER_ADD_CLIPS = false;\n\n@Component({\n  selector: 'app-top-navbar-drawer',\n  templateUrl: './top-navbar-drawer.component.html',\n  styleUrls: ['./top-navbar-drawer.component.scss'],\n  /** If you use an animation in a template, you also must list that animation in the component's animations metadata ... every time. */\n  animations: [slideInOut],\n  standalone: true,\n  imports: [\n    IonSpinner,\n    IonFabButton,\n    IonIcon,\n    IonToolbar,\n    NgIf,\n    LoginFormComponent,\n    FormStackCreate,\n    EllipsisButtonComponent,\n    NgFor,\n    AsyncPipe,\n    TranslatePipe,\n  ],\n})\nexport class TopNavbarDrawerComponent implements OnInit, OnDestroy {\n  @Input() label: string; // = 'Stack Drafts'; // will be translated\n  @Input() showLabel = true;\n  @Input() theme: 'light' | 'dark' = 'dark';\n  @Input()\n  set items(value: Stack[]) {\n    DEBUG_LOGS && console.log(`set items`, value);\n    this._items = Array.isArray(value) ? value : [];\n    clearTimeout(this.showFormTimeout);\n    if (this._items.length > 0) {\n      this.scrollItemIntoView();\n    } else {\n      // it's an empty array so there's none, show the form to create\n      // wait a moment to allow ui to ready\n      this.showFormTimeout = setTimeout(() => {\n        if (this._items.length < 1) {\n          console.warn('timeout showForm');\n          this.showingCreateForm = true;\n        }\n      }, 1200);\n    }\n  }\n  get items(): Stack[] {\n    return this._items;\n  }\n  @Input() handleActions = true;\n  @Input() selectedItemSuccess = false;\n  @Input() showingCreateForm = false;\n  @Output() selected = new EventEmitter<Partial<Stack>>();\n  @Output() newItem = new EventEmitter<Partial<Stack>>();\n  @Output() closed = new EventEmitter<void>();\n\n  @ViewChild('drawerItems', { static: false }) drawerItems: ElementRef;\n  @ViewChild(FormStackCreate) formStackCreate: FormStackCreate;\n\n  publishedItem: Partial<Stack>;\n  // listId = 'top_navbar_drawer';\n  selectedStackId = '';\n  selectedStackDraft$ = new BehaviorSubject<string>('');\n  // addToStackPlaylist$ = this.store.select(selectAddToStackPlaylist); // replaced with Payload.playlist\n  addToStackPayload$ = this.store.select(selectAddToStackPayloadMeta);\n\n  isLoadingCreate = false;\n  isCreateFormValid = false;\n  // get isCreateFormValid(): boolean {\n  //   return this.formStackCreate && this.formStackCreate.isFormValid;\n  // }\n\n  popoverOpen$ = new Subject<boolean>();\n\n  isLoggedIn$ = this.userService.isLoggedIn$;\n\n  returnUrl = '';\n  stackDefaultPoster = STACK_DEFAULT_POSTER;\n\n  private showFormTimeout;\n  private _items: Stack[] = [];\n  private onDestroy$ = new Subject<void>();\n\n  constructor(\n    private store: Store<State>,\n    private userService: UserService,\n    private _elementRef: ElementRef,\n    private navCtrl: NavController,\n    private popoverCtrl: PopoverController,\n    private translate: TranslateService,\n    public router: Router\n  ) {}\n\n  ngOnInit() {\n    this.returnUrl = this.router.url;\n    // //due to being rendered by parent ngIf=isDrawerExpanded, this will get triggered mutliple times..\n    // // doing this in topnav instead\n    // this.list$ = this.store.select(selectList(this.listId));\n    // this.items$ = this.store.select(selectStackListItems(this.listId));\n    this.store\n      .select(selectStackEdit)\n      .pipe(\n        takeUntil(this.onDestroy$),\n        filter(Boolean),\n        distinctUntilChanged((a: Stack, b: Stack) => a && b && a.projectId === b.projectId && a.stackId === b.stackId)\n      )\n      .subscribe((stack: Stack) => {\n        const { projectId, stackId } = stack; //splitStackId(id);\n        DEBUG_LOGS &&\n          console.log(`draft stackEdit:`, { projectId, stackId, showingCreateForm: !!this.showingCreateForm });\n        // check if this is editingPublished or a draft..\n        // add stack if not draft\n        if (\n          !stack.error &&\n          stack.dtePublished &&\n          !this.items.find((s) => s && s.projectId === projectId && s.stackId === stackId)\n        ) {\n          console.log(`drawer currentEdit not draft`, { projectId, stackId, stack });\n          this.publishedItem = stack;\n        } else {\n          // console.log(`drawer currentEdit is draft`, { projectId, stackId, stack });\n          this.publishedItem = null;\n        }\n        this.selectedStackId = stackId;\n\n        if (!this.showingCreateForm) {\n          this.selectedStackDraft$.next(stackId);\n          this.scrollItemIntoView();\n        }\n      });\n\n    // note: loadFilteredStacks for list done in parent so we don't rebuild each time\n\n    this.addToStackPayload$\n      .pipe(\n        takeUntil(this.onDestroy$)\n        // filter((playlist) => Array.isArray(playlist) && playlist.length > 0)\n      )\n      .subscribe(({ playlist, ...args }) => {\n        DEBUG_LOGS &&\n          console.log(`addToStackPayload:`, { playlist, ...args, showingCreateForm: !!this.showingCreateForm });\n        const {\n          // projectId = '',\n          // title = '',\n          // description = '',\n          // poster = '',\n          isCreateNew = false,\n        } = args;\n        let translatePath = '';\n        if (isCreateNew) {\n          translatePath = 'STACK.ACTIONS.RESTACK_NEW_DRAFT';\n        } else if (Array.isArray(playlist) && playlist.length > 1) {\n          translatePath = 'STACK.ACTIONS.ADD_ALL_TO_STACK_DRAFTS';\n        } else if (Array.isArray(playlist) && playlist.length === 1) {\n          translatePath = 'STACK.ACTIONS.ADD_ALL_TO_STACK_DRAFTS';\n        }\n\n        if (translatePath) {\n          this.translate\n            .get(translatePath)\n            .pipe(take(1))\n            .subscribe((text) => {\n              this.label = text;\n            });\n        } else {\n          this.label = '';\n        }\n\n        if (isCreateNew) {\n          console.log({ msg: 'isCreateNew', showingCreateForm: !!this.showingCreateForm });\n          this.selectedStackDraft$.next('');\n          this.showingCreateForm = true;\n        } else {\n          this.selectedStackDraft$.next(this.selectedStackId);\n          this.showingCreateForm = false;\n        }\n      });\n  }\n\n  ngOnDestroy() {\n    this.onDestroy$.next();\n    this.onDestroy$.complete();\n  }\n\n  navEditor({ projectId, stackId }) {\n    DEBUG_LOGS && console.log(`drawer navEditor`, { projectId, stackId });\n    if (this.returnUrl.startsWith('/stack/edit')) {\n      this.navCtrl.navigateForward([ROOT_EDIT_URL, projectId, stackId], {\n        animated: false,\n        state: { hideDrawerOnLoad: true },\n      });\n    } else {\n      this.navCtrl.navigateForward([ROOT_EDIT_URL, projectId, stackId], { state: { hideDrawerOnLoad: true } });\n    }\n  }\n\n  selectItem(evt: MouseEvent, item: Partial<Stack>) {\n    evt.preventDefault();\n    // evt.stopPropagation();\n    if (item && item.stackId) {\n      DEBUG_LOGS && console.log(`Drawer draft selected`, item);\n      const { projectId, stackId } = item;\n      this.selectedStackDraft$.next(stackId);\n\n      // if we have full routing & we're not just selecting it, go there\n      if (this.handleActions && projectId && stackId) {\n        this.addToStackPayload$.pipe(take(1)).subscribe(({ playlist }) => {\n          if (Array.isArray(playlist) && playlist.length > 0) {\n            this.store.dispatch(stackActions.addToStackIdPlaylist({ projectId, stackId }));\n            this.showSuccessDrawerItem({ thenClose: true, thenNavEditor: NAV_AFTER_ADD_CLIPS, projectId, stackId });\n          } else {\n            !environment.production && console.log(`Drawer No Playlist -> navEditor`);\n            this.resetElements();\n            this.closeDrawer();\n            this.navEditor({ projectId, stackId }); // this will selectIdEdit on nav\n          }\n          // do we want to do this here? why not allow adding to a non-selected stack?\n          // this.store.dispatch(stackActions.selectIdEdit({ projectId, stackId }));\n        });\n      }\n      // if (!this.handleActions) {\n      //   this.scrollItemIntoView();\n      // }\n    }\n    this.selected.emit(item);\n  }\n\n  onNewClicked(evt) {\n    try {\n      evt.preventDefault();\n      // evt.stopPropagation();\n      this.selectedStackDraft$.next('');\n\n      if (!this.showingCreateForm) {\n        // expand the form\n        this.showingCreateForm = true;\n      } // else evt propogated\n      this.scrollItemIntoView();\n    } catch (error) {\n      console.warn(error);\n    }\n  }\n\n  continueNew(evt) {\n    try {\n      evt.preventDefault();\n      // evt.stopPropagation();//doesn't stop from item parent\n      this.formStackCreate.createStack();\n    } catch (error) {\n      console.warn(error);\n    }\n  }\n\n  onCreateFormLoading(isLoading: boolean) {\n    this.isLoadingCreate = !!isLoading;\n  }\n\n  onCreateFormValid(isValid: boolean) {\n    this.isCreateFormValid = !!isValid;\n  }\n\n  /**\n   * Item Create Success - move this item into view and select\n   */\n  onCreateFormSuccess(stack) {\n    DEBUG_LOGS && console.log(`createSuccess`, stack);\n\n    this.store.dispatch(mystackActions.newMyStack({ stack }));\n\n    const { projectId, stackId, title, playlist } = stack;\n    this.selectedStackDraft$.next(stackId);\n\n    // add clips to mystack, nav to Editor Details\n    this.showingCreateForm = false;\n    // the createForm should have already added the playlist..\n    if (Array.isArray(playlist) && playlist.length > 0) {\n      // this.store.dispatch(\n      //   mystackActions.addClipIds({ ids: playlist.map((p) => ({ projectId: p.projectId, id: p.id })) })\n      // );\n    }\n    if (this.handleActions) {\n      this.showSuccessDrawerItem({ thenClose: true, thenNavEditor: NAV_AFTER_ADD_CLIPS, projectId, stackId });\n      // do this on route, allow the DB to exist..\n      // except some routes don't nav immediately, so do this now\n      this.store.dispatch(stackActions.selectIdEdit({ projectId, stackId }));\n    }\n\n    // this.scrollItemIntoView();\n    this.newItem.emit({ projectId, stackId, title, playlist });\n  }\n\n  delayedCloseDrawer(delay = 300) {\n    clearTimeout(this._closeTimeout);\n    this._closeTimeout = setTimeout(() => {\n      this.closeDrawer();\n    }, delay);\n  }\n\n  closeDrawer() {\n    if (this.handleActions) {\n      this.store.dispatch(stackActions.resetAddToStackPlaylist());\n    }\n    this.showingCreateForm = false;\n    // reset the selected from New\n    this.selectedStackDraft$.pipe(take(1)).subscribe((selectedId) => {\n      if (this.selectedStackId && this.selectedStackId !== selectedId) {\n        console.log({ msg: 'selectedStackId !== selectedId', selectedId, selectedStackId: this.selectedStackId });\n        this.selectedStackDraft$.next(this.selectedStackId);\n      }\n    });\n    this.closed.emit();\n  }\n\n  showSuccessDrawerItem({\n    thenClose = false,\n    thenNavEditor = false,\n    projectId,\n    stackId,\n  }: {\n    thenClose?: boolean;\n    thenNavEditor?: boolean;\n    projectId?: string;\n    stackId?: string;\n  }) {\n    this.selectedItemSuccess = true;\n    clearTimeout(this._itemSelectedTimeout);\n    this._itemSelectedTimeout = setTimeout(() => {\n      this.selectedItemSuccess = false;\n      // this.store.dispatch(stackActions.resetAddToStackPlaylist());\n      if (thenNavEditor && projectId && stackId) {\n        this.navEditor({ projectId, stackId });\n        this.closeDrawer();\n      } else if (thenClose) {\n        this.closeDrawer();\n      }\n    }, 1200);\n  }\n\n  resetElements() {\n    this.selectedItemSuccess = false;\n  }\n\n  async openPopover(event: MouseEvent, stack) {\n    Utils.tryStopPropagation(event);\n    Utils.tryPreventDefault(event);\n    console.log(`openPopover stack:`, stack);\n    this.popoverOpen$.next(true);\n    const popover = await this.popoverCtrl.create({\n      component: StackPopoverActionsComponent,\n      componentProps: {\n        stack,\n        canShare: false,\n        canFlag: false,\n        canAddToStack: false,\n        // add the moderation actions\n        // isModerated: this.isModerated,\n        // canAddToStack: this.canPlay,\n        // canApprove: this.canApprove,\n        // canFeature: this.canModerate,\n      },\n      event,\n    });\n    await popover.present();\n    const { data } = await popover.onWillDismiss();\n    console.log(`dismissed`, { data, url: this.router.url });\n    if (data && data.type && data.type === 'edit') {\n      if (this.router.url.startsWith('/stack/edit')) {\n        // we're already on the edit page, open the publish\n        this.closeDrawer();\n      }\n    }\n    this.popoverOpen$.next(false);\n  }\n\n  // eslint-disable-next-line @typescript-eslint/member-ordering\n  private _scrollTimeout;\n  // eslint-disable-next-line @typescript-eslint/member-ordering\n  private _closeTimeout;\n  // eslint-disable-next-line @typescript-eslint/member-ordering\n  private _itemSelectedTimeout;\n\n  private scrollItemIntoView() {\n    clearTimeout(this._scrollTimeout);\n    this._scrollTimeout = setTimeout(() => {\n      try {\n        const OFFSET_PADDING = 100;\n        // .querySelector('.top-navbar drawer__items .drawer .drawer__items')\n        // drawer__items__item--selected\n        if (this.drawerItems && this.drawerItems.nativeElement) {\n          const container = this.drawerItems.nativeElement;\n          // const items = container.getElementsByClassName('drawer__items__item');\n          const selected = container.getElementsByClassName('drawer__items__item--selected');\n          if (selected && selected.length > 0) {\n            DEBUG_LOGS &&\n              console.log(`scrollItemIntoView`, {\n                offsetLeft: selected[0].offsetLeft,\n                scrollLeft: container.scrollLeft,\n                selected,\n                container,\n              });\n            // container.scrollLeft = selected[0].offsetLeft;\n            this.drawerItems.nativeElement.scrollTo({\n              top: 0,\n              left:\n                selected[0].offsetLeft && selected[0].offsetLeft > OFFSET_PADDING\n                  ? selected[0].offsetLeft - OFFSET_PADDING\n                  : 0,\n              behavior: 'smooth',\n            });\n          }\n        }\n      } catch (error) {\n        console.log(`Caught Error in scrollItemIntoView`, error);\n      }\n    }, 500); // 500ms animation\n  }\n}\n","<ion-toolbar class=\"top-navbar\" *ngIf=\"showTopnav\">\n  <div class=\"container\">\n    <div class=\"row\" style=\"display: flex; justify-content: space-between;\">\n      <!-- backBtnUrl -->\n      <div\n        [class.top-navbar--fullwidth-search]=\"inFullWidthSearch\"\n        [class.top-navbar--no-title]=\"!title\"\n        style=\"display: flex; width: 100%; justify-content: space-between;\"\n      >\n\n        <ion-buttons slot=\"start\" class=\"hide-in-fullwidth-search\">\n          <ion-back-button *ngIf=\"backButtonReturnUrl\" \n            mode=\"ios\"\n            text=\"\"\n            [defaultHref]=\"backButtonReturnUrl\" \n            style=\"padding-left:6px;\"\n          ></ion-back-button>\n\n          <!-- *ngIf=\"!backButtonReturnUrl\" -->\n          <ion-button\n            routerLink=\"/stack/home\" \n            [ngSwitch]=\"theme\"\n            class=\"toolbar-title__logo\">\n            <!-- also need to handle xs-only breakpoint -->\n            <ng-container *ngSwitchCase=\"'light'\">\n              <img *ngIf=\"fullLogoNoBreakpoints else logoBreakpoints\"\n                src=\"/assets/images/logos/Filmstacker-logo-teal.png\"\n                alt=\"Home\"\n                class=\"full-logo logo-teal\"\n              />\n              <ng-template #logoBreakpoints>\n                <img\n                  src=\"/assets/images/logos/fsr-f-32x32-teal.png\"\n                  alt=\"Home\"\n                  class=\"d-md-none mini-logo\"\n                />\n                <img\n                  src=\"/assets/images/logos/Filmstacker-logo-teal.png\"\n                  alt=\"Home\"\n                  class=\"d-none d-md-block full-logo\"\n                />\n              </ng-template>\n            </ng-container>\n            <ng-container *ngSwitchDefault>\n              <img \n                src=\"/assets/images/logos/fsr-f-32x32-lightGray.png\"\n                alt=\"Home\"\n                class=\"d-md-none mini-logo\"\n              />\n              <img\n                src=\"/assets/images/logos/filmstackerLogo.png\"\n                alt=\"Home\"\n                class=\"d-none d-md-block full-logo\"\n              />\n            </ng-container>\n          </ion-button>\n        </ion-buttons>\n\n        <ion-title *ngIf=\"title\" class=\"main-title hide-in-fullwidth-search\">\n          <ng-container *ngIf=\"showtitleActionButton && drawerEnabled else noActionButton\">\n            <ion-button \n              fill=\"outline\"\n              [color]=\"isDrawerExpanded ? 'medium' : 'primary'\"\n              class=\"top-navbar__drawer-btn\"\n              [class.active]=\"isDrawerExpanded\"\n              (click)=\"onToggleDrawerClick($event)\" \n              [title]=\"'COMMON.VIEW_DRAFTS' | translate\">\n              {{ title }}\n              <ion-icon [name]=\"isDrawerExpanded ? 'chevron-up-outline' : 'chevron-down-outline'\" class=\"no-pointer-events\"></ion-icon>\n            </ion-button>\n          </ng-container>\n          <ng-template #noActionButton>\n            <a *ngIf=\"drawerEnabled else justTitle\"\n              href \n              class=\"top-navbar__drawer\" \n              (click)=\"onToggleDrawerClick($event)\" \n              [title]=\"'COMMON.VIEW_DRAFTS' | translate\">\n                {{ title }}\n                <ion-icon [name]=\"isDrawerExpanded ? 'chevron-up-outline' : 'chevron-down-outline'\" class=\"no-pointer-events\"></ion-icon>\n            </a>\n            <ng-template #justTitle>\n              {{ title }}\n            </ng-template>\n          </ng-template>\n        </ion-title>\n\n        <!-- fullwidth searchbar -->\n        <app-searchbar slot=\"end\"\n          *ngIf=\"inFullWidthSearch && showSearch\"\n          [autofocus]=\"true\"\n          [responsiveWidth]=\"true\"\n          [placeholderText]=\"searchPlaceholderText\"\n          showCancelButton=\"always\"\n          [value]=\"(filters$ | async)?.q\"\n          (searchCancel)=\"setFullWidthSearch(false); onSearchCancel()\"\n          (searchEnter)=\"onSearch($event)\"\n          (searchChange)=\"onSearchChange($event)\"\n          (searchBlur)=\"onSearchBlur($event)\"\n        ></app-searchbar>\n        \n        <ion-buttons slot=\"end\">\n          <fs-button\n            *ngIf=\"showSearch\"\n            color=\"medium\"\n            class=\"toolbar__fluid-search-btn hide-in-fullwidth-search\"\n            buttonStyle=\"clear\"\n            icon=\"search-outline\"\n            [iconOnly]=\"true\"\n            (click)=\"setFullWidthSearch(true)\"\n          ></fs-button>\n          \n          <!-- not logged in -->\n          <ng-container *ngIf=\"(loggedIn$ | async) !== true; else userLoggedIn\">\n\n            <div *ngIf=\"showSignupBtn && !showLoginBtn && !showSearch\" slot=\"end\" class=\"login-intro-text\">\n              <fs-button\n                class=\"text-btn\"\n                color=\"\"\n                buttonStyle=\"clear\"\n                routerLink=\"/signup\"\n                [queryParams]=\"{returnUrl}\"\n                >{{ 'AUTH.TOPNAV_NO_ACCOUNT' | translate }}</fs-button\n              >\n            </div>\n\n            <fs-button *ngIf=\"showSignupBtn\"\n              class=\"d-none d-sm-block toolbar__auth-btn\"\n              routerLink=\"/signup\"\n              [queryParams]=\"{returnUrl}\"\n              style=\"margin-right: 10px; margin-left: 10px\"\n              >{{ 'AUTH.SIGNUP.ACTION' | translate }}</fs-button\n            >\n\n            <div *ngIf=\"showLoginBtn && !showSignupBtn && !showSearch\" slot=\"end\" class=\"login-intro-text\">\n              <fs-button\n                class=\"text-btn\"\n                color=\"\"\n                buttonStyle=\"clear\"\n                routerLink=\"/login\"\n                [queryParams]=\"{returnUrl}\"\n              >\n                <span class=\"has-account\">{{ 'AUTH.TOPNAV_HAS_ACCOUNT' | translate }}</span>\n                <span class=\"has-account-xs\">{{ 'AUTH.TOPNAV_HAS_ACCOUNT_XS' | translate }}</span>\n              </fs-button\n              >              \n            </div>\n           \n            <fs-button *ngIf=\"showLoginBtn\"\n              class=\"d-none d-sm-block toolbar__auth-btn\"\n              buttonStyle=\"outline\"\n              routerLink=\"/login\"\n              [queryParams]=\"{returnUrl}\"\n              >{{ 'AUTH.LOGIN.ACTION' | translate }}</fs-button\n            >\n            <fs-button\n              class=\"d-sm-none toolbar__auth-btn\"\n              buttonStyle=\"outline\"\n              icon=\"person-outline\"\n              [routerLink]=\"showLoginBtn ? '/login' : '/signup'\"\n              [queryParams]=\"{returnUrl}\"\n              [iconOnly]=\"true\"\n              style=\"height:48px;\"\n            ></fs-button>\n          </ng-container>\n\n          <!-- logged in -->\n          <ng-template #userLoggedIn>\n            <ion-menu-toggle autoHide=\"false\" menu=\"user-menu\">\n              <ion-buttons>\n                <fs-button\n                  *ngIf=\"avatar$ | async as avatarUrl\"\n                  style=\"padding-left: 10px;\"\n                  buttonStyle=\"clear\"\n                  [iconOnly]=\"true\"\n                >\n                  <ion-avatar draggable=\"false\">\n                    <img [src]=\"avatarUrl\" (error)=\"onAvatarError($event)\" draggable=\"false\" />\n                  </ion-avatar>\n                </fs-button>\n                <fs-button\n                  *ngIf=\"(avatar$ | async) === ''\"\n                  buttonStyle=\"clear\"\n                  icon=\"person-outline\"\n                  [iconOnly]=\"true\"\n                ></fs-button>\n              </ion-buttons>\n            </ion-menu-toggle>\n          </ng-template>\n        </ion-buttons>\n      </div>\n    </div>\n  </div>\n</ion-toolbar>\n\n<ng-container *ngIf=\"drawerEnabled\">\n  <!-- [attr.hidden]=\"!isDrawerExpanded\"  -->\n  <app-top-navbar-drawer \n    *ngIf=\"isDrawerExpanded\"\n    @slideInOut \n    [theme]=\"theme\"\n    [items]=\"drawerItems$ | async\"\n    [handleActions]=\"drawerHandleActions\"\n    [label]=\"drawerLabel\"\n    [showLabel]=\"drawerShowLabel\"\n    [showingCreateForm]=\"drawerShowCreateForm\"\n    [selectedItemSuccess]=\"drawerSelectedItemSuccess\"\n    (closed)=\"isDrawerExpanded = false\"\n    (selected)=\"drawerSelected.emit($event)\"\n    (newItem)=\"drawerNewItem.emit($event)\"\n  ></app-top-navbar-drawer>\n</ng-container>\n\n<!-- slot content goes here -->\n<ng-content></ng-content>\n\n<!-- deprecated - but good code that can be re-used at some point\n      <app-searchbar\n        *ngIf=\"inFluidSearch\"\n        class=\"toolbar__fluid-searchbar\"\n        [responsiveWidth]=\"false\"\n        showCancelButton=\"always\"\n        [value]=\"(filters$ | async)?.q\"\n        (searchCancel)=\"setFluidSearch(false); onSearchCancel()\"\n        (searchEnter)=\"onSearch($event)\"\n        (searchChange)=\"onSearchChange($event)\"\n        class=\"d-none d-md-block\"\n      ></app-searchbar>\n      <-- button to activate FLUID search for LARGER viewports ->\n      <fs-button\n        *ngIf=\"!inFluidSearch\"\n        class=\"d-none d-md-block toolbar__not-logged-in-btn\"\n        icon=\"search-outline\"\n        buttonStyle=\"clear\"\n        [iconOnly]=\"true\"\n        (click)=\"setFluidSearch(true)\"\n      ></fs-button>\n      <-- button to activate FULLWIDTH search for SMALLER viewports ->\n      <fs-button\n        *ngIf=\"!inFluidSearch\"\n        class=\"d-md-none toolbar__not-logged-in-btn\"\n        icon=\"search-outline\"\n        buttonStyle=\"clear\"\n        [iconOnly]=\"true\"\n        (click)=\"setFullWidthSearch(true)\"\n      ></fs-button>\n      -->\n\n    <!-- fluid searchbar became too complex...removing \n          , only if no title \n        <app-searchbar\n          [value]=\"(filters$ | async)?.q\"\n          [responsiveWidth]=\"false\"\n          showCancelButton=\"focus\"\n          (searchEnter)=\"onSearch($event)\"\n          (searchChange)=\"onSearchChange($event)\"\n          (searchCancel)=\"onSearchCancel()\"\n          class=\"d-none d-lg-block toolbar__fluid-searchbar hide-in-fullwidth-search\"\n        ></app-searchbar>\n        <div class=\"d-lg-none toolbar__fluid-search-btn hide-in-fullwidth-search\">\n          <fs-button\n            buttonStyle=\"clear\"\n            icon=\"search-outline\"\n            [iconOnly]=\"true\"\n            (click)=\"setFullWidthSearch(true)\"\n          ></fs-button>\n        </div>\n      -->\n      ","/** @format */\n\nimport { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';\nimport { NgIf, NgSwitch, NgSwitchCase, NgSwitchDefault, AsyncPipe } from '@angular/common';\nimport { ActivatedRoute, Router, RouterLink } from '@angular/router';\nimport { TranslateService, TranslatePipe } from '@ngx-translate/core';\nimport {\n  NavController,\n  IonToolbar,\n  IonButtons,\n  IonBackButton,\n  IonTitle,\n  IonButton,\n  IonIcon,\n  IonAvatar,\n  IonMenuToggle,\n} from '@ionic/angular/standalone';\nimport { Observable, Subject, Subscription } from 'rxjs';\nimport { filter, take, takeUntil } from 'rxjs/operators';\n\nimport { Store } from '@ngrx/store';\nimport { State } from '@store/reducers';\nimport * as stackActions from '@store/actions/stacks.actions';\nimport { setAvatar } from '@store/actions/user.actions';\nimport { resetFilter } from '@store/actions/viewstate.actions';\nimport { selectAddToStackPlaylist } from '@store/selectors/stacks.selectors';\nimport { selectStackListItems } from '@store/selectors/lists.selectors';\nimport { FilterEntity, selectFilter, GLOBAL_QUERY_ID, FilterEntityTypes } from '@store/selectors/viewstate.selectors';\n\nimport { slideInOut } from '@app/animations';\nimport { ConfigService } from '@app/core/config/config.service';\nimport { ToasterService } from '@app/core/services/toaster.service';\nimport { UserService } from '@app/core/services/user.service';\nimport { EventsService, EventActions } from '@app/core/services/events.service';\nimport { AnalyticsService } from '@app/core/services/analytics/analytics.service';\nimport { TopNavbarDrawerComponent } from '@app/shared/components/top-navbar/drawer/top-navbar-drawer.component';\nimport { SearchbarComponent } from '@app/shared/components/top-navbar/searchbar/searchbar.component';\nimport { ButtonComponent } from '@app/shared/components/ui/buttons/button/button.component';\nimport { Stack } from '@app/shared/models/stack.model';\nimport { DEFAULT_USER_AVATAR } from '@app/shared/models/user.model';\nimport { ENABLE_SIGNUP } from '@app/app.config';\nimport { DISCOVER_PAGE } from '@app/app.routes';\n\nconst DEBUG_LOGS = false;\n/** at what screenWidth should the search placeholder text change from phone to desktop */\nconst SEARCH_TEXT_BREAKPOINT = 390;\nconst LIST_ID_TOP_DRAFTS = 'top_stack_drafts';\n\n@Component({\n  selector: 'app-top-navbar',\n  templateUrl: './top-navbar.component.html',\n  styleUrls: ['./top-navbar.component.scss'],\n  animations: [\n    // needed for stack drawer\n    slideInOut,\n    // trigger('slideInOut', [\n    //   transition(':enter', [\n    //     style({ transform: 'translateY(-204px)', }),\n    //     animate('450ms ease-in-out', style({ transform: 'translateY(0)' })),\n    //   ]),\n    //   transition(':leave', [\n    //     style({ transform: 'translateY(0)' }),\n    //     animate('450ms ease-in-out', style({ transform: 'translateY(-204px)' })),\n    //   ]),\n    // ]),\n  ],\n  standalone: true,\n  imports: [\n    NgIf,\n    RouterLink,\n    NgSwitch,\n    NgSwitchCase,\n    NgSwitchDefault,\n    SearchbarComponent,\n    ButtonComponent,\n    TopNavbarDrawerComponent,\n    AsyncPipe,\n    TranslatePipe,\n    IonAvatar,\n    IonIcon,\n    IonButton,\n    IonTitle,\n    IonBackButton,\n    IonButtons,\n    IonToolbar,\n    IonMenuToggle,\n  ],\n})\nexport class TopNavbarComponent implements OnInit, OnDestroy {\n  @Input() title = '';\n  @Input() showSearch = true;\n  /** expand the search if values found in global filter */\n  @Input() expandSearchIfQuery = false;\n  @Input() showSignupBtn = ENABLE_SIGNUP; // allow to hide for unauth'd\n  @Input() showLoginBtn = true; // allow to hide for unauth'd\n  /** manages which logo */\n  @Input() theme: 'light' | 'dark' = 'dark';\n  /** only show the logo, don't respond to the screenwidth (if no title on page) */\n  @Input() fullLogoNoBreakpoints = false;\n  @Input() backButtonReturnUrl: string;\n  @Input() drawerEnabled = false;\n  @Input() drawerLabel: string;\n  @Input() drawerShowLabel = true;\n  @Input() drawerOpenOnLoad = false;\n  @Input() drawerHandleActions = true;\n  @Input() drawerSelectedItemSuccess = false;\n  @Input() showtitleActionButton = false;\n  @Input()\n  set drawerExpandEvent(value: { i: number; showCreateForm?: boolean }) {\n    const { i = 0, showCreateForm = false } = value;\n    if (i > 0) {\n      DEBUG_LOGS && console.log(`drawerExpandEvent`, value);\n      this.drawerShowCreateForm = showCreateForm;\n      this.isDrawerExpanded = true;\n      // this.isDrawerExpanded = !!value;\n    } // else this was an init event..\n  }\n  @Input()\n  set drawerCloseEvent(value: number) {\n    if (typeof value === 'number' && value > 0) {\n      DEBUG_LOGS && console.log(`drawerCloseEvent`, value);\n      this.isDrawerExpanded = false;\n    } // else this was an init event..\n  }\n\n  @Output() drawerSelected = new EventEmitter<Partial<Stack>>();\n  @Output() drawerNewItem = new EventEmitter<Partial<Stack>>();\n  @Output() drawerExpand = new EventEmitter<boolean>();\n\n  loggedIn$ = this.userService.isLoggedIn$;\n  avatar$ = this.userService.avatarUrl$;\n  showTopnav = true;\n  inFullWidthSearch = false;\n  // inFluidSearch = false;\n  filters$: Observable<FilterEntity>;\n  /** handle draewr open if no stack id, Input */\n  isDrawerExpanded = false;\n  drawerItems$: Observable<Stack[]>;\n  drawerShowCreateForm = false;\n\n  searchPlaceholderText: string = 'Discover Filmstacks & Projects';\n\n  private _returnUrlQueryParam = '';\n  get returnUrl() {\n    return this._returnUrlQueryParam || this.router?.url;\n  }\n\n  private get hasSearchText(): boolean {\n    return !!(this._searchText?.length > 0);\n  }\n\n  private _respondToPlaylistChanges = false; // await loading respondToPlaylistChanges\n  private _placeholderTextDesktop = 'Discover Filmstacks & Projects';\n  private _placeholderTextPhone = 'Find Stacks & Projects';\n\n  /** this is used to determine what to do on searchBlur and on change */\n  private _searchText = '';\n  private onDestroy$ = new Subject<void>();\n  private subscriptions: Subscription = new Subscription();\n  private _closeDrawerTimeout;\n\n  constructor(\n    private events: EventsService,\n    private userService: UserService,\n    private configService: ConfigService,\n    private analyticsService: AnalyticsService,\n    private toaster: ToasterService,\n    private store: Store<State>,\n    private navCtrl: NavController,\n    private route: ActivatedRoute,\n    private router: Router,\n    private translate: TranslateService\n  ) {}\n\n  ngOnInit() {\n    /**\n     * Determine if the widget config says to hide topnav\n     */\n    this.configService.appConfig.then((config) => {\n      if (config.isWidgetActive && config.hideTopnav) {\n        this.showTopnav = false;\n      }\n    });\n\n    // carry the returnUrl through navs - does it need to be cleared?\n    this.route.queryParams\n      .pipe(\n        takeUntil(this.onDestroy$),\n        filter((params) => params?.returnUrl)\n      )\n      .subscribe((params) => {\n        this._returnUrlQueryParam = params.returnUrl;\n        DEBUG_LOGS && console.log(`returnUrlQueryParam='${this._returnUrlQueryParam}'`);\n      });\n\n    setTimeout(() => {\n      this._respondToPlaylistChanges = true;\n    }, 900);\n\n    if (this.drawerEnabled) {\n      // get the items here\n      this.getStackDrafts();\n      if (this.drawerOpenOnLoad) {\n        DEBUG_LOGS && console.log(`topnav drawerOpenOnLoad`, this.drawerOpenOnLoad);\n        this.isDrawerExpanded = true;\n        this.drawerExpand.emit(this.isDrawerExpanded);\n      }\n      this.store\n        .select(selectAddToStackPlaylist)\n        .pipe(\n          // delay(1000), /// wait for page to load and establish state\n          takeUntil(this.onDestroy$)\n          // filter((playlist) => Array.isArray(playlist) && playlist.length > 0)\n        )\n        .subscribe((playlist) => {\n          if (!this._respondToPlaylistChanges) {\n            return;\n          }\n          if (Array.isArray(playlist) && playlist.length > 0) {\n            DEBUG_LOGS && console.log(`[topnav] playlist -> topDrawerExpand`);\n            this.isDrawerExpanded = true;\n            this.drawerExpand.emit(this.isDrawerExpanded);\n          } else if (this.isDrawerExpanded) {\n            DEBUG_LOGS && console.log(`[topnav] no playlist - no expand (with delay)`);\n            this.delayedCloseDrawer(0); // no delay, reduce any time it's shown after nav if resetting..\n          }\n        });\n    }\n\n    /**\n     * select the global filters from the store, memoized per MVP-970\n     */\n    this.filters$ = this.store.select(selectFilter(GLOBAL_QUERY_ID));\n\n    /**\n     * open the searchbar if there's a value for the inital filter query\n     */\n    this.filters$.pipe(takeUntil(this.onDestroy$)).subscribe((filt) => {\n      DEBUG_LOGS &&\n        console.log(`[TOPNAV] filter?.q ?`, { filter: filt, setFullWidth: !!(this.expandSearchIfQuery && filt?.q) });\n      this._searchText = filt?.q ?? '';\n      if (!!(this.expandSearchIfQuery && filt?.q)) {\n        this.setFullWidthSearch(true);\n      }\n    });\n\n    const subResize = this.events.subscribe(EventActions.RESIZE, this.onResize);\n    this.subscriptions.add(subResize);\n  }\n\n  ngOnDestroy() {\n    this.subscriptions.unsubscribe();\n    this.onDestroy$.next();\n    this.onDestroy$.complete();\n  }\n\n  delayedCloseDrawer(delay = 300) {\n    clearTimeout(this._closeDrawerTimeout);\n    this._closeDrawerTimeout = setTimeout(() => {\n      this.isDrawerExpanded = false;\n      this.drawerExpand.emit(this.isDrawerExpanded);\n    }, delay);\n  }\n\n  /**\n   * due to child being rendered by ngIf=isDrawerExpanded, this would get triggered mutliple times in child\n   * which is ok since we are persisting & re-selecting the list from the store, loading if needed.\n   */\n  getStackDrafts() {\n    const listId = LIST_ID_TOP_DRAFTS;\n    // const list$: Observable<ItemList> = this.store.select(selectList(listId));\n    this.drawerItems$ = this.store.select(selectStackListItems(listId));\n    // load Stacks\n    this.userService.userId$\n      .pipe(\n        filter((id) => id && id.length > 0),\n        take(1)\n      )\n      .subscribe((userId) => {\n        /**\n         * when COLLABORATIVE DRAFTS ready, you can remove userId on this carousel\n         */\n        this.store.dispatch(\n          stackActions.loadFilteredStacks({\n            listId,\n            filters: {\n              // : FilterEntity\n              type: FilterEntityTypes.StackDrafts,\n              id: listId,\n              q: null,\n              isDraft: true,\n              isTopDrawer: true,\n              userId,\n              // ...(this.projectId ? { projectId: this.projectId, userId } : { userId })\n            },\n          })\n        );\n      });\n  }\n\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  onResize = ({ width, height }) => {\n    this.searchPlaceholderText =\n      width > SEARCH_TEXT_BREAKPOINT ? this._placeholderTextDesktop : this._placeholderTextPhone;\n  };\n\n  setFullWidthSearch(mode: boolean) {\n    DEBUG_LOGS &&\n      console.log(`[topnav] setFullWidthSearch`, {\n        showSearch: this.showSearch,\n        inFullWidthSearch: this.inFullWidthSearch,\n        mode,\n        searchText: this._searchText,\n      });\n    if (this.showSearch) {\n      this.inFullWidthSearch = mode;\n    }\n  }\n\n  // setFluidSearch(mode: boolean) {\n  //   this.inFluidSearch = mode;\n  // }\n\n  onSearchBlur(event) {\n    DEBUG_LOGS && console.log(`[topnav] onSearchBlur`, { event, searchText: this._searchText });\n    // if we click away and the page doesn't care about search then close it\n    if (!this.hasSearchText || !this.expandSearchIfQuery) {\n      this.setFullWidthSearch(false);\n    }\n  }\n\n  onSearch(searchText: string) {\n    DEBUG_LOGS && console.log(`[topnav] onSearch`, searchText);\n    // this.setFilter(searchText); // could set it here before navigating, so the Lists load with latest Filter query & don't need to load twice?\n    const queryParams: Partial<FilterEntity> = {}; // allow the any, since we don't need the required id in the queryparams\n    if (searchText) {\n      queryParams.q = searchText;\n    }\n    this._searchText = searchText; // keeping track of the searchText so we can clear when it changes to empty\n    // before we nav, close this if the page we are on does not want to keep open\n    if (!this.expandSearchIfQuery) {\n      this.setFullWidthSearch(false);\n    }\n    this.navCtrl.navigateForward(`/${DISCOVER_PAGE}`, { queryParams });\n    this.analyticsService.search(`[topnav]:${searchText}`);\n  }\n\n  onSearchChange(searchText: string) {\n    DEBUG_LOGS && console.log(`[topnav] onSearchChange`, searchText);\n    if (!searchText && searchText !== this._searchText) {\n      this.onSearchCancel();\n    } else {\n      this._searchText = searchText;\n    }\n  }\n\n  onSearchCancel() {\n    DEBUG_LOGS && console.log(`[topnav] onSearchCancel...`);\n    this.store.dispatch(resetFilter({ id: GLOBAL_QUERY_ID }));\n    this._searchText = '';\n\n    // remove the 'q' queryparam from the url\n    this.router.navigate([], {\n      queryParams: {\n        q: null,\n      },\n      queryParamsHandling: 'merge',\n      // i don't really want a location change,\n      // but updating queryparams in url only appears to work if false?\n      skipLocationChange: false,\n    });\n  }\n\n  onToggleDrawerClick(evt) {\n    evt.preventDefault();\n    this.isDrawerExpanded = !this.isDrawerExpanded;\n    this.drawerExpand.emit(this.isDrawerExpanded);\n  }\n\n  logout() {\n    this.userService.logout();\n    this.toaster.present(this.translate.instant('AUTH.TEXT_MESSAGE_ON_LOGOUT'));\n  }\n\n  onAvatarError(event) {\n    console.log(`[topnav] onAvatarError`, event);\n    this.store.dispatch(setAvatar({ avatar: DEFAULT_USER_AVATAR }));\n  }\n}\n","/** @format */\n\nimport { Component } from '@angular/core';\nimport { IonButton, IonIcon } from '@ionic/angular/standalone';\n\n@Component({\n  selector: 'fs-ellipsis-button',\n  templateUrl: './ellipsis-button.component.html',\n  styleUrls: ['./ellipsis-button.component.scss'],\n  standalone: true,\n  imports: [IonButton, IonIcon],\n})\nexport class EllipsisButtonComponent {}\n","<ion-button color=\"medium\" fill=\"clear\">\n  <ion-icon name=\"ellipsis-vertical\"></ion-icon>\n</ion-button>\n","/** @format */\n\nimport { Component, Input, OnInit, ViewChild } from '@angular/core';\nimport { FormControl } from '@angular/forms';\nimport { take } from 'rxjs';\nimport { TranslateService, TranslatePipe } from '@ngx-translate/core';\nimport { Stack } from '@app/shared/models/stack.model';\nimport { BaseModalComponent } from '@app/shared/components/ui/modal/base-modal.component';\nimport { FormTextareaComponent } from '@app/shared/components/ui/form/form-textarea/form-textarea.component';\nimport { ButtonComponent } from '@app/shared/components/ui/buttons/button/button.component';\nimport { FormControlCastPipe } from '@app/shared/pipes/form-control-cast.pipe';\nimport { StackService } from '@app/stacks/shared/services/stack.service';\n\n@Component({\n  selector: 'app-collab-modal',\n  templateUrl: './collab-modal.component.html',\n  styleUrls: ['./collab-modal.component.scss'],\n  standalone: true,\n  imports: [BaseModalComponent, FormTextareaComponent, ButtonComponent, TranslatePipe, FormControlCastPipe],\n})\nexport class CollabModalComponent implements OnInit {\n  @Input() stack: Stack;\n\n  @ViewChild('modal', { static: false, read: BaseModalComponent })\n  modal: BaseModalComponent;\n\n  descControl = new FormControl('');\n  private defaultDescText = '';\n\n  constructor(private stackService: StackService, private translate: TranslateService) {}\n\n  ngOnInit() {\n    this.translate\n      .get('STACK.COLLAB_DEFAULT_STACK_DESC')\n      .pipe(take(1))\n      .subscribe((res) => {\n        this.defaultDescText = res;\n        this.descControl.setValue(res);\n      });\n  }\n\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  invite(event) {\n    // if the desc was modified from the default, update\n    const newDescription = this.descControl.value !== this.defaultDescText ? this.descControl.value : '';\n    this.stackService.makeCollaborative(this.stack.projectId, this.stack.stackId, newDescription);\n    this.modal.dismiss(true);\n  }\n\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  cancel(event) {\n    this.modal.dismiss();\n  }\n\n  // messageChanged(event) {\n  //   console.log({ descVal: this.descControl.value, event });\n  // }\n}\n","<fs-base-modal [title]=\"''\" #modal>\n  <div class=\"ion-padding skinny-limit-width\">\n    <h2>{{ 'STACK.DRAFT_INVITE' | translate }}</h2>\n    <p class=\"dark-contrast ion-padding-bottom\">{{ 'STACK.DRAFT_INVITE_BODY' | translate }}</p>\n    <fs-form-textarea\n      class=\"ion-padding-vertical\"\n      [autoGrow]=\"true\"\n      [rows]=\"3\"\n      [label]=\"'STACK.DRAFT_INVITE_MESSAGE_LABEL' | translate\"\n      [hint]=\"'STACK.DRAFT_INVITE_MESSAGE_HINT' | translate\"\n      [control]=\"descControl | formControlCast\"\n      [debounce]=\"600\"\n    ></fs-form-textarea>\n    <div class=\"actions ion-text-center ion-padding\">\n      <fs-button size=\"large\" (click)=\"invite($event)\">\n        {{ 'STACK.DRAFT_INVITE_ACTION' | translate }}\n      </fs-button>\n      <fs-button buttonStyle=\"clear\" (click)=\"cancel($event)\">\n        {{ 'COMMON.CANCEL' | translate }}\n      </fs-button>\n    </div>\n  </div>\n</fs-base-modal>","/** @format */\n\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { Store } from '@ngrx/store';\nimport { State } from '@store/reducers';\nimport * as stackActions from '@store/actions/stacks.actions';\nimport { getStackPlayWithClips } from '@store/selectors/stacks.selectors';\nimport { Stack } from '@app/shared/models/stack.model';\n\n@Injectable({\n  providedIn: 'root',\n})\nexport class StackService {\n  constructor(private store: Store<State>) {}\n\n  /**\n   * set the current Playing Stack, and return that Stack once loaded by Effect\n   */\n  selectAndGetPlay(projectId: string, stackId: string): Observable<Stack> {\n    if (projectId && stackId) {\n      this.store.dispatch(stackActions.selectIdPlay({ projectId, stackId }));\n    }\n    return this.store.select(getStackPlayWithClips);\n  }\n\n  /*\n   * removed as it was causing confusing performance issues..\n   * set the current Editing Stack, and return that Stack once loaded by Effect\n   */\n  // selectAndGetEdit(projectId: string, stackId: string): Observable<Stack> {\n  //   if (projectId && stackId) {\n  //     this.store.dispatch(stackActions.selectIdEdit({ projectId, stackId }));\n  //   }\n  //   return this.store.select(selectStackEdit);\n  // }\n\n  setStackIsApproved({\n    projectId,\n    stackId,\n    isApproved = true,\n  }: {\n    projectId: string;\n    stackId: string;\n    isApproved: boolean;\n  }) {\n    this.store.dispatch(stackActions.setApproved({ projectId, stackId, isApproved }));\n  }\n  setStackFeatured({\n    projectId,\n    stackId,\n    featured,\n    isApproved,\n    fromIdx,\n    toIdx,\n  }: {\n    projectId: string;\n    stackId: string;\n    featured: number;\n    isApproved?: boolean;\n    fromIdx?: number;\n    toIdx?: number;\n  }) {\n    this.store.dispatch(stackActions.setFeatured({ projectId, stackId, featured, isApproved, fromIdx, toIdx }));\n  }\n\n  // can subscribe to core stack service stacksUpdated$\n\n  /**\n   * Update the Stack to be collaborative MVP-1176\n   */\n  makeCollaborative(projectId, stackId, description = '') {\n    this.store.dispatch(stackActions.setCollaborative({ projectId, stackId, isCollaborative: 1, description }));\n  }\n  removeCollaborative(projectId, stackId) {\n    this.store.dispatch(stackActions.setCollaborative({ projectId, stackId, isCollaborative: 0 }));\n  }\n}\n","import * as i0 from '@angular/core';\nimport { EventEmitter, Component, ChangeDetectionStrategy, Input, Output, ViewChild, NgModule } from '@angular/core';\nimport { toDataURL, toCanvas, toString } from 'qrcode';\nimport * as i1 from '@angular/platform-browser';\n\nclass QRCodeComponent {\n    constructor(renderer, sanitizer) {\n        this.renderer = renderer;\n        this.sanitizer = sanitizer;\n        this.allowEmptyString = false;\n        this.colorDark = \"#000000ff\";\n        this.colorLight = \"#ffffffff\";\n        this.cssClass = \"qrcode\";\n        this.elementType = \"canvas\";\n        this.errorCorrectionLevel = \"M\";\n        this.margin = 4;\n        this.qrdata = \"\";\n        this.scale = 4;\n        this.width = 10;\n        this.qrCodeURL = new EventEmitter();\n        this.context = null;\n    }\n    async ngOnChanges() {\n        await this.createQRCode();\n    }\n    isValidQrCodeText(data) {\n        if (this.allowEmptyString === false) {\n            return !(typeof data === \"undefined\" ||\n                data === \"\" ||\n                data === \"null\" ||\n                data === null);\n        }\n        return !(typeof data === \"undefined\");\n    }\n    toDataURL(qrCodeConfig) {\n        return new Promise((resolve, reject) => {\n            toDataURL(this.qrdata, qrCodeConfig, (err, url) => {\n                if (err) {\n                    reject(err);\n                }\n                else {\n                    resolve(url);\n                }\n            });\n        });\n    }\n    toCanvas(canvas, qrCodeConfig) {\n        return new Promise((resolve, reject) => {\n            toCanvas(canvas, this.qrdata, qrCodeConfig, (error) => {\n                if (error) {\n                    reject(error);\n                }\n                else {\n                    resolve(\"success\");\n                }\n            });\n        });\n    }\n    toSVG(qrCodeConfig) {\n        return new Promise((resolve, reject) => {\n            toString(this.qrdata, qrCodeConfig, (err, url) => {\n                if (err) {\n                    reject(err);\n                }\n                else {\n                    resolve(url);\n                }\n            });\n        });\n    }\n    renderElement(element) {\n        for (const node of this.qrcElement.nativeElement.childNodes) {\n            this.renderer.removeChild(this.qrcElement.nativeElement, node);\n        }\n        this.renderer.appendChild(this.qrcElement.nativeElement, element);\n    }\n    async createQRCode() {\n        if (this.version && this.version > 40) {\n            console.warn(\"[angularx-qrcode] max value for `version` is 40\");\n            this.version = 40;\n        }\n        else if (this.version && this.version < 1) {\n            console.warn(\"[angularx-qrcode]`min value for `version` is 1\");\n            this.version = 1;\n        }\n        else if (this.version !== undefined && isNaN(this.version)) {\n            console.warn(\"[angularx-qrcode] version should be a number, defaulting to auto.\");\n            this.version = undefined;\n        }\n        try {\n            if (!this.isValidQrCodeText(this.qrdata)) {\n                throw new Error(\"[angularx-qrcode] Field `qrdata` is empty, set 'allowEmptyString=\\\"true\\\"' to overwrite this behaviour.\");\n            }\n            if (this.isValidQrCodeText(this.qrdata) && this.qrdata === \"\") {\n                this.qrdata = \" \";\n            }\n            const config = {\n                color: {\n                    dark: this.colorDark,\n                    light: this.colorLight,\n                },\n                errorCorrectionLevel: this.errorCorrectionLevel,\n                margin: this.margin,\n                scale: this.scale,\n                version: this.version,\n                width: this.width,\n            };\n            const centerImageSrc = this.imageSrc;\n            const centerImageHeight = this.imageHeight || 40;\n            const centerImageWidth = this.imageWidth || 40;\n            switch (this.elementType) {\n                case \"canvas\": {\n                    const canvasElement = this.renderer.createElement(\"canvas\");\n                    this.context = canvasElement.getContext(\"2d\");\n                    this.toCanvas(canvasElement, config)\n                        .then(() => {\n                        if (this.ariaLabel) {\n                            this.renderer.setAttribute(canvasElement, \"aria-label\", `${this.ariaLabel}`);\n                        }\n                        if (this.title) {\n                            this.renderer.setAttribute(canvasElement, \"title\", `${this.title}`);\n                        }\n                        if (centerImageSrc && this.context) {\n                            this.centerImage = new Image(centerImageWidth, centerImageHeight);\n                            if (centerImageSrc !== this.centerImage.src) {\n                                this.centerImage.crossOrigin = \"anonymous\";\n                                this.centerImage.src = centerImageSrc;\n                            }\n                            if (centerImageHeight !== this.centerImage.height) {\n                                this.centerImage.height = centerImageHeight;\n                            }\n                            if (centerImageWidth !== this.centerImage.width) {\n                                this.centerImage.width = centerImageWidth;\n                            }\n                            const centerImage = this.centerImage;\n                            if (centerImage) {\n                                centerImage.onload = () => {\n                                    this.context?.drawImage(centerImage, canvasElement.width / 2 - centerImageWidth / 2, canvasElement.height / 2 - centerImageHeight / 2, centerImageWidth, centerImageHeight);\n                                };\n                            }\n                        }\n                        this.renderElement(canvasElement);\n                        this.emitQRCodeURL(canvasElement);\n                    })\n                        .catch((e) => {\n                        console.error(\"[angularx-qrcode] canvas error:\", e);\n                    });\n                    break;\n                }\n                case \"svg\": {\n                    const svgParentElement = this.renderer.createElement(\"div\");\n                    this.toSVG(config)\n                        .then((svgString) => {\n                        this.renderer.setProperty(svgParentElement, \"innerHTML\", svgString);\n                        const svgElement = svgParentElement.firstChild;\n                        this.renderer.setAttribute(svgElement, \"height\", `${this.width}`);\n                        this.renderer.setAttribute(svgElement, \"width\", `${this.width}`);\n                        this.renderElement(svgElement);\n                        this.emitQRCodeURL(svgElement);\n                    })\n                        .catch((e) => {\n                        console.error(\"[angularx-qrcode] svg error:\", e);\n                    });\n                    break;\n                }\n                case \"url\":\n                case \"img\":\n                default: {\n                    const imgElement = this.renderer.createElement(\"img\");\n                    this.toDataURL(config)\n                        .then((dataUrl) => {\n                        if (this.alt) {\n                            imgElement.setAttribute(\"alt\", this.alt);\n                        }\n                        if (this.ariaLabel) {\n                            imgElement.setAttribute(\"aria-label\", this.ariaLabel);\n                        }\n                        imgElement.setAttribute(\"src\", dataUrl);\n                        if (this.title) {\n                            imgElement.setAttribute(\"title\", this.title);\n                        }\n                        this.renderElement(imgElement);\n                        this.emitQRCodeURL(imgElement);\n                    })\n                        .catch((e) => {\n                        console.error(\"[angularx-qrcode] img/url error:\", e);\n                    });\n                }\n            }\n        }\n        catch (e) {\n            console.error(\"[angularx-qrcode] Error generating QR Code:\", e.message);\n        }\n    }\n    convertBase64ImageUrlToBlob(base64ImageUrl) {\n        const parts = base64ImageUrl.split(\";base64,\");\n        const imageType = parts[0].split(\":\")[1];\n        const decodedData = atob(parts[1]);\n        const uInt8Array = new Uint8Array(decodedData.length);\n        for (let i = 0; i < decodedData.length; ++i) {\n            uInt8Array[i] = decodedData.charCodeAt(i);\n        }\n        return new Blob([uInt8Array], { type: imageType });\n    }\n    emitQRCodeURL(element) {\n        const className = element.constructor.name;\n        if (className === SVGSVGElement.name) {\n            const svgHTML = element.outerHTML;\n            const blob = new Blob([svgHTML], { type: \"image/svg+xml\" });\n            const urlSvg = URL.createObjectURL(blob);\n            const urlSanitized = this.sanitizer.bypassSecurityTrustUrl(urlSvg);\n            this.qrCodeURL.emit(urlSanitized);\n            return;\n        }\n        let urlImage = \"\";\n        if (className === HTMLCanvasElement.name) {\n            urlImage = element.toDataURL(\"image/png\");\n        }\n        if (className === HTMLImageElement.name) {\n            urlImage = element.src;\n        }\n        const blobData = this.convertBase64ImageUrlToBlob(urlImage);\n        const urlBlob = URL.createObjectURL(blobData);\n        const urlSanitized = this.sanitizer.bypassSecurityTrustUrl(urlBlob);\n        this.qrCodeURL.emit(urlSanitized);\n    }\n    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"18.1.2\", ngImport: i0, type: QRCodeComponent, deps: [{ token: i0.Renderer2 }, { token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }\n    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"14.0.0\", version: \"18.1.2\", type: QRCodeComponent, selector: \"qrcode\", inputs: { allowEmptyString: \"allowEmptyString\", colorDark: \"colorDark\", colorLight: \"colorLight\", cssClass: \"cssClass\", elementType: \"elementType\", errorCorrectionLevel: \"errorCorrectionLevel\", imageSrc: \"imageSrc\", imageHeight: \"imageHeight\", imageWidth: \"imageWidth\", margin: \"margin\", qrdata: \"qrdata\", scale: \"scale\", version: \"version\", width: \"width\", alt: \"alt\", ariaLabel: \"ariaLabel\", title: \"title\" }, outputs: { qrCodeURL: \"qrCodeURL\" }, viewQueries: [{ propertyName: \"qrcElement\", first: true, predicate: [\"qrcElement\"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: `<div #qrcElement [class]=\"cssClass\"></div>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"18.1.2\", ngImport: i0, type: QRCodeComponent, decorators: [{\n            type: Component,\n            args: [{\n                    selector: \"qrcode\",\n                    changeDetection: ChangeDetectionStrategy.OnPush,\n                    template: `<div #qrcElement [class]=\"cssClass\"></div>`,\n                }]\n        }], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i1.DomSanitizer }], propDecorators: { allowEmptyString: [{\n                type: Input\n            }], colorDark: [{\n                type: Input\n            }], colorLight: [{\n                type: Input\n            }], cssClass: [{\n                type: Input\n            }], elementType: [{\n                type: Input\n            }], errorCorrectionLevel: [{\n                type: Input\n            }], imageSrc: [{\n                type: Input\n            }], imageHeight: [{\n                type: Input\n            }], imageWidth: [{\n                type: Input\n            }], margin: [{\n                type: Input\n            }], qrdata: [{\n                type: Input\n            }], scale: [{\n                type: Input\n            }], version: [{\n                type: Input\n            }], width: [{\n                type: Input\n            }], alt: [{\n                type: Input\n            }], ariaLabel: [{\n                type: Input\n            }], title: [{\n                type: Input\n            }], qrCodeURL: [{\n                type: Output\n            }], qrcElement: [{\n                type: ViewChild,\n                args: [\"qrcElement\", { static: true }]\n            }] } });\n\nclass QRCodeModule {\n    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"18.1.2\", ngImport: i0, type: QRCodeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }\n    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"18.1.2\", ngImport: i0, type: QRCodeModule, declarations: [QRCodeComponent], exports: [QRCodeComponent] }); }\n    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"18.1.2\", ngImport: i0, type: QRCodeModule }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"18.1.2\", ngImport: i0, type: QRCodeModule, decorators: [{\n            type: NgModule,\n            args: [{\n                    providers: [],\n                    declarations: [QRCodeComponent],\n                    exports: [QRCodeComponent],\n                }]\n        }] });\n\nexport { QRCodeComponent, QRCodeModule };\n","<div class=\"qr-wrap\">\n  <qrcode \n    *ngIf=\"qrCode\" \n    [qrdata]=\"qrCode\" \n    [width]=\"256\" \n    [colorDark]=\"colorDark\"\n    [colorLight]=\"colorLight\"\n    [errorCorrectionLevel]=\"errorCorrectionLevel\"\n    (qrCodeURL)=\"onChangeURL($event)\"\n  ></qrcode>\n  \n  <a *ngIf=\"showDownload\" [href]=\"qrCodeDownloadLink\" download=\"qrcode\" title=\"Download\">\n    <ion-fab-button>\n      <ion-icon name=\"download\"></ion-icon>\n    </ion-fab-button>\n  </a>\n</div>\n\n\n","/**\n * https://github.com/cordobo/angularx-qrcode#readme\n *\n * @format\n */\n\nimport { Component, Input } from '@angular/core';\nimport { NgIf } from '@angular/common';\nimport { SafeUrl } from '@angular/platform-browser';\nimport { IonFabButton, IonIcon } from '@ionic/angular/standalone';\nimport { QRCodeModule } from 'angularx-qrcode';\nimport { QRCodeErrorCorrectionLevel } from 'qrcode';\n\n@Component({\n  selector: 'app-qr-code',\n  templateUrl: './qr-code.component.html',\n  styleUrls: ['./qr-code.component.scss'],\n  standalone: true,\n  imports: [NgIf, QRCodeModule, IonFabButton, IonIcon],\n})\nexport class QrCodeComponent {\n  @Input() qrCode: string;\n  @Input() showDownload = true;\n  public qrCodeDownloadLink: SafeUrl = '';\n\n  /** RGBA color, color of dark module (foreground) */\n  colorDark: string = '333333ff'; // '#000000ff';\n  /** RGBA color, color of light module (background) */\n  colorLight: string = 'e9eadeff'; // '#ffffffff';\n  /** QR Correction level ('L', 'M', 'Q', 'H') */\n  errorCorrectionLevel: QRCodeErrorCorrectionLevel = 'M';\n\n  onChangeURL(url: SafeUrl) {\n    this.qrCodeDownloadLink = url;\n  }\n}\n","/*!\n * (C) Ionic http://ionicframework.com - MIT License\n */\nexport { getAssetPath, setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';\nexport { c as createAnimation } from './animation.js';\nexport { a as LIFECYCLE_DID_ENTER, c as LIFECYCLE_DID_LEAVE, L as LIFECYCLE_WILL_ENTER, b as LIFECYCLE_WILL_LEAVE, d as LIFECYCLE_WILL_UNLOAD, g as getIonPageElement } from './index2.js';\nexport { iosTransitionAnimation } from './ios.transition.js';\nexport { mdTransitionAnimation } from './md.transition.js';\nexport { g as getTimeGivenProgression } from './cubic-bezier.js';\nexport { createGesture } from './index3.js';\nexport { g as getPlatforms, i as initialize, a as isPlatform } from './ionic-global.js';\nexport { c as componentOnReady } from './helpers.js';\nexport { I as IonicSafeString, g as getMode, s as setupConfig } from './config.js';\nexport { o as openURL } from './theme.js';\nexport { m as menuController } from './index4.js';\nexport { b as actionSheetController, a as alertController, l as loadingController, m as modalController, p as pickerController, c as popoverController, t as toastController } from './overlays.js';\n\nconst IonicSlides = (opts) => {\n    const { swiper, extendParams } = opts;\n    const slidesParams = {\n        effect: undefined,\n        direction: 'horizontal',\n        initialSlide: 0,\n        loop: false,\n        parallax: false,\n        slidesPerView: 1,\n        spaceBetween: 0,\n        speed: 300,\n        slidesPerColumn: 1,\n        slidesPerColumnFill: 'column',\n        slidesPerGroup: 1,\n        centeredSlides: false,\n        slidesOffsetBefore: 0,\n        slidesOffsetAfter: 0,\n        touchEventsTarget: 'container',\n        freeMode: false,\n        freeModeMomentum: true,\n        freeModeMomentumRatio: 1,\n        freeModeMomentumBounce: true,\n        freeModeMomentumBounceRatio: 1,\n        freeModeMomentumVelocityRatio: 1,\n        freeModeSticky: false,\n        freeModeMinimumVelocity: 0.02,\n        autoHeight: false,\n        setWrapperSize: false,\n        zoom: {\n            maxRatio: 3,\n            minRatio: 1,\n            toggle: false,\n        },\n        touchRatio: 1,\n        touchAngle: 45,\n        simulateTouch: true,\n        touchStartPreventDefault: false,\n        shortSwipes: true,\n        longSwipes: true,\n        longSwipesRatio: 0.5,\n        longSwipesMs: 300,\n        followFinger: true,\n        threshold: 0,\n        touchMoveStopPropagation: true,\n        touchReleaseOnEdges: false,\n        iOSEdgeSwipeDetection: false,\n        iOSEdgeSwipeThreshold: 20,\n        resistance: true,\n        resistanceRatio: 0.85,\n        watchSlidesProgress: false,\n        watchSlidesVisibility: false,\n        preventClicks: true,\n        preventClicksPropagation: true,\n        slideToClickedSlide: false,\n        loopAdditionalSlides: 0,\n        noSwiping: true,\n        runCallbacksOnInit: true,\n        coverflowEffect: {\n            rotate: 50,\n            stretch: 0,\n            depth: 100,\n            modifier: 1,\n            slideShadows: true,\n        },\n        flipEffect: {\n            slideShadows: true,\n            limitRotation: true,\n        },\n        cubeEffect: {\n            slideShadows: true,\n            shadow: true,\n            shadowOffset: 20,\n            shadowScale: 0.94,\n        },\n        fadeEffect: {\n            crossFade: false,\n        },\n        a11y: {\n            prevSlideMessage: 'Previous slide',\n            nextSlideMessage: 'Next slide',\n            firstSlideMessage: 'This is the first slide',\n            lastSlideMessage: 'This is the last slide',\n        },\n    };\n    if (swiper.pagination) {\n        slidesParams.pagination = {\n            type: 'bullets',\n            clickable: false,\n            hideOnClick: false,\n        };\n    }\n    if (swiper.scrollbar) {\n        slidesParams.scrollbar = {\n            hide: true,\n        };\n    }\n    extendParams(slidesParams);\n};\n\nexport { IonicSlides };\n","\nconst canPromise = require('./can-promise')\n\nconst QRCode = require('./core/qrcode')\nconst CanvasRenderer = require('./renderer/canvas')\nconst SvgRenderer = require('./renderer/svg-tag.js')\n\nfunction renderCanvas (renderFunc, canvas, text, opts, cb) {\n  const args = [].slice.call(arguments, 1)\n  const argsNum = args.length\n  const isLastArgCb = typeof args[argsNum - 1] === 'function'\n\n  if (!isLastArgCb && !canPromise()) {\n    throw new Error('Callback required as last argument')\n  }\n\n  if (isLastArgCb) {\n    if (argsNum < 2) {\n      throw new Error('Too few arguments provided')\n    }\n\n    if (argsNum === 2) {\n      cb = text\n      text = canvas\n      canvas = opts = undefined\n    } else if (argsNum === 3) {\n      if (canvas.getContext && typeof cb === 'undefined') {\n        cb = opts\n        opts = undefined\n      } else {\n        cb = opts\n        opts = text\n        text = canvas\n        canvas = undefined\n      }\n    }\n  } else {\n    if (argsNum < 1) {\n      throw new Error('Too few arguments provided')\n    }\n\n    if (argsNum === 1) {\n      text = canvas\n      canvas = opts = undefined\n    } else if (argsNum === 2 && !canvas.getContext) {\n      opts = text\n      text = canvas\n      canvas = undefined\n    }\n\n    return new Promise(function (resolve, reject) {\n      try {\n        const data = QRCode.create(text, opts)\n        resolve(renderFunc(data, canvas, opts))\n      } catch (e) {\n        reject(e)\n      }\n    })\n  }\n\n  try {\n    const data = QRCode.create(text, opts)\n    cb(null, renderFunc(data, canvas, opts))\n  } catch (e) {\n    cb(e)\n  }\n}\n\nexports.create = QRCode.create\nexports.toCanvas = renderCanvas.bind(null, CanvasRenderer.render)\nexports.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL)\n\n// only svg for now.\nexports.toString = renderCanvas.bind(null, function (data, _, opts) {\n  return SvgRenderer.render(data, opts)\n})\n","// can-promise has a crash in some versions of react native that dont have\n// standard global objects\n// https://github.com/soldair/node-qrcode/issues/157\n\nmodule.exports = function () {\n  return typeof Promise === 'function' && Promise.prototype && Promise.prototype.then\n}\n","/**\n * Alignment pattern are fixed reference pattern in defined positions\n * in a matrix symbology, which enables the decode software to re-synchronise\n * the coordinate mapping of the image modules in the event of moderate amounts\n * of distortion of the image.\n *\n * Alignment patterns are present only in QR Code symbols of version 2 or larger\n * and their number depends on the symbol version.\n */\n\nconst getSymbolSize = require('./utils').getSymbolSize\n\n/**\n * Calculate the row/column coordinates of the center module of each alignment pattern\n * for the specified QR Code version.\n *\n * The alignment patterns are positioned symmetrically on either side of the diagonal\n * running from the top left corner of the symbol to the bottom right corner.\n *\n * Since positions are simmetrical only half of the coordinates are returned.\n * Each item of the array will represent in turn the x and y coordinate.\n * @see {@link getPositions}\n *\n * @param  {Number} version QR Code version\n * @return {Array}          Array of coordinate\n */\nexports.getRowColCoords = function getRowColCoords (version) {\n  if (version === 1) return []\n\n  const posCount = Math.floor(version / 7) + 2\n  const size = getSymbolSize(version)\n  const intervals = size === 145 ? 26 : Math.ceil((size - 13) / (2 * posCount - 2)) * 2\n  const positions = [size - 7] // Last coord is always (size - 7)\n\n  for (let i = 1; i < posCount - 1; i++) {\n    positions[i] = positions[i - 1] - intervals\n  }\n\n  positions.push(6) // First coord is always 6\n\n  return positions.reverse()\n}\n\n/**\n * Returns an array containing the positions of each alignment pattern.\n * Each array's element represent the center point of the pattern as (x, y) coordinates\n *\n * Coordinates are calculated expanding the row/column coordinates returned by {@link getRowColCoords}\n * and filtering out the items that overlaps with finder pattern\n *\n * @example\n * For a Version 7 symbol {@link getRowColCoords} returns values 6, 22 and 38.\n * The alignment patterns, therefore, are to be centered on (row, column)\n * positions (6,22), (22,6), (22,22), (22,38), (38,22), (38,38).\n * Note that the coordinates (6,6), (6,38), (38,6) are occupied by finder patterns\n * and are not therefore used for alignment patterns.\n *\n * let pos = getPositions(7)\n * // [[6,22], [22,6], [22,22], [22,38], [38,22], [38,38]]\n *\n * @param  {Number} version QR Code version\n * @return {Array}          Array of coordinates\n */\nexports.getPositions = function getPositions (version) {\n  const coords = []\n  const pos = exports.getRowColCoords(version)\n  const posLength = pos.length\n\n  for (let i = 0; i < posLength; i++) {\n    for (let j = 0; j < posLength; j++) {\n      // Skip if position is occupied by finder patterns\n      if ((i === 0 && j === 0) || // top-left\n          (i === 0 && j === posLength - 1) || // bottom-left\n          (i === posLength - 1 && j === 0)) { // top-right\n        continue\n      }\n\n      coords.push([pos[i], pos[j]])\n    }\n  }\n\n  return coords\n}\n","const Mode = require('./mode')\n\n/**\n * Array of characters available in alphanumeric mode\n *\n * As per QR Code specification, to each character\n * is assigned a value from 0 to 44 which in this case coincides\n * with the array index\n *\n * @type {Array}\n */\nconst ALPHA_NUM_CHARS = [\n  '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n  'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n  'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',\n  ' ', '$', '%', '*', '+', '-', '.', '/', ':'\n]\n\nfunction AlphanumericData (data) {\n  this.mode = Mode.ALPHANUMERIC\n  this.data = data\n}\n\nAlphanumericData.getBitsLength = function getBitsLength (length) {\n  return 11 * Math.floor(length / 2) + 6 * (length % 2)\n}\n\nAlphanumericData.prototype.getLength = function getLength () {\n  return this.data.length\n}\n\nAlphanumericData.prototype.getBitsLength = function getBitsLength () {\n  return AlphanumericData.getBitsLength(this.data.length)\n}\n\nAlphanumericData.prototype.write = function write (bitBuffer) {\n  let i\n\n  // Input data characters are divided into groups of two characters\n  // and encoded as 11-bit binary codes.\n  for (i = 0; i + 2 <= this.data.length; i += 2) {\n    // The character value of the first character is multiplied by 45\n    let value = ALPHA_NUM_CHARS.indexOf(this.data[i]) * 45\n\n    // The character value of the second digit is added to the product\n    value += ALPHA_NUM_CHARS.indexOf(this.data[i + 1])\n\n    // The sum is then stored as 11-bit binary number\n    bitBuffer.put(value, 11)\n  }\n\n  // If the number of input data characters is not a multiple of two,\n  // the character value of the final character is encoded as a 6-bit binary number.\n  if (this.data.length % 2) {\n    bitBuffer.put(ALPHA_NUM_CHARS.indexOf(this.data[i]), 6)\n  }\n}\n\nmodule.exports = AlphanumericData\n","function BitBuffer () {\n  this.buffer = []\n  this.length = 0\n}\n\nBitBuffer.prototype = {\n\n  get: function (index) {\n    const bufIndex = Math.floor(index / 8)\n    return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1) === 1\n  },\n\n  put: function (num, length) {\n    for (let i = 0; i < length; i++) {\n      this.putBit(((num >>> (length - i - 1)) & 1) === 1)\n    }\n  },\n\n  getLengthInBits: function () {\n    return this.length\n  },\n\n  putBit: function (bit) {\n    const bufIndex = Math.floor(this.length / 8)\n    if (this.buffer.length <= bufIndex) {\n      this.buffer.push(0)\n    }\n\n    if (bit) {\n      this.buffer[bufIndex] |= (0x80 >>> (this.length % 8))\n    }\n\n    this.length++\n  }\n}\n\nmodule.exports = BitBuffer\n","/**\n * Helper class to handle QR Code symbol modules\n *\n * @param {Number} size Symbol size\n */\nfunction BitMatrix (size) {\n  if (!size || size < 1) {\n    throw new Error('BitMatrix size must be defined and greater than 0')\n  }\n\n  this.size = size\n  this.data = new Uint8Array(size * size)\n  this.reservedBit = new Uint8Array(size * size)\n}\n\n/**\n * Set bit value at specified location\n * If reserved flag is set, this bit will be ignored during masking process\n *\n * @param {Number}  row\n * @param {Number}  col\n * @param {Boolean} value\n * @param {Boolean} reserved\n */\nBitMatrix.prototype.set = function (row, col, value, reserved) {\n  const index = row * this.size + col\n  this.data[index] = value\n  if (reserved) this.reservedBit[index] = true\n}\n\n/**\n * Returns bit value at specified location\n *\n * @param  {Number}  row\n * @param  {Number}  col\n * @return {Boolean}\n */\nBitMatrix.prototype.get = function (row, col) {\n  return this.data[row * this.size + col]\n}\n\n/**\n * Applies xor operator at specified location\n * (used during masking process)\n *\n * @param {Number}  row\n * @param {Number}  col\n * @param {Boolean} value\n */\nBitMatrix.prototype.xor = function (row, col, value) {\n  this.data[row * this.size + col] ^= value\n}\n\n/**\n * Check if bit at specified location is reserved\n *\n * @param {Number}   row\n * @param {Number}   col\n * @return {Boolean}\n */\nBitMatrix.prototype.isReserved = function (row, col) {\n  return this.reservedBit[row * this.size + col]\n}\n\nmodule.exports = BitMatrix\n","const encodeUtf8 = require('encode-utf8')\nconst Mode = require('./mode')\n\nfunction ByteData (data) {\n  this.mode = Mode.BYTE\n  if (typeof (data) === 'string') {\n    data = encodeUtf8(data)\n  }\n  this.data = new Uint8Array(data)\n}\n\nByteData.getBitsLength = function getBitsLength (length) {\n  return length * 8\n}\n\nByteData.prototype.getLength = function getLength () {\n  return this.data.length\n}\n\nByteData.prototype.getBitsLength = function getBitsLength () {\n  return ByteData.getBitsLength(this.data.length)\n}\n\nByteData.prototype.write = function (bitBuffer) {\n  for (let i = 0, l = this.data.length; i < l; i++) {\n    bitBuffer.put(this.data[i], 8)\n  }\n}\n\nmodule.exports = ByteData\n","const ECLevel = require('./error-correction-level')\r\n\r\nconst EC_BLOCKS_TABLE = [\r\n// L  M  Q  H\r\n  1, 1, 1, 1,\r\n  1, 1, 1, 1,\r\n  1, 1, 2, 2,\r\n  1, 2, 2, 4,\r\n  1, 2, 4, 4,\r\n  2, 4, 4, 4,\r\n  2, 4, 6, 5,\r\n  2, 4, 6, 6,\r\n  2, 5, 8, 8,\r\n  4, 5, 8, 8,\r\n  4, 5, 8, 11,\r\n  4, 8, 10, 11,\r\n  4, 9, 12, 16,\r\n  4, 9, 16, 16,\r\n  6, 10, 12, 18,\r\n  6, 10, 17, 16,\r\n  6, 11, 16, 19,\r\n  6, 13, 18, 21,\r\n  7, 14, 21, 25,\r\n  8, 16, 20, 25,\r\n  8, 17, 23, 25,\r\n  9, 17, 23, 34,\r\n  9, 18, 25, 30,\r\n  10, 20, 27, 32,\r\n  12, 21, 29, 35,\r\n  12, 23, 34, 37,\r\n  12, 25, 34, 40,\r\n  13, 26, 35, 42,\r\n  14, 28, 38, 45,\r\n  15, 29, 40, 48,\r\n  16, 31, 43, 51,\r\n  17, 33, 45, 54,\r\n  18, 35, 48, 57,\r\n  19, 37, 51, 60,\r\n  19, 38, 53, 63,\r\n  20, 40, 56, 66,\r\n  21, 43, 59, 70,\r\n  22, 45, 62, 74,\r\n  24, 47, 65, 77,\r\n  25, 49, 68, 81\r\n]\r\n\r\nconst EC_CODEWORDS_TABLE = [\r\n// L  M  Q  H\r\n  7, 10, 13, 17,\r\n  10, 16, 22, 28,\r\n  15, 26, 36, 44,\r\n  20, 36, 52, 64,\r\n  26, 48, 72, 88,\r\n  36, 64, 96, 112,\r\n  40, 72, 108, 130,\r\n  48, 88, 132, 156,\r\n  60, 110, 160, 192,\r\n  72, 130, 192, 224,\r\n  80, 150, 224, 264,\r\n  96, 176, 260, 308,\r\n  104, 198, 288, 352,\r\n  120, 216, 320, 384,\r\n  132, 240, 360, 432,\r\n  144, 280, 408, 480,\r\n  168, 308, 448, 532,\r\n  180, 338, 504, 588,\r\n  196, 364, 546, 650,\r\n  224, 416, 600, 700,\r\n  224, 442, 644, 750,\r\n  252, 476, 690, 816,\r\n  270, 504, 750, 900,\r\n  300, 560, 810, 960,\r\n  312, 588, 870, 1050,\r\n  336, 644, 952, 1110,\r\n  360, 700, 1020, 1200,\r\n  390, 728, 1050, 1260,\r\n  420, 784, 1140, 1350,\r\n  450, 812, 1200, 1440,\r\n  480, 868, 1290, 1530,\r\n  510, 924, 1350, 1620,\r\n  540, 980, 1440, 1710,\r\n  570, 1036, 1530, 1800,\r\n  570, 1064, 1590, 1890,\r\n  600, 1120, 1680, 1980,\r\n  630, 1204, 1770, 2100,\r\n  660, 1260, 1860, 2220,\r\n  720, 1316, 1950, 2310,\r\n  750, 1372, 2040, 2430\r\n]\r\n\r\n/**\r\n * Returns the number of error correction block that the QR Code should contain\r\n * for the specified version and error correction level.\r\n *\r\n * @param  {Number} version              QR Code version\r\n * @param  {Number} errorCorrectionLevel Error correction level\r\n * @return {Number}                      Number of error correction blocks\r\n */\r\nexports.getBlocksCount = function getBlocksCount (version, errorCorrectionLevel) {\r\n  switch (errorCorrectionLevel) {\r\n    case ECLevel.L:\r\n      return EC_BLOCKS_TABLE[(version - 1) * 4 + 0]\r\n    case ECLevel.M:\r\n      return EC_BLOCKS_TABLE[(version - 1) * 4 + 1]\r\n    case ECLevel.Q:\r\n      return EC_BLOCKS_TABLE[(version - 1) * 4 + 2]\r\n    case ECLevel.H:\r\n      return EC_BLOCKS_TABLE[(version - 1) * 4 + 3]\r\n    default:\r\n      return undefined\r\n  }\r\n}\r\n\r\n/**\r\n * Returns the number of error correction codewords to use for the specified\r\n * version and error correction level.\r\n *\r\n * @param  {Number} version              QR Code version\r\n * @param  {Number} errorCorrectionLevel Error correction level\r\n * @return {Number}                      Number of error correction codewords\r\n */\r\nexports.getTotalCodewordsCount = function getTotalCodewordsCount (version, errorCorrectionLevel) {\r\n  switch (errorCorrectionLevel) {\r\n    case ECLevel.L:\r\n      return EC_CODEWORDS_TABLE[(version - 1) * 4 + 0]\r\n    case ECLevel.M:\r\n      return EC_CODEWORDS_TABLE[(version - 1) * 4 + 1]\r\n    case ECLevel.Q:\r\n      return EC_CODEWORDS_TABLE[(version - 1) * 4 + 2]\r\n    case ECLevel.H:\r\n      return EC_CODEWORDS_TABLE[(version - 1) * 4 + 3]\r\n    default:\r\n      return undefined\r\n  }\r\n}\r\n","exports.L = { bit: 1 }\nexports.M = { bit: 0 }\nexports.Q = { bit: 3 }\nexports.H = { bit: 2 }\n\nfunction fromString (string) {\n  if (typeof string !== 'string') {\n    throw new Error('Param is not a string')\n  }\n\n  const lcStr = string.toLowerCase()\n\n  switch (lcStr) {\n    case 'l':\n    case 'low':\n      return exports.L\n\n    case 'm':\n    case 'medium':\n      return exports.M\n\n    case 'q':\n    case 'quartile':\n      return exports.Q\n\n    case 'h':\n    case 'high':\n      return exports.H\n\n    default:\n      throw new Error('Unknown EC Level: ' + string)\n  }\n}\n\nexports.isValid = function isValid (level) {\n  return level && typeof level.bit !== 'undefined' &&\n    level.bit >= 0 && level.bit < 4\n}\n\nexports.from = function from (value, defaultValue) {\n  if (exports.isValid(value)) {\n    return value\n  }\n\n  try {\n    return fromString(value)\n  } catch (e) {\n    return defaultValue\n  }\n}\n","const getSymbolSize = require('./utils').getSymbolSize\nconst FINDER_PATTERN_SIZE = 7\n\n/**\n * Returns an array containing the positions of each finder pattern.\n * Each array's element represent the top-left point of the pattern as (x, y) coordinates\n *\n * @param  {Number} version QR Code version\n * @return {Array}          Array of coordinates\n */\nexports.getPositions = function getPositions (version) {\n  const size = getSymbolSize(version)\n\n  return [\n    // top-left\n    [0, 0],\n    // top-right\n    [size - FINDER_PATTERN_SIZE, 0],\n    // bottom-left\n    [0, size - FINDER_PATTERN_SIZE]\n  ]\n}\n","const Utils = require('./utils')\n\nconst G15 = (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0)\nconst G15_MASK = (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1)\nconst G15_BCH = Utils.getBCHDigit(G15)\n\n/**\n * Returns format information with relative error correction bits\n *\n * The format information is a 15-bit sequence containing 5 data bits,\n * with 10 error correction bits calculated using the (15, 5) BCH code.\n *\n * @param  {Number} errorCorrectionLevel Error correction level\n * @param  {Number} mask                 Mask pattern\n * @return {Number}                      Encoded format information bits\n */\nexports.getEncodedBits = function getEncodedBits (errorCorrectionLevel, mask) {\n  const data = ((errorCorrectionLevel.bit << 3) | mask)\n  let d = data << 10\n\n  while (Utils.getBCHDigit(d) - G15_BCH >= 0) {\n    d ^= (G15 << (Utils.getBCHDigit(d) - G15_BCH))\n  }\n\n  // xor final data with mask pattern in order to ensure that\n  // no combination of Error Correction Level and data mask pattern\n  // will result in an all-zero data string\n  return ((data << 10) | d) ^ G15_MASK\n}\n","const EXP_TABLE = new Uint8Array(512)\nconst LOG_TABLE = new Uint8Array(256)\n/**\n * Precompute the log and anti-log tables for faster computation later\n *\n * For each possible value in the galois field 2^8, we will pre-compute\n * the logarithm and anti-logarithm (exponential) of this value\n *\n * ref {@link https://en.wikiversity.org/wiki/Reed%E2%80%93Solomon_codes_for_coders#Introduction_to_mathematical_fields}\n */\n;(function initTables () {\n  let x = 1\n  for (let i = 0; i < 255; i++) {\n    EXP_TABLE[i] = x\n    LOG_TABLE[x] = i\n\n    x <<= 1 // multiply by 2\n\n    // The QR code specification says to use byte-wise modulo 100011101 arithmetic.\n    // This means that when a number is 256 or larger, it should be XORed with 0x11D.\n    if (x & 0x100) { // similar to x >= 256, but a lot faster (because 0x100 == 256)\n      x ^= 0x11D\n    }\n  }\n\n  // Optimization: double the size of the anti-log table so that we don't need to mod 255 to\n  // stay inside the bounds (because we will mainly use this table for the multiplication of\n  // two GF numbers, no more).\n  // @see {@link mul}\n  for (let i = 255; i < 512; i++) {\n    EXP_TABLE[i] = EXP_TABLE[i - 255]\n  }\n}())\n\n/**\n * Returns log value of n inside Galois Field\n *\n * @param  {Number} n\n * @return {Number}\n */\nexports.log = function log (n) {\n  if (n < 1) throw new Error('log(' + n + ')')\n  return LOG_TABLE[n]\n}\n\n/**\n * Returns anti-log value of n inside Galois Field\n *\n * @param  {Number} n\n * @return {Number}\n */\nexports.exp = function exp (n) {\n  return EXP_TABLE[n]\n}\n\n/**\n * Multiplies two number inside Galois Field\n *\n * @param  {Number} x\n * @param  {Number} y\n * @return {Number}\n */\nexports.mul = function mul (x, y) {\n  if (x === 0 || y === 0) return 0\n\n  // should be EXP_TABLE[(LOG_TABLE[x] + LOG_TABLE[y]) % 255] if EXP_TABLE wasn't oversized\n  // @see {@link initTables}\n  return EXP_TABLE[LOG_TABLE[x] + LOG_TABLE[y]]\n}\n","const Mode = require('./mode')\nconst Utils = require('./utils')\n\nfunction KanjiData (data) {\n  this.mode = Mode.KANJI\n  this.data = data\n}\n\nKanjiData.getBitsLength = function getBitsLength (length) {\n  return length * 13\n}\n\nKanjiData.prototype.getLength = function getLength () {\n  return this.data.length\n}\n\nKanjiData.prototype.getBitsLength = function getBitsLength () {\n  return KanjiData.getBitsLength(this.data.length)\n}\n\nKanjiData.prototype.write = function (bitBuffer) {\n  let i\n\n  // In the Shift JIS system, Kanji characters are represented by a two byte combination.\n  // These byte values are shifted from the JIS X 0208 values.\n  // JIS X 0208 gives details of the shift coded representation.\n  for (i = 0; i < this.data.length; i++) {\n    let value = Utils.toSJIS(this.data[i])\n\n    // For characters with Shift JIS values from 0x8140 to 0x9FFC:\n    if (value >= 0x8140 && value <= 0x9FFC) {\n      // Subtract 0x8140 from Shift JIS value\n      value -= 0x8140\n\n    // For characters with Shift JIS values from 0xE040 to 0xEBBF\n    } else if (value >= 0xE040 && value <= 0xEBBF) {\n      // Subtract 0xC140 from Shift JIS value\n      value -= 0xC140\n    } else {\n      throw new Error(\n        'Invalid SJIS character: ' + this.data[i] + '\\n' +\n        'Make sure your charset is UTF-8')\n    }\n\n    // Multiply most significant byte of result by 0xC0\n    // and add least significant byte to product\n    value = (((value >>> 8) & 0xff) * 0xC0) + (value & 0xff)\n\n    // Convert result to a 13-bit binary string\n    bitBuffer.put(value, 13)\n  }\n}\n\nmodule.exports = KanjiData\n","/**\n * Data mask pattern reference\n * @type {Object}\n */\nexports.Patterns = {\n  PATTERN000: 0,\n  PATTERN001: 1,\n  PATTERN010: 2,\n  PATTERN011: 3,\n  PATTERN100: 4,\n  PATTERN101: 5,\n  PATTERN110: 6,\n  PATTERN111: 7\n}\n\n/**\n * Weighted penalty scores for the undesirable features\n * @type {Object}\n */\nconst PenaltyScores = {\n  N1: 3,\n  N2: 3,\n  N3: 40,\n  N4: 10\n}\n\n/**\n * Check if mask pattern value is valid\n *\n * @param  {Number}  mask    Mask pattern\n * @return {Boolean}         true if valid, false otherwise\n */\nexports.isValid = function isValid (mask) {\n  return mask != null && mask !== '' && !isNaN(mask) && mask >= 0 && mask <= 7\n}\n\n/**\n * Returns mask pattern from a value.\n * If value is not valid, returns undefined\n *\n * @param  {Number|String} value        Mask pattern value\n * @return {Number}                     Valid mask pattern or undefined\n */\nexports.from = function from (value) {\n  return exports.isValid(value) ? parseInt(value, 10) : undefined\n}\n\n/**\n* Find adjacent modules in row/column with the same color\n* and assign a penalty value.\n*\n* Points: N1 + i\n* i is the amount by which the number of adjacent modules of the same color exceeds 5\n*/\nexports.getPenaltyN1 = function getPenaltyN1 (data) {\n  const size = data.size\n  let points = 0\n  let sameCountCol = 0\n  let sameCountRow = 0\n  let lastCol = null\n  let lastRow = null\n\n  for (let row = 0; row < size; row++) {\n    sameCountCol = sameCountRow = 0\n    lastCol = lastRow = null\n\n    for (let col = 0; col < size; col++) {\n      let module = data.get(row, col)\n      if (module === lastCol) {\n        sameCountCol++\n      } else {\n        if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5)\n        lastCol = module\n        sameCountCol = 1\n      }\n\n      module = data.get(col, row)\n      if (module === lastRow) {\n        sameCountRow++\n      } else {\n        if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5)\n        lastRow = module\n        sameCountRow = 1\n      }\n    }\n\n    if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5)\n    if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5)\n  }\n\n  return points\n}\n\n/**\n * Find 2x2 blocks with the same color and assign a penalty value\n *\n * Points: N2 * (m - 1) * (n - 1)\n */\nexports.getPenaltyN2 = function getPenaltyN2 (data) {\n  const size = data.size\n  let points = 0\n\n  for (let row = 0; row < size - 1; row++) {\n    for (let col = 0; col < size - 1; col++) {\n      const last = data.get(row, col) +\n        data.get(row, col + 1) +\n        data.get(row + 1, col) +\n        data.get(row + 1, col + 1)\n\n      if (last === 4 || last === 0) points++\n    }\n  }\n\n  return points * PenaltyScores.N2\n}\n\n/**\n * Find 1:1:3:1:1 ratio (dark:light:dark:light:dark) pattern in row/column,\n * preceded or followed by light area 4 modules wide\n *\n * Points: N3 * number of pattern found\n */\nexports.getPenaltyN3 = function getPenaltyN3 (data) {\n  const size = data.size\n  let points = 0\n  let bitsCol = 0\n  let bitsRow = 0\n\n  for (let row = 0; row < size; row++) {\n    bitsCol = bitsRow = 0\n    for (let col = 0; col < size; col++) {\n      bitsCol = ((bitsCol << 1) & 0x7FF) | data.get(row, col)\n      if (col >= 10 && (bitsCol === 0x5D0 || bitsCol === 0x05D)) points++\n\n      bitsRow = ((bitsRow << 1) & 0x7FF) | data.get(col, row)\n      if (col >= 10 && (bitsRow === 0x5D0 || bitsRow === 0x05D)) points++\n    }\n  }\n\n  return points * PenaltyScores.N3\n}\n\n/**\n * Calculate proportion of dark modules in entire symbol\n *\n * Points: N4 * k\n *\n * k is the rating of the deviation of the proportion of dark modules\n * in the symbol from 50% in steps of 5%\n */\nexports.getPenaltyN4 = function getPenaltyN4 (data) {\n  let darkCount = 0\n  const modulesCount = data.data.length\n\n  for (let i = 0; i < modulesCount; i++) darkCount += data.data[i]\n\n  const k = Math.abs(Math.ceil((darkCount * 100 / modulesCount) / 5) - 10)\n\n  return k * PenaltyScores.N4\n}\n\n/**\n * Return mask value at given position\n *\n * @param  {Number} maskPattern Pattern reference value\n * @param  {Number} i           Row\n * @param  {Number} j           Column\n * @return {Boolean}            Mask value\n */\nfunction getMaskAt (maskPattern, i, j) {\n  switch (maskPattern) {\n    case exports.Patterns.PATTERN000: return (i + j) % 2 === 0\n    case exports.Patterns.PATTERN001: return i % 2 === 0\n    case exports.Patterns.PATTERN010: return j % 3 === 0\n    case exports.Patterns.PATTERN011: return (i + j) % 3 === 0\n    case exports.Patterns.PATTERN100: return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 === 0\n    case exports.Patterns.PATTERN101: return (i * j) % 2 + (i * j) % 3 === 0\n    case exports.Patterns.PATTERN110: return ((i * j) % 2 + (i * j) % 3) % 2 === 0\n    case exports.Patterns.PATTERN111: return ((i * j) % 3 + (i + j) % 2) % 2 === 0\n\n    default: throw new Error('bad maskPattern:' + maskPattern)\n  }\n}\n\n/**\n * Apply a mask pattern to a BitMatrix\n *\n * @param  {Number}    pattern Pattern reference number\n * @param  {BitMatrix} data    BitMatrix data\n */\nexports.applyMask = function applyMask (pattern, data) {\n  const size = data.size\n\n  for (let col = 0; col < size; col++) {\n    for (let row = 0; row < size; row++) {\n      if (data.isReserved(row, col)) continue\n      data.xor(row, col, getMaskAt(pattern, row, col))\n    }\n  }\n}\n\n/**\n * Returns the best mask pattern for data\n *\n * @param  {BitMatrix} data\n * @return {Number} Mask pattern reference number\n */\nexports.getBestMask = function getBestMask (data, setupFormatFunc) {\n  const numPatterns = Object.keys(exports.Patterns).length\n  let bestPattern = 0\n  let lowerPenalty = Infinity\n\n  for (let p = 0; p < numPatterns; p++) {\n    setupFormatFunc(p)\n    exports.applyMask(p, data)\n\n    // Calculate penalty\n    const penalty =\n      exports.getPenaltyN1(data) +\n      exports.getPenaltyN2(data) +\n      exports.getPenaltyN3(data) +\n      exports.getPenaltyN4(data)\n\n    // Undo previously applied mask\n    exports.applyMask(p, data)\n\n    if (penalty < lowerPenalty) {\n      lowerPenalty = penalty\n      bestPattern = p\n    }\n  }\n\n  return bestPattern\n}\n","const VersionCheck = require('./version-check')\nconst Regex = require('./regex')\n\n/**\n * Numeric mode encodes data from the decimal digit set (0 - 9)\n * (byte values 30HEX to 39HEX).\n * Normally, 3 data characters are represented by 10 bits.\n *\n * @type {Object}\n */\nexports.NUMERIC = {\n  id: 'Numeric',\n  bit: 1 << 0,\n  ccBits: [10, 12, 14]\n}\n\n/**\n * Alphanumeric mode encodes data from a set of 45 characters,\n * i.e. 10 numeric digits (0 - 9),\n *      26 alphabetic characters (A - Z),\n *   and 9 symbols (SP, $, %, *, +, -, ., /, :).\n * Normally, two input characters are represented by 11 bits.\n *\n * @type {Object}\n */\nexports.ALPHANUMERIC = {\n  id: 'Alphanumeric',\n  bit: 1 << 1,\n  ccBits: [9, 11, 13]\n}\n\n/**\n * In byte mode, data is encoded at 8 bits per character.\n *\n * @type {Object}\n */\nexports.BYTE = {\n  id: 'Byte',\n  bit: 1 << 2,\n  ccBits: [8, 16, 16]\n}\n\n/**\n * The Kanji mode efficiently encodes Kanji characters in accordance with\n * the Shift JIS system based on JIS X 0208.\n * The Shift JIS values are shifted from the JIS X 0208 values.\n * JIS X 0208 gives details of the shift coded representation.\n * Each two-byte character value is compacted to a 13-bit binary codeword.\n *\n * @type {Object}\n */\nexports.KANJI = {\n  id: 'Kanji',\n  bit: 1 << 3,\n  ccBits: [8, 10, 12]\n}\n\n/**\n * Mixed mode will contain a sequences of data in a combination of any of\n * the modes described above\n *\n * @type {Object}\n */\nexports.MIXED = {\n  bit: -1\n}\n\n/**\n * Returns the number of bits needed to store the data length\n * according to QR Code specifications.\n *\n * @param  {Mode}   mode    Data mode\n * @param  {Number} version QR Code version\n * @return {Number}         Number of bits\n */\nexports.getCharCountIndicator = function getCharCountIndicator (mode, version) {\n  if (!mode.ccBits) throw new Error('Invalid mode: ' + mode)\n\n  if (!VersionCheck.isValid(version)) {\n    throw new Error('Invalid version: ' + version)\n  }\n\n  if (version >= 1 && version < 10) return mode.ccBits[0]\n  else if (version < 27) return mode.ccBits[1]\n  return mode.ccBits[2]\n}\n\n/**\n * Returns the most efficient mode to store the specified data\n *\n * @param  {String} dataStr Input data string\n * @return {Mode}           Best mode\n */\nexports.getBestModeForData = function getBestModeForData (dataStr) {\n  if (Regex.testNumeric(dataStr)) return exports.NUMERIC\n  else if (Regex.testAlphanumeric(dataStr)) return exports.ALPHANUMERIC\n  else if (Regex.testKanji(dataStr)) return exports.KANJI\n  else return exports.BYTE\n}\n\n/**\n * Return mode name as string\n *\n * @param {Mode} mode Mode object\n * @returns {String}  Mode name\n */\nexports.toString = function toString (mode) {\n  if (mode && mode.id) return mode.id\n  throw new Error('Invalid mode')\n}\n\n/**\n * Check if input param is a valid mode object\n *\n * @param   {Mode}    mode Mode object\n * @returns {Boolean} True if valid mode, false otherwise\n */\nexports.isValid = function isValid (mode) {\n  return mode && mode.bit && mode.ccBits\n}\n\n/**\n * Get mode object from its name\n *\n * @param   {String} string Mode name\n * @returns {Mode}          Mode object\n */\nfunction fromString (string) {\n  if (typeof string !== 'string') {\n    throw new Error('Param is not a string')\n  }\n\n  const lcStr = string.toLowerCase()\n\n  switch (lcStr) {\n    case 'numeric':\n      return exports.NUMERIC\n    case 'alphanumeric':\n      return exports.ALPHANUMERIC\n    case 'kanji':\n      return exports.KANJI\n    case 'byte':\n      return exports.BYTE\n    default:\n      throw new Error('Unknown mode: ' + string)\n  }\n}\n\n/**\n * Returns mode from a value.\n * If value is not a valid mode, returns defaultValue\n *\n * @param  {Mode|String} value        Encoding mode\n * @param  {Mode}        defaultValue Fallback value\n * @return {Mode}                     Encoding mode\n */\nexports.from = function from (value, defaultValue) {\n  if (exports.isValid(value)) {\n    return value\n  }\n\n  try {\n    return fromString(value)\n  } catch (e) {\n    return defaultValue\n  }\n}\n","const Mode = require('./mode')\n\nfunction NumericData (data) {\n  this.mode = Mode.NUMERIC\n  this.data = data.toString()\n}\n\nNumericData.getBitsLength = function getBitsLength (length) {\n  return 10 * Math.floor(length / 3) + ((length % 3) ? ((length % 3) * 3 + 1) : 0)\n}\n\nNumericData.prototype.getLength = function getLength () {\n  return this.data.length\n}\n\nNumericData.prototype.getBitsLength = function getBitsLength () {\n  return NumericData.getBitsLength(this.data.length)\n}\n\nNumericData.prototype.write = function write (bitBuffer) {\n  let i, group, value\n\n  // The input data string is divided into groups of three digits,\n  // and each group is converted to its 10-bit binary equivalent.\n  for (i = 0; i + 3 <= this.data.length; i += 3) {\n    group = this.data.substr(i, 3)\n    value = parseInt(group, 10)\n\n    bitBuffer.put(value, 10)\n  }\n\n  // If the number of input digits is not an exact multiple of three,\n  // the final one or two digits are converted to 4 or 7 bits respectively.\n  const remainingNum = this.data.length - i\n  if (remainingNum > 0) {\n    group = this.data.substr(i)\n    value = parseInt(group, 10)\n\n    bitBuffer.put(value, remainingNum * 3 + 1)\n  }\n}\n\nmodule.exports = NumericData\n","const GF = require('./galois-field')\n\n/**\n * Multiplies two polynomials inside Galois Field\n *\n * @param  {Uint8Array} p1 Polynomial\n * @param  {Uint8Array} p2 Polynomial\n * @return {Uint8Array}    Product of p1 and p2\n */\nexports.mul = function mul (p1, p2) {\n  const coeff = new Uint8Array(p1.length + p2.length - 1)\n\n  for (let i = 0; i < p1.length; i++) {\n    for (let j = 0; j < p2.length; j++) {\n      coeff[i + j] ^= GF.mul(p1[i], p2[j])\n    }\n  }\n\n  return coeff\n}\n\n/**\n * Calculate the remainder of polynomials division\n *\n * @param  {Uint8Array} divident Polynomial\n * @param  {Uint8Array} divisor  Polynomial\n * @return {Uint8Array}          Remainder\n */\nexports.mod = function mod (divident, divisor) {\n  let result = new Uint8Array(divident)\n\n  while ((result.length - divisor.length) >= 0) {\n    const coeff = result[0]\n\n    for (let i = 0; i < divisor.length; i++) {\n      result[i] ^= GF.mul(divisor[i], coeff)\n    }\n\n    // remove all zeros from buffer head\n    let offset = 0\n    while (offset < result.length && result[offset] === 0) offset++\n    result = result.slice(offset)\n  }\n\n  return result\n}\n\n/**\n * Generate an irreducible generator polynomial of specified degree\n * (used by Reed-Solomon encoder)\n *\n * @param  {Number} degree Degree of the generator polynomial\n * @return {Uint8Array}    Buffer containing polynomial coefficients\n */\nexports.generateECPolynomial = function generateECPolynomial (degree) {\n  let poly = new Uint8Array([1])\n  for (let i = 0; i < degree; i++) {\n    poly = exports.mul(poly, new Uint8Array([1, GF.exp(i)]))\n  }\n\n  return poly\n}\n","const Utils = require('./utils')\nconst ECLevel = require('./error-correction-level')\nconst BitBuffer = require('./bit-buffer')\nconst BitMatrix = require('./bit-matrix')\nconst AlignmentPattern = require('./alignment-pattern')\nconst FinderPattern = require('./finder-pattern')\nconst MaskPattern = require('./mask-pattern')\nconst ECCode = require('./error-correction-code')\nconst ReedSolomonEncoder = require('./reed-solomon-encoder')\nconst Version = require('./version')\nconst FormatInfo = require('./format-info')\nconst Mode = require('./mode')\nconst Segments = require('./segments')\n\n/**\n * QRCode for JavaScript\n *\n * modified by Ryan Day for nodejs support\n * Copyright (c) 2011 Ryan Day\n *\n * Licensed under the MIT license:\n *   http://www.opensource.org/licenses/mit-license.php\n *\n//---------------------------------------------------------------------\n// QRCode for JavaScript\n//\n// Copyright (c) 2009 Kazuhiko Arase\n//\n// URL: http://www.d-project.com/\n//\n// Licensed under the MIT license:\n//   http://www.opensource.org/licenses/mit-license.php\n//\n// The word \"QR Code\" is registered trademark of\n// DENSO WAVE INCORPORATED\n//   http://www.denso-wave.com/qrcode/faqpatent-e.html\n//\n//---------------------------------------------------------------------\n*/\n\n/**\n * Add finder patterns bits to matrix\n *\n * @param  {BitMatrix} matrix  Modules matrix\n * @param  {Number}    version QR Code version\n */\nfunction setupFinderPattern (matrix, version) {\n  const size = matrix.size\n  const pos = FinderPattern.getPositions(version)\n\n  for (let i = 0; i < pos.length; i++) {\n    const row = pos[i][0]\n    const col = pos[i][1]\n\n    for (let r = -1; r <= 7; r++) {\n      if (row + r <= -1 || size <= row + r) continue\n\n      for (let c = -1; c <= 7; c++) {\n        if (col + c <= -1 || size <= col + c) continue\n\n        if ((r >= 0 && r <= 6 && (c === 0 || c === 6)) ||\n          (c >= 0 && c <= 6 && (r === 0 || r === 6)) ||\n          (r >= 2 && r <= 4 && c >= 2 && c <= 4)) {\n          matrix.set(row + r, col + c, true, true)\n        } else {\n          matrix.set(row + r, col + c, false, true)\n        }\n      }\n    }\n  }\n}\n\n/**\n * Add timing pattern bits to matrix\n *\n * Note: this function must be called before {@link setupAlignmentPattern}\n *\n * @param  {BitMatrix} matrix Modules matrix\n */\nfunction setupTimingPattern (matrix) {\n  const size = matrix.size\n\n  for (let r = 8; r < size - 8; r++) {\n    const value = r % 2 === 0\n    matrix.set(r, 6, value, true)\n    matrix.set(6, r, value, true)\n  }\n}\n\n/**\n * Add alignment patterns bits to matrix\n *\n * Note: this function must be called after {@link setupTimingPattern}\n *\n * @param  {BitMatrix} matrix  Modules matrix\n * @param  {Number}    version QR Code version\n */\nfunction setupAlignmentPattern (matrix, version) {\n  const pos = AlignmentPattern.getPositions(version)\n\n  for (let i = 0; i < pos.length; i++) {\n    const row = pos[i][0]\n    const col = pos[i][1]\n\n    for (let r = -2; r <= 2; r++) {\n      for (let c = -2; c <= 2; c++) {\n        if (r === -2 || r === 2 || c === -2 || c === 2 ||\n          (r === 0 && c === 0)) {\n          matrix.set(row + r, col + c, true, true)\n        } else {\n          matrix.set(row + r, col + c, false, true)\n        }\n      }\n    }\n  }\n}\n\n/**\n * Add version info bits to matrix\n *\n * @param  {BitMatrix} matrix  Modules matrix\n * @param  {Number}    version QR Code version\n */\nfunction setupVersionInfo (matrix, version) {\n  const size = matrix.size\n  const bits = Version.getEncodedBits(version)\n  let row, col, mod\n\n  for (let i = 0; i < 18; i++) {\n    row = Math.floor(i / 3)\n    col = i % 3 + size - 8 - 3\n    mod = ((bits >> i) & 1) === 1\n\n    matrix.set(row, col, mod, true)\n    matrix.set(col, row, mod, true)\n  }\n}\n\n/**\n * Add format info bits to matrix\n *\n * @param  {BitMatrix} matrix               Modules matrix\n * @param  {ErrorCorrectionLevel}    errorCorrectionLevel Error correction level\n * @param  {Number}    maskPattern          Mask pattern reference value\n */\nfunction setupFormatInfo (matrix, errorCorrectionLevel, maskPattern) {\n  const size = matrix.size\n  const bits = FormatInfo.getEncodedBits(errorCorrectionLevel, maskPattern)\n  let i, mod\n\n  for (i = 0; i < 15; i++) {\n    mod = ((bits >> i) & 1) === 1\n\n    // vertical\n    if (i < 6) {\n      matrix.set(i, 8, mod, true)\n    } else if (i < 8) {\n      matrix.set(i + 1, 8, mod, true)\n    } else {\n      matrix.set(size - 15 + i, 8, mod, true)\n    }\n\n    // horizontal\n    if (i < 8) {\n      matrix.set(8, size - i - 1, mod, true)\n    } else if (i < 9) {\n      matrix.set(8, 15 - i - 1 + 1, mod, true)\n    } else {\n      matrix.set(8, 15 - i - 1, mod, true)\n    }\n  }\n\n  // fixed module\n  matrix.set(size - 8, 8, 1, true)\n}\n\n/**\n * Add encoded data bits to matrix\n *\n * @param  {BitMatrix}  matrix Modules matrix\n * @param  {Uint8Array} data   Data codewords\n */\nfunction setupData (matrix, data) {\n  const size = matrix.size\n  let inc = -1\n  let row = size - 1\n  let bitIndex = 7\n  let byteIndex = 0\n\n  for (let col = size - 1; col > 0; col -= 2) {\n    if (col === 6) col--\n\n    while (true) {\n      for (let c = 0; c < 2; c++) {\n        if (!matrix.isReserved(row, col - c)) {\n          let dark = false\n\n          if (byteIndex < data.length) {\n            dark = (((data[byteIndex] >>> bitIndex) & 1) === 1)\n          }\n\n          matrix.set(row, col - c, dark)\n          bitIndex--\n\n          if (bitIndex === -1) {\n            byteIndex++\n            bitIndex = 7\n          }\n        }\n      }\n\n      row += inc\n\n      if (row < 0 || size <= row) {\n        row -= inc\n        inc = -inc\n        break\n      }\n    }\n  }\n}\n\n/**\n * Create encoded codewords from data input\n *\n * @param  {Number}   version              QR Code version\n * @param  {ErrorCorrectionLevel}   errorCorrectionLevel Error correction level\n * @param  {ByteData} data                 Data input\n * @return {Uint8Array}                    Buffer containing encoded codewords\n */\nfunction createData (version, errorCorrectionLevel, segments) {\n  // Prepare data buffer\n  const buffer = new BitBuffer()\n\n  segments.forEach(function (data) {\n    // prefix data with mode indicator (4 bits)\n    buffer.put(data.mode.bit, 4)\n\n    // Prefix data with character count indicator.\n    // The character count indicator is a string of bits that represents the\n    // number of characters that are being encoded.\n    // The character count indicator must be placed after the mode indicator\n    // and must be a certain number of bits long, depending on the QR version\n    // and data mode\n    // @see {@link Mode.getCharCountIndicator}.\n    buffer.put(data.getLength(), Mode.getCharCountIndicator(data.mode, version))\n\n    // add binary data sequence to buffer\n    data.write(buffer)\n  })\n\n  // Calculate required number of bits\n  const totalCodewords = Utils.getSymbolTotalCodewords(version)\n  const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n  const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8\n\n  // Add a terminator.\n  // If the bit string is shorter than the total number of required bits,\n  // a terminator of up to four 0s must be added to the right side of the string.\n  // If the bit string is more than four bits shorter than the required number of bits,\n  // add four 0s to the end.\n  if (buffer.getLengthInBits() + 4 <= dataTotalCodewordsBits) {\n    buffer.put(0, 4)\n  }\n\n  // If the bit string is fewer than four bits shorter, add only the number of 0s that\n  // are needed to reach the required number of bits.\n\n  // After adding the terminator, if the number of bits in the string is not a multiple of 8,\n  // pad the string on the right with 0s to make the string's length a multiple of 8.\n  while (buffer.getLengthInBits() % 8 !== 0) {\n    buffer.putBit(0)\n  }\n\n  // Add pad bytes if the string is still shorter than the total number of required bits.\n  // Extend the buffer to fill the data capacity of the symbol corresponding to\n  // the Version and Error Correction Level by adding the Pad Codewords 11101100 (0xEC)\n  // and 00010001 (0x11) alternately.\n  const remainingByte = (dataTotalCodewordsBits - buffer.getLengthInBits()) / 8\n  for (let i = 0; i < remainingByte; i++) {\n    buffer.put(i % 2 ? 0x11 : 0xEC, 8)\n  }\n\n  return createCodewords(buffer, version, errorCorrectionLevel)\n}\n\n/**\n * Encode input data with Reed-Solomon and return codewords with\n * relative error correction bits\n *\n * @param  {BitBuffer} bitBuffer            Data to encode\n * @param  {Number}    version              QR Code version\n * @param  {ErrorCorrectionLevel} errorCorrectionLevel Error correction level\n * @return {Uint8Array}                     Buffer containing encoded codewords\n */\nfunction createCodewords (bitBuffer, version, errorCorrectionLevel) {\n  // Total codewords for this QR code version (Data + Error correction)\n  const totalCodewords = Utils.getSymbolTotalCodewords(version)\n\n  // Total number of error correction codewords\n  const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n\n  // Total number of data codewords\n  const dataTotalCodewords = totalCodewords - ecTotalCodewords\n\n  // Total number of blocks\n  const ecTotalBlocks = ECCode.getBlocksCount(version, errorCorrectionLevel)\n\n  // Calculate how many blocks each group should contain\n  const blocksInGroup2 = totalCodewords % ecTotalBlocks\n  const blocksInGroup1 = ecTotalBlocks - blocksInGroup2\n\n  const totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks)\n\n  const dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks)\n  const dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1\n\n  // Number of EC codewords is the same for both groups\n  const ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1\n\n  // Initialize a Reed-Solomon encoder with a generator polynomial of degree ecCount\n  const rs = new ReedSolomonEncoder(ecCount)\n\n  let offset = 0\n  const dcData = new Array(ecTotalBlocks)\n  const ecData = new Array(ecTotalBlocks)\n  let maxDataSize = 0\n  const buffer = new Uint8Array(bitBuffer.buffer)\n\n  // Divide the buffer into the required number of blocks\n  for (let b = 0; b < ecTotalBlocks; b++) {\n    const dataSize = b < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2\n\n    // extract a block of data from buffer\n    dcData[b] = buffer.slice(offset, offset + dataSize)\n\n    // Calculate EC codewords for this data block\n    ecData[b] = rs.encode(dcData[b])\n\n    offset += dataSize\n    maxDataSize = Math.max(maxDataSize, dataSize)\n  }\n\n  // Create final data\n  // Interleave the data and error correction codewords from each block\n  const data = new Uint8Array(totalCodewords)\n  let index = 0\n  let i, r\n\n  // Add data codewords\n  for (i = 0; i < maxDataSize; i++) {\n    for (r = 0; r < ecTotalBlocks; r++) {\n      if (i < dcData[r].length) {\n        data[index++] = dcData[r][i]\n      }\n    }\n  }\n\n  // Apped EC codewords\n  for (i = 0; i < ecCount; i++) {\n    for (r = 0; r < ecTotalBlocks; r++) {\n      data[index++] = ecData[r][i]\n    }\n  }\n\n  return data\n}\n\n/**\n * Build QR Code symbol\n *\n * @param  {String} data                 Input string\n * @param  {Number} version              QR Code version\n * @param  {ErrorCorretionLevel} errorCorrectionLevel Error level\n * @param  {MaskPattern} maskPattern     Mask pattern\n * @return {Object}                      Object containing symbol data\n */\nfunction createSymbol (data, version, errorCorrectionLevel, maskPattern) {\n  let segments\n\n  if (Array.isArray(data)) {\n    segments = Segments.fromArray(data)\n  } else if (typeof data === 'string') {\n    let estimatedVersion = version\n\n    if (!estimatedVersion) {\n      const rawSegments = Segments.rawSplit(data)\n\n      // Estimate best version that can contain raw splitted segments\n      estimatedVersion = Version.getBestVersionForData(rawSegments, errorCorrectionLevel)\n    }\n\n    // Build optimized segments\n    // If estimated version is undefined, try with the highest version\n    segments = Segments.fromString(data, estimatedVersion || 40)\n  } else {\n    throw new Error('Invalid data')\n  }\n\n  // Get the min version that can contain data\n  const bestVersion = Version.getBestVersionForData(segments, errorCorrectionLevel)\n\n  // If no version is found, data cannot be stored\n  if (!bestVersion) {\n    throw new Error('The amount of data is too big to be stored in a QR Code')\n  }\n\n  // If not specified, use min version as default\n  if (!version) {\n    version = bestVersion\n\n  // Check if the specified version can contain the data\n  } else if (version < bestVersion) {\n    throw new Error('\\n' +\n      'The chosen QR Code version cannot contain this amount of data.\\n' +\n      'Minimum version required to store current data is: ' + bestVersion + '.\\n'\n    )\n  }\n\n  const dataBits = createData(version, errorCorrectionLevel, segments)\n\n  // Allocate matrix buffer\n  const moduleCount = Utils.getSymbolSize(version)\n  const modules = new BitMatrix(moduleCount)\n\n  // Add function modules\n  setupFinderPattern(modules, version)\n  setupTimingPattern(modules)\n  setupAlignmentPattern(modules, version)\n\n  // Add temporary dummy bits for format info just to set them as reserved.\n  // This is needed to prevent these bits from being masked by {@link MaskPattern.applyMask}\n  // since the masking operation must be performed only on the encoding region.\n  // These blocks will be replaced with correct values later in code.\n  setupFormatInfo(modules, errorCorrectionLevel, 0)\n\n  if (version >= 7) {\n    setupVersionInfo(modules, version)\n  }\n\n  // Add data codewords\n  setupData(modules, dataBits)\n\n  if (isNaN(maskPattern)) {\n    // Find best mask pattern\n    maskPattern = MaskPattern.getBestMask(modules,\n      setupFormatInfo.bind(null, modules, errorCorrectionLevel))\n  }\n\n  // Apply mask pattern\n  MaskPattern.applyMask(maskPattern, modules)\n\n  // Replace format info bits with correct values\n  setupFormatInfo(modules, errorCorrectionLevel, maskPattern)\n\n  return {\n    modules: modules,\n    version: version,\n    errorCorrectionLevel: errorCorrectionLevel,\n    maskPattern: maskPattern,\n    segments: segments\n  }\n}\n\n/**\n * QR Code\n *\n * @param {String | Array} data                 Input data\n * @param {Object} options                      Optional configurations\n * @param {Number} options.version              QR Code version\n * @param {String} options.errorCorrectionLevel Error correction level\n * @param {Function} options.toSJISFunc         Helper func to convert utf8 to sjis\n */\nexports.create = function create (data, options) {\n  if (typeof data === 'undefined' || data === '') {\n    throw new Error('No input text')\n  }\n\n  let errorCorrectionLevel = ECLevel.M\n  let version\n  let mask\n\n  if (typeof options !== 'undefined') {\n    // Use higher error correction level as default\n    errorCorrectionLevel = ECLevel.from(options.errorCorrectionLevel, ECLevel.M)\n    version = Version.from(options.version)\n    mask = MaskPattern.from(options.maskPattern)\n\n    if (options.toSJISFunc) {\n      Utils.setToSJISFunction(options.toSJISFunc)\n    }\n  }\n\n  return createSymbol(data, version, errorCorrectionLevel, mask)\n}\n","const Polynomial = require('./polynomial')\n\nfunction ReedSolomonEncoder (degree) {\n  this.genPoly = undefined\n  this.degree = degree\n\n  if (this.degree) this.initialize(this.degree)\n}\n\n/**\n * Initialize the encoder.\n * The input param should correspond to the number of error correction codewords.\n *\n * @param  {Number} degree\n */\nReedSolomonEncoder.prototype.initialize = function initialize (degree) {\n  // create an irreducible generator polynomial\n  this.degree = degree\n  this.genPoly = Polynomial.generateECPolynomial(this.degree)\n}\n\n/**\n * Encodes a chunk of data\n *\n * @param  {Uint8Array} data Buffer containing input data\n * @return {Uint8Array}      Buffer containing encoded data\n */\nReedSolomonEncoder.prototype.encode = function encode (data) {\n  if (!this.genPoly) {\n    throw new Error('Encoder not initialized')\n  }\n\n  // Calculate EC for this data block\n  // extends data size to data+genPoly size\n  const paddedData = new Uint8Array(data.length + this.degree)\n  paddedData.set(data)\n\n  // The error correction codewords are the remainder after dividing the data codewords\n  // by a generator polynomial\n  const remainder = Polynomial.mod(paddedData, this.genPoly)\n\n  // return EC data blocks (last n byte, where n is the degree of genPoly)\n  // If coefficients number in remainder are less than genPoly degree,\n  // pad with 0s to the left to reach the needed number of coefficients\n  const start = this.degree - remainder.length\n  if (start > 0) {\n    const buff = new Uint8Array(this.degree)\n    buff.set(remainder, start)\n\n    return buff\n  }\n\n  return remainder\n}\n\nmodule.exports = ReedSolomonEncoder\n","const numeric = '[0-9]+'\nconst alphanumeric = '[A-Z $%*+\\\\-./:]+'\nlet kanji = '(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|' +\n  '[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|' +\n  '[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|' +\n  '[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+'\nkanji = kanji.replace(/u/g, '\\\\u')\n\nconst byte = '(?:(?![A-Z0-9 $%*+\\\\-./:]|' + kanji + ')(?:.|[\\r\\n]))+'\n\nexports.KANJI = new RegExp(kanji, 'g')\nexports.BYTE_KANJI = new RegExp('[^A-Z0-9 $%*+\\\\-./:]+', 'g')\nexports.BYTE = new RegExp(byte, 'g')\nexports.NUMERIC = new RegExp(numeric, 'g')\nexports.ALPHANUMERIC = new RegExp(alphanumeric, 'g')\n\nconst TEST_KANJI = new RegExp('^' + kanji + '$')\nconst TEST_NUMERIC = new RegExp('^' + numeric + '$')\nconst TEST_ALPHANUMERIC = new RegExp('^[A-Z0-9 $%*+\\\\-./:]+$')\n\nexports.testKanji = function testKanji (str) {\n  return TEST_KANJI.test(str)\n}\n\nexports.testNumeric = function testNumeric (str) {\n  return TEST_NUMERIC.test(str)\n}\n\nexports.testAlphanumeric = function testAlphanumeric (str) {\n  return TEST_ALPHANUMERIC.test(str)\n}\n","const Mode = require('./mode')\nconst NumericData = require('./numeric-data')\nconst AlphanumericData = require('./alphanumeric-data')\nconst ByteData = require('./byte-data')\nconst KanjiData = require('./kanji-data')\nconst Regex = require('./regex')\nconst Utils = require('./utils')\nconst dijkstra = require('dijkstrajs')\n\n/**\n * Returns UTF8 byte length\n *\n * @param  {String} str Input string\n * @return {Number}     Number of byte\n */\nfunction getStringByteLength (str) {\n  return unescape(encodeURIComponent(str)).length\n}\n\n/**\n * Get a list of segments of the specified mode\n * from a string\n *\n * @param  {Mode}   mode Segment mode\n * @param  {String} str  String to process\n * @return {Array}       Array of object with segments data\n */\nfunction getSegments (regex, mode, str) {\n  const segments = []\n  let result\n\n  while ((result = regex.exec(str)) !== null) {\n    segments.push({\n      data: result[0],\n      index: result.index,\n      mode: mode,\n      length: result[0].length\n    })\n  }\n\n  return segments\n}\n\n/**\n * Extracts a series of segments with the appropriate\n * modes from a string\n *\n * @param  {String} dataStr Input string\n * @return {Array}          Array of object with segments data\n */\nfunction getSegmentsFromString (dataStr) {\n  const numSegs = getSegments(Regex.NUMERIC, Mode.NUMERIC, dataStr)\n  const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode.ALPHANUMERIC, dataStr)\n  let byteSegs\n  let kanjiSegs\n\n  if (Utils.isKanjiModeEnabled()) {\n    byteSegs = getSegments(Regex.BYTE, Mode.BYTE, dataStr)\n    kanjiSegs = getSegments(Regex.KANJI, Mode.KANJI, dataStr)\n  } else {\n    byteSegs = getSegments(Regex.BYTE_KANJI, Mode.BYTE, dataStr)\n    kanjiSegs = []\n  }\n\n  const segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs)\n\n  return segs\n    .sort(function (s1, s2) {\n      return s1.index - s2.index\n    })\n    .map(function (obj) {\n      return {\n        data: obj.data,\n        mode: obj.mode,\n        length: obj.length\n      }\n    })\n}\n\n/**\n * Returns how many bits are needed to encode a string of\n * specified length with the specified mode\n *\n * @param  {Number} length String length\n * @param  {Mode} mode     Segment mode\n * @return {Number}        Bit length\n */\nfunction getSegmentBitsLength (length, mode) {\n  switch (mode) {\n    case Mode.NUMERIC:\n      return NumericData.getBitsLength(length)\n    case Mode.ALPHANUMERIC:\n      return AlphanumericData.getBitsLength(length)\n    case Mode.KANJI:\n      return KanjiData.getBitsLength(length)\n    case Mode.BYTE:\n      return ByteData.getBitsLength(length)\n  }\n}\n\n/**\n * Merges adjacent segments which have the same mode\n *\n * @param  {Array} segs Array of object with segments data\n * @return {Array}      Array of object with segments data\n */\nfunction mergeSegments (segs) {\n  return segs.reduce(function (acc, curr) {\n    const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null\n    if (prevSeg && prevSeg.mode === curr.mode) {\n      acc[acc.length - 1].data += curr.data\n      return acc\n    }\n\n    acc.push(curr)\n    return acc\n  }, [])\n}\n\n/**\n * Generates a list of all possible nodes combination which\n * will be used to build a segments graph.\n *\n * Nodes are divided by groups. Each group will contain a list of all the modes\n * in which is possible to encode the given text.\n *\n * For example the text '12345' can be encoded as Numeric, Alphanumeric or Byte.\n * The group for '12345' will contain then 3 objects, one for each\n * possible encoding mode.\n *\n * Each node represents a possible segment.\n *\n * @param  {Array} segs Array of object with segments data\n * @return {Array}      Array of object with segments data\n */\nfunction buildNodes (segs) {\n  const nodes = []\n  for (let i = 0; i < segs.length; i++) {\n    const seg = segs[i]\n\n    switch (seg.mode) {\n      case Mode.NUMERIC:\n        nodes.push([seg,\n          { data: seg.data, mode: Mode.ALPHANUMERIC, length: seg.length },\n          { data: seg.data, mode: Mode.BYTE, length: seg.length }\n        ])\n        break\n      case Mode.ALPHANUMERIC:\n        nodes.push([seg,\n          { data: seg.data, mode: Mode.BYTE, length: seg.length }\n        ])\n        break\n      case Mode.KANJI:\n        nodes.push([seg,\n          { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }\n        ])\n        break\n      case Mode.BYTE:\n        nodes.push([\n          { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }\n        ])\n    }\n  }\n\n  return nodes\n}\n\n/**\n * Builds a graph from a list of nodes.\n * All segments in each node group will be connected with all the segments of\n * the next group and so on.\n *\n * At each connection will be assigned a weight depending on the\n * segment's byte length.\n *\n * @param  {Array} nodes    Array of object with segments data\n * @param  {Number} version QR Code version\n * @return {Object}         Graph of all possible segments\n */\nfunction buildGraph (nodes, version) {\n  const table = {}\n  const graph = { start: {} }\n  let prevNodeIds = ['start']\n\n  for (let i = 0; i < nodes.length; i++) {\n    const nodeGroup = nodes[i]\n    const currentNodeIds = []\n\n    for (let j = 0; j < nodeGroup.length; j++) {\n      const node = nodeGroup[j]\n      const key = '' + i + j\n\n      currentNodeIds.push(key)\n      table[key] = { node: node, lastCount: 0 }\n      graph[key] = {}\n\n      for (let n = 0; n < prevNodeIds.length; n++) {\n        const prevNodeId = prevNodeIds[n]\n\n        if (table[prevNodeId] && table[prevNodeId].node.mode === node.mode) {\n          graph[prevNodeId][key] =\n            getSegmentBitsLength(table[prevNodeId].lastCount + node.length, node.mode) -\n            getSegmentBitsLength(table[prevNodeId].lastCount, node.mode)\n\n          table[prevNodeId].lastCount += node.length\n        } else {\n          if (table[prevNodeId]) table[prevNodeId].lastCount = node.length\n\n          graph[prevNodeId][key] = getSegmentBitsLength(node.length, node.mode) +\n            4 + Mode.getCharCountIndicator(node.mode, version) // switch cost\n        }\n      }\n    }\n\n    prevNodeIds = currentNodeIds\n  }\n\n  for (let n = 0; n < prevNodeIds.length; n++) {\n    graph[prevNodeIds[n]].end = 0\n  }\n\n  return { map: graph, table: table }\n}\n\n/**\n * Builds a segment from a specified data and mode.\n * If a mode is not specified, the more suitable will be used.\n *\n * @param  {String} data             Input data\n * @param  {Mode | String} modesHint Data mode\n * @return {Segment}                 Segment\n */\nfunction buildSingleSegment (data, modesHint) {\n  let mode\n  const bestMode = Mode.getBestModeForData(data)\n\n  mode = Mode.from(modesHint, bestMode)\n\n  // Make sure data can be encoded\n  if (mode !== Mode.BYTE && mode.bit < bestMode.bit) {\n    throw new Error('\"' + data + '\"' +\n      ' cannot be encoded with mode ' + Mode.toString(mode) +\n      '.\\n Suggested mode is: ' + Mode.toString(bestMode))\n  }\n\n  // Use Mode.BYTE if Kanji support is disabled\n  if (mode === Mode.KANJI && !Utils.isKanjiModeEnabled()) {\n    mode = Mode.BYTE\n  }\n\n  switch (mode) {\n    case Mode.NUMERIC:\n      return new NumericData(data)\n\n    case Mode.ALPHANUMERIC:\n      return new AlphanumericData(data)\n\n    case Mode.KANJI:\n      return new KanjiData(data)\n\n    case Mode.BYTE:\n      return new ByteData(data)\n  }\n}\n\n/**\n * Builds a list of segments from an array.\n * Array can contain Strings or Objects with segment's info.\n *\n * For each item which is a string, will be generated a segment with the given\n * string and the more appropriate encoding mode.\n *\n * For each item which is an object, will be generated a segment with the given\n * data and mode.\n * Objects must contain at least the property \"data\".\n * If property \"mode\" is not present, the more suitable mode will be used.\n *\n * @param  {Array} array Array of objects with segments data\n * @return {Array}       Array of Segments\n */\nexports.fromArray = function fromArray (array) {\n  return array.reduce(function (acc, seg) {\n    if (typeof seg === 'string') {\n      acc.push(buildSingleSegment(seg, null))\n    } else if (seg.data) {\n      acc.push(buildSingleSegment(seg.data, seg.mode))\n    }\n\n    return acc\n  }, [])\n}\n\n/**\n * Builds an optimized sequence of segments from a string,\n * which will produce the shortest possible bitstream.\n *\n * @param  {String} data    Input string\n * @param  {Number} version QR Code version\n * @return {Array}          Array of segments\n */\nexports.fromString = function fromString (data, version) {\n  const segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled())\n\n  const nodes = buildNodes(segs)\n  const graph = buildGraph(nodes, version)\n  const path = dijkstra.find_path(graph.map, 'start', 'end')\n\n  const optimizedSegs = []\n  for (let i = 1; i < path.length - 1; i++) {\n    optimizedSegs.push(graph.table[path[i]].node)\n  }\n\n  return exports.fromArray(mergeSegments(optimizedSegs))\n}\n\n/**\n * Splits a string in various segments with the modes which\n * best represent their content.\n * The produced segments are far from being optimized.\n * The output of this function is only used to estimate a QR Code version\n * which may contain the data.\n *\n * @param  {string} data Input string\n * @return {Array}       Array of segments\n */\nexports.rawSplit = function rawSplit (data) {\n  return exports.fromArray(\n    getSegmentsFromString(data, Utils.isKanjiModeEnabled())\n  )\n}\n","let toSJISFunction\nconst CODEWORDS_COUNT = [\n  0, // Not used\n  26, 44, 70, 100, 134, 172, 196, 242, 292, 346,\n  404, 466, 532, 581, 655, 733, 815, 901, 991, 1085,\n  1156, 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185,\n  2323, 2465, 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706\n]\n\n/**\n * Returns the QR Code size for the specified version\n *\n * @param  {Number} version QR Code version\n * @return {Number}         size of QR code\n */\nexports.getSymbolSize = function getSymbolSize (version) {\n  if (!version) throw new Error('\"version\" cannot be null or undefined')\n  if (version < 1 || version > 40) throw new Error('\"version\" should be in range from 1 to 40')\n  return version * 4 + 17\n}\n\n/**\n * Returns the total number of codewords used to store data and EC information.\n *\n * @param  {Number} version QR Code version\n * @return {Number}         Data length in bits\n */\nexports.getSymbolTotalCodewords = function getSymbolTotalCodewords (version) {\n  return CODEWORDS_COUNT[version]\n}\n\n/**\n * Encode data with Bose-Chaudhuri-Hocquenghem\n *\n * @param  {Number} data Value to encode\n * @return {Number}      Encoded value\n */\nexports.getBCHDigit = function (data) {\n  let digit = 0\n\n  while (data !== 0) {\n    digit++\n    data >>>= 1\n  }\n\n  return digit\n}\n\nexports.setToSJISFunction = function setToSJISFunction (f) {\n  if (typeof f !== 'function') {\n    throw new Error('\"toSJISFunc\" is not a valid function.')\n  }\n\n  toSJISFunction = f\n}\n\nexports.isKanjiModeEnabled = function () {\n  return typeof toSJISFunction !== 'undefined'\n}\n\nexports.toSJIS = function toSJIS (kanji) {\n  return toSJISFunction(kanji)\n}\n","/**\n * Check if QR Code version is valid\n *\n * @param  {Number}  version QR Code version\n * @return {Boolean}         true if valid version, false otherwise\n */\nexports.isValid = function isValid (version) {\n  return !isNaN(version) && version >= 1 && version <= 40\n}\n","const Utils = require('./utils')\nconst ECCode = require('./error-correction-code')\nconst ECLevel = require('./error-correction-level')\nconst Mode = require('./mode')\nconst VersionCheck = require('./version-check')\n\n// Generator polynomial used to encode version information\nconst G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0)\nconst G18_BCH = Utils.getBCHDigit(G18)\n\nfunction getBestVersionForDataLength (mode, length, errorCorrectionLevel) {\n  for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {\n    if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, mode)) {\n      return currentVersion\n    }\n  }\n\n  return undefined\n}\n\nfunction getReservedBitsCount (mode, version) {\n  // Character count indicator + mode indicator bits\n  return Mode.getCharCountIndicator(mode, version) + 4\n}\n\nfunction getTotalBitsFromDataArray (segments, version) {\n  let totalBits = 0\n\n  segments.forEach(function (data) {\n    const reservedBits = getReservedBitsCount(data.mode, version)\n    totalBits += reservedBits + data.getBitsLength()\n  })\n\n  return totalBits\n}\n\nfunction getBestVersionForMixedData (segments, errorCorrectionLevel) {\n  for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {\n    const length = getTotalBitsFromDataArray(segments, currentVersion)\n    if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, Mode.MIXED)) {\n      return currentVersion\n    }\n  }\n\n  return undefined\n}\n\n/**\n * Returns version number from a value.\n * If value is not a valid version, returns defaultValue\n *\n * @param  {Number|String} value        QR Code version\n * @param  {Number}        defaultValue Fallback value\n * @return {Number}                     QR Code version number\n */\nexports.from = function from (value, defaultValue) {\n  if (VersionCheck.isValid(value)) {\n    return parseInt(value, 10)\n  }\n\n  return defaultValue\n}\n\n/**\n * Returns how much data can be stored with the specified QR code version\n * and error correction level\n *\n * @param  {Number} version              QR Code version (1-40)\n * @param  {Number} errorCorrectionLevel Error correction level\n * @param  {Mode}   mode                 Data mode\n * @return {Number}                      Quantity of storable data\n */\nexports.getCapacity = function getCapacity (version, errorCorrectionLevel, mode) {\n  if (!VersionCheck.isValid(version)) {\n    throw new Error('Invalid QR Code version')\n  }\n\n  // Use Byte mode as default\n  if (typeof mode === 'undefined') mode = Mode.BYTE\n\n  // Total codewords for this QR code version (Data + Error correction)\n  const totalCodewords = Utils.getSymbolTotalCodewords(version)\n\n  // Total number of error correction codewords\n  const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n\n  // Total number of data codewords\n  const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8\n\n  if (mode === Mode.MIXED) return dataTotalCodewordsBits\n\n  const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode, version)\n\n  // Return max number of storable codewords\n  switch (mode) {\n    case Mode.NUMERIC:\n      return Math.floor((usableBits / 10) * 3)\n\n    case Mode.ALPHANUMERIC:\n      return Math.floor((usableBits / 11) * 2)\n\n    case Mode.KANJI:\n      return Math.floor(usableBits / 13)\n\n    case Mode.BYTE:\n    default:\n      return Math.floor(usableBits / 8)\n  }\n}\n\n/**\n * Returns the minimum version needed to contain the amount of data\n *\n * @param  {Segment} data                    Segment of data\n * @param  {Number} [errorCorrectionLevel=H] Error correction level\n * @param  {Mode} mode                       Data mode\n * @return {Number}                          QR Code version\n */\nexports.getBestVersionForData = function getBestVersionForData (data, errorCorrectionLevel) {\n  let seg\n\n  const ecl = ECLevel.from(errorCorrectionLevel, ECLevel.M)\n\n  if (Array.isArray(data)) {\n    if (data.length > 1) {\n      return getBestVersionForMixedData(data, ecl)\n    }\n\n    if (data.length === 0) {\n      return 1\n    }\n\n    seg = data[0]\n  } else {\n    seg = data\n  }\n\n  return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl)\n}\n\n/**\n * Returns version information with relative error correction bits\n *\n * The version information is included in QR Code symbols of version 7 or larger.\n * It consists of an 18-bit sequence containing 6 data bits,\n * with 12 error correction bits calculated using the (18, 6) Golay code.\n *\n * @param  {Number} version QR Code version\n * @return {Number}         Encoded version info bits\n */\nexports.getEncodedBits = function getEncodedBits (version) {\n  if (!VersionCheck.isValid(version) || version < 7) {\n    throw new Error('Invalid QR Code version')\n  }\n\n  let d = version << 12\n\n  while (Utils.getBCHDigit(d) - G18_BCH >= 0) {\n    d ^= (G18 << (Utils.getBCHDigit(d) - G18_BCH))\n  }\n\n  return (version << 12) | d\n}\n","const Utils = require('./utils')\n\nfunction clearCanvas (ctx, canvas, size) {\n  ctx.clearRect(0, 0, canvas.width, canvas.height)\n\n  if (!canvas.style) canvas.style = {}\n  canvas.height = size\n  canvas.width = size\n  canvas.style.height = size + 'px'\n  canvas.style.width = size + 'px'\n}\n\nfunction getCanvasElement () {\n  try {\n    return document.createElement('canvas')\n  } catch (e) {\n    throw new Error('You need to specify a canvas element')\n  }\n}\n\nexports.render = function render (qrData, canvas, options) {\n  let opts = options\n  let canvasEl = canvas\n\n  if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {\n    opts = canvas\n    canvas = undefined\n  }\n\n  if (!canvas) {\n    canvasEl = getCanvasElement()\n  }\n\n  opts = Utils.getOptions(opts)\n  const size = Utils.getImageWidth(qrData.modules.size, opts)\n\n  const ctx = canvasEl.getContext('2d')\n  const image = ctx.createImageData(size, size)\n  Utils.qrToImageData(image.data, qrData, opts)\n\n  clearCanvas(ctx, canvasEl, size)\n  ctx.putImageData(image, 0, 0)\n\n  return canvasEl\n}\n\nexports.renderToDataURL = function renderToDataURL (qrData, canvas, options) {\n  let opts = options\n\n  if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {\n    opts = canvas\n    canvas = undefined\n  }\n\n  if (!opts) opts = {}\n\n  const canvasEl = exports.render(qrData, canvas, opts)\n\n  const type = opts.type || 'image/png'\n  const rendererOpts = opts.rendererOpts || {}\n\n  return canvasEl.toDataURL(type, rendererOpts.quality)\n}\n","const Utils = require('./utils')\n\nfunction getColorAttrib (color, attrib) {\n  const alpha = color.a / 255\n  const str = attrib + '=\"' + color.hex + '\"'\n\n  return alpha < 1\n    ? str + ' ' + attrib + '-opacity=\"' + alpha.toFixed(2).slice(1) + '\"'\n    : str\n}\n\nfunction svgCmd (cmd, x, y) {\n  let str = cmd + x\n  if (typeof y !== 'undefined') str += ' ' + y\n\n  return str\n}\n\nfunction qrToPath (data, size, margin) {\n  let path = ''\n  let moveBy = 0\n  let newRow = false\n  let lineLength = 0\n\n  for (let i = 0; i < data.length; i++) {\n    const col = Math.floor(i % size)\n    const row = Math.floor(i / size)\n\n    if (!col && !newRow) newRow = true\n\n    if (data[i]) {\n      lineLength++\n\n      if (!(i > 0 && col > 0 && data[i - 1])) {\n        path += newRow\n          ? svgCmd('M', col + margin, 0.5 + row + margin)\n          : svgCmd('m', moveBy, 0)\n\n        moveBy = 0\n        newRow = false\n      }\n\n      if (!(col + 1 < size && data[i + 1])) {\n        path += svgCmd('h', lineLength)\n        lineLength = 0\n      }\n    } else {\n      moveBy++\n    }\n  }\n\n  return path\n}\n\nexports.render = function render (qrData, options, cb) {\n  const opts = Utils.getOptions(options)\n  const size = qrData.modules.size\n  const data = qrData.modules.data\n  const qrcodesize = size + opts.margin * 2\n\n  const bg = !opts.color.light.a\n    ? ''\n    : '<path ' + getColorAttrib(opts.color.light, 'fill') +\n      ' d=\"M0 0h' + qrcodesize + 'v' + qrcodesize + 'H0z\"/>'\n\n  const path =\n    '<path ' + getColorAttrib(opts.color.dark, 'stroke') +\n    ' d=\"' + qrToPath(data, size, opts.margin) + '\"/>'\n\n  const viewBox = 'viewBox=\"' + '0 0 ' + qrcodesize + ' ' + qrcodesize + '\"'\n\n  const width = !opts.width ? '' : 'width=\"' + opts.width + '\" height=\"' + opts.width + '\" '\n\n  const svgTag = '<svg xmlns=\"http://www.w3.org/2000/svg\" ' + width + viewBox + ' shape-rendering=\"crispEdges\">' + bg + path + '</svg>\\n'\n\n  if (typeof cb === 'function') {\n    cb(null, svgTag)\n  }\n\n  return svgTag\n}\n","function hex2rgba (hex) {\n  if (typeof hex === 'number') {\n    hex = hex.toString()\n  }\n\n  if (typeof hex !== 'string') {\n    throw new Error('Color should be defined as hex string')\n  }\n\n  let hexCode = hex.slice().replace('#', '').split('')\n  if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) {\n    throw new Error('Invalid hex color: ' + hex)\n  }\n\n  // Convert from short to long form (fff -> ffffff)\n  if (hexCode.length === 3 || hexCode.length === 4) {\n    hexCode = Array.prototype.concat.apply([], hexCode.map(function (c) {\n      return [c, c]\n    }))\n  }\n\n  // Add default alpha value\n  if (hexCode.length === 6) hexCode.push('F', 'F')\n\n  const hexValue = parseInt(hexCode.join(''), 16)\n\n  return {\n    r: (hexValue >> 24) & 255,\n    g: (hexValue >> 16) & 255,\n    b: (hexValue >> 8) & 255,\n    a: hexValue & 255,\n    hex: '#' + hexCode.slice(0, 6).join('')\n  }\n}\n\nexports.getOptions = function getOptions (options) {\n  if (!options) options = {}\n  if (!options.color) options.color = {}\n\n  const margin = typeof options.margin === 'undefined' ||\n    options.margin === null ||\n    options.margin < 0\n    ? 4\n    : options.margin\n\n  const width = options.width && options.width >= 21 ? options.width : undefined\n  const scale = options.scale || 4\n\n  return {\n    width: width,\n    scale: width ? 4 : scale,\n    margin: margin,\n    color: {\n      dark: hex2rgba(options.color.dark || '#000000ff'),\n      light: hex2rgba(options.color.light || '#ffffffff')\n    },\n    type: options.type,\n    rendererOpts: options.rendererOpts || {}\n  }\n}\n\nexports.getScale = function getScale (qrSize, opts) {\n  return opts.width && opts.width >= qrSize + opts.margin * 2\n    ? opts.width / (qrSize + opts.margin * 2)\n    : opts.scale\n}\n\nexports.getImageWidth = function getImageWidth (qrSize, opts) {\n  const scale = exports.getScale(qrSize, opts)\n  return Math.floor((qrSize + opts.margin * 2) * scale)\n}\n\nexports.qrToImageData = function qrToImageData (imgData, qr, opts) {\n  const size = qr.modules.size\n  const data = qr.modules.data\n  const scale = exports.getScale(size, opts)\n  const symbolSize = Math.floor((size + opts.margin * 2) * scale)\n  const scaledMargin = opts.margin * scale\n  const palette = [opts.color.light, opts.color.dark]\n\n  for (let i = 0; i < symbolSize; i++) {\n    for (let j = 0; j < symbolSize; j++) {\n      let posDst = (i * symbolSize + j) * 4\n      let pxColor = opts.color.light\n\n      if (i >= scaledMargin && j >= scaledMargin &&\n        i < symbolSize - scaledMargin && j < symbolSize - scaledMargin) {\n        const iSrc = Math.floor((i - scaledMargin) / scale)\n        const jSrc = Math.floor((j - scaledMargin) / scale)\n        pxColor = palette[data[iSrc * size + jSrc] ? 1 : 0]\n      }\n\n      imgData[posDst++] = pxColor.r\n      imgData[posDst++] = pxColor.g\n      imgData[posDst++] = pxColor.b\n      imgData[posDst] = pxColor.a\n    }\n  }\n}\n","'use strict';\n\n/******************************************************************************\n * Created 2008-08-19.\n *\n * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.\n *\n * Copyright (C) 2008\n *   Wyatt Baldwin <self@wyattbaldwin.com>\n *   All rights reserved\n *\n * Licensed under the MIT license.\n *\n *   http://www.opensource.org/licenses/mit-license.php\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 *****************************************************************************/\nvar dijkstra = {\n  single_source_shortest_paths: function(graph, s, d) {\n    // Predecessor map for each node that has been encountered.\n    // node ID => predecessor node ID\n    var predecessors = {};\n\n    // Costs of shortest paths from s to all nodes encountered.\n    // node ID => cost\n    var costs = {};\n    costs[s] = 0;\n\n    // Costs of shortest paths from s to all nodes encountered; differs from\n    // `costs` in that it provides easy access to the node that currently has\n    // the known shortest path from s.\n    // XXX: Do we actually need both `costs` and `open`?\n    var open = dijkstra.PriorityQueue.make();\n    open.push(s, 0);\n\n    var closest,\n        u, v,\n        cost_of_s_to_u,\n        adjacent_nodes,\n        cost_of_e,\n        cost_of_s_to_u_plus_cost_of_e,\n        cost_of_s_to_v,\n        first_visit;\n    while (!open.empty()) {\n      // In the nodes remaining in graph that have a known cost from s,\n      // find the node, u, that currently has the shortest path from s.\n      closest = open.pop();\n      u = closest.value;\n      cost_of_s_to_u = closest.cost;\n\n      // Get nodes adjacent to u...\n      adjacent_nodes = graph[u] || {};\n\n      // ...and explore the edges that connect u to those nodes, updating\n      // the cost of the shortest paths to any or all of those nodes as\n      // necessary. v is the node across the current edge from u.\n      for (v in adjacent_nodes) {\n        if (adjacent_nodes.hasOwnProperty(v)) {\n          // Get the cost of the edge running from u to v.\n          cost_of_e = adjacent_nodes[v];\n\n          // Cost of s to u plus the cost of u to v across e--this is *a*\n          // cost from s to v that may or may not be less than the current\n          // known cost to v.\n          cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;\n\n          // If we haven't visited v yet OR if the current known cost from s to\n          // v is greater than the new cost we just found (cost of s to u plus\n          // cost of u to v across e), update v's cost in the cost list and\n          // update v's predecessor in the predecessor list (it's now u).\n          cost_of_s_to_v = costs[v];\n          first_visit = (typeof costs[v] === 'undefined');\n          if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {\n            costs[v] = cost_of_s_to_u_plus_cost_of_e;\n            open.push(v, cost_of_s_to_u_plus_cost_of_e);\n            predecessors[v] = u;\n          }\n        }\n      }\n    }\n\n    if (typeof d !== 'undefined' && typeof costs[d] === 'undefined') {\n      var msg = ['Could not find a path from ', s, ' to ', d, '.'].join('');\n      throw new Error(msg);\n    }\n\n    return predecessors;\n  },\n\n  extract_shortest_path_from_predecessor_list: function(predecessors, d) {\n    var nodes = [];\n    var u = d;\n    var predecessor;\n    while (u) {\n      nodes.push(u);\n      predecessor = predecessors[u];\n      u = predecessors[u];\n    }\n    nodes.reverse();\n    return nodes;\n  },\n\n  find_path: function(graph, s, d) {\n    var predecessors = dijkstra.single_source_shortest_paths(graph, s, d);\n    return dijkstra.extract_shortest_path_from_predecessor_list(\n      predecessors, d);\n  },\n\n  /**\n   * A very naive priority queue implementation.\n   */\n  PriorityQueue: {\n    make: function (opts) {\n      var T = dijkstra.PriorityQueue,\n          t = {},\n          key;\n      opts = opts || {};\n      for (key in T) {\n        if (T.hasOwnProperty(key)) {\n          t[key] = T[key];\n        }\n      }\n      t.queue = [];\n      t.sorter = opts.sorter || T.default_sorter;\n      return t;\n    },\n\n    default_sorter: function (a, b) {\n      return a.cost - b.cost;\n    },\n\n    /**\n     * Add a new item to the queue and ensure the highest priority element\n     * is at the front of the queue.\n     */\n    push: function (value, cost) {\n      var item = {value: value, cost: cost};\n      this.queue.push(item);\n      this.queue.sort(this.sorter);\n    },\n\n    /**\n     * Return the highest priority element in the queue.\n     */\n    pop: function () {\n      return this.queue.shift();\n    },\n\n    empty: function () {\n      return this.queue.length === 0;\n    }\n  }\n};\n\n\n// node.js module exports\nif (typeof module !== 'undefined') {\n  module.exports = dijkstra;\n}\n","'use strict'\n\nmodule.exports = function encodeUtf8 (input) {\n  var result = []\n  var size = input.length\n\n  for (var index = 0; index < size; index++) {\n    var point = input.charCodeAt(index)\n\n    if (point >= 0xD800 && point <= 0xDBFF && size > index + 1) {\n      var second = input.charCodeAt(index + 1)\n\n      if (second >= 0xDC00 && second <= 0xDFFF) {\n        // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n        point = (point - 0xD800) * 0x400 + second - 0xDC00 + 0x10000\n        index += 1\n      }\n    }\n\n    // US-ASCII\n    if (point < 0x80) {\n      result.push(point)\n      continue\n    }\n\n    // 2-byte UTF-8\n    if (point < 0x800) {\n      result.push((point >> 6) | 192)\n      result.push((point & 63) | 128)\n      continue\n    }\n\n    // 3-byte UTF-8\n    if (point < 0xD800 || (point >= 0xE000 && point < 0x10000)) {\n      result.push((point >> 12) | 224)\n      result.push(((point >> 6) & 63) | 128)\n      result.push((point & 63) | 128)\n      continue\n    }\n\n    // 4-byte UTF-8\n    if (point >= 0x10000 && point <= 0x10FFFF) {\n      result.push((point >> 18) | 240)\n      result.push(((point >> 12) & 63) | 128)\n      result.push(((point >> 6) & 63) | 128)\n      result.push((point & 63) | 128)\n      continue\n    }\n\n    // Invalid character\n    result.push(0xEF, 0xBF, 0xBD)\n  }\n\n  return new Uint8Array(result).buffer\n}\n"],"x_google_ignoreList":[15,20,21,22,23,24,42,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74]}