@usesuperflow/toolbar-staging 1.0.605 → 1.0.607

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/superflow.js CHANGED
@@ -68,7 +68,7 @@ const rt=1,at=2,lt=t=>(...e)=>({_$litDirective$:t,values:e});class ct{constructo
68
68
  * @license
69
69
  * Copyright 2017 Google LLC
70
70
  * SPDX-License-Identifier: BSD-3-Clause
71
- */class ht extends ct{constructor(t){if(super(t),this.it=D,t.type!==at)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===D||null==t)return this.ft=void 0,this.it=t;if(t===$)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this.ft;this.it=t;const e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}}ht.directiveName="unsafeHTML",ht.resultType=1;const ut=lt(ht);class pt{}pt.Events={GUEST_MODE_SIGN_IN_DIALOG_SHOWN:"guestModeSignInDialogShown",GUEST_MODE_NAME_DIALOG_SHOWN:"guestModeNameDialogShown",GUEST_MODE_SIGN_IN_BANNER_SHOWN:"guestModeSignInBannerShown",GUEST_MODE_SIGN_IN_BUTTON_CLICKED:"guestModeSignInButtonClicked",PASSWORD_PROTECTED_MODAL_CLOSE_BUTTON_CLICKED:"passwordProtectedModalCloseButtonClicked",PASSWORD_PROTECTED_MODAL_OPEN_BUTTON_CLICKED:"passwordProtectedModalOpenButtonClicked",TOOLBAR_EXPANDED:"toolbarExpanded",TOOLBAR_COLLAPSED:"toolbarCollapsed",TOOLBAR_NOTIFICATION_CLICKED:"toolbarNotificationClicked",GUEST_MODE_SKIP_BUTTON_CLICKED:"guestModeSkipButtonClicked",GUEST_MODE_SIGN_IN_NUDGE_SHOWN:"guestModeSignInNudgeShown",GUEST_MODE_NAME_NUDGE_SHOWN:"guestModeNameNudgeShown",GUEST_MODE_SIGN_IN_CLICKED:"guestModeSignInClicked",GUEST_MODE_PRESENT:"guestModePresent",GUEST_MODE_NAME_ADDED:"guestModeNameAdded",REVIEW_PASSWORD_ADDED:"reviewPasswordAdded",REVIEW_PASSWORD_REJECTED:"reviewPasswordRejected",REVIEW_PASSWORD_ACCEPTED:"reviewPasswordAccepted",PRIVATE_MODE_ENABLED:"privateModeEnabled",PRIVATE_MODE_DISABLED:"privateModeDisabled",VIEW_PROJECT_CLICKED:"viewProjectClicked",OPEN_MOBILE_CLICKED:"openMobileClicked",EXIT_REVIEW_MODE_CLICKED:"exitReviewModeClicked",SIGNOUT_CLICKED:"signoutClicked",SIGNIN_CLICKED:"signinClicked",SIGN_IN_REQUIRED:"signInRequired",USER_EMAIL_NOT_WHITELISTED:"userEmailNotWhitelisted",DOMAIN_NOT_WHITELISTED:"domainNotWhitelisted",DUPLICATE_SCRIPT_INSTALLED:"duplicateScriptInstalled",TOOLBAR_DISABLED:"toolbarDisabled",INVITE_MODAL_OPENED:"inviteModalOpened",INVITE_SENT:"inviteSent",QUALITY_CHECK_RUN_TOOLBAR_CLICKED:"qualityCheckRunFromToolbarClicked"};const vt="1.0.605",gt="5.0.2-beta.23",ft="1.0.120",mt=["v3ogId1G43AFHehEOewv","rNYzMJd13L27xtfipmSK","aU1MxKP0rca2UXwKi8bl"],wt="review",bt="feedback",yt="sreviewId",Ct="scommentId",xt="snippyly-user",Et="st",kt="_sfut",St="_sfgut",Mt="projectVersionKey",_t="projectVersion",Tt="sversion",It="sprojectInstall",Nt="sflivedemo",At="sffigmademo",Lt="sfTourCommentTooltip",Ot="sfUserAdmin",$t="sfGuestMode",Dt="sfPasswordProtected",Vt="sfQueryParamsComments",Ft="sfUsePageTitleAsLocationName",jt="sfPasswordIsValid",Pt="sfPrivateMode",Rt="sfGuestModeAllowSignIn",Ut="sfGuestUserModelOpened",zt="sfGuestUserNameUpdated",Bt="sfGuestUserBannerOpened",Ht="sfCustomerMetadata",Wt="sfSamlConfig",Gt="superflow-file-viewer-staging.web.app",Kt="drive.usesuperflow.com",Zt="tool:spell-check",Jt="tool:broken-links",Yt="terminal",qt="suggestion",Qt={VELT_ROOT:"velt-root",VELT_PRESENCE:"velt-presence",VELT_CURSOR:"velt-cursor",VELT_COMMENT_TOOL:"velt-comment-tool",VELT_COMMENTS:"velt-comments",SNIPPYLY_TEXT_HIGHLIGHT:"snippyly-text-highlight",VELT_COMMENTS_SIDEBAR:"velt-comments-sidebar",VELT_HUDDLE:"velt-huddle",VELT_RECORDER_NOTES:"velt-recorder-notes",VELT_RECORDER_CONTROL_PANEL:"velt-recorder-control-panel",VELT_ARROWS:"velt-arrows",VELT_NOTIFICATIONS_HISTORY_PANEL:"velt-notifications-history-panel"},Xt={ENABLE_URL_NAVIGATION:"enable-url-navigation",CURRENT_LOCATION_SUFFIX:"current-location-suffix"},te={customBranding:{logo:{logoMark:{lightUrl:'\n\t\t\t\t<svg viewBox="0 0 49 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t<path d="M8 8C8 3.58172 11.5817 0 16 0V0C20.4183 0 24 3.58172 24 8V16H16C11.5817 16 8 12.4183 8 8V8Z" fill="#FFCD2E"/>\n\t\t\t\t\t<path d="M0 29C0 22.3726 5.37258 17 12 17H24V29C24 35.6274 18.6274 41 12 41V41C5.37258 41 0 35.6274 0 29V29Z" fill="#A259FE"/>\n\t\t\t\t\t<path d="M25 19C25 12.3726 30.3726 7 37 7V7C43.6274 7 49 12.3726 49 19V19C49 25.6274 43.6274 31 37 31H25V19Z" fill="#FF7162"/>\n\t\t\t\t\t<path d="M25 32H33C37.4183 32 41 35.5817 41 40V40C41 44.4183 37.4183 48 33 48V48C28.5817 48 25 44.4183 25 40V32Z" fill="#0DCF82"/>\n\t\t\t\t</svg>\n\t\t\t\t',darkUrl:'\n\t\t\t\t<svg viewBox="0 0 49 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t<path d="M8 8C8 3.58172 11.5817 0 16 0V0C20.4183 0 24 3.58172 24 8V16H16C11.5817 16 8 12.4183 8 8V8Z" fill="#FFCD2E"/>\n\t\t\t\t\t<path d="M0 29C0 22.3726 5.37258 17 12 17H24V29C24 35.6274 18.6274 41 12 41V41C5.37258 41 0 35.6274 0 29V29Z" fill="#A259FE"/>\n\t\t\t\t\t<path d="M25 19C25 12.3726 30.3726 7 37 7V7C43.6274 7 49 12.3726 49 19V19C49 25.6274 43.6274 31 37 31H25V19Z" fill="#FF7162"/>\n\t\t\t\t\t<path d="M25 32H33C37.4183 32 41 35.5817 41 40V40C41 44.4183 37.4183 48 33 48V48C28.5817 48 25 44.4183 25 40V32Z" fill="#0DCF82"/>\n\t\t\t\t</svg>\n\t\t\t\t'},wordMark:{lightUrl:'\n\t\t\t\t<svg width="257" height="65" viewBox="0 0 257 65" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t<path d="M8 16C8 11.5817 11.5817 8 16 8V8C20.4183 8 24 11.5817 24 16V24H16C11.5817 24 8 20.4183 8 16V16Z" fill="#FFCD2E"/>\n\t\t\t\t\t<path d="M0 37C0 30.3726 5.37258 25 12 25H24V37C24 43.6274 18.6274 49 12 49V49C5.37258 49 0 43.6274 0 37V37Z" fill="#A259FE"/>\n\t\t\t\t\t<path d="M25 27C25 20.3726 30.3726 15 37 15V15C43.6274 15 49 20.3726 49 27V27C49 33.6274 43.6274 39 37 39H25V27Z" fill="#FF7162"/>\n\t\t\t\t\t<path d="M25 40H33C37.4183 40 41 43.5817 41 48V48C41 52.4183 37.4183 56 33 56V56C28.5817 56 25 52.4183 25 48V40Z" fill="#0DCF82"/>\n\t\t\t\t\t<path d="M73.4 46.28C71.4533 46.28 69.6933 45.9467 68.12 45.28C66.5733 44.6133 65.3467 43.6533 64.44 42.4C63.5333 41.1467 63.0667 39.6667 63.04 37.96H69.04C69.12 39.1067 69.52 40.0133 70.24 40.68C70.9867 41.3467 72 41.68 73.28 41.68C74.5867 41.68 75.6133 41.3733 76.36 40.76C77.1067 40.12 77.48 39.2933 77.48 38.28C77.48 37.4533 77.2267 36.7733 76.72 36.24C76.2133 35.7067 75.5733 35.2933 74.8 35C74.0533 34.68 73.0133 34.3333 71.68 33.96C69.8667 33.4267 68.3867 32.9067 67.24 32.4C66.12 31.8667 65.1467 31.08 64.32 30.04C63.52 28.9733 63.12 27.56 63.12 25.8C63.12 24.1467 63.5333 22.7067 64.36 21.48C65.1867 20.2533 66.3467 19.32 67.84 18.68C69.3333 18.0133 71.04 17.68 72.96 17.68C75.84 17.68 78.1733 18.3867 79.96 19.8C81.7733 21.1867 82.7733 23.1333 82.96 25.64H76.8C76.7467 24.68 76.3333 23.8933 75.56 23.28C74.8133 22.64 73.8133 22.32 72.56 22.32C71.4667 22.32 70.5867 22.6 69.92 23.16C69.28 23.72 68.96 24.5333 68.96 25.6C68.96 26.3467 69.2 26.9733 69.68 27.48C70.1867 27.96 70.8 28.36 71.52 28.68C72.2667 28.9733 73.3067 29.32 74.64 29.72C76.4533 30.2533 77.9333 30.7867 79.08 31.32C80.2267 31.8533 81.2133 32.6533 82.04 33.72C82.8667 34.7867 83.28 36.1867 83.28 37.92C83.28 39.4133 82.8933 40.8 82.12 42.08C81.3467 43.36 80.2133 44.3867 78.72 45.16C77.2267 45.9067 75.4533 46.28 73.4 46.28ZM107.855 23.84V46H102.215V43.2C101.495 44.16 100.548 44.92 99.375 45.48C98.2283 46.0133 96.975 46.28 95.615 46.28C93.8817 46.28 92.3483 45.92 91.015 45.2C89.6817 44.4533 88.6283 43.3733 87.855 41.96C87.1083 40.52 86.735 38.8133 86.735 36.84V23.84H92.335V36.04C92.335 37.8 92.775 39.16 93.655 40.12C94.535 41.0533 95.735 41.52 97.255 41.52C98.8017 41.52 100.015 41.0533 100.895 40.12C101.775 39.16 102.215 37.8 102.215 36.04V23.84H107.855ZM116.98 27.04C117.7 26.0267 118.687 25.1867 119.94 24.52C121.22 23.8267 122.674 23.48 124.3 23.48C126.194 23.48 127.9 23.9467 129.42 24.88C130.967 25.8133 132.18 27.1467 133.06 28.88C133.967 30.5867 134.42 32.5733 134.42 34.84C134.42 37.1067 133.967 39.12 133.06 40.88C132.18 42.6133 130.967 43.96 129.42 44.92C127.9 45.88 126.194 46.36 124.3 46.36C122.674 46.36 121.234 46.0267 119.98 45.36C118.754 44.6933 117.754 43.8533 116.98 42.84V56.56H111.38V23.84H116.98V27.04ZM128.7 34.84C128.7 33.5067 128.42 32.36 127.86 31.4C127.327 30.4133 126.607 29.6667 125.7 29.16C124.82 28.6533 123.86 28.4 122.82 28.4C121.807 28.4 120.847 28.6667 119.94 29.2C119.06 29.7067 118.34 30.4533 117.78 31.44C117.247 32.4267 116.98 33.5867 116.98 34.92C116.98 36.2533 117.247 37.4133 117.78 38.4C118.34 39.3867 119.06 40.1467 119.94 40.68C120.847 41.1867 121.807 41.44 122.82 41.44C123.86 41.44 124.82 41.1733 125.7 40.64C126.607 40.1067 127.327 39.3467 127.86 38.36C128.42 37.3733 128.7 36.2 128.7 34.84ZM158.29 34.44C158.29 35.24 158.236 35.96 158.13 36.6H141.93C142.063 38.2 142.623 39.4533 143.61 40.36C144.596 41.2667 145.81 41.72 147.25 41.72C149.33 41.72 150.81 40.8267 151.69 39.04H157.73C157.09 41.1733 155.863 42.9333 154.05 44.32C152.236 45.68 150.01 46.36 147.37 46.36C145.236 46.36 143.316 45.8933 141.61 44.96C139.93 44 138.61 42.6533 137.65 40.92C136.716 39.1867 136.25 37.1867 136.25 34.92C136.25 32.6267 136.716 30.6133 137.65 28.88C138.583 27.1467 139.89 25.8133 141.57 24.88C143.25 23.9467 145.183 23.48 147.37 23.48C149.476 23.48 151.356 23.9333 153.01 24.84C154.69 25.7467 155.983 27.04 156.89 28.72C157.823 30.3733 158.29 32.28 158.29 34.44ZM152.49 32.84C152.463 31.4 151.943 30.2533 150.93 29.4C149.916 28.52 148.676 28.08 147.21 28.08C145.823 28.08 144.65 28.5067 143.69 29.36C142.756 30.1867 142.183 31.3467 141.97 32.84H152.49ZM167.177 27.28C167.897 26.1067 168.831 25.1867 169.977 24.52C171.151 23.8533 172.484 23.52 173.977 23.52V29.4H172.497C170.737 29.4 169.404 29.8133 168.497 30.64C167.617 31.4667 167.177 32.9067 167.177 34.96V46H161.577V23.84H167.177V27.28ZM188.309 28.44H184.429V46H178.749V28.44H176.229V23.84H178.749V22.72C178.749 20 179.522 18 181.069 16.72C182.616 15.44 184.949 14.84 188.069 14.92V19.64C186.709 19.6133 185.762 19.84 185.229 20.32C184.696 20.8 184.429 21.6667 184.429 22.92V23.84H188.309V28.44ZM197.538 16.4V46H191.938V16.4H197.538ZM211.711 46.36C209.578 46.36 207.658 45.8933 205.951 44.96C204.244 44 202.898 42.6533 201.911 40.92C200.951 39.1867 200.471 37.1867 200.471 34.92C200.471 32.6533 200.964 30.6533 201.951 28.92C202.964 27.1867 204.338 25.8533 206.071 24.92C207.804 23.96 209.738 23.48 211.871 23.48C214.004 23.48 215.938 23.96 217.671 24.92C219.404 25.8533 220.764 27.1867 221.751 28.92C222.764 30.6533 223.271 32.6533 223.271 34.92C223.271 37.1867 222.751 39.1867 221.711 40.92C220.698 42.6533 219.311 44 217.551 44.96C215.818 45.8933 213.871 46.36 211.711 46.36ZM211.711 41.48C212.724 41.48 213.671 41.24 214.551 40.76C215.458 40.2533 216.178 39.5067 216.711 38.52C217.244 37.5333 217.511 36.3333 217.511 34.92C217.511 32.8133 216.951 31.2 215.831 30.08C214.738 28.9333 213.391 28.36 211.791 28.36C210.191 28.36 208.844 28.9333 207.751 30.08C206.684 31.2 206.151 32.8133 206.151 34.92C206.151 37.0267 206.671 38.6533 207.711 39.8C208.778 40.92 210.111 41.48 211.711 41.48ZM256.499 23.84L250.019 46H243.979L239.939 30.52L235.899 46H229.819L223.299 23.84H228.979L232.899 40.72L237.139 23.84H243.059L247.219 40.68L251.139 23.84H256.499Z" fill="#141416"/>\n\t\t\t\t</svg>\n\t\t\t\t',darkUrl:'\n\t\t\t\t<svg width="257" height="65" viewBox="0 0 257 65" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t<path d="M8 16C8 11.5817 11.5817 8 16 8V8C20.4183 8 24 11.5817 24 16V24H16C11.5817 24 8 20.4183 8 16V16Z" fill="#FFCD2E"/>\n\t\t\t\t\t<path d="M0 37C0 30.3726 5.37258 25 12 25H24V37C24 43.6274 18.6274 49 12 49V49C5.37258 49 0 43.6274 0 37V37Z" fill="#A259FE"/>\n\t\t\t\t\t<path d="M25 27C25 20.3726 30.3726 15 37 15V15C43.6274 15 49 20.3726 49 27V27C49 33.6274 43.6274 39 37 39H25V27Z" fill="#FF7162"/>\n\t\t\t\t\t<path d="M25 40H33C37.4183 40 41 43.5817 41 48V48C41 52.4183 37.4183 56 33 56V56C28.5817 56 25 52.4183 25 48V40Z" fill="#0DCF82"/>\n\t\t\t\t\t<path d="M73.4 46.28C71.4533 46.28 69.6933 45.9467 68.12 45.28C66.5733 44.6133 65.3467 43.6533 64.44 42.4C63.5333 41.1467 63.0667 39.6667 63.04 37.96H69.04C69.12 39.1067 69.52 40.0133 70.24 40.68C70.9867 41.3467 72 41.68 73.28 41.68C74.5867 41.68 75.6133 41.3733 76.36 40.76C77.1067 40.12 77.48 39.2933 77.48 38.28C77.48 37.4533 77.2267 36.7733 76.72 36.24C76.2133 35.7067 75.5733 35.2933 74.8 35C74.0533 34.68 73.0133 34.3333 71.68 33.96C69.8667 33.4267 68.3867 32.9067 67.24 32.4C66.12 31.8667 65.1467 31.08 64.32 30.04C63.52 28.9733 63.12 27.56 63.12 25.8C63.12 24.1467 63.5333 22.7067 64.36 21.48C65.1867 20.2533 66.3467 19.32 67.84 18.68C69.3333 18.0133 71.04 17.68 72.96 17.68C75.84 17.68 78.1733 18.3867 79.96 19.8C81.7733 21.1867 82.7733 23.1333 82.96 25.64H76.8C76.7467 24.68 76.3333 23.8933 75.56 23.28C74.8133 22.64 73.8133 22.32 72.56 22.32C71.4667 22.32 70.5867 22.6 69.92 23.16C69.28 23.72 68.96 24.5333 68.96 25.6C68.96 26.3467 69.2 26.9733 69.68 27.48C70.1867 27.96 70.8 28.36 71.52 28.68C72.2667 28.9733 73.3067 29.32 74.64 29.72C76.4533 30.2533 77.9333 30.7867 79.08 31.32C80.2267 31.8533 81.2133 32.6533 82.04 33.72C82.8667 34.7867 83.28 36.1867 83.28 37.92C83.28 39.4133 82.8933 40.8 82.12 42.08C81.3467 43.36 80.2133 44.3867 78.72 45.16C77.2267 45.9067 75.4533 46.28 73.4 46.28ZM107.855 23.84V46H102.215V43.2C101.495 44.16 100.548 44.92 99.375 45.48C98.2283 46.0133 96.975 46.28 95.615 46.28C93.8817 46.28 92.3483 45.92 91.015 45.2C89.6817 44.4533 88.6283 43.3733 87.855 41.96C87.1083 40.52 86.735 38.8133 86.735 36.84V23.84H92.335V36.04C92.335 37.8 92.775 39.16 93.655 40.12C94.535 41.0533 95.735 41.52 97.255 41.52C98.8017 41.52 100.015 41.0533 100.895 40.12C101.775 39.16 102.215 37.8 102.215 36.04V23.84H107.855ZM116.98 27.04C117.7 26.0267 118.687 25.1867 119.94 24.52C121.22 23.8267 122.674 23.48 124.3 23.48C126.194 23.48 127.9 23.9467 129.42 24.88C130.967 25.8133 132.18 27.1467 133.06 28.88C133.967 30.5867 134.42 32.5733 134.42 34.84C134.42 37.1067 133.967 39.12 133.06 40.88C132.18 42.6133 130.967 43.96 129.42 44.92C127.9 45.88 126.194 46.36 124.3 46.36C122.674 46.36 121.234 46.0267 119.98 45.36C118.754 44.6933 117.754 43.8533 116.98 42.84V56.56H111.38V23.84H116.98V27.04ZM128.7 34.84C128.7 33.5067 128.42 32.36 127.86 31.4C127.327 30.4133 126.607 29.6667 125.7 29.16C124.82 28.6533 123.86 28.4 122.82 28.4C121.807 28.4 120.847 28.6667 119.94 29.2C119.06 29.7067 118.34 30.4533 117.78 31.44C117.247 32.4267 116.98 33.5867 116.98 34.92C116.98 36.2533 117.247 37.4133 117.78 38.4C118.34 39.3867 119.06 40.1467 119.94 40.68C120.847 41.1867 121.807 41.44 122.82 41.44C123.86 41.44 124.82 41.1733 125.7 40.64C126.607 40.1067 127.327 39.3467 127.86 38.36C128.42 37.3733 128.7 36.2 128.7 34.84ZM158.29 34.44C158.29 35.24 158.236 35.96 158.13 36.6H141.93C142.063 38.2 142.623 39.4533 143.61 40.36C144.596 41.2667 145.81 41.72 147.25 41.72C149.33 41.72 150.81 40.8267 151.69 39.04H157.73C157.09 41.1733 155.863 42.9333 154.05 44.32C152.236 45.68 150.01 46.36 147.37 46.36C145.236 46.36 143.316 45.8933 141.61 44.96C139.93 44 138.61 42.6533 137.65 40.92C136.716 39.1867 136.25 37.1867 136.25 34.92C136.25 32.6267 136.716 30.6133 137.65 28.88C138.583 27.1467 139.89 25.8133 141.57 24.88C143.25 23.9467 145.183 23.48 147.37 23.48C149.476 23.48 151.356 23.9333 153.01 24.84C154.69 25.7467 155.983 27.04 156.89 28.72C157.823 30.3733 158.29 32.28 158.29 34.44ZM152.49 32.84C152.463 31.4 151.943 30.2533 150.93 29.4C149.916 28.52 148.676 28.08 147.21 28.08C145.823 28.08 144.65 28.5067 143.69 29.36C142.756 30.1867 142.183 31.3467 141.97 32.84H152.49ZM167.177 27.28C167.897 26.1067 168.831 25.1867 169.977 24.52C171.151 23.8533 172.484 23.52 173.977 23.52V29.4H172.497C170.737 29.4 169.404 29.8133 168.497 30.64C167.617 31.4667 167.177 32.9067 167.177 34.96V46H161.577V23.84H167.177V27.28ZM188.309 28.44H184.429V46H178.749V28.44H176.229V23.84H178.749V22.72C178.749 20 179.522 18 181.069 16.72C182.616 15.44 184.949 14.84 188.069 14.92V19.64C186.709 19.6133 185.762 19.84 185.229 20.32C184.696 20.8 184.429 21.6667 184.429 22.92V23.84H188.309V28.44ZM197.538 16.4V46H191.938V16.4H197.538ZM211.711 46.36C209.578 46.36 207.658 45.8933 205.951 44.96C204.244 44 202.898 42.6533 201.911 40.92C200.951 39.1867 200.471 37.1867 200.471 34.92C200.471 32.6533 200.964 30.6533 201.951 28.92C202.964 27.1867 204.338 25.8533 206.071 24.92C207.804 23.96 209.738 23.48 211.871 23.48C214.004 23.48 215.938 23.96 217.671 24.92C219.404 25.8533 220.764 27.1867 221.751 28.92C222.764 30.6533 223.271 32.6533 223.271 34.92C223.271 37.1867 222.751 39.1867 221.711 40.92C220.698 42.6533 219.311 44 217.551 44.96C215.818 45.8933 213.871 46.36 211.711 46.36ZM211.711 41.48C212.724 41.48 213.671 41.24 214.551 40.76C215.458 40.2533 216.178 39.5067 216.711 38.52C217.244 37.5333 217.511 36.3333 217.511 34.92C217.511 32.8133 216.951 31.2 215.831 30.08C214.738 28.9333 213.391 28.36 211.791 28.36C210.191 28.36 208.844 28.9333 207.751 30.08C206.684 31.2 206.151 32.8133 206.151 34.92C206.151 37.0267 206.671 38.6533 207.711 39.8C208.778 40.92 210.111 41.48 211.711 41.48ZM256.499 23.84L250.019 46H243.979L239.939 30.52L235.899 46H229.819L223.299 23.84H228.979L232.899 40.72L237.139 23.84H243.059L247.219 40.68L251.139 23.84H256.499Z" fill="white"/>\n\t\t\t\t</svg>\n\t\t\t\t'}}}},ee=[{name:"Peppa Pig",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fpeppa_pig.svg?alt=media&token=a9fc83f7-b347-4868-8d52-0e888f0de73a&_gl=1*jzxghx*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTQ5LjQyLjAuMA.."},{name:"Dazzling Dalmatian",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fdazzling_dalmatian.svg?alt=media&token=5842b24c-7e58-4bb5-96c2-d09aa11f7f9e&_gl=1*11ayw3z*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQxOTY4LjExLjAuMA.."},{name:"Rosy Rabbit",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Frosy_rabbit.svg?alt=media&token=4e65a9e3-080d-4416-839d-e761b6b37181&_gl=1*156om5t*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMjUzLjYwLjAuMA.."},{name:"Leo the Lion",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fleo_the_lion.svg?alt=media&token=58d1296e-fefd-42ce-80ea-ae2cc830f1a9&_gl=1*1cz8e9q*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTAwLjIwLjAuMA.."},{name:"Ducky Down",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fducky_down.svg?alt=media&token=d67ae889-78c5-46e3-aaa9-3eb511fe90b3&_gl=1*cxyj7o*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQxOTkwLjYwLjAuMA.."},{name:"Merry Monkey",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fmerry_monkey.svg?alt=media&token=5bd2f69a-7211-42df-9718-5339c467b2d1&_gl=1*1labjed*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTE3LjMuMC4w"},{name:"Ecstatic Elephant",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fecstatic_elephant.svg?alt=media&token=fbd2ba76-6c3a-47a7-beac-0460a2178b7d&_gl=1*aku3ps*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMDA3LjQzLjAuMA.."},{name:"Baby Bear",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fbaby_bear.svg?alt=media&token=71d0c5fb-60aa-4304-adc1-635a83650bde&_gl=1*1dxajmf*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQxMjQyLjUyLjAuMA.."},{name:"Freddy Froglet",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Ffreddy_froglet.svg?alt=media&token=e3b2e292-6480-4507-9da3-21a62a1346d4&_gl=1*s4yycs*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMDQzLjcuMC4w"},{name:"Powerful Panda",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fpowerful_panda.svg?alt=media&token=07f9d60f-aa14-4a77-ad5b-c48ee76db3f5&_gl=1*7gfuit*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTkzLjYwLjAuMA.."},{name:"Curious Cat",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fcurious_cat.svg?alt=media&token=dccf6824-3b7c-4e4e-8559-40fbb8ff6186&_gl=1*1nwi0ti*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQxOTM3LjQyLjAuMA.."},{name:"Playful Penguin",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fplayful_penguin.svg?alt=media&token=c6d1b11a-43a6-4001-ae56-e04fd5a3f965&_gl=1*1xdxvkx*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTYzLjI4LjAuMA.."},{name:"Kind Koala",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fkind_koala.svg?alt=media&token=974396d6-6ccd-4367-8563-b27634849cb5&_gl=1*1w1gbnn*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMDgwLjQwLjAuMA.."},{name:"Tommy Tiger",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Ftommy_tiger.svg?alt=media&token=40a95ac7-cc91-4b74-859a-4e2e5964b967&_gl=1*1n0cr0n*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMjczLjQwLjAuMA.."},{name:"Wally Walrus",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fwally_walrus.svg?alt=media&token=31e02ef2-c986-4724-b987-dca97f84f81b&_gl=1*y5by2c*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMjkxLjIyLjAuMA.."},{name:"Ricky Rhino",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fricky_rhino.svg?alt=media&token=5d9dafe5-f4de-4f8b-94c1-49e01c776611&_gl=1*zyp4n2*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMjMxLjIyLjAuMA.."},{name:"Oliver Otter",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Foliver_otter.svg?alt=media&token=5298b869-0903-40b2-a702-224a3e0bcd95&_gl=1*aicppz*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTMxLjYwLjAuMA.."},{name:"Reggie Ratling",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Freggie_ratling.svg?alt=media&token=f37fd4a0-9dbd-403a-bb82-81fdfb63cf88&_gl=1*16lzeql*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMjA3LjQ2LjAuMA.."},{name:"Gentle Giraffe",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fgentle_giraffe.svg?alt=media&token=f097ec12-e8ce-4d26-bf32-43e470eb7907&_gl=1*11ctuwz*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMDYwLjYwLjAuMA.."},{name:"Fabulous Fox",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Ffabulous_fox.svg?alt=media&token=fe1a4236-af45-427f-a035-1eda417b0682&_gl=1*xyyv1g*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMDIxLjI5LjAuMA.."}];var ie=Object.freeze({__proto__:null,AGENT_TOOL_BROKEN_LINKS:Jt,AGENT_TOOL_SPELL_CHECK:Zt,ANNOTATION_STATUS_TERMINAL:Yt,ANNOTATION_TYPE_SUGGESTION:qt,ATTRIBUTES:Xt,DEFAULT_CUSTOMER_METADATA:te,DOCUMENT_TITLE_CHANGE_LISTENER_API_KEYS:mt,DRIVE_PROD_URL:Kt,DRIVE_STAGING_URL:Gt,EXCLUDED_API_KEYS_FROM_LATEST_VERSION:["I9R2VqG45F5AgpIicnht"],FEEDBACK_MODE:bt,FIGMA_DEMO_MODAL:At,GUEST_USERS:ee,LIVE_DEMO_MODAL:Nt,PROJECT_INSTALL:It,PROJECT_VERSION:_t,PROJECT_VERSION_DEFAULT_KEY:Tt,PROJECT_VERSION_KEY:Mt,REVIEW_DOC_ID:yt,REVIEW_MODE:wt,SNIPPYLY_COMMENT_ID:Ct,SNIPPYLY_TOKEN:Et,SNIPPYLY_USER:xt,SUPERFLOW_CUSTOMER_METADATA:Ht,SUPERFLOW_DOCUMENT_METADATA:"sfDocumentMetadata",SUPERFLOW_GUEST_MODE:$t,SUPERFLOW_GUEST_MODE_ALLOW_SIGN_IN:Rt,SUPERFLOW_GUEST_USER_BANNER_OPENED:Bt,SUPERFLOW_GUEST_USER_MODEL_OPENED:Ut,SUPERFLOW_GUEST_USER_NAME_MODEL_OPENED:"sfGuestUserNameModelOpened",SUPERFLOW_GUEST_USER_NAME_UPDATED:zt,SUPERFLOW_GUEST_USER_TOKEN:St,SUPERFLOW_PASSWORD_IS_VALID:jt,SUPERFLOW_PASSWORD_PROTECTED:Dt,SUPERFLOW_PRIVATE_MODE:Pt,SUPERFLOW_QUERY_PARAMS_COMMENTS:Vt,SUPERFLOW_SAML_CONFIG:Wt,SUPERFLOW_USER_ADMIN:Ot,SUPERFLOW_USER_TOKEN:kt,SUPERFLOW_USE_PAGE_TITLE_AS_LOCATION_NAME:Ft,SUPERFLOW_VERSION:vt,TAGS:Qt,TOUR_COMMENT_TOOLTIP:Lt,VELT_SDK_DEVELOP_VERSION:gt,VELT_SDK_PROD_VERSION:ft,VELT_SDK_STAGING_VERSION:"3.0.92"});const oe=!0,ne="https://superflow-portal-v2-staging.firebaseapp.com/",se="9dbcd2509e0fa90a5c81f038ce618e3f",re="6d24f74f12f6fb84c87efa8f791cfb2e",ae="https://us-central1-snipply-sdk-staging.cloudfunctions.net/sa",le="https://us-central1-snipply-sdk-staging.cloudfunctions.net/superflowtoolbarhandler",ce=function(t){const e=[];let i=0;for(let o=0;o<t.length;o++){let n=t.charCodeAt(o);n<128?e[i++]=n:n<2048?(e[i++]=n>>6|192,e[i++]=63&n|128):55296==(64512&n)&&o+1<t.length&&56320==(64512&t.charCodeAt(o+1))?(n=65536+((1023&n)<<10)+(1023&t.charCodeAt(++o)),e[i++]=n>>18|240,e[i++]=n>>12&63|128,e[i++]=n>>6&63|128,e[i++]=63&n|128):(e[i++]=n>>12|224,e[i++]=n>>6&63|128,e[i++]=63&n|128)}return e},de={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const i=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,o=[];for(let e=0;e<t.length;e+=3){const n=t[e],s=e+1<t.length,r=s?t[e+1]:0,a=e+2<t.length,l=a?t[e+2]:0,c=n>>2,d=(3&n)<<4|r>>4;let h=(15&r)<<2|l>>6,u=63&l;a||(u=64,s||(h=64)),o.push(i[c],i[d],i[h],i[u])}return o.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(ce(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){const e=[];let i=0,o=0;for(;i<t.length;){const n=t[i++];if(n<128)e[o++]=String.fromCharCode(n);else if(n>191&&n<224){const s=t[i++];e[o++]=String.fromCharCode((31&n)<<6|63&s)}else if(n>239&&n<365){const s=((7&n)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536;e[o++]=String.fromCharCode(55296+(s>>10)),e[o++]=String.fromCharCode(56320+(1023&s))}else{const s=t[i++],r=t[i++];e[o++]=String.fromCharCode((15&n)<<12|(63&s)<<6|63&r)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const i=e?this.charToByteMapWebSafe_:this.charToByteMap_,o=[];for(let e=0;e<t.length;){const n=i[t.charAt(e++)],s=e<t.length?i[t.charAt(e)]:0;++e;const r=e<t.length?i[t.charAt(e)]:64;++e;const a=e<t.length?i[t.charAt(e)]:64;if(++e,null==n||null==s||null==r||null==a)throw new he;const l=n<<2|s>>4;if(o.push(l),64!==r){const t=s<<4&240|r>>2;if(o.push(t),64!==a){const t=r<<6&192|a;o.push(t)}}}return o},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class he extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const ue=function(t){return function(t){const e=ce(t);return de.encodeByteArray(e,!0)}(t).replace(/\./g,"")},pe=function(t){try{return de.decodeString(t,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};
71
+ */class ht extends ct{constructor(t){if(super(t),this.it=D,t.type!==at)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===D||null==t)return this.ft=void 0,this.it=t;if(t===$)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this.ft;this.it=t;const e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}}ht.directiveName="unsafeHTML",ht.resultType=1;const ut=lt(ht);class pt{}pt.Events={GUEST_MODE_SIGN_IN_DIALOG_SHOWN:"guestModeSignInDialogShown",GUEST_MODE_NAME_DIALOG_SHOWN:"guestModeNameDialogShown",GUEST_MODE_SIGN_IN_BANNER_SHOWN:"guestModeSignInBannerShown",GUEST_MODE_SIGN_IN_BUTTON_CLICKED:"guestModeSignInButtonClicked",PASSWORD_PROTECTED_MODAL_CLOSE_BUTTON_CLICKED:"passwordProtectedModalCloseButtonClicked",PASSWORD_PROTECTED_MODAL_OPEN_BUTTON_CLICKED:"passwordProtectedModalOpenButtonClicked",TOOLBAR_EXPANDED:"toolbarExpanded",TOOLBAR_COLLAPSED:"toolbarCollapsed",TOOLBAR_NOTIFICATION_CLICKED:"toolbarNotificationClicked",GUEST_MODE_SKIP_BUTTON_CLICKED:"guestModeSkipButtonClicked",GUEST_MODE_SIGN_IN_NUDGE_SHOWN:"guestModeSignInNudgeShown",GUEST_MODE_NAME_NUDGE_SHOWN:"guestModeNameNudgeShown",GUEST_MODE_SIGN_IN_CLICKED:"guestModeSignInClicked",GUEST_MODE_PRESENT:"guestModePresent",GUEST_MODE_NAME_ADDED:"guestModeNameAdded",REVIEW_PASSWORD_ADDED:"reviewPasswordAdded",REVIEW_PASSWORD_REJECTED:"reviewPasswordRejected",REVIEW_PASSWORD_ACCEPTED:"reviewPasswordAccepted",PRIVATE_MODE_ENABLED:"privateModeEnabled",PRIVATE_MODE_DISABLED:"privateModeDisabled",VIEW_PROJECT_CLICKED:"viewProjectClicked",OPEN_MOBILE_CLICKED:"openMobileClicked",EXIT_REVIEW_MODE_CLICKED:"exitReviewModeClicked",SIGNOUT_CLICKED:"signoutClicked",SIGNIN_CLICKED:"signinClicked",SIGN_IN_REQUIRED:"signInRequired",USER_EMAIL_NOT_WHITELISTED:"userEmailNotWhitelisted",DOMAIN_NOT_WHITELISTED:"domainNotWhitelisted",DUPLICATE_SCRIPT_INSTALLED:"duplicateScriptInstalled",TOOLBAR_DISABLED:"toolbarDisabled",INVITE_MODAL_OPENED:"inviteModalOpened",INVITE_SENT:"inviteSent",QUALITY_CHECK_RUN_TOOLBAR_CLICKED:"qualityCheckRunFromToolbarClicked"};const vt="1.0.607",gt="5.0.2-beta.23",ft="1.0.120",mt=["v3ogId1G43AFHehEOewv","rNYzMJd13L27xtfipmSK","aU1MxKP0rca2UXwKi8bl"],wt="review",bt="feedback",yt="sreviewId",Ct="scommentId",xt="snippyly-user",Et="st",kt="_sfut",St="_sfgut",Mt="projectVersionKey",_t="projectVersion",Tt="sversion",It="sprojectInstall",Nt="sflivedemo",At="sffigmademo",Lt="sfTourCommentTooltip",Ot="sfUserAdmin",$t="sfGuestMode",Dt="sfPasswordProtected",Vt="sfQueryParamsComments",Ft="sfUsePageTitleAsLocationName",jt="sfPasswordIsValid",Pt="sfPrivateMode",Rt="sfGuestModeAllowSignIn",Ut="sfGuestUserModelOpened",zt="sfGuestUserNameUpdated",Bt="sfGuestUserBannerOpened",Ht="sfCustomerMetadata",Wt="sfSamlConfig",Gt="superflow-file-viewer-staging.web.app",Kt="drive.usesuperflow.com",Zt="tool:spell-check",Jt="tool:broken-links",Yt="terminal",qt="suggestion",Qt={VELT_ROOT:"velt-root",VELT_PRESENCE:"velt-presence",VELT_CURSOR:"velt-cursor",VELT_COMMENT_TOOL:"velt-comment-tool",VELT_COMMENTS:"velt-comments",SNIPPYLY_TEXT_HIGHLIGHT:"snippyly-text-highlight",VELT_COMMENTS_SIDEBAR:"velt-comments-sidebar",VELT_HUDDLE:"velt-huddle",VELT_RECORDER_NOTES:"velt-recorder-notes",VELT_RECORDER_CONTROL_PANEL:"velt-recorder-control-panel",VELT_ARROWS:"velt-arrows",VELT_NOTIFICATIONS_HISTORY_PANEL:"velt-notifications-history-panel"},Xt={ENABLE_URL_NAVIGATION:"enable-url-navigation",CURRENT_LOCATION_SUFFIX:"current-location-suffix"},te={customBranding:{logo:{logoMark:{lightUrl:'\n\t\t\t\t<svg viewBox="0 0 49 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t<path d="M8 8C8 3.58172 11.5817 0 16 0V0C20.4183 0 24 3.58172 24 8V16H16C11.5817 16 8 12.4183 8 8V8Z" fill="#FFCD2E"/>\n\t\t\t\t\t<path d="M0 29C0 22.3726 5.37258 17 12 17H24V29C24 35.6274 18.6274 41 12 41V41C5.37258 41 0 35.6274 0 29V29Z" fill="#A259FE"/>\n\t\t\t\t\t<path d="M25 19C25 12.3726 30.3726 7 37 7V7C43.6274 7 49 12.3726 49 19V19C49 25.6274 43.6274 31 37 31H25V19Z" fill="#FF7162"/>\n\t\t\t\t\t<path d="M25 32H33C37.4183 32 41 35.5817 41 40V40C41 44.4183 37.4183 48 33 48V48C28.5817 48 25 44.4183 25 40V32Z" fill="#0DCF82"/>\n\t\t\t\t</svg>\n\t\t\t\t',darkUrl:'\n\t\t\t\t<svg viewBox="0 0 49 48" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t<path d="M8 8C8 3.58172 11.5817 0 16 0V0C20.4183 0 24 3.58172 24 8V16H16C11.5817 16 8 12.4183 8 8V8Z" fill="#FFCD2E"/>\n\t\t\t\t\t<path d="M0 29C0 22.3726 5.37258 17 12 17H24V29C24 35.6274 18.6274 41 12 41V41C5.37258 41 0 35.6274 0 29V29Z" fill="#A259FE"/>\n\t\t\t\t\t<path d="M25 19C25 12.3726 30.3726 7 37 7V7C43.6274 7 49 12.3726 49 19V19C49 25.6274 43.6274 31 37 31H25V19Z" fill="#FF7162"/>\n\t\t\t\t\t<path d="M25 32H33C37.4183 32 41 35.5817 41 40V40C41 44.4183 37.4183 48 33 48V48C28.5817 48 25 44.4183 25 40V32Z" fill="#0DCF82"/>\n\t\t\t\t</svg>\n\t\t\t\t'},wordMark:{lightUrl:'\n\t\t\t\t<svg width="257" height="65" viewBox="0 0 257 65" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t<path d="M8 16C8 11.5817 11.5817 8 16 8V8C20.4183 8 24 11.5817 24 16V24H16C11.5817 24 8 20.4183 8 16V16Z" fill="#FFCD2E"/>\n\t\t\t\t\t<path d="M0 37C0 30.3726 5.37258 25 12 25H24V37C24 43.6274 18.6274 49 12 49V49C5.37258 49 0 43.6274 0 37V37Z" fill="#A259FE"/>\n\t\t\t\t\t<path d="M25 27C25 20.3726 30.3726 15 37 15V15C43.6274 15 49 20.3726 49 27V27C49 33.6274 43.6274 39 37 39H25V27Z" fill="#FF7162"/>\n\t\t\t\t\t<path d="M25 40H33C37.4183 40 41 43.5817 41 48V48C41 52.4183 37.4183 56 33 56V56C28.5817 56 25 52.4183 25 48V40Z" fill="#0DCF82"/>\n\t\t\t\t\t<path d="M73.4 46.28C71.4533 46.28 69.6933 45.9467 68.12 45.28C66.5733 44.6133 65.3467 43.6533 64.44 42.4C63.5333 41.1467 63.0667 39.6667 63.04 37.96H69.04C69.12 39.1067 69.52 40.0133 70.24 40.68C70.9867 41.3467 72 41.68 73.28 41.68C74.5867 41.68 75.6133 41.3733 76.36 40.76C77.1067 40.12 77.48 39.2933 77.48 38.28C77.48 37.4533 77.2267 36.7733 76.72 36.24C76.2133 35.7067 75.5733 35.2933 74.8 35C74.0533 34.68 73.0133 34.3333 71.68 33.96C69.8667 33.4267 68.3867 32.9067 67.24 32.4C66.12 31.8667 65.1467 31.08 64.32 30.04C63.52 28.9733 63.12 27.56 63.12 25.8C63.12 24.1467 63.5333 22.7067 64.36 21.48C65.1867 20.2533 66.3467 19.32 67.84 18.68C69.3333 18.0133 71.04 17.68 72.96 17.68C75.84 17.68 78.1733 18.3867 79.96 19.8C81.7733 21.1867 82.7733 23.1333 82.96 25.64H76.8C76.7467 24.68 76.3333 23.8933 75.56 23.28C74.8133 22.64 73.8133 22.32 72.56 22.32C71.4667 22.32 70.5867 22.6 69.92 23.16C69.28 23.72 68.96 24.5333 68.96 25.6C68.96 26.3467 69.2 26.9733 69.68 27.48C70.1867 27.96 70.8 28.36 71.52 28.68C72.2667 28.9733 73.3067 29.32 74.64 29.72C76.4533 30.2533 77.9333 30.7867 79.08 31.32C80.2267 31.8533 81.2133 32.6533 82.04 33.72C82.8667 34.7867 83.28 36.1867 83.28 37.92C83.28 39.4133 82.8933 40.8 82.12 42.08C81.3467 43.36 80.2133 44.3867 78.72 45.16C77.2267 45.9067 75.4533 46.28 73.4 46.28ZM107.855 23.84V46H102.215V43.2C101.495 44.16 100.548 44.92 99.375 45.48C98.2283 46.0133 96.975 46.28 95.615 46.28C93.8817 46.28 92.3483 45.92 91.015 45.2C89.6817 44.4533 88.6283 43.3733 87.855 41.96C87.1083 40.52 86.735 38.8133 86.735 36.84V23.84H92.335V36.04C92.335 37.8 92.775 39.16 93.655 40.12C94.535 41.0533 95.735 41.52 97.255 41.52C98.8017 41.52 100.015 41.0533 100.895 40.12C101.775 39.16 102.215 37.8 102.215 36.04V23.84H107.855ZM116.98 27.04C117.7 26.0267 118.687 25.1867 119.94 24.52C121.22 23.8267 122.674 23.48 124.3 23.48C126.194 23.48 127.9 23.9467 129.42 24.88C130.967 25.8133 132.18 27.1467 133.06 28.88C133.967 30.5867 134.42 32.5733 134.42 34.84C134.42 37.1067 133.967 39.12 133.06 40.88C132.18 42.6133 130.967 43.96 129.42 44.92C127.9 45.88 126.194 46.36 124.3 46.36C122.674 46.36 121.234 46.0267 119.98 45.36C118.754 44.6933 117.754 43.8533 116.98 42.84V56.56H111.38V23.84H116.98V27.04ZM128.7 34.84C128.7 33.5067 128.42 32.36 127.86 31.4C127.327 30.4133 126.607 29.6667 125.7 29.16C124.82 28.6533 123.86 28.4 122.82 28.4C121.807 28.4 120.847 28.6667 119.94 29.2C119.06 29.7067 118.34 30.4533 117.78 31.44C117.247 32.4267 116.98 33.5867 116.98 34.92C116.98 36.2533 117.247 37.4133 117.78 38.4C118.34 39.3867 119.06 40.1467 119.94 40.68C120.847 41.1867 121.807 41.44 122.82 41.44C123.86 41.44 124.82 41.1733 125.7 40.64C126.607 40.1067 127.327 39.3467 127.86 38.36C128.42 37.3733 128.7 36.2 128.7 34.84ZM158.29 34.44C158.29 35.24 158.236 35.96 158.13 36.6H141.93C142.063 38.2 142.623 39.4533 143.61 40.36C144.596 41.2667 145.81 41.72 147.25 41.72C149.33 41.72 150.81 40.8267 151.69 39.04H157.73C157.09 41.1733 155.863 42.9333 154.05 44.32C152.236 45.68 150.01 46.36 147.37 46.36C145.236 46.36 143.316 45.8933 141.61 44.96C139.93 44 138.61 42.6533 137.65 40.92C136.716 39.1867 136.25 37.1867 136.25 34.92C136.25 32.6267 136.716 30.6133 137.65 28.88C138.583 27.1467 139.89 25.8133 141.57 24.88C143.25 23.9467 145.183 23.48 147.37 23.48C149.476 23.48 151.356 23.9333 153.01 24.84C154.69 25.7467 155.983 27.04 156.89 28.72C157.823 30.3733 158.29 32.28 158.29 34.44ZM152.49 32.84C152.463 31.4 151.943 30.2533 150.93 29.4C149.916 28.52 148.676 28.08 147.21 28.08C145.823 28.08 144.65 28.5067 143.69 29.36C142.756 30.1867 142.183 31.3467 141.97 32.84H152.49ZM167.177 27.28C167.897 26.1067 168.831 25.1867 169.977 24.52C171.151 23.8533 172.484 23.52 173.977 23.52V29.4H172.497C170.737 29.4 169.404 29.8133 168.497 30.64C167.617 31.4667 167.177 32.9067 167.177 34.96V46H161.577V23.84H167.177V27.28ZM188.309 28.44H184.429V46H178.749V28.44H176.229V23.84H178.749V22.72C178.749 20 179.522 18 181.069 16.72C182.616 15.44 184.949 14.84 188.069 14.92V19.64C186.709 19.6133 185.762 19.84 185.229 20.32C184.696 20.8 184.429 21.6667 184.429 22.92V23.84H188.309V28.44ZM197.538 16.4V46H191.938V16.4H197.538ZM211.711 46.36C209.578 46.36 207.658 45.8933 205.951 44.96C204.244 44 202.898 42.6533 201.911 40.92C200.951 39.1867 200.471 37.1867 200.471 34.92C200.471 32.6533 200.964 30.6533 201.951 28.92C202.964 27.1867 204.338 25.8533 206.071 24.92C207.804 23.96 209.738 23.48 211.871 23.48C214.004 23.48 215.938 23.96 217.671 24.92C219.404 25.8533 220.764 27.1867 221.751 28.92C222.764 30.6533 223.271 32.6533 223.271 34.92C223.271 37.1867 222.751 39.1867 221.711 40.92C220.698 42.6533 219.311 44 217.551 44.96C215.818 45.8933 213.871 46.36 211.711 46.36ZM211.711 41.48C212.724 41.48 213.671 41.24 214.551 40.76C215.458 40.2533 216.178 39.5067 216.711 38.52C217.244 37.5333 217.511 36.3333 217.511 34.92C217.511 32.8133 216.951 31.2 215.831 30.08C214.738 28.9333 213.391 28.36 211.791 28.36C210.191 28.36 208.844 28.9333 207.751 30.08C206.684 31.2 206.151 32.8133 206.151 34.92C206.151 37.0267 206.671 38.6533 207.711 39.8C208.778 40.92 210.111 41.48 211.711 41.48ZM256.499 23.84L250.019 46H243.979L239.939 30.52L235.899 46H229.819L223.299 23.84H228.979L232.899 40.72L237.139 23.84H243.059L247.219 40.68L251.139 23.84H256.499Z" fill="#141416"/>\n\t\t\t\t</svg>\n\t\t\t\t',darkUrl:'\n\t\t\t\t<svg width="257" height="65" viewBox="0 0 257 65" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t<path d="M8 16C8 11.5817 11.5817 8 16 8V8C20.4183 8 24 11.5817 24 16V24H16C11.5817 24 8 20.4183 8 16V16Z" fill="#FFCD2E"/>\n\t\t\t\t\t<path d="M0 37C0 30.3726 5.37258 25 12 25H24V37C24 43.6274 18.6274 49 12 49V49C5.37258 49 0 43.6274 0 37V37Z" fill="#A259FE"/>\n\t\t\t\t\t<path d="M25 27C25 20.3726 30.3726 15 37 15V15C43.6274 15 49 20.3726 49 27V27C49 33.6274 43.6274 39 37 39H25V27Z" fill="#FF7162"/>\n\t\t\t\t\t<path d="M25 40H33C37.4183 40 41 43.5817 41 48V48C41 52.4183 37.4183 56 33 56V56C28.5817 56 25 52.4183 25 48V40Z" fill="#0DCF82"/>\n\t\t\t\t\t<path d="M73.4 46.28C71.4533 46.28 69.6933 45.9467 68.12 45.28C66.5733 44.6133 65.3467 43.6533 64.44 42.4C63.5333 41.1467 63.0667 39.6667 63.04 37.96H69.04C69.12 39.1067 69.52 40.0133 70.24 40.68C70.9867 41.3467 72 41.68 73.28 41.68C74.5867 41.68 75.6133 41.3733 76.36 40.76C77.1067 40.12 77.48 39.2933 77.48 38.28C77.48 37.4533 77.2267 36.7733 76.72 36.24C76.2133 35.7067 75.5733 35.2933 74.8 35C74.0533 34.68 73.0133 34.3333 71.68 33.96C69.8667 33.4267 68.3867 32.9067 67.24 32.4C66.12 31.8667 65.1467 31.08 64.32 30.04C63.52 28.9733 63.12 27.56 63.12 25.8C63.12 24.1467 63.5333 22.7067 64.36 21.48C65.1867 20.2533 66.3467 19.32 67.84 18.68C69.3333 18.0133 71.04 17.68 72.96 17.68C75.84 17.68 78.1733 18.3867 79.96 19.8C81.7733 21.1867 82.7733 23.1333 82.96 25.64H76.8C76.7467 24.68 76.3333 23.8933 75.56 23.28C74.8133 22.64 73.8133 22.32 72.56 22.32C71.4667 22.32 70.5867 22.6 69.92 23.16C69.28 23.72 68.96 24.5333 68.96 25.6C68.96 26.3467 69.2 26.9733 69.68 27.48C70.1867 27.96 70.8 28.36 71.52 28.68C72.2667 28.9733 73.3067 29.32 74.64 29.72C76.4533 30.2533 77.9333 30.7867 79.08 31.32C80.2267 31.8533 81.2133 32.6533 82.04 33.72C82.8667 34.7867 83.28 36.1867 83.28 37.92C83.28 39.4133 82.8933 40.8 82.12 42.08C81.3467 43.36 80.2133 44.3867 78.72 45.16C77.2267 45.9067 75.4533 46.28 73.4 46.28ZM107.855 23.84V46H102.215V43.2C101.495 44.16 100.548 44.92 99.375 45.48C98.2283 46.0133 96.975 46.28 95.615 46.28C93.8817 46.28 92.3483 45.92 91.015 45.2C89.6817 44.4533 88.6283 43.3733 87.855 41.96C87.1083 40.52 86.735 38.8133 86.735 36.84V23.84H92.335V36.04C92.335 37.8 92.775 39.16 93.655 40.12C94.535 41.0533 95.735 41.52 97.255 41.52C98.8017 41.52 100.015 41.0533 100.895 40.12C101.775 39.16 102.215 37.8 102.215 36.04V23.84H107.855ZM116.98 27.04C117.7 26.0267 118.687 25.1867 119.94 24.52C121.22 23.8267 122.674 23.48 124.3 23.48C126.194 23.48 127.9 23.9467 129.42 24.88C130.967 25.8133 132.18 27.1467 133.06 28.88C133.967 30.5867 134.42 32.5733 134.42 34.84C134.42 37.1067 133.967 39.12 133.06 40.88C132.18 42.6133 130.967 43.96 129.42 44.92C127.9 45.88 126.194 46.36 124.3 46.36C122.674 46.36 121.234 46.0267 119.98 45.36C118.754 44.6933 117.754 43.8533 116.98 42.84V56.56H111.38V23.84H116.98V27.04ZM128.7 34.84C128.7 33.5067 128.42 32.36 127.86 31.4C127.327 30.4133 126.607 29.6667 125.7 29.16C124.82 28.6533 123.86 28.4 122.82 28.4C121.807 28.4 120.847 28.6667 119.94 29.2C119.06 29.7067 118.34 30.4533 117.78 31.44C117.247 32.4267 116.98 33.5867 116.98 34.92C116.98 36.2533 117.247 37.4133 117.78 38.4C118.34 39.3867 119.06 40.1467 119.94 40.68C120.847 41.1867 121.807 41.44 122.82 41.44C123.86 41.44 124.82 41.1733 125.7 40.64C126.607 40.1067 127.327 39.3467 127.86 38.36C128.42 37.3733 128.7 36.2 128.7 34.84ZM158.29 34.44C158.29 35.24 158.236 35.96 158.13 36.6H141.93C142.063 38.2 142.623 39.4533 143.61 40.36C144.596 41.2667 145.81 41.72 147.25 41.72C149.33 41.72 150.81 40.8267 151.69 39.04H157.73C157.09 41.1733 155.863 42.9333 154.05 44.32C152.236 45.68 150.01 46.36 147.37 46.36C145.236 46.36 143.316 45.8933 141.61 44.96C139.93 44 138.61 42.6533 137.65 40.92C136.716 39.1867 136.25 37.1867 136.25 34.92C136.25 32.6267 136.716 30.6133 137.65 28.88C138.583 27.1467 139.89 25.8133 141.57 24.88C143.25 23.9467 145.183 23.48 147.37 23.48C149.476 23.48 151.356 23.9333 153.01 24.84C154.69 25.7467 155.983 27.04 156.89 28.72C157.823 30.3733 158.29 32.28 158.29 34.44ZM152.49 32.84C152.463 31.4 151.943 30.2533 150.93 29.4C149.916 28.52 148.676 28.08 147.21 28.08C145.823 28.08 144.65 28.5067 143.69 29.36C142.756 30.1867 142.183 31.3467 141.97 32.84H152.49ZM167.177 27.28C167.897 26.1067 168.831 25.1867 169.977 24.52C171.151 23.8533 172.484 23.52 173.977 23.52V29.4H172.497C170.737 29.4 169.404 29.8133 168.497 30.64C167.617 31.4667 167.177 32.9067 167.177 34.96V46H161.577V23.84H167.177V27.28ZM188.309 28.44H184.429V46H178.749V28.44H176.229V23.84H178.749V22.72C178.749 20 179.522 18 181.069 16.72C182.616 15.44 184.949 14.84 188.069 14.92V19.64C186.709 19.6133 185.762 19.84 185.229 20.32C184.696 20.8 184.429 21.6667 184.429 22.92V23.84H188.309V28.44ZM197.538 16.4V46H191.938V16.4H197.538ZM211.711 46.36C209.578 46.36 207.658 45.8933 205.951 44.96C204.244 44 202.898 42.6533 201.911 40.92C200.951 39.1867 200.471 37.1867 200.471 34.92C200.471 32.6533 200.964 30.6533 201.951 28.92C202.964 27.1867 204.338 25.8533 206.071 24.92C207.804 23.96 209.738 23.48 211.871 23.48C214.004 23.48 215.938 23.96 217.671 24.92C219.404 25.8533 220.764 27.1867 221.751 28.92C222.764 30.6533 223.271 32.6533 223.271 34.92C223.271 37.1867 222.751 39.1867 221.711 40.92C220.698 42.6533 219.311 44 217.551 44.96C215.818 45.8933 213.871 46.36 211.711 46.36ZM211.711 41.48C212.724 41.48 213.671 41.24 214.551 40.76C215.458 40.2533 216.178 39.5067 216.711 38.52C217.244 37.5333 217.511 36.3333 217.511 34.92C217.511 32.8133 216.951 31.2 215.831 30.08C214.738 28.9333 213.391 28.36 211.791 28.36C210.191 28.36 208.844 28.9333 207.751 30.08C206.684 31.2 206.151 32.8133 206.151 34.92C206.151 37.0267 206.671 38.6533 207.711 39.8C208.778 40.92 210.111 41.48 211.711 41.48ZM256.499 23.84L250.019 46H243.979L239.939 30.52L235.899 46H229.819L223.299 23.84H228.979L232.899 40.72L237.139 23.84H243.059L247.219 40.68L251.139 23.84H256.499Z" fill="white"/>\n\t\t\t\t</svg>\n\t\t\t\t'}}}},ee=[{name:"Peppa Pig",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fpeppa_pig.svg?alt=media&token=a9fc83f7-b347-4868-8d52-0e888f0de73a&_gl=1*jzxghx*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTQ5LjQyLjAuMA.."},{name:"Dazzling Dalmatian",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fdazzling_dalmatian.svg?alt=media&token=5842b24c-7e58-4bb5-96c2-d09aa11f7f9e&_gl=1*11ayw3z*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQxOTY4LjExLjAuMA.."},{name:"Rosy Rabbit",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Frosy_rabbit.svg?alt=media&token=4e65a9e3-080d-4416-839d-e761b6b37181&_gl=1*156om5t*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMjUzLjYwLjAuMA.."},{name:"Leo the Lion",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fleo_the_lion.svg?alt=media&token=58d1296e-fefd-42ce-80ea-ae2cc830f1a9&_gl=1*1cz8e9q*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTAwLjIwLjAuMA.."},{name:"Ducky Down",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fducky_down.svg?alt=media&token=d67ae889-78c5-46e3-aaa9-3eb511fe90b3&_gl=1*cxyj7o*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQxOTkwLjYwLjAuMA.."},{name:"Merry Monkey",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fmerry_monkey.svg?alt=media&token=5bd2f69a-7211-42df-9718-5339c467b2d1&_gl=1*1labjed*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTE3LjMuMC4w"},{name:"Ecstatic Elephant",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fecstatic_elephant.svg?alt=media&token=fbd2ba76-6c3a-47a7-beac-0460a2178b7d&_gl=1*aku3ps*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMDA3LjQzLjAuMA.."},{name:"Baby Bear",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fbaby_bear.svg?alt=media&token=71d0c5fb-60aa-4304-adc1-635a83650bde&_gl=1*1dxajmf*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQxMjQyLjUyLjAuMA.."},{name:"Freddy Froglet",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Ffreddy_froglet.svg?alt=media&token=e3b2e292-6480-4507-9da3-21a62a1346d4&_gl=1*s4yycs*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMDQzLjcuMC4w"},{name:"Powerful Panda",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fpowerful_panda.svg?alt=media&token=07f9d60f-aa14-4a77-ad5b-c48ee76db3f5&_gl=1*7gfuit*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTkzLjYwLjAuMA.."},{name:"Curious Cat",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fcurious_cat.svg?alt=media&token=dccf6824-3b7c-4e4e-8559-40fbb8ff6186&_gl=1*1nwi0ti*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQxOTM3LjQyLjAuMA.."},{name:"Playful Penguin",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fplayful_penguin.svg?alt=media&token=c6d1b11a-43a6-4001-ae56-e04fd5a3f965&_gl=1*1xdxvkx*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTYzLjI4LjAuMA.."},{name:"Kind Koala",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fkind_koala.svg?alt=media&token=974396d6-6ccd-4367-8563-b27634849cb5&_gl=1*1w1gbnn*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMDgwLjQwLjAuMA.."},{name:"Tommy Tiger",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Ftommy_tiger.svg?alt=media&token=40a95ac7-cc91-4b74-859a-4e2e5964b967&_gl=1*1n0cr0n*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMjczLjQwLjAuMA.."},{name:"Wally Walrus",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fwally_walrus.svg?alt=media&token=31e02ef2-c986-4724-b987-dca97f84f81b&_gl=1*y5by2c*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMjkxLjIyLjAuMA.."},{name:"Ricky Rhino",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fricky_rhino.svg?alt=media&token=5d9dafe5-f4de-4f8b-94c1-49e01c776611&_gl=1*zyp4n2*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMjMxLjIyLjAuMA.."},{name:"Oliver Otter",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Foliver_otter.svg?alt=media&token=5298b869-0903-40b2-a702-224a3e0bcd95&_gl=1*aicppz*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMTMxLjYwLjAuMA.."},{name:"Reggie Ratling",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Freggie_ratling.svg?alt=media&token=f37fd4a0-9dbd-403a-bb82-81fdfb63cf88&_gl=1*16lzeql*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMjA3LjQ2LjAuMA.."},{name:"Gentle Giraffe",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Fgentle_giraffe.svg?alt=media&token=f097ec12-e8ce-4d26-bf32-43e470eb7907&_gl=1*11ctuwz*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMDYwLjYwLjAuMA.."},{name:"Fabulous Fox",photoUrl:"https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/avatars%2Ffabulous_fox.svg?alt=media&token=fe1a4236-af45-427f-a035-1eda417b0682&_gl=1*xyyv1g*_ga*NTc3MjEzMjIwLjE2NjEwODkwMDU.*_ga_CW55HF8NVT*MTY5NzE0MTIzNC4zMzMuMS4xNjk3MTQyMDIxLjI5LjAuMA.."}];var ie=Object.freeze({__proto__:null,AGENT_TOOL_BROKEN_LINKS:Jt,AGENT_TOOL_SPELL_CHECK:Zt,ANNOTATION_STATUS_TERMINAL:Yt,ANNOTATION_TYPE_SUGGESTION:qt,ATTRIBUTES:Xt,DEFAULT_CUSTOMER_METADATA:te,DOCUMENT_TITLE_CHANGE_LISTENER_API_KEYS:mt,DRIVE_PROD_URL:Kt,DRIVE_STAGING_URL:Gt,EXCLUDED_API_KEYS_FROM_LATEST_VERSION:["I9R2VqG45F5AgpIicnht"],FEEDBACK_MODE:bt,FIGMA_DEMO_MODAL:At,GUEST_USERS:ee,LIVE_DEMO_MODAL:Nt,PROJECT_INSTALL:It,PROJECT_VERSION:_t,PROJECT_VERSION_DEFAULT_KEY:Tt,PROJECT_VERSION_KEY:Mt,REVIEW_DOC_ID:yt,REVIEW_MODE:wt,SNIPPYLY_COMMENT_ID:Ct,SNIPPYLY_TOKEN:Et,SNIPPYLY_USER:xt,SUPERFLOW_CUSTOMER_METADATA:Ht,SUPERFLOW_DOCUMENT_METADATA:"sfDocumentMetadata",SUPERFLOW_GUEST_MODE:$t,SUPERFLOW_GUEST_MODE_ALLOW_SIGN_IN:Rt,SUPERFLOW_GUEST_USER_BANNER_OPENED:Bt,SUPERFLOW_GUEST_USER_MODEL_OPENED:Ut,SUPERFLOW_GUEST_USER_NAME_MODEL_OPENED:"sfGuestUserNameModelOpened",SUPERFLOW_GUEST_USER_NAME_UPDATED:zt,SUPERFLOW_GUEST_USER_TOKEN:St,SUPERFLOW_PASSWORD_IS_VALID:jt,SUPERFLOW_PASSWORD_PROTECTED:Dt,SUPERFLOW_PRIVATE_MODE:Pt,SUPERFLOW_QUERY_PARAMS_COMMENTS:Vt,SUPERFLOW_SAML_CONFIG:Wt,SUPERFLOW_USER_ADMIN:Ot,SUPERFLOW_USER_TOKEN:kt,SUPERFLOW_USE_PAGE_TITLE_AS_LOCATION_NAME:Ft,SUPERFLOW_VERSION:vt,TAGS:Qt,TOUR_COMMENT_TOOLTIP:Lt,VELT_SDK_DEVELOP_VERSION:gt,VELT_SDK_PROD_VERSION:ft,VELT_SDK_STAGING_VERSION:"3.0.92"});const oe=!0,ne="https://superflow-portal-v2-staging.firebaseapp.com/",se="9dbcd2509e0fa90a5c81f038ce618e3f",re="6d24f74f12f6fb84c87efa8f791cfb2e",ae="https://us-central1-snipply-sdk-staging.cloudfunctions.net/sa",le="https://us-central1-snipply-sdk-staging.cloudfunctions.net/superflowtoolbarhandler",ce=function(t){const e=[];let i=0;for(let o=0;o<t.length;o++){let n=t.charCodeAt(o);n<128?e[i++]=n:n<2048?(e[i++]=n>>6|192,e[i++]=63&n|128):55296==(64512&n)&&o+1<t.length&&56320==(64512&t.charCodeAt(o+1))?(n=65536+((1023&n)<<10)+(1023&t.charCodeAt(++o)),e[i++]=n>>18|240,e[i++]=n>>12&63|128,e[i++]=n>>6&63|128,e[i++]=63&n|128):(e[i++]=n>>12|224,e[i++]=n>>6&63|128,e[i++]=63&n|128)}return e},de={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const i=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,o=[];for(let e=0;e<t.length;e+=3){const n=t[e],s=e+1<t.length,r=s?t[e+1]:0,a=e+2<t.length,l=a?t[e+2]:0,c=n>>2,d=(3&n)<<4|r>>4;let h=(15&r)<<2|l>>6,u=63&l;a||(u=64,s||(h=64)),o.push(i[c],i[d],i[h],i[u])}return o.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(ce(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){const e=[];let i=0,o=0;for(;i<t.length;){const n=t[i++];if(n<128)e[o++]=String.fromCharCode(n);else if(n>191&&n<224){const s=t[i++];e[o++]=String.fromCharCode((31&n)<<6|63&s)}else if(n>239&&n<365){const s=((7&n)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536;e[o++]=String.fromCharCode(55296+(s>>10)),e[o++]=String.fromCharCode(56320+(1023&s))}else{const s=t[i++],r=t[i++];e[o++]=String.fromCharCode((15&n)<<12|(63&s)<<6|63&r)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const i=e?this.charToByteMapWebSafe_:this.charToByteMap_,o=[];for(let e=0;e<t.length;){const n=i[t.charAt(e++)],s=e<t.length?i[t.charAt(e)]:0;++e;const r=e<t.length?i[t.charAt(e)]:64;++e;const a=e<t.length?i[t.charAt(e)]:64;if(++e,null==n||null==s||null==r||null==a)throw new he;const l=n<<2|s>>4;if(o.push(l),64!==r){const t=s<<4&240|r>>2;if(o.push(t),64!==a){const t=r<<6&192|a;o.push(t)}}}return o},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class he extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const ue=function(t){return function(t){const e=ce(t);return de.encodeByteArray(e,!0)}(t).replace(/\./g,"")},pe=function(t){try{return de.decodeString(t,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};
72
72
  /**
73
73
  * @license
74
74
  * Copyright 2022 Google LLC
@@ -4417,7 +4417,7 @@ class Kl extends Or{}Kl.Encryptor=class extends Kl{processBlock(t,e){const i=t,o
4417
4417
  .cws-list::-webkit-scrollbar-thumb:hover {
4418
4418
  background: #9CA3AF;
4419
4419
  }
4420
- `;var ud,pd=function(t,e,i,o){for(var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r};let vd=ud=class extends Q{constructor(){super(...arguments),this.spellingWarnings=[],this.grammarWarnings=[],this.brokenLinkWarnings=[],this.isLoading=!1,this.currentPageUrl="",this.apiKey="",this.organizationId="",this.documentId="",this.openAccordions=new Set,this.currentView="categories",this.isCheckingStatus=!1,this.isRunningCheck=!1,this.currentExecutionId=null,this.pollingIntervalId=null,this.pollingAttempts=0,this.MAX_POLLING_ATTEMPTS=30,this.POLLING_INTERVAL_MS=6e4,this.checkForActiveExecution=async()=>{try{if(!this.apiKey||!this.organizationId||!this.documentId)return;this.isCheckingStatus=!0,await this.updateComplete;const{getActiveQAExecution:t}=await Promise.resolve().then((function(){return id})),e=await t(this.apiKey,this.organizationId,this.documentId),i=null==e?void 0:e.data;if(!(null==i?void 0:i.executionId))return;const o=null==i?void 0:i.status;"pending"!==o&&"running"!==o||(this.currentExecutionId=i.executionId,this.isRunningCheck=!0,await this.updateComplete,this.startPolling())}catch(t){console.warn("Error in checkForActiveExecution: ",t)}finally{this.isCheckingStatus=!1,await this.updateComplete}},this.startPolling=()=>{try{this.pollingAttempts=0,this.stopPolling(),this.pollExecutionStatus(),this.pollingIntervalId=window.setInterval((()=>{this.pollExecutionStatus()}),this.POLLING_INTERVAL_MS)}catch(t){console.warn("Error in startPolling: ",t)}},this.stopPolling=()=>{try{null!==this.pollingIntervalId&&(window.clearInterval(this.pollingIntervalId),this.pollingIntervalId=null),this.pollingAttempts=0}catch(t){console.warn("Error in stopPolling: ",t)}},this.pollExecutionStatus=async()=>{try{if(!(this.currentExecutionId&&this.apiKey&&this.organizationId&&this.documentId))return this.stopPolling(),void(this.isRunningCheck=!1);if(this.pollingAttempts++,this.pollingAttempts>this.MAX_POLLING_ATTEMPTS)return console.warn("[Content Warning Sidebar] Max polling attempts reached, stopping"),this.stopPolling(),this.isRunningCheck=!1,void(this.currentExecutionId=null);const{getQAExecutionStatus:t}=await Promise.resolve().then((function(){return id})),e=await t(this.apiKey,this.organizationId,this.documentId,this.currentExecutionId),i=null==e?void 0:e.data;if(!i)return;const o=null==i?void 0:i.status;"completed"!==o&&"failed"!==o||(this.stopPolling(),this.isRunningCheck=!1,this.currentExecutionId=null,this.dispatchEvent(new CustomEvent("qa-execution-complete",{bubbles:!0,composed:!0,detail:{executionId:this.currentExecutionId,status:o}})))}catch(t){console.warn("Error in pollExecutionStatus: ",t)}},this.getCategories=()=>{var t,e;try{return[{key:"spelling",label:"Spelling Mistakes",count:(null===(t=this.spellingWarnings)||void 0===t?void 0:t.length)||0},{key:"broken-links",label:"Broken Links",count:(null===(e=this.brokenLinkWarnings)||void 0===e?void 0:e.length)||0}]}catch(t){return console.warn("Error in getCategories: ",t),[]}},this.onCategoryClick=t=>{try{this.currentView=t,this.autoOpenCurrentPageAccordion(t)}catch(t){console.warn("Error in onCategoryClick: ",t)}},this.autoOpenCurrentPageAccordion=t=>{try{let e=[];"spelling"===t?e=this.spellingWarnings:"grammar"===t?e=this.grammarWarnings:"brokenLinks"===t&&(e=this.brokenLinkWarnings);const i=this.groupWarningsByPage(e),o=null==i?void 0:i.find((t=>null==t?void 0:t.isCurrentPage));this.openAccordions=new Set,(null==o?void 0:o.pageUrl)&&this.openAccordions.add(o.pageUrl)}catch(t){console.warn("Error in autoOpenCurrentPageAccordion: ",t)}},this.onBackClick=()=>{try{this.currentView="categories"}catch(t){console.warn("Error in onBackClick: ",t)}},this.onRefresh=async()=>{var t,e;try{if(!this.apiKey||!this.organizationId||!this.documentId)return void console.warn("[Content Warning Sidebar] Cannot run QA check: missing apiKey, organizationId, or documentId");if(this.isRunningCheck||this.isCheckingStatus)return;const e=window.location.href;this.isRunningCheck=!0,this.requestUpdate(),await this.updateComplete;const{getUserFromToken:i}=await Promise.resolve().then((function(){return Mc})),o=i(),n=o?{userId:o.userId||"",name:o.name||"",email:o.email||""}:void 0,{runQAAgent:s,trackEvent:r}=await Promise.resolve().then((function(){return id}));r(pt.Events.QUALITY_CHECK_RUN_TOOLBAR_CLICKED);const a=await s(this.apiKey,this.organizationId,this.documentId,e,void 0,!1,5,n);if(null===a)return console.error("[Content Warning Sidebar] runQAAgent returned null"),void(this.isRunningCheck=!1);if(null==a?void 0:a.error){const t=(a.error.message||"").match(/already running.*Execution ID:\s*(\S+)/i);if(null==t?void 0:t[1]){const e=t[1];return this.currentExecutionId=e,void this.startPolling()}return console.error("[Content Warning Sidebar] Error starting QA run:",a.error),void(this.isRunningCheck=!1)}const l=null===(t=null==a?void 0:a.data)||void 0===t?void 0:t.executionId;console.log("[Content Warning Sidebar] Extracted executionId:",l),l?(this.currentExecutionId=l,this.startPolling()):(console.warn("[Content Warning Sidebar] No executionId returned from QA run. Full result:",a),this.isRunningCheck=!1)}catch(t){const i=((null===(e=null==t?void 0:t.error)||void 0===e?void 0:e.message)||(null==t?void 0:t.message)||"").match(/already running.*Execution ID:\s*(\S+)/i);if(null==i?void 0:i[1]){const t=i[1];return this.currentExecutionId=t,void this.startPolling()}console.warn("Error in onRefresh: ",t),this.isRunningCheck=!1}},this.onWarningRowClick=t=>{var e;try{const i=null===(e=null==t?void 0:t.annotations)||void 0===e?void 0:e[0];if(!i)return;this.dispatchEvent(new CustomEvent("content-warning-item-click",{bubbles:!0,composed:!0,detail:{annotation:i}}))}catch(t){console.warn("Error in onWarningRowClick: ",t)}},this.onAddAllSuggestions=t=>{try{this.dispatchEvent(new CustomEvent("content-warning-sidebar-add-all",{bubbles:!0,composed:!0,detail:{category:t}}))}catch(t){console.warn("Error in onAddAllSuggestions: ",t)}},this.normalizeUrlForGrouping=t=>{try{if(!t)return"";const e="false"!==localStorage.getItem("sfNormalizeParams");let i=t;if(null==t?void 0:t.startsWith("/"))e&&(i=t.split("?")[0].split("#")[0]);else{const o=new URL(t);i=e?(null==o?void 0:o.pathname)||"/":(null==o?void 0:o.pathname)+((null==o?void 0:o.search)||"")+((null==o?void 0:o.hash)||"")}return(null==i?void 0:i.startsWith("/"))?i.substring(1):i}catch{const e=t||"";return(null==e?void 0:e.startsWith("/"))?e.substring(1):e}},this.groupWarningsByPage=t=>{var e,i,o,n,s,r;try{const a=new Map;for(const l of t){if(!(null===(e=null==l?void 0:l.pageUrls)||void 0===e?void 0:e.length)){const t="__unknown__";a.has(t)||a.set(t,{displayUrl:"__unknown__",warnings:[]}),null===(o=null===(i=a.get(t))||void 0===i?void 0:i.warnings)||void 0===o||o.push(l);continue}const t=new Map;for(const e of l.pageUrls){const i=this.normalizeUrlForGrouping(e);t.has(i)||t.set(i,e)}for(const[e,i]of t){const t=(null===(n=l.annotations)||void 0===n?void 0:n.filter((t=>{var i,o,n;const s=(null===(i=null==t?void 0:t.pageInfo)||void 0===i?void 0:i.url)||(null===(o=null==t?void 0:t.location)||void 0===o?void 0:o.url)||(null===(n=null==t?void 0:t.agent)||void 0===n?void 0:n.url)||"";return this.normalizeUrlForGrouping(s)===e})))||[];if(0===t.length)continue;const o={...l,occurrences:t.length,annotations:t};a.has(e)||a.set(e,{displayUrl:i,warnings:[]}),null===(r=null===(s=a.get(e))||void 0===s?void 0:s.warnings)||void 0===r||r.push(o)}}const l=[],c=this.normalizeUrlForGrouping(this.currentPageUrl);for(const[t,{displayUrl:e,warnings:i}]of a){const o="__unknown__"===t?"Unknown":t;l.push({pageUrl:e,pagePath:o,isCurrentPage:t===c&&"__unknown__"!==t,warnings:i})}return l.sort(((t,e)=>{var i;return(null==t?void 0:t.isCurrentPage)?-1:(null==e?void 0:e.isCurrentPage)?1:null===(i=null==t?void 0:t.pagePath)||void 0===i?void 0:i.localeCompare(null==e?void 0:e.pagePath)})),l}catch(t){return console.warn("Error in groupWarningsByPage: ",t),[]}},this.toggleAccordion=t=>{try{const e=new Set(this.openAccordions);e.has(t)?e.delete(t):e.add(t),this.openAccordions=e}catch(t){console.warn("Error in toggleAccordion: ",t)}},this.renderWarningIcon=()=>{try{return O`
4420
+ `;var ud,pd=function(t,e,i,o){for(var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r};let vd=ud=class extends Q{constructor(){super(...arguments),this.spellingWarnings=[],this.grammarWarnings=[],this.brokenLinkWarnings=[],this.isLoading=!1,this.currentPageUrl="",this.apiKey="",this.organizationId="",this.documentId="",this.openAccordions=new Set,this.currentView="categories",this.isCheckingStatus=!1,this.isRunningCheck=!1,this.currentExecutionId=null,this.pollingIntervalId=null,this.pollingAttempts=0,this.MAX_POLLING_ATTEMPTS=30,this.POLLING_INTERVAL_MS=6e4,this.checkForActiveExecution=async()=>{try{if(!this.apiKey||!this.organizationId||!this.documentId)return;this.isCheckingStatus=!0,await this.updateComplete;const{getActiveQAExecution:t}=await Promise.resolve().then((function(){return id})),e=await t(this.apiKey,this.organizationId,this.documentId),i=null==e?void 0:e.data;if(!(null==i?void 0:i.executionId))return;const o=null==i?void 0:i.status;"pending"!==o&&"running"!==o||(this.currentExecutionId=i.executionId,this.isRunningCheck=!0,await this.updateComplete,this.startPolling())}catch(t){console.warn("Error in checkForActiveExecution: ",t)}finally{this.isCheckingStatus=!1,await this.updateComplete}},this.startPolling=()=>{try{this.pollingAttempts=0,this.stopPolling(),this.pollExecutionStatus(),this.pollingIntervalId=window.setInterval((()=>{this.pollExecutionStatus()}),this.POLLING_INTERVAL_MS)}catch(t){console.warn("Error in startPolling: ",t)}},this.stopPolling=()=>{try{null!==this.pollingIntervalId&&(window.clearInterval(this.pollingIntervalId),this.pollingIntervalId=null),this.pollingAttempts=0}catch(t){console.warn("Error in stopPolling: ",t)}},this.pollExecutionStatus=async()=>{try{if(!(this.currentExecutionId&&this.apiKey&&this.organizationId&&this.documentId))return this.stopPolling(),void(this.isRunningCheck=!1);if(this.pollingAttempts++,this.pollingAttempts>this.MAX_POLLING_ATTEMPTS)return console.warn("[Content Warning Sidebar] Max polling attempts reached, stopping"),this.stopPolling(),this.isRunningCheck=!1,void(this.currentExecutionId=null);const{getQAExecutionStatus:t}=await Promise.resolve().then((function(){return id})),e=await t(this.apiKey,this.organizationId,this.documentId,this.currentExecutionId),i=null==e?void 0:e.data;if(!i)return;const o=null==i?void 0:i.status;"completed"!==o&&"failed"!==o||(this.stopPolling(),this.isRunningCheck=!1,this.currentExecutionId=null,this.dispatchEvent(new CustomEvent("qa-execution-complete",{bubbles:!0,composed:!0,detail:{executionId:this.currentExecutionId,status:o}})))}catch(t){console.warn("Error in pollExecutionStatus: ",t)}},this.getCategories=()=>{var t,e;try{return[{key:"spelling",label:"Spelling Mistakes",count:(null===(t=this.spellingWarnings)||void 0===t?void 0:t.length)||0},{key:"broken-links",label:"Broken Links",count:(null===(e=this.brokenLinkWarnings)||void 0===e?void 0:e.length)||0}]}catch(t){return console.warn("Error in getCategories: ",t),[]}},this.onCategoryClick=t=>{try{this.currentView=t,this.autoOpenCurrentPageAccordion(t)}catch(t){console.warn("Error in onCategoryClick: ",t)}},this.autoOpenCurrentPageAccordion=t=>{try{let e=[];"spelling"===t?e=this.spellingWarnings:"grammar"===t?e=this.grammarWarnings:"brokenLinks"===t&&(e=this.brokenLinkWarnings);const i=this.groupWarningsByPage(e),o=null==i?void 0:i.find((t=>null==t?void 0:t.isCurrentPage));this.openAccordions=new Set,(null==o?void 0:o.pageUrl)&&this.openAccordions.add(o.pageUrl)}catch(t){console.warn("Error in autoOpenCurrentPageAccordion: ",t)}},this.onBackClick=()=>{try{this.currentView="categories"}catch(t){console.warn("Error in onBackClick: ",t)}},this.onRefresh=async()=>{var t,e;try{if(!this.apiKey||!this.organizationId||!this.documentId)return void console.warn("[Content Warning Sidebar] Cannot run QA check: missing apiKey, organizationId, or documentId");if(this.isRunningCheck||this.isCheckingStatus)return;const e=window.location.href;this.isRunningCheck=!0,this.requestUpdate(),await this.updateComplete;const{getUserFromToken:i}=await Promise.resolve().then((function(){return Mc})),o=i(),n=o?{userId:o.userId||"",name:o.name||"",email:o.email||""}:void 0,{runQAAgent:s,trackEvent:r}=await Promise.resolve().then((function(){return id}));r(pt.Events.QUALITY_CHECK_RUN_TOOLBAR_CLICKED);const a=await s(this.apiKey,this.organizationId,this.documentId,e,void 0,!1,5,n);if(null===a)return console.error("[Content Warning Sidebar] runQAAgent returned null"),void(this.isRunningCheck=!1);if(null==a?void 0:a.error){const t=(a.error.message||"").match(/already running.*Execution ID:\s*(\S+)/i);if(null==t?void 0:t[1]){const e=t[1];return this.currentExecutionId=e,void this.startPolling()}return console.error("[Content Warning Sidebar] Error starting QA run:",a.error),void(this.isRunningCheck=!1)}const l=null===(t=null==a?void 0:a.data)||void 0===t?void 0:t.executionId;l?(this.currentExecutionId=l,this.startPolling()):(console.warn("[Content Warning Sidebar] No executionId returned from QA run. Full result:",a),this.isRunningCheck=!1)}catch(t){const i=((null===(e=null==t?void 0:t.error)||void 0===e?void 0:e.message)||(null==t?void 0:t.message)||"").match(/already running.*Execution ID:\s*(\S+)/i);if(null==i?void 0:i[1]){const t=i[1];return this.currentExecutionId=t,void this.startPolling()}console.warn("Error in onRefresh: ",t),this.isRunningCheck=!1}},this.onWarningRowClick=t=>{var e;try{const i=null===(e=null==t?void 0:t.annotations)||void 0===e?void 0:e[0];if(!i)return;this.dispatchEvent(new CustomEvent("content-warning-item-click",{bubbles:!0,composed:!0,detail:{annotation:i}}))}catch(t){console.warn("Error in onWarningRowClick: ",t)}},this.onAddAllSuggestions=t=>{try{this.dispatchEvent(new CustomEvent("content-warning-sidebar-add-all",{bubbles:!0,composed:!0,detail:{category:t}}))}catch(t){console.warn("Error in onAddAllSuggestions: ",t)}},this.normalizeUrlForGrouping=t=>{try{if(!t)return"";const e="false"!==localStorage.getItem("sfNormalizeParams");let i=t;if(null==t?void 0:t.startsWith("/"))e&&(i=t.split("?")[0].split("#")[0]);else{const o=new URL(t);i=e?(null==o?void 0:o.pathname)||"/":(null==o?void 0:o.pathname)+((null==o?void 0:o.search)||"")+((null==o?void 0:o.hash)||"")}return(null==i?void 0:i.startsWith("/"))?i.substring(1):i}catch{const e=t||"";return(null==e?void 0:e.startsWith("/"))?e.substring(1):e}},this.groupWarningsByPage=t=>{var e,i,o,n,s,r;try{const a=new Map;for(const l of t){if(!(null===(e=null==l?void 0:l.pageUrls)||void 0===e?void 0:e.length)){const t="__unknown__";a.has(t)||a.set(t,{displayUrl:"__unknown__",warnings:[]}),null===(o=null===(i=a.get(t))||void 0===i?void 0:i.warnings)||void 0===o||o.push(l);continue}const t=new Map;for(const e of l.pageUrls){const i=this.normalizeUrlForGrouping(e);t.has(i)||t.set(i,e)}for(const[e,i]of t){const t=(null===(n=l.annotations)||void 0===n?void 0:n.filter((t=>{var i,o,n;const s=(null===(i=null==t?void 0:t.pageInfo)||void 0===i?void 0:i.url)||(null===(o=null==t?void 0:t.location)||void 0===o?void 0:o.url)||(null===(n=null==t?void 0:t.agent)||void 0===n?void 0:n.url)||"";return this.normalizeUrlForGrouping(s)===e})))||[];if(0===t.length)continue;const o={...l,occurrences:t.length,annotations:t};a.has(e)||a.set(e,{displayUrl:i,warnings:[]}),null===(r=null===(s=a.get(e))||void 0===s?void 0:s.warnings)||void 0===r||r.push(o)}}const l=[],c=this.normalizeUrlForGrouping(this.currentPageUrl);for(const[t,{displayUrl:e,warnings:i}]of a){const o="__unknown__"===t?"Unknown":t;l.push({pageUrl:e,pagePath:o,isCurrentPage:t===c&&"__unknown__"!==t,warnings:i})}return l.sort(((t,e)=>{var i;return(null==t?void 0:t.isCurrentPage)?-1:(null==e?void 0:e.isCurrentPage)?1:null===(i=null==t?void 0:t.pagePath)||void 0===i?void 0:i.localeCompare(null==e?void 0:e.pagePath)})),l}catch(t){return console.warn("Error in groupWarningsByPage: ",t),[]}},this.toggleAccordion=t=>{try{const e=new Set(this.openAccordions);e.has(t)?e.delete(t):e.add(t),this.openAccordions=e}catch(t){console.warn("Error in toggleAccordion: ",t)}},this.renderWarningIcon=()=>{try{return O`
4421
4421
  <svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
4422
4422
  <path d="M12.0003 10.2329V13.8332M12.0003 16.5334H12.0093M10.5268 5.36441L3.23087 17.546C3.08046 17.8064 3.00087 18.1017 3.00001 18.4025C2.99915 18.7033 3.07705 18.999 3.22596 19.2604C3.37487 19.5217 3.5896 19.7395 3.8488 19.8921C4.108 20.0446 4.40263 20.1267 4.70338 20.1301H19.2971C19.5978 20.1266 19.8922 20.0445 20.1513 19.892C20.4104 19.7395 20.625 19.5218 20.7739 19.2606C20.9228 18.9994 21.0007 18.7038 21 18.4032C20.9992 18.1025 20.9198 17.8073 20.7697 17.5469L13.4737 5.36351C13.3202 5.11015 13.1039 4.90064 12.8458 4.75524C12.5877 4.60984 12.2965 4.53345 12.0003 4.53345C11.704 4.53345 11.4128 4.60984 11.1547 4.75524C10.8966 4.90064 10.6803 5.11015 10.5268 5.36351V5.36441Z" stroke="#E69422" stroke-width="1.80014" stroke-linecap="round" stroke-linejoin="round"/>
4423
4423
  </svg>
@@ -4538,7 +4538,7 @@ class Kl extends Or{}Kl.Encryptor=class extends Kl{processBlock(t,e){const i=t,o
4538
4538
  <div class="cws-panel">
4539
4539
  ${"categories"===this.currentView?this.renderCategoriesView():"spelling"===this.currentView?this.renderSpellingListView():"grammar"===this.currentView?this.renderGrammarListView():this.renderBrokenLinksListView()}
4540
4540
  </div>
4541
- `}catch(t){return console.warn("Error in render: ",t),O``}}};vd.hasCheckedForActiveExecution=!1,vd.styles=hd,pd([it({type:Array})],vd.prototype,"spellingWarnings",void 0),pd([it({type:Array})],vd.prototype,"grammarWarnings",void 0),pd([it({type:Array})],vd.prototype,"brokenLinkWarnings",void 0),pd([it({type:Boolean})],vd.prototype,"isLoading",void 0),pd([it({type:String})],vd.prototype,"currentPageUrl",void 0),pd([it({type:String})],vd.prototype,"apiKey",void 0),pd([it({type:String})],vd.prototype,"organizationId",void 0),pd([it({type:String})],vd.prototype,"documentId",void 0),pd([ot()],vd.prototype,"openAccordions",void 0),pd([ot()],vd.prototype,"currentView",void 0),pd([ot()],vd.prototype,"isCheckingStatus",void 0),pd([ot()],vd.prototype,"isRunningCheck",void 0),vd=ud=pd([tt("content-warning-sidebar")],vd);var gd=function(t,e,i,o){for(var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r};class fd extends Q{constructor(){super(),this._loadPlugin=!1,this.comments=[],this.addCommentMode=!1,this.showTourCommentTooltip=!1,this.allFeatureDisabled=!1,this.allFeatureRestricted=!1,this.guestMode=!1,this._expanded=!0,this.loading=!0,this._isPlanExpired=null,this.showOnboardingModal=!0,this.showLiveDemoModal=!1,this.showFigmaDemoModal=!1,this.showGuestModeSignInModal=!1,this.defaultGuestModeSignInModalConfig={title:"Sign in to notify your team",description:"Notify your team about your latest comments.",closeOnClickOutside:!1,showLeaveCommentButton:!0},this.guestModeSignInModalConfig=JSON.parse(JSON.stringify(this.defaultGuestModeSignInModalConfig)),this.showGuestModeNameModal=!1,this.guestModeSignInBannerVisible=!1,this.guestUserNameInput="",this.guestUserModelOpened=!1,this.guestUserNameUpdated=!1,this.guestUserNameUpdateLoading=!1,this.staging=oe,this._autoLocation=!0,this.copyLinkTooltip="Copy Link",this.invalidApiKey=!1,this._isUserGlobalContact=!1,this.showQrCode=!1,this.customLoginEnabledLocally=null,this.customLoginEnabled=null,this.exitReviewModeCalled=!1,this.addCommentCount=0,this._privateCommentModeEnabled=!1,this.superflowToolbarMoved=!1,this._darkMode=!1,this.allowGuestModeSignIn=!0,this._queryParamsComments=!1,this._usePageTitleAsLocationName=!1,this.toolbarEnabled=!1,this.toolbarEnabledApiCalled=!1,this.passwordProtected=!1,this.isPasswordValid=!1,this.password="",this.validatingPasswordLoading=!1,this.showPasswordProtectedModal=!1,this.showInvalidPassword=!1,this.skipGuestNameModal=!1,this._totalViews={},this.totalViewsCount=0,this.inviteUrl="",this.showModalOnceCommentIsModeIsOff=!1,this.showInviteModal=!1,this.featureAccess=null,this.hasAgentAccess=!1,this.hasContentWarnings=!1,this.contentWarningsCount=0,this.showContentWarningSidebar=!1,this.spellingWarnings=[],this.grammarWarnings=[],this.brokenLinkWarnings=[],this.spellingSuggestionPagePathMap=new Map,this.grammarSuggestionPagePathMap=new Map,this.subscriptions=[],this.onApiKeyChange=()=>{try{this.apiKey&&(null===window||void 0===window?void 0:window.onSuperflowLoad)&&"function"==typeof window.onSuperflowLoad&&window.onSuperflowLoad()}catch(t){console.warn("Error in onApiKeyChange: ",t),Dc("Error in onApiKeyChange: ",t)}},this.checkCustomLoginEnabled=async()=>{var t;try{const e=await Kc(this.apiKey);this.customLoginEnabled=!!(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.customLoginEnabled),this.customLoginEnabled&&this.loginWithCustomUser()}catch(t){this.customLoginEnabled=!1,console.warn("Error in checkCustomLoginEnabled: ",t),Dc("Error in checkCustomLoginEnabled: ",t)}},this.loginWithCustomUser=()=>{try{this.customLoginEnabled?(uc(kt),this.loadPlugin&&this.documentId&&this.identifySnippyly()):console.warn("Identify call not allowed.")}catch(t){console.warn("Error in loginWithCustomUser: ",t),Dc("Error in loginWithCustomUser: ",t)}},this.addWindowClickEventListener=()=>{try{this.windowClickEventListener||(this.windowClickEventListener=()=>{this.menuOpenedId&&(this.menuOpenedId=void 0)},window.addEventListener("click",this.windowClickEventListener))}catch(t){console.warn("Error in addWindowClickEventListener: ",t),Dc("Error in addWindowClickEventListener: ",t)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t),Dc("Error in removeWindowClickEventListener: ",t)}},this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(t){console.warn("Error in setWindowEventListner: ",t),Dc("Error in setWindowEventListner: ",t)}},this.urlChangeListener=()=>{try{const t=history.pushState;history.pushState=function(){const e=t.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),e};const e=history.replaceState;history.replaceState=function(){const t=e.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),t},window.addEventListener("popstate",(()=>{window.dispatchEvent(new Event("locationchange"))}))}catch(t){console.warn("Error in urlChangeListener: ",t),Dc("Error in urlChangeListener: ",t)}},this.checkUrl=()=>{try{this.setInviteUrl();const t=new URL(document.location),e=t.searchParams;if(e.has(Ct)&&dc(wt,"true",!1),(null==e?void 0:e.has(It))&&!hc(It)?this.showOnboardingModal=!0:this.showOnboardingModal=!1,null==e?void 0:e.has(Nt))if(hc(Nt,!1,"sessionStorage")){this.showLiveDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Nt),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showLiveDemoModal=!0;else this.showLiveDemoModal=!1;if(null==e?void 0:e.has(At))if(hc(At,!1)){this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(At),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showFigmaDemoModal=!0;else this.showFigmaDemoModal=!1;if(e.has(Et)||e.has("snippyly_google_token")){if(e.has(Et)){const t=decodeURIComponent(e.get(Et)),i=fc(t,se,re),o=i&&JSON.parse(i);if(o){const t={};t.userId=o.uid,t.name=o.displayName,t.email=o.email,t.photoUrl=null==o?void 0:o.photoURL;const e=JSON.stringify(t),i=gc(e,se,re);dc(kt,i,!0),uc(Ot)}}else if(e.has("snippyly_google_token")){const t=JSON.parse(atob(e.get("snippyly_google_token"))),i={};i.userId=t.uid,i.name=t.displayName,i.email=t.email,i.photoUrl=null==t?void 0:t.photoURL,dc(xt,JSON.stringify(i),!0)}e.delete(Et),e.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}e.has(wt)?(dc(wt,"true",!1),uc(bt),e.delete(wt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(bt)||hc(wt,!1)&&this.loadPluginUI(),e.has(bt)?(dc(bt,"true",!1),uc(wt),e.delete(bt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(wt)||hc(bt,!1)&&this.loadPluginUI(),this.setVersionInUrl()}catch(t){console.warn("Error in checkUrl: ",t),Dc("Error in checkUrl: ",t)}},this.setInviteUrl=()=>{try{const t=new URL(document.location);t.searchParams.has(wt)||t.searchParams.set(wt,"true"),this.inviteUrl=t.toString()}catch(t){console.warn("Error in setInviteUrl: ",t),Dc("Error in setInviteUrl: ",t)}},this.detectVersion=()=>{try{if(this.projectVersionKey){const t=new URL(document.location).searchParams;if(t.get(this.projectVersionKey))this.projectVersion=t.get(this.projectVersionKey);else if(window.snippylyInitialLoadUrl){const t=new URL(window.snippylyInitialLoadUrl).searchParams;t.get(this.projectVersionKey)&&(this.projectVersion=t.get(this.projectVersionKey))}this.projectVersion&&dc(_t,this.projectVersion,!1,"sessionStorage")}else{const t=new URL(document.location).searchParams;(t.has(wt)||t.has(bt))&&t.has(Tt)&&(dc(Mt,Tt,!1,"sessionStorage"),this.projectVersion=t.get(Tt),this.projectVersion&&dc(_t,this.projectVersion,!1,"sessionStorage"))}}catch(t){console.warn("Error in detectVersion: ",t),Dc("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||hc(Mt,!1,"sessionStorage"),e=this.projectVersion||hc(_t,!1,"sessionStorage");if(t&&e){const i=new URL(document.location),o=i.searchParams;o.get(t)||(o.set(t,e),window.history.replaceState({},document.title,i.href))}}catch(t){console.warn("Error in setVersionInUrl: ",t),Dc("Error in setVersionInUrl: ",t)}},this.loadPluginUI=async()=>{var t,e,i,o,n,s,r,a;try{if(!this.apiKey)return;if(!this.projectId)return;if(this.loadPlugin)return this.generateLocation(),this.setLocation(),void setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),4e3);if(this.toolbarEnabledApiCalled||await this.detectToolbarEnabled(),!this.toolbarEnabled)return;mt.includes(this.apiKey)&&this.listenToDocumentTitleChange();const l=mc();l&&!(null==l?void 0:l.isAnonymous)&&(this.loading=!0);try{this.customerMetadata=await this.getCustomerMetadata()}catch(t){console.warn("Error in getCustomerMetadata: ",t),Dc("Error in getCustomerMetadata: ",t)}if(cc(jt)&&(this.isPasswordValid=cc(jt)),this.projectConfig=await Rc(this.apiKey,this.projectId),this.guestMode=!!(null===(t=this.projectConfig)||void 0===t?void 0:t.guestMode)||this.guestMode,this.allowGuestModeSignIn=!!(null===(i=null===(e=this.projectConfig)||void 0===e?void 0:e.guestModeConfig)||void 0===i?void 0:i.allowSignIn),this.queryParamsComments=!!(null===(o=this.projectConfig)||void 0===o?void 0:o.queryParamsComments),this.usePageTitleAsLocationName=!!(null===(n=this.projectConfig)||void 0===n?void 0:n.usePageTitleAsLocationName),(null===(s=this.projectConfig)||void 0===s?void 0:s.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(a=null===(r=this.projectConfig)||void 0===r?void 0:r.passwordProtected)||void 0===a?void 0:a.enabled),dc($t,this.guestMode+"",!0),dc(Rt,this.allowGuestModeSignIn+"",!0),dc(Dt,this.passwordProtected+"",!0),dc(Vt,this.queryParamsComments+"",!0),dc(Ft,this.usePageTitleAsLocationName+"",!0),this.loadPlugin=!0,!document.querySelector(Qt.VELT_COMMENTS)){const t=document.createElement(Qt.VELT_COMMENTS);t.setAttribute("filter-comments-on-dom","true"),null==t||t.addEventListener("onSignIn",(()=>{this.loginWithGoogle()})),null==t||t.addEventListener("onUpgrade",(()=>{this.onUpgradePlanClick()})),t.addEventListener("onCommentAdd",(()=>{this.addCommentCount++})),t.addEventListener("onCommentUpdate",(t=>{var e,i;(null===(e=this.snippylyUser)||void 0===e?void 0:e.isGuest)&&"newlyAdded"===(null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.type)&&(this.addCommentCount>=2&&(this.showModalOnceCommentIsModeIsOff=!0),this.addCommentCount>=5&&!this.showModalOnceCommentIsModeIsOff&&(this.showModalOnceCommentIsModeIsOff=!0))})),window.document.body.appendChild(t)}if(!document.querySelector(Qt.VELT_CURSOR)){const t=document.createElement(Qt.VELT_CURSOR);window.document.body.appendChild(t)}if(!document.querySelector(Qt.VELT_HUDDLE)){const t=document.createElement(Qt.VELT_HUDDLE);window.document.body.appendChild(t)}if(!document.querySelector(Qt.VELT_RECORDER_NOTES)){const t=document.createElement(Qt.VELT_RECORDER_NOTES);window.document.body.appendChild(t)}if(!document.querySelector(Qt.VELT_RECORDER_CONTROL_PANEL)){const t=document.createElement(Qt.VELT_RECORDER_CONTROL_PANEL);window.document.body.appendChild(t)}if(!document.querySelector(Qt.VELT_ARROWS)){const t=document.createElement(Qt.VELT_ARROWS);window.document.body.appendChild(t)}try{const t=new URL(document.location),e=t.searchParams;let i=!1;e.has("wireframe")&&"true"===e.get("wireframe")&&(sessionStorage.setItem("velt-wireframe","true"),e.delete("wireframe"),i=!0),e.get("velt-version")&&(sessionStorage.setItem("velt-version",e.get("velt-version")),e.delete("velt-version"),i=!0),e.get("velt-env")&&(sessionStorage.setItem("velt-env",e.get("velt-env")),e.delete("velt-env"),i=!0),i&&window.history.replaceState({},document.title,t.href)}catch(t){}{const t=document.createElement("velt-wireframe");t.innerHTML='\n<style>\n .velt-comment-dialog--body {\n border-radius: 20px !important;\n }\n\n .velt-comment-dialog{\n background-color: transparent !important;\n border: none !important;\n }\n\n .velt-comment-dialog{\n padding: 0 !important;\n }\n\n .sf-suggestion-card {\n min-width: 320px;\n display: flex;\n flex-direction: column;\n gap: 4px;\n padding: 8px;\n border: 1px solid #625df5;\n border-radius: 16px;\n background: #ffffff;\n font-family: \'Poppins\', sans-serif;\n box-sizing: border-box;\n }\n\n .sf-suggestion-words {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 2px;\n padding: 6px 8px;\n font-size: 16px;\n font-weight: 500;\n line-height: normal;\n min-width: 0;\n width: 100%;\n box-sizing: border-box;\n }\n\n .sf-incorrect-word {\n text-decoration: line-through;\n color: #ff7162;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n }\n\n .sf-arrow-down {\n color: #b0b0b0;\n display: flex;\n align-items: center;\n }\n\n .sf-correct-word {\n color: #0a0a0a;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n }\n\n .sf-suggestion-actions {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .sf-stepper {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .sf-stepper-btn {\n display: flex;\n align-items: center;\n padding: 4px;\n opacity: 0;\n cursor: pointer;\n border: none;\n background: transparent;\n color: #7a7a7a;\n border-radius: 4px;\n transition: background 0.15s ease;\n }\n\n .velt-comment-dialog.selected button.sf-stepper-btn{\n opacity: 1\n }\n\n\n .sf-stepper-btn:hover {\n background: #f5f5f5;\n }\n\n .sf-stepper-count {\n font-size: 12px;\n font-weight: 500;\n color: #7a7a7a;\n white-space: nowrap;\n font-family: \'Poppins\', sans-serif;\n }\n\n .sf-accept-reject {\n display: flex;\n align-items: center;\n gap: 4px;\n }\n\n .sf-accept-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 4px 12px;\n border-radius: 32px;\n background: #198f65;\n border: none;\n cursor: pointer;\n transition: opacity 0.15s ease;\n }\n\n .sf-accept-btn:hover {\n opacity: 0.85;\n }\n\n .sf-reject-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 4px 12px;\n border-radius: 32px;\n background: #ff7162;\n border: none;\n cursor: pointer;\n transition: opacity 0.15s ease;\n }\n\n .sf-reject-btn:hover {\n opacity: 0.85;\n }\n \n .sf-comment-dialog-body-wireframe-default{\n display: flex;\n align-items: flex-start;\n border-radius: 1rem !important;\n background-color: white !important;\n padding: 1rem !important;\n flex-direction: column;\n gap: 1rem;\n &:empty{\n display: none !important;\n }\n\n velt-comment-dialog-private-banner-internal,\n velt-comment-dialog-body-internal,\n velt-comment-dialog-all-comment-internal{\n width: 100% !important;\n }\n }\n\n .no-comments:has(.sf-comment-dialog-body-wireframe-default){\n .sf-comment-dialog-body-wireframe-default{\n padding: 0 !important;\n }\n \n }\n\n .velt-thread-card--emoji-picker-button{\n transition: opacity 0.2s ease-in-out !important;\n opacity: 0 !important;\n }\n .velt-thread-card--message-wrap:hover .velt-thread-card--emoji-picker-button {\n opacity: 1 !important;\n }\n\n</style>\n<velt-wireframe style="display: none;">\n <velt-comment-dialog-wireframe variant="dialog">\n <velt-if condition="{annotation.commentType} == \'suggestion\'">\n <velt-comment-dialog-body-wireframe>\n <velt-comment-dialog-threads-wireframe>\n <velt-comment-dialog-thread-card-wireframe>\n \n <div class="sf-suggestion-card">\n <div class="sf-suggestion-words">\n <span class="sf-incorrect-word">\n <velt-data field="commentAnnotation.agent.result.incorrectWord"></velt-data>\n </span>\n <span class="sf-correct-word">\n <velt-data field="commentAnnotation.agent.result.suggestions[0]"></velt-data>\n </span>\n </div>\n\n <div class="sf-suggestion-actions">\n <div class="sf-stepper">\n <velt-if condition="{showButtons} == true">\n <velt-button-wireframe id="prev-suggestion" type="button">\n <button class="sf-stepper-btn" type="button">\n <svg width="12" height="12" viewBox="0 0 24 24" fill="none"\n xmlns="http://www.w3.org/2000/svg">\n <path d="M15 18L9 12L15 6" stroke="currentColor" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n </svg>\n </button>\n </velt-button-wireframe>\n <velt-button-wireframe id="next-suggestion" type="button">\n <button class="sf-stepper-btn" type="button">\n <svg width="12" height="12" viewBox="0 0 24 24" fill="none"\n xmlns="http://www.w3.org/2000/svg">\n <path d="M9 6L15 12L9 18" stroke="currentColor" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n </svg>\n </button>\n </velt-button-wireframe>\n </velt-if>\n </div>\n\n <div class="sf-accept-reject">\n <velt-button-wireframe id="accept-suggestion" type="button">\n <button class="sf-accept-btn" type="button">\n <svg width="16" height="16" viewBox="0 0 24 24" fill="none"\n xmlns="http://www.w3.org/2000/svg">\n <path d="M20 6L9 17L4 12" stroke="#ffffff" stroke-width="2.5"\n stroke-linecap="round" stroke-linejoin="round" />\n </svg>\n </button>\n </velt-button-wireframe>\n <velt-button-wireframe id="reject-suggestion" type="button">\n <button class="sf-reject-btn" type="button">\n <svg width="16" height="16" viewBox="0 0 24 24" fill="none"\n xmlns="http://www.w3.org/2000/svg">\n <path d="M18 6L6 18M6 6L18 18" stroke="#ffffff" stroke-width="2.5"\n stroke-linecap="round" stroke-linejoin="round" />\n </svg>\n </button>\n </velt-button-wireframe>\n </div>\n </div>\n </div>\n\n </velt-comment-dialog-thread-card-wireframe>\n </velt-comment-dialog-threads-wireframe>\n </velt-comment-dialog-body-wireframe>\n </velt-if>\n\n <velt-if condition="{annotation.commentType} != \'suggestion\'" class="sf-comment-dialog-body-wireframe-default" >\n <velt-comment-dialog-ghost-banner-wireframe></velt-comment-dialog-ghost-banner-wireframe>\n <velt-comment-dialog-private-banner-wireframe></velt-comment-dialog-private-banner-wireframe>\n <velt-comment-dialog-assignee-banner-wireframe></velt-comment-dialog-assignee-banner-wireframe>\n <velt-comment-dialog-header-wireframe></velt-comment-dialog-header-wireframe>\n <velt-comment-dialog-body-wireframe></velt-comment-dialog-body-wireframe>\n <velt-comment-dialog-composer-wireframe></velt-comment-dialog-composer-wireframe>\n <velt-comment-dialog-all-comment-wireframe></velt-comment-dialog-all-comment-wireframe>\n <velt-comment-dialog-approve-wireframe></velt-comment-dialog-approve-wireframe>\n <velt-comment-dialog-sign-in-wireframe></velt-comment-dialog-sign-in-wireframe>\n <velt-comment-dialog-upgrade-wireframe></velt-comment-dialog-upgrade-wireframe>\n <velt-comment-dialog-suggestion-action-wireframe></velt-comment-dialog-suggestion-action-wireframe>\n </velt-if>\n </velt-comment-dialog-wireframe>\n</velt-wireframe>\n',window.document.body.appendChild(t)}this.initializeSnippyly()}catch(t){this.loading=!1,console.warn("Error in loadPluginUI: ",t),Dc("Error in loadPluginUI: ",t)}},this.listenToDocumentTitleChange=()=>{try{this.documentTitleChangeInterval||(this.documentTitleChangeInterval=setInterval((()=>{var t,e,i;const o="true"===sessionStorage.getItem("debugDocumentTitleChange");if(o&&(console.log("*** listenToDocumentTitleChange ***"),console.log("usePageTitleAsLocationName: ",this.usePageTitleAsLocationName)),this.usePageTitleAsLocationName){const n=document.title;o&&(console.log("location name: ",null===(t=this.location)||void 0===t?void 0:t.locationName),console.log("title: ",n),console.log("changed: ",(null===(e=this.location)||void 0===e?void 0:e.locationName)!==n)),(null===(i=this.location)||void 0===i?void 0:i.locationName)!==n&&(o&&console.log("%c triggering location update!","color: green; font-weight: bold;"),this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),2e3))}catch(t){Dc("Error in listenToDocumentTitleChange: ",t)}},this.initializeSnippyly=async()=>{var t,i,o,n,s,r,a,l,c,d,h,u,p,v,g,f,m,w,b,y,C,x,E,k,S,M,_,T,I;try{let N=this.staging?gt:ft;this.staging||(N="latest"),this.veltVersion&&(N=this.veltVersion);let A=this.staging,L=!1;if((null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-version"))&&(N=sessionStorage.getItem("velt-version")),null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-env")){"staging"===sessionStorage.getItem("velt-env")&&(A=!1,L=!0)}if(await e(this.apiKey,{options:{develop:A,staging:L,version:N,velt:!0,proxyDomain:"https://cdn.velt.dev"}}),!window.Velt)return;if(this.autoTranslation&&(null===Velt||void 0===Velt?void 0:Velt.enableAutoTranslation)&&(null===Velt||void 0===Velt||Velt.enableAutoTranslation()),!document.querySelector(Qt.VELT_COMMENTS_SIDEBAR)){const t=document.createElement(Qt.VELT_COMMENTS_SIDEBAR);t.setAttribute(Xt.ENABLE_URL_NAVIGATION,"true"),t.setAttribute(Xt.CURRENT_LOCATION_SUFFIX,"true"),window.document.body.appendChild(t)}if(Velt){null===Velt||void 0===Velt||Velt.sf(!0);try{window.dispatchEvent(new CustomEvent("onVeltLoad",{detail:{Velt}})),(null===window||void 0===window?void 0:window.onSnippylyLoad)&&(null===window||void 0===window||window.onSnippylyLoad(Velt))}catch(t){}document.body.style.setProperty("--velt-default-font-family","'Poppins', sans-serif"),bc()}if(Velt&&(Lc({sdkVersion:null===Velt||void 0===Velt?void 0:Velt.version,sdkType:"client"}),console.log(`Velt Version: ${(null===Velt||void 0===Velt?void 0:Velt.version)||"unknown"}`),console.log(`Superflow Toolbar Version: ${vt}`)),this.generateDocumentId(),(null===Velt||void 0===Velt?void 0:Velt.on)&&"function"==typeof(null===Velt||void 0===Velt?void 0:Velt.on)){const e=mc(),i="true"===sessionStorage.getItem("debugUserUpdateEvent");this.previousVeltUserId=null!==(t=null==e?void 0:e.userId)&&void 0!==t?t:"default",i&&console.log("[Superflow Debug] Initialized previousVeltUserId:",this.previousVeltUserId),Velt.on("userUpdate").subscribe((async t=>{if(i&&console.log("User from event: UserUpdate",t),t){const e=t.userId;i&&console.log("[Superflow Debug] userUpdate event fired:",{previousVeltUserId:this.previousVeltUserId,currentUserId:e,userChanged:this.previousVeltUserId!==e}),this.previousVeltUserId!==e&&(i&&console.log("[Superflow Debug] User changed, calling setDocumentAndLocation"),await this.setDocumentAndLocation()),this.previousVeltUserId=e}})),i&&console.log("[Superflow Debug] Performing initial setDocumentAndLocation"),await this.setDocumentAndLocation()}else await this.setDocumentAndLocation();if(setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),4e3),this.commentElement=null===Velt||void 0===Velt?void 0:Velt.getCommentElement(),this.contactElement=null===Velt||void 0===Velt?void 0:Velt.getContactElement(),this.rewriterElement=null===Velt||void 0===Velt?void 0:Velt.getRewriterElement(),this.presenceElement=null===Velt||void 0===Velt?void 0:Velt.getPresenceElement(),this.commentElement){this.commentElement.enableTextComments(!0),this.customLoginEnabledLocally||this.commentElement.enableSignInButton(!0),this.commentElement.enableAttachments(!0),(null===(i=this.commentElement)||void 0===i?void 0:i.showScreenSizeInfo)&&this.commentElement.showScreenSizeInfo(!0),(null===(o=this.commentElement)||void 0===o?void 0:o.enableDeviceInfo)&&this.commentElement.enableDeviceInfo(!0),this.commentElement.enableCommentIndex(!0),this.commentElement.onCommentModeChange&&this.commentElement.onCommentModeChange().subscribe((t=>{this.addCommentMode=t,this.addCommentMode||this.showModalOnceCommentIsModeIsOff&&(this.addCommentCount>=2&&!hc(Ut)&&(this.allowGuestModeSignIn?this.openGuestModeSignInModal():this.openGuestModeNameModel(),dc(Ut,"true"),this.showModalOnceCommentIsModeIsOff=!1),this.addCommentCount>=5&&!this.showGuestModeSignInModal&&!hc(Bt,!1,"sessionStorage")&&(this.showGuestModeSignInBanner(),dc(Bt,"true",!1,"sessionStorage"),this.showModalOnceCommentIsModeIsOff=!1))})),(null===(n=this.commentElement)||void 0===n?void 0:n.enableOrphanComments)&&this.commentElement.enableOrphanComments(),(null===(s=this.commentElement)||void 0===s?void 0:s.enablePersistentCommentMode)&&this.commentElement.enablePersistentCommentMode(),(null===(r=this.commentElement)||void 0===r?void 0:r.enableGhostComments)&&this.commentElement.enableGhostComments();const t=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;t&&"object"==typeof t&&(null===(a=this.commentElement)||void 0===a?void 0:a.setCustomStatus)&&this.commentElement.setCustomStatus(t),(null===(l=this.commentElement)||void 0===l?void 0:l.enableMinimap)&&this.commentElement.enableMinimap(),(null===(c=this.commentElement)||void 0===c?void 0:c.setDStrategy)&&(null===(d=this.commentElement)||void 0===d||d.setDStrategy("dynamicId")),(null===(h=this.commentElement)||void 0===h?void 0:h.enableSidebarButtonOnCommentDialog)&&this.commentElement.enableSidebarButtonOnCommentDialog(),(null===(u=this.commentElement)||void 0===u?void 0:u.enableHotkey)&&this.commentElement.enableHotkey(),(null===(p=this.commentElement)||void 0===p?void 0:p.enableDeviceIndicatorOnCommentPins)&&this.commentElement.enableDeviceIndicatorOnCommentPins(),(null===(f=null===(g=null===(v=this.customerMetadata)||void 0===v?void 0:v.superflow)||void 0===g?void 0:g.advancedFeatures)||void 0===f?void 0:f.takeScreenshotOnComments)?this.commentElement.enableScreenshot&&this.commentElement.enableScreenshot():this.commentElement.disableScreenshot&&this.commentElement.disableScreenshot(),(null===(b=null===(w=null===(m=this.customerMetadata)||void 0===m?void 0:m.superflow)||void 0===w?void 0:w.advancedFeatures)||void 0===b?void 0:b.hasCustomStatus)&&this.setCustomStatuses(),this.setQueryParamsCommentsInSdk(),this.checkToEnableUpgradeButton(),this.setupSidebarAgentCommentFilter(),this.setupVeltButtonClickListener()}this.applyStorageFeatureAccess(),this.selectionElement=Velt.getSelectionElement(),this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.rewriterElement&&(null===(y=this.rewriterElement)||void 0===y||y.enableRewriter()),this.presenceElement&&(null===(C=this.presenceElement)||void 0===C?void 0:C.enableFlockMode)&&(null===(x=this.presenceElement)||void 0===x||x.enableFlockMode(!0)),(null===Velt||void 0===Velt?void 0:Velt.getDocElement)&&(this.docElement=Velt.getDocElement()),null===(M=(null===(E=this.docElement)||void 0===E?void 0:E.getDocumentMetadata)?null===(k=this.docElement)||void 0===k?void 0:k.getDocumentMetadata():null===(S=null===Velt||void 0===Velt?void 0:Velt.docService)||void 0===S?void 0:S.getDocumentMetadata$())||void 0===M||M.subscribe((t=>{var e,i;const o=(null===(e=null==t?void 0:t.superflow)||void 0===e?void 0:e.versions)?Object.values(null===(i=null==t?void 0:t.superflow)||void 0===i?void 0:i.versions):[],n=new URL(document.location).searchParams.get("version");if(n){const t=o.find((t=>t.id===n));t&&(this.version={id:t.id,name:t.versionName||t.id},this.setLocation())}})),(null===Velt||void 0===Velt?void 0:Velt.getViewsElement)&&(this.viewsElement=Velt.getViewsElement()),(null===(_=this.viewsElement)||void 0===_?void 0:_.getUniqueViewsByUser)&&(null===(I=null===(T=this.viewsElement)||void 0===T?void 0:T.getUniqueViewsByUser())||void 0===I||I.subscribe((t=>{this.totalViews=t}))),this.identifySnippyly()}catch(t){this.loading=!1,console.warn("Error in initializeSnippyly: ",t),Dc("Error in initializeSnippyly: ",t)}},this.generateDocumentId=()=>{try{this.documentId=oc(rc(window.location.origin))+"",this.projectId&&(this.documentId=this.projectId+""),this.serverDocumentId=sc(this.documentId+"")}catch(t){console.warn("Error in generateDocumentId: ",t),Dc("Error in generateDocumentId: ",t)}},this.setDocumentAndLocation=async()=>{try{this.generateDocumentId(),this.previousLocation=null,await(null===Velt||void 0===Velt?void 0:Velt.setDocumentId(this.documentId+"")),Lc({documentId:this.serverDocumentId,clientDocumentId:this.documentId}),this.generateLocation(),this.setLocation()}catch(t){console.warn("Error in setDocumentAndLocation: ",t),Dc("Error in setDocumentAndLocation: ",t)}},this.checkToEnableUpgradeButton=()=>{var t,e;try{this.isPlanExpired&&this.isUserGlobalContact?(null===(t=this.commentElement)||void 0===t?void 0:t.enableUpgradeButton)&&this.commentElement.enableUpgradeButton():(null===(e=this.commentElement)||void 0===e?void 0:e.disableUpgradeButton)&&this.commentElement.disableUpgradeButton()}catch(t){console.warn("Error in checkToEnableUpgradeButton: ",t),Dc("Error in checkToEnableUpgradeButton: ",t)}},this.getCustomerMetadata=async()=>{try{const t=await Bc(this.apiKey);return xc(t),t}catch(t){console.warn("Error in getCustomerMetadata: ",t),Dc("Error in getCustomerMetadata: ",t);const e=Ec();if(e)return e}},this.setCustomStatuses=async()=>{var t;try{const e=await Hc(this.apiKey);if((null==e?void 0:e.success)&&(null==e?void 0:e.data)){const i=Object.values(e.data),o=this.sortCustomStatuses(i);o.length>0&&(null===(t=this.commentElement)||void 0===t?void 0:t.setCustomStatus)&&this.commentElement.setCustomStatus(o)}}catch(t){console.warn("Error in setCustomStatuses: ",t),Dc("Error in setCustomStatuses: ",t)}},this.sortCustomStatuses=t=>{try{const e=[...t].sort(((t,e)=>("number"==typeof t.order?t.order:Number.MAX_SAFE_INTEGER)-("number"==typeof e.order?e.order:Number.MAX_SAFE_INTEGER)));return e}catch(e){return console.warn("Error in sortCustomStatuses: ",e),Dc("Error in sortCustomStatuses: ",e),t}},this.getSamlConfig=async()=>{try{const t=await Zc(this.apiKey);return kc(t),t}catch(t){console.warn("Error in getSamlConfig: ",t),Dc("Error in getSamlConfig: ",t);const e=Sc();if(e)return e}},this.setLogos=()=>{var t,e,i,o,n,s,r,a,l,c,d,h;try{let u="light";this.privateCommentModeEnabled&&(u="dark");const p=null===(i=null===(e=null===(t=this.customerMetadata)||void 0===t?void 0:t.superflow)||void 0===e?void 0:e.customBranding)||void 0===i?void 0:i.logoMark,v=null===(s=null===(n=null===(o=null==ie?void 0:te)||void 0===o?void 0:o.customBranding)||void 0===n?void 0:n.logo)||void 0===s?void 0:s.logoMark,g=null===(l=null===(a=null===(r=this.customerMetadata)||void 0===r?void 0:r.superflow)||void 0===a?void 0:a.customBranding)||void 0===l?void 0:l.wordMark,f=null===(h=null===(d=null===(c=null==ie?void 0:te)||void 0===c?void 0:c.customBranding)||void 0===d?void 0:d.logo)||void 0===h?void 0:h.wordMark;switch(u){case"light":this.logoMark=(null==p?void 0:p.lightUrl)||(null==p?void 0:p.darkUrl)||(null==v?void 0:v.lightUrl),this.wordMark=(null==g?void 0:g.lightUrl)||(null==g?void 0:g.darkUrl)||(null==f?void 0:f.lightUrl);break;case"dark":this.logoMark=(null==p?void 0:p.darkUrl)||(null==p?void 0:p.lightUrl)||(null==v?void 0:v.darkUrl),this.wordMark=(null==g?void 0:g.darkUrl)||(null==g?void 0:g.lightUrl)||(null==f?void 0:f.darkUrl)}}catch(t){console.warn("Error in setLogos: ",t),Dc("Error in setLogos: ",t)}},this.getLogoMark=()=>{var t;try{return(null===(t=this.logoMark)||void 0===t?void 0:t.includes("<svg"))?O`
4541
+ `}catch(t){return console.warn("Error in render: ",t),O``}}};vd.hasCheckedForActiveExecution=!1,vd.styles=hd,pd([it({type:Array})],vd.prototype,"spellingWarnings",void 0),pd([it({type:Array})],vd.prototype,"grammarWarnings",void 0),pd([it({type:Array})],vd.prototype,"brokenLinkWarnings",void 0),pd([it({type:Boolean})],vd.prototype,"isLoading",void 0),pd([it({type:String})],vd.prototype,"currentPageUrl",void 0),pd([it({type:String})],vd.prototype,"apiKey",void 0),pd([it({type:String})],vd.prototype,"organizationId",void 0),pd([it({type:String})],vd.prototype,"documentId",void 0),pd([ot()],vd.prototype,"openAccordions",void 0),pd([ot()],vd.prototype,"currentView",void 0),pd([ot()],vd.prototype,"isCheckingStatus",void 0),pd([ot()],vd.prototype,"isRunningCheck",void 0),vd=ud=pd([tt("content-warning-sidebar")],vd);var gd=function(t,e,i,o){for(var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r};class fd extends Q{constructor(){super(),this._loadPlugin=!1,this.comments=[],this.addCommentMode=!1,this.showTourCommentTooltip=!1,this.allFeatureDisabled=!1,this.allFeatureRestricted=!1,this.guestMode=!1,this._expanded=!0,this.loading=!0,this._isPlanExpired=null,this.showOnboardingModal=!0,this.showLiveDemoModal=!1,this.showFigmaDemoModal=!1,this.showGuestModeSignInModal=!1,this.defaultGuestModeSignInModalConfig={title:"Sign in to notify your team",description:"Notify your team about your latest comments.",closeOnClickOutside:!1,showLeaveCommentButton:!0},this.guestModeSignInModalConfig=JSON.parse(JSON.stringify(this.defaultGuestModeSignInModalConfig)),this.showGuestModeNameModal=!1,this.guestModeSignInBannerVisible=!1,this.guestUserNameInput="",this.guestUserModelOpened=!1,this.guestUserNameUpdated=!1,this.guestUserNameUpdateLoading=!1,this.staging=oe,this._autoLocation=!0,this.copyLinkTooltip="Copy Link",this.invalidApiKey=!1,this._isUserGlobalContact=!1,this.showQrCode=!1,this.customLoginEnabledLocally=null,this.customLoginEnabled=null,this.exitReviewModeCalled=!1,this.addCommentCount=0,this._privateCommentModeEnabled=!1,this.superflowToolbarMoved=!1,this._darkMode=!1,this.allowGuestModeSignIn=!0,this._queryParamsComments=!1,this._usePageTitleAsLocationName=!1,this.toolbarEnabled=!1,this.toolbarEnabledApiCalled=!1,this.passwordProtected=!1,this.isPasswordValid=!1,this.password="",this.validatingPasswordLoading=!1,this.showPasswordProtectedModal=!1,this.showInvalidPassword=!1,this.skipGuestNameModal=!1,this._totalViews={},this.totalViewsCount=0,this.inviteUrl="",this.showModalOnceCommentIsModeIsOff=!1,this.showInviteModal=!1,this.featureAccess=null,this.hasAgentAccess=!1,this.hasContentWarnings=!1,this.contentWarningsCount=0,this.showContentWarningSidebar=!1,this.spellingWarnings=[],this.grammarWarnings=[],this.brokenLinkWarnings=[],this.spellingSuggestionPagePathMap=new Map,this.grammarSuggestionPagePathMap=new Map,this.subscriptions=[],this.onApiKeyChange=()=>{try{this.apiKey&&(null===window||void 0===window?void 0:window.onSuperflowLoad)&&"function"==typeof window.onSuperflowLoad&&window.onSuperflowLoad()}catch(t){console.warn("Error in onApiKeyChange: ",t),Dc("Error in onApiKeyChange: ",t)}},this.checkCustomLoginEnabled=async()=>{var t;try{const e=await Kc(this.apiKey);this.customLoginEnabled=!!(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.customLoginEnabled),this.customLoginEnabled&&this.loginWithCustomUser()}catch(t){this.customLoginEnabled=!1,console.warn("Error in checkCustomLoginEnabled: ",t),Dc("Error in checkCustomLoginEnabled: ",t)}},this.loginWithCustomUser=()=>{try{this.customLoginEnabled?(uc(kt),this.loadPlugin&&this.documentId&&this.identifySnippyly()):console.warn("Identify call not allowed.")}catch(t){console.warn("Error in loginWithCustomUser: ",t),Dc("Error in loginWithCustomUser: ",t)}},this.addWindowClickEventListener=()=>{try{this.windowClickEventListener||(this.windowClickEventListener=()=>{this.menuOpenedId&&(this.menuOpenedId=void 0)},window.addEventListener("click",this.windowClickEventListener))}catch(t){console.warn("Error in addWindowClickEventListener: ",t),Dc("Error in addWindowClickEventListener: ",t)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t),Dc("Error in removeWindowClickEventListener: ",t)}},this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(t){console.warn("Error in setWindowEventListner: ",t),Dc("Error in setWindowEventListner: ",t)}},this.urlChangeListener=()=>{try{const t=history.pushState;history.pushState=function(){const e=t.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),e};const e=history.replaceState;history.replaceState=function(){const t=e.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),t},window.addEventListener("popstate",(()=>{window.dispatchEvent(new Event("locationchange"))}))}catch(t){console.warn("Error in urlChangeListener: ",t),Dc("Error in urlChangeListener: ",t)}},this.checkUrl=()=>{try{this.setInviteUrl();const t=new URL(document.location),e=t.searchParams;if(e.has(Ct)&&dc(wt,"true",!1),(null==e?void 0:e.has(It))&&!hc(It)?this.showOnboardingModal=!0:this.showOnboardingModal=!1,null==e?void 0:e.has(Nt))if(hc(Nt,!1,"sessionStorage")){this.showLiveDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Nt),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showLiveDemoModal=!0;else this.showLiveDemoModal=!1;if(null==e?void 0:e.has(At))if(hc(At,!1)){this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(At),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showFigmaDemoModal=!0;else this.showFigmaDemoModal=!1;if(e.has(Et)||e.has("snippyly_google_token")){if(e.has(Et)){const t=decodeURIComponent(e.get(Et)),i=fc(t,se,re),o=i&&JSON.parse(i);if(o){const t={};t.userId=o.uid,t.name=o.displayName,t.email=o.email,t.photoUrl=null==o?void 0:o.photoURL;const e=JSON.stringify(t),i=gc(e,se,re);dc(kt,i,!0),uc(Ot)}}else if(e.has("snippyly_google_token")){const t=JSON.parse(atob(e.get("snippyly_google_token"))),i={};i.userId=t.uid,i.name=t.displayName,i.email=t.email,i.photoUrl=null==t?void 0:t.photoURL,dc(xt,JSON.stringify(i),!0)}e.delete(Et),e.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}e.has(wt)?(dc(wt,"true",!1),uc(bt),e.delete(wt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(bt)||hc(wt,!1)&&this.loadPluginUI(),e.has(bt)?(dc(bt,"true",!1),uc(wt),e.delete(bt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(wt)||hc(bt,!1)&&this.loadPluginUI(),this.setVersionInUrl()}catch(t){console.warn("Error in checkUrl: ",t),Dc("Error in checkUrl: ",t)}},this.setInviteUrl=()=>{try{const t=new URL(document.location);t.searchParams.has(wt)||t.searchParams.set(wt,"true"),this.inviteUrl=t.toString()}catch(t){console.warn("Error in setInviteUrl: ",t),Dc("Error in setInviteUrl: ",t)}},this.detectVersion=()=>{try{if(this.projectVersionKey){const t=new URL(document.location).searchParams;if(t.get(this.projectVersionKey))this.projectVersion=t.get(this.projectVersionKey);else if(window.snippylyInitialLoadUrl){const t=new URL(window.snippylyInitialLoadUrl).searchParams;t.get(this.projectVersionKey)&&(this.projectVersion=t.get(this.projectVersionKey))}this.projectVersion&&dc(_t,this.projectVersion,!1,"sessionStorage")}else{const t=new URL(document.location).searchParams;(t.has(wt)||t.has(bt))&&t.has(Tt)&&(dc(Mt,Tt,!1,"sessionStorage"),this.projectVersion=t.get(Tt),this.projectVersion&&dc(_t,this.projectVersion,!1,"sessionStorage"))}}catch(t){console.warn("Error in detectVersion: ",t),Dc("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||hc(Mt,!1,"sessionStorage"),e=this.projectVersion||hc(_t,!1,"sessionStorage");if(t&&e){const i=new URL(document.location),o=i.searchParams;o.get(t)||(o.set(t,e),window.history.replaceState({},document.title,i.href))}}catch(t){console.warn("Error in setVersionInUrl: ",t),Dc("Error in setVersionInUrl: ",t)}},this.loadPluginUI=async()=>{var t,e,i,o,n,s,r,a;try{if(!this.apiKey)return;if(!this.projectId)return;if(this.loadPlugin)return this.generateLocation(),this.setLocation(),void setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),4e3);if(this.toolbarEnabledApiCalled||await this.detectToolbarEnabled(),!this.toolbarEnabled)return;mt.includes(this.apiKey)&&this.listenToDocumentTitleChange();const l=mc();l&&!(null==l?void 0:l.isAnonymous)&&(this.loading=!0);try{this.customerMetadata=await this.getCustomerMetadata()}catch(t){console.warn("Error in getCustomerMetadata: ",t),Dc("Error in getCustomerMetadata: ",t)}if(cc(jt)&&(this.isPasswordValid=cc(jt)),this.projectConfig=await Rc(this.apiKey,this.projectId),this.guestMode=!!(null===(t=this.projectConfig)||void 0===t?void 0:t.guestMode)||this.guestMode,this.allowGuestModeSignIn=!!(null===(i=null===(e=this.projectConfig)||void 0===e?void 0:e.guestModeConfig)||void 0===i?void 0:i.allowSignIn),this.queryParamsComments=!!(null===(o=this.projectConfig)||void 0===o?void 0:o.queryParamsComments),this.usePageTitleAsLocationName=!!(null===(n=this.projectConfig)||void 0===n?void 0:n.usePageTitleAsLocationName),(null===(s=this.projectConfig)||void 0===s?void 0:s.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(a=null===(r=this.projectConfig)||void 0===r?void 0:r.passwordProtected)||void 0===a?void 0:a.enabled),dc($t,this.guestMode+"",!0),dc(Rt,this.allowGuestModeSignIn+"",!0),dc(Dt,this.passwordProtected+"",!0),dc(Vt,this.queryParamsComments+"",!0),dc(Ft,this.usePageTitleAsLocationName+"",!0),this.loadPlugin=!0,!document.querySelector(Qt.VELT_COMMENTS)){const t=document.createElement(Qt.VELT_COMMENTS);t.setAttribute("filter-comments-on-dom","true"),null==t||t.addEventListener("onSignIn",(()=>{this.loginWithGoogle()})),null==t||t.addEventListener("onUpgrade",(()=>{this.onUpgradePlanClick()})),t.addEventListener("onCommentAdd",(()=>{this.addCommentCount++})),t.addEventListener("onCommentUpdate",(t=>{var e,i;(null===(e=this.snippylyUser)||void 0===e?void 0:e.isGuest)&&"newlyAdded"===(null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.type)&&(this.addCommentCount>=2&&(this.showModalOnceCommentIsModeIsOff=!0),this.addCommentCount>=5&&!this.showModalOnceCommentIsModeIsOff&&(this.showModalOnceCommentIsModeIsOff=!0))})),window.document.body.appendChild(t)}if(!document.querySelector(Qt.VELT_CURSOR)){const t=document.createElement(Qt.VELT_CURSOR);window.document.body.appendChild(t)}if(!document.querySelector(Qt.VELT_HUDDLE)){const t=document.createElement(Qt.VELT_HUDDLE);window.document.body.appendChild(t)}if(!document.querySelector(Qt.VELT_RECORDER_NOTES)){const t=document.createElement(Qt.VELT_RECORDER_NOTES);window.document.body.appendChild(t)}if(!document.querySelector(Qt.VELT_RECORDER_CONTROL_PANEL)){const t=document.createElement(Qt.VELT_RECORDER_CONTROL_PANEL);window.document.body.appendChild(t)}if(!document.querySelector(Qt.VELT_ARROWS)){const t=document.createElement(Qt.VELT_ARROWS);window.document.body.appendChild(t)}try{const t=new URL(document.location),e=t.searchParams;let i=!1;e.has("wireframe")&&"true"===e.get("wireframe")&&(sessionStorage.setItem("velt-wireframe","true"),e.delete("wireframe"),i=!0),e.get("velt-version")&&(sessionStorage.setItem("velt-version",e.get("velt-version")),e.delete("velt-version"),i=!0),e.get("velt-env")&&(sessionStorage.setItem("velt-env",e.get("velt-env")),e.delete("velt-env"),i=!0),i&&window.history.replaceState({},document.title,t.href)}catch(t){}this.initializeSnippyly()}catch(t){this.loading=!1,console.warn("Error in loadPluginUI: ",t),Dc("Error in loadPluginUI: ",t)}},this.listenToDocumentTitleChange=()=>{try{this.documentTitleChangeInterval||(this.documentTitleChangeInterval=setInterval((()=>{var t,e,i;const o="true"===sessionStorage.getItem("debugDocumentTitleChange");if(o&&(console.log("*** listenToDocumentTitleChange ***"),console.log("usePageTitleAsLocationName: ",this.usePageTitleAsLocationName)),this.usePageTitleAsLocationName){const n=document.title;o&&(console.log("location name: ",null===(t=this.location)||void 0===t?void 0:t.locationName),console.log("title: ",n),console.log("changed: ",(null===(e=this.location)||void 0===e?void 0:e.locationName)!==n)),(null===(i=this.location)||void 0===i?void 0:i.locationName)!==n&&(o&&console.log("%c triggering location update!","color: green; font-weight: bold;"),this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),2e3))}catch(t){Dc("Error in listenToDocumentTitleChange: ",t)}},this.initializeSnippyly=async()=>{var t,i,o,n,s,r,a,l,c,d,h,u,p,v,g,f,m,w,b,y,C,x,E,k,S,M,_,T,I;try{let N=this.staging?gt:ft;this.staging||(N="latest"),this.veltVersion&&(N=this.veltVersion);let A=this.staging,L=!1;if((null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-version"))&&(N=sessionStorage.getItem("velt-version")),null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-env")){"staging"===sessionStorage.getItem("velt-env")&&(A=!1,L=!0)}if(await e(this.apiKey,{options:{develop:A,staging:L,version:N,velt:!0,proxyDomain:"https://cdn.velt.dev"}}),!window.Velt)return;if(this.autoTranslation&&(null===Velt||void 0===Velt?void 0:Velt.enableAutoTranslation)&&(null===Velt||void 0===Velt||Velt.enableAutoTranslation()),!document.querySelector(Qt.VELT_COMMENTS_SIDEBAR)){const t=document.createElement(Qt.VELT_COMMENTS_SIDEBAR);t.setAttribute(Xt.ENABLE_URL_NAVIGATION,"true"),t.setAttribute(Xt.CURRENT_LOCATION_SUFFIX,"true"),window.document.body.appendChild(t)}if(Velt){null===Velt||void 0===Velt||Velt.sf(!0);try{window.dispatchEvent(new CustomEvent("onVeltLoad",{detail:{Velt}})),(null===window||void 0===window?void 0:window.onSnippylyLoad)&&(null===window||void 0===window||window.onSnippylyLoad(Velt))}catch(t){}document.body.style.setProperty("--velt-default-font-family","'Poppins', sans-serif"),bc()}if(Velt&&(Lc({sdkVersion:null===Velt||void 0===Velt?void 0:Velt.version,sdkType:"client"}),console.log(`Velt Version: ${(null===Velt||void 0===Velt?void 0:Velt.version)||"unknown"}`),console.log(`Superflow Toolbar Version: ${vt}`)),this.generateDocumentId(),(null===Velt||void 0===Velt?void 0:Velt.on)&&"function"==typeof(null===Velt||void 0===Velt?void 0:Velt.on)){const e=mc(),i="true"===sessionStorage.getItem("debugUserUpdateEvent");this.previousVeltUserId=null!==(t=null==e?void 0:e.userId)&&void 0!==t?t:"default",i&&console.log("[Superflow Debug] Initialized previousVeltUserId:",this.previousVeltUserId),Velt.on("userUpdate").subscribe((async t=>{if(i&&console.log("User from event: UserUpdate",t),t){const e=t.userId;i&&console.log("[Superflow Debug] userUpdate event fired:",{previousVeltUserId:this.previousVeltUserId,currentUserId:e,userChanged:this.previousVeltUserId!==e}),this.previousVeltUserId!==e&&(i&&console.log("[Superflow Debug] User changed, calling setDocumentAndLocation"),await this.setDocumentAndLocation()),this.previousVeltUserId=e}})),i&&console.log("[Superflow Debug] Performing initial setDocumentAndLocation"),await this.setDocumentAndLocation()}else await this.setDocumentAndLocation();if(setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),4e3),this.commentElement=null===Velt||void 0===Velt?void 0:Velt.getCommentElement(),this.contactElement=null===Velt||void 0===Velt?void 0:Velt.getContactElement(),this.rewriterElement=null===Velt||void 0===Velt?void 0:Velt.getRewriterElement(),this.presenceElement=null===Velt||void 0===Velt?void 0:Velt.getPresenceElement(),this.commentElement){this.commentElement.enableTextComments(!0),this.customLoginEnabledLocally||this.commentElement.enableSignInButton(!0),this.commentElement.enableAttachments(!0),(null===(i=this.commentElement)||void 0===i?void 0:i.showScreenSizeInfo)&&this.commentElement.showScreenSizeInfo(!0),(null===(o=this.commentElement)||void 0===o?void 0:o.enableDeviceInfo)&&this.commentElement.enableDeviceInfo(!0),this.commentElement.enableCommentIndex(!0),this.commentElement.onCommentModeChange&&this.commentElement.onCommentModeChange().subscribe((t=>{this.addCommentMode=t,this.addCommentMode||this.showModalOnceCommentIsModeIsOff&&(this.addCommentCount>=2&&!hc(Ut)&&(this.allowGuestModeSignIn?this.openGuestModeSignInModal():this.openGuestModeNameModel(),dc(Ut,"true"),this.showModalOnceCommentIsModeIsOff=!1),this.addCommentCount>=5&&!this.showGuestModeSignInModal&&!hc(Bt,!1,"sessionStorage")&&(this.showGuestModeSignInBanner(),dc(Bt,"true",!1,"sessionStorage"),this.showModalOnceCommentIsModeIsOff=!1))})),(null===(n=this.commentElement)||void 0===n?void 0:n.enableOrphanComments)&&this.commentElement.enableOrphanComments(),(null===(s=this.commentElement)||void 0===s?void 0:s.enablePersistentCommentMode)&&this.commentElement.enablePersistentCommentMode(),(null===(r=this.commentElement)||void 0===r?void 0:r.enableGhostComments)&&this.commentElement.enableGhostComments();const t=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;t&&"object"==typeof t&&(null===(a=this.commentElement)||void 0===a?void 0:a.setCustomStatus)&&this.commentElement.setCustomStatus(t),(null===(l=this.commentElement)||void 0===l?void 0:l.enableMinimap)&&this.commentElement.enableMinimap(),(null===(c=this.commentElement)||void 0===c?void 0:c.setDStrategy)&&(null===(d=this.commentElement)||void 0===d||d.setDStrategy("dynamicId")),(null===(h=this.commentElement)||void 0===h?void 0:h.enableSidebarButtonOnCommentDialog)&&this.commentElement.enableSidebarButtonOnCommentDialog(),(null===(u=this.commentElement)||void 0===u?void 0:u.enableHotkey)&&this.commentElement.enableHotkey(),(null===(p=this.commentElement)||void 0===p?void 0:p.enableDeviceIndicatorOnCommentPins)&&this.commentElement.enableDeviceIndicatorOnCommentPins(),(null===(f=null===(g=null===(v=this.customerMetadata)||void 0===v?void 0:v.superflow)||void 0===g?void 0:g.advancedFeatures)||void 0===f?void 0:f.takeScreenshotOnComments)?this.commentElement.enableScreenshot&&this.commentElement.enableScreenshot():this.commentElement.disableScreenshot&&this.commentElement.disableScreenshot(),(null===(b=null===(w=null===(m=this.customerMetadata)||void 0===m?void 0:m.superflow)||void 0===w?void 0:w.advancedFeatures)||void 0===b?void 0:b.hasCustomStatus)&&this.setCustomStatuses(),this.setQueryParamsCommentsInSdk(),this.checkToEnableUpgradeButton(),this.setupSidebarAgentCommentFilter(),this.setupVeltButtonClickListener()}this.applyStorageFeatureAccess(),this.selectionElement=Velt.getSelectionElement(),this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.rewriterElement&&(null===(y=this.rewriterElement)||void 0===y||y.enableRewriter()),this.presenceElement&&(null===(C=this.presenceElement)||void 0===C?void 0:C.enableFlockMode)&&(null===(x=this.presenceElement)||void 0===x||x.enableFlockMode(!0)),(null===Velt||void 0===Velt?void 0:Velt.getDocElement)&&(this.docElement=Velt.getDocElement()),null===(M=(null===(E=this.docElement)||void 0===E?void 0:E.getDocumentMetadata)?null===(k=this.docElement)||void 0===k?void 0:k.getDocumentMetadata():null===(S=null===Velt||void 0===Velt?void 0:Velt.docService)||void 0===S?void 0:S.getDocumentMetadata$())||void 0===M||M.subscribe((t=>{var e,i;const o=(null===(e=null==t?void 0:t.superflow)||void 0===e?void 0:e.versions)?Object.values(null===(i=null==t?void 0:t.superflow)||void 0===i?void 0:i.versions):[],n=new URL(document.location).searchParams.get("version");if(n){const t=o.find((t=>t.id===n));t&&(this.version={id:t.id,name:t.versionName||t.id},this.setLocation())}})),(null===Velt||void 0===Velt?void 0:Velt.getViewsElement)&&(this.viewsElement=Velt.getViewsElement()),(null===(_=this.viewsElement)||void 0===_?void 0:_.getUniqueViewsByUser)&&(null===(I=null===(T=this.viewsElement)||void 0===T?void 0:T.getUniqueViewsByUser())||void 0===I||I.subscribe((t=>{this.totalViews=t}))),this.identifySnippyly()}catch(t){this.loading=!1,console.warn("Error in initializeSnippyly: ",t),Dc("Error in initializeSnippyly: ",t)}},this.generateDocumentId=()=>{try{this.documentId=oc(rc(window.location.origin))+"",this.projectId&&(this.documentId=this.projectId+""),this.serverDocumentId=sc(this.documentId+"")}catch(t){console.warn("Error in generateDocumentId: ",t),Dc("Error in generateDocumentId: ",t)}},this.setDocumentAndLocation=async()=>{try{this.generateDocumentId(),this.previousLocation=null,await(null===Velt||void 0===Velt?void 0:Velt.setDocumentId(this.documentId+"")),Lc({documentId:this.serverDocumentId,clientDocumentId:this.documentId}),this.generateLocation(),this.setLocation()}catch(t){console.warn("Error in setDocumentAndLocation: ",t),Dc("Error in setDocumentAndLocation: ",t)}},this.checkToEnableUpgradeButton=()=>{var t,e;try{this.isPlanExpired&&this.isUserGlobalContact?(null===(t=this.commentElement)||void 0===t?void 0:t.enableUpgradeButton)&&this.commentElement.enableUpgradeButton():(null===(e=this.commentElement)||void 0===e?void 0:e.disableUpgradeButton)&&this.commentElement.disableUpgradeButton()}catch(t){console.warn("Error in checkToEnableUpgradeButton: ",t),Dc("Error in checkToEnableUpgradeButton: ",t)}},this.getCustomerMetadata=async()=>{try{const t=await Bc(this.apiKey);return xc(t),t}catch(t){console.warn("Error in getCustomerMetadata: ",t),Dc("Error in getCustomerMetadata: ",t);const e=Ec();if(e)return e}},this.setCustomStatuses=async()=>{var t;try{const e=await Hc(this.apiKey);if((null==e?void 0:e.success)&&(null==e?void 0:e.data)){const i=Object.values(e.data),o=this.sortCustomStatuses(i);o.length>0&&(null===(t=this.commentElement)||void 0===t?void 0:t.setCustomStatus)&&this.commentElement.setCustomStatus(o)}}catch(t){console.warn("Error in setCustomStatuses: ",t),Dc("Error in setCustomStatuses: ",t)}},this.sortCustomStatuses=t=>{try{const e=[...t].sort(((t,e)=>("number"==typeof t.order?t.order:Number.MAX_SAFE_INTEGER)-("number"==typeof e.order?e.order:Number.MAX_SAFE_INTEGER)));return e}catch(e){return console.warn("Error in sortCustomStatuses: ",e),Dc("Error in sortCustomStatuses: ",e),t}},this.getSamlConfig=async()=>{try{const t=await Zc(this.apiKey);return kc(t),t}catch(t){console.warn("Error in getSamlConfig: ",t),Dc("Error in getSamlConfig: ",t);const e=Sc();if(e)return e}},this.setLogos=()=>{var t,e,i,o,n,s,r,a,l,c,d,h;try{let u="light";this.privateCommentModeEnabled&&(u="dark");const p=null===(i=null===(e=null===(t=this.customerMetadata)||void 0===t?void 0:t.superflow)||void 0===e?void 0:e.customBranding)||void 0===i?void 0:i.logoMark,v=null===(s=null===(n=null===(o=null==ie?void 0:te)||void 0===o?void 0:o.customBranding)||void 0===n?void 0:n.logo)||void 0===s?void 0:s.logoMark,g=null===(l=null===(a=null===(r=this.customerMetadata)||void 0===r?void 0:r.superflow)||void 0===a?void 0:a.customBranding)||void 0===l?void 0:l.wordMark,f=null===(h=null===(d=null===(c=null==ie?void 0:te)||void 0===c?void 0:c.customBranding)||void 0===d?void 0:d.logo)||void 0===h?void 0:h.wordMark;switch(u){case"light":this.logoMark=(null==p?void 0:p.lightUrl)||(null==p?void 0:p.darkUrl)||(null==v?void 0:v.lightUrl),this.wordMark=(null==g?void 0:g.lightUrl)||(null==g?void 0:g.darkUrl)||(null==f?void 0:f.lightUrl);break;case"dark":this.logoMark=(null==p?void 0:p.darkUrl)||(null==p?void 0:p.lightUrl)||(null==v?void 0:v.darkUrl),this.wordMark=(null==g?void 0:g.darkUrl)||(null==g?void 0:g.lightUrl)||(null==f?void 0:f.darkUrl)}}catch(t){console.warn("Error in setLogos: ",t),Dc("Error in setLogos: ",t)}},this.getLogoMark=()=>{var t;try{return(null===(t=this.logoMark)||void 0===t?void 0:t.includes("<svg"))?O`
4542
4542
  ${ut(this.logoMark)}
4543
4543
  `:O`
4544
4544
  <img src=${this.logoMark} />
@@ -4546,7 +4546,7 @@ class Kl extends Or{}Kl.Encryptor=class extends Kl{processBlock(t,e){const i=t,o
4546
4546
  ${ut(this.wordMark)}
4547
4547
  `:O`
4548
4548
  <img src=${this.wordMark} />
4549
- `}catch(t){return console.warn("Error in getWordMark: ",t),O``}},this.generateLocation=()=>{try{if(this.autoLocation){const t=new URL(document.location).searchParams,e=new URL(document.location);e.searchParams.delete(wt),e.searchParams.delete(bt),e.searchParams.delete(yt),e.searchParams.delete(Ct),e.searchParams.delete(It),e.searchParams.delete(Nt);const i=t.get(Tt)||this.projectVersion;this.queryParamsComments||(e.search="");let o=vc(e.href);this.projectId&&(o=null==o?void 0:o.replace(window.location.origin,"")),this.location={url:o,version:i}}}catch(t){console.warn("Error in generateLocation: ",t),Dc("Error in generateLocation: ",t)}},this.setLocation=t=>{var e,i,o,n;try{if(this.autoLocation&&window.Velt&&(null===Velt||void 0===Velt?void 0:Velt.setLocation)){if(this.version?(this.location||(this.location={}),this.location.version=this.version):this.location&&delete this.location.version,!(null==t?void 0:t.forceSetLocation)&&this.previousLocation&&(null===(e=this.previousLocation)||void 0===e?void 0:e.url)===(null===(i=this.location)||void 0===i?void 0:i.url)&&(null===(o=this.previousLocation)||void 0===o?void 0:o.version)===(null===(n=this.location)||void 0===n?void 0:n.version))return;const s=ac(JSON.parse(JSON.stringify(this.location)));if(s?this.location.id=`${s}`:delete this.location.id,this.usePageTitleAsLocationName){const t=document.title;t&&(this.location.locationName=t)}null===Velt||void 0===Velt||Velt.setLocation(JSON.parse(JSON.stringify(this.location))),Lc({clientLocation:this.location}),this.previousLocation=JSON.parse(JSON.stringify(this.location)),this.onVeltLocationChange()}}catch(t){console.warn("Error in setLocation: ",t),Dc("Error in setLocation: ",t)}},this.onVeltLocationChange=()=>{try{window.dispatchEvent(new CustomEvent("veltLocationChange",{detail:this.location}))}catch(t){console.warn("Error in onVeltLocationChange: ",t),Dc("Error in onVeltLocationChange: ",t)}},this.identifySnippyly=async()=>{var t,e;let i="",o="";try{this.invalidApiKey=!1;let e,n={name:"Default User",email:"default@usesuperflow.com",userId:"default",isAnonymous:!0,organizationId:this.apiKey};e=this.customLoginEnabled&&this.providedUser?this.providedUser:mc();const s=await this.getSamlConfig(),r=new URL(document.location);if(r.searchParams.has(Et)&&r.searchParams.delete(Et),s&&(this.signInUrl=`${ne}saml/${s.slug}/login?redirect_url=${encodeURIComponent(null==r?void 0:r.toString())}&source=sf`,window.Superflow.signInUrl=this.signInUrl),(null==e?void 0:e.email)&&(n=e),n.isAnonymous)delete n.groupId;else{const t=Velt.getDocumentId()||this.serverDocumentId;t&&(n.groupId=t+"")}if(this.customLoginEnabledLocally||(null===(t=null==n?void 0:n.contacts)||void 0===t?void 0:t.length)&&(n.contacts=[]),i=null==n?void 0:n.email,o=null==n?void 0:n.userId,(null==n?void 0:n.isAnonymous)&&this.projectId&&this.guestMode){const t=yc(!0,this.apiKey);t&&(n=JSON.parse(JSON.stringify(t)))}(null==n?void 0:n.isAnonymous)||(this.loading=!0);const a={};(null==n?void 0:n.groupId)&&(a.groupId=null==n?void 0:n.groupId),n.organizationId=this.apiKey;const l=await Pc(this.apiKey,this.projectId||"",null==n?void 0:n.email,null==n?void 0:n.userId),c=null==l?void 0:l.isAdmin;if(this.snippylyUserRole=c?"Admin":"Commenter",c&&(a.isAdmin=c,c&&this.allFeatureDisabled&&(this.allFeatureDisabled=!1)),(null==n?void 0:n.userId)&&!(null==n?void 0:n.isGuest)&&!(null==n?void 0:n.isAnonymous)&&this.documentId)try{await qc(this.apiKey,this.documentId,n.userId,n.name,n.email)}catch(t){Dc("checkDocumentUserAndCreateError",t)}const[d]=await Promise.all([Velt.setVeltAuthProvider({user:n,options:{throwError:!0},retryConfig:{retryCount:3,retryDelay:1e3},generateToken:async()=>await Wc(this.apiKey,null==n?void 0:n.userId,a),onError:t=>{console.log("Error signing to velt - ",t),this.invalidApiKey=!0}}),this.fetchAndApplyFeatureAccess()]);if(this.invalidApiKey)throw"Invalid Api Key - Domain Not Whitelisted";Oc(JSON.parse(JSON.stringify(d||{}))),(null==n?void 0:n.isAnonymous)||(this.snippylyUser=JSON.parse(JSON.stringify(n)));const h=JSON.parse(JSON.stringify(d||{}));if((null==h?void 0:h.userSnippylyId)&&!(null==h?void 0:h.isGuest)&&this.checkToMigrateGuestUser(h),Velt.getUserRole$().subscribe((t=>{var e;t&&(this.loading=!1,null===(e=this.commentElement)||void 0===e||e.enablePriority())})),this.contactListSubscription=Velt.getContactElement().getContactList().subscribe((t=>{var e;this.loading=!1,(null===(e=null==t?void 0:t.organizationUsers)||void 0===e?void 0:e.length)>0&&(this.checkPrivateCommentModeFromStorage(),this.contactListSubscription&&(this.contactListSubscription.unsubscribe(),this.contactListSubscription=null))})),(null===Velt||void 0===Velt?void 0:Velt.isPlanExpired$)&&(null===Velt||void 0===Velt||Velt.isPlanExpired$().subscribe((t=>{this.isPlanExpired=t}),(t=>{this.isPlanExpired=!1,console.warn("Error in isPlanExpired$: ",t),Dc("Error in isPlanExpired$: ",t)}))),null===Velt||void 0===Velt?void 0:Velt.on){let t;null===Velt||void 0===Velt||Velt.on("initUpdate").subscribe((e=>{"setDocumentsSuccess"===e.event&&(t&&(t.unsubscribe(),t=null),t=null===Velt||void 0===Velt?void 0:Velt.getDocumentMetadata().subscribe((async t=>{if(t){const e=await Rc(this.apiKey,null==t?void 0:t.clientDocumentId);this.setProjectConfigVariables(e)}}),(t=>{console.warn("Error in getDocumentMetadata: ",t),Dc("Error in getDocumentMetadata: ",t)})))}))}Lc({clientUserId:null==n?void 0:n.userId});try{$c(n)}catch(t){console.warn("Error in trackIdentifyEvent: ",t)}this.getComments(),this.checkGlobalUserContact(),setTimeout((()=>{hc(Lt)||(this.showTourCommentTooltip=!0)}),2e3)}catch(t){if(console.log("Error",t),this.loading=!1,this.signInError=!0,t&&"string"==typeof t&&(null===(e=null==t?void 0:t.toLowerCase())||void 0===e?void 0:e.includes("invalid"))){this.invalidApiKey=!0,Vc(pt.Events.DOMAIN_NOT_WHITELISTED),this.projectId&&jc(this.apiKey,this.projectId);if(new URL(document.location).searchParams.has(It))this.isSigningInUserAdmin=!0;else if(hc(Ot))this.isSigningInUserAdmin="true"===hc(Ot,!0);else{const t=await Pc(this.apiKey,this.projectId||"",i,o);this.isSigningInUserAdmin=!!(null==t?void 0:t.isAdmin),dc(Ot,this.isSigningInUserAdmin+"",!0)}}console.warn("Error in identifySnippyly: ",t),Dc("Error in identifySnippyly: ",t)}},this.fetchAndApplyFeatureAccess=async()=>{var t;try{this.featureAccess=await Xc(this.apiKey),this.applyStorageFeatureAccess();const e=null===(t=this.featureAccess)||void 0===t?void 0:t[Qc.Agents];this.hasAgentAccess=!0===(null==e?void 0:e.hasAccess)}catch(t){console.warn("Error in fetchAndApplyFeatureAccess: ",t),Dc("Error in fetchAndApplyFeatureAccess: ",t)}},this.applyStorageFeatureAccess=()=>{try{if(!this.featureAccess||!this.commentElement)return;const t=this.featureAccess[Qc.Storage];(null==t?void 0:t.hasUsageExhausted)&&(this.commentElement.disableAttachments(),this.commentElement.setRecordings("none"))}catch(t){Dc("Error in applyStorageFeatureAccess: ",t)}},this.checkToMigrateGuestUser=async t=>{try{const e=yc(!1,this.apiKey);e&&(await Gc(this.apiKey,this.projectId||"",e,t,!0),uc(St))}catch(t){console.warn("Error in checkToMigrationGuestUser: ",t),Dc("Error in checkToMigrationGuestUser: ",t)}},this.getComments=()=>{try{this.commentElement&&(this.commentSubscription&&this.commentSubscription.unsubscribe(),this.commentSubscription=this.commentElement.getAllCommentAnnotations(this.documentId).subscribe((t=>{this.comments=null==t?void 0:t.filter((t=>{var e;return["open","inProgress"].includes(null==t?void 0:t.status)||["default","ongoing"].includes(null===(e=null==t?void 0:t.status)||void 0===e?void 0:e.type)})),this.processAgentComments(t),this.filterAgentCommentsFromCurrentData()})))}catch(t){console.warn("Error in getComments: ",t),Dc("Error in getComments: ",t)}},this.handleCommentSelection=t=>{var e,i,o,n,s,r,a,l,c,d;try{if(!1===(null==t?void 0:t.selected))return void(null===(e=null===Velt||void 0===Velt?void 0:Velt.setUiState)||void 0===e||e.call(Velt,{showButtons:!1}));const h=null==t?void 0:t.annotation;if(!h||!this.isAgentAnnotation(h))return void(null===(i=null===Velt||void 0===Velt?void 0:Velt.setUiState)||void 0===i||i.call(Velt,{showButtons:!1}));const u=null===(n=null===(o=null==h?void 0:h.agent)||void 0===o?void 0:o.result)||void 0===n?void 0:n.incorrectWord,p=(null===(s=null==h?void 0:h.pageInfo)||void 0===s?void 0:s.path)||(null===(r=null==h?void 0:h.location)||void 0===r?void 0:r.path)||(null===(a=null==h?void 0:h.agent)||void 0===a?void 0:a.path);if(!u||!p)return void(null===(l=null===Velt||void 0===Velt?void 0:Velt.setUiState)||void 0===l||l.call(Velt,{showButtons:!1}));const v=this.normalizePagePath(p),g=u,f=null===(d=null===(c=null==h?void 0:h.agent)||void 0===c?void 0:c.result)||void 0===d?void 0:d.type;let m,w="";"grammar"===f?(m=this.grammarSuggestionPagePathMap,w="grammar"):(m=this.spellingSuggestionPagePathMap,w="spelling");const b=null==m?void 0:m.get(g);((null==b?void 0:b.get(v))||0)<=1?Velt.setUiState({showButtons:!1,warningType:w}):Velt.setUiState({showButtons:!0,warningType:w})}catch(t){console.warn("Error in handleCommentSelection: ",t),Dc("Error in handleCommentSelection: ",t)}},this.processAgentComments=t=>{var e,i,o,n,s,r,a,l,c,d,h,u,p,v,g,f,m,w,b,y,C,x;try{if(!(null==t?void 0:t.length))return this.hasContentWarnings=!1,this.contentWarningsCount=0,this.spellingWarnings=[],this.grammarWarnings=[],this.brokenLinkWarnings=[],this.spellingSuggestionPagePathMap=new Map,void(this.grammarSuggestionPagePathMap=new Map);const E=null==t?void 0:t.filter((t=>{var e;const i=(null===(e=null==t?void 0:t.status)||void 0===e?void 0:e.type)===Yt,o=(null==t?void 0:t.commentType)===qt;return this.isAgentAnnotation(t)&&!i&&o})),k=new Map,S=new Map,M=new Map,_=new Map,T=new Map;for(const t of E){const E=(null===(e=null==t?void 0:t.agent)||void 0===e?void 0:e.agentFields)||[],I=(null===(i=null==t?void 0:t.pageInfo)||void 0===i?void 0:i.url)||(null===(o=null==t?void 0:t.location)||void 0===o?void 0:o.url)||(null===(n=null==t?void 0:t.agent)||void 0===n?void 0:n.url)||"",N=(null===(s=null==t?void 0:t.pageInfo)||void 0===s?void 0:s.path)||(null===(r=null==t?void 0:t.location)||void 0===r?void 0:r.path)||(null===(a=null==t?void 0:t.agent)||void 0===a?void 0:a.path)||"",A=this.normalizePagePath(N);if(E.includes(Jt)){const e=(null===(c=null===(l=null==t?void 0:t.agent)||void 0===l?void 0:l.result)||void 0===c?void 0:c.url)||(null===(h=null===(d=null==t?void 0:t.agent)||void 0===d?void 0:d.result)||void 0===h?void 0:h.link)||I,i=(null===(p=null===(u=null==t?void 0:t.agent)||void 0===u?void 0:u.result)||void 0===p?void 0:p.statusCode)||(null===(g=null===(v=null==t?void 0:t.agent)||void 0===v?void 0:v.result)||void 0===g?void 0:g.status)||"404",o=(null==e?void 0:e.toLowerCase())||"";if(M.has(o)){const e=M.get(o);e.occurrences+=1,I&&!e.pageUrls.includes(I)&&e.pageUrls.push(I),e.annotations.push(t)}else M.set(o,{statusCode:i,url:e||"",occurrences:1,pageUrls:I?[I]:[],annotations:[t]})}else if(E.includes(Zt)){const e=(null===(m=null===(f=null==t?void 0:t.agent)||void 0===f?void 0:f.result)||void 0===m?void 0:m.incorrectWord)||(null===(w=null==t?void 0:t.targetElement)||void 0===w?void 0:w.targetText)||"",i=(null===(y=null===(b=null==t?void 0:t.agent)||void 0===b?void 0:b.result)||void 0===y?void 0:y.suggestions)||[],o=Array.isArray(i)?i[0]||"":i||"",n=null===(x=null===(C=null==t?void 0:t.agent)||void 0===C?void 0:C.result)||void 0===x?void 0:x.type,s=e||"";if("grammar"===n){T.has(s)||T.set(s,new Map);const i=T.get(s),n=i.get(A)||0;if(i.set(A,n+1),S.has(s)){const e=S.get(s);e.occurrences+=1,I&&!e.pageUrls.includes(I)&&e.pageUrls.push(I),e.annotations.push(t)}else S.set(s,{incorrectWord:e||"",suggestion:o||"",occurrences:1,pageUrls:I?[I]:[],annotations:[t]})}else{_.has(s)||_.set(s,new Map);const i=_.get(s),n=i.get(A)||0;if(i.set(A,n+1),k.has(s)){const e=k.get(s);e.occurrences+=1,I&&!e.pageUrls.includes(I)&&e.pageUrls.push(I),e.annotations.push(t)}else k.set(s,{incorrectWord:e||"",suggestion:o||"",occurrences:1,pageUrls:I?[I]:[],annotations:[t]})}}}this.spellingWarnings=Array.from(k.values()),this.grammarWarnings=Array.from(S.values()),this.brokenLinkWarnings=Array.from(M.values());const I=this.spellingWarnings.length+this.grammarWarnings.length+this.brokenLinkWarnings.length;this.contentWarningsCount=I,this.hasContentWarnings=I>0,this.spellingSuggestionPagePathMap=_,this.grammarSuggestionPagePathMap=T}catch(t){console.warn("Error in processAgentComments: ",t),Dc("Error in processAgentComments: ",t)}},this.normalizePagePath=t=>{try{return t?(null==t?void 0:t.startsWith("/"))?t.substring(1):t:""}catch(e){return console.warn("Error in normalizePagePath: ",e),t||""}},this.setQueryParamsCommentsInSdk=()=>{var t,e,i,o,n;try{const s="true"===sessionStorage.getItem("debugQueryParamsComments");s&&console.log("setQueryParamsCommentsInSdk commentElement",this.commentElement),this.commentElement&&(s&&console.log("setQueryParamsCommentsInSdk queryParamsComments",this.queryParamsComments),this.queryParamsComments&&(null===(t=this.commentElement)||void 0===t?void 0:t.enableQueryParamsComments)?(s&&console.log("enableQueryParamsComments this.commentElement?.enableQueryParamsComments",null===(e=this.commentElement)||void 0===e?void 0:e.enableQueryParamsComments),null===(i=this.commentElement)||void 0===i||i.enableQueryParamsComments()):!this.queryParamsComments&&(null===(o=this.commentElement)||void 0===o?void 0:o.disableQueryParamsComments)&&(s&&console.log("disableQueryParamsComments"),null===(n=this.commentElement)||void 0===n||n.disableQueryParamsComments()))}catch(t){console.warn("Error in setQueryParamsCommentsInSdk: ",t),Dc("Error in setQueryParamsCommentsInSdk: ",t)}},this.checkGlobalUserContact=()=>{try{this.contactElement&&this.contactElement.isUserGlobalContact().subscribe((t=>{this.isUserGlobalContact=t}))}catch(t){console.warn("Error in checkGlobalUserContact: ",t),Dc("Error in checkGlobalUserContact: ",t)}},this.setProjectConfigVariables=t=>{var e,i,o,n;try{const s="Admin"===this.snippylyUserRole;this.allFeatureDisabled=!s&&(null!==(e=null==t?void 0:t.disabled)&&void 0!==e&&e),this.allFeatureRestricted=null!==(i=null==t?void 0:t.restricted)&&void 0!==i&&i,this.guestMode=null!==(o=null==t?void 0:t.guestMode)&&void 0!==o&&o,this.allowGuestModeSignIn=!!(null===(n=null==t?void 0:t.guestModeConfig)||void 0===n?void 0:n.allowSignIn),(null==t?void 0:t.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.guestMode&&Vc(pt.Events.GUEST_MODE_PRESENT),this.passwordProtected=!1,this.queryParamsComments=!!(null==t?void 0:t.queryParamsComments),this.usePageTitleAsLocationName=!!(null==t?void 0:t.usePageTitleAsLocationName),Velt&&(t&&this.passwordProtected&&!this.isPasswordValid?Velt.disableFeatures(["area","arrow","audioHuddle","cursor","huddle","liveStateSync","presence","tag","recorder","comment"]):Velt.disableFeatures([])),dc($t,this.guestMode+"",!0),dc(Rt,this.allowGuestModeSignIn+"",!0),dc(Dt,this.passwordProtected+"",!0),dc(Vt,this.queryParamsComments+"",!0),dc(Ft,this.usePageTitleAsLocationName+"",!0)}catch(t){console.warn("Error in setProjectConfigVariables: ",t),Dc("Error in setProjectConfigVariables: ",t)}},this.toggleSnippylyPluginToolbar=()=>{try{this.expanded=!this.expanded,this.expanded?Vc(pt.Events.TOOLBAR_EXPANDED):Vc(pt.Events.TOOLBAR_COLLAPSED)}catch(t){console.warn("Error in toggleSnippylyPluginToolbar: ",t),Dc("Error in toggleSnippylyPluginToolbar: ",t)}},this.togglePrivateCommentMode=()=>{try{this.commentElement&&(this.privateCommentModeEnabled?(this.commentElement.disablePrivateCommentMode&&this.commentElement.disablePrivateCommentMode(),this.privateCommentModeEnabled=!1,Vc(pt.Events.PRIVATE_MODE_DISABLED)):(this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode(),this.privateCommentModeEnabled=!0,Vc(pt.Events.PRIVATE_MODE_ENABLED)),dc(Pt,this.privateCommentModeEnabled.toString()))}catch(t){console.warn("Error in togglePrivateCommentMode: ",t),Dc("Error in togglePrivateCommentMode: ",t)}},this.checkPrivateCommentModeFromStorage=()=>{try{this.allFeatureDisabled||"Admin"!==this.snippylyUserRole||hc(Pt)&&(this.privateCommentModeEnabled="true"===hc(Pt),this.privateCommentModeEnabled&&this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode())}catch(t){console.warn("Error in checkPrivateCommentModeFromStorage: ",t),Dc("Error in checkPrivateCommentModeFromStorage: ",t)}},this.loginWithGoogle=()=>{try{if(Vc(pt.Events.SIGNIN_CLICKED),this.loading||this.customLoginEnabledLocally)return;const t=this.buildSignInUrlWithParams(this.signInUrl||"");window.open(t,"_self")}catch(t){console.warn("Error in loginWithGoogle: ",t),Dc("Error in loginWithGoogle: ",t)}},this.buildSignInUrlWithParams=t=>{try{const e=new URL(t);return this.apiKey&&e.searchParams.set("apiKey",this.apiKey),this.projectId&&e.searchParams.set("projectId",this.projectId),e.toString()}catch(e){return console.warn("Error in buildSignInUrlWithParams: ",e),Dc("Error in buildSignInUrlWithParams: ",e),t}},this.getQRCode=async()=>{try{const t=new URL(window.location.href);null==t||t.searchParams.set("review","true");const e=null==t?void 0:t.toString();if(e){const t=gc(e,se,re),i=await fetch(`https://us-central1-snipply-sdk-staging.cloudfunctions.net/getqrcode?text=${encodeURIComponent(t)}`),o=await i.json();(null==o?void 0:o.qrcode)&&(this.qrCode=null==o?void 0:o.qrcode)}}catch(t){console.warn("Error in getQRCode: ",t),Dc("Error in getQRCode: ",t)}},this.toggleQRCodeVisibility=async()=>{try{Vc(pt.Events.OPEN_MOBILE_CLICKED),this.showQrCode=!this.showQrCode,this.showQrCode&&!this.qrCode&&await this.getQRCode()}catch(t){console.warn("Error in toggleQRCodeVisibility: ",t),Dc("Error in toggleQRCodeVisibility: ",t)}},this.onUserInviteToolClick=()=>{var t;(null===(t=this.snippylyUser)||void 0===t?void 0:t.isGuest)?(this.guestModeSignInModalConfig.title="Sign in to invite others.",this.guestModeSignInModalConfig.description="Invite team members to comment on this project.",this.guestModeSignInModalConfig.showLeaveCommentButton=!1,this.guestModeSignInModalConfig.closeOnClickOutside=!0,this.openGuestModeSignInModal()):this.openInviteModal()},this.openInviteModal=()=>{this.showInviteModal=!0,Vc(pt.Events.INVITE_MODAL_OPENED)},this.closeInviteModal=()=>{this.showInviteModal=!1},this.onInviteSuccess=()=>{this.closeInviteModal(),Vc(pt.Events.INVITE_SENT)},this.removeSnippyly=async()=>{try{Vc(pt.Events.EXIT_REVIEW_MODE_CLICKED),this.exitReviewModeCalled=!0,uc(wt),uc(bt),uc(yt),uc(Mt,"sessionStorage"),uc(_t,"sessionStorage");const t=new URL(document.location),e=t.searchParams;e.delete(yt),e.delete(wt),e.delete(Ct),e.delete(bt),this.projectVersionKey&&e.delete(this.projectVersionKey),e.delete(Tt),e.delete(It),e.delete(Nt),this.projectVersion=void 0,this.projectVersionKey=void 0,delete window.snippylyInitialLoadUrl,window.history.replaceState({},document.title,t.href),window.location.reload()}catch(t){console.warn("Error in removeSnippyly: ",t),Dc("Error in removeSnippyly: ",t)}},this.signOutUser=async()=>{try{Vc(pt.Events.SIGNOUT_CLICKED),this.subscriptions.forEach((t=>{t&&t.unsubscribe&&(null==t||t.unsubscribe())})),this.contactListSubscription&&(this.contactListSubscription.unsubscribe(),this.contactListSubscription=null),await Velt.signOutUser(),uc(xt),uc(kt),uc(Ot),uc(Pt),this.snippylyUser=void 0,window.open(this.signOutUrl,"_self")}catch(t){console.warn("Error in signOutUser: ",t),Dc("Error in signOutUser: ",t)}},this.toggleMenu=(t,e)=>{try{t.stopPropagation(),this.menuOpenedId===e?this.menuOpenedId=void 0:this.menuOpenedId=e}catch(t){console.warn("Error in toggleMenu: ",t),Dc("Error in toggleMenu: ",t)}},this.copyLink=()=>{try{navigator.clipboard.writeText(window.location.href),this.copyLinkTooltip="Link copied!",setTimeout((()=>{this.copyLinkTooltip="Copy Link"}),2e3)}catch(t){console.warn("Error in copyLink: ",t),Dc("Error in copyLink: ",t)}},this.goToAdminPortal=()=>{try{let t=`${ne}`;Velt&&(null===Velt||void 0===Velt?void 0:Velt.getDocumentId)&&this.serverDocumentId&&(t=`${ne}/dashboard/project/comment/${this.apiKey}/${this.serverDocumentId}`),Vc(pt.Events.VIEW_PROJECT_CLICKED),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortal: ",t),Dc("Error in goToAdminPortal: ",t)}},this.goToAdminPortalDashboard=()=>{try{let t=`${ne}`;Velt&&(null===Velt||void 0===Velt?void 0:Velt.getDocumentId)&&this.serverDocumentId&&(t=`${ne}/dashboard`),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortalDashboard: ",t),Dc("Error in goToAdminPortalDashboard: ",t)}},this.joinCommunity=()=>{try{window.open("https://join.slack.com/t/superflowusers/shared_invite/zt-1q3jzsddt-NEb~uu9RXscLfxOIDGQXJw","_blank")}catch(t){console.warn("Error in joinCommunity: ",t),Dc("Error in joinCommunity: ",t)}},this.onboardingNextClick=()=>{try{this.showOnboardingModal=!1,dc(It,"true");const t=new URL(document.location);t.searchParams.delete(It),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onboardingNextClick: ",t),Dc("Error in onboardingNextClick: ",t)}},this.onLiveDemoModalNextClick=()=>{try{this.showLiveDemoModal=!1,dc(Nt,"true",!1,"sessionStorage");const t=new URL(document.location);t.searchParams.delete(Nt),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onLiveDemoModalNextClick: ",t),Dc("Error in onLiveDemoModalNextClick: ",t)}},this.onFigmaDemoModalNextClick=()=>{try{this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(At),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onFigmaDemoModalNextClick: ",t),Dc("Error in onFigmaDemoModalNextClick: ",t)}},this.onUpgradePlanClick=()=>{try{window.open("https://superflow-portal-v2-staging.firebaseapp.com/settings/billing","_blank")}catch(t){console.warn("Error in onUpgradePlanClick: ",t),Dc("Error in onUpgradePlanClick: ",t)}},this.onTourCommentTooltipClick=()=>{try{this.showTourCommentTooltip=!1,dc(Lt,"true")}catch(t){console.warn("Error in onTourCommentTooltipClick: ",t),Dc("Error in onTourCommentTooltipClick: ",t)}},this.onGuestModeChipSignInButtonClick=()=>{try{Vc(pt.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeChipSignInButtonClick: ",t),Dc("Error in onGuestModeChipSignInButtonClick: ",t)}},this.openGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!0,Vc(pt.Events.GUEST_MODE_SIGN_IN_DIALOG_SHOWN)}catch(t){console.warn("Error in openGuestModeSignInModal: ",t),Dc("Error in openGuestModeSignInModal: ",t)}},this.closeGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!1,this.guestModeSignInModalConfig=JSON.parse(JSON.stringify(this.defaultGuestModeSignInModalConfig))}catch(t){console.warn("Error in closeGuestModeSignInModal: ",t),Dc("Error in closeGuestModeSignInModal: ",t)}},this.onGuestModeSignInModalSignInButtonClick=()=>{try{Vc(pt.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeSignInModalSignInButtonClick: ",t),Dc("Error in onGuestModeSignInModalSignInButtonClick: ",t)}},this.openGuestModeNameModel=t=>{try{t&&(t.stopPropagation(),t.preventDefault()),this.skipGuestNameModal||(this.showGuestModeNameModal=!0,Vc(pt.Events.GUEST_MODE_NAME_NUDGE_SHOWN))}catch(t){console.warn("Error in openGuestModeNameModel: ",t),Dc("Error in openGuestModeNameModel: ",t)}},this.closeGuestModeNameModel=()=>{try{this.showGuestModeNameModal=!1}catch(t){console.warn("Error in closeGuestModeNameModel: ",t),Dc("Error in closeGuestModeNameModel: ",t)}},this.onGuestModeNameModalSkipButtonClick=()=>{try{Vc(pt.Events.GUEST_MODE_SKIP_BUTTON_CLICKED),this.showGuestModeNameModal=!1}catch(t){console.warn("Error in onGuestModeNameModalSkipButtonClick: ",t),Dc("Error in onGuestModeNameModalSkipButtonClick: ",t)}},this.onPasswordProtectedModalCloseButtonClick=()=>{try{Vc(pt.Events.PASSWORD_PROTECTED_MODAL_CLOSE_BUTTON_CLICKED),this.showPasswordProtectedModal=!1,this.password="",this.showInvalidPassword=!1}catch(t){console.warn("Error in onPasswordProtectedModalCloseButtonClick: ",t),Dc("Error in onPasswordProtectedModalCloseButtonClick: ",t)}},this.onPasswordProtectedModalOpenButtonClick=()=>{try{Vc(pt.Events.PASSWORD_PROTECTED_MODAL_OPEN_BUTTON_CLICKED),this.showPasswordProtectedModal=!0}catch(t){console.warn("Error in onPasswordProtectedModalOpenButtonClick: ",t),Dc("Error in onPasswordProtectedModalOpenButtonClick: ",t)}},this.showGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!0,Vc(pt.Events.GUEST_MODE_SIGN_IN_NUDGE_SHOWN)}catch(t){console.warn("Error in showGuestModeSignInBanner: ",t),Dc("Error in showGuestModeSignInBanner: ",t)}},this.hideGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!1}catch(t){console.warn("Error in hideGuestModeSignInBanner: ",t),Dc("Error in hideGuestModeSignInBanner: ",t)}},this.onGuestModeBannerSignInButtonClick=()=>{try{Vc(pt.Events.GUEST_MODE_SIGN_IN_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeBannerSignInButtonClick: ",t),Dc("Error in onGuestModeBannerSignInButtonClick: ",t)}},this.updateGuestUserName=async()=>{var t;try{if(!(null===(t=this.guestUserNameInput)||void 0===t?void 0:t.trim()))return;if(this.guestUserNameUpdateLoading)return;const e=yc(!0,this.apiKey);if(e){const t=JSON.parse(JSON.stringify(e));e.name=this.guestUserNameInput,e.photoUrl=null,this.guestUserNameUpdateLoading=!0,Cc(e),await Velt.identify(e),this.snippylyUser=JSON.parse(JSON.stringify(e)),await Gc(this.apiKey,this.projectId||"",t,e),this.showGuestModeNameModal=!1,this.guestUserNameUpdated=!0,this.guestUserNameUpdateLoading=!1,dc(zt,"true"),Vc(pt.Events.GUEST_MODE_NAME_ADDED,{oldName:null==t?void 0:t.name,newName:null==e?void 0:e.name})}this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateGuestUserName: ",t),Dc("Error in updateGuestUserName: ",t)}},this.submitPassword=async()=>{var t;try{if(Vc(pt.Events.REVIEW_PASSWORD_ADDED),!(null===(t=this.password)||void 0===t?void 0:t.trim()))return;if(this.validatingPasswordLoading)return;this.validatingPasswordLoading=!0,this.isPasswordValid=await Uc(this.apiKey,this.projectId,this.password),lc(jt,this.isPasswordValid),this.isPasswordValid?(this.password="",this.onPasswordProtectedModalCloseButtonClick(),this.showInvalidPassword=!1,Velt&&Velt.disableFeatures([]),Vc(pt.Events.REVIEW_PASSWORD_ACCEPTED)):(this.showInvalidPassword=!0,Vc(pt.Events.REVIEW_PASSWORD_REJECTED)),this.validatingPasswordLoading=!1}catch(t){console.warn("Error in submitPassword: ",t),Dc("Error in submitPassword: ",t)}},this.updateUserName=async()=>{var t;try{if(!(null===(t=this.guestUserNameInput)||void 0===t?void 0:t.trim()))return;if(this.guestUserNameUpdateLoading)return;this.guestUserNameUpdateLoading=!0;const e=JSON.parse(JSON.stringify(this.snippylyUser)),i=JSON.parse(JSON.stringify(this.snippylyUser));i.name=this.guestUserNameInput,await Gc(this.apiKey,this.projectId||"",e,i),await Velt.updateUser(i),this.snippylyUser=JSON.parse(JSON.stringify(i));const o=mc();o.name=i.name;const n=JSON.stringify(o),s=gc(n,se,re);dc(kt,s,!0),this.guestUserNameUpdateLoading=!1,this.guestUserNameInput="",this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateUserName: ",t),Dc("Error in updateUserName: ",t)}},this.isAgentAnnotation=t=>{try{return(null==t?void 0:t.commentType)===qt}catch(t){return console.warn("Error in isAgentAnnotation: ",t),!1}},this.filterAgentCommentsFromSidebar=t=>{try{if(!t||!this.commentElement)return;const e=t.commentAnnotations;if(!Array.isArray(e))return;const i=[];e.forEach((t=>{this.isAgentAnnotation(t)||i.push(t)}));const o=new Map;i.forEach((t=>{var e,i,n,s;const r=(null===(e=null==t?void 0:t.pageInfo)||void 0===e?void 0:e.path)||(null===(i=null==t?void 0:t.pageInfo)||void 0===i?void 0:i.url)||(null===(n=null==t?void 0:t.location)||void 0===n?void 0:n.path)||"/";o.has(r)||o.set(r,[]),null===(s=o.get(r))||void 0===s||s.push(t)}));const n=[];o.forEach(((t,e)=>{n.push({groupId:e,groupName:e,isExpanded:!0,annotations:t})})),this.commentElement.setCommentSidebarData(n,{grouping:!0})}catch(t){console.warn("Error in filterAgentCommentsFromSidebar: ",t),Dc("Error in filterAgentCommentsFromSidebar: ",t)}},this.filterAgentCommentsFromCurrentData=()=>{var t;try{if(!this.commentElement||!(null===(t=this.comments)||void 0===t?void 0:t.length))return;const e=this.comments.filter((t=>!this.isAgentAnnotation(t))),i=new Map;e.forEach((t=>{var e,o,n,s;const r=(null===(e=null==t?void 0:t.pageInfo)||void 0===e?void 0:e.path)||(null===(o=null==t?void 0:t.pageInfo)||void 0===o?void 0:o.url)||(null===(n=null==t?void 0:t.location)||void 0===n?void 0:n.path)||"/";i.has(r)||i.set(r,[]),null===(s=i.get(r))||void 0===s||s.push(t)}));const o=[];i.forEach(((t,e)=>{o.push({groupId:e,groupName:e,isExpanded:!0,annotations:t})})),this.commentElement.setCommentSidebarData(o,{grouping:!0})}catch(t){console.warn("Error in filterAgentCommentsFromCurrentData: ",t),Dc("Error in filterAgentCommentsFromCurrentData: ",t)}},this.setupSidebarAgentCommentFilter=()=>{try{return}catch(t){console.warn("Error in setupSidebarAgentCommentFilter: ",t),Dc("Error in setupSidebarAgentCommentFilter: ",t)}},this.getContentWarningsDisplayCount=()=>{try{return this.contentWarningsCount>99?"99+":`${this.contentWarningsCount}`}catch(t){return console.warn("Error in getContentWarningsDisplayCount: ",t),"0"}},this.onContentWarningsButtonClick=()=>{try{this.showContentWarningSidebar=!this.showContentWarningSidebar}catch(t){console.warn("Error in onContentWarningsButtonClick: ",t),Dc("Error in onContentWarningsButtonClick: ",t)}},this.onContentWarningSidebarClose=()=>{try{this.showContentWarningSidebar=!1}catch(t){console.warn("Error in onContentWarningSidebarClose: ",t)}},this.handleContentWarningSidebarClickOutside=t=>{var e;try{const i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("content-warning-sidebar");if(!i)return;const o=t.composedPath(),n=o.some((t=>t===i)),s=o.some((t=>{var e;return t instanceof HTMLElement&&((null===(e=t.classList)||void 0===e?void 0:e.contains("content-warnings-button"))||null!==t.closest(".content-warnings-button"))}));n||s||(this.showContentWarningSidebar=!1)}catch(t){console.warn("Error in handleContentWarningSidebarClickOutside: ",t)}},this.addContentWarningSidebarClickListener=()=>{try{this.contentWarningSidebarClickHandler||(this.contentWarningSidebarClickHandler=this.handleContentWarningSidebarClickOutside.bind(this),document.addEventListener("click",this.contentWarningSidebarClickHandler,!0))}catch(t){console.warn("Error in addContentWarningSidebarClickListener: ",t)}},this.removeContentWarningSidebarClickListener=()=>{try{void 0!==this.contentWarningSidebarListenerTimeoutId&&(window.clearTimeout(this.contentWarningSidebarListenerTimeoutId),this.contentWarningSidebarListenerTimeoutId=void 0),this.contentWarningSidebarClickHandler&&(document.removeEventListener("click",this.contentWarningSidebarClickHandler,!0),this.contentWarningSidebarClickHandler=void 0)}catch(t){console.warn("Error in removeContentWarningSidebarClickListener: ",t)}},this.onQAExecutionComplete=t=>{try{const{executionId:e,status:i}=(null==t?void 0:t.detail)||{};Vc("QA Execution Complete",{executionId:e,status:i,documentId:this.documentId})}catch(t){console.warn("Error in onQAExecutionComplete: ",t)}},this.onContentWarningSidebarAddAll=()=>{},this.onContentWarningItemClick=t=>{var e,i,o;try{const n=null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.annotation;if(!(null==n?void 0:n.annotationId)&&!(null==n?void 0:n.id))return;const s=(null==n?void 0:n.annotationId)||(null==n?void 0:n.id),r=null===(i=null==n?void 0:n.pageInfo)||void 0===i?void 0:i.url;if(r&&!this.isCurrentPageUrl(r)){const t=new URL(r);return t.searchParams.set(Ct,s),void(window.location.href=t.toString())}(null===(o=this.commentElement)||void 0===o?void 0:o.selectCommentByAnnotationId)&&this.commentElement.selectCommentByAnnotationId(s),setTimeout((()=>{var t;(null===(t=this.commentElement)||void 0===t?void 0:t.scrollToCommentByAnnotationId)&&this.commentElement.scrollToCommentByAnnotationId(s)}),150)}catch(t){console.warn("Error in onContentWarningItemClick: ",t),Dc("Error in onContentWarningItemClick: ",t)}},this.isCurrentPageUrl=t=>{try{const e=new URL(t).pathname;return e===window.location.pathname}catch{return!1}},this.setupVeltButtonClickListener=()=>{try{if(!(null===Velt||void 0===Velt?void 0:Velt.on))return void console.warn("[CWS Toolbar] Velt.on not available for button click listener");Velt.on("veltButtonClick").subscribe((t=>{var e;try{if(!t)return;const i=null===(e=null==t?void 0:t.buttonContext)||void 0===e?void 0:e.clickedButtonId,o=null==t?void 0:t.commentAnnotation;"prev-suggestion"===i?this.navigateSuggestion(o,"prev"):"next-suggestion"===i?this.navigateSuggestion(o,"next"):"accept-suggestion"===i?this.handleAcceptSuggestion(o):"reject-suggestion"===i&&this.handleDeclineSuggestion(o)}catch(t){console.warn("Error in veltButtonClick handler: ",t)}})),this.commentElement.onCommentSelectionChange().subscribe((t=>{this.handleCommentSelection(t)}))}catch(t){console.warn("Error in setupVeltButtonClickListener: ",t),Dc("Error in setupVeltButtonClickListener: ",t)}},this.navigateSuggestion=(t,e)=>{var i,o,n,s,r;try{if(!t)return void console.warn("[CWS Toolbar] No annotation provided for navigation");const a=null===(o=null===(i=null==t?void 0:t.agent)||void 0===i?void 0:i.result)||void 0===o?void 0:o.incorrectWord;if(!a)return void console.warn("[CWS Toolbar] No incorrectWord found on annotation");const l=this.findMatchingWarning(a);if(!l)return void console.warn("[CWS Toolbar] No matching warning found for word:",a);const c=null===(n=null==t?void 0:t.pageInfo)||void 0===n?void 0:n.path,d=this.normalizePagePath(c),h=null===(s=null==l?void 0:l.annotations)||void 0===s?void 0:s.filter((t=>{var e;const i=null===(e=null==t?void 0:t.pageInfo)||void 0===e?void 0:e.path;return this.normalizePagePath(i)===d}));if(!(null==h?void 0:h.length)||h.length<=1)return;const u=(null==t?void 0:t.annotationId)||(null==t?void 0:t.id),p=h.findIndex((t=>((null==t?void 0:t.annotationId)||(null==t?void 0:t.id))===u));if(-1===p)return void console.warn("[CWS Toolbar] Current annotation not found in warning group");let v;v="next"===e?(p+1)%h.length:(p-1+h.length)%h.length;const g=h[v],f=(null==g?void 0:g.annotationId)||(null==g?void 0:g.id);f&&((null===(r=this.commentElement)||void 0===r?void 0:r.selectCommentByAnnotationId)&&this.commentElement.selectCommentByAnnotationId(f),setTimeout((()=>{var t;(null===(t=this.commentElement)||void 0===t?void 0:t.scrollToCommentByAnnotationId)&&this.commentElement.scrollToCommentByAnnotationId(f)}),150))}catch(t){console.warn("Error in navigateSuggestion: ",t),Dc("Error in navigateSuggestion: ",t)}},this.findMatchingWarning=t=>{var e,i;try{const o=null===(e=this.spellingWarnings)||void 0===e?void 0:e.find((e=>(null==e?void 0:e.incorrectWord)===t));if(o)return o;const n=null===(i=this.grammarWarnings)||void 0===i?void 0:i.find((e=>(null==e?void 0:e.incorrectWord)===t));return n||null}catch(t){return console.warn("Error in findMatchingWarning: ",t),null}},this.removeAnnotationFromWarnings=t=>{try{if(!t)return;const e=(e,i)=>{var o,n;for(const s of e){const e=null===(o=null==s?void 0:s.annotations)||void 0===o?void 0:o.find((e=>((null==e?void 0:e.annotationId)||(null==e?void 0:e.id))===t));if(e){const t=(null==s?void 0:s.incorrectWord)||"",o=null===(n=null==e?void 0:e.pageInfo)||void 0===n?void 0:n.path,r=this.normalizePagePath(o);if(t&&r&&i.has(t)){const e=i.get(t),o=e.get(r)||0;o>1?e.set(r,o-1):(e.delete(r),0===e.size&&i.delete(t))}return}}};e(this.spellingWarnings,this.spellingSuggestionPagePathMap),e(this.grammarWarnings,this.grammarSuggestionPagePathMap);const i=e=>{var i,o;return null!==(o=null===(i=null==e?void 0:e.map((e=>{var i;const o=null===(i=null==e?void 0:e.annotations)||void 0===i?void 0:i.filter((e=>((null==e?void 0:e.annotationId)||(null==e?void 0:e.id))!==t));return o&&0!==o.length?{...e,annotations:o,occurrences:o.length}:null})))||void 0===i?void 0:i.filter((t=>null!==t)))&&void 0!==o?o:[]};this.spellingWarnings=i(this.spellingWarnings),this.grammarWarnings=i(this.grammarWarnings),this.brokenLinkWarnings=i(this.brokenLinkWarnings);const o=this.spellingWarnings.length+this.grammarWarnings.length+this.brokenLinkWarnings.length;this.contentWarningsCount=o,this.hasContentWarnings=o>0}catch(t){console.warn("Error in removeAnnotationFromWarnings: ",t)}},this.handleAcceptSuggestion=async t=>{var e,i,o;try{const n=(null==t?void 0:t.annotationId)||(null==t?void 0:t.id);if(!n)return void console.warn("[CWS Toolbar] handleAcceptSuggestion: No annotationId found",t);const s=(null===(e=this.snippylyUser)||void 0===e?void 0:e.userId)||(null===(i=this.snippylyUser)||void 0===i?void 0:i.uid),r=(null===(o=this.snippylyUser)||void 0===o?void 0:o.email)||"";if(!s)return void console.warn("[CWS Toolbar] handleAcceptSuggestion: No user available");if(!this.documentId)return void console.warn("[CWS Toolbar] handleAcceptSuggestion: No documentId available");await td(this.apiKey,this.apiKey,this.documentId+"",n,{userId:s,email:r}),this.removeAnnotationFromWarnings(n)}catch(t){console.warn("Error in handleAcceptSuggestion: ",t),Dc("Error in handleAcceptSuggestion: ",t)}},this.handleDeclineSuggestion=async t=>{try{const e=(null==t?void 0:t.annotationId)||(null==t?void 0:t.id);if(!e)return void console.warn("[CWS Toolbar] handleDeclineSuggestion: No annotationId found",t);if(!this.documentId)return void console.warn("[CWS Toolbar] handleDeclineSuggestion: No documentId available");await ed(this.apiKey,this.apiKey,this.documentId+"",e),this.removeAnnotationFromWarnings(e)}catch(t){console.warn("Error in handleDeclineSuggestion: ",t),Dc("Error in handleDeclineSuggestion: ",t)}},this.disableCommentMode=()=>{var t;try{(null===(t=this.commentElement)||void 0===t?void 0:t.disableCommentMode)&&this.commentElement.disableCommentMode()}catch(t){console.warn("Error in disableAddCommentMode: ",t),Dc("Error in disableAddCommentMode: ",t)}},this.disableCommentModeButton=()=>{try{return this.addCommentMode?O`
4549
+ `}catch(t){return console.warn("Error in getWordMark: ",t),O``}},this.generateLocation=()=>{try{if(this.autoLocation){const t=new URL(document.location).searchParams,e=new URL(document.location);e.searchParams.delete(wt),e.searchParams.delete(bt),e.searchParams.delete(yt),e.searchParams.delete(Ct),e.searchParams.delete(It),e.searchParams.delete(Nt);const i=t.get(Tt)||this.projectVersion;this.queryParamsComments||(e.search="");let o=vc(e.href);this.projectId&&(o=null==o?void 0:o.replace(window.location.origin,"")),this.location={url:o,version:i}}}catch(t){console.warn("Error in generateLocation: ",t),Dc("Error in generateLocation: ",t)}},this.setLocation=t=>{var e,i,o,n;try{if(this.autoLocation&&window.Velt&&(null===Velt||void 0===Velt?void 0:Velt.setLocation)){if(this.version?(this.location||(this.location={}),this.location.version=this.version):this.location&&delete this.location.version,!(null==t?void 0:t.forceSetLocation)&&this.previousLocation&&(null===(e=this.previousLocation)||void 0===e?void 0:e.url)===(null===(i=this.location)||void 0===i?void 0:i.url)&&(null===(o=this.previousLocation)||void 0===o?void 0:o.version)===(null===(n=this.location)||void 0===n?void 0:n.version))return;const s=ac(JSON.parse(JSON.stringify(this.location)));if(s?this.location.id=`${s}`:delete this.location.id,this.usePageTitleAsLocationName){const t=document.title;t&&(this.location.locationName=t)}null===Velt||void 0===Velt||Velt.setLocation(JSON.parse(JSON.stringify(this.location))),Lc({clientLocation:this.location}),this.previousLocation=JSON.parse(JSON.stringify(this.location)),this.onVeltLocationChange()}}catch(t){console.warn("Error in setLocation: ",t),Dc("Error in setLocation: ",t)}},this.onVeltLocationChange=()=>{try{window.dispatchEvent(new CustomEvent("veltLocationChange",{detail:this.location}))}catch(t){console.warn("Error in onVeltLocationChange: ",t),Dc("Error in onVeltLocationChange: ",t)}},this.identifySnippyly=async()=>{var t,e;let i="",o="";try{this.invalidApiKey=!1;let e,n={name:"Default User",email:"default@usesuperflow.com",userId:"default",isAnonymous:!0,organizationId:this.apiKey};e=this.customLoginEnabled&&this.providedUser?this.providedUser:mc();const s=await this.getSamlConfig(),r=new URL(document.location);if(r.searchParams.has(Et)&&r.searchParams.delete(Et),s&&(this.signInUrl=`${ne}saml/${s.slug}/login?redirect_url=${encodeURIComponent(null==r?void 0:r.toString())}&source=sf`,window.Superflow.signInUrl=this.signInUrl),(null==e?void 0:e.email)&&(n=e),n.isAnonymous)delete n.groupId;else{const t=Velt.getDocumentId()||this.serverDocumentId;t&&(n.groupId=t+"")}if(this.customLoginEnabledLocally||(null===(t=null==n?void 0:n.contacts)||void 0===t?void 0:t.length)&&(n.contacts=[]),i=null==n?void 0:n.email,o=null==n?void 0:n.userId,(null==n?void 0:n.isAnonymous)&&this.projectId&&this.guestMode){const t=yc(!0,this.apiKey);t&&(n=JSON.parse(JSON.stringify(t)))}(null==n?void 0:n.isAnonymous)||(this.loading=!0);const a={};(null==n?void 0:n.groupId)&&(a.groupId=null==n?void 0:n.groupId),n.organizationId=this.apiKey;const l=await Pc(this.apiKey,this.projectId||"",null==n?void 0:n.email,null==n?void 0:n.userId),c=null==l?void 0:l.isAdmin;if(this.snippylyUserRole=c?"Admin":"Commenter",c&&(a.isAdmin=c,c&&this.allFeatureDisabled&&(this.allFeatureDisabled=!1)),(null==n?void 0:n.userId)&&!(null==n?void 0:n.isGuest)&&!(null==n?void 0:n.isAnonymous)&&this.documentId)try{await qc(this.apiKey,this.documentId,n.userId,n.name,n.email)}catch(t){Dc("checkDocumentUserAndCreateError",t)}const[d]=await Promise.all([Velt.setVeltAuthProvider({user:n,options:{throwError:!0},retryConfig:{retryCount:3,retryDelay:1e3},generateToken:async()=>await Wc(this.apiKey,null==n?void 0:n.userId,a),onError:t=>{console.log("Error signing to velt - ",t),this.invalidApiKey=!0}}),this.fetchAndApplyFeatureAccess()]);if(this.hasAgentAccess&&this.insertShadowDOM(),this.invalidApiKey)throw"Invalid Api Key - Domain Not Whitelisted";Oc(JSON.parse(JSON.stringify(d||{}))),(null==n?void 0:n.isAnonymous)||(this.snippylyUser=JSON.parse(JSON.stringify(n)));const h=JSON.parse(JSON.stringify(d||{}));if((null==h?void 0:h.userSnippylyId)&&!(null==h?void 0:h.isGuest)&&this.checkToMigrateGuestUser(h),Velt.getUserRole$().subscribe((t=>{var e;t&&(this.loading=!1,null===(e=this.commentElement)||void 0===e||e.enablePriority())})),this.contactListSubscription=Velt.getContactElement().getContactList().subscribe((t=>{var e;this.loading=!1,(null===(e=null==t?void 0:t.organizationUsers)||void 0===e?void 0:e.length)>0&&(this.checkPrivateCommentModeFromStorage(),this.contactListSubscription&&(this.contactListSubscription.unsubscribe(),this.contactListSubscription=null))})),(null===Velt||void 0===Velt?void 0:Velt.isPlanExpired$)&&(null===Velt||void 0===Velt||Velt.isPlanExpired$().subscribe((t=>{this.isPlanExpired=t}),(t=>{this.isPlanExpired=!1,console.warn("Error in isPlanExpired$: ",t),Dc("Error in isPlanExpired$: ",t)}))),null===Velt||void 0===Velt?void 0:Velt.on){let t;null===Velt||void 0===Velt||Velt.on("initUpdate").subscribe((e=>{"setDocumentsSuccess"===e.event&&(t&&(t.unsubscribe(),t=null),t=null===Velt||void 0===Velt?void 0:Velt.getDocumentMetadata().subscribe((async t=>{if(t){const e=await Rc(this.apiKey,null==t?void 0:t.clientDocumentId);this.setProjectConfigVariables(e)}}),(t=>{console.warn("Error in getDocumentMetadata: ",t),Dc("Error in getDocumentMetadata: ",t)})))}))}Lc({clientUserId:null==n?void 0:n.userId});try{$c(n)}catch(t){console.warn("Error in trackIdentifyEvent: ",t)}this.getComments(),this.checkGlobalUserContact(),setTimeout((()=>{hc(Lt)||(this.showTourCommentTooltip=!0)}),2e3)}catch(t){if(console.log("Error",t),this.loading=!1,this.signInError=!0,t&&"string"==typeof t&&(null===(e=null==t?void 0:t.toLowerCase())||void 0===e?void 0:e.includes("invalid"))){this.invalidApiKey=!0,Vc(pt.Events.DOMAIN_NOT_WHITELISTED),this.projectId&&jc(this.apiKey,this.projectId);if(new URL(document.location).searchParams.has(It))this.isSigningInUserAdmin=!0;else if(hc(Ot))this.isSigningInUserAdmin="true"===hc(Ot,!0);else{const t=await Pc(this.apiKey,this.projectId||"",i,o);this.isSigningInUserAdmin=!!(null==t?void 0:t.isAdmin),dc(Ot,this.isSigningInUserAdmin+"",!0)}}console.warn("Error in identifySnippyly: ",t),Dc("Error in identifySnippyly: ",t)}},this.fetchAndApplyFeatureAccess=async()=>{var t;try{this.featureAccess=await Xc(this.apiKey),this.applyStorageFeatureAccess();const e=null===(t=this.featureAccess)||void 0===t?void 0:t[Qc.Agents];this.hasAgentAccess=!0===(null==e?void 0:e.hasAccess)}catch(t){console.warn("Error in fetchAndApplyFeatureAccess: ",t),Dc("Error in fetchAndApplyFeatureAccess: ",t)}},this.insertShadowDOM=()=>{try{const t=document.createElement("velt-wireframe");t.innerHTML='\n <style>\n .velt-comment-dialog--body {\n border-radius: 20px !important;\n }\n\n .velt-comment-dialog{\n background-color: transparent !important;\n border: none !important;\n }\n\n .velt-comment-dialog{\n padding: 0 !important;\n }\n\n .sf-suggestion-card {\n min-width: 320px;\n display: flex;\n flex-direction: column;\n gap: 4px;\n padding: 8px;\n border: 1px solid #625df5;\n border-radius: 16px;\n background: #ffffff;\n font-family: \'Poppins\', sans-serif;\n box-sizing: border-box;\n }\n\n .sf-suggestion-words {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 2px;\n padding: 6px 8px;\n font-size: 16px;\n font-weight: 500;\n line-height: normal;\n min-width: 0;\n width: 100%;\n box-sizing: border-box;\n }\n\n .sf-incorrect-word {\n text-decoration: line-through;\n color: #ff7162;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n }\n\n .sf-arrow-down {\n color: #b0b0b0;\n display: flex;\n align-items: center;\n }\n\n .sf-correct-word {\n color: #0a0a0a;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n }\n\n .sf-suggestion-actions {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .sf-stepper {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n .sf-stepper-btn {\n display: flex;\n align-items: center;\n padding: 4px;\n opacity: 0;\n cursor: pointer;\n border: none;\n background: transparent;\n color: #7a7a7a;\n border-radius: 4px;\n transition: background 0.15s ease;\n }\n\n .velt-comment-dialog.selected button.sf-stepper-btn{\n opacity: 1\n }\n\n\n .sf-stepper-btn:hover {\n background: #f5f5f5;\n }\n\n .sf-stepper-count {\n font-size: 12px;\n font-weight: 500;\n color: #7a7a7a;\n white-space: nowrap;\n font-family: \'Poppins\', sans-serif;\n }\n\n .sf-accept-reject {\n display: flex;\n align-items: center;\n gap: 4px;\n }\n\n .sf-accept-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 4px 12px;\n border-radius: 32px;\n background: #198f65;\n border: none;\n cursor: pointer;\n transition: opacity 0.15s ease;\n }\n\n .sf-accept-btn:hover {\n opacity: 0.85;\n }\n\n .sf-reject-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 4px 12px;\n border-radius: 32px;\n background: #ff7162;\n border: none;\n cursor: pointer;\n transition: opacity 0.15s ease;\n }\n\n .sf-reject-btn:hover {\n opacity: 0.85;\n }\n \n .sf-comment-dialog-body-wireframe-default{\n display: flex;\n align-items: flex-start;\n border-radius: 1rem !important;\n background-color: white !important;\n padding: 1rem !important;\n flex-direction: column;\n gap: 1rem;\n &:empty{\n display: none !important;\n }\n\n velt-comment-dialog-private-banner-internal,\n velt-comment-dialog-body-internal,\n velt-comment-dialog-all-comment-internal{\n width: 100% !important;\n }\n }\n\n .no-comments:has(.sf-comment-dialog-body-wireframe-default){\n .sf-comment-dialog-body-wireframe-default{\n padding: 0 !important;\n }\n \n }\n\n .velt-thread-card--emoji-picker-button{\n transition: opacity 0.2s ease-in-out !important;\n opacity: 0 !important;\n }\n .velt-thread-card--message-wrap:hover .velt-thread-card--emoji-picker-button {\n opacity: 1 !important;\n }\n\n </style>\n <velt-wireframe style="display: none;">\n <velt-comment-dialog-wireframe variant="dialog">\n <velt-if condition="{annotation.commentType} == \'suggestion\'">\n <velt-comment-dialog-body-wireframe>\n <velt-comment-dialog-threads-wireframe>\n <velt-comment-dialog-thread-card-wireframe>\n \n <div class="sf-suggestion-card">\n <div class="sf-suggestion-words">\n <span class="sf-incorrect-word">\n <velt-data field="commentAnnotation.agent.result.incorrectWord"></velt-data>\n </span>\n <span class="sf-correct-word">\n <velt-data field="commentAnnotation.agent.result.suggestions[0]"></velt-data>\n </span>\n </div>\n\n <div class="sf-suggestion-actions">\n <div class="sf-stepper">\n <velt-if condition="{showButtons} == true">\n <velt-button-wireframe id="prev-suggestion" type="button">\n <button class="sf-stepper-btn" type="button">\n <svg width="12" height="12" viewBox="0 0 24 24" fill="none"\n xmlns="http://www.w3.org/2000/svg">\n <path d="M15 18L9 12L15 6" stroke="currentColor" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n </svg>\n </button>\n </velt-button-wireframe>\n <velt-button-wireframe id="next-suggestion" type="button">\n <button class="sf-stepper-btn" type="button">\n <svg width="12" height="12" viewBox="0 0 24 24" fill="none"\n xmlns="http://www.w3.org/2000/svg">\n <path d="M9 6L15 12L9 18" stroke="currentColor" stroke-width="2"\n stroke-linecap="round" stroke-linejoin="round" />\n </svg>\n </button>\n </velt-button-wireframe>\n </velt-if>\n </div>\n\n <div class="sf-accept-reject">\n <velt-button-wireframe id="accept-suggestion" type="button">\n <button class="sf-accept-btn" type="button">\n <svg width="16" height="16" viewBox="0 0 24 24" fill="none"\n xmlns="http://www.w3.org/2000/svg">\n <path d="M20 6L9 17L4 12" stroke="#ffffff" stroke-width="2.5"\n stroke-linecap="round" stroke-linejoin="round" />\n </svg>\n </button>\n </velt-button-wireframe>\n <velt-button-wireframe id="reject-suggestion" type="button">\n <button class="sf-reject-btn" type="button">\n <svg width="16" height="16" viewBox="0 0 24 24" fill="none"\n xmlns="http://www.w3.org/2000/svg">\n <path d="M18 6L6 18M6 6L18 18" stroke="#ffffff" stroke-width="2.5"\n stroke-linecap="round" stroke-linejoin="round" />\n </svg>\n </button>\n </velt-button-wireframe>\n </div>\n </div>\n </div>\n\n </velt-comment-dialog-thread-card-wireframe>\n </velt-comment-dialog-threads-wireframe>\n </velt-comment-dialog-body-wireframe>\n </velt-if>\n\n <velt-if condition="{annotation.commentType} != \'suggestion\'" class="sf-comment-dialog-body-wireframe-default" >\n <velt-comment-dialog-ghost-banner-wireframe></velt-comment-dialog-ghost-banner-wireframe>\n <velt-comment-dialog-private-banner-wireframe></velt-comment-dialog-private-banner-wireframe>\n <velt-comment-dialog-assignee-banner-wireframe></velt-comment-dialog-assignee-banner-wireframe>\n <velt-comment-dialog-header-wireframe></velt-comment-dialog-header-wireframe>\n <velt-comment-dialog-body-wireframe></velt-comment-dialog-body-wireframe>\n <velt-comment-dialog-composer-wireframe></velt-comment-dialog-composer-wireframe>\n <velt-comment-dialog-all-comment-wireframe></velt-comment-dialog-all-comment-wireframe>\n <velt-comment-dialog-approve-wireframe></velt-comment-dialog-approve-wireframe>\n <velt-comment-dialog-sign-in-wireframe></velt-comment-dialog-sign-in-wireframe>\n <velt-comment-dialog-upgrade-wireframe></velt-comment-dialog-upgrade-wireframe>\n <velt-comment-dialog-suggestion-action-wireframe></velt-comment-dialog-suggestion-action-wireframe>\n </velt-if>\n </velt-comment-dialog-wireframe>\n </velt-wireframe>\n ',window.document.body.appendChild(t)}catch(t){console.warn("Error in insertShadowDOM: ",t),Dc("Error in insertShadowDOM: ",t)}},this.applyStorageFeatureAccess=()=>{try{if(!this.featureAccess||!this.commentElement)return;const t=this.featureAccess[Qc.Storage];(null==t?void 0:t.hasUsageExhausted)&&(this.commentElement.disableAttachments(),this.commentElement.setRecordings("none"))}catch(t){Dc("Error in applyStorageFeatureAccess: ",t)}},this.checkToMigrateGuestUser=async t=>{try{const e=yc(!1,this.apiKey);e&&(await Gc(this.apiKey,this.projectId||"",e,t,!0),uc(St))}catch(t){console.warn("Error in checkToMigrationGuestUser: ",t),Dc("Error in checkToMigrationGuestUser: ",t)}},this.getComments=()=>{try{this.commentElement&&(this.commentSubscription&&this.commentSubscription.unsubscribe(),this.commentSubscription=this.commentElement.getAllCommentAnnotations(this.documentId).subscribe((t=>{this.comments=null==t?void 0:t.filter((t=>{var e;return["open","inProgress"].includes(null==t?void 0:t.status)||["default","ongoing"].includes(null===(e=null==t?void 0:t.status)||void 0===e?void 0:e.type)})),this.processAgentComments(t),this.filterAgentCommentsFromCurrentData()})))}catch(t){console.warn("Error in getComments: ",t),Dc("Error in getComments: ",t)}},this.handleCommentSelection=t=>{var e,i,o,n,s,r,a,l,c,d;try{if(!1===(null==t?void 0:t.selected))return void(null===(e=null===Velt||void 0===Velt?void 0:Velt.setUiState)||void 0===e||e.call(Velt,{showButtons:!1}));const h=null==t?void 0:t.annotation;if(!h||!this.isAgentAnnotation(h))return void(null===(i=null===Velt||void 0===Velt?void 0:Velt.setUiState)||void 0===i||i.call(Velt,{showButtons:!1}));const u=null===(n=null===(o=null==h?void 0:h.agent)||void 0===o?void 0:o.result)||void 0===n?void 0:n.incorrectWord,p=(null===(s=null==h?void 0:h.pageInfo)||void 0===s?void 0:s.path)||(null===(r=null==h?void 0:h.location)||void 0===r?void 0:r.path)||(null===(a=null==h?void 0:h.agent)||void 0===a?void 0:a.path);if(!u||!p)return void(null===(l=null===Velt||void 0===Velt?void 0:Velt.setUiState)||void 0===l||l.call(Velt,{showButtons:!1}));const v=this.normalizePagePath(p),g=u,f=null===(d=null===(c=null==h?void 0:h.agent)||void 0===c?void 0:c.result)||void 0===d?void 0:d.type;let m,w="";"grammar"===f?(m=this.grammarSuggestionPagePathMap,w="grammar"):(m=this.spellingSuggestionPagePathMap,w="spelling");const b=null==m?void 0:m.get(g);((null==b?void 0:b.get(v))||0)<=1?Velt.setUiState({showButtons:!1,warningType:w}):Velt.setUiState({showButtons:!0,warningType:w})}catch(t){console.warn("Error in handleCommentSelection: ",t),Dc("Error in handleCommentSelection: ",t)}},this.processAgentComments=t=>{var e,i,o,n,s,r,a,l,c,d,h,u,p,v,g,f,m,w,b,y,C,x;try{if(!(null==t?void 0:t.length))return this.hasContentWarnings=!1,this.contentWarningsCount=0,this.spellingWarnings=[],this.grammarWarnings=[],this.brokenLinkWarnings=[],this.spellingSuggestionPagePathMap=new Map,void(this.grammarSuggestionPagePathMap=new Map);const E=null==t?void 0:t.filter((t=>{var e;const i=(null===(e=null==t?void 0:t.status)||void 0===e?void 0:e.type)===Yt,o=(null==t?void 0:t.commentType)===qt;return this.isAgentAnnotation(t)&&!i&&o})),k=new Map,S=new Map,M=new Map,_=new Map,T=new Map;for(const t of E){const E=(null===(e=null==t?void 0:t.agent)||void 0===e?void 0:e.agentFields)||[],I=(null===(i=null==t?void 0:t.pageInfo)||void 0===i?void 0:i.url)||(null===(o=null==t?void 0:t.location)||void 0===o?void 0:o.url)||(null===(n=null==t?void 0:t.agent)||void 0===n?void 0:n.url)||"",N=(null===(s=null==t?void 0:t.pageInfo)||void 0===s?void 0:s.path)||(null===(r=null==t?void 0:t.location)||void 0===r?void 0:r.path)||(null===(a=null==t?void 0:t.agent)||void 0===a?void 0:a.path)||"",A=this.normalizePagePath(N);if(E.includes(Jt)){const e=(null===(c=null===(l=null==t?void 0:t.agent)||void 0===l?void 0:l.result)||void 0===c?void 0:c.url)||(null===(h=null===(d=null==t?void 0:t.agent)||void 0===d?void 0:d.result)||void 0===h?void 0:h.link)||I,i=(null===(p=null===(u=null==t?void 0:t.agent)||void 0===u?void 0:u.result)||void 0===p?void 0:p.statusCode)||(null===(g=null===(v=null==t?void 0:t.agent)||void 0===v?void 0:v.result)||void 0===g?void 0:g.status)||"404",o=(null==e?void 0:e.toLowerCase())||"";if(M.has(o)){const e=M.get(o);e.occurrences+=1,I&&!e.pageUrls.includes(I)&&e.pageUrls.push(I),e.annotations.push(t)}else M.set(o,{statusCode:i,url:e||"",occurrences:1,pageUrls:I?[I]:[],annotations:[t]})}else if(E.includes(Zt)){const e=(null===(m=null===(f=null==t?void 0:t.agent)||void 0===f?void 0:f.result)||void 0===m?void 0:m.incorrectWord)||(null===(w=null==t?void 0:t.targetElement)||void 0===w?void 0:w.targetText)||"",i=(null===(y=null===(b=null==t?void 0:t.agent)||void 0===b?void 0:b.result)||void 0===y?void 0:y.suggestions)||[],o=Array.isArray(i)?i[0]||"":i||"",n=null===(x=null===(C=null==t?void 0:t.agent)||void 0===C?void 0:C.result)||void 0===x?void 0:x.type,s=e||"";if("grammar"===n){T.has(s)||T.set(s,new Map);const i=T.get(s),n=i.get(A)||0;if(i.set(A,n+1),S.has(s)){const e=S.get(s);e.occurrences+=1,I&&!e.pageUrls.includes(I)&&e.pageUrls.push(I),e.annotations.push(t)}else S.set(s,{incorrectWord:e||"",suggestion:o||"",occurrences:1,pageUrls:I?[I]:[],annotations:[t]})}else{_.has(s)||_.set(s,new Map);const i=_.get(s),n=i.get(A)||0;if(i.set(A,n+1),k.has(s)){const e=k.get(s);e.occurrences+=1,I&&!e.pageUrls.includes(I)&&e.pageUrls.push(I),e.annotations.push(t)}else k.set(s,{incorrectWord:e||"",suggestion:o||"",occurrences:1,pageUrls:I?[I]:[],annotations:[t]})}}}this.spellingWarnings=Array.from(k.values()),this.grammarWarnings=Array.from(S.values()),this.brokenLinkWarnings=Array.from(M.values());const I=this.spellingWarnings.length+this.grammarWarnings.length+this.brokenLinkWarnings.length;this.contentWarningsCount=I,this.hasContentWarnings=I>0,this.spellingSuggestionPagePathMap=_,this.grammarSuggestionPagePathMap=T}catch(t){console.warn("Error in processAgentComments: ",t),Dc("Error in processAgentComments: ",t)}},this.normalizePagePath=t=>{try{return t?(null==t?void 0:t.startsWith("/"))?t.substring(1):t:""}catch(e){return console.warn("Error in normalizePagePath: ",e),t||""}},this.setQueryParamsCommentsInSdk=()=>{var t,e,i,o,n;try{const s="true"===sessionStorage.getItem("debugQueryParamsComments");s&&console.log("setQueryParamsCommentsInSdk commentElement",this.commentElement),this.commentElement&&(s&&console.log("setQueryParamsCommentsInSdk queryParamsComments",this.queryParamsComments),this.queryParamsComments&&(null===(t=this.commentElement)||void 0===t?void 0:t.enableQueryParamsComments)?(s&&console.log("enableQueryParamsComments this.commentElement?.enableQueryParamsComments",null===(e=this.commentElement)||void 0===e?void 0:e.enableQueryParamsComments),null===(i=this.commentElement)||void 0===i||i.enableQueryParamsComments()):!this.queryParamsComments&&(null===(o=this.commentElement)||void 0===o?void 0:o.disableQueryParamsComments)&&(s&&console.log("disableQueryParamsComments"),null===(n=this.commentElement)||void 0===n||n.disableQueryParamsComments()))}catch(t){console.warn("Error in setQueryParamsCommentsInSdk: ",t),Dc("Error in setQueryParamsCommentsInSdk: ",t)}},this.checkGlobalUserContact=()=>{try{this.contactElement&&this.contactElement.isUserGlobalContact().subscribe((t=>{this.isUserGlobalContact=t}))}catch(t){console.warn("Error in checkGlobalUserContact: ",t),Dc("Error in checkGlobalUserContact: ",t)}},this.setProjectConfigVariables=t=>{var e,i,o,n;try{const s="Admin"===this.snippylyUserRole;this.allFeatureDisabled=!s&&(null!==(e=null==t?void 0:t.disabled)&&void 0!==e&&e),this.allFeatureRestricted=null!==(i=null==t?void 0:t.restricted)&&void 0!==i&&i,this.guestMode=null!==(o=null==t?void 0:t.guestMode)&&void 0!==o&&o,this.allowGuestModeSignIn=!!(null===(n=null==t?void 0:t.guestModeConfig)||void 0===n?void 0:n.allowSignIn),(null==t?void 0:t.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.guestMode&&Vc(pt.Events.GUEST_MODE_PRESENT),this.passwordProtected=!1,this.queryParamsComments=!!(null==t?void 0:t.queryParamsComments),this.usePageTitleAsLocationName=!!(null==t?void 0:t.usePageTitleAsLocationName),Velt&&(t&&this.passwordProtected&&!this.isPasswordValid?Velt.disableFeatures(["area","arrow","audioHuddle","cursor","huddle","liveStateSync","presence","tag","recorder","comment"]):Velt.disableFeatures([])),dc($t,this.guestMode+"",!0),dc(Rt,this.allowGuestModeSignIn+"",!0),dc(Dt,this.passwordProtected+"",!0),dc(Vt,this.queryParamsComments+"",!0),dc(Ft,this.usePageTitleAsLocationName+"",!0)}catch(t){console.warn("Error in setProjectConfigVariables: ",t),Dc("Error in setProjectConfigVariables: ",t)}},this.toggleSnippylyPluginToolbar=()=>{try{this.expanded=!this.expanded,this.expanded?Vc(pt.Events.TOOLBAR_EXPANDED):Vc(pt.Events.TOOLBAR_COLLAPSED)}catch(t){console.warn("Error in toggleSnippylyPluginToolbar: ",t),Dc("Error in toggleSnippylyPluginToolbar: ",t)}},this.togglePrivateCommentMode=()=>{try{this.commentElement&&(this.privateCommentModeEnabled?(this.commentElement.disablePrivateCommentMode&&this.commentElement.disablePrivateCommentMode(),this.privateCommentModeEnabled=!1,Vc(pt.Events.PRIVATE_MODE_DISABLED)):(this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode(),this.privateCommentModeEnabled=!0,Vc(pt.Events.PRIVATE_MODE_ENABLED)),dc(Pt,this.privateCommentModeEnabled.toString()))}catch(t){console.warn("Error in togglePrivateCommentMode: ",t),Dc("Error in togglePrivateCommentMode: ",t)}},this.checkPrivateCommentModeFromStorage=()=>{try{this.allFeatureDisabled||"Admin"!==this.snippylyUserRole||hc(Pt)&&(this.privateCommentModeEnabled="true"===hc(Pt),this.privateCommentModeEnabled&&this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode())}catch(t){console.warn("Error in checkPrivateCommentModeFromStorage: ",t),Dc("Error in checkPrivateCommentModeFromStorage: ",t)}},this.loginWithGoogle=()=>{try{if(Vc(pt.Events.SIGNIN_CLICKED),this.loading||this.customLoginEnabledLocally)return;const t=this.buildSignInUrlWithParams(this.signInUrl||"");window.open(t,"_self")}catch(t){console.warn("Error in loginWithGoogle: ",t),Dc("Error in loginWithGoogle: ",t)}},this.buildSignInUrlWithParams=t=>{try{const e=new URL(t);return this.apiKey&&e.searchParams.set("apiKey",this.apiKey),this.projectId&&e.searchParams.set("projectId",this.projectId),e.toString()}catch(e){return console.warn("Error in buildSignInUrlWithParams: ",e),Dc("Error in buildSignInUrlWithParams: ",e),t}},this.getQRCode=async()=>{try{const t=new URL(window.location.href);null==t||t.searchParams.set("review","true");const e=null==t?void 0:t.toString();if(e){const t=gc(e,se,re),i=await fetch(`https://us-central1-snipply-sdk-staging.cloudfunctions.net/getqrcode?text=${encodeURIComponent(t)}`),o=await i.json();(null==o?void 0:o.qrcode)&&(this.qrCode=null==o?void 0:o.qrcode)}}catch(t){console.warn("Error in getQRCode: ",t),Dc("Error in getQRCode: ",t)}},this.toggleQRCodeVisibility=async()=>{try{Vc(pt.Events.OPEN_MOBILE_CLICKED),this.showQrCode=!this.showQrCode,this.showQrCode&&!this.qrCode&&await this.getQRCode()}catch(t){console.warn("Error in toggleQRCodeVisibility: ",t),Dc("Error in toggleQRCodeVisibility: ",t)}},this.onUserInviteToolClick=()=>{var t;(null===(t=this.snippylyUser)||void 0===t?void 0:t.isGuest)?(this.guestModeSignInModalConfig.title="Sign in to invite others.",this.guestModeSignInModalConfig.description="Invite team members to comment on this project.",this.guestModeSignInModalConfig.showLeaveCommentButton=!1,this.guestModeSignInModalConfig.closeOnClickOutside=!0,this.openGuestModeSignInModal()):this.openInviteModal()},this.openInviteModal=()=>{this.showInviteModal=!0,Vc(pt.Events.INVITE_MODAL_OPENED)},this.closeInviteModal=()=>{this.showInviteModal=!1},this.onInviteSuccess=()=>{this.closeInviteModal(),Vc(pt.Events.INVITE_SENT)},this.removeSnippyly=async()=>{try{Vc(pt.Events.EXIT_REVIEW_MODE_CLICKED),this.exitReviewModeCalled=!0,uc(wt),uc(bt),uc(yt),uc(Mt,"sessionStorage"),uc(_t,"sessionStorage");const t=new URL(document.location),e=t.searchParams;e.delete(yt),e.delete(wt),e.delete(Ct),e.delete(bt),this.projectVersionKey&&e.delete(this.projectVersionKey),e.delete(Tt),e.delete(It),e.delete(Nt),this.projectVersion=void 0,this.projectVersionKey=void 0,delete window.snippylyInitialLoadUrl,window.history.replaceState({},document.title,t.href),window.location.reload()}catch(t){console.warn("Error in removeSnippyly: ",t),Dc("Error in removeSnippyly: ",t)}},this.signOutUser=async()=>{try{Vc(pt.Events.SIGNOUT_CLICKED),this.subscriptions.forEach((t=>{t&&t.unsubscribe&&(null==t||t.unsubscribe())})),this.contactListSubscription&&(this.contactListSubscription.unsubscribe(),this.contactListSubscription=null),await Velt.signOutUser(),uc(xt),uc(kt),uc(Ot),uc(Pt),this.snippylyUser=void 0,window.open(this.signOutUrl,"_self")}catch(t){console.warn("Error in signOutUser: ",t),Dc("Error in signOutUser: ",t)}},this.toggleMenu=(t,e)=>{try{t.stopPropagation(),this.menuOpenedId===e?this.menuOpenedId=void 0:this.menuOpenedId=e}catch(t){console.warn("Error in toggleMenu: ",t),Dc("Error in toggleMenu: ",t)}},this.copyLink=()=>{try{navigator.clipboard.writeText(window.location.href),this.copyLinkTooltip="Link copied!",setTimeout((()=>{this.copyLinkTooltip="Copy Link"}),2e3)}catch(t){console.warn("Error in copyLink: ",t),Dc("Error in copyLink: ",t)}},this.goToAdminPortal=()=>{try{let t=`${ne}`;Velt&&(null===Velt||void 0===Velt?void 0:Velt.getDocumentId)&&this.serverDocumentId&&(t=`${ne}/dashboard/project/comment/${this.apiKey}/${this.serverDocumentId}`),Vc(pt.Events.VIEW_PROJECT_CLICKED),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortal: ",t),Dc("Error in goToAdminPortal: ",t)}},this.goToAdminPortalDashboard=()=>{try{let t=`${ne}`;Velt&&(null===Velt||void 0===Velt?void 0:Velt.getDocumentId)&&this.serverDocumentId&&(t=`${ne}/dashboard`),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortalDashboard: ",t),Dc("Error in goToAdminPortalDashboard: ",t)}},this.joinCommunity=()=>{try{window.open("https://join.slack.com/t/superflowusers/shared_invite/zt-1q3jzsddt-NEb~uu9RXscLfxOIDGQXJw","_blank")}catch(t){console.warn("Error in joinCommunity: ",t),Dc("Error in joinCommunity: ",t)}},this.onboardingNextClick=()=>{try{this.showOnboardingModal=!1,dc(It,"true");const t=new URL(document.location);t.searchParams.delete(It),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onboardingNextClick: ",t),Dc("Error in onboardingNextClick: ",t)}},this.onLiveDemoModalNextClick=()=>{try{this.showLiveDemoModal=!1,dc(Nt,"true",!1,"sessionStorage");const t=new URL(document.location);t.searchParams.delete(Nt),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onLiveDemoModalNextClick: ",t),Dc("Error in onLiveDemoModalNextClick: ",t)}},this.onFigmaDemoModalNextClick=()=>{try{this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(At),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onFigmaDemoModalNextClick: ",t),Dc("Error in onFigmaDemoModalNextClick: ",t)}},this.onUpgradePlanClick=()=>{try{window.open("https://superflow-portal-v2-staging.firebaseapp.com/settings/billing","_blank")}catch(t){console.warn("Error in onUpgradePlanClick: ",t),Dc("Error in onUpgradePlanClick: ",t)}},this.onTourCommentTooltipClick=()=>{try{this.showTourCommentTooltip=!1,dc(Lt,"true")}catch(t){console.warn("Error in onTourCommentTooltipClick: ",t),Dc("Error in onTourCommentTooltipClick: ",t)}},this.onGuestModeChipSignInButtonClick=()=>{try{Vc(pt.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeChipSignInButtonClick: ",t),Dc("Error in onGuestModeChipSignInButtonClick: ",t)}},this.openGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!0,Vc(pt.Events.GUEST_MODE_SIGN_IN_DIALOG_SHOWN)}catch(t){console.warn("Error in openGuestModeSignInModal: ",t),Dc("Error in openGuestModeSignInModal: ",t)}},this.closeGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!1,this.guestModeSignInModalConfig=JSON.parse(JSON.stringify(this.defaultGuestModeSignInModalConfig))}catch(t){console.warn("Error in closeGuestModeSignInModal: ",t),Dc("Error in closeGuestModeSignInModal: ",t)}},this.onGuestModeSignInModalSignInButtonClick=()=>{try{Vc(pt.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeSignInModalSignInButtonClick: ",t),Dc("Error in onGuestModeSignInModalSignInButtonClick: ",t)}},this.openGuestModeNameModel=t=>{try{t&&(t.stopPropagation(),t.preventDefault()),this.skipGuestNameModal||(this.showGuestModeNameModal=!0,Vc(pt.Events.GUEST_MODE_NAME_NUDGE_SHOWN))}catch(t){console.warn("Error in openGuestModeNameModel: ",t),Dc("Error in openGuestModeNameModel: ",t)}},this.closeGuestModeNameModel=()=>{try{this.showGuestModeNameModal=!1}catch(t){console.warn("Error in closeGuestModeNameModel: ",t),Dc("Error in closeGuestModeNameModel: ",t)}},this.onGuestModeNameModalSkipButtonClick=()=>{try{Vc(pt.Events.GUEST_MODE_SKIP_BUTTON_CLICKED),this.showGuestModeNameModal=!1}catch(t){console.warn("Error in onGuestModeNameModalSkipButtonClick: ",t),Dc("Error in onGuestModeNameModalSkipButtonClick: ",t)}},this.onPasswordProtectedModalCloseButtonClick=()=>{try{Vc(pt.Events.PASSWORD_PROTECTED_MODAL_CLOSE_BUTTON_CLICKED),this.showPasswordProtectedModal=!1,this.password="",this.showInvalidPassword=!1}catch(t){console.warn("Error in onPasswordProtectedModalCloseButtonClick: ",t),Dc("Error in onPasswordProtectedModalCloseButtonClick: ",t)}},this.onPasswordProtectedModalOpenButtonClick=()=>{try{Vc(pt.Events.PASSWORD_PROTECTED_MODAL_OPEN_BUTTON_CLICKED),this.showPasswordProtectedModal=!0}catch(t){console.warn("Error in onPasswordProtectedModalOpenButtonClick: ",t),Dc("Error in onPasswordProtectedModalOpenButtonClick: ",t)}},this.showGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!0,Vc(pt.Events.GUEST_MODE_SIGN_IN_NUDGE_SHOWN)}catch(t){console.warn("Error in showGuestModeSignInBanner: ",t),Dc("Error in showGuestModeSignInBanner: ",t)}},this.hideGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!1}catch(t){console.warn("Error in hideGuestModeSignInBanner: ",t),Dc("Error in hideGuestModeSignInBanner: ",t)}},this.onGuestModeBannerSignInButtonClick=()=>{try{Vc(pt.Events.GUEST_MODE_SIGN_IN_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeBannerSignInButtonClick: ",t),Dc("Error in onGuestModeBannerSignInButtonClick: ",t)}},this.updateGuestUserName=async()=>{var t;try{if(!(null===(t=this.guestUserNameInput)||void 0===t?void 0:t.trim()))return;if(this.guestUserNameUpdateLoading)return;const e=yc(!0,this.apiKey);if(e){const t=JSON.parse(JSON.stringify(e));e.name=this.guestUserNameInput,e.photoUrl=null,this.guestUserNameUpdateLoading=!0,Cc(e),await Velt.identify(e),this.snippylyUser=JSON.parse(JSON.stringify(e)),await Gc(this.apiKey,this.projectId||"",t,e),this.showGuestModeNameModal=!1,this.guestUserNameUpdated=!0,this.guestUserNameUpdateLoading=!1,dc(zt,"true"),Vc(pt.Events.GUEST_MODE_NAME_ADDED,{oldName:null==t?void 0:t.name,newName:null==e?void 0:e.name})}this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateGuestUserName: ",t),Dc("Error in updateGuestUserName: ",t)}},this.submitPassword=async()=>{var t;try{if(Vc(pt.Events.REVIEW_PASSWORD_ADDED),!(null===(t=this.password)||void 0===t?void 0:t.trim()))return;if(this.validatingPasswordLoading)return;this.validatingPasswordLoading=!0,this.isPasswordValid=await Uc(this.apiKey,this.projectId,this.password),lc(jt,this.isPasswordValid),this.isPasswordValid?(this.password="",this.onPasswordProtectedModalCloseButtonClick(),this.showInvalidPassword=!1,Velt&&Velt.disableFeatures([]),Vc(pt.Events.REVIEW_PASSWORD_ACCEPTED)):(this.showInvalidPassword=!0,Vc(pt.Events.REVIEW_PASSWORD_REJECTED)),this.validatingPasswordLoading=!1}catch(t){console.warn("Error in submitPassword: ",t),Dc("Error in submitPassword: ",t)}},this.updateUserName=async()=>{var t;try{if(!(null===(t=this.guestUserNameInput)||void 0===t?void 0:t.trim()))return;if(this.guestUserNameUpdateLoading)return;this.guestUserNameUpdateLoading=!0;const e=JSON.parse(JSON.stringify(this.snippylyUser)),i=JSON.parse(JSON.stringify(this.snippylyUser));i.name=this.guestUserNameInput,await Gc(this.apiKey,this.projectId||"",e,i),await Velt.updateUser(i),this.snippylyUser=JSON.parse(JSON.stringify(i));const o=mc();o.name=i.name;const n=JSON.stringify(o),s=gc(n,se,re);dc(kt,s,!0),this.guestUserNameUpdateLoading=!1,this.guestUserNameInput="",this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateUserName: ",t),Dc("Error in updateUserName: ",t)}},this.isAgentAnnotation=t=>{try{return(null==t?void 0:t.commentType)===qt}catch(t){return console.warn("Error in isAgentAnnotation: ",t),!1}},this.filterAgentCommentsFromSidebar=t=>{try{if(!t||!this.commentElement)return;const e=t.commentAnnotations;if(!Array.isArray(e))return;const i=[];e.forEach((t=>{this.isAgentAnnotation(t)||i.push(t)}));const o=new Map;i.forEach((t=>{var e,i,n,s;const r=(null===(e=null==t?void 0:t.pageInfo)||void 0===e?void 0:e.path)||(null===(i=null==t?void 0:t.pageInfo)||void 0===i?void 0:i.url)||(null===(n=null==t?void 0:t.location)||void 0===n?void 0:n.path)||"/";o.has(r)||o.set(r,[]),null===(s=o.get(r))||void 0===s||s.push(t)}));const n=[];o.forEach(((t,e)=>{n.push({groupId:e,groupName:e,isExpanded:!0,annotations:t})})),this.commentElement.setCommentSidebarData(n,{grouping:!0})}catch(t){console.warn("Error in filterAgentCommentsFromSidebar: ",t),Dc("Error in filterAgentCommentsFromSidebar: ",t)}},this.filterAgentCommentsFromCurrentData=()=>{var t;try{if(!this.commentElement||!(null===(t=this.comments)||void 0===t?void 0:t.length))return;const e=this.comments.filter((t=>!this.isAgentAnnotation(t))),i=new Map;e.forEach((t=>{var e,o,n,s;const r=(null===(e=null==t?void 0:t.pageInfo)||void 0===e?void 0:e.path)||(null===(o=null==t?void 0:t.pageInfo)||void 0===o?void 0:o.url)||(null===(n=null==t?void 0:t.location)||void 0===n?void 0:n.path)||"/";i.has(r)||i.set(r,[]),null===(s=i.get(r))||void 0===s||s.push(t)}));const o=[];i.forEach(((t,e)=>{o.push({groupId:e,groupName:e,isExpanded:!0,annotations:t})})),this.commentElement.setCommentSidebarData(o,{grouping:!0})}catch(t){console.warn("Error in filterAgentCommentsFromCurrentData: ",t),Dc("Error in filterAgentCommentsFromCurrentData: ",t)}},this.setupSidebarAgentCommentFilter=()=>{try{return}catch(t){console.warn("Error in setupSidebarAgentCommentFilter: ",t),Dc("Error in setupSidebarAgentCommentFilter: ",t)}},this.getContentWarningsDisplayCount=()=>{try{return this.contentWarningsCount>99?"99+":`${this.contentWarningsCount}`}catch(t){return console.warn("Error in getContentWarningsDisplayCount: ",t),"0"}},this.onContentWarningsButtonClick=()=>{try{this.showContentWarningSidebar=!this.showContentWarningSidebar}catch(t){console.warn("Error in onContentWarningsButtonClick: ",t),Dc("Error in onContentWarningsButtonClick: ",t)}},this.onContentWarningSidebarClose=()=>{try{this.showContentWarningSidebar=!1}catch(t){console.warn("Error in onContentWarningSidebarClose: ",t)}},this.handleContentWarningSidebarClickOutside=t=>{var e;try{const i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("content-warning-sidebar");if(!i)return;const o=t.composedPath(),n=o.some((t=>t===i)),s=o.some((t=>{var e;return t instanceof HTMLElement&&((null===(e=t.classList)||void 0===e?void 0:e.contains("content-warnings-button"))||null!==t.closest(".content-warnings-button"))}));n||s||(this.showContentWarningSidebar=!1)}catch(t){console.warn("Error in handleContentWarningSidebarClickOutside: ",t)}},this.addContentWarningSidebarClickListener=()=>{try{this.contentWarningSidebarClickHandler||(this.contentWarningSidebarClickHandler=this.handleContentWarningSidebarClickOutside.bind(this),document.addEventListener("click",this.contentWarningSidebarClickHandler,!0))}catch(t){console.warn("Error in addContentWarningSidebarClickListener: ",t)}},this.removeContentWarningSidebarClickListener=()=>{try{void 0!==this.contentWarningSidebarListenerTimeoutId&&(window.clearTimeout(this.contentWarningSidebarListenerTimeoutId),this.contentWarningSidebarListenerTimeoutId=void 0),this.contentWarningSidebarClickHandler&&(document.removeEventListener("click",this.contentWarningSidebarClickHandler,!0),this.contentWarningSidebarClickHandler=void 0)}catch(t){console.warn("Error in removeContentWarningSidebarClickListener: ",t)}},this.onQAExecutionComplete=t=>{try{const{executionId:e,status:i}=(null==t?void 0:t.detail)||{};Vc("QA Execution Complete",{executionId:e,status:i,documentId:this.documentId})}catch(t){console.warn("Error in onQAExecutionComplete: ",t)}},this.onContentWarningSidebarAddAll=()=>{},this.onContentWarningItemClick=t=>{var e,i,o;try{const n=null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.annotation;if(!(null==n?void 0:n.annotationId)&&!(null==n?void 0:n.id))return;const s=(null==n?void 0:n.annotationId)||(null==n?void 0:n.id),r=null===(i=null==n?void 0:n.pageInfo)||void 0===i?void 0:i.url;if(r&&!this.isCurrentPageUrl(r)){const t=new URL(r);return t.searchParams.set(Ct,s),void(window.location.href=t.toString())}(null===(o=this.commentElement)||void 0===o?void 0:o.selectCommentByAnnotationId)&&this.commentElement.selectCommentByAnnotationId(s),setTimeout((()=>{var t;(null===(t=this.commentElement)||void 0===t?void 0:t.scrollToCommentByAnnotationId)&&this.commentElement.scrollToCommentByAnnotationId(s)}),150)}catch(t){console.warn("Error in onContentWarningItemClick: ",t),Dc("Error in onContentWarningItemClick: ",t)}},this.isCurrentPageUrl=t=>{try{const e=new URL(t).pathname;return e===window.location.pathname}catch{return!1}},this.setupVeltButtonClickListener=()=>{try{if(!(null===Velt||void 0===Velt?void 0:Velt.on))return void console.warn("[CWS Toolbar] Velt.on not available for button click listener");Velt.on("veltButtonClick").subscribe((t=>{var e;try{if(!t)return;const i=null===(e=null==t?void 0:t.buttonContext)||void 0===e?void 0:e.clickedButtonId,o=null==t?void 0:t.commentAnnotation;"prev-suggestion"===i?this.navigateSuggestion(o,"prev"):"next-suggestion"===i?this.navigateSuggestion(o,"next"):"accept-suggestion"===i?this.handleAcceptSuggestion(o):"reject-suggestion"===i&&this.handleDeclineSuggestion(o)}catch(t){console.warn("Error in veltButtonClick handler: ",t)}})),this.commentElement.onCommentSelectionChange().subscribe((t=>{this.handleCommentSelection(t)}))}catch(t){console.warn("Error in setupVeltButtonClickListener: ",t),Dc("Error in setupVeltButtonClickListener: ",t)}},this.navigateSuggestion=(t,e)=>{var i,o,n,s,r;try{if(!t)return void console.warn("[CWS Toolbar] No annotation provided for navigation");const a=null===(o=null===(i=null==t?void 0:t.agent)||void 0===i?void 0:i.result)||void 0===o?void 0:o.incorrectWord;if(!a)return void console.warn("[CWS Toolbar] No incorrectWord found on annotation");const l=this.findMatchingWarning(a);if(!l)return void console.warn("[CWS Toolbar] No matching warning found for word:",a);const c=null===(n=null==t?void 0:t.pageInfo)||void 0===n?void 0:n.path,d=this.normalizePagePath(c),h=null===(s=null==l?void 0:l.annotations)||void 0===s?void 0:s.filter((t=>{var e;const i=null===(e=null==t?void 0:t.pageInfo)||void 0===e?void 0:e.path;return this.normalizePagePath(i)===d}));if(!(null==h?void 0:h.length)||h.length<=1)return;const u=(null==t?void 0:t.annotationId)||(null==t?void 0:t.id),p=h.findIndex((t=>((null==t?void 0:t.annotationId)||(null==t?void 0:t.id))===u));if(-1===p)return void console.warn("[CWS Toolbar] Current annotation not found in warning group");let v;v="next"===e?(p+1)%h.length:(p-1+h.length)%h.length;const g=h[v],f=(null==g?void 0:g.annotationId)||(null==g?void 0:g.id);f&&((null===(r=this.commentElement)||void 0===r?void 0:r.selectCommentByAnnotationId)&&this.commentElement.selectCommentByAnnotationId(f),setTimeout((()=>{var t;(null===(t=this.commentElement)||void 0===t?void 0:t.scrollToCommentByAnnotationId)&&this.commentElement.scrollToCommentByAnnotationId(f)}),150))}catch(t){console.warn("Error in navigateSuggestion: ",t),Dc("Error in navigateSuggestion: ",t)}},this.findMatchingWarning=t=>{var e,i;try{const o=null===(e=this.spellingWarnings)||void 0===e?void 0:e.find((e=>(null==e?void 0:e.incorrectWord)===t));if(o)return o;const n=null===(i=this.grammarWarnings)||void 0===i?void 0:i.find((e=>(null==e?void 0:e.incorrectWord)===t));return n||null}catch(t){return console.warn("Error in findMatchingWarning: ",t),null}},this.removeAnnotationFromWarnings=t=>{try{if(!t)return;const e=(e,i)=>{var o,n;for(const s of e){const e=null===(o=null==s?void 0:s.annotations)||void 0===o?void 0:o.find((e=>((null==e?void 0:e.annotationId)||(null==e?void 0:e.id))===t));if(e){const t=(null==s?void 0:s.incorrectWord)||"",o=null===(n=null==e?void 0:e.pageInfo)||void 0===n?void 0:n.path,r=this.normalizePagePath(o);if(t&&r&&i.has(t)){const e=i.get(t),o=e.get(r)||0;o>1?e.set(r,o-1):(e.delete(r),0===e.size&&i.delete(t))}return}}};e(this.spellingWarnings,this.spellingSuggestionPagePathMap),e(this.grammarWarnings,this.grammarSuggestionPagePathMap);const i=e=>{var i,o;return null!==(o=null===(i=null==e?void 0:e.map((e=>{var i;const o=null===(i=null==e?void 0:e.annotations)||void 0===i?void 0:i.filter((e=>((null==e?void 0:e.annotationId)||(null==e?void 0:e.id))!==t));return o&&0!==o.length?{...e,annotations:o,occurrences:o.length}:null})))||void 0===i?void 0:i.filter((t=>null!==t)))&&void 0!==o?o:[]};this.spellingWarnings=i(this.spellingWarnings),this.grammarWarnings=i(this.grammarWarnings),this.brokenLinkWarnings=i(this.brokenLinkWarnings);const o=this.spellingWarnings.length+this.grammarWarnings.length+this.brokenLinkWarnings.length;this.contentWarningsCount=o,this.hasContentWarnings=o>0}catch(t){console.warn("Error in removeAnnotationFromWarnings: ",t)}},this.handleAcceptSuggestion=async t=>{var e,i,o;try{const n=(null==t?void 0:t.annotationId)||(null==t?void 0:t.id);if(!n)return void console.warn("[CWS Toolbar] handleAcceptSuggestion: No annotationId found",t);const s=(null===(e=this.snippylyUser)||void 0===e?void 0:e.userId)||(null===(i=this.snippylyUser)||void 0===i?void 0:i.uid),r=(null===(o=this.snippylyUser)||void 0===o?void 0:o.email)||"";if(!s)return void console.warn("[CWS Toolbar] handleAcceptSuggestion: No user available");if(!this.documentId)return void console.warn("[CWS Toolbar] handleAcceptSuggestion: No documentId available");await td(this.apiKey,this.apiKey,this.documentId+"",n,{userId:s,email:r}),this.removeAnnotationFromWarnings(n)}catch(t){console.warn("Error in handleAcceptSuggestion: ",t),Dc("Error in handleAcceptSuggestion: ",t)}},this.handleDeclineSuggestion=async t=>{try{const e=(null==t?void 0:t.annotationId)||(null==t?void 0:t.id);if(!e)return void console.warn("[CWS Toolbar] handleDeclineSuggestion: No annotationId found",t);if(!this.documentId)return void console.warn("[CWS Toolbar] handleDeclineSuggestion: No documentId available");await ed(this.apiKey,this.apiKey,this.documentId+"",e),this.removeAnnotationFromWarnings(e)}catch(t){console.warn("Error in handleDeclineSuggestion: ",t),Dc("Error in handleDeclineSuggestion: ",t)}},this.disableCommentMode=()=>{var t;try{(null===(t=this.commentElement)||void 0===t?void 0:t.disableCommentMode)&&this.commentElement.disableCommentMode()}catch(t){console.warn("Error in disableAddCommentMode: ",t),Dc("Error in disableAddCommentMode: ",t)}},this.disableCommentModeButton=()=>{try{return this.addCommentMode?O`
4550
4550
  <div class="disable-add-comment-button" @click=${()=>this.disableCommentMode()}>
4551
4551
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
4552
4552
  <path fill-rule="evenodd" clip-rule="evenodd" d="M3.52861 3.52858C3.78896 3.26823 4.21107 3.26823 4.47141 3.52858L8.00001 7.05717L11.5286 3.52858C11.789 3.26823 12.2111 3.26823 12.4714 3.52858C12.7318 3.78892 12.7318 4.21103 12.4714 4.47138L8.94282 7.99998L12.4714 11.5286C12.7318 11.7889 12.7318 12.211 12.4714 12.4714C12.2111 12.7317 11.789 12.7317 11.5286 12.4714L8.00001 8.94279L4.47141 12.4714C4.21107 12.7317 3.78896 12.7317 3.52861 12.4714C3.26826 12.211 3.26826 11.7889 3.52861 11.5286L7.0572 7.99998L3.52861 4.47138C3.26826 4.21103 3.26826 3.78892 3.52861 3.52858Z" fill="#FAFBFF"/>