pushfeedback 0.0.1 → 0.0.2

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-ecaab1ef.js');
5
+ const index = require('./index-cb138587.js');
6
6
 
7
7
  const feedbackButtonCss = ".feedback-button-content{cursor:pointer;background-color:var(--feedback-button-bg-color);border:1px solid var(--feedback-button-border-color);border-radius:var(--feedback-button-border-radius);color:var(--feedback-button-text-color);cursor:pointer;font-size:var(--feedback-modal-button-font-size);padding:5px 10px}.feedback-button-content:hover{color:var(--feedback-button-text-color-active);background-color:var(--feedback-button-bg-color-active);border:1px solid var(--feedback-button-border-color-active)}";
8
8
 
@@ -69,6 +69,18 @@ const isComplexType = (o) => {
69
69
  o = typeof o;
70
70
  return o === 'object' || o === 'function';
71
71
  };
72
+ /**
73
+ * Helper method for querying a `meta` tag that contains a nonce value
74
+ * out of a DOM's head.
75
+ *
76
+ * @param doc The DOM containing the `head` to query against
77
+ * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
78
+ * exists or the tag has no content.
79
+ */
80
+ function queryNonceMetaTagContent(doc) {
81
+ var _a, _b, _c;
82
+ return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
83
+ }
72
84
  /**
73
85
  * Production h() function based on Preact by
74
86
  * Jason Miller (@developit)
@@ -77,7 +89,6 @@ const isComplexType = (o) => {
77
89
  *
78
90
  * Modified for Stencil's compiler and vdom
79
91
  */
80
- // const stack: any[] = [];
81
92
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
82
93
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
83
94
  const h = (nodeName, vnodeData, ...children) => {
@@ -136,6 +147,14 @@ const h = (nodeName, vnodeData, ...children) => {
136
147
  }
137
148
  return vnode;
138
149
  };
150
+ /**
151
+ * A utility function for creating a virtual DOM node from a tag and some
152
+ * possible text content.
153
+ *
154
+ * @param tag the tag for this element
155
+ * @param text possible text content for the node
156
+ * @returns a newly-minted virtual DOM node
157
+ */
139
158
  const newVNode = (tag, text) => {
140
159
  const vnode = {
141
160
  $flags$: 0,
@@ -153,6 +172,12 @@ const newVNode = (tag, text) => {
153
172
  return vnode;
154
173
  };
155
174
  const Host = {};
175
+ /**
176
+ * Check whether a given node is a Host node or not
177
+ *
178
+ * @param node the virtual DOM node to check
179
+ * @returns whether it's a Host node or not
180
+ */
156
181
  const isHost = (node) => node && node.$tag$ === Host;
157
182
  /**
158
183
  * Parse a new property value for a given property type.
@@ -227,6 +252,7 @@ const registerStyle = (scopeId, cssText, allowCS) => {
227
252
  styles.set(scopeId, style);
228
253
  };
229
254
  const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
255
+ var _a;
230
256
  let scopeId = getScopeId(cmpMeta);
231
257
  const style = styles.get(scopeId);
232
258
  // if an element is NOT connected then getRootNode() will return the wrong root node
@@ -246,6 +272,11 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
246
272
  styleElm = doc.createElement('style');
247
273
  styleElm.innerHTML = style;
248
274
  }
275
+ // Apply CSP nonce to the style tag if it exists
276
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
277
+ if (nonce != null) {
278
+ styleElm.setAttribute('nonce', nonce);
279
+ }
249
280
  styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
250
281
  }
251
282
  if (appliedStyles) {
@@ -514,6 +545,21 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
514
545
  }
515
546
  return elm;
516
547
  };
548
+ /**
549
+ * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
550
+ * add them to the DOM in the appropriate place.
551
+ *
552
+ * @param parentElm the DOM node which should be used as a parent for the new
553
+ * DOM nodes
554
+ * @param before a child of the `parentElm` which the new children should be
555
+ * inserted before (optional)
556
+ * @param parentVNode the parent virtual DOM node
557
+ * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
558
+ * @param startIdx the index in the child virtual DOM nodes at which to start
559
+ * creating DOM nodes (inclusive)
560
+ * @param endIdx the index in the child virtual DOM nodes at which to stop
561
+ * creating DOM nodes (inclusive)
562
+ */
517
563
  const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
518
564
  let containerElm = (parentElm);
519
565
  let childNode;
@@ -530,6 +576,19 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
530
576
  }
531
577
  }
532
578
  };
579
+ /**
580
+ * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
581
+ * This can be used to, for instance, clean up after a list of children which
582
+ * should no longer be shown.
583
+ *
584
+ * This function also handles some of Stencil's slot relocation logic.
585
+ *
586
+ * @param vnodes a list of virtual DOM nodes to remove
587
+ * @param startIdx the index at which to start removing nodes (inclusive)
588
+ * @param endIdx the index at which to stop removing nodes (inclusive)
589
+ * @param vnode a VNode
590
+ * @param elm an element
591
+ */
533
592
  const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
534
593
  for (; startIdx <= endIdx; ++startIdx) {
535
594
  if ((vnode = vnodes[startIdx])) {
@@ -759,7 +818,8 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
759
818
  *
760
819
  * So, in other words, if `key` attrs are not set on VNodes which may be
761
820
  * changing order within a `children` array or something along those lines then
762
- * we could obtain a false positive and then have to do needless re-rendering.
821
+ * we could obtain a false negative and then have to do needless re-rendering
822
+ * (i.e. we'd say two VNodes aren't equal when in fact they should be).
763
823
  *
764
824
  * @param leftVNode the first VNode to check
765
825
  * @param rightVNode the second VNode to check
@@ -840,6 +900,18 @@ const callNodeRefs = (vNode) => {
840
900
  vNode.$children$ && vNode.$children$.map(callNodeRefs);
841
901
  }
842
902
  };
903
+ /**
904
+ * The main entry point for Stencil's virtual DOM-based rendering engine
905
+ *
906
+ * Given a {@link d.HostRef} container and some virtual DOM nodes, this
907
+ * function will handle creating a virtual DOM tree with a single root, patching
908
+ * the current virtual DOM tree onto an old one (if any), dealing with slot
909
+ * relocation, and reflecting attributes.
910
+ *
911
+ * @param hostRef data needed to root and render the virtual DOM tree, such as
912
+ * the DOM node into which it should be rendered.
913
+ * @param renderFnResults the virtual DOM nodes to be rendered
914
+ */
843
915
  const renderVdom = (hostRef, renderFnResults) => {
844
916
  const hostElm = hostRef.$hostElement$;
845
917
  const cmpMeta = hostRef.$cmpMeta$;
@@ -1262,6 +1334,7 @@ const disconnectedCallback = (elm) => {
1262
1334
  }
1263
1335
  };
1264
1336
  const bootstrapLazy = (lazyBundles, options = {}) => {
1337
+ var _a;
1265
1338
  const endBootstrap = createTime();
1266
1339
  const cmpTags = [];
1267
1340
  const exclude = options.exclude || [];
@@ -1338,6 +1411,11 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1338
1411
  {
1339
1412
  visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
1340
1413
  visibilityStyle.setAttribute('data-styles', '');
1414
+ // Apply CSP nonce to the style tag if it exists
1415
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
1416
+ if (nonce != null) {
1417
+ visibilityStyle.setAttribute('nonce', nonce);
1418
+ }
1341
1419
  head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
1342
1420
  }
1343
1421
  // Process deferred connectedCallbacks now all components have been registered
@@ -1353,6 +1431,13 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1353
1431
  // Fallback appLoad event
1354
1432
  endBootstrap();
1355
1433
  };
1434
+ /**
1435
+ * Assigns the given value to the nonce property on the runtime platform object.
1436
+ * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
1437
+ * @param nonce The value to be assigned to the platform nonce property.
1438
+ * @returns void
1439
+ */
1440
+ const setNonce = (nonce) => (plt.$nonce$ = nonce);
1356
1441
  const hostRefs = /*@__PURE__*/ new WeakMap();
1357
1442
  const getHostRef = (ref) => hostRefs.get(ref);
1358
1443
  const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
@@ -1464,3 +1549,4 @@ exports.bootstrapLazy = bootstrapLazy;
1464
1549
  exports.h = h;
1465
1550
  exports.promiseResolve = promiseResolve;
1466
1551
  exports.registerInstance = registerInstance;
1552
+ exports.setNonce = setNonce;
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-ecaab1ef.js');
5
+ const index = require('./index-cb138587.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Esm v2.20.0 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchEsm = () => {
11
11
  return index.promiseResolve();
@@ -18,4 +18,5 @@ const defineCustomElements = (win, options) => {
18
18
  });
19
19
  };
20
20
 
21
+ exports.setNonce = index.setNonce;
21
22
  exports.defineCustomElements = defineCustomElements;
@@ -1,9 +1,11 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-ecaab1ef.js');
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-cb138587.js');
4
6
 
5
7
  /*
6
- Stencil Client Patch Browser v2.20.0 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
7
9
  */
8
10
  const patchBrowser = () => {
9
11
  const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('pushfeedback.cjs.js', document.baseURI).href));
@@ -17,3 +19,5 @@ const patchBrowser = () => {
17
19
  patchBrowser().then(options => {
18
20
  return index.bootstrapLazy([["feedback-button_2.cjs",[[1,"feedback-button",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"feedbackModal":[32]}],[1,"feedback-modal",{"modalTitle":[1,"modal-title"],"successModalTitle":[1,"success-modal-title"],"errorModalTitle":[1,"error-modal-title"],"modalPosition":[1,"modal-position"],"sendButtonText":[1,"send-button-text"],"project":[1],"screenshotButtonTooltipText":[1,"screenshot-button-tooltip-text"],"screenshotTopbarText":[1,"screenshot-topbar-text"],"email":[1],"emailPlaceholder":[1,"email-placeholder"],"messagePlaceholder":[1,"message-placeholder"],"showModal":[1540,"show-modal"],"showScreenshotMode":[1540,"show-screenshot-mode"],"hasSelectedElement":[1540,"has-selected-element"],"sending":[32],"formMessage":[32],"formEmail":[32],"formSuccess":[32],"formError":[32],"encodedScreenshot":[32]}]]]], options);
19
21
  });
22
+
23
+ exports.setNonce = index.setNonce;
@@ -5,8 +5,8 @@
5
5
  ],
6
6
  "compiler": {
7
7
  "name": "@stencil/core",
8
- "version": "2.20.0",
9
- "typescriptVersion": "4.8.4"
8
+ "version": "2.22.3",
9
+ "typescriptVersion": "4.9.4"
10
10
  },
11
11
  "collections": [],
12
12
  "bundles": []
@@ -14,6 +14,15 @@ export { FeedbackModal as FeedbackModal } from '../types/components/feedback-mod
14
14
  */
15
15
  export declare const setAssetPath: (path: string) => void;
16
16
 
