@snippyly/plugin-staging 1.0.5 → 1.0.8
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/snippyly.js +372 -275
package/package.json
CHANGED
package/snippyly.js
CHANGED
|
@@ -3,331 +3,428 @@
|
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
5
|
*/
|
|
6
|
-
const
|
|
6
|
+
const i=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,t=Symbol(),e=new Map;class n{constructor(i,e){if(this._$cssResult$=!0,e!==t)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=i}get styleSheet(){let t=e.get(this.cssText);return i&&void 0===t&&(e.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}}const s=i?i=>i:i=>i instanceof CSSStyleSheet?(i=>{let e="";for(const t of i.cssRules)e+=t.cssText;return(i=>new n("string"==typeof i?i:i+"",t))(e)})(i):i
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/;var o;const r=window.trustedTypes,l=r?r.emptyScript:"",h=window.reactiveElementPolyfillSupport,
|
|
11
|
+
*/;var o;const r=window.trustedTypes,l=r?r.emptyScript:"",h=window.reactiveElementPolyfillSupport,d={toAttribute(i,t){switch(t){case Boolean:i=i?l:null;break;case Object:case Array:i=null==i?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=null!==i;break;case Number:e=null===i?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch(i){e=null}}return e}},a=(i,t)=>t!==i&&(t==t||i==i),c={attribute:!0,type:String,converter:d,reflect:!1,hasChanged:a};class p extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(i){var t;null!==(t=this.l)&&void 0!==t||(this.l=[]),this.l.push(i)}static get observedAttributes(){this.finalize();const i=[];return this.elementProperties.forEach(((t,e)=>{const n=this._$Eh(e,t);void 0!==n&&(this._$Eu.set(n,e),i.push(n))})),i}static createProperty(i,t=c){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(i,t),!t.noAccessor&&!this.prototype.hasOwnProperty(i)){const e="symbol"==typeof i?Symbol():"__"+i,n=this.getPropertyDescriptor(i,e,t);void 0!==n&&Object.defineProperty(this.prototype,i,n)}}static getPropertyDescriptor(i,t,e){return{get(){return this[t]},set(n){const s=this[i];this[t]=n,this.requestUpdate(i,s,e)},configurable:!0,enumerable:!0}}static getPropertyOptions(i){return this.elementProperties.get(i)||c}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const i=Object.getPrototypeOf(this);if(i.finalize(),this.elementProperties=new Map(i.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const i=this.properties,t=[...Object.getOwnPropertyNames(i),...Object.getOwnPropertySymbols(i)];for(const e of t)this.createProperty(e,i[e])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(i){const t=[];if(Array.isArray(i)){const e=new Set(i.flat(1/0).reverse());for(const i of e)t.unshift(s(i))}else void 0!==i&&t.push(s(i));return t}static _$Eh(i,t){const e=t.attribute;return!1===e?void 0:"string"==typeof e?e:"string"==typeof i?i.toLowerCase():void 0}o(){var i;this._$Ep=new Promise((i=>this.enableUpdating=i)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(i=this.constructor.l)||void 0===i||i.forEach((i=>i(this)))}addController(i){var t,e;(null!==(t=this._$Eg)&&void 0!==t?t:this._$Eg=[]).push(i),void 0!==this.renderRoot&&this.isConnected&&(null===(e=i.hostConnected)||void 0===e||e.call(i))}removeController(i){var t;null===(t=this._$Eg)||void 0===t||t.splice(this._$Eg.indexOf(i)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach(((i,t)=>{this.hasOwnProperty(t)&&(this._$Et.set(t,this[t]),delete this[t])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{i?t.adoptedStyleSheets=e.map((i=>i instanceof CSSStyleSheet?i:i.styleSheet)):e.forEach((i=>{const e=document.createElement("style"),n=window.litNonce;void 0!==n&&e.setAttribute("nonce",n),e.textContent=i.cssText,t.appendChild(e)}))})(e,this.constructor.elementStyles),e}connectedCallback(){var i;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(i=this._$Eg)||void 0===i||i.forEach((i=>{var t;return null===(t=i.hostConnected)||void 0===t?void 0:t.call(i)}))}enableUpdating(i){}disconnectedCallback(){var i;null===(i=this._$Eg)||void 0===i||i.forEach((i=>{var t;return null===(t=i.hostDisconnected)||void 0===t?void 0:t.call(i)}))}attributeChangedCallback(i,t,e){this._$AK(i,e)}_$ES(i,t,e=c){var n,s;const o=this.constructor._$Eh(i,e);if(void 0!==o&&!0===e.reflect){const r=(null!==(s=null===(n=e.converter)||void 0===n?void 0:n.toAttribute)&&void 0!==s?s:d.toAttribute)(t,e.type);this._$Ei=i,null==r?this.removeAttribute(o):this.setAttribute(o,r),this._$Ei=null}}_$AK(i,t){var e,n,s;const o=this.constructor,r=o._$Eu.get(i);if(void 0!==r&&this._$Ei!==r){const i=o.getPropertyOptions(r),l=i.converter,h=null!==(s=null!==(n=null===(e=l)||void 0===e?void 0:e.fromAttribute)&&void 0!==n?n:"function"==typeof l?l:null)&&void 0!==s?s:d.fromAttribute;this._$Ei=r,this[r]=h(t,i.type),this._$Ei=null}}requestUpdate(i,t,e){let n=!0;void 0!==i&&(((e=e||this.constructor.getPropertyOptions(i)).hasChanged||a)(this[i],t)?(this._$AL.has(i)||this._$AL.set(i,t),!0===e.reflect&&this._$Ei!==i&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(i,e))):n=!1),!this.isUpdatePending&&n&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}catch(i){Promise.reject(i)}const i=this.scheduleUpdate();return null!=i&&await i,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach(((i,t)=>this[t]=i)),this._$Et=void 0);let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),null===(i=this._$Eg)||void 0===i||i.forEach((i=>{var t;return null===(t=i.hostUpdate)||void 0===t?void 0:t.call(i)})),this.update(e)):this._$EU()}catch(i){throw t=!1,this._$EU(),i}t&&this._$AE(e)}willUpdate(i){}_$AE(i){var t;null===(t=this._$Eg)||void 0===t||t.forEach((i=>{var t;return null===(t=i.hostUpdated)||void 0===t?void 0:t.call(i)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(i)),this.updated(i)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(i){return!0}update(i){void 0!==this._$EC&&(this._$EC.forEach(((i,t)=>this._$ES(t,this[t],i))),this._$EC=void 0),this._$EU()}updated(i){}firstUpdated(i){}}
|
|
12
12
|
/**
|
|
13
13
|
* @license
|
|
14
14
|
* Copyright 2017 Google LLC
|
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
16
|
*/
|
|
17
|
-
var u;p.finalized=!0,p.elementProperties=new Map,p.elementStyles=[],p.shadowRootOptions={mode:"open"},null==h||h({ReactiveElement:p}),(null!==(o=globalThis.reactiveElementVersions)&&void 0!==o?o:globalThis.reactiveElementVersions=[]).push("1.3.2");const
|
|
17
|
+
var u;p.finalized=!0,p.elementProperties=new Map,p.elementStyles=[],p.shadowRootOptions={mode:"open"},null==h||h({ReactiveElement:p}),(null!==(o=globalThis.reactiveElementVersions)&&void 0!==o?o:globalThis.reactiveElementVersions=[]).push("1.3.2");const y=globalThis.trustedTypes,v=y?y.createPolicy("lit-html",{createHTML:i=>i}):void 0,g=`lit$${(Math.random()+"").slice(9)}$`,m="?"+g,w=`<${m}>`,f=document,b=(i="")=>f.createComment(i),C=i=>null===i||"object"!=typeof i&&"function"!=typeof i,S=Array.isArray,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,$=/-->/g,k=/>/g,E=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,L=/'/g,_=/"/g,M=/^(?:script|style|textarea|title)$/i,A=(i=>(t,...e)=>({_$litType$:i,strings:t,values:e}))(1),U=Symbol.for("lit-noChange"),T=Symbol.for("lit-nothing"),O=new WeakMap,z=f.createTreeWalker(f,129,null,!1),B=(i,t)=>{const e=i.length-1,n=[];let s,o=2===t?"<svg>":"",r=x;for(let t=0;t<e;t++){const e=i[t];let l,h,d=-1,a=0;for(;a<e.length&&(r.lastIndex=a,h=r.exec(e),null!==h);)a=r.lastIndex,r===x?"!--"===h[1]?r=$:void 0!==h[1]?r=k:void 0!==h[2]?(M.test(h[2])&&(s=RegExp("</"+h[2],"g")),r=E):void 0!==h[3]&&(r=E):r===E?">"===h[0]?(r=null!=s?s:x,d=-1):void 0===h[1]?d=-2:(d=r.lastIndex-h[2].length,l=h[1],r=void 0===h[3]?E:'"'===h[3]?_:L):r===_||r===L?r=E:r===$||r===k?r=x:(r=E,s=void 0);const c=r===E&&i[t+1].startsWith("/>")?" ":"";o+=r===x?e+w:d>=0?(n.push(l),e.slice(0,d)+"$lit$"+e.slice(d)+g+c):e+g+(-2===d?(n.push(void 0),t):c)}const l=o+(i[e]||"<?>")+(2===t?"</svg>":"");if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==v?v.createHTML(l):l,n]};class R{constructor({strings:i,_$litType$:t},e){let n;this.parts=[];let s=0,o=0;const r=i.length-1,l=this.parts,[h,d]=B(i,t);if(this.el=R.createElement(h,e),z.currentNode=this.el.content,2===t){const i=this.el.content,t=i.firstChild;t.remove(),i.append(...t.childNodes)}for(;null!==(n=z.nextNode())&&l.length<r;){if(1===n.nodeType){if(n.hasAttributes()){const i=[];for(const t of n.getAttributeNames())if(t.endsWith("$lit$")||t.startsWith(g)){const e=d[o++];if(i.push(t),void 0!==e){const i=n.getAttribute(e.toLowerCase()+"$lit$").split(g),t=/([.?@])?(.*)/.exec(e);l.push({type:1,index:s,name:t[2],strings:i,ctor:"."===t[1]?P:"?"===t[1]?V:"@"===t[1]?F:I})}else l.push({type:6,index:s})}for(const t of i)n.removeAttribute(t)}if(M.test(n.tagName)){const i=n.textContent.split(g),t=i.length-1;if(t>0){n.textContent=y?y.emptyScript:"";for(let e=0;e<t;e++)n.append(i[e],b()),z.nextNode(),l.push({type:2,index:++s});n.append(i[t],b())}}}else if(8===n.nodeType)if(n.data===m)l.push({type:2,index:s});else{let i=-1;for(;-1!==(i=n.data.indexOf(g,i+1));)l.push({type:7,index:s}),i+=g.length-1}s++}}static createElement(i,t){const e=f.createElement("template");return e.innerHTML=i,e}}function j(i,t,e=i,n){var s,o,r,l;if(t===U)return t;let h=void 0!==n?null===(s=e._$Cl)||void 0===s?void 0:s[n]:e._$Cu;const d=C(t)?void 0:t._$litDirective$;return(null==h?void 0:h.constructor)!==d&&(null===(o=null==h?void 0:h._$AO)||void 0===o||o.call(h,!1),void 0===d?h=void 0:(h=new d(i),h._$AT(i,e,n)),void 0!==n?(null!==(r=(l=e)._$Cl)&&void 0!==r?r:l._$Cl=[])[n]=h:e._$Cu=h),void 0!==h&&(t=j(i,h._$AS(i,t.values),h,n)),t}class N{constructor(i,t){this.v=[],this._$AN=void 0,this._$AD=i,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(i){var t;const{el:{content:e},parts:n}=this._$AD,s=(null!==(t=null==i?void 0:i.creationScope)&&void 0!==t?t:f).importNode(e,!0);z.currentNode=s;let o=z.nextNode(),r=0,l=0,h=n[0];for(;void 0!==h;){if(r===h.index){let t;2===h.type?t=new Z(o,o.nextSibling,this,i):1===h.type?t=new h.ctor(o,h.name,h.strings,this,i):6===h.type&&(t=new D(o,this,i)),this.v.push(t),h=n[++l]}r!==(null==h?void 0:h.index)&&(o=z.nextNode(),r++)}return s}m(i){let t=0;for(const e of this.v)void 0!==e&&(void 0!==e.strings?(e._$AI(i,e,t),t+=e.strings.length-2):e._$AI(i[t])),t++}}class Z{constructor(i,t,e,n){var s;this.type=2,this._$AH=T,this._$AN=void 0,this._$AA=i,this._$AB=t,this._$AM=e,this.options=n,this._$Cg=null===(s=null==n?void 0:n.isConnected)||void 0===s||s}get _$AU(){var i,t;return null!==(t=null===(i=this._$AM)||void 0===i?void 0:i._$AU)&&void 0!==t?t:this._$Cg}get parentNode(){let i=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===i.nodeType&&(i=t.parentNode),i}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(i,t=this){i=j(this,i,t),C(i)?i===T||null==i||""===i?(this._$AH!==T&&this._$AR(),this._$AH=T):i!==this._$AH&&i!==U&&this.$(i):void 0!==i._$litType$?this.T(i):void 0!==i.nodeType?this.k(i):(i=>{var t;return S(i)||"function"==typeof(null===(t=i)||void 0===t?void 0:t[Symbol.iterator])})(i)?this.S(i):this.$(i)}M(i,t=this._$AB){return this._$AA.parentNode.insertBefore(i,t)}k(i){this._$AH!==i&&(this._$AR(),this._$AH=this.M(i))}$(i){this._$AH!==T&&C(this._$AH)?this._$AA.nextSibling.data=i:this.k(f.createTextNode(i)),this._$AH=i}T(i){var t;const{values:e,_$litType$:n}=i,s="number"==typeof n?this._$AC(i):(void 0===n.el&&(n.el=R.createElement(n.h,this.options)),n);if((null===(t=this._$AH)||void 0===t?void 0:t._$AD)===s)this._$AH.m(e);else{const i=new N(s,this),t=i.p(this.options);i.m(e),this.k(t),this._$AH=i}}_$AC(i){let t=O.get(i.strings);return void 0===t&&O.set(i.strings,t=new R(i)),t}S(i){S(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let e,n=0;for(const s of i)n===t.length?t.push(e=new Z(this.M(b()),this.M(b()),this,this.options)):e=t[n],e._$AI(s),n++;n<t.length&&(this._$AR(e&&e._$AB.nextSibling,n),t.length=n)}_$AR(i=this._$AA.nextSibling,t){var e;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,t);i&&i!==this._$AB;){const t=i.nextSibling;i.remove(),i=t}}setConnected(i){var t;void 0===this._$AM&&(this._$Cg=i,null===(t=this._$AP)||void 0===t||t.call(this,i))}}class I{constructor(i,t,e,n,s){this.type=1,this._$AH=T,this._$AN=void 0,this.element=i,this.name=t,this._$AM=n,this.options=s,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=T}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(i,t=this,e,n){const s=this.strings;let o=!1;if(void 0===s)i=j(this,i,t,0),o=!C(i)||i!==this._$AH&&i!==U,o&&(this._$AH=i);else{const n=i;let r,l;for(i=s[0],r=0;r<s.length-1;r++)l=j(this,n[e+r],t,r),l===U&&(l=this._$AH[r]),o||(o=!C(l)||l!==this._$AH[r]),l===T?i=T:i!==T&&(i+=(null!=l?l:"")+s[r+1]),this._$AH[r]=l}o&&!n&&this.C(i)}C(i){i===T?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=i?i:"")}}class P extends I{constructor(){super(...arguments),this.type=3}C(i){this.element[this.name]=i===T?void 0:i}}const H=y?y.emptyScript:"";class V extends I{constructor(){super(...arguments),this.type=4}C(i){i&&i!==T?this.element.setAttribute(this.name,H):this.element.removeAttribute(this.name)}}class F extends I{constructor(i,t,e,n,s){super(i,t,e,n,s),this.type=5}_$AI(i,t=this){var e;if((i=null!==(e=j(this,i,t,0))&&void 0!==e?e:T)===U)return;const n=this._$AH,s=i===T&&n!==T||i.capture!==n.capture||i.once!==n.once||i.passive!==n.passive,o=i!==T&&(n===T||s);s&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,i),this._$AH=i}handleEvent(i){var t,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(t=this.options)||void 0===t?void 0:t.host)&&void 0!==e?e:this.element,i):this._$AH.handleEvent(i)}}class D{constructor(i,t,e){this.element=i,this.type=6,this._$AN=void 0,this._$AM=t,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(i){j(this,i)}}const J=window.litHtmlPolyfillSupport;
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
21
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
22
|
*/
|
|
23
|
-
var K
|
|
23
|
+
var W,K;null==J||J(R,Z),(null!==(u=globalThis.litHtmlVersions)&&void 0!==u?u:globalThis.litHtmlVersions=[]).push("2.2.6");class q extends p{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var i,t;const e=super.createRenderRoot();return null!==(i=(t=this.renderOptions).renderBefore)&&void 0!==i||(t.renderBefore=e.firstChild),e}update(i){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(i),this._$Dt=((i,t,e)=>{var n,s;const o=null!==(n=null==e?void 0:e.renderBefore)&&void 0!==n?n:t;let r=o._$litPart$;if(void 0===r){const i=null!==(s=null==e?void 0:e.renderBefore)&&void 0!==s?s:null;o._$litPart$=r=new Z(t.insertBefore(b(),i),i,void 0,null!=e?e:{})}return r._$AI(i),r})(t,this.renderRoot,this.renderOptions)}connectedCallback(){var i;super.connectedCallback(),null===(i=this._$Dt)||void 0===i||i.setConnected(!0)}disconnectedCallback(){var i;super.disconnectedCallback(),null===(i=this._$Dt)||void 0===i||i.setConnected(!1)}render(){return U}}q.finalized=!0,q._$litElement$=!0,null===(W=globalThis.litElementHydrateSupport)||void 0===W||W.call(globalThis,{LitElement:q});const G=globalThis.litElementPolyfillSupport;null==G||G({LitElement:q}),(null!==(K=globalThis.litElementVersions)&&void 0!==K?K:globalThis.litElementVersions=[]).push("3.2.0");
|
|
24
24
|
/**
|
|
25
25
|
* @license
|
|
26
26
|
* Copyright 2017 Google LLC
|
|
27
27
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
28
|
*/
|
|
29
|
-
const
|
|
29
|
+
const X=(i,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(e){e.createProperty(t.key,i)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(e){e.createProperty(t.key,i)}};
|
|
30
30
|
/**
|
|
31
31
|
* @license
|
|
32
32
|
* Copyright 2017 Google LLC
|
|
33
33
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
|
-
*/function Q(
|
|
34
|
+
*/function Q(i){return(t,e)=>void 0!==e?((i,t,e)=>{t.constructor.createProperty(e,i)})(i,t,e):X(i,t)
|
|
35
35
|
/**
|
|
36
36
|
* @license
|
|
37
37
|
* Copyright 2017 Google LLC
|
|
38
38
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
39
|
-
*/}function Y(
|
|
39
|
+
*/}function Y(i){return Q({...i,state:!0})}
|
|
40
40
|
/**
|
|
41
41
|
* @license
|
|
42
42
|
* Copyright 2021 Google LLC
|
|
43
43
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
44
|
-
*/var
|
|
44
|
+
*/var ii;null===(ii=window.HTMLSlotElement)||void 0===ii||ii.prototype.assignedElements;
|
|
45
45
|
/**
|
|
46
46
|
* @license
|
|
47
47
|
* Copyright 2017 Google LLC
|
|
48
48
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
49
49
|
*/
|
|
50
|
-
const
|
|
50
|
+
const ti=1;
|
|
51
51
|
/**
|
|
52
52
|
* @license
|
|
53
53
|
* Copyright 2018 Google LLC
|
|
54
54
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
55
55
|
*/
|
|
56
|
-
const
|
|
57
|
-
<div class="snippyly-plugin-container">
|
|
58
|
-
<div class="snippyly-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
<
|
|
72
|
-
|
|
56
|
+
const ei=(i=>(...t)=>({_$litDirective$:i,values:t}))(class extends class{constructor(i){}get _$AU(){return this._$AM._$AU}_$AT(i,t,e){this._$Ct=i,this._$AM=t,this._$Ci=e}_$AS(i,t){return this.update(i,t)}update(i,t){return this.render(...t)}}{constructor(i){var t;if(super(i),i.type!==ti||"class"!==i.name||(null===(t=i.strings)||void 0===t?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter((t=>i[t])).join(" ")+" "}update(i,[t]){var e,n;if(void 0===this.et){this.et=new Set,void 0!==i.strings&&(this.st=new Set(i.strings.join(" ").split(/\s/).filter((i=>""!==i))));for(const i in t)t[i]&&!(null===(e=this.st)||void 0===e?void 0:e.has(i))&&this.et.add(i);return this.render(t)}const s=i.element.classList;this.et.forEach((i=>{i in t||(s.remove(i),this.et.delete(i))}));for(const i in t){const e=!!t[i];e===this.et.has(i)||(null===(n=this.st)||void 0===n?void 0:n.has(i))||(e?(s.add(i),this.et.add(i)):(s.remove(i),this.et.delete(i)))}return U}}),ni=(i,t=0)=>{try{let e=3735928559^t,n=1103547991^t;for(let t,s=0;s<i.length;s++)t=i.charCodeAt(s),e=Math.imul(e^t,2654435761),n=Math.imul(n^t,1597334677);return e=Math.imul(e^e>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(e^e>>>13,3266489909),4294967296*(2097151&n)+(e>>>0)}catch(i){return console.warn("Error in cyrb53: ",i),0}},si=(i,t,e=!1,n="localStorage")=>{try{const s=e?btoa(t):t;"localStorage"===n?localStorage.setItem(i,s):sessionStorage.setItem(i,s)}catch(i){console.warn("Error in setLocalStorage: ",i)}},oi=(i,t=!1,e="localStorage")=>{try{let n=null;return n="localStorage"===e?localStorage.getItem(i):sessionStorage.getItem(i),n&&t?atob(n):n}catch(i){return console.warn("Error in getLocalStorage: ",i),null}},ri=(i,t="localStorage")=>{try{"localStorage"===t?localStorage.removeItem(i):sessionStorage.removeItem(i)}catch(i){console.warn("Error in removeLocalStorageData: ",i)}};var li=function(i,t,e,n){for(var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,e):n,l=i.length-1;l>=0;l--)(s=i[l])&&(r=(o<3?s(r):o>3?s(t,e,r):s(t,e))||r);return o>3&&r&&Object.defineProperty(t,e,r),r};let hi=class extends q{constructor(){super(),this._loadPlugin=!1,this.comments=[],this._expanded=!0,this.staging=true,this.copyLinkTooltip="Copy Link",this.addWindowClickEventListener=()=>{try{this.windowClickEventListener||(this.windowClickEventListener=()=>{this.menuOpenedId&&(this.menuOpenedId=void 0)},window.addEventListener("click",this.windowClickEventListener))}catch(i){console.warn("Error in addWindowClickEventListener: ",i)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(i){console.warn("Error in removeWindowClickEventListener: ",i)}},this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(i){console.warn("Error in setWindowEventListner: ",i)}},this.urlChangeListener=()=>{try{const i=history.pushState;history.pushState=function(){const t=i.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),t};const t=history.replaceState;history.replaceState=function(){const i=t.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),i},window.addEventListener("popstate",(()=>{window.dispatchEvent(new Event("locationchange"))}))}catch(i){console.warn("Error in urlChangeListener: ",i)}},this.checkUrl=()=>{try{const i=new URL(document.location),t=i.searchParams;if(t.has("snippyly_google_token")){const e=JSON.parse(atob(t.get("snippyly_google_token"))),n={};n.userId=e.uid,n.name=e.displayName,n.email=e.email,n.photoUrl=null==e?void 0:e.photoURL,n.contacts=window.SNIPPYLY_USER_CONTACTS||[],si("snippyly-user",JSON.stringify(n),!0),t.delete("snippyly_google_token"),window.history.replaceState({},document.title,i.href)}if(t.has("review-mode"))if(si("review-mode","true",!1,"sessionStorage"),t.has("review-doc-id"))this.loadPluginUI();else{const e=ni(window.location.origin);t.append("review-doc-id",`${e}`),window.history.replaceState({},document.title,i.href),this.loadPluginUI()}else if(oi("review-mode",!1,"sessionStorage")){t.append("review-mode","true");const e=ni(window.location.origin);t.append("review-doc-id",`${e}`),window.history.replaceState({},document.title,i.href),this.loadPluginUI()}}catch(i){console.warn("Error in checkUrl: ",i)}},this.loadPluginUI=()=>{try{this.loadPlugin=!0;const i=document.createElement("snippyly-comments");window.document.body.appendChild(i);const t=document.createElement("snippyly-comments-sidebar");window.document.body.appendChild(t);const e=document.createElement("snippyly-cursor");window.document.body.appendChild(e),((i="latest",t=!1,e)=>{if(console.log("load snippyly called"),document.getElementById("snippylyScript"))e&&e();else{const n=document.createElement("script");n.src=`https://cdn.jsdelivr.net/npm/@snippyly/sdk${t?"-staging":""}@${i||"latest"}/snippyly.js`,n.id="snippylyScript",n.type="module",document.body.appendChild(n),n.onload=()=>{e&&e()}}})(void 0,this.staging,(()=>{window.Snippyly&&this.initializeSnippyly()}))}catch(i){console.warn("Error in loadPluginUI: ",i)}},this.initializeSnippyly=async()=>{try{await(null===Snippyly||void 0===Snippyly?void 0:Snippyly.init(this.apiKey));const i=new URL(document.location).searchParams;if(i.has("review-doc-id")){null===Snippyly||void 0===Snippyly||Snippyly.setDocumentId(i.get("review-doc-id"));const t=new URL(document.location);t.searchParams.delete("review-mode"),t.searchParams.delete("review-doc-id"),null===Snippyly||void 0===Snippyly||Snippyly.setDocumentParams({url:t.href})}this.commentElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCommentElement(),this.commentElement&&this.commentElement.enableTextComments(!0),oi("snippyly-user",!0)&&this.identifySnippyly()}catch(i){console.warn("Error in initializeSnippyly: ",i)}},this.identifySnippyly=async()=>{try{this.snippylyUser=JSON.parse(oi("snippyly-user",!0)),await Snippyly.identify(this.snippylyUser),this.getComments()}catch(i){console.warn("Error in identifySnippyly: ",i)}},this.getComments=()=>{try{this.commentElement&&this.commentElement.getAllCommentPinAnnotationsOnCurrentDocument().subscribe((i=>{this.comments=i}))}catch(i){console.warn("Error in getComments: ",i)}},this.toggleCommentSidebar=()=>{try{this.commentElement&&this.commentElement.toggleCommentSidebar()}catch(i){console.warn("Error in toggleCommentSidebar: ",i)}},this.toggleSnippylyPluginToolbar=()=>{try{this.expanded=!this.expanded}catch(i){console.warn("Error in toggleSnippylyPluginToolbar: ",i)}},this.loginWithGoogle=()=>{try{window.open(`https://snippyly-login-staging.web.app/?redirect_url=${encodeURIComponent(window.location.href)}`,"_self")}catch(i){console.warn("Error in loginWithGoogle: ",i)}},this.removeSnippyly=async()=>{try{ri("review-mode","sessionStorage");const i=new URL(document.location),t=i.searchParams;t.delete("review-doc-id"),t.delete("review-mode"),window.history.replaceState({},document.title,i.href),window.location.reload()}catch(i){console.warn("Error in removeSnippyly: ",i)}},this.signOutUser=async()=>{try{await Snippyly.signOutUser(),ri("snippyly-user"),this.snippylyUser=void 0,window.open(`https://snippyly-login-staging.web.app/?signout=true&redirect_url=${encodeURIComponent(window.location.href)}`,"_self")}catch(i){console.warn("Error in signOutUser: ",i)}},this.toggleMenu=(i,t)=>{try{i.stopPropagation(),this.menuOpenedId===t?this.menuOpenedId=void 0:this.menuOpenedId=t}catch(i){console.warn("Error in toggleMenu: ",i)}},this.copyLink=()=>{try{navigator.clipboard.writeText(window.location.href),this.copyLinkTooltip="Link copied!",setTimeout((()=>{this.copyLinkTooltip="Copy Link"}),2e3)}catch(i){console.warn("Error in copyLink: ",i)}};try{this.expanded=!0,this.setWindowEventListner(),this.urlChangeListener(),this.checkUrl(),console.log("*** Staging Mode ON! ***")}catch(i){console.warn("Error in constructor: ",i)}}get loadPlugin(){return this._loadPlugin}set loadPlugin(i){this._loadPlugin=i,this.loadPlugin?this.classList.add("visible"):this.classList.remove("visible")}get expanded(){return this._expanded}set expanded(i){this._expanded=i,this.expanded?this.classList.add("expanded"):this.classList.remove("expanded")}get menuOpenedId(){return this._menuOpenedId}set menuOpenedId(i){this._menuOpenedId=i,this.menuOpenedId?this.addWindowClickEventListener():this.removeWindowClickEventListener()}render(){var i,t,e,n,s,o,r,l,h,d,a,c;return this.loadPlugin?A`
|
|
57
|
+
<div class="snippyly-plugin-container ${ei({expanded:this.expanded,active:null===(i=this.snippylyUser)||void 0===i?void 0:i.userId})}">
|
|
58
|
+
<div class="snippyly-logo-container snippyly-menu-trigger" @click=${()=>this.toggleSnippylyPluginToolbar()}>
|
|
59
|
+
${this.expanded?null:A`
|
|
60
|
+
<svg width="8" height="5" viewBox="0 0 8 5" fill="none" xmlns="http://www.w3.org/2000/svg" class="arrow-icon">
|
|
61
|
+
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
62
|
+
d="M3.646 4.354L0.645996 1.354L1.354 0.646004L4 3.293L6.646 0.646004L7.354 1.354L4.354 4.354L4 4.707L3.646 4.354Z"
|
|
63
|
+
fill="#5B5B5B" />
|
|
64
|
+
</svg>
|
|
65
|
+
`}
|
|
66
|
+
<svg class="snippyly-logo" width="20" height="20" viewBox="0 0 20 20" fill="none"
|
|
67
|
+
xmlns="http://www.w3.org/2000/svg">
|
|
68
|
+
<path
|
|
69
|
+
d="M7.27564 0.223149C6.79031 0.00346224 6.25358 -0.0557657 5.73589 0.0532382C5.21819 0.162242 4.74372 0.434385 4.37475 0.833949C3.99784 1.2249 3.74112 1.72714 3.63818 2.275C3.53523 2.82287 3.59085 3.39088 3.79775 3.90475C3.99487 4.42252 4.33503 4.86527 4.77372 5.17507C5.21241 5.48487 5.72921 5.64732 6.25653 5.64115H8.91823V2.82595C8.92404 2.26743 8.77031 1.72008 8.4772 1.25563C8.1841 0.791185 7.76528 0.431303 7.27564 0.223149Z"
|
|
70
|
+
fill="#FFCB00" />
|
|
71
|
+
<path
|
|
72
|
+
d="M16.9736 3.72115C16.3509 3.06258 15.5579 2.61408 14.6946 2.43229C13.8313 2.25049 12.9365 2.34355 12.1231 2.69972C11.3097 3.05588 10.6143 3.65918 10.1246 4.43343C9.63489 5.20769 9.37289 6.11818 9.37167 7.04995V11.7611H13.8313C14.714 11.771 15.5791 11.4985 16.3131 10.9793C17.0471 10.46 17.616 9.7183 17.9451 8.85115C18.2892 7.9918 18.3806 7.04259 18.2072 6.12744C18.0339 5.21229 17.604 4.3737 16.9736 3.72115Z"
|
|
73
|
+
fill="#FF7162" />
|
|
74
|
+
<path
|
|
75
|
+
d="M14.4933 13.9835C14.2962 13.4652 13.956 13.0218 13.5172 12.7114C13.0783 12.401 12.5612 12.2379 12.0334 12.2435H9.37167V15.0611C9.36611 15.6198 9.52006 16.1671 9.81336 16.6316C10.1067 17.096 10.5256 17.4558 11.0154 17.6639C11.3431 17.8099 11.6949 17.8853 12.0504 17.8859C12.4867 17.8813 12.9153 17.7635 13.2987 17.5429C13.682 17.3223 14.0085 17.0057 14.2496 16.6206C14.4906 16.2356 14.6388 15.7939 14.6813 15.3342C14.7238 14.8745 14.6593 14.4107 14.4933 13.9835Z"
|
|
76
|
+
fill="#0DCF82" />
|
|
77
|
+
<path
|
|
78
|
+
d="M0.351589 9.03355C0.00514201 9.8932 -0.0880133 10.8436 0.0843205 11.7602C0.256654 12.6768 0.686445 13.517 1.31742 14.1708C1.72451 14.6098 2.20989 14.9589 2.74541 15.1979C3.28094 15.4368 3.85595 15.5608 4.4371 15.5628C5.03193 15.5613 5.62062 15.4353 6.16924 15.192C6.9885 14.8437 7.68929 14.2415 8.17981 13.4645C8.67033 12.6874 8.92771 11.7717 8.91823 10.8372V6.12115H4.46544C3.58239 6.11147 2.71718 6.38434 1.98312 6.90402C1.24906 7.4237 0.680388 8.16595 0.351589 9.03355Z"
|
|
79
|
+
fill="#A259FE" />
|
|
80
|
+
</svg>
|
|
81
|
+
${this.expanded?A`
|
|
82
|
+
<svg width="8" height="5" viewBox="0 0 8 5" fill="none" xmlns="http://www.w3.org/2000/svg" class="arrow-icon">
|
|
83
|
+
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
84
|
+
d="M3.646 4.354L0.645996 1.354L1.354 0.646004L4 3.293L6.646 0.646004L7.354 1.354L4.354 4.354L4 4.707L3.646 4.354Z"
|
|
85
|
+
fill="#5B5B5B" />
|
|
86
|
+
</svg>
|
|
87
|
+
`:null}
|
|
88
|
+
<div class="snippyly-menu snippyly-tooltip">
|
|
89
|
+
<div class="menu-item">${this.expanded?"Hide Toolbar":"Show Toolbar"}</div>
|
|
73
90
|
</div>
|
|
74
91
|
</div>
|
|
75
92
|
${this.expanded?A`
|
|
76
|
-
<div class="
|
|
93
|
+
<div class="snippyly-comment-tool-container snippyly-menu-trigger ${ei({disabled:!(null===(t=this.snippylyUser)||void 0===t?void 0:t.userId)})}">
|
|
77
94
|
<snippyly-comment-tool class="custom-tool">
|
|
78
|
-
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"
|
|
79
|
-
<path
|
|
95
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
96
|
+
<path
|
|
97
|
+
d="M1.944 16.75L3.64 13.992L3.927 13.527L3.69 13.034C3.225 12.083 2.993 11.124 3 10C3 6.134 6.134 3 10 3C13.866 3 17 6.134 17 10C17 13.866 13.866 17 10 17C8.86 17.007 7.888 16.768 6.926 16.291L6.658 16.16L6.362 16.197L1.944 16.749V16.75ZM6.487 17.19C7.547 17.708 8.74 18 10 18C14.418 18 18 14.418 18 10C18 5.582 14.418 2 10 2C5.582 2 2 5.582 2 10C2 11.243 2.283 12.419 2.789 13.468L0.672 16.908L0 18L1.272 17.841L6.487 17.189V17.19Z"
|
|
98
|
+
fill="#5B5B5B" />
|
|
80
99
|
</svg>
|
|
81
100
|
</snippyly-comment-tool>
|
|
101
|
+
<div class="snippyly-menu snippyly-tooltip">
|
|
102
|
+
<div class="menu-item">${(null===(e=this.snippylyUser)||void 0===e?void 0:e.userId)?"Add comments":"Sign in to add comments"}</div>
|
|
103
|
+
</div>
|
|
82
104
|
</div>
|
|
83
|
-
${(null===(
|
|
84
|
-
<div class="comments-
|
|
85
|
-
|
|
105
|
+
${(null===(n=this.comments)||void 0===n?void 0:n.length)?A`
|
|
106
|
+
<div class="snippyly-comments-container snippyly-menu-trigger">
|
|
107
|
+
<div class="comment-counter" @click=${()=>this.toggleCommentSidebar()}>
|
|
108
|
+
${null===(s=this.comments)||void 0===s?void 0:s.length} ${1===(null===(o=this.comments)||void 0===o?void 0:o.length)?"Comment":"Comments"}
|
|
109
|
+
</div>
|
|
110
|
+
<div class="snippyly-menu snippyly-tooltip">
|
|
111
|
+
<div class="menu-item">Toggle Sidebar</div>
|
|
112
|
+
</div>
|
|
86
113
|
</div>
|
|
87
114
|
`:null}
|
|
88
115
|
<div class="spacer"></div>
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
116
|
+
<div class="snippyly-presence-container snippyly-menu-trigger">
|
|
117
|
+
<snippyly-presence max-users="4"></snippyly-presence>
|
|
118
|
+
</div>
|
|
119
|
+
${(null===(r=this.snippylyUser)||void 0===r?void 0:r.userId)?A`
|
|
120
|
+
<div class="snippyly-share-container snippyly-menu-trigger" @click=${()=>this.copyLink()}>
|
|
121
|
+
<button class="snippyly-btn snippyly-primary-btn signin-btn">
|
|
122
|
+
Share
|
|
123
|
+
</button>
|
|
124
|
+
<div class="snippyly-menu snippyly-tooltip">
|
|
125
|
+
<div class="menu-item">${this.copyLinkTooltip}</div>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
`:null}
|
|
129
|
+
${(null===(l=this.snippylyUser)||void 0===l?void 0:l.userId)?null:A`
|
|
130
|
+
<div class="snippyly-signin-container snippyly-menu-trigger">
|
|
131
|
+
<button class="snippyly-btn snippyly-primary-btn signin-btn" @click=${()=>this.loginWithGoogle()}>
|
|
132
|
+
Sign in
|
|
133
|
+
</button>
|
|
97
134
|
</div>
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
</div>
|
|
105
|
-
`:A`
|
|
106
|
-
<button class="btn primary-btn signin-btn" @click=${()=>this.loginWithGoogle()}>
|
|
107
|
-
Sign in
|
|
108
|
-
</button>
|
|
109
|
-
`}
|
|
135
|
+
`}
|
|
136
|
+
`:null}
|
|
137
|
+
|
|
138
|
+
<div class="snippyly-menu-container snippyly-menu-trigger ${ei({opened:"userMenu"===this.menuOpenedId})}" id="userMenu" @click=${i=>this.toggleMenu(i,"userMenu")}>
|
|
139
|
+
${this.expanded&&(null===(h=this.snippylyUser)||void 0===h?void 0:h.photoUrl)?A`
|
|
140
|
+
<img src=${null===(d=this.snippylyUser)||void 0===d?void 0:d.photoUrl} class="profile-img" referrerpolicy="no-referrer" title=${null===(a=this.snippylyUser)||void 0===a?void 0:a.name} />
|
|
110
141
|
`:null}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
142
|
+
<svg width="4" height="14" viewBox="0 0 4 14" fill="none" xmlns="http://www.w3.org/2000/svg"
|
|
143
|
+
class="more-menu-icon">
|
|
144
|
+
<path
|
|
145
|
+
d="M3.5 12C3.5 12.3978 3.34196 12.7794 3.06066 13.0607C2.77936 13.342 2.39782 13.5 2 13.5C1.60218 13.5 1.22064 13.342 0.93934 13.0607C0.658035 12.7794 0.5 12.3978 0.5 12C0.5 11.6022 0.658035 11.2206 0.93934 10.9393C1.22064 10.658 1.60218 10.5 2 10.5C2.39782 10.5 2.77936 10.658 3.06066 10.9393C3.34196 11.2206 3.5 11.6022 3.5 12ZM3.5 7C3.5 7.39782 3.34196 7.77936 3.06066 8.06066C2.77936 8.34196 2.39782 8.5 2 8.5C1.60218 8.5 1.22064 8.34196 0.93934 8.06066C0.658035 7.77936 0.5 7.39782 0.5 7C0.5 6.60218 0.658035 6.22064 0.93934 5.93934C1.22064 5.65804 1.60218 5.5 2 5.5C2.39782 5.5 2.77936 5.65804 3.06066 5.93934C3.34196 6.22064 3.5 6.60218 3.5 7ZM3.5 2C3.5 2.39782 3.34196 2.77936 3.06066 3.06066C2.77936 3.34196 2.39782 3.5 2 3.5C1.60218 3.5 1.22064 3.34196 0.93934 3.06066C0.658035 2.77936 0.5 2.39782 0.5 2C0.5 1.60218 0.658035 1.22064 0.93934 0.93934C1.22064 0.658035 1.60218 0.5 2 0.5C2.39782 0.5 2.77936 0.658035 3.06066 0.93934C3.34196 1.22064 3.5 1.60218 3.5 2Z"
|
|
146
|
+
fill="black" />
|
|
147
|
+
</svg>
|
|
148
|
+
<div class="snippyly-menu">
|
|
149
|
+
<div class="menu-item" @click=${()=>this.toggleSnippylyPluginToolbar()}>${this.expanded?"Hide Toolbar":"Show Toolbar"}</div>
|
|
150
|
+
<div class="menu-item" @click=${()=>this.removeSnippyly()}>Exit Review Mode</div>
|
|
151
|
+
${(null===(c=this.snippylyUser)||void 0===c?void 0:c.userId)?A`
|
|
152
|
+
<div class="menu-item-divider"></div>
|
|
153
|
+
<div class="menu-item" @click=${()=>this.signOutUser()}>Sign out</div>
|
|
154
|
+
`:null}
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
`:A``}};hi.styles=((i,...e)=>{const s=1===i.length?i[0]:e.reduce(((t,e,n)=>t+(i=>{if(!0===i._$cssResult$)return i.cssText;if("number"==typeof i)return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(e)+i[n+1]),i[0]);return new n(s,t)})`
|
|
159
|
+
|
|
160
|
+
@import url('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');
|
|
161
|
+
|
|
162
|
+
* {
|
|
163
|
+
font-family: 'Poppins', sans-serif;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.snippyly-plugin-container {
|
|
167
|
+
height: 3.5rem;
|
|
168
|
+
background-color: white;
|
|
169
|
+
position: fixed;
|
|
170
|
+
bottom: 0;
|
|
171
|
+
right: 0;
|
|
172
|
+
z-index: 99999999;
|
|
173
|
+
margin: 1.5rem;
|
|
174
|
+
border-radius: 0.5rem;
|
|
175
|
+
border: 1px solid rgba(0, 0, 0, 0.12);
|
|
176
|
+
display: flex;
|
|
177
|
+
box-sizing: border-box;
|
|
178
|
+
align-items: center;
|
|
179
|
+
z-index: 999999995;
|
|
180
|
+
box-shadow: 0 1rem 3rem #0000002d;
|
|
181
|
+
margin-bottom: 3rem; // Added to prevent overlap between plugin UI and webflow badge
|
|
182
|
+
/* overflow: hidden; */
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.snippyly-plugin-container.expanded {
|
|
186
|
+
min-width: 30rem;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.snippyly-plugin-container>* {
|
|
190
|
+
display: flex;
|
|
191
|
+
align-items: center;
|
|
192
|
+
padding: 0 0.5rem;
|
|
193
|
+
height: 100%;
|
|
194
|
+
position: relative;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.snippyly-logo-container {
|
|
198
|
+
display: flex;
|
|
199
|
+
align-items: center;
|
|
200
|
+
/* padding: 1rem; */
|
|
201
|
+
height: 100%;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.snippyly-plugin-container.expanded .snippyly-logo-container {
|
|
205
|
+
border-right: 1px solid rgba(0, 0, 0, 0.12);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.snippyly-logo-container:hover,
|
|
209
|
+
.snippyly-comment-tool-container:hover,
|
|
210
|
+
.snippyly-menu-container:hover {
|
|
211
|
+
background-color: #f5f5f5;
|
|
212
|
+
cursor: pointer;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.snippyly-logo-container {
|
|
216
|
+
border-top-left-radius: 0.5rem;
|
|
217
|
+
border-bottom-left-radius: 0.5rem;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.snippyly-menu-container {
|
|
221
|
+
border-top-right-radius: 0.5rem;
|
|
222
|
+
border-bottom-right-radius: 0.5rem;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.snippyly-plugin-container.expanded .snippyly-logo {
|
|
226
|
+
margin-right: 0.5rem;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.snippyly-plugin-container:not(.expanded) .snippyly-logo {
|
|
230
|
+
margin-left: 0.5rem;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.snippyly-comment-tool-container {
|
|
234
|
+
padding: 0;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
snippyly-comment-tool {
|
|
238
|
+
height: 100%;
|
|
239
|
+
padding: 1rem;
|
|
240
|
+
box-sizing: border-box;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.snippyly-comments-container {
|
|
244
|
+
padding-left: 0.5rem;
|
|
245
|
+
padding-right: 0.5rem;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.comment-counter {
|
|
249
|
+
border: 1px solid rgb(0, 0, 0, 0.25);
|
|
250
|
+
padding: 0.3rem 0.5rem;
|
|
251
|
+
border-radius: 0.5rem;
|
|
252
|
+
font-size: 0.8rem;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.comment-counter:hover {
|
|
256
|
+
background-color: #f5f5f5;
|
|
257
|
+
cursor: pointer;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.snippyly-btn {
|
|
261
|
+
cursor: pointer;
|
|
262
|
+
padding: 0.3rem 0.5rem;
|
|
263
|
+
font-size: 0.8rem;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.snippyly-primary-btn {
|
|
267
|
+
/* height: 36px; */
|
|
268
|
+
background: rgb(24, 160, 251);
|
|
269
|
+
border-radius: 6px;
|
|
270
|
+
border: 0;
|
|
271
|
+
box-shadow: none;
|
|
272
|
+
outline: none;
|
|
273
|
+
/* padding: 0 12px; */
|
|
274
|
+
color: white;
|
|
275
|
+
/* margin: 0 12px; */
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.snippyly-menu-trigger {
|
|
279
|
+
position: relative;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
.snippyly-menu-trigger:hover .snippyly-menu, .snippyly-menu-trigger.opened .snippyly-menu {
|
|
283
|
+
display: block;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.snippyly-menu {
|
|
287
|
+
position: absolute;
|
|
288
|
+
background: #222222;
|
|
289
|
+
color: white;
|
|
290
|
+
top: 0;
|
|
291
|
+
left: 50%;
|
|
292
|
+
white-space: nowrap;
|
|
293
|
+
transform: translate(-50%, calc(-100% - 1rem));
|
|
294
|
+
display: none;
|
|
295
|
+
border-radius: 4px;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.menu-item {
|
|
299
|
+
padding: 0.25rem 0.5rem;
|
|
300
|
+
cursor: pointer;
|
|
301
|
+
font-size: 0.8rem;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.menu-item:first-child {
|
|
305
|
+
padding-top: 0.5rem;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.menu-item:last-child {
|
|
309
|
+
padding-bottom: 0.5rem;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.menu-item-divider {
|
|
313
|
+
background: black;
|
|
314
|
+
height: 1px;
|
|
315
|
+
margin: 0.2rem 0;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.snippyly-menu:not(.snippyly-tooltip):after {
|
|
319
|
+
content: '';
|
|
320
|
+
position: absolute;
|
|
321
|
+
display: block;
|
|
322
|
+
width: 0px;
|
|
323
|
+
z-index: 1;
|
|
324
|
+
border-style: solid;
|
|
325
|
+
border-color: #222222 transparent;
|
|
326
|
+
border-width: 8px 8px 0px;
|
|
327
|
+
bottom: -7px;
|
|
328
|
+
left: 50%;
|
|
329
|
+
transform: translateX(-50%);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.spacer {
|
|
333
|
+
flex: 1 0 auto;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.profile-img {
|
|
337
|
+
width: 1.5rem;
|
|
338
|
+
height: 1.5rem;
|
|
339
|
+
border-radius: 100%;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.snippyly-logo-container.snippyly-menu-trigger .snippyly-menu {
|
|
343
|
+
left: 85%;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.snippyly-logo-container.snippyly-menu-trigger .snippyly-menu:after {
|
|
347
|
+
left: 30%;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.snippyly-menu-container.snippyly-menu-trigger .snippyly-menu {
|
|
351
|
+
left: -50%;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.snippyly-plugin-container.expanded.active .snippyly-menu-container.snippyly-menu-trigger .snippyly-menu {
|
|
355
|
+
left: 5%;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.snippyly-menu-container.snippyly-menu-trigger .snippyly-menu:after {
|
|
359
|
+
left: 75%;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.more-menu-icon {
|
|
363
|
+
margin: 0.5rem;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.disabled {
|
|
367
|
+
cursor: not-allowed !important;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.arrow-icon {
|
|
371
|
+
transform: rotate(90deg);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.snippyly-plugin-container.expanded .arrow-icon {
|
|
375
|
+
transform: rotate(270deg);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
snippyly-presence {
|
|
379
|
+
display: flex;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.s-presence-container {
|
|
383
|
+
display: inline-flex;
|
|
384
|
+
flex-direction: row-reverse;
|
|
385
|
+
align-items: center;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.s-presence-avatar {
|
|
389
|
+
position: relative;
|
|
390
|
+
box-shadow: 0px 0px 0px 3px;
|
|
391
|
+
border-radius: 50%;
|
|
392
|
+
overflow: hidden;
|
|
393
|
+
width: 24px;
|
|
394
|
+
height: 24px;
|
|
395
|
+
display: flex;
|
|
396
|
+
align-items: center;
|
|
397
|
+
justify-content: center;
|
|
398
|
+
font-size: 12px;
|
|
399
|
+
// background-color: white;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.s-presence-avatar.more-users {
|
|
403
|
+
background: #4578a7;
|
|
404
|
+
box-shadow: 0px 0px 0px 3px #4578a7;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.s-presence-avatar:not(:last-child):not(.more-users) {
|
|
408
|
+
margin-left: -6px !important;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.s-presence-avatar-image {
|
|
412
|
+
width: 100%;
|
|
413
|
+
height: auto;
|
|
414
|
+
display: block;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.s-presence-avatar-image-small {
|
|
418
|
+
width: 1.6rem;
|
|
419
|
+
height: auto;
|
|
420
|
+
display: block;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.s-presence-avatar-initial {
|
|
424
|
+
color: white;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.away {
|
|
428
|
+
filter: grayscale(1);
|
|
429
|
+
}
|
|
430
|
+
`,li([Y()],hi.prototype,"loadPlugin",null),li([Y()],hi.prototype,"comments",void 0),li([Y()],hi.prototype,"commentElement",void 0),li([Y()],hi.prototype,"_expanded",void 0),li([Y()],hi.prototype,"snippylyUser",void 0),li([Q()],hi.prototype,"apiKey",void 0),li([Y()],hi.prototype,"staging",void 0),li([Y()],hi.prototype,"_menuOpenedId",void 0),li([Y()],hi.prototype,"copyLinkTooltip",void 0),hi=li([(i=>t=>"function"==typeof t?((i,t)=>(window.customElements.define(i,t),t))(i,t):((i,t)=>{const{kind:e,elements:n}=t;return{kind:e,elements:n,finisher(t){window.customElements.define(i,t)}}})(i,t))("snippyly-plugin")],hi);export{hi as SnippylyPlugin};
|