hypothesis 1.1593.0 → 1.1594.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?f6c556","styles/annotator.css":"styles/annotator.css?427463","styles/annotator.css.map":"styles/annotator.css.map?94a857","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css":"styles/katex.min.css?d92c5a","styles/katex.min.css.map":"styles/katex.min.css.map?e7e03f","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?c95edf","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?1d8ac6","styles/sidebar.css.map":"styles/sidebar.css.map?078797","styles/sidebar.css":"styles/sidebar.css?09e5b2","styles/ui-playground.css.map":"styles/ui-playground.css.map?c3a709","styles/ui-playground.css":"styles/ui-playground.css?14a8e7","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?90e514","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?32c8a1","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?4107fe","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?f66fa1","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?73e937"};function e(s){s.setAttribute("data-hypothesis-asset","")}function t(s,t){var o=s.createElement("link");o.rel="stylesheet",o.type="text/css",o.href=t,e(o),s.head.appendChild(o)}function o(s,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=o.esModule,n=void 0===r||r,i=o.forceReload,a=void 0!==i&&i,l=s.createElement("script");n&&(l.type="module"),a&&(t+="#ts=".concat(Date.now())),l.src=t,l.async=!1,e(l),s.head.appendChild(l)}function r(s,t,o,r){var n=s.createElement("link");n.rel=t,n.href=r,n.type="application/annotator+".concat(o),e(n),s.head.appendChild(n)}function n(s,t,o){var r=s.createElement("link");r.rel="preload",r.as=t,r.href=o,"fetch"===t&&(r.crossOrigin="anonymous"),e(r),s.head.appendChild(r)}function i(s,e){return s.assetRoot+"build/"+s.manifest[e]}function a(s){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var t=function(){var s,e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).currentScript;return t?(s=t.src,(e=s.match(/(https?):\/\/([^:/]+)/))?{protocol:e[1],hostname:e[2]}:null):null}(e);if(!t)throw new Error("Could not process URL template because script origin is unknown");return s=(s=s.replace("{current_host}",t.hostname)).replace("{current_scheme}",t.protocol)}if(function(){var s=[()=>Object.fromEntries([]),()=>new URL(document.location.href),()=>new Request("https://hypothes.is"),()=>Element.prototype.attachShadow,()=>CSS.supports("display: grid"),()=>(document.evaluate("/html/body",document,null,XPathResult.ANY_TYPE,null),!0)];try{return s.every((s=>s()))}catch(s){return!1}}()){var l=function(s){for(var e={},t=s.querySelectorAll("script.js-hypothesis-config"),o=0;o<t.length;o++){var r=void 0;try{r=JSON.parse(t[o].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),r={}}Object.assign(e,r)}return e}(document),p=a(l.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1593.0/");if(document.querySelector("hypothesis-app")){!function(s,e){n(s,"fetch",e.apiUrl),n(s,"fetch",e.apiUrl+"links");for(var r=0,a=["scripts/sidebar.bundle.js"];r<a.length;r++)o(s,i(e,a[r]),{esModule:!0});for(var l=0,p=["styles/katex.min.css","styles/sidebar.css"];l<p.length;l++)t(s,i(e,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 d=l,h=a(d.notebookAppUrl||"https://hypothes.is/notebook"),u=a(d.profileAppUrl||"https://hypothes.is/user-profile"),y=a(d.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,e){if(!s.querySelector('link[type="application/annotator+html"]')){r(s,"sidebar","html",e.sidebarAppUrl),r(s,"notebook","html",e.notebookAppUrl),r(s,"profile","html",e.profileAppUrl),n(s,"style",i(e,"styles/annotator.css")),r(s,"hypothesis-client","javascript",e.assetRoot+"build/boot.js");for(var a=0,l=["scripts/annotator.bundle.js"];a<l.length;a++)o(s,i(e,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,d=p;c<d.length;c++)t(s,i(e,d[c]))}}(document,{assetRoot:p,manifest:s,notebookAppUrl:h,profileAppUrl:u,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/.")}();
1
+ !function(){"use strict";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?38386c","styles/annotator.css":"styles/annotator.css?427463","styles/annotator.css.map":"styles/annotator.css.map?94a857","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css":"styles/katex.min.css?d92c5a","styles/katex.min.css.map":"styles/katex.min.css.map?e7e03f","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?09e5b2","styles/sidebar.css.map":"styles/sidebar.css.map?078797","styles/ui-playground.css":"styles/ui-playground.css?14a8e7","styles/ui-playground.css.map":"styles/ui-playground.css.map?c3a709","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?90e514","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?74e15e","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?4107fe","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?f66fa1","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?eaeb64"};function e(s){s.setAttribute("data-hypothesis-asset","")}function t(s,t){var o=s.createElement("link");o.rel="stylesheet",o.type="text/css",o.href=t,e(o),s.head.appendChild(o)}function o(s,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=o.esModule,n=void 0===r||r,i=o.forceReload,a=void 0!==i&&i,l=s.createElement("script");n&&(l.type="module"),a&&(t+="#ts=".concat(Date.now())),l.src=t,l.async=!1,e(l),s.head.appendChild(l)}function r(s,t,o,r){var n=s.createElement("link");n.rel=t,n.href=r,n.type="application/annotator+".concat(o),e(n),s.head.appendChild(n)}function n(s,t,o){var r=s.createElement("link");r.rel="preload",r.as=t,r.href=o,"fetch"===t&&(r.crossOrigin="anonymous"),e(r),s.head.appendChild(r)}function i(s,e){return s.assetRoot+"build/"+s.manifest[e]}function a(s){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var t=function(){var s,e,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).currentScript;return t?(s=t.src,(e=s.match(/(https?):\/\/([^:/]+)/))?{protocol:e[1],hostname:e[2]}:null):null}(e);if(!t)throw new Error("Could not process URL template because script origin is unknown");return s=(s=s.replace("{current_host}",t.hostname)).replace("{current_scheme}",t.protocol)}if(function(){var s=[()=>Object.fromEntries([]),()=>new URL(document.location.href),()=>new Request("https://hypothes.is"),()=>Element.prototype.attachShadow,()=>CSS.supports("display: grid"),()=>(document.evaluate("/html/body",document,null,XPathResult.ANY_TYPE,null),!0)];try{return s.every((s=>s()))}catch(s){return!1}}()){var l=function(s){for(var e={},t=s.querySelectorAll("script.js-hypothesis-config"),o=0;o<t.length;o++){var r=void 0;try{r=JSON.parse(t[o].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),r={}}Object.assign(e,r)}return e}(document),p=a(l.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1594.0/");if(document.querySelector("hypothesis-app")){!function(s,e){n(s,"fetch",e.apiUrl),n(s,"fetch",e.apiUrl+"links");for(var r=0,a=["scripts/sidebar.bundle.js"];r<a.length;r++)o(s,i(e,a[r]),{esModule:!0});for(var l=0,p=["styles/katex.min.css","styles/sidebar.css"];l<p.length;l++)t(s,i(e,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 d=l,h=a(d.notebookAppUrl||"https://hypothes.is/notebook"),u=a(d.profileAppUrl||"https://hypothes.is/user-profile"),y=a(d.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,e){if(!s.querySelector('link[type="application/annotator+html"]')){r(s,"sidebar","html",e.sidebarAppUrl),r(s,"notebook","html",e.notebookAppUrl),r(s,"profile","html",e.profileAppUrl),n(s,"style",i(e,"styles/annotator.css")),r(s,"hypothesis-client","javascript",e.assetRoot+"build/boot.js");for(var a=0,l=["scripts/annotator.bundle.js"];a<l.length;a++)o(s,i(e,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,d=p;c<d.length;c++)t(s,i(e,d[c]))}}(document,{assetRoot:p,manifest:s,notebookAppUrl:h,profileAppUrl:u,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/.")}();
@@ -1,5 +1,5 @@
1
1
  {
2
- "scripts/annotator.bundle.js": "scripts/annotator.bundle.js?f6c556",
2
+ "scripts/annotator.bundle.js": "scripts/annotator.bundle.js?38386c",
3
3
  "styles/annotator.css": "styles/annotator.css?427463",
4
4
  "styles/annotator.css.map": "styles/annotator.css.map?94a857",
5
5
  "styles/highlights.css": "styles/highlights.css?6b4ebd",
@@ -8,13 +8,13 @@
8
8
  "styles/katex.min.css.map": "styles/katex.min.css.map?e7e03f",
9
9
  "styles/pdfjs-overrides.css": "styles/pdfjs-overrides.css?c95edf",
10
10
  "styles/pdfjs-overrides.css.map": "styles/pdfjs-overrides.css.map?1d8ac6",
11
- "styles/sidebar.css.map": "styles/sidebar.css.map?078797",
12
11
  "styles/sidebar.css": "styles/sidebar.css?09e5b2",
13
- "styles/ui-playground.css.map": "styles/ui-playground.css.map?c3a709",
12
+ "styles/sidebar.css.map": "styles/sidebar.css.map?078797",
14
13
  "styles/ui-playground.css": "styles/ui-playground.css?14a8e7",
14
+ "styles/ui-playground.css.map": "styles/ui-playground.css.map?c3a709",
15
15
  "scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?90e514",
16
- "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?32c8a1",
16
+ "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?74e15e",
17
17
  "scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?4107fe",
18
18
  "scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?f66fa1",
19
- "scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?73e937"
19
+ "scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?eaeb64"
20
20
  }
@@ -147,7 +147,7 @@ this._sidebarRPC.on("navigateToSegment",(e=>this._integration.navigateToSegment?
147
147
  if(!t.selector||!t.selector.some((e=>"TextQuoteSelector"===e.type)))return{annotation:e,target:t};let n;try{const o=await this._integration.anchor(this.element,t.selector),i=ho.fromRange(o);n={annotation:e,target:t,range:i}}catch{n={annotation:e,target:t}}return n})));if(!this._annotations.has(e.$tag))return[];for(const e of n)t(e);return e.$orphan=n.length>0&&n.every((e=>e.target.selector&&!e.range)),this._updateAnchors(this.anchors.concat(n),!0),this._sidebarRPC.call("syncAnchoringStatus",e),n}detach(e,t=!0){this._annotations.delete(e);const n=[];for(const t of this.anchors)t.annotation.$tag!==e?n.push(t):t.highlights&&So(t.highlights);this._updateAnchors(n,t)}_updateAnchors(e,t){this.anchors=e,this._clusterToolbar?.scheduleClusterUpdates(),t&&this._bucketBarClient.update(this.anchors)}async createAnnotation({highlight:e=!1}={}){const t=this.selectedRanges;this.selectedRanges=[];const n=await this.getDocumentInfo(),o=this.element,i=(await Promise.all(t.map((e=>this._integration.describe(o,e))))).map((e=>({
148
148
  source:n.uri,selector:e}))),r={uri:n.uri,document:n.metadata,target:i,$highlight:e,$cluster:e?"user-highlights":"user-annotations",$tag:"a:"+Zt(8)};return this._sidebarRPC.call("createAnnotation",r),this.anchor(r),Cr(),r}_hoverAnnotations(e){this._hoveredAnnotations.clear(),e.forEach((e=>this._hoveredAnnotations.add(e)));for(const t of this.anchors)if(t.highlights){const n=e.includes(t.annotation.$tag);Eo(t.highlights,n)}this._sidebarRPC.call("hoverAnnotations",e)}_onSelection(e){const t=this._integration.getAnnotatableRange(e);if(!t)return void this._onClearSelection();const n=document.getSelection(),o=_o(n),i=wo(n);i?(this.selectedRanges=[t],this._hostRPC.call("textSelected"),this._adder.annotationsForSelection=yr(),this._isAdderVisible=!0,this._adder.show(i,o)):this._onClearSelection()}_onClearSelection(){this._isAdderVisible=!1,this._adder.hide(),this.selectedRanges=[],this._informHostOnNextSelectionClear&&this._hostRPC.call("textUnselected"),this._informHostOnNextSelectionClear=!0}
