texlite 0.15.0 → 0.16.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.
Files changed (69) hide show
  1. package/DESIGN.md +11 -0
  2. package/README.md +6 -0
  3. package/README.zh-CN.md +6 -0
  4. package/dist/client/assets/AdminUsers-Dyapv-3c.js +1 -0
  5. package/dist/client/assets/CitationLibraryDialog-CU7Q7r0Z.js +1 -0
  6. package/dist/client/assets/Dashboard-DsdhFENx.js +2 -0
  7. package/dist/client/assets/GitDialog-CZpnKw-J.js +3 -0
  8. package/dist/client/assets/{GitHubAccountDialog-Cqcezf6G.js → GitHubAccountDialog-CZ8O_PjD.js} +1 -1
  9. package/dist/client/assets/{HistoryDialog-IurkSJuU.js → HistoryDialog-DWYErBwj.js} +3 -3
  10. package/dist/client/assets/LatexEditor-CssVgypt.js +141 -0
  11. package/dist/client/assets/{PdfPreview-BTmvQDCV.js → PdfPreview-BjghzUb1.js} +1 -1
  12. package/dist/client/assets/{ProjectIconPickerDialog-Cbm-0YQW.js → ProjectIconPickerDialog-CqRmgFBM.js} +1 -1
  13. package/dist/client/assets/{ProjectNavigationDialogs-CozcEa2v.js → ProjectNavigationDialogs-BZxI3PJO.js} +1 -1
  14. package/dist/client/assets/ProjectSettings-CZE_xDKn.js +1 -0
  15. package/dist/client/assets/ProjectWorkspace-CAX3qEYr.js +32 -0
  16. package/dist/client/assets/{SelectionHistoryDialog-DiRKiMEt.js → SelectionHistoryDialog-CR5c3I8k.js} +2 -2
  17. package/dist/client/assets/{SystemMetricsDialog-DJJZueSr.js → SystemMetricsDialog-DDpFwgXh.js} +1 -1
  18. package/dist/client/assets/{TagManagementDialog-3c-WAWQd.js → TagManagementDialog-CXLA9h_j.js} +1 -1
  19. package/dist/client/assets/WordCountDialog-DUyR24vv.js +1 -0
  20. package/dist/client/assets/check-CwBYzomT.js +1 -0
  21. package/dist/client/assets/chevron-up-D5lCNKlk.js +1 -0
  22. package/dist/client/assets/chktex-CRkLYKcV.js +3 -0
  23. package/dist/client/assets/{citationLibrary-ZeQPCv5O.js → citationLibrary-C9WnXB-1.js} +2 -2
  24. package/dist/client/assets/{external-link-DGfNJFKy.js → external-link-C9Td1CCj.js} +1 -1
  25. package/dist/client/assets/{github-DJezB5ef.js → github-D-JDXb-w.js} +1 -1
  26. package/dist/client/assets/{hard-drive-B9h-a7KY.js → hard-drive-Ctj3K_zx.js} +1 -1
  27. package/dist/client/assets/{index-DmBKxZf9.js → index-9hnQ8Q9x.js} +1 -1
  28. package/dist/client/assets/index-C0qg2Ylw.css +1 -0
  29. package/dist/client/assets/index-DkpU9Fgs.js +10 -0
  30. package/dist/client/assets/index-_eYe7K9T.js +1 -0
  31. package/dist/client/assets/{minimize-2-Crq_SyYM.js → minimize-2-BiVyoWZA.js} +1 -1
  32. package/dist/client/assets/{minus-Dn3USloe.js → minus-Bl8l4LXq.js} +1 -1
  33. package/dist/client/assets/{plus-BwKRQJHI.js → plus-CCxK-HNt.js} +1 -1
  34. package/dist/client/assets/{refresh-cw-C5yVKb1r.js → refresh-cw-BE8IbaHI.js} +1 -1
  35. package/dist/client/assets/{search-CDyQWr9H.js → search-CPbhRWQE.js} +1 -1
  36. package/dist/client/assets/{sigma-9fiQHdlo.js → sigma-LxGD9tK2.js} +1 -1
  37. package/dist/client/assets/spellCheck-hpm8qZTr.js +1 -0
  38. package/dist/client/assets/{tags-C_3BvsxV.js → tags-DuN89PsZ.js} +1 -1
  39. package/dist/client/assets/{type-CnT0mBxu.js → type-BiettCiY.js} +1 -1
  40. package/dist/client/assets/{x-DN0Ol4Ya.js → x-C_3swJOC.js} +1 -1
  41. package/dist/client/index.html +3 -3
  42. package/dist/client/texlite-icon.svg +8 -0
  43. package/dist/server/auth.js +0 -3
  44. package/dist/server/chktex.js +3 -4
  45. package/dist/server/i18n.js +4 -0
  46. package/dist/server/latexCompletion.js +11 -88
  47. package/dist/server/projectOutline.js +4 -39
  48. package/dist/server/projectSearch.js +0 -4
  49. package/dist/server/routes/citations.js +22 -0
  50. package/dist/server/routes/users.js +21 -3
  51. package/dist/shared/bibtexReferences.js +5 -1
  52. package/dist/shared/latexCompletion.js +1 -0
  53. package/dist/shared/latexReferences.js +13 -3
  54. package/dist/shared/latexSymbols.js +77 -0
  55. package/package.json +1 -1
  56. package/dist/client/assets/AdminUsers-Cau9nlv9.js +0 -1
  57. package/dist/client/assets/CitationLibraryDialog-Cf_bbSq3.js +0 -1
  58. package/dist/client/assets/Dashboard-JQ8pJe2d.js +0 -2
  59. package/dist/client/assets/GitDialog-BcqqWKr-.js +0 -3
  60. package/dist/client/assets/LatexEditor-msdbtTyG.js +0 -141
  61. package/dist/client/assets/ProjectSettings-BlthcpdA.js +0 -1
  62. package/dist/client/assets/ProjectWorkspace-DUPLJCQ3.js +0 -32
  63. package/dist/client/assets/WordCountDialog-BqlX2s36.js +0 -1
  64. package/dist/client/assets/check-EZ2H-iDj.js +0 -1
  65. package/dist/client/assets/chktex-CZIYuMLb.js +0 -3
  66. package/dist/client/assets/index-BgeOKYIx.js +0 -10
  67. package/dist/client/assets/index-CMBalIBd.css +0 -1
  68. package/dist/client/assets/spellCheck-BCpcq-VN.js +0 -1
  69. package/dist/client/assets/user-plus-pxz36w4w.js +0 -1