17
+ /**
18
+ * Used to specify a nonce value that corresponds with an application's CSP.
19
+ * When set, the nonce will be added to all dynamically created script and style tags at runtime.
20
+ * Alternatively, the nonce value can be set on a meta tag in the DOM head
21
+ * (<meta name="csp-nonce" content="{ nonce value here }" />) which
22
+ * will result in the same behavior.
23
+ */
24
+ export declare const setNonce: (nonce: string) => void
25
+
17
26
  export interface SetPlatformOptions {
18
27
  raf?: (c: FrameRequestCallback) => number;
19
28
  ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
@@ -1,3 +1,3 @@
1
- export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
1
+ export { setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
2
2
  export { FeedbackButton, defineCustomElement as defineCustomElementFeedbackButton } from './feedback-button.js';
3
3
  export { FeedbackModal, defineCustomElement as defineCustomElementFeedbackModal } from './feedback-modal.js';
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host } from './index-4051fc1e.js';
1
+ import { r as registerInstance, h, H as Host } from './index-a9d8de87.js';
2
2
 
3
3
  const feedbackButtonCss = ".feedback-button-content{cursor:pointer;background-color:var(--feedback-button-bg-color);border:1px solid var(--feedback-button-border-color);border-radius:var(--feedback-button-border-radius);color:var(--feedback-button-text-color);cursor:pointer;font-size:var(--feedback-modal-button-font-size);padding:5px 10px}.feedback-button-content:hover{color:var(--feedback-button-text-color-active);background-color:var(--feedback-button-bg-color-active);border:1px solid var(--feedback-button-border-color-active)}";
4
4
 
@@ -47,6 +47,18 @@ const isComplexType = (o) => {
47
47
  o = typeof o;
48
48
  return o === 'object' || o === 'function';
49
49
  };
50
+ /**
51
+ * Helper method for querying a `meta` tag that contains a nonce value
52
+ * out of a DOM's head.
53
+ *
54
+ * @param doc The DOM containing the `head` to query against
55
+ * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
56
+ * exists or the tag has no content.
57
+ */
58
+ function queryNonceMetaTagContent(doc) {
59
+ var _a, _b, _c;
60
+ return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
61
+ }
50
62
  /**
51
63
  * Production h() function based on Preact by
52
64
  * Jason Miller (@developit)
@@ -55,7 +67,6 @@ const isComplexType = (o) => {
55
67
  *
56
68
  * Modified for Stencil's compiler and vdom
57
69
  */
58
- // const stack: any[] = [];
59
70
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
60
71
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
61
72
  const h = (nodeName, vnodeData, ...children) => {
@@ -114,6 +125,14 @@ const h = (nodeName, vnodeData, ...children) => {
114
125
  }
115
126
  return vnode;
116
127
  };
128
+ /**
129
+ * A utility function for creating a virtual DOM node from a tag and some
130
+ * possible text content.
131
+ *
132
+ * @param tag the tag for this element
133
+ * @param text possible text content for the node
134
+ * @returns a newly-minted virtual DOM node
135
+ */
117
136
  const newVNode = (tag, text) => {
118
137
  const vnode = {
119
138
  $flags$: 0,
@@ -131,6 +150,12 @@ const newVNode = (tag, text) => {
131
150
  return vnode;
132
151
  };
133
152
  const Host = {};
153
+ /**
154
+ * Check whether a given node is a Host node or not
155
+ *
156
+ * @param node the virtual DOM node to check
157
+ * @returns whether it's a Host node or not
158
+ */
134
159
  const isHost = (node) => node && node.$tag$ === Host;
135
160
  /**
136
161
  * Parse a new property value for a given property type.
@@ -205,6 +230,7 @@ const registerStyle = (scopeId, cssText, allowCS) => {
205
230
  styles.set(scopeId, style);
206
231
  };
207
232
  const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
233
+ var _a;
208
234
  let scopeId = getScopeId(cmpMeta);
209
235
  const style = styles.get(scopeId);
210
236
  // if an element is NOT connected then getRootNode() will return the wrong root node
@@ -224,6 +250,11 @@ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
224
250
  styleElm = doc.createElement('style');
225
251
  styleElm.innerHTML = style;
226
252
  }
253
+ // Apply CSP nonce to the style tag if it exists
254
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
255
+ if (nonce != null) {
256
+ styleElm.setAttribute('nonce', nonce);
257
+ }
227
258
  styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
228
259
  }
229
260
  if (appliedStyles) {
@@ -492,6 +523,21 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
492
523
  }
493
524
  return elm;
494
525
  };
526
+ /**
527
+ * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
528
+ * add them to the DOM in the appropriate place.
529
+ *
530
+ * @param parentElm the DOM node which should be used as a parent for the new
531
+ * DOM nodes
532
+ * @param before a child of the `parentElm` which the new children should be
533
+ * inserted before (optional)
534
+ * @param parentVNode the parent virtual DOM node
535
+ * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
536
+ * @param startIdx the index in the child virtual DOM nodes at which to start
537
+ * creating DOM nodes (inclusive)
538
+ * @param endIdx the index in the child virtual DOM nodes at which to stop
539
+ * creating DOM nodes (inclusive)
540
+ */
495
541
  const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
496
542
  let containerElm = (parentElm);
497
543
  let childNode;
@@ -508,6 +554,19 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
508
554
  }
509
555
  }
510
556
  };
557
+ /**
558
+ * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
559
+ * This can be used to, for instance, clean up after a list of children which
560
+ * should no longer be shown.
561
+ *
562
+ * This function also handles some of Stencil's slot relocation logic.
563
+ *
564
+ * @param vnodes a list of virtual DOM nodes to remove
565
+ * @param startIdx the index at which to start removing nodes (inclusive)
566
+ * @param endIdx the index at which to stop removing nodes (inclusive)
567
+ * @param vnode a VNode
568
+ * @param elm an element
569
+ */
511
570
  const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
512
571
  for (; startIdx <= endIdx; ++startIdx) {
513
572
  if ((vnode = vnodes[startIdx])) {
@@ -737,7 +796,8 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
737
796
  *
738
797
  * So, in other words, if `key` attrs are not set on VNodes which may be
739
798
  * changing order within a `children` array or something along those lines then
740
- * we could obtain a false positive and then have to do needless re-rendering.
799
+ * we could obtain a false negative and then have to do needless re-rendering
800
+ * (i.e. we'd say two VNodes aren't equal when in fact they should be).
741
801
  *
742
802
  * @param leftVNode the first VNode to check
743
803
  * @param rightVNode the second VNode to check
@@ -818,6 +878,18 @@ const callNodeRefs = (vNode) => {
818
878
  vNode.$children$ && vNode.$children$.map(callNodeRefs);
819
879
  }
820
880
  };
881
+ /**
882
+ * The main entry point for Stencil's virtual DOM-based rendering engine
883
+ *
884
+ * Given a {@link d.HostRef} container and some virtual DOM nodes, this
885
+ * function will handle creating a virtual DOM tree with a single root, patching
886
+ * the current virtual DOM tree onto an old one (if any), dealing with slot
887
+ * relocation, and reflecting attributes.
888
+ *
889
+ * @param hostRef data needed to root and render the virtual DOM tree, such as
890
+ * the DOM node into which it should be rendered.
891
+ * @param renderFnResults the virtual DOM nodes to be rendered
892
+ */
821
893
  const renderVdom = (hostRef, renderFnResults) => {
822
894
  const hostElm = hostRef.$hostElement$;
823
895
  const cmpMeta = hostRef.$cmpMeta$;
@@ -1240,6 +1312,7 @@ const disconnectedCallback = (elm) => {
1240
1312
  }
1241
1313
  };
1242
1314
  const bootstrapLazy = (lazyBundles, options = {}) => {
1315
+ var _a;
1243
1316
  const endBootstrap = createTime();
1244
1317
  const cmpTags = [];
1245
1318
  const exclude = options.exclude || [];
@@ -1316,6 +1389,11 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1316
1389
  {
1317
1390
  visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
1318
1391
  visibilityStyle.setAttribute('data-styles', '');
1392
+ // Apply CSP nonce to the style tag if it exists
1393
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
1394
+ if (nonce != null) {
1395
+ visibilityStyle.setAttribute('nonce', nonce);
1396
+ }
1319
1397
  head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
1320
1398
  }
1321
1399
  // Process deferred connectedCallbacks now all components have been registered
@@ -1331,6 +1409,13 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1331
1409
  // Fallback appLoad event
1332
1410
  endBootstrap();
1333
1411
  };
1412
+ /**
1413
+ * Assigns the given value to the nonce property on the runtime platform object.
1414
+ * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
1415
+ * @param nonce The value to be assigned to the platform nonce property.
1416
+ * @returns void
1417
+ */
1418
+ const setNonce = (nonce) => (plt.$nonce$ = nonce);
1334
1419
  const hostRefs = /*@__PURE__*/ new WeakMap();
1335
1420
  const getHostRef = (ref) => hostRefs.get(ref);
1336
1421
  const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
@@ -1437,4 +1522,4 @@ const flush = () => {
1437
1522
  const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1438
1523
  const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1439
1524
 
1440
- export { Host as H, bootstrapLazy as b, h, promiseResolve as p, registerInstance as r };
1525
+ export { Host as H, bootstrapLazy as b, h, promiseResolve as p, registerInstance as r, setNonce as s };
@@ -1,7 +1,8 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-4051fc1e.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-a9d8de87.js';
2
+ export { s as setNonce } from './index-a9d8de87.js';
2
3
 
3
4
  /*
4
- Stencil Client Patch Esm v2.20.0 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
5
6
  */
6
7
  const patchEsm = () => {
7
8
  return promiseResolve();
@@ -1 +1 @@
1
- var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r)}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@",VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return{start:s,end:s+n[0].length}}return null}function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return{start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t)}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else{if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s)}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value}))}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0)})),!t)return"break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return[];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t})})),t++})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o})}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.slice(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors)})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return{original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return!1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t))}))}function reScope(e,t){var r=e.template.map((function(r){return"string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\.".concat(t),".".concat(r))}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t)}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t)})).observe(document.head,{childList:!0})}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove()}})).catch((function(e){console.error(e)}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}))}))})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal()}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal()},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t="".concat(s.scopeId,"-").concat(this.count),o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e)},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n)}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes)},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document))}("undefined"!=typeof window&&window);
1
+ var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},__assign.apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r)}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@",VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return{start:s,end:s+n[0].length}}return null}function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return{start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t)}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else{if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s)}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value}))}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0)})),!t)return"break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return[];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t})})),t++})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o})}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.slice(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors)})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return{original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return!1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t))}))}function reScope(e,t){var r=e.template.map((function(r){return"string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\.".concat(t),".".concat(r))}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t)}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t)})).observe(document.head,{childList:!0})}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove()}})).catch((function(e){console.error(e)}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}))}))})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal()}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal()},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t="".concat(s.scopeId,"-").concat(this.count),o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e)},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n)}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes)},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document))}("undefined"!=typeof window&&window);
@@ -1,7 +1,8 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-4051fc1e.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-a9d8de87.js';
2
+ export { s as setNonce } from './index-a9d8de87.js';
2
3
 
3
4
  /*
4
- Stencil Client Patch Browser v2.20.0 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
5
6
  */