149
149
  selectAnnotations(e,{toggle:t=!1,focusInSidebar:n=!1}={}){t?this._sidebarRPC.call("toggleAnnotationSelection",e):this._sidebarRPC.call("showAnnotations",e,n),this._sidebarRPC.call("openSidebar")}setHighlightsVisible(e,t=!0){!function(e,t){e.classList.toggle("hypothesis-highlights-always-on",t)}(this.element,e),this._highlightsVisible=e,t&&this._hostRPC.call("highlightsVisibleChanged",e)}get highlightsVisible(){return this._highlightsVisible}fitSideBySide(e){this._sidebarLayout=e,this._integration.fitSideBySide(e)}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(e){zn(e,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}_setOutsideAssignmentNoticeVisible(e){this._outsideAssignmentNotice||(this._outsideAssignmentNotice=new br(this.element)),this._outsideAssignmentNotice.setVisible(e)}}function Ar(e,t){const n=new URL(e),o=new URLSearchParams;return o.append("config",JSON.stringify(t)),n.hash=o.toString(),n.toString()}function Rr(e,t){const n={}
150
- ;for(const[e,o]of Object.entries(t))"notebookAppUrl"!==e&&"sidebarAppUrl"!==e&&null!=o&&(n[e]=o);n.origin=new URL(e).origin,n.version="1.1593.0";const o=new URL(window.location.href);if(o.hash="",n.hostURL=o.toString(),Array.isArray(n.services)&&n.services?.length>0){const e=n.services[0];e.onLoginRequest&&(e.onLoginRequestProvided=!0),e.onLogoutRequest&&(e.onLogoutRequestProvided=!0),e.onSignupRequest&&(e.onSignupRequestProvided=!0),e.onProfileRequest&&(e.onProfileRequestProvided=!0),e.onHelpRequest&&(e.onHelpRequestProvided=!0)}return n}function kr({closed:e,onClose:t,children:n,"data-testid":o,"aria-label":i}){const r=se(null);return ie((()=>{e?r.current?.close():r.current?.showModal()}),[e]),ie((()=>{const e=r.current;return e?.addEventListener("cancel",t),()=>{e?.removeEventListener("cancel",t)}}),[t]),Te("dialog",{ref:r,className:"relative w-full h-full backdrop:bg-black/50","data-testid":o,"aria-label":i,children:n})}function Pr({closed:e,children:t,...n}){return Te("div",{...n,
150
+ ;for(const[e,o]of Object.entries(t))"notebookAppUrl"!==e&&"sidebarAppUrl"!==e&&null!=o&&(n[e]=o);n.origin=new URL(e).origin,n.version="1.1594.0";const o=new URL(window.location.href);if(o.hash="",n.hostURL=o.toString(),Array.isArray(n.services)&&n.services?.length>0){const e=n.services[0];e.onLoginRequest&&(e.onLoginRequestProvided=!0),e.onLogoutRequest&&(e.onLogoutRequestProvided=!0),e.onSignupRequest&&(e.onSignupRequestProvided=!0),e.onProfileRequest&&(e.onProfileRequestProvided=!0),e.onHelpRequest&&(e.onHelpRequestProvided=!0)}return n}function kr({closed:e,onClose:t,children:n,"data-testid":o,"aria-label":i}){const r=se(null);return ie((()=>{e?r.current?.close():r.current?.showModal()}),[e]),ie((()=>{const e=r.current;return e?.addEventListener("cancel",t),()=>{e?.removeEventListener("cancel",t)}}),[t]),Te("dialog",{ref:r,className:"relative w-full h-full backdrop:bg-black/50","data-testid":o,"aria-label":i,children:n})}function Pr({closed:e,children:t,...n}){return Te("div",{...n,
151
151
  className:ke("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:e}),children:Te("div",{className:"relative w-full h-full",children:t})})}function Tr({document_:e=document,...t}){return Te(ae((()=>function(e){return"function"==typeof e.createElement("dialog").showModal}(e)?kr:Pr),[e]),{...t})}function Mr({config:e,groupId:t}){return Te("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allow:"fullscreen; clipboard-write",src:Ar(e.notebookAppUrl,{...Rr(e.notebookAppUrl,e),group:t})})}function Lr({eventBus:e,config:t}){const[n,o]=oe(0),[i,r]=oe(!0),[s,a]=oe(null),l=se(""),c=se(null);ie((()=>(l.current=document.body.style.overflow,()=>{document.body.style.overflow=l.current})),[]),ie((()=>{document.body.style.overflow=i?l.current:"hidden"}),[i]),ie((()=>{const t=e.createEmitter();return t.subscribe("openNotebook",(e=>{r(!1),o((e=>e+1)),a(e)})),c.current=t,()=>{t.destroy()}}),[e]);const u=le((()=>{r(!0),c.current?.publish("closeNotebook")}),[])
152
152
  ;return null===s?null:Te(Tr,{closed:i,onClose:u,"data-testid":"notebook-outer","aria-label":"Hypothesis notebook",children:[Te("div",{className:"absolute right-0 m-3",children:Te(Ct,{title:"Close notebook",onClick:u,variant:"dark",classes:ke("!bg-transparent enabled:hover:!bg-grey-3"),"data-testid":"close-button",children:Te(Fe,{className:"w-4 h-4"})})}),Te(Mr,{config:t,groupId:s},n)]})}class Or{constructor(e,t,n){this._container=new Zn("notebook",(()=>Te(Lr,{eventBus:t,config:n}))),e.append(this._container.element),this._container.render()}destroy(){this._container.destroy()}}function Ir({eventBus:e,config:t}){const[n,o]=oe(!0),i=se(null);ie((()=>{const t=e.createEmitter();return t.subscribe("openProfile",(()=>{o(!1)})),i.current=t,()=>{t.destroy()}}),[e]);const r=()=>{o(!0),i.current?.publish("closeProfile")};return n?null:Te(Tr,{closed:n,onClose:r,"data-testid":"profile-outer","aria-label":"Hypothesis profile",children:[Te("div",{className:"absolute right-0 m-3",children:Te(Ct,{
153
153
  title:"Close profile dialog",onClick:r,variant:"dark",classes:ke("!bg-transparent enabled:hover:!bg-grey-3"),children:Te(Fe,{className:"w-4 h-4"})})}),Te("iframe",{title:"Hypothesis profile",className:"h-full w-full border-0",src:t.profileAppUrl})]})}class Br{constructor(e,t,n){this._container=new Zn("profile",(()=>Te(Ir,{eventBus:t,config:n}))),e.append(this._container.element),this._container.render()}destroy(){this._container.destroy()}}function Hr({above:e,below:t,buckets:n,onFocusAnnotations:o,onScrollToAnnotation:i,onSelectAnnotations:r}){const s=e.anchors.length>0,a=t.anchors.length>0,l=e=>e.anchors.map((e=>e.tag));return Te("ul",{className:"relative",children:[s&&Te("li",{className:"absolute right-0 pointer-events-auto mt-[-11px]",style:{top:e.position},children:Te(Qt,{"data-testid":"up-navigation-button",direction:"up",onClick:()=>{const t=[...e.anchors].sort(((e,t)=>e.bottom-t.bottom)),n=t[t.length-1];i(n.tag)},onBlur:()=>o([]),onFocus:()=>o(l(e)),onMouseEnter:()=>o(l(e)),onMouseOut:()=>o([]),
@@ -586,7 +586,7 @@ const Yf=/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5
586
586
  return t}function lg(e){return Ti(e)?"orphan":Ci(e)?"note":"annotation"}function cg(e){return Cs([e]).reduce(((e,t)=>t.created>e?t.created:e),"")}function ug(e){return Cs([e]).reduce(((e,t)=>(e||(e=t.created),t.created<e?t.created:e)),"")}const dg={Newest:(e,t)=>{const n=cg(e),r=cg(t);return n>r?-1:n<r?1:0},Oldest:(e,t)=>{const n=ug(e),r=ug(t);return n<r?-1:n>r?1:0},Location:(e,t)=>{if(!e.annotation||!t.annotation)return function(e,t){return e.annotation||t.annotation?e.annotation?1:-1:0}(e,t);const n=zi(e.annotation),r=zi(t.annotation);if(n.cfi&&r.cfi){const e=qf(n.cfi,r.cfi);if(0!==e)return Math.sign(e)}else{if(n.cfi)return-1;if(r.cfi)return 1}const o=n.position??Number.MAX_SAFE_INTEGER,i=r.position??Number.MAX_SAFE_INTEGER;return Math.sign(o-i)}};const hg=function(e){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,
587
587
  selected:t.selected,sortCompareFn:dg[t.sortKey]};if(!!t.filterQuery||Object.keys(t.filters).length>0){const e=function(e,t={}){const n=e=>{const n=t[e];return"string"==typeof n?[n]:[]},r=n("cfi"),o=n("page"),i=n("quote"),a=n("tag"),s=n("text"),l=n("uri"),c=n("user"),u=[],d=[],h=ag(e,ng);for(const e of h){const t=e.slice(0,e.indexOf(":")),n=e.slice(t.length+1);switch(t){case"cfi":r.push(n);break;case"quote":i.push(n);break;case"page":o.push(n);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";d.push(e*n[t])}}break;case"tag":a.push(n);break;case"text":s.push(n);break;case"uri":l.push(n);break;case"user":c.push(n);break;default:u.push(e)}}return{any:{terms:u,operator:"and",filterReplies:!0},cfi:{terms:r,operator:"or",filterReplies:!1},quote:{terms:i,operator:"and",filterReplies:!1},page:{terms:o,operator:"or",filterReplies:!1},since:{terms:d,
588
588
  operator:"and",filterReplies:!0},tag:{terms:a,operator:"and",filterReplies:!0},text:{terms:s,operator:"and",filterReplies:!0},uri:{terms:l,operator:"or",filterReplies:!1},user:{terms:c,operator:"or",filterReplies:!0}}}(t.filterQuery||"",t.filters),r={},o={};for(const[t,n]of Object.entries(e))n.filterReplies?r[t]=n:o[t]=n;n.filterFn=e=>tg([e],r).length>0,Object.values(o).some((e=>e.terms.length>0))&&(n.threadFilterFn=e=>!!e.annotation&&tg([e.annotation],o).length>0)}const r=Bf(e.annotations,n),o={annotation:0,note:0,orphan:0};return e.showTabs&&(r.children=r.children.filter((e=>{if(!e.annotation)return!1;if(Si(e.annotation))return!1;const n=lg(e.annotation);return o[n]+=1,n===t.selectedTab}))),{tabCounts:o,rootThread:r}}));function mg(){const e=bs(),t=e.allAnnotations(),n=e.filterQuery(),r=e.route(),o=e.selectionState(),i=e.getFilterValues(),a="sidebar"===r,s=he((()=>{const e={...o,filterQuery:n,filters:i};return{annotations:t,selection:e,showTabs:a}}),[t,n,o,i,a]);return hg(s)}
589
- var pg,fg,gg=Ro((function({loadAnnotationsService:e,onLogin:t}){const n=bs(),r=n.routeParams().id??"",{rootThread:o}=mg(),i=n.profile().userid,[a,s]=se(!1);return ce((()=>{s(!1),n.clearAnnotations(),e.loadThread(r).then((e=>{const t=e.filter((e=>0===(e.references||[]).length))[0];t&&(e.forEach((e=>e.id&&n.setExpanded(e.id,!0))),t.id!==r&&n.highlightAnnotations([r]))})).catch((()=>{s(!0)}))}),[r,i,e,n]),et(x,{children:[a&&et(ys,{errorType:"annotation",onLoginRequest:t}),et(Mf,{threads:o.children})]})}),["loadAnnotationsService"]);class vg{constructor(e,t,n=window){const r="N/A";let o=r;e.userid&&(o=e.userid,e.displayName&&(o=`${e.displayName} (${o})`)),this.version="1.1593.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||r,this.fingerprint=t[0]?.metadata?.documentFingerprint??r,this.account=o,this.timestamp=(new Date).toString();const i=t[0]?.segment;if(i){const e=[];if(i.cfi&&e.push(["CFI",i.cfi]),i.pages){const t=`${i.pages.start}-${i.pages.end}`;e.push(["Pages",t])}
589
+ var pg,fg,gg=Ro((function({loadAnnotationsService:e,onLogin:t}){const n=bs(),r=n.routeParams().id??"",{rootThread:o}=mg(),i=n.profile().userid,[a,s]=se(!1);return ce((()=>{s(!1),n.clearAnnotations(),e.loadThread(r).then((e=>{const t=e.filter((e=>0===(e.references||[]).length))[0];t&&(e.forEach((e=>e.id&&n.setExpanded(e.id,!0))),t.id!==r&&n.highlightAnnotations([r]))})).catch((()=>{s(!0)}))}),[r,i,e,n]),et(x,{children:[a&&et(ys,{errorType:"annotation",onLoginRequest:t}),et(Mf,{threads:o.children})]})}),["loadAnnotationsService"]);class vg{constructor(e,t,n=window){const r="N/A";let o=r;e.userid&&(o=e.userid,e.displayName&&(o=`${e.displayName} (${o})`)),this.version="1.1594.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||r,this.fingerprint=t[0]?.metadata?.documentFingerprint??r,this.account=o,this.timestamp=(new Date).toString();const i=t[0]?.segment;if(i){const e=[];if(i.cfi&&e.push(["CFI",i.cfi]),i.pages){const t=`${i.pages.start}-${i.pages.end}`;e.push(["Pages",t])}
590
590
  i.url&&e.push(["URL",i.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 bg=function(){if(fg)return pg;fg=1;var e="complete",t="canceled";function n(e,t,n){e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,e.scrollTop=n)}function r(t){var o=t._scrollSettings;if(o){var i=o.maxSynchronousAlignments,a=function(e,t){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,
591
591
  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}}(o,t),s=Date.now()-o.startTime,l=Math.min(1/o.time*s,1);if(o.endIterations>=i)return n(t,a.x,a.y),t._scrollSettings=null,o.end(e);var c=1-o.ease(l);if(n(t,a.x-a.differenceX*c,a.y-a.differenceY*c),s>=o.time)return o.endIterations++,o.scrollAncestor&&r(o.scrollAncestor),void r(t);!function(e){if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTimeout(e,16)}(r.bind(null,t))}}function o(e){return e.self===e}function i(e){
592
592
  return"pageXOffset"in e||(e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth)&&"hidden"!==getComputedStyle(e).overflow}function a(){return!0}function s(e){if(e.assignedSlot)return s(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}}return pg=function(n,l,c){if(n){"function"==typeof l&&(c=l,l=null),l||(l={}),l.time=isNaN(l.time)?1e3:l.time,l.ease=l.ease||function(e){return 1-Math.pow(1-e,e/2)},l.align=l.align||{};var u=s(n),d=1,h=l.validTarget||a,m=l.isScrollable;l.debug&&(console.log("About to scroll to",n),u||console.error("Target did not have a parent, is it mounted in the DOM?"));for(var p=[];u;)if(l.debug&&console.log("Scrolling parent node",u),h(u,d)&&(m?m(u,i):i(u))&&(d++,p.push(u)),!(u=s(u))){f(e);break}return p.reduce(((e,i,a)=>function(e,n,i,a,s){
@@ -674,7 +674,7 @@ null==v._nextState&&null==v.__s&&(v._nextState=v.__s=v.state),v.context=y,h.getD
674
674
  }),et("body",{children:[et("section",{children:[et("h1",{children:"Summary"}),et("p",{children:et("time",{dateTime:o.toISOString(),children:sy(o)})}),et("p",{children:et("strong",{children:a})}),et("p",{children:et("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:i})}),et("table",{children:et("tbody",{style:{verticalAlign:"top"},children:[et("tr",{children:[et("td",{children:"Group:"}),et("td",{children:t})]}),et("tr",{children:[et("td",{children:"Total users:"}),et("td",{children:s.length})]}),et("tr",{children:[et("td",{children:"Users:"}),et("td",{children:s.join(", ")})]}),et("tr",{children:[et("td",{children:"Total annotations:"}),et("td",{children:e.length})]}),et("tr",{children:[et("td",{children:"Total replies:"}),et("td",{children:l.length})]})]})})]}),et("hr",{}),et("section",{children:[et("h1",{children:"Annotations"}),e.map(((e,t)=>{const n=Ri(e),r=Li(e),o=Sp(e.text),i=o===`<p>${e.text}</p>`?e.text:o;return et("article",{children:[et("h2",{children:["Annotation ",t+1,":"]
675
675
  }),et("table",{children:et("tbody",{style:{verticalAlign:"top"},children:[et("tr",{children:[et("td",{children:"Created at:"}),et("td",{children:et("time",{dateTime:e.created,children:sy(new Date(e.created))})})]}),et("tr",{children:[et("td",{children:"Author:"}),et("td",{children:c(e)})]}),n&&et("tr",{children:[et("td",{children:"Page:"}),et("td",{children:n})]}),et("tr",{children:[et("td",{children:"Type:"}),et("td",{children:Ii(e)})]}),r&&et("tr",{children:[et("td",{children:"Quote:"}),et("td",{children:et("blockquote",{style:{margin:0},children:r})})]}),et("tr",{children:[et("td",{children:"Comment:"}),et("td",{dangerouslySetInnerHTML:{__html:i}})]}),e.tags.length>0&&et("tr",{children:[et("td",{children:"Tags:"}),et("td",{children:e.tags.join(", ")})]})]})})]},e.id)}))]})]})]}),{},{pretty:!0}).replace(/\t/g," ")}_exportCommon(e,{displayNamesEnabled:t,defaultAuthority:n}){const[r]=e;if(!r)throw new Error("No annotations to export");const o=e=>Ms(e,n,t),{uri:i,title:a}=gi(r);return{uri:i,title:a,
676
676
  uniqueUsers:[...new Set(e.map((e=>o(e))).filter(Boolean))],replies:e.filter((e=>_i(e))),extractUsername:o}}}ly.$inject=[];class cy extends Error{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 uy(e,t){let n,r;try{n=await fetch(e,t)}catch(t){throw new cy(e,null,t.message)}if(204===n.status)return null;try{r=await n.json()}catch{throw new cy(e,n,"Failed to parse response")}if(!n.ok)throw new cy(e,n,r?.reason);return r}class dy{constructor(e,t,n){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,l)=>{o();try{const[o,i]=await Promise.all([e,n()]),c=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);if(!c)throw new Error(`Missing API route: ${t}`);const u={
677
- "Content-Type":"application/json","Hypothesis-Client-Version":"1.1593.0"};i&&(u.Authorization="Bearer "+i);const d=r();d&&(u["X-Client-Id"]=d);const{url:h,unusedParams:m}=Ua(c.url,a),p=new URL(h);for(const[e,t]of Object.entries(m)){const n=Array.isArray(t)?t:[t];for(const t of n)null!=t&&p.searchParams.append(e,t.toString())}return await uy(p.toString(),{body:s?JSON.stringify(ay(s)):null,headers:u,method:c.method,signal:l})}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")},members:{read:i("group.members.read")},read:i("group.read")},this.groups={list:i("groups.read")},this.profile={groups:{read:i("profile.groups.read")},
677
+ "Content-Type":"application/json","Hypothesis-Client-Version":"1.1594.0"};i&&(u.Authorization="Bearer "+i);const d=r();d&&(u["X-Client-Id"]=d);const{url:h,unusedParams:m}=Ua(c.url,a),p=new URL(h);for(const[e,t]of Object.entries(m)){const n=Array.isArray(t)?t:[t];for(const t of n)null!=t&&p.searchParams.append(e,t.toString())}return await uy(p.toString(),{body:s?JSON.stringify(ay(s)):null,headers:u,method:c.method,signal:l})}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")},members:{read:i("group.members.read")},read:i("group.read")},this.groups={list:i("groups.read")},this.profile={groups:{read:i("profile.groups.read")},
678
678
  read:i("profile.read"),update:i("profile.update")},this.analytics={events:{create:i("analytics.events.create")}}}setClientId(e){this._clientId=e}}dy.$inject=["apiRoutes","auth","store"];var hy,my,py,fy,gy,vy={};function by(){return py||(py=1,e=vy,t=function(){if(my)return hy;function e(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))}return my=1,hy=e,e.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},e.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},e.prototype.retry=function(e){
679
679
  if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=(new Date).getTime();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},e.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)},
680
680
  e.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},e.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},e.prototype.start=e.prototype.try,e.prototype.errors=function(){return this._errors},e.prototype.attempts=function(){return this._attempts},e.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},hy}(),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))
