hypothesis 1.1069.0 → 1.1070.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.
|
@@ -93,18 +93,18 @@ uo("checkbox",' <svg\n width="32"\n height="32"\n viewBox="-4 -4 39 39
|
|
|
93
93
|
columnNumber:5})}function yo({children:e,direction:t="row",classes:n,containerRef:r,elementRef:o,...i}){return so("div",{className:Pr(`Hyp-Actions--${t}`,n),...i,ref:null!=o?o:r,children:e},void 0,!1,{fileName:vo,lineNumber:89,columnNumber:5})}var wo='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 8l3.536-3.536L8 8 4.464 4.464 8 8zm0 0l-3.536 3.536L8 8l3.536 3.536L8 8z"></path></g></svg>\n',xo="/home/runner/work/frontend-shared/frontend-shared/src/components/Dialog.js";const ko=uo("cancel",wo);let So=0;function Co(e){const[t]=Vr((()=>(++So,`${e}-${So}`)));return t}
|
|
94
94
|
function Eo({buttons:e,cancelLabel:t="Cancel",children:n,contentClass:r,icon:o,initialFocus:i,onCancel:a,role:s="dialog",title:l,withCancelButton:c=!0,withCloseButton:u=!0}){const h=Co("dialog-description"),d=Co("dialog-title"),p=Xr();Wr((()=>{if(null!==i){const e=null==i?void 0:i.current;e&&!e.disabled?e.focus():p.current.focus()}}),[]),Kr((()=>{const e=p.current.querySelector("p");e&&(e.id=h,p.current.setAttribute("aria-describedby",h))}),[h]);const m=a&&c,f=e||m;return so("div",{"aria-labelledby":d,className:Pr("Hyp-Dialog",{"Hyp-Dialog--closeable":a&&u},r),ref:p,role:s,tabIndex:-1,children:[so("header",{className:"Hyp-Dialog__header",children:[o&&so("div",{className:"Hyp-Dialog__header-icon",children:so(co,{name:o,title:l,"data-testid":"header-icon"},void 0,!1,{fileName:xo,lineNumber:139,columnNumber:13})},void 0,!1,{fileName:xo,lineNumber:138,columnNumber:11}),so("h2",{className:"Hyp-Dialog__title",id:d,children:l},void 0,!1,{fileName:xo,lineNumber:142,columnNumber:9}),a&&u&&so("div",{
|
|
95
95
|
className:"Hyp-Dialog__close",children:so(mo,{"data-testid":"close-button",icon:ko,title:"Close",onClick:a},void 0,!1,{fileName:xo,lineNumber:147,columnNumber:13})},void 0,!1,{fileName:xo,lineNumber:146,columnNumber:11})]},void 0,!0,{fileName:xo,lineNumber:136,columnNumber:7}),n,f&&so("div",{className:"Hyp-Dialog__actions",children:[m&&so(fo,{"data-testid":"cancel-button",onClick:a,children:t},void 0,!1,{fileName:xo,lineNumber:160,columnNumber:13}),e]},void 0,!0,{fileName:xo,lineNumber:158,columnNumber:9})]},void 0,!0,{fileName:xo,lineNumber:125,columnNumber:5})}function Ao({name:e,classes:t="",containerClasses:n="",title:r=""}){const o=lo.get(e);if(!o)throw new Error(`Icon "${e.toString()}" is not registered`);const i=Xr();Kr((()=>{const e=i.current.querySelector("svg");e&&e.setAttribute("class",Pr("Hyp-Icon",t))}),[t,o]);const a={};return r&&(a.title=r),so("span",{className:n,dangerouslySetInnerHTML:{__html:o},ref:i,...a},void 0,!1,{
|
|
96
|
-
fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Icon.js",lineNumber:60,columnNumber:5})}function To({children:e,classes:t="",linkRef:n,...r}){return so("a",{className:Pr("Hyp-Link",t),ref:n,rel:"noopener noreferrer",...r,children:e},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Link.js",lineNumber:24,columnNumber:5})}function No(e
|
|
97
|
-
|
|
98
|
-
const o=!!n;return so("div",{className:Pr("Hyp-Panel",{"Hyp-Panel--closeable":o}),children:[so("header",{className:"Hyp-Panel__header",children:[t&&so("div",{className:"Hyp-Panel__header-icon",children:so(co,{name:t,title:r},void 0,!1,{fileName:
|
|
99
|
-
const
|
|
100
|
-
;function
|
|
101
|
-
var
|
|
102
|
-
;const
|
|
96
|
+
fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Icon.js",lineNumber:60,columnNumber:5})}function To({children:e,classes:t="",linkRef:n,...r}){return so("a",{className:Pr("Hyp-Link",t),ref:n,rel:"noopener noreferrer",...r,children:e},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Link.js",lineNumber:24,columnNumber:5})}function No(e,t,n,{useCapture:r=!1}={}){return t.forEach((t=>e.addEventListener(t,n,r))),()=>{t.forEach((t=>e.removeEventListener(t,n,r)))}}function Mo(e,t,n){Wr((()=>{if(!t)return()=>{};const r=No(document.body,["keydown"],(e=>{"Escape"===function(e){const t={Left:"ArrowLeft",Up:"ArrowUp",Down:"ArrowDown",Right:"ArrowRight",Spacebar:" ",Del:"Delete"};return t[e]?t[e]:e}(e.key)&&n()})),o=No(document.body,["focus"],(t=>{e.current&&!e.current.contains(t.target)&&n()}),{useCapture:!0}),i=No(document.body,["mousedown","click"],(t=>{e.current&&!e.current.contains(t.target)&&n()}),{useCapture:!0});return()=>{r(),i(),o()}}),[e,t,n])}
|
|
97
|
+
var Lo="/home/runner/work/frontend-shared/frontend-shared/src/components/Modal.js";function zo({children:e,onCancel:t,...n}){const r=Xr();return Mo(r,!0,(()=>{t&&t()})),so(m,{children:[so("div",{className:"Hyp-Modal__overlay"},void 0,!1,{fileName:Lo,lineNumber:39,columnNumber:7}),so("div",{className:"Hyp-Modal",ref:r,children:so(Eo,{onCancel:t,...n,children:e},void 0,!1,{fileName:Lo,lineNumber:41,columnNumber:9})},void 0,!1,{fileName:Lo,lineNumber:40,columnNumber:7})]},void 0,!0)}function Oo({message:e,confirmAction:t,onConfirm:n,onCancel:r,...o}){return so(zo,{onCancel:r,buttons:[so(fo,{onClick:n,variant:"primary","data-testid":"confirm-button",children:t},"ok",!1,{fileName:Lo,lineNumber:76,columnNumber:9})],...o,children:so("p",{children:e},void 0,!1,{fileName:Lo,lineNumber:87,columnNumber:7})},void 0,!1,{fileName:Lo,lineNumber:73,columnNumber:5})}var Ro="/home/runner/work/frontend-shared/frontend-shared/src/components/Panel.js";const Do=uo("cancel",wo);function Io({children:e,icon:t,onClose:n,title:r}){
|
|
98
|
+
const o=!!n;return so("div",{className:Pr("Hyp-Panel",{"Hyp-Panel--closeable":o}),children:[so("header",{className:"Hyp-Panel__header",children:[t&&so("div",{className:"Hyp-Panel__header-icon",children:so(co,{name:t,title:r},void 0,!1,{fileName:Ro,lineNumber:37,columnNumber:13})},void 0,!1,{fileName:Ro,lineNumber:36,columnNumber:11}),so("h2",{className:"Hyp-Panel__title",children:r},void 0,!1,{fileName:Ro,lineNumber:40,columnNumber:9}),o&&so("div",{className:"Hyp-Panel__close",children:so(mo,{icon:Do,title:"Close",onClick:n},void 0,!1,{fileName:Ro,lineNumber:43,columnNumber:13})},void 0,!1,{fileName:Ro,lineNumber:42,columnNumber:11})]},void 0,!0,{fileName:Ro,lineNumber:34,columnNumber:7}),so("div",{className:"Hyp-Panel__content",children:e},void 0,!1,{fileName:Ro,lineNumber:47,columnNumber:7})]},void 0,!0,{fileName:Ro,lineNumber:29,columnNumber:5})}
|
|
99
|
+
const Po=uo("spinner",'<svg viewBox="0 0 64 64">\n <g stroke-width="6" stroke="currentColor" stroke-linecap="round">\n <line y1="16" y2="28" transform="translate(32,32) rotate(180)">\n <animate attributeName="stroke-opacity" dur="750ms" values="0;1;.8;.65;.45;.3;.15;0" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(225)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".15;0;1;.8;.65;.45;.3;.15" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(270)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".3;.15;0;1;.8;.65;.45;.3" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(315)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".45;.3;.15;0;1;.85;.65;.45" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(0)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".65;.45;.3;.15;0;1;.8;.65;" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(45)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".8;.65;.45;.3;.15;0;1;.8" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(90)">\n <animate attributeName="stroke-opacity" dur="750ms" values="1;.85;.6;.45;.3;.15;0;1;" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(135)">\n <animate attributeName="stroke-opacity" dur="750ms" values="0;1;.8;.65;.45;.3;.15;0" repeatCount="indefinite"></animate>\n </line>\n </g>\n</svg>')
|
|
100
|
+
;function Bo({classes:e="",size:t="medium"}){return so(Ao,{name:Po,containerClasses:Pr(`Hyp-Spinner--${t}`,e)},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Spinner.js",lineNumber:32,columnNumber:5})}var Fo="/home/runner/work/frontend-shared/frontend-shared/src/components/TextInput.js";function jo({classes:e="",inputRef:t,hasError:n=!1,type:r="text",...o}){return so("input",{className:Pr("Hyp-TextInput",{"has-error":n},e),...o,ref:t,type:r},void 0,!1,{fileName:Fo,lineNumber:39,columnNumber:5})}function Uo({children:e,classes:t=""}){return so("div",{className:Pr("Hyp-TextInputWithButton",t),children:e},void 0,!1,{fileName:Fo,lineNumber:67,columnNumber:5})}
|
|
101
|
+
var Ho='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 4l4 4-4 4"></path></g></svg>',qo='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="24px" height="28px" viewBox="0 0 24 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <rect fill="#ffffff" stroke="none" width="17.14407" height="16.046612" x="3.8855932" y="3.9449153" />\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <path d="M0,2.00494659 C0,0.897645164 0.897026226,0 2.00494659,0 L21.9950534,0 C23.1023548,0 24,0.897026226 24,2.00494659 L24,21.9950534 C24,23.1023548 23.1029738,24 21.9950534,24 L2.00494659,24 C0.897645164,24 0,23.1029738 0,21.9950534 L0,2.00494659 Z M9,24 L12,28 L15,24 L9,24 Z M7.00811294,4 L4,4 L4,20 L7.00811294,20 L7.00811294,15.0028975 C7.00811294,12.004636 8.16824717,12.0097227 9,12 C10,12.0072451 11.0189302,12.0606714 11.0189302,14.003477 L11.0189302,20 L14.0270431,20 L14.0270431,13.1087862 C14.0270433,10 12,9.00309038 10,9.00309064 C8.01081726,9.00309091 8,9.00309086 7.00811294,11.0019317 L7.00811294,4 Z M19,19.9869002 C20.1045695,19.9869002 21,19.0944022 21,17.9934501 C21,16.892498 20.1045695,16 19,16 C17.8954305,16 17,16.892498 17,17.9934501 C17,19.0944022 17.8954305,19.9869002 19,19.9869002 Z" fill="currentColor"></path>\n </g>\n</svg>\n'
|
|
102
|
+
;const $o={add:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M8.99302964,2.86682521 L9,3 L9,6.999 L13,7 C13.5522847,7 14,7.44771525 14,8 C14,8.51283584 13.6139598,8.93550716 13.1166211,8.99327227 L13,9 L9,9 L9,13 C9,14.2873563 7.13555291,14.3317479 7.00697036,13.1331748 L7,13 L7,9 L3,9 C2.44771525,9 2,8.55228475 2,8 C2,7.48716416 2.38604019,7.06449284 2.88337887,7.00672773 L3,7 L7,7 L7,3 C7,1.71264368 8.86444709,1.66825208 8.99302964,2.86682521 Z"></path></svg>',
|
|
103
103
|
annotate:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">\n <path fill="currentColor" fill-rule="nonzero" d="M15 0c.27 0 .505.099.703.297A.961.961 0 0116 1v15l-4-3H1a.974.974 0 01-.703-.29A.953.953 0 010 12V1C0 .719.096.482.29.29A.966.966 0 011 0h14zM7 3l-.469.063c-.312.041-.656.187-1.031.437-.375.25-.719.646-1.031 1.188C4.156 5.229 4 6 4 7l.002.063.006.062a.896.896 0 01.008.11l-.002.074-.006.066a1.447 1.447 0 00.43 1.188C4.729 8.854 5.082 9 5.5 9c.417 0 .77-.146 1.063-.438C6.854 8.271 7 7.918 7 7.5c0-.417-.146-.77-.438-1.063A1.447 1.447 0 005.5 6c-.073 0-.146.005-.219.016-.073.01-.14.026-.203.046.177-1.03.542-1.632 1.094-1.804L7 4V3zm5 0l-.469.063c-.312.041-.656.187-1.031.437-.375.25-.719.646-1.031 1.188C9.156 5.229 9 6 9 7l.002.063.006.062a.896.896 0 01.008.11l-.002.074-.006.066a1.447 1.447 0 00.43 1.188c.291.291.645.437 1.062.437.417 0 .77-.146 1.063-.438.291-.291.437-.645.437-1.062 0-.417-.146-.77-.438-1.063A1.447 1.447 0 0010.5 6c-.073 0-.146.005-.219.016-.073.01-.14.026-.203.046.177-1.03.542-1.632 1.094-1.804L12 4V3z"/>\n</svg>\n',
|
|
104
|
-
"arrow-left":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 12L3 8l4-4M4 8h9-9z"></path></g></svg>\n',"arrow-right":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 4l4 4-4 4m3-4H3h9z"></path></g></svg>\n',cancel:wo,"caret-right":
|
|
104
|
+
"arrow-left":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 12L3 8l4-4M4 8h9-9z"></path></g></svg>\n',"arrow-right":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 4l4 4-4 4m3-4H3h9z"></path></g></svg>\n',cancel:wo,"caret-right":Ho,
|
|
105
105
|
"cc-std":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="currentColor" stroke="none" d="M7.985 0c2.238 0 4.143.781 5.715 2.343a7.694 7.694 0 011.714 2.579C15.804 5.888 16 6.914 16 8a8.164 8.164 0 01-.579 3.078 7.344 7.344 0 01-1.707 2.536 8.222 8.222 0 01-2.657 1.772c-.99.41-2.014.614-3.071.614a7.775 7.775 0 01-3.036-.607 8.047 8.047 0 01-2.6-1.757A7.846 7.846 0 010 8c0-1.057.202-2.074.607-3.05A8.033 8.033 0 012.371 2.33C3.895.777 5.766 0 7.985 0zm.03 1.443c-1.83 0-3.367.638-4.615 1.914a6.878 6.878 0 00-1.45 2.15A6.301 6.301 0 001.443 8c0 .858.168 1.684.507 2.479a6.627 6.627 0 001.45 2.129 6.593 6.593 0 002.129 1.428c.79.329 1.619.493 2.485.493.857 0 1.688-.166 2.494-.5a6.91 6.91 0 002.178-1.442c1.247-1.22 1.871-2.748 1.871-4.586a6.57 6.57 0 00-.486-2.515 6.397 6.397 0 00-1.413-2.114C11.37 2.086 9.824 1.443 8.014 1.443zm-.1 5.229l-1.073.557c-.114-.238-.254-.405-.42-.5a.95.95 0 00-.465-.143c-.714 0-1.072.472-1.072 1.415 0 .428.09.77.271 1.028.181.257.448.386.8.386.467 0 .796-.229.987-.686l.985.5a2.35 2.35 0 01-2.1 1.257c-.714 0-1.29-.218-1.729-.657-.438-.438-.657-1.047-.657-1.828 0-.762.222-1.367.665-1.814.442-.448 1.002-.672 1.678-.672.991 0 1.7.385 2.13 1.157zm4.613 0l-1.057.557c-.114-.238-.255-.405-.421-.5a.972.972 0 00-.479-.143c-.714 0-1.072.472-1.072 1.415 0 .428.091.77.272 1.028.18.257.447.386.8.386.466 0 .795-.229.985-.686l1 .5c-.218.39-.514.698-.885.922a2.308 2.308 0 01-1.214.335c-.724 0-1.302-.218-1.735-.657-.434-.438-.65-1.047-.65-1.828 0-.762.22-1.367.664-1.814.442-.448 1.002-.672 1.678-.672.99 0 1.696.385 2.114 1.157z"></path></g></svg>',
|
|
106
106
|
"cc-zero":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="currentColor" stroke="none" d="M7.983 0c2.238 0 4.148.78 5.72 2.342a7.662 7.662 0 011.715 2.582c.39.962.582 1.99.582 3.076a8.13 8.13 0 01-.583 3.087 7.262 7.262 0 01-1.703 2.526 8.213 8.213 0 01-2.655 1.77c-.99.41-2.018.617-3.076.617a7.902 7.902 0 01-3.042-.6 8.301 8.301 0 01-2.6-1.759A8.087 8.087 0 01.6 11.042 7.84 7.84 0 010 8c0-1.057.2-2.07.6-3.042a8.12 8.12 0 011.77-2.633C3.893.772 5.764 0 7.983 0zm.034 1.44c-1.829 0-3.369.64-4.616 1.915a6.962 6.962 0 00-1.457 2.157 6.388 6.388 0 000 4.969 6.83 6.83 0 003.585 3.558c.79.324 1.62.487 2.488.487.857 0 1.681-.165 2.482-.498a6.88 6.88 0 002.184-1.446C13.931 11.364 14.56 9.838 14.56 8a6.57 6.57 0 00-.487-2.515 6.418 6.418 0 00-1.418-2.118C11.37 2.081 9.826 1.44 8.017 1.44zM8 3.395c2.641 0 3.305 2.492 3.305 4.605 0 2.113-.664 4.605-3.305 4.605S4.694 10.113 4.694 8l.007-.355c.073-2.027.804-4.25 3.299-4.25zm1.316 3.227L7.35 10.017c-.274.412-.083.645.219.774l.135.044c.091.022.19.034.297.034 1.357 0 1.422-1.938 1.422-2.869l-.007-.409a7.282 7.282 0 00-.06-.72l-.04-.25zM8 5.132c-1.258 0-1.406 1.66-1.421 2.646L6.577 8c0 .24.005.544.035.865l.027.244 1.759-3.232c.182-.316.09-.542-.101-.706A1.222 1.222 0 008 5.13z"></path></g></svg>',
|
|
107
|
-
"collapse-menu":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 10l4-4 4 4"></path></g></svg>',collapse:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 11l-4 4 4-4zm-3-1h4v4m9-13l-4 4 4-4zm-1 5h-4V2"></path></g></svg>',collapsed:
|
|
107
|
+
"collapse-menu":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 10l4-4 4 4"></path></g></svg>',collapse:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 11l-4 4 4-4zm-3-1h4v4m9-13l-4 4 4-4zm-1 5h-4V2"></path></g></svg>',collapsed:Ho,
|
|
108
108
|
copy:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 15H1V5h3m11-4v10H7V1h8z"></path></g></svg>',edit:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 4l1 1-9 9-2 1 1-2 9-9zm3-3l1 1-1 1-1-1 1-1z"></path></g></svg>\n',
|
|
109
109
|
email:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 3v10h14V3H1zm0 0l7 6 7-6H1z"></path></g></svg>',"expand-menu":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">\n <path fill="currentColor" fill-rule="nonzero" d="M7.456 11.788L1.226 5.92a.695.695 0 0 1 0-1.025l.726-.684a.804.804 0 0 1 1.087-.001L8 8.861l4.961-4.65a.804.804 0 0 1 1.087.001l.727.684c.3.283.3.742 0 1.025l-6.23 5.867a.804.804 0 0 1-1.09 0z"/>\n</svg>',error:wo,
|
|
110
110
|
expand:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2 14l4-4-4 4zm3 1H1v-4m13-9l-4 4 4-4zm-3-1h4v4"></path></g></svg>',external:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 3h6v6m-1-5l-9 9 9-9z"></path></g></svg>',
|
|
@@ -121,7 +121,7 @@ hide:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0
|
|
|
121
121
|
highlight:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15H1h11zm-.5-6v2l-1 1v-2l1-1zm.5-7v6h-2V2h2zm0-1h-2 2zm0 8h-2 2z"></path></g></svg>',image:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 1v14H1V1h14zM1 15l3-8 4 6 3-4 4 6m-4-9a1 1 0 110-2 1 1 0 010 2z"></path></g></svg>',
|
|
122
122
|
leave:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M8,0 C12.0522847,0 16,3.94771525 16,8 C16,12.0522847 12.0522847,16 8,16 C3.94771525,16 0,12.0522847 0,8 C0,3.94771525 3.94771525,0 8,0 Z M8,2 C5.05228475,2 2,5.05228475 2,8 C2,10.9477153 5.05228475,14 8,14 C10.9477153,14 14,10.9477153 14,8 C14,5.05228475 10.9477153,2 8,2 Z M10.7864022,6.62017694 L10.7071068,6.70710678 L9.415,8 L10.7071068,9.29289322 C11.0976311,9.68341751 11.0976311,10.3165825 10.7071068,10.7071068 C10.3466228,11.0675907 9.77939176,11.0953203 9.38710056,10.7902954 L9.29289322,10.7071068 L8,9.415 L6.70710678,10.7071068 C5.79286771,11.6213459 4.43536121,10.3192478 5.21359778,9.37982306 L5.29289322,9.29289322 L6.585,8 L5.29289322,6.70710678 C4.90236893,6.31658249 4.90236893,5.68341751 5.29289322,5.29289322 C5.65337718,4.93240926 6.22060824,4.90467972 6.61289944,5.20970461 L6.70710678,5.29289322 L8,6.585 L9.29289322,5.29289322 C10.2071323,4.37865415 11.5646388,5.68075222 10.7864022,6.62017694 Z"></path></svg>',
|
|
123
123
|
link:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M9.68027557,6.09714063 C10.0850762,6.47284645 10.1086623,7.10557198 9.73295644,7.51037264 C9.35725062,7.9151733 8.72452509,7.93875933 8.31972443,7.56305351 C7.52101725,6.821753 6.4700536,6.81243414 5.66500421,7.53509692 L2.58706553,11.1273971 L2.50815798,11.2094765 C1.81384474,11.8538863 1.84803625,12.885989 2.50815798,13.4986648 C3.17004601,14.1129799 4.31769172,14.1788096 5.06581128,13.6063341 L5.156,13.529 L6.16163376,12.3189006 C6.48720494,11.9265987 7.04943452,11.8464869 7.46827399,12.1138931 L7.56977663,12.1880051 C7.96207853,12.5135762 8.04219031,13.0758058 7.77478412,13.4946453 L7.70067217,13.5961479 L6.64329964,14.8702449 L6.554056,14.9645777 C5.02884562,16.3801643 2.59807851,16.3107974 1.14760683,14.9645777 C-0.293859995,13.6267155 -0.415580233,11.3582822 0.996093014,9.89228498 L1.095,9.794 L4.19491885,6.17921998 L4.2738264,6.09714063 C5.8499647,4.63428646 8.10413728,4.63428646 9.68027557,6.09714063 Z M14.8523932,1.03542234 C16.29386,2.37328448 16.4155802,4.64171776 15.003907,6.10771502 L14.904,6.205 L11.7857496,9.84275726 L11.7261736,9.90285937 C10.1500353,11.3657135 7.89586272,11.3657135 6.31972443,9.90285937 C5.91492376,9.52715355 5.89133773,8.89442802 6.26704356,8.48962736 C6.64274938,8.0848267 7.27547491,8.06124067 7.68027557,8.43694649 C8.47898275,9.178247 9.5299464,9.18756586 10.3349958,8.46490308 L13.4129345,4.87260289 L13.491842,4.79052353 C14.1861553,4.1461137 14.1519637,3.11401104 13.491842,2.50133522 C12.829954,1.88702005 11.6823083,1.82119037 10.9341887,2.39366585 L10.843,2.47 L9.83836624,3.6810994 C9.51279506,4.0734013 8.95056548,4.15351308 8.53172601,3.88610689 L8.43022337,3.81199494 C8.03792147,3.48642376 7.95780969,2.92419418 8.22521588,2.5053547 L8.29932783,2.40385206 L9.35670036,1.12975511 L9.445944,1.03542234 C10.9711544,-0.380164327 13.4019215,-0.310797434 14.8523932,1.03542234 Z"></path></svg>',
|
|
124
|
-
lock:'<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="48px" height="56px" viewBox="0 0 48 56" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g fill="currentColor">\n <rect x="0" y="24" width="48" height="32"></rect>\n <path d="M24,0 C24,0 8,0 8,16 L8,32 L16,32 L16,16.0000004 C16,8 24,8 24,8 C24,8 32,8 32,16 L32,32 L40,32 L40,16 C40,0 24,0 24,0 Z"></path>\n </g>\n </g>\n</svg>',logo
|
|
124
|
+
lock:'<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="48px" height="56px" viewBox="0 0 48 56" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g fill="currentColor">\n <rect x="0" y="24" width="48" height="32"></rect>\n <path d="M24,0 C24,0 8,0 8,16 L8,32 L16,32 L16,16.0000004 C16,8 24,8 24,8 C24,8 32,8 32,16 L32,32 L40,32 L40,16 C40,0 24,0 24,0 Z"></path>\n </g>\n </g>\n</svg>',logo:qo,pointer:'<svg xmlns="http://www.w3.org/2000/svg" width="15" height="8" viewBox="0 0 15 8" aria-hidden="true" focusable="false"><path d="M0 8 L7 0 L15 8" stroke="currentColor" strokeWidth="2" /></svg>\n',
|
|
125
125
|
profile:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 15c0-2.761 3.134-5 7-5s7 2.239 7 5M8 7a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"></path></g></svg>\n',
|
|
126
126
|
public:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">\n <path fill="currentColor" fill-rule="nonzero" d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zm2.655 11.535c.244-.242.442-.719.442-1.063a1.13 1.13 0 0 0-.288-.696l-.442-.442a1.033 1.033 0 0 0-.73-.302H7.484C7.181 8.88 6.791 8 6.452 8c-.34 0-.674-.08-.978-.231l-.357-.179a.386.386 0 0 1-.213-.345c0-.153.118-.317.263-.366l1.006-.335a.618.618 0 0 1 .163-.026c.106 0 .258.056.338.126l.3.26c.046.04.106.063.169.063h.182a.258.258 0 0 0 .23-.373l-.503-1.006a.306.306 0 0 1-.027-.116c0-.06.035-.143.078-.185l.32-.31a.258.258 0 0 1 .18-.074h.29c.06 0 .141-.034.183-.076l.258-.258c.1-.1.1-.264 0-.364l-.151-.152c-.101-.1-.101-.264 0-.365l.333-.333.151-.151a.516.516 0 0 0 0-.73l-.912-.913a6.45 6.45 0 0 0-.787.078v.365a.516.516 0 0 1-.747.461l-.775-.387a6.487 6.487 0 0 0-3.329 3.287c.32.474.813 1.205 1.116 1.65.138.203.4.503.582.668l.026.023c.308.278.65.516 1.021.702.452.227 1.111.586 1.575.842.328.182.53.527.53.903v1.032c0 .274.11.537.303.73.484.484.785 1.246.73 1.653v.884c.473 0 .932-.055 1.376-.152l.56-1.511c.067-.177.106-.362.155-.544a.771.771 0 0 1 .199-.346l.365-.364zm2.797-2.946l.94.235c.036-.27.06-.544.06-.824a6.4 6.4 0 0 0-.688-2.882l-.419.21a.773.773 0 0 0-.298.263l-.632.947a.908.908 0 0 0-.13.43c0 .13.058.321.13.43l.58.87c.107.16.27.274.457.32z"/>\n</svg>',
|
|
127
127
|
refresh:'<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n \x3c!-- Generator: Sketch 39.1 (31720) - http://www.bohemiancoding.com/sketch --\x3e\n <defs/>\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g fill="currentColor">\n <g>\n <path d="M0,8 C0,12.418278 3.581722,16 8,16 C12.418278,16 16,12.418278 16,8 C16,4.89580324 14.2154684,2.11256098 11.4682644,0.789110134 L10.6002482,2.59092808 C12.661769,3.58405472 14,5.6712248 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,5.65296151 3.35941993,3.55225774 5.44569583,2.56903563 L4.59307587,0.759881355 C1.81273067,2.07020511 0,4.87140735 0,8 Z" />\n <polygon points="7 8.58578644 7 0 9 0 9 8.58578644 10.2928932 7.29289322 11 6.58578644 12.4142136 8 11.7071068 8.70710678 8.70710678 11.7071068 8 12.4142136 7.64644661 12.0606602 7.29289322 11.7071068 4.29289322 8.70710678 3.58578644 8 5 6.58578644 5.70710678 7.29289322"/>\n </g>\n </g>\n </g>\n</svg>',
|
|
@@ -131,86 +131,86 @@ search:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="
|
|
|
131
131
|
share:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M15,9 C15.5128358,9 15.9355072,9.38604019 15.9932723,9.88337887 L16,10 L16,15 C16,15.5128358 15.6139598,15.9355072 15.1166211,15.9932723 L15,16 L1,16 C0.487164161,16 0.0644928393,15.6139598 0.00672773133,15.1166211 L0,15 L0,10 C0,9.44771525 0.44771525,9 1,9 C1.51283584,9 1.93550716,9.38604019 1.99327227,9.88337887 L2,10 L2,14 L14,14 L14,10 C14,9.48716416 14.3860402,9.06449284 14.8833789,9.00672773 L15,9 Z M8.61289944,0.209704612 L8.70710678,0.292893219 L12.7071068,4.29289322 C13.0976311,4.68341751 13.0976311,5.31658249 12.7071068,5.70710678 C12.3466228,6.06759074 11.7793918,6.09532028 11.3871006,5.79029539 L11.2928932,5.70710678 L9,3.415 L9,11 C9,11.5522847 8.55228475,12 8,12 C7.48716416,12 7.06449284,11.6139598 7.00672773,11.1166211 L7,11 L7,3.415 L4.70710678,5.70710678 C4.34662282,6.06759074 3.77939176,6.09532028 3.38710056,5.79029539 L3.29289322,5.70710678 C2.93240926,5.34662282 2.90467972,4.77939176 3.20970461,4.38710056 L3.29289322,4.29289322 L7.29289322,0.292893219 C7.62333685,-0.0375504127 8.12750547,-0.0883878944 8.51140295,0.140380774 L8.61289944,0.209704612 Z"></path></svg>',
|
|
132
132
|
success:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 3L6 13 3 8"></path></g></svg>\n',sort:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false" class="Icon Icon--sort"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 9V2v7zM1 5l4-4 4 4m2 2v7-7zm-4 4l4 4 4-4"></path></g></svg>\n',
|
|
133
133
|
trash:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2 4h12l-2 11H4L2 4zM1 1h14H1z"></path></g></svg>\n',
|
|
134
|
-
twitter:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="currentColor" stroke="none" d="M15.969 3.049c-.59.259-1.22.436-1.884.516a3.305 3.305 0 0 0 1.442-1.815c-.634.37-1.336.64-2.084.79a3.28 3.28 0 0 0-5.59 2.988 9.29 9.29 0 0 1-6.76-3.418A3.214 3.214 0 0 0 .65 3.76c0 1.14.58 2.142 1.459 2.73a3.27 3.27 0 0 1-1.485-.41v.04a3.282 3.282 0 0 0 2.63 3.218 3.33 3.33 0 0 1-1.474.057 3.291 3.291 0 0 0 3.069 2.278A6.578 6.578 0 0 1 .78 13.076c-.26 0-.52-.015-.78-.044a9.33 9.33 0 0 0 5.038 1.472c6.036 0 9.332-4.997 9.332-9.323 0-.14 0-.28-.01-.42.64-.46 1.2-1.04 1.64-1.7l-.031-.012z"></path></g></svg>'};async function
|
|
135
|
-
document.body.appendChild(r),new Promise((o=>{const i=e=>{R(null,r),r.remove(),o(e)};R(so(
|
|
136
|
-
this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({get(e){throw new Error(`Missing ServiceContext provider to provide "${e}" prop`)}});function
|
|
137
|
-
})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):
|
|
138
|
-
;if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(
|
|
139
|
-
(r={dispatch:d,subscribe:h,getState:u,replaceReducer:p})[
|
|
140
|
-
var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var
|
|
141
|
-
if("function"==typeof e)return
|
|
142
|
-
activeApiRequests:e.activeApiRequests-1}},ANNOTATION_SAVE_STARTED(e,t){let n=[];t.annotation.$tag&&!e.activeAnnotationSaveRequests.includes(t.annotation.$tag)&&n.push(t.annotation.$tag);const r=e.activeAnnotationSaveRequests.concat(n);return{...e,activeAnnotationSaveRequests:r}},ANNOTATION_SAVE_FINISHED(e,t){const n=e.activeAnnotationSaveRequests.filter((e=>e!==t.annotation.$tag));return{...e,activeAnnotationSaveRequests:n}},ANNOTATION_FETCH_STARTED:e=>({...e,activeAnnotationFetches:e.activeAnnotationFetches+1}),ANNOTATION_FETCH_FINISHED(e){if(0===e.activeAnnotationFetches)throw new Error("ANNOTATION_FETCH_FINISHED action when no annotation fetches were active");return{...e,hasFetchedAnnotations:!0,activeAnnotationFetches:e.activeAnnotationFetches-1}},SET_ANNOTATION_RESULT_COUNT:(e,t)=>({annotationResultCount:t.resultCount})};const
|
|
143
|
-
actionCreators:{annotationFetchStarted:function(){return
|
|
144
|
-
return e===t};function
|
|
145
|
-
h.put(arguments,t)}return t}return d.clearCache=function(){return h.clear()},d}function
|
|
146
|
-
for(var e=[],t=p.length,n=0;n<t;n++)e.push(p[n].apply(null,arguments));return i=m.apply(null,e)}));return Object.assign(f,{resultFunc:l,memoizedResultFunc:m,dependencies:p,lastResult:function(){return i},recomputations:function(){return a},resetRecomputations:function(){return a=0}}),f};return o}var
|
|
147
|
-
return!e.id}function
|
|
148
|
-
function
|
|
149
|
-
t.$tag&&r.add(t.$tag)):(o.push(
|
|
150
|
-
;const n=Object.assign({},e,{flagged:t.isFlagged});if(n.moderation){const e=t.isFlagged?1:-1;n.moderation={...n.moderation,flagCount:n.moderation.flagCount+e}}return n}return e}))})};function
|
|
151
|
-
reducers:
|
|
152
|
-
selectors:{allAnnotations:function(e){return e.annotations},annotationCount:
|
|
153
|
-
directLinkedGroupFetchFailed:t.directLinkedGroupFetchFailed}),UPDATE_DIRECT_LINKED_GROUP_ID:(e,t)=>({directLinkedGroupId:t.directLinkedGroupId}),UPDATE_DIRECT_LINKED_ANNOTATION_ID:(e,t)=>({directLinkedAnnotationId:t.directLinkedAnnotationId}),CLEAR_DIRECT_LINKED_IDS:()=>({directLinkedAnnotationId:null,directLinkedGroupId:null}),CLEAR_SELECTION:()=>({directLinkedAnnotationId:null,directLinkedGroupId:null,directLinkedGroupFetchFailed:!1})};const
|
|
154
|
-
clearDirectLinkedGroupFetchFailed:function(){return
|
|
155
|
-
;for(let e=0;e<n.length;e++){const r=n[e];if(r.match(t))return r}return null}function
|
|
156
|
-
CHANGE_FOCUS_MODE_USER:(e,t)=>({focusActive:
|
|
157
|
-
actionCreators:{changeFocusModeUser:function(e){return
|
|
158
|
-
;var u=e[c],h=t[c];if(!1===(o=n?n.call(r,u,h,c):void 0)||void 0===o&&u!==h)return!1}return!0};const
|
|
159
|
-
frames:function(e){return e},mainFrame:
|
|
160
|
-
focusedGroupId:o}},FOCUS_GROUP(e,t){const n=e.groups.find((e=>e.id===t.id));return n?{focusedGroupId:t.id}:(console.error(`Attempted to focus group ${t.id} which is not loaded`),{})},LOAD_GROUPS(e,t){const n=t.groups;let r=e.focusedGroupId;return null!==e.focusedGroupId&&n.find((t=>t.id===e.focusedGroupId))||(r=n.length>0?n[0].id:null),{focusedGroupId:r,groups:t.groups}},CLEAR_GROUPS:()=>({filteredGroupIds:null,focusedGroupId:null,groups:[]})};function
|
|
161
|
-
filteredGroupIds:null,groups:[],focusedGroupId:null},{namespace:"groups",reducers:
|
|
162
|
-
actionCreators:{updateLinks:function(e){return
|
|
163
|
-
pendingUpdates:{},pendingDeletions:{}},{namespace:"realTimeUpdates",reducers:
|
|
164
|
-
;return e.annotations&&!e.query&&(t[e.annotations]=!0),t}const
|
|
165
|
-
let n=e.selectedTab;"orphan"===n&&0===
|
|
166
|
-
selectAnnotations:function(e){return t=>{t(
|
|
167
|
-
namespace:"sidebarPanels",reducers:
|
|
168
|
-
getToastMessages:function(e){return e.messages},hasToastMessage:function(e,t,n){return e.messages.some((e=>e.type===t&&e.message===n))}}}),
|
|
169
|
-
;return a===e.getState()&&n.push(new
|
|
170
|
-
return e.children.some((e=>e.visible||
|
|
171
|
-
;if(t.expanded.hasOwnProperty(e.id))n.collapsed=!t.expanded[e.id];else{const r=t.filterFn&&
|
|
172
|
-
const
|
|
173
|
-
;function
|
|
174
|
-
;return e.children.reduce(((e,n)=>e+
|
|
175
|
-
const t=e.selection,n={expanded:t.expanded,forcedVisible:t.forcedVisible,selected:t.selected,sortCompareFn:
|
|
176
|
-
;n.filterFn=t=>function(e,t){const n=(e,t)=>new
|
|
177
|
-
var
|
|
178
|
-
function f(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-c>=i}function g(){var e=
|
|
179
|
-
this._listeners.forEach((({eventTarget:e,eventType:t,listener:n})=>{e.removeEventListener(t,n)})),this._listeners.clear()}}const
|
|
180
|
-
|
|
181
|
-
label:"
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
;return
|
|
185
|
-
t.flag(e).catch((()=>o.error("Flagging annotation failed")))}}),d&&e.flagged&&so(mo,{pressed:!0,icon:"flag--active",title:"Annotation has been reported to the moderators"})]})}),["annotationsService","settings","toastMessenger"]);function
|
|
186
|
-
const n=new ResizeObserver((()=>t(e.clientWidth,e.clientHeight)));return n.observe(e),()=>n.disconnect()}const n=new
|
|
187
|
-
"bg-gradient-to-b from-excerpt-stop-1 via-excerpt-stop-2 to-excerpt-stop-3":!r&&f,"bg-none":r,"opacity-0 pointer-events-none":!f}),title:"Show the full excerpt"}),m&&r&&so(
|
|
188
|
-
;for(let[e,o]of n)t.includes(e)&&("t"===e?r.append("start",
|
|
189
|
-
;let n=t[2];const r=new URLSearchParams(e.search);let o=r.get("start"),i=r.get("end");if(!o){const e=n.match(/\/start\/([^/]+)/);e&&(o=e[1],n=n.replace(e[0],""))}if(!i){const e=n.match(/\/end\/([^/]+)/);e&&(i=e[1],n=n.replace(e[0],""))}const a=new URL(`https://archive.org/embed/${n}`);return o&&a.searchParams.append("start",o),i&&a.searchParams.append("end",i),
|
|
190
|
-
return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},
|
|
191
|
-
;if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return
|
|
192
|
-
;var
|
|
193
|
-
var
|
|
194
|
-
return"undefined"==typeof window?null:window},
|
|
195
|
-
var y=o.createElement("template");y.content&&y.content.ownerDocument&&(o=y.content.ownerDocument)}var w=
|
|
196
|
-
})),G=null,V=null,Y=!0,W=!0,K=!1,X=!1,Z=!1,J=!1,Q=!1,ee=!1,te=!1,ne=!1,re=!0,oe=!0,ie=!1,ae={},se=null,le=
|
|
197
|
-
ce="ADD_DATA_URI_TAGS"in e?
|
|
198
|
-
e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&($.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),L=L=-1===_e.indexOf(e.PARSER_MEDIA_TYPE)?be:e.PARSER_MEDIA_TYPE,z="application/xhtml+xml"===L?function(e){return e}:
|
|
199
|
-
;
|
|
200
|
-
"application/xhtml+xml"===L&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=w?w.createHTML(e):e;if(ge===fe)try{t=(new p).parseFromString(i,L)}catch(e){}if(!t||!t.documentElement){t=S.createDocument(ge,"template",null);try{t.documentElement.innerHTML=ve?"":i}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(o.createTextNode(n),a.childNodes[0]||null),ge===fe?A.call(t,Z?"html":"body")[0]:Z?t.documentElement:a},Oe=function(e){return C.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Re=function(e){return e instanceof d&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof h)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},De=function(e){return"object"===
|
|
201
|
-
},Ie=function(e,t,r){M[e]&&
|
|
202
|
-
e.textContent!==t&&(
|
|
203
|
-
attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H};for(i=a.length;i--;){var l=t=a[i],c=l.name,u=l.namespaceURI;if(r="value"===c?t.value:
|
|
204
|
-
if("object"===
|
|
205
|
-
;return Z&&j["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&
|
|
206
|
-
this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new
|
|
207
|
-
return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},
|
|
134
|
+
twitter:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="currentColor" stroke="none" d="M15.969 3.049c-.59.259-1.22.436-1.884.516a3.305 3.305 0 0 0 1.442-1.815c-.634.37-1.336.64-2.084.79a3.28 3.28 0 0 0-5.59 2.988 9.29 9.29 0 0 1-6.76-3.418A3.214 3.214 0 0 0 .65 3.76c0 1.14.58 2.142 1.459 2.73a3.27 3.27 0 0 1-1.485-.41v.04a3.282 3.282 0 0 0 2.63 3.218 3.33 3.33 0 0 1-1.474.057 3.291 3.291 0 0 0 3.069 2.278A6.578 6.578 0 0 1 .78 13.076c-.26 0-.52-.015-.78-.044a9.33 9.33 0 0 0 5.038 1.472c6.036 0 9.332-4.997 9.332-9.323 0-.14 0-.28-.01-.42.64-.46 1.2-1.04 1.64-1.7l-.031-.012z"></path></g></svg>'};async function Go({title:e="Confirm",message:t,confirmAction:n="Yes"}){const r=document.createElement("div");return r.setAttribute("data-testid","confirm-container"),r.style.position="relative",r.style.zIndex="10",
|
|
135
|
+
document.body.appendChild(r),new Promise((o=>{const i=e=>{R(null,r),r.remove(),o(e)};R(so(Oo,{title:e,message:t,confirmAction:n,onConfirm:()=>i(!0),onCancel:()=>i(!1)}),r)}))}function Vo(e){if(!e)return null;const t=e.match(/^acct:([^@]+)@(.+)/);return t?{username:t[1],provider:t[2]}:null}function Yo(e){const t=Vo(e);return t?t.username:""}function Wo(e,t){const n=Vo(e);return!!n&&n.provider!==t}const Ko={accentColor:"color",appBackgroundColor:"backgroundColor",ctaBackgroundColor:"backgroundColor",ctaTextColor:"color",selectionFontFamily:"fontFamily",annotationFontFamily:"fontFamily"};function Xo(e,t){const n={};if(!t.branding)return n;const{branding:r}=t;return e.forEach((e=>{const t=Ko[e],o=r[e];t&&o&&(n[t]=o)})),n}const Zo=function(e,t){var n={__c:t="__cC"+s++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(_)},
|
|
136
|
+
this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({get(e){throw new Error(`Missing ServiceContext provider to provide "${e}" prop`)}});function Jo(e,t){function n(n){const r=Qr(Zo),o={};for(let e of t)e in n||(o[e]=r.get(e));const i={...o,...n};return so(e,{...i})}const r=e.displayName||e.name;return n.displayName=`withServices(${r})`,n}function Qo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ei(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ti(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ei(Object(n),!0).forEach((function(t){Qo(e,t,n[t])
|
|
137
|
+
})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ei(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ni(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var ri="function"==typeof Symbol&&Symbol.observable||"@@observable",oi=function(){return Math.random().toString(36).substring(7).split("").join(".")},ii={INIT:"@@redux/INIT"+oi(),REPLACE:"@@redux/REPLACE"+oi(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+oi()}};function ai(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function si(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(ni(0))
|
|
138
|
+
;if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(ni(1));return n(si)(e,t)}if("function"!=typeof e)throw new Error(ni(2));var o=e,i=t,a=[],s=a,l=!1;function c(){s===a&&(s=a.slice())}function u(){if(l)throw new Error(ni(3));return i}function h(e){if("function"!=typeof e)throw new Error(ni(4));if(l)throw new Error(ni(5));var t=!0;return c(),s.push(e),function(){if(t){if(l)throw new Error(ni(6));t=!1,c();var n=s.indexOf(e);s.splice(n,1),a=null}}}function d(e){if(!ai(e))throw new Error(ni(7));if(void 0===e.type)throw new Error(ni(8));if(l)throw new Error(ni(9));try{l=!0,i=o(i,e)}finally{l=!1}for(var t=a=s,n=0;n<t.length;n++){(0,t[n])()}return e}function p(e){if("function"!=typeof e)throw new Error(ni(10));o=e,d({type:ii.REPLACE})}function m(){var e,t=h;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(ni(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[ri]=function(){return this},e}return d({type:ii.INIT}),
|
|
139
|
+
(r={dispatch:d,subscribe:h,getState:u,replaceReducer:p})[ri]=m,r}function li(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}var i,a=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:ii.INIT}))throw new Error(ni(12));if(void 0===n(void 0,{type:ii.PROBE_UNKNOWN_ACTION()}))throw new Error(ni(13))}))}(n)}catch(e){i=e}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var r=!1,o={},s=0;s<a.length;s++){var l=a[s],c=n[l],u=e[l],h=c(u,t);if(void 0===h)throw t&&t.type,new Error(ni(14));o[l]=h,r=r||h!==u}return(r=r||a.length!==Object.keys(e).length)?o:e}}function ci(e,t){return function(){return t(e.apply(this,arguments))}}function ui(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function hi(e){return function(t){
|
|
140
|
+
var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var di=hi();function pi(e){return(t={},n)=>{const r=e[n.type];if(!r)return t;const o=r(t,n);return Array.isArray(o)?o:{...t,...o}}}function mi(e,t){const n={};for(let[r,o]of Object.entries(e))n[r]=(...e)=>o(t(),...e);return n}function fi(e,t){return Object.assign(e,t)}function gi(e,t=[],n=[]){const r={};for(let n of e)r[n.namespace]=n.initialState(...t);const o={};for(let t of e)o[t.namespace]=pi(t.reducers);const i=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error(ni(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return r=ui.apply(void 0,i)(n.dispatch),ti(ti({},n),{},{dispatch:r})}}}(...[di],...n);const a=si(li(o),r,i),s={};for(let t of e)fi(s,t.actionCreators);const l=function(e,t){
|
|
141
|
+
if("function"==typeof e)return ci(e,t);if("object"!=typeof e||null===e)throw new Error(ni(16));var n={};for(var r in e){var o=e[r];"function"==typeof o&&(n[r]=ci(o,t))}return n}(s,a.dispatch);Object.assign(a,l);const c={};for(let t of e){const{namespace:e,selectors:n,rootSelectors:r}=t;if(fi(c,mi(n,(()=>a.getState()[e]))),r){fi(c,mi(r,a.getState))}}return Object.assign(a,c),a}function vi(e,t,n){return{type:t,...n}}function _i(e,t){if(!(e instanceof Function)){const t=e;e=()=>t}return{initialState:e,...t}}function bi(e){let t=0;return n=>r=>{if(!window.debug)return void n(r);++t;const o=r.type+" ("+t.toString()+")";console.group(o),console.log("Prev State:",e.getState()),console.log("Action:",r),n(r),console.log("Next State:",e.getState()),console.groupEnd()}}di.withExtraArgument=hi;const yi={API_REQUEST_STARTED:e=>({...e,activeApiRequests:e.activeApiRequests+1}),API_REQUEST_FINISHED(e){if(0===e.activeApiRequests)throw new Error("API_REQUEST_FINISHED action when no requests were active");return{...e,
|
|
142
|
+
activeApiRequests:e.activeApiRequests-1}},ANNOTATION_SAVE_STARTED(e,t){let n=[];t.annotation.$tag&&!e.activeAnnotationSaveRequests.includes(t.annotation.$tag)&&n.push(t.annotation.$tag);const r=e.activeAnnotationSaveRequests.concat(n);return{...e,activeAnnotationSaveRequests:r}},ANNOTATION_SAVE_FINISHED(e,t){const n=e.activeAnnotationSaveRequests.filter((e=>e!==t.annotation.$tag));return{...e,activeAnnotationSaveRequests:n}},ANNOTATION_FETCH_STARTED:e=>({...e,activeAnnotationFetches:e.activeAnnotationFetches+1}),ANNOTATION_FETCH_FINISHED(e){if(0===e.activeAnnotationFetches)throw new Error("ANNOTATION_FETCH_FINISHED action when no annotation fetches were active");return{...e,hasFetchedAnnotations:!0,activeAnnotationFetches:e.activeAnnotationFetches-1}},SET_ANNOTATION_RESULT_COUNT:(e,t)=>({annotationResultCount:t.resultCount})};const wi=_i({activeAnnotationSaveRequests:[],activeApiRequests:0,activeAnnotationFetches:0,hasFetchedAnnotations:!1,annotationResultCount:null},{reducers:yi,namespace:"activity",
|
|
143
|
+
actionCreators:{annotationFetchStarted:function(){return vi(0,"ANNOTATION_FETCH_STARTED",void 0)},annotationFetchFinished:function(){return vi(0,"ANNOTATION_FETCH_FINISHED",void 0)},annotationSaveStarted:function(e){return vi(0,"ANNOTATION_SAVE_STARTED",{annotation:e})},annotationSaveFinished:function(e){return vi(0,"ANNOTATION_SAVE_FINISHED",{annotation:e})},apiRequestStarted:function(){return vi(0,"API_REQUEST_STARTED",void 0)},apiRequestFinished:function(){return vi(0,"API_REQUEST_FINISHED",void 0)},setAnnotationResultCount:function(e){return vi(0,"SET_ANNOTATION_RESULT_COUNT",{resultCount:e})}},selectors:{hasFetchedAnnotations:function(e){return e.hasFetchedAnnotations},isLoading:function(e){return e.activeApiRequests>0||!e.hasFetchedAnnotations},isFetchingAnnotations:function(e){return e.activeAnnotationFetches>0},isSavingAnnotation:function(e,t){return!!t.$tag&&e.activeAnnotationSaveRequests.includes(t.$tag)},annotationResultCount:function(e){return e.annotationResultCount}}});var xi=function(e,t){
|
|
144
|
+
return e===t};function ki(e,t){var n,r,o="object"==typeof t?t:{equalityCheck:t},i=o.equalityCheck,a=void 0===i?xi:i,s=o.maxSize,l=void 0===s?1:s,c=o.resultEqualityCheck,u=function(e){return function(t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,o=0;o<r;o++)if(!e(t[o],n[o]))return!1;return!0}}(a),h=1===l?(n=u,{get:function(e){return r&&n(r.key,e)?r.value:"NOT_FOUND"},put:function(e,t){r={key:e,value:t}},getEntries:function(){return r?[r]:[]},clear:function(){r=void 0}}):function(e,t){var n=[];function r(e){var r=n.findIndex((function(n){return t(e,n.key)}));if(r>-1){var o=n[r];return r>0&&(n.splice(r,1),n.unshift(o)),o.value}return"NOT_FOUND"}return{get:r,put:function(t,o){"NOT_FOUND"===r(t)&&(n.unshift({key:t,value:o}),n.length>e&&n.pop())},getEntries:function(){return n},clear:function(){n=[]}}}(l,u);function d(){var t=h.get(arguments);if("NOT_FOUND"===t){if(t=e.apply(null,arguments),c){var n=h.getEntries(),r=n.find((function(e){return c(e.value,t)}));r&&(t=r.value)}
|
|
145
|
+
h.put(arguments,t)}return t}return d.clearCache=function(){return h.clear()},d}function Si(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var n=t.map((function(e){return"function"==typeof e?"function "+(e.name||"unnamed")+"()":typeof e})).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function Ci(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i,a=0,s={memoizeOptions:void 0},l=r.pop();if("object"==typeof l&&(s=l,l=r.pop()),"function"!=typeof l)throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof l+"]");var c=s,u=c.memoizeOptions,h=void 0===u?n:u,d=Array.isArray(h)?h:[h],p=Si(r),m=e.apply(void 0,[function(){return a++,l.apply(null,arguments)}].concat(d)),f=e((function(){
|
|
146
|
+
for(var e=[],t=p.length,n=0;n<t;n++)e.push(p[n].apply(null,arguments));return i=m.apply(null,e)}));return Object.assign(f,{resultFunc:l,memoizedResultFunc:m,dependencies:p,lastResult:function(){return i},recomputations:function(){return a},resetRecomputations:function(){return a=0}}),f};return o}var Ei=Ci(ki);function Ai(e){const t=e.uri;let n;try{n=new URL(t).hostname}catch{n=""}"localhost"===n&&(n="");let r=n;return e.document&&e.document.title&&(r=e.document.title[0]),{uri:t,domain:n,title:r}}function Ti(e){let t=e.uri;return t&&0!==t.indexOf("http://")&&0!==t.indexOf("https://")&&(t=null),e.links&&e.links.incontext&&(t=e.links.incontext),t}function Ni(e){const t=Ai(e);let n="";if(t.uri&&0===t.uri.indexOf("file://")&&t.title){const e=t.uri.split("/"),r=e[e.length-1];r&&(n=r)}else t.domain&&t.domain!==t.title&&(n=t.domain);return n}function Mi(e){let t=Ai(e).title;return t.length>30&&(t=t.slice(0,30)+"…"),t}function Li(e){return(e.references||[]).length>0}function zi(e){return!!e.id}function Oi(e){
|
|
147
|
+
return!e.id}function Ri(e){let t=!1;return e.permissions?(e.permissions.read.forEach((e=>{const n=e.split(":");2===n.length&&"group"===n[0]&&(t=!0)})),t):t}function Di(e){return!!(e.target&&e.target.length>0&&e.target[0].selector)}function Ii(e){return Di(e)&&void 0===e.$orphan&&!e.$anchorTimeout}function Pi(e){return!!e.hidden}function Bi(e){return!!e.$highlight||!Oi(e)&&!(ji(e)||Li(e)||e.hidden||e.text||e.tags&&e.tags.length)}function Fi(e){return Di(e)&&!0===e.$orphan}function ji(e){return!Di(e)&&!Li(e)}function Ui(e){return!(!Di(e)||Fi(e))}function Hi(e){return Li(e)?"Reply":Bi(e)?"Highlight":ji(e)?"Page note":"Annotation"}function qi(e){if(e){const t=e.target||[];for(let e=0;e<t.length;e++){const n=t[e].selector||[];for(const e of n)if("TextPositionSelector"===e.type)return e.start}}return Number.POSITIVE_INFINITY}function $i(e){if(0===e.target.length)return null;const t=e.target[0];if(!t.selector)return null;const n=t.selector.find((e=>"TextQuoteSelector"===e.type));return n?n.exact:null}
|
|
148
|
+
function Gi(e,t){return e.reduce(((e,n)=>t(n)?e+1:e),0)}function Vi(e){const t={};return e.forEach((e=>t[e]=!0)),t}function Yi(e){return Object.keys(e).filter((t=>!0===e[t]))}function Wi(e){return Object.entries(e)}const Ki={CHANGE_ROUTE:(e,{name:t,params:n})=>({name:t,params:n})};const Xi=_i({name:null,params:{}},{namespace:"route",reducers:Ki,actionCreators:{changeRoute:function(e,t={}){return vi(0,"CHANGE_ROUTE",{name:e,params:t})}},selectors:{route:function(e){return e.name},routeParams:function(e){return e.params}}});function Zi(e,t){return e.find((e=>e.id===t))}function Ji(e,t){return e.find((e=>e.$tag===t))}function Qi(e,t){let n=e.$orphan;return e.id||(n=!1),Object.assign({},e,{$anchorTimeout:!1,$tag:e.$tag||t,$orphan:n})}const ea={ADD_ANNOTATIONS(e,t){const n=new Set,r=new Set,o=[],i=[],a=[];let s=e.nextTag;for(let i of t.annotations){let t;i.id&&(t=Zi(e.annotations,i.id)),!t&&i.$tag&&(t=Ji(e.annotations,i.$tag)),t?(a.push(Object.assign({},t,i)),i.id&&n.add(i.id),
|
|
149
|
+
t.$tag&&r.add(t.$tag)):(o.push(Qi(i,"t"+s)),++s)}for(let t of e.annotations)n.has(t.id)||r.has(t.$tag)||i.push(t);return{annotations:o.concat(a).concat(i),nextTag:s}},CLEAR_ANNOTATIONS:()=>({annotations:[],focused:{},highlighted:{}}),FOCUS_ANNOTATIONS:(e,t)=>({focused:Vi(t.focusedTags)}),HIDE_ANNOTATION:(e,t)=>({annotations:e.annotations.map((e=>e.id!==t.id?e:{...e,hidden:!0}))}),HIGHLIGHT_ANNOTATIONS:(e,t)=>({highlighted:t.highlighted}),REMOVE_ANNOTATIONS:(e,t)=>({annotations:[...t.remainingAnnotations]}),UNHIDE_ANNOTATION:(e,t)=>({annotations:e.annotations.map((e=>e.id!==t.id?e:Object.assign({},e,{hidden:!1})))}),UPDATE_ANCHOR_STATUS:(e,t)=>({annotations:e.annotations.map((e=>{if(!t.statusUpdates.hasOwnProperty(e.$tag))return e;const n=t.statusUpdates[e.$tag];return"timeout"===n?Object.assign({},e,{$anchorTimeout:!0}):Object.assign({},e,{$orphan:"orphan"===n})}))}),UPDATE_FLAG_STATUS:(e,t)=>({annotations:e.annotations.map((e=>{if(e.id&&e.id===t.id){if(e.flagged===t.isFlagged)return e
|
|
150
|
+
;const n=Object.assign({},e,{flagged:t.isFlagged});if(n.moderation){const e=t.isFlagged?1:-1;n.moderation={...n.moderation,flagCount:n.moderation.flagCount+e}}return n}return e}))})};function ta(e){return(t,n)=>{const r=function(e,t){const n=new Set,r=new Set;for(let e of t)e.id&&n.add(e.id),e.$tag&&r.add(e.$tag);return e.filter((e=>!(e.id&&n.has(e.id)||e.$tag&&r.has(e.$tag))))}(n().annotations.annotations,e);t(vi(0,"REMOVE_ANNOTATIONS",{annotationsToRemove:e,remainingAnnotations:r}))}}function na(e){return vi(0,"UPDATE_ANCHOR_STATUS",{statusUpdates:e})}const ra=Ei((e=>e.annotations),(e=>Gi(e,Ui)));const oa=Ei((e=>e.focused),(e=>Yi(e))),ia=Ei((e=>e.highlighted),(e=>Yi(e)));const aa=Ei((e=>e.annotations),(e=>e.some(Ii))),sa=Ei((e=>e.annotations),(e=>e.filter((e=>Oi(e)&&!Bi(e))))),la=Ei((e=>e.annotations),(e=>e.filter((e=>Oi(e)&&Bi(e))))),ca=Ei((e=>e.annotations),(e=>Gi(e,ji))),ua=Ei((e=>e.annotations),(e=>Gi(e,Fi)));const ha=_i({annotations:[],focused:{},highlighted:{},nextTag:1},{namespace:"annotations",
|
|
151
|
+
reducers:ea,actionCreators:{addAnnotations:function(e){return function(t,n){const r=e.filter((e=>!e.id||!Zi(n().annotations.annotations,e.id)));if(t(vi(0,"ADD_ANNOTATIONS",{annotations:e,currentAnnotationCount:n().annotations.annotations.length})),"sidebar"!==Xi.selectors.route(n().route))return;const o=r.filter(Ii).map((e=>e.id));o.length>0&&setTimeout((()=>{const e=n().annotations.annotations,r=o.map((t=>t?Zi(e,t):null)).filter((e=>e&&Ii(e))).reduce(((e,t)=>(e[t.$tag]="timeout",e)),{});t(na(r))}),500)}},clearAnnotations:function(){return vi(0,"CLEAR_ANNOTATIONS",void 0)},focusAnnotations:function(e){return vi(0,"FOCUS_ANNOTATIONS",{focusedTags:e})},hideAnnotation:function(e){return vi(0,"HIDE_ANNOTATION",{id:e})},highlightAnnotations:function(e){return vi(0,"HIGHLIGHT_ANNOTATIONS",{highlighted:Vi(e)})},removeAnnotations:ta,unhideAnnotation:function(e){return vi(0,"UNHIDE_ANNOTATION",{id:e})},updateAnchorStatus:na,updateFlagStatus:function(e,t){return vi(0,"UPDATE_FLAG_STATUS",{id:e,isFlagged:t})}},
|
|
152
|
+
selectors:{allAnnotations:function(e){return e.annotations},annotationCount:ra,annotationExists:function(e,t){return e.annotations.some((e=>e.id===t))},findAnnotationByID:function(e,t){return Zi(e.annotations,t)},findIDsForTags:function(e,t){const n=[];for(let r of t){const t=Ji(e.annotations,r);t&&t.id&&n.push(t.id)}return n},focusedAnnotations:oa,highlightedAnnotations:ia,isAnnotationFocused:function(e,t){return!0===e.focused[t]},isWaitingToAnchorAnnotations:aa,newAnnotations:sa,newHighlights:la,noteCount:ca,orphanCount:ua,savedAnnotations:function(e){return e.annotations.filter((e=>zi(e)))}}}),da={SET_DEFAULT:(e,t)=>({[t.defaultKey]:t.value})};const pa=_i({annotationPrivacy:null,focusedGroup:null},{namespace:"defaults",reducers:da,actionCreators:{setDefault:function(e,t){return vi(0,"SET_DEFAULT",{defaultKey:e,value:t})}},selectors:{getDefault:function(e,t){return e[t]},getDefaults:function(e){return e}}});const ma={UPDATE_DIRECT_LINKED_GROUP_FETCH_FAILED:(e,t)=>({
|
|
153
|
+
directLinkedGroupFetchFailed:t.directLinkedGroupFetchFailed}),UPDATE_DIRECT_LINKED_GROUP_ID:(e,t)=>({directLinkedGroupId:t.directLinkedGroupId}),UPDATE_DIRECT_LINKED_ANNOTATION_ID:(e,t)=>({directLinkedAnnotationId:t.directLinkedAnnotationId}),CLEAR_DIRECT_LINKED_IDS:()=>({directLinkedAnnotationId:null,directLinkedGroupId:null}),CLEAR_SELECTION:()=>({directLinkedAnnotationId:null,directLinkedGroupId:null,directLinkedGroupFetchFailed:!1})};const fa=_i((function(e){return{directLinkedGroupId:e.group||null,directLinkedAnnotationId:e.annotations||null,directLinkedGroupFetchFailed:!1}}),{namespace:"directLinked",reducers:ma,actionCreators:{setDirectLinkedGroupFetchFailed:function(){return vi(0,"UPDATE_DIRECT_LINKED_GROUP_FETCH_FAILED",{directLinkedGroupFetchFailed:!0})},setDirectLinkedGroupId:function(e){return vi(0,"UPDATE_DIRECT_LINKED_GROUP_ID",{directLinkedGroupId:e})},setDirectLinkedAnnotationId:function(e){return vi(0,"UPDATE_DIRECT_LINKED_ANNOTATION_ID",{directLinkedAnnotationId:e})},
|
|
154
|
+
clearDirectLinkedGroupFetchFailed:function(){return vi(0,"UPDATE_DIRECT_LINKED_GROUP_FETCH_FAILED",{directLinkedGroupFetchFailed:!1})},clearDirectLinkedIds:function(){return vi(0,"CLEAR_DIRECT_LINKED_IDS",void 0)}},selectors:{directLinkedAnnotationId:function(e){return e.directLinkedAnnotationId},directLinkedGroupFetchFailed:function(e){return e.directLinkedGroupFetchFailed},directLinkedGroupId:function(e){return e.directLinkedGroupId}}});class ga{constructor(e,t){this.annotation={id:e.id,$tag:e.$tag},this.isPrivate=t.isPrivate,this.tags=t.tags,this.text=t.text}match(e){return this.annotation.$tag&&e.$tag===this.annotation.$tag||this.annotation.id&&e.id===this.annotation.id}isEmpty(){return!this.text&&0===this.tags.length}}const va={DISCARD_ALL_DRAFTS:()=>[],REMOVE_DRAFT:(e,t)=>e.filter((e=>!e.match(t.annotation))),UPDATE_DRAFT(e,t){const n=e.filter((e=>!e.match(t.draft.annotation)));return n.push(t.draft),n}};function _a(e){return vi(0,"REMOVE_DRAFT",{annotation:e})}function ba(e,t){const n=e
|
|
155
|
+
;for(let e=0;e<n.length;e++){const r=n[e];if(r.match(t))return r}return null}function ya(e,t){const n=ba(e,t);return n?n.isEmpty()?null:n:null}const wa=Ei((e=>e),(e=>e.filter((e=>!e.annotation.id)).map((e=>e.annotation)))),xa=_i([],{namespace:"drafts",reducers:va,actionCreators:{createDraft:function(e,t){return vi(0,"UPDATE_DRAFT",{draft:new ga(e,t)})},deleteNewAndEmptyDrafts:function(){return(e,t)=>{const n=t().drafts.filter((e=>!e.annotation.id&&!ya(t().drafts,e.annotation))).map((t=>(e(_a(t.annotation)),t.annotation)));e(ta(n))}},discardAllDrafts:function(){return vi(0,"DISCARD_ALL_DRAFTS",void 0)},removeDraft:_a},selectors:{countDrafts:function(e){return e.length},getDraft:ba,getDraftIfNotEmpty:ya,unsavedAnnotations:wa}});function ka(e){var t,n;return!!(null!==(t=e.user)&&void 0!==t&&t.username||null!==(n=e.user)&&void 0!==n&&n.userid)}function Sa(e){const t=e.user;if(!t||!ka(e))return{};const n=t.username||t.userid||"";return{user:{value:n,display:t.displayName||n}}}const Ca={
|
|
156
|
+
CHANGE_FOCUS_MODE_USER:(e,t)=>({focusActive:ka({user:t.user}),focusFilters:Sa({user:t.user})}),SET_FILTER(e,t){var n;const r={...e.filters,[t.filterName]:t.filterOption};return""===(null===(n=t.filterOption)||void 0===n?void 0:n.value)&&delete r[t.filterName],{filters:r}},SET_FILTER_QUERY:(e,t)=>({query:t.query}),SET_FOCUS_MODE(e,t){var n;return{focusActive:null!==(n=t.active)&&void 0!==n?n:!e.focusActive}},CLEAR_SELECTION:()=>({filters:{},focusActive:!1,query:null})};const Ea=Ei((e=>e.focusActive),(e=>e.focusFilters),((e,t)=>{var n;return{active:e,configured:!(null==t||!t.user),displayName:(null==t||null===(n=t.user)||void 0===n?void 0:n.display)||""}})),Aa=Ei((e=>e.filters),(e=>e.focusActive),(e=>e.focusFilters),((e,t,n)=>t?{...n,...e}:{...e}));const Ta=Ei((e=>Aa(e)),(e=>{const t={};for(let[n,r]of Object.entries(e))r&&(t[n]=r.value);return t}));const Na=_i((function(e){const t=e.focus||{};return{filters:{},focusActive:ka(t),focusFilters:Sa(t),query:e.query||null}}),{namespace:"filters",reducers:Ca,
|
|
157
|
+
actionCreators:{changeFocusModeUser:function(e){return vi(0,"CHANGE_FOCUS_MODE_USER",{user:e})},setFilter:function(e,t){return(n,r)=>{var o;null!==(o=r().filters.focusFilters)&&void 0!==o&&o[e]&&n(vi(0,"SET_FOCUS_MODE",{active:!1})),n(vi(0,"SET_FILTER",{filterName:e,filterOption:t}))}},setFilterQuery:function(e){return vi(0,"SET_FILTER_QUERY",{query:e})},toggleFocusMode:function(e){return vi(0,"SET_FOCUS_MODE",{active:e})}},selectors:{filterQuery:function(e){return e.query},focusState:Ea,getFilter:function(e,t){return Aa(e)[t]},getFilters:Aa,getFilterValues:Ta,getFocusFilters:function(e){return e.focusFilters},hasAppliedFilter:function(e){return!(!e.query&&!Object.keys(Aa(e)).length)}}});var Ma=function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<i.length;l++){var c=i[l];if(!s(c))return!1
|
|
158
|
+
;var u=e[c],h=t[c];if(!1===(o=n?n.call(r,u,h,c):void 0)||void 0===o&&u!==h)return!1}return!0};const La={CONNECT_FRAME:(e,t)=>[...e,t.frame],DESTROY_FRAME:(e,t)=>e.filter((e=>e!==t.frame)),UPDATE_FRAME_ANNOTATION_FETCH_STATUS:(e,t)=>e.map((e=>e.uri&&e.uri===t.uri?Object.assign({},e,{isAnnotationFetchComplete:t.isAnnotationFetchComplete}):e))};const za=Ei((e=>e),(e=>e.find((e=>!e.id))||null));const Oa=Ci(ki,Ma)((e=>e.reduce(((e,t)=>e.concat(function(e){let t=[e.uri];return e.metadata&&e.metadata.documentFingerprint&&(t=e.metadata.link.map((e=>e.href))),e.metadata&&e.metadata.link&&e.metadata.link.forEach((e=>{e.href.startsWith("doi:")&&t.push(e.href)})),t}(t))),[])),(e=>e)),Ra=_i([],{namespace:"frames",reducers:La,actionCreators:{connectFrame:function(e){return vi(0,"CONNECT_FRAME",{frame:e})},destroyFrame:function(e){return vi(0,"DESTROY_FRAME",{frame:e})},updateFrameAnnotationFetchStatus:function(e,t){return vi(0,"UPDATE_FRAME_ANNOTATION_FETCH_STATUS",{uri:e,isAnnotationFetchComplete:t})}},selectors:{
|
|
159
|
+
frames:function(e){return e},mainFrame:za,searchUris:Oa}}),Da={features:{},preferences:{},userid:null};const Ia={UPDATE_PROFILE:(e,t)=>({profile:{...t.profile}})};const Pa=_i((function(e){var t;return{defaultAuthority:null!==(t=null==e?void 0:e.authDomain)&&void 0!==t?t:"",profile:Da}}),{namespace:"session",reducers:Ia,actionCreators:{updateProfile:function(e){return vi(0,"UPDATE_PROFILE",{profile:e})}},selectors:{defaultAuthority:function(e){return e.defaultAuthority},hasFetchedProfile:function(e){return e.profile!==Da},isFeatureEnabled:function(e,t){return!!e.profile.features[t]},isLoggedIn:function(e){return null!==e.profile.userid},profile:function(e){return e.profile}}}),Ba={FILTER_GROUPS(e,t){var n;if(null===(n=t.filteredGroupIds)||void 0===n||!n.length)return{filteredGroupIds:null};const r=e.groups.filter((e=>t.filteredGroupIds.includes(e.id)));if(!r.length)return{filteredGroupIds:null};let o=e.focusedGroupId;return o&&t.filteredGroupIds.includes(o)||(o=r[0].id),{filteredGroupIds:t.filteredGroupIds,
|
|
160
|
+
focusedGroupId:o}},FOCUS_GROUP(e,t){const n=e.groups.find((e=>e.id===t.id));return n?{focusedGroupId:t.id}:(console.error(`Attempted to focus group ${t.id} which is not loaded`),{})},LOAD_GROUPS(e,t){const n=t.groups;let r=e.focusedGroupId;return null!==e.focusedGroupId&&n.find((t=>t.id===e.focusedGroupId))||(r=n.length>0?n[0].id:null),{focusedGroupId:r,groups:t.groups}},CLEAR_GROUPS:()=>({filteredGroupIds:null,focusedGroupId:null,groups:[]})};function Fa(e){return e.filteredGroupIds?e.groups.filter((t=>{var n;return null===(n=e.filteredGroupIds)||void 0===n?void 0:n.includes(t.id)})):e.groups}function ja(e,t){return e.groups.find((e=>e.id===t))}const Ua=Ei((e=>Fa(e)),(e=>e.filter((e=>!e.isMember&&e.isScopedToUri)))),Ha=Ei((e=>Fa(e)),(e=>e.filter((e=>e.isScopedToUri)))),qa=Ei((e=>Fa(e.groups)),(e=>Pa.selectors.isLoggedIn(e.session)),((e,t)=>t?e.filter((e=>e.isMember)):[])),$a=Ei((e=>Fa(e.groups)),(e=>qa(e)),(e=>Ua(e.groups)),((e,t,n)=>e.filter((e=>!t.includes(e)&&!n.includes(e))))),Ga=_i({
|
|
161
|
+
filteredGroupIds:null,groups:[],focusedGroupId:null},{namespace:"groups",reducers:Ba,actionCreators:{filterGroups:function(e){return vi(0,"FILTER_GROUPS",{filteredGroupIds:e})},focusGroup:function(e){return vi(0,"FOCUS_GROUP",{id:e})},loadGroups:function(e){return vi(0,"LOAD_GROUPS",{groups:e})},clearGroups:function(){return vi(0,"CLEAR_GROUPS",void 0)}},selectors:{allGroups:function(e){return e.groups},filteredGroups:Fa,filteredGroupIds:function(e){return e.filteredGroupIds},focusedGroup:function(e){return e.focusedGroupId?ja(e,e.focusedGroupId):null},focusedGroupId:function(e){return e.focusedGroupId},getFeaturedGroups:Ua,getGroup:ja,getInScopeGroups:Ha},rootSelectors:{getCurrentlyViewingGroups:$a,getMyGroups:qa}});function Va(e,t){const n={};for(const r in t)if(t.hasOwnProperty(r)){const o=t[r],i=":"+r;-1!==e.indexOf(i)?e=e.replace(i,encodeURIComponent(String(o))):n[r]=o}return{url:e,unusedParams:n}}const Ya={UPDATE_LINKS:(e,t)=>({...t.links})};const Wa=_i(null,{namespace:"links",reducers:Ya,
|
|
162
|
+
actionCreators:{updateLinks:function(e){return vi(0,"UPDATE_LINKS",{links:e})}},selectors:{getLink:function(e,t,n={}){if(!e)return"";const r=e[t];if(!r)throw new Error(`Unknown link "${t}"`);const{url:o,unusedParams:i}=Va(r,n),a=Object.keys(i);if(a.length>0)throw new Error(`Unused parameters: ${a.join(", ")}`);return o}}}),Ka={RECEIVE_REAL_TIME_UPDATES:(e,t)=>({pendingUpdates:{...t.pendingUpdates},pendingDeletions:{...t.pendingDeletions}}),CLEAR_PENDING_UPDATES:()=>({pendingUpdates:{},pendingDeletions:{}}),ADD_ANNOTATIONS(e,{annotations:t}){const n={...e.pendingUpdates};for(let e of t)e.id&&delete n[e.id];return{pendingUpdates:n}},REMOVE_ANNOTATIONS(e,{annotationsToRemove:t}){const n={...e.pendingUpdates},r={...e.pendingDeletions};for(let e of t)e.id&&(delete n[e.id],delete r[e.id]);return{pendingUpdates:n,pendingDeletions:r}},FOCUS_GROUP:()=>({pendingUpdates:{},pendingDeletions:{}})};const Xa=Ei((e=>[e.pendingUpdates,e.pendingDeletions]),(([e,t])=>Object.keys(e).length+Object.keys(t).length));const Za=_i({
|
|
163
|
+
pendingUpdates:{},pendingDeletions:{}},{namespace:"realTimeUpdates",reducers:Ka,actionCreators:{receiveRealTimeUpdates:function({updatedAnnotations:e=[],deletedAnnotations:t=[]}){return(n,r)=>{const o={...r().realTimeUpdates.pendingUpdates},i={...r().realTimeUpdates.pendingDeletions};e.forEach((e=>{const t=r().groups,n=r().route;e.group!==Ga.selectors.focusedGroupId(t)&&"sidebar"===Xi.selectors.route(n)||(o[e.id]=e)})),t.forEach((e=>{const t=e.id;delete o[t];const n=r().annotations;ha.selectors.annotationExists(n,t)&&(i[t]=!0)})),n(vi(0,"RECEIVE_REAL_TIME_UPDATES",{pendingUpdates:o,pendingDeletions:i}))}},clearPendingUpdates:function(){return vi(0,"CLEAR_PENDING_UPDATES",void 0)}},selectors:{hasPendingDeletion:function(e,t){return e.pendingDeletions.hasOwnProperty(t)},pendingDeletions:function(e){return e.pendingDeletions},pendingUpdates:function(e){return e.pendingUpdates},pendingUpdateCount:Xa}}),Ja={annotation:"Location",note:"Oldest",orphan:"Location"};function Qa(e){const t={}
|
|
164
|
+
;return e.annotations&&!e.query&&(t[e.annotations]=!0),t}const es=(e,t)=>t===e?{}:{selectedTab:e,sortKey:Ja[e]},ts={CLEAR_SELECTION:()=>({forcedVisible:{},selected:{}}),SELECT_ANNOTATIONS:(e,t)=>({selected:t.selection}),SELECT_TAB:(e,t)=>es(t.tab,e.selectedTab),SET_EXPANDED(e,t){const n={...e.expanded};return n[t.id]=t.expanded,{expanded:n}},SET_FORCED_VISIBLE:(e,t)=>({forcedVisible:{...e.forcedVisible,[t.id]:t.visible}}),SET_SORT_KEY:(e,t)=>({sortKey:t.key}),TOGGLE_SELECTED_ANNOTATIONS(e,t){const n={...e.selected};return t.toggleIds.forEach((e=>{n[e]=!n[e]})),{selected:n}},ADD_ANNOTATIONS(e,t){const n=t.annotations.filter((e=>!Li(e))),r=Gi(t.annotations,ji)===n.length;return 0===t.currentAnnotationCount&&r?es("note",e.selectedTab):{}},CHANGE_FOCUS_MODE_USER:()=>({forcedVisible:{},selected:{}}),SET_FILTER:()=>({forcedVisible:{},selected:{},expanded:{}}),SET_FILTER_QUERY:()=>({forcedVisible:{},selected:{},expanded:{}}),SET_FOCUS_MODE:()=>({forcedVisible:{},selected:{}}),REMOVE_ANNOTATIONS(e,t){
|
|
165
|
+
let n=e.selectedTab;"orphan"===n&&0===Gi(t.remainingAnnotations,Fi)&&(n="annotation");const r=e=>(t.annotationsToRemove.forEach((t=>{t.id&&delete e[t.id],t.$tag&&delete e[t.$tag]})),e);return{...es(n,e.selectedTab),expanded:r({...e.expanded}),forcedVisible:r({...e.forcedVisible}),selected:r({...e.selected})}}};function ns(){return vi(0,"CLEAR_SELECTION",void 0)}function rs(e){return e.expanded}const os=Ei((e=>e.forcedVisible),(e=>Yi(e))),is=Ei((e=>e.selected),(e=>Yi(e).length>0)),as=Ei((e=>e.selected),(e=>Yi(e)));function ss(e){return e.selectedTab}const ls=Ei((e=>e),(e=>({expanded:rs(e),forcedVisible:os(e),selected:as(e),sortKey:cs(e),selectedTab:ss(e)})));function cs(e){return e.sortKey}const us=Ei((e=>e.selectedTab),(e=>{const t=["Newest","Oldest"];return"note"!==e&&t.push("Location"),t})),hs=_i((function(e){return{selected:Qa(e),expanded:Qa(e),forcedVisible:{},selectedTab:"annotation",sortKey:Ja.annotation}}),{namespace:"selection",reducers:ts,actionCreators:{clearSelection:ns,
|
|
166
|
+
selectAnnotations:function(e){return t=>{t(ns()),t(vi(0,"SELECT_ANNOTATIONS",{selection:Vi(e)}))}},selectTab:function(e){return vi(0,"SELECT_TAB",{tab:e})},setExpanded:function(e,t){return vi(0,"SET_EXPANDED",{id:e,expanded:t})},setForcedVisible:function(e,t){return vi(0,"SET_FORCED_VISIBLE",{id:e,visible:t})},setSortKey:function(e){return vi(0,"SET_SORT_KEY",{key:e})},toggleSelectedAnnotations:function(e){return vi(0,"TOGGLE_SELECTED_ANNOTATIONS",{toggleIds:e})}},selectors:{expandedMap:rs,forcedVisibleThreads:os,hasSelectedAnnotations:is,selectedAnnotations:as,selectedTab:ss,selectionState:ls,sortKey:cs,sortKeys:us}}),ds={OPEN_SIDEBAR_PANEL:(e,t)=>({activePanelName:t.panelName}),CLOSE_SIDEBAR_PANEL(e,t){let n=e.activePanelName;return t.panelName===n&&(n=null),{activePanelName:n}},TOGGLE_SIDEBAR_PANEL:function(e,t){let n;const r=e.activePanelName===t.panelName,o=void 0!==t.panelState?t.panelState:!r;return n=o?t.panelName:r&&!o?null:e.activePanelName,{activePanelName:n}}};const ps=_i({activePanelName:null},{
|
|
167
|
+
namespace:"sidebarPanels",reducers:ds,actionCreators:{openSidebarPanel:function(e){return vi(0,"OPEN_SIDEBAR_PANEL",{panelName:e})},closeSidebarPanel:function(e){return vi(0,"CLOSE_SIDEBAR_PANEL",{panelName:e})},toggleSidebarPanel:function(e,t){return vi(0,"TOGGLE_SIDEBAR_PANEL",{panelName:e,panelState:t})}},selectors:{isSidebarPanelOpen:function(e,t){return e.activePanelName===t}}}),ms={ADD_MESSAGE:(e,t)=>({messages:e.messages.concat({...t.message})}),REMOVE_MESSAGE:(e,t)=>({messages:e.messages.filter((e=>e.id!==t.id))}),UPDATE_MESSAGE:(e,t)=>({messages:e.messages.map((e=>e.id&&e.id===t.message.id?{...t.message}:e))})};const fs=_i({messages:[]},{namespace:"toastMessages",reducers:ms,actionCreators:{addToastMessage:function(e){return vi(0,"ADD_MESSAGE",{message:e})},removeToastMessage:function(e){return vi(0,"REMOVE_MESSAGE",{id:e})},updateToastMessage:function(e){return vi(0,"UPDATE_MESSAGE",{message:e})}},selectors:{getToastMessage:function(e,t){return e.messages.find((e=>e.id===t))},
|
|
168
|
+
getToastMessages:function(e){return e.messages},hasToastMessage:function(e,t,n){return e.messages.some((e=>e.type===t&&e.message===n))}}}),gs={SET_SIDEBAR_OPENED:(e,t)=>!0===t.opened?{sidebarHasOpened:!0}:{}};const vs=_i({sidebarHasOpened:!1},{namespace:"viewer",reducers:gs,actionCreators:{setSidebarOpened:function(e){return vi(0,"SET_SIDEBAR_OPENED",{opened:e})}},selectors:{hasSidebarOpened:function(e){return e.sidebarHasOpened}}});class _s{constructor(e,t,n,r){this.name=e,this.method=t,this.args=n,this.result=r}matches(e,t){return this.name===e&&this.args.every(((e,n)=>t[n]===e))}}function bs(e){return gi([wi,ha,pa,fa,xa,Na,Ra,Wa,Ga,Za,Xi,hs,Pa,ps,fs,vs],[e],[bi])}function ys(){var e;return function(e){const[,t]=Yr((e=>e+1),0),n=Xr([]).current,r=Xr(null);if(!r.current){const t=new Map,o=(e,r)=>{const o=e[r];if("function"!=typeof o)return o;let i=t.get(r);return i||(i=(...t)=>{const i=n.find((e=>e.matches(r,t)));if(i)return i.result;const a=e.getState(),s=o.apply(e,t)
|
|
169
|
+
;return a===e.getState()&&n.push(new _s(r,o,t,s)),s},t.set(r,i),i)};r.current=new Proxy(e,{get:o})}return Wr((()=>e.subscribe((()=>{n.find((t=>t.method.apply(e,t.args)!==t.result))&&(n.splice(0,n.length),t(0))}))),[n,e]),r.current}((e="store",Qr(Zo).get(e)))}bs.$inject=["settings"];const ws={collapsed:!1,depth:0,visible:!0,replyCount:0};function xs(e){return e.id||e.$tag}function ks(e,t,n){const r=e[n];return!(!r||r.parent===t)&&(!r.parent||ks(e,t,r.parent))}function Ss(e,t,n=[]){if(e[t].parent||!n.length)return;const r=n[n.length-1];e[r]||(e[r]={...ws,children:[],id:r},Ss(e,r,n.slice(0,-1))),ks(e,t,r)&&(e[t].parent=r,e[r].children.push(e[t]))}function Cs(e,t){return Object.assign({},t(e),{children:e.children.map((e=>Cs(e,t)))})}function Es(e,t,n){const r=e.children.map((e=>Es(e,n,n))).slice().sort(t);return{...e,children:r}}function As(e,t){const n=e.children.map((e=>As(e,t+1))),r=n.reduce(((e,t)=>e+1+t.replyCount),0);return{...e,children:n,depth:t,replyCount:r}}function Ts(e){
|
|
170
|
+
return e.children.some((e=>e.visible||Ts(e)))}const Ns=(e,t)=>e.annotation&&t.annotation?e.annotation.created<t.annotation.created?-1:e.annotation.created>t.annotation.created?1:0:0;function Ms(e,t){const n=t.selected.length>0,r=t.forcedVisible.length>0;let o=function(e){const t={};e.forEach((e=>{const n=xs(e);t[n]={...ws,children:[],annotation:e,id:n}})),e.forEach((e=>{const n=(e.references||[]).filter((t=>t!==e.id));return Ss(t,xs(e),n)}));const n=[];for(const e in t)t[e].parent||(t[e].collapsed=!0,n.push(t[e]));return{...ws,id:"root",children:n}}(e);return n&&(o.children=o.children.filter((e=>{const n=t.selected.includes(e.id),o=r&&t.forcedVisible.includes(e.id);return n||o}))),t.threadFilterFn&&(o.children=o.children.filter(t.threadFilterFn)),o.visible=!1,o=Cs(o,(e=>{let n=e.visible;return t.filterFn&&(n=!(!r||!t.forcedVisible.includes(e.id))||!!e.annotation&&!!t.filterFn(e.annotation)),{...e,visible:n}})),o.children=o.children.filter((e=>e.visible||Ts(e))),o=Cs(o,(e=>{const n={collapsed:e.collapsed}
|
|
171
|
+
;if(t.expanded.hasOwnProperty(e.id))n.collapsed=!t.expanded[e.id];else{const r=t.filterFn&&Ts(e);n.collapsed=e.collapsed&&!r}return{...e,...n}})),o=Es(o,t.sortCompareFn,Ns),o=As(o,-1),o}function Ls(e){const t=e.slice(0,e.indexOf(":"));if(!t)return[null,e];if(["group","quote","since","tag","text","uri","user"].includes(t)){return[t,e.slice(t.length+1)]}return[null,e]}function zs(e){if(!e)return[];const t=e=>{const t=e.slice(0,1),n=e.slice(-1);return'"'!==t&&"'"!==t||t!==n||(e=e.slice(1,e.length-1)),e};let n=e.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g)||[];n=n.map(t);for(let e=0;e<n.length;e++){const r=n[e],[o,i]=Ls(r);o&&(n[e]=o+":"+t(i))}return n}function Os(e){const t={},n=e=>"tag"===e?"tags":e;if(e){const r=zs(e);for(const e of r){let[r,o]=Ls(e);r||(r="any",o=e);const i=n(r);t[i]?t[i].push(o):t[i]=[o]}}return t}
|
|
172
|
+
const Rs=/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u08FE\u0900-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C82\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D02\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1DC0-\u1DE6\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE26]/g
|
|
173
|
+
;function Ds(e){return function(e){return e.replace(Rs,"")}((t=e,t.normalize("NFKD"))).toLowerCase();var t}class Is{constructor(e,t){this.term=t.normalize(e),this.matcher=t}matches(e){const t=this.matcher;return t.fieldValues(e).some((e=>t.matches(t.normalize(e),this.term)))}}class Ps{constructor(e,t){this.operator=e,this.filters=t}matches(e){return"and"===this.operator?this.filters.every((t=>t.matches(e))):this.filters.some((t=>t.matches(e)))}}function Bs(e){return{fieldValues:e,matches:(e,t)=>e.includes(t),normalize:Ds}}const Fs={quote:Bs((e=>{var t;return[null!==(t=$i(e))&&void 0!==t?t:""]})),since:{fieldValues:e=>[new Date(e.updated).valueOf()],matches:(e,t)=>(Date.now()-e)/1e3<=t,normalize:e=>e},tag:Bs((e=>e.tags)),text:Bs((e=>[e.text])),uri:Bs((e=>[e.uri])),user:Bs((e=>{var t,n;return[e.user,null!==(t=null===(n=e.user_info)||void 0===n?void 0:n.display_name)&&void 0!==t?t:""]}))};function js(e){return Fi(e)?"orphan":ji(e)?"note":"annotation"}function Us(e,t){const n=e.visible===t
|
|
174
|
+
;return e.children.reduce(((e,n)=>e+Us(n,t)),n?1:0)}function Hs(e){return Us(e,!1)}function qs(e){return Us(e,!0)}function $s(e){const t=e.filter((e=>!!e.annotation)).map((e=>e.annotation));if(t.length)return t;const n=[];if(e.forEach((e=>{e.children&&n.push(...e.children)})),n.length)return $s(n);throw new Error("Thread contains no annotations")}function Gs(e){return $s([e]).reduce(((e,t)=>t.created>e?t.created:e),"")}function Vs(e){return $s([e]).reduce(((e,t)=>(e||(e=t.created),t.created<e?t.created:e)),"")}const Ys={Newest:(e,t)=>{const n=Gs(e),r=Gs(t);return n>r?-1:n<r?1:0},Oldest:(e,t)=>{const n=Vs(e),r=Vs(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=qi(e.annotation),r=qi(t.annotation);return n<r?-1:n>r?1:0}};const Ws=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){
|
|
175
|
+
const t=e.selection,n={expanded:t.expanded,forcedVisible:t.forcedVisible,selected:t.selected,sortCompareFn:Ys[t.sortKey]},r=!!t.filterQuery||Object.keys(t.filters).length>0;if(r){const e=function(e,t={}){let n;const r=[],o=[],i=[],a=[],s=[],l=[],c=t.user?[t.user]:[];if(e){n=zs(e);for(const e of n){const t=e.slice(0,e.indexOf(":")),n=e.slice(t.length+1);switch(t){case"quote":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";i.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:r.push(e)}}}return{any:{terms:r,operator:"and"},quote:{terms:o,operator:"and"},since:{terms:i,operator:"and"},tag:{terms:a,operator:"and"},text:{terms:s,operator:"and"},uri:{terms:l,operator:"or"},user:{terms:c,operator:"or"}}}(t.filterQuery||"",t.filters)
|
|
176
|
+
;n.filterFn=t=>function(e,t){const n=(e,t)=>new Is(t,Fs[e]),r=Object.entries(t).filter((([,e])=>e.terms.length>0)).map((([e,t])=>{let r;if("any"===e){const e=["quote","text","tag","user"];r=t.terms.map((t=>new Ps("or",e.map((e=>n(e,t))))))}else r=t.terms.map((t=>n(e,t)));return new Ps(t.operator,r)})),o=new Ps("and",r);return e.filter((e=>e.id&&o.matches(e))).map((e=>e.id))}([t],e).length>0}return!r&&"sidebar"===e.route&&(n.threadFilterFn=e=>{return!!e.annotation&&(n=e.annotation,r=t.selectedTab,!Ii(n)&&js(n)===r);var n,r}),Ms(e.annotations,n)}));function Ks(){const e=ys(),t=e.allAnnotations(),n=e.filterQuery(),r=e.route(),o=e.selectionState(),i=e.getFilterValues(),a=Zr((()=>({annotations:t,route:r,selection:{...o,filterQuery:n,filters:i}})),[t,n,r,o,i]);return Ws(a)}
|
|
177
|
+
var Xs=/^\s+|\s+$/g,Zs=/^[-+]0x[0-9a-f]+$/i,Js=/^0b[01]+$/i,Qs=/^0o[0-7]+$/i,el=parseInt,tl="object"==typeof V&&V&&V.Object===Object&&V,nl="object"==typeof self&&self&&self.Object===Object&&self,rl=tl||nl||Function("return this")(),ol=Object.prototype.toString,il=Math.max,al=Math.min,sl=function(){return rl.Date.now()};function ll(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function cl(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==ol.call(e)}(e))return NaN;if(ll(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ll(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Xs,"");var n=Js.test(e);return n||Qs.test(e)?el(e.slice(2),n?2:8):Zs.test(e)?NaN:+e}var ul=function(e,t,n){var r,o,i,a,s,l,c=0,u=!1,h=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function m(e){return c=e,s=setTimeout(g,t),u?p(e):a}
|
|
178
|
+
function f(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-c>=i}function g(){var e=sl();if(f(e))return v(e);s=setTimeout(g,function(e){var n=t-(e-l);return h?al(n,i-(e-c)):n}(e))}function v(e){return s=void 0,d&&r?p(e):(r=o=void 0,a)}function _(){var e=sl(),n=f(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return m(l);if(h)return s=setTimeout(g,t),p(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=cl(t)||0,ll(n)&&(u=!!n.leading,i=(h="maxWait"in n)?il(cl(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d),_.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=o=s=void 0},_.flush=function(){return void 0===s?a:v(sl())},_};class hl{constructor(){this._listeners=new Map}add(e,t,n,r){e.addEventListener(t,n,r);const o=Symbol();return this._listeners.set(o,{eventTarget:e,eventType:t,listener:n}),o}remove(e){const t=this._listeners.get(e);if(t){const{eventTarget:n,eventType:r,listener:o}=t;n.removeEventListener(r,o),this._listeners.delete(e)}}removeAll(){
|
|
179
|
+
this._listeners.forEach((({eventTarget:e,eventType:t,listener:n})=>{e.removeEventListener(t,n)})),this._listeners.clear()}}const dl={defaultHeight:200,marginAbove:800,marginBelow:800};function pl(e){const t=window.getComputedStyle(e);return e.getBoundingClientRect().height+(parseFloat(t.marginTop)+parseFloat(t.marginBottom))}function ml(e,t,n){var r;const o=Wo(e.user,t);return(n||o)&&null!==(r=e.user_info)&&void 0!==r&&r.display_name?e.user_info.display_name:Yo(e.user)}function fl(e){return/^http(s?):/i.test(e)}function gl(e){return{read:[e],update:[e],delete:[e]}}function vl(e,t){return Object.assign(gl(e),{read:["group:"+t]})}function _l(e,t,n){return"private"===function(e){switch(e){case"private":case"shared":return e;default:return"shared"}}(n)&&e?gl(e):vl(e,t)}function bl(e){return e.read.some((e=>0===e.indexOf("group:")))}function yl(e){return!bl(e)}function wl(e){const t=document.createElement("textarea");t.value=e,t.setAttribute("data-testid","copy-text"),t.contentEditable="true",
|
|
180
|
+
document.body.appendChild(t),t.focus();try{const e=document.createRange(),n=document.getSelection();n.removeAllRanges(),e.selectNodeContents(t),n.addRange(e),t.setSelectionRange(0,t.value.length),document.execCommand("copy")}finally{t.remove()}}function xl({classes:e,direction:t="up"}){return so(Ao,{name:"pointer",classes:Pr("absolute inline z-2 text-grey-3 fill-white",{"rotate-180":"down"===t},e)})}function kl({label:e,iconName:t,uri:n}){return so("li",{children:so(To,{"aria-label":e,classes:"text-grey-6 hover:text-color-text block",href:n,title:e,target:"_blank",children:so(Ao,{name:t})})})}function Sl({shareURI:e}){const t=encodeURIComponent(e);return so("ul",{className:"flex flex-row gap-x-4 items-center justify-center border-t pt-2",children:[so(kl,{iconName:"twitter",label:"Tweet share link",uri:`https://twitter.com/intent/tweet?url=${t}&hashtags=annotated`}),so(kl,{iconName:"facebook",label:"Share on Facebook",uri:`https://www.facebook.com/sharer/sharer.php?u=${t}`}),so(kl,{iconName:"email",
|
|
181
|
+
label:"Share via email",uri:`mailto:?subject=${encodeURIComponent("Let's Annotate")}&body=${t}`})]})}function Cl(){return((e=window.navigator,t="ontouchend"in document)=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(e.platform)||e.userAgent.includes("Mac")&&t)()}var El=Jo((function({annotation:e,toastMessenger:t,group:n,shareUri:r}){const o=yl(e.permissions),i=fl(e.uri),a=Xr(null),s=Xr(null),[l,c]=Vr(!1),u=Xr(l);if(Mo(a,l,(()=>c(!1))),Wr((()=>{var e,t;u.current!==l&&(u.current=l,l&&!Cl()&&(null===(e=s.current)||void 0===e||e.focus(),null===(t=s.current)||void 0===t||t.select()))}),[l]),!n)return null;const h=i,d="private"===n.type?so("span",{children:["Only members of the group ",so("em",{children:n.name})," may view this annotation."]}):so("span",{children:"Anyone using this link may view this annotation."}),p=o?so("span",{children:"Only you may view this annotation."}):d;return so("div",{className:"relative",ref:a,children:[so(mo,{icon:"share",title:"Share",
|
|
182
|
+
onClick:()=>c(!l),expanded:l}),l&&so(bo,{classes:Pr("w-96 max-w-[85vw]","absolute bottom-8 right-1 touch:bottom-touch-minimum","space-y-2 p-2","theme-clean:border theme-clean:border-solid theme-clean:border-grey-3"),children:[so("div",{className:"flex items-center",children:so("h2",{className:"text-brand text-lg font-medium",children:"Share this annotation"})}),so("div",{className:Pr("flex w-full text-sm touch:text-base"),children:so(Uo,{children:[so(jo,{"aria-label":"Use this URL to share this annotation",type:"text",value:r,readOnly:!0,inputRef:s}),so(mo,{icon:"copy",title:"Copy share link to clipboard",onClick:()=>{try{wl(r),t.success("Copied share link to clipboard")}catch(e){t.error("Unable to copy link")}},variant:"dark"})]})}),so("div",{className:"text-base font-normal","data-testid":"share-details",children:so(m,i?{children:p}:{
|
|
183
|
+
children:"This annotation cannot be shared in its original context because it was made on a document that is not available on the web. This link shares the annotation by itself."})}),h&&so(Sl,{shareURI:r}),so(xl,{direction:"down",classes:"bottom-[-12px] right-1 touch:right-[9px]"})]})]})}),["toastMessenger"]);var Al=Jo((function({annotation:e,annotationsService:t,onReply:n,settings:r,toastMessenger:o}){const i=ys(),a=i.profile(),s=i.getGroup(e.group),l=i.isLoggedIn(),c=t=>function(e,t,n){return-1!==e[t].indexOf(n||"")}(e.permissions,t,a.userid),u=c("delete"),h=c("update"),d=function(e){const t=I(e);return!1!==(null==t?void 0:t.allowFlagging)}(r)&&!!a.userid&&a.userid!==e.user,p=function(e){const t=I(e);return!1!==(null==t?void 0:t.enableShareLinks)}(r)&&function(e){var t,n,r,o,i,a
|
|
184
|
+
;return fl(e.uri)?null!==(t=null!==(n=null===(r=e.links)||void 0===r?void 0:r.incontext)&&void 0!==n?n:null===(o=e.links)||void 0===o?void 0:o.html)&&void 0!==t?t:null:null!==(i=null===(a=e.links)||void 0===a?void 0:a.html)&&void 0!==i?i:null}(e);return so("div",{className:"flex text-xl","data-testid":"annotation-action-bar",children:[h&&so(mo,{icon:"edit",title:"Edit",onClick:()=>{i.createDraft(e,{tags:e.tags,text:e.text,isPrivate:yl(e.permissions)})}}),u&&so(mo,{icon:"trash",title:"Delete",onClick:async()=>{const n=Hi(e);if(await Go({title:`Delete ${n.toLowerCase()}?`,message:`Are you sure you want to delete this ${n.toLowerCase()}?`,confirmAction:"Delete"}))try{await t.delete(e),o.success(`${n} deleted`,{visuallyHidden:!0})}catch(e){o.error(e.message)}}}),so(mo,{icon:"reply",title:"Reply",onClick:()=>{l?n():i.openSidebarPanel("loginPrompt")}}),p&&so(El,{annotation:e,group:s,shareUri:p}),d&&!e.flagged&&so(mo,{icon:"flag",title:"Report this annotation to moderators",onClick:()=>{
|
|
185
|
+
t.flag(e).catch((()=>o.error("Flagging annotation failed")))}}),d&&e.flagged&&so(mo,{pressed:!0,icon:"flag--active",title:"Annotation has been reported to the moderators"})]})}),["annotationsService","settings","toastMessenger"]);function Tl({isCollapsed:e,setCollapsed:t,linkStyle:n={}}){return so("div",{className:Pr("absolute block right-0 bottom-0","w-20 bg-gradient-to-l from-white"),children:so("div",{className:"flex justify-end",children:so(go,{classes:"inline underline",onClick:()=>t(!e),expanded:!e,title:"Toggle visibility of full excerpt text",style:n,variant:"dark",children:e?"More":"Less"})})})}const Nl=()=>{};var Ml=Jo((function({children:e,collapse:t=!1,collapsedHeight:n,inlineControls:r=!0,onCollapsibleChanged:o=Nl,onToggleCollapsed:i=Nl,overflowThreshold:a=0,settings:s={}}){const[l,c]=Vr(!0),u=Xr(),[h,d]=Vr(0),p=Jr((()=>{const e=u.current.clientHeight;d(e);o(e>n+a)}),[n,o,a]);Kr((()=>{const e=function(e,t){if("undefined"!=typeof ResizeObserver){
|
|
186
|
+
const n=new ResizeObserver((()=>t(e.clientWidth,e.clientHeight)));return n.observe(e),()=>n.disconnect()}const n=new hl;let r=e.clientWidth,o=e.clientHeight;const i=()=>{r===e.clientWidth&&o===e.clientHeight||(r=e.clientWidth,o=e.clientHeight,t(r,o))};n.add(e,"load",i),n.add(window,"resize",i);const a=new MutationObserver(i);return a.observe(e,{characterData:!0,childList:!0,subtree:!0}),()=>{n.removeAll(),a.disconnect()}}(u.current,p);return p(),e}),[p]);const m=h>n+a,f=m&&(r?l:t),g={};0!==h&&(g["max-height"]=f?n:h);const v=e=>r?c(e):i(e);return so("div",{"data-testid":"excerpt-container",className:Pr("relative overflow-hidden","transition-[max-height] ease-in duration-150"),style:g,children:[so("div",{className:Pr("inline-block w-full"),"data-testid":"excerpt-content",ref:u,children:e}),so("div",{"data-testid":"excerpt-expand",role:"presentation",onClick:()=>v(!1),className:Pr("transition-[opacity] duration-150 ease-linear","absolute w-full bottom-0 h-touch-minimum",{
|
|
187
|
+
"bg-gradient-to-b from-excerpt-stop-1 via-excerpt-stop-2 to-excerpt-stop-3":!r&&f,"bg-none":r,"opacity-0 pointer-events-none":!f}),title:"Show the full excerpt"}),m&&r&&so(Tl,{isCollapsed:l,setCollapsed:v,linkStyle:Xo(["selectionFontFamily"],s)})]})}),["settings"]);function Ll(e,t=16/9){const n=document.createElement("iframe");return n.src=e,n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",""),function(e,t){e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%";const n=document.createElement("div");return n.style.paddingBottom=1/t*100+"%",n.style.position="relative",n.appendChild(e),n}(n,t)}function zl(e){const t=/(\d+)([hms]?)/g,n={h:3600,m:60,s:1};let r,o=0;for(;null!==(r=t.exec(e));)if(r[2]){const e=r[2];o+=Number(r[1])*n[e]}else o+=+r[1];return o.toString()}function Ol(e,t){const n=function(e){const t=["end","start","t"],n=new URLSearchParams(e.search),r=new URLSearchParams
|
|
188
|
+
;for(let[e,o]of n)t.includes(e)&&("t"===e?r.append("start",zl(o)):r.append(e,o));r.sort();let o=r.toString();return o&&(o=`?${o}`),o}(t);return Ll(`https://www.youtube.com/embed/${e}${n}`)}function Rl(e,t,n,{aspectRatio:r}={}){return o=>{if(o.hostname!==e)return null;const i=t.exec(o.pathname);if(!i)return null;const a=i[1];return Ll(n(a),r)}}const Dl=[function(e){if("www.youtube.com"!==e.hostname)return null;if(!/\/watch\/?/.test(e.pathname))return null;const t=/[&?]v=([^&#]+)/.exec(e.search);return t?Ol(t[1],e):null},function(e){if("youtu.be"!==e.hostname)return null;const t=/^\/([^/]+)\/?$/.exec(e.pathname);return t?Ol(t[1],e):null},Rl("vimeo.com",/^\/([^/?#]+)\/?$/,(e=>`https://player.vimeo.com/video/${e}`)),Rl("vimeo.com",/^\/channels\/[^/]+\/([^/?#]+)\/?$/,(e=>`https://player.vimeo.com/video/${e}`)),Rl("flipgrid.com",/^\/s\/([^/]+)$/,(e=>`https://flipgrid.com/s/${e}?embed=true`)),function(e){if("archive.org"!==e.hostname)return null;const t=/^\/(embed|details)\/(.+)/.exec(e.pathname);if(!t)return null
|
|
189
|
+
;let n=t[2];const r=new URLSearchParams(e.search);let o=r.get("start"),i=r.get("end");if(!o){const e=n.match(/\/start\/([^/]+)/);e&&(o=e[1],n=n.replace(e[0],""))}if(!i){const e=n.match(/\/end\/([^/]+)/);e&&(i=e[1],n=n.replace(e[0],""))}const a=new URL(`https://archive.org/embed/${n}`);return o&&a.searchParams.append("start",o),i&&a.searchParams.append("end",i),Ll(a.href)},function(e){return e.pathname.endsWith(".mp3")||e.pathname.endsWith(".ogg")||e.pathname.endsWith(".wav")?function(e){const t=document.createElement("audio");return t.controls=!0,t.src=e,t}(e.href):null}];function Il(e){if(e.href!==e.textContent)try{const t=encodeURI(e.textContent);if(e.href!==t)return null}catch{return null}const t=function(e){let t,n;for(n=0;n<Dl.length;n++)if(t=Dl[n](e),t)return t;return null}(e);return t&&e.parentElement.replaceChild(t,e),t}function Pl(e){return Pl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){
|
|
190
|
+
return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pl(e)}function Bl(e,t){return Bl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Bl(e,t)}function Fl(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function jl(e,t,n){return jl=Fl()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&Bl(o,n.prototype),o},jl.apply(null,arguments)}function Ul(e){return function(e){if(Array.isArray(e))return Hl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Hl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name)
|
|
191
|
+
;if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Hl(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Hl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ql=Object.hasOwnProperty,$l=Object.setPrototypeOf,Gl=Object.isFrozen,Vl=Object.getPrototypeOf,Yl=Object.getOwnPropertyDescriptor,Wl=Object.freeze,Kl=Object.seal,Xl=Object.create,Zl="undefined"!=typeof Reflect&&Reflect,Jl=Zl.apply,Ql=Zl.construct;Jl||(Jl=function(e,t,n){return e.apply(t,n)}),Wl||(Wl=function(e){return e}),Kl||(Kl=function(e){return e}),Ql||(Ql=function(e,t){return jl(e,Ul(t))})
|
|
192
|
+
;var ec,tc=hc(Array.prototype.forEach),nc=hc(Array.prototype.pop),rc=hc(Array.prototype.push),oc=hc(String.prototype.toLowerCase),ic=hc(String.prototype.match),ac=hc(String.prototype.replace),sc=hc(String.prototype.indexOf),lc=hc(String.prototype.trim),cc=hc(RegExp.prototype.test),uc=(ec=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ql(ec,t)});function hc(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Jl(e,t,r)}}function dc(e,t){$l&&$l(e,null);for(var n=t.length;n--;){var r=t[n];if("string"==typeof r){var o=oc(r);o!==r&&(Gl(t)||(t[n]=o),r=o)}e[r]=!0}return e}function pc(e){var t,n=Xl(null);for(t in e)Jl(ql,e,[t])&&(n[t]=e[t]);return n}function mc(e,t){for(;null!==e;){var n=Yl(e,t);if(n){if(n.get)return hc(n.get);if("function"==typeof n.value)return hc(n.value)}e=Vl(e)}return function(e){return console.warn("fallback value for",e),null}}
|
|
193
|
+
var fc=Wl(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),gc=Wl(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),vc=Wl(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),_c=Wl(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),bc=Wl(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),yc=Wl(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),wc=Wl(["#text"]),xc=Wl(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),kc=Wl(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Sc=Wl(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Cc=Wl(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ec=Kl(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ac=Kl(/<%[\w\W]*|[\w\W]*%>/gm),Tc=Kl(/^data-[\-\w.\u00B7-\uFFFF]/),Nc=Kl(/^aria-[\-\w]+$/),Mc=Kl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Lc=Kl(/^(?:\w+script|data):/i),zc=Kl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Oc=Kl(/^html$/i),Rc=function(){
|
|
194
|
+
return"undefined"==typeof window?null:window},Dc=function(e,t){if("object"!==Pl(e)||"function"!=typeof e.createPolicy)return null;var n=null,r="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(r)&&(n=t.currentScript.getAttribute(r));var o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};var Ic=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rc(),n=function(t){return e(t)};if(n.version="2.3.8",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,o=t.document,i=t.DocumentFragment,a=t.HTMLTemplateElement,s=t.Node,l=t.Element,c=t.NodeFilter,u=t.NamedNodeMap,h=void 0===u?t.NamedNodeMap||t.MozNamedAttrMap:u,d=t.HTMLFormElement,p=t.DOMParser,m=t.trustedTypes,f=l.prototype,g=mc(f,"cloneNode"),v=mc(f,"nextSibling"),_=mc(f,"childNodes"),b=mc(f,"parentNode");if("function"==typeof a){
|
|
195
|
+
var y=o.createElement("template");y.content&&y.content.ownerDocument&&(o=y.content.ownerDocument)}var w=Dc(m,r),x=w?w.createHTML(""):"",k=o,S=k.implementation,C=k.createNodeIterator,E=k.createDocumentFragment,A=k.getElementsByTagName,T=r.importNode,N={};try{N=pc(o).documentMode?o.documentMode:{}}catch(e){}var M={};n.isSupported="function"==typeof b&&S&&void 0!==S.createHTMLDocument&&9!==N;var L,z,O=Ec,R=Ac,D=Tc,I=Nc,P=Lc,B=zc,F=Mc,j=null,U=dc({},[].concat(Ul(fc),Ul(gc),Ul(vc),Ul(bc),Ul(wc))),H=null,q=dc({},[].concat(Ul(xc),Ul(kc),Ul(Sc),Ul(Cc))),$=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}
|
|
196
|
+
})),G=null,V=null,Y=!0,W=!0,K=!1,X=!1,Z=!1,J=!1,Q=!1,ee=!1,te=!1,ne=!1,re=!0,oe=!0,ie=!1,ae={},se=null,le=dc({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ce=null,ue=dc({},["audio","video","img","source","image","track"]),he=null,de=dc({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pe="http://www.w3.org/1998/Math/MathML",me="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml",ge=fe,ve=!1,_e=["application/xhtml+xml","text/html"],be="text/html",ye=null,we=o.createElement("form"),xe=function(e){return e instanceof RegExp||e instanceof Function},ke=function(e){ye&&ye===e||(e&&"object"===Pl(e)||(e={}),e=pc(e),j="ALLOWED_TAGS"in e?dc({},e.ALLOWED_TAGS):U,H="ALLOWED_ATTR"in e?dc({},e.ALLOWED_ATTR):q,he="ADD_URI_SAFE_ATTR"in e?dc(pc(de),e.ADD_URI_SAFE_ATTR):de,
|
|
197
|
+
ce="ADD_DATA_URI_TAGS"in e?dc(pc(ue),e.ADD_DATA_URI_TAGS):ue,se="FORBID_CONTENTS"in e?dc({},e.FORBID_CONTENTS):le,G="FORBID_TAGS"in e?dc({},e.FORBID_TAGS):{},V="FORBID_ATTR"in e?dc({},e.FORBID_ATTR):{},ae="USE_PROFILES"in e&&e.USE_PROFILES,Y=!1!==e.ALLOW_ARIA_ATTR,W=!1!==e.ALLOW_DATA_ATTR,K=e.ALLOW_UNKNOWN_PROTOCOLS||!1,X=e.SAFE_FOR_TEMPLATES||!1,Z=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,Q=e.FORCE_BODY||!1,re=!1!==e.SANITIZE_DOM,oe=!1!==e.KEEP_CONTENT,ie=e.IN_PLACE||!1,F=e.ALLOWED_URI_REGEXP||F,ge=e.NAMESPACE||fe,e.CUSTOM_ELEMENT_HANDLING&&xe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&($.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&xe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),
|
|
198
|
+
e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&($.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),L=L=-1===_e.indexOf(e.PARSER_MEDIA_TYPE)?be:e.PARSER_MEDIA_TYPE,z="application/xhtml+xml"===L?function(e){return e}:oc,X&&(W=!1),te&&(ee=!0),ae&&(j=dc({},Ul(wc)),H=[],!0===ae.html&&(dc(j,fc),dc(H,xc)),!0===ae.svg&&(dc(j,gc),dc(H,kc),dc(H,Cc)),!0===ae.svgFilters&&(dc(j,vc),dc(H,kc),dc(H,Cc)),!0===ae.mathMl&&(dc(j,bc),dc(H,Sc),dc(H,Cc))),e.ADD_TAGS&&(j===U&&(j=pc(j)),dc(j,e.ADD_TAGS)),e.ADD_ATTR&&(H===q&&(H=pc(H)),dc(H,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&dc(he,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(se===le&&(se=pc(se)),dc(se,e.FORBID_CONTENTS)),oe&&(j["#text"]=!0),Z&&dc(j,["html","head","body"]),j.table&&(dc(j,["tbody"]),delete G.tbody),Wl&&Wl(e),ye=e)},Se=dc({},["mi","mo","mn","ms","mtext"]),Ce=dc({},["foreignobject","desc","title","annotation-xml"]),Ee=dc({},["title","style","font","a","script"]),Ae=dc({},gc)
|
|
199
|
+
;dc(Ae,vc),dc(Ae,_c);var Te=dc({},bc);dc(Te,yc);var Ne=function(e){var t=b(e);t&&t.tagName||(t={namespaceURI:fe,tagName:"template"});var n=oc(e.tagName),r=oc(t.tagName);return e.namespaceURI===me?t.namespaceURI===fe?"svg"===n:t.namespaceURI===pe?"svg"===n&&("annotation-xml"===r||Se[r]):Boolean(Ae[n]):e.namespaceURI===pe?t.namespaceURI===fe?"math"===n:t.namespaceURI===me?"math"===n&&Ce[r]:Boolean(Te[n]):e.namespaceURI===fe&&(!(t.namespaceURI===me&&!Ce[r])&&(!(t.namespaceURI===pe&&!Se[r])&&(!Te[n]&&(Ee[n]||!Ae[n]))))},Me=function(e){rc(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=x}catch(t){e.remove()}}},Le=function(e,t){try{rc(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){rc(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!H[e])if(ee||te)try{Me(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},ze=function(e){var t,n;if(Q)e="<remove></remove>"+e;else{var r=ic(e,/^[\r\n\t ]+/);n=r&&r[0]}
|
|
200
|
+
"application/xhtml+xml"===L&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=w?w.createHTML(e):e;if(ge===fe)try{t=(new p).parseFromString(i,L)}catch(e){}if(!t||!t.documentElement){t=S.createDocument(ge,"template",null);try{t.documentElement.innerHTML=ve?"":i}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(o.createTextNode(n),a.childNodes[0]||null),ge===fe?A.call(t,Z?"html":"body")[0]:Z?t.documentElement:a},Oe=function(e){return C.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Re=function(e){return e instanceof d&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof h)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},De=function(e){return"object"===Pl(s)?e instanceof s:e&&"object"===Pl(e)&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName
|
|
201
|
+
},Ie=function(e,t,r){M[e]&&tc(M[e],(function(e){e.call(n,t,r,ye)}))},Pe=function(e){var t;if(Ie("beforeSanitizeElements",e,null),Re(e))return Me(e),!0;if(cc(/[\u0080-\uFFFF]/,e.nodeName))return Me(e),!0;var r=z(e.nodeName);if(Ie("uponSanitizeElement",e,{tagName:r,allowedTags:j}),e.hasChildNodes()&&!De(e.firstElementChild)&&(!De(e.content)||!De(e.content.firstElementChild))&&cc(/<[/\w]/g,e.innerHTML)&&cc(/<[/\w]/g,e.textContent))return Me(e),!0;if("select"===r&&cc(/<template/i,e.innerHTML))return Me(e),!0;if(!j[r]||G[r]){if(!G[r]&&Fe(r)){if($.tagNameCheck instanceof RegExp&&cc($.tagNameCheck,r))return!1;if($.tagNameCheck instanceof Function&&$.tagNameCheck(r))return!1}if(oe&&!se[r]){var o=b(e)||e.parentNode,i=_(e)||e.childNodes;if(i&&o)for(var a=i.length-1;a>=0;--a)o.insertBefore(g(i[a],!0),v(e))}return Me(e),!0}return e instanceof l&&!Ne(e)?(Me(e),!0):"noscript"!==r&&"noembed"!==r||!cc(/<\/no(script|embed)/i,e.innerHTML)?(X&&3===e.nodeType&&(t=e.textContent,t=ac(t,O," "),t=ac(t,R," "),
|
|
202
|
+
e.textContent!==t&&(rc(n.removed,{element:e.cloneNode()}),e.textContent=t)),Ie("afterSanitizeElements",e,null),!1):(Me(e),!0)},Be=function(e,t,n){if(re&&("id"===t||"name"===t)&&(n in o||n in we))return!1;if(W&&!V[t]&&cc(D,t));else if(Y&&cc(I,t));else if(!H[t]||V[t]){if(!(Fe(e)&&($.tagNameCheck instanceof RegExp&&cc($.tagNameCheck,e)||$.tagNameCheck instanceof Function&&$.tagNameCheck(e))&&($.attributeNameCheck instanceof RegExp&&cc($.attributeNameCheck,t)||$.attributeNameCheck instanceof Function&&$.attributeNameCheck(t))||"is"===t&&$.allowCustomizedBuiltInElements&&($.tagNameCheck instanceof RegExp&&cc($.tagNameCheck,n)||$.tagNameCheck instanceof Function&&$.tagNameCheck(n))))return!1}else if(he[t]);else if(cc(F,ac(n,B,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==sc(n,"data:")||!ce[e]){if(K&&!cc(P,ac(n,B,"")));else if(n)return!1}else;return!0},Fe=function(e){return e.indexOf("-")>0},je=function(e){var t,r,o,i;Ie("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var s={
|
|
203
|
+
attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H};for(i=a.length;i--;){var l=t=a[i],c=l.name,u=l.namespaceURI;if(r="value"===c?t.value:lc(t.value),o=z(c),s.attrName=o,s.attrValue=r,s.keepAttr=!0,s.forceKeepAttr=void 0,Ie("uponSanitizeAttribute",e,s),r=s.attrValue,!s.forceKeepAttr&&(Le(c,e),s.keepAttr))if(cc(/\/>/i,r))Le(c,e);else{X&&(r=ac(r,O," "),r=ac(r,R," "));var h=z(e.nodeName);if(Be(h,o,r))try{u?e.setAttributeNS(u,c,r):e.setAttribute(c,r),nc(n.removed)}catch(e){}}}Ie("afterSanitizeAttributes",e,null)}},Ue=function e(t){var n,r=Oe(t);for(Ie("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)Ie("uponSanitizeShadowNode",n,null),Pe(n)||(n.content instanceof i&&e(n.content),je(n));Ie("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e,o){var a,l,c,u,h;if((ve=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!De(e)){if("function"!=typeof e.toString)throw uc("toString is not a function");if("string"!=typeof(e=e.toString()))throw uc("dirty is not a string, aborting")}if(!n.isSupported){
|
|
204
|
+
if("object"===Pl(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(De(e))return t.toStaticHTML(e.outerHTML)}return e}if(J||ke(o),n.removed=[],"string"==typeof e&&(ie=!1),ie){if(e.nodeName){var d=z(e.nodeName);if(!j[d]||G[d])throw uc("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof s)1===(l=(a=ze("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?a=l:a.appendChild(l);else{if(!ee&&!X&&!Z&&-1===e.indexOf("<"))return w&&ne?w.createHTML(e):e;if(!(a=ze(e)))return ee?null:ne?x:""}a&&Q&&Me(a.firstChild);for(var p=Oe(ie?e:a);c=p.nextNode();)3===c.nodeType&&c===u||Pe(c)||(c.content instanceof i&&Ue(c.content),je(c),u=c);if(u=null,ie)return e;if(ee){if(te)for(h=E.call(a.ownerDocument);a.firstChild;)h.appendChild(a.firstChild);else h=a;return H.shadowroot&&(h=T.call(r,h,!0)),h}var m=Z?a.outerHTML:a.innerHTML
|
|
205
|
+
;return Z&&j["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&cc(Oc,a.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+a.ownerDocument.doctype.name+">\n"+m),X&&(m=ac(m,O," "),m=ac(m,R," ")),w&&ne?w.createHTML(m):m},n.setConfig=function(e){ke(e),J=!0},n.clearConfig=function(){ye=null,J=!1},n.isValidAttribute=function(e,t,n){ye||ke({});var r=z(e),o=z(t);return Be(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(M[e]=M[e]||[],rc(M[e],t))},n.removeHook=function(e){if(M[e])return nc(M[e])},n.removeHooks=function(e){M[e]&&(M[e]=[])},n.removeAllHooks=function(){M={}},n}(),Pc=/["'&<>]/,Bc=function(e){var t,n=""+e,r=Pc.exec(n);if(!r)return n;var o="",i=0,a=0;for(i=r.index;i<n.length;i++){switch(n.charCodeAt(i)){case 34:t=""";break;case 38:t="&";break;case 39:t="'";break;case 60:t="<";break;case 62:t=">";break;default:continue}a!==i&&(o+=n.substring(a,i)),a=i+1,o+=t}return a!==i?o+n.substring(a,i):o};class Fc{constructor(e,t,n){this.lexer=void 0,
|
|
206
|
+
this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new Fc(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class jc{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new jc(t,Fc.range(this,e))}}class Uc{constructor(e,t){this.position=void 0;var n,r="KaTeX parse error: "+e,o=t&&t.loc;if(o&&o.start<=o.end){var i=o.lexer.input;n=o.start;var a=o.end;n===i.length?r+=" at end of input: ":r+=" at position "+(n+1)+": ";var s=i.slice(n,a).replace(/[^]/g,"$&̲");r+=(n>15?"…"+i.slice(n-15,n):i.slice(0,n))+s+(a+15<i.length?i.slice(a,a+15)+"…":i.slice(a))}var l=new Error(r);return l.name="ParseError",l.__proto__=Uc.prototype,l.position=n,l}}Uc.prototype.__proto__=Error.prototype;var Hc=/([A-Z])/g,qc={"&":"&",">":">","<":"<",'"':""","'":"'"},$c=/[&><"']/g;var Gc=function e(t){
|
|
207
|
+
return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},Vc={contains:function(e,t){return-1!==e.indexOf(t)},deflt:function(e,t){return void 0===e?t:e},escape:function(e){return String(e).replace($c,(e=>qc[e]))},hyphenate:function(e){return e.replace(Hc,"-$1").toLowerCase()},getBaseElem:Gc,isCharacterBox:function(e){var t=Gc(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){var t=/^\s*([^\\/#]*?)(?::|�*58|�*3a)/i.exec(e);return null!=t?t[1]:"_relative"}},Yc={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."
|
|
208
208
|
},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",
|
|
209
209
|
processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,
|
|
210
|
-
description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function
|
|
211
|
-
reportNonstrict(e,t,n){var r=this.strict;if("function"==typeof r&&(r=r(e,t,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new
|
|
212
|
-
;var t="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(t)}}class
|
|
213
|
-
blocks:[[44032,55215]]}];var
|
|
210
|
+
description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function Wc(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if("string"!=typeof n)return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class Kc{constructor(e){for(var t in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},Yc)if(Yc.hasOwnProperty(t)){var n=Yc[t];this[t]=void 0!==e[t]?n.processor?n.processor(e[t]):e[t]:Wc(n)}}
|
|
211
|
+
reportNonstrict(e,t,n){var r=this.strict;if("function"==typeof r&&(r=r(e,t,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new Uc("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n);"warn"===r?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var r=this.strict;if("function"==typeof r)try{r=r(e,t,n)}catch(e){r="error"}return!(!r||"ignore"===r)&&(!0===r||"error"===r||("warn"===r?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]"),!1)))}isTrusted(e){e.url&&!e.protocol&&(e.protocol=Vc.protocolFromUrl(e.url))
|
|
212
|
+
;var t="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(t)}}class Xc{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Zc[Jc[this.id]]}sub(){return Zc[Qc[this.id]]}fracNum(){return Zc[eu[this.id]]}fracDen(){return Zc[tu[this.id]]}cramp(){return Zc[nu[this.id]]}text(){return Zc[ru[this.id]]}isTight(){return this.size>=2}}var Zc=[new Xc(0,0,!1),new Xc(1,0,!0),new Xc(2,1,!1),new Xc(3,1,!0),new Xc(4,2,!1),new Xc(5,2,!0),new Xc(6,3,!1),new Xc(7,3,!0)],Jc=[4,5,4,5,6,7,6,7],Qc=[5,5,5,5,7,7,7,7],eu=[2,3,4,5,6,7,6,7],tu=[3,3,5,5,7,7,7,7],nu=[1,1,3,3,5,5,7,7],ru=[0,1,2,3,2,3,2,3],ou={DISPLAY:Zc[0],TEXT:Zc[2],SCRIPT:Zc[4],SCRIPTSCRIPT:Zc[6]},iu=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",
|
|
213
|
+
blocks:[[44032,55215]]}];var au=[];function su(e){for(var t=0;t<au.length;t+=2)if(e>=au[t]&&e<=au[t+1])return!0;return!1}iu.forEach((e=>e.blocks.forEach((e=>au.push(...e)))));var lu={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",
|
|
214
214
|
doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",
|
|
215
215
|
leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",
|
|
216
216
|
leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",
|
|
@@ -229,7 +229,7 @@ widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,
|
|
|
229
229
|
baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",
|
|
230
230
|
rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",
|
|
231
231
|
rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",
|
|
232
|
-
shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class
|
|
232
|
+
shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class cu{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return Vc.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map((e=>e.toText())).join("")}}var uu={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],
|
|
233
233
|
67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],
|
|
234
234
|
8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],
|
|
235
235
|
8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],
|
|
@@ -286,188 +286,188 @@ shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,
|
|
|
286
286
|
8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],
|
|
287
287
|
37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],
|
|
288
288
|
79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],
|
|
289
|
-
120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},
|
|
290
|
-
quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},
|
|
291
|
-
"а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function
|
|
292
|
-
this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||
|
|
293
|
-
textSize:e,sizeMultiplier:
|
|
294
|
-
cssEmPerMu:
|
|
295
|
-
this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var r=t.getColor();r&&(this.style.color=r)}},
|
|
296
|
-
this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,
|
|
297
|
-
;for(var t in e.src=this.src,e.alt=this.alt,e.className="mord",this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e="<img src='"+this.src+" 'alt='"+this.alt+"' ",t="";for(var n in this.style)this.style.hasOwnProperty(n)&&(t+=
|
|
298
|
-
/[îïíì]/.test(this.text)&&(this.text=
|
|
299
|
-
var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+"='"+this.attributes[t]+"'");e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>"}}class
|
|
300
|
-
var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+"='"+this.attributes[t]+"'");return e+="/>"}}function
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
Hu
|
|
318
|
-
Hu
|
|
319
|
-
var
|
|
320
|
-
|
|
321
|
-
var
|
|
322
|
-
return
|
|
323
|
-
i.maxFontSize>r&&(r=i.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},
|
|
324
|
-
mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},
|
|
325
|
-
for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,o=r,i=1;i<t.length;i++){var a=-t[i].shift-o-t[i].elem.depth,s=a-(t[i-1].elem.height+t[i-1].elem.depth);o+=a,n.push({type:"kern",size:s}),n.push(t[i])}return{children:n,depth:r}}var l;if("top"===e.positionType){for(var c=e.positionData,u=0;u<e.children.length;u++){var h=e.children[u];c-="kern"===h.type?h.size:h.elem.height+h.elem.depth}l=c}else if("bottom"===e.positionType)l=-e.positionData;else{var d=e.children[0];if("elem"!==d.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)l=-d.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");l=-d.elem.depth}}return{children:e.children,depth:l}}(e),o=0,i=0;i<n.length;i++){var a=n[i];if("elem"===a.type){var s=a.elem;o=Math.max(o,s.maxFontSize,s.height)}}o+=2;var l=
|
|
326
|
-
var f=m.elem,g=m.wrapperClasses||[],v=m.wrapperStyle||{},_=
|
|
327
|
-
if(120485===n||120486===n)return[
|
|
328
|
-
;return
|
|
329
|
-
mord:
|
|
330
|
-
},
|
|
331
|
-
var n=
|
|
332
|
-
r=
|
|
333
|
-
var h=i.children[0];h.style.height=
|
|
334
|
-
;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</"+this.type+">"}toText(){return this.children.map((e=>e.toText())).join("")}}class
|
|
335
|
-
return this.character?this.character:" "}},newDocumentFragment:
|
|
336
|
-
;if("mathfrak"===n)return"fraktur";if("mathscr"===n||"mathcal"===n)return"script";if("mathsf"===n)return"sans-serif";if("mathtt"===n)return"monospace";var o=e.text;return
|
|
337
|
-
;if(c instanceof
|
|
338
|
-
},
|
|
289
|
+
120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},hu={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],
|
|
290
|
+
quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},du={"Å":"A","Ð":"D","Þ":"o","å":"a","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R",
|
|
291
|
+
"а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function pu(e,t,n){if(!uu[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),o=uu[t][r];if(!o&&e[0]in du&&(r=du[e[0]].charCodeAt(0),o=uu[t][r]),o||"text"!==n||su(r)&&(o=uu[t][77]),o)return{depth:o[0],height:o[1],italic:o[2],skew:o[3],width:o[4]}}var mu={};var fu=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],gu=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],vu=function(e,t){return t.size<2?e:fu[e-1][t.size-1]};class _u{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,
|
|
292
|
+
this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||_u.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=gu[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return new _u(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:vu(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,
|
|
293
|
+
textSize:e,sizeMultiplier:gu[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=vu(_u.BASESIZE,e);return this.size===t&&this.textSize===_u.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==_u.BASESIZE?["sizing","reset-size"+this.size,"size"+_u.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!mu[t=e>=5?0:e>=3?1:2]){var n=mu[t]={
|
|
294
|
+
cssEmPerMu:hu.quad[t]/18};for(var r in hu)hu.hasOwnProperty(r)&&(n[r]=hu[r][t])}return mu[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}_u.BASESIZE=6;var bu={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},yu={ex:!0,em:!0,mu:!0},wu=function(e){return"string"!=typeof e&&(e=e.unit),e in bu||e in yu||"ex"===e},xu=function(e,t){var n;if(e.unit in bu)n=bu[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)n=t.fontMetrics().cssEmPerMu;else{var r;if(r=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)n=r.fontMetrics().xHeight;else{if("em"!==e.unit)throw new Uc("Invalid unit: '"+e.unit+"'");n=r.fontMetrics().quad}r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},ku=function(e){return+e.toFixed(4)+"em"},Su=function(e){return e.filter((e=>e)).join(" ")},Cu=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,
|
|
295
|
+
this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var r=t.getColor();r&&(this.style.color=r)}},Eu=function(e){var t=document.createElement(e);for(var n in t.className=Su(this.classes),this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var r in this.attributes)this.attributes.hasOwnProperty(r)&&t.setAttribute(r,this.attributes[r]);for(var o=0;o<this.children.length;o++)t.appendChild(this.children[o].toNode());return t},Au=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+Vc.escape(Su(this.classes))+'"');var n="";for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=Vc.hyphenate(r)+":"+this.style[r]+";");for(var o in n&&(t+=' style="'+Vc.escape(n)+'"'),this.attributes)this.attributes.hasOwnProperty(o)&&(t+=" "+o+'="'+Vc.escape(this.attributes[o])+'"');t+=">";for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+="</"+e+">"};class Tu{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,
|
|
296
|
+
this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Cu.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return Vc.contains(this.classes,e)}toNode(){return Eu.call(this,"span")}toMarkup(){return Au.call(this,"span")}}class Nu{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Cu.call(this,t,r),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return Vc.contains(this.classes,e)}toNode(){return Eu.call(this,"a")}toMarkup(){return Au.call(this,"a")}}class Mu{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return Vc.contains(this.classes,e)}toNode(){var e=document.createElement("img")
|
|
297
|
+
;for(var t in e.src=this.src,e.alt=this.alt,e.className="mord",this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e="<img src='"+this.src+" 'alt='"+this.alt+"' ",t="";for(var n in this.style)this.style.hasOwnProperty(n)&&(t+=Vc.hyphenate(n)+":"+this.style[n]+";");return t&&(e+=' style="'+Vc.escape(t)+'"'),e+="'/>"}}var Lu={"î":"ı̂","ï":"ı̈","í":"ı́","ì":"ı̀"};class zu{constructor(e,t,n,r,o,i,a,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=o||0,this.width=i||0,this.classes=a||[],this.style=s||{},this.maxFontSize=0;var l=function(e){for(var t=0;t<iu.length;t++)for(var n=iu[t],r=0;r<n.blocks.length;r++){var o=n.blocks[r];if(e>=o[0]&&e<=o[1])return n.name}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),
|
|
298
|
+
/[îïíì]/.test(this.text)&&(this.text=Lu[this.text])}hasClass(e){return Vc.contains(this.classes,e)}toNode(){var e=document.createTextNode(this.text),t=null;for(var n in this.italic>0&&((t=document.createElement("span")).style.marginRight=ku(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=Su(this.classes)),this.style)this.style.hasOwnProperty(n)&&((t=t||document.createElement("span")).style[n]=this.style[n]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=Vc.escape(Su(this.classes)),t+='"');var n="";for(var r in this.italic>0&&(n+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(r)&&(n+=Vc.hyphenate(r)+":"+this.style[r]+";");n&&(e=!0,t+=' style="'+Vc.escape(n)+'"');var o=Vc.escape(this.text);return e?(t+=">",t+=o,t+="</span>"):o}}class Ou{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){
|
|
299
|
+
var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+"='"+this.attributes[t]+"'");e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>"}}class Ru{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?e.setAttribute("d",this.alternate):e.setAttribute("d",lu[this.pathName]),e}toMarkup(){return this.alternate?"<path d='"+this.alternate+"'/>":"<path d='"+lu[this.pathName]+"'/>"}}class Du{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){
|
|
300
|
+
var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+"='"+this.attributes[t]+"'");return e+="/>"}}function Iu(e){if(e instanceof zu)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}var Pu={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Bu={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Fu={math:{},text:{}};function ju(e,t,n,r,o,i){Fu[e][o]={font:t,group:n,replace:r},i&&r&&(Fu[e][r]=Fu[e][o])}var Uu="math",Hu="text",qu="main",$u="ams",Gu="accent-token",Vu="bin",Yu="close",Wu="mathord",Ku="op-token",Xu="open",Zu="rel",Ju="textord";ju(Uu,qu,Zu,"≡","\\equiv",!0),ju(Uu,qu,Zu,"≺","\\prec",!0),ju(Uu,qu,Zu,"≻","\\succ",!0),ju(Uu,qu,Zu,"∼","\\sim",!0),ju(Uu,qu,Zu,"⊥","\\perp"),ju(Uu,qu,Zu,"⪯","\\preceq",!0),
|
|
301
|
+
ju(Uu,qu,Zu,"⪰","\\succeq",!0),ju(Uu,qu,Zu,"≃","\\simeq",!0),ju(Uu,qu,Zu,"∣","\\mid",!0),ju(Uu,qu,Zu,"≪","\\ll",!0),ju(Uu,qu,Zu,"≫","\\gg",!0),ju(Uu,qu,Zu,"≍","\\asymp",!0),ju(Uu,qu,Zu,"∥","\\parallel"),ju(Uu,qu,Zu,"⋈","\\bowtie",!0),ju(Uu,qu,Zu,"⌣","\\smile",!0),ju(Uu,qu,Zu,"⊑","\\sqsubseteq",!0),ju(Uu,qu,Zu,"⊒","\\sqsupseteq",!0),ju(Uu,qu,Zu,"≐","\\doteq",!0),ju(Uu,qu,Zu,"⌢","\\frown",!0),ju(Uu,qu,Zu,"∋","\\ni",!0),ju(Uu,qu,Zu,"∝","\\propto",!0),ju(Uu,qu,Zu,"⊢","\\vdash",!0),ju(Uu,qu,Zu,"⊣","\\dashv",!0),ju(Uu,qu,Zu,"∋","\\owns"),ju(Uu,qu,"punct",".","\\ldotp"),ju(Uu,qu,"punct","⋅","\\cdotp"),ju(Uu,qu,Ju,"#","\\#"),ju(Hu,qu,Ju,"#","\\#"),ju(Uu,qu,Ju,"&","\\&"),ju(Hu,qu,Ju,"&","\\&"),ju(Uu,qu,Ju,"ℵ","\\aleph",!0),ju(Uu,qu,Ju,"∀","\\forall",!0),ju(Uu,qu,Ju,"ℏ","\\hbar",!0),ju(Uu,qu,Ju,"∃","\\exists",!0),ju(Uu,qu,Ju,"∇","\\nabla",!0),ju(Uu,qu,Ju,"♭","\\flat",!0),ju(Uu,qu,Ju,"ℓ","\\ell",!0),ju(Uu,qu,Ju,"♮","\\natural",!0),ju(Uu,qu,Ju,"♣","\\clubsuit",!0),ju(Uu,qu,Ju,"℘","\\wp",!0),ju(Uu,qu,Ju,"♯","\\sharp",!0),
|
|
302
|
+
ju(Uu,qu,Ju,"♢","\\diamondsuit",!0),ju(Uu,qu,Ju,"ℜ","\\Re",!0),ju(Uu,qu,Ju,"♡","\\heartsuit",!0),ju(Uu,qu,Ju,"ℑ","\\Im",!0),ju(Uu,qu,Ju,"♠","\\spadesuit",!0),ju(Uu,qu,Ju,"§","\\S",!0),ju(Hu,qu,Ju,"§","\\S"),ju(Uu,qu,Ju,"¶","\\P",!0),ju(Hu,qu,Ju,"¶","\\P"),ju(Uu,qu,Ju,"†","\\dag"),ju(Hu,qu,Ju,"†","\\dag"),ju(Hu,qu,Ju,"†","\\textdagger"),ju(Uu,qu,Ju,"‡","\\ddag"),ju(Hu,qu,Ju,"‡","\\ddag"),ju(Hu,qu,Ju,"‡","\\textdaggerdbl"),ju(Uu,qu,Yu,"⎱","\\rmoustache",!0),ju(Uu,qu,Xu,"⎰","\\lmoustache",!0),ju(Uu,qu,Yu,"⟯","\\rgroup",!0),ju(Uu,qu,Xu,"⟮","\\lgroup",!0),ju(Uu,qu,Vu,"∓","\\mp",!0),ju(Uu,qu,Vu,"⊖","\\ominus",!0),ju(Uu,qu,Vu,"⊎","\\uplus",!0),ju(Uu,qu,Vu,"⊓","\\sqcap",!0),ju(Uu,qu,Vu,"∗","\\ast"),ju(Uu,qu,Vu,"⊔","\\sqcup",!0),ju(Uu,qu,Vu,"◯","\\bigcirc",!0),ju(Uu,qu,Vu,"∙","\\bullet",!0),ju(Uu,qu,Vu,"‡","\\ddagger"),ju(Uu,qu,Vu,"≀","\\wr",!0),ju(Uu,qu,Vu,"⨿","\\amalg"),ju(Uu,qu,Vu,"&","\\And"),ju(Uu,qu,Zu,"⟵","\\longleftarrow",!0),ju(Uu,qu,Zu,"⇐","\\Leftarrow",!0),ju(Uu,qu,Zu,"⟸","\\Longleftarrow",!0),
|
|
303
|
+
ju(Uu,qu,Zu,"⟶","\\longrightarrow",!0),ju(Uu,qu,Zu,"⇒","\\Rightarrow",!0),ju(Uu,qu,Zu,"⟹","\\Longrightarrow",!0),ju(Uu,qu,Zu,"↔","\\leftrightarrow",!0),ju(Uu,qu,Zu,"⟷","\\longleftrightarrow",!0),ju(Uu,qu,Zu,"⇔","\\Leftrightarrow",!0),ju(Uu,qu,Zu,"⟺","\\Longleftrightarrow",!0),ju(Uu,qu,Zu,"↦","\\mapsto",!0),ju(Uu,qu,Zu,"⟼","\\longmapsto",!0),ju(Uu,qu,Zu,"↗","\\nearrow",!0),ju(Uu,qu,Zu,"↩","\\hookleftarrow",!0),ju(Uu,qu,Zu,"↪","\\hookrightarrow",!0),ju(Uu,qu,Zu,"↘","\\searrow",!0),ju(Uu,qu,Zu,"↼","\\leftharpoonup",!0),ju(Uu,qu,Zu,"⇀","\\rightharpoonup",!0),ju(Uu,qu,Zu,"↙","\\swarrow",!0),ju(Uu,qu,Zu,"↽","\\leftharpoondown",!0),ju(Uu,qu,Zu,"⇁","\\rightharpoondown",!0),ju(Uu,qu,Zu,"↖","\\nwarrow",!0),ju(Uu,qu,Zu,"⇌","\\rightleftharpoons",!0),ju(Uu,$u,Zu,"≮","\\nless",!0),ju(Uu,$u,Zu,"","\\@nleqslant"),ju(Uu,$u,Zu,"","\\@nleqq"),ju(Uu,$u,Zu,"⪇","\\lneq",!0),ju(Uu,$u,Zu,"≨","\\lneqq",!0),ju(Uu,$u,Zu,"","\\@lvertneqq"),ju(Uu,$u,Zu,"⋦","\\lnsim",!0),ju(Uu,$u,Zu,"⪉","\\lnapprox",!0),ju(Uu,$u,Zu,"⊀","\\nprec",!0),
|
|
304
|
+
ju(Uu,$u,Zu,"⋠","\\npreceq",!0),ju(Uu,$u,Zu,"⋨","\\precnsim",!0),ju(Uu,$u,Zu,"⪹","\\precnapprox",!0),ju(Uu,$u,Zu,"≁","\\nsim",!0),ju(Uu,$u,Zu,"","\\@nshortmid"),ju(Uu,$u,Zu,"∤","\\nmid",!0),ju(Uu,$u,Zu,"⊬","\\nvdash",!0),ju(Uu,$u,Zu,"⊭","\\nvDash",!0),ju(Uu,$u,Zu,"⋪","\\ntriangleleft"),ju(Uu,$u,Zu,"⋬","\\ntrianglelefteq",!0),ju(Uu,$u,Zu,"⊊","\\subsetneq",!0),ju(Uu,$u,Zu,"","\\@varsubsetneq"),ju(Uu,$u,Zu,"⫋","\\subsetneqq",!0),ju(Uu,$u,Zu,"","\\@varsubsetneqq"),ju(Uu,$u,Zu,"≯","\\ngtr",!0),ju(Uu,$u,Zu,"","\\@ngeqslant"),ju(Uu,$u,Zu,"","\\@ngeqq"),ju(Uu,$u,Zu,"⪈","\\gneq",!0),ju(Uu,$u,Zu,"≩","\\gneqq",!0),ju(Uu,$u,Zu,"","\\@gvertneqq"),ju(Uu,$u,Zu,"⋧","\\gnsim",!0),ju(Uu,$u,Zu,"⪊","\\gnapprox",!0),ju(Uu,$u,Zu,"⊁","\\nsucc",!0),ju(Uu,$u,Zu,"⋡","\\nsucceq",!0),ju(Uu,$u,Zu,"⋩","\\succnsim",!0),ju(Uu,$u,Zu,"⪺","\\succnapprox",!0),ju(Uu,$u,Zu,"≆","\\ncong",!0),ju(Uu,$u,Zu,"","\\@nshortparallel"),ju(Uu,$u,Zu,"∦","\\nparallel",!0),ju(Uu,$u,Zu,"⊯","\\nVDash",!0),ju(Uu,$u,Zu,"⋫","\\ntriangleright"),
|
|
305
|
+
ju(Uu,$u,Zu,"⋭","\\ntrianglerighteq",!0),ju(Uu,$u,Zu,"","\\@nsupseteqq"),ju(Uu,$u,Zu,"⊋","\\supsetneq",!0),ju(Uu,$u,Zu,"","\\@varsupsetneq"),ju(Uu,$u,Zu,"⫌","\\supsetneqq",!0),ju(Uu,$u,Zu,"","\\@varsupsetneqq"),ju(Uu,$u,Zu,"⊮","\\nVdash",!0),ju(Uu,$u,Zu,"⪵","\\precneqq",!0),ju(Uu,$u,Zu,"⪶","\\succneqq",!0),ju(Uu,$u,Zu,"","\\@nsubseteqq"),ju(Uu,$u,Vu,"⊴","\\unlhd"),ju(Uu,$u,Vu,"⊵","\\unrhd"),ju(Uu,$u,Zu,"↚","\\nleftarrow",!0),ju(Uu,$u,Zu,"↛","\\nrightarrow",!0),ju(Uu,$u,Zu,"⇍","\\nLeftarrow",!0),ju(Uu,$u,Zu,"⇏","\\nRightarrow",!0),ju(Uu,$u,Zu,"↮","\\nleftrightarrow",!0),ju(Uu,$u,Zu,"⇎","\\nLeftrightarrow",!0),ju(Uu,$u,Zu,"△","\\vartriangle"),ju(Uu,$u,Ju,"ℏ","\\hslash"),ju(Uu,$u,Ju,"▽","\\triangledown"),ju(Uu,$u,Ju,"◊","\\lozenge"),ju(Uu,$u,Ju,"Ⓢ","\\circledS"),ju(Uu,$u,Ju,"®","\\circledR"),ju(Hu,$u,Ju,"®","\\circledR"),ju(Uu,$u,Ju,"∡","\\measuredangle",!0),ju(Uu,$u,Ju,"∄","\\nexists"),ju(Uu,$u,Ju,"℧","\\mho"),ju(Uu,$u,Ju,"Ⅎ","\\Finv",!0),ju(Uu,$u,Ju,"⅁","\\Game",!0),ju(Uu,$u,Ju,"‵","\\backprime"),
|
|
306
|
+
ju(Uu,$u,Ju,"▲","\\blacktriangle"),ju(Uu,$u,Ju,"▼","\\blacktriangledown"),ju(Uu,$u,Ju,"■","\\blacksquare"),ju(Uu,$u,Ju,"⧫","\\blacklozenge"),ju(Uu,$u,Ju,"★","\\bigstar"),ju(Uu,$u,Ju,"∢","\\sphericalangle",!0),ju(Uu,$u,Ju,"∁","\\complement",!0),ju(Uu,$u,Ju,"ð","\\eth",!0),ju(Hu,qu,Ju,"ð","ð"),ju(Uu,$u,Ju,"╱","\\diagup"),ju(Uu,$u,Ju,"╲","\\diagdown"),ju(Uu,$u,Ju,"□","\\square"),ju(Uu,$u,Ju,"□","\\Box"),ju(Uu,$u,Ju,"◊","\\Diamond"),ju(Uu,$u,Ju,"¥","\\yen",!0),ju(Hu,$u,Ju,"¥","\\yen",!0),ju(Uu,$u,Ju,"✓","\\checkmark",!0),ju(Hu,$u,Ju,"✓","\\checkmark"),ju(Uu,$u,Ju,"ℶ","\\beth",!0),ju(Uu,$u,Ju,"ℸ","\\daleth",!0),ju(Uu,$u,Ju,"ℷ","\\gimel",!0),ju(Uu,$u,Ju,"ϝ","\\digamma",!0),ju(Uu,$u,Ju,"ϰ","\\varkappa"),ju(Uu,$u,Xu,"┌","\\@ulcorner",!0),ju(Uu,$u,Yu,"┐","\\@urcorner",!0),ju(Uu,$u,Xu,"└","\\@llcorner",!0),ju(Uu,$u,Yu,"┘","\\@lrcorner",!0),ju(Uu,$u,Zu,"≦","\\leqq",!0),ju(Uu,$u,Zu,"⩽","\\leqslant",!0),ju(Uu,$u,Zu,"⪕","\\eqslantless",!0),ju(Uu,$u,Zu,"≲","\\lesssim",!0),ju(Uu,$u,Zu,"⪅","\\lessapprox",!0),
|
|
307
|
+
ju(Uu,$u,Zu,"≊","\\approxeq",!0),ju(Uu,$u,Vu,"⋖","\\lessdot"),ju(Uu,$u,Zu,"⋘","\\lll",!0),ju(Uu,$u,Zu,"≶","\\lessgtr",!0),ju(Uu,$u,Zu,"⋚","\\lesseqgtr",!0),ju(Uu,$u,Zu,"⪋","\\lesseqqgtr",!0),ju(Uu,$u,Zu,"≑","\\doteqdot"),ju(Uu,$u,Zu,"≓","\\risingdotseq",!0),ju(Uu,$u,Zu,"≒","\\fallingdotseq",!0),ju(Uu,$u,Zu,"∽","\\backsim",!0),ju(Uu,$u,Zu,"⋍","\\backsimeq",!0),ju(Uu,$u,Zu,"⫅","\\subseteqq",!0),ju(Uu,$u,Zu,"⋐","\\Subset",!0),ju(Uu,$u,Zu,"⊏","\\sqsubset",!0),ju(Uu,$u,Zu,"≼","\\preccurlyeq",!0),ju(Uu,$u,Zu,"⋞","\\curlyeqprec",!0),ju(Uu,$u,Zu,"≾","\\precsim",!0),ju(Uu,$u,Zu,"⪷","\\precapprox",!0),ju(Uu,$u,Zu,"⊲","\\vartriangleleft"),ju(Uu,$u,Zu,"⊴","\\trianglelefteq"),ju(Uu,$u,Zu,"⊨","\\vDash",!0),ju(Uu,$u,Zu,"⊪","\\Vvdash",!0),ju(Uu,$u,Zu,"⌣","\\smallsmile"),ju(Uu,$u,Zu,"⌢","\\smallfrown"),ju(Uu,$u,Zu,"≏","\\bumpeq",!0),ju(Uu,$u,Zu,"≎","\\Bumpeq",!0),ju(Uu,$u,Zu,"≧","\\geqq",!0),ju(Uu,$u,Zu,"⩾","\\geqslant",!0),ju(Uu,$u,Zu,"⪖","\\eqslantgtr",!0),ju(Uu,$u,Zu,"≳","\\gtrsim",!0),ju(Uu,$u,Zu,"⪆","\\gtrapprox",!0),
|
|
308
|
+
ju(Uu,$u,Vu,"⋗","\\gtrdot"),ju(Uu,$u,Zu,"⋙","\\ggg",!0),ju(Uu,$u,Zu,"≷","\\gtrless",!0),ju(Uu,$u,Zu,"⋛","\\gtreqless",!0),ju(Uu,$u,Zu,"⪌","\\gtreqqless",!0),ju(Uu,$u,Zu,"≖","\\eqcirc",!0),ju(Uu,$u,Zu,"≗","\\circeq",!0),ju(Uu,$u,Zu,"≜","\\triangleq",!0),ju(Uu,$u,Zu,"∼","\\thicksim"),ju(Uu,$u,Zu,"≈","\\thickapprox"),ju(Uu,$u,Zu,"⫆","\\supseteqq",!0),ju(Uu,$u,Zu,"⋑","\\Supset",!0),ju(Uu,$u,Zu,"⊐","\\sqsupset",!0),ju(Uu,$u,Zu,"≽","\\succcurlyeq",!0),ju(Uu,$u,Zu,"⋟","\\curlyeqsucc",!0),ju(Uu,$u,Zu,"≿","\\succsim",!0),ju(Uu,$u,Zu,"⪸","\\succapprox",!0),ju(Uu,$u,Zu,"⊳","\\vartriangleright"),ju(Uu,$u,Zu,"⊵","\\trianglerighteq"),ju(Uu,$u,Zu,"⊩","\\Vdash",!0),ju(Uu,$u,Zu,"∣","\\shortmid"),ju(Uu,$u,Zu,"∥","\\shortparallel"),ju(Uu,$u,Zu,"≬","\\between",!0),ju(Uu,$u,Zu,"⋔","\\pitchfork",!0),ju(Uu,$u,Zu,"∝","\\varpropto"),ju(Uu,$u,Zu,"◀","\\blacktriangleleft"),ju(Uu,$u,Zu,"∴","\\therefore",!0),ju(Uu,$u,Zu,"∍","\\backepsilon"),ju(Uu,$u,Zu,"▶","\\blacktriangleright"),ju(Uu,$u,Zu,"∵","\\because",!0),
|
|
309
|
+
ju(Uu,$u,Zu,"⋘","\\llless"),ju(Uu,$u,Zu,"⋙","\\gggtr"),ju(Uu,$u,Vu,"⊲","\\lhd"),ju(Uu,$u,Vu,"⊳","\\rhd"),ju(Uu,$u,Zu,"≂","\\eqsim",!0),ju(Uu,qu,Zu,"⋈","\\Join"),ju(Uu,$u,Zu,"≑","\\Doteq",!0),ju(Uu,$u,Vu,"∔","\\dotplus",!0),ju(Uu,$u,Vu,"∖","\\smallsetminus"),ju(Uu,$u,Vu,"⋒","\\Cap",!0),ju(Uu,$u,Vu,"⋓","\\Cup",!0),ju(Uu,$u,Vu,"⩞","\\doublebarwedge",!0),ju(Uu,$u,Vu,"⊟","\\boxminus",!0),ju(Uu,$u,Vu,"⊞","\\boxplus",!0),ju(Uu,$u,Vu,"⋇","\\divideontimes",!0),ju(Uu,$u,Vu,"⋉","\\ltimes",!0),ju(Uu,$u,Vu,"⋊","\\rtimes",!0),ju(Uu,$u,Vu,"⋋","\\leftthreetimes",!0),ju(Uu,$u,Vu,"⋌","\\rightthreetimes",!0),ju(Uu,$u,Vu,"⋏","\\curlywedge",!0),ju(Uu,$u,Vu,"⋎","\\curlyvee",!0),ju(Uu,$u,Vu,"⊝","\\circleddash",!0),ju(Uu,$u,Vu,"⊛","\\circledast",!0),ju(Uu,$u,Vu,"⋅","\\centerdot"),ju(Uu,$u,Vu,"⊺","\\intercal",!0),ju(Uu,$u,Vu,"⋒","\\doublecap"),ju(Uu,$u,Vu,"⋓","\\doublecup"),ju(Uu,$u,Vu,"⊠","\\boxtimes",!0),ju(Uu,$u,Zu,"⇢","\\dashrightarrow",!0),ju(Uu,$u,Zu,"⇠","\\dashleftarrow",!0),ju(Uu,$u,Zu,"⇇","\\leftleftarrows",!0),
|
|
310
|
+
ju(Uu,$u,Zu,"⇆","\\leftrightarrows",!0),ju(Uu,$u,Zu,"⇚","\\Lleftarrow",!0),ju(Uu,$u,Zu,"↞","\\twoheadleftarrow",!0),ju(Uu,$u,Zu,"↢","\\leftarrowtail",!0),ju(Uu,$u,Zu,"↫","\\looparrowleft",!0),ju(Uu,$u,Zu,"⇋","\\leftrightharpoons",!0),ju(Uu,$u,Zu,"↶","\\curvearrowleft",!0),ju(Uu,$u,Zu,"↺","\\circlearrowleft",!0),ju(Uu,$u,Zu,"↰","\\Lsh",!0),ju(Uu,$u,Zu,"⇈","\\upuparrows",!0),ju(Uu,$u,Zu,"↿","\\upharpoonleft",!0),ju(Uu,$u,Zu,"⇃","\\downharpoonleft",!0),ju(Uu,qu,Zu,"⊶","\\origof",!0),ju(Uu,qu,Zu,"⊷","\\imageof",!0),ju(Uu,$u,Zu,"⊸","\\multimap",!0),ju(Uu,$u,Zu,"↭","\\leftrightsquigarrow",!0),ju(Uu,$u,Zu,"⇉","\\rightrightarrows",!0),ju(Uu,$u,Zu,"⇄","\\rightleftarrows",!0),ju(Uu,$u,Zu,"↠","\\twoheadrightarrow",!0),ju(Uu,$u,Zu,"↣","\\rightarrowtail",!0),ju(Uu,$u,Zu,"↬","\\looparrowright",!0),ju(Uu,$u,Zu,"↷","\\curvearrowright",!0),ju(Uu,$u,Zu,"↻","\\circlearrowright",!0),ju(Uu,$u,Zu,"↱","\\Rsh",!0),ju(Uu,$u,Zu,"⇊","\\downdownarrows",!0),ju(Uu,$u,Zu,"↾","\\upharpoonright",!0),ju(Uu,$u,Zu,"⇂","\\downharpoonright",!0),
|
|
311
|
+
ju(Uu,$u,Zu,"⇝","\\rightsquigarrow",!0),ju(Uu,$u,Zu,"⇝","\\leadsto"),ju(Uu,$u,Zu,"⇛","\\Rrightarrow",!0),ju(Uu,$u,Zu,"↾","\\restriction"),ju(Uu,qu,Ju,"‘","`"),ju(Uu,qu,Ju,"$","\\$"),ju(Hu,qu,Ju,"$","\\$"),ju(Hu,qu,Ju,"$","\\textdollar"),ju(Uu,qu,Ju,"%","\\%"),ju(Hu,qu,Ju,"%","\\%"),ju(Uu,qu,Ju,"_","\\_"),ju(Hu,qu,Ju,"_","\\_"),ju(Hu,qu,Ju,"_","\\textunderscore"),ju(Uu,qu,Ju,"∠","\\angle",!0),ju(Uu,qu,Ju,"∞","\\infty",!0),ju(Uu,qu,Ju,"′","\\prime"),ju(Uu,qu,Ju,"△","\\triangle"),ju(Uu,qu,Ju,"Γ","\\Gamma",!0),ju(Uu,qu,Ju,"Δ","\\Delta",!0),ju(Uu,qu,Ju,"Θ","\\Theta",!0),ju(Uu,qu,Ju,"Λ","\\Lambda",!0),ju(Uu,qu,Ju,"Ξ","\\Xi",!0),ju(Uu,qu,Ju,"Π","\\Pi",!0),ju(Uu,qu,Ju,"Σ","\\Sigma",!0),ju(Uu,qu,Ju,"Υ","\\Upsilon",!0),ju(Uu,qu,Ju,"Φ","\\Phi",!0),ju(Uu,qu,Ju,"Ψ","\\Psi",!0),ju(Uu,qu,Ju,"Ω","\\Omega",!0),ju(Uu,qu,Ju,"A","Α"),ju(Uu,qu,Ju,"B","Β"),ju(Uu,qu,Ju,"E","Ε"),ju(Uu,qu,Ju,"Z","Ζ"),ju(Uu,qu,Ju,"H","Η"),ju(Uu,qu,Ju,"I","Ι"),ju(Uu,qu,Ju,"K","Κ"),ju(Uu,qu,Ju,"M","Μ"),ju(Uu,qu,Ju,"N","Ν"),ju(Uu,qu,Ju,"O","Ο"),
|
|
312
|
+
ju(Uu,qu,Ju,"P","Ρ"),ju(Uu,qu,Ju,"T","Τ"),ju(Uu,qu,Ju,"X","Χ"),ju(Uu,qu,Ju,"¬","\\neg",!0),ju(Uu,qu,Ju,"¬","\\lnot"),ju(Uu,qu,Ju,"⊤","\\top"),ju(Uu,qu,Ju,"⊥","\\bot"),ju(Uu,qu,Ju,"∅","\\emptyset"),ju(Uu,$u,Ju,"∅","\\varnothing"),ju(Uu,qu,Wu,"α","\\alpha",!0),ju(Uu,qu,Wu,"β","\\beta",!0),ju(Uu,qu,Wu,"γ","\\gamma",!0),ju(Uu,qu,Wu,"δ","\\delta",!0),ju(Uu,qu,Wu,"ϵ","\\epsilon",!0),ju(Uu,qu,Wu,"ζ","\\zeta",!0),ju(Uu,qu,Wu,"η","\\eta",!0),ju(Uu,qu,Wu,"θ","\\theta",!0),ju(Uu,qu,Wu,"ι","\\iota",!0),ju(Uu,qu,Wu,"κ","\\kappa",!0),ju(Uu,qu,Wu,"λ","\\lambda",!0),ju(Uu,qu,Wu,"μ","\\mu",!0),ju(Uu,qu,Wu,"ν","\\nu",!0),ju(Uu,qu,Wu,"ξ","\\xi",!0),ju(Uu,qu,Wu,"ο","\\omicron",!0),ju(Uu,qu,Wu,"π","\\pi",!0),ju(Uu,qu,Wu,"ρ","\\rho",!0),ju(Uu,qu,Wu,"σ","\\sigma",!0),ju(Uu,qu,Wu,"τ","\\tau",!0),ju(Uu,qu,Wu,"υ","\\upsilon",!0),ju(Uu,qu,Wu,"ϕ","\\phi",!0),ju(Uu,qu,Wu,"χ","\\chi",!0),ju(Uu,qu,Wu,"ψ","\\psi",!0),ju(Uu,qu,Wu,"ω","\\omega",!0),ju(Uu,qu,Wu,"ε","\\varepsilon",!0),ju(Uu,qu,Wu,"ϑ","\\vartheta",!0),
|
|
313
|
+
ju(Uu,qu,Wu,"ϖ","\\varpi",!0),ju(Uu,qu,Wu,"ϱ","\\varrho",!0),ju(Uu,qu,Wu,"ς","\\varsigma",!0),ju(Uu,qu,Wu,"φ","\\varphi",!0),ju(Uu,qu,Vu,"∗","*",!0),ju(Uu,qu,Vu,"+","+"),ju(Uu,qu,Vu,"−","-",!0),ju(Uu,qu,Vu,"⋅","\\cdot",!0),ju(Uu,qu,Vu,"∘","\\circ",!0),ju(Uu,qu,Vu,"÷","\\div",!0),ju(Uu,qu,Vu,"±","\\pm",!0),ju(Uu,qu,Vu,"×","\\times",!0),ju(Uu,qu,Vu,"∩","\\cap",!0),ju(Uu,qu,Vu,"∪","\\cup",!0),ju(Uu,qu,Vu,"∖","\\setminus",!0),ju(Uu,qu,Vu,"∧","\\land"),ju(Uu,qu,Vu,"∨","\\lor"),ju(Uu,qu,Vu,"∧","\\wedge",!0),ju(Uu,qu,Vu,"∨","\\vee",!0),ju(Uu,qu,Ju,"√","\\surd"),ju(Uu,qu,Xu,"⟨","\\langle",!0),ju(Uu,qu,Xu,"∣","\\lvert"),ju(Uu,qu,Xu,"∥","\\lVert"),ju(Uu,qu,Yu,"?","?"),ju(Uu,qu,Yu,"!","!"),ju(Uu,qu,Yu,"⟩","\\rangle",!0),ju(Uu,qu,Yu,"∣","\\rvert"),ju(Uu,qu,Yu,"∥","\\rVert"),ju(Uu,qu,Zu,"=","="),ju(Uu,qu,Zu,":",":"),ju(Uu,qu,Zu,"≈","\\approx",!0),ju(Uu,qu,Zu,"≅","\\cong",!0),ju(Uu,qu,Zu,"≥","\\ge"),ju(Uu,qu,Zu,"≥","\\geq",!0),ju(Uu,qu,Zu,"←","\\gets"),ju(Uu,qu,Zu,">","\\gt",!0),ju(Uu,qu,Zu,"∈","\\in",!0),
|
|
314
|
+
ju(Uu,qu,Zu,"","\\@not"),ju(Uu,qu,Zu,"⊂","\\subset",!0),ju(Uu,qu,Zu,"⊃","\\supset",!0),ju(Uu,qu,Zu,"⊆","\\subseteq",!0),ju(Uu,qu,Zu,"⊇","\\supseteq",!0),ju(Uu,$u,Zu,"⊈","\\nsubseteq",!0),ju(Uu,$u,Zu,"⊉","\\nsupseteq",!0),ju(Uu,qu,Zu,"⊨","\\models"),ju(Uu,qu,Zu,"←","\\leftarrow",!0),ju(Uu,qu,Zu,"≤","\\le"),ju(Uu,qu,Zu,"≤","\\leq",!0),ju(Uu,qu,Zu,"<","\\lt",!0),ju(Uu,qu,Zu,"→","\\rightarrow",!0),ju(Uu,qu,Zu,"→","\\to"),ju(Uu,$u,Zu,"≱","\\ngeq",!0),ju(Uu,$u,Zu,"≰","\\nleq",!0),ju(Uu,qu,"spacing"," ","\\ "),ju(Uu,qu,"spacing"," ","\\space"),ju(Uu,qu,"spacing"," ","\\nobreakspace"),ju(Hu,qu,"spacing"," ","\\ "),ju(Hu,qu,"spacing"," "," "),ju(Hu,qu,"spacing"," ","\\space"),ju(Hu,qu,"spacing"," ","\\nobreakspace"),ju(Uu,qu,"spacing",null,"\\nobreak"),ju(Uu,qu,"spacing",null,"\\allowbreak"),ju(Uu,qu,"punct",",",","),ju(Uu,qu,"punct",";",";"),ju(Uu,$u,Vu,"⊼","\\barwedge",!0),ju(Uu,$u,Vu,"⊻","\\veebar",!0),ju(Uu,qu,Vu,"⊙","\\odot",!0),ju(Uu,qu,Vu,"⊕","\\oplus",!0),ju(Uu,qu,Vu,"⊗","\\otimes",!0),
|
|
315
|
+
ju(Uu,qu,Ju,"∂","\\partial",!0),ju(Uu,qu,Vu,"⊘","\\oslash",!0),ju(Uu,$u,Vu,"⊚","\\circledcirc",!0),ju(Uu,$u,Vu,"⊡","\\boxdot",!0),ju(Uu,qu,Vu,"△","\\bigtriangleup"),ju(Uu,qu,Vu,"▽","\\bigtriangledown"),ju(Uu,qu,Vu,"†","\\dagger"),ju(Uu,qu,Vu,"⋄","\\diamond"),ju(Uu,qu,Vu,"⋆","\\star"),ju(Uu,qu,Vu,"◃","\\triangleleft"),ju(Uu,qu,Vu,"▹","\\triangleright"),ju(Uu,qu,Xu,"{","\\{"),ju(Hu,qu,Ju,"{","\\{"),ju(Hu,qu,Ju,"{","\\textbraceleft"),ju(Uu,qu,Yu,"}","\\}"),ju(Hu,qu,Ju,"}","\\}"),ju(Hu,qu,Ju,"}","\\textbraceright"),ju(Uu,qu,Xu,"{","\\lbrace"),ju(Uu,qu,Yu,"}","\\rbrace"),ju(Uu,qu,Xu,"[","\\lbrack",!0),ju(Hu,qu,Ju,"[","\\lbrack",!0),ju(Uu,qu,Yu,"]","\\rbrack",!0),ju(Hu,qu,Ju,"]","\\rbrack",!0),ju(Uu,qu,Xu,"(","\\lparen",!0),ju(Uu,qu,Yu,")","\\rparen",!0),ju(Hu,qu,Ju,"<","\\textless",!0),ju(Hu,qu,Ju,">","\\textgreater",!0),ju(Uu,qu,Xu,"⌊","\\lfloor",!0),ju(Uu,qu,Yu,"⌋","\\rfloor",!0),ju(Uu,qu,Xu,"⌈","\\lceil",!0),ju(Uu,qu,Yu,"⌉","\\rceil",!0),ju(Uu,qu,Ju,"\\","\\backslash"),ju(Uu,qu,Ju,"∣","|"),
|
|
316
|
+
ju(Uu,qu,Ju,"∣","\\vert"),ju(Hu,qu,Ju,"|","\\textbar",!0),ju(Uu,qu,Ju,"∥","\\|"),ju(Uu,qu,Ju,"∥","\\Vert"),ju(Hu,qu,Ju,"∥","\\textbardbl"),ju(Hu,qu,Ju,"~","\\textasciitilde"),ju(Hu,qu,Ju,"\\","\\textbackslash"),ju(Hu,qu,Ju,"^","\\textasciicircum"),ju(Uu,qu,Zu,"↑","\\uparrow",!0),ju(Uu,qu,Zu,"⇑","\\Uparrow",!0),ju(Uu,qu,Zu,"↓","\\downarrow",!0),ju(Uu,qu,Zu,"⇓","\\Downarrow",!0),ju(Uu,qu,Zu,"↕","\\updownarrow",!0),ju(Uu,qu,Zu,"⇕","\\Updownarrow",!0),ju(Uu,qu,Ku,"∐","\\coprod"),ju(Uu,qu,Ku,"⋁","\\bigvee"),ju(Uu,qu,Ku,"⋀","\\bigwedge"),ju(Uu,qu,Ku,"⨄","\\biguplus"),ju(Uu,qu,Ku,"⋂","\\bigcap"),ju(Uu,qu,Ku,"⋃","\\bigcup"),ju(Uu,qu,Ku,"∫","\\int"),ju(Uu,qu,Ku,"∫","\\intop"),ju(Uu,qu,Ku,"∬","\\iint"),ju(Uu,qu,Ku,"∭","\\iiint"),ju(Uu,qu,Ku,"∏","\\prod"),ju(Uu,qu,Ku,"∑","\\sum"),ju(Uu,qu,Ku,"⨂","\\bigotimes"),ju(Uu,qu,Ku,"⨁","\\bigoplus"),ju(Uu,qu,Ku,"⨀","\\bigodot"),ju(Uu,qu,Ku,"∮","\\oint"),ju(Uu,qu,Ku,"∯","\\oiint"),ju(Uu,qu,Ku,"∰","\\oiiint"),ju(Uu,qu,Ku,"⨆","\\bigsqcup"),ju(Uu,qu,Ku,"∫","\\smallint"),
|
|
317
|
+
ju(Hu,qu,"inner","…","\\textellipsis"),ju(Uu,qu,"inner","…","\\mathellipsis"),ju(Hu,qu,"inner","…","\\ldots",!0),ju(Uu,qu,"inner","…","\\ldots",!0),ju(Uu,qu,"inner","⋯","\\@cdots",!0),ju(Uu,qu,"inner","⋱","\\ddots",!0),ju(Uu,qu,Ju,"⋮","\\varvdots"),ju(Uu,qu,Gu,"ˊ","\\acute"),ju(Uu,qu,Gu,"ˋ","\\grave"),ju(Uu,qu,Gu,"¨","\\ddot"),ju(Uu,qu,Gu,"~","\\tilde"),ju(Uu,qu,Gu,"ˉ","\\bar"),ju(Uu,qu,Gu,"˘","\\breve"),ju(Uu,qu,Gu,"ˇ","\\check"),ju(Uu,qu,Gu,"^","\\hat"),ju(Uu,qu,Gu,"⃗","\\vec"),ju(Uu,qu,Gu,"˙","\\dot"),ju(Uu,qu,Gu,"˚","\\mathring"),ju(Uu,qu,Wu,"","\\@imath"),ju(Uu,qu,Wu,"","\\@jmath"),ju(Uu,qu,Ju,"ı","ı"),ju(Uu,qu,Ju,"ȷ","ȷ"),ju(Hu,qu,Ju,"ı","\\i",!0),ju(Hu,qu,Ju,"ȷ","\\j",!0),ju(Hu,qu,Ju,"ß","\\ss",!0),ju(Hu,qu,Ju,"æ","\\ae",!0),ju(Hu,qu,Ju,"œ","\\oe",!0),ju(Hu,qu,Ju,"ø","\\o",!0),ju(Hu,qu,Ju,"Æ","\\AE",!0),ju(Hu,qu,Ju,"Œ","\\OE",!0),ju(Hu,qu,Ju,"Ø","\\O",!0),ju(Hu,qu,Gu,"ˊ","\\'"),ju(Hu,qu,Gu,"ˋ","\\`"),ju(Hu,qu,Gu,"ˆ","\\^"),ju(Hu,qu,Gu,"˜","\\~"),ju(Hu,qu,Gu,"ˉ","\\="),ju(Hu,qu,Gu,"˘","\\u"),
|
|
318
|
+
ju(Hu,qu,Gu,"˙","\\."),ju(Hu,qu,Gu,"¸","\\c"),ju(Hu,qu,Gu,"˚","\\r"),ju(Hu,qu,Gu,"ˇ","\\v"),ju(Hu,qu,Gu,"¨",'\\"'),ju(Hu,qu,Gu,"˝","\\H"),ju(Hu,qu,Gu,"◯","\\textcircled");var Qu={"--":!0,"---":!0,"``":!0,"''":!0};ju(Hu,qu,Ju,"–","--",!0),ju(Hu,qu,Ju,"–","\\textendash"),ju(Hu,qu,Ju,"—","---",!0),ju(Hu,qu,Ju,"—","\\textemdash"),ju(Hu,qu,Ju,"‘","`",!0),ju(Hu,qu,Ju,"‘","\\textquoteleft"),ju(Hu,qu,Ju,"’","'",!0),ju(Hu,qu,Ju,"’","\\textquoteright"),ju(Hu,qu,Ju,"“","``",!0),ju(Hu,qu,Ju,"“","\\textquotedblleft"),ju(Hu,qu,Ju,"”","''",!0),ju(Hu,qu,Ju,"”","\\textquotedblright"),ju(Uu,qu,Ju,"°","\\degree",!0),ju(Hu,qu,Ju,"°","\\degree"),ju(Hu,qu,Ju,"°","\\textdegree",!0),ju(Uu,qu,Ju,"£","\\pounds"),ju(Uu,qu,Ju,"£","\\mathsterling",!0),ju(Hu,qu,Ju,"£","\\pounds"),ju(Hu,qu,Ju,"£","\\textsterling",!0),ju(Uu,$u,Ju,"✠","\\maltese"),ju(Hu,$u,Ju,"✠","\\maltese");for(var eh=0;eh<'0123456789/@."'.length;eh++){var th='0123456789/@."'.charAt(eh);ju(Uu,qu,Ju,th,th)}for(var nh=0;nh<'0123456789!@*()-=+";:?/.,'.length;nh++){
|
|
319
|
+
var rh='0123456789!@*()-=+";:?/.,'.charAt(nh);ju(Hu,qu,Ju,rh,rh)}for(var oh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ih=0;ih<oh.length;ih++){var ah=oh.charAt(ih);ju(Uu,qu,Wu,ah,ah),ju(Hu,qu,Ju,ah,ah)}ju(Uu,$u,Ju,"C","ℂ"),ju(Hu,$u,Ju,"C","ℂ"),ju(Uu,$u,Ju,"H","ℍ"),ju(Hu,$u,Ju,"H","ℍ"),ju(Uu,$u,Ju,"N","ℕ"),ju(Hu,$u,Ju,"N","ℕ"),ju(Uu,$u,Ju,"P","ℙ"),ju(Hu,$u,Ju,"P","ℙ"),ju(Uu,$u,Ju,"Q","ℚ"),ju(Hu,$u,Ju,"Q","ℚ"),ju(Uu,$u,Ju,"R","ℝ"),ju(Hu,$u,Ju,"R","ℝ"),ju(Uu,$u,Ju,"Z","ℤ"),ju(Hu,$u,Ju,"Z","ℤ"),ju(Uu,qu,Wu,"h","ℎ"),ju(Hu,qu,Wu,"h","ℎ");for(var sh="",lh=0;lh<oh.length;lh++){var ch=oh.charAt(lh);ju(Uu,qu,Wu,ch,sh=String.fromCharCode(55349,56320+lh)),ju(Hu,qu,Ju,ch,sh),ju(Uu,qu,Wu,ch,sh=String.fromCharCode(55349,56372+lh)),ju(Hu,qu,Ju,ch,sh),ju(Uu,qu,Wu,ch,sh=String.fromCharCode(55349,56424+lh)),ju(Hu,qu,Ju,ch,sh),ju(Uu,qu,Wu,ch,sh=String.fromCharCode(55349,56580+lh)),ju(Hu,qu,Ju,ch,sh),ju(Uu,qu,Wu,ch,sh=String.fromCharCode(55349,56736+lh)),ju(Hu,qu,Ju,ch,sh),
|
|
320
|
+
ju(Uu,qu,Wu,ch,sh=String.fromCharCode(55349,56788+lh)),ju(Hu,qu,Ju,ch,sh),ju(Uu,qu,Wu,ch,sh=String.fromCharCode(55349,56840+lh)),ju(Hu,qu,Ju,ch,sh),ju(Uu,qu,Wu,ch,sh=String.fromCharCode(55349,56944+lh)),ju(Hu,qu,Ju,ch,sh),lh<26&&(ju(Uu,qu,Wu,ch,sh=String.fromCharCode(55349,56632+lh)),ju(Hu,qu,Ju,ch,sh),ju(Uu,qu,Wu,ch,sh=String.fromCharCode(55349,56476+lh)),ju(Hu,qu,Ju,ch,sh))}ju(Uu,qu,Wu,"k",sh=String.fromCharCode(55349,56668)),ju(Hu,qu,Ju,"k",sh);for(var uh=0;uh<10;uh++){var hh=uh.toString();ju(Uu,qu,Wu,hh,sh=String.fromCharCode(55349,57294+uh)),ju(Hu,qu,Ju,hh,sh),ju(Uu,qu,Wu,hh,sh=String.fromCharCode(55349,57314+uh)),ju(Hu,qu,Ju,hh,sh),ju(Uu,qu,Wu,hh,sh=String.fromCharCode(55349,57324+uh)),ju(Hu,qu,Ju,hh,sh),ju(Uu,qu,Wu,hh,sh=String.fromCharCode(55349,57334+uh)),ju(Hu,qu,Ju,hh,sh)}for(var dh=0;dh<"ÐÞþ".length;dh++){var ph="ÐÞþ".charAt(dh);ju(Uu,qu,Wu,ph,ph),ju(Hu,qu,Ju,ph,ph)}
|
|
321
|
+
var mh=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["","",""],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],fh=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],gh=function(e,t,n){
|
|
322
|
+
return Fu[n][e]&&Fu[n][e].replace&&(e=Fu[n][e].replace),{value:e,metrics:pu(e,t,n)}},vh=function(e,t,n,r,o){var i,a=gh(e,t,n),s=a.metrics;if(e=a.value,s){var l=s.italic;("text"===n||r&&"mathit"===r.font)&&(l=0),i=new zu(e,s.height,s.depth,l,s.skew,s.width,o)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+n+"'"),i=new zu(e,0,0,0,0,0,o);if(r){i.maxFontSize=r.sizeMultiplier,r.style.isTight()&&i.classes.push("mtight");var c=r.getColor();c&&(i.style.color=c)}return i},_h=(e,t)=>{if(Su(e.classes)!==Su(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(1===e.classes.length){var n=e.classes[0];if("mbin"===n||"mord"===n)return!1}for(var r in e.style)if(e.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;for(var o in t.style)if(t.style.hasOwnProperty(o)&&e.style[o]!==t.style[o])return!1;return!0},bh=function(e){for(var t=0,n=0,r=0,o=0;o<e.children.length;o++){var i=e.children[o];i.height>t&&(t=i.height),i.depth>n&&(n=i.depth),
|
|
323
|
+
i.maxFontSize>r&&(r=i.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},yh=function(e,t,n,r){var o=new Tu(e,t,n,r);return bh(o),o},wh=(e,t,n,r)=>new Tu(e,t,n,r),xh=function(e){var t=new cu(e);return bh(t),t},kh=function(e,t,n){var r="";switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return r+"-"+("textbf"===t&&"textit"===n?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular")},Sh={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},
|
|
324
|
+
mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Ch={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Eh={fontMap:Sh,makeSymbol:vh,mathsym:function(e,t,n,r){return void 0===r&&(r=[]),"boldsymbol"===n.font&&gh(e,"Main-Bold",t).metrics?vh(e,"Main-Bold",t,n,r.concat(["mathbf"])):"\\"===e||"main"===Fu[t][e].font?vh(e,"Main-Regular",t,n,r):vh(e,"AMS-Regular",t,n,r.concat(["amsrm"]))},makeSpan:yh,makeSvgSpan:wh,makeLineSpan:function(e,t,n){var r=yh([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=ku(r.height),r.maxFontSize=1,r},makeAnchor:function(e,t,n,r){var o=new Nu(e,t,n,r);return bh(o),o},makeFragment:xh,wrapFragment:function(e,t){return e instanceof cu?yh([],[e],t):e},makeVList:function(e,t){for(var{children:n,depth:r}=function(e){if("individualShift"===e.positionType){
|
|
325
|
+
for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,o=r,i=1;i<t.length;i++){var a=-t[i].shift-o-t[i].elem.depth,s=a-(t[i-1].elem.height+t[i-1].elem.depth);o+=a,n.push({type:"kern",size:s}),n.push(t[i])}return{children:n,depth:r}}var l;if("top"===e.positionType){for(var c=e.positionData,u=0;u<e.children.length;u++){var h=e.children[u];c-="kern"===h.type?h.size:h.elem.height+h.elem.depth}l=c}else if("bottom"===e.positionType)l=-e.positionData;else{var d=e.children[0];if("elem"!==d.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)l=-d.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");l=-d.elem.depth}}return{children:e.children,depth:l}}(e),o=0,i=0;i<n.length;i++){var a=n[i];if("elem"===a.type){var s=a.elem;o=Math.max(o,s.maxFontSize,s.height)}}o+=2;var l=yh(["pstrut"],[]);l.style.height=ku(o);for(var c=[],u=r,h=r,d=r,p=0;p<n.length;p++){var m=n[p];if("kern"===m.type)d+=m.size;else{
|
|
326
|
+
var f=m.elem,g=m.wrapperClasses||[],v=m.wrapperStyle||{},_=yh(g,[l,f],void 0,v);_.style.top=ku(-o-d-f.depth),m.marginLeft&&(_.style.marginLeft=m.marginLeft),m.marginRight&&(_.style.marginRight=m.marginRight),c.push(_),d+=f.height+f.depth}u=Math.min(u,d),h=Math.max(h,d)}var b,y=yh(["vlist"],c);if(y.style.height=ku(h),u<0){var w=yh([],[]),x=yh(["vlist"],[w]);x.style.height=ku(-u);var k=yh(["vlist-s"],[new zu("")]);b=[yh(["vlist-r"],[y,k]),yh(["vlist-r"],[x])]}else b=[yh(["vlist-r"],[y])];var S=yh(["vlist-t"],b);return 2===b.length&&S.classes.push("vlist-t2"),S.height=h,S.depth=-u,S},makeOrd:function(e,t,n){var r=e.mode,o=e.text,i=["mord"],a="math"===r||"text"===r&&t.font,s=a?t.font:t.fontFamily;if(55349===o.charCodeAt(0)){var[l,c]=function(e,t){var n=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536,r="math"===t?0:1;if(119808<=n&&n<120484){var o=Math.floor((n-119808)/26);return[mh[o][2],mh[o][r]]}if(120782<=n&&n<=120831){var i=Math.floor((n-120782)/10);return[fh[i][2],fh[i][r]]}
|
|
327
|
+
if(120485===n||120486===n)return[mh[0][2],mh[0][r]];if(120486<n&&n<120782)return["",""];throw new Uc("Unsupported character: "+e)}(o,r);return vh(o,l,r,t,i.concat(c))}if(s){var u,h;if("boldsymbol"===s){var d=function(e,t,n,r,o){return"textord"!==o&&gh(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(o,r,0,0,n);u=d.fontName,h=[d.fontClass]}else a?(u=Sh[s].fontName,h=[s]):(u=kh(s,t.fontWeight,t.fontShape),h=[s,t.fontWeight,t.fontShape]);if(gh(o,u,r).metrics)return vh(o,u,r,t,i.concat(h));if(Qu.hasOwnProperty(o)&&"Typewriter"===u.substr(0,10)){for(var p=[],m=0;m<o.length;m++)p.push(vh(o[m],u,r,t,i.concat(h)));return xh(p)}}if("mathord"===n)return vh(o,"Math-Italic",r,t,i.concat(["mathnormal"]));if("textord"===n){var f=Fu[r][o]&&Fu[r][o].font;if("ams"===f){var g=kh("amsrm",t.fontWeight,t.fontShape);return vh(o,g,r,t,i.concat("amsrm",t.fontWeight,t.fontShape))}if("main"!==f&&f){var v=kh(f,t.fontWeight,t.fontShape)
|
|
328
|
+
;return vh(o,v,r,t,i.concat(v,t.fontWeight,t.fontShape))}var _=kh("textrm",t.fontWeight,t.fontShape);return vh(o,_,r,t,i.concat(t.fontWeight,t.fontShape))}throw new Error("unexpected type: "+n+" in makeOrd")},makeGlue:(e,t)=>{var n=yh(["mspace"],[],t),r=xu(e,t);return n.style.marginRight=ku(r),n},staticSvg:function(e,t){var[n,r,o]=Ch[e],i=new Ru(n),a=new Ou([i],{width:ku(r),height:ku(o),style:"width:"+ku(r),viewBox:"0 0 "+1e3*r+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),s=wh(["overlay"],[a],t);return s.height=o,s.style.height=ku(o),s.style.width=ku(r),s},svgData:Ch,tryCombineChars:e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof zu&&r instanceof zu&&_h(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e}},Ah={number:3,unit:"mu"},Th={number:4,unit:"mu"},Nh={number:5,unit:"mu"},Mh={mord:{mop:Ah,mbin:Th,mrel:Nh,minner:Ah},mop:{mord:Ah,mop:Ah,mrel:Nh,minner:Ah},mbin:{mord:Th,mop:Th,mopen:Th,minner:Th},mrel:{
|
|
329
|
+
mord:Nh,mop:Nh,mopen:Nh,minner:Nh},mopen:{},mclose:{mop:Ah,mbin:Th,mrel:Nh,minner:Ah},mpunct:{mord:Ah,mop:Ah,mrel:Nh,mopen:Ah,mclose:Ah,mpunct:Ah,minner:Ah},minner:{mord:Ah,mop:Ah,mbin:Th,mrel:Nh,mopen:Ah,mpunct:Ah,minner:Ah}},Lh={mord:{mop:Ah},mop:{mord:Ah,mop:Ah},mbin:{},mrel:{},mopen:{},mclose:{mop:Ah},mpunct:{},minner:{mop:Ah}},zh={},Oh={},Rh={};function Dh(e){for(var{type:t,names:n,props:r,handler:o,htmlBuilder:i,mathmlBuilder:a}=e,s={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:void 0===r.allowedInMath||r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:o},l=0;l<n.length;++l)zh[n[l]]=s;t&&(i&&(Oh[t]=i),a&&(Rh[t]=a))}function Ih(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;Dh({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var Ph=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e
|
|
330
|
+
},Bh=function(e){return"ordgroup"===e.type?e.body:[e]},Fh=Eh.makeSpan,jh=["leftmost","mbin","mopen","mrel","mop","mpunct"],Uh=["rightmost","mrel","mclose","mpunct"],Hh={display:ou.DISPLAY,text:ou.TEXT,script:ou.SCRIPT,scriptscript:ou.SCRIPTSCRIPT},qh={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},$h=function(e,t,n,r){void 0===r&&(r=[null,null]);for(var o=[],i=0;i<e.length;i++){var a=Xh(e[i],t);if(a instanceof cu){var s=a.children;o.push(...s)}else o.push(a)}if(Eh.tryCombineChars(o),!n)return o;var l=t;if(1===e.length){var c=e[0];"sizing"===c.type?l=t.havingSize(c.size):"styling"===c.type&&(l=t.havingStyle(Hh[c.style]))}var u=Fh([r[0]||"leftmost"],[],t),h=Fh([r[1]||"rightmost"],[],t),d="root"===n;return Gh(o,((e,t)=>{var n=t.classes[0],r=e.classes[0];"mbin"===n&&Vc.contains(Uh,r)?t.classes[0]="mord":"mbin"===r&&Vc.contains(jh,n)&&(e.classes[0]="mord")}),{node:u},h,d),Gh(o,((e,t)=>{
|
|
331
|
+
var n=Wh(t),r=Wh(e),o=n&&r?e.hasClass("mtight")?Lh[n][r]:Mh[n][r]:null;if(o)return Eh.makeGlue(o,l)}),{node:u},h,d),o},Gh=function e(t,n,r,o,i){o&&t.push(o);for(var a=0;a<t.length;a++){var s=t[a],l=Vh(s);if(l)e(l.children,n,r,null,i);else{var c=!s.hasClass("mspace");if(c){var u=n(s,r.node);u&&(r.insertAfter?r.insertAfter(u):(t.unshift(u),a++))}c?r.node=s:i&&s.hasClass("newline")&&(r.node=Fh(["leftmost"])),r.insertAfter=(e=>n=>{t.splice(e+1,0,n),a++})(a)}}o&&t.pop()},Vh=function(e){return e instanceof cu||e instanceof Nu||e instanceof Tu&&e.hasClass("enclosing")?e:null},Yh=function e(t,n){var r=Vh(t);if(r){var o=r.children;if(o.length){if("right"===n)return e(o[o.length-1],"right");if("left"===n)return e(o[0],"left")}}return t},Wh=function(e,t){return e?(t&&(e=Yh(e,t)),qh[e.classes[0]]||null):null},Kh=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Fh(t.concat(n))},Xh=function(e,t,n){if(!e)return Fh();if(Oh[e.type]){var r=Oh[e.type](e,t);if(n&&t.size!==n.size){
|
|
332
|
+
r=Fh(t.sizingClasses(n),[r],t);var o=t.sizeMultiplier/n.sizeMultiplier;r.height*=o,r.depth*=o}return r}throw new Uc("Got group of unknown type: '"+e.type+"'")};function Zh(e,t){var n=Fh(["base"],e,t),r=Fh(["strut"]);return r.style.height=ku(n.height+n.depth),n.depth&&(r.style.verticalAlign=ku(-n.depth)),n.children.unshift(r),n}function Jh(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var r,o=$h(e,t,"root");2===o.length&&o[1].hasClass("tag")&&(r=o.pop());for(var i,a=[],s=[],l=0;l<o.length;l++)if(s.push(o[l]),o[l].hasClass("mbin")||o[l].hasClass("mrel")||o[l].hasClass("allowbreak")){for(var c=!1;l<o.length-1&&o[l+1].hasClass("mspace")&&!o[l+1].hasClass("newline");)l++,s.push(o[l]),o[l].hasClass("nobreak")&&(c=!0);c||(a.push(Zh(s,t)),s=[])}else o[l].hasClass("newline")&&(s.pop(),s.length>0&&(a.push(Zh(s,t)),s=[]),a.push(o[l]));s.length>0&&a.push(Zh(s,t)),n?((i=Zh($h(n,t,!0))).classes=["tag"],a.push(i)):r&&a.push(r);var u=Fh(["katex-html"],a);if(u.setAttribute("aria-hidden","true"),i){
|
|
333
|
+
var h=i.children[0];h.style.height=ku(u.height+u.depth),u.depth&&(h.style.verticalAlign=ku(-u.depth))}return u}function Qh(e){return new cu(e)}class ed{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=Su(this.classes));for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=Vc.escape(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+Vc.escape(Su(this.classes))+'"'),e+=">"
|
|
334
|
+
;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</"+this.type+">"}toText(){return this.children.map((e=>e.toText())).join("")}}class td{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Vc.escape(this.toText())}toText(){return this.text}}var nd={MathNode:ed,TextNode:td,SpaceNode:class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?" ":e>=.1666&&e<=.1667?" ":e>=.2222&&e<=.2223?" ":e>=.2777&&e<=.2778?" ":e>=-.05556&&e<=-.05555?" ":e>=-.1667&&e<=-.1666?" ":e>=-.2223&&e<=-.2222?" ":e>=-.2778&&e<=-.2777?" ":null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",ku(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+ku(this.width)+'"/>'}toText(){
|
|
335
|
+
return this.character?this.character:" "}},newDocumentFragment:Qh},rd=function(e,t,n){return!Fu[t][e]||!Fu[t][e].replace||55349===e.charCodeAt(0)||Qu.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.substr(4,2)||n.font&&"tt"===n.font.substr(4,2))||(e=Fu[t][e].replace),new nd.TextNode(e)},od=function(e){return 1===e.length?e[0]:new nd.MathNode("mrow",e)},id=function(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";var n=t.font;if(!n||"mathnormal"===n)return null;var r=e.mode;if("mathit"===n)return"italic";if("boldsymbol"===n)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===n)return"bold";if("mathbb"===n)return"double-struck"
|
|
336
|
+
;if("mathfrak"===n)return"fraktur";if("mathscr"===n||"mathcal"===n)return"script";if("mathsf"===n)return"sans-serif";if("mathtt"===n)return"monospace";var o=e.text;return Vc.contains(["\\imath","\\jmath"],o)?null:(Fu[r][o]&&Fu[r][o].replace&&(o=Fu[r][o].replace),pu(o,Eh.fontMap[n].fontName,r)?Eh.fontMap[n].variant:null)},ad=function(e,t,n){if(1===e.length){var r=ld(e[0],t);return n&&r instanceof ed&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var o,i=[],a=0;a<e.length;a++){var s=ld(e[a],t);if(s instanceof ed&&o instanceof ed){if("mtext"===s.type&&"mtext"===o.type&&s.getAttribute("mathvariant")===o.getAttribute("mathvariant")){o.children.push(...s.children);continue}if("mn"===s.type&&"mn"===o.type){o.children.push(...s.children);continue}if("mi"===s.type&&1===s.children.length&&"mn"===o.type){var l=s.children[0];if(l instanceof td&&"."===l.text){o.children.push(...s.children);continue}}else if("mi"===o.type&&1===o.children.length){var c=o.children[0]
|
|
337
|
+
;if(c instanceof td&&"̸"===c.text&&("mo"===s.type||"mi"===s.type||"mn"===s.type)){var u=s.children[0];u instanceof td&&u.text.length>0&&(u.text=u.text.slice(0,1)+"̸"+u.text.slice(1),i.pop())}}}i.push(s),o=s}return i},sd=function(e,t,n){return od(ad(e,t,n))},ld=function(e,t){if(!e)return new nd.MathNode("mrow");if(Rh[e.type])return Rh[e.type](e,t);throw new Uc("Got group of unknown type: '"+e.type+"'")};function cd(e,t,n,r,o){var i,a=ad(e,n);i=1===a.length&&a[0]instanceof ed&&Vc.contains(["mrow","mtable"],a[0].type)?a[0]:new nd.MathNode("mrow",a);var s=new nd.MathNode("annotation",[new nd.TextNode(t)]);s.setAttribute("encoding","application/x-tex");var l=new nd.MathNode("semantics",[i,s]),c=new nd.MathNode("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block");var u=o?"katex":"katex-mathml";return Eh.makeSpan([u],[c])}var ud=function(e){return new _u({style:e.displayMode?ou.DISPLAY:ou.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})
|
|
338
|
+
},hd=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=Eh.makeSpan(n,[e])}return e},dd={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},pd={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],
|
|
339
339
|
underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],
|
|
340
340
|
xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],
|
|
341
|
-
xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},
|
|
342
|
-
;if(
|
|
343
|
-
for(var w=0;w<y;w++){var x=new
|
|
344
|
-
;if(r.isShifty&&
|
|
345
|
-
o.height=Math.max(f.height,o.height),o.classes[0]="mord",o):f},
|
|
346
|
-
names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return"math"===r&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:
|
|
347
|
-
mathmlBuilder:(e,t)=>{var n=
|
|
348
|
-
var n,r=t.style,o=t.havingStyle(r.sup()),i=
|
|
349
|
-
var i=
|
|
350
|
-
}}
|
|
351
|
-
type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=
|
|
352
|
-
argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,o=
|
|
353
|
-
"\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},
|
|
354
|
-
;for(var i,a=0,s=[[]];"{"!==t.gullet.future().text;)if("#"===(r=t.gullet.popToken()).text){if("{"===t.gullet.future().text){i=t.gullet.future(),s[a].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new
|
|
355
|
-
;return
|
|
356
|
-
return
|
|
357
|
-
;case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}}(e,Math.round(1e3*t))),i=new
|
|
358
|
-
u="Size4-Regular"):"\\lfloor"===e||"⌊"===e?(l=a="⎢",c="⎣",u="Size4-Regular"):"\\lceil"===e||"⌈"===e?(a="⎡",l=c="⎢",u="Size4-Regular"):"\\rfloor"===e||"⌋"===e?(l=a="⎥",c="⎦",u="Size4-Regular"):"\\rceil"===e||"⌉"===e?(a="⎤",l=c="⎥",u="Size4-Regular"):"("===e||"\\lparen"===e?(a="⎛",l="⎜",c="⎝",u="Size4-Regular"):")"===e||"\\rparen"===e?(a="⎞",l="⎟",c="⎠",u="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(a="⎧",s="⎨",c="⎩",l="⎪",u="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(a="⎫",s="⎬",c="⎭",l="⎪",u="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(a="⎧",c="⎩",l="⎪",u="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(a="⎫",c="⎭",l="⎪",u="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(a="⎧",c="⎭",l="⎪",u="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(a="⎫",c="⎩",l="⎪",u="Size4-Regular");var h=
|
|
359
|
-
;n&&(x*=r.sizeMultiplier);var k=w/2-x,S=[];if(S.push(
|
|
341
|
+
xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},md=function(e,t,n,r,o){var i,a=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(i=Eh.makeSpan(["stretchy",t],[],o),"fbox"===t){var s=o.color&&o.getColor();s&&(i.style.borderColor=s)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new Du({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new Du({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new Ou(l,{width:"100%",height:ku(a)});i=Eh.makeSvgSpan([],[c],o)}return i.height=a,i.style.height=ku(a),i},fd=function(e){var t=new nd.MathNode("mo",[new nd.TextNode(dd[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},gd=function(e,t){var{span:n,minWidth:r,height:o}=function(){var n=4e5,r=e.label.substr(1)
|
|
342
|
+
;if(Vc.contains(["widehat","widecheck","widetilde","utilde"],r)){var o,i,a,s="ordgroup"===(p=e.base).type?p.body.length:1;if(s>5)"widehat"===r||"widecheck"===r?(o=420,n=2364,a=.42,i=r+"4"):(o=312,n=2340,a=.34,i="tilde4");else{var l=[1,1,2,2,3,3][s];"widehat"===r||"widecheck"===r?(n=[0,1062,2364,2364,2364][l],o=[0,239,300,360,420][l],a=[0,.24,.3,.3,.36,.42][l],i=r+l):(n=[0,600,1033,2339,2340][l],o=[0,260,286,306,312][l],a=[0,.26,.286,.3,.306,.34][l],i="tilde"+l)}var c=new Ru(i),u=new Ou([c],{width:"100%",height:ku(a),viewBox:"0 0 "+n+" "+o,preserveAspectRatio:"none"});return{span:Eh.makeSvgSpan([],[u],t),minWidth:0,height:a}}var h,d,p,m=[],f=pd[r],[g,v,_]=f,b=_/1e3,y=g.length;if(1===y)h=["hide-tail"],d=[f[3]];else if(2===y)h=["halfarrow-left","halfarrow-right"],d=["xMinYMin","xMaxYMin"];else{if(3!==y)throw new Error("Correct katexImagesData or update code here to support\n "+y+" children.");h=["brace-left","brace-center","brace-right"],d=["xMinYMin","xMidYMin","xMaxYMin"]}
|
|
343
|
+
for(var w=0;w<y;w++){var x=new Ru(g[w]),k=new Ou([x],{width:"400em",height:ku(b),viewBox:"0 0 "+n+" "+_,preserveAspectRatio:d[w]+" slice"}),S=Eh.makeSvgSpan([h[w]],[k],t);if(1===y)return{span:S,minWidth:v,height:b};S.style.height=ku(b),m.push(S)}return{span:Eh.makeSpan(["stretchy"],m,t),minWidth:v,height:b}}();return n.height=o,n.style.height=ku(o),r>0&&(n.style.minWidth=ku(r)),n};function vd(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function _d(e){var t=bd(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function bd(e){return e&&("atom"===e.type||Bu.hasOwnProperty(e.type))?e:null}var yd=(e,t)=>{var n,r,o;e&&"supsub"===e.type?(n=(r=vd(e.base,"accent")).base,e.base=n,o=function(e){if(e instanceof Tu)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(Xh(e,t)),e.base=r):n=(r=vd(e,"accent")).base;var i=Xh(n,t.havingCrampedStyle()),a=0
|
|
344
|
+
;if(r.isShifty&&Vc.isCharacterBox(n)){var s=Vc.getBaseElem(n);a=Iu(Xh(s,t.havingCrampedStyle())).skew}var l,c="\\c"===r.label,u=c?i.height+i.depth:Math.min(i.height,t.fontMetrics().xHeight);if(r.isStretchy)l=gd(r,t),l=Eh.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:a>0?{width:"calc(100% - "+ku(2*a)+")",marginLeft:ku(2*a)}:void 0}]},t);else{var h,d;"\\vec"===r.label?(h=Eh.staticSvg("vec",t),d=Eh.svgData.vec[1]):((h=Iu(h=Eh.makeOrd({mode:r.mode,text:r.label},t,"textord"))).italic=0,d=h.width,c&&(u+=h.depth)),l=Eh.makeSpan(["accent-body"],[h]);var p="\\textcircled"===r.label;p&&(l.classes.push("accent-full"),u=i.height);var m=a;p||(m-=d/2),l.style.left=ku(m),"\\textcircled"===r.label&&(l.style.top=".2em"),l=Eh.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-u},{type:"elem",elem:l}]},t)}var f=Eh.makeSpan(["mord","accent"],[l],t);return o?(o.children[0]=f,
|
|
345
|
+
o.height=Math.max(f.height,o.height),o.classes[0]="mord",o):f},wd=(e,t)=>{var n=e.isStretchy?fd(e.label):new nd.MathNode("mo",[rd(e.label,e.mode)]),r=new nd.MathNode("mover",[ld(e.base,t),n]);return r.setAttribute("accent","true"),r},xd=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((e=>"\\"+e)).join("|"));Dh({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=Ph(t[0]),r=!xd.test(e.funcName),o=!r||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:o,base:n}},htmlBuilder:yd,mathmlBuilder:wd}),Dh({type:"accent",
|
|
346
|
+
names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return"math"===r&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:yd,mathmlBuilder:wd}),Dh({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:o}},htmlBuilder:(e,t)=>{var n=Xh(e.base,t),r=gd(e,t),o="\\utilde"===e.label?.12:0,i=Eh.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:o},{type:"elem",elem:n}]},t);return Eh.makeSpan(["mord","accentunder"],[i],t)},
|
|
347
|
+
mathmlBuilder:(e,t)=>{var n=fd(e.label),r=new nd.MathNode("munder",[ld(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var kd=e=>{var t=new nd.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Dh({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:o}=e;return{type:"xArrow",mode:r.mode,label:o,body:t[0],below:n[0]}},htmlBuilder(e,t){
|
|
348
|
+
var n,r=t.style,o=t.havingStyle(r.sup()),i=Eh.wrapFragment(Xh(e.body,o,t),t),a="\\x"===e.label.slice(0,2)?"x":"cd";i.classes.push(a+"-arrow-pad"),e.below&&(o=t.havingStyle(r.sub()),(n=Eh.wrapFragment(Xh(e.below,o,t),t)).classes.push(a+"-arrow-pad"));var s,l=gd(e,t),c=-t.fontMetrics().axisHeight+.5*l.height,u=-t.fontMetrics().axisHeight-.5*l.height-.111;if((i.depth>.25||"\\xleftequilibrium"===e.label)&&(u-=i.depth),n){var h=-t.fontMetrics().axisHeight+n.height+.5*l.height+.111;s=Eh.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:l,shift:c},{type:"elem",elem:n,shift:h}]},t)}else s=Eh.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:l,shift:c}]},t);return s.children[0].children[0].children[1].classes.push("svg-align"),Eh.makeSpan(["mrel","x-arrow"],[s],t)},mathmlBuilder(e,t){var n,r=fd(e.label);if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var o=kd(ld(e.body,t));if(e.below){
|
|
349
|
+
var i=kd(ld(e.below,t));n=new nd.MathNode("munderover",[r,i,o])}else n=new nd.MathNode("mover",[r,o])}else if(e.below){var a=kd(ld(e.below,t));n=new nd.MathNode("munder",[r,a])}else n=kd(),n=new nd.MathNode("mover",[r,n]);return n}});var Sd={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Cd=e=>"textord"===e.type&&"@"===e.text;function Ed(e,t,n){var r=Sd[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var o={type:"atom",text:r,mode:"math",family:"rel"},i={type:"ordgroup",mode:"math",body:[n.callFunction("\\\\cdleft",[t[0]],[]),n.callFunction("\\Big",[o],[]),n.callFunction("\\\\cdright",[t[1]],[])]};return n.callFunction("\\\\cdparent",[i],[]);case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return n.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}
|
|
350
|
+
}}Dh({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=Eh.wrapFragment(Xh(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=ku(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new nd.MathNode("mrow",[ld(e.label,t)]);return(n=new nd.MathNode("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new nd.MathNode("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),Dh({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=Eh.wrapFragment(Xh(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(e,t)=>new nd.MathNode("mrow",[ld(e.fragment,t)])}),Dh({
|
|
351
|
+
type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=vd(t[0],"ordgroup").body,o="",i=0;i<r.length;i++){o+=vd(r[i],"textord").text}var a,s=parseInt(o);if(isNaN(s))throw new Uc("\\@char has non-numeric argument "+o);if(s<0||s>=1114111)throw new Uc("\\@char with invalid code point "+o);return s<=65535?a=String.fromCharCode(s):(s-=65536,a=String.fromCharCode(55296+(s>>10),56320+(1023&s))),{type:"textord",mode:n.mode,text:a}}});var Ad=(e,t)=>{var n=$h(e.body,t.withColor(e.color),!1);return Eh.makeFragment(n)},Td=(e,t)=>{var n=ad(e.body,t.withColor(e.color)),r=new nd.MathNode("mstyle",n);return r.setAttribute("mathcolor",e.color),r};Dh({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=vd(t[0],"color-token").color,o=t[1];return{type:"color",mode:n.mode,color:r,body:Bh(o)}},htmlBuilder:Ad,mathmlBuilder:Td}),Dh({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,
|
|
352
|
+
argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,o=vd(t[0],"color-token").color;n.gullet.macros.set("\\current@color",o);var i=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:o,body:i}},htmlBuilder:Ad,mathmlBuilder:Td}),Dh({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:1,argTypes:["size"],allowedInText:!0},handler(e,t,n){var{parser:r}=e,o=n[0],i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:o&&vd(o,"size").value}},htmlBuilder(e,t){var n=Eh.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=ku(xu(e.size,t)))),n},mathmlBuilder(e,t){var n=new nd.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",ku(xu(e.size,t)))),n}});var Nd={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef",
|
|
353
|
+
"\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Md=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Uc("Expected a control sequence",e);return t},Ld=(e,t,n,r)=>{var o=e.gullet.macros.get(n.text);null==o&&(n.noexpand=!0,o={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,o,r)};Dh({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(Nd[r.text])return"\\global"!==n&&"\\\\globallong"!==n||(r.text=Nd[r.text]),vd(t.parseFunction(),"internal");throw new Uc("Invalid token after macro prefix",r)}}),Dh({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),o=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(o))throw new Uc("Expected a control sequence",r)
|
|
354
|
+
;for(var i,a=0,s=[[]];"{"!==t.gullet.future().text;)if("#"===(r=t.gullet.popToken()).text){if("{"===t.gullet.future().text){i=t.gullet.future(),s[a].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Uc('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new Uc('Argument number "'+r.text+'" out of order');a++,s.push([])}else{if("EOF"===r.text)throw new Uc("Expected a macro definition");s[a].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return i&&l.unshift(i),"\\edef"!==n&&"\\xdef"!==n||(l=t.gullet.expandTokens(l)).reverse(),t.gullet.macros.set(o,{tokens:l,numArgs:a,delimiters:s},n===Nd[n]),{type:"internal",mode:t.mode}}}),Dh({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=Md(t.gullet.popToken());t.gullet.consumeSpaces();var o=(e=>{var t=e.gullet.popToken();return"="===t.text&&" "===(t=e.gullet.popToken()).text&&(t=e.gullet.popToken()),t})(t)
|
|
355
|
+
;return Ld(t,r,o,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),Dh({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=Md(t.gullet.popToken()),o=t.gullet.popToken(),i=t.gullet.popToken();return Ld(t,r,i,"\\\\globalfuture"===n),t.gullet.pushToken(i),t.gullet.pushToken(o),{type:"internal",mode:t.mode}}});var zd=function(e,t,n){var r=pu(Fu.math[e]&&Fu.math[e].replace||e,t,n);if(!r)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return r},Od=function(e,t,n,r){var o=n.havingBaseStyle(t),i=Eh.makeSpan(r.concat(o.sizingClasses(n)),[e],n),a=o.sizeMultiplier/n.sizeMultiplier;return i.height*=a,i.depth*=a,i.maxFontSize=o.sizeMultiplier,i},Rd=function(e,t,n){var r=t.havingBaseStyle(n),o=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=ku(o),e.height-=o,e.depth+=o},Dd=function(e,t,n,r,o,i){var a=function(e,t,n,r){
|
|
356
|
+
return Eh.makeSymbol(e,"Size"+t+"-Regular",n,r)}(e,t,o,r),s=Od(Eh.makeSpan(["delimsizing","size"+t],[a],r),ou.TEXT,r,i);return n&&Rd(s,r,ou.TEXT),s},Id=function(e,t,n){var r;return r="Size1-Regular"===t?"delim-size1":"delim-size4",{type:"elem",elem:Eh.makeSpan(["delimsizinginner",r],[Eh.makeSpan([],[Eh.makeSymbol(e,t,n)])])}},Pd=function(e,t,n){var r=uu["Size4-Regular"][e.charCodeAt(0)]?uu["Size4-Regular"][e.charCodeAt(0)][4]:uu["Size1-Regular"][e.charCodeAt(0)][4],o=new Ru("inner",function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"∣":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145zM367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z";case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z"
|
|
357
|
+
;case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}}(e,Math.round(1e3*t))),i=new Ou([o],{width:ku(r),height:ku(t),style:"width:"+ku(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),a=Eh.makeSvgSpan([],[i],n);return a.height=t,a.style.height=ku(t),a.style.width=ku(r),{type:"elem",elem:a}},Bd={type:"kern",size:-.008},Fd=["|","\\lvert","\\rvert","\\vert"],jd=["\\|","\\lVert","\\rVert","\\Vert"],Ud=function(e,t,n,r,o,i){var a,s,l,c;a=l=c=e,s=null;var u="Size1-Regular";"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?a=l="⏐":"\\Downarrow"===e?a=l="‖":"\\updownarrow"===e?(a="\\uparrow",l="⏐",c="\\downarrow"):"\\Updownarrow"===e?(a="\\Uparrow",l="‖",c="\\Downarrow"):Vc.contains(Fd,e)?l="∣":Vc.contains(jd,e)?l="∥":"["===e||"\\lbrack"===e?(a="⎡",l="⎢",c="⎣",u="Size4-Regular"):"]"===e||"\\rbrack"===e?(a="⎤",l="⎥",c="⎦",
|
|
358
|
+
u="Size4-Regular"):"\\lfloor"===e||"⌊"===e?(l=a="⎢",c="⎣",u="Size4-Regular"):"\\lceil"===e||"⌈"===e?(a="⎡",l=c="⎢",u="Size4-Regular"):"\\rfloor"===e||"⌋"===e?(l=a="⎥",c="⎦",u="Size4-Regular"):"\\rceil"===e||"⌉"===e?(a="⎤",l=c="⎥",u="Size4-Regular"):"("===e||"\\lparen"===e?(a="⎛",l="⎜",c="⎝",u="Size4-Regular"):")"===e||"\\rparen"===e?(a="⎞",l="⎟",c="⎠",u="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(a="⎧",s="⎨",c="⎩",l="⎪",u="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(a="⎫",s="⎬",c="⎭",l="⎪",u="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(a="⎧",c="⎩",l="⎪",u="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(a="⎫",c="⎭",l="⎪",u="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(a="⎧",c="⎭",l="⎪",u="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(a="⎫",c="⎩",l="⎪",u="Size4-Regular");var h=zd(a,u,o),d=h.height+h.depth,p=zd(l,u,o),m=p.height+p.depth,f=zd(c,u,o),g=f.height+f.depth,v=0,_=1;if(null!==s){var b=zd(s,u,o);v=b.height+b.depth,_=2}var y=d+g+v,w=y+Math.max(0,Math.ceil((t-y)/(_*m)))*_*m,x=r.fontMetrics().axisHeight
|
|
359
|
+
;n&&(x*=r.sizeMultiplier);var k=w/2-x,S=[];if(S.push(Id(c,u,o)),S.push(Bd),null===s){var C=w-d-g+.016;S.push(Pd(l,C,r))}else{var E=(w-d-g-v)/2+.016;S.push(Pd(l,E,r)),S.push(Bd),S.push(Id(s,u,o)),S.push(Bd),S.push(Pd(l,E,r))}S.push(Bd),S.push(Id(a,u,o));var A=r.havingBaseStyle(ou.TEXT),T=Eh.makeVList({positionType:"bottom",positionData:k,children:S},A);return Od(Eh.makeSpan(["delimsizing","mult"],[T],A),ou.TEXT,r,i)},Hd=function(e,t,n,r,o){var i=function(e,t,n){t*=1e3;var r="";switch(e){case"sqrtMain":r=function(e,t){
|
|
360
360
|
return"M95,"+(622+e+t)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,80);break;case"sqrtSize1":r=function(e,t){
|
|
361
361
|
return"M263,"+(601+e+t)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,80);break;case"sqrtSize2":r=function(e,t){
|
|
362
362
|
return"M983 "+(10+e+t)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,80);break;case"sqrtSize3":r=function(e,t){
|
|
363
363
|
return"M424,"+(2398+e+t)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" "+t+"\nh400000v"+(40+e)+"h-400000z"}(t,80);break;case"sqrtSize4":r=function(e,t){
|
|
364
|
-
return"M473,"+(2713+e+t)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"}(t,80);break;case"sqrtTall":r=function(e,t,n){return"M702 "+(e+t)+"H400000"+(40+e)+"\nH742v"+(n-54-t-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+t+"H400000v"+(40+e)+"H742z"}(t,80,n)}return r}(e,r,n),a=new
|
|
365
|
-
;return
|
|
366
|
-
type:"stack"}],
|
|
367
|
-
var n,r,o=t.havingBaseSizing(),i=
|
|
368
|
-
var a=r.fontMetrics().axisHeight*r.sizeMultiplier,s=5/r.fontMetrics().ptPerEm,l=Math.max(t-a,n+a),c=Math.max(l/500*901,2*l-s);return
|
|
369
|
-
},
|
|
370
|
-
mode:e.parser.mode,size:
|
|
371
|
-
;--r.leftrightDepth,r.expect("\\right",!1);var i=
|
|
372
|
-
;o.setAttribute("fence","true"),e.rightColor&&o.setAttribute("mathcolor",e.rightColor),n.push(o)}return
|
|
373
|
-
number:.6,unit:"pt"},t),u=
|
|
374
|
-
s=o.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)r=
|
|
375
|
-
r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var o=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+o+"em solid "+String(e.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};
|
|
376
|
-
argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:o}=e,i=
|
|
377
|
-
handler:o},l=0;l<n.length;++l)
|
|
378
|
-
_&&(e.gullet.macros.get("\\df@tag")?(_.push(e.subparse([new
|
|
379
|
-
e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:o,arraystretch:a,body:f,cols:i,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:v,colSeparationType:s,tags:_,leqno:d}}function
|
|
380
|
-
x.depth=w,v+=y,x.pos=v,v+=w+C,s[n]=x,_(i[n+1])}var E,A,T=v/2+t.fontMetrics().axisHeight,N=e.cols||[],M=[],L=[];if(e.tags&&e.tags.some((e=>e)))for(n=0;n<o;++n){var z=s[n],O=z.pos-T,R=e.tags[n],D=void 0;(D=!0===R?
|
|
381
|
-
;(r>0||e.hskipBeforeAndAfter)&&0!==(U=
|
|
382
|
-
},
|
|
383
|
-
for(var b=e.cols||[],y="",w=1;w<b.length;w++)y+=w%2?"0em ":"1em ";c.setAttribute("columnspacing",y.trim())}else"alignat"===e.colSeparationType||"gather"===e.colSeparationType?c.setAttribute("columnspacing","0em"):"small"===e.colSeparationType?c.setAttribute("columnspacing","0.2778em"):"CD"===e.colSeparationType?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var x="",k=e.hLinesBeforeRow;h+=k[0].length>0?"left ":"",h+=k[k.length-1].length>0?"right ":"";for(var S=1;S<k.length-1;S++)x+=0===k[S].length?"none ":k[S][0]?"dashed ":"solid ";return/[sd]/.test(x)&&c.setAttribute("rowlines",x.trim()),""!==h&&(c=new
|
|
384
|
-
colSeparationType:o,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},"display"),s=0,l={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var c="",u=0;u<t[0].body.length;u++){c+=
|
|
385
|
-
;throw new
|
|
386
|
-
type:"leftright",mode:e.mode,body:[i],left:t[0],right:t[1],rightColor:void 0}:i},htmlBuilder:
|
|
387
|
-
type:"align",align:"l",pregap:0,postgap:0}]},
|
|
388
|
-
;return
|
|
389
|
-
}if(
|
|
390
|
-
argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];if("ordgroup"!==o.type)throw new
|
|
391
|
-
n.attributes.rspace="0.22em"):"mpunct"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0em"):"minner"===e.mclass&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}
|
|
392
|
-
props:{numArgs:2},handler(e,t){var n,{parser:r,funcName:o}=e,i=t[1],a=t[0];n="\\stackrel"!==o?
|
|
393
|
-
htmlBuilder:
|
|
394
|
-
;a.height=a.height<s?s:a.height,a.depth=a.depth<l?l:a.depth}n=t.havingStyle(i);var c,u,h,d,p,m,f,g,v,_,b=
|
|
395
|
-
return n=t.havingStyle(r),f.height*=n.sizeMultiplier/t.sizeMultiplier,f.depth*=n.sizeMultiplier/t.sizeMultiplier,g=r.size===
|
|
396
|
-
if(null!=e.leftDelim||null!=e.rightDelim){var a=[];if(null!=e.leftDelim){var s=new
|
|
397
|
-
return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:a,hasBarLine:n,leftDelim:s,rightDelim:l,size:c,barSize:null}},htmlBuilder:
|
|
398
|
-
props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var n,{parser:r}=e,o=t[4],i=t[5],a=
|
|
399
|
-
var{parser:n,funcName:r}=e,o=t[0],i=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(
|
|
400
|
-
var l=
|
|
401
|
-
htmlBuilder:(e,t)=>{var n
|
|
402
|
-
names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var n,{parser:r,funcName:o,token:i}=e,a=
|
|
403
|
-
;e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var o=
|
|
404
|
-
var{parser:r}=e,o={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},s="";if(n[0])for(var l=
|
|
405
|
-
var n=new
|
|
406
|
-
;return new
|
|
407
|
-
;r.switchMode("math");var i="\\("===n?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(o),{type:"styling",mode:r.mode,style:"text",body:a}}}),
|
|
408
|
-
kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-h.depth)}}if(n){var d=
|
|
409
|
-
type:"elem",elem:l.elem,marginLeft:
|
|
410
|
-
;1===p.length&&p[0]instanceof
|
|
411
|
-
names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=r;return 1===o.length&&(o=
|
|
412
|
-
props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:
|
|
413
|
-
var u=l[c];u instanceof
|
|
414
|
-
case"mspace":case"mtext":break;case"mo":var a=i.children[0];1===i.children.length&&a instanceof
|
|
415
|
-
children:[{type:"elem",elem:n},{type:"kern",size:3*o},{type:"elem",elem:r},{type:"kern",size:o}]},t);return
|
|
416
|
-
;return n=
|
|
417
|
-
;return
|
|
418
|
-
var n=
|
|
419
|
-
numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,o=!1,i=!1,a=n[0]&&
|
|
420
|
-
var{parser:r}=e,o=n[0],i=t[0];return{type:"sqrt",mode:r.mode,body:i,index:o}},htmlBuilder(e,t){var n=
|
|
421
|
-
var{body:n,index:r}=e;return r?new
|
|
422
|
-
;return n?"op"===n.type?n.limits&&(t.style.size===
|
|
423
|
-
;var w=4*u.defaultRuleThickness;if(h-r.depth-(o.height-d)<w){d=w-(h-r.depth)+o.height;var x=.8*u.xHeight-(h-r.depth);x>0&&(h+=x,d-=x)}var k=[{type:"elem",elem:o,shift:d,marginRight:_,marginLeft:b},{type:"elem",elem:r,shift:-h,marginRight:_}];g=
|
|
424
|
-
;if(e.sub&&i.push(
|
|
425
|
-
}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var
|
|
426
|
-
;if("text"===e.mode){var r=
|
|
427
|
-
;return n?
|
|
428
|
-
},mathmlBuilder(e,t){var n=new
|
|
429
|
-
return
|
|
430
|
-
;if(14===this.catcodes[r]){var o=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===o?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=o+1,this.lex()}return new
|
|
431
|
-
return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(void 0===n&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var o=this.undefStack[this.undefStack.length-1];o&&!o.hasOwnProperty(e)&&(o[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var
|
|
432
|
-
|
|
433
|
-
;if(i&&!t)throw new
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
"\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:r,end:n}=this.consumeArg(["]"]))}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new
|
|
452
|
-
}while(0!==i||n);return"{"===o.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:o,end:r}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new
|
|
453
|
-
if(0===a)throw new
|
|
454
|
-
;if("string"==typeof r){var o=0;if(-1!==r.indexOf("#"))for(var i=r.replace(/##/g,"");-1!==i.indexOf("#"+(o+1));)++o;for(var a=new
|
|
455
|
-
"⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g","ʰ":"h","ⁱ":"i","ʲ":"j","ᵏ":"k","ˡ":"l","ᵐ":"m","ⁿ":"n","ᵒ":"o","ᵖ":"p","ʳ":"r","ˢ":"s","ᵗ":"t","ᵘ":"u","ᵛ":"v","ʷ":"w","ˣ":"x","ʸ":"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),
|
|
364
|
+
return"M473,"+(2713+e+t)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"}(t,80);break;case"sqrtTall":r=function(e,t,n){return"M702 "+(e+t)+"H400000"+(40+e)+"\nH742v"+(n-54-t-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+t+"H400000v"+(40+e)+"H742z"}(t,80,n)}return r}(e,r,n),a=new Ru(e,i),s=new Ou([a],{width:"400em",height:ku(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"})
|
|
365
|
+
;return Eh.makeSvgSpan(["hide-tail"],[s],o)},qd=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],$d=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],Gd=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Vd=[0,1.2,1.8,2.4,3],Yd=[{type:"small",style:ou.SCRIPTSCRIPT},{type:"small",style:ou.SCRIPT},{type:"small",style:ou.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Wd=[{type:"small",style:ou.SCRIPTSCRIPT},{type:"small",style:ou.SCRIPT},{type:"small",style:ou.TEXT},{type:"stack"}],Kd=[{type:"small",style:ou.SCRIPTSCRIPT},{type:"small",style:ou.SCRIPT},{type:"small",style:ou.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{
|
|
366
|
+
type:"stack"}],Xd=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},Zd=function(e,t,n,r){for(var o=Math.min(2,3-r.style.size);o<n.length&&"stack"!==n[o].type;o++){var i=zd(e,Xd(n[o]),"math"),a=i.height+i.depth;if("small"===n[o].type&&(a*=r.havingBaseStyle(n[o].style).sizeMultiplier),a>t)return n[o]}return n[n.length-1]},Jd=function(e,t,n,r,o,i){var a;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),a=Vc.contains(Gd,e)?Yd:Vc.contains(qd,e)?Kd:Wd;var s=Zd(e,t,a,r);return"small"===s.type?function(e,t,n,r,o,i){var a=Eh.makeSymbol(e,"Main-Regular",o,r),s=Od(a,t,r,i);return n&&Rd(s,r,t),s}(e,s.style,n,r,o,i):"large"===s.type?Dd(e,s.size,n,r,o,i):Ud(e,t,n,r,o,i)},Qd={sqrtImage:function(e,t){
|
|
367
|
+
var n,r,o=t.havingBaseSizing(),i=Zd("\\surd",e*o.sizeMultiplier,Kd,o),a=o.sizeMultiplier,s=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l=0,c=0,u=0;return"small"===i.type?(e<1?a=1:e<1.4&&(a=.7),c=(1+s)/a,(n=Hd("sqrtMain",l=(1+s+.08)/a,u=1e3+1e3*s+80,s,t)).style.minWidth="0.853em",r=.833/a):"large"===i.type?(u=1080*Vd[i.size],c=(Vd[i.size]+s)/a,l=(Vd[i.size]+s+.08)/a,(n=Hd("sqrtSize"+i.size,l,u,s,t)).style.minWidth="1.02em",r=1/a):(l=e+s+.08,c=e+s,u=Math.floor(1e3*e+s)+80,(n=Hd("sqrtTall",l,u,s,t)).style.minWidth="0.742em",r=1.056),n.height=c,n.style.height=ku(l),{span:n,advanceWidth:r,ruleWidth:(t.fontMetrics().sqrtRuleThickness+s)*a}},sizedDelim:function(e,t,n,r,o){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),Vc.contains(qd,e)||Vc.contains(Gd,e))return Dd(e,t,!1,n,r,o);if(Vc.contains($d,e))return Ud(e,Vd[t],!1,n,r,o);throw new Uc("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:Vd,customSizedDelim:Jd,leftRightDelim:function(e,t,n,r,o,i){
|
|
368
|
+
var a=r.fontMetrics().axisHeight*r.sizeMultiplier,s=5/r.fontMetrics().ptPerEm,l=Math.max(t-a,n+a),c=Math.max(l/500*901,2*l-s);return Jd(e,c,!0,r,o,i)}},ep={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}
|
|
369
|
+
},tp=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function np(e,t){var n=bd(e);if(n&&Vc.contains(tp,n.text))return n;throw new Uc(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function rp(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Dh({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=np(t[0],e);return{type:"delimsizing",
|
|
370
|
+
mode:e.parser.mode,size:ep[e.funcName].size,mclass:ep[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?Eh.makeSpan([e.mclass]):Qd.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(rd(e.delim,e.mode));var n=new nd.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=ku(Qd.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}}),Dh({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&"string"!=typeof n)throw new Uc("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:np(t[0],e).text,color:n}}}),Dh({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=np(t[0],e),r=e.parser;++r.leftrightDepth;var o=r.parseExpression(!1)
|
|
371
|
+
;--r.leftrightDepth,r.expect("\\right",!1);var i=vd(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:o,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,t)=>{rp(e);for(var n,r,o=$h(e.body,t,!0,["mopen","mclose"]),i=0,a=0,s=!1,l=0;l<o.length;l++)o[l].isMiddle?s=!0:(i=Math.max(o[l].height,i),a=Math.max(o[l].depth,a));if(i*=t.sizeMultiplier,a*=t.sizeMultiplier,n="."===e.left?Kh(t,["mopen"]):Qd.leftRightDelim(e.left,i,a,t,e.mode,["mopen"]),o.unshift(n),s)for(var c=1;c<o.length;c++){var u=o[c].isMiddle;u&&(o[c]=Qd.leftRightDelim(u.delim,i,a,u.options,e.mode,[]))}if("."===e.right)r=Kh(t,["mclose"]);else{var h=e.rightColor?t.withColor(e.rightColor):t;r=Qd.leftRightDelim(e.right,i,a,h,e.mode,["mclose"])}return o.push(r),Eh.makeSpan(["minner"],o,t)},mathmlBuilder:(e,t)=>{rp(e);var n=ad(e.body,t);if("."!==e.left){var r=new nd.MathNode("mo",[rd(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==e.right){var o=new nd.MathNode("mo",[rd(e.right,e.mode)])
|
|
372
|
+
;o.setAttribute("fence","true"),e.rightColor&&o.setAttribute("mathcolor",e.rightColor),n.push(o)}return od(n)}}),Dh({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=np(t[0],e);if(!e.parser.leftrightDepth)throw new Uc("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if("."===e.delim)n=Kh(t,[]);else{n=Qd.sizedDelim(e.delim,1,t,e.mode,[]);var r={delim:e.delim,options:t};n.isMiddle=r}return n},mathmlBuilder:(e,t)=>{var n="\\vert"===e.delim||"|"===e.delim?rd("|","text"):rd(e.delim,e.mode),r=new nd.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var op=(e,t)=>{var n,r,o=Eh.wrapFragment(Xh(e.body,t),t),i=e.label.substr(1),a=t.sizeMultiplier,s=0,l=Vc.isCharacterBox(e.body);if("sout"===i)(n=Eh.makeSpan(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/a,s=-.5*t.fontMetrics().xHeight;else if("phase"===i){var c=xu({
|
|
373
|
+
number:.6,unit:"pt"},t),u=xu({number:.35,unit:"ex"},t);a/=t.havingBaseSizing().sizeMultiplier;var h=o.height+o.depth+c+u;o.style.paddingLeft=ku(h/2+c);var d=Math.floor(1e3*h*a),p=function(e){return"M400000 "+e+" H0 L"+e/2+" 0 l65 45 L145 "+(e-80)+" H400000z"}(d),m=new Ou([new Ru("phase",p)],{width:"400em",height:ku(d/1e3),viewBox:"0 0 400000 "+d,preserveAspectRatio:"xMinYMin slice"});(n=Eh.makeSvgSpan(["hide-tail"],[m],t)).style.height=ku(h),s=o.depth+c+u}else{/cancel/.test(i)?l||o.classes.push("cancel-pad"):"angl"===i?o.classes.push("anglpad"):o.classes.push("boxpad");var f=0,g=0,v=0;/box/.test(i)?(v=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),g=f=t.fontMetrics().fboxsep+("colorbox"===i?0:v)):"angl"===i?(f=4*(v=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness)),g=Math.max(0,.25-o.depth)):g=f=l?.2:0,n=md(o,i,f,g,t),/fbox|boxed|fcolorbox/.test(i)?(n.style.borderStyle="solid",n.style.borderWidth=ku(v)):"angl"===i&&.049!==v&&(n.style.borderTopWidth=ku(v),n.style.borderRightWidth=ku(v)),
|
|
374
|
+
s=o.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)r=Eh.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:s},{type:"elem",elem:o,shift:0}]},t);else{var _=/cancel|phase/.test(i)?["svg-align"]:[];r=Eh.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:n,shift:s,wrapperClasses:_}]},t)}return/cancel/.test(i)&&(r.height=o.height,r.depth=o.depth),/cancel/.test(i)&&!l?Eh.makeSpan(["mord","cancel-lap"],[r],t):Eh.makeSpan(["mord"],[r],t)},ip=(e,t)=>{var n=0,r=new nd.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[ld(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":
|
|
375
|
+
r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var o=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+o+"em solid "+String(e.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};Dh({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:r,funcName:o}=e,i=vd(t[0],"color-token").color,a=t[1];return{type:"enclose",mode:r.mode,label:o,backgroundColor:i,body:a}},htmlBuilder:op,mathmlBuilder:ip}),Dh({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,
|
|
376
|
+
argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:o}=e,i=vd(t[0],"color-token").color,a=vd(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:r.mode,label:o,backgroundColor:a,borderColor:i,body:s}},htmlBuilder:op,mathmlBuilder:ip}),Dh({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}}),Dh({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"enclose",mode:n.mode,label:r,body:o}},htmlBuilder:op,mathmlBuilder:ip}),Dh({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var ap={};function sp(e){for(var{type:t,names:n,props:r,handler:o,htmlBuilder:i,mathmlBuilder:a}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,
|
|
377
|
+
handler:o},l=0;l<n.length;++l)ap[n[l]]=s;i&&(Oh[t]=i),a&&(Rh[t]=a)}var lp={};function cp(e,t){lp[e]=t}function up(e){var t=[];e.consumeSpaces();for(var n=e.fetch().text;"\\hline"===n||"\\hdashline"===n;)e.consume(),t.push("\\hdashline"===n),e.consumeSpaces(),n=e.fetch().text;return t}var hp=e=>{if(!e.parser.settings.displayMode)throw new Uc("{"+e.envName+"} can be used only in display mode.")};function dp(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function pp(e,t,n){var{hskipBeforeAndAfter:r,addJot:o,cols:i,arraystretch:a,colSeparationType:s,autoTag:l,singleRow:c,emptySingleRow:u,maxNumCols:h,leqno:d}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var p=e.gullet.expandMacroAsText("\\arraystretch");if(null==p)a=1;else if(!(a=parseFloat(p))||a<0)throw new Uc("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var m=[],f=[m],g=[],v=[],_=null!=l?[]:void 0;function b(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function y(){
|
|
378
|
+
_&&(e.gullet.macros.get("\\df@tag")?(_.push(e.subparse([new jc("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):_.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(b(),v.push(up(e));;){var w=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),w={type:"ordgroup",mode:e.mode,body:w},n&&(w={type:"styling",mode:e.mode,style:n,body:[w]}),m.push(w);var x=e.fetch().text;if("&"===x){if(h&&m.length===h){if(c||s)throw new Uc("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else{if("\\end"===x){y(),1===m.length&&"styling"===w.type&&0===w.body[0].body.length&&(f.length>1||!u)&&f.pop(),v.length<f.length+1&&v.push([]);break}if("\\\\"!==x)throw new Uc("Expected & or \\\\ or \\cr or \\end",e.nextToken);e.consume();var k=void 0;" "!==e.gullet.future().text&&(k=e.parseSizeGroup(!0)),g.push(k?k.value:null),y(),v.push(up(e)),m=[],f.push(m),b()}}return e.gullet.endGroup(),
|
|
379
|
+
e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:o,arraystretch:a,body:f,cols:i,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:v,colSeparationType:s,tags:_,leqno:d}}function mp(e){return"d"===e.substr(0,1)?"display":"text"}var fp=function(e,t){var n,r,o=e.body.length,i=e.hLinesBeforeRow,a=0,s=new Array(o),l=[],c=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),u=1/t.fontMetrics().ptPerEm,h=5*u;e.colSeparationType&&"small"===e.colSeparationType&&(h=t.havingStyle(ou.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var d="CD"===e.colSeparationType?xu({number:3,unit:"ex"},t):12*u,p=3*u,m=e.arraystretch*d,f=.7*m,g=.3*m,v=0;function _(e){for(var t=0;t<e.length;++t)t>0&&(v+=.25),l.push({pos:v,isDashed:e[t]})}for(_(i[0]),n=0;n<e.body.length;++n){var b=e.body[n],y=f,w=g;a<b.length&&(a=b.length);var x=new Array(b.length);for(r=0;r<b.length;++r){var k=Xh(b[r],t);w<k.depth&&(w=k.depth),y<k.height&&(y=k.height),x[r]=k}var S=e.rowGaps[n],C=0;S&&(C=xu(S,t))>0&&(w<(C+=g)&&(w=C),C=0),e.addJot&&(w+=p),x.height=y,
|
|
380
|
+
x.depth=w,v+=y,x.pos=v,v+=w+C,s[n]=x,_(i[n+1])}var E,A,T=v/2+t.fontMetrics().axisHeight,N=e.cols||[],M=[],L=[];if(e.tags&&e.tags.some((e=>e)))for(n=0;n<o;++n){var z=s[n],O=z.pos-T,R=e.tags[n],D=void 0;(D=!0===R?Eh.makeSpan(["eqn-num"],[],t):!1===R?Eh.makeSpan([],[],t):Eh.makeSpan([],$h(R,t,!0),t)).depth=z.depth,D.height=z.height,L.push({type:"elem",elem:D,shift:O})}for(r=0,A=0;r<a||A<N.length;++r,++A){for(var I=N[A]||{},P=!0;"separator"===I.type;){if(P||((E=Eh.makeSpan(["arraycolsep"],[])).style.width=ku(t.fontMetrics().doubleRuleSep),M.push(E)),"|"!==I.separator&&":"!==I.separator)throw new Uc("Invalid separator type: "+I.separator);var B="|"===I.separator?"solid":"dashed",F=Eh.makeSpan(["vertical-separator"],[],t);F.style.height=ku(v),F.style.borderRightWidth=ku(c),F.style.borderRightStyle=B,F.style.margin="0 "+ku(-c/2);var j=v-T;j&&(F.style.verticalAlign=ku(-j)),M.push(F),I=N[++A]||{},P=!1}if(!(r>=a)){var U=void 0
|
|
381
|
+
;(r>0||e.hskipBeforeAndAfter)&&0!==(U=Vc.deflt(I.pregap,h))&&((E=Eh.makeSpan(["arraycolsep"],[])).style.width=ku(U),M.push(E));var H=[];for(n=0;n<o;++n){var q=s[n],$=q[r];if($){var G=q.pos-T;$.depth=q.depth,$.height=q.height,H.push({type:"elem",elem:$,shift:G})}}H=Eh.makeVList({positionType:"individualShift",children:H},t),H=Eh.makeSpan(["col-align-"+(I.align||"c")],[H]),M.push(H),(r<a-1||e.hskipBeforeAndAfter)&&0!==(U=Vc.deflt(I.postgap,h))&&((E=Eh.makeSpan(["arraycolsep"],[])).style.width=ku(U),M.push(E))}}if(s=Eh.makeSpan(["mtable"],M),l.length>0){for(var V=Eh.makeLineSpan("hline",t,c),Y=Eh.makeLineSpan("hdashline",t,c),W=[{type:"elem",elem:s,shift:0}];l.length>0;){var K=l.pop(),X=K.pos-T;K.isDashed?W.push({type:"elem",elem:Y,shift:X}):W.push({type:"elem",elem:V,shift:X})}s=Eh.makeVList({positionType:"individualShift",children:W},t)}if(0===L.length)return Eh.makeSpan(["mord"],[s],t);var Z=Eh.makeVList({positionType:"individualShift",children:L},t);return Z=Eh.makeSpan(["tag"],[Z],t),Eh.makeFragment([s,Z])
|
|
382
|
+
},gp={c:"center ",l:"left ",r:"right "},vp=function(e,t){for(var n=[],r=new nd.MathNode("mtd",[],["mtr-glue"]),o=new nd.MathNode("mtd",[],["mml-eqn-num"]),i=0;i<e.body.length;i++){for(var a=e.body[i],s=[],l=0;l<a.length;l++)s.push(new nd.MathNode("mtd",[ld(a[l],t)]));e.tags&&e.tags[i]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(o):s.push(o)),n.push(new nd.MathNode("mtr",s))}var c=new nd.MathNode("mtable",n),u=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",ku(u));var h="",d="";if(e.cols&&e.cols.length>0){var p=e.cols,m="",f=!1,g=0,v=p.length;"separator"===p[0].type&&(h+="top ",g=1),"separator"===p[p.length-1].type&&(h+="bottom ",v-=1);for(var _=g;_<v;_++)"align"===p[_].type?(d+=gp[p[_].align],f&&(m+="none "),f=!0):"separator"===p[_].type&&f&&(m+="|"===p[_].separator?"solid ":"dashed ",f=!1);c.setAttribute("columnalign",d.trim()),/[sd]/.test(m)&&c.setAttribute("columnlines",m.trim())}if("align"===e.colSeparationType){
|
|
383
|
+
for(var b=e.cols||[],y="",w=1;w<b.length;w++)y+=w%2?"0em ":"1em ";c.setAttribute("columnspacing",y.trim())}else"alignat"===e.colSeparationType||"gather"===e.colSeparationType?c.setAttribute("columnspacing","0em"):"small"===e.colSeparationType?c.setAttribute("columnspacing","0.2778em"):"CD"===e.colSeparationType?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var x="",k=e.hLinesBeforeRow;h+=k[0].length>0?"left ":"",h+=k[k.length-1].length>0?"right ":"";for(var S=1;S<k.length-1;S++)x+=0===k[S].length?"none ":k[S][0]?"dashed ":"solid ";return/[sd]/.test(x)&&c.setAttribute("rowlines",x.trim()),""!==h&&(c=new nd.MathNode("menclose",[c])).setAttribute("notation",h.trim()),e.arraystretch&&e.arraystretch<1&&(c=new nd.MathNode("mstyle",[c])).setAttribute("scriptlevel","1"),c},_p=function(e,t){-1===e.envName.indexOf("ed")&&hp(e);var n,r=[],o=e.envName.indexOf("at")>-1?"alignat":"align",i="split"===e.envName,a=pp(e.parser,{cols:r,addJot:!0,autoTag:i?void 0:dp(e.envName),emptySingleRow:!0,
|
|
384
|
+
colSeparationType:o,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},"display"),s=0,l={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var c="",u=0;u<t[0].body.length;u++){c+=vd(t[0].body[u],"textord").text}n=Number(c),s=2*n}var h=!s;a.body.forEach((function(e){for(var t=1;t<e.length;t+=2){var r=vd(e[t],"styling");vd(r.body[0],"ordgroup").body.unshift(l)}if(h)s<e.length&&(s=e.length);else{var o=e.length/2;if(n<o)throw new Uc("Too many math in a row: expected "+n+", but got "+o,e[0])}}));for(var d=0;d<s;++d){var p="r",m=0;d%2==1?p="l":d>0&&h&&(m=1),r[d]={type:"align",align:p,pregap:m,postgap:0}}return a.colSeparationType=h?"align":"alignat",a};sp({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(bd(t[0])?[t[0]]:vd(t[0],"ordgroup").body).map((function(e){var t=_d(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"}
|
|
385
|
+
;throw new Uc("Unknown column alignment: "+t,e)})),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return pp(e.parser,r,mp(e.envName))},htmlBuilder:fp,mathmlBuilder:vp}),sp({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===e.envName.charAt(e.envName.length-1)){var o=e.parser;if(o.consumeSpaces(),"["===o.fetch().text){if(o.consume(),o.consumeSpaces(),n=o.fetch().text,-1==="lcr".indexOf(n))throw new Uc("Expected l or c or r",o.nextToken);o.consume(),o.consumeSpaces(),o.expect("]"),o.consume(),r.cols=[{type:"align",align:n}]}}var i=pp(e.parser,r,mp(e.envName)),a=Math.max(0,...i.body.map((e=>e.length)));return i.cols=new Array(a).fill({type:"align",align:n}),t?{
|
|
386
|
+
type:"leftright",mode:e.mode,body:[i],left:t[0],right:t[1],rightColor:void 0}:i},htmlBuilder:fp,mathmlBuilder:vp}),sp({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=pp(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:fp,mathmlBuilder:vp}),sp({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(bd(t[0])?[t[0]]:vd(t[0],"ordgroup").body).map((function(e){var t=_d(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new Uc("Unknown column alignment: "+t,e)}));if(n.length>1)throw new Uc("{subarray} can contain only one column");var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if((r=pp(e.parser,r,"script")).body.length>0&&r.body[0].length>1)throw new Uc("{subarray} can contain only one column");return r},htmlBuilder:fp,mathmlBuilder:vp}),sp({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=pp(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{
|
|
387
|
+
type:"align",align:"l",pregap:0,postgap:0}]},mp(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:fp,mathmlBuilder:vp}),sp({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:_p,htmlBuilder:fp,mathmlBuilder:vp}),sp({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){Vc.contains(["gather","gather*"],e.envName)&&hp(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:dp(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return pp(e.parser,t,"display")},htmlBuilder:fp,mathmlBuilder:vp}),sp({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:_p,htmlBuilder:fp,mathmlBuilder:vp}),sp({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){hp(e);var t={autoTag:dp(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno}
|
|
388
|
+
;return pp(e.parser,t,"display")},htmlBuilder:fp,mathmlBuilder:vp}),sp({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(hp(e),function(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if("&"!==n&&"\\\\"!==n){if("\\end"===n){0===t[t.length-1].length&&t.pop();break}throw new Uc("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var r,o,i=[],a=[i],s=0;s<t.length;s++){for(var l=t[s],c={type:"styling",body:[],mode:"math",style:"display"},u=0;u<l.length;u++)if(Cd(l[u])){i.push(c);var h=_d(l[u+=1]).text,d=new Array(2);if(d[0]={type:"ordgroup",mode:"math",body:[]},d[1]={type:"ordgroup",mode:"math",body:[]},"=|.".indexOf(h)>-1);else{if(!("<>AV".indexOf(h)>-1))throw new Uc('Expected one of "<>AV=|." after @',l[u]);for(var p=0;p<2;p++){for(var m=!0,f=u+1;f<l.length;f++){if(o=h,("mathord"===(r=l[f]).type||"atom"===r.type)&&r.text===o){m=!1,u=f;break
|
|
389
|
+
}if(Cd(l[f]))throw new Uc("Missing a "+h+" character to complete a CD arrow.",l[f]);d[p].body.push(l[f])}if(m)throw new Uc("Missing a "+h+" character to complete a CD arrow.",l[u])}}var g={type:"styling",body:[Ed(h,d,e)],mode:"math",style:"display"};i.push(g),c={type:"styling",body:[],mode:"math",style:"display"}}else c.body.push(l[u]);s%2==0?i.push(c):i.shift(),i=[],a.push(i)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:"math",body:a,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(a[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(a.length+1).fill([])}}(e.parser)),htmlBuilder:fp,mathmlBuilder:vp}),cp("\\nonumber","\\gdef\\@eqnsw{0}"),cp("\\notag","\\nonumber"),Dh({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new Uc(e.funcName+" valid only within array environment")}});var bp=ap;Dh({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,
|
|
390
|
+
argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];if("ordgroup"!==o.type)throw new Uc("Invalid environment name",o);for(var i="",a=0;a<o.body.length;++a)i+=vd(o.body[a],"textord").text;if("\\begin"===r){if(!bp.hasOwnProperty(i))throw new Uc("No such environment: "+i,o);var s=bp[i],{args:l,optArgs:c}=n.parseArguments("\\begin{"+i+"}",s),u={mode:n.mode,envName:i,parser:n},h=s.handler(u,l,c);n.expect("\\end",!1);var d=n.nextToken,p=vd(n.parseFunction(),"environment");if(p.name!==i)throw new Uc("Mismatch: \\begin{"+i+"} matched by \\end{"+p.name+"}",d);return h}return{type:"environment",mode:n.mode,name:i,nameGroup:o}}});var yp=Eh.makeSpan;function wp(e,t){var n=$h(e.body,t,!0);return yp([e.mclass],n,t)}function xp(e,t){var n,r=ad(e.body,t);return"minner"===e.mclass?n=new nd.MathNode("mpadded",r):"mord"===e.mclass?e.isCharacterBox?(n=r[0]).type="mi":n=new nd.MathNode("mi",r):(e.isCharacterBox?(n=r[0]).type="mo":n=new nd.MathNode("mo",r),"mbin"===e.mclass?(n.attributes.lspace="0.22em",
|
|
391
|
+
n.attributes.rspace="0.22em"):"mpunct"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0em"):"minner"===e.mclass&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Dh({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.substr(5),body:Bh(o),isCharacterBox:Vc.isCharacterBox(o)}},htmlBuilder:wp,mathmlBuilder:xp});var kp=e=>{var t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};Dh({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:kp(t[0]),body:Bh(t[1]),isCharacterBox:Vc.isCharacterBox(t[1])}}}),Dh({type:"mclass",names:["\\stackrel","\\overset","\\underset"],
|
|
392
|
+
props:{numArgs:2},handler(e,t){var n,{parser:r,funcName:o}=e,i=t[1],a=t[0];n="\\stackrel"!==o?kp(i):"mrel";var s={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==o,body:Bh(i)},l={type:"supsub",mode:a.mode,base:s,sup:"\\underset"===o?null:a,sub:"\\underset"===o?a:null};return{type:"mclass",mode:r.mode,mclass:n,body:[l],isCharacterBox:Vc.isCharacterBox(l)}},htmlBuilder:wp,mathmlBuilder:xp});var Sp=(e,t)=>{var n=e.font,r=t.withFont(n);return Xh(e.body,r)},Cp=(e,t)=>{var n=e.font,r=t.withFont(n);return ld(e.body,r)},Ep={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Dh({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=Ph(t[0]),i=r;return i in Ep&&(i=Ep[i]),{type:"font",mode:n.mode,font:i.slice(1),body:o}},
|
|
393
|
+
htmlBuilder:Sp,mathmlBuilder:Cp}),Dh({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0],o=Vc.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:kp(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:o}}}),Dh({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:o}=e,{mode:i}=n,a=n.parseExpression(!0,o);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:a}}},htmlBuilder:Sp,mathmlBuilder:Cp});var Ap=(e,t)=>{var n=t;return"display"===e?n=n.id>=ou.SCRIPT.id?n.text():ou.DISPLAY:"text"===e&&n.size===ou.DISPLAY.size?n=ou.TEXT:"script"===e?n=ou.SCRIPT:"scriptscript"===e&&(n=ou.SCRIPTSCRIPT),n},Tp=(e,t)=>{var n,r=Ap(e.size,t.style),o=r.fracNum(),i=r.fracDen();n=t.havingStyle(o);var a=Xh(e.numer,n,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm
|
|
394
|
+
;a.height=a.height<s?s:a.height,a.depth=a.depth<l?l:a.depth}n=t.havingStyle(i);var c,u,h,d,p,m,f,g,v,_,b=Xh(e.denom,n,t);if(e.hasBarLine?(e.barSize?(u=xu(e.barSize,t),c=Eh.makeLineSpan("frac-line",t,u)):c=Eh.makeLineSpan("frac-line",t),u=c.height,h=c.height):(c=null,u=0,h=t.fontMetrics().defaultRuleThickness),r.size===ou.DISPLAY.size||"display"===e.size?(d=t.fontMetrics().num1,p=u>0?3*h:7*h,m=t.fontMetrics().denom1):(u>0?(d=t.fontMetrics().num2,p=h):(d=t.fontMetrics().num3,p=3*h),m=t.fontMetrics().denom2),c){var y=t.fontMetrics().axisHeight;d-a.depth-(y+.5*u)<p&&(d+=p-(d-a.depth-(y+.5*u))),y-.5*u-(b.height-m)<p&&(m+=p-(y-.5*u-(b.height-m)));var w=-(y-.5*u);f=Eh.makeVList({positionType:"individualShift",children:[{type:"elem",elem:b,shift:m},{type:"elem",elem:c,shift:w},{type:"elem",elem:a,shift:-d}]},t)}else{var x=d-a.depth-(b.height-m);x<p&&(d+=.5*(p-x),m+=.5*(p-x)),f=Eh.makeVList({positionType:"individualShift",children:[{type:"elem",elem:b,shift:m},{type:"elem",elem:a,shift:-d}]},t)}
|
|
395
|
+
return n=t.havingStyle(r),f.height*=n.sizeMultiplier/t.sizeMultiplier,f.depth*=n.sizeMultiplier/t.sizeMultiplier,g=r.size===ou.DISPLAY.size?t.fontMetrics().delim1:r.size===ou.SCRIPTSCRIPT.size?t.havingStyle(ou.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,v=null==e.leftDelim?Kh(t,["mopen"]):Qd.customSizedDelim(e.leftDelim,g,!0,t.havingStyle(r),e.mode,["mopen"]),_=e.continued?Eh.makeSpan([]):null==e.rightDelim?Kh(t,["mclose"]):Qd.customSizedDelim(e.rightDelim,g,!0,t.havingStyle(r),e.mode,["mclose"]),Eh.makeSpan(["mord"].concat(n.sizingClasses(t)),[v,Eh.makeSpan(["mfrac"],[f]),_],t)},Np=(e,t)=>{var n=new nd.MathNode("mfrac",[ld(e.numer,t),ld(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var r=xu(e.barSize,t);n.setAttribute("linethickness",ku(r))}}else n.setAttribute("linethickness","0px");var o=Ap(e.size,t.style);if(o.size!==t.style.size){n=new nd.MathNode("mstyle",[n]);var i=o.size===ou.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",i),n.setAttribute("scriptlevel","0")}
|
|
396
|
+
if(null!=e.leftDelim||null!=e.rightDelim){var a=[];if(null!=e.leftDelim){var s=new nd.MathNode("mo",[new nd.TextNode(e.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),a.push(s)}if(a.push(n),null!=e.rightDelim){var l=new nd.MathNode("mo",[new nd.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),a.push(l)}return od(a)}return n};Dh({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var n,{parser:r,funcName:o}=e,i=t[0],a=t[1],s=null,l=null,c="auto";switch(o){case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,s="(",l=")";break;case"\\\\bracefrac":n=!1,s="\\{",l="\\}";break;case"\\\\brackfrac":n=!1,s="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(o){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}
|
|
397
|
+
return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:a,hasBarLine:n,leftDelim:s,rightDelim:l,size:c,barSize:null}},htmlBuilder:Tp,mathmlBuilder:Np}),Dh({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0],i=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:o,denom:i,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),Dh({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var t,{parser:n,funcName:r,token:o}=e;switch(r){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:t,token:o}}});var Mp=["display","text","script","scriptscript"],Lp=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};Dh({type:"genfrac",names:["\\genfrac"],
|
|
398
|
+
props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var n,{parser:r}=e,o=t[4],i=t[5],a=Ph(t[0]),s="atom"===a.type&&"open"===a.family?Lp(a.text):null,l=Ph(t[1]),c="atom"===l.type&&"close"===l.family?Lp(l.text):null,u=vd(t[2],"size"),h=null;n=!!u.isBlank||(h=u.value).number>0;var d="auto",p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var m=vd(p.body[0],"textord");d=Mp[Number(m.text)]}}else p=vd(p,"textord"),d=Mp[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:o,denom:i,continued:!1,hasBarLine:n,barSize:h,leftDelim:s,rightDelim:c,size:d}},htmlBuilder:Tp,mathmlBuilder:Np}),Dh({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:o}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:vd(t[0],"size").value,token:o}}}),Dh({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{
|
|
399
|
+
var{parser:n,funcName:r}=e,o=t[0],i=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(vd(t[1],"infix").size),a=t[2],s=i.number>0;return{type:"genfrac",mode:n.mode,numer:o,denom:a,continued:!1,hasBarLine:s,barSize:i,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Tp,mathmlBuilder:Np});var zp=(e,t)=>{var n,r,o=t.style;"supsub"===e.type?(n=e.sup?Xh(e.sup,t.havingStyle(o.sup()),t):Xh(e.sub,t.havingStyle(o.sub()),t),r=vd(e.base,"horizBrace")):r=vd(e,"horizBrace");var i,a=Xh(r.base,t.havingBaseStyle(ou.DISPLAY)),s=gd(r,t);if(r.isOver?(i=Eh.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s}]},t)).children[0].children[0].children[1].classes.push("svg-align"):(i=Eh.makeVList({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a}]},t)).children[0].children[0].children[0].classes.push("svg-align"),n){
|
|
400
|
+
var l=Eh.makeSpan(["mord",r.isOver?"mover":"munder"],[i],t);i=r.isOver?Eh.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},t):Eh.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return Eh.makeSpan(["mord",r.isOver?"mover":"munder"],[i],t)};Dh({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:t[0]}},htmlBuilder:zp,mathmlBuilder:(e,t)=>{var n=fd(e.label);return new nd.MathNode(e.isOver?"mover":"munder",[ld(e.base,t),n])}}),Dh({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],o=vd(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:o})?{type:"href",mode:n.mode,href:o,body:Bh(r)}:n.formatUnsupportedCmd("\\href")},
|
|
401
|
+
htmlBuilder:(e,t)=>{var n=$h(e.body,t,!1);return Eh.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=sd(e.body,t);return n instanceof ed||(n=new ed("mrow",[n])),n.setAttribute("href",e.href),n}}),Dh({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=vd(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var o=[],i=0;i<r.length;i++){var a=r[i];"~"===a&&(a="\\textasciitilde"),o.push({type:"textord",mode:"text",text:a})}var s={type:"text",mode:n.mode,font:"\\texttt",body:o};return{type:"href",mode:n.mode,href:r,body:Bh(s)}}}),Dh({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:Bh(t[0])}},htmlBuilder(e,t){var n=$h(e.body,t,!1);return Eh.makeFragment(n)},mathmlBuilder:(e,t)=>new nd.MathNode("mrow",ad(e.body,t))}),Dh({type:"html",
|
|
402
|
+
names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var n,{parser:r,funcName:o,token:i}=e,a=vd(t[0],"raw").string,s=t[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(o){case"\\htmlClass":l.class=a,n={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,n={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,n={command:"\\htmlStyle",style:a};break;case"\\htmlData":for(var c=a.split(","),u=0;u<c.length;u++){var h=c[u].split("=");if(2!==h.length)throw new Uc("Error parsing key-value for \\htmlData");l["data-"+h[0].trim()]=h[1].trim()}n={command:"\\htmlData",attributes:l};break;default:throw new Error("Unrecognized html command")}return r.settings.isTrusted(n)?{type:"html",mode:r.mode,attributes:l,body:Bh(s)}:r.formatUnsupportedCmd(o)},htmlBuilder:(e,t)=>{var n=$h(e.body,t,!1),r=["enclosing"]
|
|
403
|
+
;e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var o=Eh.makeSpan(r,n,t);for(var i in e.attributes)"class"!==i&&e.attributes.hasOwnProperty(i)&&o.setAttribute(i,e.attributes[i]);return o},mathmlBuilder:(e,t)=>sd(e.body,t)}),Dh({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Bh(t[0]),mathml:Bh(t[1])}},htmlBuilder:(e,t)=>{var n=$h(e.html,t,!1);return Eh.makeFragment(n)},mathmlBuilder:(e,t)=>sd(e.mathml,t)});var Op=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new Uc("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!wu(n))throw new Uc("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Dh({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{
|
|
404
|
+
var{parser:r}=e,o={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},s="";if(n[0])for(var l=vd(n[0],"raw").string.split(","),c=0;c<l.length;c++){var u=l[c].split("=");if(2===u.length){var h=u[1].trim();switch(u[0].trim()){case"alt":s=h;break;case"width":o=Op(h);break;case"height":i=Op(h);break;case"totalheight":a=Op(h);break;default:throw new Uc("Invalid key: '"+u[0]+"' in \\includegraphics.")}}}var d=vd(t[0],"url").url;return""===s&&(s=(s=(s=d).replace(/^.*[\\/]/,"")).substring(0,s.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:d})?{type:"includegraphics",mode:r.mode,alt:s,width:o,height:i,totalheight:a,src:d}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=xu(e.height,t),r=0;e.totalheight.number>0&&(r=xu(e.totalheight,t)-n);var o=0;e.width.number>0&&(o=xu(e.width,t));var i={height:ku(n+r)};o>0&&(i.width=ku(o)),r>0&&(i.verticalAlign=ku(-r));var a=new Mu(e.src,e.alt,i);return a.height=n,a.depth=r,a},mathmlBuilder:(e,t)=>{
|
|
405
|
+
var n=new nd.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var r=xu(e.height,t),o=0;if(e.totalheight.number>0&&(o=xu(e.totalheight,t)-r,n.setAttribute("valign",ku(-o))),n.setAttribute("height",ku(r+o)),e.width.number>0){var i=xu(e.width,t);n.setAttribute("width",ku(i))}return n.setAttribute("src",e.src),n}}),Dh({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,o=vd(t[0],"size");if(n.settings.strict){var i="m"===r[1],a="mu"===o.value.unit;i?(a||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, not "+o.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:o.value}},htmlBuilder:(e,t)=>Eh.makeGlue(e.dimension,t),mathmlBuilder(e,t){var n=xu(e.dimension,t)
|
|
406
|
+
;return new nd.SpaceNode(n)}}),Dh({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:o}},htmlBuilder:(e,t)=>{var n;"clap"===e.alignment?(n=Eh.makeSpan([],[Xh(e.body,t)]),n=Eh.makeSpan(["inner"],[n],t)):n=Eh.makeSpan(["inner"],[Xh(e.body,t)]);var r=Eh.makeSpan(["fix"],[]),o=Eh.makeSpan([e.alignment],[n,r],t),i=Eh.makeSpan(["strut"]);return i.style.height=ku(o.height+o.depth),o.depth&&(i.style.verticalAlign=ku(-o.depth)),o.children.unshift(i),o=Eh.makeSpan(["thinbox"],[o],t),Eh.makeSpan(["mord","vbox"],[o],t)},mathmlBuilder:(e,t)=>{var n=new nd.MathNode("mpadded",[ld(e.body,t)]);if("rlap"!==e.alignment){var r="llap"===e.alignment?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}}),Dh({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,o=r.mode
|
|
407
|
+
;r.switchMode("math");var i="\\("===n?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(o),{type:"styling",mode:r.mode,style:"text",body:a}}}),Dh({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new Uc("Mismatched "+e.funcName)}});var Rp=(e,t)=>{switch(t.style.size){case ou.DISPLAY.size:return e.display;case ou.TEXT.size:return e.text;case ou.SCRIPT.size:return e.script;case ou.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Dh({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Bh(t[0]),text:Bh(t[1]),script:Bh(t[2]),scriptscript:Bh(t[3])}},htmlBuilder:(e,t)=>{var n=Rp(e,t),r=$h(n,t,!1);return Eh.makeFragment(r)},mathmlBuilder:(e,t)=>{var n=Rp(e,t);return sd(n,t)}});var Dp=(e,t,n,r,o,i,a)=>{e=Eh.makeSpan([],[e]);var s,l,c,u=n&&Vc.isCharacterBox(n);if(t){var h=Xh(t,r.havingStyle(o.sup()),r);l={elem:h,
|
|
408
|
+
kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-h.depth)}}if(n){var d=Xh(n,r.havingStyle(o.sub()),r);s={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}if(l&&s){var p=r.fontMetrics().bigOpSpacing5+s.elem.height+s.elem.depth+s.kern+e.depth+a;c=Eh.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:ku(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:ku(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(s){var m=e.height-a;c=Eh.makeVList({positionType:"top",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:ku(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e}]},r)}else{if(!l)return e;var f=e.depth+a;c=Eh.makeVList({positionType:"bottom",positionData:f,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{
|
|
409
|
+
type:"elem",elem:l.elem,marginLeft:ku(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}var g=[c];if(s&&0!==i&&!u){var v=Eh.makeSpan(["mspace"],[],r);v.style.marginRight=ku(i),g.unshift(v)}return Eh.makeSpan(["mop","op-limits"],g,r)},Ip=["\\smallint"],Pp=(e,t)=>{var n,r,o,i=!1;"supsub"===e.type?(n=e.sup,r=e.sub,o=vd(e.base,"op"),i=!0):o=vd(e,"op");var a,s=t.style,l=!1;if(s.size===ou.DISPLAY.size&&o.symbol&&!Vc.contains(Ip,o.name)&&(l=!0),o.symbol){var c=l?"Size2-Regular":"Size1-Regular",u="";if("\\oiint"!==o.name&&"\\oiiint"!==o.name||(u=o.name.substr(1),o.name="oiint"===u?"\\iint":"\\iiint"),a=Eh.makeSymbol(o.name,c,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),u.length>0){var h=a.italic,d=Eh.staticSvg(u+"Size"+(l?"2":"1"),t);a=Eh.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:0},{type:"elem",elem:d,shift:l?.08:0}]},t),o.name="\\"+u,a.classes.unshift("mop"),a.italic=h}}else if(o.body){var p=$h(o.body,t,!0)
|
|
410
|
+
;1===p.length&&p[0]instanceof zu?(a=p[0]).classes[0]="mop":a=Eh.makeSpan(["mop"],p,t)}else{for(var m=[],f=1;f<o.name.length;f++)m.push(Eh.mathsym(o.name[f],o.mode,t));a=Eh.makeSpan(["mop"],m,t)}var g=0,v=0;return(a instanceof zu||"\\oiint"===o.name||"\\oiiint"===o.name)&&!o.suppressBaseShift&&(g=(a.height-a.depth)/2-t.fontMetrics().axisHeight,v=a.italic),i?Dp(a,n,r,t,s,v,g):(g&&(a.style.position="relative",a.style.top=ku(g)),a)},Bp=(e,t)=>{var n;if(e.symbol)n=new ed("mo",[rd(e.name,e.mode)]),Vc.contains(Ip,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new ed("mo",ad(e.body,t));else{n=new ed("mi",[new td(e.name.slice(1))]);var r=new ed("mo",[rd("","text")]);n=e.parentIsSupSub?new ed("mrow",[n,r]):Qh([n,r])}return n},Fp={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Dh({type:"op",
|
|
411
|
+
names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=r;return 1===o.length&&(o=Fp[o]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:o}},htmlBuilder:Pp,mathmlBuilder:Bp}),Dh({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Bh(r)}},htmlBuilder:Pp,mathmlBuilder:Bp});var jp={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Dh({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],
|
|
412
|
+
props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Pp,mathmlBuilder:Bp}),Dh({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Pp,mathmlBuilder:Bp}),Dh({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,r=n;return 1===r.length&&(r=jp[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Pp,mathmlBuilder:Bp});var Up=(e,t)=>{var n,r,o,i,a=!1;if("supsub"===e.type?(n=e.sup,r=e.sub,o=vd(e.base,"operatorname"),a=!0):o=vd(e,"operatorname"),o.body.length>0){for(var s=o.body.map((e=>{var t=e.text;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e})),l=$h(s,t.withFont("mathrm"),!0),c=0;c<l.length;c++){
|
|
413
|
+
var u=l[c];u instanceof zu&&(u.text=u.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}i=Eh.makeSpan(["mop"],l,t)}else i=Eh.makeSpan(["mop"],[],t);return a?Dp(i,n,r,t,t.style,0,0):i};function Hp(e,t,n){for(var r=$h(e,t,!1),o=t.sizeMultiplier/n.sizeMultiplier,i=0;i<r.length;i++){var a=r[i].classes.indexOf("sizing");a<0?Array.prototype.push.apply(r[i].classes,t.sizingClasses(n)):r[i].classes[a+1]==="reset-size"+t.size&&(r[i].classes[a+1]="reset-size"+n.size),r[i].height*=o,r[i].depth*=o}return Eh.makeFragment(r)}Dh({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"operatorname",mode:n.mode,body:Bh(o),alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}},htmlBuilder:Up,mathmlBuilder:(e,t)=>{for(var n=ad(e.body,t.withFont("mathrm")),r=!0,o=0;o<n.length;o++){var i=n[o];if(i instanceof nd.SpaceNode);else if(i instanceof nd.MathNode)switch(i.type){case"mi":case"mn":case"ms":
|
|
414
|
+
case"mspace":case"mtext":break;case"mo":var a=i.children[0];1===i.children.length&&a instanceof nd.TextNode?a.text=a.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break;default:r=!1}else r=!1}if(r){var s=n.map((e=>e.toText())).join("");n=[new nd.TextNode(s)]}var l=new nd.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new nd.MathNode("mo",[rd("","text")]);return e.parentIsSupSub?new nd.MathNode("mrow",[l,c]):nd.newDocumentFragment([l,c])}}),cp("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),Ih({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?Eh.makeFragment($h(e.body,t,!1)):Eh.makeSpan(["mord"],$h(e.body,t,!0),t),mathmlBuilder:(e,t)=>sd(e.body,t,!0)}),Dh({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=Xh(e.body,t.havingCrampedStyle()),r=Eh.makeLineSpan("overline-line",t),o=t.fontMetrics().defaultRuleThickness,i=Eh.makeVList({positionType:"firstBaseline",
|
|
415
|
+
children:[{type:"elem",elem:n},{type:"kern",size:3*o},{type:"elem",elem:r},{type:"kern",size:o}]},t);return Eh.makeSpan(["mord","overline"],[i],t)},mathmlBuilder(e,t){var n=new nd.MathNode("mo",[new nd.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new nd.MathNode("mover",[ld(e.body,t),n]);return r.setAttribute("accent","true"),r}}),Dh({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:Bh(r)}},htmlBuilder:(e,t)=>{var n=$h(e.body,t.withPhantom(),!1);return Eh.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=ad(e.body,t);return new nd.MathNode("mphantom",n)}}),Dh({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=Eh.makeSpan([],[Xh(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r<n.children.length;r++)n.children[r].height=0,n.children[r].depth=0
|
|
416
|
+
;return n=Eh.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),Eh.makeSpan(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n=ad(Bh(e.body),t),r=new nd.MathNode("mphantom",n),o=new nd.MathNode("mpadded",[r]);return o.setAttribute("height","0px"),o.setAttribute("depth","0px"),o}}),Dh({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=Eh.makeSpan(["inner"],[Xh(e.body,t.withPhantom())]),r=Eh.makeSpan(["fix"],[]);return Eh.makeSpan(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=ad(Bh(e.body),t),r=new nd.MathNode("mphantom",n),o=new nd.MathNode("mpadded",[r]);return o.setAttribute("width","0px"),o}}),Dh({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=vd(t[0],"size").value,o=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:o}},htmlBuilder(e,t){var n=Xh(e.body,t),r=xu(e.dy,t)
|
|
417
|
+
;return Eh.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new nd.MathNode("mpadded",[ld(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}}),Dh({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),Dh({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,o=n[0],i=vd(t[0],"size"),a=vd(t[1],"size");return{type:"rule",mode:r.mode,shift:o&&vd(o,"size").value,width:i.value,height:a.value}},htmlBuilder(e,t){var n=Eh.makeSpan(["mord","rule"],[],t),r=xu(e.width,t),o=xu(e.height,t),i=e.shift?xu(e.shift,t):0;return n.style.borderRightWidth=ku(r),n.style.borderTopWidth=ku(o),n.style.bottom=ku(i),n.width=r,n.height=o+i,n.depth=-i,n.maxFontSize=1.125*o*t.sizeMultiplier,n},mathmlBuilder(e,t){
|
|
418
|
+
var n=xu(e.width,t),r=xu(e.height,t),o=e.shift?xu(e.shift,t):0,i=t.color&&t.getColor()||"black",a=new nd.MathNode("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",ku(n)),a.setAttribute("height",ku(r));var s=new nd.MathNode("mpadded",[a]);return o>=0?s.setAttribute("height",ku(o)):(s.setAttribute("height",ku(o)),s.setAttribute("depth",ku(-o))),s.setAttribute("voffset",ku(o)),s}});var qp=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];Dh({type:"sizing",names:qp,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:o}=e,i=o.parseExpression(!1,n);return{type:"sizing",mode:o.mode,size:qp.indexOf(r)+1,body:i}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return Hp(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=ad(e.body,n),o=new nd.MathNode("mstyle",r);return o.setAttribute("mathsize",ku(n.sizeMultiplier)),o}}),Dh({type:"smash",names:["\\smash"],props:{
|
|
419
|
+
numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,o=!1,i=!1,a=n[0]&&vd(n[0],"ordgroup");if(a)for(var s="",l=0;l<a.body.length;++l){if("t"===(s=a.body[l].text))o=!0;else{if("b"!==s){o=!1,i=!1;break}i=!0}}else o=!0,i=!0;var c=t[0];return{type:"smash",mode:r.mode,body:c,smashHeight:o,smashDepth:i}},htmlBuilder:(e,t)=>{var n=Eh.makeSpan([],[Xh(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].height=0;if(e.smashDepth&&(n.depth=0,n.children))for(var o=0;o<n.children.length;o++)n.children[o].depth=0;var i=Eh.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return Eh.makeSpan(["mord"],[i],t)},mathmlBuilder:(e,t)=>{var n=new nd.MathNode("mpadded",[ld(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),Dh({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){
|
|
420
|
+
var{parser:r}=e,o=n[0],i=t[0];return{type:"sqrt",mode:r.mode,body:i,index:o}},htmlBuilder(e,t){var n=Xh(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=Eh.wrapFragment(n,t);var r=t.fontMetrics().defaultRuleThickness,o=r;t.style.id<ou.TEXT.id&&(o=t.fontMetrics().xHeight);var i=r+o/4,a=n.height+n.depth+i+r,{span:s,ruleWidth:l,advanceWidth:c}=Qd.sqrtImage(a,t),u=s.height-l;u>n.height+n.depth+i&&(i=(i+u-n.height-n.depth)/2);var h=s.height-n.height-i-l;n.style.paddingLeft=ku(c);var d=Eh.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+h)},{type:"elem",elem:s},{type:"kern",size:l}]},t);if(e.index){var p=t.havingStyle(ou.SCRIPTSCRIPT),m=Xh(e.index,p,t),f=.6*(d.height-d.depth),g=Eh.makeVList({positionType:"shift",positionData:-f,children:[{type:"elem",elem:m}]},t),v=Eh.makeSpan(["root"],[g]);return Eh.makeSpan(["mord","sqrt"],[v,d],t)}return Eh.makeSpan(["mord","sqrt"],[d],t)},mathmlBuilder(e,t){
|
|
421
|
+
var{body:n,index:r}=e;return r?new nd.MathNode("mroot",[ld(n,t),ld(r,t)]):new nd.MathNode("msqrt",[ld(n,t)])}});var $p={display:ou.DISPLAY,text:ou.TEXT,script:ou.SCRIPT,scriptscript:ou.SCRIPTSCRIPT};Dh({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:o}=e,i=o.parseExpression(!0,n),a=r.slice(1,r.length-5);return{type:"styling",mode:o.mode,style:a,body:i}},htmlBuilder(e,t){var n=$p[e.style],r=t.havingStyle(n).withFont("");return Hp(e.body,r,t)},mathmlBuilder(e,t){var n=$p[e.style],r=t.havingStyle(n),o=ad(e.body,r),i=new nd.MathNode("mstyle",o),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return i.setAttribute("scriptlevel",a[0]),i.setAttribute("displaystyle",a[1]),i}});Ih({type:"supsub",htmlBuilder(e,t){var n=function(e,t){var n=e.base
|
|
422
|
+
;return n?"op"===n.type?n.limits&&(t.style.size===ou.DISPLAY.size||n.alwaysHandleSupSub)?Pp:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===ou.DISPLAY.size||n.limits)?Up:null:"accent"===n.type?Vc.isCharacterBox(n.base)?yd:null:"horizBrace"===n.type&&!e.sub===n.isOver?zp:null:null}(e,t);if(n)return n(e,t);var r,o,i,{base:a,sup:s,sub:l}=e,c=Xh(a,t),u=t.fontMetrics(),h=0,d=0,p=a&&Vc.isCharacterBox(a);if(s){var m=t.havingStyle(t.style.sup());r=Xh(s,m,t),p||(h=c.height-m.fontMetrics().supDrop*m.sizeMultiplier/t.sizeMultiplier)}if(l){var f=t.havingStyle(t.style.sub());o=Xh(l,f,t),p||(d=c.depth+f.fontMetrics().subDrop*f.sizeMultiplier/t.sizeMultiplier)}i=t.style===ou.DISPLAY?u.sup1:t.style.cramped?u.sup3:u.sup2;var g,v=t.sizeMultiplier,_=ku(.5/u.ptPerEm/v),b=null;if(o){var y=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof zu||y)&&(b=ku(-c.italic))}if(r&&o){h=Math.max(h,i,r.depth+.25*u.xHeight),d=Math.max(d,u.sub2)
|
|
423
|
+
;var w=4*u.defaultRuleThickness;if(h-r.depth-(o.height-d)<w){d=w-(h-r.depth)+o.height;var x=.8*u.xHeight-(h-r.depth);x>0&&(h+=x,d-=x)}var k=[{type:"elem",elem:o,shift:d,marginRight:_,marginLeft:b},{type:"elem",elem:r,shift:-h,marginRight:_}];g=Eh.makeVList({positionType:"individualShift",children:k},t)}else if(o){d=Math.max(d,u.sub1,o.height-.8*u.xHeight);var S=[{type:"elem",elem:o,marginLeft:b,marginRight:_}];g=Eh.makeVList({positionType:"shift",positionData:d,children:S},t)}else{if(!r)throw new Error("supsub must have either sup or sub.");h=Math.max(h,i,r.depth+.25*u.xHeight),g=Eh.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:r,marginRight:_}]},t)}var C=Wh(c,"right")||"mord";return Eh.makeSpan([C],[c,Eh.makeSpan(["msupsub"],[g])],t)},mathmlBuilder(e,t){var n,r=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(r=!0,n=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var o,i=[ld(e.base,t)]
|
|
424
|
+
;if(e.sub&&i.push(ld(e.sub,t)),e.sup&&i.push(ld(e.sup,t)),r)o=n?"mover":"munder";else if(e.sub)if(e.sup){var a=e.base;o=a&&"op"===a.type&&a.limits&&t.style===ou.DISPLAY||a&&"operatorname"===a.type&&a.alwaysHandleSupSub&&(t.style===ou.DISPLAY||a.limits)?"munderover":"msubsup"}else{var s=e.base;o=s&&"op"===s.type&&s.limits&&(t.style===ou.DISPLAY||s.alwaysHandleSupSub)||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(s.limits||t.style===ou.DISPLAY)?"munder":"msub"}else{var l=e.base;o=l&&"op"===l.type&&l.limits&&(t.style===ou.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===ou.DISPLAY)?"mover":"msup"}return new nd.MathNode(o,i)}}),Ih({type:"atom",htmlBuilder:(e,t)=>Eh.mathsym(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){var n=new nd.MathNode("mo",[rd(e.text,e.mode)]);if("bin"===e.family){var r=id(e,t);"bold-italic"===r&&n.setAttribute("mathvariant",r)
|
|
425
|
+
}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var Gp={mi:"italic",mn:"normal",mtext:"normal"};Ih({type:"mathord",htmlBuilder:(e,t)=>Eh.makeOrd(e,t,"mathord"),mathmlBuilder(e,t){var n=new nd.MathNode("mi",[rd(e.text,e.mode,t)]),r=id(e,t)||"italic";return r!==Gp[n.type]&&n.setAttribute("mathvariant",r),n}}),Ih({type:"textord",htmlBuilder:(e,t)=>Eh.makeOrd(e,t,"textord"),mathmlBuilder(e,t){var n,r=rd(e.text,e.mode,t),o=id(e,t)||"normal";return n="text"===e.mode?new nd.MathNode("mtext",[r]):/[0-9]/.test(e.text)?new nd.MathNode("mn",[r]):"\\prime"===e.text?new nd.MathNode("mo",[r]):new nd.MathNode("mi",[r]),o!==Gp[n.type]&&n.setAttribute("mathvariant",o),n}});var Vp={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Yp={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Ih({type:"spacing",htmlBuilder(e,t){if(Yp.hasOwnProperty(e.text)){var n=Yp[e.text].className||""
|
|
426
|
+
;if("text"===e.mode){var r=Eh.makeOrd(e,t,"textord");return r.classes.push(n),r}return Eh.makeSpan(["mspace",n],[Eh.mathsym(e.text,e.mode,t)],t)}if(Vp.hasOwnProperty(e.text))return Eh.makeSpan(["mspace",Vp[e.text]],[],t);throw new Uc('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!Yp.hasOwnProperty(e.text)){if(Vp.hasOwnProperty(e.text))return new nd.MathNode("mspace");throw new Uc('Unknown type of space "'+e.text+'"')}return new nd.MathNode("mtext",[new nd.TextNode(" ")])}});var Wp=()=>{var e=new nd.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};Ih({type:"tag",mathmlBuilder(e,t){var n=new nd.MathNode("mtable",[new nd.MathNode("mtr",[Wp(),new nd.MathNode("mtd",[sd(e.body,t)]),Wp(),new nd.MathNode("mtd",[sd(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var Kp={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Xp={"\\textbf":"textbf","\\textmd":"textmd"},Zp={"\\textit":"textit","\\textup":"textup"},Jp=(e,t)=>{var n=e.font
|
|
427
|
+
;return n?Kp[n]?t.withTextFontFamily(Kp[n]):Xp[n]?t.withTextFontWeight(Xp[n]):t.withTextFontShape(Zp[n]):t};Dh({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"text",mode:n.mode,body:Bh(o),font:r}},htmlBuilder(e,t){var n=Jp(e,t),r=$h(e.body,n,!0);return Eh.makeSpan(["mord","text"],r,n)},mathmlBuilder(e,t){var n=Jp(e,t);return sd(e.body,n)}}),Dh({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Xh(e.body,t),r=Eh.makeLineSpan("underline-line",t),o=t.fontMetrics().defaultRuleThickness,i=Eh.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:o},{type:"elem",elem:r},{type:"kern",size:3*o},{type:"elem",elem:n}]},t);return Eh.makeSpan(["mord","underline"],[i],t)
|
|
428
|
+
},mathmlBuilder(e,t){var n=new nd.MathNode("mo",[new nd.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new nd.MathNode("munder",[ld(e.body,t),n]);return r.setAttribute("accentunder","true"),r}}),Dh({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Xh(e.body,t),r=t.fontMetrics().axisHeight,o=.5*(n.height-r-(n.depth+r));return Eh.makeVList({positionType:"shift",positionData:o,children:[{type:"elem",elem:n}]},t)},mathmlBuilder:(e,t)=>new nd.MathNode("mpadded",[ld(e.body,t)],["vcenter"])}),Dh({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new Uc("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=Qp(e),r=[],o=t.havingStyle(t.style.text()),i=0;i<n.length;i++){var a=n[i];"~"===a&&(a="\\textasciitilde"),r.push(Eh.makeSymbol(a,"Typewriter-Regular",e.mode,o,["mord","texttt"]))}
|
|
429
|
+
return Eh.makeSpan(["mord","text"].concat(o.sizingClasses(t)),Eh.tryCombineChars(r),o)},mathmlBuilder(e,t){var n=new nd.TextNode(Qp(e)),r=new nd.MathNode("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var Qp=e=>e.body.replace(/ /g,e.star?"␣":" "),em=zh,tm=new RegExp("[̀-ͯ]+$");class nm{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp("([ \r\n\t]+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧-豈-][̀-ͯ]*|[\ud800-\udbff][\udc00-\udfff][̀-ͯ]*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|(\\\\[a-zA-Z@]+)[ \r\n\t]*|\\\\[^\ud800-\udfff])","g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new jc("EOF",new Fc(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new Uc("Unexpected character: '"+e[t]+"'",new jc(e[t],new Fc(this,t,t+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ")
|
|
430
|
+
;if(14===this.catcodes[r]){var o=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===o?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=o+1,this.lex()}return new jc(r,new Fc(this,t,this.tokenRegex.lastIndex))}}class rm{constructor(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new Uc("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(null==e[t]?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){
|
|
431
|
+
return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(void 0===n&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var o=this.undefStack[this.undefStack.length-1];o&&!o.hasOwnProperty(e)&&(o[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var om=lp;cp("\\noexpand",(function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}})),cp("\\expandafter",(function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}})),cp("\\@firstoftwo",(function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}})),cp("\\@secondoftwo",(function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}})),cp("\\@ifnextchar",(function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return 1===t[0].length&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}})),
|
|
432
|
+
cp("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),cp("\\TextOrMath",(function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}}));var im={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};cp("\\char",(function(e){var t,n=e.popToken(),r="";if("'"===n.text)t=8,n=e.popToken();else if('"'===n.text)t=16,n=e.popToken();else if("`"===n.text)if("\\"===(n=e.popToken()).text[0])r=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new Uc("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(null==(r=im[n.text])||r>=t)throw new Uc("Invalid base-"+t+" digit "+n.text);for(var o;null!=(o=im[e.future().text])&&o<t;)r*=t,r+=o,e.popToken()}return"\\@char{"+r+"}"}));var am=(e,t,n)=>{var r=e.consumeArg().tokens;if(1!==r.length)throw new Uc("\\newcommand's first argument must be a macro name");var o=r[0].text,i=e.isDefined(o)
|
|
433
|
+
;if(i&&!t)throw new Uc("\\newcommand{"+o+"} attempting to redefine "+o+"; use \\renewcommand");if(!i&&!n)throw new Uc("\\renewcommand{"+o+"} when command "+o+" does not yet exist; use \\newcommand");var a=0;if(1===(r=e.consumeArg().tokens).length&&"["===r[0].text){for(var s="",l=e.expandNextToken();"]"!==l.text&&"EOF"!==l.text;)s+=l.text,l=e.expandNextToken();if(!s.match(/^\s*[0-9]+\s*$/))throw new Uc("Invalid number of arguments: "+s);a=parseInt(s),r=e.consumeArg().tokens}return e.macros.set(o,{tokens:r,numArgs:a}),""};cp("\\newcommand",(e=>am(e,!1,!0))),cp("\\renewcommand",(e=>am(e,!0,!1))),cp("\\providecommand",(e=>am(e,!0,!0))),cp("\\message",(e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map((e=>e.text)).join("")),""})),cp("\\errmessage",(e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map((e=>e.text)).join("")),""})),cp("\\show",(e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),em[n],Fu.math[n],Fu.text[n]),""})),cp("\\bgroup","{"),cp("\\egroup","}"),
|
|
434
|
+
cp("~","\\nobreakspace"),cp("\\lq","`"),cp("\\rq","'"),cp("\\aa","\\r a"),cp("\\AA","\\r A"),cp("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),cp("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),cp("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),cp("ℬ","\\mathscr{B}"),cp("ℰ","\\mathscr{E}"),cp("ℱ","\\mathscr{F}"),cp("ℋ","\\mathscr{H}"),cp("ℐ","\\mathscr{I}"),cp("ℒ","\\mathscr{L}"),cp("ℳ","\\mathscr{M}"),cp("ℛ","\\mathscr{R}"),cp("ℭ","\\mathfrak{C}"),cp("ℌ","\\mathfrak{H}"),cp("ℨ","\\mathfrak{Z}"),cp("\\Bbbk","\\Bbb{k}"),cp("·","\\cdotp"),cp("\\llap","\\mathllap{\\textrm{#1}}"),cp("\\rlap","\\mathrlap{\\textrm{#1}}"),cp("\\clap","\\mathclap{\\textrm{#1}}"),cp("\\mathstrut","\\vphantom{(}"),cp("\\underbar","\\underline{\\text{#1}}"),cp("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),cp("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),cp("\\ne","\\neq"),cp("≠","\\neq"),
|
|
435
|
+
cp("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),cp("∉","\\notin"),cp("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),cp("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),cp("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),cp("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),cp("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),cp("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),cp("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),cp("⟂","\\perp"),cp("‼","\\mathclose{!\\mkern-0.8mu!}"),cp("∌","\\notni"),cp("⌜","\\ulcorner"),cp("⌝","\\urcorner"),cp("⌞","\\llcorner"),cp("⌟","\\lrcorner"),cp("©","\\copyright"),cp("®","\\textregistered"),cp("️","\\textregistered"),cp("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),
|
|
436
|
+
cp("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),cp("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),cp("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),cp("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),cp("⋮","\\vdots"),cp("\\varGamma","\\mathit{\\Gamma}"),cp("\\varDelta","\\mathit{\\Delta}"),cp("\\varTheta","\\mathit{\\Theta}"),cp("\\varLambda","\\mathit{\\Lambda}"),cp("\\varXi","\\mathit{\\Xi}"),cp("\\varPi","\\mathit{\\Pi}"),cp("\\varSigma","\\mathit{\\Sigma}"),cp("\\varUpsilon","\\mathit{\\Upsilon}"),cp("\\varPhi","\\mathit{\\Phi}"),cp("\\varPsi","\\mathit{\\Psi}"),cp("\\varOmega","\\mathit{\\Omega}"),cp("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),cp("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),cp("\\boxed","\\fbox{$\\displaystyle{#1}$}"),cp("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),cp("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),
|
|
437
|
+
cp("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var sm={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi",
|
|
438
|
+
"\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};cp("\\dots",(function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in sm?t=sm[n]:("\\not"===n.substr(0,4)||n in Fu.math&&Vc.contains(["bin","rel"],Fu.math[n].group))&&(t="\\dotsb"),t}));var lm={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};cp("\\dotso",(function(e){return e.future().text in lm?"\\ldots\\,":"\\ldots"})),cp("\\dotsc",(function(e){var t=e.future().text;return t in lm&&","!==t?"\\ldots\\,":"\\ldots"})),cp("\\cdots",(function(e){return e.future().text in lm?"\\@cdots\\,":"\\@cdots"})),cp("\\dotsb","\\cdots"),cp("\\dotsm","\\cdots"),cp("\\dotsi","\\!\\cdots"),cp("\\dotsx","\\ldots\\,"),cp("\\DOTSI","\\relax"),cp("\\DOTSB","\\relax"),cp("\\DOTSX","\\relax"),cp("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),cp("\\,","\\tmspace+{3mu}{.1667em}"),cp("\\thinspace","\\,"),
|
|
439
|
+
cp("\\>","\\mskip{4mu}"),cp("\\:","\\tmspace+{4mu}{.2222em}"),cp("\\medspace","\\:"),cp("\\;","\\tmspace+{5mu}{.2777em}"),cp("\\thickspace","\\;"),cp("\\!","\\tmspace-{3mu}{.1667em}"),cp("\\negthinspace","\\!"),cp("\\negmedspace","\\tmspace-{4mu}{.2222em}"),cp("\\negthickspace","\\tmspace-{5mu}{.277em}"),cp("\\enspace","\\kern.5em "),cp("\\enskip","\\hskip.5em\\relax"),cp("\\quad","\\hskip1em\\relax"),cp("\\qquad","\\hskip2em\\relax"),cp("\\tag","\\@ifstar\\tag@literal\\tag@paren"),cp("\\tag@paren","\\tag@literal{({#1})}"),cp("\\tag@literal",(e=>{if(e.macros.get("\\df@tag"))throw new Uc("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"})),cp("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),cp("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),cp("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),
|
|
440
|
+
cp("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),cp("\\pmb","\\html@mathml{\\@binrel{#1}{\\mathrlap{#1}\\kern0.5px#1}}{\\mathbf{#1}}"),cp("\\newline","\\\\\\relax"),cp("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var cm=ku(uu["Main-Regular"]["T".charCodeAt(0)][1]-.7*uu["Main-Regular"]["A".charCodeAt(0)][1]);cp("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+cm+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),cp("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+cm+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),cp("\\hspace","\\@ifstar\\@hspacer\\@hspace"),cp("\\@hspace","\\hskip #1\\relax"),cp("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),cp("\\ordinarycolon",":"),cp("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),cp("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),
|
|
441
|
+
cp("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),cp("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),cp("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),cp("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),cp("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),cp("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),cp("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),cp("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),
|
|
442
|
+
cp("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),cp("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),cp("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),cp("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),cp("∷","\\dblcolon"),cp("∹","\\eqcolon"),cp("≔","\\coloneqq"),cp("≕","\\eqqcolon"),cp("⩴","\\Coloneqq"),cp("\\ratio","\\vcentcolon"),cp("\\coloncolon","\\dblcolon"),cp("\\colonequals","\\coloneqq"),cp("\\coloncolonequals","\\Coloneqq"),cp("\\equalscolon","\\eqqcolon"),cp("\\equalscoloncolon","\\Eqqcolon"),cp("\\colonminus","\\coloneq"),cp("\\coloncolonminus","\\Coloneq"),cp("\\minuscolon","\\eqcolon"),cp("\\minuscoloncolon","\\Eqcolon"),cp("\\coloncolonapprox","\\Colonapprox"),cp("\\coloncolonsim","\\Colonsim"),
|
|
443
|
+
cp("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),cp("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),cp("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),cp("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),cp("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),cp("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),cp("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),cp("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),cp("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),cp("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),cp("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),cp("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),cp("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),cp("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),cp("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),cp("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),
|
|
444
|
+
cp("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),cp("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),cp("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),cp("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),cp("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),cp("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),cp("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),cp("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),cp("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),cp("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),cp("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),cp("\\imath","\\html@mathml{\\@imath}{ı}"),cp("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),cp("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),cp("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),cp("⟦","\\llbracket"),cp("⟧","\\rrbracket"),cp("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),
|
|
445
|
+
cp("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),cp("⦃","\\lBrace"),cp("⦄","\\rBrace"),cp("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),cp("⦵","\\minuso"),cp("\\darr","\\downarrow"),cp("\\dArr","\\Downarrow"),cp("\\Darr","\\Downarrow"),cp("\\lang","\\langle"),cp("\\rang","\\rangle"),cp("\\uarr","\\uparrow"),cp("\\uArr","\\Uparrow"),cp("\\Uarr","\\Uparrow"),cp("\\N","\\mathbb{N}"),cp("\\R","\\mathbb{R}"),cp("\\Z","\\mathbb{Z}"),cp("\\alef","\\aleph"),cp("\\alefsym","\\aleph"),cp("\\Alpha","\\mathrm{A}"),cp("\\Beta","\\mathrm{B}"),cp("\\bull","\\bullet"),cp("\\Chi","\\mathrm{X}"),cp("\\clubs","\\clubsuit"),cp("\\cnums","\\mathbb{C}"),cp("\\Complex","\\mathbb{C}"),cp("\\Dagger","\\ddagger"),cp("\\diamonds","\\diamondsuit"),cp("\\empty","\\emptyset"),cp("\\Epsilon","\\mathrm{E}"),cp("\\Eta","\\mathrm{H}"),cp("\\exist","\\exists"),cp("\\harr","\\leftrightarrow"),
|
|
446
|
+
cp("\\hArr","\\Leftrightarrow"),cp("\\Harr","\\Leftrightarrow"),cp("\\hearts","\\heartsuit"),cp("\\image","\\Im"),cp("\\infin","\\infty"),cp("\\Iota","\\mathrm{I}"),cp("\\isin","\\in"),cp("\\Kappa","\\mathrm{K}"),cp("\\larr","\\leftarrow"),cp("\\lArr","\\Leftarrow"),cp("\\Larr","\\Leftarrow"),cp("\\lrarr","\\leftrightarrow"),cp("\\lrArr","\\Leftrightarrow"),cp("\\Lrarr","\\Leftrightarrow"),cp("\\Mu","\\mathrm{M}"),cp("\\natnums","\\mathbb{N}"),cp("\\Nu","\\mathrm{N}"),cp("\\Omicron","\\mathrm{O}"),cp("\\plusmn","\\pm"),cp("\\rarr","\\rightarrow"),cp("\\rArr","\\Rightarrow"),cp("\\Rarr","\\Rightarrow"),cp("\\real","\\Re"),cp("\\reals","\\mathbb{R}"),cp("\\Reals","\\mathbb{R}"),cp("\\Rho","\\mathrm{P}"),cp("\\sdot","\\cdot"),cp("\\sect","\\S"),cp("\\spades","\\spadesuit"),cp("\\sub","\\subset"),cp("\\sube","\\subseteq"),cp("\\supe","\\supseteq"),cp("\\Tau","\\mathrm{T}"),cp("\\thetasym","\\vartheta"),cp("\\weierp","\\wp"),cp("\\Zeta","\\mathrm{Z}"),cp("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),
|
|
447
|
+
cp("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),cp("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),cp("\\bra","\\mathinner{\\langle{#1}|}"),cp("\\ket","\\mathinner{|{#1}\\rangle}"),cp("\\braket","\\mathinner{\\langle{#1}\\rangle}"),cp("\\Bra","\\left\\langle#1\\right|"),cp("\\Ket","\\left|#1\\right\\rangle");var um=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,o=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.macros.get("|"),s=t.macros.get("\\|");t.macros.beginGroup();var l=t=>n=>{e&&(n.macros.set("|",a),o.length&&n.macros.set("\\|",s));var i=t;!t&&o.length&&("|"===n.future().text&&(n.popToken(),i=!0));return{tokens:i?o:r,numArgs:0}};t.macros.set("|",l(!1)),o.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,u=t.expandTokens([...i,...c,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};cp("\\bra@ket",um(!1)),cp("\\bra@set",um(!0)),cp("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),
|
|
448
|
+
cp("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),cp("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),cp("\\angln","{\\angl n}"),cp("\\blue","\\textcolor{##6495ed}{#1}"),cp("\\orange","\\textcolor{##ffa500}{#1}"),cp("\\pink","\\textcolor{##ff00af}{#1}"),cp("\\red","\\textcolor{##df0030}{#1}"),cp("\\green","\\textcolor{##28ae7b}{#1}"),cp("\\gray","\\textcolor{gray}{#1}"),cp("\\purple","\\textcolor{##9d38bd}{#1}"),cp("\\blueA","\\textcolor{##ccfaff}{#1}"),cp("\\blueB","\\textcolor{##80f6ff}{#1}"),cp("\\blueC","\\textcolor{##63d9ea}{#1}"),cp("\\blueD","\\textcolor{##11accd}{#1}"),cp("\\blueE","\\textcolor{##0c7f99}{#1}"),cp("\\tealA","\\textcolor{##94fff5}{#1}"),cp("\\tealB","\\textcolor{##26edd5}{#1}"),cp("\\tealC","\\textcolor{##01d1c1}{#1}"),cp("\\tealD","\\textcolor{##01a995}{#1}"),cp("\\tealE","\\textcolor{##208170}{#1}"),cp("\\greenA","\\textcolor{##b6ffb0}{#1}"),cp("\\greenB","\\textcolor{##8af281}{#1}"),cp("\\greenC","\\textcolor{##74cf70}{#1}"),
|
|
449
|
+
cp("\\greenD","\\textcolor{##1fab54}{#1}"),cp("\\greenE","\\textcolor{##0d923f}{#1}"),cp("\\goldA","\\textcolor{##ffd0a9}{#1}"),cp("\\goldB","\\textcolor{##ffbb71}{#1}"),cp("\\goldC","\\textcolor{##ff9c39}{#1}"),cp("\\goldD","\\textcolor{##e07d10}{#1}"),cp("\\goldE","\\textcolor{##a75a05}{#1}"),cp("\\redA","\\textcolor{##fca9a9}{#1}"),cp("\\redB","\\textcolor{##ff8482}{#1}"),cp("\\redC","\\textcolor{##f9685d}{#1}"),cp("\\redD","\\textcolor{##e84d39}{#1}"),cp("\\redE","\\textcolor{##bc2612}{#1}"),cp("\\maroonA","\\textcolor{##ffbde0}{#1}"),cp("\\maroonB","\\textcolor{##ff92c6}{#1}"),cp("\\maroonC","\\textcolor{##ed5fa6}{#1}"),cp("\\maroonD","\\textcolor{##ca337c}{#1}"),cp("\\maroonE","\\textcolor{##9e034e}{#1}"),cp("\\purpleA","\\textcolor{##ddd7ff}{#1}"),cp("\\purpleB","\\textcolor{##c6b9fc}{#1}"),cp("\\purpleC","\\textcolor{##aa87ff}{#1}"),cp("\\purpleD","\\textcolor{##7854ab}{#1}"),cp("\\purpleE","\\textcolor{##543b78}{#1}"),cp("\\mintA","\\textcolor{##f5f9e8}{#1}"),
|
|
450
|
+
cp("\\mintB","\\textcolor{##edf2df}{#1}"),cp("\\mintC","\\textcolor{##e0e5cc}{#1}"),cp("\\grayA","\\textcolor{##f6f7f7}{#1}"),cp("\\grayB","\\textcolor{##f0f1f2}{#1}"),cp("\\grayC","\\textcolor{##e3e5e6}{#1}"),cp("\\grayD","\\textcolor{##d6d8da}{#1}"),cp("\\grayE","\\textcolor{##babec2}{#1}"),cp("\\grayF","\\textcolor{##888d93}{#1}"),cp("\\grayG","\\textcolor{##626569}{#1}"),cp("\\grayH","\\textcolor{##3b3e40}{#1}"),cp("\\grayI","\\textcolor{##21242c}{#1}"),cp("\\kaBlue","\\textcolor{##314453}{#1}"),cp("\\kaGreen","\\textcolor{##71B307}{#1}");var hm={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class dm{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new rm(om,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new nm(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){
|
|
451
|
+
this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:r,end:n}=this.consumeArg(["]"]))}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new jc("EOF",n.loc)),this.pushTokens(r),t.range(n,"")}consumeSpaces(){for(;;){if(" "!==this.future().text)break;this.stack.pop()}}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r,o=this.future(),i=0,a=0;do{if(r=this.popToken(),t.push(r),"{"===r.text)++i;else if("}"===r.text){if(-1===--i)throw new Uc("Extra }",r)}else if("EOF"===r.text)throw new Uc("Unexpected end of input in a macro argument, expected '"+(e&&n?e[a]:"}")+"'",r);if(e&&n)if((0===i||1===i&&"{"===e[a])&&r.text===e[a]){if(++a===e.length){t.splice(-a,a);break}}else a=0
|
|
452
|
+
}while(0!==i||n);return"{"===o.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:o,end:r}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new Uc("The length of delimiters doesn't match the number of args!");for(var n=t[0],r=0;r<n.length;r++){var o=this.popToken();if(n[r]!==o.text)throw new Uc("Use of the macro doesn't match its definition",o)}}for(var i=[],a=0;a<e;a++)i.push(this.consumeArg(t&&t[a+1]).tokens);return i}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(null==r||e&&r.unexpandable){if(e&&null==r&&"\\"===n[0]&&!this.isDefined(n))throw new Uc("Undefined control sequence: "+n);return this.pushToken(t),t}if(this.expansionCount++,this.expansionCount>this.settings.maxExpand)throw new Uc("Too many expansions: infinite loop or need to increase maxExpand setting");var o=r.tokens,i=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs)for(var a=(o=o.slice()).length-1;a>=0;--a){var s=o[a];if("#"===s.text){
|
|
453
|
+
if(0===a)throw new Uc("Incomplete placeholder at end of macro body",s);if("#"===(s=o[--a]).text)o.splice(a+1,1);else{if(!/^[1-9]$/.test(s.text))throw new Uc("Not a valid argument number",s);o.splice(a,2,...i[+s.text-1])}}}return this.pushTokens(o),o}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;){var e=this.expandOnce();if(e instanceof jc)return e.treatAsRelax&&(e.text="\\relax"),this.stack.pop()}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new jc(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;){var r=this.expandOnce(!0);r instanceof jc&&(r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),t.push(this.stack.pop()))}return t}expandMacroAsText(e){var t=this.expandMacro(e);return t?t.map((e=>e.text)).join(""):t}_getExpansion(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var n=this.lexer.catcodes[e];if(null!=n&&13!==n)return}var r="function"==typeof t?t(this):t
|
|
454
|
+
;if("string"==typeof r){var o=0;if(-1!==r.indexOf("#"))for(var i=r.replace(/##/g,"");-1!==i.indexOf("#"+(o+1));)++o;for(var a=new nm(r,this.settings),s=[],l=a.lex();"EOF"!==l.text;)s.push(l),l=a.lex();return s.reverse(),{tokens:s,numArgs:o}}return r}isDefined(e){return this.macros.has(e)||em.hasOwnProperty(e)||Fu.math.hasOwnProperty(e)||Fu.text.hasOwnProperty(e)||hm.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:em.hasOwnProperty(e)&&!em[e].primitive}}var pm=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,mm=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8",
|
|
455
|
+
"⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g","ʰ":"h","ⁱ":"i","ʲ":"j","ᵏ":"k","ˡ":"l","ᵐ":"m","ⁿ":"n","ᵒ":"o","ᵖ":"p","ʳ":"r","ˢ":"s","ᵗ":"t","ᵘ":"u","ᵛ":"v","ʷ":"w","ˣ":"x","ʸ":"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),fm={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},gm={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","ḉ":"ḉ","č":"č","ĉ":"ĉ","ċ":"ċ","ç":"ç","ď":"ď",
|
|
456
456
|
"ḋ":"ḋ","ḑ":"ḑ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ḝ":"ḝ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ȩ":"ȩ","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ģ":"ģ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","ḩ":"ḩ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ķ":"ķ","ĺ":"ĺ","ľ":"ľ","ļ":"ļ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ņ":"ņ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ŗ":"ŗ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ş":"ş","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ţ":"ţ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ",
|
|
457
457
|
"ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Ḉ":"Ḉ","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ç":"Ç","Ď":"Ď","Ḋ":"Ḋ","Ḑ":"Ḑ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ḝ":"Ḝ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ȩ":"Ȩ","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ģ":"Ģ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Ḩ":"Ḩ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ķ":"Ķ","Ĺ":"Ĺ","Ľ":"Ľ","Ļ":"Ļ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ņ":"Ņ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō",
|
|
458
|
-
"Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"};class
|
|
459
|
-
this.gullet=new
|
|
460
|
-
;if(t&&r.text===t)break;if(e&&
|
|
461
|
-
;return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t,n,r=this.parseGroup("atom",e);if("text"===this.mode)return r;for(;;){this.consumeSpaces();var o=this.fetch();if("\\limits"===o.text||"\\nolimits"===o.text){if(r&&"op"===r.type){var i="\\limits"===o.text;r.limits=i,r.alwaysHandleSupSub=!0}else{if(!r||"operatorname"!==r.type)throw new
|
|
462
|
-
if(!
|
|
463
|
-
parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(0===n)return{args:[],optArgs:[]};for(var r=[],o=[],i=0;i<n;i++){var a=t.argTypes&&t.argTypes[i],s=i<t.numOptionalArgs;(t.primitive&&null==a||"sqrt"===t.type&&1===i&&null==o[0])&&(a="primitive");var l=this.parseGroupOfType("argument to '"+e+"'",a,s);if(s)o.push(l);else{if(null==l)throw new
|
|
464
|
-
;if(null==i)throw new
|
|
465
|
-
!(t=e||"{"===this.gullet.future().text?this.parseStringGroup("size",e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new
|
|
466
|
-
mode:this.mode,loc:n.loc,body:o};return t&&this.switchMode(r),i}parseGroup(e,t){var n,r=this.fetch(),o=r.text;if("{"===o||"\\begingroup"===o){this.consume();var i="{"===o?"}":"\\endgroup";this.gullet.beginGroup();var a=this.parseExpression(!1,i),s=this.fetch();this.expect(i),this.gullet.endGroup(),n={type:"ordgroup",mode:this.mode,loc:
|
|
467
|
-
text:o+o}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r="*"===n.charAt(0);if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new
|
|
468
|
-
type:s,mode:this.mode,loc:l,text:t};o=a}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(
|
|
469
|
-
;if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new
|
|
470
|
-
return
|
|
458
|
+
"Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"};class vm{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",
|
|
459
|
+
this.gullet=new dm(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new Uc("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new jc("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){"math"===this.mode&&this.consumeSpaces();var r=this.fetch();if(-1!==vm.endOfExpression.indexOf(r.text))break
|
|
460
|
+
;if(t&&r.text===t)break;if(e&&em[r.text]&&em[r.text].infix)break;var o=this.parseAtom(t);if(!o)break;"internal"!==o.type&&n.push(o)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t,n=-1,r=0;r<e.length;r++)if("infix"===e[r].type){if(-1!==n)throw new Uc("only one infix operator per group",e[r].token);n=r,t=e[r].replaceWith}if(-1!==n&&t){var o,i,a=e.slice(0,n),s=e.slice(n+1);return o=1===a.length&&"ordgroup"===a[0].type?a[0]:{type:"ordgroup",mode:this.mode,body:a},i=1===s.length&&"ordgroup"===s[0].type?s[0]:{type:"ordgroup",mode:this.mode,body:s},["\\\\abovefrac"===t?this.callFunction(t,[o,e[n],i],[]):this.callFunction(t,[o,i],[])]}return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r=this.parseGroup(e);if(!r)throw new Uc("Expected group after '"+n+"'",t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var r={type:"text",mode:this.mode,body:t}
|
|
461
|
+
;return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t,n,r=this.parseGroup("atom",e);if("text"===this.mode)return r;for(;;){this.consumeSpaces();var o=this.fetch();if("\\limits"===o.text||"\\nolimits"===o.text){if(r&&"op"===r.type){var i="\\limits"===o.text;r.limits=i,r.alwaysHandleSupSub=!0}else{if(!r||"operatorname"!==r.type)throw new Uc("Limit controls must follow a math operator",o);r.alwaysHandleSupSub&&(r.limits="\\limits"===o.text)}this.consume()}else if("^"===o.text){if(t)throw new Uc("Double superscript",o);t=this.handleSupSubscript("superscript")}else if("_"===o.text){if(n)throw new Uc("Double subscript",o);n=this.handleSupSubscript("subscript")}else if("'"===o.text){if(t)throw new Uc("Double superscript",o);var a={type:"textord",mode:this.mode,text:"\\prime"},s=[a];for(this.consume();"'"===this.fetch().text;)s.push(a),this.consume();"^"===this.fetch().text&&s.push(this.handleSupSubscript("superscript")),t={type:"ordgroup",mode:this.mode,body:s}}else{
|
|
462
|
+
if(!mm[o.text])break;var l=mm[o.text],c=pm.test(o.text);for(this.consume();;){var u=this.fetch().text;if(!mm[u])break;if(pm.test(u)!==c)break;this.consume(),l+=mm[u]}var h=new vm(l,this.settings).parse();c?n={type:"ordgroup",mode:"math",body:h}:t={type:"ordgroup",mode:"math",body:h}}}return t||n?{type:"supsub",mode:this.mode,base:r,sup:t,sub:n}:r}parseFunction(e,t){var n=this.fetch(),r=n.text,o=em[r];if(!o)return null;if(this.consume(),t&&"atom"!==t&&!o.allowedInArgument)throw new Uc("Got function '"+r+"' with no arguments"+(t?" as "+t:""),n);if("text"===this.mode&&!o.allowedInText)throw new Uc("Can't use function '"+r+"' in text mode",n);if("math"===this.mode&&!1===o.allowedInMath)throw new Uc("Can't use function '"+r+"' in math mode",n);var{args:i,optArgs:a}=this.parseArguments(r,o);return this.callFunction(r,i,a,n,e)}callFunction(e,t,n,r,o){var i={funcName:e,parser:this,token:r,breakOnTokenText:o},a=em[e];if(a&&a.handler)return a.handler(i,t,n);throw new Uc("No function handler for "+e)}
|
|
463
|
+
parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(0===n)return{args:[],optArgs:[]};for(var r=[],o=[],i=0;i<n;i++){var a=t.argTypes&&t.argTypes[i],s=i<t.numOptionalArgs;(t.primitive&&null==a||"sqrt"===t.type&&1===i&&null==o[0])&&(a="primitive");var l=this.parseGroupOfType("argument to '"+e+"'",a,s);if(s)o.push(l);else{if(null==l)throw new Uc("Null argument, please report this as a bug");r.push(l)}}return{args:r,optArgs:o}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":var r=this.parseArgumentGroup(n,"text");return null!=r?{type:"styling",mode:r.mode,body:[r],style:"text"}:null;case"raw":var o=this.parseStringGroup("raw",n);return null!=o?{type:"raw",mode:"text",string:o.text}:null;case"primitive":if(n)throw new Uc("A primitive argument cannot be optional");var i=this.parseGroup(e)
|
|
464
|
+
;if(null==i)throw new Uc("Expected group as "+e,this.fetch());return i;case"original":case null:case void 0:return this.parseArgumentGroup(n);default:throw new Uc("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;" "===this.fetch().text;)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(null==n)return null;for(var r,o="";"EOF"!==(r=this.fetch()).text;)o+=r.text,this.consume();return this.consume(),n.text=o,n}parseRegexGroup(e,t){for(var n,r=this.fetch(),o=r,i="";"EOF"!==(n=this.fetch()).text&&e.test(i+n.text);)i+=(o=n).text,this.consume();if(""===i)throw new Uc("Invalid "+t+": '"+r.text+"'",r);return r.range(o,i)}parseColorGroup(e){var t=this.parseStringGroup("color",e);if(null==t)return null;var n=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new Uc("Invalid color: '"+t.text+"'",t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r="#"+r),{type:"color-token",mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),
|
|
465
|
+
!(t=e||"{"===this.gullet.future().text?this.parseStringGroup("size",e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new Uc("Invalid size: '"+t.text+"'",t);var o={number:+(r[1]+r[2]),unit:r[3]};if(!wu(o))throw new Uc("Invalid unit: '"+o.unit+"'",t);return{type:"size",mode:this.mode,value:o,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==t)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(null==n)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var o=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var i={type:"ordgroup",
|
|
466
|
+
mode:this.mode,loc:n.loc,body:o};return t&&this.switchMode(r),i}parseGroup(e,t){var n,r=this.fetch(),o=r.text;if("{"===o||"\\begingroup"===o){this.consume();var i="{"===o?"}":"\\endgroup";this.gullet.beginGroup();var a=this.parseExpression(!1,i),s=this.fetch();this.expect(i),this.gullet.endGroup(),n={type:"ordgroup",mode:this.mode,loc:Fc.range(r,s),body:a,semisimple:"\\begingroup"===o||void 0}}else if(null==(n=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===o[0]&&!hm.hasOwnProperty(o)){if(this.settings.throwOnError)throw new Uc("Undefined control sequence: "+o,r);n=this.formatUnsupportedCmd(o),this.consume()}return n}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n],o=r.text;"-"===o&&"-"===e[n+1].text&&(n+1<t&&"-"===e[n+2].text?(e.splice(n,3,{type:"textord",mode:"text",loc:Fc.range(r,e[n+2]),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:Fc.range(r,e[n+1]),text:"--"}),t-=1)),"'"!==o&&"`"!==o||e[n+1].text!==o||(e.splice(n,2,{type:"textord",mode:"text",loc:Fc.range(r,e[n+1]),
|
|
467
|
+
text:o+o}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r="*"===n.charAt(0);if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new Uc("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:r}}gm.hasOwnProperty(t[0])&&!Fu[this.mode][t[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=gm[t[0]]+t.substr(1));var o,i=tm.exec(t);if(i&&("i"===(t=t.substring(0,i.index))?t="ı":"j"===t&&(t="ȷ")),Fu[this.mode][t]){this.settings.strict&&"math"===this.mode&&"ÐÞþ".indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var a,s=Fu[this.mode][t].group,l=Fc.range(e);if(Pu.hasOwnProperty(s)){var c=s;a={type:"atom",mode:this.mode,family:c,loc:l,text:t}}else a={
|
|
468
|
+
type:s,mode:this.mode,loc:l,text:t};o=a}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(su(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),o={type:"textord",mode:"text",loc:Fc.range(e),text:t}}if(this.consume(),i)for(var u=0;u<i[0].length;u++){var h=i[0][u];if(!fm[h])throw new Uc("Unknown accent ' "+h+"'",e);var d=fm[h][this.mode]||fm[h].text;if(!d)throw new Uc("Accent "+h+" unsupported in "+this.mode+" mode",e);o={type:"accent",mode:this.mode,loc:Fc.range(e),label:d,isStretchy:!1,isShifty:!0,base:o}}return o}}vm.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var _m=function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new vm(e,t);delete n.gullet.macros.current["\\df@tag"];var r=n.parse()
|
|
469
|
+
;if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new Uc("\\tag works only in display equations");r=[{type:"tag",mode:"text",body:r,tag:n.subparse([new jc("\\df@tag")])}]}return r};"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&("undefined"!=typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."));var bm=function(e,t,n){if(n.throwOnError||!(e instanceof Uc))throw e;var r=Eh.makeSpan(["katex-error"],[new zu(t)]);return r.setAttribute("title",e.toString()),r.setAttribute("style","color:"+n.errorColor),r},ym=function(e,t){var n=new Kc(t);try{return function(e,t,n){var r,o=ud(n);if("mathml"===n.output)return cd(e,t,o,n.displayMode,!0);if("html"===n.output){var i=Jh(e,o);r=Eh.makeSpan(["katex"],[i])}else{var a=cd(e,t,o,n.displayMode,!1),s=Jh(e,o);r=Eh.makeSpan(["katex"],[a,s])}return hd(r,n)}(_m(e,n),e,n)}catch(t){
|
|
470
|
+
return bm(t,e,n)}},wm=function(e,t){return ym(e,t).toMarkup()},xm={exports:{}};!function(e){(function(){function t(e){var t={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,
|
|
471
471
|
describe:"Remove only spaces, ' and \" from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids",type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},
|
|
472
472
|
tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,describe:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,describe:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,describe:"Parses simple line breaks as <br> (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,describe:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,describe:"Enables github @mentions",type:"boolean"},ghMentionsLink:{
|
|
473
473
|
defaultValue:"https://github.com/{u}",describe:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,describe:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,describe:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,describe:"Support for HTML Tag escaping. ex: <div>foo</div>",type:"boolean"},emoji:{defaultValue:!1,describe:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,describe:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",type:"boolean"},ellipsis:{defaultValue:!0,describe:"Replaces three dots with the ellipsis unicode character",type:"boolean"},completeHTMLDocument:{
|
|
@@ -538,118 +538,118 @@ var o=new Array(r+1).join("#"),i="";if(e.hasChildNodes()){i=o+" ";for(var a=e.ch
|
|
|
538
538
|
r||(o=n.subParser("makeMarkdown.header")(e,t,4)+"\n\n");break;case"h5":r||(o=n.subParser("makeMarkdown.header")(e,t,5)+"\n\n");break;case"h6":r||(o=n.subParser("makeMarkdown.header")(e,t,6)+"\n\n");break;case"p":r||(o=n.subParser("makeMarkdown.paragraph")(e,t)+"\n\n");break;case"blockquote":r||(o=n.subParser("makeMarkdown.blockquote")(e,t)+"\n\n");break;case"hr":r||(o=n.subParser("makeMarkdown.hr")(e,t)+"\n\n");break;case"ol":r||(o=n.subParser("makeMarkdown.list")(e,t,"ol")+"\n\n");break;case"ul":r||(o=n.subParser("makeMarkdown.list")(e,t,"ul")+"\n\n");break;case"precode":r||(o=n.subParser("makeMarkdown.codeBlock")(e,t)+"\n\n");break;case"pre":r||(o=n.subParser("makeMarkdown.pre")(e,t)+"\n\n");break;case"table":r||(o=n.subParser("makeMarkdown.table")(e,t)+"\n\n");break;case"code":o=n.subParser("makeMarkdown.codeSpan")(e,t);break;case"em":case"i":o=n.subParser("makeMarkdown.emphasis")(e,t);break;case"strong":case"b":o=n.subParser("makeMarkdown.strong")(e,t);break;case"del":
|
|
539
539
|
o=n.subParser("makeMarkdown.strikethrough")(e,t);break;case"a":o=n.subParser("makeMarkdown.links")(e,t);break;case"img":o=n.subParser("makeMarkdown.image")(e,t);break;default:o=e.outerHTML+"\n\n"}return o})),n.subParser("makeMarkdown.paragraph",(function(e,t){var r="";if(e.hasChildNodes())for(var o=e.childNodes,i=o.length,a=0;a<i;++a)r+=n.subParser("makeMarkdown.node")(o[a],t);return r=r.trim()})),n.subParser("makeMarkdown.pre",(function(e,t){var n=e.getAttribute("prenum");return"<pre>"+t.preList[n]+"</pre>"})),n.subParser("makeMarkdown.strikethrough",(function(e,t){var r="";if(e.hasChildNodes()){r+="~~";for(var o=e.childNodes,i=o.length,a=0;a<i;++a)r+=n.subParser("makeMarkdown.node")(o[a],t);r+="~~"}return r})),n.subParser("makeMarkdown.strong",(function(e,t){var r="";if(e.hasChildNodes()){r+="**";for(var o=e.childNodes,i=o.length,a=0;a<i;++a)r+=n.subParser("makeMarkdown.node")(o[a],t);r+="**"}return r})),n.subParser("makeMarkdown.table",(function(e,t){
|
|
540
540
|
var r,o,i="",a=[[],[]],s=e.querySelectorAll("thead>tr>th"),l=e.querySelectorAll("tbody>tr");for(r=0;r<s.length;++r){var c=n.subParser("makeMarkdown.tableCell")(s[r],t),u="---";if(s[r].hasAttribute("style"))switch(s[r].getAttribute("style").toLowerCase().replace(/\s/g,"")){case"text-align:left;":u=":---";break;case"text-align:right;":u="---:";break;case"text-align:center;":u=":---:"}a[0][r]=c.trim(),a[1][r]=u}for(r=0;r<l.length;++r){var h=a.push([])-1,d=l[r].getElementsByTagName("td");for(o=0;o<s.length;++o){var p=" ";void 0!==d[o]&&(p=n.subParser("makeMarkdown.tableCell")(d[o],t)),a[h].push(p)}}var m=3;for(r=0;r<a.length;++r)for(o=0;o<a[r].length;++o){var f=a[r][o].length;f>m&&(m=f)}for(r=0;r<a.length;++r){for(o=0;o<a[r].length;++o)1===r?":"===a[r][o].slice(-1)?a[r][o]=n.helper.padEnd(a[r][o].slice(-1),m-1,"-")+":":a[r][o]=n.helper.padEnd(a[r][o],m,"-"):a[r][o]=n.helper.padEnd(a[r][o],m);i+="| "+a[r].join(" | ")+" |\n"}return i.trim()})),n.subParser("makeMarkdown.tableCell",(function(e,t){var r=""
|
|
541
|
-
;if(!e.hasChildNodes())return"";for(var o=e.childNodes,i=o.length,a=0;a<i;++a)r+=n.subParser("makeMarkdown.node")(o[a],t,!0);return r.trim()})),n.subParser("makeMarkdown.txt",(function(e){var t=e.nodeValue;return t=(t=t.replace(/ +/g," ")).replace(/¨NBSP;/g," "),t=(t=(t=(t=(t=(t=(t=(t=(t=n.helper.unescapeHTMLEntities(t)).replace(/([*_~|`])/g,"\\$1")).replace(/^(\s*)>/g,"\\$1>")).replace(/^#/gm,"\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3")).replace(/^( {0,3}\d+)\./gm,"$1\\.")).replace(/^( {0,3})([+-])/gm,"$1\\$2")).replace(/]([\s]*)\(/g,"\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:")}));e.exports?e.exports=n:this.showdown=n}).call(V)}(
|
|
542
|
-
;if(-1!==e&&(-1===o||e<o)?(i=e,a=r.indexOf("$$",i+2)):(i=o,a=r.indexOf("\\)",i+2)),-1===a)break;a+=2;const s=t.length+1,l=
|
|
543
|
-
;n&&(t?n.className=t:n.style.width="350px")}}(o.current,{className:"w-full md:w-[380px]"})}),[e]),so("div",{className:"w-full break-words cursor-text",children:so(
|
|
544
|
-
className:Pr("px-1.5 py-1 touch:p-2","border-l rounded-sm rounded-l-none","text-grey-6 hover:text-color-text hover:bg-grey-2","transition-colors duration-200","u-outline-on-keyboard-focus--inset"),onClick:()=>{t(n)},title:`Remove tag: ${n}`,children:so(Ao,{classes:"font-base",name:"cancel",title:`Remove ${n}`})})]})}function
|
|
545
|
-
;const[o,i]=Vr(!0),[a,s]=Vr(!1),l=
|
|
546
|
-
i+=r.length-n):i<=t||(o<=t&&i>=t+n?i+=r.length-n:o<t&&i<t+n?o=t:o<t+n&&i>t+n?i+=r.length-n:t<o&&t+n>i&&(o=t,i=t+n)),{text:e.text.slice(0,t)+r+e.text.slice(t+n),selectionStart:o,selectionEnd:i}}function
|
|
547
|
-
o===t&&i===n?(a=
|
|
548
|
-
classes:"text-tiny touch:text-base",name:t})})}function
|
|
549
|
-
return null!==e.offsetParent&&!("boolean"==typeof(t=e).disabled&&t.disabled);var t})),s=(e=a(),t=-1,n=!1)=>{t<0&&(t=e.findIndex((e=>0===e.tabIndex)))<0&&(t=0);for(let[r,o]of e.entries())o.tabIndex=r===t?0:-1,r===t&&n&&o.focus()};s(a(),0,t);const l=new
|
|
550
|
-
className:Pr("flex flex-wrap w-full items-center","p-1 border-x border-t rounded-t bg-white","touch:h-auto touch:overflow-x-scroll touch:flex-nowrap touch:pb-2.5"),"data-testid":"markdown-toolbar",role:"toolbar","aria-label":"Markdown editor toolbar",ref:r,children:[so(
|
|
551
|
-
iconName:"format-list-unordered",onClick:()=>t("list"),shortcutKey:
|
|
552
|
-
;break;case"italic":n((e=>
|
|
553
|
-
const s=Zr((()=>r.map(((t,r)=>{const a=n?{id:`${n}${r}`}:{};return so("li",{role:"option","aria-selected":(e===r).toString(),className:Pr("flex items-center","border-l-4 py-1 px-3 cursor-pointer hover:bg-grey-2","touch:h-touch-minimum",{"border-brand bg-grey-1":e===r,"border-transparent":e!==r}),onClick:()=>{i(t)},...a,children:o(t,r)},`AutocompleteList-${r}`)}))),[e,n,r,o,i]),l=t?{id:t}:{},c=0===r.length||!a;return so("div",{className:"relative",children:so(bo,{classes:Pr({hidden:c},"absolute top-[3px] z-3","w-auto min-w-[10em] theme-clean:border p-0"),children:[so("ul",{tabIndex:-1,"aria-label":"Suggestions",role:"listbox",...l,children:s}),so(
|
|
554
|
-
},v=t=>{e(t)&&(h(!1),c(-1),g(),i.current.focus())},_=e=>{let t=l+e;t<-1?t=a.length-1:t>=a.length&&(t=-1),c(t)},b=l>=0?`${d}-AutocompleteList-item-${l}`:"";return so("div",{className:"space-y-4",children:[so(
|
|
555
|
-
placeholder:"Add new tags",type:"text",autoComplete:"off","aria-autocomplete":"list","aria-activedescendant":b,"aria-controls":`${d}-AutocompleteList`,dir:"auto"}),so(
|
|
556
|
-
children:"Annotations can be freely reused by anyone for any purpose."})]})})}function
|
|
557
|
-
;function
|
|
558
|
-
className:"flex items-center gap-x-1",children:[a,c&&so("span",{className:Pr({"rotate-180 text-color-text":h}),children:so(Ao,{name:"expand-menu",classes:"w-2.5 h-2.5"})})]})}),h&&so(m,{children:[so(
|
|
559
|
-
overflow:"auto"===r?"visible":"hidden",transition:"height 0.15s ease-in"},children:e})}function
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
className:Pr("flex flex-row rounded-r-sm bg-grey-7 hover:bg-grey-8"),style:s,children:so(
|
|
563
|
-
}),[m,h]),v=Jr((e=>{l.createDraft(t.annotation,{...t,text:e})}),[t,l]),_=Jr((n=>{l.createDraft(e,{...t,isPrivate:n}),
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
displayName:
|
|
569
|
-
const r=`${n?"Show replies":"Hide replies"} (${t})`;return so(go,{onClick:e,title:r,children:r})}function
|
|
570
|
-
children:[n&&so(
|
|
571
|
-
name:e.hidden?"hide":"flag"})}),so("div",{className:"self-center grow",children:[!e.hidden&&so("span",{children:["Flagged for review by ",o," ",1===o?"user":"users"]}),e.hidden&&so("span",{children:"Hidden from users"})]}),so("div",{className:"self-center pr-2",children:so(fo,{classes:"py-1 bg-slate-1",onClick:e.hidden?()=>{const o=e.id;t.annotation.unhide({id:o}).then((()=>{r.unhideAnnotation(o)})).catch((()=>{n.error("Failed to unhide annotation")}))}:()=>{const o=e.id;t.annotation.hide({id:o}).then((()=>{r.hideAnnotation(o)})).catch((()=>{n.error("Failed to hide annotation")}))},title:e.hidden?"Make this annotation visible to everyone":"Hide this annotationn from non-moderators",variant:"dark",children:e.hidden?"Unhide":"Hide"})})]}):null}),["api","toastMessenger"])
|
|
572
|
-
children:so("div",{className:Pr("bg-white"),children:so(mo,{classes:Pr("-mt-1 touch:min-w-[auto] touch:min-h-[auto]"),expanded:!e,icon:n,title:r,onClick:t,size:"medium",variant:"light"})})})}var
|
|
573
|
-
threadIsCollapsed:t.collapsed,onToggleReplies:c}),so("div",{className:Pr("grow max-w-full"),"data-testid":"thread-content",children:[h,
|
|
574
|
-
"data-testid":"thread-card",onClick:e=>{var t;(t=e.target).closest("button")||t.closest("a")||!i||l(i)},onMouseEnter:()=>s(null!=i?i:null),onMouseLeave:()=>s(null),children:c},t.id)}),["frameSync"]);function
|
|
575
|
-
offscreenLowerHeight:h}}(c,i,r,t)),[c,i,r,t]),p=
|
|
576
|
-
title:"annotation"===e?"Annotation unavailable":"Group unavailable",children:[so("p",{children:o?"group"===e?"The current URL links to a group, but that group cannot be found,\n or you do not have permission to view the annotations in that group.":"The current URL links to an annotation, but that annotation\n cannot be found, or you do not have permission to view it.":`The ${e} associated with the current URL is unavailable.\n You may need to log in to see it.`}),so("div",{className:"flex justify-end space-x-2",children:[n&&so(fo,{variant:o?"primary":void 0,onClick:()=>r.clearSelection(),children:"Show all annotations"}),!o&&so(fo,{
|
|
577
|
-
t.id!==r&&n.highlightAnnotations([r]))})).catch((()=>{s(!0)}))}),[r,i,e,n]),so(m,{children:[a&&so(
|
|
578
|
-
const e=
|
|
579
|
-
focusDisplayName:"selection"!==l&&i.active?i.displayName:"",resultCount:c})}),l&&so(fo,{icon:"focus"===l?void 0:"cancel",onClick:"focus"!==l||a?()=>e.clearSelection():()=>e.toggleFocusMode(),title:h,variant:"primary",children:h})]})})})}function
|
|
580
|
-
e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,e.scrollTop=n)}function
|
|
581
|
-
y:o,differenceX:i,differenceY:a}}(t,e),o=Date.now()-t.startTime,i=Math.min(1/t.time*o,1);if(t.endIterations>=n)return
|
|
582
|
-
t.time=isNaN(t.time)?1e3:t.time,t.ease=t.ease||function(e){return 1-Math.pow(1-e,e/2)},t.align=t.align||{};var r=
|
|
583
|
-
maxSynchronousAlignments:h,end:u,scrollAncestor:r},"cancellable"in n&&!n.cancellable||(i=u.bind(null,"canceled"),t.addEventListener("touchstart",i,c),t.addEventListener("wheel",i,c)),a&&
|
|
584
|
-
function
|
|
585
|
-
isWaitingToAnchor:l,isSelected:"note"===o,label:"Page notes",onSelect:()=>c("note"),children:"Page Notes"}),s>0&&so(
|
|
586
|
-
;var
|
|
587
|
-
}),_&&so(
|
|
588
|
-
this.fingerprint=null!==(r=null===(o=t[0])||void 0===o||null===(i=o.metadata)||void 0===i?void 0:i.documentFingerprint)&&void 0!==r?r:a,this.account=s,this.timestamp=(new Date).toString()}asFormattedString(){return`Version: ${this.version}\nUser Agent: ${this.userAgent}\nURL: ${this.urls}\nFingerprint: ${this.fingerprint}\nAccount: ${this.account}\nDate: ${this.timestamp}\n`}asEncodedURLString(){return encodeURIComponent(this.asFormattedString())}}function
|
|
589
|
-
children:["To create a highlight (",so(To,{classes:"underline hover:underline",href:"https://web.hypothes.is/help/why-are-highlights-private-by-default/",target:"_blank",children:"visible only to you"}),"), select text and then select the"," ",so(
|
|
590
|
-
var
|
|
591
|
-
children:so(To,{href:t,classes:"flex items-center justify-center space-x-2 text-color-text-light text-lg font-medium",target:"_blank",children:[so("span",{children:e})," ",so(Ao,{name:"external",classes:"w-3 h-3"})]})})}var
|
|
592
|
-
children:"Getting started"}),"tutorial"===a&&so(
|
|
593
|
-
;var
|
|
594
|
-
;this._incremental?this.emit("results",i):this._results=this._results.concat(i);const a=i.length===r,s=i.length>0?i[i.length-1][this._sortBy]:null;a&&s?this._getPage(e,s,n+1):(this._incremental||this.emit("results",this._results),this.emit("end"))}catch(e){if(this._canceled)return;this.emit("error",e),this.emit("end")}}get(e){this._results=[],this._resultCount=null,this._getPage(e)}cancel(){this._canceled=!0,this.emit("end")}}function
|
|
595
|
-
const e=
|
|
596
|
-
children:[c," ",1===c?"thread":"threads"]})]}),s&&so("h3",{className:"italic font-normal",children:["(and ",e," more)"]}),!t&&a&&so("h3",{className:"italic font-normal",children:["(",i," ",1===i?"annotation":"annotations",")"]})]})}function
|
|
597
|
-
children:null===t?so("div",{"data-testid":"pagination-gap",children:"..."}):so(fo,{classes:"p-navigation-button",title:`Go to page ${t}`,pressed:t===e,onClick:e=>a(t,e.target),variant:"dark",children:t.toString()},`page-${n}`)},n)))}),so("div",{className:Pr("w-28 h-10 flex justify-end","grow md:grow-0"),children:r&&so(fo,{classes:"p-navigation-button",icon:"arrow-right",iconPosition:"right",title:"Go to next page",onClick:t=>a(e+1,t.target),variant:"dark",children:"next"})})]})}function
|
|
598
|
-
;const r=
|
|
599
|
-
"data-testid":"notebook-group-name",children:d})}),so("div",{className:"justify-self-start",children:so(
|
|
600
|
-
currentPage:f,isLoading:l,onChangePage:w,threads:h.children})]})]})}),["loadAnnotationsService","streamer"]);var
|
|
601
|
-
onClick:()=>{try{
|
|
602
|
-
;return so(bo,{classes:Pr("p-0 flex border",{"sr-only":e.visuallyHidden,"border-red-error":"error"===e.type,"border-yellow-notice":"notice"===e.type,"border-green-success":"success"===e.type}),onClick:()=>t(e.id),children:[so("div",{className:Pr("flex items-center p-3 text-white",{"bg-red-error":"error"===e.type,"bg-yellow-notice":"notice"===e.type,"bg-green-success":"success"===e.type}),children:so(Ao,{name:r,classes:Pr("mt-[2px]")})}),so("div",{className:Pr("grow p-3 !mt-0"),"data-testid":"toast-message-text",children:[so("strong",{children:n}),e.message,e.moreInfoURL&&so("div",{className:"text-right",children:so(To,{href:e.moreInfoURL,onClick:e=>e.stopPropagation(),target:"_new",children:"More info"})})]
|
|
603
|
-
"motion-safe:animate-slide-in-from-right lg:animate-fade-in":!t.isDismissed,"motion-reduce:animate-fade-in":!t.isDismissed,"animate-fade-out":t.isDismissed}),children:so(
|
|
604
|
-
className:"border-b",children:x(t).map((e=>so("li",{children:e},e.key)))})]})}var
|
|
605
|
-
isSubmenuItem:!0,label:"Leave group",onClick:async()=>{const e=`Are you sure you want to leave the group "${t.name}"?`;await
|
|
606
|
-
className:Pr("shrink-0 flex items-center gap-x-1 text-lg text-color-text font-bold"),children:[t&&so("img",{className:Pr("relative top-[1px] w-4 h-4"),src:t,alt:n}),i.name]})}else f=so("span",{children:"…"});return!!
|
|
607
|
-
onSubmit:e=>{e.preventDefault(),(o.current.value||i)&&n(o.current.value)},children:[so(
|
|
608
|
-
query:
|
|
609
|
-
}),["frameSync","settings"]);var
|
|
610
|
-
title:"Share annotations on this page"})]}),so(mo,{icon:"help",expanded:p,onClick:()=>{const e=I(a);e&&e.onHelpRequestProvided?t.notifyHost("helpRequested"):u.toggleSidebarPanel("help")},size:"small",title:"Help"}),"logged-in"===e.status?so(
|
|
611
|
-
displayName:n,userid:e.userid,username:t.username}}return{status:"logged-out"}}(s):{status:"unknown"}),[a,s]),u=Zr((()=>
|
|
612
|
-
;if(0===e)return!0;let t="";return 1===e?t="You have an unsaved annotation.\nDo you really want to discard this draft?":e>1&&(t="You have "+e+" unsaved annotations.\nDo you really want to discard these drafts?"),
|
|
613
|
-
const t={},n=this._store.getDraft(e);return n&&(t.tags=n.tags,t.text=n.text,t.permissions=n.isPrivate?
|
|
614
|
-
createPageNote(){const e=this._store.mainFrame();if(!this._store.isLoggedIn())return void this._store.openSidebarPanel("loginPrompt");if(!e)return;const t={target:[],uri:e.uri};this.create(t)}async delete(e){await this._api.annotation.delete({id:e.id}),this._activity.reportActivity("delete",e),this._store.removeAnnotations([e])}async flag(e){await this._api.annotation.flag({id:e.id}),this._activity.reportActivity("flag",e),this._store.updateFlagStatus(e.id,!0)}reply(e,t){const n={group:e.group,permissions:
|
|
615
|
-
return this._store.removeDraft(e),this._store.addAnnotations([o]),o}}
|
|
616
|
-
throw new
|
|
617
|
-
method:c.method})}finally{i()}}}class
|
|
618
|
-
this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var
|
|
619
|
-
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},
|
|
620
|
-
;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var o=this._errors[r],i=o.message,a=(e[i]||0)+1;e[i]=a,a>=n&&(t=o,n=a)}return t},function(e){var t=
|
|
621
|
-
;for(var i=0;i<r.length;i++){var a=r[i],s=t[a];t[a]=function(r){var o=e.operation(n),i=Array.prototype.slice.call(arguments,1),a=i.pop();i.push((function(e){o.retry(e)||(e&&(arguments[0]=o.mainError()),a.apply(this,arguments))})),o.attempt((function(){r.apply(t,i)}))}.bind(t,s),t[a].options=n}}}(
|
|
622
|
-
this.tokenEndpoint=e.tokenEndpoint,this.authorizationEndpoint=e.authorizationEndpoint,this.revokeEndpoint=e.revokeEndpoint}exchangeAuthCode(e){return this._getAccessToken({client_id:this.clientId,grant_type:"authorization_code",code:e})}exchangeGrantToken(e){return this._getAccessToken({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:e})}refreshToken(e){return this._getAccessToken({grant_type:"refresh_token",refresh_token:e})}async revokeToken(e){try{await this._formPost(this.revokeEndpoint,{token:e})}catch(e){throw new
|
|
623
|
-
r.searchParams.set("origin",e.location.origin),r.searchParams.set("response_mode","web_message"),r.searchParams.set("response_type","code"),r.searchParams.set("state",t);const o=`left=${e.screen.width/2-237.5},top=${e.screen.height/2-215},width=475,height=430`;if(!e.open(r.toString(),"Log in to Hypothesis",o))throw new Error("Failed to open login window");return n.then((e=>e.code))}async _formPost(e,t){const n=new URLSearchParams;for(let[e,r]of Object.entries(t))n.set(e,r);n.sort();return
|
|
624
|
-
;return e=e.replace(/\./g,"%2E"),`hypothesis.oauth.${e}.token`}function d(e){n.setObject(h(),e)}const p=async()=>{if(s)return s;const e=await t.links();return s=new
|
|
625
|
-
const e=m();return a=(async(e,t)=>{const n=await p();let r;try{if(r=await n.refreshToken(e),Date.now()>r.expiresAt)throw new Error("Refreshed token expired in the past")}catch{return null}return t.persist&&d(r),r})(t.refreshToken,{persist:void 0===e}),f()}return t.accessToken};(()=>{e.addEventListener("storage",(({key:e})=>{e===h()&&(a=null,this.emit("oauthTokensChanged"))}))})(),this.login=async function(){const t=await p(),n=await t.authorize(e);i=n,a=null},this.logout=async function(){const[e,t]=await Promise.all([a,p()]);e&&await t.revokeToken(e.accessToken),a=Promise.resolve(null),n.removeItem(h())},
|
|
626
|
-
|
|
627
|
-
this._hostFrame.postMessage({frame1:this._source,frame2:e,type:"request",requestId:n},"*")},i=setInterval(o,250),a=setTimeout((()=>{clearInterval(i),r(new Error(`Unable to establish ${this._source}-${e} communication channel`))}),2e4),s=this._listeners.add(window,"message",(r=>{const{data:o,ports:l}=r;
|
|
628
|
-
this._receivedCloseEvent=!1}on(e,t){if(this._port)throw new Error("Cannot add a method handler after a port is connected");this._methods.set(e,t)}connect(e){this._port=e,this._listeners.add(e,"message",(e=>this._handle(e))),e.start(),
|
|
629
|
-
;const r=(...e)=>{const r={arguments:e,protocol:"frame-rpc",response:t.sequence,version:"1.0.0"};n.postMessage(r)};e(...t.arguments,r)}else if("response"in t){const e=this._callbacks.get(t.response);this._callbacks.delete(t.response),e&&e(...t.arguments)}}}function
|
|
630
|
-
|
|
631
|
-
metadata:e.metadata,uri:e.uri})})),t.on("close",(()=>{const e=this._store.frames().find((e=>e.id===n));e&&this._store.destroyFrame(e),t.destroy(),this._guestRPC.delete(n)})),t.on("createAnnotation",(e=>{if(!this._store.isLoggedIn())return this._hostRPC.call("openSidebar"),this._store.openSidebarPanel("loginPrompt"),void this._guestRPC.forEach((t=>t.call("deleteAnnotation",e.$tag)));this._inFrame.add(e.$tag),e.$highlight||this._hostRPC.call("openSidebar"),this._hostRPC.call("showHighlights"),
|
|
632
|
-
|
|
633
|
-
this._store.focusAnnotations(e),this._guestRPC.forEach((t=>t.call("focusAnnotations",e)))}scrollToAnnotation(e){this._guestRPC.forEach((t=>t.call("scrollToAnnotation",e)))}destroy(){this._portFinder.destroy(),this._listeners.removeAll()}}
|
|
634
|
-
;return o?"__world__"===r||"__world__"===n?e:e.filter((e=>"__world__"!==e.id)):e}_setupAutoReload(){this._reloadSetUp||(this._reloadSetUp=!0,
|
|
635
|
-
this._setupAutoReload();const r=this._store.directLinkedAnnotationId();let o=null;r&&(o=this._api.annotation.get({id:r}).catch((()=>null)));const i=this._store.directLinkedGroupId();let a=null;i&&(a=this._fetchGroup(i).then((e=>(this._store.clearDirectLinkedGroupFetchFailed(),e))).catch((()=>(this._store.setDirectLinkedGroupFetchFailed(),null))));const s={expand:
|
|
636
|
-
async _loadServiceSpecifiedGroups(e){const t=await this._api.profile.groups.read({expand:
|
|
637
|
-
;e.length&&this._store.addAnnotations(e),this._store.setDefault("focusedGroup",n)}}leave(e){return this._api.group.member.delete({pubid:e,userid:"me"})}}
|
|
638
|
-
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()})),this._store.annotationFetchStarted(),this._searchClient.get({
|
|
639
|
-
this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()}),this._streamer.connect()}return r}}
|
|
640
|
-
const n=this._storage.getItem(t);this._store.setDefault(e,n)}
|
|
641
|
-
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()}}
|
|
642
|
-
return(!this._lastLoad||!this._lastLoadTime||Date.now()-this._lastLoadTime>3e5)&&(this._lastLoadTime=Date.now(),this._lastLoad=
|
|
643
|
-
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
|
|
644
|
-
this._websocketURL=t.links().then((e=>e.websocket)),this.clientId=U(32),this._socket=null,this._updateImmediately=!0,this._configMessages={},this._reconnectionAttempts=0,this._reconnectSetUp=!1}applyPendingUpdates(){const e=Object.values(this._store.pendingUpdates());e.length&&this._store.addAnnotations(e);const t=Object.keys(this._store.pendingDeletions()).map((e=>({id:e})));t.length&&this._store.removeAnnotations(t),this._store.clearPendingUpdates()}_handleSocketError(e,t){G("Error connecting to H push notification service:",t);const n=new URL(e).hostname
|
|
645
|
-
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 G("Received unsupported notification",t.type)}_sendClientConfig(e){Object.keys(this._configMessages).forEach((t=>{this._configMessages[t]&&e.send(this._configMessages[t])}))}setConfig(e,t){var n;this._configMessages[e]=t,
|
|
646
|
-
this._sendClientConfig(o)})),o.on("disconnect",(()=>{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")})),o.on("error",(e=>this._handleSocketError(t,e))),o.on("message",(e=>this._handleSocketMessage(e))),this._socket=o,this.setConfig("client-id",{messageType:"client_id",value:this.clientId}),this.setConfig("auth-check",{type:"whoami",id:1})}async connect(e={}){
|
|
647
|
-
if(null!==t&&r>=t)return!1;const o=n.split(/\W+/),i=new RegExp(`^${W(e)}`,"i");return!(!o.some((e=>e.match(i)))&&!n.match(i))&&(++r,!0)}))}store(e){const t=this._storage.getObject("hypothesis.user.tags.map")||{};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("hypothesis.user.tags.map",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("hypothesis.user.tags.list",n)}}
|
|
648
|
-
_addMessage(e,t,{autoDismiss:n=!0,moreInfoURL:r="",visuallyHidden:o=!1}={}){if(this._store.hasToastMessage(e,t))return;const i=U(10),a={type:e,id:i,message:t,moreInfoURL:r,visuallyHidden:o};this._store.addToastMessage({isDismissed:!1,...a}),n&&setTimeout((()=>{this.dismiss(i)}),5e3)}error(e,t){this._addMessage("error",e,t)}success(e,t){this._addMessage("success",e,t)}notice(e,t){this._addMessage("notice",e,t)}}
|
|
649
|
-
const r=new Error(`Failed to construct dependency "${t}" of "${e}": ${n.message}`);throw r.cause=n,r}let o;if(t.class)o=new t.class(...n);else{o=(0,t.factory)(...n)}return this._instances.set(e,o),o}finally{this._constructing.delete(e)}}register(e,t){if("function"==typeof t)t={class:t};else if(!function(e){return"object"==typeof e&&null!==e&&("value"in e||"function"==typeof e.class||"function"==typeof e.factory)}(t))throw new Error(`Invalid provider for "${e}"`);return this._providers.set(e,t),this}run(e){const t="Injector.run";this.register(t,{factory:e});try{return this.get(t)}finally{this._instances.delete(t),this._providers.delete(t)
|
|
650
|
-
;return"1.
|
|
651
|
-
;n instanceof Event&&(e.extra||(e.extra={}),Object.assign(e.extra,{type:n.type,detail:n.detail,isTrusted:n.isTrusted}))}catch(e){}return e}});try{Wt("host_config",D(window.location.href))}catch(e){}Wt("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),vr(((e,t)=>{Yt(e,{tags:{context:t}})}))}(
|
|
652
|
-
;const
|
|
653
|
-
const e=await async function(e,t){return{...await H(t.targetFrame,t.origin,"requestConfig",[],3e3),...e.group?{group:e.group}:{}}}(n,r);o=function(e,t){const n=e.services;return Array.isArray(n)?(n.forEach(((e,n)=>{"$rpc:requestGroups"===e.groups&&(e.groups=H(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=I(e);if(t){if(t.apiUrl)return t.apiUrl;throw new Error("Service should contain an apiUrl value.")}return e.apiUrl}(i),i}(
|
|
654
|
-
;n.register("annotationsService",
|
|
541
|
+
;if(!e.hasChildNodes())return"";for(var o=e.childNodes,i=o.length,a=0;a<i;++a)r+=n.subParser("makeMarkdown.node")(o[a],t,!0);return r.trim()})),n.subParser("makeMarkdown.txt",(function(e){var t=e.nodeValue;return t=(t=t.replace(/ +/g," ")).replace(/¨NBSP;/g," "),t=(t=(t=(t=(t=(t=(t=(t=(t=n.helper.unescapeHTMLEntities(t)).replace(/([*_~|`])/g,"\\$1")).replace(/^(\s*)>/g,"\\$1>")).replace(/^#/gm,"\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3")).replace(/^( {0,3}\d+)\./gm,"$1\\.")).replace(/^( {0,3})([+-])/gm,"$1\\$2")).replace(/]([\s]*)\(/g,"\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:")}));e.exports?e.exports=n:this.showdown=n}).call(V)}(xm);var km=xm.exports;const Sm=Ic(window);function Cm(){return[{type:"output",filter:function(e){return e.replace(/<a href=/g,'<a target="_blank" href=')}}]}let Em;function Am(e){return"{math:"+e.toString()+"}"}function Tm(e){const t=function(e){const t=[];let n=0,r=e;for(;;){const e=r.indexOf("$$",n),o=r.indexOf("\\(",n);if(-1===e&&-1===o)break;let i,a
|
|
542
|
+
;if(-1!==e&&(-1===o||e<o)?(i=e,a=r.indexOf("$$",i+2)):(i=o,a=r.indexOf("\\)",i+2)),-1===a)break;a+=2;const s=t.length+1,l=Am(s);let c;t.push({id:s,expression:r.slice(i+2,a-2),inline:-1!==o}),c=-1!==o?l:"\n\n"+l+"\n\n",r=r.slice(0,i)+c+r.slice(a),n=i+c.length}return{mathBlocks:t,content:r}}(e),n=Sm.sanitize(function(e){return Em||(Em=new km.Converter({extensions:[Cm],simplifiedAutoLink:!0,literalMidWordUnderscores:!0,strikethrough:!0})),Em.makeHtml(e)}(t.content)),r=function(e,t){return t.reduce(((e,t)=>{let n;try{n=t.inline?wm(t.expression):wm(t.expression,{displayMode:!0})}catch(e){n=Bc(t.expression)}return e.replace(Am(t.id),n)}),e)}(n,t.mathBlocks);return r}function Nm({children:e,classes:t,...n}){return so("div",{dir:"auto",lang:"",className:Pr("StyledText",t),...n,children:e})}function Mm({markdown:e,classes:t,style:n}){const r=Zr((()=>e?Tm(e):""),[e]),o=Xr();return Wr((()=>{!function(e,{className:t}={}){const n=Array.from(e.getElementsByTagName("a"));for(let e of n){const n=Il(e)
|
|
543
|
+
;n&&(t?n.className=t:n.style.width="350px")}}(o.current,{className:"w-full md:w-[380px]"})}),[e]),so("div",{className:"w-full break-words cursor-text",children:so(Nm,{children:so("div",{className:t,"data-testid":"markdown-text",ref:o,dangerouslySetInnerHTML:{__html:r},style:n})})})}function Lm({children:e}){return so("ul",{className:"flex flex-wrap gap-2 leading-none","aria-label":"Annotation tags",children:e})}function zm({href:e,onRemoveTag:t,tag:n}){return so("li",{className:"flex items-center border rounded-sm bg-grey-0",children:[so("div",{className:"grow px-1.5 py-1 touch:p-2",children:e?so(To,{classes:"text-color-text-light hover:text-brand",href:e,lang:"",target:"_blank","aria-label":`Tag: ${n}`,title:`View annotations with tag: ${n}`,children:n}):so("span",{className:"text-color-text-light cursor-default","aria-label":`Tag: ${n}`,lang:"",children:n})}),t&&so("button",{
|
|
544
|
+
className:Pr("px-1.5 py-1 touch:p-2","border-l rounded-sm rounded-l-none","text-grey-6 hover:text-color-text hover:bg-grey-2","transition-colors duration-200","u-outline-on-keyboard-focus--inset"),onClick:()=>{t(n)},title:`Remove tag: ${n}`,children:so(Ao,{classes:"font-base",name:"cancel",title:`Remove ${n}`})})]})}function Om({classes:e,setCollapsed:t,collapsed:n}){const r=n?"More":"Less";return so(fo,{classes:Pr("text-grey-7 font-normal",e),expanded:!n,onClick:()=>t(!n),title:`Toggle visibility of full annotation text: Show ${r}`,children:so("div",{className:"flex items-center gap-x-2",children:[so(Ao,{classes:Pr("!text-tiny"),name:n?"expand":"collapse",title:n?"expand":"collapse"}),so("div",{children:r})]})})}Sm.addHook("afterSanitizeAttributes",(e=>{"target"in e&&e.setAttribute("target","_blank")}));var Rm=Jo((function({annotation:e,settings:t}){var n,r
|
|
545
|
+
;const[o,i]=Vr(!0),[a,s]=Vr(!1),l=ys(),c=l.defaultAuthority(),u=l.getDraft(e),h=null!==(n=null==u?void 0:u.tags)&&void 0!==n?n:e.tags,d=null!==(r=null==u?void 0:u.text)&&void 0!==r?r:e.text,p=d.length>0,m=h.length>0,f=Xo(["annotationFontFamily"],t),g=Zr((()=>e&&!Wo(null==e?void 0:e.user,c)),[e,c]),v=e=>l.getLink("search.tag",{tag:e});return so("div",{className:"space-y-4",children:[p&&so(Ml,{collapse:o,collapsedHeight:400,inlineControls:!1,onCollapsibleChanged:s,onToggleCollapsed:i,overflowThreshold:20,children:so(Mm,{markdown:d,classes:Pr({"p-redacted-text":Pi(e)}),style:f})}),(a||m)&&so("div",{className:"flex flex-row gap-x-2",children:[so("div",{className:"grow",children:m&&so(Lm,{children:h.map((e=>so(zm,{tag:e,href:g?v(e):void 0},e)))})}),a&&so("div",{children:so(Om,{classes:Pr("-mt-3"),collapsed:o,setCollapsed:i})})]})]})}),["settings"]);const Dm=0,Im=1;function Pm(e,t,n,r){let o=e.selectionStart,i=e.selectionEnd;return o>=t+n?(o+=r.length-n,
|
|
546
|
+
i+=r.length-n):i<=t||(o<=t&&i>=t+n?i+=r.length-n:o<t&&i<t+n?o=t:o<t+n&&i>t+n?i+=r.length-n:t<o&&t+n>i&&(o=t,i=t+n)),{text:e.text.slice(0,t)+r+e.text.slice(t+n),selectionStart:o,selectionEnd:i}}function Bm(e,t=Dm){const n=e.text.slice(e.selectionStart,e.selectionEnd);let r,o="";if(t===Im&&(o="!"),n.match(/[a-z]+:\/\/.*/)){const t="Description";return r=Pm(e,e.selectionStart,n.length,o+"["+t+"]("+n+")"),r.selectionStart=e.selectionStart+o.length+1,r.selectionEnd=r.selectionStart+t.length,r}{const t=o+"["+n+"](",i="http://insert-your-link-here.com";return r=Pm(e,e.selectionStart,n.length,t+i+")"),r.selectionStart=e.selectionStart+t.length,r.selectionEnd=r.selectionStart+i.length,r}}function Fm(e,t,n,r){void 0===n&&(n=t);const o=e.text.slice(e.selectionStart-t.length,e.selectionStart),i=e.text.slice(e.selectionEnd,e.selectionEnd+t.length);let a=e;return e.selectionStart===e.selectionEnd&&r&&(a=Pm(e,e.selectionStart,0,r),a.selectionStart=a.selectionEnd-r.length),
|
|
547
|
+
o===t&&i===n?(a=Pm(a,a.selectionStart-t.length,t.length,""),a=Pm(a,a.selectionEnd,n.length,"")):(a=Pm(a,a.selectionStart,0,t),a=Pm(a,a.selectionEnd,0,n)),a}function jm(e,t){const n=e.indexOf("\n",t);return n<0?e.length:n}function Um(e,t,n,r){let o=function(e,t){const n=e.lastIndexOf("\n",t);return n<0?0:n+1}(e.text,t),i=jm(e.text,t);for(;i<=jm(e.text,n);){const t=i===e.text.length,a=i-o,s=jm((e=r(e,o,i)).text,o)-o;if(n+=s-a,t)break;o=o+s+1,i=jm(e.text,o)}return e}function Hm(e,t){const n=e.selectionStart,r=e.selectionEnd;let o=!0;return Um(e,n,r,((e,n)=>(e.text.slice(n,n+t.length)!==t&&(o=!1),e))),Um(e,n,r,o?(e,n)=>Pm(e,n,t.length,""):(e,n)=>e.text.slice(n,n+t.length)===t?e:Pm(e,n,0,t))}const qm={bold:"b",image:"g",italic:"i",link:"l",list:"u",math:"m",numlist:"o",quote:"q"};function $m({classes:e,icon:t,linkRef:n,...r}){return so(To,{classes:Pr("flex justify-center items-center","text-grey-7 hover:!text-grey-7","touch:h-touch-minimum touch:w-touch-minimum",e),linkRef:n,...r,children:so(Ao,{
|
|
548
|
+
classes:"text-tiny touch:text-base",name:t})})}function Gm({disabled:e=!1,iconName:t="",label:n,onClick:r,shortcutKey:o,title:i=""}){const a=Zr((()=>((e=window.navigator.userAgent)=>e.indexOf("Mac OS")>=0)()?"Cmd":"Ctrl"),[]);let s=i;o&&(s+=` (${a}-${o.toUpperCase()})`);const l={disabled:e,icon:t,onClick:r,title:s};return n?so(fo,{classes:Pr("font-normal bg-transparent","hover:!bg-transparent"),...l,children:n}):so(mo,{classes:"px-2 py-2.5 text-tiny touch:text-base",...l})}function Vm({classes:e,containerRef:t,...n}){return so("textarea",{className:Pr("border rounded-sm p-2","text-color-text-light bg-grey-0","focus:bg-white focus:outline-none focus:shadow-focus-inner",e),...n,ref:t})}function Ym({isPreviewing:e,onCommand:t,onTogglePreview:n}){const r=Xr(null);return function(e,{autofocus:t=!1,horizontal:n=!0,vertical:r=!0,selector:o="a,button"}={}){Wr((()=>{if(!e.current)throw new Error("Container ref not set");const i=e.current,a=()=>Array.from(i.querySelectorAll(o)).filter((e=>{
|
|
549
|
+
return null!==e.offsetParent&&!("boolean"==typeof(t=e).disabled&&t.disabled);var t})),s=(e=a(),t=-1,n=!1)=>{t<0&&(t=e.findIndex((e=>0===e.tabIndex)))<0&&(t=0);for(let[r,o]of e.entries())o.tabIndex=r===t?0:-1,r===t&&n&&o.focus()};s(a(),0,t);const l=new hl;l.add(i,"focusin",(e=>{const t=a(),n=t.indexOf(e.target);n>=0&&s(t,n)})),l.add(i,"keydown",(e=>{const t=a();let o=t.findIndex((e=>0===e.tabIndex)),i=!1;n&&"ArrowLeft"===e.key||r&&"ArrowUp"===e.key?(0===o?o=t.length-1:--o,i=!0):n&&"ArrowRight"===e.key||r&&"ArrowDown"===e.key?(o===t.length-1?o=0:++o,i=!0):"Home"===e.key?(o=0,i=!0):"End"===e.key&&(o=t.length-1,i=!0),i&&(s(t,o,!0),e.preventDefault(),e.stopPropagation())}));const c=new MutationObserver((()=>{s()}));return c.observe(i,{subtree:!0,attributes:!0,attributeFilter:["disabled"],childList:!0}),()=>{l.removeAll(),c.disconnect()}}),[t,e,n,o,r])}(r),so("div",{
|
|
550
|
+
className:Pr("flex flex-wrap w-full items-center","p-1 border-x border-t rounded-t bg-white","touch:h-auto touch:overflow-x-scroll touch:flex-nowrap touch:pb-2.5"),"data-testid":"markdown-toolbar",role:"toolbar","aria-label":"Markdown editor toolbar",ref:r,children:[so(Gm,{disabled:e,iconName:"format-bold",onClick:()=>t("bold"),shortcutKey:qm.bold,title:"Bold"}),so(Gm,{disabled:e,iconName:"format-italic",onClick:()=>t("italic"),shortcutKey:qm.italic,title:"Italic"}),so(Gm,{disabled:e,iconName:"format-quote",onClick:()=>t("quote"),shortcutKey:qm.quote,title:"Quote"}),so(Gm,{disabled:e,iconName:"link",onClick:()=>t("link"),shortcutKey:qm.link,title:"Insert link"}),so(Gm,{disabled:e,iconName:"image",onClick:()=>t("image"),shortcutKey:qm.image,title:"Insert image"}),so(Gm,{disabled:e,iconName:"format-functions",onClick:()=>t("math"),title:"Insert math (LaTeX is supported)"}),so(Gm,{disabled:e,iconName:"format-list-numbered",onClick:()=>t("numlist"),shortcutKey:qm.numlist,title:"Numbered list"}),so(Gm,{disabled:e,
|
|
551
|
+
iconName:"format-list-unordered",onClick:()=>t("list"),shortcutKey:qm.list,title:"Bulleted list"}),so("div",{className:"grow flex justify-end",children:[so($m,{classes:Pr("px-2 py-2.5"),href:"https://web.hypothes.is/help/formatting-annotations-with-markdown/",icon:"help",target:"_blank",title:"Formatting help","aria-label":"Formatting help"}),so(Gm,{label:e?"Write":"Preview",onClick:n})]})]})}function Wm({label:e="",onEditText:t=(()=>{}),text:n="",textStyle:r={}}){const[o,i]=Vr(!1),a=Xr(null);Wr((()=>{var e;o||(null===(e=a.current)||void 0===e||e.focus())}),[o]);const s=e=>{a.current&&(!function(e,t){const n=e=>{const n=e({text:t.value,selectionStart:t.selectionStart,selectionEnd:t.selectionEnd});t.value=n.text,t.selectionStart=n.selectionStart,t.selectionEnd=n.selectionEnd,t.focus()},r=e=>{const t=e.text.slice(0,e.selectionStart);return 0===t.length||"\n"===t.slice(-1)||"$$"===t.slice(-2)?Fm(e,"$$","$$","Insert LaTeX"):Fm(e,"\\(","\\)","Insert LaTeX")};switch(e){case"bold":n((e=>Fm(e,"**","**","Bold")))
|
|
552
|
+
;break;case"italic":n((e=>Fm(e,"*","*","Italic")));break;case"quote":n((e=>Hm(e,"> ")));break;case"link":n((e=>Bm(e)));break;case"image":n((e=>Bm(e,Im)));break;case"math":n(r);break;case"numlist":n((e=>Hm(e,"1. ")));break;case"list":n((e=>Hm(e,"* ")));break;default:throw new Error(`Unknown toolbar command "${e}"`)}}(e,a.current),t(a.current.value))};return so("div",{className:"leading-none",children:[so(Ym,{onCommand:s,isPreviewing:o,onTogglePreview:()=>i(!o)}),o?so(Mm,{markdown:n,classes:"border bg-grey-1 p-2",style:r}):so(Vm,{"aria-label":e,dir:"auto",classes:Pr("w-full min-h-[8em] resize-y","rounded-t-none","text-base touch:text-touch-base"),containerRef:a,onClick:e=>e.stopPropagation(),onKeyDown:e=>{if(e.ctrlKey||e.metaKey)for(let[t,n]of Object.entries(qm))n===e.key&&(e.stopPropagation(),e.preventDefault(),s(t))},onInput:e=>t(e.target.value),value:n,style:r})]})}const Km=e=>e;function Xm({activeItem:e=-1,id:t,itemPrefixId:n,list:r,listFormatter:o=Km,onSelectItem:i,open:a=!1}){
|
|
553
|
+
const s=Zr((()=>r.map(((t,r)=>{const a=n?{id:`${n}${r}`}:{};return so("li",{role:"option","aria-selected":(e===r).toString(),className:Pr("flex items-center","border-l-4 py-1 px-3 cursor-pointer hover:bg-grey-2","touch:h-touch-minimum",{"border-brand bg-grey-1":e===r,"border-transparent":e!==r}),onClick:()=>{i(t)},...a,children:o(t,r)},`AutocompleteList-${r}`)}))),[e,n,r,o,i]),l=t?{id:t}:{},c=0===r.length||!a;return so("div",{className:"relative",children:so(bo,{classes:Pr({hidden:c},"absolute top-[3px] z-3","w-auto min-w-[10em] theme-clean:border p-0"),children:[so("ul",{tabIndex:-1,"aria-label":"Suggestions",role:"listbox",...l,children:s}),so(xl,{direction:"up",classes:"top-[-10px] left-[3px]"})]})})}let Zm=0;var Jm=Jo((function({onAddTag:e,onRemoveTag:t,onTagInput:n,tagList:r,tags:o}){const i=Xr(),[a,s]=Vr([]),[l,c]=Vr(-1),[u,h]=Vr(!1),[d]=Vr((()=>(++Zm,`TagEditor-${Zm}`))),p=Xr();Mo(p,u,(()=>{h(!1)}));const m=()=>i.current.value.trim(),f=()=>m()&&m().length>0,g=()=>{i.current.value="",null==n||n("")
|
|
554
|
+
},v=t=>{e(t)&&(h(!1),c(-1),g(),i.current.focus())},_=e=>{let t=l+e;t<-1?t=a.length-1:t>=a.length&&(t=-1),c(t)},b=l>=0?`${d}-AutocompleteList-item-${l}`:"";return so("div",{className:"space-y-4",children:[so(Lm,{children:r.map((e=>so(zm,{onRemoveTag:t,tag:e},e)))}),so("div",{id:d,"data-testid":"combobox-container",ref:p,role:"combobox","aria-expanded":u.toString(),"aria-owns":`${d}-AutocompleteList`,"aria-haspopup":"listbox",children:[so(jo,{classes:"w-full",onInput:()=>{null==n||n(m()),(()=>{if(f()){const e=o.filter(m());s(((e,t)=>{const n=[];for(let r of e)t.indexOf(r)<0&&n.push(r);return n.sort()})(e,r)),h(e.length>0)}else h(!1);c(-1)})()},onKeyDown:e=>{switch(e.key){case"ArrowUp":_(-1),e.preventDefault();break;case"ArrowDown":_(1),e.preventDefault();break;case"Escape":g(),e.preventDefault();break;case"Enter":case",":v(-1===l?m():a[l]),e.preventDefault();break;case"Tab":if(!f())break;-1!==l?v(a[l]):1===a.length?v(a[0]):v(m()),e.preventDefault()}},onFocus:()=>{f()&&h(!0)},inputRef:i,
|
|
555
|
+
placeholder:"Add new tags",type:"text",autoComplete:"off","aria-autocomplete":"list","aria-activedescendant":b,"aria-controls":`${d}-AutocompleteList`,dir:"auto"}),so(Xm,{id:`${d}-AutocompleteList`,list:a,listFormatter:e=>{const t=m().toLowerCase(),n=e.toLowerCase().indexOf(t);if(-1===n)return so("span",{children:e});const r=e.slice(0,n),o=e.slice(n,n+t.length),i=e.slice(n+t.length);return so("span",{children:[so("strong",{children:r}),o,so("strong",{children:i})]})},open:u,onSelectItem:e=>{e&&v(e)},itemPrefixId:`${d}-AutocompleteList-item-`,activeItem:l})]})]})}),["tags"]);function Qm(){return so("div",{className:"pt-2 border-t text-sm leading-none",children:so(To,{classes:"flex items-center text-color-text-light",href:"http://creativecommons.org/publicdomain/zero/1.0/",target:"_blank",title:"View more information about the Creative Commons Public Domain dedication",children:[so(Ao,{name:"cc-std",classes:"text-tiny"}),so(Ao,{name:"cc-zero",classes:"ml-px text-tiny"}),so("div",{className:"ml-1",
|
|
556
|
+
children:"Annotations can be freely reused by anyone for any purpose."})]})})}function ef(e){return null!==e.offsetParent}function tf({className:e,closeMenu:t,children:n,visible:r}){const o=Xr();Wr((()=>{let e;return r&&(e=setTimeout((()=>{const e=o.current.querySelector('[role^="menuitem"]');e&&e.focus()}))),()=>{clearTimeout(e)}}),[r]);return so("div",{role:"menu",className:e,ref:o,onKeyDown:e=>{const n=Array.from(o.current.querySelectorAll('[role^="menuitem"]')).filter(ef);let r=n.findIndex((e=>e.contains(document.activeElement))),i=!1;switch(e.key){case"ArrowLeft":case"Escape":t&&(t(e),i=!0);break;case"ArrowUp":r-=1,r<0&&(r=n.length-1),i=!0;break;case"ArrowDown":r+=1,r===n.length&&(r=0),i=!0;break;case"Home":r=0,i=!0;break;case"End":r=n.length-1,i=!0}i&&r>=0&&(e.stopPropagation(),e.preventDefault(),n[r].focus())},children:n})}let nf=!1;const rf=()=>{}
|
|
557
|
+
;function of({align:e="left",arrowClass:t="",children:n,containerPositioned:r=!0,contentClass:o,defaultOpen:i=!1,label:a,open:s,onOpenChanged:l,menuIndicator:c=!0,title:u}){let[h,d]=Vr(i);"boolean"==typeof s&&(h=s,d=l||rf);const p=Xr(h);Wr((()=>{"function"==typeof l&&p.current!==h&&(p.current=h,l(h))}),[h,l]);const f=e=>{if("mousedown"===e.type)nf=!0;else if("click"===e.type&&nf)return nf=!1,e.stopPropagation(),void e.preventDefault();d(!h)},g=Jr((()=>d(!1)),[d]),v=Xr();Mo(v,h,g);const _=e=>e.stopPropagation();return so("div",{className:"relative","data-testid":"menu-container",ref:v,style:{position:r?"relative":"static"},onClick:_,onMouseDown:_,children:[so("button",{"aria-expanded":h?"true":"false","aria-haspopup":!0,className:Pr("u-outline-on-keyboard-focus","flex items-center justify-center rounded-sm transition-colors",{"text-grey-7 hover:text-grey-9":!h,"text-brand":h}),"data-testid":"menu-toggle-button",onMouseDown:f,onClick:f,"aria-label":u,title:u,children:so("span",{
|
|
558
|
+
className:"flex items-center gap-x-1",children:[a,c&&so("span",{className:Pr({"rotate-180 text-color-text":h}),children:so(Ao,{name:"expand-menu",classes:"w-2.5 h-2.5"})})]})}),h&&so(m,{children:[so(xl,{direction:"up",classes:Pr("right-0 top-[calc(100%-6px)] w-[15px]",t)}),so("div",{className:Pr("u-outline-on-keyboard-focus","absolute top-[calc(100%+5px)] z-1 border shadow","bg-white text-lg",{"left-0":"left"===e,"right-0":"right"===e},o),"data-testid":"menu-content",role:"menu",tabIndex:-1,onClick:g,onKeyDown:e=>{const t=e.key;"Enter"!==t&&" "!==t||setTimeout((()=>{g()}))},children:so(tf,{visible:!0,children:n})})]})]})}function af({children:e,visible:t}){const n=Xr(),[r,o]=Vr(t?"auto":0),[i,a]=Vr(t);Wr((()=>{if(t===(0!==r))return;const e=n.current;t?(e.style.display="",a(!0),o(e.scrollHeight)):(e.style.height=`${e.scrollHeight}px`,e.getBoundingClientRect(),o(0))}),[r,t]);return so("div",{ontransitionend:Jr((()=>{t?o("auto"):a(!1)}),[o,t]),ref:n,style:{display:i?"":"none",height:r,
|
|
559
|
+
overflow:"auto"===r?"visible":"hidden",transition:"height 0.15s ease-in"},children:e})}function sf({title:e,isExpanded:t,onToggleSubmenu:n}){return so("div",{"data-testid":"submenu-toggle",role:"none",className:Pr("flex flex-col items-center justify-center w-10 h-10","text-grey-6 bg-grey-1","bg-clip-content border-[8px] border-transparent rounded-xl","group-hover:hover:text-grey-8",{"bg-grey-4":t,"group-hover:bg-grey-3":!t}),onClick:n,title:e,children:so(Ao,{name:t?"collapse-menu":"expand-menu",classes:"w-3 h-3"})})}function lf({href:e,icon:t,iconAlt:n,isDisabled:r,isExpanded:o,isSelected:i,isSubmenuItem:a,isSubmenuVisible:s,label:l,onClick:c,onToggleSubmenu:u,submenu:h}){const d=t&&-1!==t.indexOf("/"),p=Xr();let f,g;const v="boolean"==typeof s,_="boolean"==typeof i;Wr((()=>()=>{clearTimeout(f)}),[]);const b=e=>{switch(e.key){case"ArrowRight":u&&(e.stopPropagation(),e.preventDefault(),u(e));break;case"Enter":case" ":c&&c(e)}};let y=null;t&&"blank"!==t&&(y=d?so("img",{className:"w-4 h-4",alt:n,src:t}):so(Ao,{
|
|
560
|
+
name:t,classes:"h-3 w-3"}));const w=a?null:y,x=a?y:null,k=x&&a,S=so(m,{children:[(w||a||"blank"===t)&&so("div",{className:"w-7 flex items-center justify-center","data-testid":"left-item-container",children:w}),so("span",{className:"flex items-center grow whitespace-nowrap px-1",children:l}),k&&so("div",{className:"w-8 flex items-center justify-center","data-testid":"right-item-container",children:x}),v&&so(sf,{title:`Show actions for ${l}`,isExpanded:s,onToggleSubmenu:u})]}),C=Pr("u-outline-on-keyboard-focus--inset","w-full min-w-[150px] flex items-center select-none","border-b","group",{"min-h-[30px] font-normal":a,"min-h-[40px] font-medium":!a,"bg-grey-1 hover:bg-grey-3":a||o,"bg-white hover:bg-grey-1":!a&&!o,"pr-1":!v},{"border-l-[4px] border-l-brand":i,"pl-[4px]":!i,"border-b-grey-3":o,"border-b-transparent":!o,"text-color-text-light":r,"text-color-text":!r});return g=e?so("a",{ref:p,className:C,"data-testid":"menu-item",href:e,target:"_blank",tabIndex:-1,rel:"noopener noreferrer",role:"menuitem",
|
|
561
|
+
onKeyDown:b,children:S}):so("div",{ref:p,className:C,"data-testid":"menu-item",tabIndex:-1,onKeyDown:b,onClick:c,role:_?"menuitemradio":"menuitem","aria-checked":_?i:void 0,"aria-haspopup":v,"aria-expanded":v?s:void 0,children:S}),so(m,{children:[g,v&&so(af,{visible:s,children:so(tf,{closeMenu:e=>{u&&u(e),f=setTimeout((()=>{p.current.focus()}))},visible:s,className:"border-b",children:h})})]})}var cf=Jo((function({group:e,isDisabled:t,isPrivate:n,onCancel:r,onSave:o,onSetPrivate:i,settings:a}){const s=Xo(["ctaTextColor","ctaBackgroundColor"],a),l=so("div",{className:"w-9 h-9 flex items-center justify-center text-color-text-inverted",style:s,children:so(Ao,{name:"expand-menu",classes:"w-4 h-4"})});return so("div",{className:"flex flex-row gap-x-3",children:[so("div",{className:"flex relative",children:[so(fo,{classes:Pr("rounded-r-none"),"data-testid":"publish-control-button",style:s,onClick:o,disabled:t,size:"large",variant:"primary",children:["Post to ",n?"Only Me":e.name]}),so("div",{
|
|
562
|
+
className:Pr("flex flex-row rounded-r-sm bg-grey-7 hover:bg-grey-8"),style:s,children:so(of,{arrowClass:Pr("right-[10px]"),containerPositioned:!1,contentClass:Pr("min-w-full"),label:l,menuIndicator:!1,title:"Change annotation sharing setting",align:"left",children:[so(lf,{icon:"open"===e.type?"public":"groups",label:e.name,isSelected:!n,onClick:()=>i(!1)}),so(lf,{icon:"lock",label:"Only Me",isSelected:n,onClick:()=>i(!0)})]})})]}),so("div",{children:so(fo,{classes:"p-2.5",icon:"cancel",onClick:r,size:"large",children:"Cancel"})})]})}),["settings"]);var uf=Jo((function({annotation:e,draft:t,annotationsService:n,settings:r,tags:o,toastMessenger:i}){const[a,s]=Vr(null),l=ys(),c=l.getGroup(e.group),u=!t.isPrivate&&c&&"private"!==c.type,h=t.tags,d=t.text,p=!d&&!h.length,m=Jr((e=>{l.createDraft(t.annotation,{...t,tags:e})}),[t,l]),f=Jr((e=>{if(!e||h.indexOf(e)>=0)return!1;const t=[...h,e];return o.store(t),m(t),!0}),[m,h,o]),g=Jr((e=>{const t=[...h],n=t.indexOf(e);return n>=0&&(t.splice(n,1),m(t),!0)
|
|
563
|
+
}),[m,h]),v=Jr((e=>{l.createDraft(t.annotation,{...t,text:e})}),[t,l]),_=Jr((n=>{l.createDraft(e,{...t,isPrivate:n}),Li(e)||l.setDefault("annotationPrivacy",n?"private":"shared")}),[e,t,l]),b=async()=>{a&&f(a);const t=`${Hi(e)} ${zi(e)?"updated":"saved"}`;try{await n.save(e),i.success(t,{visuallyHidden:!0})}catch(e){i.error("Saving annotation failed")}},y=Jr((()=>{l.removeDraft(e),zi(e)||l.removeAnnotations([e])}),[e,l]);return so("div",{"data-testid":"annotation-editor",className:"space-y-4",onKeyDown:e=>{const t=e.key;p||(e.metaKey||e.ctrlKey)&&"Enter"===t&&(e.stopPropagation(),e.preventDefault(),b())},children:[so(Wm,{textStyle:Xo(["annotationFontFamily"],r),label:"Annotation body",text:d,onEditText:v}),so(Jm,{onAddTag:f,onRemoveTag:g,onTagInput:s,tagList:h}),c&&so(cf,{group:c,isDisabled:p,isPrivate:t.isPrivate,onCancel:y,onSave:b,onSetPrivate:_}),u&&so(Qm,{})]})}),["annotationsService","settings","tags","toastMessenger"]);function hf({domain:e,link:t,title:n}){return so("div",{className:"flex gap-x-1",
|
|
564
|
+
children:[so("div",{className:"text-color-text-light",children:['on "',t?so(To,{href:t,target:"_blank",children:n}):so("span",{children:n}),'"']}),e&&so("span",{className:"text-color-text-light",children:["(",e,")"]})]})}function df({group:e,isPrivate:t}){const n=null==e?void 0:e.links.html;return so(m,{children:[e&&n&&so(To,{classes:Pr("flex items-baseline gap-x-1","p-muted-link"),href:e.links.html,target:"_blank",children:[so(Ao,{classes:"text-tiny",name:"open"===e.type?"public":"groups"}),so("span",{children:e.name})]}),t&&!n&&so("div",{className:"text-color-text-light","data-testid":"private-info",children:"Only me"})]})}let pf={};function mf(e,t){return t-e}function ff(e,t,n=window.Intl){const r=JSON.stringify(t);let o=pf[r];return o||(o=pf[r]=new n.DateTimeFormat(void 0,t)),o.format(e)}const gf=[{test:(e,t)=>mf(e,t)<3e4,formatter:()=>"Just now",nextUpdate:1e3},{test:(e,t)=>mf(e,t)<6e4,formatter:function(e,t){return`${Math.floor(mf(e,t)/1e3)} secs ago`},nextUpdate:1e3},{test:(e,t)=>mf(e,t)<36e5,
|
|
565
|
+
formatter:function(e,t){const n=Math.floor(mf(e,t)/6e4);return`${n} min${n>1?"s":""} ago`},nextUpdate:6e4},{test:(e,t)=>mf(e,t)<864e5,formatter:function(e,t){const n=Math.floor(mf(e,t)/36e5);return`${n} hr${n>1?"s":""} ago`},nextUpdate:36e5},{test:(e,t)=>e.getFullYear()===t.getFullYear(),formatter:function(e,t,n){return ff(e,{month:"short",day:"numeric"},n)},nextUpdate:null}],vf={test:()=>!0,formatter:function(e,t,n){return ff(e,{day:"numeric",month:"short",year:"numeric"},n)},nextUpdate:null};function _f(e,t){for(let n of gf)if(n.test(e,t))return n;return vf}function bf(e){return!isNaN(e.valueOf())}function yf(e,t){let n;const r=new Date(e),o=()=>{const e=function(e,t){if(!e||!bf(e)||!bf(t))return null;let n=_f(e,t).nextUpdate;return null===n?null:(n=Math.max(n,5e3),n=Math.min(n,20736e5),n)}(r,new Date);if(null===e)return;n=setTimeout((()=>{t(),o()}),e+500)};return o(),()=>clearTimeout(n)}function wf(e,t,n){return e?_f(e,t).formatter(e,t,n):""}function xf(e,t){return ff(e,{year:"numeric",month:"short",
|
|
566
|
+
day:"2-digit",weekday:"long",hour:"2-digit",minute:"2-digit"},t)}function kf({annotationCreated:e,annotationUpdated:t,annotationUrl:n,withEditedTimestamp:r}){const[o,i]=Vr((()=>new Date)),a=Zr((()=>new Date(e)),[e]),s=Zr((()=>r&&new Date(t)),[t,r]),l=Zr((()=>({absolute:xf(a),relative:wf(a,o)})),[a,o]),c=Zr((()=>s?{absolute:xf(s),relative:wf(s,o)}:{}),[s,o]);Wr((()=>yf(s?t:e,(()=>i(new Date)))),[e,t,a,s,o]);const u=c&&c.relative!==l.relative?`edited ${c.relative}`:"edited";return so("div",{children:[r&&so("span",{className:"text-color-text-light text-sm italic","data-testid":"timestamp-edited",title:c.absolute,children:["(",u,")"," "]}),n?so(To,{classes:"p-muted-link",target:"_blank",title:l.absolute,href:n,children:l.relative}):so("span",{className:"color-text-color-light","data-testid":"timestamp-created",title:l.absolute,children:l.relative})]})}function Sf({authorLink:e,displayName:t}){const n=so("h3",{className:"text-color-text font-bold",children:t});return e?so(To,{href:e,target:"_blank",children:n
|
|
567
|
+
}):so("div",{children:n})}function Cf({children:e}){return so("div",{className:"flex gap-x-1 items-baseline flex-wrap-reverse",children:e})}var Ef=Jo((function({annotation:e,isEditing:t,replyCount:n,threadIsCollapsed:r,settings:o}){var i;const a=ys(),s=a.defaultAuthority(),l=a.isFeatureEnabled("client_display_names"),c=a.getLink("user",{user:e.user}),u=Zr((()=>ml(e,s,l)),[e,s,l]),h=Zr((()=>function(e,t,n,r){var o;return!Wo(e.user,n)&&r?r:null!==(o=t.usernameUrl&&`${t.usernameUrl}${Yo(e.user)}`)&&void 0!==o?o:void 0}(e,o,s,c)),[e,o,s,c]),d=Li(e)&&r,p=(null===(i=e.links)||void 0===i?void 0:i.html)||"",m=Zr((()=>function(e){if(!e.updated||!e.created||e.updated===e.created)return!1;const t=new Date(e.created).getTime(),n=new Date(e.updated).getTime();return!isNaN(t)&&!isNaN(n)&&n-t>2e3}(e)&&!d),[e,d]),f=function(e){return{domain:Ni(e),titleText:Mi(e),titleLink:Ti(e)}}(e),g=p&&f.titleLink?f.titleLink:"",v="sidebar"!==a.route()&&f.titleText,_=a.getGroup(e.group);return so("header",{children:[so(Cf,{
|
|
568
|
+
children:[yl(e.permissions)&&!t&&so(Ao,{classes:"text-tiny",name:"lock",title:"This annotation is visible only to you"}),so(Sf,{authorLink:h,displayName:u}),n>0&&d&&so(go,{onClick:()=>a.setExpanded(e.id,!0),title:"Expand replies",children:`${n} ${n>1?"replies":"reply"}`}),!t&&e.created&&so("div",{className:"flex justify-end grow",children:so(kf,{annotationCreated:e.created,annotationUpdated:e.updated,annotationUrl:p,withEditedTimestamp:m})})]}),!Li(e)&&so(Cf,{children:[_&&so(df,{group:_,isPrivate:yl(e.permissions)}),!t&&Bi(e)&&so(Ao,{name:"highlight",title:"This is a highlight. Click 'edit' to add a note or tag.",classes:"text-tiny text-color-text-light"}),v&&so(hf,{domain:f.domain,link:g,title:f.titleText})]})]})}),["settings"]);var Af=Jo((function({quote:e,isFocused:t,isOrphan:n,settings:r}){return so(Ml,{collapsedHeight:35,inlineControls:!0,overflowThreshold:20,children:so(Nm,{classes:Pr({"p-redacted-text":n}),children:so("blockquote",{className:Pr("hover:border-l-blue-quote",{"border-l-blue-quote":t}),
|
|
569
|
+
style:Xo(["selectionFontFamily"],r),children:e})})})}),["settings"]);function Tf({onToggleReplies:e,replyCount:t,threadIsCollapsed:n}){const r=`${n?"Show replies":"Hide replies"} (${t})`;return so(go,{onClick:e,title:r,children:r})}function Nf(){return so("div",{className:Pr("flex grow justify-end items-center gap-x-1","h-8 touch:h-touch-minimum"),"data-testid":"saving-message",children:[so(Bo,{classes:Pr("text-xl","animate-fade-in-slow"),size:"small"}),so("div",{className:"text-color-text-light font-medium",children:"Saving..."})]})}var Mf=Jo((function({annotation:e,isReply:t,onToggleReplies:n,replyCount:r,threadIsCollapsed:o,annotationsService:i}){const a=ys(),s=$i(e),l=a.getDraft(e),c=a.profile().userid,u=a.isAnnotationFocused(e.$tag),h=a.isSavingAnnotation(e),d=!!l&&!h,p=t&&o,m=!h&&!d&&zi(e),f=a.defaultAuthority(),g=a.isFeatureEnabled("client_display_names"),v=Zr((()=>ml(e,f,g)),[e,f,g]);return so("article",{className:"space-y-4","aria-label":`${Hi(e)} by ${v}`,children:[so(Ef,{annotation:e,isEditing:d,
|
|
570
|
+
replyCount:r,threadIsCollapsed:o}),s&&so(Af,{quote:s,isFocused:u,isOrphan:Fi(e)}),!p&&!d&&so(Rm,{annotation:e}),d&&so(uf,{annotation:e,draft:l}),!p&&so("footer",{className:"flex items-center",children:[n&&so(Tf,{onToggleReplies:n,replyCount:r,threadIsCollapsed:o}),h&&so(Nf,{}),m&&so(yo,{classes:"grow",children:so(Al,{annotation:e,onReply:()=>{zi(e)&&c&&i.reply(e,c)}})})]})]})}),["annotationsService"]);function Lf({isReply:e,replyCount:t,threadIsCollapsed:n,onToggleReplies:r}){return so("article",{className:"space-y-4","aria-label":(e?"Reply":"Annotation")+" with unavailable content",children:[so("div",{children:so("em",{children:"Message not available."})}),r&&so("footer",{className:"flex items-center",children:so(Tf,{onToggleReplies:r,replyCount:t,threadIsCollapsed:n})})]})}var zf=Jo((function({annotation:e,api:t,toastMessenger:n}){const r=ys(),o=function(e){return e.moderation?e.moderation.flagCount:null}(e);return null!==o&&(o>0||e.hidden)?so("div",{
|
|
571
|
+
className:Pr("flex gap-x-3 bg-grey-1 text-color-text font-semibold","mb-2 ",{"-mt-3 -ml-3 -mr-3":!Li(e),"-mr-3":Li(e)}),children:[so("div",{className:Pr("p-3 text-white",{"bg-red-error":!e.hidden,"bg-grey-6":e.hidden}),children:so(Ao,{name:e.hidden?"hide":"flag"})}),so("div",{className:"self-center grow",children:[!e.hidden&&so("span",{children:["Flagged for review by ",o," ",1===o?"user":"users"]}),e.hidden&&so("span",{children:"Hidden from users"})]}),so("div",{className:"self-center pr-2",children:so(fo,{classes:"py-1 bg-slate-1",onClick:e.hidden?()=>{const o=e.id;t.annotation.unhide({id:o}).then((()=>{r.unhideAnnotation(o)})).catch((()=>{n.error("Failed to unhide annotation")}))}:()=>{const o=e.id;t.annotation.hide({id:o}).then((()=>{r.hideAnnotation(o)})).catch((()=>{n.error("Failed to hide annotation")}))},title:e.hidden?"Make this annotation visible to everyone":"Hide this annotationn from non-moderators",variant:"dark",children:e.hidden?"Unhide":"Hide"})})]}):null}),["api","toastMessenger"])
|
|
572
|
+
;function Of({threadIsCollapsed:e,onToggleReplies:t}){const n=e?"collapsed":"expand-menu",r=e?"Expand replies":"Collapse replies";return so("div",{className:Pr("cursor-auto",{"bg-thread-line":!e}),"data-testid":"thread-collapse-channel",children:so("div",{className:Pr("bg-white"),children:so(mo,{classes:Pr("-mt-1 touch:min-w-[auto] touch:min-h-[auto]"),expanded:!e,icon:n,title:r,onClick:t,size:"medium",variant:"light"})})})}var Rf=Jo((function e({thread:t,threadsService:n}){const r=!!t.parent,o=t.children.filter((e=>qs(e)>0)),i=ys(),a=i.hasAppliedFilter(),s=t.annotation&&i.isSavingAnnotation(t.annotation),l=t.annotation&&!!i.getDraft(t.annotation)&&!s,c=Jr((()=>i.setExpanded(t.id,!!t.collapsed)),[i,t.id,t.collapsed]),u=!r&&!l&&!a&&t.replyCount>0,h=Zr((()=>t.visible&&so(m,{children:t.annotation?so(m,{children:[so(zf,{annotation:t.annotation}),so(Mf,{annotation:t.annotation,isReply:r,onToggleReplies:u?c:void 0,replyCount:t.replyCount,threadIsCollapsed:t.collapsed})]}):so(Lf,{isReply:r,
|
|
573
|
+
onToggleReplies:u?c:void 0,replyCount:t.replyCount,threadIsCollapsed:t.collapsed})})),[r,c,u,t.annotation,t.replyCount,t.collapsed,t.visible]);return so("section",{className:"flex","data-testid":"thread-container",children:[r&&so(Of,{threadIsCollapsed:t.collapsed,onToggleReplies:c}),so("div",{className:Pr("grow max-w-full"),"data-testid":"thread-content",children:[h,Hs(t)>0&&so("div",{className:"space-y-2",children:[!t.parent&&t.annotation&&so(Ef,{annotation:t.annotation,isEditing:l,replyCount:t.replyCount,threadIsCollapsed:t.collapsed}),so("div",{children:so(fo,{onClick:()=>n.forceVisible(t),children:["Show ",Hs(t)," more in conversation"]})})]}),!t.collapsed&&so("ul",{className:Pr("-ml-3"),"data-testid":"thread-children",children:o.map((t=>so("li",{className:"mt-2",children:so(e,{thread:t,threadsService:n})},t.id)))})]})]})}),["threadsService"]);var Df=Jo((function({frameSync:e,thread:t}){var n,r
|
|
574
|
+
;const o=ys(),i=null!==(n=null===(r=t.annotation)||void 0===r?void 0:r.$tag)&&void 0!==n?n:null,a=i&&o.isAnnotationFocused(i),s=Zr((()=>ul((t=>{const n=t?[t]:[];e.focusAnnotations(n)}),10)),[e]),l=Jr((t=>{e.scrollToAnnotation(t)}),[e]),c=Zr((()=>so(Rf,{thread:t})),[t]);return so(bo,{classes:Pr("p-3 cursor-pointer",{"is-focused":a}),"data-testid":"thread-card",onClick:e=>{var t;(t=e.target).closest("button")||t.closest("a")||!i||l(i)},onMouseEnter:()=>s(null!=i?i:null),onMouseLeave:()=>s(null),children:c},t.id)}),["frameSync"]);function If(){const e=document.querySelector(".js-thread-list-scroll-root");if(!e)throw new Error("Scroll container is missing");return e}function Pf(e){return Math.max(e-e%50,0)}function Bf({threads:e}){const[t,n]=Vr(0),[r,o]=Vr(0);Kr((()=>{const e=new hl,t=If();n(t.clientHeight),o(Pf(t.scrollTop));const r=ul((()=>{n(t.clientHeight),o(Pf(t.scrollTop))}),10,{maxWait:100});return e.add(t,"scroll",r),e.add(window,"resize",r),()=>{e.removeAll(),r.cancel()}}),[])
|
|
575
|
+
;const[i,a]=Vr((()=>new Map)),[s,l]=Vr(null),c=e,{offscreenLowerHeight:u,offscreenUpperHeight:h,visibleThreads:d}=Zr((()=>function(e,t,n,r,o=dl){const{defaultHeight:i,marginAbove:a,marginBelow:s}=o,l=[];let c=0,u=0,h=0;return e.forEach((e=>{const o=t.get(e.id)||i;c+o<n-a?u+=o:c<n+r+s?l.push(e):h+=o,c+=o})),{visibleThreads:l,offscreenUpperHeight:u,offscreenLowerHeight:h}}(c,i,r,t)),[c,i,r,t]),p=ys(),m=(()=>{const e=p.unsavedAnnotations();return e.length?e[e.length-1].$tag:null})();return Wr((()=>{m&&(p.setForcedVisible(m,!0),l(m))}),[p,m]),Wr((()=>{if(!s)return;const e=c.findIndex((e=>e.id===s));if(-1===e)return;l(null);const t=c.slice(0,e).reduce(((e,t)=>e+(e=>i.get(e.id)||dl.defaultHeight)(t)),0);If().scrollTop=t}),[s,c,i]),Wr((()=>{a((e=>{const t=new Map;for(let{id:n}of d){const r=document.getElementById(n);if(!r)return console.warn("ThreadList could not measure thread. Element not found."),e;const o=pl(r);o!==e.get(n)&&t.set(n,o)}return 0===t.size?e:new Map([...e,...t])}))}),[d]),so("div",{
|
|
576
|
+
children:[so("div",{style:{height:h}}),d.map((e=>so("div",{className:Pr("mb-3"),"data-testid":"thread-card-container",id:e.id,children:so(Df,{thread:e})},e.id))),so("div",{style:{height:u}})]})}function Ff({errorType:e,onLoginRequest:t,showClearSelection:n=!1}){const r=ys(),o=r.isLoggedIn();return so("div",{className:"mb-4",children:so(Io,{icon:"restricted",title:"annotation"===e?"Annotation unavailable":"Group unavailable",children:[so("p",{children:o?"group"===e?"The current URL links to a group, but that group cannot be found,\n or you do not have permission to view the annotations in that group.":"The current URL links to an annotation, but that annotation\n cannot be found, or you do not have permission to view it.":`The ${e} associated with the current URL is unavailable.\n You may need to log in to see it.`}),so("div",{className:"flex justify-end space-x-2",children:[n&&so(fo,{variant:o?"primary":void 0,onClick:()=>r.clearSelection(),children:"Show all annotations"}),!o&&so(fo,{
|
|
577
|
+
variant:"primary",onClick:t,children:"Log in"})]})]})})}var jf=Jo((function({loadAnnotationsService:e,onLogin:t}){const n=ys(),r=n.routeParams().id,o=Ks(),i=n.profile().userid,[a,s]=Vr(!1);return Wr((()=>{s(!1),n.clearAnnotations(),e.loadThread(r).then((e=>{const t=e.filter((e=>0===(e.references||[]).length))[0];t&&(e.forEach((e=>n.setExpanded(e.id,!0))),t.id!==r&&n.highlightAnnotations([r]))})).catch((()=>{s(!0)}))}),[r,i,e,n]),so(m,{children:[a&&so(Ff,{errorType:"annotation",onLoginRequest:t}),so(Bf,{threads:o.children})]})}),["loadAnnotationsService"]);function Uf({additionalCount:e=0,entitySingular:t="annotation",entityPlural:n="annotations",filterQuery:r,focusDisplayName:o,resultCount:i}){return so(m,{children:[i>0&&so("span",{children:"Showing "}),so("span",{className:"whitespace-nowrap font-bold",children:[i>0?i:"No"," ",1===i?t:n]}),r&&so("span",{children:[" ","for ",so("span",{className:"break-words",children:`'${r}'`})]}),o&&so("span",{children:[" ","by"," ",so("span",{
|
|
578
|
+
className:"whitespace-nowrap font-bold",children:o})]}),e>0&&so("span",{className:"whitespace-nowrap italic text-color-text-light",children:[" ","(and ",e," more)"]})]})}function Hf(){const e=ys(),t=Ks(),n=e.annotationCount(),r=e.directLinkedAnnotationId(),o=e.filterQuery(),i=e.focusState(),a=e.forcedVisibleThreads().length,s=e.selectedAnnotations().length,l=Zr((()=>s>0?"selection":o?"query":i.configured?"focus":null),[s,o,i]),c=Zr((()=>"selection"===l?s:qs(t)-a),[l,s,t,a]),u=Zr((()=>{if("selection"===l){return(t.children||[]).filter((e=>e.annotation&&e.visible)).length-s}return a}),[l,a,t.children,s]),h=Zr((()=>{if("selection"===l){return!i.configured&&!r?`Show all (${n})`:"Show all"}return"focus"===l?a>0?"Reset filters":i.active?"Show all":`Show only ${i.displayName}`:"Clear search"}),[n,r,i,l,a]);return so(bo,{classes:Pr("mb-3 p-3",{"sr-only":!l}),children:so("div",{className:"flex items-center justify-center space-x-1",children:e.isLoading()?so(Bo,{}):so(m,{children:[so("div",{
|
|
579
|
+
className:Pr("grow min-w-[0]"),role:"status",children:l&&so(Uf,{additionalCount:u,entitySingular:"query"===l?"result":"annotation",entityPlural:"query"===l?"results":"annotations",filterQuery:o,focusDisplayName:"selection"!==l&&i.active?i.displayName:"",resultCount:c})}),l&&so(fo,{icon:"focus"===l?void 0:"cancel",onClick:"focus"!==l||a?()=>e.clearSelection():()=>e.toggleFocusMode(),title:h,variant:"primary",children:h})]})})})}function qf({onLogin:e}){const t=ys();return so("div",{className:"flex flex-col items-center m-6 space-y-6",children:[so("span",{className:"text-center",children:["This is a public annotation created with Hypothesis. ",so("br",{}),"To reply or make your own annotations on this document,"," ",so(To,{classes:"inline text-color-text underline hover:underline",href:t.getLink("signup"),target:"_blank",children:"create a free account"})," ","or"," ",so(go,{classes:"inline underline",onClick:e,variant:"dark",children:"log in"}),"."]}),so("div",{children:so(To,{href:"https://hypothes.is",
|
|
580
|
+
"aria-label":"Hypothesis homepage",target:"_blank",title:"Hypothesis homepage",children:so(Ao,{name:"logo",classes:"w-16 h-16 text-grey-7"})})})]})}function $f(e,t,n){e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,e.scrollTop=n)}function Gf(e){var t=e._scrollSettings;if(t){var n=t.maxSynchronousAlignments,r=function(e,t){var n,r,o,i,a,s,l,c=e.align,u=e.target.getBoundingClientRect(),h=c&&null!=c.left?c.left:.5,d=c&&null!=c.top?c.top:.5,p=c&&null!=c.leftOffset?c.leftOffset:0,m=c&&null!=c.topOffset?c.topOffset:0,f=h,g=d;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-=p,o-=m,r=e.align.lockX?t.pageXOffset:r,o=e.align.lockY?t.pageYOffset:o,i=r-t.pageXOffset,a=o-t.pageYOffset;else{s=u.width,l=u.height,n=t.getBoundingClientRect();var v=u.left-(n.left-t.scrollLeft),_=u.top-(n.top-t.scrollTop);r=v+s*f-t.clientWidth*f,o=_+l*g-t.clientHeight*g,r-=p,o-=m,
|
|
581
|
+
r=Math.max(Math.min(r,t.scrollWidth-t.clientWidth),0),o=Math.max(Math.min(o,t.scrollHeight-t.clientHeight),0),r=e.align.lockX?t.scrollLeft:r,o=e.align.lockY?t.scrollTop:o,i=r-t.scrollLeft,a=o-t.scrollTop}return{x:r,y:o,differenceX:i,differenceY:a}}(t,e),o=Date.now()-t.startTime,i=Math.min(1/t.time*o,1);if(t.endIterations>=n)return $f(e,r.x,r.y),e._scrollSettings=null,t.end("complete");var a=1-t.ease(i);if($f(e,r.x-r.differenceX*a,r.y-r.differenceY*a),o>=t.time)return t.endIterations++,t.scrollAncestor&&Gf(t.scrollAncestor),void Gf(e);!function(e){if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTimeout(e,16)}(Gf.bind(null,e))}}function Vf(e){return e.self===e}function Yf(e){return"pageXOffset"in e||(e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth)&&"hidden"!==getComputedStyle(e).overflow}function Wf(){return!0}function Kf(e){if(e.assignedSlot)return Kf(e.assignedSlot)
|
|
582
|
+
;if(e.parentElement)return"BODY"===e.parentElement.tagName?e.parentElement.ownerDocument.defaultView||e.parentElement.ownerDocument.ownerWindow:e.parentElement;if(e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t.host}}var Xf=function(e,t,n){if(e){"function"==typeof t&&(n=t,t=null),t||(t={}),t.time=isNaN(t.time)?1e3:t.time,t.ease=t.ease||function(e){return 1-Math.pow(1-e,e/2)},t.align=t.align||{};var r=Kf(e),o=1,i=t.validTarget||Wf,a=t.isScrollable;t.debug&&(console.log("About to scroll to",e),r||console.error("Target did not have a parent, is it mounted in the DOM?"));for(var s=[];r;)if(t.debug&&console.log("Scrolling parent node",r),i(r,o)&&(a?a(r,Yf):Yf(r))&&(o++,s.push(r)),!(r=Kf(r))){l("complete");break}return s.reduce(((n,r,o)=>function(e,t,n,r,o){var i,a=!t._scrollSettings,s=t._scrollSettings,l=Date.now(),c={passive:!0};function u(e){t._scrollSettings=null,t.parentElement&&t.parentElement._scrollSettings&&t.parentElement._scrollSettings.end(e),
|
|
583
|
+
n.debug&&console.log("Scrolling ended with type",e,"for",t),o(e),i&&(t.removeEventListener("touchstart",i,c),t.removeEventListener("wheel",i,c))}s&&s.end("canceled");var h=n.maxSynchronousAlignments;return null==h&&(h=3),t._scrollSettings={startTime:l,endIterations:0,target:e,time:n.time,ease:n.ease,align:n.align,isWindow:n.isWindow||Vf,maxSynchronousAlignments:h,end:u,scrollAncestor:r},"cancellable"in n&&!n.cancellable||(i=u.bind(null,"canceled"),t.addEventListener("touchstart",i,c),t.addEventListener("wheel",i,c)),a&&Gf(t),i}(e,r,t,s[o+1],l)),null)}function l(e){--o||n&&n(e)}};function Zf({children:e,icon:t="",panelName:n,title:r,onActiveChanged:o}){const i=ys(),a=i.isSidebarPanelOpen(n),s=Xr(null),l=Xr(a);Wr((()=>{l.current!==a&&(l.current=a,a&&s.current&&Xf(s.current),"function"==typeof o&&o(a))}),[a,o]);const c=Jr((()=>{i.toggleSidebarPanel(n,!1)}),[i,n]);return so(af,{visible:a,children:so("div",{ref:s,className:"mb-4",children:so(Io,{title:r,icon:t,onClose:c,children:e})})})}
|
|
584
|
+
function Jf({onLogin:e,onSignUp:t}){return ys().isLoggedIn()?null:so(Zf,{icon:"restricted",title:"Login needed",panelName:"loginPrompt",children:[so("p",{children:"Please log in to create annotations or highlights."}),so(yo,{children:[so(fo,{title:"Sign up",onClick:t,children:"Sign up"}),so(fo,{title:"Log in",variant:"primary",onClick:e,children:"Log in"})]})]})}function Qf({children:e,count:t,isWaitingToAnchor:n,isSelected:r,label:o,onSelect:i}){const a=()=>{r||i()},s=t>0?`${o} (${t} available)`:o;return so(go,{classes:Pr("inline bg-transparent min-w-[5.25rem] text-color-text hover:!no-underline",{"font-bold":r}),onClick:a,onMouseDown:a,pressed:!!r,role:"tab",tabIndex:0,title:s,children:so(m,{children:[e,t>0&&!n&&so("span",{className:"relative bottom-[3px] left-[2px] text-tiny",children:t})]})})}var eg=Jo((function({annotationsService:e,isLoading:t,settings:n}){const r=ys(),o=r.selectedTab(),i=r.noteCount(),a=r.annotationCount(),s=r.orphanCount(),l=r.isWaitingToAnchorAnnotations(),c=e=>{r.clearSelection(),
|
|
585
|
+
r.selectTab(e)},u="annotation"===o&&0===a&&!l,h="note"===o&&0===i;return so("div",{className:Pr("space-y-3 pb-[9px]"),children:[so("div",{className:"flex gap-x-6 theme-clean:ml-[15px]",role:"tablist",children:[so(Qf,{count:a,isWaitingToAnchor:l,isSelected:"annotation"===o,label:"Annotations",onSelect:()=>c("annotation"),children:"Annotations"}),so(Qf,{count:i,isWaitingToAnchor:l,isSelected:"note"===o,label:"Page notes",onSelect:()=>c("note"),children:"Page Notes"}),s>0&&so(Qf,{count:s,isWaitingToAnchor:l,isSelected:"orphan"===o,label:"Orphans",onSelect:()=>c("orphan"),children:"Orphans"})]}),"note"===o&&n.enableExperimentalNewNoteButton&&so("div",{className:"flex justify-end",children:so(fo,{"data-testid":"new-note-button",icon:"add",onClick:()=>e.createPageNote(),variant:"primary",style:Xo(["ctaBackgroundColor"],n),children:"New note"})}),!t&&h&&so(_o,{classes:"text-center",children:so("span",{"data-testid":"notes-unavailable-message",children:"There are no page notes in this group."})}),!t&&u&&so(_o,{
|
|
586
|
+
classes:"text-center",children:so("span",{"data-testid":"annotations-unavailable-message",children:["There are no annotations in this group.",so("br",{}),"Create one by selecting some text and clicking the"," ",so(Ao,{classes:"inline m-0.5 -mt-0.5",name:"annotate",title:"Annotate"})," ","button."]})})]})}),["annotationsService","settings"]);var tg=Jo((function({frameSync:e,onLogin:t,onSignUp:n,loadAnnotationsService:r,streamer:o}){const i=Ks(),a=ys(),s=a.focusedGroupId(),l=a.hasAppliedFilter()||a.hasSelectedAnnotations(),c=a.isLoading(),u=a.isLoggedIn(),h=a.directLinkedAnnotationId(),d=h?a.findAnnotationByID(h):void 0,p=d?js(d):"annotation",m=a.searchUris(),f=a.hasSidebarOpened(),g=a.profile().userid,v=d&&!1===d.$orphan?d.$tag:null,_=!(c||!h)&&!d,b=a.directLinkedGroupFetchFailed(),y=_||b,w=!y,x=!y&&!l,k=h&&!u&&!_&&!c,S=Xr(s);Wr((()=>{if(!S.current||S.current!==s){if(S.current){let e=a.focusState().active;a.clearSelection(),e&&a.toggleFocusMode(!0)}S.current=s}s&&m.length&&r.load({groupId:s,uris:m})
|
|
587
|
+
}),[a,r,s,g,m]),Wr((()=>{v?(e.focusAnnotations([v]),e.scrollToAnnotation(v),a.selectTab(p)):d&&a.selectTab(p)}),[p,e,d,v,a]);const C=a.hasFetchedProfile();return Wr((()=>{C&&(f||u)&&o.connect({applyUpdatesImmediately:!1})}),[C,u,f,o]),so("div",{children:[so("h2",{className:"sr-only",children:"Annotations"}),w&&so(Hf,{}),so(Jf,{onLogin:t,onSignUp:n}),_&&so(Ff,{errorType:"annotation",onLoginRequest:t,showClearSelection:!0}),b&&so(Ff,{errorType:"group",onLoginRequest:t}),x&&so(eg,{isLoading:c}),so(Bf,{threads:i.children}),k&&so(qf,{onLogin:t})]})}),["frameSync","loadAnnotationsService","streamer"]);var ng=Jo((function({api:e,toastMessenger:t}){const n=ys(),r=n.routeParams().q,o=Jr((async t=>{const r={_separate_replies:!0,offset:0,limit:20,...Os(t)};try{n.annotationFetchStarted();const t=await e.search(r);n.addAnnotations([...t.rows,...t.replies])}finally{n.annotationFetchFinished()}}),[e,n]);return Wr((()=>{n.setSortKey("Newest"),n.clearAnnotations(),o(r).catch((e=>{
|
|
588
|
+
t.error(`Unable to fetch annotations: ${e.message}`)}))}),[r,o,n,t]),so(Bf,{threads:Ks().children})}),["api","toastMessenger"]);class rg{constructor(e,t,n=window){var r,o,i;const a="N/A";let s=a;e.userid&&(s=e.userid,e.displayName&&(s=`${e.displayName} (${s})`)),this.version="1.1070.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||a,this.fingerprint=null!==(r=null===(o=t[0])||void 0===o||null===(i=o.metadata)||void 0===i?void 0:i.documentFingerprint)&&void 0!==r?r:a,this.account=s,this.timestamp=(new Date).toString()}asFormattedString(){return`Version: ${this.version}\nUser Agent: ${this.userAgent}\nURL: ${this.urls}\nFingerprint: ${this.fingerprint}\nAccount: ${this.account}\nDate: ${this.timestamp}\n`}asEncodedURLString(){return encodeURIComponent(this.asFormattedString())}}function og(e){const t=I(e);return!(null==t||!t.authority)&&t.authority!==e.authDomain}function ig({commandName:e,iconName:t}){return so("span",{className:"whitespace-nowrap",children:[so(Ao,{name:t,
|
|
589
|
+
classes:Pr("mx-1 -mt-1","text-color-text-light inline")}),so("em",{children:e})]})}var ag=Jo((function({settings:e}){const t=!og(e);return so("ol",{className:"list-decimal pl-10 space-y-2",children:[so("li",{children:["To create an annotation, select text and then select the"," ",so(ig,{iconName:"annotate",commandName:"Annotate"})," ","button."]}),so("li",{children:["To create a highlight (",so(To,{classes:"underline hover:underline",href:"https://web.hypothes.is/help/why-are-highlights-private-by-default/",target:"_blank",children:"visible only to you"}),"), select text and then select the"," ",so(ig,{iconName:"highlight",commandName:"Highlight"})," ","button."]}),t&&so("li",{children:["To annotate in a private group, select the group from the groups dropdown. Don't see your group? Ask the group creator to send a"," ",so(To,{classes:"underline hover:underline",href:"https://web.hypothes.is/help/how-to-join-a-private-group/",target:"_blank",children:"join link"}),")."]}),so("li",{
|
|
590
|
+
children:["To reply to an annotation, select the"," ",so(ig,{iconName:"reply",commandName:"Reply"})," button."]})]})}),["settings"]);function sg({label:e,children:t,classes:n}){return so(m,{children:[so("dt",{className:"col-span-1 sm:text-right font-medium",children:e}),so("dd",{className:Pr("col-span-1 sm:col-span-3 text-color-text-light break-words",n),children:t})]})}var lg=Jo((function({toastMessenger:e,versionData:t}){return so("div",{className:"space-y-4",children:[so("dl",{className:"grid grid-cols-1 sm:grid-cols-4 sm:gap-x-2",children:[so(sg,{label:"Version",children:t.version}),so(sg,{label:"User Agent",children:t.userAgent}),so(sg,{classes:Pr("break-all"),label:"URL",children:t.urls}),so(sg,{label:"Fingerprint",children:t.fingerprint}),so(sg,{label:"Account",children:t.account}),so(sg,{label:"Date",children:t.timestamp})]}),so("div",{className:"flex items-center justify-center",children:so(fo,{onClick:()=>{try{wl(t.asFormattedString()),e.success("Copied version info to clipboard")}catch(t){
|
|
591
|
+
e.error("Unable to copy version info")}},icon:"copy",children:"Copy version details"})})]})}),["toastMessenger"]);function cg({children:e,onClick:t}){return so(go,{classes:"leading-none text-brand",onClick:t,children:[e,so(Ao,{classes:"ml-1",name:"arrow-right"})]})}function ug({linkText:e,url:t}){return so("div",{className:"flex-1 border-r last-of-type:border-r-0",children:so(To,{href:t,classes:"flex items-center justify-center space-x-2 text-color-text-light text-lg font-medium",target:"_blank",children:[so("span",{children:e})," ",so(Ao,{name:"external",classes:"w-3 h-3"})]})})}var hg=Jo((function({auth:e,session:t}){const n=ys(),r=n.frames(),o=n.mainFrame(),i=!!n.profile().preferences.show_sidebar_tutorial,[a,s]=Vr("tutorial"),l=Zr((()=>{const t=e||{status:"logged-out"},n=[...r].sort(((e,t)=>e===o?-1:t===o?1:0));return new rg(t,n)}),[e,r,o]),c=`https://web.hypothes.is/get-help/?sys_info=${l.asEncodedURLString()}`,u=(e,t)=>{e.preventDefault(),s(t)};return so(Zf,{title:"Help",panelName:"help",
|
|
592
|
+
onActiveChanged:Jr((e=>{!e&&i&&t.dismissSidebarTutorial()}),[t,i]),children:so("div",{className:"space-y-4",children:[so("div",{className:"flex items-center",children:[so("h3",{className:"grow text-lg font-medium","data-testid":"subpanel-title",children:{tutorial:"Getting started",versionInfo:"About this version"}[a]}),"versionInfo"===a&&so(cg,{onClick:e=>u(e,"tutorial"),children:"Getting started"}),"tutorial"===a&&so(cg,{onClick:e=>u(e,"versionInfo"),children:"About this version"})]}),so("div",{className:"border-y py-4",children:["tutorial"===a&&so(ag,{}),"versionInfo"===a&&so(lg,{versionData:l})]}),so("div",{className:"flex items-center",children:[so(ug,{linkText:"Help topics",url:"https://web.hypothes.is/help/"}),so(ug,{linkText:"New support ticket",url:c})]})]})})}),["session"]),dg={exports:{}};function pg(){}pg.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,
|
|
593
|
+
this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r<o;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],o=[];if(r&&t)for(var i=0,a=r.length;i<a;i++)r[i].fn!==t&&r[i].fn._!==t&&o.push(r[i]);return o.length?n[e]=o:delete n[e],this}},dg.exports=pg;var mg=dg.exports.TinyEmitter=pg;class fg extends Error{constructor(e){super(`Results size exceeds ${e}`)}}function gg(e){return 0===e?50:200}class vg extends mg{constructor(e,{getPageSize:t=gg,separateReplies:n=!0,incremental:r=!0,maxResults:o=null,sortBy:i="created",sortOrder:a="asc"}={}){super(),this._searchFn=e,this._getPageSize=t,this._separateReplies=n,this._incremental=r,this._maxResults=o,this._sortBy=i,this._sortOrder=a,this._canceled=!1,this._results=[],this._resultCount=null}async _getPage(e,t,n=0){const r=this._getPageSize(n),o={limit:r,sort:this._sortBy,order:this._sortOrder,_separate_replies:this._separateReplies,...e}
|
|
594
|
+
;t&&(o.search_after=t);try{const t=await this._searchFn(o);if(this._canceled)return;if(null===this._resultCount&&(this._resultCount=t.total,this.emit("resultCount",this._resultCount)),this._maxResults&&t.total>this._maxResults)return this.emit("error",new fg(this._maxResults)),void this.emit("end");const i=t.rows.concat(t.replies||[]);this._incremental?this.emit("results",i):this._results=this._results.concat(i);const a=i.length===r,s=i.length>0?i[i.length-1][this._sortBy]:null;a&&s?this._getPage(e,s,n+1):(this._incremental||this.emit("results",this._results),this.emit("end"))}catch(e){if(this._canceled)return;this.emit("error",e),this.emit("end")}}get(e){this._results=[],this._resultCount=null,this._getPage(e)}cancel(){this._canceled=!0,this.emit("end")}}function _g({defaultOption:e,icon:t,onSelect:n,options:r,selectedOption:o,title:i}){const a=[e,...r],s=null!=o?o:e,l=so("span",{className:Pr("shrink-0 flex items-center gap-x-2","text-color-text font-bold text-lg"),children:[t&&so(Ao,{name:t,
|
|
595
|
+
classes:"w-4 h-4"}),s.display]});return so(of,{label:l,title:i,contentClass:Pr("max-h-[70vh] tall:max-h-[504px] overflow-y-auto"),children:a.map((e=>so(lf,{onClick:()=>n(e),isSelected:e.value===s.value,label:e.display},e.value)))})}function bg(){const e=ys(),t=e.getFilter("user"),n=function(){const e=ys(),t=e.allAnnotations(),n=e.getFocusFilters(),r=Yo(e.profile().userid),o=e.defaultAuthority(),i=e.isFeatureEnabled("client_display_names");return Zr((()=>{const e={};if(t.forEach((t=>{const n=Yo(t.user);e[n]=ml(t,o,i)})),n.user){const t=Yo(n.user.value)||n.user.value;e[t]=n.user.display}const a=Object.keys(e).map((t=>({display:t===r?`${e[t]} (Me)`:e[t],value:t})));return a.sort(((e,t)=>r===e.value?-1:r===t.value?1:e.display.localeCompare(t.display))),a}),[t,r,o,i,n.user])}();return so(_g,{defaultOption:{value:"",display:"Everybody"},icon:"profile",onSelect:t=>e.setFilter("user",t),options:n,selectedOption:t,title:"Filter by user"})}function yg({forcedVisibleCount:e,isFiltered:t,isLoading:n,resultCount:r}){
|
|
596
|
+
const o=Ks(),i=n?r:qs(o),a=o.children.length>0,s=t&&e>0,l=i-e,c=o.children.length;return so("div",{className:"flex gap-x-1 leading-none",children:[n&&so(Bo,{size:"small"}),!n&&so("h2",{className:"font-bold",children:[!a&&so("span",{children:"No results"}),a&&t&&so("span",{children:[l," ",1===l?"result":"results"]}),a&&!t&&so("span",{children:[c," ",1===c?"thread":"threads"]})]}),s&&so("h3",{className:"italic font-normal",children:["(and ",e," more)"]}),!t&&a&&so("h3",{className:"italic font-normal",children:["(",i," ",1===i?"annotation":"annotations",")"]})]})}function wg({currentPage:e,onChangePage:t,totalPages:n}){const r=e<n,o=e>1,i=function(e,t,n=5){if(t<=1)return[];const r=new Set([1,e,t]);let o=1;for(;r.size<Math.min(t,n);)e+o<=t&&r.add(e+o),e-o>=1&&r.add(e-o),++o;const i=[];return[...r].sort(((e,t)=>e-t)).forEach(((e,t,n)=>{t>0&&e-n[t-1]>1&&i.push(null),i.push(e)})),i}(e,n),a=(e,n)=>{t(e),n.blur()};return so("div",{className:"flex items-center text-lg","data-testid":"pagination-navigation",
|
|
597
|
+
children:[so("div",{className:"w-28 h-10",children:o&&so(fo,{classes:"p-navigation-button",icon:"arrow-left",title:"Go to previous page",onClick:t=>a(e-1,t.target),variant:"dark",children:"prev"})}),so("ul",{className:Pr("hidden","md:flex md:items-center md:justify-center md:gap-x-2","md:grow"),children:i.map(((t,n)=>so("li",{children:null===t?so("div",{"data-testid":"pagination-gap",children:"..."}):so(fo,{classes:"p-navigation-button",title:`Go to page ${t}`,pressed:t===e,onClick:e=>a(t,e.target),variant:"dark",children:t.toString()},`page-${n}`)},n)))}),so("div",{className:Pr("w-28 h-10 flex justify-end","grow md:grow-0"),children:r&&so(fo,{classes:"p-navigation-button",icon:"arrow-right",iconPosition:"right",title:"Go to next page",onClick:t=>a(e+1,t.target),variant:"dark",children:"next"})})]})}function xg({currentPage:e,isLoading:t,onChangePage:n,threads:r,pageSize:o=25}){const{paginatedThreads:i,totalPages:a}=Zr((()=>{const t=r.filter((e=>qs(e)>0)),n=(e-1)*o,i=n+o,a=Math.ceil(t.length/o);return{
|
|
598
|
+
paginatedThreads:t.slice(n,i),totalPages:a}}),[r,e,o]);return so(m,{children:[so(Bf,{threads:i}),!t&&so(wg,{currentPage:e,onChangePage:n,totalPages:a})]})}var kg=Jo((function({loadAnnotationsService:e,streamer:t}){var n;const r=ys(),o=r.getFilterValues(),i=r.focusedGroup(),a=r.forcedVisibleThreads().length,s=r.hasAppliedFilter(),l=r.isLoading(),c=r.annotationResultCount(),u=r.pendingUpdateCount(),h=Ks(),d=null!==(n=null==i?void 0:i.name)&&void 0!==n?n:"…",p=(null==i?void 0:i.id)||r.directLinkedGroupId(),m=Xr(1),[f,g]=Vr(1),[v,_]=Vr(!1),b=e=>{e instanceof fg&&_(!0)},y=r.hasFetchedProfile();Wr((()=>{y&&t.connect({applyUpdatesImmediately:!1})}),[y,t]),Wr((()=>{r.setSortKey("Newest"),p&&e.load({groupId:p,sortBy:"updated",sortOrder:"desc",maxResults:5e3,onError:b,streamFilterBy:"group"})}),[e,p,r]);const w=e=>{g(e)};Wr((()=>{w(1)}),[o,i]);const x=Xr(null);Kr((()=>{f!==m.current&&(x.current&&Xf(x.current),m.current=f)}),[f]);const k=`Show ${u} new or updated ${u>1?"annotations":"annotation"}`;return so("div",{
|
|
599
|
+
className:"grid gap-2 lg:grid-cols-2","data-testid":"notebook-container",children:[so("header",{className:"leading-none lg:col-span-2",ref:x,children:so("h1",{className:"text-2xl font-bold","data-testid":"notebook-group-name",children:d})}),so("div",{className:"justify-self-start",children:so(bg,{})}),so("div",{className:"flex items-center lg:justify-self-end text-lg font-medium",children:[u>0&&!s&&so(mo,{icon:"refresh",onClick:()=>t.applyPendingUpdates(),variant:"primary",title:k}),so(yg,{forcedVisibleCount:a,isFiltered:s,isLoading:l,resultCount:null!=c?c:0})]}),so("div",{className:"lg:col-span-2",children:[v&&so("div",{className:"py-4","data-testid":"notebook-messages",children:so(Io,{title:"Too many results to show",children:["This preview of the Notebook can show"," ",so("strong",{children:["up to ",5e3," results"]})," at a time (there are"," ",c," to show here)."," ",so("a",{
|
|
600
|
+
href:"mailto:support@hypothes.is?subject=Hypothesis%20Notebook&body=Please%20notify%20me%20when%20the%20Hypothesis%20Notebook%20is%20updated%20to%20support%20more%20than%205000%20annotations",children:"Contact us"})," ","if you would like to be notified when support for more annotations is available."]})}),so(xg,{currentPage:f,isLoading:l,onChangePage:w,threads:h.children})]})]})}),["loadAnnotationsService","streamer"]);var Sg=Jo((function({toastMessenger:e}){const t=ys(),n=t.mainFrame(),r=t.focusedGroup(),o=`Share Annotations in ${r&&r.name||"..."}`,i=r&&n,a=i&&(s=n.uri,l=r.id,fl(s)?`https://hyp.is/go?url=${encodeURIComponent(s)}&group=${l}`:null);var s,l;return so(Zf,{title:o,panelName:"shareGroupAnnotations",children:[!i&&so("div",{className:"flex flex-row items-center justify-center",children:so(Bo,{})}),i&&so("div",{className:"text-color-text-light space-y-3",children:a?so(m,{children:[so("div",{className:"text-color-text font-medium","data-testid":"sharing-intro",children:"private"===r.type?so("p",{
|
|
601
|
+
children:"Use this link to share these annotations with other group members:"}):so("p",{children:"Use this link to share these annotations with anyone:"})}),so("div",{children:so(Uo,{children:[so(jo,{"aria-label":"Use this URL to share these annotations",type:"text",value:a,readOnly:!0}),so(mo,{icon:"copy",onClick:()=>{try{wl(a),e.success("Copied share link to clipboard")}catch(t){e.error("Unable to copy link")}},title:"Copy share link",variant:"dark"})]})}),so("p",{"data-testid":"sharing-details",children:["private"===r.type?so("span",{children:["Annotations in the private group"," ",so("em",{children:r.name})," are only visible to group members."]}):so("span",{children:["Anyone using this link may view the annotations in the group"," ",so("em",{children:r.name}),"."]})," ",so("span",{children:["Private (",so(Ao,{name:"lock",classes:"inline -mt-0.5"})," ",so("em",{children:"Only Me"}),") annotations are only visible to you."]})]}),so("div",{className:"text-[24px]",children:so(Sl,{shareURI:a})})]}):so("p",{
|
|
602
|
+
"data-testid":"no-sharing",children:"These annotations cannot be shared because this document is not available on the web."})})]})}),["toastMessenger"]);function Cg({message:e,onDismiss:t}){const n="notice"!==e.type?`${e.type.charAt(0).toUpperCase()+e.type.slice(1)}: `:"",r="notice"===e.type?"cancel":e.type;return so(bo,{classes:Pr("p-0 flex border",{"sr-only":e.visuallyHidden,"border-red-error":"error"===e.type,"border-yellow-notice":"notice"===e.type,"border-green-success":"success"===e.type}),onClick:()=>t(e.id),children:[so("div",{className:Pr("flex items-center p-3 text-white",{"bg-red-error":"error"===e.type,"bg-yellow-notice":"notice"===e.type,"bg-green-success":"success"===e.type}),children:so(Ao,{name:r,classes:Pr("mt-[2px]")})}),so("div",{className:Pr("grow p-3 !mt-0"),"data-testid":"toast-message-text",children:[so("strong",{children:n}),e.message,e.moreInfoURL&&so("div",{className:"text-right",children:so(To,{href:e.moreInfoURL,onClick:e=>e.stopPropagation(),target:"_new",children:"More info"})})]
|
|
603
|
+
})]})}var Eg=Jo((function({toastMessenger:e}){return so("div",{children:so("ul",{"aria-live":"polite","aria-relevant":"additions",className:"absolute z-2 left-0 w-full",children:ys().getToastMessages().map((t=>so("li",{className:Pr("relative w-full container hover:cursor-pointer",{"mb-2":!t.visuallyHidden,"motion-safe:animate-slide-in-from-right lg:animate-fade-in":!t.isDismissed,"motion-reduce:animate-fade-in":!t.isDismissed,"animate-fade-out":t.isDismissed}),children:so(Cg,{message:t,onDismiss:t=>e.dismiss(t)})},t.id)))})})}),["toastMessenger"]);function Ag(e){return e.organization&&e.organization.name}function Tg(e){const t={};return e.forEach((e=>{if("object"!=typeof e.organization)return;const n="__default__"===(r=e.organization).id?"__default__":`${r.name.toLowerCase()}${r.id}`;var r;void 0===t[n]&&(t[n]={...e.organization,groups:[]}),function(e,t){const n=Object.assign({},e),r=t.groups;!r.length&&e.organization.logo&&(n.logo=e.organization.logo),r.push(n)}(e,t[n])})),t}function Ng(e){
|
|
604
|
+
const t=Tg(e),n=[],r=[];return Object.keys(t).sort().forEach((e=>{"__default__"===e?n.push(...t[e].groups):r.push(...t[e].groups)})),n.length&&r.push(...n),r}function Mg({heading:e,children:t}){return so(m,{children:[e&&so("h2",{className:"text-color-text-light p-3 leading-none uppercase",children:e}),so("ul",{className:"border-b",children:x(t).map((e=>so("li",{children:e},e.key)))})]})}var Lg=Jo((function({isExpanded:e,group:t,groups:n,onExpand:r,toastMessenger:o}){const i=t.links.html,a=i||t.canLeave,s=t.scopes&&!t.scopes.enforced||t.isScopedToUri,l=ys(),c=l.focusedGroupId(),u=t.id===c,h=t=>{t.stopPropagation(),t.preventDefault(),r(!e)},d="private"===t.type?"Copy invite link":"Copy activity link";return so(lf,{icon:t.logo||"blank",iconAlt:Ag(t),isDisabled:!s,isExpanded:!!a&&e,isSelected:u,isSubmenuVisible:a?e:void 0,label:t.name,onClick:s?()=>{l.clearDirectLinkedGroupFetchFailed(),l.clearDirectLinkedIds(),n.focus(t.id)}:h,onToggleSubmenu:h,submenu:so(m,{children:[so("ul",{children:[i&&so("li",{
|
|
605
|
+
children:so(lf,{href:i,icon:"external",isSubmenuItem:!0,label:"View group activity"})}),i&&so("li",{children:so(lf,{onClick:()=>(e=>{try{wl(e),o.success(`Copied link for "${t.name}"`)}catch(e){o.error("Unable to copy link")}})(i),icon:"copy",isSubmenuItem:!0,label:d})}),t.canLeave&&so("li",{children:so(lf,{icon:"leave",isSubmenuItem:!0,label:"Leave group",onClick:async()=>{const e=`Are you sure you want to leave the group "${t.name}"?`;await Go({title:"Leave group?",message:e,confirmAction:"Leave"})&&n.leave(t.id)}})})]}),!s&&so("p",{className:Pr("p-2 pl-9 bg-grey-1 hyphens-none"),"data-testid":"unselectable-group-note",children:"This group is restricted to specific URLs."})]})})}),["groups","toastMessenger"]);function zg({expandedGroup:e,onExpandGroup:t,groups:n,heading:r}){return so(Mg,{heading:r,children:n.map((n=>so(Lg,{isExpanded:n===e,onExpand:e=>t(e?n:null),group:n},n.id)))})}var Og=Jo((function({settings:e}){
|
|
606
|
+
const t=ys(),n=t.getCurrentlyViewingGroups(),r=t.getFeaturedGroups(),o=t.getMyGroups(),i=t.focusedGroup(),a=t.profile().userid,s=Zr((()=>Ng(o)),[o]),l=Zr((()=>Ng(r)),[r]),c=Zr((()=>Ng(n)),[n]),u=t.defaultAuthority(),h=a&&!Wo(a,u),d=t.getLink("groups.new"),[p,m]=Vr(null);let f;if(i){const t=i.organization.logo||function(e){const t=I(e);return t&&t.icon?t.icon:null}(e)||"",n=Ag(i)?Ag(i):"";f=so("span",{className:Pr("shrink-0 flex items-center gap-x-1 text-lg text-color-text font-bold"),children:[t&&so("img",{className:Pr("relative top-[1px] w-4 h-4"),src:t,alt:n}),i.name]})}else f=so("span",{children:"…"});return!!og(e)&&n.length+r.length+o.length<2?f:so(of,{align:"left",contentClass:"min-w-[250px]",label:f,onOpenChanged:()=>m(null),title:i?`Select group (now viewing: ${i.name})`:"Select group",children:[c.length>0&&so(zg,{expandedGroup:p,onExpandGroup:m,heading:"Currently Viewing",groups:c}),l.length>0&&so(zg,{expandedGroup:p,onExpandGroup:m,heading:"Featured Groups",groups:l}),s.length>0&&so(zg,{
|
|
607
|
+
expandedGroup:p,onExpandGroup:m,heading:"My Groups",groups:s}),h&&so(lf,{icon:"add",href:d,label:"New private group"})]})}),["settings"]);function Rg({alwaysExpanded:e,query:t,onSearch:n}){const r=ys().isLoading(),o=Xr(),[i,a]=Vr(t),[s,l]=Vr(t);t!==i&&(l(t),a(t));const c=e||t;return so("form",{action:"#",className:Pr("relative","flex items-center","bg-white/90 hover:bg-white transition-colors"),name:"searchForm",onSubmit:e=>{e.preventDefault(),(o.current.value||i)&&n(o.current.value)},children:[so(jo,{"aria-label":"Search",classes:Pr("order-1","text-base",{"border-0":!c,"focus:border":!0,border:c},{"max-w-0 p-0":!c,"focus:max-w-[150px] focus:p-1.5 focus:ml-[2px]":!0,"max-w-[150px] p-1.5 ml-[2px]":c},"transition-[max-width] duration-300 ease-out"),dir:"auto",type:"text",name:"query",placeholder:r?"Loading…":"Search…",disabled:r,inputRef:o,value:s||"",onInput:e=>l(e.target.value)}),!r&&so("div",{className:"order-0",children:so(mo,{icon:"search",onClick:()=>o.current.focus(),size:"small",
|
|
608
|
+
title:"Search annotations"})}),r&&so(Bo,{size:"small"})]})}function Dg(){const e=ys(),t=e.sortKey(),n=e.sortKeys().map((n=>so(lf,{label:n,onClick:()=>e.setSortKey(n),isSelected:n===t},n))),r=so("span",{className:"p-1",children:so(Ao,{name:"sort"})});return so("div",{className:"SortMenu",children:so(of,{label:r,title:`Sort by ${t}`,align:"right",menuIndicator:!1,children:n})})}var Ig=Jo((function({router:e}){return so(Rg,{query:ys().routeParams().q,onSearch:t=>{e.navigate("stream",{q:t})},alwaysExpanded:!0})}),["router"]);var Pg=Jo((function({auth:e,frameSync:t,onLogout:n,settings:r}){const o=ys(),i=o.defaultAuthority(),a=Wo(e.userid,i),s=I(r),[l,c]=Vr(!1),u=e=>s&&!!s[e],h=!a||u("onProfileRequestProvided"),d=!a||u("onLogoutRequestProvided"),p=()=>{t.notifyHost("openNotebook",o.focusedGroupId())},m=()=>a&&t.notifyHost("profileRequested"),f=(()=>{const t={};return h&&(a||(t.href=o.getLink("user",{user:e.username})),t.onClick=m),t})(),g=so("span",{className:"p-1",children:so(Ao,{name:"profile"})})
|
|
609
|
+
;return so("div",{"data-testid":"user-menu",onKeyDown:e=>{"n"===e.key&&(p(),c(!1))},children:so(of,{label:g,title:e.displayName,align:"right",open:l,onOpenChanged:c,children:[so(Mg,{children:[so(lf,{label:e.displayName,isDisabled:!h,...f}),!a&&so(lf,{label:"Account settings",href:o.getLink("account.settings")}),so(lf,{label:"Open notebook",onClick:()=>p()})]}),d&&so(Mg,{children:so(lf,{label:"Log out",onClick:n})})]})})}),["frameSync","settings"]);var Bg=Jo((function({auth:e,frameSync:t,isSidebar:n,onLogin:r,onLogout:o,onSignUp:i,settings:a,streamer:s}){const l=!og(a),c=Xo(["accentColor"],a),u=ys(),h=u.filterQuery(),d=u.pendingUpdateCount(),p=u.isSidebarPanelOpen("help"),f=u.isSidebarPanelOpen("shareGroupAnnotations");return so("div",{className:Pr("absolute h-10 left-0 top-0 right-0 z-4","text-grey-7 border-b theme-clean:border-b-0 bg-white"),"data-testid":"top-bar",children:so("div",{className:Pr("container flex items-center h-full","text-xl"),"data-testid":"top-bar-content",
|
|
610
|
+
children:[so(n?Og:Ig,{}),so("div",{className:"grow flex items-center justify-end",children:[n&&so(m,{children:[d>0&&so(mo,{icon:"refresh",onClick:()=>s.applyPendingUpdates(),size:"small",variant:"primary",title:`Show ${d} new/updated ${1===d?"annotation":"annotations"}`}),so(Rg,{query:h||null,onSearch:u.setFilterQuery}),so(Dg,{}),l&&so(mo,{icon:"share",expanded:f,onClick:()=>{u.toggleSidebarPanel("shareGroupAnnotations")},size:"small",title:"Share annotations on this page"})]}),so(mo,{icon:"help",expanded:p,onClick:()=>{const e=I(a);e&&e.onHelpRequestProvided?t.notifyHost("helpRequested"):u.toggleSidebarPanel("help")},size:"small",title:"Help"}),"logged-in"===e.status?so(Pg,{auth:e,onLogout:o}):so("div",{className:"flex items-center text-lg font-medium space-x-1","data-testid":"login-links",children:["unknown"===e.status&&so("span",{children:"⋯"}),"logged-out"===e.status&&so(m,{children:[so(go,{classes:"inline",onClick:i,style:c,variant:"primary",children:"Sign up"}),so("div",{children:"/"}),so(go,{
|
|
611
|
+
classes:"inline",onClick:r,style:c,variant:"primary",children:"Log in"})]})]})]})]})})}),["frameSync","settings","streamer"]);var Fg=Jo((function({auth:e,frameSync:t,settings:n,session:r,toastMessenger:o}){const i=ys(),a=i.hasFetchedProfile(),s=i.profile(),l=i.route(),c=Zr((()=>a?function(e){const t=Vo(e.userid);if(t&&e.userid){let n=t.username;return e.user_info&&e.user_info.display_name&&(n=e.user_info.display_name),{status:"logged-in",displayName:n,userid:e.userid,username:t.username}}return{status:"logged-out"}}(s):{status:"unknown"}),[a,s]),u=Zr((()=>Xo(["appBackgroundColor"],n)),[n]),h="clean"===n.theme,d="sidebar"===l;Wr((()=>{(function(e,t,n){const r="object"==typeof t.preferences&&!!t.preferences.show_sidebar_tutorial,o=I(n)||{onHelpRequestProvided:!1};return e&&!o.onHelpRequestProvided&&r})(d,s,n)&&i.openSidebarPanel("help")}),[d,s,n,i]);const p=async()=>{if(I(n))t.notifyHost("loginRequested");else try{await e.login(),i.closeSidebarPanel("loginPrompt"),i.clearGroups(),r.reload()}catch(e){
|
|
612
|
+
o.error(e.message)}},m=()=>{I(n)?t.notifyHost("signupRequested"):window.open(i.getLink("signup"))};return so("div",{className:Pr("h-full min-h-full overflow-scroll","lg:pb-16 bg-grey-2","js-thread-list-scroll-root",{"theme-clean":h,"pt-[49px]":"notebook"!==l,"p-4 lg:p-12":"notebook"===l}),"data-testid":"hypothesis-app",style:u,children:["notebook"!==l&&so(Bg,{auth:c,onLogin:p,onSignUp:m,onLogout:async()=>{await(async()=>{const e=i.countDrafts();if(0===e)return!0;let t="";return 1===e?t="You have an unsaved annotation.\nDo you really want to discard this draft?":e>1&&(t="You have "+e+" unsaved annotations.\nDo you really want to discard these drafts?"),Go({title:"Discard drafts?",message:t,confirmAction:"Discard"})})()&&(i.clearGroups(),i.removeAnnotations(i.unsavedAnnotations()),i.discardAllDrafts(),I(n)?t.notifyHost("logoutRequested"):r.logout())},isSidebar:d}),so("div",{className:"container",children:[so(Eg,{}),so(hg,{auth:"logged-in"===c.status?c:{}}),so(Sg,{}),l&&so("main",{
|
|
613
|
+
children:["annotation"===l&&so(jf,{onLogin:p}),"notebook"===l&&so(kg,{}),"stream"===l&&so(ng,{}),"sidebar"===l&&so(tg,{onLogin:p,onSignUp:m})]})]})]})}),["auth","frameSync","session","settings","toastMessenger"]);function jg({error:e}){return so("div",{className:Pr("m-2 mt-12"),children:so(Io,{title:"Unable to start Hypothesis",children:e.message})})}class Ug{constructor(e,t,n){this._activity=e,this._api=t,this._store=n}_applyDraftChanges(e){const t={},n=this._store.getDraft(e);return n&&(t.tags=n.tags,t.text=n.text,t.permissions=n.isPrivate?gl(e.user):vl(e.user,e.group)),{...e,...t}}_initialize(e,t=new Date){const n=this._store.getDefault("annotationPrivacy"),r=this._store.focusedGroupId(),o=this._store.profile();if(!r)throw new Error("Cannot create annotation without a group");const i=o.userid;if(!i)throw new Error("Cannot create annotation when logged out");const a=o.user_info,s="s:"+U(8),l=Object.assign({created:t.toISOString(),group:r,permissions:_l(i,r,n),tags:[],text:"",updated:t.toISOString(),user:i,
|
|
614
|
+
user_info:a,$tag:s,hidden:!1,links:{},document:{title:""}},e);return Bi(l)&&(l.permissions=gl(i)),l}create(e,t=new Date){const n=this._initialize(e,t);this._store.addAnnotations([n]),this._store.deleteNewAndEmptyDrafts(),Bi(n)||this._store.createDraft(n,{tags:n.tags,text:n.text,isPrivate:!Ri(n)}),ji(n)?this._store.selectTab("note"):Ui(n)&&this._store.selectTab("annotation"),(n.references||[]).forEach((e=>{this._store.setExpanded(e,!0)}))}createPageNote(){const e=this._store.mainFrame();if(!this._store.isLoggedIn())return void this._store.openSidebarPanel("loginPrompt");if(!e)return;const t={target:[],uri:e.uri};this.create(t)}async delete(e){await this._api.annotation.delete({id:e.id}),this._activity.reportActivity("delete",e),this._store.removeAnnotations([e])}async flag(e){await this._api.annotation.flag({id:e.id}),this._activity.reportActivity("flag",e),this._store.updateFlagStatus(e.id,!0)}reply(e,t){const n={group:e.group,permissions:Ri(e)?vl(t,e.group):gl(t),references:(e.references||[]).concat(e.id),
|
|
615
|
+
target:[{source:e.target[0].source}],uri:e.uri};this.create(n)}async save(e){let t,n;const r=this._applyDraftChanges(e);let o;zi(e)?(t=this._api.annotation.update({id:e.id},r),n="update"):(t=this._api.annotation.create({},r),n="create"),this._store.annotationSaveStarted(e);try{o=await t,this._activity.reportActivity(n,o)}finally{this._store.annotationSaveFinished(e)}for(let[t,n]of Object.entries(e))if(t.startsWith("$")){o[t]=n}return this._store.removeDraft(e),this._store.addAnnotations([o]),o}}Ug.$inject=["annotationActivity","api","store"];class Hg{constructor(e){this._rpc=e.rpc,this._reportConfig=e.reportActivity}reportActivity(e,t){if(!this._rpc||!this._reportConfig)return;let n;switch(e){case"create":n=new Date(t.created).toISOString();break;case"update":n=new Date(t.updated).toISOString();break;default:n=(new Date).toISOString()}const r={date:n,annotation:{id:t.id,isShared:bl(t.permissions)}};this._reportConfig.events.includes(e)&&function(e,t,n,r=[]){const o={jsonrpc:"2.0",method:n,params:r}
|
|
616
|
+
;e.postMessage(o,t)}(this._rpc.targetFrame,this._rpc.origin,this._reportConfig.method,[e,r])}}Hg.$inject=["settings"];class qg 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 $g(e,t){let n,r;try{n=await fetch(e,t)}catch(t){throw new qg(e,null,t.message)}if(204===n.status)return null;try{r=await n.json()}catch(t){throw new qg(e,n,"Failed to parse response")}var o;if(!n.ok)throw new qg(e,n,null===(o=r)||void 0===o?void 0:o.reason);return r}function Gg(e){const t={};for(let[n,r]of Object.entries(e))n.startsWith("$")||(t[n]=r);return t}function Vg(e){return"url"in e}function Yg(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s)=>{o();try{const[o,l]=await Promise.all([e,n()]),c=function(e,t){let n=e;const r=t.split(".");for(let[e,t]of r.entries()){const o=n[t];if(!o||Vg(o)){if(o&&e===r.length-1)return o;break}n=o}return null}(o,t)
|
|
617
|
+
;if(!c)throw new Error(`Missing API route: ${t}`);const u={"Content-Type":"application/json","Hypothesis-Client-Version":"1.1070.0"};l&&(u.Authorization="Bearer "+l);const h=r();h&&(u["X-Client-Id"]=h);const{url:d,unusedParams:p}=Va(c.url,a),m=new URL(d);for(let[e,t]of Object.entries(p)){Array.isArray(t)||(t=[t]);for(let n of t)null!=n&&m.searchParams.append(e,n.toString())}return await $g(m.toString(),{body:s?JSON.stringify(Gg(s)):null,headers:u,method:c.method})}finally{i()}}}class Wg{constructor(e,t,n){const r=e.routes();this._clientId=null;const o=()=>this._clientId,i=e=>Yg(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")},
|
|
618
|
+
read:i("group.read")},this.groups={list:i("groups.read")},this.profile={groups:{read:i("profile.groups.read")},read:i("profile.read"),update:i("profile.update")}}setClientId(e){this._clientId=e}}Wg.$inject=["apiRoutes","auth","store"];var Kg={exports:{}},Xg={};function Zg(e,t){"boolean"==typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var Jg=Zg;Zg.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},Zg.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},Zg.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),
|
|
619
|
+
!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},Zg.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)},Zg.prototype.try=function(e){
|
|
620
|
+
console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},Zg.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},Zg.prototype.start=Zg.prototype.try,Zg.prototype.errors=function(){return this._errors},Zg.prototype.attempts=function(){return this._attempts},Zg.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var o=this._errors[r],i=o.message,a=(e[i]||0)+1;e[i]=a,a>=n&&(t=o,n=a)}return t},function(e){var t=Jg;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))
|
|
621
|
+
;return e&&e.forever&&!r.length&&r.push(this.createTimeout(o,t)),r.sort((function(e,t){return e-t})),r},e.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*Math.max(t.minTimeout,1)*Math.pow(t.factor,e));return r=Math.min(r,t.maxTimeout)},e.wrap=function(t,n,r){if(n instanceof Array&&(r=n,n=null),!r)for(var o in r=[],t)"function"==typeof t[o]&&r.push(o);for(var i=0;i<r.length;i++){var a=r[i],s=t[a];t[a]=function(r){var o=e.operation(n),i=Array.prototype.slice.call(arguments,1),a=i.pop();i.push((function(e){o.retry(e)||(e&&(arguments[0]=o.mainError()),a.apply(this,arguments))})),o.attempt((function(){r.apply(t,i)}))}.bind(t,s),t[a].options=n}}}(Xg);var Qg=Y(Kg.exports=Xg);function ev(e,t){return new Promise(((n,r)=>{const o=Qg.operation(t);o.attempt((async()=>{try{const t=await e();o.retry(),n(t)}catch(e){o.retry(e)||r(e)}}))}))}function tv(e){return ev((()=>$g(e)))}class nv{constructor(e){this._apiURL=e.apiUrl,this._routeCache=null,this._linkCache=null}routes(){
|
|
622
|
+
return this._routeCache||(this._routeCache=tv(this._apiURL).then((e=>e.links))),this._routeCache}links(){return this._linkCache||(this._linkCache=this.routes().then((async e=>{const t=e.links;return await tv(t.url)}))),this._linkCache}}nv.$inject=["settings"];class rv extends Error{constructor(e,t){super(e),this.cause=t}}class ov{constructor(e){this.clientId=e.clientId,this.tokenEndpoint=e.tokenEndpoint,this.authorizationEndpoint=e.authorizationEndpoint,this.revokeEndpoint=e.revokeEndpoint}exchangeAuthCode(e){return this._getAccessToken({client_id:this.clientId,grant_type:"authorization_code",code:e})}exchangeGrantToken(e){return this._getAccessToken({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:e})}refreshToken(e){return this._getAccessToken({grant_type:"refresh_token",refresh_token:e})}async revokeToken(e){try{await this._formPost(this.revokeEndpoint,{token:e})}catch(e){throw new rv("Failed to revoke access token",e)}}authorize(e){const t=U(16),n=new Promise(((n,r)=>{
|
|
623
|
+
e.addEventListener("message",(function o(i){"object"==typeof i.data&&i.data.state===t&&("authorization_response"===i.data.type&&n(i.data),"authorization_canceled"===i.data.type&&r(new Error("Authorization window was closed")),e.removeEventListener("message",o))}))})),r=new URL(this.authorizationEndpoint);r.searchParams.set("client_id",this.clientId),r.searchParams.set("origin",e.location.origin),r.searchParams.set("response_mode","web_message"),r.searchParams.set("response_type","code"),r.searchParams.set("state",t);const o=`left=${e.screen.width/2-237.5},top=${e.screen.height/2-215},width=475,height=430`;if(!e.open(r.toString(),"Log in to Hypothesis",o))throw new Error("Failed to open login window");return n.then((e=>e.code))}async _formPost(e,t){const n=new URLSearchParams;for(let[e,r]of Object.entries(t))n.set(e,r);n.sort();return $g(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n.toString()})}async _getAccessToken(e){let t;try{
|
|
624
|
+
t=await this._formPost(this.tokenEndpoint,e)}catch(e){throw new rv("Failed to fetch access token",e)}return{accessToken:t.access_token,expiresAt:Date.now()+1e3*(t.expires_in-10),refreshToken:t.refresh_token}}}class iv extends mg{constructor(e,t,n,r,o){let i,a,s;super();const l=(c="token",u=r.apiUrl,new URL(c,u).href);var c,u;function h(){let e=new URL(r.apiUrl).hostname;return e=e.replace(/\./g,"%2E"),`hypothesis.oauth.${e}.token`}function d(e){n.setObject(h(),e)}const p=async()=>{if(s)return s;const e=await t.links();return s=new ov({clientId:r.oauthClientId,authorizationEndpoint:e["oauth.authorize"],revokeEndpoint:e["oauth.revoke"],tokenEndpoint:l}),s},m=()=>{var e;return null===(e=I(r))||void 0===e?void 0:e.grantToken},f=async()=>{if(!a){const e=m();void 0!==e?a=e?p().then((t=>t.exchangeGrantToken(e))).catch((e=>{var t;throw t="You must reload the page to annotate.",o.error(`Hypothesis login lost: ${t}`,{autoDismiss:!1}),e})):Promise.resolve(null):i?(a=(async e=>{
|
|
625
|
+
const t=await p(),n=await t.exchangeAuthCode(e);return d(n),n})(i),i=null):a=Promise.resolve(function(){const e=n.getObject(h());return e&&"string"==typeof e.accessToken&&"string"==typeof e.refreshToken&&"number"==typeof e.expiresAt?{accessToken:e.accessToken,refreshToken:e.refreshToken,expiresAt:e.expiresAt}:null}())}const e=a,t=await a;if(!t)return null;if(e!==a)return f();if(Date.now()>t.expiresAt){const e=m();return a=(async(e,t)=>{const n=await p();let r;try{if(r=await n.refreshToken(e),Date.now()>r.expiresAt)throw new Error("Refreshed token expired in the past")}catch{return null}return t.persist&&d(r),r})(t.refreshToken,{persist:void 0===e}),f()}return t.accessToken};(()=>{e.addEventListener("storage",(({key:e})=>{e===h()&&(a=null,this.emit("oauthTokensChanged"))}))})(),this.login=async function(){const t=await p(),n=await t.authorize(e);i=n,a=null},this.logout=async function(){const[e,t]=await Promise.all([a,p()]);e&&await t.revokeToken(e.accessToken),a=Promise.resolve(null),n.removeItem(h())},
|
|
626
|
+
this.getAccessToken=f}}iv.$inject=["$window","apiRoutes","localStorage","settings","toastMessenger"];class av{constructor(e,t,n){this._annotationsService=e,this._toastMessenger=t,this._store=n,this._saving=new Set,this._failed=new Set}init(){const e=e=>!this._saving.has(e)&&!this._failed.has(e);this._store.subscribe((()=>{this._store.newHighlights().forEach((t=>{const n=t.$tag;e(n)&&(this._saving.add(n),ev((()=>this._annotationsService.save(t))).then((()=>{this._toastMessenger.success("Highlight saved",{visuallyHidden:!0})})).catch((()=>{this._failed.add(n)})).finally((()=>{this._saving.delete(n)})))}))}))}isSaving(){return this._saving.size>0}}function sv(e,t){return!!function(e){if(null===e||"object"!=typeof e)return!1;for(let t of["frame1","frame2","type","requestId"])if("string"!=typeof e[t])return!1;return!0}(e)&&JSON.stringify(e,Object.keys(t).sort())===JSON.stringify(t,Object.keys(t).sort())}av.$inject=["annotationsService","toastMessenger","store"];class lv{constructor({hostFrame:e,source:t}){
|
|
627
|
+
this._hostFrame=e,this._source=t,this._listeners=new hl}destroy(){this._listeners.removeAll()}async discover(e){let t=!1;if(("guest"===this._source&&"host"===e||"guest"===this._source&&"sidebar"===e||"sidebar"===this._source&&"host"===e||"notebook"===this._source&&"sidebar"===e)&&(t=!0),!t)throw new Error("Invalid request of channel/port");const n=U(6);return new Promise(((t,r)=>{const o=()=>{this._hostFrame.postMessage({frame1:this._source,frame2:e,type:"request",requestId:n},"*")},i=setInterval(o,250),a=setTimeout((()=>{clearInterval(i),r(new Error(`Unable to establish ${this._source}-${e} communication channel`))}),2e4),s=this._listeners.add(window,"message",(r=>{const{data:o,ports:l}=r;sv(o,{frame1:this._source,frame2:e,type:"offer",requestId:n})&&(clearInterval(i),clearTimeout(a),this._listeners.remove(s),t(l[0]))}));o()}))}}function cv(e,t,n=[],r=-1){e.postMessage({protocol:"frame-rpc",version:"1.0.0",arguments:n,method:t,sequence:r})}class uv{
|
|
628
|
+
constructor({userAgent:e=navigator.userAgent,currentWindow:t=window}={}){this._port=null,this._methods=new Map,this._sequence=1,this._callbacks=new Map,this._listeners=new hl,this._listeners.add(t,"unload",(()=>{this._port&&(cv(this._port,"close"),t!==t.parent&&function(e){const t=e.match(/\bAppleWebKit\/([0-9]+)\b/);return!!t&&!(parseInt(t[1])<=537)}(e)&&t.parent.postMessage({type:"hypothesisPortClosed"},"*",[this._port]))})),this._pendingCalls=[],this._receivedCloseEvent=!1}on(e,t){if(this._port)throw new Error("Cannot add a method handler after a port is connected");this._methods.set(e,t)}connect(e){this._port=e,this._listeners.add(e,"message",(e=>this._handle(e))),e.start(),cv(e,"connect");for(let[e,t]of this._pendingCalls)this.call(e,...t);this._pendingCalls=[]}destroy(){this._port&&(cv(this._port,"close"),this._port.close()),this._destroyed=!0,this._listeners.removeAll()}call(e,...t){if(this._port||this._pendingCalls.push([e,t]),!this._port||this._destroyed)return
|
|
629
|
+
;const n=this._sequence++,r=t[t.length-1];"function"==typeof r&&(this._callbacks.set(n,r),t=t.slice(0,-1)),cv(this._port,e,t,n)}_parseMessage({data:e}){return e&&"object"==typeof e?"frame-rpc"!==e.protocol||"1.0.0"!==e.version?null:Array.isArray(e.arguments)?e:null:null}_handle(e){const t=this._parseMessage(e),n=this._port;if(t&&n)if("method"in t){if("close"===t.method){if(this._receivedCloseEvent)return;this._receivedCloseEvent=!0}const e=this._methods.get(t.method);if(!e)return;const r=(...e)=>{const r={arguments:e,protocol:"frame-rpc",response:t.sequence,version:"1.0.0"};n.postMessage(r)};e(...t.arguments,r)}else if("response"in t){const e=this._callbacks.get(t.response);this._callbacks.delete(t.response),e&&e(...t.arguments)}}}function hv(e,t,n,r){let o=t();return e((()=>{const e=t();if(r?r(e,o):e===o)return;const i=o;o=e,n(e,i)}))}function dv({$tag:e,target:t,uri:n}){return{$tag:e,target:t,uri:n}}function pv(e,t){const n=e.find((e=>e.uri===t.uri));if(n)return n;const r=e.find((e=>null===e.id))
|
|
630
|
+
;return r||e[0]}class mv{constructor(e,t,n){this._window=e,this._annotationsService=t,this._store=n,this._portFinder=new lv({hostFrame:this._window.parent,source:"sidebar"}),this._listeners=new hl,this._hostRPC=new uv,this._guestRPC=new Map,this._nextGuestId=0,this._inFrame=new Set,this._highlightsVisible=!1,this._setupSyncToGuests(),this._setupHostEvents(),this._setupFeatureFlagSync()}_setupSyncToGuests(){let e=0;const t=(t,n,r)=>{let o=0;const i=new Set,a=[];t.forEach((e=>{Li(e)||(Ri(e)&&++o,i.add(e.$tag),this._inFrame.has(e.$tag)||a.push(e))}));const s=r.filter((e=>!i.has(e.$tag)));if(a.length>0){const e=new Map;for(let t of a){var l;const r=pv(n,t);if(!r)continue;const o=null!==(l=e.get(r.id))&&void 0!==l?l:[];o.push(t),e.set(r.id,o)}for(let[t,n]of e){const e=this._guestRPC.get(t);e&&e.call("loadAnnotations",n.map(dv))}a.forEach((e=>{this._inFrame.add(e.$tag)}))}s.forEach((e=>{this._guestRPC.forEach((t=>t.call("deleteAnnotation",e.$tag))),this._inFrame.delete(e.$tag)})),
|
|
631
|
+
n.length>0&&n.every((e=>e.isAnnotationFetchComplete))&&(0!==o&&o===e||(this._hostRPC.call("publicAnnotationCountChanged",o),e=o))};hv(this._store.subscribe,(()=>[this._store.allAnnotations(),this._store.frames()]),(([e,n],[r])=>t(e,n,r)),Ma)}_connectGuest(e){const t=new uv;++this._nextGuestId;let n=`temp-${this._nextGuestId}`;this._guestRPC.set(n,t),t.on("documentInfoChanged",(e=>{this._guestRPC.delete(n),n=e.frameIdentifier,this._guestRPC.set(n,t),this._store.connectFrame({id:e.frameIdentifier,metadata:e.metadata,uri:e.uri})})),t.on("close",(()=>{const e=this._store.frames().find((e=>e.id===n));e&&this._store.destroyFrame(e),t.destroy(),this._guestRPC.delete(n)})),t.on("createAnnotation",(e=>{if(!this._store.isLoggedIn())return this._hostRPC.call("openSidebar"),this._store.openSidebarPanel("loginPrompt"),void this._guestRPC.forEach((t=>t.call("deleteAnnotation",e.$tag)));this._inFrame.add(e.$tag),e.$highlight||this._hostRPC.call("openSidebar"),this._hostRPC.call("showHighlights"),
|
|
632
|
+
this._annotationsService.create(e)}));let r={};const o=ul((()=>{this._store.updateAnchorStatus(r),r={}}),10);t.on("syncAnchoringStatus",(({$tag:e,$orphan:t})=>{this._inFrame.add(e),r[e]=t?"orphan":"anchored",o()})),t.on("showAnnotations",(e=>{this._store.selectAnnotations(this._store.findIDsForTags(e)),this._store.selectTab("annotation")})),t.on("focusAnnotations",(e=>{this._store.focusAnnotations(e||[])})),t.on("toggleAnnotationSelection",(e=>{this._store.toggleSelectedAnnotations(this._store.findIDsForTags(e))})),t.on("openSidebar",(()=>{this._hostRPC.call("openSidebar")})),t.on("closeSidebar",(()=>{this._hostRPC.call("closeSidebar")})),t.connect(e),t.call("setHighlightsVisible",this._highlightsVisible),t.call("featureFlagsUpdated",this._store.profile().features)}_setupHostEvents(){this._hostRPC.on("sidebarOpened",(()=>{this._store.setSidebarOpened(!0)})),this._hostRPC.on("setHighlightsVisible",(e=>{this._highlightsVisible=e,this._guestRPC.forEach((t=>t.call("setHighlightsVisible",e)))}))}
|
|
633
|
+
_setupFeatureFlagSync(){const e=()=>this._store.profile().features,t=e=>{this._hostRPC.call("featureFlagsUpdated",e);for(let t of this._guestRPC.values())t.call("featureFlagsUpdated",e)};t(e()),hv(this._store.subscribe,e,t)}async connect(){const e=await this._portFinder.discover("host");this._hostRPC.connect(e),this._listeners.add(e,"message",(e=>{const{data:t,ports:n}=e;sv(t,{frame1:"guest",frame2:"sidebar",type:"offer"})&&this._connectGuest(n[0])}))}notifyHost(e,...t){this._hostRPC.call(e,...t)}focusAnnotations(e){this._store.focusAnnotations(e),this._guestRPC.forEach((t=>t.call("focusAnnotations",e)))}scrollToAnnotation(e){this._guestRPC.forEach((t=>t.call("scrollToAnnotation",e)))}destroy(){this._portFinder.destroy(),this._listeners.removeAll()}}mv.$inject=["$window","annotationsService","store"];const fv={id:"__default__",name:"__DEFAULT__",logo:"data:image/svg+xml;utf8,"+encodeURIComponent(qo)};const gv=["organization","scopes"];class vv{constructor(e,t,n,r,o,i){this._store=e,this._api=t,this._auth=n,
|
|
634
|
+
this._settings=o,this._toastMessenger=i,this._serviceConfig=I(o),this._reloadSetUp=!1}_mainURI(){var e,t;return null!==(e=null===(t=this._store.mainFrame())||void 0===t?void 0:t.uri)&&void 0!==e?e:null}async _filterGroups(e,t,n,r){if(r){const t=e.find((e=>e.id===r));t&&!t.isScopedToUri&&t.scopes&&t.scopes.enforced&&(e=e.filter((e=>e.id!==r)),this._store.setDirectLinkedGroupFetchFailed(),r=null)}if(t)return e;const o=e.some((e=>"__world__"!==e.id&&e.isScopedToUri));return o?"__world__"===r||"__world__"===n?e:e.filter((e=>"__world__"!==e.id)):e}_setupAutoReload(){this._reloadSetUp||(this._reloadSetUp=!0,hv(this._store.subscribe,(()=>this._mainURI()),(()=>this.load())),hv(this._store.subscribe,(()=>[this._store.hasFetchedProfile(),this._store.profile().userid]),((e,[t])=>{t&&this.load()}),Ma))}_addGroupsToStore(e,t){!function(e){e.forEach((e=>{e.organization&&"object"==typeof e.organization||(e.organization=fv)}))}(e);const n=0===this._store.allGroups().length,r=this._store.getDefault("focusedGroup")
|
|
635
|
+
;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:gv})}async _loadGroupsForUserAndDocument(){var e;const t=()=>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 n=null;"sidebar"===this._store.route()&&(n=await t()),this._setupAutoReload();const r=this._store.directLinkedAnnotationId();let o=null;r&&(o=this._api.annotation.get({id:r}).catch((()=>null)));const i=this._store.directLinkedGroupId();let a=null;i&&(a=this._fetchGroup(i).then((e=>(this._store.clearDirectLinkedGroupFetchFailed(),e))).catch((()=>(this._store.setDirectLinkedGroupFetchFailed(),null))));const s={expand:gv},l=null===(e=this._serviceConfig)||void 0===e?void 0:e.authority;l&&(s.authority=l),n&&(s.document_uri=n);const[c,u,h,d,p]=await Promise.all([this._api.profile.groups.read({expand:gv
|
|
636
|
+
}),this._api.groups.list(s),this._auth.getAccessToken(),o,a]);p&&!u.some((e=>e.id===p.id))&&u.push(p);let m=null;if(d){m=d.group;const e=c.concat(u).find((e=>e.id===d.group));if(!e)try{const e=await this._fetchGroup(d.group);u.push(e)}catch(e){this._toastMessenger.error("Unable to fetch group for linked annotation")}}const f=null!==h,g=await this._filterGroups(K(c,u,n,this._settings),f,m,i),v=m||i||null;return this._addGroupsToStore(g,v),g}async _loadServiceSpecifiedGroups(e){const t=await this._api.profile.groups.read({expand:gv});let n;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(){var e;const t=null===(e=this._serviceConfig)||void 0===e?void 0:e.groups
|
|
637
|
+
;if(Array.isArray(t)||"function"==typeof(null==(n=t)?void 0:n.then)){let e=[];try{e=await t}catch(e){this._toastMessenger.error(`Unable to fetch group configuration: ${e.message}`)}return this._loadServiceSpecifiedGroups(e)}return this._loadGroupsForUserAndDocument();var n}focus(e){const t=this._store.focusedGroupId();this._store.focusGroup(e);const n=this._store.focusedGroupId();if(t!==n&&null!==t&&n){const e=this._store.newAnnotations().filter((e=>!Li(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"})}}vv.$inject=["store","api","auth","session","settings","toastMessenger"];class _v{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()),
|
|
638
|
+
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 vg(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()})),this._store.annotationFetchStarted(),this._searchClient.get({
|
|
639
|
+
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}),Li(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),!Li(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}}_v.$inject=["api","store","streamer","streamFilter"];class bv{constructor(){this._store=new Map}getItem(e){var t;return null!==(t=this._store.get(e))&&void 0!==t?t:null}setItem(e,t){this._store.set(e,t)}removeItem(e){this._store.delete(e)}}class yv{constructor(e){let t="hypothesis.testKey";try{this._storage=e.localStorage,e.localStorage.setItem(t,t),e.localStorage.getItem(t),e.localStorage.removeItem(t)}catch(e){this._storage=new bv}}
|
|
640
|
+
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)}}yv.$inject=["$window"];const wv={annotationPrivacy:"hypothesis.privacy",focusedGroup:"hypothesis.groups.focus"};class xv{constructor(e,t){this._storage=e,this._store=t}init(){for(let[e,t]of Wi(wv)){const n=this._storage.getItem(t);this._store.setDefault(e,n)}hv(this._store.subscribe,(()=>this._store.getDefaults()),((e,t)=>{for(let[n,r]of Wi(e))t[n]!==r&&n in wv&&this._storage.setItem(wv[n],r)}))}}xv.$inject=["localStorage","store"];class kv{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(let[e,r]of t)n[e]=r;"client"===e[0]&&e.shift();let r;switch(e[0].replace(/\.html$/,"")){
|
|
641
|
+
case"a":r="annotation",n.id=e[1]||"";break;case"notebook":r="notebook";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"stream":n="/stream";break;default:throw new Error(`Cannot generate URL for route "${e}"`)}let o=!1;const i=new URLSearchParams;for(let[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()}}kv.$inject=["$window","store"];class Sv{constructor(e,t){this._apiRoutes=e,this._store=t}async init(){try{const e=await this._apiRoutes.links();this._store.updateLinks(e)}catch(e){
|
|
642
|
+
console.warn(`Failed to fetch Hypothesis links: ${e.message}`)}}}Sv.$inject=["apiRoutes","store"];class Cv{constructor(e,t,n,r,o){var i,a;this._api=t,this._auth=n,this._store=e,this._toastMessenger=o,this._authority=null!==(i=null===(a=I(r))||void 0===a?void 0:a.authority)&&void 0!==i?i: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=ev((()=>{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;return this._store.updateProfile(e),this._lastLoad=Promise.resolve(e),
|
|
643
|
+
this._lastLoadTime=Date.now(),n&&(e.userid?br({id:e.userid}):br(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()}}Cv.$inject=["store","api","auth","settings","toastMessenger"];class Ev{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 Av extends mg{constructor(e){super();const t=[];let n;const r=()=>{for(;t.length>0;){const e=JSON.stringify(t.shift());n.send(e)}};this.close=()=>{n.close(1e3)},this.send=e=>{t.push(e),this.isConnected()&&r()},this.isConnected=()=>n.readyState===WebSocket.OPEN,(()=>{n=new WebSocket(e),
|
|
644
|
+
n.onopen=e=>{r(),this.emit("open",e)},n.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")},n.onerror=e=>{this.emit("error",e)},n.onmessage=e=>{this.emit("message",e)}})()}}class Tv{constructor(e,t,n,r,o){this._auth=n,this._groups=r,this._session=o,this._store=e,this._websocketURL=t.links().then((e=>e.websocket)),this.clientId=U(32),this._socket=null,this._updateImmediately=!0,this._configMessages={},this._reconnectionAttempts=0,this._reconnectSetUp=!1}applyPendingUpdates(){const e=Object.values(this._store.pendingUpdates());e.length&&this._store.addAnnotations(e);const t=Object.keys(this._store.pendingDeletions()).map((e=>({id:e})));t.length&&this._store.removeAnnotations(t),this._store.clearPendingUpdates()}_handleSocketError(e,t){G("Error connecting to H push notification service:",t);const n=new URL(e).hostname
|
|
645
|
+
;-1!==["localhost","127.0.0.1"].indexOf(n)&&G("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),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 G("Received unsupported notification",t.type)}_sendClientConfig(e){Object.keys(this._configMessages).forEach((t=>{this._configMessages[t]&&e.send(this._configMessages[t])}))}setConfig(e,t){var n;this._configMessages[e]=t,
|
|
646
|
+
null!==(n=this._socket)&&void 0!==n&&n.isConnected()&&this._socket.send(t)}async _reconnect(){var e;const t=await this._websocketURL;if(!t)return;let n,r;null===(e=this._socket)||void 0===e||e.close();try{n=await this._auth.getAccessToken()}catch(e){throw console.error("Failed to fetch token for WebSocket authentication",e),e}if(n){const e=new URL(t);e.searchParams.set("access_token",n),r=e.toString()}else r=t;const o=new Av(r);o.on("open",(()=>{this._reconnectionAttempts=0,this._sendClientConfig(o)})),o.on("disconnect",(()=>{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")})),o.on("error",(e=>this._handleSocketError(t,e))),o.on("message",(e=>this._handleSocketMessage(e))),this._socket=o,this.setConfig("client-id",{messageType:"client_id",value:this.clientId}),this.setConfig("auth-check",{type:"whoami",id:1})}async connect(e={}){
|
|
647
|
+
var t;this._updateImmediately=null===(t=e.applyUpdatesImmediately)||void 0===t||t,this._reconnectSetUp||(this._reconnectSetUp=!0,hv(this._store.subscribe,(()=>this._store.profile().userid),(()=>this._reconnect()))),this._socket||await this._reconnect()}}Tv.$inject=["store","apiRoutes","auth","groups","session"];class Nv{constructor(e){this._storage=e}filter(e,t=null){const n=this._storage.getObject("hypothesis.user.tags.list")||[];let r=0;return n.filter((n=>{if(null!==t&&r>=t)return!1;const o=n.split(/\W+/),i=new RegExp(`^${W(e)}`,"i");return!(!o.some((e=>e.match(i)))&&!n.match(i))&&(++r,!0)}))}store(e){const t=this._storage.getObject("hypothesis.user.tags.map")||{};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("hypothesis.user.tags.map",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("hypothesis.user.tags.list",n)}}Nv.$inject=["localStorage"]
|
|
648
|
+
;class Mv{constructor(e){this._store=e}forceVisible(e){e.children.forEach((e=>{this.forceVisible(e)})),e.visible||this._store.setForcedVisible(e.id,!0)}}Mv.$inject=["store"];class Lv{constructor(e){this._store=e}dismiss(e){const t=this._store.getToastMessage(e);t&&!t.isDismissed&&(this._store.updateToastMessage({...t,isDismissed:!0}),setTimeout((()=>{this._store.removeToastMessage(e)}),500))}_addMessage(e,t,{autoDismiss:n=!0,moreInfoURL:r="",visuallyHidden:o=!1}={}){if(this._store.hasToastMessage(e,t))return;const i=U(10),a={type:e,id:i,message:t,moreInfoURL:r,visuallyHidden:o};this._store.addToastMessage({isDismissed:!1,...a}),n&&setTimeout((()=>{this.dismiss(i)}),5e3)}error(e,t){this._addMessage("error",e,t)}success(e,t){this._addMessage("success",e,t)}notice(e,t){this._addMessage("notice",e,t)}}Lv.$inject=["store"];class zv{constructor(){this._providers=new Map,this._instances=new Map,this._constructing=new Set}get(e){if(this._instances.has(e))return this._instances.get(e);const t=this._providers.get(e)
|
|
649
|
+
;if(!t)throw new Error(`"${e}" is not registered`);if("value"in t)return this._instances.set(e,t.value),t.value;if(this._constructing.has(e))throw new Error(`Encountered a circular dependency when constructing "${e}"`);this._constructing.add(e);try{const n=[],r="class"in t&&t.class.$inject||"factory"in t&&t.factory.$inject||[];for(const t of r)try{n.push(this.get(t))}catch(n){const r=new Error(`Failed to construct dependency "${t}" of "${e}": ${n.message}`);throw r.cause=n,r}let o;if(t.class)o=new t.class(...n);else{o=(0,t.factory)(...n)}return this._instances.set(e,o),o}finally{this._constructing.delete(e)}}register(e,t){if("function"==typeof t)t={class:t};else if(!function(e){return"object"==typeof e&&null!==e&&("value"in e||"function"==typeof e.class||"function"==typeof e.factory)}(t))throw new Error(`Invalid provider for "${e}"`);return this._providers.set(e,t),this}run(e){const t="Injector.run";this.register(t,{factory:e});try{return this.get(t)}finally{this._instances.delete(t),this._providers.delete(t)
|
|
650
|
+
}}}const Ov=function(t){for(var n={},r=t.querySelectorAll("script.js-hypothesis-config"),o=0;o<r.length;o++){var i=void 0;try{i=JSON.parse(r[o].textContent||"")}catch(e){console.warn("Could not parse settings from js-hypothesis-config tags",e),i={}}e(n,i)}return n}(document),Rv=function(e){const{version:t,origin:n}=D(e.location.href);return"1.1070.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1070.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 Dv(e,t){e.setClientId(t.clientId)}function Iv(e,t,n){e.load(),t.load(),n.sync()}function Pv(e,t,n){e.init(),t.init(),n.init()}function Bv(e,t){"sidebar"===t.route()&&e.connect()}Ov.sentry&&Rv&&function(e){const t=function(){let e=import.meta.url
|
|
651
|
+
;return e?new URL(e).origin:null}(),n=t?[t]:void 0;pr({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1070.0",beforeSend:(e,t)=>{if(_r>=5)return G("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++_r;try{const n=t&&t.originalException;n instanceof Event&&(e.extra||(e.extra={}),Object.assign(e.extra,{type:n.type,detail:n.detail,isTrusted:n.isTrusted}))}catch(e){}return e}});try{Wt("host_config",D(window.location.href))}catch(e){}Wt("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),vr(((e,t)=>{Yt(e,{tags:{context:t}})}))}(Ov.sentry),function(e){e.addEventListener("click",(e=>{const t=e.target;if("A"===t.tagName){const e=t;"_blank"===e.target&&(e.rel="noopener")}}))}(document.body),function(e=n){let t=!1;try{document.createElement("div").dir="auto"}catch(e){t=!0}if(t){const t=e.vnode;e.vnode=e=>{
|
|
652
|
+
if("string"==typeof e.type){const t=e.props;"dir"in t&&"auto"===t.dir&&(t.dir="")}t&&t(e)}}}(),Dv.$inject=["api","streamer"],Iv.$inject=["groups","session","router"],Pv.$inject=["autosaveService","persistedDefaults","serviceURL"],Bv.$inject=["frameSync","store"],function(e,{reset:t=!1}={}){t&&lo.clear();for(let[t,n]of Object.entries(e))lo.set(t,n)}($o);const Fv=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",J)}(),async function(e,t=window){const n=function(e){const t=D(e.location.href),n=["annotations","group","query","appType","openSidebar","showHighlights","services","branding","enableExperimentalNewNoteButton","focus","requestConfigFromFrame","theme","usernameUrl"],r={openSidebar:P,requestConfigFromFrame:e=>{if("string"==typeof e)return e;const t=function(e){return"object"==typeof e&&null!==e?e:{}}(e);return{origin:F(t.origin),ancestorLevel:B(t.ancestorLevel)}}},o={};for(let[e,i]of Object.entries(t))n.includes(e)&&null!==i&&(r[e]?o[e]=r[e](i):o[e]=i);return o
|
|
653
|
+
}(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:q(n.ancestorLevel,t),origin:n.origin}}(n,t);let o;if(r){const e=await async function(e,t){return{...await H(t.targetFrame,t.origin,"requestConfig",[],3e3),...e.group?{group:e.group}:{}}}(n,r);o=function(e,t){const n=e.services;return Array.isArray(n)?(n.forEach(((e,n)=>{"$rpc:requestGroups"===e.groups&&(e.groups=H(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=I(e);if(t){if(t.apiUrl)return t.apiUrl;throw new Error("Service should contain an apiUrl value.")}return e.apiUrl}(i),i}(Ov).then((e=>{!function(e,t){const n=new zv
|
|
654
|
+
;n.register("annotationsService",Ug).register("annotationActivity",Hg).register("api",Wg).register("apiRoutes",nv).register("auth",iv).register("autosaveService",av).register("frameSync",mv).register("groups",vv).register("loadAnnotationsService",_v).register("localStorage",yv).register("persistedDefaults",xv).register("router",kv).register("serviceURL",Sv).register("session",Cv).register("streamer",Tv).register("streamFilter",Ev).register("tags",Nv).register("threadsService",Mv).register("toastMessenger",Lv).register("store",{factory:bs}),n.register("$window",{value:window}).register("settings",{value:e}),n.run(Pv),n.run(Dv),n.run(Iv),n.run(Z),n.run(Bv),R(so(Zo.Provider,{value:n,children:so(Fg,{})}),t)}(e,Fv)})).catch((e=>function(e,t){console.error("Failed to start Hypothesis client: ",e),R(so(jg,{error:e}),t)}(e,Fv)));
|
|
655
655
|
//# sourceMappingURL=sidebar.bundle.js.map
|