6
7
  const patchBrowser = () => {
7
8
  const importMeta = import.meta.url;
@@ -0,0 +1 @@
1
+ import{r as e,h as t,H as o}from"./p-6aedd58b.js";const n=class{constructor(t){e(this,t),this.feedbackModal=void 0,this.modalTitle="Share your feedback",this.successModalTitle="Thanks for your feedback!",this.errorModalTitle="Oops! We didn't receive your feedback. Please try again later.",this.modalPosition="center",this.sendButtonText="Send",this.project="",this.screenshotButtonTooltipText="Take a Screenshot",this.screenshotTopbarText="SELECT AN ELEMENT ON THE PAGE",this.email="",this.emailPlaceholder="Email address (optional)",this.messagePlaceholder="How could this page be more helpful?"}componentDidLoad(){this.feedbackModal.showModal=!1}showModal(){this.feedbackModal.showModal=!0}render(){let e={};return["modalTitle","successModalTitle","errorModalTitle","modalPosition","sendButtonText","project","screenshotButtonTooltipText","screenshotTopbarText","email","emailPlaceholder","messagePlaceholder","showModal"].forEach((t=>{e[t]=this[t]})),t(o,null,t("a",{class:"feedback-button-content",onClick:()=>this.showModal()},t("slot",null)),t("feedback-modal",Object.assign({},e,{ref:e=>this.feedbackModal=e})))}};n.style=".feedback-button-content{cursor:pointer;background-color:var(--feedback-button-bg-color);border:1px solid var(--feedback-button-border-color);border-radius:var(--feedback-button-border-radius);color:var(--feedback-button-text-color);cursor:pointer;font-size:var(--feedback-modal-button-font-size);padding:5px 10px}.feedback-button-content:hover{color:var(--feedback-button-text-color-active);background-color:var(--feedback-button-bg-color-active);border:1px solid var(--feedback-button-border-color-active)}";var r,i,a=(r=function(e){!function(){var t=function(){return{escape:function(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:t,mimeType:function(e){var o,n;return(o="application/font-woff",n="image/jpeg",{woff:o,woff2:o,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:n,jpeg:n,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[t(e).toLowerCase()]||""},dataAsUrl:function(e,t){return"data:"+t+";base64,"+e},isDataUrl:function(e){return-1!==e.search(/^(data:)/)},canvasToBlob:function(e){return e.toBlob?new Promise((function(t){e.toBlob(t)})):function(e){return new Promise((function(t){for(var o=window.atob(e.toDataURL().split(",")[1]),n=o.length,r=new Uint8Array(n),i=0;i<n;i++)r[i]=o.charCodeAt(i);t(new Blob([r],{type:"image/png"}))}))}(e)},resolveUrl:function(e,t){var o=document.implementation.createHTMLDocument(),n=o.createElement("base");o.head.appendChild(n);var r=o.createElement("a");return o.body.appendChild(r),n.href=t,r.href=e,r.href},getAndEncode:function(e){return s.impl.options.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+(new Date).getTime()),new Promise((function(t){var o,n=new XMLHttpRequest;if(n.onreadystatechange=function(){if(4===n.readyState)if(200===n.status){var r=new FileReader;r.onloadend=function(){var e=r.result.split(/,/)[1];t(e)},r.readAsDataURL(n.response)}else o?t(o):i("cannot fetch resource: "+e+", status: "+n.status)},n.ontimeout=function(){o?t(o):i("timeout of 30000ms occured while fetching resource: "+e)},n.responseType="blob",n.timeout=3e4,n.open("GET",e,!0),n.send(),s.impl.options.imagePlaceholder){var r=s.impl.options.imagePlaceholder.split(/,/);r&&r[1]&&(o=r[1])}function i(e){console.error(e),t("")}}))},uid:(e=0,function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+e++}),delay:function(e){return function(t){return new Promise((function(o){setTimeout((function(){o(t)}),e)}))}},asArray:function(e){for(var t=[],o=e.length,n=0;n<o;n++)t.push(e[n]);return t},escapeXhtml:function(e){return e.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(e){return new Promise((function(t,o){var n=new Image;n.onload=function(){t(n)},n.onerror=o,n.src=e}))},width:function(e){var t=o(e,"border-left-width"),n=o(e,"border-right-width");return e.scrollWidth+t+n},height:function(e){var t=o(e,"border-top-width"),n=o(e,"border-bottom-width");return e.scrollHeight+t+n}};var e;function t(e){var t=/\.([^\.\/]*?)$/g.exec(e);return t?t[1]:""}function o(e,t){var o=window.getComputedStyle(e).getPropertyValue(t);return parseFloat(o.replace("px",""))}}(),o=function(){var e=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(e,t,i){return o(e)?Promise.resolve(e).then(n).then((function(o){var n=Promise.resolve(e);return o.forEach((function(e){n=n.then((function(o){return r(o,e,t,i)}))})),n})):Promise.resolve(e)},shouldProcess:o,impl:{readUrls:n,inline:r}};function o(t){return-1!==t.search(e)}function n(o){for(var n,r=[];null!==(n=e.exec(o));)r.push(n[1]);return r.filter((function(e){return!t.isDataUrl(e)}))}function r(e,o,n,r){return Promise.resolve(o).then((function(e){return n?t.resolveUrl(e,n):e})).then(r||t.getAndEncode).then((function(e){return t.dataAsUrl(e,t.mimeType(o))})).then((function(n){return e.replace(function(e){return new RegExp("(url\\(['\"]?)("+t.escape(e)+")(['\"]?\\))","g")}(o),"$1"+n+"$3")}))}}(),n=function(){return{resolveAll:function(){return e().then((function(e){return Promise.all(e.map((function(e){return e.resolve()})))})).then((function(e){return e.join("\n")}))},impl:{readAll:e}};function e(){return Promise.resolve(t.asArray(document.styleSheets)).then((function(e){var o=[];return e.forEach((function(e){try{t.asArray(e.cssRules||[]).forEach(o.push.bind(o))}catch(t){console.log("Error while reading CSS rules from "+e.href,t.toString())}})),o})).then((function(e){return e.filter((function(e){return e.type===CSSRule.FONT_FACE_RULE})).filter((function(e){return o.shouldProcess(e.style.getPropertyValue("src"))}))})).then((function(t){return t.map(e)}));function e(e){return{resolve:function(){return o.inlineAll(e.cssText,(e.parentStyleSheet||{}).href)},src:function(){return e.style.getPropertyValue("src")}}}}}(),r=function(){return{inlineAll:function n(r){return r instanceof Element?function(e){var t=e.style.getPropertyValue("background");return t?o.inlineAll(t).then((function(t){e.style.setProperty("background",t,e.style.getPropertyPriority("background"))})).then((function(){return e})):Promise.resolve(e)}(r).then((function(){return r instanceof HTMLImageElement?e(r).inline():Promise.all(t.asArray(r.childNodes).map((function(e){return n(e)})))})):Promise.resolve(r)},impl:{newImage:e}};function e(e){return{inline:function(o){return t.isDataUrl(e.src)?Promise.resolve():Promise.resolve(e.src).then(o||t.getAndEncode).then((function(o){return t.dataAsUrl(o,t.mimeType(e.src))})).then((function(t){return new Promise((function(o,n){e.onload=o,e.onerror=n,e.src=t}))}))}}}}(),i=void 0,a=!1,s={toSvg:c,toPng:function(e,t){return d(e,t||{}).then((function(e){return e.toDataURL()}))},toJpeg:function(e,t){return d(e,t=t||{}).then((function(e){return e.toDataURL("image/jpeg",t.quality||1)}))},toBlob:function(e,o){return d(e,o||{}).then(t.canvasToBlob)},toPixelData:function(e,o){return d(e,o||{}).then((function(o){return o.getContext("2d").getImageData(0,0,t.width(e),t.height(e)).data}))},impl:{fontFaces:n,images:r,util:t,inliner:o,options:{}}};function c(e,o){return function(e){s.impl.options.imagePlaceholder=void 0===e.imagePlaceholder?i:e.imagePlaceholder,s.impl.options.cacheBust=void 0===e.cacheBust?a:e.cacheBust}(o=o||{}),Promise.resolve(e).then((function(e){return l(e,o.filter,!0)})).then(u).then(f).then((function(e){return o.bgcolor&&(e.style.backgroundColor=o.bgcolor),o.width&&(e.style.width=o.width+"px"),o.height&&(e.style.height=o.height+"px"),o.style&&Object.keys(o.style).forEach((function(t){e.style[t]=o.style[t]})),e})).then((function(n){return function(e,o,n){return Promise.resolve(e).then((function(e){return e.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(e)})).then(t.escapeXhtml).then((function(e){return'<foreignObject x="0" y="0" width="100%" height="100%">'+e+"</foreignObject>"})).then((function(e){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+o+'" height="'+n+'">'+e+"</svg>"})).then((function(e){return"data:image/svg+xml;charset=utf-8,"+e}))}(n,o.width||t.width(e),o.height||t.height(e))}))}function d(e,o){return c(e,o).then(t.makeImage).then(t.delay(100)).then((function(n){var r=function(e){var n=document.createElement("canvas");if(n.width=o.width||t.width(e),n.height=o.height||t.height(e),o.bgcolor){var r=n.getContext("2d");r.fillStyle=o.bgcolor,r.fillRect(0,0,n.width,n.height)}return n}(e);return r.getContext("2d").drawImage(n,0,0),r}))}function l(e,o,n){return n||!o||o(e)?Promise.resolve(e).then((function(e){return e instanceof HTMLCanvasElement?t.makeImage(e.toDataURL()):e.cloneNode(!1)})).then((function(n){return function(e,o,n){var r=e.childNodes;return 0===r.length?Promise.resolve(o):function(e,t,o){var n=Promise.resolve();return t.forEach((function(t){n=n.then((function(){return l(t,o)})).then((function(t){t&&e.appendChild(t)}))})),n}(o,t.asArray(r),n).then((function(){return o}))}(e,n,o)})).then((function(o){return function(e,o){return o instanceof Element?Promise.resolve().then((function(){n=window.getComputedStyle(e),r=o.style,n.cssText?r.cssText=n.cssText:function(e,o){t.asArray(e).forEach((function(t){o.setProperty(t,e.getPropertyValue(t),e.getPropertyPriority(t))}))}(n,r);var n,r})).then((function(){[":before",":after"].forEach((function(n){!function(n){var r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(""!==i&&"none"!==i){var a=t.uid();o.className=o.className+" "+a;var s=document.createElement("style");s.appendChild(function(e,o,n){var r="."+e+":"+o,i=n.cssText?a(n):s(n);return document.createTextNode(r+"{"+i+"}");function a(e){var t=e.getPropertyValue("content");return e.cssText+" content: "+t+";"}function s(e){return t.asArray(e).map(o).join("; ")+";";function o(t){return t+": "+e.getPropertyValue(t)+(e.getPropertyPriority(t)?" !important":"")}}}(a,n,r)),o.appendChild(s)}}(n)}))})).then((function(){e instanceof HTMLTextAreaElement&&(o.innerHTML=e.value),e instanceof HTMLInputElement&&o.setAttribute("value",e.value)})).then((function(){o instanceof SVGElement&&(o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o instanceof SVGRectElement&&["width","height"].forEach((function(e){var t=o.getAttribute(e);t&&o.style.setProperty(e,t)})))})).then((function(){return o})):o}(e,o)})):Promise.resolve()}function u(e){return n.resolveAll().then((function(t){var o=document.createElement("style");return e.appendChild(o),o.appendChild(document.createTextNode(t)),e}))}function f(e){return r.inlineAll(e).then((function(){return e}))}e.exports=s}()},r(i={path:undefined,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}}),i.exports);const s=class{constructor(t){e(this,t),this.handleSubmit=async e=>{e.preventDefault(),this.showScreenshotMode=!1,this.showModal=!1,this.sending=!0;let t="";this.encodedScreenshot&&await this.encodedScreenshot.then((e=>{t=e})).catch((e=>{console.log(e)}));try{200===(await fetch("https://app.pushfeedback.com/api/feedback/",{method:"POST",body:JSON.stringify({url:window.location.href,message:this.formMessage,email:this.formEmail,project:this.project,screenshot:t}),headers:{"Content-Type":"application/json"}})).status?(this.formSuccess=!0,this.formError=!1):(this.formSuccess=!1,this.formError=!0)}catch(e){this.formSuccess=!1,this.formError=!0}finally{this.sending=!1,this.showModal=!0}},this.close=()=>{this.sending=!1,this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1,this.encodedScreenshot=null,this.formSuccess=!1,this.formError=!1,this.formMessage="",this.formEmail=""},this.openScreenShot=()=>{this.hasSelectedElement=!1,this.showModal=!1,this.showScreenshotMode=!0,this.encodedScreenshot=null,document.getElementsByTagName("html")[0].style.overflow="auto"},this.closeScreenShot=()=>{this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1,this.encodedScreenshot=null,this.overlay.style.display="none",document.getElementsByTagName("html")[0].style.overflow="inherit"},this.handleMouseOverScreenShot=e=>{if(e.preventDefault(),this.hasSelectedElement)return;this.overlay.style.display="none",this.screenshotModal.style.display="none";const t=document.elementFromPoint(e.clientX,e.clientY).getBoundingClientRect();this.screenshotModal.style.display="",this.elementSelected.style.position="absolute",this.elementSelected.style.left=`${t.left}px`,this.elementSelected.style.top=`${t.top}px`,this.elementSelected.style.width=`${t.width}px`,this.elementSelected.style.height=`${t.height}px`,this.elementSelected.classList.add("feedback-modal-element-hover"),this.topSide.style.position="absolute",this.topSide.style.left=`${t.left}px`,this.topSide.style.top="0px",this.topSide.style.width=`${t.width+8}px`,this.topSide.style.height=`${t.top}px`,this.topSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.leftSide.style.position="absolute",this.leftSide.style.left="0px",this.leftSide.style.top="0px",this.leftSide.style.width=`${t.left}px`,this.leftSide.style.height="100vh",this.leftSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.bottomSide.style.position="absolute",this.bottomSide.style.left=`${t.left}px`,this.bottomSide.style.top=`${t.bottom+8}px`,this.bottomSide.style.width=`${t.width+8}px`,this.bottomSide.style.height="100vh",this.bottomSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.rightSide.style.position="absolute",this.rightSide.style.left=`${t.right+8}px`,this.rightSide.style.top="0px",this.rightSide.style.width="100%",this.rightSide.style.height="100vh",this.rightSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.screenshotModal.style.backgroundColor="transparent"},this.handleMouseClickedSelectedElement=e=>{e.preventDefault(),this.elementSelected&&this.elementSelected.classList.add("feedback-modal-element-selected");let t=this.elementSelected.getBoundingClientRect().top;this.elementSelected.style.top=`${t+window.pageYOffset}px`;const o=this.elementSelected.cloneNode(!0);document.body.appendChild(o),this.elementSelected.style.top=`${t}px`,this.encodedScreenshot=a.toPng(document.body,{cacheBust:!0}).then((function(e){return document.body.removeChild(o),e})).catch((function(e){return console.error("oops, something went wrong!",e),""})),document.getElementsByTagName("html")[0].style.overflow="hidden",this.hasSelectedElement=!0,this.overlay.style.display="block",this.showModal=!0},this.sending=!1,this.formMessage="",this.formEmail="",this.formSuccess=!1,this.formError=!1,this.encodedScreenshot=void 0,this.modalTitle="Share your feedback",this.successModalTitle="Thanks for your feedback!",this.errorModalTitle="Oops! We didn't receive your feedback. Please try again later.",this.modalPosition="center",this.sendButtonText="Send",this.project="",this.screenshotButtonTooltipText="Take a Screenshot",this.screenshotTopbarText="SELECT AN ELEMENT ON THE PAGE",this.email="",this.emailPlaceholder="Email address (optional)",this.messagePlaceholder="How could this page be more helpful?",this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1}componentWillLoad(){this.formEmail=this.email}handleMessageInput(e){this.formMessage=e.target.value}handleEmailInput(e){this.formEmail=e.target.value}render(){return t("div",{class:"feedback-modal-wrapper"},this.showScreenshotMode&&t("div",{class:"feedback-modal-screenshot",ref:e=>this.screenshotModal=e,onMouseMove:this.handleMouseOverScreenShot},t("div",{class:"feedback-modal-screenshot-element-selected",ref:e=>this.elementSelected=e,onClick:this.handleMouseClickedSelectedElement}),t("div",{class:"top-side",ref:e=>this.topSide=e}),t("div",{class:"left-side",ref:e=>this.leftSide=e}),t("div",{class:"bottom-side",ref:e=>this.bottomSide=e}),t("div",{class:"right-side",ref:e=>this.rightSide=e}),t("div",{class:"feedback-modal-screenshot-header",onClick:this.closeScreenShot},t("span",null,this.screenshotTopbarText),t("span",{class:"feedback-modal-screenshot-close"},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#fff","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-x"},t("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),t("div",{class:"feedback-modal-screenshot-overlay",ref:e=>this.overlay=e})),this.showModal&&t("div",{class:`feedback-modal-content feedback-modal-content--${this.modalPosition}`,ref:e=>this.modalContent=e},t("div",{class:"feedback-modal-header"},this.formSuccess||this.formError?this.formSuccess?t("span",{class:"text-center"},this.successModalTitle):this.formError?t("span",{class:"text-center"},this.errorModalTitle):t("span",null):t("span",null,this.modalTitle),t("button",{class:"feedback-modal-close",onClick:this.close},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#ccc","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-x"},t("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),t("div",{class:"feedback-modal-body"},this.formSuccess||this.formError?t("span",null):t("form",{onSubmit:this.handleSubmit},t("div",{class:"feedback-modal-text"},t("textarea",{placeholder:this.messagePlaceholder,value:this.formMessage,onInput:e=>this.handleMessageInput(e),required:!0})),!this.email&&t("div",{class:"feedback-modal-email"},t("input",{type:"email",placeholder:this.emailPlaceholder,onInput:e=>this.handleEmailInput(e),value:this.formEmail})),t("div",{class:"feedback-modal-buttons"},t("button",{type:"button",class:"button"+(this.encodedScreenshot?" active":""),title:this.screenshotButtonTooltipText,onClick:this.openScreenShot,disabled:this.sending},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-camera"},t("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),t("circle",{cx:"12",cy:"13",r:"4"}))),t("button",{class:"button",type:"submit",disabled:this.sending},this.sendButtonText)))),t("div",{class:"feedback-modal-footer"},t("div",{class:"feedback-logo"},t("svg",{class:"w-8 h-8",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},t("defs",null,t("radialGradient",{cx:"21.152%",cy:"86.063%",fx:"21.152%",fy:"86.063%",r:"79.941%",id:"footer-logo"},t("stop",{"stop-color":"#4FD1C5",offset:"0%"}),t("stop",{"stop-color":"#81E6D9",offset:"25.871%"}),t("stop",{"stop-color":"#338CF5",offset:"100%"}))),t("rect",{width:"32",height:"32",rx:"16",fill:"url(#footer-logo)","fill-rule":"nonzero"}))," ",t("a",{href:"https://pushfeedback.com"},"PushFeedback")))))}};s.style=".text-center{text-align:center;flex-grow:1}.feedback-modal{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border-color:1px solid var(--feedback-modal-header-text-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-content-text-color);display:flex;flex-direction:column;font-family:var(--feedback-modal-content-font-family);max-width:300px;padding:20px;position:fixed;width:100%;z-index:300}.feedback-modal-content.feedback-modal-content--center{left:50%;top:50%;transform:translate(-50%, -50%)}.feedback-modal-content.feedback-modal-content--bottom-right{bottom:var(--feedback-modal-content-position-bottom);right:var(--feedback-modal-content-position-right)}.feedback-modal-content.feedback-modal-content--bottom-left{bottom:var(--feedback-modal-content-position-bottom);left:var(--feedback-modal-content-position-left)}.feedback-modal-content.feedback-modal-content--top-right{right:var(--feedback-modal-content-position-right);top:var(--fedback-modal-content-position-top)}.feedback-modal-content.feedback-modal-content--top-left{left:var(--feedback-modal-content-position-left);top:var(--fedback-modal-content-position-top)}.feedback-modal-header{align-items:center;color:var(--feedback-modal-header-text-color);font-family:var(--feedback-modal-header-font-family);display:flex;font-size:var(--feedback-header-font-size);justify-content:space-between;margin-bottom:20px}.feedback-modal-text{margin-bottom:20px}.feedback-modal-text textarea{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:100px;padding:10px;resize:none;width:100%}.feedback-modal-email{margin-bottom:20px}.feedback-modal-email input{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:40px;padding:10px;width:100%}.feedback-modal-text textarea:focus,.feedback-modal-email input:focus{border:1px solid var(--feedback-modal-input-border-color-focused);outline:none}.feedback-modal-buttons{display:flex;justify-content:space-between}.button{background-color:transparent;border:1px solid var(--feedback-modal-button-border-color);border-radius:var(--feedback-modal-button-border-radius);color:var(--feedback-modal-button-text-color);cursor:pointer;font-size:var(--feedback-modal-button-font-size);padding:5px 10px}.button:hover,.button.active{color:var(--feedback-modal-button-text-color-active);background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active)}.feedback-modal-footer{font-size:12px;margin-top:5px 0;text-align:center}.feedback-modal-footer a{color:#191919;text-decoration:none}.feedback-logo{display:flex;align-items:center;justify-content:center;margin-top:5px}.feedback-logo svg{max-width:12px;margin-right:5px}.feedback-modal-close{background-color:var(--feedback-modal-close-bg-color);border:0;border-radius:50%;cursor:pointer;margin-left:auto;padding:0;width:24px;height:24px}.feedback-modal-screenshot{background-color:var(--feedback-modal-screenshot-bg-color);box-shadow:0px 0px 0px 5px var(--feedback-modal-screenshot-element-selected-bg-color) inset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-screenshot-header{align-items:center;background-color:var(--feedback-modal-screenshot-header-bg-color);color:var(--feedback-modal-screenshot-element-selected-text-color);cursor:pointer;display:flex;padding:5px;position:fixed;justify-content:center;width:100%;z-index:200}.feedback-modal-screenshot-header span{padding-left:10px;padding-right:10px}.feedback-modal-screenshot-overlay{background-color:transparent;cursor:unset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-message{font-size:var(--fedback-modal-message-font-size)}.feedback-modal-element-hover{cursor:pointer;background-color:transparent;border:4px dashed var(--feedback-modal-screenshot-element-hover-border-color)}.feedback-modal-element-selected{border:4px solid var(--feedback-modal-screenshot-element-selected-border-color)}";export{n as feedback_button,s as feedback_modal}
@@ -0,0 +1,2 @@
1
+ let e,n,t=!1,l=!1;const s="http://www.w3.org/1999/xlink",o={},i=e=>"object"==(e=typeof e)||"function"===e;function r(e){var n,t,l;return null!==(l=null===(t=null===(n=e.head)||void 0===n?void 0:n.querySelector('meta[name="csp-nonce"]'))||void 0===t?void 0:t.getAttribute("content"))&&void 0!==l?l:void 0}const c=(e,n,...t)=>{let l=null,s=null,o=!1,r=!1;const c=[],f=n=>{for(let t=0;t<n.length;t++)l=n[t],Array.isArray(l)?f(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof e&&!i(l))&&(l+=""),o&&r?c[c.length-1].t+=l:c.push(o?u(null,l):l),r=o)};if(f(t),n){n.key&&(s=n.key);{const e=n.className||n.class;e&&(n.class="object"!=typeof e?e:Object.keys(e).filter((n=>e[n])).join(" "))}}const a=u(e,null);return a.l=n,c.length>0&&(a.o=c),a.i=s,a},u=(e,n)=>({u:0,h:e,t:n,p:null,o:null,l:null,i:null}),f={},a=new WeakMap,d=e=>"sc-"+e.$,h=(e,n,t,l,o,r)=>{if(t!==l){let c=D(e,n),u=n.toLowerCase();if("class"===n){const n=e.classList,s=$(t),o=$(l);n.remove(...s.filter((e=>e&&!o.includes(e)))),n.add(...o.filter((e=>e&&!s.includes(e))))}else if("style"===n){for(const n in t)l&&null!=l[n]||(n.includes("-")?e.style.removeProperty(n):e.style[n]="");for(const n in l)t&&l[n]===t[n]||(n.includes("-")?e.style.setProperty(n,l[n]):e.style[n]=l[n])}else if("key"===n);else if("ref"===n)l&&l(e);else if(c||"o"!==n[0]||"n"!==n[1]){const f=i(l);if((c||f&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[n]=l;else{const s=null==l?"":l;"list"===n?c=!1:null!=t&&e[n]==s||(e[n]=s)}}catch(e){}let a=!1;u!==(u=u.replace(/^xlink\:?/,""))&&(n=u,a=!0),null==l||!1===l?!1===l&&""!==e.getAttribute(n)||(a?e.removeAttributeNS(s,n):e.removeAttribute(n)):(!c||4&r||o)&&!f&&(l=!0===l?"":l,a?e.setAttributeNS(s,n,l):e.setAttribute(n,l))}else n="-"===n[2]?n.slice(3):D(B,u)?u.slice(2):u[2]+n.slice(3),t&&I.rel(e,n,t,!1),l&&I.ael(e,n,l,!1)}},p=/\s/,$=e=>e?e.split(p):[],y=(e,n,t,l)=>{const s=11===n.p.nodeType&&n.p.host?n.p.host:n.p,i=e&&e.l||o,r=n.l||o;for(l in i)l in r||h(s,l,i[l],void 0,t,n.u);for(l in r)h(s,l,i[l],r[l],t,n.u)},m=(n,l,s)=>{const o=l.o[s];let i,r,c=0;if(null!==o.t)i=o.p=G.createTextNode(o.t);else{if(t||(t="svg"===o.h),i=o.p=G.createElementNS(t?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.h),t&&"foreignObject"===o.h&&(t=!1),y(null,o,t),null!=e&&i["s-si"]!==e&&i.classList.add(i["s-si"]=e),o.o)for(c=0;c<o.o.length;++c)r=m(n,o,c),r&&i.appendChild(r);"svg"===o.h?t=!1:"foreignObject"===i.tagName&&(t=!0)}return i},w=(e,t,l,s,o,i)=>{let r,c=e;for(c.shadowRoot&&c.tagName===n&&(c=c.shadowRoot);o<=i;++o)s[o]&&(r=m(null,l,o),r&&(s[o].p=r,c.insertBefore(r,t)))},b=(e,n,t,l,s)=>{for(;n<=t;++n)(l=e[n])&&(s=l.p,S(l),s.remove())},v=(e,n)=>e.h===n.h&&e.i===n.i,g=(e,n)=>{const l=n.p=e.p,s=e.o,o=n.o,i=n.h,r=n.t;null===r?(t="svg"===i||"foreignObject"!==i&&t,"slot"===i||y(e,n,t),null!==s&&null!==o?((e,n,t,l)=>{let s,o,i=0,r=0,c=0,u=0,f=n.length-1,a=n[0],d=n[f],h=l.length-1,p=l[0],$=l[h];for(;i<=f&&r<=h;)if(null==a)a=n[++i];else if(null==d)d=n[--f];else if(null==p)p=l[++r];else if(null==$)$=l[--h];else if(v(a,p))g(a,p),a=n[++i],p=l[++r];else if(v(d,$))g(d,$),d=n[--f],$=l[--h];else if(v(a,$))g(a,$),e.insertBefore(a.p,d.p.nextSibling),a=n[++i],$=l[--h];else if(v(d,p))g(d,p),e.insertBefore(d.p,a.p),d=n[--f],p=l[++r];else{for(c=-1,u=i;u<=f;++u)if(n[u]&&null!==n[u].i&&n[u].i===p.i){c=u;break}c>=0?(o=n[c],o.h!==p.h?s=m(n&&n[r],t,c):(g(o,p),n[c]=void 0,s=o.p),p=l[++r]):(s=m(n&&n[r],t,r),p=l[++r]),s&&a.p.parentNode.insertBefore(s,a.p)}i>f?w(e,null==l[h+1]?null:l[h+1].p,t,l,r,h):r>h&&b(n,i,f)})(l,s,n,o):null!==o?(null!==e.t&&(l.textContent=""),w(l,null,n,o,0,o.length-1)):null!==s&&b(s,0,s.length-1),t&&"svg"===i&&(t=!1)):e.t!==r&&(l.data=r)},S=e=>{e.l&&e.l.ref&&e.l.ref(null),e.o&&e.o.map(S)},j=(e,n)=>{n&&!e.m&&n["s-p"]&&n["s-p"].push(new Promise((n=>e.m=n)))},k=(e,n)=>{if(e.u|=16,!(4&e.u))return j(e,e.v),te((()=>O(e,n)));e.u|=512},O=(e,n)=>{const t=e.g;let l;return n&&(l=P(t,"componentWillLoad")),E(l,(()=>M(e,t,n)))},M=async(e,n,t)=>{const l=e.S,s=l["s-rc"];t&&(e=>{const n=e.j,t=e.S,l=n.u,s=((e,n)=>{var t;let l=d(n);const s=z.get(l);if(e=11===e.nodeType?e:G,s)if("string"==typeof s){let n,o=a.get(e=e.head||e);if(o||a.set(e,o=new Set),!o.has(l)){{n=G.createElement("style"),n.innerHTML=s;const l=null!==(t=I.k)&&void 0!==t?t:r(G);null!=l&&n.setAttribute("nonce",l),e.insertBefore(n,e.querySelector("link"))}o&&o.add(l)}}else e.adoptedStyleSheets.includes(s)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,s]);return l})(t.shadowRoot?t.shadowRoot:t.getRootNode(),n);10&l&&(t["s-sc"]=s,t.classList.add(s+"-h"))})(e);x(e,n),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const n=l["s-p"],t=()=>C(e);0===n.length?t():(Promise.all(n).then(t),e.u|=4,n.length=0)}},x=(t,l)=>{try{l=l.render(),t.u&=-17,t.u|=2,((t,l)=>{const s=t.S,o=t.j,i=t.O||u(null,null),r=(e=>e&&e.h===f)(l)?l:c(null,null,l);n=s.tagName,o.M&&(r.l=r.l||{},o.M.map((([e,n])=>r.l[n]=s[e]))),r.h=null,r.u|=4,t.O=r,r.p=i.p=s.shadowRoot||s,e=s["s-sc"],g(i,r)})(t,l)}catch(e){F(e,t.S)}return null},C=e=>{const n=e.S,t=e.g,l=e.v;64&e.u||(e.u|=64,N(n),P(t,"componentDidLoad"),e.C(n),l||L()),e.m&&(e.m(),e.m=void 0),512&e.u&&ne((()=>k(e,!1))),e.u&=-517},L=()=>{N(G.documentElement),ne((()=>(e=>{const n=I.ce("appload",{detail:{namespace:"pushfeedback"}});return e.dispatchEvent(n),n})(B)))},P=(e,n,t)=>{if(e&&e[n])try{return e[n](t)}catch(e){F(e)}},E=(e,n)=>e&&e.then?e.then(n):n(),N=e=>e.classList.add("hydrated"),T=(e,n,t)=>{if(n.L){const l=Object.entries(n.L),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&t&&32&l)&&Object.defineProperty(s,e,{get(){return((e,n)=>R(this).P.get(n))(0,e)},set(t){((e,n,t,l)=>{const s=R(e),o=s.P.get(n),r=s.u,c=s.g;t=((e,n)=>null==e||i(e)?e:4&n?"false"!==e&&(""===e||!!e):1&n?e+"":e)(t,l.L[n][0]),8&r&&void 0!==o||t===o||Number.isNaN(o)&&Number.isNaN(t)||(s.P.set(n,t),c&&2==(18&r)&&k(s,!1))})(this,e,t,n)},configurable:!0,enumerable:!0})})),1&t){const t=new Map;s.attributeChangedCallback=function(e,n,l){I.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(s.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,n])=>15&n[0])).map((([e,l])=>{const s=l[1]||e;return t.set(s,e),512&l[0]&&n.M.push([e,s]),s}))}}return e},W=(e,n={})=>{var t;const l=[],s=n.exclude||[],o=B.customElements,i=G.head,c=i.querySelector("meta[charset]"),u=G.createElement("style"),f=[];let a,h=!0;Object.assign(I,n),I.N=new URL(n.resourcesUrl||"./",G.baseURI).href,e.map((e=>{e[1].map((n=>{const t={u:n[0],$:n[1],L:n[2],T:n[3]};t.L=n[2],t.M=[];const i=t.$,r=class extends HTMLElement{constructor(e){super(e),q(e=this,t),1&t.u&&e.attachShadow({mode:"open"})}connectedCallback(){a&&(clearTimeout(a),a=null),h?f.push(this):I.jmp((()=>(e=>{if(0==(1&I.u)){const n=R(e),t=n.j,l=()=>{};if(!(1&n.u)){n.u|=1;{let t=e;for(;t=t.parentNode||t.host;)if(t["s-p"]){j(n,n.v=t);break}}t.L&&Object.entries(t.L).map((([n,[t]])=>{if(31&t&&e.hasOwnProperty(n)){const t=e[n];delete e[n],e[n]=t}})),(async(e,n,t,l,s)=>{if(0==(32&n.u)){{if(n.u|=32,(s=_(t)).then){const e=()=>{};s=await s,e()}s.isProxied||(T(s,t,2),s.isProxied=!0);const e=()=>{};n.u|=8;try{new s(n)}catch(e){F(e)}n.u&=-9,e()}if(s.style){let e=s.style;const n=d(t);if(!z.has(n)){const l=()=>{};((e,n,t)=>{let l=z.get(e);K&&t?(l=l||new CSSStyleSheet,"string"==typeof l?l=n:l.replaceSync(n)):l=n,z.set(e,l)})(n,e,!!(1&t.u)),l()}}}const o=n.v,i=()=>k(n,!0);o&&o["s-rc"]?o["s-rc"].push(i):i()})(0,n,t)}l()}})(this)))}disconnectedCallback(){I.jmp((()=>{}))}componentOnReady(){return R(this).W}};t.A=e[0],s.includes(i)||o.get(i)||(l.push(i),o.define(i,T(r,t,1)))}))}));{u.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",u.setAttribute("data-styles","");const e=null!==(t=I.k)&&void 0!==t?t:r(G);null!=e&&u.setAttribute("nonce",e),i.insertBefore(u,c?c.nextSibling:i.firstChild)}h=!1,f.length?f.map((e=>e.connectedCallback())):I.jmp((()=>a=setTimeout(L,30)))},A=e=>I.k=e,H=new WeakMap,R=e=>H.get(e),U=(e,n)=>H.set(n.g=e,n),q=(e,n)=>{const t={u:0,S:e,j:n,P:new Map};return t.W=new Promise((e=>t.C=e)),e["s-p"]=[],e["s-rc"]=[],H.set(e,t)},D=(e,n)=>n in e,F=(e,n)=>(0,console.error)(e,n),V=new Map,_=e=>{const n=e.$.replace(/-/g,"_"),t=e.A,l=V.get(t);return l?l[n]:import(`./${t}.entry.js`).then((e=>(V.set(t,e),e[n])),F)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},z=new Map,B="undefined"!=typeof window?window:{},G=B.document||{head:{}},I={u:0,N:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,n,t,l)=>e.addEventListener(n,t,l),rel:(e,n,t,l)=>e.removeEventListener(n,t,l),ce:(e,n)=>new CustomEvent(e,n)},J=e=>Promise.resolve(e),K=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),Q=[],X=[],Y=(e,n)=>t=>{e.push(t),l||(l=!0,n&&4&I.u?ne(ee):I.raf(ee))},Z=e=>{for(let n=0;n<e.length;n++)try{e[n](performance.now())}catch(e){F(e)}e.length=0},ee=()=>{Z(Q),Z(X),(l=Q.length>0)&&I.raf(ee)},ne=e=>J().then(e),te=Y(X,!0);export{f as H,W as b,c as h,J as p,U as r,A as s}
@@ -1 +1 @@
1
- import{p as e,b as o}from"./p-e53ad7c2.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-a5896889",[[1,"feedback-button",{modalTitle:[1,"modal-title"],successModalTitle:[1,"success-modal-title"],errorModalTitle:[1,"error-modal-title"],modalPosition:[1,"modal-position"],sendButtonText:[1,"send-button-text"],project:[1],screenshotButtonTooltipText:[1,"screenshot-button-tooltip-text"],screenshotTopbarText:[1,"screenshot-topbar-text"],email:[1],emailPlaceholder:[1,"email-placeholder"],messagePlaceholder:[1,"message-placeholder"],feedbackModal:[32]}],[1,"feedback-modal",{modalTitle:[1,"modal-title"],successModalTitle:[1,"success-modal-title"],errorModalTitle:[1,"error-modal-title"],modalPosition:[1,"modal-position"],sendButtonText:[1,"send-button-text"],project:[1],screenshotButtonTooltipText:[1,"screenshot-button-tooltip-text"],screenshotTopbarText:[1,"screenshot-topbar-text"],email:[1],emailPlaceholder:[1,"email-placeholder"],messagePlaceholder:[1,"message-placeholder"],showModal:[1540,"show-modal"],showScreenshotMode:[1540,"show-screenshot-mode"],hasSelectedElement:[1540,"has-selected-element"],sending:[32],formMessage:[32],formEmail:[32],formSuccess:[32],formError:[32],encodedScreenshot:[32]}]]]],e)));
1
+ import{p as e,b as o}from"./p-6aedd58b.js";export{s as setNonce}from"./p-6aedd58b.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-327ea768",[[1,"feedback-button",{modalTitle:[1,"modal-title"],successModalTitle:[1,"success-modal-title"],errorModalTitle:[1,"error-modal-title"],modalPosition:[1,"modal-position"],sendButtonText:[1,"send-button-text"],project:[1],screenshotButtonTooltipText:[1,"screenshot-button-tooltip-text"],screenshotTopbarText:[1,"screenshot-topbar-text"],email:[1],emailPlaceholder:[1,"email-placeholder"],messagePlaceholder:[1,"message-placeholder"],feedbackModal:[32]}],[1,"feedback-modal",{modalTitle:[1,"modal-title"],successModalTitle:[1,"success-modal-title"],errorModalTitle:[1,"error-modal-title"],modalPosition:[1,"modal-position"],sendButtonText:[1,"send-button-text"],project:[1],screenshotButtonTooltipText:[1,"screenshot-button-tooltip-text"],screenshotTopbarText:[1,"screenshot-topbar-text"],email:[1],emailPlaceholder:[1,"email-placeholder"],messagePlaceholder:[1,"message-placeholder"],showModal:[1540,"show-modal"],showScreenshotMode:[1540,"show-screenshot-mode"],hasSelectedElement:[1540,"has-selected-element"],sending:[32],formMessage:[32],formEmail:[32],formSuccess:[32],formError:[32],encodedScreenshot:[32]}]]]],e)));
@@ -133,7 +133,7 @@ export interface ListenOptions {
133
133
  */
134
134
  passive?: boolean;
135
135
  }