@@ -701,16 +701,16 @@ logo:"data:image/svg+xml;utf8,"+encodeURIComponent('<?xml version="1.0" encoding
701
701
  ;const n=0===this._store.allGroups().length,r=this._store.getDefault("focusedGroup");this._store.loadGroups(e),n&&(t&&e.some((e=>e.id===t))?this.focus(t):r&&e.some((e=>e.id===r))&&this.focus(r))}_fetchGroup(e){return this._api.group.read({id:e,expand:qy})}async _loadGroupsForUserAndDocument(){const e=()=>function(e,t){const n=t(e);return null!==n?Promise.resolve(n):new Promise((n=>{const r=e.subscribe((()=>{const o=t(e);null!==o&&(r(),n(o))}))}))}(this._store,(()=>this._mainURI()));let t=null;"sidebar"===this._store.route()&&(t=await e()),this._setupAutoReload();const n=this._store.directLinkedAnnotationId();let r=null;n&&(r=this._api.annotation.get({id:n}).catch((()=>null)));const o=this._store.directLinkedGroupId();let i=null;o&&(i=this._fetchGroup(o).then((e=>(this._store.clearDirectLinkedGroupFetchFailed(),e))).catch((()=>(this._store.setDirectLinkedGroupFetchFailed(),null))));const a={expand:qy},s=this._serviceConfig?.authority;s&&(a.authority=s),t&&(a.document_uri=t)
702
702
  ;const[l,c,u,d,h]=await Promise.all([this._api.profile.groups.read({expand:qy}),this._api.groups.list(a),this._auth.getAccessToken(),r,i]);h&&!c.some((e=>e.id===h.id))&&c.push(h);let m=null;if(d){m=d.group;const e=l.concat(c).find((e=>e.id===d.group));if(!e)try{const e=await this._fetchGroup(d.group);c.push(e)}catch{this._toastMessenger.error("Unable to fetch group for linked annotation")}}const p=null!==u,f=await this._filterGroups(nb(l,c,t,this._settings),p,m,o),g=m||o||null;return this._addGroupsToStore(f,g),f}async _loadServiceSpecifiedGroups(e){const t=await this._api.profile.groups.read({expand:qy});let n=null;const r=async e=>{try{return await this._fetchGroup(e)}catch(e){return n=e,null}},o=await Promise.all(e.map((e=>t.find((t=>t.id===e||t.groupid===e))||r(e)))),i=o.filter((e=>null!==e)),a=this._store.directLinkedGroupId();return this._addGroupsToStore(i,a),n&&this._toastMessenger.error(`Unable to fetch groups: ${n.message}`,{autoDismiss:!1}),i}async load(){const e=this._serviceConfig?.groups
703
703
  ;if(Array.isArray(e)||(t=e,"function"==typeof t?.then)){let t=[];try{t=await e}catch(e){this._toastMessenger.error(`Unable to fetch group configuration: ${e.message}`)}return this._loadServiceSpecifiedGroups(t)}return this._loadGroupsForUserAndDocument();var t}focus(e){const t=this._store.focusedGroupId();this._store.focusGroup(e);const n=this._store.focusedGroupId();if(t!==n&&null!==t&&n){this._focusedMembersController?.abort();const e=this._store.newAnnotations().filter((e=>!_i(e))).map((e=>({...e,group:n})));e.length&&this._store.addAnnotations(e),this._store.setDefault("focusedGroup",n)}}leave(e){return this._api.group.member.delete({pubid:e,userid:"me"})}async loadFocusedGroupMembers(){const e=this._store.focusedGroupId();if(!e)return;this._focusedMembersController?.abort(),this._focusedMembersController=new AbortController;const{signal:t}=this._focusedMembersController;this._store.startLoadingFocusedGroupMembers();const n=await this._fetchAllMembers(e,t)
704
- ;this._store.loadFocusedGroupMembers(t?.aborted?null:n)}async _fetchAllMembers(e,t){const n=await this._fetchMembers({groupId:e,signal:t}),r=Math.min(Math.ceil(n.meta.page.total/100),10);let o=n.data;for(let n=2;n<=r&&!t?.aborted;n++){const r=await this._fetchMembers({groupId:e,page:n,signal:t});o=o.concat(r.data)}return o}_fetchMembers({groupId:e,page:t=1,signal:n}){return this._api.group.members.read({pubid:e,"page[number]":t,"page[size]":100},void 0,n)}}Uy.$inject=["store","api","auth","settings","toastMessenger"];const Gy="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Vy=globalThis,Wy="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Ky="9.5.0";function Yy(){return Xy(Vy),Vy}function Xy(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Ky,t[Ky]=t[Ky]||{}}function Zy(e,t,n=Vy){const r=n.__SENTRY__=n.__SENTRY__||{},o=r[Ky]=r[Ky]||{};return o[e]||(o[e]=t())}const Jy=["debug","info","warn","error","log","assert","trace"],Qy={};function e_(e){if(!("console"in Vy))return e()
704
+ ;this._store.loadFocusedGroupMembers(t?.aborted?null:n)}async _fetchAllMembers(e,t){const n=await this._fetchMembers({groupId:e,signal:t}),r=Math.min(Math.ceil(n.meta.page.total/100),10);let o=n.data;for(let n=2;n<=r&&!t?.aborted;n++){const r=await this._fetchMembers({groupId:e,page:n,signal:t});o=o.concat(r.data)}return o}_fetchMembers({groupId:e,page:t=1,signal:n}){return this._api.group.members.read({pubid:e,"page[number]":t,"page[size]":100},void 0,n)}}Uy.$inject=["store","api","auth","settings","toastMessenger"];const Gy="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Vy=globalThis,Wy="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Ky="9.8.0";function Yy(){return Xy(Vy),Vy}function Xy(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Ky,t[Ky]=t[Ky]||{}}function Zy(e,t,n=Vy){const r=n.__SENTRY__=n.__SENTRY__||{},o=r[Ky]=r[Ky]||{};return o[e]||(o[e]=t())}const Jy=["debug","info","warn","error","log","assert","trace"],Qy={};function e_(e){if(!("console"in Vy))return e()
705
705
  ;const t=Vy.console,n={},r=Object.keys(Qy);r.forEach((e=>{const r=Qy[e];n[e]=t[e],t[e]=r}));try{return e()}finally{r.forEach((e=>{t[e]=n[e]}))}}const t_=Zy("logger",(function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return Wy?Jy.forEach((n=>{t[n]=(...t)=>{e&&e_((()=>{Vy.console[n](`Sentry Logger [${n}]:`,...t)}))}})):Jy.forEach((e=>{t[e]=()=>{}})),t})),n_=50,r_="?",o_=/\(error: (.*)\)/,i_=/captureMessage|captureException/;function a_(...e){const t=e.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return(e,n=0,r=0)=>{const o=[],i=e.split("\n");for(let e=n;e<i.length;e++){const n=i[e];if(n.length>1024)continue;const a=o_.test(n)?n.replace(o_,"$1"):n;if(!a.match(/\S*Error: /)){for(const e of t){const t=e(a);if(t){o.push(t);break}}if(o.length>=n_+r)break}}return function(e){if(!e.length)return[];const t=Array.from(e);/sentryWrapped/.test(s_(t).function||"")&&t.pop();t.reverse(),i_.test(s_(t).function||"")&&(t.pop(),i_.test(s_(t).function||"")&&t.pop());return t.slice(0,n_).map((e=>({...e,
706
706
  filename:e.filename||s_(t).filename,function:e.function||r_})))}(o.slice(r))}}function s_(e){return e[e.length-1]||{}}const l_="<anonymous>";function c_(e){try{return e&&"function"==typeof e&&e.name||l_}catch(e){return l_}}function u_(e){const t=e.exception;if(t){const e=[];try{return t.values.forEach((t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)})),e}catch(e){return}}}const d_={},h_={};function m_(e,t){d_[e]=d_[e]||[],d_[e].push(t)}function p_(e,t){if(!h_[e]){h_[e]=!0;try{t()}catch(t){Wy&&t_.error(`Error while instrumenting ${e}`,t)}}}function f_(e,t){const n=e&&d_[e];if(n)for(const r of n)try{r(t)}catch(t){Wy&&t_.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${c_(r)}\nError:`,t)}}let g_=null;function v_(){g_=Vy.onerror,Vy.onerror=function(e,t,n,r,o){return f_("error",{column:r,error:o,line:n,msg:e,url:t}),!!g_&&g_.apply(this,arguments)},Vy.onerror.__SENTRY_INSTRUMENTED__=!0}let b_=null;function y_(){b_=Vy.onunhandledrejection,Vy.onunhandledrejection=function(e){
707
707
  return f_("unhandledrejection",e),!b_||b_.apply(this,arguments)},Vy.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const __=Object.prototype.toString;function w_(e){switch(__.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return I_(e,Error)}}function x_(e,t){return __.call(e)===`[object ${t}]`}function k_(e){return x_(e,"ErrorEvent")}function N_(e){return x_(e,"DOMError")}function S_(e){return x_(e,"String")}function A_(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function E_(e){return null===e||A_(e)||"object"!=typeof e&&"function"!=typeof e}function T_(e){return x_(e,"Object")}function C_(e){return"undefined"!=typeof Event&&I_(e,Event)}function M_(e){return Boolean(e?.then&&"function"==typeof e.then)}function I_(e,t){try{return e instanceof t}catch(e){return!1}}function z_(e){return!("object"!=typeof e||null===e||!e.__isVue&&!e._isVue)}const L_=Vy,O_=80
708
708
  ;function R_(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,o=[];let i=0,a=0;const s=" > ",l=s.length;let c;const u=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||O_;for(;n&&i++<r&&(c=P_(n,u),!("html"===c||i>1&&a+o.length*l+c.length>=d));)o.push(c),a+=c.length,n=n.parentNode;return o.reverse().join(s)}catch(e){return"<unknown>"}}function P_(e,t){const n=e,r=[];if(!n?.tagName)return"";if(L_.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const o=t?.length?t.filter((e=>n.getAttribute(e))).map((e=>[e,n.getAttribute(e)])):null;if(o?.length)o.forEach((e=>{r.push(`[${e[0]}="${e[1]}"]`)}));else{n.id&&r.push(`#${n.id}`);const e=n.className;if(e&&S_(e)){const t=e.split(/\s+/);for(const e of t)r.push(`.${e}`)}}const i=["aria-label","type","name","title","alt"];for(const e of i){const t=n.getAttribute(e);t&&r.push(`[${e}="${t}"]`)}
709
- return r.join("")}function D_(){try{return L_.document.location.href}catch(e){return""}}function F_(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function H_(e,t){if(!Array.isArray(e))return"";const n=[];for(let t=0;t<e.length;t++){const r=e[t];try{z_(r)?n.push("[VueViewModel]"):n.push(String(r))}catch(e){n.push("[value cannot be serialized]")}}return n.join(t)}function B_(e,t,n=!1){return!!S_(e)&&(x_(t,"RegExp")?t.test(e):!!S_(t)&&(n?e===t:e.includes(t)))}function $_(e,t=[],n=!1){return t.some((t=>B_(e,t,n)))}function j_(e,t,n){if(!(t in e))return;const r=e[t],o=n(r);"function"==typeof o&&U_(o,r);try{e[t]=o}catch{Wy&&t_.log(`Failed to replace method "${t}" in object`,e)}}function q_(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch(n){Wy&&t_.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function U_(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,q_(e,"__sentry_original__",t)}catch(e){}}function G_(e){
710
- return e.__sentry_original__}function V_(e){if(w_(e))return{message:e.message,name:e.name,stack:e.stack,...K_(e)};if(C_(e)){const t={type:e.type,target:W_(e.target),currentTarget:W_(e.currentTarget),...K_(e)};return"undefined"!=typeof CustomEvent&&I_(e,CustomEvent)&&(t.detail=e.detail),t}return e}function W_(e){try{return t=e,"undefined"!=typeof Element&&I_(t,Element)?R_(e):Object.prototype.toString.call(e)}catch(e){return"<unknown>"}var t}function K_(e){if("object"==typeof e&&null!==e){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function Y_(e){return X_(e,new Map)}function X_(e,t){if(function(e){if(!T_(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||"Object"===t}catch{return!0}}(e)){const n=t.get(e);if(void 0!==n)return n;const r={};t.set(e,r);for(const n of Object.getOwnPropertyNames(e))void 0!==e[n]&&(r[n]=X_(e[n],t));return r}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n;const r=[];return t.set(e,r),
711
- e.forEach((e=>{r.push(X_(e,t))})),r}return e}const Z_=1e3;function J_(){return Date.now()/Z_}const Q_=function(){const{performance:e}=Vy;if(!e?.now)return J_;const t=Date.now()-e.now(),n=null==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/Z_}();function ew(e=function(){const e=Vy;return e.crypto||e.msCrypto}()){let t=()=>16*Math.random();try{if(e?.randomUUID)return e.randomUUID().replace(/-/g,"");e?.getRandomValues&&(t=()=>{const t=new Uint8Array(1);return e.getRandomValues(t),t[0]})}catch(e){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(e=>(e^(15&t())>>e/4).toString(16)))}function tw(e){return e.exception?.values?.[0]}function nw(e){const{message:t,event_id:n}=e;if(t)return t;const r=tw(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function rw(e,t,n){const r=e.exception=e.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=t||""),i.type||(i.type="Error")}function ow(e,t){const n=tw(e);if(!n)return;const r=n.mechanism
712
- ;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r?.data,...t.data};n.mechanism.data=e}}function iw(e){if(function(e){try{return e.__sentry_captured__}catch{}}(e))return!0;try{q_(e,"__sentry_captured__",!0)}catch(e){}return!1}var aw;function sw(e){return new cw((t=>{t(e)}))}function lw(e){return new cw(((t,n)=>{n(e)}))}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(aw||(aw={}));class cw{constructor(e){this._state=aw.PENDING,this._handlers=[],this._runExecutor(e)}then(e,t){return new cw(((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new cw(((t,n)=>{let r,o;return this.then((t=>{o=!1,r=t,e&&e()}),(t=>{o=!0,r=t,e&&e()})).then((()=>{o?n(r):t(r)}))}))}_executeHandlers(){if(this._state===aw.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach((e=>{
713
- e[0]||(this._state===aw.RESOLVED&&e[1](this._value),this._state===aw.REJECTED&&e[2](this._value),e[0]=!0)}))}_runExecutor(e){const t=(e,t)=>{this._state===aw.PENDING&&(M_(t)?t.then(n,r):(this._state=e,this._value=t,this._executeHandlers()))},n=e=>{t(aw.RESOLVED,e)},r=e=>{t(aw.REJECTED,e)};try{e(n,r)}catch(e){r(e)}}}function uw(e){const t=Q_(),n={sid:ew(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return Y_({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&dw(n,e),n}function dw(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),
709
+ return r.join("")}function D_(){try{return L_.document.location.href}catch(e){return""}}function F_(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function H_(e,t){if(!Array.isArray(e))return"";const n=[];for(let t=0;t<e.length;t++){const r=e[t];try{z_(r)?n.push("[VueViewModel]"):n.push(String(r))}catch(e){n.push("[value cannot be serialized]")}}return n.join(t)}function B_(e,t,n=!1){return!!S_(e)&&(x_(t,"RegExp")?t.test(e):!!S_(t)&&(n?e===t:e.includes(t)))}function $_(e,t=[],n=!1){return t.some((t=>B_(e,t,n)))}function j_(e,t,n){if(!(t in e))return;const r=e[t];if("function"!=typeof r)return;const o=n(r);"function"==typeof o&&U_(o,r);try{e[t]=o}catch{Wy&&t_.log(`Failed to replace method "${t}" in object`,e)}}function q_(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch(n){Wy&&t_.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function U_(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,q_(e,"__sentry_original__",t)
710
+ }catch(e){}}function G_(e){return e.__sentry_original__}function V_(e){if(w_(e))return{message:e.message,name:e.name,stack:e.stack,...K_(e)};if(C_(e)){const t={type:e.type,target:W_(e.target),currentTarget:W_(e.currentTarget),...K_(e)};return"undefined"!=typeof CustomEvent&&I_(e,CustomEvent)&&(t.detail=e.detail),t}return e}function W_(e){try{return t=e,"undefined"!=typeof Element&&I_(t,Element)?R_(e):Object.prototype.toString.call(e)}catch(e){return"<unknown>"}var t}function K_(e){if("object"==typeof e&&null!==e){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function Y_(e){return X_(e,new Map)}function X_(e,t){if(function(e){if(!T_(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||"Object"===t}catch{return!0}}(e)){const n=t.get(e);if(void 0!==n)return n;const r={};t.set(e,r);for(const n of Object.getOwnPropertyNames(e))void 0!==e[n]&&(r[n]=X_(e[n],t));return r}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n
711
+ ;const r=[];return t.set(e,r),e.forEach((e=>{r.push(X_(e,t))})),r}return e}const Z_=1e3;function J_(){return Date.now()/Z_}const Q_=function(){const{performance:e}=Vy;if(!e?.now)return J_;const t=Date.now()-e.now(),n=null==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/Z_}();function ew(e=function(){const e=Vy;return e.crypto||e.msCrypto}()){let t=()=>16*Math.random();try{if(e?.randomUUID)return e.randomUUID().replace(/-/g,"");e?.getRandomValues&&(t=()=>{const t=new Uint8Array(1);return e.getRandomValues(t),t[0]})}catch(e){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(e=>(e^(15&t())>>e/4).toString(16)))}function tw(e){return e.exception?.values?.[0]}function nw(e){const{message:t,event_id:n}=e;if(t)return t;const r=tw(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function rw(e,t,n){const r=e.exception=e.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=t||""),i.type||(i.type="Error")}function ow(e,t){const n=tw(e);if(!n)return
712
+ ;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r?.data,...t.data};n.mechanism.data=e}}function iw(e){if(function(e){try{return e.__sentry_captured__}catch{}}(e))return!0;try{q_(e,"__sentry_captured__",!0)}catch(e){}return!1}var aw;function sw(e){return new cw((t=>{t(e)}))}function lw(e){return new cw(((t,n)=>{n(e)}))}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(aw||(aw={}));class cw{constructor(e){this._state=aw.PENDING,this._handlers=[],this._runExecutor(e)}then(e,t){return new cw(((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new cw(((t,n)=>{let r,o;return this.then((t=>{o=!1,r=t,e&&e()}),(t=>{o=!0,r=t,e&&e()})).then((()=>{o?n(r):t(r)}))}))}_executeHandlers(){if(this._state===aw.PENDING)return;const e=this._handlers.slice();this._handlers=[],
713
+ e.forEach((e=>{e[0]||(this._state===aw.RESOLVED&&e[1](this._value),this._state===aw.REJECTED&&e[2](this._value),e[0]=!0)}))}_runExecutor(e){const t=(e,t)=>{this._state===aw.PENDING&&(M_(t)?t.then(n,r):(this._state=e,this._value=t,this._executeHandlers()))},n=e=>{t(aw.RESOLVED,e)},r=e=>{t(aw.REJECTED,e)};try{e(n,r)}catch(e){r(e)}}}function uw(e){const t=Q_(),n={sid:ew(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return Y_({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&dw(n,e),n}function dw(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),
714
714
  e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Q_(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:ew()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function hw(){return ew()}function mw(){return ew().substring(16)}function pw(e,t,n=2){if(!t||"object"!=typeof t||n<=0)return t;if(e&&0===Object.keys(t).length)return e;const r={...e}
715
715
  ;for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=pw(r[e],t[e],n-1));return r}const fw="_sentrySpan";function gw(e,t){t?q_(e,fw,t):delete e[fw]}function vw(e){return e[fw]}class bw{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:hw(),sampleRand:Math.random()}}clone(){const e=new bw;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},
716
716
  e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,gw(e,vw(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&dw(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){
@@ -747,50 +747,50 @@ _flushOutcomes(){Gy&&t_.log("Flushing outcomes...");const e=this._clearOutcomes(
747
747
  ;return-1===t.indexOf(o)&&t.push(o),o.then((()=>n(o))).then(null,(()=>n(o).then(null,(()=>{})))),o},drain:function(e){return new cw(((n,r)=>{let o=t.length;if(!o)return n(!0);const i=setTimeout((()=>{e&&e>0&&n(!1)}),e);t.forEach((e=>{sw(e).then((()=>{--o||(clearTimeout(i),n(!0))}),r)}))}))}}}const ek=6e4;function tk(e,{statusCode:t,headers:n},r=Date.now()){const o={...e},i=n?.["x-sentry-rate-limits"],a=n?.["retry-after"];if(i)for(const e of i.trim().split(",")){const[t,n,,,i]=e.split(":",5),a=parseInt(t,10),s=1e3*(isNaN(a)?60:a);if(n)for(const e of n.split(";"))"metric_bucket"===e&&i&&!i.split(";").includes("custom")||(o[e]=r+s);else o.all=r+s}else a?o.all=r+function(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?ek:r-t}(a,r):429===t&&(o.all=r+6e4);return o}const nk=64;function rk(e,t,n=Qx(e.bufferSize||nk)){let r={};return{send:function(o){const i=[];if(px(o,((t,n)=>{const o=yx(n);!function(e,t,n=Date.now()){return function(e,t){
748
748
  return e[t]||e.all||0}(e,t)>n}(r,o)?i.push(t):e.recordDroppedEvent("ratelimit_backoff",o)})),0===i.length)return sw({});const a=hx(o[0],i),s=t=>{px(a,((n,r)=>{e.recordDroppedEvent(t,yx(r))}))};return n.add((()=>t({body:gx(a)}).then((e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&Gy&&t_.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=tk(r,e),e)),(e=>{throw s("network_error"),e})))).then((e=>e),(e=>{if(e instanceof Gx)return Gy&&t_.error("Skipped sending event because buffer is full."),s("queue_overflow"),sw({});throw e}))},flush:e=>n.drain(e)}}function ok(e){void 0===e.user?.ip_address&&(e.user={...e.user,ip_address:"{{auto}}"})}function ik(e){"aggregates"in e?void 0===e.attrs?.ip_address&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):void 0===e.ipAddress&&(e.ipAddress="{{auto}}")}const ak=100;function sk(e,t){const n=Ew(),r=Aw();if(!n)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:i=ak}=n.getOptions();if(i<=0)return;const a={timestamp:J_(),...e
749
749
  },s=o?e_((()=>o(a,t))):a;null!==s&&(n.emit&&n.emit("beforeAddBreadcrumb",s,t),r.addBreadcrumb(s,i))}let lk;const ck=new WeakMap,uk=()=>({name:"FunctionToString",setupOnce(){lk=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=G_(this),n=ck.has(Ew())&&void 0!==t?t:this;return lk.apply(n,e)}}catch{}},setup(e){ck.set(e,!0)}
750
- }),dk=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,'can\'t redefine non-configurable property "solana"',"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],hk=(e={})=>({name:"EventFilters",processEvent(t,n,r){const o=r.getOptions(),i=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:dk],
751
- ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(e,o);return function(e,t){if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(e))return Gy&&t_.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${nw(e)}`),!0;if(function(e,t){if(e.type||!t||!t.length)return!1;return Vx(e).some((e=>$_(e,t)))}(e,t.ignoreErrors))return Gy&&t_.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${nw(e)}`),!0;if(function(e){if(e.type)return!1;if(!e.exception?.values?.length)return!1;return!e.message&&!e.exception.values.some((e=>e.stacktrace||e.type&&"Error"!==e.type||e.value))}(e))return Gy&&t_.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${nw(e)}`),!0;if(function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const n=e.transaction;return!!n&&$_(n,t)
752
- }(e,t.ignoreTransactions))return Gy&&t_.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${nw(e)}`),!0;if(function(e,t){if(!t?.length)return!1;const n=pk(e);return!!n&&$_(n,t)}(e,t.denyUrls))return Gy&&t_.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${nw(e)}.\nUrl: ${pk(e)}`),!0;if(!function(e,t){if(!t?.length)return!0;const n=pk(e);return!n||$_(n,t)}(e,t.allowUrls))return Gy&&t_.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${nw(e)}.\nUrl: ${pk(e)}`),!0;return!1}(t,i)?null:t}}),mk=(e={})=>({...hk(e),name:"InboundFilters"});function pk(e){try{const t=[...e.exception?.values??[]].reverse().find((e=>void 0===e.mechanism?.parent_id&&e.stacktrace?.frames?.length)),n=t?.stacktrace?.frames;return n?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(n):null}catch(t){
753
- return Gy&&t_.error(`Cannot extract url for event ${nw(e)}`),null}}function fk(e,t,n=250,r,o,i,a){if(!i.exception?.values||!a||!I_(a.originalException,Error))return;const s=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;var l,c;s&&(i.exception.values=(l=gk(e,t,o,a.originalException,r,i.exception.values,s,0),c=n,l.map((e=>(e.value&&(e.value=F_(e.value,c)),e)))))}function gk(e,t,n,r,o,i,a,s){if(i.length>=n+1)return i;let l=[...i];if(I_(r[o],Error)){vk(a,s);const i=e(t,r[o]),c=l.length;bk(i,o,c,s),l=gk(e,t,n,r[o],o,[i,...l],i,c)}return Array.isArray(r.errors)&&r.errors.forEach(((r,i)=>{if(I_(r,Error)){vk(a,s);const c=e(t,r),u=l.length;bk(c,`errors[${i}]`,u,s),l=gk(e,t,n,r,o,[c,...l],c,u)}})),l}function vk(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,..."AggregateError"===e.type&&{is_exception_group:!0},exception_id:t}}function bk(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",
754
- source:t,exception_id:n,parent_id:r}}function yk(){"console"in Vy&&Jy.forEach((function(e){e in Vy.console&&j_(Vy.console,e,(function(t){return Qy[e]=t,function(...t){f_("console",{args:t,level:e});const n=Qy[e];n?.apply(Vy.console,t)}}))}))}function _k(e){return"warn"===e?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const wk=()=>{let e;return{name:"Dedupe",processEvent(t){if(t.type)return t;try{if(function(e,t){if(!t)return!1;if(function(e,t){const n=e.message,r=t.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!kk(e,t))return!1;if(!xk(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){const n=Nk(t),r=Nk(e);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!kk(e,t))return!1;if(!xk(e,t))return!1;return!0}(e,t))return!0;return!1}(t,e))return Gy&&t_.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(e){}return e=t}}};function xk(e,t){let n=u_(e),r=u_(t);if(!n&&!r)return!0
755
- ;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let e=0;e<r.length;e++){const t=r[e],o=n[e];if(t.filename!==o.filename||t.lineno!==o.lineno||t.colno!==o.colno||t.function!==o.function)return!1}return!0}function kk(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch(e){return!1}}function Nk(e){return e.exception?.values&&e.exception.values[0]}function Sk(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function Ak(e){return void 0===e?void 0:e>=400&&e<500?"warning":e>=500?"error":void 0}const Ek=Vy;function Tk(){if(!("fetch"in Ek))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(e){return!1}}function Ck(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Mk(e,t){
756
- const n="fetch";m_(n,e),p_(n,(()=>function(e,t=!1){if(t&&!function(){if("string"==typeof EdgeRuntime)return!0;if(!Tk())return!1;if(Ck(Ek.fetch))return!0;let e=!1;const t=Ek.document;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=Ck(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){Wy&&t_.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e}())return;j_(Vy,"fetch",(function(e){return function(...t){const n=new Error,{method:r,url:o}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:zk(t),method:Ik(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:zk(t),method:Ik(t,"method")?String(t.method).toUpperCase():"GET"}}(t),i={args:t,fetchData:{method:r,url:o},startTimestamp:1e3*Q_(),virtualError:n};return f_("fetch",{...i}),e.apply(Vy,t).then((async e=>(f_("fetch",{...i,endTimestamp:1e3*Q_(),response:e}),
757
- e)),(e=>{throw f_("fetch",{...i,endTimestamp:1e3*Q_(),error:e}),w_(e)&&void 0===e.stack&&(e.stack=n.stack,q_(e,"framesToPop",1)),e}))}}))}(0,t)))}function Ik(e,t){return!!e&&"object"==typeof e&&!!e[t]}function zk(e){return"string"==typeof e?e:e?Ik(e,"url")?e.url:e.toString?e.toString():"":""}const Lk=Vy;let Ok=0;function Rk(){return Ok>0}function Pk(e,t={}){if(!function(e){return"function"==typeof e}(e))return e;try{const t=e.__sentry_wrapped__;if(t)return"function"==typeof t?t:e;if(G_(e))return e}catch(t){return e}const n=function(...n){try{const r=n.map((e=>Pk(e,t)));return e.apply(this,r)}catch(e){throw Ok++,setTimeout((()=>{Ok--})),function(...e){const t=Nw(Yy());if(2===e.length){const[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}t.withScope(e[0])}((r=>{r.addEventProcessor((e=>(t.mechanism&&(rw(e,void 0),ow(e,t.mechanism)),e.extra={...e.extra,arguments:n},e))),zx(e)})),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch{}U_(n,e),q_(e,"__sentry_wrapped__",n);try{
758
- Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}function Dk(e,t){const n=Bk(e,t),r={type:qk(t),value:Uk(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Fk(e,t,n,r){const o=Ew(),i=o?.getOptions().normalizeDepth,a=function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}return}(t),s={__serialized__:ux(t,i)};if(a)return{exception:{values:[Dk(e,a)]},extra:s};const l={exception:{values:[{type:C_(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Wk(t,{isUnhandledRejection:r})}]},extra:s};if(n){const t=Bk(e,n);t.length&&(l.exception.values[0].stacktrace={frames:t})}return l}function Hk(e,t){return{exception:{values:[Dk(e,t)]}}}function Bk(e,t){const n=t.stacktrace||t.stack||"",r=function(e){if(e&&$k.test(e.message))return 1;return 0}(t),o=function(e){
759
- if("number"==typeof e.framesToPop)return e.framesToPop;return 0}(t);try{return e(n,r,o)}catch(e){}return[]}const $k=/Minified React error #\d+;/i;function jk(e){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&e instanceof WebAssembly.Exception}function qk(e){const t=e?.name;if(!t&&jk(e)){return e.message&&Array.isArray(e.message)&&2==e.message.length?e.message[0]:"WebAssembly.Exception"}return t}function Uk(e){const t=e?.message;return jk(e)?Array.isArray(e.message)&&2==e.message.length?e.message[1]:"wasm exception":t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function Gk(e,t,n,r,o){let i;if(k_(t)&&t.error){return Hk(e,t.error)}if(N_(t)||x_(t,"DOMException")){const o=t;if("stack"in t)i=Hk(e,t);else{const t=o.name||(N_(o)?"DOMError":"DOMException"),a=o.message?`${t}: ${o.message}`:t;i=Vk(e,a,n,r),rw(i,a)}return"code"in o&&(i.tags={...i.tags,"DOMException.code":`${o.code}`}),i}if(w_(t))return Hk(e,t);if(T_(t)||C_(t)){return i=Fk(e,t,n,o),ow(i,{
760
- synthetic:!0}),i}return i=Vk(e,t,n,r),rw(i,`${t}`),ow(i,{synthetic:!0}),i}function Vk(e,t,n,r){const o={};if(r&&n){const r=Bk(e,n);r.length&&(o.exception={values:[{value:t,stacktrace:{frames:r}}]}),ow(o,{synthetic:!0})}if(A_(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return o.logentry={message:e,params:n},o}return o.message=t,o}function Wk(e,{isUnhandledRejection:t}){const n=function(e,t=40){const n=Object.keys(V_(e));n.sort();const r=n[0];if(!r)return"[object has no keys]";if(r.length>=t)return F_(r,t);for(let e=n.length;e>0;e--){const r=n.slice(0,e).join(", ");if(!(r.length>t))return e===n.length?r:F_(r,t)}return""}(e),r=t?"promise rejection":"exception";if(k_(e))return`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``;if(C_(e)){return`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){}}(e)}\` (type=${e.type}) captured as ${r}`}return`Object captured as ${r} with keys: ${n}`}class Kk extends Yx{
761
- constructor(e){const t={parentSpanIsAlwaysRootSpan:!0,...e};!function(e,t,n=[t],r="npm"){const o=e._metadata||{};o.sdk||(o.sdk={name:`sentry.javascript.${t}`,packages:n.map((e=>({name:`${r}:@sentry/${e}`,version:Ky}))),version:Ky}),e._metadata=o}(t,"browser",["browser"],Lk.SENTRY_SDK_SOURCE||"npm"),super(t),t.sendClientReports&&Lk.document&&Lk.document.addEventListener("visibilitychange",(()=>{"hidden"===Lk.document.visibilityState&&this._flushOutcomes()})),this._options.sendDefaultPii&&(this.on("postprocessEvent",ok),this.on("beforeSendSession",ik))}eventFromException(e,t){return function(e,t,n,r){const o=Gk(e,t,n?.syntheticException||void 0,r);return ow(o),o.level="error",n?.event_id&&(o.event_id=n.event_id),sw(o)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,o){const i=Vk(e,t,r?.syntheticException||void 0,o);return i.level=n,r?.event_id&&(i.event_id=r.event_id),sw(i)
762
- }(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n,r)}}const Yk="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Xk=Vy,Zk=1e3;let Jk,Qk,eN,tN;function nN(){if(!Xk.document)return;const e=f_.bind(null,"dom"),t=rN(e,!0);Xk.document.addEventListener("click",t,!1),Xk.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((t=>{const n=Xk,r=n[t]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(j_(r,"addEventListener",(function(t){return function(n,r,o){if("click"===n||"keypress"==n)try{const r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},i=r[n]=r[n]||{refCount:0};if(!i.handler){const r=rN(e);i.handler=r,t.call(this,n,r,o)}i.refCount++}catch(e){}return t.call(this,n,r,o)}})),j_(r,"removeEventListener",(function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this.__sentry_instrumentation_handlers__||{},o=n[t]
763
- ;o&&(o.refCount--,o.refCount<=0&&(e.call(this,t,o.handler,r),o.handler=void 0,delete n[t]),0===Object.keys(n).length&&delete this.__sentry_instrumentation_handlers__)}catch(e){}return e.call(this,t,n,r)}})))}))}function rN(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(e){try{return e.target}catch(e){return null}}(n);if(function(e,t){return"keypress"===e&&(!t?.tagName||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable)}(n.type,r))return;q_(n,"_sentryCaptured",!0),r&&!r._sentryId&&q_(r,"_sentryId",ew());const o="keypress"===n.type?"input":n.type;if(!function(e){if(e.type!==Qk)return!1;try{if(!e.target||e.target._sentryId!==eN)return!1}catch(e){}return!0}(n)){e({event:n,name:o,global:t}),Qk=n.type,eN=r?r._sentryId:void 0}clearTimeout(Jk),Jk=Xk.setTimeout((()=>{eN=void 0,Qk=void 0}),Zk)}}function oN(e){const t="history";m_(t,e),p_(t,iN)}function iN(){function e(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const r=tN,o=String(n);if(tN=o,
764
- r===o)return e.apply(this,t);f_("history",{from:r,to:o})}return e.apply(this,t)}}Xk.addEventListener("popstate",(()=>{const e=Xk.location.href,t=tN;if(tN=e,t===e)return;f_("history",{from:t,to:e})})),"history"in Ek&&(j_(Xk.history,"pushState",e),j_(Xk.history,"replaceState",e))}const aN={};function sN(e){aN[e]=void 0}const lN="__sentry_xhr_v3__";function cN(){if(!Xk.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){const r=new Error,o=1e3*Q_(),i=S_(n[0])?n[0].toUpperCase():void 0,a=function(e){if(S_(e))return e;try{return e.toString()}catch{}return}(n[1]);if(!i||!a)return e.apply(t,n);t[lN]={method:i,url:a,request_headers:{}},"POST"===i&&a.match(/sentry_key/)&&(t.__sentry_own_request__=!0);const s=()=>{const e=t[lN];if(e&&4===t.readyState){try{e.status_code=t.status}catch(e){}f_("xhr",{endTimestamp:1e3*Q_(),startTimestamp:o,xhr:t,virtualError:r})}}
765
- ;return"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(e,t,n)=>(s(),e.apply(t,n))}):t.addEventListener("readystatechange",s),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){const[r,o]=n,i=t[lN];return i&&S_(r)&&S_(o)&&(i.request_headers[r.toLowerCase()]=o),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){const r=t[lN];if(!r)return e.apply(t,n);void 0!==n[0]&&(r.body=n[0]);return f_("xhr",{startTimestamp:1e3*Q_(),xhr:t}),e.apply(t,n)}})}function uN(e,t=function(e){const t=aN[e];if(t)return t;let n=Xk[e];if(Ck(n))return aN[e]=n.bind(Xk);const r=Xk.document;if(r&&"function"==typeof r.createElement)try{const t=r.createElement("iframe");t.hidden=!0,r.head.appendChild(t);const o=t.contentWindow;o?.[e]&&(n=o[e]),r.head.removeChild(t)}catch(t){Yk&&t_.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n?aN[e]=n.bind(Xk):n}("fetch")){let n=0,r=0
766
- ;return rk(e,(function(o){const i=o.body.length;n+=i,r++;const a={body:o.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};if(!t)return sN("fetch"),lw("No fetch implementation available");try{return t(e.url,a).then((e=>(n-=i,r--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}})))}catch(e){return sN("fetch"),n-=i,r--,lw(e)}}))}function dN(e,t,n,r){const o={filename:e,function:"<anonymous>"===t?r_:t,in_app:!0};return void 0!==n&&(o.lineno=n),void 0!==r&&(o.colno=r),o}const hN=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,mN=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,pN=/\((\S*)(?::(\d+))(?::(\d+))\)/,fN=[30,e=>{const t=hN.exec(e);if(t){const[,e,n,r]=t;return dN(e,r_,+n,+r)}const n=mN.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){const e=pN.exec(n[2]);e&&(n[2]=e[1],
767
- n[3]=e[2],n[4]=e[3])}const[e,t]=_N(n[1]||r_,n[2]);return dN(t,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],gN=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,vN=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,bN=[50,e=>{const t=gN.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=vN.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||r_;return[n,e]=_N(n,e),dN(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],yN=a_(...[fN,bN]),_N=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:r_,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},wN="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,xN=1024,kN=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:"Breadcrumbs",setup(e){var n;t.console&&function(e){const t="console";m_(t,e),p_(t,yk)}(function(e){
768
- return function(t){if(Ew()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:_k(t.level),message:H_(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${H_(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}sk(n,{input:t.args,level:t.level})}}(e)),t.dom&&(n=function(e,t){return function(n){if(Ew()!==e)return;let r,o,i="object"==typeof t?t.serializeAttribute:void 0,a="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;a&&a>xN&&(wN&&t_.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${a} was configured. Sentry will use 1024 instead.`),a=xN),"string"==typeof i&&(i=[i]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;r=R_(t,{keyAttrs:i,maxStringLength:a}),o=function(e){if(!L_.HTMLElement)return null;let t=e;for(let e=0;e<5;e++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent
769
- ;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}(t)}catch(e){r="<unknown>"}if(0===r.length)return;const s={category:`ui.${n.name}`,message:r};o&&(s.data={"ui.component_name":o}),sk(s,{event:n.event,name:n.name,global:n.global})}}(e,t.dom),m_("dom",n),p_("dom",nN)),t.xhr&&function(e){m_("xhr",e),p_("xhr",cN)}(function(e){return function(t){if(Ew()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,o=t.xhr[lN];if(!n||!r||!o)return;const{method:i,url:a,status_code:s,body:l}=o,c={method:i,url:a,status_code:s},u={xhr:t.xhr,input:l,startTimestamp:n,endTimestamp:r},d={category:"xhr",data:c,type:"http",level:Ak(s)};e.emit("beforeOutgoingRequestBreadcrumb",d,u),sk(d,u)}}(e)),t.fetch&&Mk(function(e){return function(t){if(Ew()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.fetchData.method,t.fetchData.url,t.error){const o=t.fetchData,i={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},a={
770
- category:"fetch",data:o,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",a,i),sk(a,i)}else{const o=t.response,i={...t.fetchData,status_code:o?.status};t.fetchData.request_body_size,t.fetchData.response_body_size,o?.status;const a={input:t.args,response:o,startTimestamp:n,endTimestamp:r},s={category:"fetch",data:i,type:"http",level:Ak(i.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",s,a),sk(s,a)}}}(e)),t.history&&oN(function(e){return function(t){if(Ew()!==e)return;let n=t.from,r=t.to;const o=Sk(Lk.location.href);let i=n?Sk(n):void 0;const a=Sk(r);i?.path||(i=o),o.protocol===a.protocol&&o.host===a.host&&(r=a.relative),o.protocol===i.protocol&&o.host===i.host&&(n=i.relative),sk({category:"navigation",data:{from:n,to:r}})}}(e)),t.sentry&&e.on("beforeSendEvent",function(e){return function(t){Ew()===e&&sk({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:nw(t)},{event:t})}}(e))}}}
771
- ;const NN=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],SN=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:"BrowserApiErrors",setupOnce(){t.setTimeout&&j_(Lk,"setTimeout",AN),t.setInterval&&j_(Lk,"setInterval",AN),t.requestAnimationFrame&&j_(Lk,"requestAnimationFrame",EN),t.XMLHttpRequest&&"XMLHttpRequest"in Lk&&j_(XMLHttpRequest.prototype,"send",TN);const e=t.eventTarget;if(e){(Array.isArray(e)?e:NN).forEach(CN)}}}};function AN(e){return function(...t){const n=t[0];return t[0]=Pk(n,{mechanism:{data:{
772
- function:c_(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function EN(e){return function(t){return e.apply(this,[Pk(t,{mechanism:{data:{function:"requestAnimationFrame",handler:c_(e)},handled:!1,type:"instrument"}})])}}function TN(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((e=>{e in n&&"function"==typeof n[e]&&j_(n,e,(function(t){const n={mechanism:{data:{function:e,handler:c_(t)},handled:!1,type:"instrument"}},r=G_(t);return r&&(n.mechanism.data.handler=c_(r)),Pk(t,n)}))})),e.apply(this,t)}}function CN(e){const t=Lk,n=t[e]?.prototype;n?.hasOwnProperty?.("addEventListener")&&(j_(n,"addEventListener",(function(t){return function(n,r,o){try{"function"==typeof r.handleEvent&&(r.handleEvent=Pk(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:c_(r),target:e},handled:!1,type:"instrument"}}))}catch{}return t.apply(this,[n,Pk(r,{mechanism:{data:{function:"addEventListener",handler:c_(r),target:e},handled:!1,type:"instrument"}}),o])}
773
- })),j_(n,"removeEventListener",(function(e){return function(t,n,r){try{const o=n.__sentry_wrapped__;o&&e.call(this,t,o,r)}catch(e){}return e.call(this,t,n,r)}})))}const MN=()=>({name:"BrowserSession",setupOnce(){void 0!==Lk.document?(Rx({ignoreDuration:!0}),Fx(),oN((({from:e,to:t})=>{void 0!==e&&e!==t&&(Rx({ignoreDuration:!0}),Fx())}))):wN&&t_.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.")}}),IN=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(!function(e){!function(e){const t="error";m_(t,e),p_(t,v_)}((t=>{const{stackParser:n,attachStacktrace:r}=LN();if(Ew()!==e||Rk())return;const{msg:o,url:i,line:a,column:s,error:l}=t,c=function(e,t,n,r){const o=e.exception=e.exception||{},i=o.values=o.values||[],a=i[0]=i[0]||{},s=a.stacktrace=a.stacktrace||{},l=s.frames=s.frames||[],c=r,u=n,d=S_(t)&&t.length>0?t:D_();0===l.length&&l.push({colno:c,filename:d,function:r_,in_app:!0,
774
- lineno:u});return e}(Gk(n,l||o,void 0,r,!1),i,a,s);c.level="error",Lx(c,{originalException:l,mechanism:{handled:!1,type:"onerror"}})}))}(e),zN("onerror")),t.onunhandledrejection&&(!function(e){!function(e){const t="unhandledrejection";m_(t,e),p_(t,y_)}((t=>{const{stackParser:n,attachStacktrace:r}=LN();if(Ew()!==e||Rk())return;const o=function(e){if(E_(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}(t),i=E_(o)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(o)}`}]}}:Gk(n,o,void 0,r,!0);i.level="error",Lx(i,{originalException:o,mechanism:{handled:!1,type:"onunhandledrejection"}})}))}(e),zN("onunhandledrejection"))}}};function zN(e){wN&&t_.log(`Global Handler attached: ${e}`)}function LN(){const e=Ew();return e?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const ON=()=>({name:"HttpContext",preprocessEvent(e){if(!Lk.navigator&&!Lk.location&&!Lk.document)return
775
- ;const t=e.request?.url||D_(),{referrer:n}=Lk.document||{},{userAgent:r}=Lk.navigator||{},o={...e.request?.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},i={...e.request,...t&&{url:t},headers:o};e.request=i}}),RN=(e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(e,r,o){const i=o.getOptions();fk(Dk,i.stackParser,i.maxValueLength,n,t,e,r)}}};function PN(e){const t={};for(const n of Object.getOwnPropertyNames(e)){const r=n;void 0!==e[r]&&(t[r]=e[r])}return t}function DN(e={}){const t=function(e={}){return{defaultIntegrations:[mk(),uk(),SN(),kN(),IN(),RN(),wk(),ON(),MN()],release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:Lk.SENTRY_RELEASE?.id,sendClientReports:!0,...PN(e)}}(e);if(!t.skipBrowserExtensionCheck&&function(){const e=void 0!==Lk.window&&Lk;if(!e)return!1
776
- ;const t=e[e.chrome?"chrome":"browser"],n=t?.runtime?.id,r=D_()||"",o=!!n&&Lk===Lk.top&&["chrome-extension:","moz-extension:","ms-browser-extension:","safari-web-extension:"].some((e=>r.startsWith(`${e}//`))),i=void 0!==e.nw;return!!n&&!o&&!i}())return void(wN&&e_((()=>{console.error("[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")})));wN&&!Tk()&&t_.warn("No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill.");const n={...t,stackParser:(r=t.stackParser||yN,Array.isArray(r)?a_(...r):r),integrations:jx(t),transport:t.transport||uN};var r;return Jx(Kk,n)}let FN=0;function HN(e,t){zx(e,{tags:{context:t}})}function BN(e){!function(e){Aw().setUser(e)}(e)}class $N{constructor(e,t,n){this._store=e,this._annotationsService=t,this._toastMessenger=n}async import(e){this._store.beginImport(e.length);const t=this._store.profile().userid
777
- ;if(!t)throw new Error("Cannot import when logged out");const n=this._store.focusedGroupId();if(!n)throw new Error("Cannot import when no group is selected");const r=this._store.allAnnotations(),o=this._store.defaultContentFrame(),i=async e=>{const i=r.find((t=>function(e,t){return e.text===t.text&&!!function(e,t){return e.length===t.length&&e.every(((e,n)=>t[n]===e))}(e.tags,t.tags)&&Li(e)===Li(t)}(e,t)));if(i)return{type:"duplicate",annotation:i};try{const r=function(e,t){return{target:e.target,tags:e.tags,text:e.text,uri:t?.uri??e.uri,document:t?.metadata??e.document,extra:{source:"import",original_id:e.id}}}(e,o),i=this._annotationsService.annotationFromData(r);i.permissions=Rs(e.permissions)?Ls(t,n):zs(t);return{type:"import",annotation:await this._annotationsService.save(i)}}catch(e){return HN(e,"annotation-import"),{type:"error",error:e}}},a=[],s=e.map(((e,t)=>({ann:e,index:t}))),l=[];for(;s.length>0;){const e=s.shift(),t=i(e.ann).then((t=>{this._store.completeImport(1),a[e.index]=t})).then((()=>{
778
- const e=l.indexOf(t);-1!==e&&l.splice(e,1)}));l.push(t),l.length>=5&&await Promise.race(l)}await Promise.all(l);const{messageType:c,message:u}=function(e){const t=e.filter((e=>"error"===e.type)),n=t.length>0?`${t.length} imports failed (${t[0].error.message})`:"",r=e.filter((e=>"import"===e.type)).length,o=r>0?`${r} annotations imported`:"",i=e.filter((e=>"duplicate"===e.type)).length,a=i>0?`${i} duplicates skipped`:"";let s;return s=0===t.length?r>0?"success":"notice":r>0?"notice":"error",{messageType:s,message:[o,n,a].filter((e=>e.length>0)).join(", ")}}(a);return"success"===c?this._toastMessenger.success(u):"notice"===c?this._toastMessenger.notice(u,{autoDismiss:!1}):"error"===c&&this._toastMessenger.error(u,{autoDismiss:!1}),a}}$N.$inject=["store","annotationsService","toastMessenger"];class jN{constructor(e,t,n,r){this._api=e,this._store=t,this._streamer=n,this._streamFilter=r,this._searchClient=null}load({groupId:e,uris:t,onError:n,maxResults:r,sortBy:o,sortOrder:i,streamFilterBy:a="uri"}){
779
- if(this._store.removeAnnotations(this._store.savedAnnotations()),this._searchClient&&this._searchClient.cancel(),"group"===a)this._streamFilter.resetFilter().addClause("/group","equals",e,!0),this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()});else t&&t.length>0&&(this._streamFilter.resetFilter().addClause("/uri","one_of",t),this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()}));const s={incremental:!0,separateReplies:!1,maxResults:r,sortBy:o,sortOrder:i};this._searchClient=new Og(this._api.search,s),this._searchClient.on("resultCount",(e=>{this._store.setAnnotationResultCount(e)})),this._searchClient.on("results",(e=>{e.length&&this._store.addAnnotations(e)})),this._searchClient.on("error",(e=>{"function"==typeof n?n(e):console.error(e)})),this._searchClient.on("end",(()=>{this._searchClient=null,t&&t.length>0&&this._store.frames().forEach((e=>{t.indexOf(e.uri)>=0&&this._store.updateFrameAnnotationFetchStatus(e.uri,!0)})),this._store.annotationFetchFinished()})),
780
- this._store.annotationFetchStarted(),this._searchClient.get({group:e,uri:t})}async loadThread(e){let t,n;this._store.clearAnnotations();try{this._store.annotationFetchStarted(),t=await this._api.annotation.get({id:e}),_i(t)&&(t=await this._api.annotation.get({id:t.references[0]})),n=await this._api.search({references:t.id})}finally{this._store.annotationFetchFinished()}const r=[t,...n.rows];if(this._store.addAnnotations(r),!_i(t)){const e=t.id;this._streamFilter.addClause("/references","one_of",e,!0).addClause("/id","equals",e,!0),this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()}),this._streamer.connect()}return r}}jN.$inject=["api","store","streamer","streamFilter"];class qN{constructor(){this._store=new Map}getItem(e){return this._store.get(e)??null}setItem(e,t){this._store.set(e,t)}removeItem(e){this._store.delete(e)}}class UN{constructor(e){const t="hypothesis.testKey";try{this._storage=e.localStorage,e.localStorage.setItem(t,t),e.localStorage.getItem(t),
781
- e.localStorage.removeItem(t)}catch{this._storage=new qN}}getItem(e){return this._storage.getItem(e)}getObject(e){const t=this._storage.getItem(e);return t?JSON.parse(t):null}setItem(e,t){this._storage.setItem(e,t)}setObject(e,t){const n=JSON.stringify(t);this._storage.setItem(e,n)}removeItem(e){this._storage.removeItem(e)}}UN.$inject=["$window"];const GN={annotationPrivacy:"hypothesis.privacy",focusedGroup:"hypothesis.groups.focus"};class VN{constructor(e,t){this._storage=e,this._store=t}init(){for(const[e,t]of Hi(GN)){const n=this._storage.getItem(t);this._store.setDefault(e,n)}Fy(this._store.subscribe,(()=>this._store.getDefaults()),((e,t)=>{for(const[n,r]of Hi(e))t[n]!==r&&n in GN&&this._storage.setItem(GN[n],r)}))}}VN.$inject=["localStorage","store"];class WN{constructor(e,t){this._window=e,this._store=t,this._didRegisterPopstateListener=!1}currentRoute(){const e=this._window.location.pathname.slice(1).split("/"),t=new URLSearchParams(this._window.location.search),n={};for(const[e,r]of t)n[e]=r
782
- ;"client"===e[0]&&e.shift();let r;switch(e[0].replace(/\.html$/,"")){case"a":r="annotation",n.id=e[1]||"";break;case"notebook":r="notebook";break;case"user-profile":r="profile";break;case"stream":r="stream";break;default:r="sidebar"}return{route:r,params:n}}routeUrl(e,t={}){let n;const r={...t};switch(e){case"annotation":{const e=t.id;delete r.id,n=`/a/${e}`}break;case"notebook":n="/notebook";break;case"profile":n="/user-profile";break;case"stream":n="/stream";break;default:throw new Error(`Cannot generate URL for route "${e}"`)}let o=!1;const i=new URLSearchParams;for(const[e,t]of Object.entries(r))o=!0,i.set(e,t);return o&&(n+="?"+i.toString()),n}sync(){const{route:e,params:t}=this.currentRoute();this._store.changeRoute(e,t),this._didRegisterPopstateListener||(this._window.addEventListener("popstate",(()=>{this.sync()})),this._didRegisterPopstateListener=!0)}navigate(e,t){this._window.history.pushState({},"",this.routeUrl(e,t)),this.sync()}}WN.$inject=["$window","store"];class KN{constructor(e,t){
783
- this._apiRoutes=e,this._store=t}async init(){try{const e=await this._apiRoutes.links();this._store.updateLinks(e)}catch(e){console.warn(`Failed to fetch Hypothesis links: ${e.message}`)}}}KN.$inject=["apiRoutes","store"];class YN{constructor(e,t,n,r,o){this._api=t,this._auth=n,this._store=e,this._toastMessenger=o,this._authority=Mo(r)?.authority??null,this._lastLoad=null,this._lastLoadTime=null,n.on("oauthTokensChanged",(()=>this.reload()))}load(){return(!this._lastLoad||!this._lastLoadTime||Date.now()-this._lastLoadTime>3e5)&&(this._lastLoadTime=Date.now(),this._lastLoad=_y((()=>{const e=this._authority?{authority:this._authority}:{};return this._api.profile.read(e)})).then((e=>(this.update(e),this._lastLoadTime=Date.now(),e))).catch((e=>{throw this._lastLoadTime=null,e}))),this._lastLoad}async dismissSidebarTutorial(){const e=await this._api.profile.update({},{preferences:{show_sidebar_tutorial:!1}});this.update(e)}update(e){const t=this._store.profile(),n=e.userid!==t.userid
784
- ;return this._store.updateProfile(e),this._lastLoad=Promise.resolve(e),this._lastLoadTime=Date.now(),n&&(e.userid?BN({id:e.userid}):BN(null)),e}async logout(){try{return await this._auth.logout(),this.reload()}catch(e){throw this._toastMessenger.error("Log out failed"),new Error(e)}}reload(){return this._lastLoad=null,this._lastLoadTime=null,this.load()}}YN.$inject=["store","api","auth","settings","toastMessenger"];class XN{constructor(){this._filter={match_policy:"include_any",clauses:[],actions:{create:!0,update:!0,delete:!0}}}addClause(e,t,n,r=!1){return this._filter.clauses.push({field:e,operator:t,value:n,case_sensitive:r}),this}getFilter(){return this._filter}resetFilter(){return this._filter={match_policy:"include_any",clauses:[],actions:{create:!0,update:!0,delete:!0}},this}}class ZN extends Ig.TinyEmitter{constructor(e){super(),this._messageQueue=[],this._socket=new WebSocket(e),this._socket.onopen=e=>{this.sendMessages(),this.emit("open",e)},this._socket.onclose=e=>{
785
- if(1e3===e.code||1001===e.code)return void this.emit("close",e);const t=new Error(`WebSocket closed abnormally, code: ${e.code}`);console.warn(t),this.emit("disconnect")},this._socket.onerror=e=>{this.emit("error",e)},this._socket.onmessage=e=>{this.emit("message",e)}}close(){this._socket.close(1e3)}send(e){this._messageQueue.push(e),this.isConnected()&&this.sendMessages()}isConnected(){return this._socket.readyState===WebSocket.OPEN}sendMessages(){for(;this._messageQueue.length>0;){const e=JSON.stringify(this._messageQueue.shift());this._socket.send(e)}}}class JN{constructor(e,t,n,r,o,i){this._auth=n,this._groups=r,this._session=o,this._store=e,this._websocketURL=t.links().then((e=>e.websocket)),this.clientId=jv(32),this._socket=null,this._updateImmediately=!0,this._configMessages={},this._reconnectionAttempts=0,this._reconnectSetUp=!1,this._window=i}applyPendingUpdates(){const e=Object.values(this._store.pendingUpdates());e.length&&(this._store.addAnnotations(e),
786
- this._store.highlightAnnotations(e.map((({id:e})=>e)).filter(Boolean)),this._window.setTimeout((()=>this._store.highlightAnnotations([])),5e3));const t=Object.keys(this._store.pendingDeletions()).map((e=>({id:e})));t.length&&this._store.removeAnnotations(t),this._store.clearPendingUpdates()}_handleSocketError(e,t){Xv("Error connecting to H push notification service:",t);const n=new URL(e).hostname;-1!==["localhost","127.0.0.1"].indexOf(n)&&Xv("Check that your H service is configured to allow WebSocket connections from "+window.location.origin)}_handleSocketMessage(e){const t=JSON.parse(e.data);if(t)if("annotation-notification"===t.type){const e=t.payload;switch(t.options.action){case"create":case"update":case"past":this._store.receiveRealTimeUpdates({updatedAnnotations:e});break;case"delete":this._store.receiveRealTimeUpdates({deletedAnnotations:e})}this._updateImmediately&&this.applyPendingUpdates()}else if("session-change"===t.type)this._session.update(t.model),
787
- this._groups.load();else if("whoyouare"===t.type){const e=this._store.profile().userid;t.userid!==e&&console.warn('WebSocket user ID "%s" does not match logged-in ID "%s"',t.userid,e)}else Xv("Received unsupported notification",t.type)}_sendClientConfig(e){Object.keys(this._configMessages).forEach((t=>{this._configMessages[t]&&e.send(this._configMessages[t])}))}setConfig(e,t){this._configMessages[e]=t,this._socket?.isConnected()&&this._socket.send(t)}async _reconnect(){const e=await this._websocketURL;if(!e)return;let t,n;this._socket?.close();try{t=await this._auth.getAccessToken()}catch(e){throw console.error("Failed to fetch token for WebSocket authentication",e),e}if(t){const r=new URL(e);r.searchParams.set("access_token",t),n=r.toString()}else n=e;const r=new ZN(n);r.on("open",(()=>{this._reconnectionAttempts=0,this._sendClientConfig(r)})),r.on("disconnect",(()=>{if(++this._reconnectionAttempts,this._reconnectionAttempts<10){const e=1e3*2**this._reconnectionAttempts;setTimeout((()=>this._reconnect()),e)
788
- }else console.error("Gave up trying to reconnect to Hypothesis real time update service")})),r.on("error",(t=>this._handleSocketError(e,t))),r.on("message",(e=>this._handleSocketMessage(e))),this._socket=r,this.setConfig("client-id",{messageType:"client_id",value:this.clientId}),this.setConfig("auth-check",{type:"whoami",id:1})}async connect(e={}){this._updateImmediately=e.applyUpdatesImmediately??!0,this._reconnectSetUp||(this._reconnectSetUp=!0,Fy(this._store.subscribe,(()=>this._store.profile().userid),(()=>this._reconnect()))),this._socket||await this._reconnect()}}JN.$inject=["store","apiRoutes","auth","groups","session","$window"];const QN="hypothesis.user.tags.list",eS="hypothesis.user.tags.map";class tS{constructor(e){this._storage=e}filter(e,t=null){const n=this._storage.getObject(QN)||[];let r=0;return n.filter((n=>{if(null!==t&&r>=t)return!1;const o=n.split(/\W+/),i=new RegExp(`^${Qv(e)}`,"i");return!(!o.some((e=>e.match(i)))&&!n.match(i))&&(++r,!0)}))}store(e){
789
- const t=this._storage.getObject(eS)||{};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(eS,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(QN,n)}}tS.$inject=["localStorage"];class nS{constructor(e){this._store=e}forceVisible(e){e.children.forEach((e=>{this.forceVisible(e)})),e.visible||this._store.setForcedVisible(e.id,!0)}}nS.$inject=["store"];class rS extends Ig.TinyEmitter{constructor(e,t){super(),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){this._store.getToastMessage(e)&&(this._store.removeToastMessage(e),this.emit("toastMessageDismissed",e))}_addMessage(e,t,{autoDismiss:n=!0,visuallyHidden:r=!1,delayed:o=!1}={}){
790
- if(this._store.hasToastMessage(e,t))return;if(o&&!this._window.document.hasFocus()){const o={autoDismiss:n,visuallyHidden:r};return void this._delayedMessageQueue.push({type:e,messageText:t,options:o})}const i={type:e,id:jv(10),message:t,visuallyHidden:r,autoDismiss:n};this._store.addToastMessage(i),this.emit("toastMessageAdded",i)}error(e,t){this._addMessage("error",e,t)}success(e,t){this._addMessage("success",e,t)}notice(e,t){this._addMessage("notice",e,t)}}rS.$inject=["store","$window"];const oS=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){console.warn("Could not parse settings from js-hypothesis-config tags",e),o={}}Object.assign(t,o)}return t}(document),iS=function(e){const{version:t,origin:n}=Uv(e.location.href);return"1.1593.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1593.0) than the host page (${t}). It may not work.`),
791
- !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 aS(e,t){e.setClientId(t.clientId)}function sS(e){e.sync()}function lS(e,t){e.load(),t.load()}function cS(e,t,n){e.init(),t.init(),n.init()}function uS(e,t,n){"sidebar"===t.route()&&e.connect().catch((()=>{n.error("Hypothesis failed to connect to the web page. Try reloading the page.",{autoDismiss:!1})}))}oS.sentry&&iS&&function(e){const t=function(){const e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;DN({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1593.0",beforeSend:(e,t)=>{if(FN>=5)return Xv("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++FN;try{const n=t&&t.originalException
792
- ;n instanceof Event&&(e.extra||(e.extra={}),Object.assign(e.extra,{type:n.type,detail:n.detail,isTrusted:n.isTrusted}))}catch{}return e}});try{Ox("host_config",Uv(window.location.href))}catch{}Ox("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),Iy(((e,t)=>{HN(e,t)}))}(oS.sentry),document.body.addEventListener("click",(e=>{const t=e.target;"A"===t.tagName&&"_blank"===t.target&&(t.rel="noopener")})),aS.$inject=["api","streamer"],sS.$inject=["router"],lS.$inject=["groups","session"],cS.$inject=["autosaveService","persistedDefaults","serviceURL"],uS.$inject=["frameSync","store","toastMessenger"];const dS=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",ab)}(),async function(e,t=window){const n=function(e){
750
+ }),dk=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,'can\'t redefine non-configurable property "solana"',"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],hk=(e={})=>{let t;return{name:"EventFilters",setup(n){const r=n.getOptions();t=pk(e,r)},processEvent(n,r,o){if(!t){const n=o.getOptions();t=pk(e,n)}return function(e,t){if(e.type){if("transaction"===e.type&&function(e,t){if(!t?.length)return!1;const n=e.transaction;return!!n&&$_(n,t)
751
+ }(e,t.ignoreTransactions))return Gy&&t_.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${nw(e)}`),!0}else{if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(e))return Gy&&t_.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${nw(e)}`),!0;if(function(e,t){if(!t?.length)return!1;return Vx(e).some((e=>$_(e,t)))}(e,t.ignoreErrors))return Gy&&t_.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${nw(e)}`),!0;if(function(e){if(!e.exception?.values?.length)return!1;return!e.message&&!e.exception.values.some((e=>e.stacktrace||e.type&&"Error"!==e.type||e.value))}(e))return Gy&&t_.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${nw(e)}`),!0;if(function(e,t){if(!t?.length)return!1;const n=fk(e);return!!n&&$_(n,t)}(e,t.denyUrls))return Gy&&t_.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${nw(e)}.\nUrl: ${fk(e)}`),!0
752
+ ;if(!function(e,t){if(!t?.length)return!0;const n=fk(e);return!n||$_(n,t)}(e,t.allowUrls))return Gy&&t_.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${nw(e)}.\nUrl: ${fk(e)}`),!0}return!1}(n,t)?null:n}}},mk=(e={})=>({...hk(e),name:"InboundFilters"});function pk(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:dk],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}function fk(e){try{const t=[...e.exception?.values??[]].reverse().find((e=>void 0===e.mechanism?.parent_id&&e.stacktrace?.frames?.length)),n=t?.stacktrace?.frames;return n?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(n):null}catch(t){
753
+ return Gy&&t_.error(`Cannot extract url for event ${nw(e)}`),null}}function gk(e,t,n=250,r,o,i,a){if(!i.exception?.values||!a||!I_(a.originalException,Error))return;const s=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;var l,c;s&&(i.exception.values=(l=vk(e,t,o,a.originalException,r,i.exception.values,s,0),c=n,l.map((e=>(e.value&&(e.value=F_(e.value,c)),e)))))}function vk(e,t,n,r,o,i,a,s){if(i.length>=n+1)return i;let l=[...i];if(I_(r[o],Error)){bk(a,s);const i=e(t,r[o]),c=l.length;yk(i,o,c,s),l=vk(e,t,n,r[o],o,[i,...l],i,c)}return Array.isArray(r.errors)&&r.errors.forEach(((r,i)=>{if(I_(r,Error)){bk(a,s);const c=e(t,r),u=l.length;yk(c,`errors[${i}]`,u,s),l=vk(e,t,n,r,o,[c,...l],c,u)}})),l}function bk(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,..."AggregateError"===e.type&&{is_exception_group:!0},exception_id:t}}function yk(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",
754
+ source:t,exception_id:n,parent_id:r}}function _k(){"console"in Vy&&Jy.forEach((function(e){e in Vy.console&&j_(Vy.console,e,(function(t){return Qy[e]=t,function(...t){f_("console",{args:t,level:e});const n=Qy[e];n?.apply(Vy.console,t)}}))}))}function wk(e){return"warn"===e?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const xk=()=>{let e;return{name:"Dedupe",processEvent(t){if(t.type)return t;try{if(function(e,t){if(!t)return!1;if(function(e,t){const n=e.message,r=t.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!Nk(e,t))return!1;if(!kk(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){const n=Sk(t),r=Sk(e);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!Nk(e,t))return!1;if(!kk(e,t))return!1;return!0}(e,t))return!0;return!1}(t,e))return Gy&&t_.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(e){}return e=t}}};function kk(e,t){let n=u_(e),r=u_(t);if(!n&&!r)return!0
755
+ ;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let e=0;e<r.length;e++){const t=r[e],o=n[e];if(t.filename!==o.filename||t.lineno!==o.lineno||t.colno!==o.colno||t.function!==o.function)return!1}return!0}function Nk(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch(e){return!1}}function Sk(e){return e.exception?.values&&e.exception.values[0]}function Ak(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function Ek(e){return[{type:"otel_log"},e]}const Tk=new WeakMap;function Ck(e,t){const n=Tk.get(e)??[];if(0===n.length)return;const r=e.getOptions(),o=function(e,t,n,r){const o={};return t?.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=ax(r)),hx(o,e.map(Ek))}(n,r._metadata,r.tunnel,e.getDsn());n.length=0,e.sendEnvelope(o)}function Mk(e){
756
+ return void 0===e?void 0:e>=400&&e<500?"warning":e>=500?"error":void 0}const Ik=Vy;function zk(){if(!("fetch"in Ik))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(e){return!1}}function Lk(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Ok(e,t){const n="fetch";m_(n,e),p_(n,(()=>function(e,t=!1){if(t&&!function(){if("string"==typeof EdgeRuntime)return!0;if(!zk())return!1;if(Lk(Ik.fetch))return!0;let e=!1;const t=Ik.document;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=Lk(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){Wy&&t_.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e}())return;j_(Vy,"fetch",(function(e){return function(...t){const n=new Error,{method:r,url:o}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:Pk(t),
757
+ method:Rk(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:Pk(t),method:Rk(t,"method")?String(t.method).toUpperCase():"GET"}}(t),i={args:t,fetchData:{method:r,url:o},startTimestamp:1e3*Q_(),virtualError:n};return f_("fetch",{...i}),e.apply(Vy,t).then((async e=>(f_("fetch",{...i,endTimestamp:1e3*Q_(),response:e}),e)),(e=>{throw f_("fetch",{...i,endTimestamp:1e3*Q_(),error:e}),w_(e)&&void 0===e.stack&&(e.stack=n.stack,q_(e,"framesToPop",1)),e}))}}))}(0,t)))}function Rk(e,t){return!!e&&"object"==typeof e&&!!e[t]}function Pk(e){return"string"==typeof e?e:e?Rk(e,"url")?e.url:e.toString?e.toString():"":""}const Dk=Vy;let Fk=0;function Hk(){return Fk>0}function Bk(e,t={}){if(!function(e){return"function"==typeof e}(e))return e;try{const t=e.__sentry_wrapped__;if(t)return"function"==typeof t?t:e;if(G_(e))return e}catch(t){return e}const n=function(...n){try{const r=n.map((e=>Bk(e,t)));return e.apply(this,r)}catch(e){throw Fk++,setTimeout((()=>{Fk--})),function(...e){const t=Nw(Yy())
758
+ ;if(2===e.length){const[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}t.withScope(e[0])}((r=>{r.addEventProcessor((e=>(t.mechanism&&(rw(e,void 0),ow(e,t.mechanism)),e.extra={...e.extra,arguments:n},e))),zx(e)})),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch{}U_(n,e),q_(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}function $k(e,t){const n=Uk(e,t),r={type:Wk(t),value:Kk(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function jk(e,t,n,r){const o=Ew(),i=o?.getOptions().normalizeDepth,a=function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}return}(t),s={__serialized__:ux(t,i)};if(a)return{exception:{values:[$k(e,a)]},extra:s};const l={exception:{values:[{type:C_(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Zk(t,{
759
+ isUnhandledRejection:r})}]},extra:s};if(n){const t=Uk(e,n);t.length&&(l.exception.values[0].stacktrace={frames:t})}return l}function qk(e,t){return{exception:{values:[$k(e,t)]}}}function Uk(e,t){const n=t.stacktrace||t.stack||"",r=function(e){if(e&&Gk.test(e.message))return 1;return 0}(t),o=function(e){if("number"==typeof e.framesToPop)return e.framesToPop;return 0}(t);try{return e(n,r,o)}catch(e){}return[]}const Gk=/Minified React error #\d+;/i;function Vk(e){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&e instanceof WebAssembly.Exception}function Wk(e){const t=e?.name;if(!t&&Vk(e)){return e.message&&Array.isArray(e.message)&&2==e.message.length?e.message[0]:"WebAssembly.Exception"}return t}function Kk(e){const t=e?.message;return Vk(e)?Array.isArray(e.message)&&2==e.message.length?e.message[1]:"wasm exception":t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function Yk(e,t,n,r,o){let i;if(k_(t)&&t.error){return qk(e,t.error)}
760
+ if(N_(t)||x_(t,"DOMException")){const o=t;if("stack"in t)i=qk(e,t);else{const t=o.name||(N_(o)?"DOMError":"DOMException"),a=o.message?`${t}: ${o.message}`:t;i=Xk(e,a,n,r),rw(i,a)}return"code"in o&&(i.tags={...i.tags,"DOMException.code":`${o.code}`}),i}if(w_(t))return qk(e,t);if(T_(t)||C_(t)){return i=jk(e,t,n,o),ow(i,{synthetic:!0}),i}return i=Xk(e,t,n,r),rw(i,`${t}`),ow(i,{synthetic:!0}),i}function Xk(e,t,n,r){const o={};if(r&&n){const r=Uk(e,n);r.length&&(o.exception={values:[{value:t,stacktrace:{frames:r}}]}),ow(o,{synthetic:!0})}if(A_(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return o.logentry={message:e,params:n},o}return o.message=t,o}function Zk(e,{isUnhandledRejection:t}){const n=function(e,t=40){const n=Object.keys(V_(e));n.sort();const r=n[0];if(!r)return"[object has no keys]";if(r.length>=t)return F_(r,t);for(let e=n.length;e>0;e--){const r=n.slice(0,e).join(", ");if(!(r.length>t))return e===n.length?r:F_(r,t)}return""}(e),r=t?"promise rejection":"exception"
761
+ ;if(k_(e))return`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``;if(C_(e)){return`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){}}(e)}\` (type=${e.type}) captured as ${r}`}return`Object captured as ${r} with keys: ${n}`}class Jk extends Yx{constructor(e){const t={parentSpanIsAlwaysRootSpan:!0,...e};!function(e,t,n=[t],r="npm"){const o=e._metadata||{};o.sdk||(o.sdk={name:`sentry.javascript.${t}`,packages:n.map((e=>({name:`${r}:@sentry/${e}`,version:Ky}))),version:Ky}),e._metadata=o}(t,"browser",["browser"],Dk.SENTRY_SDK_SOURCE||"npm"),super(t),t.sendClientReports&&Dk.document&&Dk.document.addEventListener("visibilitychange",(()=>{"hidden"===Dk.document.visibilityState&&(this._flushOutcomes(),this._options._experiments?.enableLogs&&Ck(this))})),this._options.sendDefaultPii&&(this.on("postprocessEvent",ok),this.on("beforeSendSession",ik))}eventFromException(e,t){return function(e,t,n,r){const o=Yk(e,t,n?.syntheticException||void 0,r)
762
+ ;return ow(o),o.level="error",n?.event_id&&(o.event_id=n.event_id),sw(o)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,o){const i=Xk(e,t,r?.syntheticException||void 0,o);return i.level=n,r?.event_id&&(i.event_id=r.event_id),sw(i)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n,r)}}const Qk="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,eN=Vy,tN=1e3;let nN,rN,oN,iN;function aN(){if(!eN.document)return;const e=f_.bind(null,"dom"),t=sN(e,!0);eN.document.addEventListener("click",t,!1),eN.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((t=>{const n=eN,r=n[t]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(j_(r,"addEventListener",(function(t){return function(n,r,o){if("click"===n||"keypress"==n)try{
763
+ const r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},i=r[n]=r[n]||{refCount:0};if(!i.handler){const r=sN(e);i.handler=r,t.call(this,n,r,o)}i.refCount++}catch(e){}return t.call(this,n,r,o)}})),j_(r,"removeEventListener",(function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this.__sentry_instrumentation_handlers__||{},o=n[t];o&&(o.refCount--,o.refCount<=0&&(e.call(this,t,o.handler,r),o.handler=void 0,delete n[t]),0===Object.keys(n).length&&delete this.__sentry_instrumentation_handlers__)}catch(e){}return e.call(this,t,n,r)}})))}))}function sN(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(e){try{return e.target}catch(e){return null}}(n);if(function(e,t){return"keypress"===e&&(!t?.tagName||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable)}(n.type,r))return;q_(n,"_sentryCaptured",!0),r&&!r._sentryId&&q_(r,"_sentryId",ew());const o="keypress"===n.type?"input":n.type;if(!function(e){if(e.type!==rN)return!1;try{
764
+ if(!e.target||e.target._sentryId!==oN)return!1}catch(e){}return!0}(n)){e({event:n,name:o,global:t}),rN=n.type,oN=r?r._sentryId:void 0}clearTimeout(nN),nN=eN.setTimeout((()=>{oN=void 0,rN=void 0}),tN)}}function lN(e){const t="history";m_(t,e),p_(t,cN)}function cN(){function e(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const r=iN,o=String(n);if(iN=o,r===o)return e.apply(this,t);f_("history",{from:r,to:o})}return e.apply(this,t)}}eN.addEventListener("popstate",(()=>{const e=eN.location.href,t=iN;if(iN=e,t===e)return;f_("history",{from:t,to:e})})),"history"in Ik&&Ik.history&&(j_(eN.history,"pushState",e),j_(eN.history,"replaceState",e))}const uN={};function dN(e){uN[e]=void 0}const hN="__sentry_xhr_v3__";function mN(){if(!eN.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){const r=new Error,o=1e3*Q_(),i=S_(n[0])?n[0].toUpperCase():void 0,a=function(e){if(S_(e))return e;try{return e.toString()}catch{}return}(n[1]);if(!i||!a)return e.apply(t,n);t[hN]={
765
+ method:i,url:a,request_headers:{}},"POST"===i&&a.match(/sentry_key/)&&(t.__sentry_own_request__=!0);const s=()=>{const e=t[hN];if(e&&4===t.readyState){try{e.status_code=t.status}catch(e){}f_("xhr",{endTimestamp:1e3*Q_(),startTimestamp:o,xhr:t,virtualError:r})}};return"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(e,t,n)=>(s(),e.apply(t,n))}):t.addEventListener("readystatechange",s),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){const[r,o]=n,i=t[hN];return i&&S_(r)&&S_(o)&&(i.request_headers[r.toLowerCase()]=o),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){const r=t[hN];if(!r)return e.apply(t,n);void 0!==n[0]&&(r.body=n[0]);return f_("xhr",{startTimestamp:1e3*Q_(),xhr:t}),e.apply(t,n)}})}function pN(e,t=function(e){const t=uN[e];if(t)return t;let n=eN[e];if(Lk(n))return uN[e]=n.bind(eN);const r=eN.document;if(r&&"function"==typeof r.createElement)try{const t=r.createElement("iframe")
766
+ ;t.hidden=!0,r.head.appendChild(t);const o=t.contentWindow;o?.[e]&&(n=o[e]),r.head.removeChild(t)}catch(t){Qk&&t_.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n?uN[e]=n.bind(eN):n}("fetch")){let n=0,r=0;return rk(e,(function(o){const i=o.body.length;n+=i,r++;const a={body:o.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};if(!t)return dN("fetch"),lw("No fetch implementation available");try{return t(e.url,a).then((e=>(n-=i,r--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}})))}catch(e){return dN("fetch"),n-=i,r--,lw(e)}}))}function fN(e,t,n,r){const o={filename:e,function:"<anonymous>"===t?r_:t,in_app:!0};return void 0!==n&&(o.lineno=n),void 0!==r&&(o.colno=r),o}
767
+ const gN=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,vN=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,bN=/\((\S*)(?::(\d+))(?::(\d+))\)/,yN=[30,e=>{const t=gN.exec(e);if(t){const[,e,n,r]=t;return fN(e,r_,+n,+r)}const n=vN.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){const e=bN.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}const[e,t]=NN(n[1]||r_,n[2]);return fN(t,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],_N=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,wN=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,xN=[50,e=>{const t=_N.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=wN.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||r_;return[n,e]=NN(n,e),fN(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],kN=a_(...[yN,xN]),NN=(e,t)=>{
768
+ const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:r_,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},SN="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,AN=1024,EN=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:"Breadcrumbs",setup(e){var n;t.console&&function(e){const t="console";m_(t,e),p_(t,_k)}(function(e){return function(t){if(Ew()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:wk(t.level),message:H_(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${H_(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}sk(n,{input:t.args,level:t.level})}}(e)),t.dom&&(n=function(e,t){return function(n){if(Ew()!==e)return;let r,o,i="object"==typeof t?t.serializeAttribute:void 0,a="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0
769
+ ;a&&a>AN&&(SN&&t_.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${a} was configured. Sentry will use 1024 instead.`),a=AN),"string"==typeof i&&(i=[i]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;r=R_(t,{keyAttrs:i,maxStringLength:a}),o=function(e){if(!L_.HTMLElement)return null;let t=e;for(let e=0;e<5;e++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}(t)}catch(e){r="<unknown>"}if(0===r.length)return;const s={category:`ui.${n.name}`,message:r};o&&(s.data={"ui.component_name":o}),sk(s,{event:n.event,name:n.name,global:n.global})}}(e,t.dom),m_("dom",n),p_("dom",aN)),t.xhr&&function(e){m_("xhr",e),p_("xhr",mN)}(function(e){return function(t){if(Ew()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,o=t.xhr[hN];if(!n||!r||!o)return;const{method:i,url:a,status_code:s,body:l}=o,c={method:i,url:a,status_code:s},u={
770
+ xhr:t.xhr,input:l,startTimestamp:n,endTimestamp:r},d={category:"xhr",data:c,type:"http",level:Mk(s)};e.emit("beforeOutgoingRequestBreadcrumb",d,u),sk(d,u)}}(e)),t.fetch&&Ok(function(e){return function(t){if(Ew()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.fetchData.method,t.fetchData.url,t.error){const o=t.fetchData,i={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},a={category:"fetch",data:o,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",a,i),sk(a,i)}else{const o=t.response,i={...t.fetchData,status_code:o?.status};t.fetchData.request_body_size,t.fetchData.response_body_size,o?.status;const a={input:t.args,response:o,startTimestamp:n,endTimestamp:r},s={category:"fetch",data:i,type:"http",level:Mk(i.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",s,a),sk(s,a)}}}(e)),t.history&&lN(function(e){return function(t){if(Ew()!==e)return;let n=t.from,r=t.to;const o=Ak(Dk.location.href)
771
+ ;let i=n?Ak(n):void 0;const a=Ak(r);i?.path||(i=o),o.protocol===a.protocol&&o.host===a.host&&(r=a.relative),o.protocol===i.protocol&&o.host===i.host&&(n=i.relative),sk({category:"navigation",data:{from:n,to:r}})}}(e)),t.sentry&&e.on("beforeSendEvent",function(e){return function(t){Ew()===e&&sk({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:nw(t)},{event:t})}}(e))}}};const TN=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],CN=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,
772
+ setTimeout:!0,...e};return{name:"BrowserApiErrors",setupOnce(){t.setTimeout&&j_(Dk,"setTimeout",MN),t.setInterval&&j_(Dk,"setInterval",MN),t.requestAnimationFrame&&j_(Dk,"requestAnimationFrame",IN),t.XMLHttpRequest&&"XMLHttpRequest"in Dk&&j_(XMLHttpRequest.prototype,"send",zN);const e=t.eventTarget;if(e){(Array.isArray(e)?e:TN).forEach(LN)}}}};function MN(e){return function(...t){const n=t[0];return t[0]=Bk(n,{mechanism:{data:{function:c_(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function IN(e){return function(t){return e.apply(this,[Bk(t,{mechanism:{data:{function:"requestAnimationFrame",handler:c_(e)},handled:!1,type:"instrument"}})])}}function zN(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((e=>{e in n&&"function"==typeof n[e]&&j_(n,e,(function(t){const n={mechanism:{data:{function:e,handler:c_(t)},handled:!1,type:"instrument"}},r=G_(t);return r&&(n.mechanism.data.handler=c_(r)),Bk(t,n)}))})),e.apply(this,t)}}function LN(e){
773
+ const t=Dk,n=t[e]?.prototype;n?.hasOwnProperty?.("addEventListener")&&(j_(n,"addEventListener",(function(t){return function(n,r,o){try{"function"==typeof r.handleEvent&&(r.handleEvent=Bk(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:c_(r),target:e},handled:!1,type:"instrument"}}))}catch{}return t.apply(this,[n,Bk(r,{mechanism:{data:{function:"addEventListener",handler:c_(r),target:e},handled:!1,type:"instrument"}}),o])}})),j_(n,"removeEventListener",(function(e){return function(t,n,r){try{const o=n.__sentry_wrapped__;o&&e.call(this,t,o,r)}catch(e){}return e.call(this,t,n,r)}})))}const ON=()=>({name:"BrowserSession",setupOnce(){void 0!==Dk.document?(Rx({ignoreDuration:!0}),Fx(),lN((({from:e,to:t})=>{void 0!==e&&e!==t&&(Rx({ignoreDuration:!0}),Fx())}))):SN&&t_.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.")}}),RN=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(e){
774
+ t.onerror&&(!function(e){!function(e){const t="error";m_(t,e),p_(t,v_)}((t=>{const{stackParser:n,attachStacktrace:r}=DN();if(Ew()!==e||Hk())return;const{msg:o,url:i,line:a,column:s,error:l}=t,c=function(e,t,n,r){const o=e.exception=e.exception||{},i=o.values=o.values||[],a=i[0]=i[0]||{},s=a.stacktrace=a.stacktrace||{},l=s.frames=s.frames||[],c=r,u=n,d=S_(t)&&t.length>0?t:D_();0===l.length&&l.push({colno:c,filename:d,function:r_,in_app:!0,lineno:u});return e}(Yk(n,l||o,void 0,r,!1),i,a,s);c.level="error",Lx(c,{originalException:l,mechanism:{handled:!1,type:"onerror"}})}))}(e),PN("onerror")),t.onunhandledrejection&&(!function(e){!function(e){const t="unhandledrejection";m_(t,e),p_(t,y_)}((t=>{const{stackParser:n,attachStacktrace:r}=DN();if(Ew()!==e||Hk())return;const o=function(e){if(E_(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}(t),i=E_(o)?{exception:{values:[{type:"UnhandledRejection",
775
+ value:`Non-Error promise rejection captured with value: ${String(o)}`}]}}:Yk(n,o,void 0,r,!0);i.level="error",Lx(i,{originalException:o,mechanism:{handled:!1,type:"onunhandledrejection"}})}))}(e),PN("onunhandledrejection"))}}};function PN(e){SN&&t_.log(`Global Handler attached: ${e}`)}function DN(){const e=Ew();return e?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const FN=()=>({name:"HttpContext",preprocessEvent(e){if(!Dk.navigator&&!Dk.location&&!Dk.document)return;const t=e.request?.url||D_(),{referrer:n}=Dk.document||{},{userAgent:r}=Dk.navigator||{},o={...e.request?.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},i={...e.request,...t&&{url:t},headers:o};e.request=i}}),HN=(e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(e,r,o){const i=o.getOptions();gk($k,i.stackParser,i.maxValueLength,n,t,e,r)}}};function BN(e){const t={};for(const n of Object.getOwnPropertyNames(e)){const r=n;void 0!==e[r]&&(t[r]=e[r])}return t}function $N(e={}){const t=function(e={}){
776
+ return{defaultIntegrations:[mk(),uk(),CN(),EN(),RN(),HN(),xk(),FN(),ON()],release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:Dk.SENTRY_RELEASE?.id,sendClientReports:!0,...BN(e)}}(e);if(!t.skipBrowserExtensionCheck&&function(){const e=void 0!==Dk.window&&Dk;if(!e)return!1;const t=e[e.chrome?"chrome":"browser"],n=t?.runtime?.id,r=D_()||"",o=!!n&&Dk===Dk.top&&["chrome-extension:","moz-extension:","ms-browser-extension:","safari-web-extension:"].some((e=>r.startsWith(`${e}//`))),i=void 0!==e.nw;return!!n&&!o&&!i}())return void(SN&&e_((()=>{console.error("[Sentry] You cannot run Sentry this way in a browser extension, check: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")})));SN&&!zk()&&t_.warn("No Fetch API detected. The Sentry SDK requires a Fetch API compatible environment to send events. Please add a Fetch API polyfill.");const n={...t,stackParser:(r=t.stackParser||kN,Array.isArray(r)?a_(...r):r),integrations:jx(t),transport:t.transport||pN};var r;return Jx(Jk,n)}
777
+ let jN=0;function qN(e,t){zx(e,{tags:{context:t}})}function UN(e){!function(e){Aw().setUser(e)}(e)}class GN{constructor(e,t,n){this._store=e,this._annotationsService=t,this._toastMessenger=n}async import(e){this._store.beginImport(e.length);const t=this._store.profile().userid;if(!t)throw new Error("Cannot import when logged out");const n=this._store.focusedGroupId();if(!n)throw new Error("Cannot import when no group is selected");const r=this._store.allAnnotations(),o=this._store.defaultContentFrame(),i=async e=>{const i=r.find((t=>function(e,t){return e.text===t.text&&!!function(e,t){return e.length===t.length&&e.every(((e,n)=>t[n]===e))}(e.tags,t.tags)&&Li(e)===Li(t)}(e,t)));if(i)return{type:"duplicate",annotation:i};try{const r=function(e,t){return{target:e.target,tags:e.tags,text:e.text,uri:t?.uri??e.uri,document:t?.metadata??e.document,extra:{source:"import",original_id:e.id}}}(e,o),i=this._annotationsService.annotationFromData(r);i.permissions=Rs(e.permissions)?Ls(t,n):zs(t);return{type:"import",
778
+ annotation:await this._annotationsService.save(i)}}catch(e){return qN(e,"annotation-import"),{type:"error",error:e}}},a=[],s=e.map(((e,t)=>({ann:e,index:t}))),l=[];for(;s.length>0;){const e=s.shift(),t=i(e.ann).then((t=>{this._store.completeImport(1),a[e.index]=t})).then((()=>{const e=l.indexOf(t);-1!==e&&l.splice(e,1)}));l.push(t),l.length>=5&&await Promise.race(l)}await Promise.all(l);const{messageType:c,message:u}=function(e){const t=e.filter((e=>"error"===e.type)),n=t.length>0?`${t.length} imports failed (${t[0].error.message})`:"",r=e.filter((e=>"import"===e.type)).length,o=r>0?`${r} annotations imported`:"",i=e.filter((e=>"duplicate"===e.type)).length,a=i>0?`${i} duplicates skipped`:"";let s;return s=0===t.length?r>0?"success":"notice":r>0?"notice":"error",{messageType:s,message:[o,n,a].filter((e=>e.length>0)).join(", ")}}(a);return"success"===c?this._toastMessenger.success(u):"notice"===c?this._toastMessenger.notice(u,{autoDismiss:!1}):"error"===c&&this._toastMessenger.error(u,{autoDismiss:!1}),a}}
779
+ GN.$inject=["store","annotationsService","toastMessenger"];class VN{constructor(e,t,n,r){this._api=e,this._store=t,this._streamer=n,this._streamFilter=r,this._searchClient=null}load({groupId:e,uris:t,onError:n,maxResults:r,sortBy:o,sortOrder:i,streamFilterBy:a="uri"}){if(this._store.removeAnnotations(this._store.savedAnnotations()),this._searchClient&&this._searchClient.cancel(),"group"===a)this._streamFilter.resetFilter().addClause("/group","equals",e,!0),this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()});else t&&t.length>0&&(this._streamFilter.resetFilter().addClause("/uri","one_of",t),this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()}));const s={incremental:!0,separateReplies:!1,maxResults:r,sortBy:o,sortOrder:i};this._searchClient=new Og(this._api.search,s),this._searchClient.on("resultCount",(e=>{this._store.setAnnotationResultCount(e)})),this._searchClient.on("results",(e=>{e.length&&this._store.addAnnotations(e)})),this._searchClient.on("error",(e=>{
780
+ "function"==typeof n?n(e):console.error(e)})),this._searchClient.on("end",(()=>{this._searchClient=null,t&&t.length>0&&this._store.frames().forEach((e=>{t.indexOf(e.uri)>=0&&this._store.updateFrameAnnotationFetchStatus(e.uri,!0)})),this._store.annotationFetchFinished()})),this._store.annotationFetchStarted(),this._searchClient.get({group:e,uri:t})}async loadThread(e){let t,n;this._store.clearAnnotations();try{this._store.annotationFetchStarted(),t=await this._api.annotation.get({id:e}),_i(t)&&(t=await this._api.annotation.get({id:t.references[0]})),n=await this._api.search({references:t.id})}finally{this._store.annotationFetchFinished()}const r=[t,...n.rows];if(this._store.addAnnotations(r),!_i(t)){const e=t.id;this._streamFilter.addClause("/references","one_of",e,!0).addClause("/id","equals",e,!0),this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()}),this._streamer.connect()}return r}}VN.$inject=["api","store","streamer","streamFilter"];class WN{constructor(){this._store=new Map}
781
+ getItem(e){return this._store.get(e)??null}setItem(e,t){this._store.set(e,t)}removeItem(e){this._store.delete(e)}}class KN{constructor(e){const t="hypothesis.testKey";try{this._storage=e.localStorage,e.localStorage.setItem(t,t),e.localStorage.getItem(t),e.localStorage.removeItem(t)}catch{this._storage=new WN}}getItem(e){return this._storage.getItem(e)}getObject(e){const t=this._storage.getItem(e);return t?JSON.parse(t):null}setItem(e,t){this._storage.setItem(e,t)}setObject(e,t){const n=JSON.stringify(t);this._storage.setItem(e,n)}removeItem(e){this._storage.removeItem(e)}}KN.$inject=["$window"];const YN={annotationPrivacy:"hypothesis.privacy",focusedGroup:"hypothesis.groups.focus"};class XN{constructor(e,t){this._storage=e,this._store=t}init(){for(const[e,t]of Hi(YN)){const n=this._storage.getItem(t);this._store.setDefault(e,n)}Fy(this._store.subscribe,(()=>this._store.getDefaults()),((e,t)=>{for(const[n,r]of Hi(e))t[n]!==r&&n in YN&&this._storage.setItem(YN[n],r)}))}}XN.$inject=["localStorage","store"]
782
+ ;class ZN{constructor(e,t){this._window=e,this._store=t,this._didRegisterPopstateListener=!1}currentRoute(){const e=this._window.location.pathname.slice(1).split("/"),t=new URLSearchParams(this._window.location.search),n={};for(const[e,r]of t)n[e]=r;"client"===e[0]&&e.shift();let r;switch(e[0].replace(/\.html$/,"")){case"a":r="annotation",n.id=e[1]||"";break;case"notebook":r="notebook";break;case"user-profile":r="profile";break;case"stream":r="stream";break;default:r="sidebar"}return{route:r,params:n}}routeUrl(e,t={}){let n;const r={...t};switch(e){case"annotation":{const e=t.id;delete r.id,n=`/a/${e}`}break;case"notebook":n="/notebook";break;case"profile":n="/user-profile";break;case"stream":n="/stream";break;default:throw new Error(`Cannot generate URL for route "${e}"`)}let o=!1;const i=new URLSearchParams;for(const[e,t]of Object.entries(r))o=!0,i.set(e,t);return o&&(n+="?"+i.toString()),n}sync(){const{route:e,params:t}=this.currentRoute();this._store.changeRoute(e,t),
783
+ this._didRegisterPopstateListener||(this._window.addEventListener("popstate",(()=>{this.sync()})),this._didRegisterPopstateListener=!0)}navigate(e,t){this._window.history.pushState({},"",this.routeUrl(e,t)),this.sync()}}ZN.$inject=["$window","store"];class JN{constructor(e,t){this._apiRoutes=e,this._store=t}async init(){try{const e=await this._apiRoutes.links();this._store.updateLinks(e)}catch(e){console.warn(`Failed to fetch Hypothesis links: ${e.message}`)}}}JN.$inject=["apiRoutes","store"];class QN{constructor(e,t,n,r,o){this._api=t,this._auth=n,this._store=e,this._toastMessenger=o,this._authority=Mo(r)?.authority??null,this._lastLoad=null,this._lastLoadTime=null,n.on("oauthTokensChanged",(()=>this.reload()))}load(){return(!this._lastLoad||!this._lastLoadTime||Date.now()-this._lastLoadTime>3e5)&&(this._lastLoadTime=Date.now(),this._lastLoad=_y((()=>{const e=this._authority?{authority:this._authority}:{};return this._api.profile.read(e)})).then((e=>(this.update(e),this._lastLoadTime=Date.now(),
784
+ e))).catch((e=>{throw this._lastLoadTime=null,e}))),this._lastLoad}async dismissSidebarTutorial(){const e=await this._api.profile.update({},{preferences:{show_sidebar_tutorial:!1}});this.update(e)}update(e){const t=this._store.profile(),n=e.userid!==t.userid;return this._store.updateProfile(e),this._lastLoad=Promise.resolve(e),this._lastLoadTime=Date.now(),n&&(e.userid?UN({id:e.userid}):UN(null)),e}async logout(){try{return await this._auth.logout(),this.reload()}catch(e){throw this._toastMessenger.error("Log out failed"),new Error(e)}}reload(){return this._lastLoad=null,this._lastLoadTime=null,this.load()}}QN.$inject=["store","api","auth","settings","toastMessenger"];class eS{constructor(){this._filter={match_policy:"include_any",clauses:[],actions:{create:!0,update:!0,delete:!0}}}addClause(e,t,n,r=!1){return this._filter.clauses.push({field:e,operator:t,value:n,case_sensitive:r}),this}getFilter(){return this._filter}resetFilter(){return this._filter={match_policy:"include_any",clauses:[],actions:{create:!0,
785
+ update:!0,delete:!0}},this}}class tS extends Ig.TinyEmitter{constructor(e){super(),this._messageQueue=[],this._socket=new WebSocket(e),this._socket.onopen=e=>{this.sendMessages(),this.emit("open",e)},this._socket.onclose=e=>{if(1e3===e.code||1001===e.code)return void this.emit("close",e);const t=new Error(`WebSocket closed abnormally, code: ${e.code}`);console.warn(t),this.emit("disconnect")},this._socket.onerror=e=>{this.emit("error",e)},this._socket.onmessage=e=>{this.emit("message",e)}}close(){this._socket.close(1e3)}send(e){this._messageQueue.push(e),this.isConnected()&&this.sendMessages()}isConnected(){return this._socket.readyState===WebSocket.OPEN}sendMessages(){for(;this._messageQueue.length>0;){const e=JSON.stringify(this._messageQueue.shift());this._socket.send(e)}}}class nS{constructor(e,t,n,r,o,i){this._auth=n,this._groups=r,this._session=o,this._store=e,this._websocketURL=t.links().then((e=>e.websocket)),this.clientId=jv(32),this._socket=null,this._updateImmediately=!0,this._configMessages={},
786
+ this._reconnectionAttempts=0,this._reconnectSetUp=!1,this._window=i}applyPendingUpdates(){const e=Object.values(this._store.pendingUpdates());e.length&&(this._store.addAnnotations(e),this._store.highlightAnnotations(e.map((({id:e})=>e)).filter(Boolean)),this._window.setTimeout((()=>this._store.highlightAnnotations([])),5e3));const t=Object.keys(this._store.pendingDeletions()).map((e=>({id:e})));t.length&&this._store.removeAnnotations(t),this._store.clearPendingUpdates()}_handleSocketError(e,t){Xv("Error connecting to H push notification service:",t);const n=new URL(e).hostname;-1!==["localhost","127.0.0.1"].indexOf(n)&&Xv("Check that your H service is configured to allow WebSocket connections from "+window.location.origin)}_handleSocketMessage(e){const t=JSON.parse(e.data);if(t)if("annotation-notification"===t.type){const e=t.payload;switch(t.options.action){case"create":case"update":case"past":this._store.receiveRealTimeUpdates({updatedAnnotations:e});break;case"delete":this._store.receiveRealTimeUpdates({
787
+ deletedAnnotations:e})}this._updateImmediately&&this.applyPendingUpdates()}else if("session-change"===t.type)this._session.update(t.model),this._groups.load();else if("whoyouare"===t.type){const e=this._store.profile().userid;t.userid!==e&&console.warn('WebSocket user ID "%s" does not match logged-in ID "%s"',t.userid,e)}else Xv("Received unsupported notification",t.type)}_sendClientConfig(e){Object.keys(this._configMessages).forEach((t=>{this._configMessages[t]&&e.send(this._configMessages[t])}))}setConfig(e,t){this._configMessages[e]=t,this._socket?.isConnected()&&this._socket.send(t)}async _reconnect(){const e=await this._websocketURL;if(!e)return;let t,n;this._socket?.close();try{t=await this._auth.getAccessToken()}catch(e){throw console.error("Failed to fetch token for WebSocket authentication",e),e}if(t){const r=new URL(e);r.searchParams.set("access_token",t),n=r.toString()}else n=e;const r=new tS(n);r.on("open",(()=>{this._reconnectionAttempts=0,this._sendClientConfig(r)})),r.on("disconnect",(()=>{
788
+ if(++this._reconnectionAttempts,this._reconnectionAttempts<10){const e=1e3*2**this._reconnectionAttempts;setTimeout((()=>this._reconnect()),e)}else console.error("Gave up trying to reconnect to Hypothesis real time update service")})),r.on("error",(t=>this._handleSocketError(e,t))),r.on("message",(e=>this._handleSocketMessage(e))),this._socket=r,this.setConfig("client-id",{messageType:"client_id",value:this.clientId}),this.setConfig("auth-check",{type:"whoami",id:1})}async connect(e={}){this._updateImmediately=e.applyUpdatesImmediately??!0,this._reconnectSetUp||(this._reconnectSetUp=!0,Fy(this._store.subscribe,(()=>this._store.profile().userid),(()=>this._reconnect()))),this._socket||await this._reconnect()}}nS.$inject=["store","apiRoutes","auth","groups","session","$window"];const rS="hypothesis.user.tags.list",oS="hypothesis.user.tags.map";class iS{constructor(e){this._storage=e}filter(e,t=null){const n=this._storage.getObject(rS)||[];let r=0;return n.filter((n=>{if(null!==t&&r>=t)return!1
789
+ ;const o=n.split(/\W+/),i=new RegExp(`^${Qv(e)}`,"i");return!(!o.some((e=>e.match(i)))&&!n.match(i))&&(++r,!0)}))}store(e){const t=this._storage.getObject(oS)||{};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(oS,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(rS,n)}}iS.$inject=["localStorage"];class aS{constructor(e){this._store=e}forceVisible(e){e.children.forEach((e=>{this.forceVisible(e)})),e.visible||this._store.setForcedVisible(e.id,!0)}}aS.$inject=["store"];class sS extends Ig.TinyEmitter{constructor(e,t){super(),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){this._store.getToastMessage(e)&&(this._store.removeToastMessage(e),
790
+ this.emit("toastMessageDismissed",e))}_addMessage(e,t,{autoDismiss:n=!0,visuallyHidden:r=!1,delayed:o=!1}={}){if(this._store.hasToastMessage(e,t))return;if(o&&!this._window.document.hasFocus()){const o={autoDismiss:n,visuallyHidden:r};return void this._delayedMessageQueue.push({type:e,messageText:t,options:o})}const i={type:e,id:jv(10),message:t,visuallyHidden:r,autoDismiss:n};this._store.addToastMessage(i),this.emit("toastMessageAdded",i)}error(e,t){this._addMessage("error",e,t)}success(e,t){this._addMessage("success",e,t)}notice(e,t){this._addMessage("notice",e,t)}}sS.$inject=["store","$window"];const lS=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){console.warn("Could not parse settings from js-hypothesis-config tags",e),o={}}Object.assign(t,o)}return t}(document),cS=function(e){const{version:t,origin:n}=Uv(e.location.href)
791
+ ;return"1.1594.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1594.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 uS(e,t){e.setClientId(t.clientId)}function dS(e){e.sync()}function hS(e,t){e.load(),t.load()}function mS(e,t,n){e.init(),t.init(),n.init()}function pS(e,t,n){"sidebar"===t.route()&&e.connect().catch((()=>{n.error("Hypothesis failed to connect to the web page. Try reloading the page.",{autoDismiss:!1})}))}lS.sentry&&cS&&function(e){const t=function(){const e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;$N({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1594.0",beforeSend:(e,t)=>{
792
+ if(jN>=5)return Xv("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++jN;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{}return e}});try{Ox("host_config",Uv(window.location.href))}catch{}Ox("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),Iy(((e,t)=>{qN(e,t)}))}(lS.sentry),document.body.addEventListener("click",(e=>{const t=e.target;"A"===t.tagName&&"_blank"===t.target&&(t.rel="noopener")})),uS.$inject=["api","streamer"],dS.$inject=["router"],hS.$inject=["groups","session"],mS.$inject=["autosaveService","persistedDefaults","serviceURL"],pS.$inject=["frameSync","store","toastMessenger"];const fS=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",ab)}(),async function(e,t=window){const n=function(e){
793
793
  const t=Uv(e.location.href),n=["annotations","group","query","appType","openSidebar","showHighlights","services","branding","enableExperimentalNewNoteButton","focus","requestConfigFromFrame","theme","usernameUrl"],r={openSidebar:Gv,requestConfigFromFrame:e=>{if("string"==typeof e)return e;const t=function(e){return"object"==typeof e&&null!==e?e:{}}(e);return{origin:Wv(t.origin),ancestorLevel:Vv(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:Kv(n.ancestorLevel,t),origin:n.origin}}(n,t);let o;if(r){const e=await async function(e,t){return{...await qv(t.targetFrame,t.origin,"requestConfig",[],3e3),...e.group?{group:e.group}:{}}}(n,r);o=function(e,t){const n=e.services
794
- ;return Array.isArray(n)?(n.forEach(((e,n)=>{"$rpc:requestGroups"===e.groups&&(e.groups=qv(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=Mo(e);if(!t)return e.apiUrl;if(t.apiUrl)return t.apiUrl;throw new Error("Service should contain an apiUrl value.")}(i),i}(oS).then((e=>{!function(e,t){const n=new V
795
- ;n.register("analytics",sb).register("annotationsExporter",ly).register("annotationsService",cb).register("annotationActivity",lb).register("api",dy).register("apiRoutes",xy).register("auth",Sy).register("autosaveService",Ay).register("dashboard",Ey).register("frameSync",$y).register("groups",Uy).register("importAnnotationsService",$N).register("loadAnnotationsService",jN).register("localStorage",UN).register("persistedDefaults",VN).register("router",WN).register("serviceURL",KN).register("session",YN).register("streamer",JN).register("streamFilter",XN).register("tags",tS).register("threadsService",nS).register("toastMessenger",rS).register("store",{factory:vs}),n.register("$window",{value:window}).register("settings",{value:e}),n.run(sS),n.run(cS),n.run(aS),n.run(lS),n.run(ib),n.run(uS),$(et(Oo.Provider,{value:n,children:et(Hv,{})}),t)}(e,dS)})).catch((e=>function(e,t){console.error("Failed to start Hypothesis client: ",e),$(et(Bv,{error:e}),t)}(e,dS)));
794
+ ;return Array.isArray(n)?(n.forEach(((e,n)=>{"$rpc:requestGroups"===e.groups&&(e.groups=qv(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=Mo(e);if(!t)return e.apiUrl;if(t.apiUrl)return t.apiUrl;throw new Error("Service should contain an apiUrl value.")}(i),i}(lS).then((e=>{!function(e,t){const n=new V
795
+ ;n.register("analytics",sb).register("annotationsExporter",ly).register("annotationsService",cb).register("annotationActivity",lb).register("api",dy).register("apiRoutes",xy).register("auth",Sy).register("autosaveService",Ay).register("dashboard",Ey).register("frameSync",$y).register("groups",Uy).register("importAnnotationsService",GN).register("loadAnnotationsService",VN).register("localStorage",KN).register("persistedDefaults",XN).register("router",ZN).register("serviceURL",JN).register("session",QN).register("streamer",nS).register("streamFilter",eS).register("tags",iS).register("threadsService",aS).register("toastMessenger",sS).register("store",{factory:vs}),n.register("$window",{value:window}).register("settings",{value:e}),n.run(dS),n.run(mS),n.run(uS),n.run(hS),n.run(ib),n.run(pS),$(et(Oo.Provider,{value:n,children:et(Hv,{})}),t)}(e,fS)})).catch((e=>function(e,t){console.error("Failed to start Hypothesis client: ",e),$(et(Bv,{error:e}),t)}(e,fS)));
796
796
  //# sourceMappingURL=sidebar.bundle.js.map