hypothesis 1.1355.0 → 1.1356.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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?
|
|
1
|
+
!function(){"use strict";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?daf992","styles/annotator.css":"styles/annotator.css?0f15d2","styles/annotator.css.map":"styles/annotator.css.map?85af3b","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css":"styles/katex.min.css?0b5991","styles/katex.min.css.map":"styles/katex.min.css.map?42d80c","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?c95edf","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?1d8ac6","styles/sidebar.css":"styles/sidebar.css?e2cf56","styles/sidebar.css.map":"styles/sidebar.css.map?1ea137","styles/ui-playground.css":"styles/ui-playground.css?daa1e5","styles/ui-playground.css.map":"styles/ui-playground.css.map?776ff6","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?700ca1","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?340ab2","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?1349a2","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?b798f3","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?e7db31"};function t(s){s.setAttribute("data-hypothesis-asset","")}function e(s,e){var n=s.createElement("link");n.rel="stylesheet",n.type="text/css",n.href=e,t(n),s.head.appendChild(n)}function n(s,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.esModule,o=void 0===r||r,i=n.forceReload,a=void 0!==i&&i,l=s.createElement("script");o&&(l.type="module"),a&&(e+="#ts=".concat(Date.now())),l.src=e,l.async=!1,t(l),s.head.appendChild(l)}function r(s,e,n,r){var o=s.createElement("link");o.rel=e,o.href=r,o.type="application/annotator+".concat(n),t(o),s.head.appendChild(o)}function o(s,e,n){var r=s.createElement("link");r.rel="preload",r.as=e,r.href=n,"fetch"===e&&(r.crossOrigin="anonymous"),t(r),s.head.appendChild(r)}function i(s,t){return s.assetRoot+"build/"+s.manifest[t]}function a(s){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var e=function(){var s,t,e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).currentScript;return e?(s=e.src,(t=s.match(/(https?):\/\/([^:/]+)/))?{protocol:t[1],hostname:t[2]}:null):null}(t);if(!e)throw new Error("Could not process URL template because script origin is unknown");return s=(s=s.replace("{current_host}",e.hostname)).replace("{current_scheme}",e.protocol)}if(function(){var s=[function(){return Object.fromEntries([])},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 s.every((function(s){return s()}))}catch(s){return!1}}()){var l=function(s){for(var t={},e=s.querySelectorAll("script.js-hypothesis-config"),n=0;n<e.length;n++){var r=void 0;try{r=JSON.parse(e[n].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),r={}}Object.assign(t,r)}return t}(document),p=a(l.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1356.0/");if(document.querySelector("hypothesis-app")){!function(s,t){o(s,"fetch",t.apiUrl),o(s,"fetch",t.apiUrl+"links");for(var r=0,a=["scripts/sidebar.bundle.js"];r<a.length;r++)n(s,i(t,a[r]),{esModule:!0});for(var l=0,p=["styles/katex.min.css","styles/sidebar.css"];l<p.length;l++)e(s,i(t,p[l]))}(document,{assetRoot:p,manifest:s,apiUrl:l.apiUrl})}else{var c=function(){var s;return null===(s=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).chrome)||void 0===s||null===(s=s.runtime)||void 0===s?void 0:s.id}();if(c&&!function(s){return!!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("script.js-hypothesis-config[data-extension-id=".concat(s,"]"))}(c))throw new Error("Could not start Hypothesis extension as configuration is missing");var u=l,d=a(u.notebookAppUrl||"https://hypothes.is/notebook"),h=a(u.profileAppUrl||"https://hypothes.is/user-profile"),y=a(u.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,t){if(!s.querySelector('link[type="application/annotator+html"]')){r(s,"sidebar","html",t.sidebarAppUrl),r(s,"notebook","html",t.notebookAppUrl),r(s,"profile","html",t.profileAppUrl),o(s,"style",i(t,"styles/annotator.css")),r(s,"hypothesis-client","javascript",t.assetRoot+"build/boot.js");for(var a=0,l=["scripts/annotator.bundle.js"];a<l.length;a++)n(s,i(t,l[a]),{esModule:!1});var p=[];void 0!==window.PDFViewerApplication&&p.push("styles/pdfjs-overrides.css"),p.push("styles/highlights.css");for(var c=0,u=p;c<u.length;c++)e(s,i(t,u[c]))}}(document,{assetRoot:p,manifest:s,notebookAppUrl:d,profileAppUrl:h,sidebarAppUrl:y})}}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,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"scripts/annotator.bundle.js": "scripts/annotator.bundle.js?
|
|
2
|
+
"scripts/annotator.bundle.js": "scripts/annotator.bundle.js?daf992",
|
|
3
3
|
"styles/annotator.css": "styles/annotator.css?0f15d2",
|
|
4
4
|
"styles/annotator.css.map": "styles/annotator.css.map?85af3b",
|
|
5
5
|
"styles/highlights.css": "styles/highlights.css?6b4ebd",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"styles/sidebar.css.map": "styles/sidebar.css.map?1ea137",
|
|
13
13
|
"styles/ui-playground.css": "styles/ui-playground.css?daa1e5",
|
|
14
14
|
"styles/ui-playground.css.map": "styles/ui-playground.css.map?776ff6",
|
|
15
|
+
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?700ca1",
|
|
15
16
|
"scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?340ab2",
|
|
16
|
-
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?4f9331",
|
|
17
17
|
"scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?1349a2",
|
|
18
18
|
"scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?b798f3",
|
|
19
|
-
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?
|
|
19
|
+
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?e7db31"
|
|
20
20
|
}
|
|
@@ -127,7 +127,7 @@ this._sidebarRPC.on("hoverAnnotations",(t=>this._hoverAnnotations(t))),this._sid
|
|
|
127
127
|
this._bucketBarClient.destroy(),null===(t=this._clusterToolbar)||void 0===t||t.destroy(),function(t){En(Array.from(t.querySelectorAll("hypothesis-highlight")))}(this.element),this._integration.destroy()}async anchor(t){this._contentReady&&(await this._contentReady,this._contentReady=void 0);const e=t=>{var e;const n=Ho(t);if(!n)return;const i=Cn(n,null===(e=t.annotation)||void 0===e?void 0:e.$cluster);i.forEach((e=>{e._annotation=t.annotation})),t.highlights=i,this._hoveredAnnotations.has(t.annotation.$tag)&&Nn(i,!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 i=await this._integration.anchor(this.element,e.selector),o=dn.fromRange(i);n={annotation:t,target:e,range:o}}catch(i){n={annotation:t,target:e}}return n})));if(!this._annotations.has(t.$tag))return[];for(const t of n)e(t)
|
|
128
128
|
;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(const e of this.anchors)e.annotation.$tag!==t?n.push(e):e.highlights&&En(e.highlights);this._updateAnchors(n,e)}_updateAnchors(t,e){var n;this.anchors=t,null===(n=this._clusterToolbar)||void 0===n||n.scheduleClusterUpdates(),e&&this._bucketBarClient.update(this.anchors)}async createAnnotation({highlight:t=!1}={}){const e=this.selectedRanges;this.selectedRanges=[];const n=await this.getDocumentInfo(),i=this.element,o=(await Promise.all(e.map((t=>this._integration.describe(i,t))))).map((t=>({source:n.uri,selector:t}))),s={uri:n.uri,document:n.metadata,target:o,$highlight:t,$cluster:t?"user-highlights":"user-annotations",$tag:"a:"+r(8)};return this._sidebarRPC.call("createAnnotation",s),this.anchor(s),Vo(),s}_hoverAnnotations(t){this._hoveredAnnotations.clear(),
|
|
129
129
|
t.forEach((t=>this._hoveredAnnotations.add(t)));for(const e of this.anchors)if(e.highlights){const n=t.includes(e.annotation.$tag);Nn(e.highlights,n)}this._sidebarRPC.call("hoverAnnotations",t)}_onSelection(t){const e=this._integration.getAnnotatableRange(t);if(!e)return void this._onClearSelection();const n=document.getSelection(),i=_n(n),o=yn(n);o?(this.selectedRanges=[e],this._hostRPC.call("textSelected"),this._adder.annotationsForSelection=Fo(),this._isAdderVisible=!0,this._adder.show(o,i)):this._onClearSelection()}_onClearSelection(){this._isAdderVisible=!1,this._adder.hide(),this.selectedRanges=[],this._informHostOnNextSelectionClear&&this._hostRPC.call("textUnselected"),this._informHostOnNextSelectionClear=!0}selectAnnotations(t,{toggle:e=!1,focusInSidebar:n=!1}={}){e?this._sidebarRPC.call("toggleAnnotationSelection",t):this._sidebarRPC.call("showAnnotations",t,n),this._sidebarRPC.call("openSidebar")}setHighlightsVisible(t,e=!0){!function(t,e){t.classList.toggle("hypothesis-highlights-always-on",e)
|
|
130
|
-
}(this.element,t),this._highlightsVisible=t,e&&this._hostRPC.call("highlightsVisibleChanged",t)}get highlightsVisible(){return this._highlightsVisible}fitSideBySide(t){this._sidebarLayout=t,this._integration.fitSideBySide(t)}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(t){ne(t,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}}function Wo(t,e){const n=new URL(t),i=new URLSearchParams;return i.append("config",JSON.stringify(e)),n.hash=i.toString(),n.toString()}function $o(t,e){var n;const i={};for(const[t,n]of Object.entries(e))"notebookAppUrl"!==t&&"sidebarAppUrl"!==t&&null!=n&&(i[t]=n);i.origin=new URL(t).origin,i.version="1.
|
|
130
|
+
}(this.element,t),this._highlightsVisible=t,e&&this._hostRPC.call("highlightsVisibleChanged",t)}get highlightsVisible(){return this._highlightsVisible}fitSideBySide(t){this._sidebarLayout=t,this._integration.fitSideBySide(t)}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(t){ne(t,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}}function Wo(t,e){const n=new URL(t),i=new URLSearchParams;return i.append("config",JSON.stringify(e)),n.hash=i.toString(),n.toString()}function $o(t,e){var n;const i={};for(const[t,n]of Object.entries(e))"notebookAppUrl"!==t&&"sidebarAppUrl"!==t&&null!=n&&(i[t]=n);i.origin=new URL(t).origin,i.version="1.1356.0";const o=new URL(window.location.href);if(o.hash="",i.hostURL=o.toString(),Array.isArray(i.services)&&(null===(n=i.services)||void 0===n?void 0:n.length)>0){const t=i.services[0];t.onLoginRequest&&(t.onLoginRequestProvided=!0),t.onLogoutRequest&&(t.onLogoutRequestProvided=!0),t.onSignupRequest&&(t.onSignupRequestProvided=!0),
|
|
131
131
|
t.onProfileRequest&&(t.onProfileRequestProvided=!0),t.onHelpRequest&&(t.onHelpRequestProvided=!0)}return i}function zo({config:t,groupId:e}){return ce("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allowFullScreen:!0,src:Wo(t.notebookAppUrl,{...$o(t.notebookAppUrl,t),group:e})})}function jo({eventBus:t,config:e}){const[n,i]=Wt(0),[o,r]=Wt(!0),[s,a]=Wt(null),l=zt(""),c=zt(null);$t((()=>(l.current=document.body.style.overflow,()=>{document.body.style.overflow=l.current})),[]),$t((()=>{document.body.style.overflow=o?l.current:"hidden"}),[o]),$t((()=>{const e=t.createEmitter();return e.subscribe("openNotebook",(t=>{r(!1),i((t=>t+1)),a(t)})),c.current=e,()=>{e.destroy()}}),[t]);return null===s?null:ce("div",{className:ae("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:o}),"data-testid":"notebook-outer",children:ce("div",{className:"relative w-full h-full","data-testid":"notebook-inner",children:[ce("div",{className:"absolute right-0 m-3",children:ce(Ue,{
|
|
132
132
|
title:"Close the Notebook",onClick:()=>{var t;r(!0),null===(t=c.current)||void 0===t||t.publish("closeNotebook")},variant:"dark",classes:ae("!bg-transparent enabled:hover:!bg-grey-3"),children:ce(me,{className:"w-4 h-4"})})}),ce(zo,{config:e,groupId:s},n)]})})}class Xo{constructor(t,e,i){n(this,"_outerContainer",void 0),n(this,"_shadowRoot",void 0),this._outerContainer=document.createElement("hypothesis-notebook"),t.appendChild(this._outerContainer),this._shadowRoot=Je(this._outerContainer),Rt(ce(jo,{eventBus:e,config:i}),this._shadowRoot)}destroy(){Rt(null,this._shadowRoot),this._outerContainer.remove()}}function Yo({eventBus:t,config:e}){const[n,i]=Wt(!0),o=zt(null);$t((()=>{const e=t.createEmitter();return e.subscribe("openProfile",(()=>{i(!1)})),o.current=e,()=>{e.destroy()}}),[t]);return n?null:ce("div",{className:"fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50","data-testid":"profile-outer",children:ce("div",{className:"relative w-full h-full","data-testid":"profile-inner",
|
|
133
133
|
children:[ce("div",{className:"absolute right-0 m-3",children:ce(Ue,{title:"Close the Profile",onClick:()=>{var t;i(!0),null===(t=o.current)||void 0===t||t.publish("closeProfile")},variant:"dark",classes:ae("!bg-transparent enabled:hover:!bg-grey-3"),children:ce(me,{className:"w-4 h-4"})})}),ce("iframe",{title:"Hypothesis profile",className:"h-full w-full border-0",src:e.profileAppUrl})]})})}class Go{constructor(t,e,i){n(this,"_outerContainer",void 0),n(this,"shadowRoot",void 0),this._outerContainer=document.createElement("hypothesis-profile"),t.appendChild(this._outerContainer),this.shadowRoot=Je(this._outerContainer),Rt(ce(Yo,{eventBus:e,config:i}),this.shadowRoot)}destroy(){Rt(null,this.shadowRoot),this._outerContainer.remove()}}var Zo={exports:{}};!function(t){!function(e,n,i,o){var r,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),l="function",c=Math.round,h=Math.abs,u=Date.now;function d(t,e,n){return setTimeout(b(t,n),e)}function f(t,e,n){return!!Array.isArray(t)&&(p(t,n[e],n),!0)}
|
|
@@ -118,11 +118,11 @@ return e.directLinkedGroupId}}});class Ko{constructor(e,t){H(this,"annotation",v
|
|
|
118
118
|
reducers:Xo,actionCreators:{createDraft:function(e,t){return qr(0,"UPDATE_DRAFT",{draft:new Ko(e,t)})},deleteNewAndEmptyDrafts:function(){return(e,t)=>{const n=t().drafts.drafts.filter((e=>!e.annotation.id&&!Qo(t().drafts,e.annotation))).map((t=>(e(Zo(t.annotation)),t.annotation)));e(Ro(n))}},discardAllDrafts:function(){return qr(0,"DISCARD_ALL_DRAFTS",void 0)},removeDraft:Zo},selectors:{countDrafts:function(e){return e.drafts.length},getDraft:Jo,getDraftIfNotEmpty:Qo,unsavedAnnotations:ei}});function ni(e){var t,n;return!!(null!==(t=e.user)&&void 0!==t&&t.username||null!==(n=e.user)&&void 0!==n&&n.userid)}function ri(e){const t=e.user;if(!t||!ni(e))return{};const n=t.username||t.userid||"";return{user:{value:n,display:t.displayName||n}}}const oi={CHANGE_FOCUS_MODE_USER:(e,t)=>({focusActive:ni({user:t.user}),focusFilters:ri({user:t.user})}),SET_FILTER(e,t){var n;const r={...e.filters,[t.filterName]:t.filterOption};return""===(null===(n=t.filterOption)||void 0===n?void 0:n.value)&&delete r[t.filterName],{
|
|
119
119
|
filters:r}},SET_FILTER_QUERY:(e,t)=>({query:t.query}),SET_FOCUS_MODE(e,t){var n;return{focusActive:null!==(n=t.active)&&void 0!==n?n:!e.focusActive}},CLEAR_SELECTION:()=>({filters:{},focusActive:!1,query:null})};const ii=Jr((e=>e.focusActive),(e=>e.focusFilters),((e,t)=>{var n;return{active:e,configured:!(null==t||!t.user),displayName:(null==t||null===(n=t.user)||void 0===n?void 0:n.display)||""}})),ai=Jr((e=>e.filters),(e=>e.focusActive),(e=>e.focusFilters),((e,t,n)=>t?{...n,...e}:{...e}));const si=Jr((e=>ai(e)),(e=>{const t={};for(const[n,r]of Object.entries(e))r&&(t[n]=r.value);return t}));const li=$r((function(e){const t=e.focus||{};return{filters:{},focusActive:ni(t),focusFilters:ri(t),query:e.query||null}}),{namespace:"filters",reducers:oi,actionCreators:{changeFocusModeUser:function(e){return qr(0,"CHANGE_FOCUS_MODE_USER",{user:e})},setFilter:function(e,t){return(n,r)=>{var o;null!==(o=r().filters.focusFilters)&&void 0!==o&&o[e]&&n(qr(0,"SET_FOCUS_MODE",{active:!1})),n(qr(0,"SET_FILTER",{filterName:e,
|
|
120
120
|
filterOption:t}))}},setFilterQuery:function(e){return qr(0,"SET_FILTER_QUERY",{query:e})},toggleFocusMode:function(e){return qr(0,"SET_FOCUS_MODE",{active:e})}},selectors:{filterQuery:function(e){return e.query},focusState:ii,getFilter:function(e,t){return ai(e)[t]},getFilters:ai,getFilterValues:si,getFocusFilters:function(e){return e.focusFilters},hasAppliedFilter:function(e){return!(!e.query&&!Object.keys(ai(e)).length)}}});var ci=t((function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<i.length;l++){var c=i[l];if(!s(c))return!1;var u=e[c],d=t[c];if(!1===(o=n?n.call(r,u,d,c):void 0)||void 0===o&&u!==d)return!1}return!0}));const ui={CONNECT_FRAME(e,t){const n=e.frames.findIndex((e=>e.id===t.frame.id)),r=[...e.frames];return-1!==n?r[n]=t.frame:r.push(t.frame),{frames:r}},DESTROY_FRAME(e,t){
|
|
121
|
-
const n=e.frames.filter((e=>e!==t.frame));return{frames:n}},UPDATE_FRAME_ANNOTATION_FETCH_STATUS:(e,t)=>({frames:e.frames.map((e=>e.uri&&e.uri===t.uri?Object.assign({},e,{isAnnotationFetchComplete:t.isAnnotationFetchComplete}):e))}),SET_CONTENT_INFO:(e,t)=>({contentInfo:t.info})};const di=e=>e.find((e=>!e.id))||null,hi=Jr((e=>e.frames),di),mi=Jr((e=>e.frames),(e=>{
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
const n=e.frames.filter((e=>e!==t.frame));return{frames:n}},UPDATE_FRAME_ANNOTATION_FETCH_STATUS:(e,t)=>({frames:e.frames.map((e=>e.uri&&e.uri===t.uri?Object.assign({},e,{isAnnotationFetchComplete:t.isAnnotationFetchComplete}):e))}),SET_CONTENT_INFO:(e,t)=>({contentInfo:t.info})};const di=e=>e.find((e=>!e.id))||null,hi=Jr((e=>e.frames),di),mi=Jr((e=>e.frames),(e=>{const t=di(e);return t||(e.length>0?e[0]:null)}));const pi=Zr(Xr,ci)((e=>e.frames.reduce(((e,t)=>e.concat(function(e){let t=[e.uri];return e.metadata&&e.metadata.documentFingerprint&&(t=e.metadata.link.map((e=>e.href))),e.metadata&&e.metadata.link&&e.metadata.link.forEach((e=>{e.href.startsWith("doi:")&&t.push(e.href)})),t}(t))),[])),(e=>e));const fi=$r({frames:[],contentInfo:null},{namespace:"frames",reducers:ui,actionCreators:{connectFrame:function(e){return qr(0,"CONNECT_FRAME",{frame:e})},destroyFrame:function(e){return qr(0,"DESTROY_FRAME",{frame:e})},setContentInfo:function(e){return qr(0,"SET_CONTENT_INFO",{info:e})},
|
|
122
|
+
updateFrameAnnotationFetchStatus:function(e,t){return qr(0,"UPDATE_FRAME_ANNOTATION_FETCH_STATUS",{uri:e,isAnnotationFetchComplete:t})}},selectors:{getContentInfo:function(e){return e.contentInfo},frames:function(e){return e.frames},mainFrame:hi,defaultContentFrame:mi,searchUris:pi}}),gi={FILTER_GROUPS(e,t){var n;if(null===(n=t.filteredGroupIds)||void 0===n||!n.length)return{filteredGroupIds:null};const r=e.groups.filter((e=>t.filteredGroupIds.includes(e.id)));if(!r.length)return{filteredGroupIds:null};let o=e.focusedGroupId;return o&&t.filteredGroupIds.includes(o)||(o=r[0].id),{filteredGroupIds:t.filteredGroupIds,focusedGroupId:o}},FOCUS_GROUP(e,t){const n=e.groups.find((e=>e.id===t.id));return n?{focusedGroupId:t.id}:(console.error(`Attempted to focus group ${t.id} which is not loaded`),{})},LOAD_GROUPS(e,t){const n=t.groups;let r=e.focusedGroupId;return null!==e.focusedGroupId&&n.find((t=>t.id===e.focusedGroupId))||(r=n.length>0?n[0].id:null),{focusedGroupId:r,groups:t.groups}},CLEAR_GROUPS:()=>({
|
|
123
|
+
filteredGroupIds:null,focusedGroupId:null,groups:[]})};function vi(e){return e.filteredGroupIds?e.groups.filter((t=>{var n;return null===(n=e.filteredGroupIds)||void 0===n?void 0:n.includes(t.id)})):e.groups}function bi(e,t){return e.groups.find((e=>e.id===t))}const _i=Jr((e=>vi(e)),(e=>e.filter((e=>!e.isMember&&e.isScopedToUri)))),yi=Jr((e=>vi(e)),(e=>e.filter((e=>e.isScopedToUri)))),wi=Jr((e=>vi(e.groups)),(e=>Ao.selectors.isLoggedIn(e.session)),((e,t)=>t?e.filter((e=>e.isMember)):[])),xi=Jr((e=>vi(e.groups)),(e=>wi(e)),(e=>_i(e.groups)),((e,t,n)=>e.filter((e=>!t.includes(e)&&!n.includes(e))))),ki=$r({filteredGroupIds:null,groups:[],focusedGroupId:null},{namespace:"groups",reducers:gi,actionCreators:{filterGroups:function(e){return qr(0,"FILTER_GROUPS",{filteredGroupIds:e})},focusGroup:function(e){return qr(0,"FOCUS_GROUP",{id:e})},loadGroups:function(e){return qr(0,"LOAD_GROUPS",{groups:e})},clearGroups:function(){return qr(0,"CLEAR_GROUPS",void 0)}},selectors:{allGroups:function(e){return e.groups},
|
|
124
|
+
filteredGroups:vi,filteredGroupIds:function(e){return e.filteredGroupIds},focusedGroup:function(e){var t;return e.focusedGroupId&&null!==(t=bi(e,e.focusedGroupId))&&void 0!==t?t:null},focusedGroupId:function(e){return e.focusedGroupId},getFeaturedGroups:_i,getGroup:bi,getInScopeGroups:yi},rootSelectors:{getCurrentlyViewingGroups:xi,getMyGroups:wi}});function Ni(e,t){const n={};for(const r in t)if(Qr(t,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}}const Si={UPDATE_LINKS:(e,t)=>({...t.links})};const Ei=$r(null,{namespace:"links",reducers:Si,actionCreators:{updateLinks:function(e){return qr(0,"UPDATE_LINKS",{links:e})}},selectors:{getLink:function(e,t,n={}){if(!e)return"";const r=e[t];if(!r)throw new Error(`Unknown link "${t}"`);const{url:o,unusedParams:i}=Ni(r,n),a=Object.keys(i);if(a.length>0)throw new Error(`Unused parameters: ${a.join(", ")}`);return o}}}),Ti={RECEIVE_REAL_TIME_UPDATES:(e,t)=>({pendingUpdates:{...t.pendingUpdates},
|
|
125
|
+
pendingDeletions:{...t.pendingDeletions}}),CLEAR_PENDING_UPDATES:()=>({pendingUpdates:{},pendingDeletions:{}}),ADD_ANNOTATIONS(e,{annotations:t}){const n={...e.pendingUpdates};for(const e of t)e.id&&delete n[e.id];return{pendingUpdates:n}},REMOVE_ANNOTATIONS(e,{annotationsToRemove:t}){const n={...e.pendingUpdates},r={...e.pendingDeletions};for(const e of t)e.id&&(delete n[e.id],delete r[e.id]);return{pendingUpdates:n,pendingDeletions:r}},FOCUS_GROUP:()=>({pendingUpdates:{},pendingDeletions:{}})};const Ai=Jr((e=>[e.pendingUpdates,e.pendingDeletions]),(([e,t])=>Object.keys(e).length+Object.keys(t).length));const Ci=$r({pendingUpdates:{},pendingDeletions:{}},{namespace:"realTimeUpdates",reducers:Ti,actionCreators:{receiveRealTimeUpdates:function({updatedAnnotations:e=[],deletedAnnotations:t=[]}){return(n,r)=>{const o={...r().realTimeUpdates.pendingUpdates},i={...r().realTimeUpdates.pendingDeletions};e.forEach((e=>{const t=r().groups,n=r().route
|
|
126
126
|
;e.group!==ki.selectors.focusedGroupId(t)&&"sidebar"===No.selectors.route(n)||(o[e.id]=e)})),t.forEach((e=>{const t=e.id;delete o[t];const n=r().annotations;$o.selectors.annotationExists(n,t)&&(i[t]=!0)})),n(qr(0,"RECEIVE_REAL_TIME_UPDATES",{pendingUpdates:o,pendingDeletions:i}))}},clearPendingUpdates:function(){return qr(0,"CLEAR_PENDING_UPDATES",void 0)}},selectors:{hasPendingDeletion:function(e,t){return Qr(e.pendingDeletions,t)},hasPendingUpdates:function(e){return Object.keys(e.pendingUpdates).length>0},pendingDeletions:function(e){return e.pendingDeletions},pendingUpdates:function(e){return e.pendingUpdates},pendingUpdateCount:Ai}}),Mi={annotation:"Location",note:"Oldest",orphan:"Location"};function Ii(e){const t={};return e.annotations&&!e.query&&(t[e.annotations]=!0),t}function zi(e,t){return t===e?{}:{selectedTab:e,sortKey:Mi[e]}}const Ri={CLEAR_ANNOTATION_FOCUS_REQUEST:()=>({focusRequest:null}),CLEAR_SELECTION:()=>({forcedVisible:{},selected:{}}),SELECT_ANNOTATIONS:(e,t)=>({selected:t.selection}),
|
|
127
127
|
SELECT_TAB:(e,t)=>zi(t.tab,e.selectedTab),SET_EXPANDED(e,t){const n={...e.expanded};return n[t.id]=t.expanded,{expanded:n}},SET_ANNOTATION_FOCUS_REQUEST:(e,t)=>({focusRequest:t.id}),SET_FORCED_VISIBLE:(e,t)=>({forcedVisible:{...e.forcedVisible,[t.id]:t.visible}}),SET_SORT_KEY:(e,t)=>({sortKey:t.key}),TOGGLE_SELECTED_ANNOTATIONS(e,t){const n={...e.selected};return t.toggleIds.forEach((e=>{n[e]=!n[e]})),{selected:n}},ADD_ANNOTATIONS(e,t){const n=t.annotations.filter((e=>!oo(e))),r=_o(t.annotations,po)===n.length;return 0===t.currentAnnotationCount&&r?zi("note",e.selectedTab):{}},CHANGE_FOCUS_MODE_USER:()=>({forcedVisible:{},selected:{}}),SET_FILTER:()=>({forcedVisible:{},selected:{},expanded:{}}),SET_FILTER_QUERY:()=>({forcedVisible:{},selected:{},expanded:{}}),SET_FOCUS_MODE:()=>({forcedVisible:{},selected:{}}),REMOVE_ANNOTATIONS(e,t){let n=e.selectedTab;"orphan"===n&&0===_o(t.remainingAnnotations,mo)&&(n="annotation");const r=e=>(t.annotationsToRemove.forEach((t=>{t.id&&delete e[t.id],t.$tag&&delete e[t.$tag]
|
|
128
128
|
})),e);return{...zi(n,e.selectedTab),expanded:r({...e.expanded}),forcedVisible:r({...e.forcedVisible}),selected:r({...e.selected})}}};function Li(){return qr(0,"CLEAR_SELECTION",void 0)}function Oi(e){return e.expanded}const Di=Jr((e=>e.forcedVisible),(e=>wo(e))),Pi=Jr((e=>e.selected),(e=>wo(e).length>0)),Bi=Jr((e=>e.selected),(e=>wo(e)));function Fi(e){return e.selectedTab}const Hi=Jr((e=>e),(e=>({expanded:Oi(e),forcedVisible:Di(e),selected:Bi(e),sortKey:Ui(e),selectedTab:Fi(e)})));function Ui(e){return e.sortKey}const ji=Jr((e=>e.selectedTab),(e=>{const t=["Newest","Oldest"];return"note"!==e&&t.push("Location"),t})),qi=$r((function(e){return{selected:Ii(e),expanded:Ii(e),forcedVisible:{},selectedTab:"annotation",sortKey:Mi.annotation,focusRequest:null}}),{namespace:"selection",reducers:Ri,actionCreators:{clearAnnotationFocusRequest:function(){return qr(0,"CLEAR_ANNOTATION_FOCUS_REQUEST",void 0)},clearSelection:Li,selectAnnotations:function(e){return t=>{t(Li()),t(qr(0,"SELECT_ANNOTATIONS",{selection:yo(e)
|
|
@@ -544,7 +544,7 @@ for(let n=0;n<Math.min(e.length,t.length);n++)if(e[n]!==t[n]){if(typeof e[n]!=ty
|
|
|
544
544
|
;function Ip(e){return function(e){return e.replace(Mp,"")}((t=e,t.normalize("NFKD"))).toLowerCase();var t}class zp{constructor(e,t){H(this,"term",void 0),H(this,"matcher",void 0),this.term=t.normalize(e),this.matcher=t}matches(e){const t=this.matcher;return t.fieldValues(e).some((e=>t.matches(t.normalize(e),this.term)))}}class Rp{constructor(e,t){H(this,"operator",void 0),H(this,"filters",void 0),this.operator=e,this.filters=t}matches(e){return"and"===this.operator?this.filters.every((t=>t.matches(e))):this.filters.some((t=>t.matches(e)))}}function Lp(e){return{fieldValues:e,matches:(e,t)=>e.includes(t),normalize:Ip}}const Op={quote:Lp((e=>{var t;return[null!==(t=bo(e))&&void 0!==t?t:""]})),since:{fieldValues:e=>[new Date(e.updated).valueOf()],matches:(e,t)=>(Date.now()-e)/1e3<=t,normalize:e=>e},tag:Lp((e=>e.tags)),text:Lp((e=>[e.text])),uri:Lp((e=>[e.uri])),user:Lp((e=>{var t,n;return[e.user,null!==(t=null===(n=e.user_info)||void 0===n?void 0:n.display_name)&&void 0!==t?t:""]}))};const Dp=function(e){
|
|
545
545
|
if(1!==e.length)throw new Error("Memoize input must be a function of one argument");let t,n;return function(r){return r===t||(t=r,n=e(r)),n}}((function(e){const t=e.selection,n={expanded:t.expanded,forcedVisible:t.forcedVisible,selected:t.selected,sortCompareFn:Cp[t.sortKey]},r=!!t.filterQuery||Object.keys(t.filters).length>0;if(r){const e=function(e,t={}){const n=[],r=[],o=[],i=[],a=[],s=[],l=t.user?[t.user]:[],c=hp(e);for(const e of c){const t=e.slice(0,e.indexOf(":")),c=e.slice(t.length+1);switch(t){case"quote":r.push(c);break;case"since":{const t=86400,n={sec:1,min:60,hour:3600,day:t,week:7*t,month:30*t,year:365*t},r=e.slice(6).toLowerCase().match(/^(\d+)(sec|min|hour|day|week|month|year)?$/);if(r){const e=parseFloat(r[1]),t=r[2]||"sec";o.push(e*n[t])}}break;case"tag":i.push(c);break;case"text":a.push(c);break;case"uri":s.push(c);break;case"user":l.push(c);break;default:n.push(e)}}return{any:{terms:n,operator:"and"},quote:{terms:r,operator:"and"},since:{terms:o,operator:"and"},tag:{terms:i,operator:"and"
|
|
546
546
|
},text:{terms:a,operator:"and"},uri:{terms:s,operator:"or"},user:{terms:l,operator:"or"}}}(t.filterQuery||"",t.filters);n.filterFn=t=>function(e,t){const n=(e,t)=>new zp(t,Op[e]),r=Object.entries(t).filter((([,e])=>e.terms.length>0)).map((([e,t])=>{let r;if("any"===e){const e=["quote","text","tag","user"];r=t.terms.map((t=>new Rp("or",e.map((e=>n(e,t))))))}else r=t.terms.map((t=>n(e,t)));return new Rp(t.operator,r)})),o=new Rp("and",r);return e.filter((e=>e.id&&o.matches(e))).map((e=>e.id))}([t],e).length>0}return!r&&"sidebar"===e.route&&(n.threadFilterFn=e=>{return!!e.annotation&&(n=e.annotation,r=t.selectedTab,!co(n)&&Np(n)===r);var n,r}),kp(e.annotations,n)}));function Pp(){const e=Ji(),t=e.allAnnotations(),n=e.filterQuery(),r=e.route(),o=e.selectionState(),i=e.getFilterValues(),a=de((()=>({annotations:t,route:r,selection:{...o,filterQuery:n,filters:i}})),[t,n,r,o,i]);return Dp(a)}var Bp=wr((function({loadAnnotationsService:e,onLogin:t}){var n
|
|
547
|
-
;const r=Ji(),o=null!==(n=r.routeParams().id)&&void 0!==n?n:"",i=Pp(),a=r.profile().userid,[s,l]=ae(!1);return le((()=>{l(!1),r.clearAnnotations(),e.loadThread(o).then((e=>{const t=e.filter((e=>0===(e.references||[]).length))[0];t&&(e.forEach((e=>e.id&&r.setExpanded(e.id,!0))),t.id!==o&&r.highlightAnnotations([o]))})).catch((()=>{l(!0)}))}),[o,a,e,r]),Te(v,{children:[s&&Te(Qi,{errorType:"annotation",onLoginRequest:t}),Te(cp,{threads:i.children})]})}),["loadAnnotationsService"]);class Fp{constructor(e,t,n=window){var r,o,i;H(this,"version",void 0),H(this,"userAgent",void 0),H(this,"urls",void 0),H(this,"fingerprint",void 0),H(this,"account",void 0),H(this,"timestamp",void 0),H(this,"segment",void 0);const a="N/A";let s=a;e.userid&&(s=e.userid,e.displayName&&(s=`${e.displayName} (${s})`)),this.version="1.
|
|
547
|
+
;const r=Ji(),o=null!==(n=r.routeParams().id)&&void 0!==n?n:"",i=Pp(),a=r.profile().userid,[s,l]=ae(!1);return le((()=>{l(!1),r.clearAnnotations(),e.loadThread(o).then((e=>{const t=e.filter((e=>0===(e.references||[]).length))[0];t&&(e.forEach((e=>e.id&&r.setExpanded(e.id,!0))),t.id!==o&&r.highlightAnnotations([o]))})).catch((()=>{l(!0)}))}),[o,a,e,r]),Te(v,{children:[s&&Te(Qi,{errorType:"annotation",onLoginRequest:t}),Te(cp,{threads:i.children})]})}),["loadAnnotationsService"]);class Fp{constructor(e,t,n=window){var r,o,i;H(this,"version",void 0),H(this,"userAgent",void 0),H(this,"urls",void 0),H(this,"fingerprint",void 0),H(this,"account",void 0),H(this,"timestamp",void 0),H(this,"segment",void 0);const a="N/A";let s=a;e.userid&&(s=e.userid,e.displayName&&(s=`${e.displayName} (${s})`)),this.version="1.1356.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||a,
|
|
548
548
|
this.fingerprint=null!==(r=null===(o=t[0])||void 0===o||null===(o=o.metadata)||void 0===o?void 0:o.documentFingerprint)&&void 0!==r?r:a,this.account=s,this.timestamp=(new Date).toString();const l=null===(i=t[0])||void 0===i?void 0:i.segment;if(l){const e=[];l.cfi&&e.push(["CFI",l.cfi]),l.url&&e.push(["URL",l.url]),this.segment=e.map((([e,t])=>`${e}: ${t}`)).join(", ")}}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())}}var Hp="complete",Up="canceled";function jp(e,t,n){e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,e.scrollTop=n)}function qp(e){var t=e._scrollSettings;if(t){var n=t.maxSynchronousAlignments,r=function(e,t){
|
|
549
549
|
var n,r,o,i,a,s,l,c=e.align,u=e.target.getBoundingClientRect(),d=c&&null!=c.left?c.left:.5,h=c&&null!=c.top?c.top:.5,m=c&&null!=c.leftOffset?c.leftOffset:0,p=c&&null!=c.topOffset?c.topOffset:0,f=d,g=h;if(e.isWindow(t))s=Math.min(u.width,t.innerWidth),l=Math.min(u.height,t.innerHeight),r=u.left+t.pageXOffset-t.innerWidth*f+s*f,o=u.top+t.pageYOffset-t.innerHeight*g+l*g,r-=m,o-=p,r=e.align.lockX?t.pageXOffset:r,o=e.align.lockY?t.pageYOffset:o,i=r-t.pageXOffset,a=o-t.pageYOffset;else{s=u.width,l=u.height,n=t.getBoundingClientRect();var v=u.left-(n.left-t.scrollLeft),b=u.top-(n.top-t.scrollTop);r=v+s*f-t.clientWidth*f,o=b+l*g-t.clientHeight*g,r-=m,o-=p,r=Math.max(Math.min(r,t.scrollWidth-t.clientWidth),0),o=Math.max(Math.min(o,t.scrollHeight-t.clientHeight),0),r=e.align.lockX?t.scrollLeft:r,o=e.align.lockY?t.scrollTop:o,i=r-t.scrollLeft,a=o-t.scrollTop}return{x:r,y:o,differenceX:i,differenceY:a}}(t,e),o=Date.now()-t.startTime,i=Math.min(1/t.time*o,1);if(t.endIterations>=n)return jp(e,r.x,r.y),
|
|
550
550
|
e._scrollSettings=null,t.end(Hp);var a=1-t.ease(i);if(jp(e,r.x-r.differenceX*a,r.y-r.differenceY*a),o>=t.time)return t.endIterations++,t.scrollAncestor&&qp(t.scrollAncestor),void qp(e);!function(e){if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTimeout(e,16)}(qp.bind(null,e))}}function $p(e){return e.self===e}function Gp(e){return"pageXOffset"in e||(e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth)&&"hidden"!==getComputedStyle(e).overflow}function Vp(){return!0}function Yp(e){if(e.assignedSlot)return Yp(e.assignedSlot);if(e.parentElement)return"body"===e.parentElement.tagName.toLowerCase()?e.parentElement.ownerDocument.defaultView||e.parentElement.ownerDocument.ownerWindow:e.parentElement;if(e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t.host}}var Wp=function(e,t,n){if(e){"function"==typeof t&&(n=t,t=null),t||(t={}),t.time=isNaN(t.time)?1e3:t.time,t.ease=t.ease||function(e){return 1-Math.pow(1-e,e/2)},t.align=t.align||{}
|
|
@@ -565,8 +565,8 @@ children:"..."}):Te(pf,{title:`Go to page ${t}`,pressed:t===e,onClick:e=>a(t,e.t
|
|
|
565
565
|
className:"flex items-center lg:justify-self-end text-md font-medium",children:[Te(yf,{}),Te(mf,{forcedVisibleCount:a,isFiltered:s,isLoading:l,resultCount:null!=c?c:0})]}),Te("div",{className:"lg:col-span-2",children:[g&&Te("div",{className:"py-4","data-testid":"notebook-messages",children:Te(Vn,{title:"Too many results to show",children:[Te("p",{children:["This preview of the Notebook can show"," ",Te("strong",{children:["up to ",5e3," results"]})," at a time (there are"," ",c," to show here)."]}),Te("p",{children:[Te(cr,{href:"mailto:support@hypothes.is?subject=Hypothesis%20Notebook&body=Please%20notify%20me%20when%20the%20Hypothesis%20Notebook%20is%20updated%20to%20support%20more%20than%205000%20annotations",underline:"always",children:"Contact us"})," ","if you would like to be notified when support for more annotations is available."]})]})}),Te(gf,{currentPage:p,isLoading:l,onChangePage:y,threads:u.children})]})]})}),["loadAnnotationsService","streamer"])
|
|
566
566
|
;function xf({classes:e,children:t,onClose:n=(()=>{}),...r}){return Te("div",{className:X("flex items-center gap-x-1 py-1 px-2 rounded-[4px]","bg-green-success/10 animate-pulse-fade-out",e),onAnimationEnd:n,...r,children:[Te(nt,{className:"text-green-success w-em h-em p-[0.125em]"}),Te("div",{className:"text-sm",children:t})]})}function kf(){const e=Ji(),[t,n]=ae(!1),[r,o]=ae(0);if(le((()=>{let e;return t&&(e=setTimeout((()=>{n(!1),o((e=>e+1))}),1e3)),()=>{clearTimeout(e)}}),[t]),!e.isFeatureEnabled("client_user_profile"))return null;const i=r>0&&!t;return Te(Le,{"data-testid":"profile-container",children:[Te("div",{className:X("h-12","px-3 border-b flex items-center"),children:[Te("div",{className:"grow",children:Te("h1",{className:"text-xl text-slate-7 font-normal",children:"Notifications"})}),Te("ul",{className:"sr-only","aria-live":"polite",children:i&&Te("li",{children:"Notification preferences saved"},r)}),r>0&&Te(xf,{onClose:()=>o(0),children:"Saved"},r)]}),Te(Re,{children:Te(De,{size:"lg",
|
|
567
567
|
children:Te(ir,{defaultChecked:!0,disabled:t,onChange:()=>n(!0),checkedIcon:t?In:void 0,icon:t?In:void 0,children:"Email me a daily summary of activity in my courses"})})})]})}function Nf({annotations:e,getDisplayName:t,excludeReplies:n=!1}){const r=new Map;for(const o of e){if(n&&oo(o))continue;let e=r.get(o.user);e||(e={userid:o.user,displayName:t(o),annotations:[]},r.set(o.user,e)),e.annotations.push(o)}const o=[...r.values()];return o.sort(((e,t)=>e.displayName.localeCompare(t.displayName))),o}function Sf(e){return`${e.getFullYear()}-${`${e.getMonth()+1}`.padStart(2,"0")}-${`${e.getDate()}`.padStart(2,"0")}`}function Ef({documentMetadata:e,groupName:t,date:n=new Date}){const r=[Sf(n)];return null!=e&&e.title?r.push(function(e,t){const n=Array.from(e);return n.length<=t?e:n.slice(0,t).join("")}(e.title,50)):r.push("Hypothesis"),t&&r.push(t.replace(/ /g,"-")),r.join("-")}function Tf(){return Te("div",{className:"flex flex-row items-center justify-center","data-testid":"loading-spinner",children:Te(Qn,{
|
|
568
|
-
size:"md"})})}var Af=wr((function({annotationsExporter:e,toastMessenger:t}){const n=Ji(),r=n.focusedGroup(),o=r&&!n.isLoading(),i=n.defaultContentFrame(),a=n.savedAnnotations(),s=n.defaultAuthority(),l=n.isFeatureEnabled("client_display_names"),c=he((e=>Aa(e,s,l)),[s,l]),u=de((()=>Nf({annotations:a,getDisplayName:c})),[a,c]),d=n.profile().userid,[h,m]=ae(d),p=n.countDrafts(),f=de((()=>Ef({documentMetadata:i.metadata,groupName:null==r?void 0:r.name})),[i,r]),[g,b]=ae();return o?Te("form",{className:"space-y-3",onSubmit:n=>{n.preventDefault();try{var r,o;const t=null!==(r=null===(o=u.find((e=>e.userid===h)))||void 0===o?void 0:o.annotations)&&void 0!==r?r:a,n=`${null!=g?g:f}.json`;!function(e,t,n=document){const r=n.createElement("a"),o=JSON.stringify(e,null,2),i=new Blob([o],{type:"application/json"}),a=URL.createObjectURL(i);r.setAttribute("href",a),r.setAttribute("download",t),r.style.visibility="hidden",n.body.appendChild(r),r.click(),n.body.removeChild(r)}(e.buildExportContent(t),n)
|
|
569
|
-
t.error("Exporting annotations failed")}},"data-testid":"export-form",children:[a.length>0?Te(v,{children:[Te("p",{className:"text-color-text-light mb-3",children:[Te(cr,{variant:"text-light",underline:"always",href:"https://web.hypothes.is/help/exporting-and-importing-annotations-in-the-hypothesis-web-app/",target:"_blank",children:"Learn more"})," ","about copying and exporting annotations."]}),Te("label",{"data-testid":"export-count",htmlFor:"export-filename",className:"font-medium",children:"Name of export file:"}),Te(sr,{"data-testid":"export-filename",id:"export-filename",defaultValue:f,value:g,onChange:e=>b(e.target.value),required:!0,maxLength:250}),Te("label",{htmlFor:"export-user",className:"block font-medium",children:["Select which user","'","s annotations to export:"]}),Te(lr,{id:"export-user",onChange:e=>m(e.target.value||null),children:[Te("option",{value:"",selected:!h,children:["All annotations (",a.length,")"]}),u.map((e=>Te("option",{value:e.userid,selected:e.userid===h,
|
|
568
|
+
size:"md"})})}var Af=wr((function({annotationsExporter:e,toastMessenger:t}){const n=Ji(),r=n.focusedGroup(),o=r&&!n.isLoading(),i=n.defaultContentFrame(),a=n.savedAnnotations(),s=n.defaultAuthority(),l=n.isFeatureEnabled("client_display_names"),c=he((e=>Aa(e,s,l)),[s,l]),u=de((()=>Nf({annotations:a,getDisplayName:c})),[a,c]),d=n.profile().userid,[h,m]=ae(d),p=n.countDrafts(),f=de((()=>Ef({documentMetadata:null==i?void 0:i.metadata,groupName:null==r?void 0:r.name})),[i,r]),[g,b]=ae();return o?Te("form",{className:"space-y-3",onSubmit:n=>{n.preventDefault();try{var r,o;const t=null!==(r=null===(o=u.find((e=>e.userid===h)))||void 0===o?void 0:o.annotations)&&void 0!==r?r:a,n=`${null!=g?g:f}.json`;!function(e,t,n=document){const r=n.createElement("a"),o=JSON.stringify(e,null,2),i=new Blob([o],{type:"application/json"}),a=URL.createObjectURL(i);r.setAttribute("href",a),r.setAttribute("download",t),r.style.visibility="hidden",n.body.appendChild(r),r.click(),n.body.removeChild(r)}(e.buildExportContent(t),n)
|
|
569
|
+
}catch(n){t.error("Exporting annotations failed")}},"data-testid":"export-form",children:[a.length>0?Te(v,{children:[Te("p",{className:"text-color-text-light mb-3",children:[Te(cr,{variant:"text-light",underline:"always",href:"https://web.hypothes.is/help/exporting-and-importing-annotations-in-the-hypothesis-web-app/",target:"_blank",children:"Learn more"})," ","about copying and exporting annotations."]}),Te("label",{"data-testid":"export-count",htmlFor:"export-filename",className:"font-medium",children:"Name of export file:"}),Te(sr,{"data-testid":"export-filename",id:"export-filename",defaultValue:f,value:g,onChange:e=>b(e.target.value),required:!0,maxLength:250}),Te("label",{htmlFor:"export-user",className:"block font-medium",children:["Select which user","'","s annotations to export:"]}),Te(lr,{id:"export-user",onChange:e=>m(e.target.value||null),children:[Te("option",{value:"",selected:!h,children:["All annotations (",a.length,")"]}),u.map((e=>Te("option",{value:e.userid,selected:e.userid===h,
|
|
570
570
|
children:[e.displayName," (",e.annotations.length,")"]},e.userid)))]})]}):Te("p",{"data-testid":"no-annotations-message",children:"There are no annotations available for export."}),p>0&&Te("p",{"data-testid":"drafts-message",children:["You have ",p," unsaved"," ",(_=p,y="draft",w="drafts",1===_?y:w),a.length>0&&Te(v,{children:" that will not be included"}),"."]}),Te(Oe,{children:Te(Jn,{"data-testid":"export-button",variant:"primary",disabled:0===a.length,type:"submit",children:"Export"})})]}):Te(Tf,{});var _,y,w}),["annotationsExporter","toastMessenger"]);function Cf(e,t=new FileReader){const{promise:n,resolve:r,reject:o}=function(){let e,t;return{promise:new Promise(((n,r)=>{e=n,t=r})),resolve:e,reject:t}}();return t.addEventListener("loadend",(e=>{try{var t,n;const o=null!==(t=null===(n=e.target)||void 0===n||null===(n=n.result)||void 0===n?void 0:n.toString())&&void 0!==t?t:"",i=JSON.parse(o);r(i)}catch(e){o(e)}})),t.readAsText(e),n}function Mf({size:e,value:t}){const n=e-4,r=Math.PI*n;return Te("span",{
|
|
571
571
|
className:"text-grey-3",role:"progressbar","aria-valuenow":t,style:{width:`${e}px`,height:`${e}px`,transform:"rotate(-90deg)"},children:Te("svg",{viewBox:`0 0 ${e} ${e}`,children:Te("circle",{cx:e/2,cy:e/2,r:n/2,fill:"none",stroke:"currentColor","stroke-width":2,style:{strokeDasharray:r,strokeDashoffset:r-r*(t/100)+"px",transitionDuration:"300ms",transitionProperty:"stroke-dashoffset"}})})})}function If({onFileSelected:e,disabled:t,id:n}){const r=ue(null),[o,i]=ae(null);return Te(Jn,{variant:"custom",classes:X("w-full relative overflow-hidden border rounded","bg-grey-0 hover:bg-grey-0"),title:o?`${o}, Select a file`:"Select a file",onClick:()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.click()},disabled:t,"data-testid":"file-input-proxy-button",children:[Te("input",{ref:r,accept:".json",id:n,type:"file",disabled:t,className:"invisible absolute w-0 h-0","aria-hidden":!0,"data-testid":"file-input",onChange:t=>{var n,r;const o=t.target.files
|
|
572
572
|
;i(null!==(n=null==o||null===(r=o[0])||void 0===r?void 0:r.name)&&void 0!==n?n:null),null!==o&&o.length>0&&e(o[0])}}),Te("div",{className:"max-w-full pr-10 truncate","data-testid":"filename-container",children:null!=o?o:"Select a file"}),Te("div",{className:"absolute right-0 h-full p-2 border-l bg-grey-2",children:Te(At,{})})]})}var zf=wr((function({importAnnotationsService:e}){const[t,n]=ae(null),[r,o]=ae(null),[i,a]=ae(null),[s,l]=ae(null),c=Ji(),u=c.profile().userid,d=c.defaultAuthority(),h=c.isFeatureEnabled("client_display_names"),m=he((e=>Aa(e,d,h)),[d,h]),p=de((()=>r?Nf({annotations:r,getDisplayName:m,excludeReplies:!0}):null),[r,m]);let f;le((()=>{u&&t&&(o(null),a(null),l(null),async function(e){let t;try{t=await Cf(e)}catch(e){throw new Error("Not a valid JSON file")}if(null===(n=t)||"object"!=typeof n||!Array.isArray(t.annotations))throw new Error("Not a valid Hypothesis JSON file");var n;return t.annotations}(t).then((e=>{o(e);const t=e.some((e=>e.user===u));l(t?u:null)})).catch((e=>{a(e.message)
|
|
@@ -601,7 +601,7 @@ e))).catch((e=>{throw i.removeEventListener("message",l),e}))}function hg(e){con
|
|
|
601
601
|
title:""}},e);return ho(l)&&(l.permissions=Ma(i)),l}create(e,t=new Date){const n=this.annotationFromData(e,t);this._store.addAnnotations([n]),this._store.deleteNewAndEmptyDrafts(),ho(n)||this._store.createDraft(n,{tags:n.tags,text:n.text,isPrivate:!so(n)}),po(n)?this._store.selectTab("note"):fo(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:so(e)?Ia(t,e.group):Ma(t),references:(e.references||[]).concat(e.id),target:[{source:e.target[0].source}],
|
|
602
602
|
uri:e.uri};this.create(n)}async save(e){let t,n;const r=this._applyDraftChanges(e);let o;io(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)}for(const[t,n]of Object.entries(e))if(t.startsWith("$")){o[t]=n}return this._store.removeDraft(e),this._store.addAnnotations([o]),o}}function Tg(e){const t={};for(const[n,r]of Object.entries(e))n.startsWith("$")||(t[n]=r);return t}Eg.$inject=["annotationActivity","api","store"];class Ag{constructor(e){H(this,"_store",void 0),this._store=e}buildExportContent(e,t=new Date){var n;const r=this._store.profile(),o=new Fp(r,[]);return{export_date:t.toISOString(),export_userid:null!==(n=r.userid)&&void 0!==n?n:"",client_version:o.version,annotations:e.map(Tg)}}}Ag.$inject=["store"];class Cg extends Error{constructor(e,t,n=""){let r="Network request failed";t&&(r+=` (${t.status})`),
|
|
603
603
|
n&&(r+=`: ${n}`),super(r),H(this,"url",void 0),H(this,"response",void 0),H(this,"reason",void 0),this.url=e,this.response=t,this.reason=n}}async function Mg(e,t){let n,r;try{n=await fetch(e,t)}catch(t){throw new Cg(e,null,t.message)}if(204===n.status)return null;try{r=await n.json()}catch(t){throw new Cg(e,n,"Failed to parse response")}var o;if(!n.ok)throw new Cg(e,n,null===(o=r)||void 0===o?void 0:o.reason);return r}class Ig{constructor(e,t,n){H(this,"_clientId",void 0),H(this,"search",void 0),H(this,"annotation",void 0),H(this,"group",void 0),H(this,"groups",void 0),H(this,"profile",void 0),this._clientId=null;const r=e.routes(),o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s)=>{o();try{const[o,i]=await Promise.all([e,n()]),l=function(e,t){let n=e;const r=t.split(".");for(const[e,t]of r.entries()){const o=n[t];if(!o||"url"in o){if(o&&e===r.length-1)return o;break}n=o}return null}(o,t)
|
|
604
|
-
;if(!l)throw new Error(`Missing API route: ${t}`);const c={"Content-Type":"application/json","Hypothesis-Client-Version":"1.
|
|
604
|
+
;if(!l)throw new Error(`Missing API route: ${t}`);const c={"Content-Type":"application/json","Hypothesis-Client-Version":"1.1356.0"};i&&(c.Authorization="Bearer "+i);const u=r();u&&(c["X-Client-Id"]=u);const{url:d,unusedParams:h}=Ni(l.url,a),m=new URL(d);for(const[e,t]of Object.entries(h)){const n=Array.isArray(t)?t:[t];for(const t of n)null!=t&&m.searchParams.append(e,t.toString())}return await Mg(m.toString(),{body:s?JSON.stringify(Tg(s)):null,headers:c,method:l.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={list:i("groups.read")},this.profile={groups:{
|
|
605
605
|
read:i("profile.groups.read")},read:i("profile.read"),update:i("profile.update")}}setClientId(e){this._clientId=e}}Ig.$inject=["apiRoutes","auth","store"];var zg={};function Rg(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 Lg=Rg;Rg.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},Rg.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},Rg.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=(new Date).getTime()
|
|
606
606
|
;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},Rg.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)},Rg.prototype.try=function(e){
|
|
607
607
|
console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},Rg.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},Rg.prototype.start=Rg.prototype.try,Rg.prototype.errors=function(){return this._errors},Rg.prototype.attempts=function(){return this._attempts},Rg.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=Lg;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))
|
|
@@ -711,8 +711,8 @@ const e=this._store.profile().userid;t.userid!==e&&console.warn('WebSocket user
|
|
|
711
711
|
;setTimeout((()=>this._reconnect()),e)}else console.error("Gave up trying to reconnect to Hypothesis real time update service")})),o.on("error",(e=>this._handleSocketError(t,e))),o.on("message",(e=>this._handleSocketMessage(e))),this._socket=o,this.setConfig("client-id",{messageType:"client_id",value:this.clientId}),this.setConfig("auth-check",{type:"whoami",id:1})}async connect(e={}){var t;this._updateImmediately=null===(t=e.applyUpdatesImmediately)||void 0===t||t,this._reconnectSetUp||(this._reconnectSetUp=!0,Jg(this._store.subscribe,(()=>this._store.profile().userid),(()=>this._reconnect()))),this._socket||await this._reconnect()}}ow.$inject=["store","apiRoutes","auth","groups","session"];const iw="hypothesis.user.tags.list",aw="hypothesis.user.tags.map";class sw{constructor(e){H(this,"_storage",void 0),this._storage=e}filter(e,t=null){const n=this._storage.getObject(iw)||[];let r=0;return n.filter((n=>{if(null!==t&&r>=t)return!1;const o=n.split(/\W+/),i=new RegExp(`^${_g(e)}`,"i")
|
|
712
712
|
;return!(!o.some((e=>e.match(i)))&&!n.match(i))&&(++r,!0)}))}store(e){const t=this._storage.getObject(aw)||{};e.forEach((e=>{t[e]?(t[e].count+=1,t[e].updated=Date.now()):t[e]={text:e,count:1,updated:Date.now()}})),this._storage.setObject(aw,t);const n=Object.keys(t).sort(((e,n)=>t[e].count!==t[n].count?t[n].count-t[e].count:e.localeCompare(n)));this._storage.setObject(iw,n)}}sw.$inject=["localStorage"];class lw{constructor(e){H(this,"_store",void 0),this._store=e}forceVisible(e){e.children.forEach((e=>{this.forceVisible(e)})),e.visible||this._store.setForcedVisible(e.id,!0)}}lw.$inject=["store"];class cw extends sf{constructor(e,t){super(),H(this,"_store",void 0),H(this,"_window",void 0),H(this,"_delayedMessageQueue",void 0),this._store=e,this._window=t,this._delayedMessageQueue=[],this._window.addEventListener("focus",(()=>{this._delayedMessageQueue.forEach((({type:e,messageText:t,options:n})=>this._addMessage(e,t,n))),this._delayedMessageQueue=[]}))}dismiss(e){const t=this._store.getToastMessage(e)
|
|
713
713
|
;t&&!t.isDismissed&&(this._store.updateToastMessage({...t,isDismissed:!0}),this.emit("toastMessageDismissed",e),setTimeout((()=>{this._store.removeToastMessage(e)}),500))}_addMessage(e,t,{autoDismiss:n=!0,moreInfoURL:r="",visuallyHidden:o=!1,delayed:i=!1}={}){if(this._store.hasToastMessage(e,t))return;if(i&&!this._window.document.hasFocus()){const i={autoDismiss:n,moreInfoURL:r,visuallyHidden:o};return void this._delayedMessageQueue.push({type:e,messageText:t,options:i})}const a=ug(10),s={type:e,id:a,message:t,moreInfoURL:r,visuallyHidden:o};this._store.addToastMessage({isDismissed:!1,...s}),this.emit("toastMessageAdded",s),n&&setTimeout((()=>{this.dismiss(a)}),5e3)}error(e,t){this._addMessage("error",e,t)}success(e,t){this._addMessage("success",e,t)}notice(e,t){this._addMessage("notice",e,t)}}cw.$inject=["store","$window"];const uw=function(e){for(var t={},n=e.querySelectorAll("script.js-hypothesis-config"),r=0;r<n.length;r++){var o=void 0;try{o=JSON.parse(n[r].textContent||"")}catch(e){
|
|
714
|
-
console.warn("Could not parse settings from js-hypothesis-config tags",e),o={}}Object.assign(t,o)}return t}(document),dw=function(e){const{version:t,origin:n}=hg(e.location.href);return"1.
|
|
715
|
-
release:"1.
|
|
714
|
+
console.warn("Could not parse settings from js-hypothesis-config tags",e),o={}}Object.assign(t,o)}return t}(document),dw=function(e){const{version:t,origin:n}=hg(e.location.href);return"1.1356.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1356.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 hw(e,t){e.setClientId(t.clientId)}function mw(e,t,n){e.load(),t.load(),n.sync()}function pw(e,t,n){e.init(),t.init(),n.init()}function fw(e,t){"sidebar"===t.route()&&e.connect()}uw.sentry&&dw&&function(e){const t=function(){const e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;jy({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],
|
|
715
|
+
release:"1.1356.0",beforeSend:(e,t)=>{if($y>=5)return bg("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++$y;try{const n=t&&t.originalException;n instanceof Event&&(e.extra||(e.extra={}),Object.assign(e.extra,{type:n.type,detail:n.detail,isTrusted:n.isTrusted}))}catch(e){}return e}});try{b_("host_config",hg(window.location.href))}catch(e){}b_("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),Vg(((e,t)=>{Gy(e,t)}))}(uw.sentry),function(e){e.addEventListener("click",(e=>{const t=e.target;"A"===t.tagName&&"_blank"===t.target&&(t.rel="noopener")}))}(document.body),hw.$inject=["api","streamer"],mw.$inject=["groups","session","router"],pw.$inject=["autosaveService","persistedDefaults","serviceURL"],fw.$inject=["frameSync","store"];const gw=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",Ng)}(),async function(e,t=window){const n=function(e){
|
|
716
716
|
const t=hg(e.location.href),n=["annotations","group","query","appType","openSidebar","showHighlights","services","branding","enableExperimentalNewNoteButton","focus","requestConfigFromFrame","theme","usernameUrl"],r={openSidebar:mg,requestConfigFromFrame:e=>{if("string"==typeof e)return e;const t=function(e){return"object"==typeof e&&null!==e?e:{}}(e);return{origin:fg(t.origin),ancestorLevel:pg(t.ancestorLevel)}}},o={};for(const[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:gg(n.ancestorLevel,t),origin:n.origin}}(n,t);let o;if(r){const e=await async function(e,t){return{...await dg(t.targetFrame,t.origin,"requestConfig",[],3e3),...e.group?{group:e.group}:{}}}(n,r);o=function(e,t){const n=e.services
|
|
717
717
|
;return Array.isArray(n)?(n.forEach(((e,n)=>{"$rpc:requestGroups"===e.groups&&(e.groups=dg(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=gr(e);if(!t)return e.apiUrl;if(t.apiUrl)return t.apiUrl;throw new Error("Service should contain an apiUrl value.")}(i),i}(uw).then((e=>{!function(e,t){const n=new $
|
|
718
718
|
;n.register("annotationsExporter",Ag).register("annotationsService",Eg).register("annotationActivity",Sg).register("api",Ig).register("apiRoutes",Bg).register("auth",Ug).register("autosaveService",jg).register("frameSync",tv).register("groups",ov).register("importAnnotationsService",Yy).register("loadAnnotationsService",Wy).register("localStorage",Xy).register("persistedDefaults",Jy).register("router",Qy).register("serviceURL",ew).register("session",tw).register("streamer",ow).register("streamFilter",nw).register("tags",sw).register("threadsService",lw).register("toastMessenger",cw).register("store",{factory:Zi}),n.register("$window",{value:window}).register("settings",{value:e}),n.run(pw),n.run(hw),n.run(mw),n.run(kg),n.run(fw),B(Te(yr.Provider,{value:n,children:Te(sg,{})}),t)}(e,gw)})).catch((e=>function(e,t){console.error("Failed to start Hypothesis client: ",e),B(Te(lg,{error:e}),t)}(e,gw)));
|