136
- export declare type ListenTargetOptions = 'body' | 'document' | 'window';
136
+ export type ListenTargetOptions = 'body' | 'document' | 'window';
137
137
  export interface StateDecorator {
138
138
  (): PropertyDecorator;
139
139
  }
@@ -214,8 +214,8 @@ export declare const State: StateDecorator;
214
214
  * https://stenciljs.com/docs/reactive-data#watch-decorator
215
215
  */
216
216
  export declare const Watch: WatchDecorator;
217
- export declare type ResolutionHandler = (elm: HTMLElement) => string | undefined | null;
218
- export declare type ErrorHandler = (err: any, element?: HTMLElement) => void;
217
+ export type ResolutionHandler = (elm: HTMLElement) => string | undefined | null;
218
+ export type ErrorHandler = (err: any, element?: HTMLElement) => void;
219
219
  /**
220
220
  * `setMode()` is used for libraries which provide multiple "modes" for styles.
221
221
  */
@@ -257,6 +257,15 @@ export declare function getAssetPath(path: string): string;
257
257
  * @returns the set path
258
258
  */
259
259
  export declare function setAssetPath(path: string): string;
260
+ /**
261
+ * Used to specify a nonce value that corresponds with an application's
262
+ * [Content Security Policy (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP).
263
+ * When set, the nonce will be added to all dynamically created script and style tags at runtime.
264
+ * Alternatively, the nonce value can be set on a `meta` tag in the DOM head
265
+ * (<meta name="csp-nonce" content="{ nonce value here }" />) and will result in the same behavior.
266
+ * @param nonce The value to be used for the nonce attribute.
267
+ */
268
+ export declare function setNonce(nonce: string): void;
260
269
  /**
261
270
  * Retrieve a Stencil element for a given reference
262
271
  * @param ref the ref to get the Stencil element for
@@ -433,13 +442,57 @@ interface HostAttributes {
433
442
  ref?: (el: HTMLElement | null) => void;
434
443
  [prop: string]: any;
435
444
  }
445
+ /**
446
+ * Utilities for working with functional Stencil components. An object
447
+ * conforming to this interface is passed by the Stencil runtime as the third
448
+ * argument to a functional component, allowing component authors to work with
449
+ * features like children.
450
+ *
451
+ * The children of a functional component will be passed as the second
452
+ * argument, so a functional component which uses these utils to transform its
453
+ * children might look like the following:
454
+ *
455
+ * ```ts
456
+ * export const AddClass: FunctionalComponent = (_, children, utils) => (
457
+ * utils.map(children, child => ({
458
+ * ...child,
459
+ * vattrs: {
460
+ * ...child.vattrs,
461
+ * class: `${child.vattrs.class} add-class`
462
+ * }
463
+ * }))
464
+ * );
465
+ * ```
466
+ *
467
+ * For more see the Stencil documentation, here:
468
+ * https://stenciljs.com/docs/functional-components
469
+ */
436
470
  export interface FunctionalUtilities {
471
+ /**
472
+ * Utility for reading the children of a functional component at runtime.
473
+ * Since the Stencil runtime uses a different interface for children it is
474
+ * not recommendeded to read the children directly, and is preferable to use
475
+ * this utility to, for instance, perform a side effect for each child.
476
+ */
437
477
  forEach: (children: VNode[], cb: (vnode: ChildNode, index: number, array: ChildNode[]) => void) => void;
478
+ /**
479
+ * Utility for transforming the children of a functional component. Given an
480
+ * array of children and a callback this will return a list of the results of
481
+ * passing each child to the supplied callback.
482
+ */
438
483
  map: (children: VNode[], cb: (vnode: ChildNode, index: number, array: ChildNode[]) => ChildNode) => VNode[];
439
484
  }
