hypothesis 1.1034.0 → 1.1035.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/boot.js +1 -1
- package/build/manifest.json +11 -11
- package/build/scripts/annotator.bundle.js +1 -1
- package/build/scripts/sidebar.bundle.js +11 -11
- package/build/scripts/sidebar.bundle.js.map +1 -1
- package/build/scripts/ui-playground.bundle.js +134 -134
- package/build/scripts/ui-playground.bundle.js.map +1 -1
- package/build/styles/annotator.css +11 -15
- package/build/styles/annotator.css.map +1 -1
- package/build/styles/sidebar.css +11 -2
- package/build/styles/sidebar.css.map +1 -1
- package/build/styles/ui-playground.css +11 -2
- package/build/styles/ui-playground.css.map +1 -1
- package/package.json +4 -4
package/build/boot.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";function t(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function e(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.every((function(e){return"function"==typeof t[e]}))}var n={es2017:function(){return!e(Object,"entries","values")},es2018:function(){return"function"!=typeof Promise||!e(Promise.prototype,"finally")}};function r(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=o(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,s=function(){};return{s:s,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){l=!0,a=t},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function s(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||o(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){if(t){if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var i=["es2017","es2018"];function l(t){t.setAttribute("data-hypothesis-asset","")}function c(t,e){var n=t.createElement("link");n.rel="stylesheet",n.type="text/css",n.href=e,l(n),t.head.appendChild(n)}function u(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.esModule,s=void 0===r||r,o=n.forceReload,a=void 0!==o&&o,i=t.createElement("script");s&&(i.type="module"),a&&(e+="#ts=".concat(Date.now())),i.src=e,i.async=!1,l(i),t.head.appendChild(i)}function p(t,e,n,r){var s=t.createElement("link");s.rel=e,s.href=r,s.type="application/annotator+".concat(n),l(s),t.head.appendChild(s)}function d(t,e,n){var r=t.createElement("link");r.rel="preload",r.as=e,r.href=n,"fetch"===e&&(r.crossOrigin="anonymous"),l(r),t.head.appendChild(r)}function f(t,e){return t.assetRoot+"build/"+t.manifest[e]}function h(t){return function(t){return t.filter((function(t){var e=n[t];if(!e)throw new Error('Unknown polyfill set "'.concat(t,'"'));return e()}))}(t).map((function(t){return"scripts/polyfills-".concat(t,".bundle.js")}))}function y(t){var e=t.match(/(https?):\/\/([^:/]+)/);return e?{protocol:e[1],hostname:e[2]}:null}function m(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=t.currentScript;return e?y(e.src):null}function b(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===t.indexOf("{"))return t;var n=m(e);if(!n)throw new Error("Could not process URL template because script origin is unknown");return t=(t=t.replace("{current_host}",n.hostname)).replace("{current_scheme}",n.protocol)}var v={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?
|
|
1
|
+
!function(){"use strict";function t(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function e(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.every((function(e){return"function"==typeof t[e]}))}var n={es2017:function(){return!e(Object,"entries","values")},es2018:function(){return"function"!=typeof Promise||!e(Promise.prototype,"finally")}};function r(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=o(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,s=function(){};return{s:s,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){l=!0,a=t},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function s(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||o(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){if(t){if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var i=["es2017","es2018"];function l(t){t.setAttribute("data-hypothesis-asset","")}function c(t,e){var n=t.createElement("link");n.rel="stylesheet",n.type="text/css",n.href=e,l(n),t.head.appendChild(n)}function u(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.esModule,s=void 0===r||r,o=n.forceReload,a=void 0!==o&&o,i=t.createElement("script");s&&(i.type="module"),a&&(e+="#ts=".concat(Date.now())),i.src=e,i.async=!1,l(i),t.head.appendChild(i)}function p(t,e,n,r){var s=t.createElement("link");s.rel=e,s.href=r,s.type="application/annotator+".concat(n),l(s),t.head.appendChild(s)}function d(t,e,n){var r=t.createElement("link");r.rel="preload",r.as=e,r.href=n,"fetch"===e&&(r.crossOrigin="anonymous"),l(r),t.head.appendChild(r)}function f(t,e){return t.assetRoot+"build/"+t.manifest[e]}function h(t){return function(t){return t.filter((function(t){var e=n[t];if(!e)throw new Error('Unknown polyfill set "'.concat(t,'"'));return e()}))}(t).map((function(t){return"scripts/polyfills-".concat(t,".bundle.js")}))}function y(t){var e=t.match(/(https?):\/\/([^:/]+)/);return e?{protocol:e[1],hostname:e[2]}:null}function m(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=t.currentScript;return e?y(e.src):null}function b(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===t.indexOf("{"))return t;var n=m(e);if(!n)throw new Error("Could not process URL template because script origin is unknown");return t=(t=t.replace("{current_host}",n.hostname)).replace("{current_scheme}",n.protocol)}var v={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?37dd30","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?dc7bc7","styles/annotator.css":"styles/annotator.css?af785c","styles/annotator.css.map":"styles/annotator.css.map?8ee081","styles/highlights.css":"styles/highlights.css?5dd56a","styles/highlights.css.map":"styles/highlights.css.map?f623a8","styles/katex.min.css":"styles/katex.min.css?ac2365","styles/katex.min.css.map":"styles/katex.min.css.map?4daef7","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?ed2cb3","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?13b830","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?203ad9","styles/sidebar.css":"styles/sidebar.css?cb16d4","styles/sidebar.css.map":"styles/sidebar.css.map?8d53bb","styles/ui-playground.css.map":"styles/ui-playground.css.map?26452a","styles/ui-playground.css":"styles/ui-playground.css?a0ec3b","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?d9f991","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?795949","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?83fb2f"};if(function(){var t=[function(){return Promise.resolve()},function(){return new Map},function(){return new URL(document.location.href)},function(){return new Request("https://hypothes.is")},function(){return Element.prototype.attachShadow},function(){return CSS.supports("display: grid")},function(){return document.evaluate("/html/body",document,null,XPathResult.ANY_TYPE,null),!0}];try{return t.every((function(t){return t()}))}catch(t){return!1}}()){var g=function(e){for(var n={},r=e.querySelectorAll("script.js-hypothesis-config"),s=0;s<r.length;s++){var o=void 0;try{o=JSON.parse(r[s].textContent||"")}catch(t){console.warn("Could not parse settings from js-hypothesis-config tags",t),o={}}t(n,o)}return n}(document),j=b(g.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1035.0/");if(document.querySelector("hypothesis-app")){!function(t,e){d(t,"fetch",e.apiUrl),d(t,"fetch",e.apiUrl+"links");var n,o=h(i),a=r([].concat(s(o),["scripts/sidebar.bundle.js"]));try{for(a.s();!(n=a.n()).done;)u(t,f(e,n.value),{esModule:!0})}catch(t){a.e(t)}finally{a.f()}for(var l=0,p=["styles/katex.min.css","styles/sidebar.css"];l<p.length;l++)c(t,f(e,p[l]))}(document,{assetRoot:j,manifest:v,apiUrl:g.apiUrl})}else{var w=g,A=b(w.notebookAppUrl||"https://hypothes.is/notebook"),k=b(w.sidebarAppUrl||"https://hypothes.is/app.html");!function(t,e){if(!t.querySelector('link[type="application/annotator+html"]')){p(t,"sidebar","html",e.sidebarAppUrl),p(t,"notebook","html",e.notebookAppUrl),d(t,"style",f(e,"styles/annotator.css")),p(t,"hypothesis-client","javascript",e.assetRoot+"build/boot.js");var n,o=h(i),a=r([].concat(s(o),["scripts/annotator.bundle.js"]));try{for(a.s();!(n=a.n()).done;)u(t,f(e,n.value),{esModule:!1})}catch(t){a.e(t)}finally{a.f()}var l=[];void 0!==window.PDFViewerApplication&&l.push("styles/pdfjs-overrides.css"),l.push("styles/highlights.css");for(var y=0,m=l;y<m.length;y++)c(t,f(e,m[y]))}}(document,{assetRoot:j,manifest:v,notebookAppUrl:A,sidebarAppUrl:k})}}else console.warn("The Hypothesis annotation tool is not supported in this browser. See https://web.hypothes.is/help/which-browsers-are-supported-by-hypothesis/.")}();
|
package/build/manifest.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
"scripts/annotator.bundle.js": "scripts/annotator.bundle.js?
|
|
3
|
-
"scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?
|
|
4
|
-
"styles/annotator.css": "styles/annotator.css?
|
|
2
|
+
"scripts/annotator.bundle.js": "scripts/annotator.bundle.js?37dd30",
|
|
3
|
+
"scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?dc7bc7",
|
|
4
|
+
"styles/annotator.css": "styles/annotator.css?af785c",
|
|
5
|
+
"styles/annotator.css.map": "styles/annotator.css.map?8ee081",
|
|
5
6
|
"styles/highlights.css": "styles/highlights.css?5dd56a",
|
|
6
|
-
"styles/annotator.css.map": "styles/annotator.css.map?638a46",
|
|
7
7
|
"styles/highlights.css.map": "styles/highlights.css.map?f623a8",
|
|
8
8
|
"styles/katex.min.css": "styles/katex.min.css?ac2365",
|
|
9
9
|
"styles/katex.min.css.map": "styles/katex.min.css.map?4daef7",
|
|
10
10
|
"styles/pdfjs-overrides.css": "styles/pdfjs-overrides.css?ed2cb3",
|
|
11
11
|
"styles/pdfjs-overrides.css.map": "styles/pdfjs-overrides.css.map?13b830",
|
|
12
|
-
"
|
|
13
|
-
"styles/sidebar.css": "styles/sidebar.css?
|
|
14
|
-
"styles/
|
|
15
|
-
"styles/ui-playground.css.map": "styles/ui-playground.css.map?
|
|
12
|
+
"scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?203ad9",
|
|
13
|
+
"styles/sidebar.css": "styles/sidebar.css?cb16d4",
|
|
14
|
+
"styles/sidebar.css.map": "styles/sidebar.css.map?8d53bb",
|
|
15
|
+
"styles/ui-playground.css.map": "styles/ui-playground.css.map?26452a",
|
|
16
|
+
"styles/ui-playground.css": "styles/ui-playground.css?a0ec3b",
|
|
17
|
+
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?d9f991",
|
|
16
18
|
"scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?795949",
|
|
17
|
-
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?
|
|
18
|
-
"scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?5dd5ee",
|
|
19
|
-
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?b7812f"
|
|
19
|
+
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?83fb2f"
|
|
20
20
|
}
|
|
@@ -104,7 +104,7 @@ this._listeners.add(this.element,"mouseout",(()=>{this._highlightsVisible&&this.
|
|
|
104
104
|
this._portFinder.destroy(),this._hostRPC.destroy(),this._sidebarRPC.destroy(),this._listeners.removeAll(),this._selectionObserver.disconnect(),this._adder.destroy(),this._bucketBarClient.destroy(),function(t){Ae(Array.from(t.querySelectorAll("hypothesis-highlight")))}(this.element),this._integration.destroy()}async anchor(t){const e=t=>{const e=Oo(t);if(!e)return;const n=Ee(e);n.forEach((e=>{e._annotation=t.annotation})),t.highlights=n,this._focusedAnnotations.has(t.annotation.$tag)&&ke(n,!0)};this.detach(t.$tag,!1),this._annotations.add(t.$tag),t.target||(t.target=[]);const n=await Promise.all(t.target.map((async e=>{if(!e.selector||!e.selector.some((t=>"TextQuoteSelector"===t.type)))return{annotation:t,target:e};let n;try{const o=await this._integration.anchor(this.element,e.selector),i=_e.fromRange(o);n={annotation:t,target:e,range:i}}catch(o){n={annotation:t,target:e}}return n})));if(!this._annotations.has(t.$tag))return[];for(let t of n)e(t)
|
|
105
105
|
;return t.$orphan=n.length>0&&n.every((t=>t.target.selector&&!t.range)),this._updateAnchors(this.anchors.concat(n),!0),this._sidebarRPC.call("syncAnchoringStatus",t),n}detach(t,e=!0){this._annotations.delete(t);const n=[];for(let e of this.anchors)e.annotation.$tag!==t?n.push(e):e.highlights&&Ae(e.highlights);this._updateAnchors(n,e)}_updateAnchors(t,e){this.anchors=t,e&&this._bucketBarClient.update(this.anchors)}async createAnnotation({highlight:t=!1}={}){const e=this.selectedRanges;this.selectedRanges=[];const n=await this.getDocumentInfo(),o=this.element,i=(await Promise.all(e.map((t=>this._integration.describe(o,t))))).map((t=>({source:n.uri,selector:t}))),r={uri:n.uri,document:n.metadata,target:i,$highlight:t,$tag:"a:"+Lt(8)};return this._sidebarRPC.call("createAnnotation",r),this.anchor(r),Io(),r}_focusAnnotations(t){this._focusedAnnotations.clear(),t.forEach((t=>this._focusedAnnotations.add(t)));for(let e of this.anchors)if(e.highlights){const n=t.includes(e.annotation.$tag);ke(e.highlights,n)}
|
|
106
106
|
this._sidebarRPC.call("focusAnnotations",t)}_scrollToClosestOffScreenAnchor(t,e){const n=function(t,e){let n=null,o=0;for(let r of t){var i;if(null===(i=r.highlights)||void 0===i||!i.length)continue;const t=Re(r.highlights).top;"up"===e&&t>=137||"down"===e&&t<=window.innerHeight-22||(!n||"up"===e&&t>o||"down"===e&&t<o)&&(n=r,o=t)}return n}(this.anchors.filter((({annotation:e})=>t.includes(e.$tag))),e);n&&this._integration.scrollToAnchor(n)}_onSelection(t){if(!this._integration.canAnnotate(t))return void this._onClearSelection();const e=document.getSelection(),n=we(e),o=xe(e);o?(this.selectedRanges=[t],this._hostRPC.call("textSelected"),this._adder.annotationsForSelection=Mo(),this._isAdderVisible=!0,this._adder.show(o,n)):this._onClearSelection()}_onClearSelection(){this._isAdderVisible=!1,this._adder.hide(),this.selectedRanges=[],this._informHostOnNextSelectionClear&&this._hostRPC.call("textUnselected"),this._informHostOnNextSelectionClear=!0}selectAnnotations(t,e=!1){
|
|
107
|
-
e?this._sidebarRPC.call("toggleAnnotationSelection",t):this._sidebarRPC.call("showAnnotations",t),this._sidebarRPC.call("openSidebar")}setHighlightsVisible(t){!function(t,e){t.classList.toggle("hypothesis-highlights-always-on",e)}(this.element,t),this._highlightsVisible=t}fitSideBySide(t){this._sideBySideActive=this._integration.fitSideBySide(t)}get sideBySideActive(){return this._sideBySideActive}get focusedAnnotationTags(){return this._focusedAnnotations}}function Bo(t,e){const n=new URL(t),o=new URLSearchParams;return o.append("config",JSON.stringify(e)),n.hash=o.toString(),n.toString()}function Fo(t,e){var n;const o={};for(let[t,n]of Object.entries(e))"notebookAppUrl"!==t&&"sidebarAppUrl"!==t&&null!=n&&(o[t]=n);o.origin=new URL(t).origin,o.version="1.
|
|
107
|
+
e?this._sidebarRPC.call("toggleAnnotationSelection",t):this._sidebarRPC.call("showAnnotations",t),this._sidebarRPC.call("openSidebar")}setHighlightsVisible(t){!function(t,e){t.classList.toggle("hypothesis-highlights-always-on",e)}(this.element,t),this._highlightsVisible=t}fitSideBySide(t){this._sideBySideActive=this._integration.fitSideBySide(t)}get sideBySideActive(){return this._sideBySideActive}get focusedAnnotationTags(){return this._focusedAnnotations}}function Bo(t,e){const n=new URL(t),o=new URLSearchParams;return o.append("config",JSON.stringify(e)),n.hash=o.toString(),n.toString()}function Fo(t,e){var n;const o={};for(let[t,n]of Object.entries(e))"notebookAppUrl"!==t&&"sidebarAppUrl"!==t&&null!=n&&(o[t]=n);o.origin=new URL(t).origin,o.version="1.1035.0";const i=new URL(window.location.href);if(i.hash="",o.hostURL=i.toString(),Array.isArray(o.services)&&(null===(n=o.services)||void 0===n?void 0:n.length)>0){const t=o.services[0];t.onLoginRequest&&(t.onLoginRequestProvided=!0),
|
|
108
108
|
t.onLogoutRequest&&(t.onLogoutRequestProvided=!0),t.onSignupRequest&&(t.onSignupRequestProvided=!0),t.onProfileRequest&&(t.onProfileRequestProvided=!0),t.onHelpRequest&&(t.onHelpRequestProvided=!0)}return o}function Ho({config:t,groupId:e}){return mt("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allowFullScreen:!0,src:Bo(t.notebookAppUrl,{...Fo(t.notebookAppUrl,t),group:e})})}function Vo({eventBus:t,config:e}){const[n,o]=rt(0),[i,r]=rt(!0),[s,a]=rt(null),c=ct(""),l=ct(null);st((()=>(c.current=document.body.style.overflow,()=>{document.body.style.overflow=c.current})),[]),st((()=>{document.body.style.overflow=i?c.current:"hidden"}),[i]),st((()=>{const e=t.createEmitter();return e.subscribe("openNotebook",(t=>{r(!1),o((t=>t+1)),a(t)})),l.current=e,()=>{e.destroy()}}),[t]);return null===s?null:mt("div",{className:Z("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:i}),"data-testid":"notebook-outer",children:mt("div",{className:"relative w-full h-full",
|
|
109
109
|
"data-testid":"notebook-inner",children:[mt("div",{className:"absolute right-0 text-xl m-3",children:mt(Ct,{icon:"cancel",title:"Close the Notebook",onClick:()=>{var t;r(!0),null===(t=l.current)||void 0===t||t.publish("closeNotebook")},variant:"dark"})}),mt(Ho,{config:e,groupId:s},n)]})})}class qo{constructor(t,e,n={}){this._outerContainer=document.createElement("hypothesis-notebook"),t.appendChild(this._outerContainer),this.shadowRoot=he(this._outerContainer),M(mt(Vo,{eventBus:e,config:n}),this.shadowRoot)}destroy(){M(null,this.shadowRoot),this._outerContainer.remove()}}var Uo={exports:{}};!function(t){!function(e,n,o,i){var r,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),c=Math.round,l=Math.abs,h=Date.now;function u(t,e,n){return setTimeout(v(t,n),e)}function d(t,e,n){return!!Array.isArray(t)&&(f(t,n[e],n),!0)}function f(t,e,n){var o;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==i)for(o=0;o<t.length;)e.call(n,t[o],o,t),o++;else for(o in t)t.hasOwnProperty(o)&&e.call(n,t[o],o,t)}
|
|
110
110
|
function p(t,n,o){var i="DEPRECATED METHOD: "+n+"\n"+o+" AT \n";return function(){var n=new Error("get-stack-trace"),o=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=e.console&&(e.console.warn||e.console.log);return r&&r.call(e.console,i,o),t.apply(this,arguments)}}r="function"!=typeof Object.assign?function(t){if(t===i||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var o=arguments[n];if(o!==i&&null!==o)for(var r in o)o.hasOwnProperty(r)&&(e[r]=o[r])}return e}:Object.assign;var g=p((function(t,e,n){for(var o=Object.keys(e),r=0;r<o.length;)(!n||n&&t[o[r]]===i)&&(t[o[r]]=e[o[r]]),r++;return t}),"extend","Use `assign`."),m=p((function(t,e){return g(t,e,!0)}),"merge","Use `assign`.");function _(t,e,n){var o,i=e.prototype;(o=t.prototype=Object.create(i)).constructor=t,o._super=i,n&&r(o,n)}function v(t,e){return function(){
|
|
@@ -99,13 +99,13 @@ _o((function(){return e}),t)}function xo(e){var t=ro.context[e.__c],n=mo(no++,9)
|
|
|
99
99
|
;r&&r.__H&&(r.__H.__.forEach((function(e){try{Co(e)}catch(e){t=e}})),t&&n.__e(t,r.__v))};var So="function"==typeof requestAnimationFrame;function Co(e){var t=ro,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),ro=t}function Ao(e){var t=ro;e.__c=e.__(),ro=t}function To(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Eo(e,t){return"function"==typeof t?t(e):t}var No=0;function Mo(e,t,r,o,i){var a,s,l={};for(s in t)"ref"==s?a=t[s]:l[s]=t[s];var c={type:e,props:l,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--No,__source:i,__self:o};if("function"==typeof e&&(a=e.defaultProps))for(s in a)void 0===l[s]&&(l[s]=a[s]);return n.vnode&&n.vnode(c),c}const Lo=new Map;function zo({name:e,className:t="",inline:n=!1,title:r=""}){const o=Lo.get(e);if(!o)throw new Error(`Icon "${e.toString()}" is not registered`);const i=bo();yo((()=>{const e=i.current.querySelector("svg");e&&e.setAttribute("class",t)}),[t,o]);const a={}
|
|
100
100
|
;return r&&(a.title=r),Mo("span",{className:io("Hyp-SvgIcon",{"Hyp-SvgIcon--inline":n}),dangerouslySetInnerHTML:{__html:o},ref:i,...a},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/SvgIcon.js",lineNumber:69,columnNumber:5})}function Oo(e,t){const n="string"==typeof e?Symbol(e):e;return Lo.set(n,t),n}var Io="/home/runner/work/frontend-shared/frontend-shared/src/components/buttons.js";function Po({buttonRef:e,classes:t,className:n,icon:r,iconPosition:o="left",size:i="medium",variant:a="normal",expanded:s,pressed:l,type:c="button",...u}){var h;const d=null!==(h=null==u?void 0:u.role)&&void 0!==h?h:"button",p={"aria-label":u.title};return"tab"===d?p["aria-selected"]=l:(p["aria-pressed"]=l,p["aria-expanded"]=s),Mo("button",{ref:e,className:io(n,`${n}--${i}`,`${n}--${a}`,{[`${n}--icon-${o}`]:r},t),type:c,...p,...u},void 0,!1,{fileName:Io,lineNumber:82,columnNumber:5})}function Ro({className:e="Hyp-IconButton",...t}){const{icon:n}=t;return Mo(Po,{className:e,...t,
|
|
101
101
|
children:Mo(zo,{name:n},void 0,!1,{fileName:Io,lineNumber:109,columnNumber:7})},void 0,!1,{fileName:Io,lineNumber:108,columnNumber:5})}function Do({children:e,className:t="Hyp-LabeledButton",...n}){const{icon:r,iconPosition:o="left"}=n;return Mo(Po,{className:t,...n,children:[r&&"left"===o&&Mo(zo,{name:r},void 0,!1,{fileName:Io,lineNumber:127,columnNumber:43}),e,r&&"right"===o&&Mo(zo,{name:r},void 0,!1,{fileName:Io,lineNumber:129,columnNumber:44})]},void 0,!0,{fileName:Io,lineNumber:126,columnNumber:5})}function Bo(e){return Mo(Po,{className:"Hyp-LinkButton",...e},void 0,!1,{fileName:Io,lineNumber:140,columnNumber:10})}
|
|
102
|
-
Oo("checkbox",' <svg\n width="32"\n height="32"\n viewBox="-4 -4 39 39"\n aria-hidden="true"\n focusable="false"\n >\n <rect\n class="hyp-svg-checkbox--background"\n width="35"\n height="35"\n x="-2"\n y="-2"\n stroke="currentColor"\n fill="none"\n stroke-width="3"\n rx="5"\n ry="5"\n />\n <polyline\n class="hyp-svg-checkbox--checkmark"\n points="4,14 12,23 28,5"\n stroke="transparent"\n stroke-width="5"\n fill="none"\n />\n</svg>');var Fo="/home/runner/work/frontend-shared/frontend-shared/src/components/containers.js";function jo({children:e,classes:t
|
|
103
|
-
function qo({children:e,direction:t="row",classes:n
|
|
104
|
-
const h=Wo("dialog-description"),d=Wo("dialog-title"),p=bo();vo((()=>{if(null!==i){const e=null==i?void 0:i.current;e&&!e.disabled?e.focus():p.current.focus()}}),[]),yo((()=>{const e=p.current.querySelector("p");e&&(e.id=h,p.current.setAttribute("aria-describedby",h))}),[h]);const m=a&&c,f=e||m;return Mo("div",{"aria-labelledby":d,className:io("Hyp-Dialog",{"Hyp-Dialog--closeable":a&&u},r),ref:p,role:s,tabIndex:-1,children:[Mo("header",{className:"Hyp-Dialog__header",children:[o&&Mo("div",{className:"Hyp-Dialog__header-icon",children:Mo(zo,{name:o,title:l,"data-testid":"header-icon"},void 0,!1,{fileName:$o,lineNumber:139,columnNumber:13})},void 0,!1,{fileName:$o,lineNumber:138,columnNumber:11}),Mo("h2",{className:"Hyp-Dialog__title",id:d,children:l},void 0,!1,{fileName:$o,lineNumber:142,columnNumber:9}),a&&u&&Mo("div",{
|
|
105
|
-
lineNumber:146,columnNumber:11})]},void 0,!0,{fileName:$o,lineNumber:136,columnNumber:7}),n,f&&Mo("div",{className:"Hyp-Dialog__actions",children:[m&&Mo(Do,{"data-testid":"cancel-button",onClick:a,children:t},void 0,!1,{fileName:$o,lineNumber:160,columnNumber:13}),e]},void 0,!0,{fileName:$o,lineNumber:158,columnNumber:9})]},void 0,!0,{fileName:$o,lineNumber:125,columnNumber:5})}function Ko({name:e,classes:t="",containerClasses:n="",title:r=""}){const o=Lo.get(e);if(!o)throw new Error(`Icon "${e.toString()}" is not registered`);const i=bo();yo((()=>{const e=i.current.querySelector("svg");e&&e.setAttribute("class",io("Hyp-Icon",t))}),[t,o]);const a={};return r&&(a.title=r),Mo("span",{className:n,dangerouslySetInnerHTML:{__html:o},ref:i,...a},void 0,!1,{
|
|
106
|
-
},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Link.js",lineNumber:24,columnNumber:5})}function Zo(e){const t={Left:"ArrowLeft",Up:"ArrowUp",Down:"ArrowDown",Right:"ArrowRight",Spacebar:" ",Del:"Delete"};return t[e]?t[e]:e}function Jo(e,t,n,{useCapture:r=!1}={}){return t.forEach((t=>e.addEventListener(t,n,r))),()=>{t.forEach((t=>e.removeEventListener(t,n,r)))}}function Qo(e,t,n){vo((()=>{if(!t)return()=>{};const r=Jo(document.body,["keydown"],(e=>{"Escape"===Zo(e.key)&&n()})),o=Jo(document.body,["focus"],(t=>{e.current&&!e.current.contains(t.target)&&n()}),{useCapture:!0}),i=Jo(document.body,["mousedown","click"],(t=>{e.current&&!e.current.contains(t.target)&&n()}),{useCapture:!0});return()=>{r(),i(),o()}}),[e,t,n])
|
|
107
|
-
lineNumber:39,columnNumber:7}),Mo("div",{className:"Hyp-Modal",ref:r,children:Mo(Yo,{onCancel:t,...n,children:e},void 0,!1,{fileName:ei,lineNumber:41,columnNumber:9})},void 0,!1,{fileName:ei,lineNumber:40,columnNumber:7})]},void 0,!0)}function ni({message:e,confirmAction:t,onConfirm:n,onCancel:r,...o}){return Mo(ti,{onCancel:r,buttons:[Mo(Do,{onClick:n,variant:"primary","data-testid":"confirm-button",children:t},"ok",!1,{fileName:ei,lineNumber:76,columnNumber:9})],...o,children:Mo("p",{children:e},void 0,!1,{fileName:ei,lineNumber:87,columnNumber:7})},void 0,!1,{fileName:ei,lineNumber:73,columnNumber:5})}var ri="/home/runner/work/frontend-shared/frontend-shared/src/components/Panel.js";const oi=Oo("cancel",Uo);function ii({children:e,icon:t,onClose:n,title:r}){
|
|
108
|
-
lineNumber:37,columnNumber:13})},void 0,!1,{fileName:ri,lineNumber:36,columnNumber:11}),Mo("h2",{className:"Hyp-Panel__title",children:r},void 0,!1,{fileName:ri,lineNumber:40,columnNumber:9}),o&&Mo("div",{className:"Hyp-Panel__close",children:Mo(Ro,{icon:oi,title:"Close",onClick:n},void 0,!1,{fileName:ri,lineNumber:43,columnNumber:13})},void 0,!1,{fileName:ri,lineNumber:42,columnNumber:11})]},void 0,!0,{fileName:ri,lineNumber:34,columnNumber:7}),Mo("div",{className:"Hyp-Panel__content",children:e},void 0,!1,{fileName:ri,lineNumber:47,columnNumber:7})]},void 0,!0,{fileName:ri,lineNumber:29,columnNumber:5})}
|
|
102
|
+
Oo("checkbox",' <svg\n width="32"\n height="32"\n viewBox="-4 -4 39 39"\n aria-hidden="true"\n focusable="false"\n >\n <rect\n class="hyp-svg-checkbox--background"\n width="35"\n height="35"\n x="-2"\n y="-2"\n stroke="currentColor"\n fill="none"\n stroke-width="3"\n rx="5"\n ry="5"\n />\n <polyline\n class="hyp-svg-checkbox--checkmark"\n points="4,14 12,23 28,5"\n stroke="transparent"\n stroke-width="5"\n fill="none"\n />\n</svg>');var Fo="/home/runner/work/frontend-shared/frontend-shared/src/components/containers.js";function jo({children:e,classes:t,containerRef:n,elementRef:r,...o}){return Mo("div",{className:io("Hyp-Frame",t),...o,ref:null!=r?r:n,children:e},void 0,!1,{fileName:Fo,lineNumber:40,columnNumber:5})}function Ho({children:e,classes:t,containerRef:n,elementRef:r,...o}){return Mo("div",{className:io("Hyp-Card",t),...o,ref:null!=r?r:n,children:e},void 0,!1,{fileName:Fo,lineNumber:63,
|
|
103
|
+
columnNumber:5})}function qo({children:e,direction:t="row",classes:n,containerRef:r,elementRef:o,...i}){return Mo("div",{className:io(`Hyp-Actions--${t}`,n),...i,ref:null!=o?o:r,children:e},void 0,!1,{fileName:Fo,lineNumber:89,columnNumber:5})}var Uo='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 8l3.536-3.536L8 8 4.464 4.464 8 8zm0 0l-3.536 3.536L8 8l3.536 3.536L8 8z"></path></g></svg>\n',$o="/home/runner/work/frontend-shared/frontend-shared/src/components/Dialog.js";const Go=Oo("cancel",Uo);let Vo=0;function Wo(e){const[t]=fo((()=>(++Vo,`${e}-${Vo}`)));return t}
|
|
104
|
+
function Yo({buttons:e,cancelLabel:t="Cancel",children:n,contentClass:r,icon:o,initialFocus:i,onCancel:a,role:s="dialog",title:l,withCancelButton:c=!0,withCloseButton:u=!0}){const h=Wo("dialog-description"),d=Wo("dialog-title"),p=bo();vo((()=>{if(null!==i){const e=null==i?void 0:i.current;e&&!e.disabled?e.focus():p.current.focus()}}),[]),yo((()=>{const e=p.current.querySelector("p");e&&(e.id=h,p.current.setAttribute("aria-describedby",h))}),[h]);const m=a&&c,f=e||m;return Mo("div",{"aria-labelledby":d,className:io("Hyp-Dialog",{"Hyp-Dialog--closeable":a&&u},r),ref:p,role:s,tabIndex:-1,children:[Mo("header",{className:"Hyp-Dialog__header",children:[o&&Mo("div",{className:"Hyp-Dialog__header-icon",children:Mo(zo,{name:o,title:l,"data-testid":"header-icon"},void 0,!1,{fileName:$o,lineNumber:139,columnNumber:13})},void 0,!1,{fileName:$o,lineNumber:138,columnNumber:11}),Mo("h2",{className:"Hyp-Dialog__title",id:d,children:l},void 0,!1,{fileName:$o,lineNumber:142,columnNumber:9}),a&&u&&Mo("div",{
|
|
105
|
+
className:"Hyp-Dialog__close",children:Mo(Ro,{"data-testid":"close-button",icon:Go,title:"Close",onClick:a},void 0,!1,{fileName:$o,lineNumber:147,columnNumber:13})},void 0,!1,{fileName:$o,lineNumber:146,columnNumber:11})]},void 0,!0,{fileName:$o,lineNumber:136,columnNumber:7}),n,f&&Mo("div",{className:"Hyp-Dialog__actions",children:[m&&Mo(Do,{"data-testid":"cancel-button",onClick:a,children:t},void 0,!1,{fileName:$o,lineNumber:160,columnNumber:13}),e]},void 0,!0,{fileName:$o,lineNumber:158,columnNumber:9})]},void 0,!0,{fileName:$o,lineNumber:125,columnNumber:5})}function Ko({name:e,classes:t="",containerClasses:n="",title:r=""}){const o=Lo.get(e);if(!o)throw new Error(`Icon "${e.toString()}" is not registered`);const i=bo();yo((()=>{const e=i.current.querySelector("svg");e&&e.setAttribute("class",io("Hyp-Icon",t))}),[t,o]);const a={};return r&&(a.title=r),Mo("span",{className:n,dangerouslySetInnerHTML:{__html:o},ref:i,...a},void 0,!1,{
|
|
106
|
+
fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Icon.js",lineNumber:60,columnNumber:5})}function Xo({children:e,classes:t="",linkRef:n,...r}){return Mo("a",{className:io("Hyp-Link",t),ref:n,rel:"noopener noreferrer",...r,children:e},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Link.js",lineNumber:24,columnNumber:5})}function Zo(e){const t={Left:"ArrowLeft",Up:"ArrowUp",Down:"ArrowDown",Right:"ArrowRight",Spacebar:" ",Del:"Delete"};return t[e]?t[e]:e}function Jo(e,t,n,{useCapture:r=!1}={}){return t.forEach((t=>e.addEventListener(t,n,r))),()=>{t.forEach((t=>e.removeEventListener(t,n,r)))}}function Qo(e,t,n){vo((()=>{if(!t)return()=>{};const r=Jo(document.body,["keydown"],(e=>{"Escape"===Zo(e.key)&&n()})),o=Jo(document.body,["focus"],(t=>{e.current&&!e.current.contains(t.target)&&n()}),{useCapture:!0}),i=Jo(document.body,["mousedown","click"],(t=>{e.current&&!e.current.contains(t.target)&&n()}),{useCapture:!0});return()=>{r(),i(),o()}}),[e,t,n])
|
|
107
|
+
}var ei="/home/runner/work/frontend-shared/frontend-shared/src/components/Modal.js";function ti({children:e,onCancel:t,...n}){const r=bo();return Qo(r,!0,(()=>{t&&t()})),Mo(m,{children:[Mo("div",{className:"Hyp-Modal__overlay"},void 0,!1,{fileName:ei,lineNumber:39,columnNumber:7}),Mo("div",{className:"Hyp-Modal",ref:r,children:Mo(Yo,{onCancel:t,...n,children:e},void 0,!1,{fileName:ei,lineNumber:41,columnNumber:9})},void 0,!1,{fileName:ei,lineNumber:40,columnNumber:7})]},void 0,!0)}function ni({message:e,confirmAction:t,onConfirm:n,onCancel:r,...o}){return Mo(ti,{onCancel:r,buttons:[Mo(Do,{onClick:n,variant:"primary","data-testid":"confirm-button",children:t},"ok",!1,{fileName:ei,lineNumber:76,columnNumber:9})],...o,children:Mo("p",{children:e},void 0,!1,{fileName:ei,lineNumber:87,columnNumber:7})},void 0,!1,{fileName:ei,lineNumber:73,columnNumber:5})}var ri="/home/runner/work/frontend-shared/frontend-shared/src/components/Panel.js";const oi=Oo("cancel",Uo);function ii({children:e,icon:t,onClose:n,title:r}){
|
|
108
|
+
const o=!!n;return Mo("div",{className:io("Hyp-Panel",{"Hyp-Panel--closeable":o}),children:[Mo("header",{className:"Hyp-Panel__header",children:[t&&Mo("div",{className:"Hyp-Panel__header-icon",children:Mo(zo,{name:t,title:r},void 0,!1,{fileName:ri,lineNumber:37,columnNumber:13})},void 0,!1,{fileName:ri,lineNumber:36,columnNumber:11}),Mo("h2",{className:"Hyp-Panel__title",children:r},void 0,!1,{fileName:ri,lineNumber:40,columnNumber:9}),o&&Mo("div",{className:"Hyp-Panel__close",children:Mo(Ro,{icon:oi,title:"Close",onClick:n},void 0,!1,{fileName:ri,lineNumber:43,columnNumber:13})},void 0,!1,{fileName:ri,lineNumber:42,columnNumber:11})]},void 0,!0,{fileName:ri,lineNumber:34,columnNumber:7}),Mo("div",{className:"Hyp-Panel__content",children:e},void 0,!1,{fileName:ri,lineNumber:47,columnNumber:7})]},void 0,!0,{fileName:ri,lineNumber:29,columnNumber:5})}
|
|
109
109
|
const ai=Oo("spinner",'<svg viewBox="0 0 64 64">\n <g stroke-width="6" stroke="currentColor" stroke-linecap="round">\n <line y1="16" y2="28" transform="translate(32,32) rotate(180)">\n <animate attributeName="stroke-opacity" dur="750ms" values="0;1;.8;.65;.45;.3;.15;0" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(225)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".15;0;1;.8;.65;.45;.3;.15" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(270)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".3;.15;0;1;.8;.65;.45;.3" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(315)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".45;.3;.15;0;1;.85;.65;.45" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(0)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".65;.45;.3;.15;0;1;.8;.65;" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(45)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".8;.65;.45;.3;.15;0;1;.8" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(90)">\n <animate attributeName="stroke-opacity" dur="750ms" values="1;.85;.6;.45;.3;.15;0;1;" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(135)">\n <animate attributeName="stroke-opacity" dur="750ms" values="0;1;.8;.65;.45;.3;.15;0" repeatCount="indefinite"></animate>\n </line>\n </g>\n</svg>')
|
|
110
110
|
;function si({classes:e="",size:t="medium"}){return Mo(Ko,{name:ai,containerClasses:io(`Hyp-Spinner--${t}`,e)},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Spinner.js",lineNumber:32,columnNumber:5})}var li="/home/runner/work/frontend-shared/frontend-shared/src/components/TextInput.js";function ci({classes:e="",inputRef:t,hasError:n=!1,type:r="text",...o}){return Mo("input",{className:io("Hyp-TextInput",{"has-error":n},e),...o,ref:t,type:r},void 0,!1,{fileName:li,lineNumber:39,columnNumber:5})}function ui({children:e,classes:t=""}){return Mo("div",{className:io("Hyp-TextInputWithButton",t),children:e},void 0,!1,{fileName:li,lineNumber:67,columnNumber:5})}
|
|
111
111
|
var hi='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 4l4 4-4 4"></path></g></svg>',di='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="24px" height="28px" viewBox="0 0 24 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <rect fill="#ffffff" stroke="none" width="17.14407" height="16.046612" x="3.8855932" y="3.9449153" />\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <path d="M0,2.00494659 C0,0.897645164 0.897026226,0 2.00494659,0 L21.9950534,0 C23.1023548,0 24,0.897026226 24,2.00494659 L24,21.9950534 C24,23.1023548 23.1029738,24 21.9950534,24 L2.00494659,24 C0.897645164,24 0,23.1029738 0,21.9950534 L0,2.00494659 Z M9,24 L12,28 L15,24 L9,24 Z M7.00811294,4 L4,4 L4,20 L7.00811294,20 L7.00811294,15.0028975 C7.00811294,12.004636 8.16824717,12.0097227 9,12 C10,12.0072451 11.0189302,12.0606714 11.0189302,14.003477 L11.0189302,20 L14.0270431,20 L14.0270431,13.1087862 C14.0270433,10 12,9.00309038 10,9.00309064 C8.01081726,9.00309091 8,9.00309086 7.00811294,11.0019317 L7.00811294,4 Z M19,19.9869002 C20.1045695,19.9869002 21,19.0944022 21,17.9934501 C21,16.892498 20.1045695,16 19,16 C17.8954305,16 17,16.892498 17,17.9934501 C17,19.0944022 17.8954305,19.9869002 19,19.9869002 Z" fill="currentColor"></path>\n </g>\n</svg>\n'
|
|
@@ -561,7 +561,7 @@ if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTi
|
|
|
561
561
|
pressed:!!r,role:"tab",tabIndex:0,title:s,children:Mo(m,{children:[e,t>0&&!n&&Mo("span",{className:"text-tiny",style:"position:relative;bottom:3px;left:2px",children:t})]})})}var dm=wi((function({annotationsService:e,isLoading:t,settings:n}){const r=ki(),o=r.selectedTab(),i=r.noteCount(),a=r.annotationCount(),s=r.orphanCount(),l=r.isWaitingToAnchorAnnotations(),c=e=>{r.clearSelection(),r.selectTab(e)},u="annotation"===o&&0===a&&!l,h="note"===o&&0===i;return Mo("div",{className:"hyp-u-vertical-spacing--4 SelectionTabs__container",children:[Mo("div",{className:"hyp-u-layout-row hyp-u-horizontal-spacing--6 SelectionTabs",role:"tablist",children:[Mo(hm,{count:a,isWaitingToAnchor:l,isSelected:"annotation"===o,label:"Annotations",onSelect:()=>c("annotation"),children:"Annotations"}),Mo(hm,{count:i,isWaitingToAnchor:l,isSelected:"note"===o,label:"Page notes",onSelect:()=>c("note"),children:"Page Notes"}),s>0&&Mo(hm,{count:s,isWaitingToAnchor:l,isSelected:"orphan"===o,label:"Orphans",onSelect:()=>c("orphan"),
|
|
562
562
|
children:"Orphans"})]}),"note"===o&&n.enableExperimentalNewNoteButton&&Mo("div",{className:"hyp-u-layout-row--justify-right",children:Mo(Do,{"data-testid":"new-note-button",icon:"add",onClick:()=>e.createPageNote(),variant:"primary",style:bi(["ctaBackgroundColor"],n),children:"New note"})}),!t&&h&&Mo(jo,{classes:"text-center",children:Mo("span",{"data-testid":"notes-unavailable-message",children:"There are no page notes in this group."})}),!t&&u&&Mo(jo,{classes:"text-center",children:Mo("span",{"data-testid":"annotations-unavailable-message",children:["There are no annotations in this group.",Mo("br",{}),"Create one by selecting some text and clicking the"," ",Mo(Ko,{classes:"m-0.5 inline -mt-0.5",name:"annotate",title:"Annotate"})," ","button."]})})]})}),["annotationsService","settings"]);var pm=wi((function({frameSync:e,onLogin:t,onSignUp:n,loadAnnotationsService:r,streamer:o}){
|
|
563
563
|
const i=ma(),a=ki(),s=a.focusedGroupId(),l=a.hasAppliedFilter()||a.hasSelectedAnnotations(),c=a.isLoading(),u=a.isLoggedIn(),h=a.directLinkedAnnotationId(),d=h?a.findAnnotationByID(h):void 0,p=d?ia(d):"annotation",m=a.searchUris(),f=a.hasSidebarOpened(),g=a.profile().userid,v=d&&!1===d.$orphan?d.$tag:null,y=!(c||!h)&&!d,b=a.directLinkedGroupFetchFailed(),_=y||b,w=!_,x=!_&&!l,k=h&&!u&&!y&&!c,S=bo(s);vo((()=>{if(!S.current||S.current!==s){if(S.current){let e=a.focusState().active;a.clearSelection(),e&&a.toggleFocusMode(!0)}S.current=s}s&&m.length&&r.load({groupId:s,uris:m})}),[a,r,s,g,m]),vo((()=>{v?(e.focusAnnotations([v]),e.scrollToAnnotation(v),a.selectTab(p)):d&&a.selectTab(p)}),[p,e,d,v,a]);const C=a.hasFetchedProfile();return vo((()=>{C&&(f||u)&&o.connect({applyUpdatesImmediately:!1})}),[C,u,f,o]),Mo("div",{children:[Mo("h2",{className:"sr-only",children:"Annotations"}),w&&Mo(em,{}),Mo(um,{onLogin:t,onSignUp:n}),y&&Mo(Yp,{errorType:"annotation",onLoginRequest:t,showClearSelection:!0}),b&&Mo(Yp,{
|
|
564
|
-
errorType:"group",onLoginRequest:t}),x&&Mo(dm,{isLoading:c}),Mo(Wp,{threads:i.children}),k&&Mo(tm,{onLogin:t})]})}),["frameSync","loadAnnotationsService","streamer"]);var mm=wi((function({api:e,toastMessenger:t}){const n=ki(),r=n.routeParams().q,o=wo((async t=>{const r={_separate_replies:!0,offset:0,limit:20,...Ri(t)};try{n.annotationFetchStarted();const t=await e.search(r);n.addAnnotations([...t.rows,...t.replies])}finally{n.annotationFetchFinished()}}),[e,n]);return vo((()=>{n.setSortKey("Newest"),n.clearAnnotations(),o(r).catch((e=>{t.error(`Unable to fetch annotations: ${e.message}`)}))}),[r,o,n,t]),Mo(Wp,{threads:ma().children})}),["api","toastMessenger"]);class fm{constructor(e,t,n=window){var r,o,i;const a="N/A";let s=a;e.userid&&(s=e.userid,e.displayName&&(s=`${e.displayName} (${s})`)),this.version="1.
|
|
564
|
+
errorType:"group",onLoginRequest:t}),x&&Mo(dm,{isLoading:c}),Mo(Wp,{threads:i.children}),k&&Mo(tm,{onLogin:t})]})}),["frameSync","loadAnnotationsService","streamer"]);var mm=wi((function({api:e,toastMessenger:t}){const n=ki(),r=n.routeParams().q,o=wo((async t=>{const r={_separate_replies:!0,offset:0,limit:20,...Ri(t)};try{n.annotationFetchStarted();const t=await e.search(r);n.addAnnotations([...t.rows,...t.replies])}finally{n.annotationFetchFinished()}}),[e,n]);return vo((()=>{n.setSortKey("Newest"),n.clearAnnotations(),o(r).catch((e=>{t.error(`Unable to fetch annotations: ${e.message}`)}))}),[r,o,n,t]),Mo(Wp,{threads:ma().children})}),["api","toastMessenger"]);class fm{constructor(e,t,n=window){var r,o,i;const a="N/A";let s=a;e.userid&&(s=e.userid,e.displayName&&(s=`${e.displayName} (${s})`)),this.version="1.1035.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||a,
|
|
565
565
|
this.fingerprint=null!==(r=null===(o=t[0])||void 0===o||null===(i=o.metadata)||void 0===i?void 0:i.documentFingerprint)&&void 0!==r?r:a,this.account=s,this.timestamp=(new Date).toString()}asFormattedString(){return`Version: ${this.version}\nUser Agent: ${this.userAgent}\nURL: ${this.urls}\nFingerprint: ${this.fingerprint}\nAccount: ${this.account}\nDate: ${this.timestamp}\n`}asEncodedURLString(){return encodeURIComponent(this.asFormattedString())}}function gm(e){const t=R(e);return!(null==t||!t.authority)&&t.authority!==e.authDomain}function vm({commandName:e,iconName:t}){return Mo("span",{className:"whitespace-nowrap",children:[Mo(Ko,{name:t,classes:io("mx-1 -mt-1","text-color-text-light inline")}),Mo("em",{children:e})]})}var ym=wi((function({settings:e}){const t=!gm(e);return Mo("ol",{className:"list-decimal pl-10 space-y-2",children:[Mo("li",{children:["To create an annotation, select text and then select the"," ",Mo(vm,{iconName:"annotate",commandName:"Annotate"})," ","button."]}),Mo("li",{
|
|
566
566
|
children:["To create a highlight (",Mo(Xo,{classes:"underline hover:underline",href:"https://web.hypothes.is/help/why-are-highlights-private-by-default/",target:"_blank",children:"visible only to you"}),"), select text and then select the"," ",Mo(vm,{iconName:"highlight",commandName:"Highlight"})," ","button."]}),t&&Mo("li",{children:["To annotate in a private group, select the group from the groups dropdown. Don't see your group? Ask the group creator to send a"," ",Mo(Xo,{classes:"underline hover:underline",href:"https://web.hypothes.is/help/how-to-join-a-private-group/",target:"_blank",children:"join link"}),")."]}),Mo("li",{children:["To reply to an annotation, select the"," ",Mo(vm,{iconName:"reply",commandName:"Reply"})," button."]})]})}),["settings"]);var bm=wi((function({toastMessenger:e,versionData:t}){return Mo("div",{className:"hyp-u-vertical-spacing",children:[Mo("dl",{className:"VersionInfo",children:[Mo("dt",{className:"VersionInfo__key",children:"Version"}),Mo("dd",{
|
|
567
567
|
className:"VersionInfo__value",children:t.version}),Mo("dt",{className:"VersionInfo__key",children:"User Agent"}),Mo("dd",{className:"VersionInfo__value",children:t.userAgent}),Mo("dt",{className:"VersionInfo__key",children:"URL"}),Mo("dd",{className:"VersionInfo__value",children:t.urls}),Mo("dt",{className:"VersionInfo__key",children:"Fingerprint"}),Mo("dd",{className:"VersionInfo__value",children:t.fingerprint}),Mo("dt",{className:"VersionInfo__key",children:"Account"}),Mo("dd",{className:"VersionInfo__value",children:t.account}),Mo("dt",{className:"VersionInfo__key",children:"Date"}),Mo("dd",{className:"VersionInfo__value",children:t.timestamp})]}),Mo("div",{className:"hyp-u-layout-row--justify-center",children:Mo(Do,{onClick:()=>{try{Ba(t.asFormattedString()),e.success("Copied version info to clipboard")}catch(t){e.error("Unable to copy version info")}},icon:"copy",children:"Copy version details"})})]})}),["toastMessenger"]);function _m({children:e,onClick:t}){return Mo(Bo,{
|
|
@@ -590,7 +590,7 @@ R(n)?t.notifyHost("signupRequested"):window.open(i.getLink("signup"))};return Mo
|
|
|
590
590
|
document:{title:""}},e);return Yi(l)&&(l.permissions=Ia(i)),l}create(e,t=new Date){const n=this._initialize(e,t);this._store.addAnnotations([n]),this._store.deleteNewAndEmptyDrafts(),Yi(n)||this._store.createDraft(n,{tags:n.tags,text:n.text,isPrivate:!$i(n)}),Xi(n)?this._store.selectTab("note"):Zi(n)&&this._store.selectTab("annotation"),(n.references||[]).forEach((e=>{this._store.setExpanded(e,!0)}))}createPageNote(){const e=this._store.mainFrame();if(!this._store.isLoggedIn())return void this._store.openSidebarPanel("loginPrompt");if(!e)return;const t={target:[],uri:e.uri};this.create(t)}async delete(e){await this._api.annotation.delete({id:e.id}),this._activity.reportActivity("delete",e),this._store.removeAnnotations([e])}async flag(e){await this._api.annotation.flag({id:e.id}),this._activity.reportActivity("flag",e),this._store.updateFlagStatus(e.id,!0)}reply(e,t){const n={group:e.group,permissions:$i(e)?Pa(t,e.group):Ia(t),references:(e.references||[]).concat(e.id),target:[{source:e.target[0].source}],
|
|
591
591
|
uri:e.uri};this.create(n)}async save(e){let t,n;const r=this._applyDraftChanges(e);let o;qi(e)?(t=this._api.annotation.update({id:e.id},r),n="update"):(t=this._api.annotation.create({},r),n="create"),this._store.annotationSaveStarted(e);try{o=await t,this._activity.reportActivity(n,o)}finally{this._store.annotationSaveFinished(e)}return Object.keys(e).forEach((t=>{"$"===t[0]&&(o[t]=e[t])})),this._store.removeDraft(e),this._store.addAnnotations([o]),o}}Qm.$inject=["annotationActivity","api","store"];class ef{constructor(e){this._rpc=e.rpc,this._reportConfig=e.reportActivity}reportActivity(e,t){if(!this._rpc||!this._reportConfig)return;let n;switch(e){case"create":n=new Date(t.created).toISOString();break;case"update":n=new Date(t.updated).toISOString();break;default:n=(new Date).toISOString()}const r={date:n,annotation:{id:t.id}};this._reportConfig.events.includes(e)&&q(this._rpc.targetFrame,this._rpc.origin,this._reportConfig.method,[e,r],3e3)}}ef.$inject=["settings"];class tf extends Error{
|
|
592
592
|
constructor(e,t,n=""){let r="Network request failed";t&&(r+=` (${t.status})`),n&&(r+=`: ${n}`),super(r),this.url=e,this.response=t,this.reason=n}}async function nf(e,t){let n,r;try{n=await fetch(e,t)}catch(t){throw new tf(e,null,t.message)}if(204===n.status)return null;try{r=await n.json()}catch(t){throw new tf(e,n,"Failed to parse response")}var o;if(!n.ok)throw new tf(e,n,null===(o=r)||void 0===o?void 0:o.reason);return r}function rf(e,t){const n={};for(const r in t)if(t.hasOwnProperty(r)){const o=t[r],i=":"+r;-1!==e.indexOf(i)?e=e.replace(i,encodeURIComponent(String(o))):n[r]=o}return{url:e,unusedParams:n}}function of(e){const t={};for(let[n,r]of Object.entries(e))n.startsWith("$")||(t[n]=r);return t}class af{constructor(e,t,n){const r=e.routes();this._clientId=null;const o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s)=>{o();try{const[o,l]=await Promise.all([e,n()]),c=function(e,t){let n=e;for(let e of t.split("."))if(n=n[e],
|
|
593
|
-
!n)break;return function(e){return!!e&&"url"in e}(n)?n:null}(o,t);if(!c)throw new Error(`Missing API route: ${t}`);const u={"Content-Type":"application/json","Hypothesis-Client-Version":"1.
|
|
593
|
+
!n)break;return function(e){return!!e&&"url"in e}(n)?n:null}(o,t);if(!c)throw new Error(`Missing API route: ${t}`);const u={"Content-Type":"application/json","Hypothesis-Client-Version":"1.1035.0"};l&&(u.Authorization="Bearer "+l);const h=r();h&&(u["X-Client-Id"]=h);const{url:d,unusedParams:p}=rf(c.url,a),m=new URL(d);for(let[e,t]of Object.entries(p)){Array.isArray(t)||(t=[t]);for(let n of t)null!=n&&m.searchParams.append(e,n.toString())}return await nf(m.toString(),{body:s?JSON.stringify(of(s)):null,headers:u,method:c.method})}finally{i()}}}(r,e,{getAccessToken:t.getAccessToken,getClientId:o,onRequestStarted:n.apiRequestStarted,onRequestFinished:n.apiRequestFinished});this.search=i("search"),this.annotation={create:i("annotation.create"),delete:i("annotation.delete"),get:i("annotation.read"),update:i("annotation.update"),flag:i("annotation.flag"),hide:i("annotation.hide"),unhide:i("annotation.unhide")},this.group={member:{delete:i("group.member.delete")},read:i("group.read")},this.groups={
|
|
594
594
|
list:i("groups.read")},this.profile={groups:{read:i("profile.groups.read")},read:i("profile.read"),update:i("profile.update")}}setClientId(e){this._clientId=e}}af.$inject=["apiRoutes","auth","store"];var sf={};function lf(e,t){"boolean"==typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var cf=lf;lf.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},lf.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},lf.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=(new Date).getTime()
|
|
595
595
|
;if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(void 0===n){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1)}var r=this;return this._timer=setTimeout((function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout((function(){r._operationTimeoutCb(r._attempts)}),r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)}),n),this._options.unref&&this._timer.unref(),!0},lf.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout((function(){n._operationTimeoutCb()}),n._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},lf.prototype.try=function(e){
|
|
596
596
|
console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},lf.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},lf.prototype.start=lf.prototype.try,lf.prototype.errors=function(){return this._errors},lf.prototype.attempts=function(){return this._attempts},lf.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var o=this._errors[r],i=o.message,a=(e[i]||0)+1;e[i]=a,a>=n&&(t=o,n=a)}return t},function(e){var t=cf;e.operation=function(n){var r=e.timeouts(n);return new t(r,{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],o=0;o<t.retries;o++)r.push(this.createTimeout(o,t))
|
|
@@ -653,8 +653,8 @@ selected:zv(e),sortKey:Pv(e),selectedTab:Ov(e)})));function Pv(e){return e.sortK
|
|
|
653
653
|
OPEN_SIDEBAR_PANEL:(e,t)=>({activePanelName:t.panelName}),CLOSE_SIDEBAR_PANEL(e,t){let n=e.activePanelName;return t.panelName===n&&(n=null),{activePanelName:n}},TOGGLE_SIDEBAR_PANEL:function(e,t){let n;const r=e.activePanelName===t.panelName,o=void 0!==t.panelState?t.panelState:!r;return n=o?t.panelName:r&&!o?null:e.activePanelName,{activePanelName:n}}};const Fv=hg({activePanelName:null},{namespace:"sidebarPanels",reducers:Bv,actionCreators:{openSidebarPanel:function(e){return ug(0,"OPEN_SIDEBAR_PANEL",{panelName:e})},closeSidebarPanel:function(e){return ug(0,"CLOSE_SIDEBAR_PANEL",{panelName:e})},toggleSidebarPanel:function(e,t){return ug(0,"TOGGLE_SIDEBAR_PANEL",{panelName:e,panelState:t})}},selectors:{isSidebarPanelOpen:function(e,t){return e.activePanelName===t}}}),jv={ADD_MESSAGE:(e,t)=>({messages:e.messages.concat({...t.message})}),REMOVE_MESSAGE:(e,t)=>({messages:e.messages.filter((e=>e.id!==t.id))}),UPDATE_MESSAGE:(e,t)=>({messages:e.messages.map((e=>e.id&&e.id===t.message.id?{...t.message}:e))})}
|
|
654
654
|
;const Hv=hg({messages:[]},{namespace:"toastMessages",reducers:jv,actionCreators:{addToastMessage:function(e){return ug(0,"ADD_MESSAGE",{message:e})},removeToastMessage:function(e){return ug(0,"REMOVE_MESSAGE",{id:e})},updateToastMessage:function(e){return ug(0,"UPDATE_MESSAGE",{message:e})}},selectors:{getToastMessage:function(e,t){return e.messages.find((e=>e.id===t))},getToastMessages:function(e){return e.messages},hasToastMessage:function(e,t,n){return e.messages.some((e=>e.type===t&&e.message===n))}}}),qv={SET_SIDEBAR_OPENED:(e,t)=>!0===t.opened?{sidebarHasOpened:!0}:{}};const Uv=hg({sidebarHasOpened:!1},{namespace:"viewer",reducers:qv,actionCreators:{setSidebarOpened:function(e){return ug(0,"SET_SIDEBAR_OPENED",{opened:e})}},selectors:{hasSidebarOpened:function(e){return e.sidebarHasOpened}}});function $v(e){return cg([mg,Fg,Hg,Ug,Xg,rv,sv,_v,yv,kv,Sg,Dv,uv,Fv,Hv,Uv],[e],[dg])}$v.$inject=["settings"];class Gv{constructor(){this._providers=new Map,this._instances=new Map,this._constructing=new Set}
|
|
655
655
|
get(e){if(this._instances.has(e))return this._instances.get(e);const t=this._providers.get(e);if(!t)throw new Error(`"${e}" is not registered`);if("value"in t)return this._instances.set(e,t.value),t.value;if(this._constructing.has(e))throw new Error(`Encountered a circular dependency when constructing "${e}"`);this._constructing.add(e);try{const n=[],r="class"in t&&t.class.$inject||"factory"in t&&t.factory.$inject||[];for(const t of r)try{n.push(this.get(t))}catch(n){const r=new Error(`Failed to construct dependency "${t}" of "${e}": ${n.message}`);throw r.cause=n,r}let o;if(t.class)o=new t.class(...n);else{o=(0,t.factory)(...n)}return this._instances.set(e,o),o}finally{this._constructing.delete(e)}}register(e,t){if("function"==typeof t)t={class:t};else if(!function(e){return"object"==typeof e&&null!==e&&("value"in e||"function"==typeof e.class||"function"==typeof e.factory)}(t))throw new Error(`Invalid provider for "${e}"`);return this._providers.set(e,t),this}run(e){const t="Injector.run";this.register(t,{
|
|
656
|
-
factory:e});try{return this.get(t)}finally{this._instances.delete(t),this._providers.delete(t)}}}const Vv=function(t){for(var n={},r=t.querySelectorAll("script.js-hypothesis-config"),o=0;o<r.length;o++){var i=void 0;try{i=JSON.parse(r[o].textContent||"")}catch(e){console.warn("Could not parse settings from js-hypothesis-config tags",e),i={}}e(n,i)}return n}(document),Wv=function(e){const{version:t,origin:n}=P(e.location.href);return"1.
|
|
657
|
-
"sidebar"===t.route()&&e.connect()}Vv.sentry&&Wv&&function(e){const t=function(){let e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;Br({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.
|
|
656
|
+
factory:e});try{return this.get(t)}finally{this._instances.delete(t),this._providers.delete(t)}}}const Vv=function(t){for(var n={},r=t.querySelectorAll("script.js-hypothesis-config"),o=0;o<r.length;o++){var i=void 0;try{i=JSON.parse(r[o].textContent||"")}catch(e){console.warn("Could not parse settings from js-hypothesis-config tags",e),i={}}e(n,i)}return n}(document),Wv=function(e){const{version:t,origin:n}=P(e.location.href);return"1.1035.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1035.0) than the host page (${t}). It may not work.`),!1):"null"===e.origin?(console.warn("Hypothesis has been loaded in a sandboxed frame. This is not supported."),!1):e.origin===n||(console.warn(`The Hypothesis sidebar is running in a different origin (${e.origin}) than expected (${n}). It may not work.`),!1)}(window);function Yv(e,t){e.setClientId(t.clientId)}function Kv(e,t,n){e.load(),t.load(),n.sync()}function Xv(e,t,n,r){e.init(),t.init(),n.init(),r.init()}function Zv(e,t){
|
|
657
|
+
"sidebar"===t.route()&&e.connect()}Vv.sentry&&Wv&&function(e){const t=function(){let e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;Br({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1035.0",beforeSend:(e,t)=>{if(Hr>=5)return G("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++Hr;try{const n=t&&t.originalException;n instanceof Event&&Object.assign(e.extra,{type:n.type,detail:n.detail,isTrusted:n.isTrusted})}catch(e){}return e}});try{Jt("host_config",P(window.location.href))}catch(e){}Jt("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),jr(((e,t)=>{Zt(e,{tags:{context:t}})}))}(Vv.sentry),function(e){e.addEventListener("click",(e=>{const t=e.target;if("A"===t.tagName){const e=t;"_blank"===e.target&&(e.rel="noopener")}}))}(document.body),function(e=n){let t=!1;try{
|
|
658
658
|
document.createElement("div").dir="auto"}catch(e){t=!0}if(t){const t=e.vnode;e.vnode=e=>{if("string"==typeof e.type){const t=e.props;"dir"in t&&"auto"===t.dir&&(t.dir="")}t&&t(e)}}}(),Yv.$inject=["api","streamer"],Kv.$inject=["groups","session","router"],Xv.$inject=["autosaveService","features","persistedDefaults","serviceURL"],Zv.$inject=["frameSync","store"],function(e,{reset:t=!1}={}){t&&Lo.clear();for(let[t,n]of Object.entries(e))Lo.set(t,n)}(pi);const Jv=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",Z)}(),async function(e,t=window){const n=function(e){const t=P(e.location.href),n=["annotations","group","query","appType","openSidebar","showHighlights","services","branding","enableExperimentalNewNoteButton","focus","requestConfigFromFrame","theme","usernameUrl"],r={openSidebar:D,requestConfigFromFrame:e=>{if("string"==typeof e)return e;const t=function(e){return"object"==typeof e&&null!==e?e:{}}(e);return{origin:F(t.origin),ancestorLevel:B(t.ancestorLevel)}}
|
|
659
659
|
},o={};for(let[e,i]of Object.entries(t))n.includes(e)&&null!==i&&(r[e]?o[e]=r[e](i):o[e]=i);return o}(window),r=function(e,t){const n=e.requestConfigFromFrame;if(!n)return null;if("number"!=typeof n.ancestorLevel||"string"!=typeof n.origin)throw new Error("Improper `requestConfigFromFrame` object. Both `ancestorLevel` and `origin` need to be specified");return{targetFrame:U(n.ancestorLevel,t),origin:n.origin}}(n,t);let o;if(r){const e=await async function(e,t){return{...await q(t.targetFrame,t.origin,"requestConfig",[],3e3),...e.group?{group:e.group}:{}}}(n,r);o=function(e,t){const n=e.services;return Array.isArray(n)?(n.forEach(((e,n)=>{"$rpc:requestGroups"===e.groups&&(e.groups=q(t.targetFrame,t.origin,"requestGroups",[n],0).catch((()=>{throw new Error("Unable to fetch groups")})))})),e):e}(e,r)}else o=n;const i={...e,...o};return r&&(i.rpc=r),i.apiUrl=function(e){const t=R(e);if(t){if(t.apiUrl)return t.apiUrl;throw new Error("Service should contain an apiUrl value.")}return e.apiUrl}(i),i}(Vv).then((e=>{
|
|
660
660
|
!function(e,t){const n=new Gv;n.register("annotationsService",Qm).register("annotationActivity",ef).register("api",af).register("apiRoutes",pf).register("auth",gf).register("autosaveService",vf).register("features",_f).register("frameSync",Tf).register("groups",Mf).register("loadAnnotationsService",Lf).register("localStorage",Of).register("persistedDefaults",Pf).register("router",Rf).register("serviceURL",Df).register("session",Bf).register("streamer",Hf).register("streamFilter",Ff).register("tags",qf).register("threadsService",Uf).register("toastMessenger",$f).register("store",{factory:$v}),n.register("$window",{value:window}).register("settings",{value:e}),n.run(Xv),n.run(Yv),n.run(Kv),n.run(X),n.run(Zv),I(Mo(_i.Provider,{value:n,children:Mo(Zm,{})}),t)}(e,Jv)})).catch((e=>function(e,t){console.error("Failed to start Hypothesis client: ",e),I(Mo(Jm,{error:e}),t)}(e,Jv)));
|