@usesuperflow/toolbar-staging 1.0.286 → 1.0.288
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/package.json +1 -1
- package/superflow.js +3 -3
- package/superflow.min.js +3 -3
package/package.json
CHANGED
package/superflow.js
CHANGED
|
@@ -2465,7 +2465,7 @@ class ws extends uo{}ws.Encryptor=class extends ws{processBlock(t,e){const i=t,o
|
|
|
2465
2465
|
* Copyright 2017 Google LLC
|
|
2466
2466
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2467
2467
|
*/
|
|
2468
|
-
class Xs extends at{constructor(t){if(super(t),this.it=F,t.type!==st)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===F||null==t)return this.ft=void 0,this.it=t;if(t===D)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:[]}}}Xs.directiveName="unsafeHTML",Xs.resultType=1;const tr=rt(Xs);var er=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 ir 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=true,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.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.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),Bs("Error in onApiKeyChange: ",t)}},this.checkCustomLoginEnabled=async()=>{var t;try{const e=await(t=>{const e={apiKey:t};return Ke(Us,Et,{timeout:12e5})(e)})(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),Bs("Error in checkCustomLoginEnabled: ",t)}},this.loginWithCustomUser=()=>{try{this.customLoginEnabled?(Ls("_sfut"),this.loadPlugin&&this.documentId&&this.identifySnippyly()):console.warn("Identify call not allowed.")}catch(t){console.warn("Error in loginWithCustomUser: ",t),Bs("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),Bs("Error in addWindowClickEventListener: ",t)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t),Bs("Error in removeWindowClickEventListener: ",t)}},this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(t){console.warn("Error in setWindowEventListner: ",t),Bs("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),Bs("Error in urlChangeListener: ",t)}},this.checkUrl=()=>{try{this.setInviteUrl();const t=new URL(document.location),e=t.searchParams;if((null==e?void 0:e.has("sprojectInstall"))&&!Is("sprojectInstall")?this.showOnboardingModal=!0:this.showOnboardingModal=!1,null==e?void 0:e.has("sflivedemo"))if(Is("sflivedemo",!1,"sessionStorage")){this.showLiveDemoModal=!1;const t=new URL(document.location);t.searchParams.delete("sflivedemo"),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("sffigmademo"))if(Is("sffigmademo",!1)){this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete("sffigmademo"),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("st")||e.has("snippyly_google_token")){if(e.has("st")){const t=decodeURIComponent(e.get("st")),i=Ds(t,mt,gt),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=Os(e,mt,gt);Ts("_sfut",i,!0),Ls("sfUserAdmin")}}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,Ts("snippyly-user",JSON.stringify(i),!0)}e.delete("st"),e.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}e.has("review")?(Ts("review","true",!1),Ls("feedback"),e.delete("review"),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has("feedback")||Is("review",!1)&&this.loadPluginUI(),e.has("feedback")?(Ts("feedback","true",!1),Ls("review"),e.delete("feedback"),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has("review")||Is("feedback",!1)&&this.loadPluginUI(),this.setVersionInUrl()}catch(t){console.warn("Error in checkUrl: ",t),Bs("Error in checkUrl: ",t)}},this.setInviteUrl=()=>{try{const t=new URL(document.location);t.searchParams.has("review")||t.searchParams.set("review","true"),this.inviteUrl=t.toString()}catch(t){console.warn("Error in setInviteUrl: ",t),Bs("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&&Ts("projectVersion",this.projectVersion,!1,"sessionStorage")}else{const t=new URL(document.location).searchParams;(t.has("review")||t.has("feedback"))&&t.has("sversion")&&(Ts("projectVersionKey","sversion",!1,"sessionStorage"),this.projectVersion=t.get("sversion"),this.projectVersion&&Ts("projectVersion",this.projectVersion,!1,"sessionStorage"))}}catch(t){console.warn("Error in detectVersion: ",t),Bs("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||Is("projectVersionKey",!1,"sessionStorage"),e=this.projectVersion||Is("projectVersion",!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),Bs("Error in setVersionInUrl: ",t)}},this.loadPluginUI=async()=>{var t,e,i,o,n,s,r;try{if(!this.apiKey)return;if(!this.projectId)return;if(this.loadPlugin)return this.generateLocation(),void this.setLocation();if(this.toolbarEnabledApiCalled||await this.detectToolbarEnabled(),!this.toolbarEnabled)return;const a=Fs();if(a&&!(null==a?void 0:a.isAnonymous)&&(this.loading=!0),null===(t=this.getCustomerMetadata())||void 0===t||t.then((t=>{this.customerMetadata=t})).catch((t=>{console.warn("Error in getCustomerMetadata: ",t),Bs("Error in getCustomerMetadata: ",t)})),Ns("sfPasswordIsValid")&&(this.isPasswordValid=Ns("sfPasswordIsValid")),Is("sfGuestMode",!0)&&Is("sfGuestModeAllowSignIn",!0)&&Is("sfPasswordProtected",!0)?(this.guestMode="true"===Is("sfGuestMode",!0),this.allowGuestModeSignIn="true"===Is("sfGuestModeAllowSignIn",!0),this.passwordProtected="true"===Is("sfPasswordProtected",!0)):(this.projectConfig=await(async(t,e)=>{var i;try{const o=Ke(Us,St,{timeout:12e5}),n=await o({apiKey:t,projectId:e});return null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.data}catch(t){return console.warn("Error in getProjectConfig: ",t),null}})(this.apiKey,this.projectId),this.guestMode=!!(null===(e=this.projectConfig)||void 0===e?void 0:e.guestMode)||this.guestMode,this.allowGuestModeSignIn=!!(null===(o=null===(i=this.projectConfig)||void 0===i?void 0:i.guestModeConfig)||void 0===o?void 0:o.allowSignIn),(null===(n=this.projectConfig)||void 0===n?void 0:n.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(r=null===(s=this.projectConfig)||void 0===s?void 0:s.passwordProtected)||void 0===r?void 0:r.enabled),Ts("sfGuestMode",this.guestMode+"",!0),Ts("sfGuestModeAllowSignIn",this.allowGuestModeSignIn+"",!0),Ts("sfPasswordProtected",this.passwordProtected+"",!0)),this.loadPlugin=!0,!document.querySelector(dt.VELT_COMMENTS)){const t=document.createElement(dt.VELT_COMMENTS);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&&!Is("sfGuestUserModelOpened")&&(this.allowGuestModeSignIn?this.openGuestModeSignInModal():this.openGuestModeNameModel(),Ts("sfGuestUserModelOpened","true")),this.addCommentCount>=5&&!Is("sfGuestUserBannerOpened",!1,"sessionStorage")&&(this.showGuestModeSignInBanner(),Ts("sfGuestUserBannerOpened","true",!1,"sessionStorage")))})),window.document.body.appendChild(t)}if(!document.querySelector(dt.VELT_CURSOR)){const t=document.createElement(dt.VELT_CURSOR);window.document.body.appendChild(t)}if(!document.querySelector(dt.VELT_HUDDLE)){const t=document.createElement(dt.VELT_HUDDLE);window.document.body.appendChild(t)}if(!document.querySelector(dt.VELT_RECORDER_NOTES)){const t=document.createElement(dt.VELT_RECORDER_NOTES);window.document.body.appendChild(t)}if(!document.querySelector(dt.VELT_RECORDER_CONTROL_PANEL)){const t=document.createElement(dt.VELT_RECORDER_CONTROL_PANEL);window.document.body.appendChild(t)}if(!document.querySelector(dt.VELT_ARROWS)){const t=document.createElement(dt.VELT_ARROWS);window.document.body.appendChild(t)}this.initializeSnippyly()}catch(t){this.loading=!1,console.warn("Error in loadPluginUI: ",t),Bs("Error in loadPluginUI: ",t)}},this.initializeSnippyly=async()=>{var t,i,o,n,s,r,a,l,d,c,h,u,p,v,m,g,f,w,y,C;try{if(await e(this.apiKey,{options:{develop:this.staging,version:this.staging?"1.0.373":"latest",velt:!0}}),!window.Snippyly)return;if(this.autoTranslation&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.enableAutoTranslation)&&(null===Snippyly||void 0===Snippyly||Snippyly.enableAutoTranslation()),!document.querySelector(dt.VELT_COMMENTS_SIDEBAR)){const t=document.createElement(dt.VELT_COMMENTS_SIDEBAR);t.setAttribute(ct.ENABLE_URL_NAVIGATION,"true"),t.setAttribute(ct.CURRENT_LOCATION_SUFFIX,"true"),window.document.body.appendChild(t)}if(Snippyly){null===Snippyly||void 0===Snippyly||Snippyly.sf(!0);try{(null===window||void 0===window?void 0:window.onSnippylyLoad)&&(null===window||void 0===window||window.onSnippylyLoad(Snippyly))}catch(t){}document.body.style.setProperty("--velt-default-font-family","'Poppins', sans-serif"),(()=>{try{if(!document.getElementById("superflowFontLink1")){const t=document.createElement("link");t.rel="preconnect",t.href="https://fonts.googleapis.com",t.id="superflowFontLink1",document.head.appendChild(t)}if(!document.getElementById("superflowFontLink2")){const t=document.createElement("link");t.rel="preconnect",t.href="https://fonts.gstatic.com",t.crossOrigin="anonymous",t.id="superflowFontLink2",document.head.appendChild(t)}if(!document.getElementById("superflowFontLink3")){const t=document.createElement("link");t.rel="stylesheet",t.href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap",t.id="superflowFontLink3",document.head.appendChild(t)}}catch(t){console.warn("Error in loadPoppinsFont: ",t),Bs("Error in loadPoppinsFont: ",t)}})()}Snippyly&&zs({sdkVersion:null===Snippyly||void 0===Snippyly?void 0:Snippyly.version,sdkType:"client"}),this.documentId=Ms(_s(window.location.origin))+"",this.projectId&&(this.documentId=this.projectId+""),await(null===Snippyly||void 0===Snippyly?void 0:Snippyly.setDocumentId(this.documentId+""));const b=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId();if(zs({documentId:b,clientDocumentId:this.documentId}),this.generateLocation(),this.setLocation(),this.commentElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCommentElement(),this.contactElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getContactElement(),this.rewriterElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getRewriterElement(),this.presenceElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getPresenceElement(),this.commentElement){this.commentElement.enableTextComments(!0),this.customLoginEnabledLocally||this.commentElement.enableSignInButton(!0),this.commentElement.enableAttachments(!0),(null===(t=this.commentElement)||void 0===t?void 0:t.showScreenSizeInfo)&&this.commentElement.showScreenSizeInfo(!0),(null===(i=this.commentElement)||void 0===i?void 0:i.enableDeviceInfo)&&this.commentElement.enableDeviceInfo(!0),this.commentElement.enableCommentIndex(!0),this.commentElement.onCommentModeChange&&this.commentElement.onCommentModeChange().subscribe((t=>{this.addCommentMode=t})),(null===(o=this.commentElement)||void 0===o?void 0:o.enableOrphanComments)&&this.commentElement.enableOrphanComments(),(null===(n=this.commentElement)||void 0===n?void 0:n.enableAutoCategorize)&&this.commentElement.enableAutoCategorize(),(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 e=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;e&&"object"==typeof e&&(null===(a=this.commentElement)||void 0===a?void 0:a.setCustomStatus)&&this.commentElement.setCustomStatus(e),(null===(l=this.commentElement)||void 0===l?void 0:l.enableMinimap)&&this.commentElement.enableMinimap(),(null===(d=this.commentElement)||void 0===d?void 0:d.setDStrategy)&&(null===(c=this.commentElement)||void 0===c||c.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()}this.selectionElement=Snippyly.getSelectionElement(),this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.rewriterElement&&(null===(v=this.rewriterElement)||void 0===v||v.enableRewriter()),this.presenceElement&&(null===(m=this.presenceElement)||void 0===m?void 0:m.enableFlockMode)&&(null===(g=this.presenceElement)||void 0===g||g.enableFlockMode(!0)),null===(f=null===Snippyly||void 0===Snippyly?void 0:Snippyly.docService)||void 0===f||f.getDocumentMetadata$().subscribe((t=>{const e=(null==t?void 0:t.versions)?Object.values(null==t?void 0:t.versions):[],i=new URL(document.location).searchParams.get("version");if(i){const t=e.find((t=>t.versionId===i));t&&(this.version={id:t.versionId,name:t.versionName||t.versionId},this.setLocation())}})),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getViewsElement)&&(this.viewsElement=Snippyly.getViewsElement()),(null===(w=this.viewsElement)||void 0===w?void 0:w.getUniqueViewsByUser)&&(null===(C=null===(y=this.viewsElement)||void 0===y?void 0:y.getUniqueViewsByUser())||void 0===C||C.subscribe((t=>{this.totalViews=t}))),this.identifySnippyly()}catch(t){this.loading=!1,console.warn("Error in initializeSnippyly: ",t),Bs("Error in initializeSnippyly: ",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),Bs("Error in checkToEnableUpgradeButton: ",t)}},this.getCustomerMetadata=async()=>{try{let t=(()=>{try{const t=Is("sfCustomerMetadata");return t?"false"===t?JSON.parse(JSON.stringify(ht)):JSON.parse(t):null}catch(t){return console.warn("Error in getCustomerMetadataFromStorage: ",t),Bs("Error in getCustomerMetadataFromStorage: ",t),null}})();return t||(t=await(async t=>{try{const e=Ke(Us,Ct,{timeout:12e5}),i=await e({apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getCustomerMetadata: ",t),null}})(this.apiKey),Vs(t)),t}catch(t){console.warn("Error in getCustomerMetadata: ",t),Bs("Error in getCustomerMetadata: ",t)}},this.setLogos=()=>{var t,e,i,o,n,s,r,a,l,d,c,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.customBranding)||void 0===e?void 0:e.logo)||void 0===i?void 0:i.logoMark,v=null===(s=null===(n=null===(o=null==pt?void 0:ht)||void 0===o?void 0:o.customBranding)||void 0===n?void 0:n.logo)||void 0===s?void 0:s.logoMark,m=null===(l=null===(a=null===(r=this.customerMetadata)||void 0===r?void 0:r.customBranding)||void 0===a?void 0:a.logo)||void 0===l?void 0:l.wordMark,g=null===(h=null===(c=null===(d=null==pt?void 0:ht)||void 0===d?void 0:d.customBranding)||void 0===c?void 0:c.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==m?void 0:m.lightUrl)||(null==m?void 0:m.darkUrl)||(null==g?void 0:g.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==m?void 0:m.darkUrl)||(null==m?void 0:m.lightUrl)||(null==g?void 0:g.darkUrl)}}catch(t){console.warn("Error in setLogos: ",t),Bs("Error in setLogos: ",t)}},this.getLogoMark=()=>{var t;try{return(null===(t=this.logoMark)||void 0===t?void 0:t.includes("<svg"))?O`
|
|
2468
|
+
class Xs extends at{constructor(t){if(super(t),this.it=F,t.type!==st)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===F||null==t)return this.ft=void 0,this.it=t;if(t===D)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:[]}}}Xs.directiveName="unsafeHTML",Xs.resultType=1;const tr=rt(Xs);var er=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 ir 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=true,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.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.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),Bs("Error in onApiKeyChange: ",t)}},this.checkCustomLoginEnabled=async()=>{var t;try{const e=await(t=>{const e={apiKey:t};return Ke(Us,Et,{timeout:12e5})(e)})(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),Bs("Error in checkCustomLoginEnabled: ",t)}},this.loginWithCustomUser=()=>{try{this.customLoginEnabled?(Ls("_sfut"),this.loadPlugin&&this.documentId&&this.identifySnippyly()):console.warn("Identify call not allowed.")}catch(t){console.warn("Error in loginWithCustomUser: ",t),Bs("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),Bs("Error in addWindowClickEventListener: ",t)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t),Bs("Error in removeWindowClickEventListener: ",t)}},this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(t){console.warn("Error in setWindowEventListner: ",t),Bs("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),Bs("Error in urlChangeListener: ",t)}},this.checkUrl=()=>{try{this.setInviteUrl();const t=new URL(document.location),e=t.searchParams;if((null==e?void 0:e.has("sprojectInstall"))&&!Is("sprojectInstall")?this.showOnboardingModal=!0:this.showOnboardingModal=!1,null==e?void 0:e.has("sflivedemo"))if(Is("sflivedemo",!1,"sessionStorage")){this.showLiveDemoModal=!1;const t=new URL(document.location);t.searchParams.delete("sflivedemo"),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("sffigmademo"))if(Is("sffigmademo",!1)){this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete("sffigmademo"),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("st")||e.has("snippyly_google_token")){if(e.has("st")){const t=decodeURIComponent(e.get("st")),i=Ds(t,mt,gt),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=Os(e,mt,gt);Ts("_sfut",i,!0),Ls("sfUserAdmin")}}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,Ts("snippyly-user",JSON.stringify(i),!0)}e.delete("st"),e.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}e.has("review")?(Ts("review","true",!1),Ls("feedback"),e.delete("review"),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has("feedback")||Is("review",!1)&&this.loadPluginUI(),e.has("feedback")?(Ts("feedback","true",!1),Ls("review"),e.delete("feedback"),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has("review")||Is("feedback",!1)&&this.loadPluginUI(),this.setVersionInUrl()}catch(t){console.warn("Error in checkUrl: ",t),Bs("Error in checkUrl: ",t)}},this.setInviteUrl=()=>{try{const t=new URL(document.location);t.searchParams.has("review")||t.searchParams.set("review","true"),this.inviteUrl=t.toString()}catch(t){console.warn("Error in setInviteUrl: ",t),Bs("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&&Ts("projectVersion",this.projectVersion,!1,"sessionStorage")}else{const t=new URL(document.location).searchParams;(t.has("review")||t.has("feedback"))&&t.has("sversion")&&(Ts("projectVersionKey","sversion",!1,"sessionStorage"),this.projectVersion=t.get("sversion"),this.projectVersion&&Ts("projectVersion",this.projectVersion,!1,"sessionStorage"))}}catch(t){console.warn("Error in detectVersion: ",t),Bs("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||Is("projectVersionKey",!1,"sessionStorage"),e=this.projectVersion||Is("projectVersion",!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),Bs("Error in setVersionInUrl: ",t)}},this.loadPluginUI=async()=>{var t,e,i,o,n,s,r;try{if(!this.apiKey)return;if(!this.projectId)return;if(this.loadPlugin)return this.generateLocation(),void this.setLocation();if(this.toolbarEnabledApiCalled||await this.detectToolbarEnabled(),!this.toolbarEnabled)return;const a=Fs();if(a&&!(null==a?void 0:a.isAnonymous)&&(this.loading=!0),null===(t=this.getCustomerMetadata())||void 0===t||t.then((t=>{this.customerMetadata=t})).catch((t=>{console.warn("Error in getCustomerMetadata: ",t),Bs("Error in getCustomerMetadata: ",t)})),Ns("sfPasswordIsValid")&&(this.isPasswordValid=Ns("sfPasswordIsValid")),Is("sfGuestMode",!0)&&Is("sfGuestModeAllowSignIn",!0)&&Is("sfPasswordProtected",!0)?(this.guestMode="true"===Is("sfGuestMode",!0),this.allowGuestModeSignIn="true"===Is("sfGuestModeAllowSignIn",!0),this.passwordProtected="true"===Is("sfPasswordProtected",!0)):(this.projectConfig=await(async(t,e)=>{var i;try{const o=Ke(Us,St,{timeout:12e5}),n=await o({apiKey:t,projectId:e});return null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.data}catch(t){return console.warn("Error in getProjectConfig: ",t),null}})(this.apiKey,this.projectId),this.guestMode=!!(null===(e=this.projectConfig)||void 0===e?void 0:e.guestMode)||this.guestMode,this.allowGuestModeSignIn=!!(null===(o=null===(i=this.projectConfig)||void 0===i?void 0:i.guestModeConfig)||void 0===o?void 0:o.allowSignIn),(null===(n=this.projectConfig)||void 0===n?void 0:n.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(r=null===(s=this.projectConfig)||void 0===s?void 0:s.passwordProtected)||void 0===r?void 0:r.enabled),Ts("sfGuestMode",this.guestMode+"",!0),Ts("sfGuestModeAllowSignIn",this.allowGuestModeSignIn+"",!0),Ts("sfPasswordProtected",this.passwordProtected+"",!0)),this.loadPlugin=!0,!document.querySelector(dt.VELT_COMMENTS)){const t=document.createElement(dt.VELT_COMMENTS);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(dt.VELT_CURSOR)){const t=document.createElement(dt.VELT_CURSOR);window.document.body.appendChild(t)}if(!document.querySelector(dt.VELT_HUDDLE)){const t=document.createElement(dt.VELT_HUDDLE);window.document.body.appendChild(t)}if(!document.querySelector(dt.VELT_RECORDER_NOTES)){const t=document.createElement(dt.VELT_RECORDER_NOTES);window.document.body.appendChild(t)}if(!document.querySelector(dt.VELT_RECORDER_CONTROL_PANEL)){const t=document.createElement(dt.VELT_RECORDER_CONTROL_PANEL);window.document.body.appendChild(t)}if(!document.querySelector(dt.VELT_ARROWS)){const t=document.createElement(dt.VELT_ARROWS);window.document.body.appendChild(t)}this.initializeSnippyly()}catch(t){this.loading=!1,console.warn("Error in loadPluginUI: ",t),Bs("Error in loadPluginUI: ",t)}},this.initializeSnippyly=async()=>{var t,i,o,n,s,r,a,l,d,c,h,u,p,v,m,g,f,w,y,C;try{if(await e(this.apiKey,{options:{develop:this.staging,version:this.staging?"1.0.373":"latest",velt:!0}}),!window.Snippyly)return;if(this.autoTranslation&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.enableAutoTranslation)&&(null===Snippyly||void 0===Snippyly||Snippyly.enableAutoTranslation()),!document.querySelector(dt.VELT_COMMENTS_SIDEBAR)){const t=document.createElement(dt.VELT_COMMENTS_SIDEBAR);t.setAttribute(ct.ENABLE_URL_NAVIGATION,"true"),t.setAttribute(ct.CURRENT_LOCATION_SUFFIX,"true"),window.document.body.appendChild(t)}if(Snippyly){null===Snippyly||void 0===Snippyly||Snippyly.sf(!0);try{(null===window||void 0===window?void 0:window.onSnippylyLoad)&&(null===window||void 0===window||window.onSnippylyLoad(Snippyly))}catch(t){}document.body.style.setProperty("--velt-default-font-family","'Poppins', sans-serif"),(()=>{try{if(!document.getElementById("superflowFontLink1")){const t=document.createElement("link");t.rel="preconnect",t.href="https://fonts.googleapis.com",t.id="superflowFontLink1",document.head.appendChild(t)}if(!document.getElementById("superflowFontLink2")){const t=document.createElement("link");t.rel="preconnect",t.href="https://fonts.gstatic.com",t.crossOrigin="anonymous",t.id="superflowFontLink2",document.head.appendChild(t)}if(!document.getElementById("superflowFontLink3")){const t=document.createElement("link");t.rel="stylesheet",t.href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap",t.id="superflowFontLink3",document.head.appendChild(t)}}catch(t){console.warn("Error in loadPoppinsFont: ",t),Bs("Error in loadPoppinsFont: ",t)}})()}Snippyly&&zs({sdkVersion:null===Snippyly||void 0===Snippyly?void 0:Snippyly.version,sdkType:"client"}),this.documentId=Ms(_s(window.location.origin))+"",this.projectId&&(this.documentId=this.projectId+""),await(null===Snippyly||void 0===Snippyly?void 0:Snippyly.setDocumentId(this.documentId+""));const b=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId();if(zs({documentId:b,clientDocumentId:this.documentId}),this.generateLocation(),this.setLocation(),this.commentElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCommentElement(),this.contactElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getContactElement(),this.rewriterElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getRewriterElement(),this.presenceElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getPresenceElement(),this.commentElement){this.commentElement.enableTextComments(!0),this.customLoginEnabledLocally||this.commentElement.enableSignInButton(!0),this.commentElement.enableAttachments(!0),(null===(t=this.commentElement)||void 0===t?void 0:t.showScreenSizeInfo)&&this.commentElement.showScreenSizeInfo(!0),(null===(i=this.commentElement)||void 0===i?void 0:i.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&&!Is("sfGuestUserModelOpened")&&(this.allowGuestModeSignIn?this.openGuestModeSignInModal():this.openGuestModeNameModel(),Ts("sfGuestUserModelOpened","true"),this.showModalOnceCommentIsModeIsOff=!1),this.addCommentCount>=5&&!this.showGuestModeSignInModal&&!Is("sfGuestUserBannerOpened",!1,"sessionStorage")&&(this.showGuestModeSignInBanner(),Ts("sfGuestUserBannerOpened","true",!1,"sessionStorage"),this.showModalOnceCommentIsModeIsOff=!1))})),(null===(o=this.commentElement)||void 0===o?void 0:o.enableOrphanComments)&&this.commentElement.enableOrphanComments(),(null===(n=this.commentElement)||void 0===n?void 0:n.enableAutoCategorize)&&this.commentElement.enableAutoCategorize(),(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 e=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;e&&"object"==typeof e&&(null===(a=this.commentElement)||void 0===a?void 0:a.setCustomStatus)&&this.commentElement.setCustomStatus(e),(null===(l=this.commentElement)||void 0===l?void 0:l.enableMinimap)&&this.commentElement.enableMinimap(),(null===(d=this.commentElement)||void 0===d?void 0:d.setDStrategy)&&(null===(c=this.commentElement)||void 0===c||c.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()}this.selectionElement=Snippyly.getSelectionElement(),this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.rewriterElement&&(null===(v=this.rewriterElement)||void 0===v||v.enableRewriter()),this.presenceElement&&(null===(m=this.presenceElement)||void 0===m?void 0:m.enableFlockMode)&&(null===(g=this.presenceElement)||void 0===g||g.enableFlockMode(!0)),null===(f=null===Snippyly||void 0===Snippyly?void 0:Snippyly.docService)||void 0===f||f.getDocumentMetadata$().subscribe((t=>{const e=(null==t?void 0:t.versions)?Object.values(null==t?void 0:t.versions):[],i=new URL(document.location).searchParams.get("version");if(i){const t=e.find((t=>t.versionId===i));t&&(this.version={id:t.versionId,name:t.versionName||t.versionId},this.setLocation())}})),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getViewsElement)&&(this.viewsElement=Snippyly.getViewsElement()),(null===(w=this.viewsElement)||void 0===w?void 0:w.getUniqueViewsByUser)&&(null===(C=null===(y=this.viewsElement)||void 0===y?void 0:y.getUniqueViewsByUser())||void 0===C||C.subscribe((t=>{this.totalViews=t}))),this.identifySnippyly()}catch(t){this.loading=!1,console.warn("Error in initializeSnippyly: ",t),Bs("Error in initializeSnippyly: ",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),Bs("Error in checkToEnableUpgradeButton: ",t)}},this.getCustomerMetadata=async()=>{try{let t=(()=>{try{const t=Is("sfCustomerMetadata");return t?"false"===t?JSON.parse(JSON.stringify(ht)):JSON.parse(t):null}catch(t){return console.warn("Error in getCustomerMetadataFromStorage: ",t),Bs("Error in getCustomerMetadataFromStorage: ",t),null}})();return t||(t=await(async t=>{try{const e=Ke(Us,Ct,{timeout:12e5}),i=await e({apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getCustomerMetadata: ",t),null}})(this.apiKey),Vs(t)),t}catch(t){console.warn("Error in getCustomerMetadata: ",t),Bs("Error in getCustomerMetadata: ",t)}},this.setLogos=()=>{var t,e,i,o,n,s,r,a,l,d,c,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.customBranding)||void 0===e?void 0:e.logo)||void 0===i?void 0:i.logoMark,v=null===(s=null===(n=null===(o=null==pt?void 0:ht)||void 0===o?void 0:o.customBranding)||void 0===n?void 0:n.logo)||void 0===s?void 0:s.logoMark,m=null===(l=null===(a=null===(r=this.customerMetadata)||void 0===r?void 0:r.customBranding)||void 0===a?void 0:a.logo)||void 0===l?void 0:l.wordMark,g=null===(h=null===(c=null===(d=null==pt?void 0:ht)||void 0===d?void 0:d.customBranding)||void 0===c?void 0:c.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==m?void 0:m.lightUrl)||(null==m?void 0:m.darkUrl)||(null==g?void 0:g.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==m?void 0:m.darkUrl)||(null==m?void 0:m.lightUrl)||(null==g?void 0:g.darkUrl)}}catch(t){console.warn("Error in setLogos: ",t),Bs("Error in setLogos: ",t)}},this.getLogoMark=()=>{var t;try{return(null===(t=this.logoMark)||void 0===t?void 0:t.includes("<svg"))?O`
|
|
2469
2469
|
${tr(this.logoMark)}
|
|
2470
2470
|
`:O`
|
|
2471
2471
|
<img src=${this.logoMark} />
|
|
@@ -2473,7 +2473,7 @@ class Xs extends at{constructor(t){if(super(t),this.it=F,t.type!==st)throw Error
|
|
|
2473
2473
|
${tr(this.wordMark)}
|
|
2474
2474
|
`:O`
|
|
2475
2475
|
<img src=${this.wordMark} />
|
|
2476
|
-
`}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("review"),e.searchParams.delete("feedback"),e.searchParams.delete("sreviewId"),e.searchParams.delete("scommentId"),e.searchParams.delete("sprojectInstall"),e.searchParams.delete("sflivedemo");const i=t.get("sversion")||this.projectVersion;e.search="";let o=(t=>{try{return t.replace(/#.*$/,"")}catch(e){return console.warn("Error in removeHashFromUrl: ",e),Bs("Error in removeHashFromUrl: ",e),t}})(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),Bs("Error in generateLocation: ",t)}},this.setLocation=()=>{var t,e,i,o;try{if(this.autoLocation&&window.Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.setLocation)){if(this.version?(this.location||(this.location={}),this.location.version=this.version):this.location&&delete this.location.version,this.previousLocation&&(null===(t=this.previousLocation)||void 0===t?void 0:t.url)===(null===(e=this.location)||void 0===e?void 0:e.url)&&(null===(i=this.previousLocation)||void 0===i?void 0:i.version)===(null===(o=this.location)||void 0===o?void 0:o.version))return;null===Snippyly||void 0===Snippyly||Snippyly.setLocation(JSON.parse(JSON.stringify(this.location))),zs({clientLocation:this.location}),this.previousLocation=JSON.parse(JSON.stringify(this.location))}}catch(t){console.warn("Error in setLocation: ",t),Bs("Error in setLocation: ",t)}},this.identifySnippyly=async()=>{var t,e;let i="";try{this.invalidApiKey=!1;let e,o={name:"Default User",email:"default@usesuperflow.com",userId:"default",isAnonymous:!0};if(e=this.customLoginEnabled&&this.providedUser?this.providedUser:Fs(),(null==e?void 0:e.email)&&(o=e),o.isAnonymous?delete o.groupId:o.groupId=Snippyly.getDocumentId()+"",this.customLoginEnabledLocally||(null===(t=null==o?void 0:o.contacts)||void 0===t?void 0:t.length)&&(o.contacts=[]),i=null==o?void 0:o.email,(null==o?void 0:o.isAnonymous)&&this.projectId&&this.guestMode){const t=js();t&&(o=JSON.parse(JSON.stringify(t)))}(null==o?void 0:o.isAnonymous)||(this.loading=!0);const n=await(async(t,e)=>{var i,o;try{const n=Ke(Us,bt,{timeout:12e5}),s=await n({apiKey:t,userId:e});return null===(o=null===(i=null==s?void 0:s.data)||void 0===i?void 0:i.data)||void 0===o?void 0:o.token}catch(t){return console.warn("Error in generateSuperflowAuthToken: ",t),null}})(this.apiKey,null==o?void 0:o.userId),s={};n&&(s.authToken=n);const r=await Snippyly.identify(o,s);Hs(JSON.parse(JSON.stringify(r||{}))),(null==o?void 0:o.isAnonymous)||(this.snippylyUser=JSON.parse(JSON.stringify(o)));const a=JSON.parse(JSON.stringify(r||{}));(null==a?void 0:a.userSnippylyId)&&!(null==a?void 0:a.isGuest)&&this.checkToMigrateGuestUser(a),Snippyly.getUserRole$().subscribe((t=>{var e;this.loading=!1,this.snippylyUserRole=t,this.snippylyUserRole||Zs(Qs.Events.USER_EMAIL_NOT_WHITELISTED),null===(e=this.commentElement)||void 0===e||e.enablePriority()})),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getFeaturesAccessLevelIam$)&&this.subscriptions.push(Snippyly.getFeaturesAccessLevelIam$().subscribe((async t=>{var e,i,o,n,s,r,a,l;this.allFeatureDisabled=!!(null===(e=null==t?void 0:t.all)||void 0===e?void 0:e.disabled),this.allFeatureRestricted=!!(null===(i=null==t?void 0:t.all)||void 0===i?void 0:i.restricted),this.guestMode=!!(null===(o=null==t?void 0:t.all)||void 0===o?void 0:o.guestMode),this.allowGuestModeSignIn=!!(null===(s=null===(n=null==t?void 0:t.all)||void 0===n?void 0:n.guestModeConfig)||void 0===s?void 0:s.allowSignIn),this.guestMode&&Zs(Qs.Events.GUEST_MODE_PRESENT),(null===(r=null==t?void 0:t.all)||void 0===r?void 0:r.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(l=null===(a=null==t?void 0:t.all)||void 0===a?void 0:a.passwordProtected)||void 0===l?void 0:l.enabled),Velt&&(t&&this.passwordProtected&&!this.isPasswordValid?Velt.disableFeatures(["area","arrow","audioHuddle","cursor","huddle","liveStateSync","presence","tag","recorder","comment"]):Velt.disableFeatures([])),Ts("sfGuestMode",this.guestMode+"",!0),Ts("sfGuestModeAllowSignIn",this.allowGuestModeSignIn+"",!0),Ts("sfPasswordProtected",this.passwordProtected+"",!0)}),(t=>{this.loading=!1,console.warn("Error in getFeaturesAccessLevelIam$: ",t),Bs("Error in getFeaturesAccessLevelIam$: ",t)}))),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.isPlanExpired$)&&(null===Snippyly||void 0===Snippyly||Snippyly.isPlanExpired$().subscribe((t=>{this.isPlanExpired=t}),(t=>{this.isPlanExpired=!1,console.warn("Error in isPlanExpired$: ",t),Bs("Error in isPlanExpired$: ",t)}))),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCustomerMetadata$)&&(null===Snippyly||void 0===Snippyly||Snippyly.getCustomerMetadata$().subscribe((t=>{Vs(t),t&&(this.customerMetadata=t)}),(t=>{console.warn("Error in getCustomerMetadata$: ",t),Bs("Error in getCustomerMetadata$: ",t)}))),zs({clientUserId:null==o?void 0:o.userId});try{(t=>{var e,i,o,n,s,r,a,l,d,c,h,u;const p={properties:{apiKey:null!==(e=null==Ps?void 0:Ps.apiKey)&&void 0!==e?e:"",name:null!==(i=null==t?void 0:t.name)&&void 0!==i?i:"",firstName:(null==t?void 0:t.name)?null===(o=null==t?void 0:t.name)||void 0===o?void 0:o.split(" ")[0]:"",lastName:(null==t?void 0:t.name)?null===(n=null==t?void 0:t.name)||void 0===n?void 0:n.split(" ")[1]:"",email:null!==(s=null==t?void 0:t.email)&&void 0!==s?s:"",clientUserId:null!==(r=null==t?void 0:t.userId)&&void 0!==r?r:"",snippylyUserId:null!==(a=null==t?void 0:t.userSnippylyId)&&void 0!==a?a:"",groupId:null!==(l=null==t?void 0:t.groupId)&&void 0!==l?l:"",isOwner:"",plan:"",sdkVersion:null!==(d=null==Ps?void 0:Ps.sdkVersion)&&void 0!==d?d:"",sdkType:null!==(c=null==Ps?void 0:Ps.sdkType)&&void 0!==c?c:"",sourcePlatform:null!==(h=null==Ps?void 0:Ps.sourcePlatform)&&void 0!==h?h:"",website:null===(u=null===window||void 0===window?void 0:window.location)||void 0===u?void 0:u.href},context:{userAgent:null===navigator||void 0===navigator?void 0:navigator.userAgent},userId:null==t?void 0:t.userSnippylyId,sf:!0};Gs("identify",p)})(o)}catch(t){console.warn("Error in trackIdentifyEvent: ",t)}this.getComments(),this.checkGlobalUserContact(),setTimeout((()=>{Is("sfTourCommentTooltip")||(this.showTourCommentTooltip=!0)}),2e3)}catch(t){if(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,Zs(Qs.Events.DOMAIN_NOT_WHITELISTED),this.projectId&&(async(t,e)=>{try{const i=Ke(Us,wt,{timeout:12e5});await i({apiKey:t,projectId:e})}catch(t){console.warn("Error in checkDomainWhitelisted: ",t)}})(this.apiKey,this.projectId);if(new URL(document.location).searchParams.has("sprojectInstall"))this.isSigningInUserAdmin=!0;else if(Is("sfUserAdmin"))this.isSigningInUserAdmin="true"===Is("sfUserAdmin",!0);else{const t=await(async(t,e,i)=>{try{const o=Ke(Us,yt,{timeout:12e5}),n=await o({apiKey:t,projectId:e,email:i});return null==n?void 0:n.data}catch(t){return console.warn("Error in iam: ",t),null}})(this.apiKey,this.projectId||"",i);this.isSigningInUserAdmin=!!(null==t?void 0:t.isAdmin),Ts("sfUserAdmin",this.isSigningInUserAdmin+"",!0)}}console.warn("Error in identifySnippyly: ",t),Bs("Error in identifySnippyly: ",t)}},this.checkToMigrateGuestUser=async t=>{try{const e=js(!1);e&&(await Ws(this.apiKey,this.projectId||"",e,t,!0),Ls("_sfgut"))}catch(t){console.warn("Error in checkToMigrationGuestUser: ",t),Bs("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)}))})))}catch(t){console.warn("Error in getComments: ",t),Bs("Error in getComments: ",t)}},this.checkGlobalUserContact=()=>{try{this.contactElement&&this.contactElement.isUserGlobalContact().subscribe((t=>{this.isUserGlobalContact=t}))}catch(t){console.warn("Error in checkGlobalUserContact: ",t),Bs("Error in checkGlobalUserContact: ",t)}},this.toggleSnippylyPluginToolbar=()=>{try{this.expanded=!this.expanded,this.expanded?Zs(Qs.Events.TOOLBAR_EXPANDED):Zs(Qs.Events.TOOLBAR_COLLAPSED)}catch(t){console.warn("Error in toggleSnippylyPluginToolbar: ",t),Bs("Error in toggleSnippylyPluginToolbar: ",t)}},this.togglePrivateCommentMode=()=>{try{this.commentElement&&(this.privateCommentModeEnabled?(this.commentElement.disablePrivateCommentMode&&this.commentElement.disablePrivateCommentMode(),this.privateCommentModeEnabled=!1,Zs(Qs.Events.PRIVATE_MODE_DISABLED)):(this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode(),this.privateCommentModeEnabled=!0,Zs(Qs.Events.PRIVATE_MODE_ENABLED)))}catch(t){console.warn("Error in togglePrivateCommentMode: ",t),Bs("Error in togglePrivateCommentMode: ",t)}},this.loginWithGoogle=()=>{try{if(Zs(Qs.Events.SIGNIN_CLICKED),this.loading||this.customLoginEnabledLocally)return;window.open(this.signInUrl,"_self")}catch(t){console.warn("Error in loginWithGoogle: ",t),Bs("Error in loginWithGoogle: ",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=Os(e,mt,gt),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),Bs("Error in getQRCode: ",t)}},this.toggleQRCodeVisibility=async()=>{try{Zs(Qs.Events.OPEN_MOBILE_CLICKED),this.showQrCode=!this.showQrCode,this.showQrCode&&!this.qrCode&&await this.getQRCode()}catch(t){console.warn("Error in toggleQRCodeVisibility: ",t),Bs("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.removeSnippyly=async()=>{try{Zs(Qs.Events.EXIT_REVIEW_MODE_CLICKED),this.exitReviewModeCalled=!0,Ls("review"),Ls("feedback"),Ls("sreviewId"),Ls("projectVersionKey","sessionStorage"),Ls("projectVersion","sessionStorage");const t=new URL(document.location),e=t.searchParams;e.delete("sreviewId"),e.delete("review"),e.delete("feedback"),this.projectVersionKey&&e.delete(this.projectVersionKey),e.delete("sversion"),e.delete("sprojectInstall"),e.delete("sflivedemo"),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),Bs("Error in removeSnippyly: ",t)}},this.signOutUser=async()=>{try{Zs(Qs.Events.SIGNOUT_CLICKED),this.subscriptions.forEach((t=>{t&&t.unsubscribe&&(null==t||t.unsubscribe())})),await Snippyly.signOutUser(),Ls("snippyly-user"),Ls("_sfut"),Ls("sfUserAdmin"),this.snippylyUser=void 0,window.open(this.signOutUrl,"_self")}catch(t){console.warn("Error in signOutUser: ",t),Bs("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),Bs("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),Bs("Error in copyLink: ",t)}},this.goToAdminPortal=()=>{try{let t=`${vt}`;if(Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId)){const e=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId();e&&(t=`${vt}/dashboard/project/comment/${this.apiKey}/${e}`)}Zs(Qs.Events.VIEW_PROJECT_CLICKED),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortal: ",t),Bs("Error in goToAdminPortal: ",t)}},this.goToAdminPortalDashboard=()=>{try{let t=`${vt}`;if(Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId)){(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId())&&(t=`${vt}/dashboard`)}window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortalDashboard: ",t),Bs("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),Bs("Error in joinCommunity: ",t)}},this.onboardingNextClick=()=>{try{this.showOnboardingModal=!1,Ts("sprojectInstall","true");const t=new URL(document.location);t.searchParams.delete("sprojectInstall"),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onboardingNextClick: ",t),Bs("Error in onboardingNextClick: ",t)}},this.onLiveDemoModalNextClick=()=>{try{this.showLiveDemoModal=!1,Ts("sflivedemo","true",!1,"sessionStorage");const t=new URL(document.location);t.searchParams.delete("sflivedemo"),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onLiveDemoModalNextClick: ",t),Bs("Error in onLiveDemoModalNextClick: ",t)}},this.onFigmaDemoModalNextClick=()=>{try{this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete("sffigmademo"),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onFigmaDemoModalNextClick: ",t),Bs("Error in onFigmaDemoModalNextClick: ",t)}},this.onUpgradePlanClick=()=>{try{window.open("https://superflow-portal-staging-2023.web.app/dashboard/billing","_blank")}catch(t){console.warn("Error in onUpgradePlanClick: ",t),Bs("Error in onUpgradePlanClick: ",t)}},this.onTourCommentTooltipClick=()=>{try{this.showTourCommentTooltip=!1,Ts("sfTourCommentTooltip","true")}catch(t){console.warn("Error in onTourCommentTooltipClick: ",t),Bs("Error in onTourCommentTooltipClick: ",t)}},this.onGuestModeChipSignInButtonClick=()=>{try{Zs(Qs.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeChipSignInButtonClick: ",t),Bs("Error in onGuestModeChipSignInButtonClick: ",t)}},this.openGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!0,Zs(Qs.Events.GUEST_MODE_SIGN_IN_DIALOG_SHOWN)}catch(t){console.warn("Error in openGuestModeSignInModal: ",t),Bs("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),Bs("Error in closeGuestModeSignInModal: ",t)}},this.onGuestModeSignInModalSignInButtonClick=()=>{try{Zs(Qs.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeSignInModalSignInButtonClick: ",t),Bs("Error in onGuestModeSignInModalSignInButtonClick: ",t)}},this.openGuestModeNameModel=t=>{try{t&&(t.stopPropagation(),t.preventDefault()),this.skipGuestNameModal||(this.showGuestModeNameModal=!0,Zs(Qs.Events.GUEST_MODE_NAME_NUDGE_SHOWN))}catch(t){console.warn("Error in openGuestModeNameModel: ",t),Bs("Error in openGuestModeNameModel: ",t)}},this.closeGuestModeNameModel=()=>{try{this.showGuestModeNameModal=!1}catch(t){console.warn("Error in closeGuestModeNameModel: ",t),Bs("Error in closeGuestModeNameModel: ",t)}},this.onGuestModeNameModalSkipButtonClick=()=>{try{Zs(Qs.Events.GUEST_MODE_SKIP_BUTTON_CLICKED),this.showGuestModeNameModal=!1}catch(t){console.warn("Error in onGuestModeNameModalSkipButtonClick: ",t),Bs("Error in onGuestModeNameModalSkipButtonClick: ",t)}},this.onPasswordProtectedModalCloseButtonClick=()=>{try{Zs(Qs.Events.PASSWORD_PROTECTED_MODAL_CLOSE_BUTTON_CLICKED),this.showPasswordProtectedModal=!1,this.password="",this.showInvalidPassword=!1}catch(t){console.warn("Error in onPasswordProtectedModalCloseButtonClick: ",t),Bs("Error in onPasswordProtectedModalCloseButtonClick: ",t)}},this.onPasswordProtectedModalOpenButtonClick=()=>{try{Zs(Qs.Events.PASSWORD_PROTECTED_MODAL_OPEN_BUTTON_CLICKED),this.showPasswordProtectedModal=!0}catch(t){console.warn("Error in onPasswordProtectedModalOpenButtonClick: ",t),Bs("Error in onPasswordProtectedModalOpenButtonClick: ",t)}},this.showGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!0,Zs(Qs.Events.GUEST_MODE_SIGN_IN_NUDGE_SHOWN)}catch(t){console.warn("Error in showGuestModeSignInBanner: ",t),Bs("Error in showGuestModeSignInBanner: ",t)}},this.hideGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!1}catch(t){console.warn("Error in hideGuestModeSignInBanner: ",t),Bs("Error in hideGuestModeSignInBanner: ",t)}},this.onGuestModeBannerSignInButtonClick=()=>{try{Zs(Qs.Events.GUEST_MODE_SIGN_IN_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeBannerSignInButtonClick: ",t),Bs("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=js();if(e){const t=JSON.parse(JSON.stringify(e));e.name=this.guestUserNameInput,e.photoUrl=null,this.guestUserNameUpdateLoading=!0,(t=>{try{const e=JSON.stringify(t),i=Os(e,mt,gt);Ts("_sfgut",i,!0)}catch(t){console.warn("Error in updateGuestUser: ",t),Bs("Error in updateGuestUser: ",t)}})(e),await Snippyly.identify(e),this.snippylyUser=JSON.parse(JSON.stringify(e)),await Ws(this.apiKey,this.projectId||"",t,e),this.showGuestModeNameModal=!1,this.guestUserNameUpdated=!0,this.guestUserNameUpdateLoading=!1,Ts("sfGuestUserNameUpdated","true"),Zs(Qs.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),Bs("Error in updateGuestUserName: ",t)}},this.submitPassword=async()=>{var t;try{if(Zs(Qs.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(async(t,e,i)=>{var o;try{const n=Ke(Us,kt,{timeout:12e5}),s=await n({apiKey:t,projectId:e,password:i});return null===(o=null==s?void 0:s.data)||void 0===o?void 0:o.data}catch(t){return console.warn("Error in validatePassword: ",t),null}})(this.apiKey,this.projectId,this.password),function(t,e){try{const i="object"==typeof e?JSON.stringify(e):e;localStorage.setItem(t,i)}catch(t){console.warn("Error in setLocalStorage: ",t)}}("sfPasswordIsValid",this.isPasswordValid),this.isPasswordValid?(this.password="",this.onPasswordProtectedModalCloseButtonClick(),this.showInvalidPassword=!1,Velt&&Velt.disableFeatures([]),Zs(Qs.Events.REVIEW_PASSWORD_ACCEPTED)):(this.showInvalidPassword=!0,Zs(Qs.Events.REVIEW_PASSWORD_REJECTED)),this.validatingPasswordLoading=!1}catch(t){console.warn("Error in submitPassword: ",t),Bs("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 Ws(this.apiKey,this.projectId||"",e,i),await Snippyly.updateUser(i),this.snippylyUser=JSON.parse(JSON.stringify(i));const o=Fs();o.name=i.name;const n=JSON.stringify(o),s=Os(n,mt,gt);Ts("_sfut",s,!0),this.guestUserNameUpdateLoading=!1,this.guestUserNameInput="",this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateUserName: ",t),Bs("Error in updateUserName: ",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),Bs("Error in disableAddCommentMode: ",t)}},this.disableCommentModeButton=()=>{try{return this.addCommentMode?O`
|
|
2476
|
+
`}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("review"),e.searchParams.delete("feedback"),e.searchParams.delete("sreviewId"),e.searchParams.delete("scommentId"),e.searchParams.delete("sprojectInstall"),e.searchParams.delete("sflivedemo");const i=t.get("sversion")||this.projectVersion;e.search="";let o=(t=>{try{return t.replace(/#.*$/,"")}catch(e){return console.warn("Error in removeHashFromUrl: ",e),Bs("Error in removeHashFromUrl: ",e),t}})(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),Bs("Error in generateLocation: ",t)}},this.setLocation=()=>{var t,e,i,o;try{if(this.autoLocation&&window.Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.setLocation)){if(this.version?(this.location||(this.location={}),this.location.version=this.version):this.location&&delete this.location.version,this.previousLocation&&(null===(t=this.previousLocation)||void 0===t?void 0:t.url)===(null===(e=this.location)||void 0===e?void 0:e.url)&&(null===(i=this.previousLocation)||void 0===i?void 0:i.version)===(null===(o=this.location)||void 0===o?void 0:o.version))return;null===Snippyly||void 0===Snippyly||Snippyly.setLocation(JSON.parse(JSON.stringify(this.location))),zs({clientLocation:this.location}),this.previousLocation=JSON.parse(JSON.stringify(this.location))}}catch(t){console.warn("Error in setLocation: ",t),Bs("Error in setLocation: ",t)}},this.identifySnippyly=async()=>{var t,e;let i="";try{this.invalidApiKey=!1;let e,o={name:"Default User",email:"default@usesuperflow.com",userId:"default",isAnonymous:!0};if(e=this.customLoginEnabled&&this.providedUser?this.providedUser:Fs(),(null==e?void 0:e.email)&&(o=e),o.isAnonymous?delete o.groupId:o.groupId=Snippyly.getDocumentId()+"",this.customLoginEnabledLocally||(null===(t=null==o?void 0:o.contacts)||void 0===t?void 0:t.length)&&(o.contacts=[]),i=null==o?void 0:o.email,(null==o?void 0:o.isAnonymous)&&this.projectId&&this.guestMode){const t=js();t&&(o=JSON.parse(JSON.stringify(t)))}(null==o?void 0:o.isAnonymous)||(this.loading=!0);const n=await(async(t,e)=>{var i,o;try{const n=Ke(Us,bt,{timeout:12e5}),s=await n({apiKey:t,userId:e});return null===(o=null===(i=null==s?void 0:s.data)||void 0===i?void 0:i.data)||void 0===o?void 0:o.token}catch(t){return console.warn("Error in generateSuperflowAuthToken: ",t),null}})(this.apiKey,null==o?void 0:o.userId),s={};n&&(s.authToken=n);const r=await Snippyly.identify(o,s);Hs(JSON.parse(JSON.stringify(r||{}))),(null==o?void 0:o.isAnonymous)||(this.snippylyUser=JSON.parse(JSON.stringify(o)));const a=JSON.parse(JSON.stringify(r||{}));(null==a?void 0:a.userSnippylyId)&&!(null==a?void 0:a.isGuest)&&this.checkToMigrateGuestUser(a),Snippyly.getUserRole$().subscribe((t=>{var e;this.loading=!1,this.snippylyUserRole=t,this.snippylyUserRole||Zs(Qs.Events.USER_EMAIL_NOT_WHITELISTED),null===(e=this.commentElement)||void 0===e||e.enablePriority()})),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getFeaturesAccessLevelIam$)&&this.subscriptions.push(Snippyly.getFeaturesAccessLevelIam$().subscribe((async t=>{var e,i,o,n,s,r,a,l;this.allFeatureDisabled=!!(null===(e=null==t?void 0:t.all)||void 0===e?void 0:e.disabled),this.allFeatureRestricted=!!(null===(i=null==t?void 0:t.all)||void 0===i?void 0:i.restricted),this.guestMode=!!(null===(o=null==t?void 0:t.all)||void 0===o?void 0:o.guestMode),this.allowGuestModeSignIn=!!(null===(s=null===(n=null==t?void 0:t.all)||void 0===n?void 0:n.guestModeConfig)||void 0===s?void 0:s.allowSignIn),this.guestMode&&Zs(Qs.Events.GUEST_MODE_PRESENT),(null===(r=null==t?void 0:t.all)||void 0===r?void 0:r.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(l=null===(a=null==t?void 0:t.all)||void 0===a?void 0:a.passwordProtected)||void 0===l?void 0:l.enabled),Velt&&(t&&this.passwordProtected&&!this.isPasswordValid?Velt.disableFeatures(["area","arrow","audioHuddle","cursor","huddle","liveStateSync","presence","tag","recorder","comment"]):Velt.disableFeatures([])),Ts("sfGuestMode",this.guestMode+"",!0),Ts("sfGuestModeAllowSignIn",this.allowGuestModeSignIn+"",!0),Ts("sfPasswordProtected",this.passwordProtected+"",!0)}),(t=>{this.loading=!1,console.warn("Error in getFeaturesAccessLevelIam$: ",t),Bs("Error in getFeaturesAccessLevelIam$: ",t)}))),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.isPlanExpired$)&&(null===Snippyly||void 0===Snippyly||Snippyly.isPlanExpired$().subscribe((t=>{this.isPlanExpired=t}),(t=>{this.isPlanExpired=!1,console.warn("Error in isPlanExpired$: ",t),Bs("Error in isPlanExpired$: ",t)}))),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCustomerMetadata$)&&(null===Snippyly||void 0===Snippyly||Snippyly.getCustomerMetadata$().subscribe((t=>{Vs(t),t&&(this.customerMetadata=t)}),(t=>{console.warn("Error in getCustomerMetadata$: ",t),Bs("Error in getCustomerMetadata$: ",t)}))),zs({clientUserId:null==o?void 0:o.userId});try{(t=>{var e,i,o,n,s,r,a,l,d,c,h,u;const p={properties:{apiKey:null!==(e=null==Ps?void 0:Ps.apiKey)&&void 0!==e?e:"",name:null!==(i=null==t?void 0:t.name)&&void 0!==i?i:"",firstName:(null==t?void 0:t.name)?null===(o=null==t?void 0:t.name)||void 0===o?void 0:o.split(" ")[0]:"",lastName:(null==t?void 0:t.name)?null===(n=null==t?void 0:t.name)||void 0===n?void 0:n.split(" ")[1]:"",email:null!==(s=null==t?void 0:t.email)&&void 0!==s?s:"",clientUserId:null!==(r=null==t?void 0:t.userId)&&void 0!==r?r:"",snippylyUserId:null!==(a=null==t?void 0:t.userSnippylyId)&&void 0!==a?a:"",groupId:null!==(l=null==t?void 0:t.groupId)&&void 0!==l?l:"",isOwner:"",plan:"",sdkVersion:null!==(d=null==Ps?void 0:Ps.sdkVersion)&&void 0!==d?d:"",sdkType:null!==(c=null==Ps?void 0:Ps.sdkType)&&void 0!==c?c:"",sourcePlatform:null!==(h=null==Ps?void 0:Ps.sourcePlatform)&&void 0!==h?h:"",website:null===(u=null===window||void 0===window?void 0:window.location)||void 0===u?void 0:u.href},context:{userAgent:null===navigator||void 0===navigator?void 0:navigator.userAgent},userId:null==t?void 0:t.userSnippylyId,sf:!0};Gs("identify",p)})(o)}catch(t){console.warn("Error in trackIdentifyEvent: ",t)}this.getComments(),this.checkGlobalUserContact(),setTimeout((()=>{Is("sfTourCommentTooltip")||(this.showTourCommentTooltip=!0)}),2e3)}catch(t){if(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"))){if(this.invalidApiKey=!0,Zs(Qs.Events.DOMAIN_NOT_WHITELISTED),this.projectId){const t=await(async(t,e)=>{try{const i=Ke(Us,wt,{timeout:12e5});return await i({apiKey:t,projectId:e})}catch(t){console.warn("Error in checkDomainWhitelisted: ",t)}})(this.apiKey,this.projectId);t.refereshPage&&setTimeout((function(){location.reload()}),5e3)}if(new URL(document.location).searchParams.has("sprojectInstall"))this.isSigningInUserAdmin=!0;else if(Is("sfUserAdmin"))this.isSigningInUserAdmin="true"===Is("sfUserAdmin",!0);else{const t=await(async(t,e,i)=>{try{const o=Ke(Us,yt,{timeout:12e5}),n=await o({apiKey:t,projectId:e,email:i});return null==n?void 0:n.data}catch(t){return console.warn("Error in iam: ",t),null}})(this.apiKey,this.projectId||"",i);this.isSigningInUserAdmin=!!(null==t?void 0:t.isAdmin),Ts("sfUserAdmin",this.isSigningInUserAdmin+"",!0)}}console.warn("Error in identifySnippyly: ",t),Bs("Error in identifySnippyly: ",t)}},this.checkToMigrateGuestUser=async t=>{try{const e=js(!1);e&&(await Ws(this.apiKey,this.projectId||"",e,t,!0),Ls("_sfgut"))}catch(t){console.warn("Error in checkToMigrationGuestUser: ",t),Bs("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)}))})))}catch(t){console.warn("Error in getComments: ",t),Bs("Error in getComments: ",t)}},this.checkGlobalUserContact=()=>{try{this.contactElement&&this.contactElement.isUserGlobalContact().subscribe((t=>{this.isUserGlobalContact=t}))}catch(t){console.warn("Error in checkGlobalUserContact: ",t),Bs("Error in checkGlobalUserContact: ",t)}},this.toggleSnippylyPluginToolbar=()=>{try{this.expanded=!this.expanded,this.expanded?Zs(Qs.Events.TOOLBAR_EXPANDED):Zs(Qs.Events.TOOLBAR_COLLAPSED)}catch(t){console.warn("Error in toggleSnippylyPluginToolbar: ",t),Bs("Error in toggleSnippylyPluginToolbar: ",t)}},this.togglePrivateCommentMode=()=>{try{this.commentElement&&(this.privateCommentModeEnabled?(this.commentElement.disablePrivateCommentMode&&this.commentElement.disablePrivateCommentMode(),this.privateCommentModeEnabled=!1,Zs(Qs.Events.PRIVATE_MODE_DISABLED)):(this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode(),this.privateCommentModeEnabled=!0,Zs(Qs.Events.PRIVATE_MODE_ENABLED)))}catch(t){console.warn("Error in togglePrivateCommentMode: ",t),Bs("Error in togglePrivateCommentMode: ",t)}},this.loginWithGoogle=()=>{try{if(Zs(Qs.Events.SIGNIN_CLICKED),this.loading||this.customLoginEnabledLocally)return;window.open(this.signInUrl,"_self")}catch(t){console.warn("Error in loginWithGoogle: ",t),Bs("Error in loginWithGoogle: ",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=Os(e,mt,gt),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),Bs("Error in getQRCode: ",t)}},this.toggleQRCodeVisibility=async()=>{try{Zs(Qs.Events.OPEN_MOBILE_CLICKED),this.showQrCode=!this.showQrCode,this.showQrCode&&!this.qrCode&&await this.getQRCode()}catch(t){console.warn("Error in toggleQRCodeVisibility: ",t),Bs("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.removeSnippyly=async()=>{try{Zs(Qs.Events.EXIT_REVIEW_MODE_CLICKED),this.exitReviewModeCalled=!0,Ls("review"),Ls("feedback"),Ls("sreviewId"),Ls("projectVersionKey","sessionStorage"),Ls("projectVersion","sessionStorage");const t=new URL(document.location),e=t.searchParams;e.delete("sreviewId"),e.delete("review"),e.delete("feedback"),this.projectVersionKey&&e.delete(this.projectVersionKey),e.delete("sversion"),e.delete("sprojectInstall"),e.delete("sflivedemo"),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),Bs("Error in removeSnippyly: ",t)}},this.signOutUser=async()=>{try{Zs(Qs.Events.SIGNOUT_CLICKED),this.subscriptions.forEach((t=>{t&&t.unsubscribe&&(null==t||t.unsubscribe())})),await Snippyly.signOutUser(),Ls("snippyly-user"),Ls("_sfut"),Ls("sfUserAdmin"),this.snippylyUser=void 0,window.open(this.signOutUrl,"_self")}catch(t){console.warn("Error in signOutUser: ",t),Bs("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),Bs("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),Bs("Error in copyLink: ",t)}},this.goToAdminPortal=()=>{try{let t=`${vt}`;if(Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId)){const e=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId();e&&(t=`${vt}/dashboard/project/comment/${this.apiKey}/${e}`)}Zs(Qs.Events.VIEW_PROJECT_CLICKED),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortal: ",t),Bs("Error in goToAdminPortal: ",t)}},this.goToAdminPortalDashboard=()=>{try{let t=`${vt}`;if(Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId)){(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId())&&(t=`${vt}/dashboard`)}window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortalDashboard: ",t),Bs("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),Bs("Error in joinCommunity: ",t)}},this.onboardingNextClick=()=>{try{this.showOnboardingModal=!1,Ts("sprojectInstall","true");const t=new URL(document.location);t.searchParams.delete("sprojectInstall"),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onboardingNextClick: ",t),Bs("Error in onboardingNextClick: ",t)}},this.onLiveDemoModalNextClick=()=>{try{this.showLiveDemoModal=!1,Ts("sflivedemo","true",!1,"sessionStorage");const t=new URL(document.location);t.searchParams.delete("sflivedemo"),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onLiveDemoModalNextClick: ",t),Bs("Error in onLiveDemoModalNextClick: ",t)}},this.onFigmaDemoModalNextClick=()=>{try{this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete("sffigmademo"),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onFigmaDemoModalNextClick: ",t),Bs("Error in onFigmaDemoModalNextClick: ",t)}},this.onUpgradePlanClick=()=>{try{window.open("https://superflow-portal-staging-2023.web.app/dashboard/billing","_blank")}catch(t){console.warn("Error in onUpgradePlanClick: ",t),Bs("Error in onUpgradePlanClick: ",t)}},this.onTourCommentTooltipClick=()=>{try{this.showTourCommentTooltip=!1,Ts("sfTourCommentTooltip","true")}catch(t){console.warn("Error in onTourCommentTooltipClick: ",t),Bs("Error in onTourCommentTooltipClick: ",t)}},this.onGuestModeChipSignInButtonClick=()=>{try{Zs(Qs.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeChipSignInButtonClick: ",t),Bs("Error in onGuestModeChipSignInButtonClick: ",t)}},this.openGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!0,Zs(Qs.Events.GUEST_MODE_SIGN_IN_DIALOG_SHOWN)}catch(t){console.warn("Error in openGuestModeSignInModal: ",t),Bs("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),Bs("Error in closeGuestModeSignInModal: ",t)}},this.onGuestModeSignInModalSignInButtonClick=()=>{try{Zs(Qs.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeSignInModalSignInButtonClick: ",t),Bs("Error in onGuestModeSignInModalSignInButtonClick: ",t)}},this.openGuestModeNameModel=t=>{try{t&&(t.stopPropagation(),t.preventDefault()),this.skipGuestNameModal||(this.showGuestModeNameModal=!0,Zs(Qs.Events.GUEST_MODE_NAME_NUDGE_SHOWN))}catch(t){console.warn("Error in openGuestModeNameModel: ",t),Bs("Error in openGuestModeNameModel: ",t)}},this.closeGuestModeNameModel=()=>{try{this.showGuestModeNameModal=!1}catch(t){console.warn("Error in closeGuestModeNameModel: ",t),Bs("Error in closeGuestModeNameModel: ",t)}},this.onGuestModeNameModalSkipButtonClick=()=>{try{Zs(Qs.Events.GUEST_MODE_SKIP_BUTTON_CLICKED),this.showGuestModeNameModal=!1}catch(t){console.warn("Error in onGuestModeNameModalSkipButtonClick: ",t),Bs("Error in onGuestModeNameModalSkipButtonClick: ",t)}},this.onPasswordProtectedModalCloseButtonClick=()=>{try{Zs(Qs.Events.PASSWORD_PROTECTED_MODAL_CLOSE_BUTTON_CLICKED),this.showPasswordProtectedModal=!1,this.password="",this.showInvalidPassword=!1}catch(t){console.warn("Error in onPasswordProtectedModalCloseButtonClick: ",t),Bs("Error in onPasswordProtectedModalCloseButtonClick: ",t)}},this.onPasswordProtectedModalOpenButtonClick=()=>{try{Zs(Qs.Events.PASSWORD_PROTECTED_MODAL_OPEN_BUTTON_CLICKED),this.showPasswordProtectedModal=!0}catch(t){console.warn("Error in onPasswordProtectedModalOpenButtonClick: ",t),Bs("Error in onPasswordProtectedModalOpenButtonClick: ",t)}},this.showGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!0,Zs(Qs.Events.GUEST_MODE_SIGN_IN_NUDGE_SHOWN)}catch(t){console.warn("Error in showGuestModeSignInBanner: ",t),Bs("Error in showGuestModeSignInBanner: ",t)}},this.hideGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!1}catch(t){console.warn("Error in hideGuestModeSignInBanner: ",t),Bs("Error in hideGuestModeSignInBanner: ",t)}},this.onGuestModeBannerSignInButtonClick=()=>{try{Zs(Qs.Events.GUEST_MODE_SIGN_IN_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeBannerSignInButtonClick: ",t),Bs("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=js();if(e){const t=JSON.parse(JSON.stringify(e));e.name=this.guestUserNameInput,e.photoUrl=null,this.guestUserNameUpdateLoading=!0,(t=>{try{const e=JSON.stringify(t),i=Os(e,mt,gt);Ts("_sfgut",i,!0)}catch(t){console.warn("Error in updateGuestUser: ",t),Bs("Error in updateGuestUser: ",t)}})(e),await Snippyly.identify(e),this.snippylyUser=JSON.parse(JSON.stringify(e)),await Ws(this.apiKey,this.projectId||"",t,e),this.showGuestModeNameModal=!1,this.guestUserNameUpdated=!0,this.guestUserNameUpdateLoading=!1,Ts("sfGuestUserNameUpdated","true"),Zs(Qs.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),Bs("Error in updateGuestUserName: ",t)}},this.submitPassword=async()=>{var t;try{if(Zs(Qs.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(async(t,e,i)=>{var o;try{const n=Ke(Us,kt,{timeout:12e5}),s=await n({apiKey:t,projectId:e,password:i});return null===(o=null==s?void 0:s.data)||void 0===o?void 0:o.data}catch(t){return console.warn("Error in validatePassword: ",t),null}})(this.apiKey,this.projectId,this.password),function(t,e){try{const i="object"==typeof e?JSON.stringify(e):e;localStorage.setItem(t,i)}catch(t){console.warn("Error in setLocalStorage: ",t)}}("sfPasswordIsValid",this.isPasswordValid),this.isPasswordValid?(this.password="",this.onPasswordProtectedModalCloseButtonClick(),this.showInvalidPassword=!1,Velt&&Velt.disableFeatures([]),Zs(Qs.Events.REVIEW_PASSWORD_ACCEPTED)):(this.showInvalidPassword=!0,Zs(Qs.Events.REVIEW_PASSWORD_REJECTED)),this.validatingPasswordLoading=!1}catch(t){console.warn("Error in submitPassword: ",t),Bs("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 Ws(this.apiKey,this.projectId||"",e,i),await Snippyly.updateUser(i),this.snippylyUser=JSON.parse(JSON.stringify(i));const o=Fs();o.name=i.name;const n=JSON.stringify(o),s=Os(n,mt,gt);Ts("_sfut",s,!0),this.guestUserNameUpdateLoading=!1,this.guestUserNameInput="",this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateUserName: ",t),Bs("Error in updateUserName: ",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),Bs("Error in disableAddCommentMode: ",t)}},this.disableCommentModeButton=()=>{try{return this.addCommentMode?O`
|
|
2477
2477
|
<div class="disable-add-comment-button" @click=${()=>this.disableCommentMode()}>
|
|
2478
2478
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2479
2479
|
<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"/>
|
|
@@ -3306,4 +3306,4 @@ class Xs extends at{constructor(t){if(super(t),this.it=F,t.type!==st)throw Error
|
|
|
3306
3306
|
</div>
|
|
3307
3307
|
</div>
|
|
3308
3308
|
`:O``}
|
|
3309
|
-
`:O``}}ir.styles=[Ks,Js],er([it()],ir.prototype,"loadPlugin",null),er([it()],ir.prototype,"comments",void 0),er([it()],ir.prototype,"commentElement",void 0),er([it()],ir.prototype,"contactElement",void 0),er([it()],ir.prototype,"rewriterElement",void 0),er([it()],ir.prototype,"presenceElement",void 0),er([it()],ir.prototype,"commentSubscription",void 0),er([it()],ir.prototype,"selectionElement",void 0),er([it()],ir.prototype,"viewsElement",void 0),er([it()],ir.prototype,"addCommentMode",void 0),er([it()],ir.prototype,"showTourCommentTooltip",void 0),er([it()],ir.prototype,"allFeatureDisabled",void 0),er([it()],ir.prototype,"allFeatureRestricted",void 0),er([it()],ir.prototype,"guestMode",void 0),er([it()],ir.prototype,"_expanded",void 0),er([it()],ir.prototype,"loading",void 0),er([it()],ir.prototype,"signInError",void 0),er([it()],ir.prototype,"snippylyUser",void 0),er([it()],ir.prototype,"snippylyUserRole",void 0),er([it()],ir.prototype,"_isPlanExpired",void 0),er([it()],ir.prototype,"showOnboardingModal",void 0),er([it()],ir.prototype,"showLiveDemoModal",void 0),er([it()],ir.prototype,"showFigmaDemoModal",void 0),er([it()],ir.prototype,"showGuestModeSignInModal",void 0),er([it()],ir.prototype,"guestModeSignInModalConfig",void 0),er([it()],ir.prototype,"showGuestModeNameModal",void 0),er([it()],ir.prototype,"guestModeSignInBannerVisible",void 0),er([it()],ir.prototype,"guestUserNameInput",void 0),er([it()],ir.prototype,"guestUserModelOpened",void 0),er([it()],ir.prototype,"guestUserNameUpdated",void 0),er([it()],ir.prototype,"guestUserNameUpdateLoading",void 0),er([et()],ir.prototype,"apiKey",null),er([et()],ir.prototype,"projectId",null),er([it()],ir.prototype,"staging",void 0),er([et()],ir.prototype,"projectVersionKey",null),er([it()],ir.prototype,"projectVersion",void 0),er([it()],ir.prototype,"version",void 0),er([et()],ir.prototype,"autoLocation",null),er([it()],ir.prototype,"_menuOpenedId",void 0),er([it()],ir.prototype,"copyLinkTooltip",void 0),er([it()],ir.prototype,"invalidApiKey",void 0),er([it()],ir.prototype,"documentId",void 0),er([it()],ir.prototype,"_isUserGlobalContact",void 0),er([it()],ir.prototype,"location",void 0),er([it()],ir.prototype,"qrCode",void 0),er([it()],ir.prototype,"showQrCode",void 0),er([it()],ir.prototype,"customLoginEnabledLocally",void 0),er([et()],ir.prototype,"customLoginEnabled",void 0),er([it()],ir.prototype,"providedUser",void 0),er([it()],ir.prototype,"autoTranslation",void 0),er([it()],ir.prototype,"addCommentCount",void 0),er([it()],ir.prototype,"isSigningInUserAdmin",void 0),er([it()],ir.prototype,"_privateCommentModeEnabled",void 0),er([it()],ir.prototype,"superflowToolbarMoved",void 0),er([it()],ir.prototype,"_customerMetadata",void 0),er([it()],ir.prototype,"logoMark",void 0),er([it()],ir.prototype,"wordMark",void 0),er([it()],ir.prototype,"_darkMode",void 0),er([it()],ir.prototype,"projectConfig",void 0),er([it()],ir.prototype,"allowGuestModeSignIn",void 0),er([it()],ir.prototype,"toolbarEnabled",void 0),er([it()],ir.prototype,"toolbarEnabledApiCalled",void 0),er([it()],ir.prototype,"passwordProtected",void 0),er([it()],ir.prototype,"isPasswordValid",void 0),er([it()],ir.prototype,"password",void 0),er([it()],ir.prototype,"validatingPasswordLoading",void 0),er([it()],ir.prototype,"showPasswordProtectedModal",void 0),er([it()],ir.prototype,"showInvalidPassword",void 0),er([it()],ir.prototype,"skipGuestNameModal",void 0),er([it()],ir.prototype,"_totalViews",void 0),er([it()],ir.prototype,"totalViewsCount",void 0),er([it()],ir.prototype,"inviteUrl",void 0),(t=>{if(customElements.get("superflow-toolbar")||customElements.get("snippyly-plugin"))return;const e={allow:["sdkUrl","windowVariables","snippylyPlugin"],loaders:{windowVariables:()=>{const t=null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_API_KEY;return{valid:!!t,type:"windowVariables",apiKey:t,staging:!!(null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_STAGING),projectVersionKey:null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_PROJECT_VERSION_KEY,projectId:null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_PROJECT_ID,autoLocation:null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_AUTO_LOCATION}},snippylyPlugin:()=>{const t=document.querySelector("snippyly-plugin");if(!t)return;const e=t.getAttribute("apiKey"),i=!!t.getAttribute("staging"),o=t.getAttribute("projectVersionKey"),n=t.getAttribute("projectId"),s=t.getAttribute("autoLocation");return null==t||t.remove(),{valid:!!e,type:"snippylyPlugin",apiKey:e,staging:i,projectVersionKey:o,projectId:n,autoLocation:s}},sdkUrl:()=>{const t=document.getElementById("superflowToolbarScript");if(!t)return;const e=null==t?void 0:t.src,i=new URL(e).searchParams,o=i.has("apiKey")?i.get("apiKey"):void 0;return{valid:!!o,type:"sdkUrl",apiKey:o,staging:void 0,projectVersionKey:void 0,projectId:i.has("projectId")?i.get("projectId"):void 0,autoLocation:i.has("autoLocation")?i.get("autoLocation"):void 0}}},load:()=>{for(let t=0;t<e.allow.length;t++){const i=e.allow[t],o=e.loaders[i]();if(o&&o.valid)return o}}},i=()=>{try{const i=e.load();if(customElements.define("superflow-toolbar",t),i&&i.valid){(()=>{try{document.querySelectorAll("superflow-toolbar").forEach((t=>{t.remove()})),document.querySelectorAll("snippyly-plugin").forEach((t=>{t.remove()}))}catch(t){console.warn("Error in removeSuperflowToolbarTag: ",t)}})();const t={};return t.apiKey=i.apiKey,i.staging&&(t.staging="true"),i.projectVersionKey&&(t.projectVersionKey=i.projectVersionKey),i.projectId&&(t.projectId=i.projectId),(null==i?void 0:i.autoLocation)&&(t.autoLocation=i.autoLocation),void((t={})=>{try{const e=document.createElement("superflow-toolbar");Object.keys(t||{}).forEach((i=>{e.setAttribute(i,t[i])})),document.body.appendChild(e)}catch(t){console.warn("Error in loadSuperflowToolbarTag: ",t)}})(t)}}catch(t){console.warn("Error in initSuperflow: ",t)}};(null===document||void 0===document?void 0:document.body)?i():null===document||void 0===document||document.addEventListener("DOMContentLoaded",(()=>{i()}))})(ir);class or extends Q{}customElements.get("snippyly-plugin")||customElements.define("snippyly-plugin",or);export{or as SnippylyPlugin,ir as SuperflowToolbar};
|
|
3309
|
+
`:O``}}ir.styles=[Ks,Js],er([it()],ir.prototype,"loadPlugin",null),er([it()],ir.prototype,"comments",void 0),er([it()],ir.prototype,"commentElement",void 0),er([it()],ir.prototype,"contactElement",void 0),er([it()],ir.prototype,"rewriterElement",void 0),er([it()],ir.prototype,"presenceElement",void 0),er([it()],ir.prototype,"commentSubscription",void 0),er([it()],ir.prototype,"selectionElement",void 0),er([it()],ir.prototype,"viewsElement",void 0),er([it()],ir.prototype,"addCommentMode",void 0),er([it()],ir.prototype,"showTourCommentTooltip",void 0),er([it()],ir.prototype,"allFeatureDisabled",void 0),er([it()],ir.prototype,"allFeatureRestricted",void 0),er([it()],ir.prototype,"guestMode",void 0),er([it()],ir.prototype,"_expanded",void 0),er([it()],ir.prototype,"loading",void 0),er([it()],ir.prototype,"signInError",void 0),er([it()],ir.prototype,"snippylyUser",void 0),er([it()],ir.prototype,"snippylyUserRole",void 0),er([it()],ir.prototype,"_isPlanExpired",void 0),er([it()],ir.prototype,"showOnboardingModal",void 0),er([it()],ir.prototype,"showLiveDemoModal",void 0),er([it()],ir.prototype,"showFigmaDemoModal",void 0),er([it()],ir.prototype,"showGuestModeSignInModal",void 0),er([it()],ir.prototype,"guestModeSignInModalConfig",void 0),er([it()],ir.prototype,"showGuestModeNameModal",void 0),er([it()],ir.prototype,"guestModeSignInBannerVisible",void 0),er([it()],ir.prototype,"guestUserNameInput",void 0),er([it()],ir.prototype,"guestUserModelOpened",void 0),er([it()],ir.prototype,"guestUserNameUpdated",void 0),er([it()],ir.prototype,"guestUserNameUpdateLoading",void 0),er([et()],ir.prototype,"apiKey",null),er([et()],ir.prototype,"projectId",null),er([it()],ir.prototype,"staging",void 0),er([et()],ir.prototype,"projectVersionKey",null),er([it()],ir.prototype,"projectVersion",void 0),er([it()],ir.prototype,"version",void 0),er([et()],ir.prototype,"autoLocation",null),er([it()],ir.prototype,"_menuOpenedId",void 0),er([it()],ir.prototype,"copyLinkTooltip",void 0),er([it()],ir.prototype,"invalidApiKey",void 0),er([it()],ir.prototype,"documentId",void 0),er([it()],ir.prototype,"_isUserGlobalContact",void 0),er([it()],ir.prototype,"location",void 0),er([it()],ir.prototype,"qrCode",void 0),er([it()],ir.prototype,"showQrCode",void 0),er([it()],ir.prototype,"customLoginEnabledLocally",void 0),er([et()],ir.prototype,"customLoginEnabled",void 0),er([it()],ir.prototype,"providedUser",void 0),er([it()],ir.prototype,"autoTranslation",void 0),er([it()],ir.prototype,"addCommentCount",void 0),er([it()],ir.prototype,"isSigningInUserAdmin",void 0),er([it()],ir.prototype,"_privateCommentModeEnabled",void 0),er([it()],ir.prototype,"superflowToolbarMoved",void 0),er([it()],ir.prototype,"_customerMetadata",void 0),er([it()],ir.prototype,"logoMark",void 0),er([it()],ir.prototype,"wordMark",void 0),er([it()],ir.prototype,"_darkMode",void 0),er([it()],ir.prototype,"projectConfig",void 0),er([it()],ir.prototype,"allowGuestModeSignIn",void 0),er([it()],ir.prototype,"toolbarEnabled",void 0),er([it()],ir.prototype,"toolbarEnabledApiCalled",void 0),er([it()],ir.prototype,"passwordProtected",void 0),er([it()],ir.prototype,"isPasswordValid",void 0),er([it()],ir.prototype,"password",void 0),er([it()],ir.prototype,"validatingPasswordLoading",void 0),er([it()],ir.prototype,"showPasswordProtectedModal",void 0),er([it()],ir.prototype,"showInvalidPassword",void 0),er([it()],ir.prototype,"skipGuestNameModal",void 0),er([it()],ir.prototype,"_totalViews",void 0),er([it()],ir.prototype,"totalViewsCount",void 0),er([it()],ir.prototype,"inviteUrl",void 0),er([it()],ir.prototype,"showModalOnceCommentIsModeIsOff",void 0),(t=>{if(customElements.get("superflow-toolbar")||customElements.get("snippyly-plugin"))return;const e={allow:["sdkUrl","windowVariables","snippylyPlugin"],loaders:{windowVariables:()=>{const t=null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_API_KEY;return{valid:!!t,type:"windowVariables",apiKey:t,staging:!!(null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_STAGING),projectVersionKey:null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_PROJECT_VERSION_KEY,projectId:null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_PROJECT_ID,autoLocation:null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_AUTO_LOCATION}},snippylyPlugin:()=>{const t=document.querySelector("snippyly-plugin");if(!t)return;const e=t.getAttribute("apiKey"),i=!!t.getAttribute("staging"),o=t.getAttribute("projectVersionKey"),n=t.getAttribute("projectId"),s=t.getAttribute("autoLocation");return null==t||t.remove(),{valid:!!e,type:"snippylyPlugin",apiKey:e,staging:i,projectVersionKey:o,projectId:n,autoLocation:s}},sdkUrl:()=>{const t=document.getElementById("superflowToolbarScript");if(!t)return;const e=null==t?void 0:t.src,i=new URL(e).searchParams,o=i.has("apiKey")?i.get("apiKey"):void 0;return{valid:!!o,type:"sdkUrl",apiKey:o,staging:void 0,projectVersionKey:void 0,projectId:i.has("projectId")?i.get("projectId"):void 0,autoLocation:i.has("autoLocation")?i.get("autoLocation"):void 0}}},load:()=>{for(let t=0;t<e.allow.length;t++){const i=e.allow[t],o=e.loaders[i]();if(o&&o.valid)return o}}},i=()=>{try{const i=e.load();if(customElements.define("superflow-toolbar",t),i&&i.valid){(()=>{try{document.querySelectorAll("superflow-toolbar").forEach((t=>{t.remove()})),document.querySelectorAll("snippyly-plugin").forEach((t=>{t.remove()}))}catch(t){console.warn("Error in removeSuperflowToolbarTag: ",t)}})();const t={};return t.apiKey=i.apiKey,i.staging&&(t.staging="true"),i.projectVersionKey&&(t.projectVersionKey=i.projectVersionKey),i.projectId&&(t.projectId=i.projectId),(null==i?void 0:i.autoLocation)&&(t.autoLocation=i.autoLocation),void((t={})=>{try{const e=document.createElement("superflow-toolbar");Object.keys(t||{}).forEach((i=>{e.setAttribute(i,t[i])})),document.body.appendChild(e)}catch(t){console.warn("Error in loadSuperflowToolbarTag: ",t)}})(t)}}catch(t){console.warn("Error in initSuperflow: ",t)}};(null===document||void 0===document?void 0:document.body)?i():null===document||void 0===document||document.addEventListener("DOMContentLoaded",(()=>{i()}))})(ir);class or extends Q{}customElements.get("snippyly-plugin")||customElements.define("snippyly-plugin",or);export{or as SnippylyPlugin,ir as SuperflowToolbar};
|
package/superflow.min.js
CHANGED
|
@@ -2464,7 +2464,7 @@ class Xs extends Wo{}Xs.Encryptor=class extends Xs{processBlock(t,e){const i=t,o
|
|
|
2464
2464
|
* Copyright 2017 Google LLC
|
|
2465
2465
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2466
2466
|
*/
|
|
2467
|
-
class Dr extends lt{constructor(t){if(super(t),this.it=$,t.type!==rt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===$||null==t)return this.ft=void 0,this.it=t;if(t===F)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:[]}}}Dr.directiveName="unsafeHTML",Dr.resultType=1;const Fr=at(Dr);var $r=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 jr extends X{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=true,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.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.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),kr("Error in onApiKeyChange: ",t)}},this.checkCustomLoginEnabled=async()=>{var t;try{const e=await(t=>{const e={apiKey:t};return Ni(Cr,qt,{timeout:12e5})(e)})(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),kr("Error in checkCustomLoginEnabled: ",t)}},this.loginWithCustomUser=()=>{try{this.customLoginEnabled?(ur(ft),this.loadPlugin&&this.documentId&&this.identifySnippyly()):console.warn("Identify call not allowed.")}catch(t){console.warn("Error in loginWithCustomUser: ",t),kr("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),kr("Error in addWindowClickEventListener: ",t)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t),kr("Error in removeWindowClickEventListener: ",t)}},this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(t){console.warn("Error in setWindowEventListner: ",t),kr("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),kr("Error in urlChangeListener: ",t)}},this.checkUrl=()=>{try{this.setInviteUrl();const t=new URL(document.location),e=t.searchParams;if((null==e?void 0:e.has(xt))&&!hr(xt)?this.showOnboardingModal=!0:this.showOnboardingModal=!1,null==e?void 0:e.has(Et))if(hr(Et,!1,"sessionStorage")){this.showLiveDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Et),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(St))if(hr(St,!1)){this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(St),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(gt)||e.has("snippyly_google_token")){if(e.has(gt)){const t=decodeURIComponent(e.get(gt)),i=mr(t,Ht,Bt),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=vr(e,Ht,Bt);dr(ft,i,!0),ur(Mt)}}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,dr(mt,JSON.stringify(i),!0)}e.delete(gt),e.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}e.has(ht)?(dr(ht,"true",!1),ur(ut),e.delete(ht),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(ut)||hr(ht,!1)&&this.loadPluginUI(),e.has(ut)?(dr(ut,"true",!1),ur(ht),e.delete(ut),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(ht)||hr(ut,!1)&&this.loadPluginUI(),this.setVersionInUrl()}catch(t){console.warn("Error in checkUrl: ",t),kr("Error in checkUrl: ",t)}},this.setInviteUrl=()=>{try{const t=new URL(document.location);t.searchParams.has(ht)||t.searchParams.set(ht,"true"),this.inviteUrl=t.toString()}catch(t){console.warn("Error in setInviteUrl: ",t),kr("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&&dr(Ct,this.projectVersion,!1,"sessionStorage")}else{const t=new URL(document.location).searchParams;(t.has(ht)||t.has(ut))&&t.has(bt)&&(dr(yt,bt,!1,"sessionStorage"),this.projectVersion=t.get(bt),this.projectVersion&&dr(Ct,this.projectVersion,!1,"sessionStorage"))}}catch(t){console.warn("Error in detectVersion: ",t),kr("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||hr(yt,!1,"sessionStorage"),e=this.projectVersion||hr(Ct,!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),kr("Error in setVersionInUrl: ",t)}},this.loadPluginUI=async()=>{var t,e,i,o,n,s,r;try{if(!this.apiKey)return;if(!this.projectId)return;if(this.loadPlugin)return this.generateLocation(),void this.setLocation();if(this.toolbarEnabledApiCalled||await this.detectToolbarEnabled(),!this.toolbarEnabled)return;const a=gr();if(a&&!(null==a?void 0:a.isAnonymous)&&(this.loading=!0),null===(t=this.getCustomerMetadata())||void 0===t||t.then((t=>{this.customerMetadata=t})).catch((t=>{console.warn("Error in getCustomerMetadata: ",t),kr("Error in getCustomerMetadata: ",t)})),cr(Tt)&&(this.isPasswordValid=cr(Tt)),hr(_t,!0)&&hr(It,!0)&&hr(Nt,!0)?(this.guestMode="true"===hr(_t,!0),this.allowGuestModeSignIn="true"===hr(It,!0),this.passwordProtected="true"===hr(Nt,!0)):(this.projectConfig=await(async(t,e)=>{var i;try{const o=Ni(Cr,Qt,{timeout:12e5}),n=await o({apiKey:t,projectId:e});return null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.data}catch(t){return console.warn("Error in getProjectConfig: ",t),null}})(this.apiKey,this.projectId),this.guestMode=!!(null===(e=this.projectConfig)||void 0===e?void 0:e.guestMode)||this.guestMode,this.allowGuestModeSignIn=!!(null===(o=null===(i=this.projectConfig)||void 0===i?void 0:i.guestModeConfig)||void 0===o?void 0:o.allowSignIn),(null===(n=this.projectConfig)||void 0===n?void 0:n.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(r=null===(s=this.projectConfig)||void 0===s?void 0:s.passwordProtected)||void 0===r?void 0:r.enabled),dr(_t,this.guestMode+"",!0),dr(It,this.allowGuestModeSignIn+"",!0),dr(Nt,this.passwordProtected+"",!0)),this.loadPlugin=!0,!document.querySelector(jt.VELT_COMMENTS)){const t=document.createElement(jt.VELT_COMMENTS);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&&!hr(Lt)&&(this.allowGuestModeSignIn?this.openGuestModeSignInModal():this.openGuestModeNameModel(),dr(Lt,"true")),this.addCommentCount>=5&&!hr(Ot,!1,"sessionStorage")&&(this.showGuestModeSignInBanner(),dr(Ot,"true",!1,"sessionStorage")))})),window.document.body.appendChild(t)}if(!document.querySelector(jt.VELT_CURSOR)){const t=document.createElement(jt.VELT_CURSOR);window.document.body.appendChild(t)}if(!document.querySelector(jt.VELT_HUDDLE)){const t=document.createElement(jt.VELT_HUDDLE);window.document.body.appendChild(t)}if(!document.querySelector(jt.VELT_RECORDER_NOTES)){const t=document.createElement(jt.VELT_RECORDER_NOTES);window.document.body.appendChild(t)}if(!document.querySelector(jt.VELT_RECORDER_CONTROL_PANEL)){const t=document.createElement(jt.VELT_RECORDER_CONTROL_PANEL);window.document.body.appendChild(t)}if(!document.querySelector(jt.VELT_ARROWS)){const t=document.createElement(jt.VELT_ARROWS);window.document.body.appendChild(t)}this.initializeSnippyly()}catch(t){this.loading=!1,console.warn("Error in loadPluginUI: ",t),kr("Error in loadPluginUI: ",t)}},this.initializeSnippyly=async()=>{var t,e,o,n,s,r,a,l,c,d,h,u,p,v,m,g,f,w,y,C;try{if(await i(this.apiKey,{options:{develop:this.staging,version:this.staging?dt:"latest",velt:!0}}),!window.Snippyly)return;if(this.autoTranslation&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.enableAutoTranslation)&&(null===Snippyly||void 0===Snippyly||Snippyly.enableAutoTranslation()),!document.querySelector(jt.VELT_COMMENTS_SIDEBAR)){const t=document.createElement(jt.VELT_COMMENTS_SIDEBAR);t.setAttribute(Vt.ENABLE_URL_NAVIGATION,"true"),t.setAttribute(Vt.CURRENT_LOCATION_SUFFIX,"true"),window.document.body.appendChild(t)}if(Snippyly){null===Snippyly||void 0===Snippyly||Snippyly.sf(!0);try{(null===window||void 0===window?void 0:window.onSnippylyLoad)&&(null===window||void 0===window||window.onSnippylyLoad(Snippyly))}catch(t){}document.body.style.setProperty("--velt-default-font-family","'Poppins', sans-serif"),(()=>{try{if(!document.getElementById("superflowFontLink1")){const t=document.createElement("link");t.rel="preconnect",t.href="https://fonts.googleapis.com",t.id="superflowFontLink1",document.head.appendChild(t)}if(!document.getElementById("superflowFontLink2")){const t=document.createElement("link");t.rel="preconnect",t.href="https://fonts.gstatic.com",t.crossOrigin="anonymous",t.id="superflowFontLink2",document.head.appendChild(t)}if(!document.getElementById("superflowFontLink3")){const t=document.createElement("link");t.rel="stylesheet",t.href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap",t.id="superflowFontLink3",document.head.appendChild(t)}}catch(t){console.warn("Error in loadPoppinsFont: ",t),kr("Error in loadPoppinsFont: ",t)}})()}Snippyly&&Er({sdkVersion:null===Snippyly||void 0===Snippyly?void 0:Snippyly.version,sdkType:"client"}),this.documentId=ar(lr(window.location.origin))+"",this.projectId&&(this.documentId=this.projectId+""),await(null===Snippyly||void 0===Snippyly?void 0:Snippyly.setDocumentId(this.documentId+""));const b=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId();if(Er({documentId:b,clientDocumentId:this.documentId}),this.generateLocation(),this.setLocation(),this.commentElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCommentElement(),this.contactElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getContactElement(),this.rewriterElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getRewriterElement(),this.presenceElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getPresenceElement(),this.commentElement){this.commentElement.enableTextComments(!0),this.customLoginEnabledLocally||this.commentElement.enableSignInButton(!0),this.commentElement.enableAttachments(!0),(null===(t=this.commentElement)||void 0===t?void 0:t.showScreenSizeInfo)&&this.commentElement.showScreenSizeInfo(!0),(null===(e=this.commentElement)||void 0===e?void 0:e.enableDeviceInfo)&&this.commentElement.enableDeviceInfo(!0),this.commentElement.enableCommentIndex(!0),this.commentElement.onCommentModeChange&&this.commentElement.onCommentModeChange().subscribe((t=>{this.addCommentMode=t})),(null===(o=this.commentElement)||void 0===o?void 0:o.enableOrphanComments)&&this.commentElement.enableOrphanComments(),(null===(n=this.commentElement)||void 0===n?void 0:n.enableAutoCategorize)&&this.commentElement.enableAutoCategorize(),(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 i=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;i&&"object"==typeof i&&(null===(a=this.commentElement)||void 0===a?void 0:a.setCustomStatus)&&this.commentElement.setCustomStatus(i),(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()}this.selectionElement=Snippyly.getSelectionElement(),this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.rewriterElement&&(null===(v=this.rewriterElement)||void 0===v||v.enableRewriter()),this.presenceElement&&(null===(m=this.presenceElement)||void 0===m?void 0:m.enableFlockMode)&&(null===(g=this.presenceElement)||void 0===g||g.enableFlockMode(!0)),null===(f=null===Snippyly||void 0===Snippyly?void 0:Snippyly.docService)||void 0===f||f.getDocumentMetadata$().subscribe((t=>{const e=(null==t?void 0:t.versions)?Object.values(null==t?void 0:t.versions):[],i=new URL(document.location).searchParams.get("version");if(i){const t=e.find((t=>t.versionId===i));t&&(this.version={id:t.versionId,name:t.versionName||t.versionId},this.setLocation())}})),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getViewsElement)&&(this.viewsElement=Snippyly.getViewsElement()),(null===(w=this.viewsElement)||void 0===w?void 0:w.getUniqueViewsByUser)&&(null===(C=null===(y=this.viewsElement)||void 0===y?void 0:y.getUniqueViewsByUser())||void 0===C||C.subscribe((t=>{this.totalViews=t}))),this.identifySnippyly()}catch(t){this.loading=!1,console.warn("Error in initializeSnippyly: ",t),kr("Error in initializeSnippyly: ",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),kr("Error in checkToEnableUpgradeButton: ",t)}},this.getCustomerMetadata=async()=>{try{let t=(()=>{try{const t=hr(Dt);return t?"false"===t?JSON.parse(JSON.stringify(Ut)):JSON.parse(t):null}catch(t){return console.warn("Error in getCustomerMetadataFromStorage: ",t),kr("Error in getCustomerMetadataFromStorage: ",t),null}})();return t||(t=await(async t=>{try{const e=Ni(Cr,Kt,{timeout:12e5}),i=await e({apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getCustomerMetadata: ",t),null}})(this.apiKey),yr(t)),t}catch(t){console.warn("Error in getCustomerMetadata: ",t),kr("Error in getCustomerMetadata: ",t)}},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.customBranding)||void 0===e?void 0:e.logo)||void 0===i?void 0:i.logoMark,v=null===(s=null===(n=null===(o=null==Pt?void 0:Ut)||void 0===o?void 0:o.customBranding)||void 0===n?void 0:n.logo)||void 0===s?void 0:s.logoMark,m=null===(l=null===(a=null===(r=this.customerMetadata)||void 0===r?void 0:r.customBranding)||void 0===a?void 0:a.logo)||void 0===l?void 0:l.wordMark,g=null===(h=null===(d=null===(c=null==Pt?void 0:Ut)||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==m?void 0:m.lightUrl)||(null==m?void 0:m.darkUrl)||(null==g?void 0:g.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==m?void 0:m.darkUrl)||(null==m?void 0:m.lightUrl)||(null==g?void 0:g.darkUrl)}}catch(t){console.warn("Error in setLogos: ",t),kr("Error in setLogos: ",t)}},this.getLogoMark=()=>{var t;try{return(null===(t=this.logoMark)||void 0===t?void 0:t.includes("<svg"))?D`
|
|
2467
|
+
class Dr extends lt{constructor(t){if(super(t),this.it=$,t.type!==rt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===$||null==t)return this.ft=void 0,this.it=t;if(t===F)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:[]}}}Dr.directiveName="unsafeHTML",Dr.resultType=1;const Fr=at(Dr);var $r=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 jr extends X{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=true,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.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.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),kr("Error in onApiKeyChange: ",t)}},this.checkCustomLoginEnabled=async()=>{var t;try{const e=await(t=>{const e={apiKey:t};return Ni(Cr,qt,{timeout:12e5})(e)})(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),kr("Error in checkCustomLoginEnabled: ",t)}},this.loginWithCustomUser=()=>{try{this.customLoginEnabled?(ur(ft),this.loadPlugin&&this.documentId&&this.identifySnippyly()):console.warn("Identify call not allowed.")}catch(t){console.warn("Error in loginWithCustomUser: ",t),kr("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),kr("Error in addWindowClickEventListener: ",t)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t),kr("Error in removeWindowClickEventListener: ",t)}},this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(t){console.warn("Error in setWindowEventListner: ",t),kr("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),kr("Error in urlChangeListener: ",t)}},this.checkUrl=()=>{try{this.setInviteUrl();const t=new URL(document.location),e=t.searchParams;if((null==e?void 0:e.has(xt))&&!hr(xt)?this.showOnboardingModal=!0:this.showOnboardingModal=!1,null==e?void 0:e.has(Et))if(hr(Et,!1,"sessionStorage")){this.showLiveDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Et),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(St))if(hr(St,!1)){this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(St),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(gt)||e.has("snippyly_google_token")){if(e.has(gt)){const t=decodeURIComponent(e.get(gt)),i=mr(t,Ht,Bt),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=vr(e,Ht,Bt);dr(ft,i,!0),ur(Mt)}}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,dr(mt,JSON.stringify(i),!0)}e.delete(gt),e.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}e.has(ht)?(dr(ht,"true",!1),ur(ut),e.delete(ht),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(ut)||hr(ht,!1)&&this.loadPluginUI(),e.has(ut)?(dr(ut,"true",!1),ur(ht),e.delete(ut),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(ht)||hr(ut,!1)&&this.loadPluginUI(),this.setVersionInUrl()}catch(t){console.warn("Error in checkUrl: ",t),kr("Error in checkUrl: ",t)}},this.setInviteUrl=()=>{try{const t=new URL(document.location);t.searchParams.has(ht)||t.searchParams.set(ht,"true"),this.inviteUrl=t.toString()}catch(t){console.warn("Error in setInviteUrl: ",t),kr("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&&dr(Ct,this.projectVersion,!1,"sessionStorage")}else{const t=new URL(document.location).searchParams;(t.has(ht)||t.has(ut))&&t.has(bt)&&(dr(yt,bt,!1,"sessionStorage"),this.projectVersion=t.get(bt),this.projectVersion&&dr(Ct,this.projectVersion,!1,"sessionStorage"))}}catch(t){console.warn("Error in detectVersion: ",t),kr("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||hr(yt,!1,"sessionStorage"),e=this.projectVersion||hr(Ct,!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),kr("Error in setVersionInUrl: ",t)}},this.loadPluginUI=async()=>{var t,e,i,o,n,s,r;try{if(!this.apiKey)return;if(!this.projectId)return;if(this.loadPlugin)return this.generateLocation(),void this.setLocation();if(this.toolbarEnabledApiCalled||await this.detectToolbarEnabled(),!this.toolbarEnabled)return;const a=gr();if(a&&!(null==a?void 0:a.isAnonymous)&&(this.loading=!0),null===(t=this.getCustomerMetadata())||void 0===t||t.then((t=>{this.customerMetadata=t})).catch((t=>{console.warn("Error in getCustomerMetadata: ",t),kr("Error in getCustomerMetadata: ",t)})),cr(Tt)&&(this.isPasswordValid=cr(Tt)),hr(_t,!0)&&hr(It,!0)&&hr(Nt,!0)?(this.guestMode="true"===hr(_t,!0),this.allowGuestModeSignIn="true"===hr(It,!0),this.passwordProtected="true"===hr(Nt,!0)):(this.projectConfig=await(async(t,e)=>{var i;try{const o=Ni(Cr,Qt,{timeout:12e5}),n=await o({apiKey:t,projectId:e});return null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.data}catch(t){return console.warn("Error in getProjectConfig: ",t),null}})(this.apiKey,this.projectId),this.guestMode=!!(null===(e=this.projectConfig)||void 0===e?void 0:e.guestMode)||this.guestMode,this.allowGuestModeSignIn=!!(null===(o=null===(i=this.projectConfig)||void 0===i?void 0:i.guestModeConfig)||void 0===o?void 0:o.allowSignIn),(null===(n=this.projectConfig)||void 0===n?void 0:n.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(r=null===(s=this.projectConfig)||void 0===s?void 0:s.passwordProtected)||void 0===r?void 0:r.enabled),dr(_t,this.guestMode+"",!0),dr(It,this.allowGuestModeSignIn+"",!0),dr(Nt,this.passwordProtected+"",!0)),this.loadPlugin=!0,!document.querySelector(jt.VELT_COMMENTS)){const t=document.createElement(jt.VELT_COMMENTS);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(jt.VELT_CURSOR)){const t=document.createElement(jt.VELT_CURSOR);window.document.body.appendChild(t)}if(!document.querySelector(jt.VELT_HUDDLE)){const t=document.createElement(jt.VELT_HUDDLE);window.document.body.appendChild(t)}if(!document.querySelector(jt.VELT_RECORDER_NOTES)){const t=document.createElement(jt.VELT_RECORDER_NOTES);window.document.body.appendChild(t)}if(!document.querySelector(jt.VELT_RECORDER_CONTROL_PANEL)){const t=document.createElement(jt.VELT_RECORDER_CONTROL_PANEL);window.document.body.appendChild(t)}if(!document.querySelector(jt.VELT_ARROWS)){const t=document.createElement(jt.VELT_ARROWS);window.document.body.appendChild(t)}this.initializeSnippyly()}catch(t){this.loading=!1,console.warn("Error in loadPluginUI: ",t),kr("Error in loadPluginUI: ",t)}},this.initializeSnippyly=async()=>{var t,e,o,n,s,r,a,l,c,d,h,u,p,v,m,g,f,w,y,C;try{if(await i(this.apiKey,{options:{develop:this.staging,version:this.staging?dt:"latest",velt:!0}}),!window.Snippyly)return;if(this.autoTranslation&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.enableAutoTranslation)&&(null===Snippyly||void 0===Snippyly||Snippyly.enableAutoTranslation()),!document.querySelector(jt.VELT_COMMENTS_SIDEBAR)){const t=document.createElement(jt.VELT_COMMENTS_SIDEBAR);t.setAttribute(Vt.ENABLE_URL_NAVIGATION,"true"),t.setAttribute(Vt.CURRENT_LOCATION_SUFFIX,"true"),window.document.body.appendChild(t)}if(Snippyly){null===Snippyly||void 0===Snippyly||Snippyly.sf(!0);try{(null===window||void 0===window?void 0:window.onSnippylyLoad)&&(null===window||void 0===window||window.onSnippylyLoad(Snippyly))}catch(t){}document.body.style.setProperty("--velt-default-font-family","'Poppins', sans-serif"),(()=>{try{if(!document.getElementById("superflowFontLink1")){const t=document.createElement("link");t.rel="preconnect",t.href="https://fonts.googleapis.com",t.id="superflowFontLink1",document.head.appendChild(t)}if(!document.getElementById("superflowFontLink2")){const t=document.createElement("link");t.rel="preconnect",t.href="https://fonts.gstatic.com",t.crossOrigin="anonymous",t.id="superflowFontLink2",document.head.appendChild(t)}if(!document.getElementById("superflowFontLink3")){const t=document.createElement("link");t.rel="stylesheet",t.href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap",t.id="superflowFontLink3",document.head.appendChild(t)}}catch(t){console.warn("Error in loadPoppinsFont: ",t),kr("Error in loadPoppinsFont: ",t)}})()}Snippyly&&Er({sdkVersion:null===Snippyly||void 0===Snippyly?void 0:Snippyly.version,sdkType:"client"}),this.documentId=ar(lr(window.location.origin))+"",this.projectId&&(this.documentId=this.projectId+""),await(null===Snippyly||void 0===Snippyly?void 0:Snippyly.setDocumentId(this.documentId+""));const b=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId();if(Er({documentId:b,clientDocumentId:this.documentId}),this.generateLocation(),this.setLocation(),this.commentElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCommentElement(),this.contactElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getContactElement(),this.rewriterElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getRewriterElement(),this.presenceElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getPresenceElement(),this.commentElement){this.commentElement.enableTextComments(!0),this.customLoginEnabledLocally||this.commentElement.enableSignInButton(!0),this.commentElement.enableAttachments(!0),(null===(t=this.commentElement)||void 0===t?void 0:t.showScreenSizeInfo)&&this.commentElement.showScreenSizeInfo(!0),(null===(e=this.commentElement)||void 0===e?void 0:e.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&&!hr(Lt)&&(this.allowGuestModeSignIn?this.openGuestModeSignInModal():this.openGuestModeNameModel(),dr(Lt,"true"),this.showModalOnceCommentIsModeIsOff=!1),this.addCommentCount>=5&&!this.showGuestModeSignInModal&&!hr(Ot,!1,"sessionStorage")&&(this.showGuestModeSignInBanner(),dr(Ot,"true",!1,"sessionStorage"),this.showModalOnceCommentIsModeIsOff=!1))})),(null===(o=this.commentElement)||void 0===o?void 0:o.enableOrphanComments)&&this.commentElement.enableOrphanComments(),(null===(n=this.commentElement)||void 0===n?void 0:n.enableAutoCategorize)&&this.commentElement.enableAutoCategorize(),(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 i=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;i&&"object"==typeof i&&(null===(a=this.commentElement)||void 0===a?void 0:a.setCustomStatus)&&this.commentElement.setCustomStatus(i),(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()}this.selectionElement=Snippyly.getSelectionElement(),this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.rewriterElement&&(null===(v=this.rewriterElement)||void 0===v||v.enableRewriter()),this.presenceElement&&(null===(m=this.presenceElement)||void 0===m?void 0:m.enableFlockMode)&&(null===(g=this.presenceElement)||void 0===g||g.enableFlockMode(!0)),null===(f=null===Snippyly||void 0===Snippyly?void 0:Snippyly.docService)||void 0===f||f.getDocumentMetadata$().subscribe((t=>{const e=(null==t?void 0:t.versions)?Object.values(null==t?void 0:t.versions):[],i=new URL(document.location).searchParams.get("version");if(i){const t=e.find((t=>t.versionId===i));t&&(this.version={id:t.versionId,name:t.versionName||t.versionId},this.setLocation())}})),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getViewsElement)&&(this.viewsElement=Snippyly.getViewsElement()),(null===(w=this.viewsElement)||void 0===w?void 0:w.getUniqueViewsByUser)&&(null===(C=null===(y=this.viewsElement)||void 0===y?void 0:y.getUniqueViewsByUser())||void 0===C||C.subscribe((t=>{this.totalViews=t}))),this.identifySnippyly()}catch(t){this.loading=!1,console.warn("Error in initializeSnippyly: ",t),kr("Error in initializeSnippyly: ",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),kr("Error in checkToEnableUpgradeButton: ",t)}},this.getCustomerMetadata=async()=>{try{let t=(()=>{try{const t=hr(Dt);return t?"false"===t?JSON.parse(JSON.stringify(Ut)):JSON.parse(t):null}catch(t){return console.warn("Error in getCustomerMetadataFromStorage: ",t),kr("Error in getCustomerMetadataFromStorage: ",t),null}})();return t||(t=await(async t=>{try{const e=Ni(Cr,Kt,{timeout:12e5}),i=await e({apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getCustomerMetadata: ",t),null}})(this.apiKey),yr(t)),t}catch(t){console.warn("Error in getCustomerMetadata: ",t),kr("Error in getCustomerMetadata: ",t)}},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.customBranding)||void 0===e?void 0:e.logo)||void 0===i?void 0:i.logoMark,v=null===(s=null===(n=null===(o=null==Pt?void 0:Ut)||void 0===o?void 0:o.customBranding)||void 0===n?void 0:n.logo)||void 0===s?void 0:s.logoMark,m=null===(l=null===(a=null===(r=this.customerMetadata)||void 0===r?void 0:r.customBranding)||void 0===a?void 0:a.logo)||void 0===l?void 0:l.wordMark,g=null===(h=null===(d=null===(c=null==Pt?void 0:Ut)||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==m?void 0:m.lightUrl)||(null==m?void 0:m.darkUrl)||(null==g?void 0:g.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==m?void 0:m.darkUrl)||(null==m?void 0:m.lightUrl)||(null==g?void 0:g.darkUrl)}}catch(t){console.warn("Error in setLogos: ",t),kr("Error in setLogos: ",t)}},this.getLogoMark=()=>{var t;try{return(null===(t=this.logoMark)||void 0===t?void 0:t.includes("<svg"))?D`
|
|
2468
2468
|
${Fr(this.logoMark)}
|
|
2469
2469
|
`:D`
|
|
2470
2470
|
<img src=${this.logoMark} />
|
|
@@ -2472,7 +2472,7 @@ class Dr extends lt{constructor(t){if(super(t),this.it=$,t.type!==rt)throw Error
|
|
|
2472
2472
|
${Fr(this.wordMark)}
|
|
2473
2473
|
`:D`
|
|
2474
2474
|
<img src=${this.wordMark} />
|
|
2475
|
-
`}catch(t){return console.warn("Error in getWordMark: ",t),D``}},this.generateLocation=()=>{try{if(this.autoLocation){const t=new URL(document.location).searchParams,e=new URL(document.location);e.searchParams.delete(ht),e.searchParams.delete(ut),e.searchParams.delete(pt),e.searchParams.delete(vt),e.searchParams.delete(xt),e.searchParams.delete(Et);const i=t.get(bt)||this.projectVersion;e.search="";let o=(t=>{try{return t.replace(/#.*$/,"")}catch(e){return console.warn("Error in removeHashFromUrl: ",e),kr("Error in removeHashFromUrl: ",e),t}})(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),kr("Error in generateLocation: ",t)}},this.setLocation=()=>{var t,e,i,o;try{if(this.autoLocation&&window.Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.setLocation)){if(this.version?(this.location||(this.location={}),this.location.version=this.version):this.location&&delete this.location.version,this.previousLocation&&(null===(t=this.previousLocation)||void 0===t?void 0:t.url)===(null===(e=this.location)||void 0===e?void 0:e.url)&&(null===(i=this.previousLocation)||void 0===i?void 0:i.version)===(null===(o=this.location)||void 0===o?void 0:o.version))return;null===Snippyly||void 0===Snippyly||Snippyly.setLocation(JSON.parse(JSON.stringify(this.location))),Er({clientLocation:this.location}),this.previousLocation=JSON.parse(JSON.stringify(this.location))}}catch(t){console.warn("Error in setLocation: ",t),kr("Error in setLocation: ",t)}},this.identifySnippyly=async()=>{var t,e;let i="";try{this.invalidApiKey=!1;let e,o={name:"Default User",email:"default@usesuperflow.com",userId:"default",isAnonymous:!0};if(e=this.customLoginEnabled&&this.providedUser?this.providedUser:gr(),(null==e?void 0:e.email)&&(o=e),o.isAnonymous?delete o.groupId:o.groupId=Snippyly.getDocumentId()+"",this.customLoginEnabledLocally||(null===(t=null==o?void 0:o.contacts)||void 0===t?void 0:t.length)&&(o.contacts=[]),i=null==o?void 0:o.email,(null==o?void 0:o.isAnonymous)&&this.projectId&&this.guestMode){const t=wr();t&&(o=JSON.parse(JSON.stringify(t)))}(null==o?void 0:o.isAnonymous)||(this.loading=!0);const n=await(async(t,e)=>{var i,o;try{const n=Ni(Cr,Jt,{timeout:12e5}),s=await n({apiKey:t,userId:e});return null===(o=null===(i=null==s?void 0:s.data)||void 0===i?void 0:i.data)||void 0===o?void 0:o.token}catch(t){return console.warn("Error in generateSuperflowAuthToken: ",t),null}})(this.apiKey,null==o?void 0:o.userId),s={};n&&(s.authToken=n);const r=await Snippyly.identify(o,s);Sr(JSON.parse(JSON.stringify(r||{}))),(null==o?void 0:o.isAnonymous)||(this.snippylyUser=JSON.parse(JSON.stringify(o)));const a=JSON.parse(JSON.stringify(r||{}));(null==a?void 0:a.userSnippylyId)&&!(null==a?void 0:a.isGuest)&&this.checkToMigrateGuestUser(a),Snippyly.getUserRole$().subscribe((t=>{var e;this.loading=!1,this.snippylyUserRole=t,this.snippylyUserRole||Mr(Or.Events.USER_EMAIL_NOT_WHITELISTED),null===(e=this.commentElement)||void 0===e||e.enablePriority()})),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getFeaturesAccessLevelIam$)&&this.subscriptions.push(Snippyly.getFeaturesAccessLevelIam$().subscribe((async t=>{var e,i,o,n,s,r,a,l;this.allFeatureDisabled=!!(null===(e=null==t?void 0:t.all)||void 0===e?void 0:e.disabled),this.allFeatureRestricted=!!(null===(i=null==t?void 0:t.all)||void 0===i?void 0:i.restricted),this.guestMode=!!(null===(o=null==t?void 0:t.all)||void 0===o?void 0:o.guestMode),this.allowGuestModeSignIn=!!(null===(s=null===(n=null==t?void 0:t.all)||void 0===n?void 0:n.guestModeConfig)||void 0===s?void 0:s.allowSignIn),this.guestMode&&Mr(Or.Events.GUEST_MODE_PRESENT),(null===(r=null==t?void 0:t.all)||void 0===r?void 0:r.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(l=null===(a=null==t?void 0:t.all)||void 0===a?void 0:a.passwordProtected)||void 0===l?void 0:l.enabled),Velt&&(t&&this.passwordProtected&&!this.isPasswordValid?Velt.disableFeatures(["area","arrow","audioHuddle","cursor","huddle","liveStateSync","presence","tag","recorder","comment"]):Velt.disableFeatures([])),dr(_t,this.guestMode+"",!0),dr(It,this.allowGuestModeSignIn+"",!0),dr(Nt,this.passwordProtected+"",!0)}),(t=>{this.loading=!1,console.warn("Error in getFeaturesAccessLevelIam$: ",t),kr("Error in getFeaturesAccessLevelIam$: ",t)}))),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.isPlanExpired$)&&(null===Snippyly||void 0===Snippyly||Snippyly.isPlanExpired$().subscribe((t=>{this.isPlanExpired=t}),(t=>{this.isPlanExpired=!1,console.warn("Error in isPlanExpired$: ",t),kr("Error in isPlanExpired$: ",t)}))),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCustomerMetadata$)&&(null===Snippyly||void 0===Snippyly||Snippyly.getCustomerMetadata$().subscribe((t=>{yr(t),t&&(this.customerMetadata=t)}),(t=>{console.warn("Error in getCustomerMetadata$: ",t),kr("Error in getCustomerMetadata$: ",t)}))),Er({clientUserId:null==o?void 0:o.userId});try{(t=>{var e,i,o,n,s,r,a,l,c,d,h,u;const p={properties:{apiKey:null!==(e=null==xr?void 0:xr.apiKey)&&void 0!==e?e:"",name:null!==(i=null==t?void 0:t.name)&&void 0!==i?i:"",firstName:(null==t?void 0:t.name)?null===(o=null==t?void 0:t.name)||void 0===o?void 0:o.split(" ")[0]:"",lastName:(null==t?void 0:t.name)?null===(n=null==t?void 0:t.name)||void 0===n?void 0:n.split(" ")[1]:"",email:null!==(s=null==t?void 0:t.email)&&void 0!==s?s:"",clientUserId:null!==(r=null==t?void 0:t.userId)&&void 0!==r?r:"",snippylyUserId:null!==(a=null==t?void 0:t.userSnippylyId)&&void 0!==a?a:"",groupId:null!==(l=null==t?void 0:t.groupId)&&void 0!==l?l:"",isOwner:"",plan:"",sdkVersion:null!==(c=null==xr?void 0:xr.sdkVersion)&&void 0!==c?c:"",sdkType:null!==(d=null==xr?void 0:xr.sdkType)&&void 0!==d?d:"",sourcePlatform:null!==(h=null==xr?void 0:xr.sourcePlatform)&&void 0!==h?h:"",website:null===(u=null===window||void 0===window?void 0:window.location)||void 0===u?void 0:u.href},context:{userAgent:null===navigator||void 0===navigator?void 0:navigator.userAgent},userId:null==t?void 0:t.userSnippylyId,sf:!0};_r("identify",p)})(o)}catch(t){console.warn("Error in trackIdentifyEvent: ",t)}this.getComments(),this.checkGlobalUserContact(),setTimeout((()=>{hr(kt)||(this.showTourCommentTooltip=!0)}),2e3)}catch(t){if(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,Mr(Or.Events.DOMAIN_NOT_WHITELISTED),this.projectId&&(async(t,e)=>{try{const i=Ni(Cr,Gt,{timeout:12e5});await i({apiKey:t,projectId:e})}catch(t){console.warn("Error in checkDomainWhitelisted: ",t)}})(this.apiKey,this.projectId);if(new URL(document.location).searchParams.has(xt))this.isSigningInUserAdmin=!0;else if(hr(Mt))this.isSigningInUserAdmin="true"===hr(Mt,!0);else{const t=await(async(t,e,i)=>{try{const o=Ni(Cr,Wt,{timeout:12e5}),n=await o({apiKey:t,projectId:e,email:i});return null==n?void 0:n.data}catch(t){return console.warn("Error in iam: ",t),null}})(this.apiKey,this.projectId||"",i);this.isSigningInUserAdmin=!!(null==t?void 0:t.isAdmin),dr(Mt,this.isSigningInUserAdmin+"",!0)}}console.warn("Error in identifySnippyly: ",t),kr("Error in identifySnippyly: ",t)}},this.checkToMigrateGuestUser=async t=>{try{const e=wr(!1);e&&(await Nr(this.apiKey,this.projectId||"",e,t,!0),ur(wt))}catch(t){console.warn("Error in checkToMigrationGuestUser: ",t),kr("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)}))})))}catch(t){console.warn("Error in getComments: ",t),kr("Error in getComments: ",t)}},this.checkGlobalUserContact=()=>{try{this.contactElement&&this.contactElement.isUserGlobalContact().subscribe((t=>{this.isUserGlobalContact=t}))}catch(t){console.warn("Error in checkGlobalUserContact: ",t),kr("Error in checkGlobalUserContact: ",t)}},this.toggleSnippylyPluginToolbar=()=>{try{this.expanded=!this.expanded,this.expanded?Mr(Or.Events.TOOLBAR_EXPANDED):Mr(Or.Events.TOOLBAR_COLLAPSED)}catch(t){console.warn("Error in toggleSnippylyPluginToolbar: ",t),kr("Error in toggleSnippylyPluginToolbar: ",t)}},this.togglePrivateCommentMode=()=>{try{this.commentElement&&(this.privateCommentModeEnabled?(this.commentElement.disablePrivateCommentMode&&this.commentElement.disablePrivateCommentMode(),this.privateCommentModeEnabled=!1,Mr(Or.Events.PRIVATE_MODE_DISABLED)):(this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode(),this.privateCommentModeEnabled=!0,Mr(Or.Events.PRIVATE_MODE_ENABLED)))}catch(t){console.warn("Error in togglePrivateCommentMode: ",t),kr("Error in togglePrivateCommentMode: ",t)}},this.loginWithGoogle=()=>{try{if(Mr(Or.Events.SIGNIN_CLICKED),this.loading||this.customLoginEnabledLocally)return;window.open(this.signInUrl,"_self")}catch(t){console.warn("Error in loginWithGoogle: ",t),kr("Error in loginWithGoogle: ",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=vr(e,Ht,Bt),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),kr("Error in getQRCode: ",t)}},this.toggleQRCodeVisibility=async()=>{try{Mr(Or.Events.OPEN_MOBILE_CLICKED),this.showQrCode=!this.showQrCode,this.showQrCode&&!this.qrCode&&await this.getQRCode()}catch(t){console.warn("Error in toggleQRCodeVisibility: ",t),kr("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.removeSnippyly=async()=>{try{Mr(Or.Events.EXIT_REVIEW_MODE_CLICKED),this.exitReviewModeCalled=!0,ur(ht),ur(ut),ur(pt),ur(yt,"sessionStorage"),ur(Ct,"sessionStorage");const t=new URL(document.location),e=t.searchParams;e.delete(pt),e.delete(ht),e.delete(ut),this.projectVersionKey&&e.delete(this.projectVersionKey),e.delete(bt),e.delete(xt),e.delete(Et),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),kr("Error in removeSnippyly: ",t)}},this.signOutUser=async()=>{try{Mr(Or.Events.SIGNOUT_CLICKED),this.subscriptions.forEach((t=>{t&&t.unsubscribe&&(null==t||t.unsubscribe())})),await Snippyly.signOutUser(),ur(mt),ur(ft),ur(Mt),this.snippylyUser=void 0,window.open(this.signOutUrl,"_self")}catch(t){console.warn("Error in signOutUser: ",t),kr("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),kr("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),kr("Error in copyLink: ",t)}},this.goToAdminPortal=()=>{try{let t=`${zt}`;if(Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId)){const e=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId();e&&(t=`${zt}/dashboard/project/comment/${this.apiKey}/${e}`)}Mr(Or.Events.VIEW_PROJECT_CLICKED),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortal: ",t),kr("Error in goToAdminPortal: ",t)}},this.goToAdminPortalDashboard=()=>{try{let t=`${zt}`;if(Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId)){(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId())&&(t=`${zt}/dashboard`)}window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortalDashboard: ",t),kr("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),kr("Error in joinCommunity: ",t)}},this.onboardingNextClick=()=>{try{this.showOnboardingModal=!1,dr(xt,"true");const t=new URL(document.location);t.searchParams.delete(xt),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onboardingNextClick: ",t),kr("Error in onboardingNextClick: ",t)}},this.onLiveDemoModalNextClick=()=>{try{this.showLiveDemoModal=!1,dr(Et,"true",!1,"sessionStorage");const t=new URL(document.location);t.searchParams.delete(Et),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onLiveDemoModalNextClick: ",t),kr("Error in onLiveDemoModalNextClick: ",t)}},this.onFigmaDemoModalNextClick=()=>{try{this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(St),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onFigmaDemoModalNextClick: ",t),kr("Error in onFigmaDemoModalNextClick: ",t)}},this.onUpgradePlanClick=()=>{try{window.open("https://superflow-portal-staging-2023.web.app/dashboard/billing","_blank")}catch(t){console.warn("Error in onUpgradePlanClick: ",t),kr("Error in onUpgradePlanClick: ",t)}},this.onTourCommentTooltipClick=()=>{try{this.showTourCommentTooltip=!1,dr(kt,"true")}catch(t){console.warn("Error in onTourCommentTooltipClick: ",t),kr("Error in onTourCommentTooltipClick: ",t)}},this.onGuestModeChipSignInButtonClick=()=>{try{Mr(Or.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeChipSignInButtonClick: ",t),kr("Error in onGuestModeChipSignInButtonClick: ",t)}},this.openGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!0,Mr(Or.Events.GUEST_MODE_SIGN_IN_DIALOG_SHOWN)}catch(t){console.warn("Error in openGuestModeSignInModal: ",t),kr("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),kr("Error in closeGuestModeSignInModal: ",t)}},this.onGuestModeSignInModalSignInButtonClick=()=>{try{Mr(Or.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeSignInModalSignInButtonClick: ",t),kr("Error in onGuestModeSignInModalSignInButtonClick: ",t)}},this.openGuestModeNameModel=t=>{try{t&&(t.stopPropagation(),t.preventDefault()),this.skipGuestNameModal||(this.showGuestModeNameModal=!0,Mr(Or.Events.GUEST_MODE_NAME_NUDGE_SHOWN))}catch(t){console.warn("Error in openGuestModeNameModel: ",t),kr("Error in openGuestModeNameModel: ",t)}},this.closeGuestModeNameModel=()=>{try{this.showGuestModeNameModal=!1}catch(t){console.warn("Error in closeGuestModeNameModel: ",t),kr("Error in closeGuestModeNameModel: ",t)}},this.onGuestModeNameModalSkipButtonClick=()=>{try{Mr(Or.Events.GUEST_MODE_SKIP_BUTTON_CLICKED),this.showGuestModeNameModal=!1}catch(t){console.warn("Error in onGuestModeNameModalSkipButtonClick: ",t),kr("Error in onGuestModeNameModalSkipButtonClick: ",t)}},this.onPasswordProtectedModalCloseButtonClick=()=>{try{Mr(Or.Events.PASSWORD_PROTECTED_MODAL_CLOSE_BUTTON_CLICKED),this.showPasswordProtectedModal=!1,this.password="",this.showInvalidPassword=!1}catch(t){console.warn("Error in onPasswordProtectedModalCloseButtonClick: ",t),kr("Error in onPasswordProtectedModalCloseButtonClick: ",t)}},this.onPasswordProtectedModalOpenButtonClick=()=>{try{Mr(Or.Events.PASSWORD_PROTECTED_MODAL_OPEN_BUTTON_CLICKED),this.showPasswordProtectedModal=!0}catch(t){console.warn("Error in onPasswordProtectedModalOpenButtonClick: ",t),kr("Error in onPasswordProtectedModalOpenButtonClick: ",t)}},this.showGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!0,Mr(Or.Events.GUEST_MODE_SIGN_IN_NUDGE_SHOWN)}catch(t){console.warn("Error in showGuestModeSignInBanner: ",t),kr("Error in showGuestModeSignInBanner: ",t)}},this.hideGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!1}catch(t){console.warn("Error in hideGuestModeSignInBanner: ",t),kr("Error in hideGuestModeSignInBanner: ",t)}},this.onGuestModeBannerSignInButtonClick=()=>{try{Mr(Or.Events.GUEST_MODE_SIGN_IN_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeBannerSignInButtonClick: ",t),kr("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=wr();if(e){const t=JSON.parse(JSON.stringify(e));e.name=this.guestUserNameInput,e.photoUrl=null,this.guestUserNameUpdateLoading=!0,(t=>{try{const e=JSON.stringify(t),i=vr(e,Ht,Bt);dr(wt,i,!0)}catch(t){console.warn("Error in updateGuestUser: ",t),kr("Error in updateGuestUser: ",t)}})(e),await Snippyly.identify(e),this.snippylyUser=JSON.parse(JSON.stringify(e)),await Nr(this.apiKey,this.projectId||"",t,e),this.showGuestModeNameModal=!1,this.guestUserNameUpdated=!0,this.guestUserNameUpdateLoading=!1,dr(At,"true"),Mr(Or.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),kr("Error in updateGuestUserName: ",t)}},this.submitPassword=async()=>{var t;try{if(Mr(Or.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(async(t,e,i)=>{var o;try{const n=Ni(Cr,Xt,{timeout:12e5}),s=await n({apiKey:t,projectId:e,password:i});return null===(o=null==s?void 0:s.data)||void 0===o?void 0:o.data}catch(t){return console.warn("Error in validatePassword: ",t),null}})(this.apiKey,this.projectId,this.password),function(t,e){try{const i="object"==typeof e?JSON.stringify(e):e;localStorage.setItem(t,i)}catch(t){console.warn("Error in setLocalStorage: ",t)}}(Tt,this.isPasswordValid),this.isPasswordValid?(this.password="",this.onPasswordProtectedModalCloseButtonClick(),this.showInvalidPassword=!1,Velt&&Velt.disableFeatures([]),Mr(Or.Events.REVIEW_PASSWORD_ACCEPTED)):(this.showInvalidPassword=!0,Mr(Or.Events.REVIEW_PASSWORD_REJECTED)),this.validatingPasswordLoading=!1}catch(t){console.warn("Error in submitPassword: ",t),kr("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 Nr(this.apiKey,this.projectId||"",e,i),await Snippyly.updateUser(i),this.snippylyUser=JSON.parse(JSON.stringify(i));const o=gr();o.name=i.name;const n=JSON.stringify(o),s=vr(n,Ht,Bt);dr(ft,s,!0),this.guestUserNameUpdateLoading=!1,this.guestUserNameInput="",this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateUserName: ",t),kr("Error in updateUserName: ",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),kr("Error in disableAddCommentMode: ",t)}},this.disableCommentModeButton=()=>{try{return this.addCommentMode?D`
|
|
2475
|
+
`}catch(t){return console.warn("Error in getWordMark: ",t),D``}},this.generateLocation=()=>{try{if(this.autoLocation){const t=new URL(document.location).searchParams,e=new URL(document.location);e.searchParams.delete(ht),e.searchParams.delete(ut),e.searchParams.delete(pt),e.searchParams.delete(vt),e.searchParams.delete(xt),e.searchParams.delete(Et);const i=t.get(bt)||this.projectVersion;e.search="";let o=(t=>{try{return t.replace(/#.*$/,"")}catch(e){return console.warn("Error in removeHashFromUrl: ",e),kr("Error in removeHashFromUrl: ",e),t}})(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),kr("Error in generateLocation: ",t)}},this.setLocation=()=>{var t,e,i,o;try{if(this.autoLocation&&window.Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.setLocation)){if(this.version?(this.location||(this.location={}),this.location.version=this.version):this.location&&delete this.location.version,this.previousLocation&&(null===(t=this.previousLocation)||void 0===t?void 0:t.url)===(null===(e=this.location)||void 0===e?void 0:e.url)&&(null===(i=this.previousLocation)||void 0===i?void 0:i.version)===(null===(o=this.location)||void 0===o?void 0:o.version))return;null===Snippyly||void 0===Snippyly||Snippyly.setLocation(JSON.parse(JSON.stringify(this.location))),Er({clientLocation:this.location}),this.previousLocation=JSON.parse(JSON.stringify(this.location))}}catch(t){console.warn("Error in setLocation: ",t),kr("Error in setLocation: ",t)}},this.identifySnippyly=async()=>{var t,e;let i="";try{this.invalidApiKey=!1;let e,o={name:"Default User",email:"default@usesuperflow.com",userId:"default",isAnonymous:!0};if(e=this.customLoginEnabled&&this.providedUser?this.providedUser:gr(),(null==e?void 0:e.email)&&(o=e),o.isAnonymous?delete o.groupId:o.groupId=Snippyly.getDocumentId()+"",this.customLoginEnabledLocally||(null===(t=null==o?void 0:o.contacts)||void 0===t?void 0:t.length)&&(o.contacts=[]),i=null==o?void 0:o.email,(null==o?void 0:o.isAnonymous)&&this.projectId&&this.guestMode){const t=wr();t&&(o=JSON.parse(JSON.stringify(t)))}(null==o?void 0:o.isAnonymous)||(this.loading=!0);const n=await(async(t,e)=>{var i,o;try{const n=Ni(Cr,Jt,{timeout:12e5}),s=await n({apiKey:t,userId:e});return null===(o=null===(i=null==s?void 0:s.data)||void 0===i?void 0:i.data)||void 0===o?void 0:o.token}catch(t){return console.warn("Error in generateSuperflowAuthToken: ",t),null}})(this.apiKey,null==o?void 0:o.userId),s={};n&&(s.authToken=n);const r=await Snippyly.identify(o,s);Sr(JSON.parse(JSON.stringify(r||{}))),(null==o?void 0:o.isAnonymous)||(this.snippylyUser=JSON.parse(JSON.stringify(o)));const a=JSON.parse(JSON.stringify(r||{}));(null==a?void 0:a.userSnippylyId)&&!(null==a?void 0:a.isGuest)&&this.checkToMigrateGuestUser(a),Snippyly.getUserRole$().subscribe((t=>{var e;this.loading=!1,this.snippylyUserRole=t,this.snippylyUserRole||Mr(Or.Events.USER_EMAIL_NOT_WHITELISTED),null===(e=this.commentElement)||void 0===e||e.enablePriority()})),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getFeaturesAccessLevelIam$)&&this.subscriptions.push(Snippyly.getFeaturesAccessLevelIam$().subscribe((async t=>{var e,i,o,n,s,r,a,l;this.allFeatureDisabled=!!(null===(e=null==t?void 0:t.all)||void 0===e?void 0:e.disabled),this.allFeatureRestricted=!!(null===(i=null==t?void 0:t.all)||void 0===i?void 0:i.restricted),this.guestMode=!!(null===(o=null==t?void 0:t.all)||void 0===o?void 0:o.guestMode),this.allowGuestModeSignIn=!!(null===(s=null===(n=null==t?void 0:t.all)||void 0===n?void 0:n.guestModeConfig)||void 0===s?void 0:s.allowSignIn),this.guestMode&&Mr(Or.Events.GUEST_MODE_PRESENT),(null===(r=null==t?void 0:t.all)||void 0===r?void 0:r.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(l=null===(a=null==t?void 0:t.all)||void 0===a?void 0:a.passwordProtected)||void 0===l?void 0:l.enabled),Velt&&(t&&this.passwordProtected&&!this.isPasswordValid?Velt.disableFeatures(["area","arrow","audioHuddle","cursor","huddle","liveStateSync","presence","tag","recorder","comment"]):Velt.disableFeatures([])),dr(_t,this.guestMode+"",!0),dr(It,this.allowGuestModeSignIn+"",!0),dr(Nt,this.passwordProtected+"",!0)}),(t=>{this.loading=!1,console.warn("Error in getFeaturesAccessLevelIam$: ",t),kr("Error in getFeaturesAccessLevelIam$: ",t)}))),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.isPlanExpired$)&&(null===Snippyly||void 0===Snippyly||Snippyly.isPlanExpired$().subscribe((t=>{this.isPlanExpired=t}),(t=>{this.isPlanExpired=!1,console.warn("Error in isPlanExpired$: ",t),kr("Error in isPlanExpired$: ",t)}))),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCustomerMetadata$)&&(null===Snippyly||void 0===Snippyly||Snippyly.getCustomerMetadata$().subscribe((t=>{yr(t),t&&(this.customerMetadata=t)}),(t=>{console.warn("Error in getCustomerMetadata$: ",t),kr("Error in getCustomerMetadata$: ",t)}))),Er({clientUserId:null==o?void 0:o.userId});try{(t=>{var e,i,o,n,s,r,a,l,c,d,h,u;const p={properties:{apiKey:null!==(e=null==xr?void 0:xr.apiKey)&&void 0!==e?e:"",name:null!==(i=null==t?void 0:t.name)&&void 0!==i?i:"",firstName:(null==t?void 0:t.name)?null===(o=null==t?void 0:t.name)||void 0===o?void 0:o.split(" ")[0]:"",lastName:(null==t?void 0:t.name)?null===(n=null==t?void 0:t.name)||void 0===n?void 0:n.split(" ")[1]:"",email:null!==(s=null==t?void 0:t.email)&&void 0!==s?s:"",clientUserId:null!==(r=null==t?void 0:t.userId)&&void 0!==r?r:"",snippylyUserId:null!==(a=null==t?void 0:t.userSnippylyId)&&void 0!==a?a:"",groupId:null!==(l=null==t?void 0:t.groupId)&&void 0!==l?l:"",isOwner:"",plan:"",sdkVersion:null!==(c=null==xr?void 0:xr.sdkVersion)&&void 0!==c?c:"",sdkType:null!==(d=null==xr?void 0:xr.sdkType)&&void 0!==d?d:"",sourcePlatform:null!==(h=null==xr?void 0:xr.sourcePlatform)&&void 0!==h?h:"",website:null===(u=null===window||void 0===window?void 0:window.location)||void 0===u?void 0:u.href},context:{userAgent:null===navigator||void 0===navigator?void 0:navigator.userAgent},userId:null==t?void 0:t.userSnippylyId,sf:!0};_r("identify",p)})(o)}catch(t){console.warn("Error in trackIdentifyEvent: ",t)}this.getComments(),this.checkGlobalUserContact(),setTimeout((()=>{hr(kt)||(this.showTourCommentTooltip=!0)}),2e3)}catch(t){if(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"))){if(this.invalidApiKey=!0,Mr(Or.Events.DOMAIN_NOT_WHITELISTED),this.projectId){const t=await(async(t,e)=>{try{const i=Ni(Cr,Gt,{timeout:12e5});return await i({apiKey:t,projectId:e})}catch(t){console.warn("Error in checkDomainWhitelisted: ",t)}})(this.apiKey,this.projectId);t.refereshPage&&setTimeout((function(){location.reload()}),5e3)}if(new URL(document.location).searchParams.has(xt))this.isSigningInUserAdmin=!0;else if(hr(Mt))this.isSigningInUserAdmin="true"===hr(Mt,!0);else{const t=await(async(t,e,i)=>{try{const o=Ni(Cr,Wt,{timeout:12e5}),n=await o({apiKey:t,projectId:e,email:i});return null==n?void 0:n.data}catch(t){return console.warn("Error in iam: ",t),null}})(this.apiKey,this.projectId||"",i);this.isSigningInUserAdmin=!!(null==t?void 0:t.isAdmin),dr(Mt,this.isSigningInUserAdmin+"",!0)}}console.warn("Error in identifySnippyly: ",t),kr("Error in identifySnippyly: ",t)}},this.checkToMigrateGuestUser=async t=>{try{const e=wr(!1);e&&(await Nr(this.apiKey,this.projectId||"",e,t,!0),ur(wt))}catch(t){console.warn("Error in checkToMigrationGuestUser: ",t),kr("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)}))})))}catch(t){console.warn("Error in getComments: ",t),kr("Error in getComments: ",t)}},this.checkGlobalUserContact=()=>{try{this.contactElement&&this.contactElement.isUserGlobalContact().subscribe((t=>{this.isUserGlobalContact=t}))}catch(t){console.warn("Error in checkGlobalUserContact: ",t),kr("Error in checkGlobalUserContact: ",t)}},this.toggleSnippylyPluginToolbar=()=>{try{this.expanded=!this.expanded,this.expanded?Mr(Or.Events.TOOLBAR_EXPANDED):Mr(Or.Events.TOOLBAR_COLLAPSED)}catch(t){console.warn("Error in toggleSnippylyPluginToolbar: ",t),kr("Error in toggleSnippylyPluginToolbar: ",t)}},this.togglePrivateCommentMode=()=>{try{this.commentElement&&(this.privateCommentModeEnabled?(this.commentElement.disablePrivateCommentMode&&this.commentElement.disablePrivateCommentMode(),this.privateCommentModeEnabled=!1,Mr(Or.Events.PRIVATE_MODE_DISABLED)):(this.commentElement.enablePrivateCommentMode&&this.commentElement.enablePrivateCommentMode(),this.privateCommentModeEnabled=!0,Mr(Or.Events.PRIVATE_MODE_ENABLED)))}catch(t){console.warn("Error in togglePrivateCommentMode: ",t),kr("Error in togglePrivateCommentMode: ",t)}},this.loginWithGoogle=()=>{try{if(Mr(Or.Events.SIGNIN_CLICKED),this.loading||this.customLoginEnabledLocally)return;window.open(this.signInUrl,"_self")}catch(t){console.warn("Error in loginWithGoogle: ",t),kr("Error in loginWithGoogle: ",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=vr(e,Ht,Bt),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),kr("Error in getQRCode: ",t)}},this.toggleQRCodeVisibility=async()=>{try{Mr(Or.Events.OPEN_MOBILE_CLICKED),this.showQrCode=!this.showQrCode,this.showQrCode&&!this.qrCode&&await this.getQRCode()}catch(t){console.warn("Error in toggleQRCodeVisibility: ",t),kr("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.removeSnippyly=async()=>{try{Mr(Or.Events.EXIT_REVIEW_MODE_CLICKED),this.exitReviewModeCalled=!0,ur(ht),ur(ut),ur(pt),ur(yt,"sessionStorage"),ur(Ct,"sessionStorage");const t=new URL(document.location),e=t.searchParams;e.delete(pt),e.delete(ht),e.delete(ut),this.projectVersionKey&&e.delete(this.projectVersionKey),e.delete(bt),e.delete(xt),e.delete(Et),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),kr("Error in removeSnippyly: ",t)}},this.signOutUser=async()=>{try{Mr(Or.Events.SIGNOUT_CLICKED),this.subscriptions.forEach((t=>{t&&t.unsubscribe&&(null==t||t.unsubscribe())})),await Snippyly.signOutUser(),ur(mt),ur(ft),ur(Mt),this.snippylyUser=void 0,window.open(this.signOutUrl,"_self")}catch(t){console.warn("Error in signOutUser: ",t),kr("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),kr("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),kr("Error in copyLink: ",t)}},this.goToAdminPortal=()=>{try{let t=`${zt}`;if(Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId)){const e=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId();e&&(t=`${zt}/dashboard/project/comment/${this.apiKey}/${e}`)}Mr(Or.Events.VIEW_PROJECT_CLICKED),window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortal: ",t),kr("Error in goToAdminPortal: ",t)}},this.goToAdminPortalDashboard=()=>{try{let t=`${zt}`;if(Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId)){(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocumentId())&&(t=`${zt}/dashboard`)}window.open(t,"_blank")}catch(t){console.warn("Error in goToAdminPortalDashboard: ",t),kr("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),kr("Error in joinCommunity: ",t)}},this.onboardingNextClick=()=>{try{this.showOnboardingModal=!1,dr(xt,"true");const t=new URL(document.location);t.searchParams.delete(xt),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onboardingNextClick: ",t),kr("Error in onboardingNextClick: ",t)}},this.onLiveDemoModalNextClick=()=>{try{this.showLiveDemoModal=!1,dr(Et,"true",!1,"sessionStorage");const t=new URL(document.location);t.searchParams.delete(Et),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onLiveDemoModalNextClick: ",t),kr("Error in onLiveDemoModalNextClick: ",t)}},this.onFigmaDemoModalNextClick=()=>{try{this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(St),window.history.replaceState({},document.title,t.href)}catch(t){console.warn("Error in onFigmaDemoModalNextClick: ",t),kr("Error in onFigmaDemoModalNextClick: ",t)}},this.onUpgradePlanClick=()=>{try{window.open("https://superflow-portal-staging-2023.web.app/dashboard/billing","_blank")}catch(t){console.warn("Error in onUpgradePlanClick: ",t),kr("Error in onUpgradePlanClick: ",t)}},this.onTourCommentTooltipClick=()=>{try{this.showTourCommentTooltip=!1,dr(kt,"true")}catch(t){console.warn("Error in onTourCommentTooltipClick: ",t),kr("Error in onTourCommentTooltipClick: ",t)}},this.onGuestModeChipSignInButtonClick=()=>{try{Mr(Or.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeChipSignInButtonClick: ",t),kr("Error in onGuestModeChipSignInButtonClick: ",t)}},this.openGuestModeSignInModal=()=>{try{this.showGuestModeSignInModal=!0,Mr(Or.Events.GUEST_MODE_SIGN_IN_DIALOG_SHOWN)}catch(t){console.warn("Error in openGuestModeSignInModal: ",t),kr("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),kr("Error in closeGuestModeSignInModal: ",t)}},this.onGuestModeSignInModalSignInButtonClick=()=>{try{Mr(Or.Events.GUEST_MODE_SIGN_IN_BUTTON_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeSignInModalSignInButtonClick: ",t),kr("Error in onGuestModeSignInModalSignInButtonClick: ",t)}},this.openGuestModeNameModel=t=>{try{t&&(t.stopPropagation(),t.preventDefault()),this.skipGuestNameModal||(this.showGuestModeNameModal=!0,Mr(Or.Events.GUEST_MODE_NAME_NUDGE_SHOWN))}catch(t){console.warn("Error in openGuestModeNameModel: ",t),kr("Error in openGuestModeNameModel: ",t)}},this.closeGuestModeNameModel=()=>{try{this.showGuestModeNameModal=!1}catch(t){console.warn("Error in closeGuestModeNameModel: ",t),kr("Error in closeGuestModeNameModel: ",t)}},this.onGuestModeNameModalSkipButtonClick=()=>{try{Mr(Or.Events.GUEST_MODE_SKIP_BUTTON_CLICKED),this.showGuestModeNameModal=!1}catch(t){console.warn("Error in onGuestModeNameModalSkipButtonClick: ",t),kr("Error in onGuestModeNameModalSkipButtonClick: ",t)}},this.onPasswordProtectedModalCloseButtonClick=()=>{try{Mr(Or.Events.PASSWORD_PROTECTED_MODAL_CLOSE_BUTTON_CLICKED),this.showPasswordProtectedModal=!1,this.password="",this.showInvalidPassword=!1}catch(t){console.warn("Error in onPasswordProtectedModalCloseButtonClick: ",t),kr("Error in onPasswordProtectedModalCloseButtonClick: ",t)}},this.onPasswordProtectedModalOpenButtonClick=()=>{try{Mr(Or.Events.PASSWORD_PROTECTED_MODAL_OPEN_BUTTON_CLICKED),this.showPasswordProtectedModal=!0}catch(t){console.warn("Error in onPasswordProtectedModalOpenButtonClick: ",t),kr("Error in onPasswordProtectedModalOpenButtonClick: ",t)}},this.showGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!0,Mr(Or.Events.GUEST_MODE_SIGN_IN_NUDGE_SHOWN)}catch(t){console.warn("Error in showGuestModeSignInBanner: ",t),kr("Error in showGuestModeSignInBanner: ",t)}},this.hideGuestModeSignInBanner=()=>{try{this.guestModeSignInBannerVisible=!1}catch(t){console.warn("Error in hideGuestModeSignInBanner: ",t),kr("Error in hideGuestModeSignInBanner: ",t)}},this.onGuestModeBannerSignInButtonClick=()=>{try{Mr(Or.Events.GUEST_MODE_SIGN_IN_CLICKED),this.loginWithGoogle()}catch(t){console.warn("Error in onGuestModeBannerSignInButtonClick: ",t),kr("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=wr();if(e){const t=JSON.parse(JSON.stringify(e));e.name=this.guestUserNameInput,e.photoUrl=null,this.guestUserNameUpdateLoading=!0,(t=>{try{const e=JSON.stringify(t),i=vr(e,Ht,Bt);dr(wt,i,!0)}catch(t){console.warn("Error in updateGuestUser: ",t),kr("Error in updateGuestUser: ",t)}})(e),await Snippyly.identify(e),this.snippylyUser=JSON.parse(JSON.stringify(e)),await Nr(this.apiKey,this.projectId||"",t,e),this.showGuestModeNameModal=!1,this.guestUserNameUpdated=!0,this.guestUserNameUpdateLoading=!1,dr(At,"true"),Mr(Or.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),kr("Error in updateGuestUserName: ",t)}},this.submitPassword=async()=>{var t;try{if(Mr(Or.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(async(t,e,i)=>{var o;try{const n=Ni(Cr,Xt,{timeout:12e5}),s=await n({apiKey:t,projectId:e,password:i});return null===(o=null==s?void 0:s.data)||void 0===o?void 0:o.data}catch(t){return console.warn("Error in validatePassword: ",t),null}})(this.apiKey,this.projectId,this.password),function(t,e){try{const i="object"==typeof e?JSON.stringify(e):e;localStorage.setItem(t,i)}catch(t){console.warn("Error in setLocalStorage: ",t)}}(Tt,this.isPasswordValid),this.isPasswordValid?(this.password="",this.onPasswordProtectedModalCloseButtonClick(),this.showInvalidPassword=!1,Velt&&Velt.disableFeatures([]),Mr(Or.Events.REVIEW_PASSWORD_ACCEPTED)):(this.showInvalidPassword=!0,Mr(Or.Events.REVIEW_PASSWORD_REJECTED)),this.validatingPasswordLoading=!1}catch(t){console.warn("Error in submitPassword: ",t),kr("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 Nr(this.apiKey,this.projectId||"",e,i),await Snippyly.updateUser(i),this.snippylyUser=JSON.parse(JSON.stringify(i));const o=gr();o.name=i.name;const n=JSON.stringify(o),s=vr(n,Ht,Bt);dr(ft,s,!0),this.guestUserNameUpdateLoading=!1,this.guestUserNameInput="",this.closeGuestModeNameModel()}catch(t){console.warn("Error in updateUserName: ",t),kr("Error in updateUserName: ",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),kr("Error in disableAddCommentMode: ",t)}},this.disableCommentModeButton=()=>{try{return this.addCommentMode?D`
|
|
2476
2476
|
<div class="disable-add-comment-button" @click=${()=>this.disableCommentMode()}>
|
|
2477
2477
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2478
2478
|
<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"/>
|
|
@@ -3305,4 +3305,4 @@ class Dr extends lt{constructor(t){if(super(t),this.it=$,t.type!==rt)throw Error
|
|
|
3305
3305
|
</div>
|
|
3306
3306
|
</div>
|
|
3307
3307
|
`:D``}
|
|
3308
|
-
`:D``}}jr.styles=[Tr,Ir],$r([ot()],jr.prototype,"loadPlugin",null),$r([ot()],jr.prototype,"comments",void 0),$r([ot()],jr.prototype,"commentElement",void 0),$r([ot()],jr.prototype,"contactElement",void 0),$r([ot()],jr.prototype,"rewriterElement",void 0),$r([ot()],jr.prototype,"presenceElement",void 0),$r([ot()],jr.prototype,"commentSubscription",void 0),$r([ot()],jr.prototype,"selectionElement",void 0),$r([ot()],jr.prototype,"viewsElement",void 0),$r([ot()],jr.prototype,"addCommentMode",void 0),$r([ot()],jr.prototype,"showTourCommentTooltip",void 0),$r([ot()],jr.prototype,"allFeatureDisabled",void 0),$r([ot()],jr.prototype,"allFeatureRestricted",void 0),$r([ot()],jr.prototype,"guestMode",void 0),$r([ot()],jr.prototype,"_expanded",void 0),$r([ot()],jr.prototype,"loading",void 0),$r([ot()],jr.prototype,"signInError",void 0),$r([ot()],jr.prototype,"snippylyUser",void 0),$r([ot()],jr.prototype,"snippylyUserRole",void 0),$r([ot()],jr.prototype,"_isPlanExpired",void 0),$r([ot()],jr.prototype,"showOnboardingModal",void 0),$r([ot()],jr.prototype,"showLiveDemoModal",void 0),$r([ot()],jr.prototype,"showFigmaDemoModal",void 0),$r([ot()],jr.prototype,"showGuestModeSignInModal",void 0),$r([ot()],jr.prototype,"guestModeSignInModalConfig",void 0),$r([ot()],jr.prototype,"showGuestModeNameModal",void 0),$r([ot()],jr.prototype,"guestModeSignInBannerVisible",void 0),$r([ot()],jr.prototype,"guestUserNameInput",void 0),$r([ot()],jr.prototype,"guestUserModelOpened",void 0),$r([ot()],jr.prototype,"guestUserNameUpdated",void 0),$r([ot()],jr.prototype,"guestUserNameUpdateLoading",void 0),$r([it()],jr.prototype,"apiKey",null),$r([it()],jr.prototype,"projectId",null),$r([ot()],jr.prototype,"staging",void 0),$r([it()],jr.prototype,"projectVersionKey",null),$r([ot()],jr.prototype,"projectVersion",void 0),$r([ot()],jr.prototype,"version",void 0),$r([it()],jr.prototype,"autoLocation",null),$r([ot()],jr.prototype,"_menuOpenedId",void 0),$r([ot()],jr.prototype,"copyLinkTooltip",void 0),$r([ot()],jr.prototype,"invalidApiKey",void 0),$r([ot()],jr.prototype,"documentId",void 0),$r([ot()],jr.prototype,"_isUserGlobalContact",void 0),$r([ot()],jr.prototype,"location",void 0),$r([ot()],jr.prototype,"qrCode",void 0),$r([ot()],jr.prototype,"showQrCode",void 0),$r([ot()],jr.prototype,"customLoginEnabledLocally",void 0),$r([it()],jr.prototype,"customLoginEnabled",void 0),$r([ot()],jr.prototype,"providedUser",void 0),$r([ot()],jr.prototype,"autoTranslation",void 0),$r([ot()],jr.prototype,"addCommentCount",void 0),$r([ot()],jr.prototype,"isSigningInUserAdmin",void 0),$r([ot()],jr.prototype,"_privateCommentModeEnabled",void 0),$r([ot()],jr.prototype,"superflowToolbarMoved",void 0),$r([ot()],jr.prototype,"_customerMetadata",void 0),$r([ot()],jr.prototype,"logoMark",void 0),$r([ot()],jr.prototype,"wordMark",void 0),$r([ot()],jr.prototype,"_darkMode",void 0),$r([ot()],jr.prototype,"projectConfig",void 0),$r([ot()],jr.prototype,"allowGuestModeSignIn",void 0),$r([ot()],jr.prototype,"toolbarEnabled",void 0),$r([ot()],jr.prototype,"toolbarEnabledApiCalled",void 0),$r([ot()],jr.prototype,"passwordProtected",void 0),$r([ot()],jr.prototype,"isPasswordValid",void 0),$r([ot()],jr.prototype,"password",void 0),$r([ot()],jr.prototype,"validatingPasswordLoading",void 0),$r([ot()],jr.prototype,"showPasswordProtectedModal",void 0),$r([ot()],jr.prototype,"showInvalidPassword",void 0),$r([ot()],jr.prototype,"skipGuestNameModal",void 0),$r([ot()],jr.prototype,"_totalViews",void 0),$r([ot()],jr.prototype,"totalViewsCount",void 0),$r([ot()],jr.prototype,"inviteUrl",void 0),(t=>{if(customElements.get("superflow-toolbar")||customElements.get("snippyly-plugin"))return;const e={allow:["sdkUrl","windowVariables","snippylyPlugin"],loaders:{windowVariables:()=>{const t=null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_API_KEY;return{valid:!!t,type:"windowVariables",apiKey:t,staging:!!(null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_STAGING),projectVersionKey:null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_PROJECT_VERSION_KEY,projectId:null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_PROJECT_ID,autoLocation:null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_AUTO_LOCATION}},snippylyPlugin:()=>{const t=document.querySelector("snippyly-plugin");if(!t)return;const e=t.getAttribute("apiKey"),i=!!t.getAttribute("staging"),o=t.getAttribute("projectVersionKey"),n=t.getAttribute("projectId"),s=t.getAttribute("autoLocation");return null==t||t.remove(),{valid:!!e,type:"snippylyPlugin",apiKey:e,staging:i,projectVersionKey:o,projectId:n,autoLocation:s}},sdkUrl:()=>{const t=document.getElementById("superflowToolbarScript");if(!t)return;const e=null==t?void 0:t.src,i=new URL(e).searchParams,o=i.has("apiKey")?i.get("apiKey"):void 0;return{valid:!!o,type:"sdkUrl",apiKey:o,staging:void 0,projectVersionKey:void 0,projectId:i.has("projectId")?i.get("projectId"):void 0,autoLocation:i.has("autoLocation")?i.get("autoLocation"):void 0}}},load:()=>{for(let t=0;t<e.allow.length;t++){const i=e.allow[t],o=e.loaders[i]();if(o&&o.valid)return o}}},i=()=>{try{const i=e.load();if(customElements.define("superflow-toolbar",t),i&&i.valid){(()=>{try{document.querySelectorAll("superflow-toolbar").forEach((t=>{t.remove()})),document.querySelectorAll("snippyly-plugin").forEach((t=>{t.remove()}))}catch(t){console.warn("Error in removeSuperflowToolbarTag: ",t)}})();const t={};return t.apiKey=i.apiKey,i.staging&&(t.staging="true"),i.projectVersionKey&&(t.projectVersionKey=i.projectVersionKey),i.projectId&&(t.projectId=i.projectId),(null==i?void 0:i.autoLocation)&&(t.autoLocation=i.autoLocation),void((t={})=>{try{const e=document.createElement("superflow-toolbar");Object.keys(t||{}).forEach((i=>{e.setAttribute(i,t[i])})),document.body.appendChild(e)}catch(t){console.warn("Error in loadSuperflowToolbarTag: ",t)}})(t)}}catch(t){console.warn("Error in initSuperflow: ",t)}};(null===document||void 0===document?void 0:document.body)?i():null===document||void 0===document||document.addEventListener("DOMContentLoaded",(()=>{i()}))})(jr);class Vr extends X{}customElements.get("snippyly-plugin")||customElements.define("snippyly-plugin",Vr),t.SnippylyPlugin=Vr,t.SuperflowToolbar=jr,Object.defineProperty(t,"u",{value:!0})}({});
|
|
3308
|
+
`:D``}}jr.styles=[Tr,Ir],$r([ot()],jr.prototype,"loadPlugin",null),$r([ot()],jr.prototype,"comments",void 0),$r([ot()],jr.prototype,"commentElement",void 0),$r([ot()],jr.prototype,"contactElement",void 0),$r([ot()],jr.prototype,"rewriterElement",void 0),$r([ot()],jr.prototype,"presenceElement",void 0),$r([ot()],jr.prototype,"commentSubscription",void 0),$r([ot()],jr.prototype,"selectionElement",void 0),$r([ot()],jr.prototype,"viewsElement",void 0),$r([ot()],jr.prototype,"addCommentMode",void 0),$r([ot()],jr.prototype,"showTourCommentTooltip",void 0),$r([ot()],jr.prototype,"allFeatureDisabled",void 0),$r([ot()],jr.prototype,"allFeatureRestricted",void 0),$r([ot()],jr.prototype,"guestMode",void 0),$r([ot()],jr.prototype,"_expanded",void 0),$r([ot()],jr.prototype,"loading",void 0),$r([ot()],jr.prototype,"signInError",void 0),$r([ot()],jr.prototype,"snippylyUser",void 0),$r([ot()],jr.prototype,"snippylyUserRole",void 0),$r([ot()],jr.prototype,"_isPlanExpired",void 0),$r([ot()],jr.prototype,"showOnboardingModal",void 0),$r([ot()],jr.prototype,"showLiveDemoModal",void 0),$r([ot()],jr.prototype,"showFigmaDemoModal",void 0),$r([ot()],jr.prototype,"showGuestModeSignInModal",void 0),$r([ot()],jr.prototype,"guestModeSignInModalConfig",void 0),$r([ot()],jr.prototype,"showGuestModeNameModal",void 0),$r([ot()],jr.prototype,"guestModeSignInBannerVisible",void 0),$r([ot()],jr.prototype,"guestUserNameInput",void 0),$r([ot()],jr.prototype,"guestUserModelOpened",void 0),$r([ot()],jr.prototype,"guestUserNameUpdated",void 0),$r([ot()],jr.prototype,"guestUserNameUpdateLoading",void 0),$r([it()],jr.prototype,"apiKey",null),$r([it()],jr.prototype,"projectId",null),$r([ot()],jr.prototype,"staging",void 0),$r([it()],jr.prototype,"projectVersionKey",null),$r([ot()],jr.prototype,"projectVersion",void 0),$r([ot()],jr.prototype,"version",void 0),$r([it()],jr.prototype,"autoLocation",null),$r([ot()],jr.prototype,"_menuOpenedId",void 0),$r([ot()],jr.prototype,"copyLinkTooltip",void 0),$r([ot()],jr.prototype,"invalidApiKey",void 0),$r([ot()],jr.prototype,"documentId",void 0),$r([ot()],jr.prototype,"_isUserGlobalContact",void 0),$r([ot()],jr.prototype,"location",void 0),$r([ot()],jr.prototype,"qrCode",void 0),$r([ot()],jr.prototype,"showQrCode",void 0),$r([ot()],jr.prototype,"customLoginEnabledLocally",void 0),$r([it()],jr.prototype,"customLoginEnabled",void 0),$r([ot()],jr.prototype,"providedUser",void 0),$r([ot()],jr.prototype,"autoTranslation",void 0),$r([ot()],jr.prototype,"addCommentCount",void 0),$r([ot()],jr.prototype,"isSigningInUserAdmin",void 0),$r([ot()],jr.prototype,"_privateCommentModeEnabled",void 0),$r([ot()],jr.prototype,"superflowToolbarMoved",void 0),$r([ot()],jr.prototype,"_customerMetadata",void 0),$r([ot()],jr.prototype,"logoMark",void 0),$r([ot()],jr.prototype,"wordMark",void 0),$r([ot()],jr.prototype,"_darkMode",void 0),$r([ot()],jr.prototype,"projectConfig",void 0),$r([ot()],jr.prototype,"allowGuestModeSignIn",void 0),$r([ot()],jr.prototype,"toolbarEnabled",void 0),$r([ot()],jr.prototype,"toolbarEnabledApiCalled",void 0),$r([ot()],jr.prototype,"passwordProtected",void 0),$r([ot()],jr.prototype,"isPasswordValid",void 0),$r([ot()],jr.prototype,"password",void 0),$r([ot()],jr.prototype,"validatingPasswordLoading",void 0),$r([ot()],jr.prototype,"showPasswordProtectedModal",void 0),$r([ot()],jr.prototype,"showInvalidPassword",void 0),$r([ot()],jr.prototype,"skipGuestNameModal",void 0),$r([ot()],jr.prototype,"_totalViews",void 0),$r([ot()],jr.prototype,"totalViewsCount",void 0),$r([ot()],jr.prototype,"inviteUrl",void 0),$r([ot()],jr.prototype,"showModalOnceCommentIsModeIsOff",void 0),(t=>{if(customElements.get("superflow-toolbar")||customElements.get("snippyly-plugin"))return;const e={allow:["sdkUrl","windowVariables","snippylyPlugin"],loaders:{windowVariables:()=>{const t=null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_API_KEY;return{valid:!!t,type:"windowVariables",apiKey:t,staging:!!(null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_STAGING),projectVersionKey:null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_PROJECT_VERSION_KEY,projectId:null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_PROJECT_ID,autoLocation:null===window||void 0===window?void 0:window.SUPERFLOW_TOOLBAR_AUTO_LOCATION}},snippylyPlugin:()=>{const t=document.querySelector("snippyly-plugin");if(!t)return;const e=t.getAttribute("apiKey"),i=!!t.getAttribute("staging"),o=t.getAttribute("projectVersionKey"),n=t.getAttribute("projectId"),s=t.getAttribute("autoLocation");return null==t||t.remove(),{valid:!!e,type:"snippylyPlugin",apiKey:e,staging:i,projectVersionKey:o,projectId:n,autoLocation:s}},sdkUrl:()=>{const t=document.getElementById("superflowToolbarScript");if(!t)return;const e=null==t?void 0:t.src,i=new URL(e).searchParams,o=i.has("apiKey")?i.get("apiKey"):void 0;return{valid:!!o,type:"sdkUrl",apiKey:o,staging:void 0,projectVersionKey:void 0,projectId:i.has("projectId")?i.get("projectId"):void 0,autoLocation:i.has("autoLocation")?i.get("autoLocation"):void 0}}},load:()=>{for(let t=0;t<e.allow.length;t++){const i=e.allow[t],o=e.loaders[i]();if(o&&o.valid)return o}}},i=()=>{try{const i=e.load();if(customElements.define("superflow-toolbar",t),i&&i.valid){(()=>{try{document.querySelectorAll("superflow-toolbar").forEach((t=>{t.remove()})),document.querySelectorAll("snippyly-plugin").forEach((t=>{t.remove()}))}catch(t){console.warn("Error in removeSuperflowToolbarTag: ",t)}})();const t={};return t.apiKey=i.apiKey,i.staging&&(t.staging="true"),i.projectVersionKey&&(t.projectVersionKey=i.projectVersionKey),i.projectId&&(t.projectId=i.projectId),(null==i?void 0:i.autoLocation)&&(t.autoLocation=i.autoLocation),void((t={})=>{try{const e=document.createElement("superflow-toolbar");Object.keys(t||{}).forEach((i=>{e.setAttribute(i,t[i])})),document.body.appendChild(e)}catch(t){console.warn("Error in loadSuperflowToolbarTag: ",t)}})(t)}}catch(t){console.warn("Error in initSuperflow: ",t)}};(null===document||void 0===document?void 0:document.body)?i():null===document||void 0===document||document.addEventListener("DOMContentLoaded",(()=>{i()}))})(jr);class Vr extends X{}customElements.get("snippyly-plugin")||customElements.define("snippyly-plugin",Vr),t.SnippylyPlugin=Vr,t.SuperflowToolbar=jr,Object.defineProperty(t,"u",{value:!0})}({});
|