440
485
  export interface FunctionalComponent<T = {}> {
441
486
  (props: T, children: VNode[], utils: FunctionalUtilities): VNode | VNode[];
442
487
  }
488
+ /**
489
+ * A Child VDOM node
490
+ *
491
+ * This has most of the same properties as {@link VNode} but friendlier names
492
+ * (i.e. `vtag` instead of `$tag$`, `vchildren` instead of `$children$`) in
493
+ * order to provide a friendlier public interface for users of the
494
+ * {@link FunctionalUtilities}).
495
+ */
443
496
  export interface ChildNode {
444
497
  vtag?: string | number | Function;
445
498
  vkey?: string | number;
@@ -486,6 +539,9 @@ export declare function h(sel: any, children: Array<VNode | undefined | null>):
486
539
  export declare function h(sel: any, data: VNodeData | null, text: string): VNode;
487
540
  export declare function h(sel: any, data: VNodeData | null, children: Array<VNode | undefined | null>): VNode;
488
541
  export declare function h(sel: any, data: VNodeData | null, children: VNode): VNode;
542
+ /**
543
+ * A virtual DOM node
544
+ */
489
545
  export interface VNode {
490
546
  $flags$: number;
491
547
  $tag$: string | number | Function;
package/loader/index.d.ts CHANGED
@@ -10,3 +10,12 @@ export interface CustomElementsDefineOptions {
10
10
  }
11
11
  export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): Promise<void>;
12
12
  export declare function applyPolyfills(): Promise<void>;
13
+
14
+ /**
15
+ * Used to specify a nonce value that corresponds with an application's CSP.
16
+ * When set, the nonce will be added to all dynamically created script and style tags at runtime.
17
+ * Alternatively, the nonce value can be set on a meta tag in the DOM head
18
+ * (<meta name="csp-nonce" content="{ nonce value here }" />) which
19
+ * will result in the same behavior.
20
+ */
21
+ export declare function setNonce(nonce: string): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pushfeedback",
3
- "version": "0.0.1",
4
- "description": "Stencil Component Starter",
3
+ "version": "0.0.2",
4
+ "description": "Feedback widget for websites.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
7
7
  "es2015": "dist/esm/index.mjs",
@@ -30,6 +30,7 @@
30
30
  "dom-to-image": "^2.6.0"
31
31
  },