@@ -1,3 +1,3 @@
1
- import{u as oe,r as a,j as t}from"./react-CltQJflK.js";import{c as re,g as B,M as ae,C as le,d as ce}from"./index-BgeOKYIx.js";import{d as de,C as ue}from"./index-DmBKxZf9.js";import{E as fe}from"./ProjectWorkspace-DUPLJCQ3.js";import"./check-EZ2H-iDj.js";import"./x-DN0Ol4Ya.js";import"./search-CDyQWr9H.js";import"./user-plus-pxz36w4w.js";import"./refresh-cw-C5yVKb1r.js";const he=re("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]),O=96,R=48;function me(e,s){const o=e.replace(/\r\n/g,`
1
+ import{u as oe,r as a,j as t}from"./react-CltQJflK.js";import{c as re,g as B,M as ae,C as le,d as ce}from"./index-DkpU9Fgs.js";import{d as de,C as ue}from"./index-9hnQ8Q9x.js";import{D as fe}from"./ProjectWorkspace-CAX3qEYr.js";import"./chevron-up-D5lCNKlk.js";import"./check-CwBYzomT.js";import"./x-C_3swJOC.js";import"./search-CPbhRWQE.js";import"./index-_eYe7K9T.js";import"./refresh-cw-BE8IbaHI.js";const he=re("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]),O=96,R=48;function me(e,s){const o=e.replace(/\r\n/g,`
2
2
  `),r=s.replace(/\r\n/g,`
3
- `);if(o===r)return{previous:[],current:[],additions:0,deletions:0,hasChanges:!1};const d=new de,p=d.diff_main(o,r,!1);d.diff_cleanupSemantic(p);const n=[],g=[];let f=0,c=0;for(let h=0;h<p.length;h+=1){const[y,u]=p[h];if(u)if(y===0){const v=pe(u,h,p.length);E(n,v),E(g,v)}else y<0?(c+=u.length,E(n,{kind:"deletion",text:u})):(f+=u.length,E(g,{kind:"addition",text:u}))}return{previous:n,current:g,additions:f,deletions:c,hasChanges:f>0||c>0}}function pe(e,s,o){const r=s===0,d=s===o-1;return(r||d)&&e.length<=O?{kind:"equal",text:e}:!r&&!d&&e.length<=R*2?{kind:"equal",text:e}:r?{kind:"omitted",text:`…${I(e,O)}`}:d?{kind:"omitted",text:`${q(e,O)}…`}:{kind:"omitted",text:`${q(e,R)}…${I(e,R)}`}}function q(e,s){if(e.length<=s)return e;const o=ye(e,s);return e.slice(0,o)}function I(e,s){if(e.length<=s)return e;const o=ge(e,e.length-s);return e.slice(o)}function ye(e,s){const o=Math.min(e.length,s+24);for(let r=s;r<o;r+=1)if(J(e[r]))return r+1;return s}function ge(e,s){const o=Math.max(0,s-24);for(let r=s;r>o;r-=1)if(J(e[r-1]))return r;return s}function J(e){return/\s|[.,;:!?)}\]]/.test(e)}function E(e,s){const o=e.at(-1);o?.kind===s.kind?o.text+=s.text:e.push({...s})}function we({open:e,project:s,filePath:o,selection:r,currentSource:d,onOpenChange:p}){const{t:n,i18n:g}=oe(),[{filePath:f,selection:c,source:h}]=a.useState(()=>({filePath:o,selection:r,source:d})),[y,u]=a.useState([]),[v,k]=a.useState(null),[K,T]=a.useState(!1),[Q,$]=a.useState(!0),[U,w]=a.useState(!1),[D,C]=a.useState(""),[b,P]=a.useState(null),[W,L]=a.useState(!1),[H,z]=a.useState(!1),[Y,M]=a.useState(""),[Z,ee]=a.useState(0);a.useEffect(()=>{if(P(null),!e||s.permission!=="owner")return;const i=new AbortController;return B(`/api/projects/${s.id}/edit-history/stats`,{signal:i.signal}).then(m=>{i.signal.aborted||P(m)}).catch(m=>{!i.signal.aborted&&!G(m)&&C(_(m))}),()=>i.abort()},[e,s.id,s.permission,Z]);const te=async()=>{if(!H){z(!0),M("");try{await B(`/api/projects/${s.id}/edit-history`,{method:"DELETE"}),u([]),k(null),T(!1),$(!0),ee(i=>i+1),L(!1)}catch(i){M(_(i))}finally{z(!1)}}},[se,A]=a.useState({}),N=Math.max(0,c.endOffset-c.startOffset);a.useEffect(()=>{if(!e||!f||N<=0)return;const i=new AbortController;if(w(!0),C(""),u([]),$(!0),A({}),k(null),T(!1),h.slice(c.startOffset,c.endOffset)!==c.selectedText){C(n("selectionHistory.sourceChanged")),w(!1);return}const m=new URLSearchParams({path:f,start:String(c.startOffset),end:String(c.endOffset),sourceHash:fe(h)});return B(`/api/projects/${s.id}/edit-history?${m}`,{signal:i.signal}).then(l=>{u(l.entries),$(l.chainComplete),k(l.baseline),T(l.hasMore)}).catch(l=>{G(l)||C(_(l))}).finally(()=>{i.signal.aborted||w(!1)}),()=>i.abort()},[e,s.id,f,c,N,h,n]);const ne=a.useMemo(()=>n("selectionHistory.description",{path:f,count:N}),[n,f,N]);return t.jsx(ae,{open:e,wide:!0,draggable:!0,className:"selection-history-modal",title:n("selectionHistory.title"),description:ne,onOpenChange:p,footer:t.jsx("button",{onClick:()=>p(!1),children:n("common.close")}),children:t.jsxs("div",{className:"selection-history-dialog",children:[s.permission==="owner"&&b&&t.jsxs("div",{className:"history-stats",children:[t.jsx("strong",{children:n("selectionHistory.storageUsage",{used:(b.payloadBytes/1048576).toFixed(2),limit:(b.maxStorageBytes/1048576).toFixed(0),count:b.segmentCount})}),t.jsx("small",{children:n("selectionHistory.storageDescription")}),t.jsx("button",{type:"button",className:"danger-text",disabled:U||H||b.segmentCount===0,onClick:()=>{M(""),L(!0)},children:n("selectionHistory.clearAll")})]}),t.jsx(le,{open:W,title:n("selectionHistory.clearAll"),description:n("selectionHistory.clearDescription"),confirmLabel:n("common.delete"),danger:!0,busy:H,error:Y,onConfirm:()=>{te()},onCancel:()=>{H||L(!1)}}),D&&t.jsx("p",{className:"error selection-history-message",children:D}),U?t.jsxs("div",{className:"selection-history-loading",children:[t.jsx(ce,{className:"spin",size:22}),n("common.loading")]}):t.jsxs(t.Fragment,{children:[!Q&&t.jsx("p",{className:"selection-history-boundary",children:n("selectionHistory.boundary")}),K&&t.jsx("p",{className:"selection-history-boundary",children:n("selectionHistory.limited",{count:y.length})}),y.length===0&&!D?t.jsxs("div",{className:"selection-history-empty",children:[t.jsx(ue,{size:28}),t.jsx("strong",{children:n("selectionHistory.emptyTitle")}),t.jsx("span",{children:n("selectionHistory.emptyDescription")})]}):t.jsx("ol",{className:"selection-history-list",children:y.map((i,m)=>{const l=se[i.id]||"content",j=y[m+1]||v,F=!!(j&&i.content!==null&&j.content!==null&&!i.contentTruncated&&!j.contentTruncated),S=l==="diff"&&F?me(j.content,i.content):null,V=j?F?S&&!S.hasChanges?n("selectionHistory.noDiff"):null:n("selectionHistory.diffUnavailable"):n("selectionHistory.noPrevious");return t.jsx("li",{children:t.jsxs("article",{className:"selection-history-entry",children:[t.jsxs("header",{children:[t.jsx("time",{title:new Date(i.updatedAt).toLocaleString(g.resolvedLanguage),children:je(i.updatedAt,g.resolvedLanguage)}),t.jsxs("span",{className:"selection-history-authors",children:[t.jsx(he,{size:14}),t.jsx("span",{children:n("selectionHistory.changedBy")}),t.jsx("span",{className:"selection-history-author-list",children:i.authors.map((x,ie)=>t.jsx("span",{children:xe(x,n("editor.deletedUser"))},x.id||`deleted-${ie}`))})]})]}),t.jsxs("div",{className:"selection-history-tabs",role:"tablist","aria-label":n("selectionHistory.view"),children:[t.jsx("button",{type:"button",className:l==="content"?"active":"",role:"tab","aria-selected":l==="content","aria-controls":`selection-history-content-${i.id}`,onClick:()=>A(x=>({...x,[i.id]:"content"})),children:n("selectionHistory.contentTab")}),t.jsx("button",{type:"button",className:l==="diff"?"active":"",role:"tab","aria-selected":l==="diff","aria-controls":`selection-history-diff-${i.id}`,onClick:()=>A(x=>({...x,[i.id]:"diff"})),children:n("selectionHistory.diffTab")})]}),l==="content"?t.jsxs("div",{className:"selection-history-content",id:`selection-history-content-${i.id}`,role:"tabpanel",children:[i.content===null?t.jsx("p",{className:"selection-history-content-unavailable",children:n("selectionHistory.contentUnavailable")}):t.jsx("pre",{children:i.content||"∅"}),i.contentTruncated&&t.jsx("small",{children:n("selectionHistory.contentTruncated")})]}):t.jsx("div",{className:"selection-history-content",id:`selection-history-diff-${i.id}`,role:"tabpanel",children:V?t.jsx("p",{className:"selection-history-content-unavailable",children:V}):S&&t.jsx(be,{diff:S,previousLabel:n("selectionHistory.previousVersion"),currentLabel:n("selectionHistory.currentVersion")})})]})},i.id)})})]})]})})}function xe(e,s){return!e.name&&!e.username?s:e.name&&e.username?`${e.name} (@${e.username})`:e.name||`@${e.username}`}function be({diff:e,previousLabel:s,currentLabel:o}){return t.jsxs("div",{className:"selection-history-semantic-diff",children:[t.jsx(X,{label:s,pieces:e.previous,variant:"previous"}),t.jsx(X,{label:o,pieces:e.current,variant:"current"})]})}function X({label:e,pieces:s,variant:o}){return t.jsxs("section",{className:`selection-history-diff-side ${o}`,children:[t.jsx("header",{children:e}),t.jsx("pre",{children:s.length?s.map((r,d)=>t.jsx("span",{className:r.kind,children:r.text},`${d}-${r.kind}`)):"∅"})]})}function je(e,s){const o=new Date(e);return Number.isNaN(o.getTime())?e:o.toLocaleString(s,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}function G(e){return e instanceof Error&&e.name==="AbortError"}function _(e){return e instanceof Error?e.message:String(e)}export{we as SelectionHistoryDialog};
3
+ `);if(o===r)return{previous:[],current:[],additions:0,deletions:0,hasChanges:!1};const d=new de,p=d.diff_main(o,r,!1);d.diff_cleanupSemantic(p);const n=[],g=[];let f=0,c=0;for(let h=0;h<p.length;h+=1){const[y,u]=p[h];if(u)if(y===0){const v=pe(u,h,p.length);E(n,v),E(g,v)}else y<0?(c+=u.length,E(n,{kind:"deletion",text:u})):(f+=u.length,E(g,{kind:"addition",text:u}))}return{previous:n,current:g,additions:f,deletions:c,hasChanges:f>0||c>0}}function pe(e,s,o){const r=s===0,d=s===o-1;return(r||d)&&e.length<=O?{kind:"equal",text:e}:!r&&!d&&e.length<=R*2?{kind:"equal",text:e}:r?{kind:"omitted",text:`…${I(e,O)}`}:d?{kind:"omitted",text:`${q(e,O)}…`}:{kind:"omitted",text:`${q(e,R)}…${I(e,R)}`}}function q(e,s){if(e.length<=s)return e;const o=ye(e,s);return e.slice(0,o)}function I(e,s){if(e.length<=s)return e;const o=ge(e,e.length-s);return e.slice(o)}function ye(e,s){const o=Math.min(e.length,s+24);for(let r=s;r<o;r+=1)if(J(e[r]))return r+1;return s}function ge(e,s){const o=Math.max(0,s-24);for(let r=s;r>o;r-=1)if(J(e[r-1]))return r;return s}function J(e){return/\s|[.,;:!?)}\]]/.test(e)}function E(e,s){const o=e.at(-1);o?.kind===s.kind?o.text+=s.text:e.push({...s})}function De({open:e,project:s,filePath:o,selection:r,currentSource:d,onOpenChange:p}){const{t:n,i18n:g}=oe(),[{filePath:f,selection:c,source:h}]=a.useState(()=>({filePath:o,selection:r,source:d})),[y,u]=a.useState([]),[v,k]=a.useState(null),[K,T]=a.useState(!1),[Q,$]=a.useState(!0),[U,w]=a.useState(!1),[D,C]=a.useState(""),[b,P]=a.useState(null),[W,L]=a.useState(!1),[H,z]=a.useState(!1),[Y,M]=a.useState(""),[Z,ee]=a.useState(0);a.useEffect(()=>{if(P(null),!e||s.permission!=="owner")return;const i=new AbortController;return B(`/api/projects/${s.id}/edit-history/stats`,{signal:i.signal}).then(m=>{i.signal.aborted||P(m)}).catch(m=>{!i.signal.aborted&&!G(m)&&C(_(m))}),()=>i.abort()},[e,s.id,s.permission,Z]);const te=async()=>{if(!H){z(!0),M("");try{await B(`/api/projects/${s.id}/edit-history`,{method:"DELETE"}),u([]),k(null),T(!1),$(!0),ee(i=>i+1),L(!1)}catch(i){M(_(i))}finally{z(!1)}}},[se,A]=a.useState({}),N=Math.max(0,c.endOffset-c.startOffset);a.useEffect(()=>{if(!e||!f||N<=0)return;const i=new AbortController;if(w(!0),C(""),u([]),$(!0),A({}),k(null),T(!1),h.slice(c.startOffset,c.endOffset)!==c.selectedText){C(n("selectionHistory.sourceChanged")),w(!1);return}const m=new URLSearchParams({path:f,start:String(c.startOffset),end:String(c.endOffset),sourceHash:fe(h)});return B(`/api/projects/${s.id}/edit-history?${m}`,{signal:i.signal}).then(l=>{u(l.entries),$(l.chainComplete),k(l.baseline),T(l.hasMore)}).catch(l=>{G(l)||C(_(l))}).finally(()=>{i.signal.aborted||w(!1)}),()=>i.abort()},[e,s.id,f,c,N,h,n]);const ne=a.useMemo(()=>n("selectionHistory.description",{path:f,count:N}),[n,f,N]);return t.jsx(ae,{open:e,wide:!0,draggable:!0,className:"selection-history-modal",title:n("selectionHistory.title"),description:ne,onOpenChange:p,footer:t.jsx("button",{onClick:()=>p(!1),children:n("common.close")}),children:t.jsxs("div",{className:"selection-history-dialog",children:[s.permission==="owner"&&b&&t.jsxs("div",{className:"history-stats",children:[t.jsx("strong",{children:n("selectionHistory.storageUsage",{used:(b.payloadBytes/1048576).toFixed(2),limit:(b.maxStorageBytes/1048576).toFixed(0),count:b.segmentCount})}),t.jsx("small",{children:n("selectionHistory.storageDescription")}),t.jsx("button",{type:"button",className:"danger-text",disabled:U||H||b.segmentCount===0,onClick:()=>{M(""),L(!0)},children:n("selectionHistory.clearAll")})]}),t.jsx(le,{open:W,title:n("selectionHistory.clearAll"),description:n("selectionHistory.clearDescription"),confirmLabel:n("common.delete"),danger:!0,busy:H,error:Y,onConfirm:()=>{te()},onCancel:()=>{H||L(!1)}}),D&&t.jsx("p",{className:"error selection-history-message",children:D}),U?t.jsxs("div",{className:"selection-history-loading",children:[t.jsx(ce,{className:"spin",size:22}),n("common.loading")]}):t.jsxs(t.Fragment,{children:[!Q&&t.jsx("p",{className:"selection-history-boundary",children:n("selectionHistory.boundary")}),K&&t.jsx("p",{className:"selection-history-boundary",children:n("selectionHistory.limited",{count:y.length})}),y.length===0&&!D?t.jsxs("div",{className:"selection-history-empty",children:[t.jsx(ue,{size:28}),t.jsx("strong",{children:n("selectionHistory.emptyTitle")}),t.jsx("span",{children:n("selectionHistory.emptyDescription")})]}):t.jsx("ol",{className:"selection-history-list",children:y.map((i,m)=>{const l=se[i.id]||"content",j=y[m+1]||v,F=!!(j&&i.content!==null&&j.content!==null&&!i.contentTruncated&&!j.contentTruncated),S=l==="diff"&&F?me(j.content,i.content):null,V=j?F?S&&!S.hasChanges?n("selectionHistory.noDiff"):null:n("selectionHistory.diffUnavailable"):n("selectionHistory.noPrevious");return t.jsx("li",{children:t.jsxs("article",{className:"selection-history-entry",children:[t.jsxs("header",{children:[t.jsx("time",{title:new Date(i.updatedAt).toLocaleString(g.resolvedLanguage),children:je(i.updatedAt,g.resolvedLanguage)}),t.jsxs("span",{className:"selection-history-authors",children:[t.jsx(he,{size:14}),t.jsx("span",{children:n("selectionHistory.changedBy")}),t.jsx("span",{className:"selection-history-author-list",children:i.authors.map((x,ie)=>t.jsx("span",{children:xe(x,n("editor.deletedUser"))},x.id||`deleted-${ie}`))})]})]}),t.jsxs("div",{className:"selection-history-tabs",role:"tablist","aria-label":n("selectionHistory.view"),children:[t.jsx("button",{type:"button",className:l==="content"?"active":"",role:"tab","aria-selected":l==="content","aria-controls":`selection-history-content-${i.id}`,onClick:()=>A(x=>({...x,[i.id]:"content"})),children:n("selectionHistory.contentTab")}),t.jsx("button",{type:"button",className:l==="diff"?"active":"",role:"tab","aria-selected":l==="diff","aria-controls":`selection-history-diff-${i.id}`,onClick:()=>A(x=>({...x,[i.id]:"diff"})),children:n("selectionHistory.diffTab")})]}),l==="content"?t.jsxs("div",{className:"selection-history-content",id:`selection-history-content-${i.id}`,role:"tabpanel",children:[i.content===null?t.jsx("p",{className:"selection-history-content-unavailable",children:n("selectionHistory.contentUnavailable")}):t.jsx("pre",{children:i.content||"∅"}),i.contentTruncated&&t.jsx("small",{children:n("selectionHistory.contentTruncated")})]}):t.jsx("div",{className:"selection-history-content",id:`selection-history-diff-${i.id}`,role:"tabpanel",children:V?t.jsx("p",{className:"selection-history-content-unavailable",children:V}):S&&t.jsx(be,{diff:S,previousLabel:n("selectionHistory.previousVersion"),currentLabel:n("selectionHistory.currentVersion")})})]})},i.id)})})]})]})})}function xe(e,s){return!e.name&&!e.username?s:e.name&&e.username?`${e.name} (@${e.username})`:e.name||`@${e.username}`}function be({diff:e,previousLabel:s,currentLabel:o}){return t.jsxs("div",{className:"selection-history-semantic-diff",children:[t.jsx(X,{label:s,pieces:e.previous,variant:"previous"}),t.jsx(X,{label:o,pieces:e.current,variant:"current"})]})}function X({label:e,pieces:s,variant:o}){return t.jsxs("section",{className:`selection-history-diff-side ${o}`,children:[t.jsx("header",{children:e}),t.jsx("pre",{children:s.length?s.map((r,d)=>t.jsx("span",{className:r.kind,children:r.text},`${d}-${r.kind}`)):"∅"})]})}function je(e,s){const o=new Date(e);return Number.isNaN(o.getTime())?e:o.toLocaleString(s,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}function G(e){return e instanceof Error&&e.name==="AbortError"}function _(e){return e instanceof Error?e.message:String(e)}export{De as SelectionHistoryDialog};
@@ -1 +1 @@
1
- import{u as f,r as n,j as e}from"./react-CltQJflK.js";import{g as y,M as b}from"./index-BgeOKYIx.js";import{A as M}from"./Dashboard-JQ8pJe2d.js";import{R as $}from"./refresh-cw-C5yVKb1r.js";import"./hard-drive-B9h-a7KY.js";import"./x-DN0Ol4Ya.js";import"./github-DJezB5ef.js";import"./sigma-9fiQHdlo.js";import"./tags-C_3BvsxV.js";function R({open:t,onOpenChange:c}){const{t:s}=f(),[r,p]=n.useState(null),[u,x]=n.useState(!1),[d,j]=n.useState(""),a=n.useCallback(async()=>{x(!0);try{p(await y("/api/health/metrics")),j("")}catch(i){j(i instanceof Error?i.message:s("errors.generic"))}finally{x(!1)}},[s]);return n.useEffect(()=>{if(!t)return;a();const i=window.setInterval(()=>{a()},5e3);return()=>window.clearInterval(i)},[t,a]),e.jsxs(b,{open:t,onOpenChange:c,wide:!0,title:s("metrics.title"),description:s("metrics.description"),footer:e.jsxs("button",{onClick:()=>{a()},disabled:u,children:[e.jsx($,{size:14,className:u?"spin":""}),s("metrics.refresh")]}),children:[d&&e.jsx("p",{className:"error",children:d}),!r&&!d&&e.jsx("p",{className:"muted",children:s("common.loading")}),r&&e.jsxs("div",{className:"system-metrics",children:[e.jsxs("div",{className:"metric-summary-grid",children:[e.jsx(l,{label:s("metrics.uptime"),value:g(r.uptimeSeconds)}),e.jsx(l,{label:s("metrics.memory"),value:`${h(r.memory.rssBytes)} RSS`,detail:`${h(r.memory.heapUsedBytes)} / ${h(r.memory.heapTotalBytes)} ${s("metrics.heap")}`}),e.jsx(l,{label:s("metrics.compileQueue"),value:`${r.compileQueue.running} / ${r.compileQueue.concurrency}`,detail:s("metrics.pending",{count:r.compileQueue.pending})}),e.jsx(l,{label:s("metrics.collaboration"),value:s("metrics.sessions",{count:r.collaboration.sessions}),detail:s("metrics.roomsAndDirty",{rooms:r.collaboration.rooms,dirty:r.collaboration.dirtyFiles})})]}),e.jsxs("section",{className:"metric-section",children:[e.jsxs("h3",{children:[e.jsx(M,{size:15}),s("metrics.eventLoop")]}),e.jsx("p",{children:s("metrics.latencySummary",r.eventLoopDelay)})]}),e.jsxs("section",{className:"metric-section",children:[e.jsx("h3",{children:s("metrics.operationDurations")}),Object.keys(r.durationsMs).length===0?e.jsx("p",{className:"muted",children:s("metrics.noSamples")}):e.jsx("div",{className:"metric-table-wrap",children:e.jsxs("table",{className:"metric-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:s("metrics.operation")}),e.jsx("th",{children:s("metrics.samples")}),e.jsx("th",{children:s("metrics.last")}),e.jsx("th",{children:"P50"}),e.jsx("th",{children:"P95"}),e.jsx("th",{children:s("metrics.max")})]})}),e.jsx("tbody",{children:Object.entries(r.durationsMs).sort(([i],[o])=>i.localeCompare(o)).map(([i,o])=>e.jsxs("tr",{children:[e.jsx("td",{children:v(i,s)}),e.jsx("td",{children:o.count}),e.jsx("td",{children:m(o.last)}),e.jsx("td",{children:m(o.p50)}),e.jsx("td",{children:m(o.p95)}),e.jsx("td",{children:m(o.max)})]},i))})]})})]})]})]})}function l({label:t,value:c,detail:s}){return e.jsxs("article",{className:"metric-card",children:[e.jsx("span",{children:t}),e.jsx("strong",{children:c}),s&&e.jsx("small",{children:s})]})}function h(t){return`${Math.round(t/1024/1024*10)/10} MB`}function g(t){const c=Math.floor(t/86400),s=Math.floor(t%86400/3600),r=Math.floor(t%3600/60);return c?`${c}d ${s}h`:s?`${s}h ${r}m`:`${r}m`}function m(t){return t>=1e3?`${Math.round(t/100)/10}s`:`${Math.round(t*10)/10}ms`}function v(t,c){return c(`metrics.operations.${t}`,{defaultValue:t})}export{R as SystemMetricsDialog};
1
+ import{u as f,r as n,j as e}from"./react-CltQJflK.js";import{g as y,M as b}from"./index-DkpU9Fgs.js";import{A as M}from"./Dashboard-DsdhFENx.js";import{R as $}from"./refresh-cw-BE8IbaHI.js";import"./hard-drive-Ctj3K_zx.js";import"./x-C_3swJOC.js";import"./github-D-JDXb-w.js";import"./sigma-LxGD9tK2.js";import"./tags-DuN89PsZ.js";function R({open:t,onOpenChange:c}){const{t:s}=f(),[r,p]=n.useState(null),[u,x]=n.useState(!1),[d,j]=n.useState(""),a=n.useCallback(async()=>{x(!0);try{p(await y("/api/health/metrics")),j("")}catch(i){j(i instanceof Error?i.message:s("errors.generic"))}finally{x(!1)}},[s]);return n.useEffect(()=>{if(!t)return;a();const i=window.setInterval(()=>{a()},5e3);return()=>window.clearInterval(i)},[t,a]),e.jsxs(b,{open:t,onOpenChange:c,wide:!0,title:s("metrics.title"),description:s("metrics.description"),footer:e.jsxs("button",{onClick:()=>{a()},disabled:u,children:[e.jsx($,{size:14,className:u?"spin":""}),s("metrics.refresh")]}),children:[d&&e.jsx("p",{className:"error",children:d}),!r&&!d&&e.jsx("p",{className:"muted",children:s("common.loading")}),r&&e.jsxs("div",{className:"system-metrics",children:[e.jsxs("div",{className:"metric-summary-grid",children:[e.jsx(l,{label:s("metrics.uptime"),value:g(r.uptimeSeconds)}),e.jsx(l,{label:s("metrics.memory"),value:`${h(r.memory.rssBytes)} RSS`,detail:`${h(r.memory.heapUsedBytes)} / ${h(r.memory.heapTotalBytes)} ${s("metrics.heap")}`}),e.jsx(l,{label:s("metrics.compileQueue"),value:`${r.compileQueue.running} / ${r.compileQueue.concurrency}`,detail:s("metrics.pending",{count:r.compileQueue.pending})}),e.jsx(l,{label:s("metrics.collaboration"),value:s("metrics.sessions",{count:r.collaboration.sessions}),detail:s("metrics.roomsAndDirty",{rooms:r.collaboration.rooms,dirty:r.collaboration.dirtyFiles})})]}),e.jsxs("section",{className:"metric-section",children:[e.jsxs("h3",{children:[e.jsx(M,{size:15}),s("metrics.eventLoop")]}),e.jsx("p",{children:s("metrics.latencySummary",r.eventLoopDelay)})]}),e.jsxs("section",{className:"metric-section",children:[e.jsx("h3",{children:s("metrics.operationDurations")}),Object.keys(r.durationsMs).length===0?e.jsx("p",{className:"muted",children:s("metrics.noSamples")}):e.jsx("div",{className:"metric-table-wrap",children:e.jsxs("table",{className:"metric-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:s("metrics.operation")}),e.jsx("th",{children:s("metrics.samples")}),e.jsx("th",{children:s("metrics.last")}),e.jsx("th",{children:"P50"}),e.jsx("th",{children:"P95"}),e.jsx("th",{children:s("metrics.max")})]})}),e.jsx("tbody",{children:Object.entries(r.durationsMs).sort(([i],[o])=>i.localeCompare(o)).map(([i,o])=>e.jsxs("tr",{children:[e.jsx("td",{children:v(i,s)}),e.jsx("td",{children:o.count}),e.jsx("td",{children:m(o.last)}),e.jsx("td",{children:m(o.p50)}),e.jsx("td",{children:m(o.p95)}),e.jsx("td",{children:m(o.max)})]},i))})]})})]})]})]})}function l({label:t,value:c,detail:s}){return e.jsxs("article",{className:"metric-card",children:[e.jsx("span",{children:t}),e.jsx("strong",{children:c}),s&&e.jsx("small",{children:s})]})}function h(t){return`${Math.round(t/1024/1024*10)/10} MB`}function g(t){const c=Math.floor(t/86400),s=Math.floor(t%86400/3600),r=Math.floor(t%3600/60);return c?`${c}d ${s}h`:s?`${s}h ${r}m`:`${r}m`}function m(t){return t>=1e3?`${Math.round(t/100)/10}s`:`${Math.round(t*10)/10}ms`}function v(t,c){return c(`metrics.operations.${t}`,{defaultValue:t})}export{R as SystemMetricsDialog};
@@ -1 +1 @@
1
- import{u as W,r as s,j as a}from"./react-CltQJflK.js";import{g as f,h as b,M as Y,d as E,C as Z}from"./index-BgeOKYIx.js";import{P as _}from"./plus-BwKRQJHI.js";import{P as ee,T as ae,X as te}from"./x-DN0Ol4Ya.js";import{C as ne}from"./check-EZ2H-iDj.js";const H=["red","orange","yellow","green","blue","purple","gray"];function S(l){return[...l].sort((C,y)=>C.name.localeCompare(y.name))}function se(l){return l instanceof Error&&l.name==="AbortError"}function de({open:l,onOpenChange:C,onTagCreated:y,onTagUpdated:R,onTagDeleted:X}){const{t}=W(),[T,h]=s.useState([]),[G,w]=s.useState(!1),[D,i]=s.useState(""),[p,k]=s.useState(""),[z,L]=s.useState("blue"),[d,P]=s.useState(!1),[$,m]=s.useState(null),[j,I]=s.useState(""),[M,A]=s.useState("blue"),[N,O]=s.useState(null),[o,v]=s.useState(null),[Q,g]=s.useState(""),[u,q]=s.useState(!1);s.useEffect(()=>{if(!l)return;const e=new AbortController;return w(!0),i(""),f("/api/tags/management",{signal:e.signal}).then(n=>h(S(n.tags))).catch(n=>{se(n)||i(b(n))}).finally(()=>{e.signal.aborted||w(!1)}),()=>e.abort()},[l]);const F=async()=>{if(!(!p.trim()||d)){P(!0),i("");try{const e=await f("/api/tags",{method:"POST",body:JSON.stringify({name:p,color:z})});h(n=>S([...n,{...e.tag,projectCount:0}])),y(e.tag),k(""),L("blue")}catch(e){i(b(e))}finally{P(!1)}}},U=e=>{m(e.id),I(e.name),A(e.color),i("")},J=async e=>{if(!(!j.trim()||N)){O(e.id),i("");try{const n=await f(`/api/tags/${e.id}`,{method:"PATCH",body:JSON.stringify({name:j,color:M})}),c={...n.tag,projectCount:e.projectCount};h(r=>S(r.map(B=>B.id===e.id?c:B))),R(n.tag),m(null)}catch(n){i(b(n))}finally{O(null)}}},V=async()=>{if(!(!o||u)){q(!0),g("");try{await f(`/api/tags/${o.id}`,{method:"DELETE"}),h(e=>e.filter(n=>n.id!==o.id)),X(o.id),v(null),$===o.id&&m(null)}catch(e){g(b(e))}finally{q(!1)}}},x=d||N!==null||u,K=e=>{!e&&x||(e||(i(""),g(""),m(null)),C(e))};return a.jsxs(a.Fragment,{children:[a.jsx(Y,{open:l,title:t("tags.manage"),description:t("tags.manageDescription"),wide:!0,className:"tag-management-modal",onOpenChange:K,footer:a.jsx("button",{onClick:()=>K(!1),disabled:x,children:t("common.close")}),children:a.jsxs("div",{className:"tag-management",children:[D&&a.jsx("p",{className:"error dialog-error",role:"alert",children:D}),a.jsxs("div",{className:"tag-management-create",children:[a.jsxs("label",{className:"tag-management-field",children:[a.jsx("span",{children:t("tags.name")}),a.jsx("input",{autoFocus:!0,value:p,maxLength:32,placeholder:t("tags.name"),onChange:e=>{k(e.target.value),i("")},onKeyDown:e=>{e.key==="Enter"&&(e.preventDefault(),F())}})]}),a.jsxs("label",{className:"tag-management-field tag-management-color",children:[a.jsx("span",{children:t("tags.color")}),a.jsx("select",{value:z,onChange:e=>L(e.target.value),children:H.map(e=>a.jsx("option",{value:e,children:t(`tags.${e}`)},e))})]}),a.jsxs("button",{type:"button",className:"primary",disabled:!p.trim()||d,"aria-busy":d,onClick:()=>{F()},children:[d?a.jsx(E,{className:"spin",size:14}):a.jsx(_,{"aria-hidden":!0,size:14}),t("tags.createInManager")]})]}),G?a.jsxs("div",{className:"tag-management-loading",children:[a.jsx(E,{className:"spin",size:16}),t("common.loading")]}):T.length===0?a.jsx("p",{className:"tag-management-empty",children:t("tags.noTags")}):a.jsx("div",{className:"tag-management-list",children:T.map(e=>{const n=$===e.id,c=N===e.id;return a.jsxs("article",{className:`tag-management-item${n?" editing":""}`,children:[a.jsxs("div",{className:"tag-management-item-main",children:[a.jsx("span",{className:`tag-dot tag-${e.color}`,"aria-hidden":"true"}),a.jsxs("div",{children:[a.jsx("strong",{title:e.name,children:e.name}),a.jsx("small",{children:t("tags.projectCount",{count:e.projectCount})})]})]}),a.jsxs("div",{className:"tag-management-item-actions",children:[a.jsx("button",{type:"button",title:t("tags.edit"),"aria-label":t("tags.edit"),disabled:x&&!n,onClick:()=>U(e),children:a.jsx(ee,{"aria-hidden":!0,size:14})}),a.jsx("button",{type:"button",className:"danger-text",title:t("common.delete"),"aria-label":t("common.delete"),disabled:x,onClick:()=>{v(e),g("")},children:a.jsx(ae,{"aria-hidden":!0,size:14})})]}),n&&a.jsxs("div",{className:"tag-management-edit",children:[a.jsxs("label",{className:"tag-management-field",children:[a.jsx("span",{children:t("tags.rename")}),a.jsx("input",{value:j,maxLength:32,onChange:r=>{I(r.target.value),i("")},onKeyDown:r=>{r.key==="Enter"&&(r.preventDefault(),J(e))}})]}),a.jsxs("label",{className:"tag-management-field tag-management-color",children:[a.jsx("span",{children:t("tags.color")}),a.jsx("select",{value:M,onChange:r=>{A(r.target.value),i("")},children:H.map(r=>a.jsx("option",{value:r,children:t(`tags.${r}`)},r))})]}),a.jsxs("div",{className:"tag-management-edit-actions",children:[a.jsxs("button",{type:"button",disabled:c,onClick:()=>{m(null),i("")},children:[a.jsx(te,{"aria-hidden":!0,size:14}),t("common.cancel")]}),a.jsxs("button",{type:"button",className:"primary",disabled:!j.trim()||c,"aria-busy":c,onClick:()=>{J(e)},children:[c?a.jsx(E,{className:"spin",size:14}):a.jsx(ne,{"aria-hidden":!0,size:14}),t("common.save")]})]})]})]},e.id)})})]})}),a.jsx(Z,{open:!!o,title:t("tags.deleteTitle"),description:t("tags.deleteDescription",{tag:o?.name??"",count:o?.projectCount??0}),confirmLabel:t(u?"common.loading":"common.delete"),danger:!0,busy:u,error:Q,onCancel:()=>{u||(v(null),g(""))},onConfirm:()=>{V()}})]})}export{de as TagManagementDialog};
1
+ import{u as W,r as s,j as a}from"./react-CltQJflK.js";import{g as f,h as b,M as Y,d as E,C as Z}from"./index-DkpU9Fgs.js";import{P as _}from"./plus-CCxK-HNt.js";import{P as ee,T as ae,X as te}from"./x-C_3swJOC.js";import{C as ne}from"./check-CwBYzomT.js";const H=["red","orange","yellow","green","blue","purple","gray"];function S(l){return[...l].sort((C,y)=>C.name.localeCompare(y.name))}function se(l){return l instanceof Error&&l.name==="AbortError"}function de({open:l,onOpenChange:C,onTagCreated:y,onTagUpdated:R,onTagDeleted:X}){const{t}=W(),[T,h]=s.useState([]),[G,w]=s.useState(!1),[D,i]=s.useState(""),[p,k]=s.useState(""),[z,L]=s.useState("blue"),[d,P]=s.useState(!1),[$,m]=s.useState(null),[j,I]=s.useState(""),[M,A]=s.useState("blue"),[N,O]=s.useState(null),[o,v]=s.useState(null),[Q,g]=s.useState(""),[u,q]=s.useState(!1);s.useEffect(()=>{if(!l)return;const e=new AbortController;return w(!0),i(""),f("/api/tags/management",{signal:e.signal}).then(n=>h(S(n.tags))).catch(n=>{se(n)||i(b(n))}).finally(()=>{e.signal.aborted||w(!1)}),()=>e.abort()},[l]);const F=async()=>{if(!(!p.trim()||d)){P(!0),i("");try{const e=await f("/api/tags",{method:"POST",body:JSON.stringify({name:p,color:z})});h(n=>S([...n,{...e.tag,projectCount:0}])),y(e.tag),k(""),L("blue")}catch(e){i(b(e))}finally{P(!1)}}},U=e=>{m(e.id),I(e.name),A(e.color),i("")},J=async e=>{if(!(!j.trim()||N)){O(e.id),i("");try{const n=await f(`/api/tags/${e.id}`,{method:"PATCH",body:JSON.stringify({name:j,color:M})}),c={...n.tag,projectCount:e.projectCount};h(r=>S(r.map(B=>B.id===e.id?c:B))),R(n.tag),m(null)}catch(n){i(b(n))}finally{O(null)}}},V=async()=>{if(!(!o||u)){q(!0),g("");try{await f(`/api/tags/${o.id}`,{method:"DELETE"}),h(e=>e.filter(n=>n.id!==o.id)),X(o.id),v(null),$===o.id&&m(null)}catch(e){g(b(e))}finally{q(!1)}}},x=d||N!==null||u,K=e=>{!e&&x||(e||(i(""),g(""),m(null)),C(e))};return a.jsxs(a.Fragment,{children:[a.jsx(Y,{open:l,title:t("tags.manage"),description:t("tags.manageDescription"),wide:!0,className:"tag-management-modal",onOpenChange:K,footer:a.jsx("button",{onClick:()=>K(!1),disabled:x,children:t("common.close")}),children:a.jsxs("div",{className:"tag-management",children:[D&&a.jsx("p",{className:"error dialog-error",role:"alert",children:D}),a.jsxs("div",{className:"tag-management-create",children:[a.jsxs("label",{className:"tag-management-field",children:[a.jsx("span",{children:t("tags.name")}),a.jsx("input",{autoFocus:!0,value:p,maxLength:32,placeholder:t("tags.name"),onChange:e=>{k(e.target.value),i("")},onKeyDown:e=>{e.key==="Enter"&&(e.preventDefault(),F())}})]}),a.jsxs("label",{className:"tag-management-field tag-management-color",children:[a.jsx("span",{children:t("tags.color")}),a.jsx("select",{value:z,onChange:e=>L(e.target.value),children:H.map(e=>a.jsx("option",{value:e,children:t(`tags.${e}`)},e))})]}),a.jsxs("button",{type:"button",className:"primary",disabled:!p.trim()||d,"aria-busy":d,onClick:()=>{F()},children:[d?a.jsx(E,{className:"spin",size:14}):a.jsx(_,{"aria-hidden":!0,size:14}),t("tags.createInManager")]})]}),G?a.jsxs("div",{className:"tag-management-loading",children:[a.jsx(E,{className:"spin",size:16}),t("common.loading")]}):T.length===0?a.jsx("p",{className:"tag-management-empty",children:t("tags.noTags")}):a.jsx("div",{className:"tag-management-list",children:T.map(e=>{const n=$===e.id,c=N===e.id;return a.jsxs("article",{className:`tag-management-item${n?" editing":""}`,children:[a.jsxs("div",{className:"tag-management-item-main",children:[a.jsx("span",{className:`tag-dot tag-${e.color}`,"aria-hidden":"true"}),a.jsxs("div",{children:[a.jsx("strong",{title:e.name,children:e.name}),a.jsx("small",{children:t("tags.projectCount",{count:e.projectCount})})]})]}),a.jsxs("div",{className:"tag-management-item-actions",children:[a.jsx("button",{type:"button",title:t("tags.edit"),"aria-label":t("tags.edit"),disabled:x&&!n,onClick:()=>U(e),children:a.jsx(ee,{"aria-hidden":!0,size:14})}),a.jsx("button",{type:"button",className:"danger-text",title:t("common.delete"),"aria-label":t("common.delete"),disabled:x,onClick:()=>{v(e),g("")},children:a.jsx(ae,{"aria-hidden":!0,size:14})})]}),n&&a.jsxs("div",{className:"tag-management-edit",children:[a.jsxs("label",{className:"tag-management-field",children:[a.jsx("span",{children:t("tags.rename")}),a.jsx("input",{value:j,maxLength:32,onChange:r=>{I(r.target.value),i("")},onKeyDown:r=>{r.key==="Enter"&&(r.preventDefault(),J(e))}})]}),a.jsxs("label",{className:"tag-management-field tag-management-color",children:[a.jsx("span",{children:t("tags.color")}),a.jsx("select",{value:M,onChange:r=>{A(r.target.value),i("")},children:H.map(r=>a.jsx("option",{value:r,children:t(`tags.${r}`)},r))})]}),a.jsxs("div",{className:"tag-management-edit-actions",children:[a.jsxs("button",{type:"button",disabled:c,onClick:()=>{m(null),i("")},children:[a.jsx(te,{"aria-hidden":!0,size:14}),t("common.cancel")]}),a.jsxs("button",{type:"button",className:"primary",disabled:!j.trim()||c,"aria-busy":c,onClick:()=>{J(e)},children:[c?a.jsx(E,{className:"spin",size:14}):a.jsx(ne,{"aria-hidden":!0,size:14}),t("common.save")]})]})]})]},e.id)})})]})}),a.jsx(Z,{open:!!o,title:t("tags.deleteTitle"),description:t("tags.deleteDescription",{tag:o?.name??"",count:o?.projectCount??0}),confirmLabel:t(u?"common.loading":"common.delete"),danger:!0,busy:u,error:Q,onCancel:()=>{u||(v(null),g(""))},onConfirm:()=>{V()}})]})}export{de as TagManagementDialog};
@@ -0,0 +1 @@
1
+ import{u as c,j as o}from"./react-CltQJflK.js";import{M as x,d as h}from"./index-DkpU9Fgs.js";import{H as j}from"./ProjectWorkspace-CAX3qEYr.js";import{T as u}from"./type-BiettCiY.js";import{k as m}from"./x-C_3swJOC.js";import"./chevron-up-D5lCNKlk.js";import"./check-CwBYzomT.js";import"./search-CPbhRWQE.js";import"./index-_eYe7K9T.js";import"./refresh-cw-BE8IbaHI.js";function W({open:l,mode:d,path:s,busy:i,error:e,result:t,onOpenChange:n}){const{t:r}=c(),a=r(d==="full"?"editor.wordCountFullHint":"editor.wordCountSelectionHint");return o.jsxs(x,{open:l,title:r("editor.wordCountTitle"),description:a,onOpenChange:n,footer:o.jsx("button",{type:"button",onClick:()=>n(!1),children:r("common.close")}),children:[s&&o.jsxs("p",{className:"word-count-source",children:[r(d==="full"?"editor.wordCountFull":"editor.wordCountSelection")," · ",o.jsx("code",{children:s}),o.jsx("a",{href:"https://app.uio.no/ifi/texcount/",target:"_blank",rel:"noreferrer",children:r("editor.wordCountHelp")})]}),o.jsx("p",{className:"word-count-template-note",children:r("editor.wordCountTemplateNote")}),i&&o.jsxs("div",{className:"word-count-loading",role:"status","aria-live":"polite",children:[o.jsx(h,{className:"spin",size:22}),o.jsx("span",{children:r("editor.wordCountLoading")})]}),e&&o.jsx("p",{className:"error dialog-error",children:e}),t&&!i&&o.jsxs("div",{className:"word-count-result","aria-live":"polite",children:[o.jsxs("div",{className:"word-count-totals",children:[o.jsxs("div",{className:"word-count-total",children:[o.jsx(j,{size:20}),o.jsx("strong",{children:t.totalWords.toLocaleString()}),o.jsx("span",{children:r("editor.wordCountTotal")})]}),o.jsxs("div",{className:"word-count-total word-count-characters",children:[o.jsx(u,{size:20}),o.jsx("strong",{children:t.totalCharacters.toLocaleString()}),o.jsxs("span",{children:[r("editor.wordCountCharacters"),o.jsx("small",{children:r("editor.wordCountCharactersHint")})]})]})]}),o.jsxs("dl",{className:"word-count-breakdown",children:[o.jsxs("div",{children:[o.jsx("dt",{children:r("editor.wordCountText")}),o.jsxs("dd",{children:[t.textWords.toLocaleString(),o.jsx("small",{children:r("editor.wordCountWordsUnit")})]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:r("editor.wordCountHeaders")}),o.jsxs("dd",{children:[t.headerWords.toLocaleString(),o.jsx("small",{children:r("editor.wordCountWordsUnit")})]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:r("editor.wordCountCaptions")}),o.jsxs("dd",{children:[t.captionWords.toLocaleString(),o.jsx("small",{children:r("editor.wordCountWordsUnit")})]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:r("editor.wordCountFloats")}),o.jsxs("dd",{children:[t.floats.toLocaleString(),o.jsx("small",{children:r("editor.wordCountItemsUnit")})]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:r("editor.wordCountInlineMath")}),o.jsxs("dd",{children:[t.inlineMath.toLocaleString(),o.jsx("small",{children:r("editor.wordCountExpressionsUnit")})]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:r("editor.wordCountDisplayMath")}),o.jsxs("dd",{children:[t.displayMath.toLocaleString(),o.jsx("small",{children:r("editor.wordCountExpressionsUnit")})]})]}),t.files!==null&&o.jsxs("div",{children:[o.jsx("dt",{children:r("editor.wordCountFiles")}),o.jsxs("dd",{children:[t.files.toLocaleString(),o.jsx("small",{children:r("editor.wordCountItemsUnit")})]})]})]}),t.parserErrors>0&&o.jsxs("p",{className:"warning word-count-warning",children:[o.jsx(m,{size:14}),r("editor.wordCountParserErrors",{count:t.parserErrors})]})]})]})}export{W as WordCountDialog};
@@ -0,0 +1 @@
1
+ import{c}from"./index-DkpU9Fgs.js";const o=c("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);export{o as C};
@@ -0,0 +1 @@
1
+ import{c as o}from"./index-DkpU9Fgs.js";const n=o("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const r=o("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);export{n as C,r as a};
@@ -0,0 +1,3 @@
1
+ import{g as y,A as b}from"./index-DkpU9Fgs.js";import{a as L,c as $}from"./ProjectWorkspace-CAX3qEYr.js";import"./react-CltQJflK.js";import"./chevron-up-D5lCNKlk.js";import"./check-CwBYzomT.js";import"./x-C_3swJOC.js";import"./search-CPbhRWQE.js";import"./index-_eYe7K9T.js";import"./refresh-cw-BE8IbaHI.js";class k extends Error{constructor(){super("A newer ChkTeX check replaced this request."),this.name="ChktexLintSupersededError"}}function J(t){return t instanceof k}const O=$();let T=0;async function I(t,s,e,r){try{return(await y(`/api/projects/${t}/chktex`,{method:"POST",body:JSON.stringify({path:s,source:e,clientId:O,sequence:r})})).issues}catch(o){throw o instanceof b&&o.code==="CHK_TEX_SUPERSEDED"?new k:o}}function M(t){const s=[0],e=new TextEncoder;let r=0;for(const o of t){const a=e.encode(o).length;r+=o.length;for(let n=0;n<a;n+=1)s.push(r)}return s}function X(t){const s=[0];for(let e=0;e<t.length;e+=1)t[e]===`
2
+ `&&s.push(e+1);return s}function q(t,s){const e=X(t),r=new Set,o=new Map,a=[];for(const n of s){const i=n.line-1;if(!Number.isSafeInteger(i)||i<0||i>=e.length)continue;let l=o.get(i);if(!l){const m=e[i]??0,g=t.indexOf(`
3
+ `,m),w=g===-1?t.length:g,x=t.slice(m,w);l={start:m,line:x,offsets:M(x)},o.set(i,l)}const{start:d,line:C,offsets:h}=l,c=n.column-1;if(!Number.isSafeInteger(c)||c<0||c>=h.length-1)continue;const f=d+h[c],E=Math.min(h.length-1,c+Math.max(1,n.length)),u=d+(h[E]??C.length);if(f>=t.length||u<=f)continue;const S=t.slice(f,Math.min(u,t.length)),p=`${f}:${u}:${n.number??""}`;r.has(p)||(r.add(p),a.push({from:f,to:Math.min(u,t.length),word:S,kind:"latex",message:n.number===null?`ChkTeX: ${n.message}`:`ChkTeX ${n.number}: ${n.message}`,suggestions:[]}))}return a.sort((n,i)=>n.from-i.from||n.to-i.to)}async function K(t,s,e){if(!L(s))return[];const r=await I(t,s,e,++T);return q(e,r)}export{k as ChktexLintSupersededError,J as isChktexLintSupersededError,K as lintChktex,q as mapChktexLints};
@@ -22,5 +22,5 @@ ${H}`))}E=`
22
22
  ${H}${Du.join(`
23
23
 
24
24
  ${H}`)}
25
- ${B}`}return W(E)}return`"${E}"`}).join(" # ")}D(Q,"formatValue");var it={auth:{description:"Last name of first authors",callback:D(u=>{const t=S(u.get("author")??"",!0)[0]?.lastName.replace(/(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u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uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF])+/g,"_");return t?[t]:[]},"callback")},authEtAl:{description:"If 1 or 2 authors, both authors, otherwise first author and EtAl",callback:D(u=>{const e=S(u.get("author")??"",!0);return[...e.slice(0,2).map(t=>t.lastName.replace(/(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\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B\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF])+/g,"_")),...e.length>2?["Et","Al"]:[]]},"callback")},authors:{description:"Last name all authors",callback:D(u=>S(u.get("author")??"",!0).map(t=>t.lastName.replace(/(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB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E3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF])+/g,"_")),"callback")},authorsN:{description:"Last name N authors, with EtAl if more",callback:D((u,e=0)=>{const t=S(u.get("author")??"",!0);return[...t.slice(0,e).map(F=>F.lastName.replace(/(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F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FFF])+/g,"_")),...t.length>e?["Et","Al"]:[]]},"callback")},veryshorttitle:{description:"First non-function word of the title",callback:D(u=>uu(G(u)).slice(0,1),"callback")},shorttitle:{description:"First three non-function words of the title",callback:D(u=>uu(G(u)).slice(0,3),"callback")},title:{description:"Full title, capitalized",callback:D(u=>tu(V(G(u))),"callback")},fulltitle:{description:"Full title, verbatim",callback:D(u=>V(G(u)),"callback")},year:{description:"Year",callback:D(u=>{const e=u.get("year")?.replace(/[^0-9]/g,"");return e?[e]:[]},"callback")},duplicateLetter:{description:"If the multiple entries end up with the same key, then insert a letter a-z. By default this will be inserted at the end.",callback:D(()=>["[duplicateLetter]"],"callback")},duplicateNumber:{description:"If the multiple entries end up with the same key, then insert a number.",callback:D(()=>["[duplicateNumber]"],"callback")}},nt={required:{description:"If data is missing, revert to existing key",callback:D(u=>{if(u.length===0)throw new Lu;return u},"callback")},lower:{description:"Convert to lowercase",callback:D(u=>u.map(e=>e.toLocaleLowerCase()),"callback")},upper:{description:"Convert to uppercase",callback:D(u=>u.map(e=>e.toLocaleUpperCase()),"callback")},capitalize:{description:"Capitalize first letter of each word",callback:tu}},Lu=class extends Error{static{D(this,"MissingRequiredData")}};function Ru(u,e,t){let F=t;!t.includes("[duplicateLetter]")&&!t.includes("[duplicateNumber]")&&(F=`${t}[duplicateLetter]`);const r=new Map;for(const a of u.children)if(U(a)){const c=e.get(a.block);if(!c)continue;const d=Iu(c,F);if(!d)continue;const m=r.get(d)??[];r.set(d,[...m,a.block])}const s=new Map;for(const[a,c]of r)for(const[d,m]of c.entries()){const h=c.length>1?String.fromCharCode(97+d):"",l=c.length>1?String(d+1):"";m.key=a.replace(/\[duplicateLetter\]/g,h).replace(/\[duplicateNumber\]/g,l)}return s}D(Ru,"generateKeys");function Iu(u,e){try{const t=e.replace(/\[[^:\]]+(?::[^:\]]+)*\]/g,F=>{const[r,...s]=F.slice(1,-1).split(":");if(!r)throw new Error("Token parse error");let a;const c=r.replace(/[0-9]+/g,h=>(a=Number(h),"N")),d=it[c];let m;if(d)m=d.callback(u,a);else if(c===c.toLocaleUpperCase()){const h=u.get(c.toLocaleLowerCase());m=h?V(h):[]}else throw new Error(`Invalid citation key token ${c}`);for(const h of s){const l=nt[h];if(l)m=l.callback(m);else throw new Error(`Invalid modifier ${h}`)}return m.join("")});return t===""?void 0:t}catch(t){if(t instanceof Lu)return;throw t}}D(Iu,"generateKey");var dt=new Set(["a","about","above","across","against","along","among","an","and","around","at","before","behind","below","beneath","beside","between","beyond","but","by","down","during","except","for","for","from","in","inside","into","like","near","nor","of","off","on","onto","or","since","so","the","through","to","toward","under","until","up","upon","with","within","without","yet"]);function uu(u){return V(u).filter(e=>!dt.has(e.toLocaleLowerCase()))}D(uu,"nonFunctionWords");function V(u){return u.split(/(?:[\0-\/:-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\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E45-\uDE7F\uDEAB-\uDEB7\uDEB9-\uDEFF\uDF1B-\uDF3F\uDF47-\uDFFF]|\uD806[\uDC2C-\uDC9F\uDCE0-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC00-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80E-\uD810\uD812-\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD834\uD836\uD83C-\uD83F\uD87C\uD87D\uD87F\uD889-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F-\uDE6F\uDEBF-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF])+/).filter(e=>e.length>0)}D(V,"words");function tu(u){return u.map(e=>e.slice(0,1).toLocaleUpperCase()+e.slice(1).toLocaleLowerCase())}D(tu,"capitalize");function G(u){return u.get("title")??u.get("booktitle")??""}D(G,"title");var Tu=["doi","citation","abstract"],eu=14,j=2,ct=80,qu=["title","shorttitle","author","year","month","day","journal","booktitle","location","on","publisher","address","series","volume","number","pages","doi","isbn","issn","url","urldate","copyright","category","note","metadata"],lt=["key"],Su="[auth:required:lower][year:required][veryshorttitle:lower][duplicateNumber]",ht=[{key:"help",cli:{"--help":!0,"-h":!0},title:"Help",description:["Show help"],type:"boolean"},{key:"v2",cli:{"--v2":!0},title:"Enable planned v2 CLI changes",description:["Input files will no longer be modified by default. Instead, you will need to specify `--modify`/`-m` option to overwrite the file, or `--output`/`-o` to output to a different file."],type:"string",defaultValue:void 0},{key:"outputPath",cli:{"--output":D(u=>u[0],"--output"),"-o":D(u=>u[0],"-o")},title:"Output path",description:["Write output to specified path. When omitted (and -m/--modify is not used), the result will be printed to stdout."],type:"string",defaultValue:void 0},{key:"modify",cli:{"--modify":!0,"-m":!0,"--no-modify":!1},title:"Modify input files",description:["Overwrite the original input files with the tidied result. This is enabled by default but will be disabled by default in v2. For v1, use --no-modify to output to stdout instead of overwriting the input files."],type:"boolean",defaultValue:!0},{key:"omit",cli:{"--omit":D(u=>(u.length===0&&(console.error("Expected a omit list"),process.exit(1)),u),"--omit")},toCLI:D(u=>Array.isArray(u)&&u.length>0?`--omit=${u.join(",")}`:void 0,"toCLI"),title:"Remove fields",description:["Remove specified fields from bibliography entries."],examples:["--omit=id,name"],type:"string[]",defaultValue:[]},{key:"curly",cli:{"--curly":!0,"--no-curly":!1},toCLI:D(u=>u?"--curly":void 0,"toCLI"),title:"Enclose values in braces",description:['Enclose all property values in braces. Quoted values will be converted to braces. For example, "Journal of Tea" will become {Journal of Tea}.'],type:"boolean",defaultValue:!1},{key:"numeric",cli:{"--numeric":!0,"--no-numeric":!1},toCLI:D(u=>u?"--numeric":void 0,"toCLI"),title:"Use numeric values where possible",description:["Strip quotes and braces from numeric/month values. For example, {1998} will become 1998."],type:"boolean",defaultValue:!1},{key:"months",cli:{"--months":!0},toCLI:D(u=>u?"--months":void 0,"toCLI"),title:"Abbreviate months",description:["Convert all months to three letter abbreviations (jan, feb, etc)."],type:"boolean",defaultValue:!1},{key:"space",cli:{"--space":D(u=>u.length>0?Number(u[0]):!0,"--space")},toCLI:D((u,e)=>{if(!e.tab){if(typeof u=="number"&&u!==j)return`--space=${u}`;if(u&&u!==j)return"--space"}},"toCLI"),title:"Indent with spaces",description:["Indent all fields with the specified number of spaces. Ignored if tab is set."],examples:["--space=2 (default)","--space=4"],type:"boolean | number",convertBoolean:{true:j,false:void 0},defaultValue:j},{key:"tab",cli:{"--tab":!0,"--no-tab":!1},toCLI:D(u=>u?"--tab":void 0,"toCLI"),title:"Indent with tabs",description:["Indent all fields with a tab."],type:"boolean",defaultValue:!1},{key:"align",cli:{"--align":D(u=>Number(u[0]),"--align"),"--no-align":!1},toCLI:D(u=>{if(u===!1||u===1||u===0)return"--no-align";if(typeof u=="number"&&u!==eu)return`--align=${u}`},"toCLI"),title:"Align values",description:["Insert whitespace between fields and values so that values are visually aligned."],examples:["--align=14 (default)"],type:"boolean | number",convertBoolean:{true:eu,false:1},defaultValue:eu},{key:"blankLines",cli:{"--blank-lines":!0,"--no-blank-lines":!1},toCLI:D(u=>u?"--blank-lines":void 0,"toCLI"),title:"Insert blank lines",description:["Insert an empty line between each entry."],type:"boolean"},{key:"sort",cli:{"--sort":D(u=>u.length>0?u:!0,"--sort"),"--no-sort":!1},toCLI:D(u=>{if(Array.isArray(u)&&u.length>0)return`--sort=${u.join(",")}`;if(u===!0)return"--sort"},"toCLI"),title:"Sort bibliography entries",description:["Sort entries by the specified field names (citation key is used if no fields are specified). For descending order, prefix the field with a dash (-).","Multiple fields may be specified to sort everything by first field, then by the second field whenever the first field for entries are equal, etc.","The following additional fields are also permitted: key (entry citation key), type (sorts by the type of entry, e.g. article), and special (ensures that @string, @preamble, @set, and @xdata entries are first). "],examples:["--sort (sort by citation key)","--sort=-year,name (sort year descending then name ascending)","--sort=name,year"],type:"boolean | string[]",convertBoolean:{true:lt,false:void 0}},{key:"duplicates",cli:{"--duplicates":D(u=>{if(u.length===0)return!0;for(const e of u)e!=="doi"&&e!=="key"&&e!=="abstract"&&e!=="citation"&&(console.error(`Invalid key for merge option: "${e}"`),process.exit(1));return u},"--duplicates")},toCLI:D(u=>{if(Array.isArray(u)&&u.length>0)return`--duplicates=${u.join(",")}`;if(u===!0)return"--duplicates"},"toCLI"),title:"Check for duplicates",description:["Warn if duplicates are found, which are entries where DOI, abstract, or author and title are the same."],examples:["--duplicates doi (same DOIs)","--duplicates key (same IDs)","--duplicates abstract (similar abstracts)","--duplicates citation (similar author and titles)","--duplicates doi, key (identical DOI or keys)","--duplicates (same DOI, key, abstract, or citation)"],type:"boolean | ('doi' | 'key' | 'abstract' | 'citation')[]",convertBoolean:{true:Tu,false:void 0},defaultValue:D(u=>u.merge?Tu:void 0,"defaultValue")},{key:"merge",cli:{"--merge":D(u=>u.length===0?!0:(u[0]!=="first"&&u[0]!=="last"&&u[0]!=="combine"&&u[0]!=="overwrite"&&(console.error(`Invalid merge strategy: "${u[0]}"`),process.exit(1)),u[0]),"--merge"),"--no-merge":!1},toCLI:D(u=>{if(typeof u=="string")return`--merge=${u}`;if(u)return"--merge"},"toCLI"),title:"Merge duplicate entries",description:["Merge duplicates entries. Use the duplicates option to determine how duplicates are identified. There are different ways to merge:","- first: only keep the original entry","- last: only keep the last found duplicate","- combine: keep original entry and merge in fields of duplicates if they do not already exist","- overwrite: keep original entry and merge in fields of duplicates, overwriting existing fields if they exist"],type:"boolean | 'first' | 'last' | 'combine' | 'overwrite'",convertBoolean:{true:"combine",false:void 0}},{key:"stripEnclosingBraces",cli:{"--strip-enclosing-braces":!0},toCLI:D(u=>u?"--strip-enclosing-braces":void 0,"toCLI"),title:"Strip double-braced values",description:["Where an entire value is enclosed in double braces, remove the extra braces. For example, {{Journal of Tea}} will become {Journal of Tea}."],type:"boolean",defaultValue:!1},{key:"dropAllCaps",cli:{"--drop-all-caps":!0},toCLI:D(u=>u?"--drop-all-caps":void 0,"toCLI"),title:"Drop all caps",description:["Where values are all caps, make them title case. For example, {JOURNAL OF TEA} will become {Journal of Tea}. Roman numerals will be left unchanged."],type:"boolean",defaultValue:!1},{key:"escape",cli:{"--escape":!0,"--no-escape":!1},toCLI:D(u=>u===!1?"--no-escape":void 0,"toCLI"),title:"Escape special characters",description:["Escape special characters, such as umlaut. This ensures correct typesetting with latex. Enabled by default."],type:"boolean",defaultValue:!0},{key:"sortFields",cli:{"--sort-fields":D(u=>u.length>0?u:!0,"--sort-fields")},toCLI:D(u=>{if(Array.isArray(u)&&u.length>0)return JSON.stringify(u)===JSON.stringify(qu)?"--sort-fields":`--sort-fields=${u.join(",")}`;if(u===!0)return"--sort-fields"},"toCLI"),title:"Sort fields",description:["Sort the fields within entries.","If no fields are specified fields will be sorted by: title, shorttitle, author, year, month, day, journal, booktitle, location, on, publisher, address, series, volume, number, pages, doi, isbn, issn, url, urldate, copyright, category, note, metadata"],examples:["--sort-fields=name,author"],type:"boolean | string[]",convertBoolean:{true:qu,false:void 0},defaultValue:void 0},{key:"sortProperties",cli:{"--sort-properties":D(u=>u.length>0?u:!0,"--sort-properties")},title:"Sort properties",description:["Alias of sort fields (legacy)"],type:"boolean | string[]",deprecated:!0},{key:"stripComments",cli:{"--strip-comments":!0,"--no-strip-comments":!1},toCLI:D(u=>u?"--strip-comments":void 0,"toCLI"),title:"Remove comments",description:["Remove all comments from the bibtex source."],type:"boolean",defaultValue:!1},{key:"trailingCommas",cli:{"--trailing-commas":!0,"--no-trailing-commas":!0},toCLI:D(u=>u?"--trailing-commas":void 0,"toCLI"),title:"Trailing commas",description:["End the last key value pair in each entry with a comma."],type:"boolean",defaultValue:!1},{key:"encodeUrls",cli:{"--encode-urls":!0,"--no-encode-urls":!0},toCLI:D(u=>u?"--encode-urls":void 0,"toCLI"),title:"Encode URLs",description:["Replace invalid URL characters with percent encoded values."],type:"boolean",defaultValue:!1},{key:"tidyComments",cli:{"--tidy-comments":!0,"--no-tidy-comments":!1},toCLI:D(u=>u===!1?"--no-tidy-comments":void 0,"toCLI"),title:"Tidy comments",description:["Remove whitespace surrounding comments."],type:"boolean",defaultValue:!0},{key:"removeEmptyFields",cli:{"--remove-empty-fields":!0,"--no-remove-empty-fields":!1},toCLI:D(u=>u?"--remove-empty-fields":void 0,"toCLI"),title:"Remove empty fields",description:["Remove any fields that have empty values."],type:"boolean",defaultValue:!1},{key:"removeDuplicateFields",cli:{"--remove-dupe-fields":!0,"--no-remove-dupe-fields":!1},toCLI:D(u=>u===!1?"--no-remove-dupe-fields":void 0,"toCLI"),title:"Remove duplicate fields",description:["Only allow one of each field in each entry. Enabled by default."],type:"boolean",defaultValue:!0},{key:"generateKeys",cli:{"--generate-keys":D(u=>u.length>0?u:!0,"--generate-keys")},toCLI:D(u=>{if(u===!0||u===Su)return"--generate-keys";if(typeof u=="string")return`--generate-keys="${u.replace(/"/g,'\\"')}"`},"toCLI"),title:"Generate citation keys [Experimental]",description:["For all entries replace the key with a new key of the form <author><year><title>. A JabRef citation pattern can be provided. This is an experimental option that may change without warning."],type:"boolean | string",convertBoolean:{true:Su,false:void 0},defaultValue:void 0},{key:"maxAuthors",cli:{"--max-authors":D(u=>Number(u[0]),"--max-authors")},toCLI:D(u=>u?`--max-authors=${u}`:void 0,"toCLI"),title:"Maximum authors",description:['Truncate authors if above a given number into "and others".'],type:"number"},{key:"lowercase",cli:{"--no-lowercase":!1},toCLI:D(u=>u===!1?"--no-lowercase":void 0,"toCLI"),title:"Lowercase fields",description:["Lowercase field names and entry type. Enabled by default."],type:"boolean",defaultValue:!0},{key:"enclosingBraces",cli:{"--enclosing-braces":D(u=>u.length>0?u:!0,"--enclosing-braces")},toCLI:D(u=>{if(Array.isArray(u)&&u.length>0)return`--enclosing-braces=${u.join(",")}`;if(u===!0)return"--enclosing-braces"},"toCLI"),title:"Enclose values in double braces",description:["Enclose the given fields in double braces, such that case is preserved during BibTeX compilation."],examples:["--enclosing-braces=title,journal (output title and journal fields will be of the form {{This is a title}})","--enclosing-braces (equivalent to ---enclosing-braces=title)"],type:"boolean | string[]",convertBoolean:{true:["title"],false:void 0}},{key:"removeBraces",cli:{"--remove-braces":D(u=>u.length>0?u:!0,"--remove-braces")},toCLI:D(u=>{if(Array.isArray(u)&&u.length>0)return`--remove-braces=${u.join(",")}`;if(u===!0)return"--remove-braces"},"toCLI"),title:"Remove braces",description:["Remove any curly braces within the value, unless they are part of a command."],examples:["--remove-braces=title,journal","--remove-braces (equivalent to ---remove-braces=title)"],type:"boolean | string[]",convertBoolean:{true:["title"],false:void 0}},{key:"wrap",cli:{"--wrap":D(u=>u.length>0?Number(u[0]):!0,"--wrap"),"--no-wrap":!1},toCLI:D(u=>u?`--wrap=${u}`:void 0,"toCLI"),title:"Wrap values",description:["Wrap long values at the given column"],examples:["--wrap (80 by default)","--wrap=82"],type:"boolean | number",convertBoolean:{true:ct,false:void 0}},{key:"version",cli:{"--version":!0,"-v":!0},title:"Version",description:["Show bibtex-tidy version."],type:"boolean"},{key:"quiet",cli:{"--quiet":!0},title:"Quiet",description:["Suppress logs on stdout."],type:"boolean"},{key:"backup",cli:{"--backup":!0,"--no-backup":!1},title:"Backup",description:["Make a backup <filename>.original. Enabled by default (unless --modify is explicitly provided or outputting to a different file/stdio). Deprecated but provided for backward compatibility."],type:"boolean",defaultValue:!0,deprecated:!0}];function Yu(u){return Object.fromEntries(ht.map(e=>{const t=e.key,F=u[t];return e.convertBoolean&&typeof F=="boolean"?[t,F?e.convertBoolean.true:e.convertBoolean.false]:typeof F>"u"&&e.defaultValue!==void 0?typeof e.defaultValue=="function"?[t,e.defaultValue(u)]:[t,e.defaultValue]:[t,F]}))}D(Yu,"normalizeOptions");function zu(u,e,t){const F=new Map,r=[];for(const s of u.children){if(s.type==="text"||s.block?.type!=="entry"&&!t.includes("special")){r.push(s);continue}const a=new Map;for(let c of t){c.startsWith("-")&&(c=c.slice(1));let d;switch(c){case"key":if(s.block?.type!=="entry")continue;d=s.block.key??"";break;case"type":d=s.command;break;case"month":{if(s.block?.type!=="entry")continue;const m=e.get(s.block)?.get(c),h=m?ku.indexOf(m):-1;d=h>-1?h:"";break}case"special":d=Nu(s)?0:1;break;default:if(s.block?.type!=="entry")continue;d=e.get(s.block)?.get(c)??""}a.set(c,typeof d=="string"?d.toLowerCase():d)}for(F.set(s,a);r.length>0;){const c=r.pop();if(!c)break;F.set(c,a)}}for(const s of[...t].reverse()){const a=s.startsWith("-"),c=a?s.slice(1):s;u.children.sort((d,m)=>{let h=F.get(d)?.get(c)??"￰",l=F.get(m)?.get(c)??"￰";return typeof h=="number"&&(h=String(h).padStart(50,"0")),typeof l=="number"&&(l=String(l).padStart(50,"0")),(a?l:h).localeCompare(a?h:l)})}}D(zu,"sortEntries");var ot=new Set(["string","preamble","set","xdata"]);function Nu(u){return ot.has(u.command.toLowerCase())}D(Nu,"isBibLaTeXSpecialEntry");function Ou(u,e){for(const t of L(u))t.fields.sort((F,r)=>{const s=e.indexOf(F.name.toLocaleLowerCase()),a=e.indexOf(r.name.toLocaleLowerCase());return s===-1&&a===-1?0:s===-1?1:a===-1?-1:a<s?1:a>s?-1:0})}D(Ou,"sortEntryFields");function Vu(u,e={}){const t=Yu(e),F=Eu(u),r=nu(F),s=L(r).filter(h=>!h.key).map(h=>({code:"MISSING_KEY",message:`${h.parent.command} entry does not have a citation key.`})),a=Gu(r,t),c=yu(r,a,t.duplicates,t.merge);s.push(...c.warnings),r.children=r.children.filter(h=>!U(h)||!c.entries.has(h.block)),t.sort&&zu(r,a,t.sort),t.sortFields&&Ou(r,t.sortFields);const d=t.generateKeys?Ru(r,a,t.generateKeys):void 0;return{bibtex:wu(r,t,d),warnings:s,count:L(r).length}}D(Vu,"tidy");function Gu(u,e){return new Map(L(u).map(t=>[t,new Map(t.fields.map(F=>[F.name.toLocaleLowerCase(),Q(F,e)??""]))]))}D(Gu,"generateValueLookup");function L(u){return u.children.filter(U).map(e=>e.block)}return D(L,"getEntries"),au}var At=bt();class ju extends Error{constructor(n){super(n==="too-large"?"BibTeX input is too large to format":"BibTeX input is invalid"),this.kind=n,this.name="BibtexFormatError"}kind}const Bt=new Set(["comment","string","preamble"]),pt={lowercase:!1,removeDuplicateFields:!1};function yt(i){return new TextEncoder().encode(i).byteLength}function Hu(i){if(!Number.isSafeInteger(i)||i<1)throw new RangeError("Citation BibTeX limit must be a positive integer.");return i}function xt(i){return`${Math.round(Hu(i)/1024)} KB`}function Fu(i,n){return yt(i)>Hu(n)}function ru(i,n){if(!i.trim()||Fu(i,n))return null;try{const f=At.tidy(i,pt);return{bibtex:f.bibtex,count:f.count}}catch{return null}}function Lt(i,n){if(!i.trim())return i;if(Fu(i,n))throw new ju("too-large");const f=ru(i,n);if(!f)throw new ju("invalid");return f.bibtex}function Rt(i,n){return gt(i,n).entries}function gt(i,n){if(!i.trim())return{status:"empty",entries:[]};if(Fu(i,n))return{status:"too-large",entries:[]};const f=ru(i,n);if(!f)return{status:"invalid",entries:[]};if(f.count===0)return{status:"empty",entries:[]};const C=[];let D=0;for(;D<i.length;){const o=i.indexOf("@",D);if(o<0)break;D=o+1;const k=i.lastIndexOf(`
26
- `,o-1)+1;if(kt(i,k,o))continue;const p=i.slice(o).match(/^@([A-Za-z][A-Za-z0-9_-]*)\s*([\{\(])/);if(!p||p.index===void 0)continue;const A=o+p[0].length-1,z=su(i,A,p[2]==="{"?"}":")");if(z<0)continue;const x=Mu(i.slice(o,z+1));x&&C.push(x),D=z+1}return{status:"ok",entries:C}}function It(i,n){const f=i.trim(),C=ru(f,n);return!C||C.count!==1?null:Mu(f)}function Tt(i){const n=i.bibtex.match(/^@([A-Za-z][A-Za-z0-9_-]*)\s*([\{\(])\s*[^,\s\}\)]+\s*,/s);if(!n||n.index===void 0)return null;const f=i.bibtex.indexOf(n[2],n.index);if(su(i.bibtex,f,n[2]==="{"?"}":")")<0)return null;const D=_u(i.bibtex.slice(n[0].length,-1));if(!D)return null;const o=n[1].toLowerCase();return(/inproceedings|conference|incollection/.test(o)?D.booktitle??D.journal:D.journal??D.booktitle)?.trim()||null}function Mu(i){const n=i.match(/^@([A-Za-z][A-Za-z0-9_-]*)\s*([\{\(])\s*([^,\s\}\)]+)\s*,/s);if(!n)return null;const f=i.indexOf(n[2],n.index??0);if(su(i,f,n[2]==="{"?"}":")")!==i.length-1)return null;const D=n[1];if(Bt.has(D.toLowerCase()))return null;const o=_u(i.slice(n[0].length,-1));return o?{citationKey:n[3],entryType:D,bibtex:i,title:o.title??null,authors:o.author??null,year:o.year??null}:null}function kt(i,n,f){let C=!1;for(let D=n;D<f;D+=1){const o=i[D];if(o==="%"&&!C)return!0;o==="\\"?C=!C:C=!1}return!1}function su(i,n,f){let C=0,D=0,o=!1,k=!1;for(let p=n;p<i.length;p+=1){const A=i[p];if(k){k=!1;continue}if(A==="\\"){k=!0;continue}if(f==="}"){if(A==='"'&&C===1&&(o=!o),A==="{")C+=1;else if(A==="}"&&--C===0)return p;continue}if(A==="{"&&!o){D+=1;continue}if(A==="}"&&!o&&D>0){D-=1;continue}if(!(D>0)){if(A==='"'){o=!o;continue}if(!o){if(A==="(")C+=1;else if(A===")"&&--C===0)return p}}}return-1}function _u(i){const n={};for(const f of wt(i,",")){if(!f.trim())continue;const C=f.replace(/(^|[\r\n])\s*%[^\r\n]*/g,"$1").trim();if(!C)continue;const D=C.match(/^\s*([A-Za-z][A-Za-z0-9_-]*)\s*=\s*([\s\S]*)$/);if(!D||!D[2].trim())return null;const o=vt(D[2]);o&&(n[D[1].toLowerCase()]=o)}return n}function wt(i,n){const f=[];let C=0,D=0,o=!1,k=!1;for(let p=0;p<i.length;p+=1){const A=i[p];if(k){k=!1;continue}if(A==="\\"){k=!0;continue}if(A==='"'){o=!o;continue}o||(A==="{"?D+=1:A==="}"?D=Math.max(0,D-1):A===n&&D===0&&(f.push(i.slice(C,p)),C=p+1))}return f.push(i.slice(C)),f}function vt(i){let n=i.trim();return(n.startsWith("{")&&n.endsWith("}")||n.startsWith('"')&&n.endsWith('"'))&&(n=n.slice(1,-1)),n.replace(/\s+/g," ").trim()}export{ju as BibtexFormatError,xt as citationBibtexLimitLabel,Tt as citationVenue,Lt as formatBibtex,Fu as isBibtexTooLarge,Rt as parseBibEntries,gt as parseBibEntriesResult,It as parseSingleBibEntry};
25
+ ${B}`}return W(E)}return`"${E}"`}).join(" # ")}D(Q,"formatValue");var it={auth:{description:"Last name of first authors",callback:D(u=>{const t=S(u.get("author")??"",!0)[0]?.lastName.replace(/(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA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14\uDD17\uDD30-\uDD3E\uDD40\uDD42-\uDD9F\uDDA8\uDDA9\uDDD1-\uDDE0\uDDE2\uDDE4-\uDDFF\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE4F\uDE51-\uDE5B\uDE8A-\uDE9C\uDE9E-\uDEAF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC2F-\uDC3F\uDC41-\uDC71\uDC90-\uDCFF\uDD07\uDD0A\uDD31-\uDD45\uDD47-\uDD5F\uDD66\uDD69\uDD8A-\uDD97\uDD99-\uDEDF\uDEF3-\uDF01\uDF03\uDF11\uDF34-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC00-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80E-\uD810\uD812-\uD819\uD824-\uD82A\uD82D\uD82E\uD830-\uD834\uD836\uD83C-\uD83F\uD87C\uD87D\uD87F\uD889-\uDBFF][\uDC00-\uDFFF]|\uD80B[\uDC00-\uDF8F\uDFF1-\uDFFF]|\uD80D[\uDC30-\uDC40\uDC47-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F-\uDE6F\uDEBF-\uDECF\uDEEE-\uDEFF\uDF30-\uDF3F\uDF44-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4F\uDF51-\uDF92\uDFA0-\uDFDF\uDFE2\uDFE4-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82B[\uDC00-\uDFEF\uDFF4\uDFFC\uDFFF]|\uD82C[\uDD23-\uDD31\uDD33-\uDD4F\uDD53\uDD54\uDD56-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF])+/g,"_");return t?[t]:[]},"callback")},authEtAl:{description:"If 1 or 2 authors, both authors, otherwise first author and EtAl",callback:D(u=>{const e=S(u.get("author")??"",!0);return[...e.slice(0,2).map(t=>t.lastName.replace(/(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\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\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF])+/g,"_")),...e.length>2?["Et","Al"]:[]]},"callback")},authors:{description:"Last name all authors",callback:D(u=>S(u.get("author")??"",!0).map(t=>t.lastName.replace(/(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABE3-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB1E\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFE6F\uFE75\uFEFD-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3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\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF])+/g,"_")),"callback")},authorsN:{description:"Last name N authors, with EtAl if more",callback:D((u,e=0)=>{const t=S(u.get("author")??"",!0);return[...t.slice(0,e).map(F=>F.lastName.replace(/(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\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uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF])+/g,"_")),...t.length>e?["Et","Al"]:[]]},"callback")},veryshorttitle:{description:"First non-function word of the title",callback:D(u=>uu(G(u)).slice(0,1),"callback")},shorttitle:{description:"First three non-function words of the title",callback:D(u=>uu(G(u)).slice(0,3),"callback")},title:{description:"Full title, capitalized",callback:D(u=>tu(V(G(u))),"callback")},fulltitle:{description:"Full title, verbatim",callback:D(u=>V(G(u)),"callback")},year:{description:"Year",callback:D(u=>{const e=u.get("year")?.replace(/[^0-9]/g,"");return e?[e]:[]},"callback")},duplicateLetter:{description:"If the multiple entries end up with the same key, then insert a letter a-z. By default this will be inserted at the end.",callback:D(()=>["[duplicateLetter]"],"callback")},duplicateNumber:{description:"If the multiple entries end up with the same key, then insert a number.",callback:D(()=>["[duplicateNumber]"],"callback")}},nt={required:{description:"If data is missing, revert to existing key",callback:D(u=>{if(u.length===0)throw new Lu;return u},"callback")},lower:{description:"Convert to lowercase",callback:D(u=>u.map(e=>e.toLocaleLowerCase()),"callback")},upper:{description:"Convert to uppercase",callback:D(u=>u.map(e=>e.toLocaleUpperCase()),"callback")},capitalize:{description:"Capitalize first letter of each word",callback:tu}},Lu=class extends Error{static{D(this,"MissingRequiredData")}};function Ru(u,e,t){let F=t;!t.includes("[duplicateLetter]")&&!t.includes("[duplicateNumber]")&&(F=`${t}[duplicateLetter]`);const r=new Map;for(const a of u.children)if(U(a)){const c=e.get(a.block);if(!c)continue;const d=Iu(c,F);if(!d)continue;const m=r.get(d)??[];r.set(d,[...m,a.block])}const s=new Map;for(const[a,c]of r)for(const[d,m]of c.entries()){const h=c.length>1?String.fromCharCode(97+d):"",l=c.length>1?String(d+1):"";m.key=a.replace(/\[duplicateLetter\]/g,h).replace(/\[duplicateNumber\]/g,l)}return s}D(Ru,"generateKeys");function Iu(u,e){try{const t=e.replace(/\[[^:\]]+(?::[^:\]]+)*\]/g,F=>{const[r,...s]=F.slice(1,-1).split(":");if(!r)throw new Error("Token parse error");let a;const c=r.replace(/[0-9]+/g,h=>(a=Number(h),"N")),d=it[c];let m;if(d)m=d.callback(u,a);else if(c===c.toLocaleUpperCase()){const h=u.get(c.toLocaleLowerCase());m=h?V(h):[]}else throw new Error(`Invalid citation key token ${c}`);for(const h of s){const l=nt[h];if(l)m=l.callback(m);else throw new Error(`Invalid modifier ${h}`)}return m.join("")});return t===""?void 0:t}catch(t){if(t instanceof Lu)return;throw t}}D(Iu,"generateKey");var dt=new Set(["a","about","above","across","against","along","among","an","and","around","at","before","behind","below","beneath","beside","between","beyond","but","by","down","during","except","for","for","from","in","inside","into","like","near","nor","of","off","on","onto","or","since","so","the","through","to","toward","under","until","up","upon","with","within","without","yet"]);function uu(u){return V(u).filter(e=>!dt.has(e.toLocaleLowerCase()))}D(uu,"nonFunctionWords");function V(u){return u.split(/(?:[\0-\/:-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CB-\uA7CF\uA7D2\uA7D4\uA7DA-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-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uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF])+/).filter(e=>e.length>0)}D(V,"words");function tu(u){return u.map(e=>e.slice(0,1).toLocaleUpperCase()+e.slice(1).toLocaleLowerCase())}D(tu,"capitalize");function G(u){return u.get("title")??u.get("booktitle")??""}D(G,"title");var Tu=["doi","citation","abstract"],eu=14,j=2,ct=80,qu=["title","shorttitle","author","year","month","day","journal","booktitle","location","on","publisher","address","series","volume","number","pages","doi","isbn","issn","url","urldate","copyright","category","note","metadata"],lt=["key"],Su="[auth:required:lower][year:required][veryshorttitle:lower][duplicateNumber]",ht=[{key:"help",cli:{"--help":!0,"-h":!0},title:"Help",description:["Show help"],type:"boolean"},{key:"v2",cli:{"--v2":!0},title:"Enable planned v2 CLI changes",description:["Input files will no longer be modified by default. Instead, you will need to specify `--modify`/`-m` option to overwrite the file, or `--output`/`-o` to output to a different file."],type:"string",defaultValue:void 0},{key:"outputPath",cli:{"--output":D(u=>u[0],"--output"),"-o":D(u=>u[0],"-o")},title:"Output path",description:["Write output to specified path. When omitted (and -m/--modify is not used), the result will be printed to stdout."],type:"string",defaultValue:void 0},{key:"modify",cli:{"--modify":!0,"-m":!0,"--no-modify":!1},title:"Modify input files",description:["Overwrite the original input files with the tidied result. This is enabled by default but will be disabled by default in v2. For v1, use --no-modify to output to stdout instead of overwriting the input files."],type:"boolean",defaultValue:!0},{key:"omit",cli:{"--omit":D(u=>(u.length===0&&(console.error("Expected a omit list"),process.exit(1)),u),"--omit")},toCLI:D(u=>Array.isArray(u)&&u.length>0?`--omit=${u.join(",")}`:void 0,"toCLI"),title:"Remove fields",description:["Remove specified fields from bibliography entries."],examples:["--omit=id,name"],type:"string[]",defaultValue:[]},{key:"curly",cli:{"--curly":!0,"--no-curly":!1},toCLI:D(u=>u?"--curly":void 0,"toCLI"),title:"Enclose values in braces",description:['Enclose all property values in braces. Quoted values will be converted to braces. For example, "Journal of Tea" will become {Journal of Tea}.'],type:"boolean",defaultValue:!1},{key:"numeric",cli:{"--numeric":!0,"--no-numeric":!1},toCLI:D(u=>u?"--numeric":void 0,"toCLI"),title:"Use numeric values where possible",description:["Strip quotes and braces from numeric/month values. For example, {1998} will become 1998."],type:"boolean",defaultValue:!1},{key:"months",cli:{"--months":!0},toCLI:D(u=>u?"--months":void 0,"toCLI"),title:"Abbreviate months",description:["Convert all months to three letter abbreviations (jan, feb, etc)."],type:"boolean",defaultValue:!1},{key:"space",cli:{"--space":D(u=>u.length>0?Number(u[0]):!0,"--space")},toCLI:D((u,e)=>{if(!e.tab){if(typeof u=="number"&&u!==j)return`--space=${u}`;if(u&&u!==j)return"--space"}},"toCLI"),title:"Indent with spaces",description:["Indent all fields with the specified number of spaces. Ignored if tab is set."],examples:["--space=2 (default)","--space=4"],type:"boolean | number",convertBoolean:{true:j,false:void 0},defaultValue:j},{key:"tab",cli:{"--tab":!0,"--no-tab":!1},toCLI:D(u=>u?"--tab":void 0,"toCLI"),title:"Indent with tabs",description:["Indent all fields with a tab."],type:"boolean",defaultValue:!1},{key:"align",cli:{"--align":D(u=>Number(u[0]),"--align"),"--no-align":!1},toCLI:D(u=>{if(u===!1||u===1||u===0)return"--no-align";if(typeof u=="number"&&u!==eu)return`--align=${u}`},"toCLI"),title:"Align values",description:["Insert whitespace between fields and values so that values are visually aligned."],examples:["--align=14 (default)"],type:"boolean | number",convertBoolean:{true:eu,false:1},defaultValue:eu},{key:"blankLines",cli:{"--blank-lines":!0,"--no-blank-lines":!1},toCLI:D(u=>u?"--blank-lines":void 0,"toCLI"),title:"Insert blank lines",description:["Insert an empty line between each entry."],type:"boolean"},{key:"sort",cli:{"--sort":D(u=>u.length>0?u:!0,"--sort"),"--no-sort":!1},toCLI:D(u=>{if(Array.isArray(u)&&u.length>0)return`--sort=${u.join(",")}`;if(u===!0)return"--sort"},"toCLI"),title:"Sort bibliography entries",description:["Sort entries by the specified field names (citation key is used if no fields are specified). For descending order, prefix the field with a dash (-).","Multiple fields may be specified to sort everything by first field, then by the second field whenever the first field for entries are equal, etc.","The following additional fields are also permitted: key (entry citation key), type (sorts by the type of entry, e.g. article), and special (ensures that @string, @preamble, @set, and @xdata entries are first). "],examples:["--sort (sort by citation key)","--sort=-year,name (sort year descending then name ascending)","--sort=name,year"],type:"boolean | string[]",convertBoolean:{true:lt,false:void 0}},{key:"duplicates",cli:{"--duplicates":D(u=>{if(u.length===0)return!0;for(const e of u)e!=="doi"&&e!=="key"&&e!=="abstract"&&e!=="citation"&&(console.error(`Invalid key for merge option: "${e}"`),process.exit(1));return u},"--duplicates")},toCLI:D(u=>{if(Array.isArray(u)&&u.length>0)return`--duplicates=${u.join(",")}`;if(u===!0)return"--duplicates"},"toCLI"),title:"Check for duplicates",description:["Warn if duplicates are found, which are entries where DOI, abstract, or author and title are the same."],examples:["--duplicates doi (same DOIs)","--duplicates key (same IDs)","--duplicates abstract (similar abstracts)","--duplicates citation (similar author and titles)","--duplicates doi, key (identical DOI or keys)","--duplicates (same DOI, key, abstract, or citation)"],type:"boolean | ('doi' | 'key' | 'abstract' | 'citation')[]",convertBoolean:{true:Tu,false:void 0},defaultValue:D(u=>u.merge?Tu:void 0,"defaultValue")},{key:"merge",cli:{"--merge":D(u=>u.length===0?!0:(u[0]!=="first"&&u[0]!=="last"&&u[0]!=="combine"&&u[0]!=="overwrite"&&(console.error(`Invalid merge strategy: "${u[0]}"`),process.exit(1)),u[0]),"--merge"),"--no-merge":!1},toCLI:D(u=>{if(typeof u=="string")return`--merge=${u}`;if(u)return"--merge"},"toCLI"),title:"Merge duplicate entries",description:["Merge duplicates entries. Use the duplicates option to determine how duplicates are identified. There are different ways to merge:","- first: only keep the original entry","- last: only keep the last found duplicate","- combine: keep original entry and merge in fields of duplicates if they do not already exist","- overwrite: keep original entry and merge in fields of duplicates, overwriting existing fields if they exist"],type:"boolean | 'first' | 'last' | 'combine' | 'overwrite'",convertBoolean:{true:"combine",false:void 0}},{key:"stripEnclosingBraces",cli:{"--strip-enclosing-braces":!0},toCLI:D(u=>u?"--strip-enclosing-braces":void 0,"toCLI"),title:"Strip double-braced values",description:["Where an entire value is enclosed in double braces, remove the extra braces. For example, {{Journal of Tea}} will become {Journal of Tea}."],type:"boolean",defaultValue:!1},{key:"dropAllCaps",cli:{"--drop-all-caps":!0},toCLI:D(u=>u?"--drop-all-caps":void 0,"toCLI"),title:"Drop all caps",description:["Where values are all caps, make them title case. For example, {JOURNAL OF TEA} will become {Journal of Tea}. Roman numerals will be left unchanged."],type:"boolean",defaultValue:!1},{key:"escape",cli:{"--escape":!0,"--no-escape":!1},toCLI:D(u=>u===!1?"--no-escape":void 0,"toCLI"),title:"Escape special characters",description:["Escape special characters, such as umlaut. This ensures correct typesetting with latex. Enabled by default."],type:"boolean",defaultValue:!0},{key:"sortFields",cli:{"--sort-fields":D(u=>u.length>0?u:!0,"--sort-fields")},toCLI:D(u=>{if(Array.isArray(u)&&u.length>0)return JSON.stringify(u)===JSON.stringify(qu)?"--sort-fields":`--sort-fields=${u.join(",")}`;if(u===!0)return"--sort-fields"},"toCLI"),title:"Sort fields",description:["Sort the fields within entries.","If no fields are specified fields will be sorted by: title, shorttitle, author, year, month, day, journal, booktitle, location, on, publisher, address, series, volume, number, pages, doi, isbn, issn, url, urldate, copyright, category, note, metadata"],examples:["--sort-fields=name,author"],type:"boolean | string[]",convertBoolean:{true:qu,false:void 0},defaultValue:void 0},{key:"sortProperties",cli:{"--sort-properties":D(u=>u.length>0?u:!0,"--sort-properties")},title:"Sort properties",description:["Alias of sort fields (legacy)"],type:"boolean | string[]",deprecated:!0},{key:"stripComments",cli:{"--strip-comments":!0,"--no-strip-comments":!1},toCLI:D(u=>u?"--strip-comments":void 0,"toCLI"),title:"Remove comments",description:["Remove all comments from the bibtex source."],type:"boolean",defaultValue:!1},{key:"trailingCommas",cli:{"--trailing-commas":!0,"--no-trailing-commas":!0},toCLI:D(u=>u?"--trailing-commas":void 0,"toCLI"),title:"Trailing commas",description:["End the last key value pair in each entry with a comma."],type:"boolean",defaultValue:!1},{key:"encodeUrls",cli:{"--encode-urls":!0,"--no-encode-urls":!0},toCLI:D(u=>u?"--encode-urls":void 0,"toCLI"),title:"Encode URLs",description:["Replace invalid URL characters with percent encoded values."],type:"boolean",defaultValue:!1},{key:"tidyComments",cli:{"--tidy-comments":!0,"--no-tidy-comments":!1},toCLI:D(u=>u===!1?"--no-tidy-comments":void 0,"toCLI"),title:"Tidy comments",description:["Remove whitespace surrounding comments."],type:"boolean",defaultValue:!0},{key:"removeEmptyFields",cli:{"--remove-empty-fields":!0,"--no-remove-empty-fields":!1},toCLI:D(u=>u?"--remove-empty-fields":void 0,"toCLI"),title:"Remove empty fields",description:["Remove any fields that have empty values."],type:"boolean",defaultValue:!1},{key:"removeDuplicateFields",cli:{"--remove-dupe-fields":!0,"--no-remove-dupe-fields":!1},toCLI:D(u=>u===!1?"--no-remove-dupe-fields":void 0,"toCLI"),title:"Remove duplicate fields",description:["Only allow one of each field in each entry. Enabled by default."],type:"boolean",defaultValue:!0},{key:"generateKeys",cli:{"--generate-keys":D(u=>u.length>0?u:!0,"--generate-keys")},toCLI:D(u=>{if(u===!0||u===Su)return"--generate-keys";if(typeof u=="string")return`--generate-keys="${u.replace(/"/g,'\\"')}"`},"toCLI"),title:"Generate citation keys [Experimental]",description:["For all entries replace the key with a new key of the form <author><year><title>. A JabRef citation pattern can be provided. This is an experimental option that may change without warning."],type:"boolean | string",convertBoolean:{true:Su,false:void 0},defaultValue:void 0},{key:"maxAuthors",cli:{"--max-authors":D(u=>Number(u[0]),"--max-authors")},toCLI:D(u=>u?`--max-authors=${u}`:void 0,"toCLI"),title:"Maximum authors",description:['Truncate authors if above a given number into "and others".'],type:"number"},{key:"lowercase",cli:{"--no-lowercase":!1},toCLI:D(u=>u===!1?"--no-lowercase":void 0,"toCLI"),title:"Lowercase fields",description:["Lowercase field names and entry type. Enabled by default."],type:"boolean",defaultValue:!0},{key:"enclosingBraces",cli:{"--enclosing-braces":D(u=>u.length>0?u:!0,"--enclosing-braces")},toCLI:D(u=>{if(Array.isArray(u)&&u.length>0)return`--enclosing-braces=${u.join(",")}`;if(u===!0)return"--enclosing-braces"},"toCLI"),title:"Enclose values in double braces",description:["Enclose the given fields in double braces, such that case is preserved during BibTeX compilation."],examples:["--enclosing-braces=title,journal (output title and journal fields will be of the form {{This is a title}})","--enclosing-braces (equivalent to ---enclosing-braces=title)"],type:"boolean | string[]",convertBoolean:{true:["title"],false:void 0}},{key:"removeBraces",cli:{"--remove-braces":D(u=>u.length>0?u:!0,"--remove-braces")},toCLI:D(u=>{if(Array.isArray(u)&&u.length>0)return`--remove-braces=${u.join(",")}`;if(u===!0)return"--remove-braces"},"toCLI"),title:"Remove braces",description:["Remove any curly braces within the value, unless they are part of a command."],examples:["--remove-braces=title,journal","--remove-braces (equivalent to ---remove-braces=title)"],type:"boolean | string[]",convertBoolean:{true:["title"],false:void 0}},{key:"wrap",cli:{"--wrap":D(u=>u.length>0?Number(u[0]):!0,"--wrap"),"--no-wrap":!1},toCLI:D(u=>u?`--wrap=${u}`:void 0,"toCLI"),title:"Wrap values",description:["Wrap long values at the given column"],examples:["--wrap (80 by default)","--wrap=82"],type:"boolean | number",convertBoolean:{true:ct,false:void 0}},{key:"version",cli:{"--version":!0,"-v":!0},title:"Version",description:["Show bibtex-tidy version."],type:"boolean"},{key:"quiet",cli:{"--quiet":!0},title:"Quiet",description:["Suppress logs on stdout."],type:"boolean"},{key:"backup",cli:{"--backup":!0,"--no-backup":!1},title:"Backup",description:["Make a backup <filename>.original. Enabled by default (unless --modify is explicitly provided or outputting to a different file/stdio). Deprecated but provided for backward compatibility."],type:"boolean",defaultValue:!0,deprecated:!0}];function Yu(u){return Object.fromEntries(ht.map(e=>{const t=e.key,F=u[t];return e.convertBoolean&&typeof F=="boolean"?[t,F?e.convertBoolean.true:e.convertBoolean.false]:typeof F>"u"&&e.defaultValue!==void 0?typeof e.defaultValue=="function"?[t,e.defaultValue(u)]:[t,e.defaultValue]:[t,F]}))}D(Yu,"normalizeOptions");function zu(u,e,t){const F=new Map,r=[];for(const s of u.children){if(s.type==="text"||s.block?.type!=="entry"&&!t.includes("special")){r.push(s);continue}const a=new Map;for(let c of t){c.startsWith("-")&&(c=c.slice(1));let d;switch(c){case"key":if(s.block?.type!=="entry")continue;d=s.block.key??"";break;case"type":d=s.command;break;case"month":{if(s.block?.type!=="entry")continue;const m=e.get(s.block)?.get(c),h=m?ku.indexOf(m):-1;d=h>-1?h:"";break}case"special":d=Nu(s)?0:1;break;default:if(s.block?.type!=="entry")continue;d=e.get(s.block)?.get(c)??""}a.set(c,typeof d=="string"?d.toLowerCase():d)}for(F.set(s,a);r.length>0;){const c=r.pop();if(!c)break;F.set(c,a)}}for(const s of[...t].reverse()){const a=s.startsWith("-"),c=a?s.slice(1):s;u.children.sort((d,m)=>{let h=F.get(d)?.get(c)??"￰",l=F.get(m)?.get(c)??"￰";return typeof h=="number"&&(h=String(h).padStart(50,"0")),typeof l=="number"&&(l=String(l).padStart(50,"0")),(a?l:h).localeCompare(a?h:l)})}}D(zu,"sortEntries");var ot=new Set(["string","preamble","set","xdata"]);function Nu(u){return ot.has(u.command.toLowerCase())}D(Nu,"isBibLaTeXSpecialEntry");function Ou(u,e){for(const t of L(u))t.fields.sort((F,r)=>{const s=e.indexOf(F.name.toLocaleLowerCase()),a=e.indexOf(r.name.toLocaleLowerCase());return s===-1&&a===-1?0:s===-1?1:a===-1?-1:a<s?1:a>s?-1:0})}D(Ou,"sortEntryFields");function Vu(u,e={}){const t=Yu(e),F=Eu(u),r=nu(F),s=L(r).filter(h=>!h.key).map(h=>({code:"MISSING_KEY",message:`${h.parent.command} entry does not have a citation key.`})),a=Gu(r,t),c=yu(r,a,t.duplicates,t.merge);s.push(...c.warnings),r.children=r.children.filter(h=>!U(h)||!c.entries.has(h.block)),t.sort&&zu(r,a,t.sort),t.sortFields&&Ou(r,t.sortFields);const d=t.generateKeys?Ru(r,a,t.generateKeys):void 0;return{bibtex:wu(r,t,d),warnings:s,count:L(r).length}}D(Vu,"tidy");function Gu(u,e){return new Map(L(u).map(t=>[t,new Map(t.fields.map(F=>[F.name.toLocaleLowerCase(),Q(F,e)??""]))]))}D(Gu,"generateValueLookup");function L(u){return u.children.filter(U).map(e=>e.block)}return D(L,"getEntries"),au}var At=bt();class ju extends Error{constructor(n){super(n==="too-large"?"BibTeX input is too large to format":"BibTeX input is invalid"),this.kind=n,this.name="BibtexFormatError"}kind}const Bt=new Set(["comment","string","preamble"]),pt={lowercase:!1,removeDuplicateFields:!1};function yt(i){return new TextEncoder().encode(i).byteLength}function Hu(i){if(!Number.isSafeInteger(i)||i<1)throw new RangeError("Citation BibTeX limit must be a positive integer.");return i}function vt(i){return`${Math.round(Hu(i)/1024)} KB`}function Fu(i,n){return yt(i)>Hu(n)}function ru(i,n){if(!i.trim()||Fu(i,n))return null;try{const f=At.tidy(i,pt);return{bibtex:f.bibtex,count:f.count}}catch{return null}}function xt(i,n){if(!i.trim())return i;if(Fu(i,n))throw new ju("too-large");const f=ru(i,n);if(!f)throw new ju("invalid");return f.bibtex}function Lt(i,n){if(!i.trim())return{status:"empty",entries:[]};if(Fu(i,n))return{status:"too-large",entries:[]};const f=ru(i,n);if(!f)return{status:"invalid",entries:[]};if(f.count===0)return{status:"empty",entries:[]};const C=[];let D=0;for(;D<i.length;){const o=i.indexOf("@",D);if(o<0)break;D=o+1;const k=i.lastIndexOf(`
26
+ `,o-1)+1;if(gt(i,k,o))continue;const p=i.slice(o).match(/^@([A-Za-z][A-Za-z0-9_-]*)\s*([\{\(])/);if(!p||p.index===void 0)continue;const A=o+p[0].length-1,z=su(i,A,p[2]==="{"?"}":")");if(z<0)continue;const x=Mu(i.slice(o,z+1));x&&C.push(x),D=z+1}return{status:"ok",entries:C}}function Rt(i,n){const f=i.trim(),C=ru(f,n);return!C||C.count!==1?null:Mu(f)}function It(i){const n=i.bibtex.match(/^@([A-Za-z][A-Za-z0-9_-]*)\s*([\{\(])\s*[^,\s\}\)]+\s*,/s);if(!n||n.index===void 0)return null;const f=i.bibtex.indexOf(n[2],n.index);if(su(i.bibtex,f,n[2]==="{"?"}":")")<0)return null;const D=_u(i.bibtex.slice(n[0].length,-1));if(!D)return null;const o=n[1].toLowerCase();return(/inproceedings|conference|incollection/.test(o)?D.booktitle??D.journal:D.journal??D.booktitle)?.trim()||null}function Mu(i){const n=i.match(/^@([A-Za-z][A-Za-z0-9_-]*)\s*([\{\(])\s*([^,\s\}\)]+)\s*,/s);if(!n)return null;const f=i.indexOf(n[2],n.index??0);if(su(i,f,n[2]==="{"?"}":")")!==i.length-1)return null;const D=n[1];if(Bt.has(D.toLowerCase()))return null;const o=_u(i.slice(n[0].length,-1));return o?{citationKey:n[3],entryType:D,bibtex:i,title:o.title??null,authors:o.author??null,year:o.year??null}:null}function gt(i,n,f){let C=!1;for(let D=n;D<f;D+=1){const o=i[D];if(o==="%"&&!C)return!0;o==="\\"?C=!C:C=!1}return!1}function su(i,n,f){let C=0,D=0,o=!1,k=!1;for(let p=n;p<i.length;p+=1){const A=i[p];if(k){k=!1;continue}if(A==="\\"){k=!0;continue}if(f==="}"){if(A==='"'&&C===1&&(o=!o),A==="{")C+=1;else if(A==="}"&&--C===0)return p;continue}if(A==="{"&&!o){D+=1;continue}if(A==="}"&&!o&&D>0){D-=1;continue}if(!(D>0)){if(A==='"'){o=!o;continue}if(!o){if(A==="(")C+=1;else if(A===")"&&--C===0)return p}}}return-1}function _u(i){const n={};for(const f of kt(i,",")){if(!f.trim())continue;const C=f.replace(/(^|[\r\n])\s*%[^\r\n]*/g,"$1").trim();if(!C)continue;const D=C.match(/^\s*([A-Za-z][A-Za-z0-9_-]*)\s*=\s*([\s\S]*)$/);if(!D||!D[2].trim())return null;const o=wt(D[2]);o&&(n[D[1].toLowerCase()]=o)}return n}function kt(i,n){const f=[];let C=0,D=0,o=!1,k=!1;for(let p=0;p<i.length;p+=1){const A=i[p];if(k){k=!1;continue}if(A==="\\"){k=!0;continue}if(A==='"'){o=!o;continue}o||(A==="{"?D+=1:A==="}"?D=Math.max(0,D-1):A===n&&D===0&&(f.push(i.slice(C,p)),C=p+1))}return f.push(i.slice(C)),f}function wt(i){let n=i.trim();return(n.startsWith("{")&&n.endsWith("}")||n.startsWith('"')&&n.endsWith('"'))&&(n=n.slice(1,-1)),n.replace(/\s+/g," ").trim()}export{ju as BibtexFormatError,vt as citationBibtexLimitLabel,It as citationVenue,xt as formatBibtex,Fu as isBibtexTooLarge,Lt as parseBibEntriesResult,Rt as parseSingleBibEntry};
@@ -1 +1 @@
1
- import{c as a}from"./index-BgeOKYIx.js";const e=a("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);export{e as E};
1
+ import{c as a}from"./index-DkpU9Fgs.js";const e=a("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);export{e as E};
@@ -1 +1 @@
1
- import{c}from"./index-BgeOKYIx.js";const a=c("FolderGit2",[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);const t=c("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);export{a as F,t as G};
1
+ import{c}from"./index-DkpU9Fgs.js";const a=c("FolderGit2",[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);const t=c("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);export{a as F,t as G};
@@ -1 +1 @@
1
- import{c as e}from"./index-BgeOKYIx.js";const a=e("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);export{a as H};
1
+ import{c as e}from"./index-DkpU9Fgs.js";const a=e("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);export{a as H};
@@ -1,4 +1,4 @@
1
- import{c as F}from"./index-BgeOKYIx.js";import{g as B}from"./react-CltQJflK.js";const z=F("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);var R={exports:{}},C;function L(){return C||(C=1,(function(T){var f=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},p=-1,M=1,_=0;f.Diff=function(r,n){return[r,n]},f.prototype.diff_main=function(r,n,e,t){typeof t>"u"&&(this.Diff_Timeout<=0?t=Number.MAX_VALUE:t=new Date().getTime()+this.Diff_Timeout*1e3);var a=t;if(r==null||n==null)throw new Error("Null input. (diff_main)");if(r==n)return r?[new f.Diff(_,r)]:[];typeof e>"u"&&(e=!0);var i=e,s=this.diff_commonPrefix(r,n),h=r.substring(0,s);r=r.substring(s),n=n.substring(s),s=this.diff_commonSuffix(r,n);var l=r.substring(r.length-s);r=r.substring(0,r.length-s),n=n.substring(0,n.length-s);var g=this.diff_compute_(r,n,i,a);return h&&g.unshift(new f.Diff(_,h)),l&&g.push(new f.Diff(_,l)),this.diff_cleanupMerge(g),g},f.prototype.diff_compute_=function(r,n,e,t){var a;if(!r)return[new f.Diff(M,n)];if(!n)return[new f.Diff(p,r)];var i=r.length>n.length?r:n,s=r.length>n.length?n:r,h=i.indexOf(s);if(h!=-1)return a=[new f.Diff(M,i.substring(0,h)),new f.Diff(_,s),new f.Diff(M,i.substring(h+s.length))],r.length>n.length&&(a[0][0]=a[2][0]=p),a;if(s.length==1)return[new f.Diff(p,r),new f.Diff(M,n)];var l=this.diff_halfMatch_(r,n);if(l){var g=l[0],v=l[1],u=l[2],o=l[3],c=l[4],b=this.diff_main(g,u,e,t),w=this.diff_main(v,o,e,t);return b.concat([new f.Diff(_,c)],w)}return e&&r.length>100&&n.length>100?this.diff_lineMode_(r,n,t):this.diff_bisect_(r,n,t)},f.prototype.diff_lineMode_=function(r,n,e){var t=this.diff_linesToChars_(r,n);r=t.chars1,n=t.chars2;var a=t.lineArray,i=this.diff_main(r,n,!1,e);this.diff_charsToLines_(i,a),this.diff_cleanupSemantic(i),i.push(new f.Diff(_,""));for(var s=0,h=0,l=0,g="",v="";s<i.length;){switch(i[s][0]){case M:l++,v+=i[s][1];break;case p:h++,g+=i[s][1];break;case _:if(h>=1&&l>=1){i.splice(s-h-l,h+l),s=s-h-l;for(var u=this.diff_main(g,v,!1,e),o=u.length-1;o>=0;o--)i.splice(s,0,u[o]);s=s+u.length}l=0,h=0,g="",v="";break}s++}return i.pop(),i},f.prototype.diff_bisect_=function(r,n,e){for(var t=r.length,a=n.length,i=Math.ceil((t+a)/2),s=i,h=2*i,l=new Array(h),g=new Array(h),v=0;v<h;v++)l[v]=-1,g[v]=-1;l[s+1]=0,g[s+1]=0;for(var u=t-a,o=u%2!=0,c=0,b=0,w=0,I=0,m=0;m<i&&!(new Date().getTime()>e);m++){for(var D=-m+c;D<=m-b;D+=2){var A=s+D,k;D==-m||D!=m&&l[A-1]<l[A+1]?k=l[A+1]:k=l[A-1]+1;for(var y=k-D;k<t&&y<a&&r.charAt(k)==n.charAt(y);)k++,y++;if(l[A]=k,k>t)b+=2;else if(y>a)c+=2;else if(o){var E=s+u-D;if(E>=0&&E<h&&g[E]!=-1){var P=t-g[E];if(k>=P)return this.diff_bisectSplit_(r,n,k,y,e)}}}for(var d=-m+w;d<=m-I;d+=2){var E=s+d,P;d==-m||d!=m&&g[E-1]<g[E+1]?P=g[E+1]:P=g[E-1]+1;for(var S=P-d;P<t&&S<a&&r.charAt(t-P-1)==n.charAt(a-S-1);)P++,S++;if(g[E]=P,P>t)I+=2;else if(S>a)w+=2;else if(!o){var A=s+u-d;if(A>=0&&A<h&&l[A]!=-1){var k=l[A],y=s+k-A;if(P=t-P,k>=P)return this.diff_bisectSplit_(r,n,k,y,e)}}}}return[new f.Diff(p,r),new f.Diff(M,n)]},f.prototype.diff_bisectSplit_=function(r,n,e,t,a){var i=r.substring(0,e),s=n.substring(0,t),h=r.substring(e),l=n.substring(t),g=this.diff_main(i,s,!1,a),v=this.diff_main(h,l,!1,a);return g.concat(v)},f.prototype.diff_linesToChars_=function(r,n){var e=[],t={};e[0]="";function a(l){for(var g="",v=0,u=-1,o=e.length;u<l.length-1;){u=l.indexOf(`
1
+ import{c as F}from"./index-DkpU9Fgs.js";import{g as B}from"./react-CltQJflK.js";const z=F("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);var R={exports:{}},C;function L(){return C||(C=1,(function(T){var f=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},p=-1,M=1,_=0;f.Diff=function(r,n){return[r,n]},f.prototype.diff_main=function(r,n,e,t){typeof t>"u"&&(this.Diff_Timeout<=0?t=Number.MAX_VALUE:t=new Date().getTime()+this.Diff_Timeout*1e3);var a=t;if(r==null||n==null)throw new Error("Null input. (diff_main)");if(r==n)return r?[new f.Diff(_,r)]:[];typeof e>"u"&&(e=!0);var i=e,s=this.diff_commonPrefix(r,n),h=r.substring(0,s);r=r.substring(s),n=n.substring(s),s=this.diff_commonSuffix(r,n);var l=r.substring(r.length-s);r=r.substring(0,r.length-s),n=n.substring(0,n.length-s);var g=this.diff_compute_(r,n,i,a);return h&&g.unshift(new f.Diff(_,h)),l&&g.push(new f.Diff(_,l)),this.diff_cleanupMerge(g),g},f.prototype.diff_compute_=function(r,n,e,t){var a;if(!r)return[new f.Diff(M,n)];if(!n)return[new f.Diff(p,r)];var i=r.length>n.length?r:n,s=r.length>n.length?n:r,h=i.indexOf(s);if(h!=-1)return a=[new f.Diff(M,i.substring(0,h)),new f.Diff(_,s),new f.Diff(M,i.substring(h+s.length))],r.length>n.length&&(a[0][0]=a[2][0]=p),a;if(s.length==1)return[new f.Diff(p,r),new f.Diff(M,n)];var l=this.diff_halfMatch_(r,n);if(l){var g=l[0],v=l[1],u=l[2],o=l[3],c=l[4],b=this.diff_main(g,u,e,t),w=this.diff_main(v,o,e,t);return b.concat([new f.Diff(_,c)],w)}return e&&r.length>100&&n.length>100?this.diff_lineMode_(r,n,t):this.diff_bisect_(r,n,t)},f.prototype.diff_lineMode_=function(r,n,e){var t=this.diff_linesToChars_(r,n);r=t.chars1,n=t.chars2;var a=t.lineArray,i=this.diff_main(r,n,!1,e);this.diff_charsToLines_(i,a),this.diff_cleanupSemantic(i),i.push(new f.Diff(_,""));for(var s=0,h=0,l=0,g="",v="";s<i.length;){switch(i[s][0]){case M:l++,v+=i[s][1];break;case p:h++,g+=i[s][1];break;case _:if(h>=1&&l>=1){i.splice(s-h-l,h+l),s=s-h-l;for(var u=this.diff_main(g,v,!1,e),o=u.length-1;o>=0;o--)i.splice(s,0,u[o]);s=s+u.length}l=0,h=0,g="",v="";break}s++}return i.pop(),i},f.prototype.diff_bisect_=function(r,n,e){for(var t=r.length,a=n.length,i=Math.ceil((t+a)/2),s=i,h=2*i,l=new Array(h),g=new Array(h),v=0;v<h;v++)l[v]=-1,g[v]=-1;l[s+1]=0,g[s+1]=0;for(var u=t-a,o=u%2!=0,c=0,b=0,w=0,I=0,m=0;m<i&&!(new Date().getTime()>e);m++){for(var D=-m+c;D<=m-b;D+=2){var A=s+D,k;D==-m||D!=m&&l[A-1]<l[A+1]?k=l[A+1]:k=l[A-1]+1;for(var y=k-D;k<t&&y<a&&r.charAt(k)==n.charAt(y);)k++,y++;if(l[A]=k,k>t)b+=2;else if(y>a)c+=2;else if(o){var E=s+u-D;if(E>=0&&E<h&&g[E]!=-1){var P=t-g[E];if(k>=P)return this.diff_bisectSplit_(r,n,k,y,e)}}}for(var d=-m+w;d<=m-I;d+=2){var E=s+d,P;d==-m||d!=m&&g[E-1]<g[E+1]?P=g[E+1]:P=g[E-1]+1;for(var S=P-d;P<t&&S<a&&r.charAt(t-P-1)==n.charAt(a-S-1);)P++,S++;if(g[E]=P,P>t)I+=2;else if(S>a)w+=2;else if(!o){var A=s+u-d;if(A>=0&&A<h&&l[A]!=-1){var k=l[A],y=s+k-A;if(P=t-P,k>=P)return this.diff_bisectSplit_(r,n,k,y,e)}}}}return[new f.Diff(p,r),new f.Diff(M,n)]},f.prototype.diff_bisectSplit_=function(r,n,e,t,a){var i=r.substring(0,e),s=n.substring(0,t),h=r.substring(e),l=n.substring(t),g=this.diff_main(i,s,!1,a),v=this.diff_main(h,l,!1,a);return g.concat(v)},f.prototype.diff_linesToChars_=function(r,n){var e=[],t={};e[0]="";function a(l){for(var g="",v=0,u=-1,o=e.length;u<l.length-1;){u=l.indexOf(`
2
2
  `,v),u==-1&&(u=l.length-1);var c=l.substring(v,u+1);(t.hasOwnProperty?t.hasOwnProperty(c):t[c]!==void 0)?g+=String.fromCharCode(t[c]):(o==i&&(c=l.substring(v),u=l.length),g+=String.fromCharCode(o),t[c]=o,e[o++]=c),v=u+1}return g}var i=4e4,s=a(r);i=65535;var h=a(n);return{chars1:s,chars2:h,lineArray:e}},f.prototype.diff_charsToLines_=function(r,n){for(var e=0;e<r.length;e++){for(var t=r[e][1],a=[],i=0;i<t.length;i++)a[i]=n[t.charCodeAt(i)];r[e][1]=a.join("")}},f.prototype.diff_commonPrefix=function(r,n){if(!r||!n||r.charAt(0)!=n.charAt(0))return 0;for(var e=0,t=Math.min(r.length,n.length),a=t,i=0;e<a;)r.substring(i,a)==n.substring(i,a)?(e=a,i=e):t=a,a=Math.floor((t-e)/2+e);return a},f.prototype.diff_commonSuffix=function(r,n){if(!r||!n||r.charAt(r.length-1)!=n.charAt(n.length-1))return 0;for(var e=0,t=Math.min(r.length,n.length),a=t,i=0;e<a;)r.substring(r.length-a,r.length-i)==n.substring(n.length-a,n.length-i)?(e=a,i=e):t=a,a=Math.floor((t-e)/2+e);return a},f.prototype.diff_commonOverlap_=function(r,n){var e=r.length,t=n.length;if(e==0||t==0)return 0;e>t?r=r.substring(e-t):e<t&&(n=n.substring(0,e));var a=Math.min(e,t);if(r==n)return a;for(var i=0,s=1;;){var h=r.substring(a-s),l=n.indexOf(h);if(l==-1)return i;s+=l,(l==0||r.substring(a-s)==n.substring(0,s))&&(i=s,s++)}},f.prototype.diff_halfMatch_=function(r,n){if(this.Diff_Timeout<=0)return null;var e=r.length>n.length?r:n,t=r.length>n.length?n:r;if(e.length<4||t.length*2<e.length)return null;var a=this;function i(b,w,I){for(var m=b.substring(I,I+Math.floor(b.length/4)),D=-1,A="",k,y,E,P;(D=w.indexOf(m,D+1))!=-1;){var d=a.diff_commonPrefix(b.substring(I),w.substring(D)),S=a.diff_commonSuffix(b.substring(0,I),w.substring(0,D));A.length<S+d&&(A=w.substring(D-S,D)+w.substring(D,D+d),k=b.substring(0,I-S),y=b.substring(I+d),E=w.substring(0,D-S),P=w.substring(D+d))}return A.length*2>=b.length?[k,y,E,P,A]:null}var s=i(e,t,Math.ceil(e.length/4)),h=i(e,t,Math.ceil(e.length/2)),l;if(!s&&!h)return null;h?s?l=s[4].length>h[4].length?s:h:l=h:l=s;var g,v,u,o;r.length>n.length?(g=l[0],v=l[1],u=l[2],o=l[3]):(u=l[0],o=l[1],g=l[2],v=l[3]);var c=l[4];return[g,v,u,o,c]},f.prototype.diff_cleanupSemantic=function(r){for(var n=!1,e=[],t=0,a=null,i=0,s=0,h=0,l=0,g=0;i<r.length;)r[i][0]==_?(e[t++]=i,s=l,h=g,l=0,g=0,a=r[i][1]):(r[i][0]==M?l+=r[i][1].length:g+=r[i][1].length,a&&a.length<=Math.max(s,h)&&a.length<=Math.max(l,g)&&(r.splice(e[t-1],0,new f.Diff(p,a)),r[e[t-1]+1][0]=M,t--,t--,i=t>0?e[t-1]:-1,s=0,h=0,l=0,g=0,a=null,n=!0)),i++;for(n&&this.diff_cleanupMerge(r),this.diff_cleanupSemanticLossless(r),i=1;i<r.length;){if(r[i-1][0]==p&&r[i][0]==M){var v=r[i-1][1],u=r[i][1],o=this.diff_commonOverlap_(v,u),c=this.diff_commonOverlap_(u,v);o>=c?(o>=v.length/2||o>=u.length/2)&&(r.splice(i,0,new f.Diff(_,u.substring(0,o))),r[i-1][1]=v.substring(0,v.length-o),r[i+1][1]=u.substring(o),i++):(c>=v.length/2||c>=u.length/2)&&(r.splice(i,0,new f.Diff(_,v.substring(0,c))),r[i-1][0]=M,r[i-1][1]=u.substring(0,u.length-c),r[i+1][0]=p,r[i+1][1]=v.substring(c),i++),i++}i++}},f.prototype.diff_cleanupSemanticLossless=function(r){function n(c,b){if(!c||!b)return 6;var w=c.charAt(c.length-1),I=b.charAt(0),m=w.match(f.nonAlphaNumericRegex_),D=I.match(f.nonAlphaNumericRegex_),A=m&&w.match(f.whitespaceRegex_),k=D&&I.match(f.whitespaceRegex_),y=A&&w.match(f.linebreakRegex_),E=k&&I.match(f.linebreakRegex_),P=y&&c.match(f.blanklineEndRegex_),d=E&&b.match(f.blanklineStartRegex_);return P||d?5:y||E?4:m&&!A&&k?3:A||k?2:m||D?1:0}for(var e=1;e<r.length-1;){if(r[e-1][0]==_&&r[e+1][0]==_){var t=r[e-1][1],a=r[e][1],i=r[e+1][1],s=this.diff_commonSuffix(t,a);if(s){var h=a.substring(a.length-s);t=t.substring(0,t.length-s),a=h+a.substring(0,a.length-s),i=h+i}for(var l=t,g=a,v=i,u=n(t,a)+n(a,i);a.charAt(0)===i.charAt(0);){t+=a.charAt(0),a=a.substring(1)+i.charAt(0),i=i.substring(1);var o=n(t,a)+n(a,i);o>=u&&(u=o,l=t,g=a,v=i)}r[e-1][1]!=l&&(l?r[e-1][1]=l:(r.splice(e-1,1),e--),r[e][1]=g,v?r[e+1][1]=v:(r.splice(e+1,1),e--))}e++}},f.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,f.whitespaceRegex_=/\s/,f.linebreakRegex_=/[\r\n]/,f.blanklineEndRegex_=/\n\r?\n$/,f.blanklineStartRegex_=/^\r?\n\r?\n/,f.prototype.diff_cleanupEfficiency=function(r){for(var n=!1,e=[],t=0,a=null,i=0,s=!1,h=!1,l=!1,g=!1;i<r.length;)r[i][0]==_?(r[i][1].length<this.Diff_EditCost&&(l||g)?(e[t++]=i,s=l,h=g,a=r[i][1]):(t=0,a=null),l=g=!1):(r[i][0]==p?g=!0:l=!0,a&&(s&&h&&l&&g||a.length<this.Diff_EditCost/2&&s+h+l+g==3)&&(r.splice(e[t-1],0,new f.Diff(p,a)),r[e[t-1]+1][0]=M,t--,a=null,s&&h?(l=g=!0,t=0):(t--,i=t>0?e[t-1]:-1,l=g=!1),n=!0)),i++;n&&this.diff_cleanupMerge(r)},f.prototype.diff_cleanupMerge=function(r){r.push(new f.Diff(_,""));for(var n=0,e=0,t=0,a="",i="",s;n<r.length;)switch(r[n][0]){case M:t++,i+=r[n][1],n++;break;case p:e++,a+=r[n][1],n++;break;case _:e+t>1?(e!==0&&t!==0&&(s=this.diff_commonPrefix(i,a),s!==0&&(n-e-t>0&&r[n-e-t-1][0]==_?r[n-e-t-1][1]+=i.substring(0,s):(r.splice(0,0,new f.Diff(_,i.substring(0,s))),n++),i=i.substring(s),a=a.substring(s)),s=this.diff_commonSuffix(i,a),s!==0&&(r[n][1]=i.substring(i.length-s)+r[n][1],i=i.substring(0,i.length-s),a=a.substring(0,a.length-s))),n-=e+t,r.splice(n,e+t),a.length&&(r.splice(n,0,new f.Diff(p,a)),n++),i.length&&(r.splice(n,0,new f.Diff(M,i)),n++),n++):n!==0&&r[n-1][0]==_?(r[n-1][1]+=r[n][1],r.splice(n,1)):n++,t=0,e=0,a="",i="";break}r[r.length-1][1]===""&&r.pop();var h=!1;for(n=1;n<r.length-1;)r[n-1][0]==_&&r[n+1][0]==_&&(r[n][1].substring(r[n][1].length-r[n-1][1].length)==r[n-1][1]?(r[n][1]=r[n-1][1]+r[n][1].substring(0,r[n][1].length-r[n-1][1].length),r[n+1][1]=r[n-1][1]+r[n+1][1],r.splice(n-1,1),h=!0):r[n][1].substring(0,r[n+1][1].length)==r[n+1][1]&&(r[n-1][1]+=r[n+1][1],r[n][1]=r[n][1].substring(r[n+1][1].length)+r[n+1][1],r.splice(n+1,1),h=!0)),n++;h&&this.diff_cleanupMerge(r)},f.prototype.diff_xIndex=function(r,n){var e=0,t=0,a=0,i=0,s;for(s=0;s<r.length&&(r[s][0]!==M&&(e+=r[s][1].length),r[s][0]!==p&&(t+=r[s][1].length),!(e>n));s++)a=e,i=t;return r.length!=s&&r[s][0]===p?i:i+(n-a)},f.prototype.diff_prettyHtml=function(r){for(var n=[],e=/&/g,t=/</g,a=/>/g,i=/\n/g,s=0;s<r.length;s++){var h=r[s][0],l=r[s][1],g=l.replace(e,"&amp;").replace(t,"&lt;").replace(a,"&gt;").replace(i,"&para;<br>");switch(h){case M:n[s]='<ins style="background:#e6ffe6;">'+g+"</ins>";break;case p:n[s]='<del style="background:#ffe6e6;">'+g+"</del>";break;case _:n[s]="<span>"+g+"</span>";break}}return n.join("")},f.prototype.diff_text1=function(r){for(var n=[],e=0;e<r.length;e++)r[e][0]!==M&&(n[e]=r[e][1]);return n.join("")},f.prototype.diff_text2=function(r){for(var n=[],e=0;e<r.length;e++)r[e][0]!==p&&(n[e]=r[e][1]);return n.join("")},f.prototype.diff_levenshtein=function(r){for(var n=0,e=0,t=0,a=0;a<r.length;a++){var i=r[a][0],s=r[a][1];switch(i){case M:e+=s.length;break;case p:t+=s.length;break;case _:n+=Math.max(e,t),e=0,t=0;break}}return n+=Math.max(e,t),n},f.prototype.diff_toDelta=function(r){for(var n=[],e=0;e<r.length;e++)switch(r[e][0]){case M:n[e]="+"+encodeURI(r[e][1]);break;case p:n[e]="-"+r[e][1].length;break;case _:n[e]="="+r[e][1].length;break}return n.join(" ").replace(/%20/g," ")},f.prototype.diff_fromDelta=function(r,n){for(var e=[],t=0,a=0,i=n.split(/\t/g),s=0;s<i.length;s++){var h=i[s].substring(1);switch(i[s].charAt(0)){case"+":try{e[t++]=new f.Diff(M,decodeURI(h))}catch{throw new Error("Illegal escape in diff_fromDelta: "+h)}break;case"-":case"=":var l=parseInt(h,10);if(isNaN(l)||l<0)throw new Error("Invalid number in diff_fromDelta: "+h);var g=r.substring(a,a+=l);i[s].charAt(0)=="="?e[t++]=new f.Diff(_,g):e[t++]=new f.Diff(p,g);break;default:if(i[s])throw new Error("Invalid diff operation in diff_fromDelta: "+i[s])}}if(a!=r.length)throw new Error("Delta length ("+a+") does not equal source text length ("+r.length+").");return e},f.prototype.match_main=function(r,n,e){if(r==null||n==null||e==null)throw new Error("Null input. (match_main)");return e=Math.max(0,Math.min(e,r.length)),r==n?0:r.length?r.substring(e,e+n.length)==n?e:this.match_bitap_(r,n,e):-1},f.prototype.match_bitap_=function(r,n,e){if(n.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var t=this.match_alphabet_(n),a=this;function i(k,y){var E=k/n.length,P=Math.abs(e-y);return a.Match_Distance?E+P/a.Match_Distance:P?1:E}var s=this.Match_Threshold,h=r.indexOf(n,e);h!=-1&&(s=Math.min(i(0,h),s),h=r.lastIndexOf(n,e+n.length),h!=-1&&(s=Math.min(i(0,h),s)));var l=1<<n.length-1;h=-1;for(var g,v,u=n.length+r.length,o,c=0;c<n.length;c++){for(g=0,v=u;g<v;)i(c,e+v)<=s?g=v:u=v,v=Math.floor((u-g)/2+g);u=v;var b=Math.max(1,e-v+1),w=Math.min(e+v,r.length)+n.length,I=Array(w+2);I[w+1]=(1<<c)-1;for(var m=w;m>=b;m--){var D=t[r.charAt(m-1)];if(c===0?I[m]=(I[m+1]<<1|1)&D:I[m]=(I[m+1]<<1|1)&D|((o[m+1]|o[m])<<1|1)|o[m+1],I[m]&l){var A=i(c,m-1);if(A<=s)if(s=A,h=m-1,h>e)b=Math.max(1,2*e-h);else break}}if(i(c+1,e)>s)break;o=I}return h},f.prototype.match_alphabet_=function(r){for(var n={},e=0;e<r.length;e++)n[r.charAt(e)]=0;for(var e=0;e<r.length;e++)n[r.charAt(e)]|=1<<r.length-e-1;return n},f.prototype.patch_addContext_=function(r,n){if(n.length!=0){if(r.start2===null)throw Error("patch not initialized");for(var e=n.substring(r.start2,r.start2+r.length1),t=0;n.indexOf(e)!=n.lastIndexOf(e)&&e.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)t+=this.Patch_Margin,e=n.substring(r.start2-t,r.start2+r.length1+t);t+=this.Patch_Margin;var a=n.substring(r.start2-t,r.start2);a&&r.diffs.unshift(new f.Diff(_,a));var i=n.substring(r.start2+r.length1,r.start2+r.length1+t);i&&r.diffs.push(new f.Diff(_,i)),r.start1-=a.length,r.start2-=a.length,r.length1+=a.length+i.length,r.length2+=a.length+i.length}},f.prototype.patch_make=function(r,n,e){var t,a;if(typeof r=="string"&&typeof n=="string"&&typeof e>"u")t=r,a=this.diff_main(t,n,!0),a.length>2&&(this.diff_cleanupSemantic(a),this.diff_cleanupEfficiency(a));else if(r&&typeof r=="object"&&typeof n>"u"&&typeof e>"u")a=r,t=this.diff_text1(a);else if(typeof r=="string"&&n&&typeof n=="object"&&typeof e>"u")t=r,a=n;else if(typeof r=="string"&&typeof n=="string"&&e&&typeof e=="object")t=r,a=e;else throw new Error("Unknown call format to patch_make.");if(a.length===0)return[];for(var i=[],s=new f.patch_obj,h=0,l=0,g=0,v=t,u=t,o=0;o<a.length;o++){var c=a[o][0],b=a[o][1];switch(!h&&c!==_&&(s.start1=l,s.start2=g),c){case M:s.diffs[h++]=a[o],s.length2+=b.length,u=u.substring(0,g)+b+u.substring(g);break;case p:s.length1+=b.length,s.diffs[h++]=a[o],u=u.substring(0,g)+u.substring(g+b.length);break;case _:b.length<=2*this.Patch_Margin&&h&&a.length!=o+1?(s.diffs[h++]=a[o],s.length1+=b.length,s.length2+=b.length):b.length>=2*this.Patch_Margin&&h&&(this.patch_addContext_(s,v),i.push(s),s=new f.patch_obj,h=0,v=u,l=g);break}c!==M&&(l+=b.length),c!==p&&(g+=b.length)}return h&&(this.patch_addContext_(s,v),i.push(s)),i},f.prototype.patch_deepCopy=function(r){for(var n=[],e=0;e<r.length;e++){var t=r[e],a=new f.patch_obj;a.diffs=[];for(var i=0;i<t.diffs.length;i++)a.diffs[i]=new f.Diff(t.diffs[i][0],t.diffs[i][1]);a.start1=t.start1,a.start2=t.start2,a.length1=t.length1,a.length2=t.length2,n[e]=a}return n},f.prototype.patch_apply=function(r,n){if(r.length==0)return[n,[]];r=this.patch_deepCopy(r);var e=this.patch_addPadding(r);n=e+n+e,this.patch_splitMax(r);for(var t=0,a=[],i=0;i<r.length;i++){var s=r[i].start2+t,h=this.diff_text1(r[i].diffs),l,g=-1;if(h.length>this.Match_MaxBits?(l=this.match_main(n,h.substring(0,this.Match_MaxBits),s),l!=-1&&(g=this.match_main(n,h.substring(h.length-this.Match_MaxBits),s+h.length-this.Match_MaxBits),(g==-1||l>=g)&&(l=-1))):l=this.match_main(n,h,s),l==-1)a[i]=!1,t-=r[i].length2-r[i].length1;else{a[i]=!0,t=l-s;var v;if(g==-1?v=n.substring(l,l+h.length):v=n.substring(l,g+this.Match_MaxBits),h==v)n=n.substring(0,l)+this.diff_text2(r[i].diffs)+n.substring(l+h.length);else{var u=this.diff_main(h,v,!1);if(h.length>this.Match_MaxBits&&this.diff_levenshtein(u)/h.length>this.Patch_DeleteThreshold)a[i]=!1;else{this.diff_cleanupSemanticLossless(u);for(var o=0,c,b=0;b<r[i].diffs.length;b++){var w=r[i].diffs[b];w[0]!==_&&(c=this.diff_xIndex(u,o)),w[0]===M?n=n.substring(0,l+c)+w[1]+n.substring(l+c):w[0]===p&&(n=n.substring(0,l+c)+n.substring(l+this.diff_xIndex(u,o+w[1].length))),w[0]!==p&&(o+=w[1].length)}}}}}return n=n.substring(e.length,n.length-e.length),[n,a]},f.prototype.patch_addPadding=function(r){for(var n=this.Patch_Margin,e="",t=1;t<=n;t++)e+=String.fromCharCode(t);for(var t=0;t<r.length;t++)r[t].start1+=n,r[t].start2+=n;var a=r[0],i=a.diffs;if(i.length==0||i[0][0]!=_)i.unshift(new f.Diff(_,e)),a.start1-=n,a.start2-=n,a.length1+=n,a.length2+=n;else if(n>i[0][1].length){var s=n-i[0][1].length;i[0][1]=e.substring(i[0][1].length)+i[0][1],a.start1-=s,a.start2-=s,a.length1+=s,a.length2+=s}if(a=r[r.length-1],i=a.diffs,i.length==0||i[i.length-1][0]!=_)i.push(new f.Diff(_,e)),a.length1+=n,a.length2+=n;else if(n>i[i.length-1][1].length){var s=n-i[i.length-1][1].length;i[i.length-1][1]+=e.substring(0,s),a.length1+=s,a.length2+=s}return e},f.prototype.patch_splitMax=function(r){for(var n=this.Match_MaxBits,e=0;e<r.length;e++)if(!(r[e].length1<=n)){var t=r[e];r.splice(e--,1);for(var a=t.start1,i=t.start2,s="";t.diffs.length!==0;){var h=new f.patch_obj,l=!0;for(h.start1=a-s.length,h.start2=i-s.length,s!==""&&(h.length1=h.length2=s.length,h.diffs.push(new f.Diff(_,s)));t.diffs.length!==0&&h.length1<n-this.Patch_Margin;){var g=t.diffs[0][0],v=t.diffs[0][1];g===M?(h.length2+=v.length,i+=v.length,h.diffs.push(t.diffs.shift()),l=!1):g===p&&h.diffs.length==1&&h.diffs[0][0]==_&&v.length>2*n?(h.length1+=v.length,a+=v.length,l=!1,h.diffs.push(new f.Diff(g,v)),t.diffs.shift()):(v=v.substring(0,n-h.length1-this.Patch_Margin),h.length1+=v.length,a+=v.length,g===_?(h.length2+=v.length,i+=v.length):l=!1,h.diffs.push(new f.Diff(g,v)),v==t.diffs[0][1]?t.diffs.shift():t.diffs[0][1]=t.diffs[0][1].substring(v.length))}s=this.diff_text2(h.diffs),s=s.substring(s.length-this.Patch_Margin);var u=this.diff_text1(t.diffs).substring(0,this.Patch_Margin);u!==""&&(h.length1+=u.length,h.length2+=u.length,h.diffs.length!==0&&h.diffs[h.diffs.length-1][0]===_?h.diffs[h.diffs.length-1][1]+=u:h.diffs.push(new f.Diff(_,u))),l||r.splice(++e,0,h)}}},f.prototype.patch_toText=function(r){for(var n=[],e=0;e<r.length;e++)n[e]=r[e];return n.join("")},f.prototype.patch_fromText=function(r){var n=[];if(!r)return n;for(var e=r.split(`
3
3
  `),t=0,a=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;t<e.length;){var i=e[t].match(a);if(!i)throw new Error("Invalid patch string: "+e[t]);var s=new f.patch_obj;for(n.push(s),s.start1=parseInt(i[1],10),i[2]===""?(s.start1--,s.length1=1):i[2]=="0"?s.length1=0:(s.start1--,s.length1=parseInt(i[2],10)),s.start2=parseInt(i[3],10),i[4]===""?(s.start2--,s.length2=1):i[4]=="0"?s.length2=0:(s.start2--,s.length2=parseInt(i[4],10)),t++;t<e.length;){var h=e[t].charAt(0);try{var l=decodeURI(e[t].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+l)}if(h=="-")s.diffs.push(new f.Diff(p,l));else if(h=="+")s.diffs.push(new f.Diff(M,l));else if(h==" ")s.diffs.push(new f.Diff(_,l));else{if(h=="@")break;if(h!=="")throw new Error('Invalid patch mode "'+h+'" in: '+l)}t++}}return n},f.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},f.patch_obj.prototype.toString=function(){var r,n;this.length1===0?r=this.start1+",0":this.length1==1?r=this.start1+1:r=this.start1+1+","+this.length1,this.length2===0?n=this.start2+",0":this.length2==1?n=this.start2+1:n=this.start2+1+","+this.length2;for(var e=["@@ -"+r+" +"+n+` @@
4
4
  `],t,a=0;a<this.diffs.length;a++){switch(this.diffs[a][0]){case M:t="+";break;case p:t="-";break;case _:t=" ";break}e[a+1]=t+encodeURI(this.diffs[a][1])+`