32
32
  "devDependencies": {
33
+ "@stencil/react-output-target": "^0.5.3",
33
34
  "@types/jest": "^27.0.3",
34
35
  "jest": "^27.4.5",
35
36
  "jest-cli": "^27.4.5",
@@ -1 +0,0 @@
1
- import{r as e,h as t,H as o}from"./p-e53ad7c2.js";const n=class{constructor(t){e(this,t),this.feedbackModal=void 0,this.modalTitle="Share your feedback",this.successModalTitle="Thanks for your feedback!",this.errorModalTitle="Oops! We didn't receive your feedback. Please try again later.",this.modalPosition="center",this.sendButtonText="Send",this.project="",this.screenshotButtonTooltipText="Take a Screenshot",this.screenshotTopbarText="SELECT AN ELEMENT ON THE PAGE",this.email="",this.emailPlaceholder="Email address (optional)",this.messagePlaceholder="How could this page be more helpful?"}componentDidLoad(){this.feedbackModal.showModal=!1}showModal(){this.feedbackModal.showModal=!0}render(){let e={};return["modalTitle","successModalTitle","errorModalTitle","modalPosition","sendButtonText","project","screenshotButtonTooltipText","screenshotTopbarText","email","emailPlaceholder","messagePlaceholder","showModal"].forEach((t=>{e[t]=this[t]})),t(o,null,t("a",{class:"feedback-button-content",onClick:()=>this.showModal()},t("slot",null)),t("feedback-modal",Object.assign({},e,{ref:e=>this.feedbackModal=e})))}};n.style=".feedback-button-content{cursor:pointer;background-color:var(--feedback-button-bg-color);border:1px solid var(--feedback-button-border-color);border-radius:var(--feedback-button-border-radius);color:var(--feedback-button-text-color);cursor:pointer;font-size:var(--feedback-modal-button-font-size);padding:5px 10px}.feedback-button-content:hover{color:var(--feedback-button-text-color-active);background-color:var(--feedback-button-bg-color-active);border:1px solid var(--feedback-button-border-color-active)}";var r,i=(function(e){!function(){var t=function(){return{escape:function(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:t,mimeType:function(e){var o,n;return(o="application/font-woff",n="image/jpeg",{woff:o,woff2:o,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:n,jpeg:n,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"})[t(e).toLowerCase()]||""},dataAsUrl:function(e,t){return"data:"+t+";base64,"+e},isDataUrl:function(e){return-1!==e.search(/^(data:)/)},canvasToBlob:function(e){return e.toBlob?new Promise((function(t){e.toBlob(t)})):function(e){return new Promise((function(t){for(var o=window.atob(e.toDataURL().split(",")[1]),n=o.length,r=new Uint8Array(n),i=0;i<n;i++)r[i]=o.charCodeAt(i);t(new Blob([r],{type:"image/png"}))}))}(e)},resolveUrl:function(e,t){var o=document.implementation.createHTMLDocument(),n=o.createElement("base");o.head.appendChild(n);var r=o.createElement("a");return o.body.appendChild(r),n.href=t,r.href=e,r.href},getAndEncode:function(e){return s.impl.options.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+(new Date).getTime()),new Promise((function(t){var o,n=new XMLHttpRequest;if(n.onreadystatechange=function(){if(4===n.readyState)if(200===n.status){var r=new FileReader;r.onloadend=function(){var e=r.result.split(/,/)[1];t(e)},r.readAsDataURL(n.response)}else o?t(o):i("cannot fetch resource: "+e+", status: "+n.status)},n.ontimeout=function(){o?t(o):i("timeout of 30000ms occured while fetching resource: "+e)},n.responseType="blob",n.timeout=3e4,n.open("GET",e,!0),n.send(),s.impl.options.imagePlaceholder){var r=s.impl.options.imagePlaceholder.split(/,/);r&&r[1]&&(o=r[1])}function i(e){console.error(e),t("")}}))},uid:(e=0,function(){return"u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+e++}),delay:function(e){return function(t){return new Promise((function(o){setTimeout((function(){o(t)}),e)}))}},asArray:function(e){for(var t=[],o=e.length,n=0;n<o;n++)t.push(e[n]);return t},escapeXhtml:function(e){return e.replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(e){return new Promise((function(t,o){var n=new Image;n.onload=function(){t(n)},n.onerror=o,n.src=e}))},width:function(e){var t=o(e,"border-left-width"),n=o(e,"border-right-width");return e.scrollWidth+t+n},height:function(e){var t=o(e,"border-top-width"),n=o(e,"border-bottom-width");return e.scrollHeight+t+n}};var e;function t(e){var t=/\.([^\.\/]*?)$/g.exec(e);return t?t[1]:""}function o(e,t){var o=window.getComputedStyle(e).getPropertyValue(t);return parseFloat(o.replace("px",""))}}(),o=function(){var e=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:function(e,t,i){return o(e)?Promise.resolve(e).then(n).then((function(o){var n=Promise.resolve(e);return o.forEach((function(e){n=n.then((function(o){return r(o,e,t,i)}))})),n})):Promise.resolve(e)},shouldProcess:o,impl:{readUrls:n,inline:r}};function o(t){return-1!==t.search(e)}function n(o){for(var n,r=[];null!==(n=e.exec(o));)r.push(n[1]);return r.filter((function(e){return!t.isDataUrl(e)}))}function r(e,o,n,r){return Promise.resolve(o).then((function(e){return n?t.resolveUrl(e,n):e})).then(r||t.getAndEncode).then((function(e){return t.dataAsUrl(e,t.mimeType(o))})).then((function(n){return e.replace(function(e){return new RegExp("(url\\(['\"]?)("+t.escape(e)+")(['\"]?\\))","g")}(o),"$1"+n+"$3")}))}}(),n=function(){return{resolveAll:function(){return e().then((function(e){return Promise.all(e.map((function(e){return e.resolve()})))})).then((function(e){return e.join("\n")}))},impl:{readAll:e}};function e(){return Promise.resolve(t.asArray(document.styleSheets)).then((function(e){var o=[];return e.forEach((function(e){try{t.asArray(e.cssRules||[]).forEach(o.push.bind(o))}catch(t){console.log("Error while reading CSS rules from "+e.href,t.toString())}})),o})).then((function(e){return e.filter((function(e){return e.type===CSSRule.FONT_FACE_RULE})).filter((function(e){return o.shouldProcess(e.style.getPropertyValue("src"))}))})).then((function(t){return t.map(e)}));function e(e){return{resolve:function(){return o.inlineAll(e.cssText,(e.parentStyleSheet||{}).href)},src:function(){return e.style.getPropertyValue("src")}}}}}(),r=function(){return{inlineAll:function n(r){return r instanceof Element?function(e){var t=e.style.getPropertyValue("background");return t?o.inlineAll(t).then((function(t){e.style.setProperty("background",t,e.style.getPropertyPriority("background"))})).then((function(){return e})):Promise.resolve(e)}(r).then((function(){return r instanceof HTMLImageElement?e(r).inline():Promise.all(t.asArray(r.childNodes).map((function(e){return n(e)})))})):Promise.resolve(r)},impl:{newImage:e}};function e(e){return{inline:function(o){return t.isDataUrl(e.src)?Promise.resolve():Promise.resolve(e.src).then(o||t.getAndEncode).then((function(o){return t.dataAsUrl(o,t.mimeType(e.src))})).then((function(t){return new Promise((function(o,n){e.onload=o,e.onerror=n,e.src=t}))}))}}}}(),i=void 0,a=!1,s={toSvg:c,toPng:function(e,t){return d(e,t||{}).then((function(e){return e.toDataURL()}))},toJpeg:function(e,t){return d(e,t=t||{}).then((function(e){return e.toDataURL("image/jpeg",t.quality||1)}))},toBlob:function(e,o){return d(e,o||{}).then(t.canvasToBlob)},toPixelData:function(e,o){return d(e,o||{}).then((function(o){return o.getContext("2d").getImageData(0,0,t.width(e),t.height(e)).data}))},impl:{fontFaces:n,images:r,util:t,inliner:o,options:{}}};function c(e,o){return function(e){s.impl.options.imagePlaceholder=void 0===e.imagePlaceholder?i:e.imagePlaceholder,s.impl.options.cacheBust=void 0===e.cacheBust?a:e.cacheBust}(o=o||{}),Promise.resolve(e).then((function(e){return l(e,o.filter,!0)})).then(u).then(f).then((function(e){return o.bgcolor&&(e.style.backgroundColor=o.bgcolor),o.width&&(e.style.width=o.width+"px"),o.height&&(e.style.height=o.height+"px"),o.style&&Object.keys(o.style).forEach((function(t){e.style[t]=o.style[t]})),e})).then((function(n){return function(e,o,n){return Promise.resolve(e).then((function(e){return e.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),(new XMLSerializer).serializeToString(e)})).then(t.escapeXhtml).then((function(e){return'<foreignObject x="0" y="0" width="100%" height="100%">'+e+"</foreignObject>"})).then((function(e){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+o+'" height="'+n+'">'+e+"</svg>"})).then((function(e){return"data:image/svg+xml;charset=utf-8,"+e}))}(n,o.width||t.width(e),o.height||t.height(e))}))}function d(e,o){return c(e,o).then(t.makeImage).then(t.delay(100)).then((function(n){var r=function(e){var n=document.createElement("canvas");if(n.width=o.width||t.width(e),n.height=o.height||t.height(e),o.bgcolor){var r=n.getContext("2d");r.fillStyle=o.bgcolor,r.fillRect(0,0,n.width,n.height)}return n}(e);return r.getContext("2d").drawImage(n,0,0),r}))}function l(e,o,n){return n||!o||o(e)?Promise.resolve(e).then((function(e){return e instanceof HTMLCanvasElement?t.makeImage(e.toDataURL()):e.cloneNode(!1)})).then((function(n){return function(e,o,n){var r=e.childNodes;return 0===r.length?Promise.resolve(o):function(e,t,o){var n=Promise.resolve();return t.forEach((function(t){n=n.then((function(){return l(t,o)})).then((function(t){t&&e.appendChild(t)}))})),n}(o,t.asArray(r),n).then((function(){return o}))}(e,n,o)})).then((function(o){return function(e,o){return o instanceof Element?Promise.resolve().then((function(){n=window.getComputedStyle(e),r=o.style,n.cssText?r.cssText=n.cssText:function(e,o){t.asArray(e).forEach((function(t){o.setProperty(t,e.getPropertyValue(t),e.getPropertyPriority(t))}))}(n,r);var n,r})).then((function(){[":before",":after"].forEach((function(n){!function(n){var r=window.getComputedStyle(e,n),i=r.getPropertyValue("content");if(""!==i&&"none"!==i){var a=t.uid();o.className=o.className+" "+a;var s=document.createElement("style");s.appendChild(function(e,o,n){var r="."+e+":"+o,i=n.cssText?a(n):s(n);return document.createTextNode(r+"{"+i+"}");function a(e){var t=e.getPropertyValue("content");return e.cssText+" content: "+t+";"}function s(e){return t.asArray(e).map(o).join("; ")+";";function o(t){return t+": "+e.getPropertyValue(t)+(e.getPropertyPriority(t)?" !important":"")}}}(a,n,r)),o.appendChild(s)}}(n)}))})).then((function(){e instanceof HTMLTextAreaElement&&(o.innerHTML=e.value),e instanceof HTMLInputElement&&o.setAttribute("value",e.value)})).then((function(){o instanceof SVGElement&&(o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o instanceof SVGRectElement&&["width","height"].forEach((function(e){var t=o.getAttribute(e);t&&o.style.setProperty(e,t)})))})).then((function(){return o})):o}(e,o)})):Promise.resolve()}function u(e){return n.resolveAll().then((function(t){var o=document.createElement("style");return e.appendChild(o),o.appendChild(document.createTextNode(t)),e}))}function f(e){return r.inlineAll(e).then((function(){return e}))}e.exports=s}()}(r={path:undefined,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}}),r.exports);const a=class{constructor(t){e(this,t),this.handleSubmit=async e=>{e.preventDefault(),this.showScreenshotMode=!1,this.showModal=!1,this.sending=!0;let t="";this.encodedScreenshot&&await this.encodedScreenshot.then((e=>{t=e})).catch((e=>{console.log(e)}));try{200===(await fetch("https://app.pushfeedback.com/api/feedback/",{method:"POST",body:JSON.stringify({url:window.location.href,message:this.formMessage,email:this.formEmail,project:this.project,screenshot:t}),headers:{"Content-Type":"application/json"}})).status?(this.formSuccess=!0,this.formError=!1):(this.formSuccess=!1,this.formError=!0)}catch(e){this.formSuccess=!1,this.formError=!0}finally{this.sending=!1,this.showModal=!0}},this.close=()=>{this.sending=!1,this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1,this.encodedScreenshot=null,this.formSuccess=!1,this.formError=!1,this.formMessage="",this.formEmail=""},this.openScreenShot=()=>{this.hasSelectedElement=!1,this.showModal=!1,this.showScreenshotMode=!0,this.encodedScreenshot=null,document.getElementsByTagName("html")[0].style.overflow="auto"},this.closeScreenShot=()=>{this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1,this.encodedScreenshot=null,this.overlay.style.display="none",document.getElementsByTagName("html")[0].style.overflow="inherit"},this.handleMouseOverScreenShot=e=>{if(e.preventDefault(),this.hasSelectedElement)return;this.overlay.style.display="none",this.screenshotModal.style.display="none";const t=document.elementFromPoint(e.clientX,e.clientY).getBoundingClientRect();this.screenshotModal.style.display="",this.elementSelected.style.position="absolute",this.elementSelected.style.left=`${t.left}px`,this.elementSelected.style.top=`${t.top}px`,this.elementSelected.style.width=`${t.width}px`,this.elementSelected.style.height=`${t.height}px`,this.elementSelected.classList.add("feedback-modal-element-hover"),this.topSide.style.position="absolute",this.topSide.style.left=`${t.left}px`,this.topSide.style.top="0px",this.topSide.style.width=`${t.width+8}px`,this.topSide.style.height=`${t.top}px`,this.topSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.leftSide.style.position="absolute",this.leftSide.style.left="0px",this.leftSide.style.top="0px",this.leftSide.style.width=`${t.left}px`,this.leftSide.style.height="100vh",this.leftSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.bottomSide.style.position="absolute",this.bottomSide.style.left=`${t.left}px`,this.bottomSide.style.top=`${t.bottom+8}px`,this.bottomSide.style.width=`${t.width+8}px`,this.bottomSide.style.height="100vh",this.bottomSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.rightSide.style.position="absolute",this.rightSide.style.left=`${t.right+8}px`,this.rightSide.style.top="0px",this.rightSide.style.width="100%",this.rightSide.style.height="100vh",this.rightSide.style.backgroundColor="rgba(0, 0, 0, 0.3)",this.screenshotModal.style.backgroundColor="transparent"},this.handleMouseClickedSelectedElement=e=>{e.preventDefault(),this.elementSelected&&this.elementSelected.classList.add("feedback-modal-element-selected");let t=this.elementSelected.getBoundingClientRect().top;this.elementSelected.style.top=`${t+window.pageYOffset}px`;const o=this.elementSelected.cloneNode(!0);document.body.appendChild(o),this.elementSelected.style.top=`${t}px`,this.encodedScreenshot=i.toPng(document.body,{cacheBust:!0}).then((function(e){return document.body.removeChild(o),e})).catch((function(e){return console.error("oops, something went wrong!",e),""})),document.getElementsByTagName("html")[0].style.overflow="hidden",this.hasSelectedElement=!0,this.overlay.style.display="block",this.showModal=!0},this.sending=!1,this.formMessage="",this.formEmail="",this.formSuccess=!1,this.formError=!1,this.encodedScreenshot=void 0,this.modalTitle="Share your feedback",this.successModalTitle="Thanks for your feedback!",this.errorModalTitle="Oops! We didn't receive your feedback. Please try again later.",this.modalPosition="center",this.sendButtonText="Send",this.project="",this.screenshotButtonTooltipText="Take a Screenshot",this.screenshotTopbarText="SELECT AN ELEMENT ON THE PAGE",this.email="",this.emailPlaceholder="Email address (optional)",this.messagePlaceholder="How could this page be more helpful?",this.showModal=!1,this.showScreenshotMode=!1,this.hasSelectedElement=!1}componentWillLoad(){this.formEmail=this.email}handleMessageInput(e){this.formMessage=e.target.value}handleEmailInput(e){this.formEmail=e.target.value}render(){return t("div",{class:"feedback-modal-wrapper"},this.showScreenshotMode&&t("div",{class:"feedback-modal-screenshot",ref:e=>this.screenshotModal=e,onMouseMove:this.handleMouseOverScreenShot},t("div",{class:"feedback-modal-screenshot-element-selected",ref:e=>this.elementSelected=e,onClick:this.handleMouseClickedSelectedElement}),t("div",{class:"top-side",ref:e=>this.topSide=e}),t("div",{class:"left-side",ref:e=>this.leftSide=e}),t("div",{class:"bottom-side",ref:e=>this.bottomSide=e}),t("div",{class:"right-side",ref:e=>this.rightSide=e}),t("div",{class:"feedback-modal-screenshot-header",onClick:this.closeScreenShot},t("span",null,this.screenshotTopbarText),t("span",{class:"feedback-modal-screenshot-close"},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#fff","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-x"},t("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),t("div",{class:"feedback-modal-screenshot-overlay",ref:e=>this.overlay=e})),this.showModal&&t("div",{class:`feedback-modal-content feedback-modal-content--${this.modalPosition}`,ref:e=>this.modalContent=e},t("div",{class:"feedback-modal-header"},this.formSuccess||this.formError?this.formSuccess?t("span",{class:"text-center"},this.successModalTitle):this.formError?t("span",{class:"text-center"},this.errorModalTitle):t("span",null):t("span",null,this.modalTitle),t("button",{class:"feedback-modal-close",onClick:this.close},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#ccc","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-x"},t("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),t("div",{class:"feedback-modal-body"},this.formSuccess||this.formError?t("span",null):t("form",{onSubmit:this.handleSubmit},t("div",{class:"feedback-modal-text"},t("textarea",{placeholder:this.messagePlaceholder,value:this.formMessage,onInput:e=>this.handleMessageInput(e),required:!0})),!this.email&&t("div",{class:"feedback-modal-email"},t("input",{type:"email",placeholder:this.emailPlaceholder,onInput:e=>this.handleEmailInput(e),value:this.formEmail})),t("div",{class:"feedback-modal-buttons"},t("button",{type:"button",class:"button"+(this.encodedScreenshot?" active":""),title:this.screenshotButtonTooltipText,onClick:this.openScreenShot,disabled:this.sending},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"feather feather-camera"},t("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),t("circle",{cx:"12",cy:"13",r:"4"}))),t("button",{class:"button",type:"submit",disabled:this.sending},this.sendButtonText)))),t("div",{class:"feedback-modal-footer"},t("div",{class:"feedback-logo"},t("svg",{class:"w-8 h-8",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},t("defs",null,t("radialGradient",{cx:"21.152%",cy:"86.063%",fx:"21.152%",fy:"86.063%",r:"79.941%",id:"footer-logo"},t("stop",{"stop-color":"#4FD1C5",offset:"0%"}),t("stop",{"stop-color":"#81E6D9",offset:"25.871%"}),t("stop",{"stop-color":"#338CF5",offset:"100%"}))),t("rect",{width:"32",height:"32",rx:"16",fill:"url(#footer-logo)","fill-rule":"nonzero"}))," ",t("a",{href:"https://pushfeedback.com"},"PushFeedback")))))}};a.style=".text-center{text-align:center;flex-grow:1}.feedback-modal{display:inline-block;position:relative}.feedback-modal-content{background-color:var(--feedback-modal-content-bg-color);border-color:1px solid var(--feedback-modal-header-text-color);border-radius:var(--feedback-modal-content-border-radius);box-shadow:0px 1px 2px 0px rgba(60, 64, 67, .30), 0px 2px 6px 2px rgba(60, 64, 67, .15);box-sizing:border-box;color:var(--feedback-modal-content-text-color);display:flex;flex-direction:column;font-family:var(--feedback-modal-content-font-family);max-width:300px;padding:20px;position:fixed;width:100%;z-index:300}.feedback-modal-content.feedback-modal-content--center{left:50%;top:50%;transform:translate(-50%, -50%)}.feedback-modal-content.feedback-modal-content--bottom-right{bottom:var(--feedback-modal-content-position-bottom);right:var(--feedback-modal-content-position-right)}.feedback-modal-content.feedback-modal-content--bottom-left{bottom:var(--feedback-modal-content-position-bottom);left:var(--feedback-modal-content-position-left)}.feedback-modal-content.feedback-modal-content--top-right{right:var(--feedback-modal-content-position-right);top:var(--fedback-modal-content-position-top)}.feedback-modal-content.feedback-modal-content--top-left{left:var(--feedback-modal-content-position-left);top:var(--fedback-modal-content-position-top)}.feedback-modal-header{align-items:center;color:var(--feedback-modal-header-text-color);font-family:var(--feedback-modal-header-font-family);display:flex;font-size:var(--feedback-header-font-size);justify-content:space-between;margin-bottom:20px}.feedback-modal-text{margin-bottom:20px}.feedback-modal-text textarea{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:100px;padding:10px;resize:none;width:100%}.feedback-modal-email{margin-bottom:20px}.feedback-modal-email input{border:1px solid var(--feedback-modal-input-border-color);border-radius:4px;box-sizing:border-box;font-family:var(--feedback-modal-content-font-family);font-size:var(--feedback-modal-input-font-size);height:40px;padding:10px;width:100%}.feedback-modal-text textarea:focus,.feedback-modal-email input:focus{border:1px solid var(--feedback-modal-input-border-color-focused);outline:none}.feedback-modal-buttons{display:flex;justify-content:space-between}.button{background-color:transparent;border:1px solid var(--feedback-modal-button-border-color);border-radius:var(--feedback-modal-button-border-radius);color:var(--feedback-modal-button-text-color);cursor:pointer;font-size:var(--feedback-modal-button-font-size);padding:5px 10px}.button:hover,.button.active{color:var(--feedback-modal-button-text-color-active);background-color:var(--feedback-modal-button-bg-color-active);border:1px solid var(--feedback-modal-button-border-color-active)}.feedback-modal-footer{font-size:12px;margin-top:5px 0;text-align:center}.feedback-modal-footer a{color:#191919;text-decoration:none}.feedback-logo{display:flex;align-items:center;justify-content:center;margin-top:5px}.feedback-logo svg{max-width:12px;margin-right:5px}.feedback-modal-close{background-color:var(--feedback-modal-close-bg-color);border:0;border-radius:50%;cursor:pointer;margin-left:auto;padding:0;width:24px;height:24px}.feedback-modal-screenshot{background-color:var(--feedback-modal-screenshot-bg-color);box-shadow:0px 0px 0px 5px var(--feedback-modal-screenshot-element-selected-bg-color) inset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-screenshot-header{align-items:center;background-color:var(--feedback-modal-screenshot-header-bg-color);color:var(--feedback-modal-screenshot-element-selected-text-color);cursor:pointer;display:flex;padding:5px;position:fixed;justify-content:center;width:100%;z-index:200}.feedback-modal-screenshot-header span{padding-left:10px;padding-right:10px}.feedback-modal-screenshot-overlay{background-color:transparent;cursor:unset;height:100vh;left:0;position:fixed;top:0;width:100%;z-index:100}.feedback-modal-message{font-size:var(--fedback-modal-message-font-size)}.feedback-modal-element-hover{cursor:pointer;background-color:transparent;border:4px dashed var(--feedback-modal-screenshot-element-hover-border-color)}.feedback-modal-element-selected{border:4px solid var(--feedback-modal-screenshot-element-selected-border-color)}";export{n as feedback_button,a as feedback_modal}
@@ -1,2 +0,0 @@
1
- let e,t,n=!1,l=!1;const s="http://www.w3.org/1999/xlink",o={},i=e=>"object"==(e=typeof e)||"function"===e,r=(e,t,...n)=>{let l=null,s=null,o=!1,r=!1;const u=[],f=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?f(l):null!=l&&"boolean"!=typeof l&&((o="function"!=typeof e&&!i(l))&&(l+=""),o&&r?u[u.length-1].t+=l:u.push(o?c(null,l):l),r=o)};if(f(n),t){t.key&&(s=t.key);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const a=c(e,null);return a.l=t,u.length>0&&(a.o=u),a.i=s,a},c=(e,t)=>({u:0,h:e,t,$:null,o:null,l:null,i:null}),u={},f=new WeakMap,a=e=>"sc-"+e.p,h=(e,t,n,l,o,r)=>{if(n!==l){let c=U(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,s=p(n),o=p(l);t.remove(...s.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!s.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("key"===t);else if("ref"===t)l&&l(e);else if(c||"o"!==t[0]||"n"!==t[1]){const f=i(l);if((c||f&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{const s=null==l?"":l;"list"===t?c=!1:null!=n&&e[t]==s||(e[t]=s)}}catch(e){}let a=!1;u!==(u=u.replace(/^xlink\:?/,""))&&(t=u,a=!0),null==l||!1===l?!1===l&&""!==e.getAttribute(t)||(a?e.removeAttributeNS(s,t):e.removeAttribute(t)):(!c||4&r||o)&&!f&&(l=!0===l?"":l,a?e.setAttributeNS(s,t,l):e.setAttribute(t,l))}else t="-"===t[2]?t.slice(3):U(_,u)?u.slice(2):u[2]+t.slice(3),n&&B.rel(e,t,n,!1),l&&B.ael(e,t,l,!1)}},$=/\s/,p=e=>e?e.split($):[],y=(e,t,n,l)=>{const s=11===t.$.nodeType&&t.$.host?t.$.host:t.$,i=e&&e.l||o,r=t.l||o;for(l in i)l in r||h(s,l,i[l],void 0,n,t.u);for(l in r)h(s,l,i[l],r[l],n,t.u)},d=(t,l,s)=>{const o=l.o[s];let i,r,c=0;if(null!==o.t)i=o.$=z.createTextNode(o.t);else{if(n||(n="svg"===o.h),i=o.$=z.createElementNS(n?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.h),n&&"foreignObject"===o.h&&(n=!1),y(null,o,n),null!=e&&i["s-si"]!==e&&i.classList.add(i["s-si"]=e),o.o)for(c=0;c<o.o.length;++c)r=d(t,o,c),r&&i.appendChild(r);"svg"===o.h?n=!1:"foreignObject"===i.tagName&&(n=!0)}return i},w=(e,n,l,s,o,i)=>{let r,c=e;for(c.shadowRoot&&c.tagName===t&&(c=c.shadowRoot);o<=i;++o)s[o]&&(r=d(null,l,o),r&&(s[o].$=r,c.insertBefore(r,n)))},m=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.$,v(l),s.remove())},b=(e,t)=>e.h===t.h&&e.i===t.i,g=(e,t)=>{const l=t.$=e.$,s=e.o,o=t.o,i=t.h,r=t.t;null===r?(n="svg"===i||"foreignObject"!==i&&n,"slot"===i||y(e,t,n),null!==s&&null!==o?((e,t,n,l)=>{let s,o,i=0,r=0,c=0,u=0,f=t.length-1,a=t[0],h=t[f],$=l.length-1,p=l[0],y=l[$];for(;i<=f&&r<=$;)if(null==a)a=t[++i];else if(null==h)h=t[--f];else if(null==p)p=l[++r];else if(null==y)y=l[--$];else if(b(a,p))g(a,p),a=t[++i],p=l[++r];else if(b(h,y))g(h,y),h=t[--f],y=l[--$];else if(b(a,y))g(a,y),e.insertBefore(a.$,h.$.nextSibling),a=t[++i],y=l[--$];else if(b(h,p))g(h,p),e.insertBefore(h.$,a.$),h=t[--f],p=l[++r];else{for(c=-1,u=i;u<=f;++u)if(t[u]&&null!==t[u].i&&t[u].i===p.i){c=u;break}c>=0?(o=t[c],o.h!==p.h?s=d(t&&t[r],n,c):(g(o,p),t[c]=void 0,s=o.$),p=l[++r]):(s=d(t&&t[r],n,r),p=l[++r]),s&&a.$.parentNode.insertBefore(s,a.$)}i>f?w(e,null==l[$+1]?null:l[$+1].$,n,l,r,$):r>$&&m(t,i,f)})(l,s,t,o):null!==o?(null!==e.t&&(l.textContent=""),w(l,null,t,o,0,o.length-1)):null!==s&&m(s,0,s.length-1),n&&"svg"===i&&(n=!1)):e.t!==r&&(l.data=r)},v=e=>{e.l&&e.l.ref&&e.l.ref(null),e.o&&e.o.map(v)},S=(e,t)=>{t&&!e.m&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.m=t)))},j=(e,t)=>{if(e.u|=16,!(4&e.u))return S(e,e.g),ee((()=>k(e,t)));e.u|=512},k=(e,t)=>{const n=e.v;let l;return t&&(l=L(n,"componentWillLoad")),P(l,(()=>O(e,n,t)))},O=async(e,t,n)=>{const l=e.S,s=l["s-rc"];n&&(e=>{const t=e.j,n=e.S,l=t.u,s=((e,t)=>{let n=a(t);const l=V.get(n);if(e=11===e.nodeType?e:z,l)if("string"==typeof l){let t,s=f.get(e=e.head||e);s||f.set(e,s=new Set),s.has(n)||(t=z.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),s&&s.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=s,n.classList.add(s+"-h"))})(e);M(e,t),s&&(s.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>x(e);0===t.length?n():(Promise.all(t).then(n),e.u|=4,t.length=0)}},M=(n,l)=>{try{l=l.render(),n.u&=-17,n.u|=2,((n,l)=>{const s=n.S,o=n.j,i=n.k||c(null,null),f=(e=>e&&e.h===u)(l)?l:r(null,null,l);t=s.tagName,o.O&&(f.l=f.l||{},o.O.map((([e,t])=>f.l[t]=s[e]))),f.h=null,f.u|=4,n.k=f,f.$=i.$=s.shadowRoot||s,e=s["s-sc"],g(i,f)})(n,l)}catch(e){q(e,n.S)}return null},x=e=>{const t=e.S,n=e.v,l=e.g;64&e.u||(e.u|=64,E(t),L(n,"componentDidLoad"),e.M(t),l||C()),e.m&&(e.m(),e.m=void 0),512&e.u&&Z((()=>j(e,!1))),e.u&=-517},C=()=>{E(z.documentElement),Z((()=>(e=>{const t=B.ce("appload",{detail:{namespace:"pushfeedback"}});return e.dispatchEvent(t),t})(_)))},L=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){q(e)}},P=(e,t)=>e&&e.then?e.then(t):t(),E=e=>e.classList.add("hydrated"),N=(e,t,n)=>{if(t.C){const l=Object.entries(t.C),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>A(this).L.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=A(e),o=s.L.get(t),r=s.u,c=s.v;n=((e,t)=>null==e||i(e)?e:4&t?"false"!==e&&(""===e||!!e):1&t?e+"":e)(n,l.C[t][0]),8&r&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n)||(s.L.set(t,n),c&&2==(18&r)&&j(s,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;s.attributeChangedCallback=function(e,t,l){B.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(s.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const s=l[1]||e;return n.set(s,e),512&l[0]&&t.O.push([e,s]),s}))}}return e},T=(e,t={})=>{const n=[],l=t.exclude||[],s=_.customElements,o=z.head,i=o.querySelector("meta[charset]"),r=z.createElement("style"),c=[];let u,f=!0;Object.assign(B,t),B.P=new URL(t.resourcesUrl||"./",z.baseURI).href,e.map((e=>{e[1].map((t=>{const o={u:t[0],p:t[1],C:t[2],N:t[3]};o.C=t[2],o.O=[];const i=o.p,r=class extends HTMLElement{constructor(e){super(e),R(e=this,o),1&o.u&&e.attachShadow({mode:"open"})}connectedCallback(){u&&(clearTimeout(u),u=null),f?c.push(this):B.jmp((()=>(e=>{if(0==(1&B.u)){const t=A(e),n=t.j,l=()=>{};if(!(1&t.u)){t.u|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){S(t,t.g=n);break}}n.C&&Object.entries(n.C).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.u)){{if(t.u|=32,(s=F(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(N(s,n,2),s.isProxied=!0);const e=()=>{};t.u|=8;try{new s(t)}catch(e){q(e)}t.u&=-9,e()}if(s.style){let e=s.style;const t=a(n);if(!V.has(t)){const l=()=>{};((e,t,n)=>{let l=V.get(e);I&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,V.set(e,l)})(t,e,!!(1&n.u)),l()}}}const o=t.g,i=()=>j(t,!0);o&&o["s-rc"]?o["s-rc"].push(i):i()})(0,t,n)}l()}})(this)))}disconnectedCallback(){B.jmp((()=>{}))}componentOnReady(){return A(this).T}};o.W=e[0],l.includes(i)||s.get(i)||(n.push(i),s.define(i,N(r,o,1)))}))})),r.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",r.setAttribute("data-styles",""),o.insertBefore(r,i?i.nextSibling:o.firstChild),f=!1,c.length?c.map((e=>e.connectedCallback())):B.jmp((()=>u=setTimeout(C,30)))},W=new WeakMap,A=e=>W.get(e),H=(e,t)=>W.set(t.v=e,t),R=(e,t)=>{const n={u:0,S:e,j:t,L:new Map};return n.T=new Promise((e=>n.M=e)),e["s-p"]=[],e["s-rc"]=[],W.set(e,n)},U=(e,t)=>t in e,q=(e,t)=>(0,console.error)(e,t),D=new Map,F=e=>{const t=e.p.replace(/-/g,"_"),n=e.W,l=D.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(D.set(n,e),e[t])),q)
2
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},V=new Map,_="undefined"!=typeof window?window:{},z=_.document||{head:{}},B={u:0,P:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},G=e=>Promise.resolve(e),I=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),J=[],K=[],Q=(e,t)=>n=>{e.push(n),l||(l=!0,t&&4&B.u?Z(Y):B.raf(Y))},X=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){q(e)}e.length=0},Y=()=>{X(J),X(K),(l=J.length>0)&&B.raf(Y)},Z=e=>G().then(e),ee=Q(K,!0);export{u as H,T as b,r as h,G as p,H as r}