proofmarks 0.1.0__py3-none-win_amd64.whl
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.
- proofmarks/__init__.py +3 -0
- proofmarks/__main__.py +3 -0
- proofmarks/_run.py +15 -0
- proofmarks/standalone/CHANGELOG.md +22 -0
- proofmarks/standalone/LICENSE.md +105 -0
- proofmarks/standalone/README.md +117 -0
- proofmarks/standalone/SECURITY.md +15 -0
- proofmarks/standalone/TELEMETRY.md +64 -0
- proofmarks/standalone/dist/OFL.txt +93 -0
- proofmarks/standalone/dist/chunk-FIVQWTE5.js +2 -0
- proofmarks/standalone/dist/chunk-GMJHTMKC.js +1 -0
- proofmarks/standalone/dist/companion/proofmarks.exe +4 -0
- proofmarks/standalone/dist/config/index.d.mts +4 -0
- proofmarks/standalone/dist/config/index.mjs +160 -0
- proofmarks/standalone/dist/index.js +1 -0
- proofmarks/standalone/dist/next/index.js +2 -0
- proofmarks/standalone/dist/overlay/react.js +1 -0
- proofmarks/standalone/dist/pi/extension.js +3 -0
- proofmarks/standalone/dist/proofmarks-font.js +1 -0
- proofmarks/standalone/dist/script-entry.js +1 -0
- proofmarks/standalone/dist/script.js +1 -0
- proofmarks/standalone/dist/shared/node-2IMCJYUI.js +20 -0
- proofmarks/standalone/dist/shared/node-6KSUNIF7.js +3 -0
- proofmarks/standalone/dist/shared/node-KSPBKQI5.js +2 -0
- proofmarks/standalone/dist/shared/node-VICV4ZWL.js +22 -0
- proofmarks/standalone/dist/shared/node-VRDN4HYM.js +10 -0
- proofmarks/standalone/dist/sizes.json +37 -0
- proofmarks/standalone/rules/calibration/jev-jev-1.14.0.json +210 -0
- proofmarks/standalone/rules/rules.v3.json +390 -0
- proofmarks-0.1.0.dist-info/METADATA +127 -0
- proofmarks-0.1.0.dist-info/RECORD +33 -0
- proofmarks-0.1.0.dist-info/WHEEL +4 -0
- proofmarks-0.1.0.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var Xo=`"'\u201D\u2019)\\]*_`,ti=String.raw`(?:^|\n)[ \t]*(?:(?:[-*+]|\d+[.)]|>|#{1,6})[ \t]+)?`,Fs=new RegExp(String.raw`(?:${ti}|[.!?…][${Xo}]*[ \t]+|>[ \t]*)$`);function ni(t,e,n,r=()=>!0){let o=t.slice(0,e),a=t.slice(n),i=t.slice(e,n),l=Fs.test(o),c=new RegExp(`^[.!?\u2026]+[${Xo}]*`).exec(a);if(l&&(c||new RegExp(`[.!?\u2026][${Xo}]*$`).test(i))){let f=n+(c?.[0].length??0),y=new RegExp(`${ti}$`).test(o)?null:/[ \t]+$/.exec(o);return y?{start:e-y[0].length,end:f,after:""}:{start:e,end:f+(/^[ \t]*/.exec(t.slice(f))?.[0].length??0),after:""}}let d=l?/^(?:[,:;]|[ \t]+[—–-])?[ \t]+/.exec(a):null;if(d){let f=n+d[0].length,y=t.slice(f);if(/^\p{Ll}/u.test(y)){let k=/^[^\n]*?(?:[.!?…](?=\s|$)|$)/.exec(y)[0];for(let E of k.matchAll(/\S+/g)){let A=E.index+E[0].length,R=k.charAt(0).toUpperCase()+k.slice(1,A);if(r(R,e,f+A))return{start:e,end:f+A,after:R}}}return{start:e,end:f,after:""}}let u=/[ \t]*,[ \t]*$/.exec(o);if(u&&/^[.!?…]/.test(a))return{start:e-u[0].length,end:n,after:""};let x=/[ \t]+$/.exec(o),h=x&&/^,[ \t]+/.exec(a);return h?{start:e,end:n+h[0].length,after:""}:x&&/^[,.;:!?…]/.test(a)?{start:e-x[0].length,end:n,after:""}:x?{start:e,end:n+(/^[ \t]*/.exec(a)?.[0].length??0),after:""}:{start:e,end:n,after:""}}function ri(t,e,n){if(!/^[,.;:!?]/.test(n))return e;let r=t.slice(0,e),o=/[ \t]*(?:\n[ \t]*)?$/.exec(r)[0].length,a=r.slice(0,r.length-o);return!a||a.endsWith(`
|
|
2
|
+
`)?e:e-o}async function oi(){return(await import("./proofmarks-font.js")).handwritingFont}function ai(t){let e=atob(t.slice(t.indexOf(",")+1)),n=new Uint8Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n.buffer}function rn(t){if(t.proposals?.length)return t.proposals;if(t.proposed===void 0)return[];let e=t.rewriteRequest;return[{version:1,text:t.proposed,...e?.by?{by:e.by}:{},...e?.proposedAt?{proposedAt:e.proposedAt}:{},...e?.stillFlagged?{stillFlagged:!0}:{}}]}var Hs={claude:"Claude Code","claude-code":"Claude Code",codex:"Codex",pi:"pi",other:"Your agent"},js={claude:"claude-code","claude-code":"claude-code",codex:"codex",pi:"pi"},Is={"claude-code":"#d97757",codex:"#7aa2f7",pi:"#f09082"};function Ws(t,e){return e?.agents.find(n=>n.id===t)?.host??(t?.startsWith("headless:")?js[t.slice(9)]:void 0)}var ii=t=>t?.resolvedTarget??t?.target??void 0;function _o(t,e){return e?.agents.find(n=>n.id===t)?.label??e?.headless.find(n=>n.id===t)?.label.replace(/,?\s*(?:no|without a) conversation$/i,"")??(t?.startsWith("headless:")?Hs[t.slice(9)]:"Your agent")??"Your agent"}function Xr(t,e,n=Date.now(),r){let o=t.rewriteRequest,a=o?o.target??o.claimedBy:ii(e),i=_o(a,e),l=rn(t).length,c=!!o&&(o.version??1)>l&&l>0,d=(t.status??"open")==="open"&&(t.proposed===void 0||!!r||c&&!(o?.status==="failed"&&o.error==="Cancelled")),u=d&&(o?.status==="pending"||o?.status==="claimed"),x=Date.parse(o?.requestedAt??""),h=e?.agents.find(S=>S.id===a)?.delivery,f=u&&o?.status==="pending"&&(h==="push"||h==="watch"||!h&&!!a&&!a.startsWith("headless:"))&&Number.isFinite(x)&&n-x>=3e4,y=d&&(o?.status==="failed"||!!r),k=d?r??(y?o?.error??"The rewrite failed. Try again.":f?`${i} hasn't picked this up. Is it watching?`:o?.status==="claimed"?`${i} is writing`:u?`Sent to ${i==="Your agent"?"your agent":i}`:""):"",E=u&&!f&&!y?o?.status==="claimed"?"writing":"sent":void 0,A=Ws(a,e),R=A&&Is[A];return{waiting:u,stalled:f,failed:y,message:k,retry:f||y,label:i,working:E,color:R}}function Ys(t){return[...t.agents.map(e=>{let n=new Date(e.startedAt),r=Number.isNaN(n.getTime())?"":n.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"}),o=e.project.split(/[\\/]/).filter(Boolean).at(-1);return{id:e.id,label:[e.label,o,r?`started ${r}`:""].filter(Boolean).join(" \xB7 "),delivery:e.delivery==="push"?"Pushes to the conversation":e.delivery==="watch"?"Waiting in watch mode":"Not watching yet. Ask this agent to watch."}}),...t.headless.filter(e=>e.available).map(e=>({id:e.id,label:`${_o(e.id,t)}, no conversation`,delivery:"Runs without a conversation"}))]}function _r(t,e){let n=t.ownerDocument,r=t.getRootNode(),o=r instanceof ShadowRoot?r.activeElement:n.activeElement,a=o instanceof HTMLElement?o.dataset.agentTarget:void 0;t.replaceChildren(),t.dataset.rewriteTargets="";let i=n.createElement("h3");i.textContent="Rewrite with",t.append(i);let l=x=>{let h=n.createElement("p");h.textContent=x,h.setAttribute("role","status"),t.append(h)};if(!e.agents){l(e.reason??"Checking for connected agents\u2026");return}let c=Ys(e.agents),d=ii(e.agents);if(!c.length){l("Connect an MCP agent in watch mode, or install Claude Code, Codex or pi.");return}if(!e.agents.agents.length&&c.length===1){l(`No agents connected. Ask uses ${_o(c[0].id,e.agents)} without a conversation.`),e.reason&&l(e.reason);return}let u=n.createElement("div");u.setAttribute("role","radiogroup"),u.setAttribute("aria-label","Rewrite with");for(let x of c){let h=n.createElement("button");h.type="button",h.className="d-switch-row d-agent-row",h.dataset.agentTarget=x.id,h.setAttribute("role","radio"),h.setAttribute("aria-checked",String(x.id===d)),h.tabIndex=x.id===(d??c[0]?.id)?0:-1,h.disabled=!!e.busy;let f=n.createElement("span");f.className="d-agent-copy";let y=n.createElement("span");if(y.textContent=x.label,f.append(y),x.id===d){let E=n.createElement("span");E.className="d-agent-delivery",E.textContent=x.delivery,f.append(E)}let k=n.createElement("span");k.setAttribute("aria-hidden","true"),k.textContent=x.id===d?"\u2713":"",h.append(f,k),h.onclick=()=>e.select(x.id),u.append(h)}u.addEventListener("keydown",x=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(x.key))return;x.preventDefault();let h=[...u.querySelectorAll("button:not(:disabled)")];if(!h.length)return;let f=h.indexOf(x.target),y=x.key==="Home"?0:x.key==="End"?h.length-1:(f+(["ArrowLeft","ArrowUp"].includes(x.key)?-1:1)+h.length)%h.length;h[y].focus(),h[y].click()}),t.append(u),e.reason&&l(e.reason),a&&t.querySelectorAll("[data-agent-target]").forEach(x=>{x.dataset.agentTarget===a&&!x.disabled&&x.focus({preventScroll:!0})})}function si(t){let e="",n;return t.setAttribute("aria-atomic","true"),(r,o)=>{let a=t.ownerDocument,i=a.defaultView,l=!!o&&[...a.fonts].some(f=>f.family==="ProofmarksHand"&&f.status==="loaded"),c=i.matchMedia("(prefers-reduced-motion:reduce)").matches,d=JSON.stringify([r,o,l,l&&c]);if(d===e)return;e=d;let u=t.hasAttribute("data-working")&&o&&r&&!c?t.querySelector(".working-line"):null;n?.cancel(),t.hasAttribute("data-working")&&t.getAnimations({subtree:!0}).forEach(f=>{let y=f.effect.target;u&&y instanceof Node&&u.contains(y)?f.pause():f.cancel()}),t.hidden=!r;let x=t.querySelector(".d-sr")??a.createElement("span");for(let f of[...t.children])f!==x&&f.remove();if(delete t.dataset.working,delete t.dataset.workingPhase,!o||!r){t.textContent=r;return}l&&(t.dataset.working=""),t.dataset.workingPhase=o,x.className="d-sr",x.textContent!==r&&(x.textContent=r);let h=a.createElement("span");h.className="working-line",h.setAttribute("aria-hidden","true"),h.textContent=r,x.isConnected||t.replaceChildren(x),t.append(h),l&&(u&&(u.className="working-line working-outgoing",t.append(u),n=u.animate([{opacity:1},{opacity:0}],{duration:150,fill:"forwards"}),n.onfinish=()=>{u.getAnimations({subtree:!0}).forEach(f=>f.cancel()),u.remove()}),Xs(h,r,o,c,u?150:0))}}function Vs(t,e=0){let n=0,r=Array.from({length:t},(o,a)=>{let i=n;return n+=30+[0,11,5,15][a%4],i});return r.map(o=>o*Math.min(1,(1120-e)/Math.max(1,r.at(-1)??0)))}function Xs(t,e,n,r,o){let a=t.ownerDocument;t.textContent="";let i=a.createElement("canvas").getContext("2d"),l=S=>(i.fillStyle=S,i.fillRect(0,0,1,1),[...i.getImageData(0,0,1,1).data].slice(0,3).reduce((L,$,m)=>{let M=$/255;return L+(M<=.04045?M/12.92:((M+.055)/1.055)**2.4)*[.2126,.7152,.0722][m]},0)),c=a.defaultView.getComputedStyle(t),d=c.getPropertyValue("--agent").trim()||c.getPropertyValue("--mark"),u=l(d),x=l(c.getPropertyValue("--ink"));t.style.color=(Math.max(u,x)+.05)/(Math.min(u,x)+.05)>=4.5?d:"var(--paper)";let h=Vs(e.length,o),f=(h.at(-1)??0)+80,y=[...e].map((S,L)=>{let $=a.createElement("span");return $.className="hand-glyph",$.textContent=S,t.append($),r||$.animate([{opacity:0,transform:"translateY(1px)"},{opacity:1,transform:"none"}],{duration:80,delay:o+h[L],fill:"backwards",easing:"cubic-bezier(.22,1,.36,1)"}),$});if(r)return;let k=n==="sent"?.5:1,E=a.createElement("span");E.className="hand-nib",t.append(E),E.animate([{offset:0,transform:"translateX(0px)",opacity:k},...y.map((S,L)=>({offset:(h[L]+80)/f,transform:`translateX(${S.offsetLeft+S.offsetWidth}px)`,opacity:L===y.length-1?0:k}))],{duration:f,delay:o,fill:"backwards"});let A=a.createElement("span");A.className="hand-dots",t.append(A),i.font=`${c.fontWeight} ${c.fontSize} ${c.fontFamily}`;let R=Math.max(...y.map(S=>S.offsetLeft+i.measureText(S.textContent).actualBoundingBoxRight));A.style.left=`${R+2.5+i.measureText(".").actualBoundingBoxLeft}px`;for(let S=0;S<3;S++){let L=a.createElement("span");L.textContent=".",A.append(L),L.animate([{offset:0,opacity:0},{offset:.15+S*.15,opacity:0},{offset:.2+S*.15,opacity:k},{offset:.8,opacity:k},{offset:1,opacity:0}],{duration:1600,delay:o+f,iterations:1/0,fill:"backwards"})}}var li=".working-line{display:inline-block;position:relative;max-width:100%}[data-working]{height:18px;position:relative}[data-working] .working-line{position:absolute;left:0;top:0;white-space:pre;font:500 18px/18px ProofmarksHand,cursive}.hand-glyph{display:inline-block;white-space:pre}.hand-nib{width:3px;height:3px;border-radius:50%;background:var(--agent, var(--mark));position:absolute;left:0;top:12px;opacity:0}.hand-dots{position:absolute;top:0;display:flex;color:var(--agent, var(--mark))}.hand-dots span{opacity:0}.working-outgoing{pointer-events:none}.working-outgoing .hand-nib,.working-outgoing .hand-dots{display:none}";var Se=t=>t.documentElement.clientWidth;function ci(t){let e=new Set,n=!t.empty;return{get ready(){return n},visible:r=>n&&!e.has(r),toggleRule(r){return e.has(r)?e.delete(r):e.add(r),!e.has(r)},finish(){n=!0}}}function Uo(t){return t?.connected?`${t.provider??"Judge"} \xB7 connected \xB7 ${t.model??""}`:t?.reason??"Jev \xB7 not connected"}var di=t=>`${t} ${new Intl.PluralRules("en-US").select(t)==="one"?"mark":"marks"}`;function _s(t){let e=t.kept+t.dismissed;return t.line>t.base?`Stricter here: you dismissed ${t.dismissed} of ${e}.`:t.line<t.base?`Looser here: you kept ${t.kept} of ${e}.`:t.kept?t.dismissed?`You kept ${t.kept} and dismissed ${t.dismissed} so far.`:`You kept ${di(t.kept)} so far.`:`You dismissed ${di(t.dismissed)} so far.`}function Us(t,e,n,r){let o=t.createElement("button");o.type="button",o.textContent=e,o.onclick=()=>o.setAttribute("aria-checked",String(r())),o.className="d-switch-row",o.setAttribute("role","switch"),o.setAttribute("aria-checked",String(n));let a=t.createElement("span");return a.className="d-switch",a.setAttribute("aria-hidden","true"),o.append(a),o}function dr(t,e,n){let r=t.createElement("section"),o=t.createElement("h3");return o.textContent=n,r.append(o),e.append(r),r}function pi(t){let{doc:e}=t,n=e.createElement("div");n.className="d-settings";let r=dr(e,n,"Judge"),o=e.createElement("p");o.dataset.companionStatus="",o.textContent=Uo(t.status),r.append(o);let a=dr(e,n,"Rules");for(let l of t.rules){let c=e.createElement("button"),d=e.createElement("span"),u=e.createElement("span");c.type="button",c.className="d-rule-open",c.dataset.rule=l.id,c.onclick=()=>t.openRule(l.id),d.textContent=l.label,u.textContent="\u203A",u.setAttribute("aria-hidden","true"),c.append(d,u),a.append(c)}let i=dr(e,n,"Rewrite with");return _r(i,{agents:t.agents,reason:t.agentReason,busy:t.targetBusy,select:l=>t.selectTarget?.(l)}),n}function ui(t){let{doc:e,rule:n}=t,r=e.createElement("div");r.className="d-settings d-rule-page",r.append(Us(e,"Show these marks",t.state.visible(n.id),()=>{let i=t.state.toggleRule(n.id);return t.changed(),i}));let o=n.rubric;for(let[i,l]of[["Checks",o?.checks??n.why],["Looks like",o?.looksLike],["Not this",o?.notLike],["Try",o?.fix??n.fix]]){if(!l)continue;let c=e.createElement("p");c.textContent=l,dr(e,r,i).append(c)}let a=t.strictness;if(a){let i=dr(e,r,"On this site"),l=e.createElement("div"),c=e.createElement("p");if(l.className="d-learned",c.textContent=_s(a),l.append(c),a.line!==a.base){let d=e.createElement("button");d.type="button",d.className="d-learned-reset",d.textContent="Reset",d.setAttribute("aria-label",`Reset strictness for ${n.label}`),d.disabled=!!t.resetting||!t.resetStrictness,d.onclick=()=>t.resetStrictness?.(n.id),l.append(d)}i.append(l)}return r}var hi='.d-sr,.d-sr-close{position:absolute!important;width:1px!important;height:1px!important;min-width:0!important;min-height:0!important;padding:0!important;margin:-1px;overflow:hidden;clip-path:inset(50%)}.d-sr-close:focus-visible{position:static!important;width:auto!important;height:40px!important;margin:0;clip-path:none;padding:8px!important}.card,.card.dock-card{padding:14px}.panel[data-slot^=bottom] .card.dock-card{padding-bottom:14px}.card header{margin:-4px 0 14px;min-height:40px}.card header .d-rule{width:auto;min-width:0;height:auto;min-height:40px;padding:0 4px;margin-left:-4px;text-align:left;color:var(--mark);font:500 21px/1.2 ProofmarksHand,cursive;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:5px;text-decoration-color:color-mix(in srgb, currentColor 45%, transparent)}.card .proof-content{gap:14px;padding:0}.card .rule-check{margin:0;font-size:12px;color:var(--muted)}.proof-pair{display:flex;flex-direction:column;gap:10px}.proof-version p{margin:0!important;font-size:14px;line-height:1.5}.proof-version del{color:var(--muted);text-decoration-thickness:1px}.proof-version ins{text-decoration:none}.proof-content .copy-note{margin:14px 0 0}.card .actions{display:flex;gap:6px;align-items:center}.card .actions button{min-height:40px}.card .proof-status{margin:0}.card .proof-status[data-status=dismissed]{color:var(--muted)}.card .actions [data-action=revert]{flex:none}.card .d-footer{display:flex;align-items:center;justify-content:space-between;margin:14px -8px -6px}.d-footer button{min-width:40px;min-height:40px}.d-footer .proof-position{height:40px;width:auto;margin:0;font-size:12px;color:var(--muted)}.d-footer [data-step]{font-size:22px}.card[data-following=true]{pointer-events:auto}.card[data-following=true] .d-rule{pointer-events:none}.card[data-following=true] .actions-shell,.card[data-following=true] .d-footer{display:none}.card[data-following=true] header button{visibility:visible}.card[data-following=true] .d-sr-close{display:none}.card .meta-info{margin:0;display:flex;flex-direction:row;align-items:center;gap:6px}.card .meta-info strong{display:flex;flex:none}.meta-info strong{display:inline}.meta-info strong span{display:none}.meta-info svg{width:15px;height:15px;margin-right:6px}.meta-info>span{display:inline;font-size:11px;color:var(--muted)}.d-deep{scroll-margin:14px;display:flex;flex-direction:column;gap:14px}.d-deep>header{display:flex;align-items:center;gap:6px;margin:0}.card .d-deep h2{font:500 16px/1.4 system-ui,sans-serif;color:var(--paper);white-space:normal}.card .d-deep header button{min-width:40px;width:40px;height:40px;font-size:24px}.d-deep>button{padding-inline:0;text-align:left;min-height:40px;font-size:13px}.d-muted,.d-settings p{font-size:12px;color:var(--muted);margin:0}.d-deep>button:not(.d-nav):not(.d-switch-row){text-decoration:underline;text-underline-offset:4px}.d-nav{display:flex;justify-content:space-between;align-items:center;padding-right:2px;border-top:1px solid #ffffff14;border-radius:0}.d-settings{display:flex;flex-direction:column;gap:20px}.d-settings h3,.why-content h4{font:500 11px/1.5 system-ui,sans-serif;text-transform:uppercase;color:var(--muted);margin:0 0 6px;letter-spacing:.04em}.d-settings button,.d-settings a{font-size:13px;min-height:40px}.d-settings a{color:var(--paper)}.d-switch-row{display:flex;align-items:center;justify-content:space-between;width:100%;padding:0;gap:12px;font-size:13px}.d-switch{width:30px;height:18px;border-radius:12px;padding:3px;background:#ffffff24;flex:none}.d-switch:before{content:"";display:block;width:12px;height:12px;border-radius:50%;background:var(--muted);transform:translate(0);transition:transform .15s cubic-bezier(.22,1,.36,1)}[aria-checked=true]>.d-switch{background:var(--paper)}[aria-checked=true]>.d-switch:before{background:var(--ink);transform:translate(12px)}.d-segments{display:flex;padding:3px;margin-top:12px;background:#ffffff0b;border-radius:7px}.d-segments button{flex:1;padding:4px;color:var(--muted)}.d-segments [aria-pressed=true]{background:#ffffff14;color:var(--paper)}.why-content p{font-size:13px;line-height:1.55;margin:0 0 16px}.why-content .record-meta{font-size:11px;color:var(--muted);margin-top:18px}.why-content .signal-row{margin-top:12px}.panel[data-expanded=true]>.header{visibility:visible}.panel[data-expanded=true] .pill-surface,.panel[data-expanded=true] .pill-mark:before{background:transparent}.card .d-deep .record-title{font:500 25px/1.2 ProofmarksHand,cursive;color:var(--mark);margin:0 0 4px;text-transform:none;letter-spacing:normal}.label{background:transparent}.d-surface-shadow{position:fixed;pointer-events:none;z-index:2147481999;border-radius:var(--surface-radius);box-shadow:var(--surface-shadow);opacity:0;transition:opacity 80ms cubic-bezier(.22,1,.36,1)}.d-surface-shadow[data-open=true]{opacity:1;transition-delay:.13s;transition-duration:.1s}.header .pill .pill-close{display:none}.header .pill .pill-count{padding:0 14px 0 2px;min-width:0}.header .pill .pill-mark{min-width:44px}.panel .header .pill-content{gap:0}.mobile-sheet{max-height:78dvh;padding:0 14px max(8px,env(safe-area-inset-bottom))}.mobile-sheet .sheet-card{padding:14px 0}.sheet-handle{height:44px;min-height:44px;width:100%;font-size:0;position:sticky;top:0;background:var(--ink);z-index:2}.sheet-handle:before{content:"";display:block;width:40px;height:4px;background:#ffffff33;border-radius:2px;margin:auto}.mobile-sheet .sheet-card .actions-shell{position:static}.mobile-sheet .d-deep header button{display:block}.mobile-sheet .card .d-sr-close{display:block}.mobile-sheet .actions button{flex:1}@media(max-width:700px),(pointer:coarse){.d-footer button,.d-deep button,.d-settings button,.card .actions button,.card header .d-rule{min-height:44px}.card .d-footer button{min-width:44px}.card .d-deep header button{min-width:44px}.d-deep{gap:14px}}.panel{max-height:var(--panel-max-height, calc(100dvh - 100px) );overflow:visible;border-radius:var(--surface-radius);background:transparent;box-shadow:none}.dock-surface{clip-path:none;border-radius:0}.panel[data-expanded=false]:not([data-animating]) .dock-surface{display:none}.card.dock-card,.card[data-fixed=true],.mobile-sheet .sheet-card{display:flex;flex-direction:column;max-height:var(--panel-max-height, calc(78dvh - 44px) );overflow:hidden;padding:14px 14px 0;border-radius:0;min-height:0}.card>header,.card .d-deep>header{flex:none;display:flex;align-items:center;margin:-14px -14px 10px;padding:0;min-height:44px;gap:0}.card header .d-rule{flex:1;min-width:0;padding:0 14px;margin:0;font-size:21px}.card header .d-rule:focus-visible{outline-offset:2px}.card .surface-logo,.card .d-deep .surface-logo{flex:0 0 44px;width:44px;height:44px;min-height:44px;min-width:44px;padding:11px;position:static;order:initial}.surface-logo svg{display:block;width:22px;height:22px}.card .d-deep h2{flex:1;margin:0}.card .d-deep{min-height:0;display:flex;flex-direction:column;gap:0}.card .d-view-body{min-height:0;overflow:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:14px;padding-bottom:14px}.card .proof-content{min-height:0;overflow:auto;overscroll-behavior:contain}.card .actions-shell{flex:none}.card .d-footer{order:3;flex:none;min-height:46px;height:46px;margin:14px -14px 0;gap:0}.card .d-footer button{height:44px;min-height:44px}.card .d-footer .proof-position{flex:1}.card[data-view]:not([data-view=proof]) .d-footer [data-step]{display:none}.d-view-body>button,.d-view-body>[data-rewrite-all]>button{padding-inline:0;text-align:left;min-height:40px;font-size:13px}.d-view-body>[data-rewrite-all]{display:flex;flex-direction:column;align-items:flex-start;gap:6px}.d-view-body>[data-rewrite-all]:empty{display:none}.d-view-body>[data-rewrite-all]>p{margin:0}.d-view-body>[data-rewrite-all]>button.primary{background:var(--paper);color:var(--ink);padding-inline:16px;text-decoration:none}.d-view-body>button:not(.d-nav):not(.d-switch-row),.d-view-body>[data-rewrite-all]>button,.d-settings section>button:not(.d-switch-row):not(.d-rule-open){padding-inline:0;text-decoration:underline;text-underline-offset:4px}.mobile-sheet{overflow:hidden;display:flex;flex-direction:column;padding:0 14px max(8px,env(safe-area-inset-bottom));border-radius:var(--surface-radius) var(--surface-radius) 0 0}.sheet-handle{position:static;flex:none}.mobile-sheet .sheet-card{max-height:calc(78dvh - 52px);padding:14px 0 0}.mobile-sheet .card>header,.mobile-sheet .card .d-deep>header{margin:-14px 0 10px;padding:0}.mobile-sheet .card header .sheet-logo{position:static;display:block}.mobile-sheet .d-deep header button{min-width:44px}.card .completion-undo{min-height:40px}.mobile-sheet .completion-undo{min-height:44px}.card .d-view-body{margin-inline:-12px;padding-inline:12px}.mobile-sheet .sheet-card{overflow:visible}.card button:not(.d-rule):not(.primary){position:relative;isolation:isolate;background:transparent;transition:scale .16s ease-out}.card button:not(.d-rule):not(.primary):before{content:"";position:absolute;z-index:-1;pointer-events:none;left:50%;top:50%;width:min(calc(100% - 8px),var(--control-ink-width, 32px));height:32px;transform:translate(-50%,-50%);border-radius:999px}.card button:not(.d-rule):not(.primary):focus-visible{outline:0}.card button:not(.d-rule):not(.primary):focus-visible:before{outline:2px solid var(--paper);outline-offset:2px}.card .d-view-body>button:not(.primary):not(.d-rule):before,.card .d-view-body>[data-rewrite-all]>button:not(.primary):before,.card .d-settings section>button:not(.primary):not(.d-rule):before{width:var(--control-ink-width, 32px);left:-12px;transform:translateY(-50%)}.card .d-deep button.d-switch-row:not(.primary):not(.d-rule):before,.card .d-deep button.d-nav:not(.primary):not(.d-rule):before,.card .d-deep button.d-rule-open:not(.primary):not(.d-rule):before{left:-8px;width:calc(100% + 16px);height:calc(100% - 8px);transform:translateY(-50%)}.card button:not(.d-sr-close){position:relative}.card button:not(.d-sr-close):after{content:"";position:absolute;pointer-events:auto;left:50%;top:50%;width:max(100%,44px);height:max(100%,44px);transform:translate(-50%,-50%)}.card[data-following=true] button:after{pointer-events:none}.card button:active{transform:none;scale:.97}.card .d-rule:active{scale:1}.card .d-rule:focus-visible{outline:0;text-decoration-thickness:2px;text-decoration-color:currentColor}.card[data-fixed=true]{max-height:calc(100dvh - 24px)}.card:not(.dock-card):not(.sheet-card){border-radius:var(--surface-radius);box-shadow:var(--surface-shadow)}.card .d-segments [aria-pressed=true]{background:#ffffff14}.card button:not(.primary):not(.d-rule):active:before{background:oklch(0.31 0.01 70)}@media(hover:hover)and (pointer:fine){.card button:not(.primary):hover{background:transparent}.card button:not(.primary):not(.d-rule):hover:before,.card .d-segments [aria-pressed=true]{background:#ffffff14}.card button:not(.primary):not(.d-rule):active:before{background:oklch(0.31 0.01 70)}.card .d-rule:hover{background:transparent;text-decoration-thickness:2px;text-decoration-color:currentColor}.card .primary:hover{background:#e7e1d5}}@media(prefers-reduced-motion:reduce){.card button,.card button:before{transition:none!important}.card button:active{scale:1}.d-surface-shadow,.d-switch:before{transition:none!important}}.card .actions[data-decided=true]{height:40px;min-height:40px;gap:10px}.card .actions[data-decided=true] .proof-status{flex:none;margin:0;font-size:13px}.card .actions[data-decided=true] [data-action=revert]{flex:none;min-width:44px;height:40px;font-size:13px;padding-inline:16px}.card .actions[data-decided=true] [data-action=revert]:before{left:0;top:0;width:100%;height:100%;transform:none;border-radius:6px;background:#ffffff14}@media(hover:hover)and (pointer:fine){.card .actions[data-decided=true] [data-action=revert]:hover:before{background:#ffffff24}}@media(max-width:700px),(pointer:coarse){.card .actions[data-decided=true],.card .actions[data-decided=true] [data-action=revert]{height:44px;min-height:44px}}.card[data-view=settings] .d-deep>header{gap:8px}.card[data-view=settings] .d-deep>header>button:not(.surface-logo){flex:0 0 44px;min-width:44px;width:44px}.card .d-deep>header h2{min-width:0}.card .actions .ask-rewrite{flex:none;white-space:nowrap;text-align:left;font-size:13px;padding:6px 16px}.card .rewrite-warning,.card .rewrite-prompt{margin:0;color:var(--muted);font-size:12px;line-height:1.5}@media(max-width:700px),(pointer:coarse){.mobile-sheet .actions:has(>.ask-rewrite:not([hidden])){min-height:60.8px}.mobile-sheet .card .actions .ask-rewrite{flex:none;max-width:none;white-space:nowrap;line-height:16px}}.marks [data-finding-group]{transition:opacity .15s cubic-bezier(.22,1,.36,1)}.marks [data-quiet=true]{opacity:0}@media(prefers-reduced-motion:reduce){.marks [data-finding-group]{transition:none}}.marks [data-dim=true]{opacity:.15}.line-menu{position:absolute;z-index:3;pointer-events:auto;display:flex;flex-direction:column;align-items:flex-start;padding:2px 12px 6px 7px;margin:-2px 0 0 -7px;background:#fffdf8;border-radius:8px;box-shadow:0 1px 2px #0000000f,0 8px 24px #0000001f;animation:line-menu-in .12s cubic-bezier(.22,1,.36,1)}.line-menu .line-name{border:0;background:none;padding:3px 0;font:500 23px/1.1 ProofmarksHand,cursive;color:var(--mark);text-align:left;cursor:pointer;text-underline-offset:4px}.line-menu .line-name:hover,.line-menu .line-name:focus-visible{text-decoration:underline}@keyframes line-menu-in{0%{opacity:0;transform:translateY(-2px)}}@media(prefers-reduced-motion:reduce){.line-menu{animation:none}}.morph-surface{position:fixed;left:0;top:0;z-index:2147482000;transform-origin:0 0;will-change:transform;pointer-events:none;background:var(--ink);border-radius:var(--surface-radius);box-shadow:var(--surface-shadow)}.morph-cream{position:absolute;inset:0;border-radius:inherit;background:#fffdf8;will-change:opacity}.card[data-morphing]{background:transparent!important;border-color:transparent!important;box-shadow:none!important}[data-reshaping],[data-reshaping] .proof-content,[data-reshaping] .d-view-body{overflow:hidden!important}.line-tabs[data-tucking] .line-tab{opacity:0}.tab-ghosts{position:fixed;inset:0;z-index:2147482001;pointer-events:none}.tab-ghost{position:fixed}.ghost-mover{position:absolute;inset:0;will-change:transform}.ghost-shape{position:absolute;inset:0;filter:drop-shadow(-2px 2px 4px #0000001a)}.ghost-cap,.ghost-body{position:absolute;top:0;bottom:0;background:#fffdf8;border:1px solid #0000001a;will-change:transform}.ghost-cap{left:0;border-right:0;border-radius:9px 0 0 9px}.ghost-body{right:0;border-left:0;transform-origin:100% 50%}.tab-ghost[data-selected] :is(.ghost-cap,.ghost-body){background:var(--ink);border-color:oklch(0.3 0.01 70)}.ghost-clip{position:absolute;inset:0;overflow:hidden}.ghost-name{position:absolute;top:0;bottom:0;display:flex;align-items:center;white-space:nowrap;font:500 19px/1 ProofmarksHand,cursive;color:var(--mark);will-change:transform}.ghost-rest{will-change:opacity}.tab-ghost[data-selected] .ghost-name{color:var(--ink-mark)}.line-tabs{position:fixed;left:0;top:0;z-index:2147481999;width:0;display:flex;flex-direction:column;align-items:flex-end;pointer-events:none}.line-tab{pointer-events:auto;display:flex;justify-content:flex-end;min-width:0;min-height:0;padding:2px 0;border:0;border-radius:0;background:none;color:var(--mark);cursor:pointer;font:500 19px/1 ProofmarksHand,cursive}.tab-chip{display:flex;align-items:center;height:30px;width:30px;padding-left:var(--lead, 10px);border:1px solid #0000001a;border-right:0;border-radius:9px 0 0 9px;background:#fffdf8;box-shadow:-2px 2px 8px #0000001a;overflow:hidden;white-space:nowrap;transition:width .18s cubic-bezier(.22,1,.36,1)}.tab-first,.tab-rest{flex:none}.tab-rest{opacity:0;transition:opacity .1s}.line-tab[aria-selected=true]{color:var(--ink-mark)}.line-tab[aria-selected=true] .tab-chip{background:var(--ink);border-color:oklch(0.3 0.01 70)}.line-tab:hover .tab-chip,.line-tab:focus-visible .tab-chip{width:var(--full, 110px)}.line-tab:hover .tab-rest,.line-tab:focus-visible .tab-rest{opacity:1;transition-delay:.03s}.line-tab:focus-visible{outline:none}.line-tab:focus-visible .tab-chip{outline:2px solid var(--mark);outline-offset:-3px}@media(prefers-reduced-motion:reduce){.tab-chip,.tab-rest{transition:none}}.d-agent-row{text-align:left;min-height:44px;padding:6px 0}.d-agent-copy{display:flex;flex-direction:column;gap:3px;min-width:0}.d-agent-delivery{font-size:12px;color:var(--muted)}.d-settings button.d-rule-open{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:6px 0;text-align:left}.d-rule-page p{font-size:13px;line-height:1.55;color:var(--paper)}.d-learned{display:flex;align-items:center;justify-content:space-between;gap:12px}.card .d-learned button.d-learned-reset:not(.primary):before{width:var(--control-ink-width, 32px)}.d-settings button.d-learned-reset{flex:none;font-size:12px;color:var(--muted);text-decoration:underline;text-underline-offset:4px;padding:0;min-height:32px}.card .rewrite-target{align-self:flex-start;font-size:12px;color:var(--muted);text-decoration:underline;text-underline-offset:4px;padding:0;min-height:32px}@media(max-width:700px),(pointer:coarse){.d-settings button.d-learned-reset,.card .rewrite-target{min-height:44px}}.version-tools{display:flex;align-items:center;margin-left:auto;flex:none}.card header .version-tools:not([hidden])~.surface-logo{margin-left:6px!important}.card[data-following=true] .version-tools{display:none}.version-nav{display:flex;align-items:center;flex:none}.card .version-tools button{display:inline-flex;align-items:center;justify-content:center;width:32px;min-width:32px;padding:0;font-size:18px;line-height:1}.version-label{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums;padding:0 2px;white-space:nowrap;text-box:trim-both cap alphabetic}.card .version-tools .try-another{color:var(--muted)}.card .version-tools .try-another:not(:disabled):hover{color:var(--paper)}.version-tools svg{display:block;width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}.queue-line{display:flex;align-items:center;gap:6px;margin:10px 0 0;font-size:12px;line-height:1.5;color:var(--muted)}.card .queue-line button{font-size:12px;min-height:32px;padding-inline:8px;margin-left:auto}@media(max-width:700px),(pointer:coarse){.card .queue-line button{min-height:44px;height:44px}.card .version-tools button{width:44px;min-width:44px}}';function fi(t){let e=[];for(let n of[...t].sort((r,o)=>r.top-o.top||r.left-o.left)){let r=e.find(o=>Math.min(o.bottom,n.bottom)-Math.max(o.top,n.top)>=Math.min(o.bottom-o.top,n.bottom-n.top)*.6);r?(r.left=Math.min(r.left,n.left),r.right=Math.max(r.right,n.right),r.top=Math.min(r.top,n.top),r.bottom=Math.max(r.bottom,n.bottom)):e.push({left:n.left,right:n.right,top:n.top,bottom:n.bottom})}return e.sort((n,r)=>n.top-r.top||n.left-r.left)}function Ks(t,e=6){let n=[];for(let i of[...t].sort((l,c)=>l.anchor-c.anchor)){let l=n.at(-1);l&&Math.abs(i.anchor-l[0].anchor)<1?l.push(i):n.push([i])}let r=-1/0,o=n.flatMap(i=>i.sort((l,c)=>(l.anchorLeft??l.left)-(c.anchorLeft??c.left))),a=o[0]?.left??0;return o.map(i=>{let l=Math.max(i.anchor,r+e);return r=l+i.height,{...i,left:a,top:l}})}function Ur(t){let e=[];for(let n of[...t].sort((r,o)=>r.anchor-o.anchor)){let r=e.at(-1);r&&Math.abs(n.anchor-r[0].anchor)<1?r.push(n):e.push([n])}return e.map(n=>n.sort((r,o)=>(r.rank??0)-(o.rank??0)||(r.anchorLeft??r.left??0)-(o.anchorLeft??o.left??0)))}function mi(t,e=6){let n=Ur(t),r=new Map(Ks(n.map(o=>o[0]),e).map(o=>[o.id,o]));return n.flatMap(o=>{let a=r.get(o[0].id);return o.map((i,l)=>l?{...i,left:a.left,top:a.top,hidden:!0,head:a.id}:{...a,count:o.length})})}var gi=t=>Math.max(0,Math.min(200,t)),bi=(t,e,n)=>Math.max(t+8,e?n-164:t+8);function Kr(t){return t==="Another copy of this sentence changed. Reload to try again."?t:/ambiguous|more than once/i.test(t)?"This sentence appears more than once in the file, so it can't be edited from here.":/no longer matches|text has changed|source text.*match|source match is empty/i.test(t)?"The text changed since this proof was made.":/no nonempty rewrite|empty rewrite|no rewrite/i.test(t)?"No rewrite yet.":"This proof can't be applied right now."}var xn=t=>`${Math.round(Math.max(0,Math.min(1,t))*100)}%`,xi=t=>t.threshold??.6;function yi(t,e,n){let r=t.createElement("div");r.className="why-content";let o=t.createElement("h3");if(o.className="record-title",o.textContent=n?.label??e.rule,r.append(o),e.actionReason){let u=t.createElement("h4"),x=t.createElement("p");u.textContent="Edit details",x.className="record-action-reason",x.textContent=e.actionReason,r.append(u,x)}let a=n?.rubric;if(a)for(let[u,x]of[["Checks",a.checks],["Looks like",a.looksLike],["Not this",a.notLike],["Try",a.fix]]){let h=t.createElement("h4"),f=t.createElement("p");h.textContent=u,f.textContent=x,r.append(h,f)}if(!e.judge){let u=t.createElement("p");return u.className="record-meta",u.textContent=e.id,r.append(u),r}let i=t.createElement("section");i.className="record-scores";let l=t.createElement("h4");l.textContent="Sentence signals",i.append(l);let c=[{id:"rule",label:n?.label??e.rule,score:e.judge.probability??e.judge.score??0,threshold:e.judge.threshold},...e.judge.signals??[]];for(let u of c){let x=t.createElement("div");x.className="signal-row";let h=t.createElement("span");h.textContent=u.label;let f=t.createElement("span");f.className="signal-value",f.textContent=xn(u.score);let y=t.createElement("span");y.className="signal-track",y.setAttribute("role","meter"),y.setAttribute("aria-label",u.label),y.setAttribute("aria-valuemin","0"),y.setAttribute("aria-valuemax","100"),y.setAttribute("aria-valuenow",String(Math.round(u.score*100))),y.setAttribute("aria-valuetext",`${xn(u.score)}; threshold ${xn(xi(u))}`);let k=t.createElement("span");k.className="signal-fill",k.style.width=xn(u.score);let E=t.createElement("span");E.className="signal-tick",E.style.left=xn(xi(u)),y.append(k,E),x.append(h,f,y),i.append(x)}if(e.judge.after!==void 0){let u=typeof e.judge.after=="number"?e.judge.after:e.judge.after.probability,x=t.createElement("p");x.textContent=`Rewrite: ${xn(u)}; threshold ${xn(e.judge.threshold)}`,i.append(x)}r.append(i);let d=t.createElement("p");return d.className="record-meta",d.textContent=`${e.id} \xB7 ${e.judge.model} \xB7 ${e.judge.scope??e.level??"sentence"}`,r.append(d),r}function vi(t,e){return+!!t.target-+!!e.target||(t.span?.start??1/0)-(e.span?.start??1/0)||(e.span?.end??1/0)-(t.span?.end??1/0)||0}var yn=t=>t.filter(e=>e.status!=="superseded"),Ko=(t,e)=>yn(t).filter(n=>(n.status??"open")==="open"==(e==="open"));var Qr=t=>`oklch(from ${t} .8 calc(c * .7) h)`,Gs=(t,e=new Map)=>[...yn(t)].sort((n,r)=>+!!n.target-+!!r.target||(e.get(n.id)??1/0)-(e.get(r.id)??1/0)||vi(n,r)),Gr=class{anchors=new Map;ranks=new Map;reset(){this.anchors.clear(),this.ranks.clear()}order(e,n){let r=!1;for(let o of n)o.range&&!o.finding.target&&!this.anchors.has(o.finding.id)&&(this.anchors.set(o.finding.id,o.range.cloneRange()),r=!0);if(r){let o=e.filter(a=>this.anchors.has(a.id));o.sort((a,i)=>{let l=this.ranks.get(a.id),c=this.ranks.get(i.id);if(l!==void 0&&c!==void 0)return l-c;let d=this.anchors.get(a.id),u=this.anchors.get(i.id);return d.compareBoundaryPoints(0,u)||u.compareBoundaryPoints(2,d)}),o.forEach((a,i)=>this.ranks.set(a.id,i))}return Gs(e,this.ranks)}},Go=(t,e)=>!t.target&&(t.status??"open")==="open"&&!e?"Couldn't find this text on the page.":void 0;function wi(t,e,n){if(t=yn(t),!t.length)return;let r=t.findIndex(a=>a.id===e),o=r<0?n>0?-1:0:r;return t[(o+n+t.length)%t.length]}function Qo(t,e,n){if(t&&t.length){let[r,o]=e,a=Math.PI/180*n,i=Math.cos(a),l=Math.sin(a);for(let c of t){let[d,u]=c;c[0]=(d-r)*i-(u-o)*l+r,c[1]=(d-r)*l+(u-o)*i+o}}}function Qs(t,e){return t[0]===e[0]&&t[1]===e[1]}function Js(t,e,n,r=1){let o=n,a=Math.max(e,.1),i=t[0]&&t[0][0]&&typeof t[0][0]=="number"?[t]:t,l=[0,0];if(o)for(let d of i)Qo(d,l,o);let c=(function(d,u,x){let h=[];for(let R of d){let S=[...R];Qs(S[0],S[S.length-1])||S.push([S[0][0],S[0][1]]),S.length>2&&h.push(S)}let f=[];u=Math.max(u,.1);let y=[];for(let R of h)for(let S=0;S<R.length-1;S++){let L=R[S],$=R[S+1];if(L[1]!==$[1]){let m=Math.min(L[1],$[1]);y.push({ymin:m,ymax:Math.max(L[1],$[1]),x:m===L[1]?L[0]:$[0],islope:($[0]-L[0])/($[1]-L[1])})}}if(y.sort(((R,S)=>R.ymin<S.ymin?-1:R.ymin>S.ymin?1:R.x<S.x?-1:R.x>S.x?1:R.ymax===S.ymax?0:(R.ymax-S.ymax)/Math.abs(R.ymax-S.ymax))),!y.length)return f;let k=[],E=y[0].ymin,A=0;for(;k.length||y.length;){if(y.length){let R=-1;for(let S=0;S<y.length&&!(y[S].ymin>E);S++)R=S;y.splice(0,R+1).forEach((S=>{k.push({s:E,edge:S})}))}if(k=k.filter((R=>!(R.edge.ymax<=E))),k.sort(((R,S)=>R.edge.x===S.edge.x?0:(R.edge.x-S.edge.x)/Math.abs(R.edge.x-S.edge.x))),(x!==1||A%u==0)&&k.length>1)for(let R=0;R<k.length;R+=2){let S=R+1;if(S>=k.length)break;let L=k[R].edge,$=k[S].edge;f.push([[Math.round(L.x),E],[Math.round($.x),E]])}E+=x,k.forEach((R=>{R.edge.x=R.edge.x+x*R.edge.islope})),A++}return f})(i,a,r);if(o){for(let d of i)Qo(d,l,-o);(function(d,u,x){let h=[];d.forEach((f=>h.push(...f))),Qo(h,u,x)})(c,l,-o)}return c}function hr(t,e){var n;let r=e.hachureAngle+90,o=e.hachureGap;o<0&&(o=4*e.strokeWidth),o=Math.round(Math.max(o,.1));let a=1;return e.roughness>=1&&(((n=e.randomizer)===null||n===void 0?void 0:n.next())||Math.random())>.7&&(a=o),Js(t,o,r,a||1)}var ur=class{constructor(e){this.helper=e}fillPolygons(e,n){return this._fillPolygons(e,n)}_fillPolygons(e,n){let r=hr(e,n);return{type:"fillSketch",ops:this.renderLines(r,n)}}renderLines(e,n){let r=[];for(let o of e)r.push(...this.helper.doubleLineOps(o[0][0],o[0][1],o[1][0],o[1][1],n));return r}};function io(t){let e=t[0],n=t[1];return Math.sqrt(Math.pow(e[0]-n[0],2)+Math.pow(e[1]-n[1],2))}var na=class extends ur{fillPolygons(e,n){let r=n.hachureGap;r<0&&(r=4*n.strokeWidth),r=Math.max(r,.1);let o=hr(e,Object.assign({},n,{hachureGap:r})),a=Math.PI/180*n.hachureAngle,i=[],l=.5*r*Math.cos(a),c=.5*r*Math.sin(a);for(let[d,u]of o)io([d,u])&&i.push([[d[0]-l,d[1]+c],[...u]],[[d[0]+l,d[1]-c],[...u]]);return{type:"fillSketch",ops:this.renderLines(i,n)}}},ra=class extends ur{fillPolygons(e,n){let r=this._fillPolygons(e,n),o=Object.assign({},n,{hachureAngle:n.hachureAngle+90}),a=this._fillPolygons(e,o);return r.ops=r.ops.concat(a.ops),r}},oa=class{constructor(e){this.helper=e}fillPolygons(e,n){let r=hr(e,n=Object.assign({},n,{hachureAngle:0}));return this.dotsOnLines(r,n)}dotsOnLines(e,n){let r=[],o=n.hachureGap;o<0&&(o=4*n.strokeWidth),o=Math.max(o,.1);let a=n.fillWeight;a<0&&(a=n.strokeWidth/2);let i=o/4;for(let l of e){let c=io(l),d=c/o,u=Math.ceil(d)-1,x=c-u*o,h=(l[0][0]+l[1][0])/2-o/4,f=Math.min(l[0][1],l[1][1]);for(let y=0;y<u;y++){let k=f+x+y*o,E=h-i+2*Math.random()*i,A=k-i+2*Math.random()*i,R=this.helper.ellipse(E,A,a,a,n);r.push(...R.ops)}}return{type:"fillSketch",ops:r}}},aa=class{constructor(e){this.helper=e}fillPolygons(e,n){let r=hr(e,n);return{type:"fillSketch",ops:this.dashedLine(r,n)}}dashedLine(e,n){let r=n.dashOffset<0?n.hachureGap<0?4*n.strokeWidth:n.hachureGap:n.dashOffset,o=n.dashGap<0?n.hachureGap<0?4*n.strokeWidth:n.hachureGap:n.dashGap,a=[];return e.forEach((i=>{let l=io(i),c=Math.floor(l/(r+o)),d=(l+o-c*(r+o))/2,u=i[0],x=i[1];u[0]>x[0]&&(u=i[1],x=i[0]);let h=Math.atan((x[1]-u[1])/(x[0]-u[0]));for(let f=0;f<c;f++){let y=f*(r+o),k=y+r,E=[u[0]+y*Math.cos(h)+d*Math.cos(h),u[1]+y*Math.sin(h)+d*Math.sin(h)],A=[u[0]+k*Math.cos(h)+d*Math.cos(h),u[1]+k*Math.sin(h)+d*Math.sin(h)];a.push(...this.helper.doubleLineOps(E[0],E[1],A[0],A[1],n))}})),a}},ia=class{constructor(e){this.helper=e}fillPolygons(e,n){let r=n.hachureGap<0?4*n.strokeWidth:n.hachureGap,o=n.zigzagOffset<0?r:n.zigzagOffset,a=hr(e,n=Object.assign({},n,{hachureGap:r+o}));return{type:"fillSketch",ops:this.zigzagLines(a,o,n)}}zigzagLines(e,n,r){let o=[];return e.forEach((a=>{let i=io(a),l=Math.round(i/(2*n)),c=a[0],d=a[1];c[0]>d[0]&&(c=a[1],d=a[0]);let u=Math.atan((d[1]-c[1])/(d[0]-c[0]));for(let x=0;x<l;x++){let h=2*x*n,f=2*(x+1)*n,y=Math.sqrt(2*Math.pow(n,2)),k=[c[0]+h*Math.cos(u),c[1]+h*Math.sin(u)],E=[c[0]+f*Math.cos(u),c[1]+f*Math.sin(u)],A=[k[0]+y*Math.cos(u+Math.PI/4),k[1]+y*Math.sin(u+Math.PI/4)];o.push(...this.helper.doubleLineOps(k[0],k[1],A[0],A[1],r),...this.helper.doubleLineOps(A[0],A[1],E[0],E[1],r))}})),o}},je={},sa=class{constructor(e){this.seed=e}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}},Zs=0,Jo=1,ki=2,Jr={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Zo(t,e){return t.type===e}function ha(t){let e=[],n=(function(i){let l=new Array;for(;i!=="";)if(i.match(/^([ \t\r\n,]+)/))i=i.substr(RegExp.$1.length);else if(i.match(/^([aAcChHlLmMqQsStTvVzZ])/))l[l.length]={type:Zs,text:RegExp.$1},i=i.substr(RegExp.$1.length);else{if(!i.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];l[l.length]={type:Jo,text:`${parseFloat(RegExp.$1)}`},i=i.substr(RegExp.$1.length)}return l[l.length]={type:ki,text:""},l})(t),r="BOD",o=0,a=n[o];for(;!Zo(a,ki);){let i=0,l=[];if(r==="BOD"){if(a.text!=="M"&&a.text!=="m")return ha("M0,0"+t);o++,i=Jr[a.text],r=a.text}else Zo(a,Jo)?i=Jr[r]:(o++,i=Jr[a.text],r=a.text);if(!(o+i<n.length))throw new Error("Path data ended short");for(let c=o;c<o+i;c++){let d=n[c];if(!Zo(d,Jo))throw new Error("Param not a number: "+r+","+d.text);l[l.length]=+d.text}if(typeof Jr[r]!="number")throw new Error("Bad segment: "+r);{let c={key:r,data:l};e.push(c),o+=i,a=n[o],r==="M"&&(r="L"),r==="m"&&(r="l")}}return e}function Li(t){let e=0,n=0,r=0,o=0,a=[];for(let{key:i,data:l}of t)switch(i){case"M":a.push({key:"M",data:[...l]}),[e,n]=l,[r,o]=l;break;case"m":e+=l[0],n+=l[1],a.push({key:"M",data:[e,n]}),r=e,o=n;break;case"L":a.push({key:"L",data:[...l]}),[e,n]=l;break;case"l":e+=l[0],n+=l[1],a.push({key:"L",data:[e,n]});break;case"C":a.push({key:"C",data:[...l]}),e=l[4],n=l[5];break;case"c":{let c=l.map(((d,u)=>u%2?d+n:d+e));a.push({key:"C",data:c}),e=c[4],n=c[5];break}case"Q":a.push({key:"Q",data:[...l]}),e=l[2],n=l[3];break;case"q":{let c=l.map(((d,u)=>u%2?d+n:d+e));a.push({key:"Q",data:c}),e=c[2],n=c[3];break}case"A":a.push({key:"A",data:[...l]}),e=l[5],n=l[6];break;case"a":e+=l[5],n+=l[6],a.push({key:"A",data:[l[0],l[1],l[2],l[3],l[4],e,n]});break;case"H":a.push({key:"H",data:[...l]}),e=l[0];break;case"h":e+=l[0],a.push({key:"H",data:[e]});break;case"V":a.push({key:"V",data:[...l]}),n=l[0];break;case"v":n+=l[0],a.push({key:"V",data:[n]});break;case"S":a.push({key:"S",data:[...l]}),e=l[2],n=l[3];break;case"s":{let c=l.map(((d,u)=>u%2?d+n:d+e));a.push({key:"S",data:c}),e=c[2],n=c[3];break}case"T":a.push({key:"T",data:[...l]}),e=l[0],n=l[1];break;case"t":e+=l[0],n+=l[1],a.push({key:"T",data:[e,n]});break;case"Z":case"z":a.push({key:"Z",data:[]}),e=r,n=o}return a}function Ri(t){let e=[],n="",r=0,o=0,a=0,i=0,l=0,c=0;for(let{key:d,data:u}of t){switch(d){case"M":e.push({key:"M",data:[...u]}),[r,o]=u,[a,i]=u;break;case"C":e.push({key:"C",data:[...u]}),r=u[4],o=u[5],l=u[2],c=u[3];break;case"L":e.push({key:"L",data:[...u]}),[r,o]=u;break;case"H":r=u[0],e.push({key:"L",data:[r,o]});break;case"V":o=u[0],e.push({key:"L",data:[r,o]});break;case"S":{let x=0,h=0;n==="C"||n==="S"?(x=r+(r-l),h=o+(o-c)):(x=r,h=o),e.push({key:"C",data:[x,h,...u]}),l=u[0],c=u[1],r=u[2],o=u[3];break}case"T":{let[x,h]=u,f=0,y=0;n==="Q"||n==="T"?(f=r+(r-l),y=o+(o-c)):(f=r,y=o);let k=r+2*(f-r)/3,E=o+2*(y-o)/3,A=x+2*(f-x)/3,R=h+2*(y-h)/3;e.push({key:"C",data:[k,E,A,R,x,h]}),l=f,c=y,r=x,o=h;break}case"Q":{let[x,h,f,y]=u,k=r+2*(x-r)/3,E=o+2*(h-o)/3,A=f+2*(x-f)/3,R=y+2*(h-y)/3;e.push({key:"C",data:[k,E,A,R,f,y]}),l=x,c=h,r=f,o=y;break}case"A":{let x=Math.abs(u[0]),h=Math.abs(u[1]),f=u[2],y=u[3],k=u[4],E=u[5],A=u[6];x===0||h===0?(e.push({key:"C",data:[r,o,E,A,E,A]}),r=E,o=A):(r!==E||o!==A)&&($i(r,o,E,A,x,h,f,y,k).forEach((function(R){e.push({key:"C",data:R})})),r=E,o=A);break}case"Z":e.push({key:"Z",data:[]}),r=a,o=i}n=d}return e}function cr(t,e,n){return[t*Math.cos(n)-e*Math.sin(n),t*Math.sin(n)+e*Math.cos(n)]}function $i(t,e,n,r,o,a,i,l,c,d){let u=(x=i,Math.PI*x/180);var x;let h=[],f=0,y=0,k=0,E=0;if(d)[f,y,k,E]=d;else{[t,e]=cr(t,e,-u),[n,r]=cr(n,r,-u);let le=(t-n)/2,j=(e-r)/2,Z=le*le/(o*o)+j*j/(a*a);Z>1&&(Z=Math.sqrt(Z),o*=Z,a*=Z);let he=o*o,fe=a*a,Be=he*fe-he*j*j-fe*le*le,Ee=he*j*j+fe*le*le,q=(l===c?-1:1)*Math.sqrt(Math.abs(Be/Ee));k=q*o*j/a+(t+n)/2,E=q*-a*le/o+(e+r)/2,f=Math.asin(parseFloat(((e-E)/a).toFixed(9))),y=Math.asin(parseFloat(((r-E)/a).toFixed(9))),t<k&&(f=Math.PI-f),n<k&&(y=Math.PI-y),f<0&&(f=2*Math.PI+f),y<0&&(y=2*Math.PI+y),c&&f>y&&(f-=2*Math.PI),!c&&y>f&&(y-=2*Math.PI)}let A=y-f;if(Math.abs(A)>120*Math.PI/180){let le=y,j=n,Z=r;y=c&&y>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,h=$i(n=k+o*Math.cos(y),r=E+a*Math.sin(y),j,Z,o,a,i,0,c,[y,le,k,E])}A=y-f;let R=Math.cos(f),S=Math.sin(f),L=Math.cos(y),$=Math.sin(y),m=Math.tan(A/4),M=4/3*o*m,Y=4/3*a*m,O=[t,e],J=[t+M*S,e-Y*R],re=[n+M*$,r-Y*L],se=[n,r];if(J[0]=2*O[0]-J[0],J[1]=2*O[1]-J[1],d)return[J,re,se].concat(h);{h=[J,re,se].concat(h);let le=[];for(let j=0;j<h.length;j+=3){let Z=cr(h[j][0],h[j][1],u),he=cr(h[j+1][0],h[j+1][1],u),fe=cr(h[j+2][0],h[j+2][1],u);le.push([Z[0],Z[1],he[0],he[1],fe[0],fe[1]])}return le}}var el={randOffset:function(t,e){return V(t,e)},randOffsetWithRange:function(t,e,n){return ro(t,e,n)},ellipse:function(t,e,n,r,o){let a=Oi(n,r,o);return la(t,e,o,a).opset},doubleLineOps:function(t,e,n,r,o){return on(t,e,n,r,o,!0)}};function Ni(t,e,n,r,o){return{type:"path",ops:on(t,e,n,r,o)}}function to(t,e,n){let r=(t||[]).length;if(r>2){let o=[];for(let a=0;a<r-1;a++)o.push(...on(t[a][0],t[a][1],t[a+1][0],t[a+1][1],n));return e&&o.push(...on(t[r-1][0],t[r-1][1],t[0][0],t[0][1],n)),{type:"path",ops:o}}return r===2?Ni(t[0][0],t[0][1],t[1][0],t[1][1],n):{type:"path",ops:[]}}function tl(t,e,n,r,o){return(function(a,i){return to(a,!0,i)})([[t,e],[t+n,e],[t+n,e+r],[t,e+r]],o)}function Mi(t,e){if(t.length){let n=typeof t[0][0]=="number"?[t]:t,r=Zr(n[0],1*(1+.2*e.roughness),e),o=e.disableMultiStroke?[]:Zr(n[0],1.5*(1+.22*e.roughness),Si(e));for(let a=1;a<n.length;a++){let i=n[a];if(i.length){let l=Zr(i,1*(1+.2*e.roughness),e),c=e.disableMultiStroke?[]:Zr(i,1.5*(1+.22*e.roughness),Si(e));for(let d of l)d.op!=="move"&&r.push(d);for(let d of c)d.op!=="move"&&o.push(d)}}return{type:"path",ops:r.concat(o)}}return{type:"path",ops:[]}}function Oi(t,e,n){let r=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),o=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*r)),a=2*Math.PI/o,i=Math.abs(t/2),l=Math.abs(e/2),c=1-n.curveFitting;return i+=V(i*c,n),l+=V(l*c,n),{increment:a,rx:i,ry:l}}function la(t,e,n,r){let[o,a]=Pi(r.increment,t,e,r.rx,r.ry,1,r.increment*ro(.1,ro(.4,1,n),n),n),i=oo(o,null,n);if(!n.disableMultiStroke&&n.roughness!==0){let[l]=Pi(r.increment,t,e,r.rx,r.ry,1.5,0,n),c=oo(l,null,n);i=i.concat(c)}return{estimatedPoints:a,opset:{type:"path",ops:i}}}function Ei(t,e,n,r,o,a,i,l,c){let d=t,u=e,x=Math.abs(n/2),h=Math.abs(r/2);x+=V(.01*x,c),h+=V(.01*h,c);let f=o,y=a;for(;f<0;)f+=2*Math.PI,y+=2*Math.PI;y-f>2*Math.PI&&(f=0,y=2*Math.PI);let k=2*Math.PI/c.curveStepCount,E=Math.min(k/2,(y-f)/2),A=Ai(E,d,u,x,h,f,y,1,c);if(!c.disableMultiStroke){let R=Ai(E,d,u,x,h,f,y,1.5,c);A.push(...R)}return i&&(l?A.push(...on(d,u,d+x*Math.cos(f),u+h*Math.sin(f),c),...on(d,u,d+x*Math.cos(y),u+h*Math.sin(y),c)):A.push({op:"lineTo",data:[d,u]},{op:"lineTo",data:[d+x*Math.cos(f),u+h*Math.sin(f)]})),{type:"path",ops:A}}function Ci(t,e){let n=Ri(Li(ha(t))),r=[],o=[0,0],a=[0,0];for(let{key:i,data:l}of n)switch(i){case"M":a=[l[0],l[1]],o=[l[0],l[1]];break;case"L":r.push(...on(a[0],a[1],l[0],l[1],e)),a=[l[0],l[1]];break;case"C":{let[c,d,u,x,h,f]=l;r.push(...nl(c,d,u,x,h,f,a,e)),a=[h,f];break}case"Z":r.push(...on(a[0],a[1],o[0],o[1],e)),a=[o[0],o[1]]}return{type:"path",ops:r}}function ea(t,e){let n=[];for(let r of t)if(r.length){let o=e.maxRandomnessOffset||0,a=r.length;if(a>2){n.push({op:"move",data:[r[0][0]+V(o,e),r[0][1]+V(o,e)]});for(let i=1;i<a;i++)n.push({op:"lineTo",data:[r[i][0]+V(o,e),r[i][1]+V(o,e)]})}}return{type:"fillPath",ops:n}}function Hn(t,e){return(function(n,r){let o=n.fillStyle||"hachure";if(!je[o])switch(o){case"zigzag":je[o]||(je[o]=new na(r));break;case"cross-hatch":je[o]||(je[o]=new ra(r));break;case"dots":je[o]||(je[o]=new oa(r));break;case"dashed":je[o]||(je[o]=new aa(r));break;case"zigzag-line":je[o]||(je[o]=new ia(r));break;default:o="hachure",je[o]||(je[o]=new ur(r))}return je[o]})(e,el).fillPolygons(t,e)}function Si(t){let e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}function Di(t){return t.randomizer||(t.randomizer=new sa(t.seed||0)),t.randomizer.next()}function ro(t,e,n,r=1){return n.roughness*r*(Di(n)*(e-t)+t)}function V(t,e,n=1){return ro(-t,t,e,n)}function on(t,e,n,r,o,a=!1){let i=a?o.disableMultiStrokeFill:o.disableMultiStroke,l=da(t,e,n,r,o,!0,!1);if(i)return l;let c=da(t,e,n,r,o,!0,!0);return l.concat(c)}function da(t,e,n,r,o,a,i){let l=Math.pow(t-n,2)+Math.pow(e-r,2),c=Math.sqrt(l),d=1;d=c<200?1:c>500?.4:-.0016668*c+1.233334;let u=o.maxRandomnessOffset||0;u*u*100>l&&(u=c/10);let x=u/2,h=.2+.2*Di(o),f=o.bowing*o.maxRandomnessOffset*(r-e)/200,y=o.bowing*o.maxRandomnessOffset*(t-n)/200;f=V(f,o,d),y=V(y,o,d);let k=[],E=()=>V(x,o,d),A=()=>V(u,o,d),R=o.preserveVertices;return a&&(i?k.push({op:"move",data:[t+(R?0:E()),e+(R?0:E())]}):k.push({op:"move",data:[t+(R?0:V(u,o,d)),e+(R?0:V(u,o,d))]})),i?k.push({op:"bcurveTo",data:[f+t+(n-t)*h+E(),y+e+(r-e)*h+E(),f+t+2*(n-t)*h+E(),y+e+2*(r-e)*h+E(),n+(R?0:E()),r+(R?0:E())]}):k.push({op:"bcurveTo",data:[f+t+(n-t)*h+A(),y+e+(r-e)*h+A(),f+t+2*(n-t)*h+A(),y+e+2*(r-e)*h+A(),n+(R?0:A()),r+(R?0:A())]}),k}function Zr(t,e,n){if(!t.length)return[];let r=[];r.push([t[0][0]+V(e,n),t[0][1]+V(e,n)]),r.push([t[0][0]+V(e,n),t[0][1]+V(e,n)]);for(let o=1;o<t.length;o++)r.push([t[o][0]+V(e,n),t[o][1]+V(e,n)]),o===t.length-1&&r.push([t[o][0]+V(e,n),t[o][1]+V(e,n)]);return oo(r,null,n)}function oo(t,e,n){let r=t.length,o=[];if(r>3){let a=[],i=1-n.curveTightness;o.push({op:"move",data:[t[1][0],t[1][1]]});for(let l=1;l+2<r;l++){let c=t[l];a[0]=[c[0],c[1]],a[1]=[c[0]+(i*t[l+1][0]-i*t[l-1][0])/6,c[1]+(i*t[l+1][1]-i*t[l-1][1])/6],a[2]=[t[l+1][0]+(i*t[l][0]-i*t[l+2][0])/6,t[l+1][1]+(i*t[l][1]-i*t[l+2][1])/6],a[3]=[t[l+1][0],t[l+1][1]],o.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(e&&e.length===2){let l=n.maxRandomnessOffset;o.push({op:"lineTo",data:[e[0]+V(l,n),e[1]+V(l,n)]})}}else r===3?(o.push({op:"move",data:[t[1][0],t[1][1]]}),o.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):r===2&&o.push(...da(t[0][0],t[0][1],t[1][0],t[1][1],n,!0,!0));return o}function Pi(t,e,n,r,o,a,i,l){let c=[],d=[];if(l.roughness===0){t/=4,d.push([e+r*Math.cos(-t),n+o*Math.sin(-t)]);for(let u=0;u<=2*Math.PI;u+=t){let x=[e+r*Math.cos(u),n+o*Math.sin(u)];c.push(x),d.push(x)}d.push([e+r*Math.cos(0),n+o*Math.sin(0)]),d.push([e+r*Math.cos(t),n+o*Math.sin(t)])}else{let u=V(.5,l)-Math.PI/2;d.push([V(a,l)+e+.9*r*Math.cos(u-t),V(a,l)+n+.9*o*Math.sin(u-t)]);let x=2*Math.PI+u-.01;for(let h=u;h<x;h+=t){let f=[V(a,l)+e+r*Math.cos(h),V(a,l)+n+o*Math.sin(h)];c.push(f),d.push(f)}d.push([V(a,l)+e+r*Math.cos(u+2*Math.PI+.5*i),V(a,l)+n+o*Math.sin(u+2*Math.PI+.5*i)]),d.push([V(a,l)+e+.98*r*Math.cos(u+i),V(a,l)+n+.98*o*Math.sin(u+i)]),d.push([V(a,l)+e+.9*r*Math.cos(u+.5*i),V(a,l)+n+.9*o*Math.sin(u+.5*i)])}return[d,c]}function Ai(t,e,n,r,o,a,i,l,c){let d=a+V(.1,c),u=[];u.push([V(l,c)+e+.9*r*Math.cos(d-t),V(l,c)+n+.9*o*Math.sin(d-t)]);for(let x=d;x<=i;x+=t)u.push([V(l,c)+e+r*Math.cos(x),V(l,c)+n+o*Math.sin(x)]);return u.push([e+r*Math.cos(i),n+o*Math.sin(i)]),u.push([e+r*Math.cos(i),n+o*Math.sin(i)]),oo(u,null,c)}function nl(t,e,n,r,o,a,i,l){let c=[],d=[l.maxRandomnessOffset||1,(l.maxRandomnessOffset||1)+.3],u=[0,0],x=l.disableMultiStroke?1:2,h=l.preserveVertices;for(let f=0;f<x;f++)f===0?c.push({op:"move",data:[i[0],i[1]]}):c.push({op:"move",data:[i[0]+(h?0:V(d[0],l)),i[1]+(h?0:V(d[0],l))]}),u=h?[o,a]:[o+V(d[f],l),a+V(d[f],l)],c.push({op:"bcurveTo",data:[t+V(d[f],l),e+V(d[f],l),n+V(d[f],l),r+V(d[f],l),u[0],u[1]]});return c}function pr(t){return[...t]}function Ti(t,e=0){let n=t.length;if(n<3)throw new Error("A curve must have at least three points.");let r=[];if(n===3)r.push(pr(t[0]),pr(t[1]),pr(t[2]),pr(t[2]));else{let o=[];o.push(t[0],t[0]);for(let l=1;l<t.length;l++)o.push(t[l]),l===t.length-1&&o.push(t[l]);let a=[],i=1-e;r.push(pr(o[0]));for(let l=1;l+2<o.length;l++){let c=o[l];a[0]=[c[0],c[1]],a[1]=[c[0]+(i*o[l+1][0]-i*o[l-1][0])/6,c[1]+(i*o[l+1][1]-i*o[l-1][1])/6],a[2]=[o[l+1][0]+(i*o[l][0]-i*o[l+2][0])/6,o[l+1][1]+(i*o[l][1]-i*o[l+2][1])/6],a[3]=[o[l+1][0],o[l+1][1]],r.push(a[1],a[2],a[3])}}return r}function no(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function rl(t,e,n){let r=no(e,n);if(r===0)return no(t,e);let o=((t[0]-e[0])*(n[0]-e[0])+(t[1]-e[1])*(n[1]-e[1]))/r;return o=Math.max(0,Math.min(1,o)),no(t,vn(e,n,o))}function vn(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function ca(t,e,n,r){let o=r||[];if((function(l,c){let d=l[c+0],u=l[c+1],x=l[c+2],h=l[c+3],f=3*u[0]-2*d[0]-h[0];f*=f;let y=3*u[1]-2*d[1]-h[1];y*=y;let k=3*x[0]-2*h[0]-d[0];k*=k;let E=3*x[1]-2*h[1]-d[1];return E*=E,f<k&&(f=k),y<E&&(y=E),f+y})(t,e)<n){let l=t[e+0];o.length?(a=o[o.length-1],i=l,Math.sqrt(no(a,i))>1&&o.push(l)):o.push(l),o.push(t[e+3])}else{let c=t[e+0],d=t[e+1],u=t[e+2],x=t[e+3],h=vn(c,d,.5),f=vn(d,u,.5),y=vn(u,x,.5),k=vn(h,f,.5),E=vn(f,y,.5),A=vn(k,E,.5);ca([c,h,k,A],0,n,o),ca([A,E,y,x],0,n,o)}var a,i;return o}function ol(t,e){return ao(t,0,t.length,e)}function ao(t,e,n,r,o){let a=o||[],i=t[e],l=t[n-1],c=0,d=1;for(let u=e+1;u<n-1;++u){let x=rl(t[u],i,l);x>c&&(c=x,d=u)}return Math.sqrt(c)>r?(ao(t,e,d+1,r,a),ao(t,d,n,r,a)):(a.length||a.push(i),a.push(l)),a}function ta(t,e=.15,n){let r=[],o=(t.length-1)/3;for(let a=0;a<o;a++)ca(t,3*a,e,r);return n&&n>0?ao(r,0,r.length,n):r}var Ge="none",jn=class{constructor(e){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(e){return e?Object.assign({},this.defaultOptions,e):this.defaultOptions}_d(e,n,r){return{shape:e,sets:n||[],options:r||this.defaultOptions}}line(e,n,r,o,a){let i=this._o(a);return this._d("line",[Ni(e,n,r,o,i)],i)}rectangle(e,n,r,o,a){let i=this._o(a),l=[],c=tl(e,n,r,o,i);if(i.fill){let d=[[e,n],[e+r,n],[e+r,n+o],[e,n+o]];i.fillStyle==="solid"?l.push(ea([d],i)):l.push(Hn([d],i))}return i.stroke!==Ge&&l.push(c),this._d("rectangle",l,i)}ellipse(e,n,r,o,a){let i=this._o(a),l=[],c=Oi(r,o,i),d=la(e,n,i,c);if(i.fill)if(i.fillStyle==="solid"){let u=la(e,n,i,c).opset;u.type="fillPath",l.push(u)}else l.push(Hn([d.estimatedPoints],i));return i.stroke!==Ge&&l.push(d.opset),this._d("ellipse",l,i)}circle(e,n,r,o){let a=this.ellipse(e,n,r,r,o);return a.shape="circle",a}linearPath(e,n){let r=this._o(n);return this._d("linearPath",[to(e,!1,r)],r)}arc(e,n,r,o,a,i,l=!1,c){let d=this._o(c),u=[],x=Ei(e,n,r,o,a,i,l,!0,d);if(l&&d.fill)if(d.fillStyle==="solid"){let h=Object.assign({},d);h.disableMultiStroke=!0;let f=Ei(e,n,r,o,a,i,!0,!1,h);f.type="fillPath",u.push(f)}else u.push((function(h,f,y,k,E,A,R){let S=h,L=f,$=Math.abs(y/2),m=Math.abs(k/2);$+=V(.01*$,R),m+=V(.01*m,R);let M=E,Y=A;for(;M<0;)M+=2*Math.PI,Y+=2*Math.PI;Y-M>2*Math.PI&&(M=0,Y=2*Math.PI);let O=(Y-M)/R.curveStepCount,J=[];for(let re=M;re<=Y;re+=O)J.push([S+$*Math.cos(re),L+m*Math.sin(re)]);return J.push([S+$*Math.cos(Y),L+m*Math.sin(Y)]),J.push([S,L]),Hn([J],R)})(e,n,r,o,a,i,d));return d.stroke!==Ge&&u.push(x),this._d("arc",u,d)}curve(e,n){let r=this._o(n),o=[],a=Mi(e,r);if(r.fill&&r.fill!==Ge)if(r.fillStyle==="solid"){let i=Mi(e,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(i.ops)})}else{let i=[],l=e;if(l.length){let c=typeof l[0][0]=="number"?[l]:l;for(let d of c)d.length<3?i.push(...d):d.length===3?i.push(...ta(Ti([d[0],d[0],d[1],d[2]]),10,(1+r.roughness)/2)):i.push(...ta(Ti(d),10,(1+r.roughness)/2))}i.length&&o.push(Hn([i],r))}return r.stroke!==Ge&&o.push(a),this._d("curve",o,r)}polygon(e,n){let r=this._o(n),o=[],a=to(e,!0,r);return r.fill&&(r.fillStyle==="solid"?o.push(ea([e],r)):o.push(Hn([e],r))),r.stroke!==Ge&&o.push(a),this._d("polygon",o,r)}path(e,n){let r=this._o(n),o=[];if(!e)return this._d("path",o,r);e=(e||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");let a=r.fill&&r.fill!=="transparent"&&r.fill!==Ge,i=r.stroke!==Ge,l=!!(r.simplification&&r.simplification<1),c=(function(u,x,h){let f=Ri(Li(ha(u))),y=[],k=[],E=[0,0],A=[],R=()=>{A.length>=4&&k.push(...ta(A,x)),A=[]},S=()=>{R(),k.length&&(y.push(k),k=[])};for(let{key:$,data:m}of f)switch($){case"M":S(),E=[m[0],m[1]],k.push(E);break;case"L":R(),k.push([m[0],m[1]]);break;case"C":if(!A.length){let M=k.length?k[k.length-1]:E;A.push([M[0],M[1]])}A.push([m[0],m[1]]),A.push([m[2],m[3]]),A.push([m[4],m[5]]);break;case"Z":R(),k.push([E[0],E[1]])}if(S(),!h)return y;let L=[];for(let $ of y){let m=ol($,h);m.length&&L.push(m)}return L})(e,1,l?4-4*(r.simplification||1):(1+r.roughness)/2),d=Ci(e,r);if(a)if(r.fillStyle==="solid")if(c.length===1){let u=Ci(e,Object.assign(Object.assign({},r),{disableMultiStroke:!0,roughness:r.roughness?r.roughness+r.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(u.ops)})}else o.push(ea(c,r));else o.push(Hn(c,r));return i&&(l?c.forEach((u=>{o.push(to(u,!1,r))})):o.push(d)),this._d("path",o,r)}opsToPath(e,n){let r="";for(let o of e.ops){let a=typeof n=="number"&&n>=0?o.data.map((i=>+i.toFixed(n))):o.data;switch(o.op){case"move":r+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":r+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":r+=`L${a[0]} ${a[1]} `}}return r.trim()}toPaths(e){let n=e.sets||[],r=e.options||this.defaultOptions,o=[];for(let a of n){let i=null;switch(a.type){case"path":i={d:this.opsToPath(a),stroke:r.stroke,strokeWidth:r.strokeWidth,fill:Ge};break;case"fillPath":i={d:this.opsToPath(a),stroke:Ge,strokeWidth:0,fill:r.fill||Ge};break;case"fillSketch":i=this.fillSketch(a,r)}i&&o.push(i)}return o}fillSketch(e,n){let r=n.fillWeight;return r<0&&(r=n.strokeWidth/2),{d:this.opsToPath(e),stroke:n.fill||Ge,strokeWidth:r,fill:Ge}}_mergedShape(e){return e.filter(((n,r)=>r===0||n.op!=="move"))}},pa=class{constructor(e,n){this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new jn(n)}draw(e){let n=e.sets||[],r=e.options||this.getDefaultOptions(),o=this.ctx,a=e.options.fixedDecimalPlaceDigits;for(let i of n)switch(i.type){case"path":o.save(),o.strokeStyle=r.stroke==="none"?"transparent":r.stroke,o.lineWidth=r.strokeWidth,r.strokeLineDash&&o.setLineDash(r.strokeLineDash),r.strokeLineDashOffset&&(o.lineDashOffset=r.strokeLineDashOffset),this._drawToContext(o,i,a),o.restore();break;case"fillPath":{o.save(),o.fillStyle=r.fill||"";let l=e.shape==="curve"||e.shape==="polygon"||e.shape==="path"?"evenodd":"nonzero";this._drawToContext(o,i,a,l),o.restore();break}case"fillSketch":this.fillSketch(o,i,r)}}fillSketch(e,n,r){let o=r.fillWeight;o<0&&(o=r.strokeWidth/2),e.save(),r.fillLineDash&&e.setLineDash(r.fillLineDash),r.fillLineDashOffset&&(e.lineDashOffset=r.fillLineDashOffset),e.strokeStyle=r.fill||"",e.lineWidth=o,this._drawToContext(e,n,r.fixedDecimalPlaceDigits),e.restore()}_drawToContext(e,n,r,o="nonzero"){e.beginPath();for(let a of n.ops){let i=typeof r=="number"&&r>=0?a.data.map((l=>+l.toFixed(r))):a.data;switch(a.op){case"move":e.moveTo(i[0],i[1]);break;case"bcurveTo":e.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5]);break;case"lineTo":e.lineTo(i[0],i[1])}}n.type==="fillPath"?e.fill(o):e.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(e,n,r,o,a){let i=this.gen.line(e,n,r,o,a);return this.draw(i),i}rectangle(e,n,r,o,a){let i=this.gen.rectangle(e,n,r,o,a);return this.draw(i),i}ellipse(e,n,r,o,a){let i=this.gen.ellipse(e,n,r,o,a);return this.draw(i),i}circle(e,n,r,o){let a=this.gen.circle(e,n,r,o);return this.draw(a),a}linearPath(e,n){let r=this.gen.linearPath(e,n);return this.draw(r),r}polygon(e,n){let r=this.gen.polygon(e,n);return this.draw(r),r}arc(e,n,r,o,a,i,l=!1,c){let d=this.gen.arc(e,n,r,o,a,i,l,c);return this.draw(d),d}curve(e,n){let r=this.gen.curve(e,n);return this.draw(r),r}path(e,n){let r=this.gen.path(e,n);return this.draw(r),r}},eo="http://www.w3.org/2000/svg",ua=class{constructor(e,n){this.svg=e,this.gen=new jn(n)}draw(e){let n=e.sets||[],r=e.options||this.getDefaultOptions(),o=this.svg.ownerDocument||window.document,a=o.createElementNS(eo,"g"),i=e.options.fixedDecimalPlaceDigits;for(let l of n){let c=null;switch(l.type){case"path":c=o.createElementNS(eo,"path"),c.setAttribute("d",this.opsToPath(l,i)),c.setAttribute("stroke",r.stroke),c.setAttribute("stroke-width",r.strokeWidth+""),c.setAttribute("fill","none"),r.strokeLineDash&&c.setAttribute("stroke-dasharray",r.strokeLineDash.join(" ").trim()),r.strokeLineDashOffset&&c.setAttribute("stroke-dashoffset",`${r.strokeLineDashOffset}`);break;case"fillPath":c=o.createElementNS(eo,"path"),c.setAttribute("d",this.opsToPath(l,i)),c.setAttribute("stroke","none"),c.setAttribute("stroke-width","0"),c.setAttribute("fill",r.fill||""),e.shape!=="curve"&&e.shape!=="polygon"||c.setAttribute("fill-rule","evenodd");break;case"fillSketch":c=this.fillSketch(o,l,r)}c&&a.appendChild(c)}return a}fillSketch(e,n,r){let o=r.fillWeight;o<0&&(o=r.strokeWidth/2);let a=e.createElementNS(eo,"path");return a.setAttribute("d",this.opsToPath(n,r.fixedDecimalPlaceDigits)),a.setAttribute("stroke",r.fill||""),a.setAttribute("stroke-width",o+""),a.setAttribute("fill","none"),r.fillLineDash&&a.setAttribute("stroke-dasharray",r.fillLineDash.join(" ").trim()),r.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${r.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(e,n){return this.gen.opsToPath(e,n)}line(e,n,r,o,a){let i=this.gen.line(e,n,r,o,a);return this.draw(i)}rectangle(e,n,r,o,a){let i=this.gen.rectangle(e,n,r,o,a);return this.draw(i)}ellipse(e,n,r,o,a){let i=this.gen.ellipse(e,n,r,o,a);return this.draw(i)}circle(e,n,r,o){let a=this.gen.circle(e,n,r,o);return this.draw(a)}linearPath(e,n){let r=this.gen.linearPath(e,n);return this.draw(r)}polygon(e,n){let r=this.gen.polygon(e,n);return this.draw(r)}arc(e,n,r,o,a,i,l=!1,c){let d=this.gen.arc(e,n,r,o,a,i,l,c);return this.draw(d)}curve(e,n){let r=this.gen.curve(e,n);return this.draw(r)}path(e,n){let r=this.gen.path(e,n);return this.draw(r)}},In={canvas:(t,e)=>new pa(t,e),svg:(t,e)=>new ua(t,e),generator:t=>new jn(t),newSeed:()=>jn.newSeed()};function fr(t){let e=t.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("aria-hidden","true");let n=[["M18.9 4.6C15.5 3.2 9 3.7 6.1 6.5C3.8 8.6 3.6 11.6 5.7 13.1C8 14.7 12.4 14.2 16.6 12.5","2.05"],["M15.6 4.2C15.2 8.9 14.5 15.2 14 20.2","2.1"],["M18.9 4.6C18.5 9.1 18 14.8 17.5 19.6","1.95"]];for(let[r,o]of n){let a=t.createElementNS(e.namespaceURI,"path");a.setAttribute("d",r),a.setAttribute("fill","none"),a.setAttribute("stroke","currentColor"),a.setAttribute("stroke-width",o),a.setAttribute("stroke-linecap","round"),a.setAttribute("stroke-linejoin","round"),e.append(a)}return e}function zi(t){let{doc:e,win:n}=t,r="cubic-bezier(.22,1,.36,1)",o,a="",i=!0,l=!0,c=!1,d=[],u=!1,x=!1,h,f=-1/0,y=0,k=[],E,A,R=[],S=e.createElement("div");S.className="pill",S.setAttribute("role","group"),S.setAttribute("aria-label","Proofmarks"),S.setAttribute("aria-expanded","false");let L=e.createElement("span");L.className="pill-surface",L.setAttribute("aria-hidden","true");let $=e.createElement("div");$.className="pill-content";let m=(q,oe)=>{let N=e.createElement("button");return N.type="button",N.setAttribute("aria-label",q),N.addEventListener("click",oe),N},M=m("Expand Proofmarks badge",t.open);M.className="pill-mark",M.append(fr(e));let Y=m("Open writing review",t.open);Y.className="pill-count";let O=e.createElement("span");O.className="badge",O.setAttribute("aria-hidden","true"),Y.append(O);let J=e.createElement("span");J.className="notification-dot",J.setAttribute("aria-hidden","true"),J.hidden=!0;let re=e.createElement("span");re.className="completion-badge-check",re.hidden=!0,re.setAttribute("aria-hidden","true"),re.innerHTML='<svg viewBox="0 0 16 16"><path d="M4.5 8 7 10.5 11.5 5.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>';let se=e.createElement("div");se.className="pill-clip",$.append(M,Y),se.append(L,$),S.append(se,J,re);function le(){return t.reduced.matches}function j(q){A?.cancel(),A=void 0,re.hidden=!(l&&c);let oe=!c&&l&&i&&!u&&(h??0)>0;J.hidden=!oe,oe&&q&&!le()&&(A=J.animate([{transform:"scale(0)"},{transform:"scale(1)"}],{duration:140,delay:0,easing:r,fill:"backwards"}))}function Z(q){if(x)return;let oe=i||u?44:Math.ceil($.getBoundingClientRect().width);if(!oe||oe===y)return;let N=y>0,B=S.getBoundingClientRect().width||oe;E?.cancel(),E=void 0,y=oe,S.style.width=`${oe}px`,N&&q&&!le()&&B!==oe&&(E=S.animate([{width:`${B}px`},{width:`${oe}px`}],{duration:i?150:220,easing:r})),t.geometry()}function he(){let q=i||u;S.dataset.circle=String(q),S.dataset.panel=String(u),S.dataset.muted=String(!l),Y.inert=q,M.inert=!1,M.setAttribute("aria-label",u?"Proofmarks, close writing review":t.touch()?"Proofmarks, open writing review":q?o?`Proofmarks, ${a.charAt(0).toLowerCase()}${a.slice(1)}`:`Proofmarks, open review, ${h?`${h} ${h===1?"proof":"proofs"}`:"all reviewed"}`:"Open writing review"),S.setAttribute("aria-expanded",String(u))}function fe(q){if(u||i===q)return;let oe=n.getComputedStyle(Y).opacity;k.forEach(N=>N.cancel()),k=[],i=q,he(),Z(!0),j(!0),le()||(k=[Y.animate([{opacity:oe},{opacity:q?0:1}],{duration:q?150:220,easing:r})])}function Be(){d.forEach(q=>q.cancel()),d=[],k.forEach(q=>q.cancel()),E?.cancel(),A?.cancel(),R.forEach(q=>q.cancel()),R=[],O.querySelector(".outgoing")?.remove(),Z(!1),j(!1),t.geometry()}let Ee=new ResizeObserver(()=>Z(!0));return Ee.observe($),he(),S.style.width=i?"44px":"150px",{element:S,mark:M,countButton:Y,setCircle:fe,prompt(q,oe){o!==q&&(o=q,a=oe??q??"",he(),S.dataset.prompt=String(!!q),Y.style.minWidth="",h=void 0,q&&(O.textContent=q,Y.setAttribute("aria-label",oe??q),t.touch()&&fe(!1),J.hidden=!0,Z(!1)))},isMorphing:()=>E?.playState==="running",setCompleted(q,oe=!1){c===q&&!oe||(d.forEach(N=>N.cancel()),d=[],c=q,j(!1),q&&oe&&!t.reduced.matches&&(J.hidden=!1,d=[J.animate([{opacity:1,transform:"scale(1)"},{opacity:0,transform:"scale(.65)"}],{duration:180}),re.animate([{opacity:0,transform:"scale(.65)"},{opacity:1,transform:"scale(1)"}],{duration:180,easing:r})],d[0].onfinish=()=>{J.hidden=!0}))},setEnabled(q){l=q,he(),j(!1)},update(q,oe){if(o)return;let N=n.performance.now();if(Y.setAttribute("aria-label",`Open writing review: ${oe}`),h===q)return;R.forEach(Q=>Q.cancel()),R=[],O.replaceChildren();let B=e.createElement("span");B.className="count",B.textContent=q?String(q):"";let W=e.createElement("span");if(W.textContent=q?q===1?"proof":"proofs":"All reviewed",O.append(B,W),B.hidden=q===0,h!==void 0&&!le()&&N-f>220){let Q=e.createElement("span");Q.className="outgoing",Q.textContent=h?String(h):"",O.append(Q),R.push(B.animate([{transform:"translateY(8px)",filter:"blur(2px)",opacity:0},{transform:"translateY(0)",filter:"blur(0px)",opacity:1}],{duration:220,easing:r})),q===0&&R.push(W.animate([{opacity:0},{opacity:1}],{duration:150,easing:r}));let H=Q.animate([{transform:"translateY(0)",filter:"blur(0px)",opacity:1},{transform:"translateY(-12px)",filter:"blur(2px)",opacity:0}],{duration:150,easing:r});H.onfinish=()=>Q.remove(),R.push(H)}let ie=h!==void 0&&!h;h=q,f=N,he(),j(ie&&q>0),Z(!0)},setExpanded(q){u=q,i=!0,k.forEach(oe=>oe.cancel()),k=[],E?.cancel(),E=void 0,he(),Z(!1),j(!1)},focus(){M.focus({preventScroll:!0})},settle:Be,destroy(){d.forEach(q=>q.cancel()),x=!0,Ee.disconnect(),k.forEach(q=>q.cancel()),E?.cancel(),A?.cancel(),R.forEach(q=>q.cancel())}}}function an(t){t=yn(t);let e=t.filter(n=>n.status==="accepted"||n.status==="accepted-unrecorded"||n.status==="dismissed").length;return{reviewed:e,complete:t.length>0&&e===t.length,announcement:`All ${e} ${e===1?"proof":"proofs"} reviewed`}}function al(){let t=!1;return{complete(){t=!0},reset(){t=!1},consume(e){let n=t&&!e;return t=!1,n}}}function Bi(t){let{doc:e,win:n}=t,r=`proofmarks:completion:${t.source}`,o,a=[];try{t.persistent!==!1&&(n.localStorage.removeItem("proofmarks:done-style"),o=JSON.parse(n.localStorage.getItem(r)??"null")?.id)}catch{}let i=al(),l=e.createElement("div");l.className="completion",l.hidden=!0;let c=e.createElement("div");c.className="completion-art",c.setAttribute("aria-hidden","true"),l.append(c);let d=e.createElement("div");d.className="completion-sign";let u=fr(e);u.classList.add("completion-pilcrow");let x=u.querySelector("path");x.setAttribute("d","M16.5416 3.9912C13.044 3.492 8.42 4.26 6.1 6.5C3.8 8.6 3.6 11.6 5.7 13.1C8 14.7 12.4 14.2 16.6 12.5");let h=x.cloneNode();h.setAttribute("d","M18.9 4.6C18.22 4.32 17.416 4.116 16.5416 3.9912"),u.append(h),d.append(u);let f=e.createElementNS("http://www.w3.org/2000/svg","svg");f.setAttribute("viewBox","0 0 70 64"),f.classList.add("completion-sign-check"),f.append(In.svg(f).path("M8 34 C15 39 19 45 24 50 C34 32 48 17 61 9",{seed:8517,stroke:"currentColor",strokeWidth:3,roughness:.55,disableMultiStroke:!0})),d.append(f);let y=e.createElement("div");y.className="completion-caption",y.textContent="All reviewed",d.append(y),c.append(d);let k=e.createElement("span");k.className="completion-equivalent",l.append(k);let E=e.createElement("button");E.type="button",E.className="completion-undo",E.textContent="Undo last decision",E.setAttribute("aria-keyshortcuts","U"),E.onclick=()=>{A(),o&&t.undo(o)},l.append(E);function A(){a.forEach(S=>S.cancel()),a=[]}function R(){if(A(),t.reduced.matches)return;let S=[...u.querySelectorAll("path")];for(let[L,$]of S.entries()){let m=$.getTotalLength()+1;$.style.strokeDasharray=`${m} ${m+2}`,a.push($.animate([{strokeDashoffset:m},{strokeDashoffset:0}],{duration:[200,125,125,50][L],delay:[0,200,325,450][L],easing:"cubic-bezier(.22,1,.36,1)",fill:"backwards"}))}for(let L of f.querySelectorAll("path")){let $=L.getTotalLength()+1;L.style.strokeDasharray=`${$} ${$+2}`,a.push(L.animate([{strokeDashoffset:$},{strokeDashoffset:0}],{duration:200,delay:500,easing:"cubic-bezier(.22,1,.36,1)",fill:"backwards"}))}t.badge(!0,!0)}return{element:l,undo:E,settle:A,update(S,L){let $=an(S);k.textContent=$.announcement,E.disabled=L||!o||!S.some(m=>m.id===o&&m.status!=="open"&&m.status!=="accepted-unrecorded"),$.complete||(i.reset(),A()),t.badge($.complete,!1)},completed(S){o=S,i.complete();try{t.persistent!==!1&&n.localStorage.setItem(r,JSON.stringify({id:S}))}catch{}},show(){l.hidden=!1,i.consume(t.reduced.matches)&&R()},hide(){l.hidden=!0,A()},destroy(){A(),l.remove()}}}function il(t,e){let n=Math.max(t.left,e.left),r=Math.min(t.right,e.right),o=Math.max(t.top,e.top),a=Math.min(t.bottom,e.bottom);return n>=r||o>=a?[t]:[{...t,bottom:o},{...t,top:a},{left:t.left,right:n,top:o,bottom:a},{left:r,right:t.right,top:o,bottom:a}].filter(i=>i.left<i.right&&i.top<i.bottom)}function sl(t,e,n,r,o={}){if(o.surface){let d=o.surface,u=Math.max(8,Math.min((t.top+t.bottom-n)/2,(o.height??1/0)-n-8)),x={left:d.left-e-8,top:u},h={left:d.right+8,top:u},f=o.side==="left"?[h,x]:[x,h],y=Math.max(8,Math.min((t.left+t.right-e)/2,r-e-8)),k={left:y,top:d.bottom+8},E={left:y,top:d.top-n-8};return f.push(...t.top+t.bottom<d.top+d.bottom?[E,k]:[k,E]),f.find(A=>A.left>=8&&A.left+e<=r-8&&A.top>=8&&A.top+n<=(o.height??1/0)-8&&!o.obstacles?.some(R=>A.left<R.right+4&&A.left+e>R.left-4&&A.top<R.bottom+4&&A.top+n>R.top-4))}let a=o.header??t,i=Math.max(8,Math.min((t.left+t.right-e)/2,r-e-8)),l=[t,...o.obstacles??[],...o.header?[o.header]:[]],c=[{left:i,top:a.top-n-8},{left:i,top:a.bottom+8},{left:a.right+4,top:(t.top+t.bottom-n)/2},{left:a.left-e-4,top:(t.top+t.bottom-n)/2}];for(let d of l)c.push({left:i,top:d.top-n-8},{left:i,top:d.bottom+8});return c.find(d=>d.left>=8&&d.left+e<=r-8&&d.top>=8&&d.top+n<=(o.height??1/0)-8&&!l.some(u=>d.left<u.right+4&&d.left+e>u.left-4&&d.top<u.bottom+4&&d.top+n>u.top-4))}var ll=(t,e,n)=>n||t<e?0:400;function qi(t,e,n,r){let o=k=>{let E=k.getBoundingClientRect();return{left:E.left,right:E.right,top:E.top,bottom:E.bottom}},a=e.matchMedia("(hover: hover) and (pointer: fine)"),i=t.createElement("div");i.className="proof-tooltip",i.id="proof-tooltip",i.setAttribute("role","tooltip"),i.hidden=!0,n.append(i);let l,c=0,d=0,u,x=[];function h(){l?.cancel(),e.clearTimeout(c),i.hidden||(d=e.performance.now()+600),i.hidden=!0,u?.removeAttribute("aria-describedby"),u=void 0}function f(k,E){let A=()=>{if(!a.matches)return;h(),u=k;let L=()=>{if(u!==k||!k.isConnected||!k.getBoundingClientRect().width)return;let m=E(),M=m.match(/^(.*) (⇧?[PADIUO]|Esc|←|→|,|\[|\])$/);if(i.replaceChildren(t.createTextNode(M?M[1]:m)),M){let j=t.createElement("span");j.className="proof-tooltip-key",j.textContent=M[2],i.append(j)}i.hidden=!1,k.setAttribute("aria-describedby",i.id);let Y=k.closest(".card header"),O=Y?.closest(".card"),J=k.closest(".card"),re=Y&&O?{...o(O),bottom:Y.getBoundingClientRect().bottom}:void 0,se=[...n.querySelectorAll('button,a,input,select,textarea,[role="button"]'),...[...t.querySelectorAll('button,a,input,select,textarea,[role="button"]')].filter(j=>{let Z=j.getBoundingClientRect(),he=t.elementFromPoint((Z.left+Z.right)/2,(Z.top+Z.bottom)/2);return!!he&&(he===j||j.contains(he))})].filter(j=>!j.closest("[inert]")&&j.getBoundingClientRect().width&&j.getBoundingClientRect().height&&e.getComputedStyle(j).visibility!=="hidden"&&e.getComputedStyle(j).opacity!=="0").flatMap(j=>{let Z=o(j);return J&&!J.contains(j)&&!j.closest(".header,.sheet-logo")?il(Z,o(J)):[Z]});for(let j of n.querySelectorAll(".line-tabs:not([hidden]) .line-tab"))se.push(o(j));let le=sl(k.getBoundingClientRect(),i.getBoundingClientRect().width,i.getBoundingClientRect().height,Se(t),{height:e.innerHeight,header:re,surface:J?o(J):void 0,side:n.querySelector(".panel")?.dataset.slot?.endsWith("left")?"left":"right",obstacles:se});if(!le){i.hidden=!0,k.removeAttribute("aria-describedby");return}i.style.left=`${le.left}px`,i.style.top=`${le.top}px`,$>0&&!r.matches&&(l=i.animate([{opacity:0,transform:"translateY(2px) scale(.96)"},{opacity:1,transform:"none"}],{duration:150,easing:"ease-out"})),d=1/0},$=ll(e.performance.now(),d,r.matches);$?c=e.setTimeout(L,$):L()},R=L=>{L.pointerType!=="touch"&&A()},S=()=>{k.matches(":focus-visible")&&A()};k.removeAttribute("title"),k.addEventListener("pointerenter",R),k.addEventListener("pointerleave",h),k.addEventListener("focus",S),k.addEventListener("blur",h),k.addEventListener("pointerdown",h),k.addEventListener("click",h),x.push(()=>{k.removeEventListener("pointerenter",R),k.removeEventListener("pointerleave",h),k.removeEventListener("focus",S),k.removeEventListener("blur",h),k.removeEventListener("pointerdown",h),k.removeEventListener("click",h)})}let y=k=>{k.key==="Escape"&&h()};return e.addEventListener("keydown",y,!0),e.addEventListener("scroll",h,!0),e.addEventListener("resize",h),a.addEventListener("change",h),{bind:f,destroy(){h(),x.forEach(k=>k()),i.remove(),e.removeEventListener("keydown",y,!0),e.removeEventListener("scroll",h,!0),e.removeEventListener("resize",h),a.removeEventListener("change",h)}}}function Fi(t,e){if(e.editable||t.isComposing||t.metaKey||t.ctrlKey)return;if(t.altKey)return!t.shiftKey&&/^Arrow(Left|Right|Up|Down)$/.test(t.key)?"dock":void 0;let n=t.key.toLowerCase();if(!(t.repeat&&!["ArrowLeft","ArrowRight","n","N"].includes(t.key))){if(t.key==="?")return"help";if(t.shiftKey)return n==="p"?"toggle-marks":n==="n"?"previous-open":void 0;if(n==="p")return"toggle-card";if(n==="n")return"next-open";if(n==="o")return"overview";if(n==="i")return"why";if(n===",")return"settings";if(t.key==="Escape")return e.card||e.help||e.badgeExpanded?"escape":void 0;if(e.card){if(t.key==="ArrowLeft")return"previous";if(t.key==="ArrowRight")return"next";if(n==="a")return"accept";if(n==="d")return"dismiss";if(n==="u")return"undo";if(t.key==="[")return"previous-version";if(t.key==="]")return"next-version"}}}function Hi(t){let e=[],r=[...t.replace(/(?:https?:\/\/|www\.|mailto:)[^\s<>"`]+|(`+)[\s\S]*?\1/g,(a,i,l)=>(e.push({start:l,value:a}),"x".repeat(a.length)))],o="";for(let a=0;a<r.length;a++){let i=r[a];if(i!=="'"&&i!=='"'){o+=i;continue}let l=r[a-1]??"",c=r[a+1]??"",d=o.at(-1)??"",u=(!d||/[\s([{“‘]/u.test(d))&&/\S/u.test(c),x=i==="'"&&(/[\p{L}\p{N}]/u.test(l)||/^(?:\d{2}(?:s)?\b|(?:tis|twas|twere|em|cause|bout|til)\b)/i.test(r.slice(a+1).join("")));o+=i==="'"?u&&!x?"\u2018":"\u2019":u?"\u201C":"\u201D"}for(let a of e)o=o.slice(0,a.start)+a.value+o.slice(a.start+a.value.length);return o}function Wn(t){let e=[];t=t.replace(/\\([\x21-\x2f\x3a-\x40\x5b-\x60\x7b-\x7e])|(`+)([\s\S]*?)\2/g,(r,o,a,i)=>{let l=o??i.replace(/\r?\n/g," ");return o===void 0&&/^ .* $/.test(l)&&/\S/.test(l)&&(l=l.slice(1,-1)),e.push(l),`\uE000${e.length-1}\uE001`});let n="";for(let r=0;r<t.length;){if(t[r]==="["){let o=r+1,a=1;for(;o<t.length;o++){if(t[o]==="\\"){o++;continue}if(t[o]==="["&&a++,t[o]==="]"&&!--a)break}if(a===0&&t[o+1]==="("){let i=o+2,l=1;for(;i<t.length;i++){if(t[i]==="\\"){i++;continue}if(t[i]==="("&&l++,t[i]===")"&&!--l)break}if(l===0){n+=Wn(t.slice(r+1,o)),r=i+1;continue}}}n+=t[r++]}for(let r=0;r<4;r++)n=n.replace(/(\*\*|__)(?=\S)([\s\S]*?\S)\1/g,"$2").replace(/\*(?=\S)([^*]*?\S)\*/g,"$1").replace(/(?<![\p{L}\p{N}])_(?=\S)([^_]*?\S)_(?![\p{L}\p{N}])/gu,"$1");return Hi(n).replace(/\uE000(\d+)\uE001/g,(r,o)=>e[Number(o)]??r)}var so=Wn;var Wi=(t,e)=>t.left<e.right+8&&t.right>e.left-8&&t.top<e.bottom+8&&t.bottom>e.top-8,ji=(t,e,n)=>{let r=Math.max(e,Math.min(n,t));return r+Math.sign(t-r)*Math.sqrt(Math.abs(t-r))*2},Ii=(t,e)=>t+e*499;function dl(t,e,n,r,o,a,i=146,l=12){let c=[];for(let d of o?["bottom"]:["top","bottom"])for(let u of o?["left","center","right"]:["left","right"]){let x=u==="left"?l:u==="right"?t-i-l:(t-i)/2,h=d==="top"?n:e-r-46;h>=n&&!a.some(f=>Wi({left:x,top:h,right:x+i,bottom:h+46},f))&&c.push({slot:`${d}-${u}`,x,y:h})}return c}function cl(t,e,n){let r={...t};for(let o=0;o<e.length;o++)for(let a of e)Wi({left:r.x,right:r.x+n,top:r.y,bottom:r.y+46},a)&&(r.y=r.slot.startsWith("bottom")?a.top-54:a.bottom+8);return r}function pl(t,e,n,r,o,a){return`inset(${r+4}px ${Math.max(0,t-n-o+4)}px ${Math.max(0,e-r-a+4)}px ${n+4}px round ${(a-8)/2}px)`}function Yi(t){let{doc:e,win:n,panel:r,pill:o}=t,a=t.storageKey??"proofmarks:badge-slot",i=()=>o.getBoundingClientRect().width+2,l=t.slot??"top-right";try{t.persistent!==!1&&(l=n.localStorage.getItem(a)||l)}catch{}let c={x:0,y:0},d={x:0,y:0},u=0,x,h=!1,f,y=e.createElement("div");y.style.cssText="position:fixed;pointer-events:none;visibility:hidden;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)",r.append(y);function k(){return[...e.querySelectorAll(t.avoid?.join(",")||":not(*)")].flatMap(B=>{let W=B.getBoundingClientRect();return W.width&&W.height&&n.getComputedStyle(B).visibility!=="hidden"&&n.getComputedStyle(B).pointerEvents!=="none"?[W]:[]})}function E(){let N=n.getComputedStyle(y),B=[...e.querySelectorAll("body header,body nav")].filter(W=>!W.closest("article")).map(W=>W.getBoundingClientRect()).filter(W=>W.top<90&&W.bottom>0&&W.height<180);return{top:Math.max(12+(parseFloat(N.paddingTop)||0),...B.map(W=>W.bottom+12)),bottom:12+(parseFloat(N.paddingBottom)||0),side:12+Math.max(parseFloat(N.paddingLeft)||0,parseFloat(N.paddingRight)||0)}}function A(){let N=E(),B=k();return dl(Se(e),n.innerHeight,N.top,N.bottom,t.mobile.matches,[],i(),N.side).map(W=>cl(W,B,i()))}function R(){r.style.transform=`translate3d(${c.x-d.x}px,${c.y-d.y}px,0)`,t.changed()}function S(){let N=l.startsWith("bottom")?c.y+46-E().top:n.innerHeight-E().bottom-c.y;r.style.setProperty("--panel-max-height",`${Math.max(120,N)}px`);let B=r.offsetWidth,W=r.offsetHeight;d={x:l.endsWith("left")?0:l.endsWith("right")?B-i():(B-i())/2,y:l.startsWith("bottom")?W-46:0},r.style.setProperty("--badge-x",`${d.x}px`),r.style.setProperty("--badge-y",`${d.y}px`),r.dataset.slot=l,r.style.clipPath=t.expanded()?"inset(0 0 0 0 round var(--surface-radius))":"none"}function L(){return`inset(${d.y}px ${Math.max(0,r.offsetWidth-d.x-i())}px ${Math.max(0,r.offsetHeight-d.y-46)}px ${d.x}px round var(--surface-radius))`}function $(){let N=o.getBoundingClientRect();return pl(r.offsetWidth,r.offsetHeight,d.x,d.y,N.width,N.height)}function m(){cancelAnimationFrame(u),u=0,x?.cancel(),x=void 0}function M(N,B){m();let W={...c};l=N.slot,c={x:N.x,y:N.y},S();try{t.persistent!==!1&&n.localStorage.setItem(a,l)}catch{}if(!B||t.reduced.matches||t.keyboard()){R();return}let ie=n.performance.now(),Q={...c};c=W;let H=()=>{let xe=(n.performance.now()-ie)/1e3,v=(1+32*xe)*Math.exp(-32*xe);if(c={x:Q.x+(W.x-Q.x)*v,y:Q.y+(W.y-Q.y)*v},xe>=.28){c=Q,u=0,R();return}R(),u=requestAnimationFrame(H)};u=requestAnimationFrame(H)}function Y(){if(f?.active||u)return;if(!t.mobile.matches&&l.endsWith("center")){let W=E();c={x:(Se(e)-i())/2,y:l.startsWith("bottom")?n.innerHeight-W.bottom-46:W.top}}let N=A(),B=N.find(W=>W.slot===l)??N.sort((W,ie)=>Math.hypot(W.x-c.x,W.y-c.y)-Math.hypot(ie.x-c.x,ie.y-c.y)||ie.x-W.x)[0];B&&M(B,!1)}function O(N){let B=A(),W=B.find(Q=>Q.slot===l)??B[0];if(!W)return;let ie;if(N&&!t.mobile.matches){let Q=["top-left","top-right","bottom-right","bottom-left"],H=B.sort((ct,Pe)=>Q.indexOf(ct.slot)-Q.indexOf(Pe.slot)),xe=H.findIndex(ct=>ct.slot===l);ie=H[(xe+(N==="ArrowLeft"||N==="ArrowUp"?-1:1)+H.length)%H.length]}else if(N){let Q=N==="ArrowLeft"?-1:N==="ArrowRight"?1:0,H=N==="ArrowUp"?-1:N==="ArrowDown"?1:0;ie=B.filter(xe=>(xe.x-W.x)*Q+(xe.y-W.y)*H>1).sort((xe,v)=>Math.hypot(xe.x-W.x,xe.y-W.y)-Math.hypot(v.x-W.x,v.y-W.y))[0]}else{let Q=B.filter(H=>!H.slot.endsWith("center"));ie=Q[(Q.findIndex(H=>H.slot===l)+1)%Q.length]}ie&&M(ie,!1)}function J(N){t.expanded()||N.button!==0||(h=!1,m(),f={id:N.pointerId,start:{x:N.clientX,y:N.clientY},origin:{...c},last:{x:N.clientX,y:N.clientY},time:N.timeStamp,vx:0,vy:0,active:!1})}function re(N){if(!f||N.pointerId!==f.id)return;let B=N.clientX-f.start.x,W=N.clientY-f.start.y;if(!f.active&&Math.hypot(B,W)<=4)return;f.active||o.setPointerCapture(N.pointerId),f.active=!0,r.dataset.dragging="true";let ie=N.timeStamp-f.time;ie>0&&(f.vx=(N.clientX-f.last.x)/ie,f.vy=(N.clientY-f.last.y)/ie),f.last={x:N.clientX,y:N.clientY},f.time=N.timeStamp;let Q=E();c={x:ji(f.origin.x+B,Q.side,Se(e)-i()-Q.side),y:ji(f.origin.y+W,Q.top,n.innerHeight-Q.bottom-46)},R()}function se(N,B=!1){if(!f)return;let W=f;if(f=void 0,delete r.dataset.dragging,o.hasPointerCapture(W.id)&&o.releasePointerCapture(W.id),!W.active)return;h=!0;let ie=N?N.timeStamp-W.time:1/0,Q=B||ie>100?0:W.vx,H=B||ie>100?0:W.vy,xe=Ii(c.x,Q),v=Ii(c.y,H),ct=A().sort((Pe,ee)=>Math.hypot(Pe.x-xe,Pe.y-v)-Math.hypot(ee.x-xe,ee.y-v))[0];ct&&M(ct,!0)}let le=N=>se(N),j=()=>se(void 0,!0),Z=N=>{h&&(h=!1,N.preventDefault(),N.stopImmediatePropagation())},he=N=>{!N.defaultPrevented&&!N.isComposing&&!N.metaKey&&!N.ctrlKey&&!N.shiftKey&&N.altKey&&N.key.startsWith("Arrow")&&(N.preventDefault(),O(N.key))},fe=()=>Y(),Be=()=>{j(),m(),Y()},Ee=()=>{t.reduced.matches&&Be()};t.reduced.addEventListener("change",Ee),o.addEventListener("pointerdown",J),n.addEventListener("pointermove",re),n.addEventListener("pointerup",le),o.addEventListener("pointercancel",j),o.addEventListener("lostpointercapture",N=>{N.target===o&&j()}),o.addEventListener("click",Z,!0),o.addEventListener("keydown",he),n.addEventListener("blur",j),n.addEventListener("resize",fe),n.addEventListener("pointerup",fe),t.mobile.addEventListener("change",fe);let q=new ResizeObserver(Y);q.observe(r),q.observe(o);let oe=new MutationObserver(Y);for(let N of e.querySelectorAll(t.avoid?.join(",")||":not(*)"))oe.observe(N,{attributes:!0,subtree:!0,attributeFilter:["style","class"]});return Y(),{refresh:Y,closedClip:$,openingClip:L,moveSlot:O,settle:Be,destroy(){m(),q.disconnect(),oe.disconnect(),j(),m(),n.removeEventListener("pointermove",re),n.removeEventListener("pointerup",le),n.removeEventListener("blur",j),n.removeEventListener("resize",fe),n.removeEventListener("pointerup",fe),t.mobile.removeEventListener("change",fe),t.reduced.removeEventListener("change",Ee)}}}var ul=(t,e,n)=>t>10&&t+e*499>n*.35;function Vi(t){let{doc:e,win:n,card:r,panel:o}=t,a=e.createElement("section");a.className="mobile-sheet",a.hidden=!0,a.setAttribute("role","region"),a.setAttribute("aria-label","Proofmarks review"),t.shadow.append(a);let l=((S,L)=>{let $=e.createElement("button");return $.type="button",$.textContent=S,$.onclick=L,$})("\u2015",()=>{});l.className="sheet-handle",l.setAttribute("aria-label","Page overview; drag down to close review"),l.onclick=()=>{if(u){u=!1;return}t.overview()};let c,d,u=!1;a.append(l);let x=e.createElement("style");t.host.append(x);function h(){let S=d?n.getComputedStyle(a).transform:"translateY(100%)";d&&(c?.cancel(),d()),a.hidden&&(a.dataset.slot=o.dataset.slot,a.hidden=!1,o.hidden=!0,t.host.dataset.sheetOpen="",x.textContent=t.avoid?.length?t.avoid.join(",")+"{visibility:hidden!important}":"",t.reduced.matches||(c=a.animate([{transform:S},{transform:"translateY(0)"}],{duration:220,easing:"cubic-bezier(.22,1,.36,1)"})))}function f(S){requestAnimationFrame(()=>{if(a.hidden)return;let L=t.rect(S);if(!L)return;let $=n.innerHeight-a.offsetHeight,m=Math.max(80,$-90),M=n.scrollY+L.top-90-Math.max(0,(m-L.height)/2);n.scrollTo({top:Math.max(0,M),behavior:t.reduced.matches?"instant":"smooth"})})}let y;l.onpointerdown=S=>{c?.cancel(),y={id:S.pointerId,start:S.clientY,y:S.clientY,time:S.timeStamp,velocity:0,height:a.offsetHeight},l.setPointerCapture(S.pointerId)},l.onpointermove=S=>{if(!y)return;let L=S.timeStamp-y.time;L>0&&(y.velocity=(S.clientY-y.y)/L),y.y=S.clientY,y.time=S.timeStamp;let $=S.clientY-y.start;a.style.transform=`translate3d(0,${$<0?-Math.sqrt(-$)*2:$}px,0)`};function k(S=!1){if(!y)return;let L=y.y-y.start,$=a.style.transform,m=!S&&ul(L,y.velocity,y.height);u=Math.abs(L)>4,y=void 0,a.style.transform="",!S&&L<-60?t.overview():m?t.close():t.reduced.matches||(c=a.animate([{transform:$},{transform:"translateY(0)"}],{duration:220,easing:"cubic-bezier(.22,1,.36,1)"}))}l.onpointerup=()=>k(),l.onpointercancel=()=>k(!0),l.onlostpointercapture=()=>k(!0);let E=()=>k(!0);n.addEventListener("blur",E);let A=()=>{!t.mobile.matches&&!a.hidden&&t.close()};return t.mobile.addEventListener("change",A),{element:a,isOpen:()=>!a.hidden,review(){h(),r.classList.add("sheet-card"),a.append(r),r.style.transform="",r.style.left="",r.style.top=""},reveal:f,close(){if(a.hidden)return;c?.cancel();let S=r.cloneNode(!0);S.inert=!0,S.classList.remove("card"),S.classList.add("card-exiting"),S.setAttribute("aria-hidden","true"),a.append(S),r.classList.remove("sheet-card"),t.shadow.append(r);let L=()=>{d=void 0,S.remove(),a.hidden=!0,a.style.transform="",x.textContent="",delete t.host.dataset.sheetOpen,o.hidden=!1};if(d=L,t.reduced.matches){L();return}c=a.animate([{transform:n.getComputedStyle(a).transform},{transform:"translateY(100%)"}],{duration:150,easing:"cubic-bezier(.22,1,.36,1)"}),c.onfinish=L},destroy(){c?.cancel(),d?.(),n.removeEventListener("blur",E),t.mobile.removeEventListener("change",A),a.remove(),x.remove()}}}function wn(t){return t.replace(/[‘’]/g,"'").replace(/[“”]/g,'"').replace(/\s+/g," ").trim()}function hl(t){let e=Wn(t),n=t.replace(/ \(\[[^\]]+\]\(https?:\/\/[^\s]+\), [^)]*\)/g,"");return[...new Set([wn(e),wn(Wn(n))])]}function fa(t){return t.proposed?.trim()?t.proposed:t.after??t.proposed??t.match}var sn=t=>Wn(t).replace(/[‘’]/g,"'").replace(/[“”]/g,'"').replace(/\s+/g," ");function fl(t,e){let n=sn(e.left),r=n.endsWith(" ")?sn(e.right).replace(/^ /,""):sn(e.right);for(let[o,a]of[[24,24],[12,12],[0,16],[16,0]]){let i=o?n.slice(-o):"",l=a?r.slice(0,a):"",c=i+l;if(c.trim().length<6)continue;let d=t.indexOf(c);if(d>=0&&t.indexOf(c,d+1)<0)return d+i.length}return-1}function ml(t,e){let n=sn(e.context.left),r=n.endsWith(" ")?sn(e.after).replace(/^ /,""):sn(e.after),o=(r||n).endsWith(" ")?sn(e.context.right).replace(/^ /,""):sn(e.context.right),a=/^ */.exec(r)[0].length,i=/ *$/.exec(r)[0].length;if(a!==r.length)for(let[l,c]of[[24,24],[12,12],[0,16],[16,0]]){let d=l?n.slice(-l):"",u=c?o.slice(0,c):"";if(!(d+u).trim())continue;let x=d+r+u,h=t.indexOf(x);if(h>=0&&t.indexOf(x,h+1)<0)return{start:h+d.length+a,end:h+d.length+r.length-i}}}var gl='script,style,pre,svg,button,input,textarea,select,figure,[role="button"],[role="slider"],[aria-hidden="true"],[hidden],[id^="cite-"],[data-proofmarks]',bl={"\u2018":"'","\u2019":"'","\u201C":'"',"\u201D":'"'},xl=/\s/;function yl(t){let e="",n="",r=[],o=[];for(let a of t){let i=a.textContent??"";for(let l=0;l<i.length;l++){let c=i[l];if(c=bl[c]??c,xl.test(c)&&(c=" "),c===" "&&n===" "){o[o.length-1]={node:a,offset:l+1};continue}e+=c,n=c,r.push({node:a,offset:l}),o.push({node:a,offset:l+1})}}return{text:e,starts:r,ends:o}}function mr(t,e){let n=t.ownerDocument,r=n.createTreeWalker(t,4),o=[],a=new Map,i;for(;i=r.nextNode();){let d=i.parentElement;if(!d||d.closest(gl)||!d.checkVisibility({checkVisibilityCSS:!0}))continue;let u=d.closest("[data-proofmarks-meta]");if(u){let x=a.get(u)??[];x.push(i),a.set(u,x)}else o.push(i)}let l=new Map,c=d=>{let u=l.get(d);return u||(u=yl(d),l.set(d,u)),u};return e.filter(d=>d.status!=="dismissed"&&d.status!=="superseded").map(d=>{let u=d.target,x=u?[...a].filter(([E])=>E.getAttribute("data-proofmarks-meta")===u.field&&(u.index===void 0||E.getAttribute("data-proofmarks-meta-index")===String(u.index))).map(([,E])=>E):[o],h=d.status==="accepted"||d.status==="accepted-unrecorded",f=h?fa(d):d.match;if(h&&!f.trim()){let E=d.edits?.find(A=>!A.target&&!A.after)?.context;if(!E)return{finding:d,range:null};for(let A of x){let R=c(A),S=fl(R.text,E);if(S<0)continue;let L=!/^\S/.test(E.right),$=L&&S>0?S-1:S,m=R.starts[$],M=R.ends[$];if(!m||!M)continue;let Y=n.createRange();return Y.setStart(m.node,m.offset),Y.setEnd(M.node,M.offset),{finding:d,range:Y,segments:[Y],gapAfter:$<S}}return{finding:d,range:null}}let y=(E,A,R,S)=>{let L=A.starts[R],$=A.ends[S-1];if(!L||!$)return;let m=n.createRange();m.setStart(L.node,L.offset),m.setEnd($.node,$.offset);let M=[];for(let Y of E.slice(E.indexOf(L.node),E.indexOf($.node)+1)){let O=n.createRange();O.setStart(Y,Y===L.node?L.offset:0),O.setEnd(Y,Y===$.node?$.offset:Y.length),M.push(O)}return{range:m,segments:M}},k=h?d.edits?.find(E=>!E.target&&E.after&&E.context):void 0;if(k?.context)for(let E of x){let A=c(E),R=ml(A.text,{after:k.after,context:k.context}),S=R&&y(E,A,R.start,R.end);if(S)return{finding:d,...S}}for(let E of x){let A=c(E);for(let R of hl(f)){let S=A.text.indexOf(R);if(!R||S<0)continue;let L=y(E,A,S,S+R.length);if(L)return{finding:d,...L}}}return{finding:d,range:null}})}function Xi(t){return(t.segments??[]).flatMap(e=>[...e.getClientRects()])}var ma=t=>[...t.matchAll(/\S+/gu)].map(e=>({text:e[0],start:e.index,end:e.index+e[0].length}));function ga(t,e){let n=Array.from({length:t.length+1},()=>new Uint16Array(e.length+1));for(let c=t.length-1;c>=0;c--)for(let d=e.length-1;d>=0;d--)n[c][d]=wn(t[c])===wn(e[d])?1+n[c+1][d+1]:Math.max(n[c+1][d],n[c][d+1]);let r=[],o=[],a=[],i=0,l=0;for(;i<t.length||l<e.length;)i<t.length&&l<e.length&&wn(t[i])===wn(e[l])?r.push({old:i++,next:l++}):i<t.length&&(l===e.length||n[i+1][l]>=n[i][l+1])?o.push(i++):a.push(l++);return{kept:r,removed:o,added:a}}function vl({count:t,nextCount:e,inline:n,blocks:r,supported:o}){return o?t>60||e>60?"over 60 words":r?"multiple blocks":n?"formatted inline or citation":void 0:"highlight unsupported"}function ba(t){let e=t.startContainer;if(e.nodeType!==3||t.endContainer!==e)return;let n=e.ownerDocument,r=n.defaultView,o=r.getComputedStyle(e.parentElement),a=[];for(let i of ma(t.toString())){let l=n.createRange();l.setStart(e,t.startOffset+i.start),l.setEnd(e,t.startOffset+i.end);let c=[...l.getClientRects()].filter(u=>u.width>0);if(c.length!==1)return;let d=c[0];a.push({text:i.text,rect:new DOMRect(d.x+r.scrollX,d.y+r.scrollY,d.width,d.height)})}return{words:a,font:o,range:t}}function _i(t,e){let n=t.startContainer.ownerDocument.defaultView,r=t.startContainer.parentElement?.closest("p,li,blockquote")!==t.endContainer.parentElement?.closest("p,li,blockquote"),o=!!t.cloneContents().querySelector("*")||t.startContainer.parentElement!==t.startContainer.parentElement?.closest("p,li,blockquote"),a=vl({count:ma(t.toString()).length,nextCount:ma(e).length,inline:o,blocks:r,supported:"highlights"in n.CSS&&"Highlight"in n});if(a)return{reason:a};let i=ba(t);return i?{snapshot:i}:{reason:"split word or text nodes"}}function Ui(t,e,n,r,o,a){let i=e.ownerDocument,l=i.defaultView,c=i.createElement("div");c.className="word-morph",c.setAttribute("aria-hidden","true");let d=e.getBoundingClientRect();Object.assign(c.style,{position:"absolute",left:`${-d.x-l.scrollX}px`,top:`${-d.y-l.scrollY}px`,pointerEvents:"none",zIndex:"21"}),t.append(c);let u=i.createElement("style");u.textContent="::highlight(proofmarks-morph){color:transparent;text-shadow:none}",e.append(u);let x=new Highlight(r.range);CSS.highlights.set("proofmarks-morph",x);let h=[],f=ga(n.words.map(L=>L.text),r.words.map(L=>L.text)),y=[],k=(L,$,m,M,Y)=>{let O=i.createElement("span");O.textContent=L.text,O.dataset.word=L.text,O.dataset.kind=m,Object.assign(O.style,{position:"absolute",left:`${L.rect.x}px`,top:`${L.rect.y}px`,whiteSpace:"pre",font:$.font,fontFamily:$.fontFamily,fontSize:$.fontSize,fontWeight:$.fontWeight,fontStyle:$.fontStyle,fontStretch:$.fontStretch,fontVariant:$.fontVariant,letterSpacing:$.letterSpacing,lineHeight:`${L.rect.height}px`,color:$.color,textTransform:$.textTransform,willChange:"transform,opacity"}),m==="removed"&&(O.style.opacity="0"),O.dataset.x=String(L.rect.x),O.dataset.y=String(L.rect.y),c.append(O),y.push({span:O,word:L,frames:M,options:Y})},E="cubic-bezier(.22,1,.36,1)";for(let L of f.kept){let $=n.words[L.old],m=r.words[L.next];k(m,r.font,"kept",[{transform:`translate3d(${$.rect.x-m.rect.x}px,${$.rect.y-m.rect.y}px,0)`},{transform:"translate3d(0,0,0)"}],{duration:200,easing:E})}for(let L of f.removed)k(n.words[L],n.font,"removed",[{opacity:1},{opacity:0}],{duration:120,easing:E});for(let L of f.added)k(r.words[L],r.font,"added",[{opacity:0,transform:"translate3d(0,3px,0)"},{opacity:1,transform:"translate3d(0,0,0)"}],{duration:160,delay:40,fill:"backwards",easing:E});let A=y.map(({span:L,word:$})=>{let m=i.createRange();m.selectNodeContents(L);let M=m.getBoundingClientRect();return{x:$.rect.x-M.x-l.scrollX,y:$.rect.y-M.y-l.scrollY}});y.forEach(({span:L,word:$,frames:m,options:M},Y)=>{let O=A[Y];L.style.left=`${$.rect.x+O.x}px`,L.style.top=`${$.rect.y+O.y}px`,h.push(L.animate(m,M))});let R=!1,S=()=>{if(!R){R=!0;for(let L of h)L.cancel();if(a){let L=0;for(let $ of c.querySelectorAll("[data-kind]:not([data-kind=removed])")){let m=i.createRange();m.selectNodeContents($);let M=m.getBoundingClientRect();L=Math.max(L,Math.abs(M.x+l.scrollX-Number($.dataset.x)),Math.abs(M.y+l.scrollY-Number($.dataset.y)))}a(L)}CSS.highlights.get("proofmarks-morph")===x&&CSS.highlights.delete("proofmarks-morph"),c.remove(),u.remove(),o()}};return Promise.all(h.map(L=>L.finished)).then(S,()=>{}),S}function Ki(t,e){let n=t.join(""),r=u=>[...u.matchAll(/[\p{L}\p{N}]+(?:['’][\p{L}\p{N}]+)*|\s+|[^\p{L}\p{N}\s]/gu)].map(x=>({text:x[0],start:x.index})),o=r(n),a=r(e),i=new Map(ga(o.map(u=>u.text),a.map(u=>u.text)).kept.map(u=>[u.next,u.old])),l=[];t.reduce((u,x)=>(l.push(u+x.length),u+x.length),0);let c=t.map(()=>""),d=0;for(let[u,x]of a.entries()){let h=i.get(u),f=h===void 0?void 0:o[h];for(let y=0;y<x.text.length;y++){if(f){let k=f.start+Math.min(f.text.length-1,Math.floor(y*f.text.length/x.text.length));for(;d<l.length-1&&k>=l[d];)d++}c[d]=(c[d]??"")+x.text[y]}}return c}function wl(t,e){let n=Ki(t.map(o=>(o.startContainer.nodeValue??"").slice(o.startOffset,o.endOffset)),e),r=t.map((o,a)=>{let i=o.startContainer;if(i.nodeType!==3||o.endContainer!==i)throw new Error("Expected text-only range segments.");let l=i.nodeValue??"";return{node:i,before:l,start:o.startOffset,length:n[a].length,after:l.slice(0,o.startOffset)+n[a]+l.slice(o.endOffset)}});for(let{node:o,after:a}of r)o.nodeValue=a;return{range(){let o=r[0],a=o.node.ownerDocument.createRange();a.setStart(o.node,o.start);let i=r.at(-1);return a.setEnd(i.node,i.start+i.length),a},rollback(){for(let{node:o,before:a,after:i}of r)o.nodeValue===i&&(o.nodeValue=a)}}}function Gi(t){let e=[];try{for(let n of t)e.push(wl(n.segments,n.replacement))}catch(n){for(let r of e.reverse())r.rollback();throw n}return{primary:e[0],rollback(){for(let n of[...e].reverse())n.rollback()}}}function Qi(t){let e=[];for(let n of[...t].sort((r,o)=>r.top-o.top||r.left-o.left)){let r=e.find(o=>Math.min(o.bottom,n.bottom)>Math.max(o.top,n.top));r?(r.left=Math.min(r.left,n.left),r.right=Math.max(r.right,n.right),r.top=Math.min(r.top,n.top),r.bottom=Math.max(r.bottom,n.bottom)):e.push({...n,left:n.left,right:n.right,top:n.top,bottom:n.bottom})}return e.map((n,r)=>{let o=e[r-1],a=e[r+1],i=o?Math.max(0,n.top-o.bottom)/2:0,l=a?Math.max(0,a.top-n.bottom)/2:0;return{...n,top:n.top-i,bottom:n.bottom+l}})}var gr=(t,e,n)=>e>=t.left&&e<=t.right&&n>=t.top&&n<=t.bottom;function xa(t,e,n,r,o,a,i={left:!1,above:!1}){let x=o-8-(t+16+n),h=a-8-(e+20+r);i.left=i.left?x<24:x<0,i.above=i.above?h<24:h<0;let f=i.left?t-16-n:t+16,y=i.above?e-20-r:e+20;return{x:Math.max(8,Math.min(f,o-n-8)),y:Math.max(8,Math.min(y,a-r-8))}}function kl(t){if(t<=0)return 0;if(t>=1)return 1;let e=0,n=1,r=.5;for(let o=0;o<16;o++)r=(e+n)/2,3*(1-r)*(1-r)*r*.22+3*(1-r)*r*r*.36+r*r*r<t?e=r:n=r;return 1-Math.pow(1-r,3)}function Ji(t,e,n,r,o,a,i){let l=Math.min(r,a-24),c=Math.min(n,o-24),d=xa(t,e,c,l,o,a,i),u=a-12-e-20-l,x=e-20-l-12;return u<0&&x<0&&(i.above=x>u),{x:Math.max(12,Math.min(d.x,o-c-12)),y:Math.max(12,Math.min(i.above?e-20-l:e+20,a-l-12))}}function Zi(t,e,n=36,r=150){let o=Math.max(0,t-n,e-n);for(let a=0;a<r;a++)if(o*(1-kl(a/r))<=1)return a;return r}function es(t,e){let n=t.ownerDocument,r=n.createTreeWalker(t,4),o=new Set,a;for(;a=r.nextNode();){let l=a.parentElement;if(!a.textContent?.trim()||!l||l.closest('script,style,svg,header,nav,footer,[hidden],[aria-hidden="true"]')||!l.checkVisibility({checkVisibilityCSS:!0}))continue;let c=n.createRange();c.selectNodeContents(a);let d=[...c.getClientRects()].filter(u=>u.width>1&&u.height>1);if(!(!d.length||d.some(u=>u.left<e+20))){for(;l.parentElement&&l.parentElement!==t&&l.parentElement.getBoundingClientRect().left>=e+20;)l=l.parentElement;l.getBoundingClientRect().left>=e+20&&o.add(l)}}return[...o].filter(l=>![...o].some(c=>c!==l&&c.contains(l))).map(l=>{let c=[];for(let d=l;d&&d!==n.documentElement;d=d.parentElement)c.unshift(`${d.localName}:nth-child(${[...d.parentElement.children].indexOf(d)+1})`);return`html[data-proofmarks-on] > ${c.join(" > ")}`})}function ts(t){return t.length?`${t.join(",")} { opacity: .3 !important; transition: none !important; }`:""}function lo(t){let e=2166136261;for(let n of t)e=Math.imul(e^n.charCodeAt(0),16777619);return(e>>>0)%2147483646+1}function ns(t,e,n,r=6){return n==="circle"?{x:6+Math.min(4,t/150),y:Math.max(0,Math.min(2,r/2-1))}:{x:6,y:6}}function Ml(t,e,n=6){let{x:r,y:o}=ns(t,e,"circle",n),a=r*4/3;return`M 0 ${-o} C ${t*.28} ${-o} ${t*.72} ${-o} ${t} ${-o} C ${t+a} ${-o} ${t+a} ${e+o} ${t} ${e+o} C ${t*.72} ${e+o} ${t*.28} ${e+o} 0 ${e+o} C ${-a} ${e+o} ${-a} ${-o} 0 ${-o} Z`}function rs(t,e,n,r,o,a,i=6){let l=t.ownerDocument.createElementNS("http://www.w3.org/2000/svg","svg");l.classList.add("rough-annotation"),l.setAttribute("aria-hidden","true"),l.setAttribute("width",t.style.width),l.setAttribute("height",t.style.height);let c=parseFloat(t.style.width),d=parseFloat(t.style.height),u=ns(c,d,e),x=In.svg(l),h={seed:r,stroke:n,strokeWidth:1.3,roughness:.6,disableMultiStroke:!0},f=e==="bracket"?`M 0 0 L -5 0 L -5 ${d} L 0 ${d}`:e==="caret"?`M 0 ${d+7} L 5 ${d} L 10 ${d+7}`:e==="strike-through"?`M 0 ${d/2} L ${c} ${d/2}`:e==="crossed-off"?`M 0 0 L ${c} ${d} M 0 ${d} L ${c} 0`:`M 0 ${d+1} L ${c} ${d+1}`;if(l.append(e==="box"?x.rectangle(-u.x,-u.y,c+2*u.x,d+2*u.y,h):e==="circle"?x.path(Ml(c,d,i),{...h,roughness:.25,bowing:0,maxRandomnessOffset:.25}):x.path(f,h)),t.append(l),o)for(let y of l.querySelectorAll("path")){let k=y.getTotalLength();y.style.strokeDasharray=String(k),y.style.strokeDashoffset="0",y.animate([{strokeDashoffset:String(k)},{strokeDashoffset:"0"}],{duration:420,delay:a,easing:"cubic-bezier(.22,1,.36,1)",fill:"backwards"})}}function El(t,e){let n=e.map(a=>({x:Math.min(a.right,Math.max(a.left,t.x)),y:Math.min(a.bottom,Math.max(a.top,t.y))})).sort((a,i)=>Math.hypot(a.x-t.x,a.y-t.y)-Math.hypot(i.x-t.x,i.y-t.y))[0];if(!n||t.x-n.x<14)return null;let r={x:n.x+3,y:n.y},o=Math.min(22,(t.x-r.x)*.12);return{end:r,first:{x:t.x-35,y:t.y-o},last:{x:r.x+30,y:r.y-o}}}function os(t,e,n,r,o,a,i){let l=El(e,n);if(!l)return;let{end:c,first:d,last:u}=l,x=Math.atan2(c.y-u.y,c.x-u.x),h=7,f=document.createElementNS("http://www.w3.org/2000/svg","svg");f.classList.add("arrow"),f.dataset.finding=i,f.setAttribute("aria-hidden","true"),f.setAttribute("width","100%"),f.setAttribute("height",String(Math.max(e.y,...n.map(k=>k.bottom))+16)),t.append(f);let y=`M ${e.x} ${e.y} C ${d.x} ${d.y}, ${u.x} ${u.y}, ${c.x} ${c.y} M ${c.x-h*Math.cos(x-.5)} ${c.y-h*Math.sin(x-.5)} L ${c.x} ${c.y} L ${c.x-h*Math.cos(x+.5)} ${c.y-h*Math.sin(x+.5)}`;if(f.append(In.svg(f).path(y,{stroke:r,strokeWidth:1.2,roughness:.55,bowing:.7,disableMultiStroke:!0,seed:lo(`${i}:arrow`)})),o)for(let k of f.querySelectorAll("path")){let E=k.getTotalLength();k.style.strokeDasharray=`${E}`,k.style.strokeDashoffset="0",k.animate([{strokeDashoffset:String(E)},{strokeDashoffset:"0"}],{duration:420,delay:a,easing:"cubic-bezier(.22,1,.36,1)",fill:"backwards"})}}var as={version:"3",rules:[{id:"inflated",color:"#875f45",mark:"underline",label:"Inflated word",level:"word",why:"A fancy word stands in for a plain one.",fix:"Use the plain word.",edit:"replace",detector:{kind:"lexicon",terms:[{term:"delve",pos:"verb",plain:"dig into"},{term:"leverage",pos:"verb",plain:"use"},{term:"utilize",pos:"verb",plain:"use"},{term:"utilise",pos:"verb",plain:"use"},{term:"utilization",pos:"noun",plain:"use"},{term:"facilitate",pos:"verb",plain:"help"},{term:"foster",pos:"verb",plain:"build"},{term:"cultivate",pos:"verb",plain:"build"},{term:"enhance",pos:"verb",plain:"improve"},{term:"showcase",pos:"verb",plain:"show"},{term:"underscore",pos:"verb",plain:"show"},{term:"garner",pos:"verb",plain:"get"},{term:"empower",pos:"verb",plain:"let"},{term:"streamline",pos:"verb",plain:"simplify"},{term:"elevate",pos:"verb",plain:"improve"},{term:"unlock",pos:"verb",plain:"open"},{term:"harness",pos:"verb",plain:"use"},{term:"harness the power of",pos:"verb",plain:"use"},{term:"navigate",pos:"verb",plain:"handle"},{term:"embark",pos:"verb",plain:"start"},{term:"spearhead",pos:"verb",plain:"lead"},{term:"bolster",pos:"verb",plain:"support"},{term:"revolutionize",pos:"verb",plain:"change"},{term:"reimagine",pos:"verb",plain:"redesign"},{term:"commence",pos:"verb",plain:"start"},{term:"ascertain",pos:"verb",plain:"find out"},{term:"endeavor",pos:"noun",plain:"effort"},{term:"crucial",pos:"adj",plain:"important"},{term:"pivotal",pos:"adj",plain:"key"},{term:"paramount",pos:"adj",plain:"most important"},{term:"multifaceted",pos:"adj",plain:"complex"},{term:"holistic",pos:"adj",plain:"whole"},{term:"meticulous",pos:"adj",plain:"careful"},{term:"numerous",pos:"adj",plain:"many"},{term:"a myriad of",pos:"phrase",plain:"many"},{term:"myriad",pos:"adj",plain:"many"},{term:"a plethora of",pos:"phrase",plain:"many"},{term:"additionally",pos:"phrase",plain:"also"},{term:"landscape",pos:"noun",plain:"field"},{term:"tapestry",pos:"noun",plain:"mix"},{term:"realm",pos:"noun",plain:"area"},{term:"ecosystem",pos:"noun",plain:"network"},{term:"synergy",pos:"noun",plain:"combined effect"},{term:"paradigm",pos:"noun",plain:"model"},{term:"paradigm shift",pos:"noun",plain:"big change"},{term:"north star",pos:"noun",plain:"goal"},{term:"substrate",pos:"noun",plain:"base"},{term:"nexus",pos:"phrase",plain:"link"},{term:"a testament to",pos:"phrase",plain:"shows"},{term:"indelible mark",pos:"noun",plain:"lasting effect"},{term:"play a key role",pos:"verb",forms:["played a key role","plays a key role"],plain:"matters"},{term:"play a vital role",pos:"verb",forms:["played a vital role","plays a vital role"],plain:"matters"},{term:"play a crucial role",pos:"verb",forms:["played a crucial role","plays a crucial role"],plain:"matters"},{term:"play a pivotal role",pos:"verb",forms:["played a pivotal role","plays a pivotal role"],plain:"matters"},{term:"play an important role",pos:"verb",forms:["played an important role","plays an important role"],plain:"matters"}]},judge:{ask:"Is \u201C{term}\u201D in the target an inflated or buzzword choice where a plainer word would say the same thing?",yes:"\u201C{term}\u201D dresses up a plain idea, as in leverage a tool, foster a culture, a pivotal moment, navigate challenges.",no:"\u201C{term}\u201D is literal or a necessary technical term, as in a mountain landscape, foster care, financial leverage, navigating a ship.",context:"paragraph"},default:!0},{id:"filler",color:"#5e6b38",mark:"box",label:"Filler",level:"word",why:"Words that delay the point without adding to it.",fix:"Delete the phrase.",edit:"delete",detector:{kind:"lexicon",terms:[{term:"in order to",plain:"to"},{term:"due to the fact that",plain:"because"},{term:"owing to the fact that",plain:"because"},{term:"in spite of the fact that",plain:"although"},{term:"it is important to note that"},{term:"it is important to note"},{term:"it's important to note that"},{term:"it's important to note"},{term:"it is worth noting that"},{term:"it is worth noting"},{term:"it's worth noting that"},{term:"it's worth noting"},{term:"it should be noted that"},{term:"it goes without saying that"},{term:"it goes without saying"},{term:"needless to say"},{term:"at the end of the day"},{term:"the fact of the matter is"},{term:"in the event that",plain:"if"},{term:"for all intents and purposes"},{term:"at this point in time",plain:"now"},{term:"each and every",plain:"every"},{term:"first and foremost",plain:"first"},{term:"when it comes to",plain:"for"},{term:"in terms of"},{term:"in a timely manner",plain:"promptly"},{term:"on a daily basis",plain:"daily"},{term:"has the ability to",plain:"can"},{term:"meet your needs",pos:"verb",forms:["met your needs"]},{term:"meet their needs",pos:"verb",forms:["met their needs"]}]},judge:{ask:"Can \u201C{term}\u201D be deleted or shortened in the target without losing any meaning?",yes:"Empty framing, as in in order to (to), it is important to note that, at the end of the day.",no:"The words carry meaning here, such as the literal end of a working day or a real condition.",context:"paragraph"},default:!0},{id:"brochure-verb",color:"#3f6b67",mark:"underline",label:"Brochure verb",level:"word",why:"A costume for \u201Cis\u201D or \u201Chas\u201D.",fix:"Say \u201Cis\u201D or \u201Chas\u201D.",edit:"replace",detector:{kind:"lexicon",terms:[{term:"serve as",pos:"verb",plain:"is"},{term:"stand as",pos:"verb",forms:["stood as"],plain:"is"},{term:"act as",pos:"verb",plain:"is"},{term:"function as",pos:"verb",plain:"is"},{term:"boast",pos:"verb",plain:"has"},{term:"it features",pos:"phrase",forms:["also features","which features","that features","it also features"],plain:"has"},{term:"it offers",pos:"phrase",forms:["also offers","which offers","it also offers"],plain:"has"},{term:"is home to",pos:"phrase",plain:"has"}]},judge:{ask:"Does \u201C{term}\u201D in the target stand in for a plain \u201Cis\u201D or \u201Chas\u201D?",yes:"The library boasts full support; the inn stands as a landmark; it features a plugin system.",no:"A literal action, as in a person boasting about a win, a film featuring an actor, a server acting as a proxy.",context:"paragraph"},default:!0},{id:"promo-adjective",color:"#835b70",mark:"strike-through",label:"Promotional adjective",level:"word",why:"Praise instead of description.",fix:"Describe the thing and let the reader judge.",edit:"delete",detector:{kind:"lexicon",terms:[{term:"vibrant",pos:"adj"},{term:"stunning",pos:"adj"},{term:"breathtaking",pos:"adj"},{term:"groundbreaking",pos:"adj"},{term:"renowned",pos:"adj"},{term:"seamless",pos:"adj"},{term:"robust",pos:"adj"},{term:"nestled",pos:"phrase"},{term:"cutting-edge",pos:"phrase"},{term:"state-of-the-art",pos:"phrase"},{term:"world-class",pos:"phrase"},{term:"best-in-class",pos:"phrase"},{term:"innovative",pos:"adj"},{term:"revolutionary",pos:"adj"},{term:"game-changing",pos:"phrase"},{term:"game-changer",pos:"noun"},{term:"unparalleled",pos:"adj"},{term:"unmatched",pos:"adj"},{term:"unrivaled",pos:"adj"},{term:"transformative",pos:"adj"},{term:"effortless",pos:"adj"},{term:"intuitive",pos:"adj"},{term:"next-level",pos:"phrase"},{term:"top-notch",pos:"phrase"},{term:"must-have",pos:"phrase"},{term:"awe-inspiring",pos:"phrase"},{term:"captivating",pos:"adj"}]},judge:{ask:"Is \u201C{term}\u201D in the target promotional praise rather than a checkable description?",yes:"Breathtaking views, a vibrant scene, seamless integration, a robust platform, an intuitive interface.",no:"A measurable or technical use, as in a robust statistical estimator or an innovative method the text then describes in detail.",context:"paragraph"},default:!0},{id:"signpost",color:"#75642f",mark:"strike-through",label:"Signposting",level:"word",why:"Announces a point instead of making it.",fix:"Cut the opener and start with the point.",edit:"delete",detector:{kind:"lexicon",terms:[{term:"here's the thing"},{term:"here's why"},{term:"here's how"},{term:"here's what"},{term:"here's the kicker"},{term:"let's dive in"},{term:"let's dive into"},{term:"let's delve into"},{term:"let's break it down"},{term:"let's take a closer look"},{term:"let's explore"},{term:"the bottom line is"},{term:"the truth is"},{term:"the reality is"},{term:"make no mistake"},{term:"simply put"},{term:"put simply"},{term:"in conclusion"},{term:"in summary"},{term:"to sum up"},{term:"all in all"},{term:"at its core"},{term:"ultimately",start:!0},{term:"and the best part?"},{term:"the best part?"},{term:"the result?"},{term:"the catch?"},{term:"spoiler alert"},{term:"let that sink in"},{term:"now more than ever"},{term:"it's no secret that"},{term:"in today's fast-paced world"},{term:"in today's fast-paced digital landscape"},{term:"in today's digital age"},{term:"in today's rapidly evolving landscape"},{term:"in today's ever-changing world"},{term:"in today's competitive landscape"},{term:"in an era of"}]},judge:{ask:"Is \u201C{term}\u201D in the target an empty opener or hook that announces a point instead of making it?",yes:"Here's the thing:, Let's dive in, Simply put, And the best part?, In conclusion, In today's fast-paced world.",no:"The words do real work, as in a genuine question the text answers next, or a summary that adds information.",context:"paragraph"},default:!0},{id:"contrast",color:"#994b52",mark:"circle",label:"Not X, but Y",level:"sentence",why:"Sets up a claim just to knock it down.",fix:"State the second half on its own.",edit:"replace",detector:{kind:"pattern",pattern:"contrast"},judge:{ask:"Is the target a punchy not-X-but-Y reveal (\u201CX isn't A; it's B\u201D, \u201Cnot just A, it's B\u201D, \u201Cit's not about A, it's about B\u201D) used for effect, whether or not it's true?",yes:"It's not a tool, it's a movement; Design isn't decoration. It's how it works; Not just faster, but smarter; Success isn't luck. It's practice.",no:"Concessions (They aren't finished, but they're usable); not only X but also Y; plain explanations and descriptions (The table isn't solid wood; it's veneer); contrasts inside longer reasoning; a story's narration.",context:"paragraph"},default:!0},{id:"three",color:"#87532f",mark:"underline",label:"List of three",level:"sentence",why:"Three items for rhythm, not because there are three.",fix:"Keep the items that carry meaning.",edit:"replace",detector:{kind:"pattern",pattern:"three"},judge:{ask:"Does the target use a decorative list or parallel sequence of three that substitutes rhythm for substance?",yes:"Three interchangeable qualities or audiences: fast, reliable, and secure; plan smarter, ship faster, grow bigger; a founder, a marketer, or an engineer; Speed matters. Focus matters. Clarity matters.",no:"A necessary inventory of three real fields, steps or named items; not every list of three is bad.",context:"paragraph"},default:!0},{id:"hedging",color:"#596b86",mark:"underline",label:"Stacked hedges",level:"sentence",why:"Several hedges in one claim dodge commitment.",fix:"Keep one hedge, or commit.",edit:"replace",detector:{kind:"pattern",pattern:"hedging"},judge:{ask:"Does the target stack several hedges (could, potentially, possibly, some, generally, tend to) so the claim avoids committing?",yes:"Could potentially possibly help some teams in certain cases; people generally tend to prefer.",no:"One justified hedge, or an explicit limit on the evidence.",context:"paragraph"},default:!0},{id:"attribution",color:"#416c8d",mark:"caret",label:"Vague attribution",level:"sentence",why:"Cites authority nobody can check.",fix:"Name the source, or cut the claim.",edit:"insert",detector:{kind:"pattern",pattern:"attribution"},judge:{ask:"Does the target appeal to vague authority or imply evidence without a checkable source?",yes:"Experts agree; studies show; many believe; research suggests, with no named study or person.",no:"A named source, a quoted person, an explicit opinion, or a claim that does not invoke outside authority.",context:"paragraph"},default:!0},{id:"trailing",color:"#786348",mark:"strike-through",label:"Trailing -ing clause",level:"sentence",why:"Bolts an unsupported conclusion onto a fact.",fix:"Cut the clause, or give it its own evidence.",edit:"delete",detector:{kind:"pattern",pattern:"trailing"},judge:{ask:"Does the target bolt an unsupported interpretation onto a fact using a trailing -ing clause?",yes:"The feature shipped, highlighting our commitment to excellence; revenue doubled, cementing its position as a leader.",no:"A clause describing a real action or a direct, supported consequence.",context:"paragraph"},default:!0},{id:"residue",color:"#816044",mark:"strike-through",label:"Chatbot residue",level:"sentence",why:"A conversational leftover that addresses no real reader.",fix:"Delete it.",edit:"delete",detector:{kind:"lexicon",terms:[{term:"i hope this helps"},{term:"hope this helps"},{term:"let me know if you have any questions"},{term:"let me know if you have questions"},{term:"let me know if you need"},{term:"feel free to reach out"},{term:"feel free to ask"},{term:"great question"},{term:"certainly!"},{term:"absolutely!"},{term:"as an ai"},{term:"i'd be happy to"},{term:"happy to help"},{term:"i hope you found this"},{term:"stay tuned"},{term:"happy coding"},{term:"without further ado"},{term:"in this article, we"},{term:"in this post, we'll"}]},judge:{ask:"Is \u201C{term}\u201D in the target chatbot or newsletter residue, a conversational leftover that addresses no real reader?",yes:"I hope this helps!, Let me know if you have any questions., Great question!, Without further ado.",no:"Direct address that fits the document, such as a real sign-off in a personal letter.",context:"paragraph"},default:!0},{id:"false-range",color:"#6f5f86",mark:"underline",label:"False range",level:"sentence",why:"\u201CFrom X to Y\u201D with no real scale between them.",fix:"Name the things, or the one that matters.",edit:"replace",detector:{kind:"pattern",pattern:"false-range"},judge:{ask:"Does the target use a \u201Cfrom X to Y\u201D phrase (or \u201Crange from X to Y to Z\u201D, \u201Cfrom X through Y and beyond\u201D) to gesture at breadth instead of naming what matters?",yes:"From startups to enterprises; from ideas to impact; from the first sketch through launch and beyond; ranging from corner shops to global brands to city governments.",no:"A literal change from one thing to another (moving from tables to a document store); a real numeric, time, size or step range (from 2019 to 2024, from 10 ms to 200 ms, from the first call to the tenth).",context:"paragraph"},default:!0},{id:"puffery",color:"#8a565e",mark:"underline",label:"Puffery",level:"sentence",why:"Asserts importance instead of showing it.",fix:"Say what happened and let the reader judge.",edit:"replace",detector:{kind:"judge"},judge:{ask:"Does the target assert importance, success or a bright future without showing the event or evidence?",yes:"A pivotal moment; a true game-changer; the results speak for themselves; the future is bright; the backbone of modern commerce.",no:"A concrete result, a measured number, or an opinion clearly framed as the writer's own.",context:"paragraph"},default:!0},{id:"generic-voice",color:"#655b82",mark:"bracket",label:"Generic voice",level:"paragraph",why:"Could describe any company; no specific detail or stance.",fix:"Add a specific fact, example or opinion.",edit:"paragraph",detector:{kind:"judge"},judge:{ask:"Is the target filler a reader could skip: general claims or advice that any piece on the topic could make, with nothing specific in it (an example, number, name, firsthand detail, analogy, or a stance someone could disagree with)?",yes:"Communication is key to any successful team, and great teams invest in it; focusing on what matters most helps teams deliver value; at the end of the day it's about creating an environment where people can do their best work.",no:"A paragraph that carries the argument forward with a specific claim, example, analogy or firsthand detail; one that names or defines specific things; a short lead-in to specifics that follow; neutral technical instructions.",context:"none"},default:!0},{id:"repetition",color:"#4f705e",mark:"bracket",label:"Repetition",level:"paragraph",why:"Says the same thing again without adding to it.",fix:"Say it once, then move on.",edit:"paragraph",detector:{kind:"judge"},judge:{ask:"Does the target repeat the same point in different words without adding new information?",yes:"Consistency matters because a consistent brand is memorable, and memorable brands are consistent.",no:"Each sentence adds a new fact, step, example or turn of argument.",context:"none"},default:!0},{id:"over-explaining",color:"#76614d",mark:"bracket",label:"Over-explaining",level:"paragraph",why:"Explains what the reader already knows.",fix:"Cut to what's new to the reader.",edit:"paragraph",detector:{kind:"judge"},judge:{ask:"Does the target explain something obvious or familiar step by step, as if the reader lacked basics they already have?",yes:"Explaining what email or a password is to people who use them daily; defining a common term and then restating the definition.",no:"New, technical or surprising information explained once at the level the reader needs.",context:"none"},default:!0},{id:"rhythm",color:"#4c6a79",mark:"bracket",label:"Uniform rhythm",level:"paragraph",why:"Every sentence has the same length and shape.",fix:"Vary the sentence lengths; combine or split some.",edit:"paragraph",detector:{kind:"pattern",pattern:"rhythm"},judge:{ask:"Do the sentences in the target have nearly uniform length and structure, so the paragraph reads with a mechanical, repetitive rhythm?",yes:"Six short sentences that all start with \u201CWe\u201D and run five to seven words.",no:"Sentence lengths and shapes vary, or repetition is a deliberate, effective device.",context:"none"},default:!0},{id:"em-dash",color:"#7a584c",mark:"underline",label:"Em dash",level:"word",why:"A dramatic pause before a reveal.",fix:"Use a period or a comma.",edit:"replace",detector:{kind:"pattern",pattern:"em-dash"},judge:{ask:"Does the dash in the target set up a reveal for effect (a dramatic pause before a twist, a punchline, a summary or a restatement), the way machine-written prose uses it, where a period or comma would read as well?",yes:"They weren't bigger\u2014they were just better; The update is small \u2014 but it changes everything; One tool \u2014 endless possibilities; We tried everything \u2014 and then we tried one more thing.",no:"A pair of dashes around an aside (The results\u2014three studies in all\u2014point the same way); a dash before an attribution or a list; a speaker breaking off; a range of numbers or dates.",context:"paragraph"},default:!0},{id:"colon",color:"#63733f",mark:"box",label:"Connecting colon",level:"sentence",why:"A colon used as a hinge between claims, not to introduce a list.",fix:"Split it into two sentences.",edit:"replace",detector:{kind:"pattern",pattern:"colon"},judge:{ask:"Does the colon in the target hinge a setup to its payoff for effect, where a period would do as well, rather than introduce a list, an example, a quotation, a definition, a label or a time?",yes:"The answer was simple: we stopped holding meetings; Here's the truth: nobody reads the docs; One thing became clear: speed wins; The result: happier customers.",no:"Three things matter: speed, cost and focus; Note: the API is in beta; a ratio like 3:1; a colon before a quotation, an explanation the reader needs, or the items that follow.",context:"paragraph"},default:!0},{id:"title-case",color:"#755e73",mark:"underline",label:"Title case heading",level:"sentence",why:"Title Case headings read like marketing copy.",fix:"Use sentence case.",edit:"replace",detector:{kind:"pattern",pattern:"title-case"},default:!1,severity:"warning"},{id:"bold",color:"#586b68",mark:"underline",label:"Bold inflation",level:"word",why:"Bold used for emphasis instead of scanning.",fix:"Keep bold for labels a reader scans for.",edit:"replace",detector:{kind:"pattern",pattern:"bold"},judge:{ask:"Is the bold on \u201C{term}\u201D in the target hype: emphasis that makes ordinary words sound important, rather than a key term, warning or point a reader scans for?",yes:"This is **really** important; Every plan includes **unlimited** projects; We **never** compromise on quality; a **game-changing** feature.",no:"A term defined where it's introduced; a section's main point stated plainly for a reader who skims; a warning the reader must not miss; a button or menu name in instructions; a person's name after a quotation.",context:"paragraph"},default:!0}]};var Sl={actor:"attribution"};function is(t){return as.rules.find(e=>e.id===(Sl[t]??t))}function ss(t,e){return is(t.rule)?.edit??t.edit??e?.edit??"replace"}function ls(t){let e=new Set([...t.rules.map(n=>n.id),...t.findings.map(n=>n.rule)]);return{...t,rules:[...e].map(n=>{let r=t.rules.find(a=>a.id===n),o=is(n);return o?{...r,id:n,label:o.label,color:r?.color??"#994b52",edit:o.edit,level:o.level,why:o.why,fix:o.fix,rubric:{checks:o.why,looksLike:o.judge?.yes??"",notLike:o.judge?.no??"",fix:o.fix}}:r??{id:n,label:n,color:"#655347"}})}}function ds(t,e,n){if(e.status==="accepted"||e.status==="accepted-unrecorded")return{mark:fa(e).trim()?"underline":"caret",bracket:!1};let r=ss(e,t);if(r==="paragraph")return{mark:"underline",bracket:!0,bracketOnly:!0};if(r==="delete")return{mark:"strike-through",bracket:!1};if(r==="insert")return{mark:"caret",bracket:!1};if(n>1||e.match.length>90)return{mark:"underline",bracket:!0};let o=t.mark??"underline",a=e.proposed!==void 0&&!e.proposed.trim();return{mark:(o==="strike-through"||o==="crossed-off")&&!a?"underline":o,bracket:!1}}var cs='.badge{position:relative;display:flex;gap:4px;align-items:center;font-variant-numeric:tabular-nums}.count,.outgoing{display:inline-block;width:var(--count-width, 2ch);text-align:right}.outgoing{position:absolute;left:0;top:0;pointer-events:none}.pill-clip{position:absolute;inset:0;border-radius:22px;overflow:hidden}.pill-surface{position:absolute;inset:4px;border-radius:18px;background:#24201c;pointer-events:none}.pill-content{position:relative;display:flex;align-items:center;width:max-content;height:44px;white-space:nowrap}.header .pill button{position:relative;flex:none;display:flex;align-items:center;justify-content:center;min-height:44px;min-width:44px;height:44px;border:0;background:transparent;color:#f7f3eb;padding:0;font-size:12px;touch-action:none}.header .pill-mark{width:44px;border-radius:22px}.pill-mark:before{content:"";position:absolute;inset:4px;border-radius:50%;background:#24201c}.pill-mark svg{position:relative;width:22px;height:22px;pointer-events:none}.pill[data-circle=true] .pill-mark:before{background:#24201c}.header .pill-count{padding:0 6px;min-width:58px}.header .pill .pill-close{width:44px;font-size:22px}.pill[data-circle=true] .pill-count,.pill[data-circle=true] .pill-close{opacity:0;pointer-events:none}.pill[data-panel=true] .pill-close{visibility:hidden}.pill button:focus-visible{outline:2px solid #f7f3eb;outline-offset:-5px}.notification-dot{position:absolute;top:3.272px;left:28.728px;width:12px;height:12px;border:2px solid #24201c;border-radius:50%;background:#ff3c02;pointer-events:none}.badge{gap:4px;line-height:18px}.count,.outgoing{width:2ch;text-align:right}.pill[data-circle=false] .notification-dot{display:none}.marks{position:absolute;left:0;top:0;width:100%;height:0;z-index:20;pointer-events:none}.arrow{position:absolute;inset:0;overflow:visible;pointer-events:none}.passage,.rect{position:absolute;pointer-events:none;background:transparent}.label{position:absolute;pointer-events:auto;border:0;background:#f7f3ebed;font:500 25px/1.05 ProofmarksHand,cursive;color:var(--mark);text-align:left;padding:4px 7px;width:148px}.rough-annotation{position:absolute;left:0;top:0;overflow:visible;pointer-events:none}.rough-annotation path{animation-timing-function:cubic-bezier(.22,1,.36,1)!important}.pill-close svg{position:absolute;width:20px;height:20px;pointer-events:none}.shortcuts-help{position:fixed;z-index:2147482003;width:280px;max-width:calc(var(--layout-width) - 24px);padding:16px;background:var(--ink);color:var(--paper);border:1px solid #ffffff20;border-radius:var(--surface-radius);box-shadow:0 12px 36px #0003;pointer-events:auto}.shortcuts-help h2{font-size:14px;margin:0 28px 14px 0}.shortcuts-help>button{position:absolute;right:6px;top:5px;font-size:20px}.shortcuts-help p{display:flex;gap:12px;justify-content:space-between;font-size:11px;margin:10px 0}.shortcuts-help kbd{font:11px ui-monospace,monospace;color:var(--muted);white-space:nowrap}.label[data-offscreen=true],.arrow[data-offscreen=true]{visibility:hidden;pointer-events:none}@keyframes rough-notation-dash{to{stroke-dashoffset:0}}:host{--surface-radius: 14px;--surface-shadow: 0 1px 3px #0002, 0 8px 20px -6px #0004, 0 24px 48px -18px #0005;--ink: #24201c;--paper: #f7f3eb;--muted: oklch(0.76 0.015 70);position:absolute;left:0;top:0;width:100%;height:0;pointer-events:none;color:var(--paper);font:14px/1.45 system-ui,sans-serif;color-scheme:dark}*{box-sizing:border-box}[hidden]{display:none!important}button{touch-action:manipulation;cursor:pointer;min-height:32px;min-width:32px;font:inherit;color:inherit;background:transparent;border:0;border-radius:6px;padding:6px 10px}button:disabled{cursor:default;color:var(--muted);opacity:.65}button:focus-visible{outline:2px solid var(--paper);outline-offset:-3px}button:active{transform:translateY(1px)}.panel{position:fixed;left:0;top:0;z-index:2147482000;width:330px;max-width:calc(var(--layout-width) - 20px);min-height:46px;max-height:calc(100dvh - 100px);overflow:hidden;pointer-events:auto;background:var(--ink);border-radius:var(--surface-radius);box-shadow:var(--surface-shadow);will-change:transform}.panel[data-expanded=false]:not([data-animating]){background:transparent;box-shadow:none}.header{height:46px;position:absolute;inset:0;z-index:2}.header{pointer-events:none}.header .pill{pointer-events:auto}.header .pill{position:relative;display:block;height:44px;min-height:44px;padding:0;border:0;border-radius:22px;overflow:visible;color:var(--paper);background:transparent;touch-action:none;user-select:none;position:absolute;left:0;top:var(--badge-y, 0px);transform:none;cursor:grab}.panel[data-slot$=right] .pill{left:auto;right:2px}.panel[data-slot$=center] .pill{left:calc(50% - 1px);transform:translate(-50%)}.panel[data-dragging=true] .pill{cursor:grabbing}.marks [data-status^=accepted] .rect,.marks [data-status^=accepted] .arrow path{opacity:.45}.marks [data-active=true] .label{font-weight:700;text-decoration:underline;text-underline-offset:4px}.label:focus-visible{outline-color:var(--mark)}.card{position:absolute;z-index:2147482000;right:16px;top:155px;width:330px;max-width:calc(var(--layout-width) - 20px);max-height:calc(100dvh - 100px);overflow:auto;background:var(--ink);color:var(--paper);border:1px solid oklch(0.3 0.01 70);border-radius:var(--surface-radius);padding:14px;pointer-events:auto;box-shadow:var(--surface-shadow)}.card.dock-card{z-index:1;background:transparent;position:relative!important;inset:auto!important;transform:none!important;width:330px;max-width:100%;border:0;box-shadow:none}.card header{display:flex;align-items:center;gap:2px;position:relative;margin:8px 0;min-height:44px;flex-wrap:nowrap}.card h2{flex:1;min-width:0;font:500 20px/1.2 ProofmarksHand,cursive;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0;color:var(--mark)}.card header button{font-size:22px;padding:0;width:28px;min-width:28px;height:44px;min-height:44px;flex:none}.card header button:last-child{font-size:18px}.proof-position{display:flex;align-items:center;justify-content:center;align-self:center;height:44px;min-width:42px;flex:none;font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap;margin:0 5px}.panel[data-slot^=bottom] .card.dock-card{padding-bottom:52px}.meta-info{display:flex;flex-direction:column;gap:4px;font-size:12px;line-height:1.5;color:var(--muted)}.meta-info strong{display:flex;align-items:center;gap:6px;font-weight:500;color:var(--paper)}.meta-info svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}.proof-content{position:relative}.card[data-fixed=true],.card[data-following=true]{display:flex;flex-direction:column;overflow:hidden}.card[data-fixed=true] .proof-content,.card[data-following=true] .proof-content{min-height:0;overflow:auto}.card[data-fixed=true] header,.card[data-fixed=true] .actions-shell,.card[data-following=true] header,.card[data-following=true] .actions-shell{flex-shrink:0}.card h3{font-size:10px;text-transform:uppercase;letter-spacing:.05em;margin:14px 0 5px;color:var(--muted);font-weight:500}.card p{font-size:13px;line-height:1.5;margin:4px 0;white-space:pre-wrap;overflow-wrap:anywhere}.card .original{color:var(--muted)}.card .note{font-size:12px;color:var(--muted);white-space:normal;margin-top:12px}.card .proof-empty{padding:24px 0;font-size:18px}.proof-outgoing{position:absolute;top:94px;left:14px;right:14px;pointer-events:none}.proof-status{color:var(--muted);font-size:12px;margin-right:auto}.proof-status[data-status^=accepted]{color:oklch(0.8 0.06 177)}.card[data-following=true]{position:fixed;left:0;top:0;right:auto;max-height:calc(100dvh - 24px);pointer-events:none;will-change:transform}.card[data-following=true] header button,.card[data-following=true] .proof-position{visibility:hidden}.card[data-fixed=true]{position:fixed;left:0;top:0;right:auto;max-height:calc(100dvh - 24px);will-change:transform}.actions-shell{height:0;visibility:hidden;overflow:hidden}.action-content{padding-top:14px}.actions{display:flex;gap:6px;align-items:center}.actions button{font-size:13px}.actions .primary{background:var(--paper);color:var(--ink);padding-inline:16px}.action-reason{color:var(--muted)}.toast{position:fixed;z-index:2147482001;max-width:calc(var(--layout-width) - 20px);display:flex;align-items:center;gap:12px;background:var(--ink);color:var(--paper);border-radius:8px;padding:4px 8px;font-size:12px;pointer-events:auto;box-shadow:0 6px 22px #0003}.toast button{text-decoration:underline}.mobile-sheet{position:fixed;z-index:2147482002;bottom:0;left:0;right:0;max-height:55svh;max-height:55dvh;overflow:auto;overscroll-behavior:contain;pointer-events:auto;background:var(--ink);color:var(--paper);border-radius:16px 16px 0 0;box-shadow:0 -6px 28px #0003;padding:0 12px max(12px,env(safe-area-inset-bottom));-webkit-tap-highlight-color:transparent}.sheet-handle{display:block;margin:auto;width:80px;height:44px;min-height:44px;touch-action:none;padding:0;color:var(--muted)}.sheet-close{position:absolute;right:8px;top:0;font-size:20px;z-index:2}.mobile-sheet .sheet-card{position:static!important;transform:none!important;width:100%;max-width:none;max-height:none;border:0;box-shadow:none;padding:8px 0 0;overflow:visible}.sheet-card p{font-size:15px}.sheet-card h2{font-size:22px}.sheet-card header>button:last-child{display:none}.sheet-card .actions-shell{position:sticky;bottom:0;background:var(--ink);height:auto!important}.sheet-card .actions button{min-height:48px;flex:1;font-size:16px}:host([data-sheet-open]) .toast{display:none}@media(hover:hover)and (pointer:fine){.card button:not(.primary):hover,.toast button:hover{background:oklch(0.31 0.01 70)}}@media(prefers-reduced-motion:reduce){.rough-annotation path{animation:none!important}}@media(max-width:700px),(pointer:coarse){button{min-width:44px;min-height:44px}.card header button{min-width:44px}.label{min-width:0;width:16px;height:56px;font-size:0;border-radius:0;text-align:center;background:transparent;border:0;padding:0}.label:after{content:"";position:absolute;right:3px;top:26px;width:8px;height:3px;background:var(--mark)}.label:focus-visible{outline-offset:-3px}.card kbd{display:none}}.panel,.panel[data-expanded=false]:not([data-animating]){background:transparent;box-shadow:none}.dock-surface{position:absolute;inset:0;background:var(--ink);pointer-events:none;clip-path:inset(4px 4px 4px 4px round 18px)}.panel .pill-mark:before,.panel .pill[data-circle=true] .pill-mark:before{background:transparent}.card.dock-card[hidden]{display:block!important;visibility:hidden;pointer-events:none}.pill[data-muted=true] .pill-mark{color:var(--muted)}.proof-tooltip{position:fixed;z-index:2147483000;pointer-events:none;display:inline-flex;align-items:center;gap:6px;height:20px;box-sizing:border-box;padding:4px 6px;border:0;border-radius:6px;background:#0d0d0d;color:#fff;font:500 10px/12px Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;white-space:nowrap;width:max-content;max-width:calc(var(--layout-width) - 16px);overflow:hidden;text-overflow:ellipsis;box-shadow:0 2px 2px -1px rgba(0, 0, 0, 0.12),0 4px 4px -2px rgba(0, 0, 0, 0.12),0 8px 8px -4px rgba(0, 0, 0, 0.12),0 16px 16px -8px rgba(0, 0, 0, 0.12),0 24px 24px -12px rgba(0, 0, 0, 0.12)}.proof-tooltip-key{display:inline-flex;align-items:center;gap:1px;color:rgb(255 255 255 / 0.64);font:inherit}.card .proof-empty{padding:12px 0 0}.completion{height:232px;display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px}.completion-art{height:160px;width:100%;display:grid;place-items:center;flex:none}.completion-sign{position:relative;width:210px;height:158px}.completion-pilcrow{position:absolute;width:102px;height:102px;left:28px;top:0;color:var(--paper);overflow:visible}.completion-sign-check{position:absolute;width:66px;height:64px;left:122px;top:36px;color:#a7c9b9;overflow:visible}.completion-caption{position:absolute;bottom:0;width:100%;font:30px/1.2 ProofmarksHand,cursive}.completion-equivalent{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.completion-undo{min-height:40px!important;font-size:12px;min-height:36px}.completion-badge-check{position:absolute;top:3px;left:27px;width:16px;height:16px;color:#b7d2c5;background:var(--ink);border-radius:50%;pointer-events:none}.completion-badge-check svg{display:block;width:16px;height:16px}.sheet-card .completion{height:248px}[data-severity=warning] .rect,[data-severity=warning] .passage,[data-severity=warning] .arrow{opacity:.55}.record-scores{margin-top:20px;border-top:1px solid #ffffff18}.signal-row{display:grid;grid-template-columns:1fr auto;gap:6px 10px;margin-top:12px;font-size:11px;color:var(--muted)}.signal-value{font-variant-numeric:tabular-nums}.signal-track{position:relative;grid-column:1/-1;height:5px;background:#ffffff18;border-radius:1px}.signal-fill{position:absolute;inset:0 auto 0 0;background:#f7f3eb8c}.signal-tick{position:absolute;top:-3px;width:1px;height:11px;background:var(--paper)}.card .proof-content{display:flex;flex-direction:column;gap:16px;padding:4px 0 8px}.card .proof-content p{font-size:14px;line-height:1.5;margin:0;overflow-wrap:anywhere}.card .proof-content .rule-check{font-size:12px;color:var(--muted);white-space:normal;text-wrap:pretty}.proof-pair{display:flex;flex-direction:column;gap:12px}.proof-version{display:flex;flex-direction:column;gap:4px}.card .proof-pair h3{font-size:12px;line-height:1.5;font-weight:500;text-transform:none;letter-spacing:0;color:var(--muted);margin:0}.card .proof-pair .original{color:var(--muted)}.card .proof-content .note{font-size:12px;line-height:1.5;white-space:normal;color:var(--paper);text-wrap:pretty}.card .proof-content .copy-note{color:var(--muted)}@media(max-width:700px),(pointer:coarse){.card .proof-content p{font-size:15px}.card .proof-content .rule-check,.card .proof-content .note,.card .proof-pair h3{font-size:12px}}';function ps(t){let e=t.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("aria-hidden","true");for(let n of["M19.2 12.6C18.9 16.6 15.6 19.8 11.7 19.8C7.6 19.8 4.3 16.4 4.4 12.2C4.5 8.1 7.9 4.8 12 4.9C14.6 5 16.8 6.3 18.1 8.3","M18.7 3.9L18.3 8.6L13.8 8.1"]){let r=t.createElementNS("http://www.w3.org/2000/svg","path");r.setAttribute("d",n),e.append(r)}return e}function ya(t,e){let n=t.createElementNS("http://www.w3.org/2000/svg","svg"),r=t.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("viewBox","0 0 24 24"),n.setAttribute("aria-hidden","true"),r.setAttribute("d",e==="previous"?"M14.25 7L9.75 12L14.25 17":"M9.75 7L14.25 12L9.75 17"),n.append(r),n}function us(t,e){let n=rn(t),r=n.map(o=>({version:o.version,rewrite:o}));return e&&n.length&&r.push({version:Math.max(t.rewriteRequest?.version??0,n.at(-1).version+1)}),r}function hs(t,e,n){return t.find(r=>r.version===e)??t.find(r=>r.rewrite&&r.rewrite.text===n)??t.filter(r=>r.rewrite).at(-1)??t.at(-1)}function fs(t,e,n,r){let o=t.findIndex(i=>i.id===n),a=t.length;for(let i=1;i<=a;i++){let l=t[((o<0?r>0?-1:0:o)+r*i+a*(i+1))%a];if(e.has(l.id))return l}}var ms=(t,e,n)=>(t.status??"open")==="open"&&!t.actionReason&&e!==void 0&&!n?.rewrite?.stillFlagged;function gs(t,e,n){return n?`Accepting ${Math.min(n.done+1,n.total)} of ${n.total}\u2026`:`${t} ${t===1?"rewrite":"rewrites"} ready`+(e?`, and ${e} to check yourself.`:".")}function kn(t){let e=t.filter(n=>(n.status??"open")==="open");return{ready:e.filter(n=>rn(n).length>0),writing:e.filter(n=>["pending","claimed"].includes(n.rewriteRequest?.status??"")),missing:e.filter(n=>n.proposed===void 0&&!["pending","claimed"].includes(n.rewriteRequest?.status??""))}}function Mn(t){let e=ls(t);return{...e,findings:yn(e.findings)}}function cc({root:t,setupHint:e,agents:n,onSelectTarget:r,onCancelRewrite:o,avoid:a=[],findings:i,rules:l,source:c,reviewId:d,onAccept:u,onDismiss:x,onRevert:h,onRequestRewrite:f,onReview:y,onResetStrictness:k,strictness:E=[],onMeasure:A,enabled:R,badgeSlot:S,optimisticText:L=!1,formatOptimisticText:$=m=>m}){({findings:i,rules:l}=Mn({findings:i,rules:l}));let m=t.ownerDocument,M=m.defaultView,Y=ci({empty:i.length===0}),O="proof",J,re={connected:!1,reason:"Proofmarks companion is not running. Start proofmarks serve."},se=!1,le=E,j=!1,Z=n,he=!n&&!r?"Connect an MCP agent in watch mode, or install Claude Code, Codex or pi.":void 0,fe=!1,Be=new Map,Ee=m.createElement("div");Ee.dataset.proofmarks="",Ee.style.setProperty("--layout-width",`${Se(m)}px`);let q=m.documentElement.getAttribute("data-proofmarks-on"),oe=m.createElement("style");Ee.append(oe);let N=()=>{q===null?m.documentElement.removeAttribute("data-proofmarks-on"):m.documentElement.setAttribute("data-proofmarks-on",q)},B=Ee.attachShadow({mode:"open"}),W=m.createElement("style");W.textContent=cs+hi+li,B.append(W);let ie=m.createElement("div");ie.className="marks",B.append(ie);let Q=m.createElement("div");Q.className="d-surface-shadow",B.append(Q);let H=m.createElement("aside");H.className="panel",H.setAttribute("aria-label","Proofmarks writing review"),B.append(H);let xe=m.createElement("div");xe.className="dock-surface",xe.setAttribute("aria-hidden","true"),H.append(xe);let v=m.createElement("section");v.className="card",v.hidden=!0,v.setAttribute("role","dialog"),v.setAttribute("aria-label","Writing proposal"),B.append(v),m.body.append(Ee);let ct,Pe=R??new URL(M.location.href).searchParams.get("proof")==="1",ee=!1,br=0,Ae=!1,Qe=[],co=new Gr,pt=()=>co.order(i,Qe);function va(){Qe=mr(t,i);let s=i.filter(p=>p.status==="dismissed").map(p=>({...p,status:"open"}));co.order(i,[...Qe,...s.length?mr(t,s):[]])}let Je=new Map,ln=s=>new DOMRect(s.x+M.scrollX,s.y+M.scrollY,s.width,s.height),G,Lt="text",En,po,ut,Ze=[],dn,kt,Mt=[],Wt=0,xr,Et,yr,wa=0,Yn=!1,Ce,Vn=0,Rt,vr;function ht(){clearTimeout(xr),clearTimeout(Et),Et=void 0,yr=void 0}let Te=!1,et=!1,Yt=!1,wr,uo,$t=!1,ho=!1,Nt,cn=[],ft,Xn=!1,pe=!1,kr,Vt,Mr,Xt=()=>{let s=kr;kr=void 0,s?.()},_t={width:330,height:0},Cn={left:!1,above:!1},Ot,Ut,Sn,Er=new WeakMap;function Cr(s,p){Er.set(s,p),s.dataset.reshaping="";let g=()=>{Er.get(s)===p&&(Er.delete(s),delete s.dataset.reshaping)};return p.finished.then(g,g),p}let mt={width:Se(m),height:M.innerHeight},Ct,te=M.matchMedia("(pointer: coarse), (max-width: 700px)"),fo=M.matchMedia("(hover: hover) and (pointer: fine)"),Pn=()=>{let s=v.getBoundingClientRect(),p=Er.get(v),g=p&&p.effect?.getKeyframes().at(-1)?.height;_t={width:s.width,height:typeof g=="string"?parseFloat(g):s.height}};function ka(){if(!Te||v.hidden||!Ce)return;let s=xa(Ce.x,Ce.y,_t.width,_t.height,mt.width,mt.height,Cn);v.style.transform=`translate3d(${s.x}px, ${s.y}px, 0)`}function An(s){if(te.matches||_||Yt||$t)return;if(Te){ka();return}if(Ut){let b=Math.min(_t.width,mt.width-24),P=Math.min(_t.height,mt.height-24);v.dataset.fixed="true",v.style.left="0px",v.style.top="0px",v.style.transform=`translate3d(${Math.max(12,Math.min(Ut.x-M.scrollX,mt.width-b-12))}px,${Math.max(12,Math.min(Ut.y-M.scrollY,mt.height-P-12))}px,0)`,en||ar();return}let p=Mt.find(b=>b.finding.id===s.id)?.rects[0];Ot??=p?{x:p.left+Math.min(p.width/2,180),y:p.top+p.height/2}:{x:M.scrollX+mt.width/2,y:M.scrollY+mt.height/2};let g=Ji(Ot.x-M.scrollX,Ot.y-M.scrollY,_t.width,_t.height,mt.width,mt.height,Cn);v.dataset.fixed="true",v.style.left="0px",v.style.top="0px",v.style.transform=`translate3d(${g.x}px,${g.y}px,0)`,en||ar()}let ge=M.matchMedia("(prefers-reduced-motion: reduce)"),be=(s,p)=>{let g=m.createElement("button");return g.type="button",g.textContent=s,g.addEventListener("click",p),g},gt=s=>s.status==="accepted"||s.status==="accepted-unrecorded"?{id:s.rule,label:"Accepted",color:"#38766b",mark:"underline"}:l.find(p=>p.id===s.rule)??{id:s.rule,label:s.rule,color:"#655347"},Kt=m.createElement("header"),Dt=be("",()=>Xe("why")),Ma=m.createTextNode("");Dt.append(Ma),Dt.className="d-rule";let pn=be("Close the proof",()=>yt());pn.className="d-sr-close",pn.setAttribute("aria-label","Close the proof"),Kt.append(Dt,pn),v.append(Kt);let bt=be("",()=>yt());bt.className="surface-logo",bt.setAttribute("aria-label","Proofmarks, close review"),bt.append(fr(m));let tt=be("",()=>Xe("overview"));tt.className="proof-position";let _n=m.createElement("span");_n.className="counter-live d-sr",_n.setAttribute("aria-live","polite"),v.append(_n);let Gt=be("\u2039",()=>Hr(-1)),St=be("\u203A",()=>Hr(1));Gt.setAttribute("aria-label","Previous proof"),St.setAttribute("aria-label","Next proof"),Gt.dataset.step="previous",St.dataset.step="next";let nt=m.createElement("footer");nt.className="d-footer",nt.append(Gt,tt,St);let de=m.createElement("div");de.className="proof-content",v.append(de);let Un=m.createElement("div");Un.className="meta-info",Un.hidden=!0,de.append(Un);let Ea=m.createElement("strong"),Ca=m.createElement("span"),Sr=m.createElementNS("http://www.w3.org/2000/svg","svg");Sr.setAttribute("viewBox","0 0 24 24"),Sr.setAttribute("aria-hidden","true");let Sa=m.createElementNS("http://www.w3.org/2000/svg","path");Sa.setAttribute("d","M3 3.5 20.5 21 M9 5.5C14 3.8 19 7.5 22 12c-1 1.7-2.1 3-3.5 4 M15.3 18.2C10 20 4.6 16.9 2 12c1.1-1.8 2.4-3.3 4-4.5 M10 9.8c-2.6 2.7 1.1 6.6 4 4.2"),Sr.append(Sa),Ea.append(Sr,Ca);let mo=m.createElement("span");mo.textContent="Not on the page \xB7 read by search and AI",Un.append(Ea,mo);let bs=s=>s.field==="takeaways"?`Takeaway ${(s.index??0)+1}`:s.field==="summary"?"Summary":"Description",Tn=new Map,Ln=m.createElement("p");Ln.className="rule-check",Ln.hidden=!0,de.append(Ln);let Qt=m.createElement("div");Qt.className="proof-pair",de.append(Qt);let Pa=s=>{let p=m.createElement("span");p.className="d-sr",p.textContent=s+": ";let g=m.createElement("p"),b=m.createTextNode(""),P=m.createElement(s==="Original"?"del":"ins");P.append(b),g.append(P);let C=m.createElement("div");return C.className="proof-version",C.append(p,g),Qt.append(C),{text:b,paragraph:g,change:P,item:C}},{text:xs,paragraph:ys,change:vs}=Pa("Original"),{text:ws,item:ks}=Pa("Rewrite");ys.className="original",Qt.setAttribute("role","group"),Qt.setAttribute("aria-label","Proposed change: original struck through, followed by the rewrite");let Kn=new Map,Ie=m.createElement("div");Ie.className="version-nav",Ie.setAttribute("role","group"),Ie.setAttribute("aria-label","Rewrite versions"),Ie.hidden=!0;let Rn=be("",()=>bo(-1)),$n=be("",()=>bo(1)),Gn=m.createElement("span");Rn.append(ya(m,"previous")),$n.append(ya(m,"next")),Gn.className="version-label",Gn.setAttribute("aria-hidden","true"),Rn.setAttribute("aria-label","Previous version"),$n.setAttribute("aria-label","Next version"),Rn.setAttribute("aria-keyshortcuts","["),$n.setAttribute("aria-keyshortcuts","]"),Ie.append(Rn,Gn,$n);let We=be("",()=>{let s=i.find(p=>p.id===G);s&&xo(s)});We.className="try-another",We.hidden=!0,We.setAttribute("aria-label","Try another rewrite"),We.append(ps(m));let Qn=m.createElement("div");Qn.className="version-tools",Qn.hidden=!0,Qn.append(Ie,We),Kt.insertBefore(Qn,pn);let Pt=m.createElement("p");Pt.className="note anchor-reason",Pt.setAttribute("role","status"),Pt.hidden=!0,de.append(Pt);let Jn=m.createElement("p");Jn.className="note copy-note",Jn.textContent="Also updates the copy search and AI read.",Jn.hidden=!0,de.append(Jn);let Nn=m.createElement("p");Nn.className="note rewrite-warning",Nn.hidden=!0,de.append(Nn);let un=m.createElement("p");un.className="note rewrite-prompt",un.setAttribute("role","status"),un.hidden=!0,de.append(un);let Ms=si(un),zt=m.createElement("div");zt.className="proof-empty",zt.hidden=!0,v.append(zt);let we=m.createElement("div");we.className="actions-shell",we.style.height="0px",we.inert=!0;let hn=m.createElement("div");hn.className="action-content";let fn=m.createElement("div");fn.className="actions",hn.append(fn),we.append(hn),v.append(we,nt);let Zn=m.createElement("span");Zn.className="proof-status",fn.append(Zn);let qe=["accept","dismiss","revert"].map(s=>{let p=be(s==="accept"?"Accept":s==="dismiss"?"Dismiss":"Revert",()=>{let g=i.find(b=>b.id===G);g&&Br(s,g)});return p.dataset.action=s,s==="accept"&&(p.className="primary"),fn.append(p),p}),xt=be("Ask your agent for a rewrite",()=>{let s=i.find(p=>p.id===G);s&&xo(s)});xt.className="primary ask-rewrite",fn.prepend(xt);let Ye=be("Cancel",()=>{let s=i.find(p=>p.id===G);s&&vo(s)});Ye.dataset.cancelRewrite="",Ye.hidden=!0,fn.insertBefore(Ye,qe[1]);let Pr=be("Switch target",()=>{Xe("settings"),ae.querySelector("[data-rewrite-targets]")?.scrollIntoView({block:"nearest"})});Pr.className="rewrite-target",Pr.hidden=!0,Qt.after(un,Pr),Gt.setAttribute("aria-keyshortcuts","ArrowLeft"),St.setAttribute("aria-keyshortcuts","ArrowRight");for(let[s,p]of qe.entries())p.setAttribute("aria-label",p.textContent),p.setAttribute("aria-keyshortcuts",["A","D","U"][s]);pn.setAttribute("aria-keyshortcuts","Escape");let er=m.createElement("p"),Ar=m.createTextNode("");er.className="action-reason",er.setAttribute("role","status"),er.append(Ar),hn.append(er);let tr=m.createElement("p"),Aa=m.createElement("span"),go=be("Cancel all",()=>{vo()});tr.className="queue-line",tr.hidden=!0,go.dataset.cancelRewrites="",tr.append(Aa,go),hn.append(tr);let Tr=kn(i).writing.length>1,nr=()=>{if(!Tr)return!1;let s=kn(i);return!s.ready.length&&!s.writing.length&&(Tr=!1),Tr};function Jt(s){let p=(s.status??"open")==="open",g=Xr(s,Z,Date.now(),Be.get(s.id)),b=p?us(s,g.waiting||g.failed):[],P=hs(b,Kn.get(s.id),s.proposed);return{request:g,slots:b,slot:P,text:p&&P?P.rewrite?.text:s.proposed}}function bo(s,p){let g=i.find(z=>z.id===G);if(!g||v.hidden||O!=="proof")return;let{slots:b,slot:P}=Jt(g),C=p!==void 0?b.find(z=>z.version===p):b[b.indexOf(P)+s];if(!C||C===P)return;Kn.set(g.id,C.version);let T=te.matches?Fe.element:_?H:v,w=T.getBoundingClientRect().height;Bt(g),Ve(g),An(g),ge.matches||(ut?.cancel(),ut=Cr(T,T.animate([{height:`${w}px`},{height:`${T.getBoundingClientRect().height}px`}],{duration:180,easing:ke})),Ze.push(Qt.animate([{opacity:.4},{opacity:1}],{duration:160,easing:ke}))),me.textContent=Ie.dataset.label??""}function Es(){let s=kn(i);tr.hidden=!f||!(s.writing.length>1||nr()&&s.writing.length>0),Aa.textContent=`${s.writing.length} ${s.writing.length===1?"rewrite":"rewrites"} on the way`,go.disabled=pe}function Ta(s){ho=s,we.inert=!s,we.style.visibility=s?"visible":"hidden",we.style.height=s?`${hn.offsetHeight}px`:"0px",Pn()}function Lr(){wr?.cancel(),wr=void 0,uo=void 0,Yt=!1,delete v.dataset.closing,v.style.removeProperty("transform-origin"),v.style.removeProperty("clip-path"),v.style.removeProperty("height"),de.style.removeProperty("height"),de.style.removeProperty("flex-shrink"),we.style.removeProperty("clip-path")}function yt(s=!1){if($e.settle(),Nt){let C=M.getComputedStyle(v).transform,T=M.getComputedStyle(v).height;ft?.(),v.style.transform=C,v.style.height=T}if(_){_e(!1);return}if(Yt||v.hidden)return;ht(),cancelAnimationFrame(Wt),Wt=0,Ce&&G&&(Rt={...Ce,id:G});let p=()=>{v.hidden=!0,it(),Lr(),et=!1,Te=!1,Ot=void 0,Ut=void 0,Sn=void 0,Ra(),zo(),delete v.dataset.fixed,Ta(!1),vt()};if(Fe.isOpen()){Fe.close(),p();return}let g=M.getComputedStyle(v).transform,b=we.getBoundingClientRect().height;$t=!1,v.style.transform=g,we.style.height=`${b}px`,Yt=!0,v.dataset.closing="true",Te=!1,et=!1,v.inert=!0,Ir(!0),v.style.transformOrigin="0 0";let P=g==="none"?"":g;if(uo=p,wr=v.animate([{opacity:1,transform:`${P} scale(1)`},{opacity:0,transform:`${P} scale(${ge.matches?1:.98})`}],{duration:ge.matches?0:s?80:140,easing:"cubic-bezier(.22,1,.36,1)",fill:"forwards"}),wr.onfinish=p,ge.matches&&p(),Ae){let C=[...ie.querySelectorAll("button")].find(T=>T.dataset.finding===G);Yn=!0,(C&&!C.inert?C:ye.mark).focus({preventScroll:!0}),Yn=!1}}function rt(s,p=!1,g=!1,b="text"){if(Yt&&(v.hidden=!0,Lr()),p&&(Ot=void 0,Ut=void 0,Sn=void 0),!g&&!_&&!te.matches&&b==="pill"){En=s.id,_e(!0);return}Lt=b,v.dataset.entry=b,O="proof",ae.hidden=!0,v.dataset.view="proof",nt.hidden=g,!_&&v.classList.contains("dock-card")&&(v.classList.remove("dock-card"),B.append(v),lt.refresh()),te.matches&&(g=!1,Fe.review()),g||(En=s.id),v.style.opacity="1",v.dataset.proof=s.id,zt.hidden=!0,de.hidden=!1,Kt.hidden=!1,Dt.hidden=!1,we.hidden=!1,v.hidden&&(Cn={left:!1,above:!1}),et=!g,g?delete v.dataset.fixed:!_&&!te.matches&&(v.dataset.fixed="true"),Te=g,v.dataset.following=String(g),v.inert=!1,v.setAttribute("role",g?"tooltip":"dialog"),g&&(v.style.left="0px",v.style.top="0px"),clearTimeout(Et),Et=void 0,wa=Date.now(),G=s.id,v.hidden=!1;let P=l.find(C=>C.id===s.rule)??gt(s);v.style.setProperty("--mark",Qr(P.color)),Ma.data=P.label,Dt.setAttribute("aria-label",`${P.label}: details for this proof`),Bt(s),$e.hide(),Un.hidden=!s.target,mo.textContent=Qe.find(C=>C.finding.id===s.id)?.range?"Also read by search and AI":"Not on the page \xB7 read by search and AI",Ca.textContent=s.target?bs(s.target):"",Ve(s),Ta(!g),Pn(),An(s),te.matches&&Fe.reveal(s.id),zo(),Ro(),p&&(St.disabled?pn:St).focus({preventScroll:!0}),vt(),it()}function Bt(s){Ls(s);let p=l.find(F=>F.id===s.rule)??gt(s);Ln.textContent=so(p.why??p.rubric?.checks??""),Ln.hidden=!Ln.textContent,xs.data=so(s.before??s.match);let{request:g,slots:b,slot:P,text:C}=Jt(s);P&&!Kn.has(s.id)&&Kn.set(s.id,P.version),ws.data=so(C??"");let T=C===void 0,w=C==="";ks.hidden=T||w,vs.style.textDecoration=T?"none":"",Qt.setAttribute("aria-label",w?"Proposed change: delete the struck-through text":"Proposed change: original struck through, followed by the rewrite"),un.style.setProperty("--agent",g.color??""),Ms(T?g.message:"",g.working),Pr.hidden=!g.stalled||!T,Nn.hidden=!(P?P.rewrite?.stillFlagged:s.rewriteRequest?.stillFlagged)||T;let z=P?b.indexOf(P):-1,D=b.at(-1)?.version??0;Ie.hidden=b.length<2,Ie.dataset.label=P?`Version ${P.version} of ${D}`:"",Ie.setAttribute("aria-label",Ie.dataset.label||"Rewrite versions"),Gn.textContent=P?`${P.version}/${D}`:"",Gn.setAttribute("aria-hidden","true"),Rn.disabled=z<1,$n.disabled=z<0||z>=b.length-1,Nn.textContent=Nn.hidden?"":`This rewrite may still read as ${p.label}`}async function xo(s){if(pe||se||fe||!f)return;let p=!!s&&B.activeElement===xt,g=!!s&&rn(s).length>0;for(let b of s?[s]:i.filter(P=>(P.status??"open")==="open"&&P.proposed===void 0))Be.delete(b.id);pe=!0,s&&Ve(s);try{if(s&&Xr(s,Z).waiting){if(!o){let T="Cancel the earlier request before retrying.";Be.set(s.id,T),me.textContent=T;return}let P=await o(s);if(ee)return;if(P.review&&({findings:i,rules:l}=Mn(P.review)),!P.ok){let T=P.reason??"Couldn\u2019t cancel the earlier request. Try again.";Be.set(s.id,T),me.textContent=T;return}let C=s.id;if(s=i.find(T=>T.id===C),!s||!g&&s.proposed!==void 0)return}let b=await f(s,g?{another:!0}:void 0);if(ee)return;if(b.review&&({findings:i,rules:l}=Mn(b.review),st()),b.ok&&s){let P=s.id,C=i.find(T=>T.id===P)?.rewriteRequest?.version;g&&C&&Kn.set(s.id,C)}if(b.ok&&!s){Tr=!0;let P=pt().find(C=>["pending","claimed"].includes(C.rewriteRequest?.status??""));P&&!v.hidden&&at(P,!0)}if(b.ok){let P=i.find(C=>C.id===(s?.id??G));me.textContent=s&&P?Xr(P,Z).message:"Rewrite requests sent."}else{let P=b.reason??"Couldn\u2019t request a rewrite.";s&&Be.set(s.id,P),me.textContent=P}}catch{let b="Couldn\u2019t request a rewrite. Try again.";s&&Be.set(s.id,b),me.textContent=b}finally{if(pe=!1,!ee){let b=i.find(P=>P.id===G);b&&O==="proof"&&(Bt(b),Ve(b),p&&(xt.hidden?Ye.hidden?qe[1]:Ye:xt).focus({preventScroll:!0})),gn(),At()}}}function yo(){let s=ae.querySelector("[data-rewrite-targets]");s&&_r(s,{agents:Z,reason:he,busy:fe,select:p=>{La(p)}})}async function La(s){if(fe||!r)return;let p=B.activeElement instanceof HTMLElement&&!!B.activeElement.dataset.agentTarget;fe=!0,he=void 0,yo();try{let g=await r(s);if(ee)return;g.ok&&g.agents?Z=g.agents:he=g.reason??"Couldn\u2019t change the rewrite target."}catch{he="Couldn\u2019t change the rewrite target. Try again."}finally{if(fe=!1,!ee){yo();let g=i.find(b=>b.id===G);g&&O==="proof"&&!v.hidden&&g.proposed===void 0&&(g.status??"open")==="open"&&Ve(g),p&&!B.activeElement&&ae.querySelectorAll("[data-agent-target]").forEach(b=>{b.dataset.agentTarget===s&&b.focus({preventScroll:!0})})}}}async function vo(s){if(pe||!o)return;pe=!0;let p=i.find(g=>g.id===G);p&&Ve(p);try{let g=await o(s);if(ee)return;g.review&&(s&&Be.delete(s.id),{findings:i,rules:l}=Mn(g.review),st()),me.textContent=g.ok?s?"Rewrite cancelled.":"Rewrites cancelled.":g.reason??"Couldn\u2019t cancel the rewrite."}catch{me.textContent="Couldn\u2019t cancel the rewrite. Try again."}finally{if(pe=!1,!ee){let g=i.find(b=>b.id===G);g&&O==="proof"&&(Bt(g),Ve(g)),gn(),At()}}}function wo(s){Ut=void 0,Sn=void 0;let p=!v.hidden&&G===s.id?v.getBoundingClientRect():void 0,g=p&&!Te?[we,nt].map(C=>M.getComputedStyle(C).opacity):["0","0"];if(ft?.(),v.style.removeProperty("height"),de.style.removeProperty("height"),de.style.removeProperty("flex-shrink"),!p&&!_&&!te.matches&&(rt(s,!1,!0,"text"),p=v.getBoundingClientRect()),Ot=p?{x:M.scrollX+(Cn.left?p.right+16:p.left-16),y:M.scrollY+(Cn.above?p.bottom+20:p.top-20)}:Ce?{x:M.scrollX+Ce.x,y:M.scrollY+Ce.y}:void 0,ht(),_&&_e(!1,!0),rt(s,!1,!1,"text"),v.style.removeProperty("height"),v.style.removeProperty("clip-path"),!p||ge.matches||te.matches)return;let b=v.getBoundingClientRect();$t=!0,de.style.height=`${de.getBoundingClientRect().height}px`,de.style.flexShrink="0";let P=()=>{Nt?.cancel(),cn.forEach(C=>C.cancel()),Nt=void 0,cn=[],ft=void 0,de.style.removeProperty("height"),de.style.removeProperty("flex-shrink"),$t=!1,Pn()};ft=P,Nt=v.animate([{transform:`translate3d(${p.x}px,${p.y}px,0)`,height:`${p.height}px`},{transform:`translate3d(${b.x}px,${b.y}px,0)`,height:`${b.height}px`}],{duration:220,easing:ke,fill:"both"}),cn=[we,nt].map((C,T)=>C.animate([{opacity:g[T]},{opacity:1}],{duration:200,easing:ke,fill:"both"})),Nt.onfinish=P}let ko=`proofmarks:undo:${d??c??M.location.pathname}`,Rr=`proofmarks:reopen:${d??c??M.location.pathname}`,Cs=15e3;function Ra(s){try{s?M.sessionStorage.setItem(Rr,JSON.stringify({id:s,entry:_?"pill":"text",at:Date.now()})):M.sessionStorage.removeItem(Rr)}catch{}}let Mo=(()=>{try{let s=JSON.parse(M.sessionStorage.getItem(Rr)??"null");return M.sessionStorage.removeItem(Rr),s&&typeof s.id=="string"&&Date.now()-s.at<Cs?s:void 0}catch{return}})();function Ss(){let s=Mo;if(Mo=void 0,!s)return;let p=i.find(g=>g.id===s.id);!p||!v.hidden||(s.entry==="pill"&&!te.matches?(En=p.id,_e(!0)):rt(p,!1,!1,"text"))}let ot,$r,Le=m.createElement("div");Le.className="toast",Le.hidden=!0,B.append(Le);let me=m.createElement("div");me.setAttribute("role","status"),me.setAttribute("aria-live","polite"),Object.assign(me.style,{position:"absolute",width:"1px",height:"1px",overflow:"hidden",clipPath:"inset(50%)"}),B.append(me);function mn(s){ot=s;try{s?M.sessionStorage.setItem(ko,JSON.stringify(s)):M.sessionStorage.removeItem(ko)}catch{}}function Nr(){Le.hidden||!Ct||(Le.style.top=`${Ct.bottom+64<M.innerHeight?Ct.bottom+8:Math.max(80,Ct.top-64)}px`,Le.style.left=`${Math.max(12,Math.min(Ct.left,Se(m)-300))}px`,Le.style.right="auto")}function vt(){clearTimeout($r);try{ot=JSON.parse(M.sessionStorage.getItem(ko)??"null")??void 0}catch{ot=void 0}if(Le.replaceChildren(),Le.hidden=!0,!ot)return;if(ot.expires<=Date.now()){mn();return}let s=ot.id,p=i.find(P=>P.id===s);if(!p||p.status!==ot.status)return;Le.hidden=!v.hidden;let g=m.createElement("span");g.textContent=`${ot.status==="accepted"?"Accepted":"Dismissed"} ${l.find(P=>P.id===p.rule)?.label??"proof"}`;let b=be("Undo",()=>{Br("revert",p)});b.disabled=pe,Le.append(g,b),Nr(),$r=setTimeout(()=>{mn(),Le.hidden=!0},ot.expires-Date.now())}let Or,$a=()=>{m.hidden?(Or=Date.now(),clearTimeout($r)):Or!==void 0&&(ot&&mn({...ot,expires:ot.expires+Date.now()-Or}),Or=void 0,vt())};m.addEventListener("visibilitychange",$a);let Na=new WeakMap,Dr=m.createElement("canvas").getContext("2d");function zr(){for(let s of v.querySelectorAll("button:not(.primary):not(.d-rule)")){let p=s.textContent?.trim()??"",g=p+te.matches;if(Na.get(s)===g)continue;Na.set(s,g),Dr&&(Dr.font=M.getComputedStyle(s).font);let b=p&&Dr?Math.ceil(Dr.measureText(p).width)+24:32;s.style.setProperty("--control-ink-width",`${Math.max(32,b)}px`)}}function Ve(s){Pt.textContent=Go(s,!!Qe.find(U=>U.finding.id===s.id)?.range)??"",Pt.hidden=!Pt.textContent;let p=s.status??"open";Jn.hidden=!!s.target||!(s.hiddenCopies?.length||s.edits?.some(U=>U.target)),fn.dataset.decided=String(p!=="open"),Zn.hidden=p==="open",Zn.textContent=p==="dismissed"?"Dismissed":"Accepted",Zn.dataset.status=p;let g=s.actionReason??(p==="open"?!u||!x?"No action adapter is connected.":void 0:h?void 0:"No action adapter is connected."),{request:b,text:P}=Jt(s),C=P===void 0,T=b.waiting,w=B.activeElement===xt,z=B.activeElement===Ye,D=B.activeElement===We;xt.hidden=p!=="open"||!C||T&&!b.retry,xt.textContent=b.retry?"Retry":"Ask your agent for a rewrite",Ye.hidden=!T||!C,Ye.disabled=pe||se||!o,xt.disabled=pe||se||fe||!f,We.hidden=p!=="open"||!rn(s).length||!f,We.disabled=pe||se||fe||T,Qn.hidden=Ie.hidden&&We.hidden,w&&xt.hidden&&(Ye.hidden?qe[1]:Ye).focus({preventScroll:!0});for(let U of qe)U.hidden=p==="open"?U.dataset.action==="revert"||U.dataset.action==="accept"&&C:U.dataset.action!=="revert",U.disabled=pe||se||!!g||U.dataset.action==="accept"&&C;z&&Ye.hidden&&(p!=="open"?qe[2]:C?xt:qe[0]).focus({preventScroll:!0}),D&&(We.hidden||We.disabled)&&(Ye.hidden?qe[1]:Ye).focus({preventScroll:!0}),Es();let F=qe[2];F.firstChild.nodeValue="Undo",F.setAttribute("aria-label","Undo"),Ar.data=g?Kr(g):"",er.hidden=!Ar.data;for(let U of qe)U.dataset.reason=Ar.data;ho&&!$t&&(we.style.height=`${hn.offsetHeight}px`),zr()}async function Br(s,p,g=!1){Xt(),ut?.cancel(),Ze.forEach(I=>I.cancel()),Ze=[],v.querySelector(".proof-outgoing")?.remove();let b=s==="accept"?Jt(p):void 0;if(pe||se||b&&b.text===void 0)return!1;let P=s==="accept"?u:s==="dismiss"?x:h;if(!P)return!1;!v.hidden&&!g&&Ra(p.id),s!=="revert"&&!g&&(ht(),Te=!1,clearTimeout(kt),Ce&&(Rt={...Ce,id:p.id}),me.textContent=`${s==="accept"?"Accepted":"Dismissed"} ${l.find(I=>I.id===p.rule)?.label??"proof"}, ${s==="accept"?"Revert":"Restore"} available`);let C=p.hiddenCopies??[],T=p.status,w=Qe.find(I=>I.finding.id===p.id),z=b?b.text:s==="revert"&&p.status==="accepted"?p.before??p.match:void 0,D=s==="revert"&&p.status==="accepted"?p.edits?.find(I=>!I.target):void 0;if(D&&w?.range&&w.segments?.length===1&&!C.length&&(z=D.before,!D.after)){let I=m.createRange();w.gapAfter?I.setStart(w.range.endContainer,w.range.endOffset):I.setStart(w.range.startContainer,w.range.startOffset),I.collapse(!0),w={...w,range:I,segments:[I]}}let F=w?.segments?.length===1?w.segments[0]:void 0;if(w&&F&&z===""&&!C.length&&F.startContainer===F.endContainer){let I=ni(F.startContainer.nodeValue??"",F.startOffset,F.endOffset),ne=m.createRange();ne.setStart(F.startContainer,I.start),ne.setEnd(F.startContainer,I.end),w={...w,range:ne,segments:[ne]},z=I.after}if(w&&F&&z&&!C.length&&F.startContainer===F.endContainer){let I=ri(F.startContainer.nodeValue??"",F.startOffset,z);if(I<F.startOffset){let ne=m.createRange();ne.setStart(F.startContainer,I),ne.setEnd(F.startContainer,F.endOffset),w={...w,range:ne,segments:[ne]}}}let U=z===void 0?void 0:$(z,w?.segments?.map(I=>I.toString()).join("")??""),K=!g&&L&&U!==void 0&&w?.range&&!ge.matches?p.match.includes("](")?{reason:"citation source"}:_i(w.range,U):void 0;K?.reason&&A?.("morph-fallback:"+p.id+":"+K.reason);let ce=p.target?[]:s==="accept"?C:s==="revert"?p.edits?.flatMap(I=>I.target?[I.target]:[])??[]:[],Ue=mr(t,ce.map(I=>({...p,target:I}))),He=L&&U!==void 0?[...w?.segments?.length?[{segments:w.segments,replacement:U}]:[],...Ue.flatMap(I=>I.segments?.length?[{segments:I.segments,replacement:$(z,I.segments.map(ne=>ne.toString()).join(""))}]:[])]:[],Ke=He.length?Gi(He):void 0,Oe=w?.segments?.length?Ke?.primary:void 0;if(Oe&&K&&"snapshot"in K&&K.snapshot){let I=ba(Oe.range());I&&(Vt=p.id,A?.("morph-start:"+p.id),kr=Ui(B,Ee,K.snapshot,I,()=>{kr=void 0,Vt=void 0,A?.("morph-end:"+p.id),st()},ne=>A?.("morph-alignment:"+p.id+":"+ne)))}lr.takeRecords(),pe=!0;let ze=p.proposed;if(b&&(p.proposed=b.text),p.status=s==="accept"?"accepted":s==="dismiss"?"dismissed":"open",Oe&&A?.("optimistic-text"),s!=="revert"?g||mn({id:p.id,status:s==="accept"?"accepted":"dismissed",expires:Date.now()+8e3}):Oe&&mn(),Ve(p),At(),vt(),Oe){let I=Je.get(p.id)?.element;if(I){I.dataset.status=p.status,I.style.setProperty("--mark",gt(p).color);for(let Fn of I.querySelectorAll("path"))Fn.setAttribute("stroke",gt(p).color)}va();let ne=Vt;Vt=void 0,ir(),Vt=ne,st()}let dt;try{dt=await P({...p,status:T},{expectedCopies:C,...b?.slot?.rewrite?{version:b.slot.rewrite.version}:{}})}catch(I){dt={ok:!1,reason:I instanceof Error?I.message:"The action failed."}}if(pe=!1,!dt.ok)return Xt(),Ke?.rollback(),p.status=T,p.proposed=ze,s!=="revert"&&mn(),ee?void 0:(p.actionReason=dt.reason??"The action failed.",Ve(p),At(),vt(),me.textContent=Kr(p.actionReason),Le.hidden=!1,Le.textContent=Kr(p.actionReason),st(),!1);if(s==="revert"&&(mn(),me.textContent=`Restored ${l.find(I=>I.id===p.rule)?.label??"proof"} to Open`),ee)return!0;dt.review?{findings:i,rules:l}=Mn(dt.review):(p.status=s==="accept"?"accepted":s==="dismiss"?"dismissed":"open",delete p.actionReason);let wt=!g&&s!=="revert"&&an(i).complete;wt&&($e.completed(p.id),me.textContent=an(i).announcement);let nn=i.find(I=>I.id===G);if(nn&&!v.hidden&&(Ve(nn),v.style.setProperty("--mark",Qr(gt(nn).color))),st(),At(),vt(),g)return!0;if(!v.hidden){clearTimeout(po);let I=()=>{if(!(ee||v.hidden)){if(Vt){po=setTimeout(I,20);return}at(s==="revert"?i.find(ne=>ne.id===p.id):wt?void 0:i.find(ne=>ne.id===p.id),!1),Ae&&!v.hidden&&(wt?$e.undo:s==="revert"?qe[0]:qe[2]).focus({preventScroll:!0})}};I()}return!0}let Oa=()=>i.length?`${Ko(i,"reviewed").length} of ${i.length} reviewed`:"No proofs yet";function qr(s){let{slot:p,text:g}=Jt(s);return ms(s,g,p)}let qt;async function Ps(){if(qt||pe||se||!u)return;let s=pt().filter(qr);if(!s.length)return;qt={done:0,total:s.length},gn();let p=0;for(let b of s){let P=i.find(T=>T.id===b.id);if(P&&qr(P)&&await Br("accept",P,!0)&&p++,ee)return;qt.done++,gn();let C=O==="overview"&&ae.querySelector("header h2");C&&(C.textContent=Oa())}let g=qt.total;qt=void 0,me.textContent=p===g?`Accepted ${g} ${g===1?"rewrite":"rewrites"}.`:`Accepted ${p} of ${g} rewrites.`,an(i).complete&&($e.completed(s.at(-1).id),me.textContent=an(i).announcement),gn(),At()}let Eo=!1,On,Dn,Co,So,ke="cubic-bezier(.22,1,.36,1)",_=!1,Ft=!1,Po=!1,ye=zi({doc:m,win:M,reduced:ge,keyboard:()=>Ae,open:()=>_e(!_),touch:()=>te.matches,geometry:()=>queueMicrotask(()=>{ee||lt.refresh()})}),Re=ye.element,De=qi(m,M,B,ge);De.bind(bt,()=>"Close Esc"),bt.setAttribute("aria-keyshortcuts","Escape"),De.bind(Dt,()=>"Details I"),Dt.setAttribute("aria-keyshortcuts","I"),De.bind(tt,()=>"Overview O"),tt.setAttribute("aria-keyshortcuts","O"),De.bind(Gt,()=>nr()?"Previous rewrite \u2190":"Previous \u2190"),De.bind(St,()=>nr()?"Next rewrite \u2192":"Next \u2192"),De.bind(pn,()=>"Close Esc"),De.bind(Rn,()=>"Previous version ["),De.bind($n,()=>"Next version ]"),De.bind(We,()=>We.disabled&&!pe?"Another rewrite is on the way":"Try another rewrite");for(let[s,p]of qe.entries())De.bind(p,()=>p.disabled&&p.dataset.reason?p.dataset.reason:`${p.getAttribute("aria-label")} ${["A","D","U"][s]}`);De.bind(ye.countButton,()=>Y.ready?"Open review P":"Review this page P"),ye.countButton.setAttribute("aria-keyshortcuts","P");let $e=Bi({doc:m,win:M,reduced:ge,source:d??c??M.location.pathname,persistent:!0,undo:s=>{let p=i.find(g=>g.id===s);p&&Br("revert",p)},badge:(s,p)=>ye.setCompleted(s,p)});zt.append($e.element),De.bind($e.undo,()=>"Undo last decision \xB7 return to proof U");let Ht=m.createElement("div");Ht.className="header",Ht.append(Re),H.append(Ht),Ht.style.opacity="1",H.dataset.expanded="false";let rr="inset(0 0 0 0 round var(--surface-radius))",or="inset(0 0 0 0 round var(--surface-radius))";ye.mark.setAttribute("aria-keyshortcuts","P");let Me=m.createElement("section");Me.className="shortcuts-help",Me.hidden=!0,Me.setAttribute("role","dialog"),Me.setAttribute("aria-label","Proofmarks shortcuts");let Da=m.createElement("h2");Da.textContent="Proofmarks shortcuts";let Ao=be("\xD7",()=>Lo(!1));Ao.setAttribute("aria-label","Close shortcuts"),Me.append(Da,Ao);for(let[s,p]of[["P","Open / close review"],["\u21E7P","Show / hide marks"],["N / \u21E7N","Next / previous proof"],["\u2190 / \u2192","Previous / next proof"],["A / D","Accept / Dismiss"],["U","Undo"],["[ / ]","Previous / next version"],["O","Page overview"],["I","Details"],[",","Settings"],["Esc","Back / close"],["?","Show / hide shortcuts"],["\u2325 + arrows","Move badge"]]){let g=m.createElement("p"),b=m.createElement("kbd");b.textContent=s,g.append(b,m.createTextNode(p)),Me.append(g)}B.append(Me);function To(){if(Me.hidden)return;let s=Re.getBoundingClientRect(),p=Me.offsetWidth,g=Me.offsetHeight;Me.style.left=`${Math.max(12,Math.min(s.left>Se(m)/2?s.left-p-12:s.right+12,Se(m)-p-12))}px`,Me.style.top=`${Math.max(12,Math.min(s.top,M.innerHeight-g-12))}px`}function Lo(s=Me.hidden){Me.hidden=!s,s?(To(),Ao.focus({preventScroll:!0})):(Ft=!0,ye.focus())}function Ro(){let s=pt(),p=s.findIndex(b=>b.id===G),g=!zt.hidden;if(Gt.hidden=St.hidden=g,tt.textContent=s.length&&!g?`${Math.max(0,p)+1} of ${s.length}`:"Page overview",tt.setAttribute("aria-label",s.length&&!g?`Proof ${Math.max(0,p)+1} of ${s.length}. Open the page overview`:"Page overview"),nr()&&!g){let b=kn(i).ready;tt.textContent=b.length?`${b.length} ready`:"None ready yet",tt.setAttribute("aria-label",`${tt.textContent}. Open the page overview`),_n.textContent=tt.getAttribute("aria-label"),zr(),Gt.disabled=St.disabled=pe||!b.some(P=>P.id!==G),nt.hidden=Te||O!=="proof",Fr();return}_n.textContent=tt.getAttribute("aria-label"),zr(),Gt.disabled=St.disabled=s.length<2||pe,nt.hidden=Te||O!=="proof",Fr()}let ae=m.createElement("div");ae.className="d-deep",ae.hidden=!0,v.append(ae);function Fr(){let s=v.classList.contains("dock-card")&&!te.matches&&H.dataset.slot?.startsWith("bottom"),p=s?nt:O==="proof"?Kt:ae.querySelector("header");p&&(bt.classList.toggle("sheet-logo",te.matches),bt.style.marginLeft=H.dataset.slot?.endsWith("left")?"0":"auto",H.dataset.slot?.endsWith("left")?p.firstElementChild!==bt&&p.prepend(bt):p.lastElementChild!==bt&&p.append(bt),nt.hidden=Te||!s&&O!=="proof")}function za(){if(O==="overview"&&!i.length){yt();return}Xe(O==="rule"?"settings":O==="settings"?"overview":"proof")}function Xe(s){if(v.hidden)return;let p=te.matches?Fe.element:_?H:v,g=p.getBoundingClientRect().height,b=p===v?v.style.transform:"";ut?.cancel(),Ze.forEach(w=>w.cancel());let P=O;if(O=s,v.dataset.view=O,ae.replaceChildren(),ae.hidden=O==="proof",O==="proof"){let w=i.find(z=>z.id===G);w?rt(w,!1,!1,Lt):at(void 0,!1)}else{Kt.hidden=de.hidden=we.hidden=zt.hidden=nt.hidden=!0;let w=m.createElement("header"),z=be("\u2039",za),D=m.createElement("h2");if(z.setAttribute("aria-label",O==="rule"?"Back to settings":O==="settings"?"Back to overview":"Back to proof"),De.bind(z,()=>"Back Esc"),D.textContent=O==="overview"?Oa():O==="why"?"Details":O==="rule"?l.find(K=>K.id===J)?.label??"Rule":"Settings",w.append(z,D),ae.append(w),O==="overview"){let K=be("Hide marks",()=>{qn(!Pe),K.setAttribute("aria-checked",String(!Pe))});K.className="d-switch-row",K.setAttribute("role","switch"),K.setAttribute("aria-checked",String(!Pe));let ce=m.createElement("span");ce.className="d-switch",ce.setAttribute("aria-hidden","true"),K.append(ce);let Ue=be("Re-check page",$o),He=m.createElement("p"),Ke=be("Settings",()=>Xe("settings"));He.className="d-muted",Ke.className="d-nav",Ke.setAttribute("aria-keyshortcuts",","),De.bind(Ke,()=>"Settings ,");let Oe=m.createElement("span");if(Oe.textContent="\u203A",Oe.setAttribute("aria-hidden","true"),Ke.append(Oe),ae.append(K),f){let ze=m.createElement("div");ze.dataset.rewriteAll="",ae.append(ze),gn(ze)}if(y)Ue.disabled=se,He.textContent=re.lastReviewTime?"Last checked "+new Date(re.lastReviewTime).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}):re.reason??"Not checked yet",ae.append(Ue,He);else if(!i.length){let ze=m.createElement("p");ze.textContent=e??"Reviews run through the Proofmarks companion.",ae.append(ze)}ae.append(Ke)}else if(O==="why"){let K=i.find(ce=>ce.id===G);K&&ae.append(yi(m,K,l.find(ce=>ce.id===K.rule)))}else if(O==="rule"){let K=l.find(ce=>ce.id===J);K&&ae.append(ui({doc:m,rule:K,state:Y,changed:()=>ir(),strictness:le.find(ce=>ce.rule===K.id),resetting:j||se,resetStrictness:k?ce=>{As(ce)}:void 0}))}else ae.append(pi({doc:m,rules:l,status:re,agents:Z,agentReason:he,targetBusy:fe,selectTarget:K=>{La(K)},openRule:K=>{J=K,Xe("rule")}}));let F=m.createElement("div");F.className="d-view-body";for(let K of[...ae.children])K!==w&&F.append(K);ae.append(F);let U=P==="rule"&&O==="settings"&&ae.querySelector(`[data-rule="${J}"]`);U?(U.focus({preventScroll:!0}),U.scrollIntoView({block:"nearest"})):z.focus({preventScroll:!0})}if(O!=="proof"&&(tt.textContent="Page overview",Ir()),Fr(),zr(),et&&!_&&!te.matches){Pn();let w=i.find(z=>z.id===G);w&&An(w)}let C=p.getBoundingClientRect().height,T=p===v?v.style.transform:"";if(!ge.matches){let w=!!b&&!!T&&b!==T;ut=Cr(p,p.animate([{height:`${g}px`,...w?{transform:b}:{}},{height:`${C}px`,...w?{transform:T}:{}}],{duration:220,easing:ke})),Ze=[(O==="proof"?de:ae.querySelector(".d-view-body")??ae).animate([{opacity:0,transform:"translateY(4px)",filter:"blur(1px)"},{opacity:1,transform:"none",filter:"none"}],{duration:200,delay:40,easing:ke,fill:"backwards"})]}lt.refresh()}function gn(s=ae.querySelector("[data-rewrite-all]")){if(!s)return;let p=kn(i),g=B.activeElement instanceof HTMLElement&&s.contains(B.activeElement)?B.activeElement.dataset:void 0;s.replaceChildren();let b=p.ready.filter(qr),P=p.ready.filter(C=>!qr(C)&&(C.status??"open")==="open").length;if(b.length||qt){let C=qt?.total??b.length,T=m.createElement("p"),w=be(`Accept ${C} ${C===1?"rewrite":"rewrites"}`,()=>{Ps()});T.className="d-muted",T.dataset.acceptStatus="",T.textContent=gs(b.length,P,qt),w.dataset.acceptAll="",w.className="primary",w.disabled=!!qt||pe||se,s.append(T,w)}if(p.missing.length){let C=be("Rewrite all",()=>{xo()});C.dataset.requestRewrites="",C.disabled=pe||se||fe,s.append(C)}if(p.writing.length){let C=m.createElement("p"),T=be("Cancel all",()=>{vo()});C.className="d-muted",C.dataset.rewritesWaiting="",C.textContent=`${p.writing.length} ${p.writing.length===1?"rewrite":"rewrites"} on the way`,T.dataset.cancelRewrites="",T.disabled=pe,s.append(C,T)}g&&(s.querySelector(g.cancelRewrites!==void 0?"[data-cancel-rewrites]":g.acceptAll!==void 0?"[data-accept-all]":"[data-request-rewrites]")??s.querySelector("button"))?.focus({preventScroll:!0})}async function As(s){if(!(j||!k)){j=!0,ir();try{let p=await k(s);p.ok||(me.textContent=p.reason??"Reset failed.")}catch{me.textContent="Proofmarks companion is not running. Start proofmarks serve."}j=!1,ee||$o()}}function $o(){if(e){me.textContent=e;return}if(!se){if(!y){me.textContent="Proofmarks companion is not running. Start proofmarks serve.";return}se=!0,Do(),y().then(s=>{ee||(s.ok&&s.review?({findings:i,rules:l}=Mn(s.review),le=s.review.strictness??[],Y.finish(),Pe||qn(!0),re={...re,connected:!0,lastReviewTime:new Date().toISOString()},st(),me.textContent="Page checked. Proofs ready."):(re={...re,reason:s.reason??"Review failed"},me.textContent=re.reason,v.hidden&&_e(!0),Xe("overview")))}).catch(()=>{re={connected:!1,reason:"Proofmarks companion is not running. Start proofmarks serve."},me.textContent=re.reason,v.hidden&&_e(!0),Xe("overview")}).finally(()=>{se=!1,ee||(Do(),!v.hidden&&O!=="proof"&&Xe(O))})}}function Ba(s){let g=(Qe.find(w=>w.finding.id===s.id)??mr(t,[{...s,status:"open"}])[0])?.range;if(!g)return;let b=g.getBoundingClientRect();if(!_&&!te.matches&&Lt==="text"&&et){(b.top<100||b.bottom>M.innerHeight-100)&&M.scrollTo({top:Math.max(0,M.scrollY+b.top-M.innerHeight/2),behavior:"instant"});let w=g.getBoundingClientRect();Ot={x:M.scrollX+w.left+Math.min(w.width/2,180),y:M.scrollY+w.top+w.height/2},An(s);return}if(te.matches){Fe.reveal(s.id);return}let P=_?H.getBoundingClientRect():v.getBoundingClientRect(),C=90,T=M.innerHeight-24;b.right>P.left&&b.left<P.right&&(P.top<M.innerHeight/2?C=Math.max(C,P.bottom+16):T=Math.min(T,P.top-16)),M.scrollTo({top:Math.max(0,M.scrollY+b.top-C-Math.max(0,(T-C-Math.min(b.height,T-C))/2)),behavior:ge.matches||Ae?"instant":"smooth"})}function at(s,p=!0,g=!1){ft?.();let b=s?.id===G&&O==="proof",P=_?H:v,C=P.getBoundingClientRect().height;ut?.cancel(),Ze.forEach(D=>D.cancel()),Ze=[],v.querySelector(".proof-outgoing")?.remove();let T=de.offsetTop,w=!b&&!v.hidden&&!ge.matches?de.cloneNode(!0):void 0;s?(!b&&!_&&Lt==="text"&&!g&&(Ot=void 0,Ut=void 0,Sn=void 0),rt(s,!1,!1,Lt),p&&Ba(s)):(O="proof",ae.hidden=!0,v.dataset.view="proof",v.hidden=!1,v.inert=!1,Te=!1,et=!0,v.dataset.following="false",delete v.dataset.proof,de.hidden=!0,Kt.hidden=!1,Dt.hidden=!0,we.hidden=!0,zt.hidden=!1,$e.update(i,pe),$e.show(),Ro());for(let[D,F]of Je)F.element.dataset.active=String(D===s?.id);let z=P.getBoundingClientRect().height;if(C>0&&!ge.matches&&(ut=Cr(P,P.animate([{height:`${C}px`},{height:`${z}px`}],{duration:220,easing:ke})),w&&s)){w.className="proof-content proof-outgoing",w.style.top=`${T}px`,w.setAttribute("aria-hidden","true"),w.inert=!0,v.append(w);let D=w.animate([{opacity:1},{opacity:0}],{duration:40,easing:ke});D.onfinish=()=>w.remove(),Ze.push(D,de.animate([{opacity:0,transform:"translateY(4px)",filter:"blur(1px)"},{opacity:1,transform:"none",filter:"none"}],{duration:200,delay:40,easing:ke,fill:"backwards"}))}vt()}function Hr(s){if(!pe){if(nr()){let p=new Set(kn(i).ready.map(b=>b.id)),g=fs(pt(),p,G,s);g&&at(g);return}at(wi(pt(),G,s))}}function jr(){xe.style.clipPath="none";let s=H.getBoundingClientRect();Object.assign(Q.style,{left:`${s.left}px`,top:`${s.top}px`,width:`${s.width}px`,height:`${s.height}px`}),Q.dataset.open=String(_)}function qa(){clearTimeout(kt),!_&&(kt=setTimeout(()=>{!_&&!Re.matches(":hover")&&!(Ae&&Re.contains(B.activeElement))&&ye.setCircle(!0)},120))}function No(){et=!1,Te=!1,delete H.dataset.animating,v.hidden=!0,H.style.clipPath="none",jr(),vt()}function Oo(){$e.settle(),ft?.(),uo?.(),Xt(),lt.settle(),ut?.cancel(),Ze.forEach(s=>s.cancel()),v.querySelector(".proof-outgoing")?.remove(),$t=!1,we.style.visibility=ho?"visible":"hidden",ie.getAnimations({subtree:!0}).forEach(s=>s.cancel()),On?.cancel(),Dn?.cancel(),Co?.cancel(),So?.cancel(),On=void 0,!_&&v.classList.contains("dock-card")&&No(),or=lt.closedClip(),H.style.clipPath=_?rr:"none",delete H.dataset.animating,Nr(),ye.settle(),jr()}function _e(s,p=!1){if(s&&y&&!i.length&&!se){$o();return}if(ee)return;if(s&&(ft?.(),Yt&&Lr()),$e.settle(),clearTimeout(dn),clearTimeout(kt),te.matches){if(s){Lt="pill",Pe||qn(!0);let D=an(i).complete?void 0:pt().find(F=>F.id===En)??pt()[0];Fe.review(),at(D),i.length||Xe("overview")}else yt();return}if(s===_)return;s&&!Pe&&qn(!0);let g=v.classList.contains("dock-card"),b=(s?Re:H).getBoundingClientRect(),P=s&&!_?lt.openingClip():M.getComputedStyle(H).clipPath,C=M.getComputedStyle(Ht).opacity,T=M.getComputedStyle(v).opacity;if(On?.cancel(),Dn?.cancel(),Co?.cancel(),So?.cancel(),ut?.cancel(),ht(),Te=!1,delete v.dataset.fixed,s?Ft=!1:Ft=!0,_=s,Eo=s,H.dataset.expanded=String(s),ye.setExpanded(s),s){xe.getAnimations().forEach(F=>F.cancel()),Lt="pill",v.classList.add("dock-card"),H.append(v),v.style.cssText="";let D=an(i).complete?void 0:pt().find(F=>F.id===En)??pt()[0];at(D,!1),i.length||Xe("overview")}v.inert=!s,Ht.inert=!1,lt.refresh(),or=lt.closedClip();let w=H.getBoundingClientRect(),z=s&&!g?`inset(${b.top-w.top}px ${Math.max(0,w.right-b.right)}px ${Math.max(0,w.bottom-b.bottom)}px ${Math.max(0,b.left-w.left)}px round var(--surface-radius))`:P;if(H.style.clipPath=rr,jr(),Ht.style.opacity=s?"0":"1",Ht.inert=s,v.style.opacity=s?"1":"0",Ae&&(s?(O==="proof"?Dt:ae.querySelector("button"))?.focus({preventScroll:!0}):(Po=!0,ye.focus(),Po=!1)),p||ge.matches)s||No();else{H.dataset.animating="true";let D=(s?H:xe).animate(s?[{clipPath:z},{clipPath:rr}]:[{clipPath:rr},{clipPath:or}],{duration:s?220:150,easing:ke,fill:s?"none":"forwards"});if(On=D,s||Ze.push(v.animate([{clipPath:rr},{clipPath:or}],{duration:150,easing:ke})),D.onfinish=()=>{On===D&&(On=void 0,delete H.dataset.animating,_||(No(),D.cancel(),Dn?.cancel(),Dn=void 0))},xe.style.clipPath="none",s)Dn=void 0;else{let F=Zi(w.width,w.height);Dn=xe.animate([{opacity:1},{opacity:0}],{duration:150-F,delay:F,easing:"linear",fill:"forwards"})}Co=Ht.animate([{opacity:C},{opacity:s?0:1}],{duration:150,easing:ke}),So=(s?O==="proof"?de:ae.querySelector(".d-view-body")??ae:v).animate(s?[{opacity:0,transform:"translateY(4px)",filter:"blur(1px)"},{opacity:1,transform:"none",filter:"none"}]:[{opacity:T},{opacity:0}],{duration:s?200:90,delay:s?40:0,easing:ke,fill:"backwards"})}if(s){let D=i.find(F=>F.id===G);D&&Ba(D)}vt()}H.addEventListener("click",()=>{Eo=!0,clearTimeout(kt)},!0),H.onpointerenter=()=>clearTimeout(kt),H.onpointerleave=()=>{fo.matches&&_&&!pe&&!Eo&&(kt=setTimeout(()=>_e(!1),600))},Re.onpointerenter=()=>{if(clearTimeout(kt),!(!fo.matches||te.matches||_||Ft)){if(clearTimeout(dn),ye.isMorphing()&&!Vn&&H.dataset.dragging!=="true"){ye.setCircle(!1);return}dn=setTimeout(()=>{!Vn&&H.dataset.dragging!=="true"&&ye.setCircle(!1)},32)}},Re.onpointerleave=()=>{Ft=!1,clearTimeout(dn),qa()},Re.addEventListener("pointerdown",()=>clearTimeout(dn)),Re.addEventListener("keydown",s=>{(s.key==="Enter"||s.key===" ")&&(Ae=!0,Ft=!1)}),Re.addEventListener("focusin",()=>{clearTimeout(kt),!Po&&!_&&(Ae||B.activeElement?.matches(":focus-visible"))&&(Ae=!0,Ft=!1,ye.setCircle(!1))}),Re.addEventListener("focusout",()=>qa());function Do(){if(e){ye.prompt(e.startsWith("Start")?"Start Proofmarks":"Set up this page",e);return}if(se){ye.prompt("Checking\u2026","Review in progress");return}if(y&&!i.length||!Y.ready){ye.prompt("It\u2019s proofin\u2019 time","Review this page");return}ye.prompt(),ye.setEnabled(Pe);let s=Ko(pt(),"open").length;ye.update(s,s?`${s} ${s===1?"proof":"proofs"}`:"All reviewed")}function At(){Do(),$e.update(i,pe),v.hidden||Ro()}function zo(){let s=te.matches&&!v.hidden&&Fe.isOpen()?G:void 0;for(let[p,g]of Je)g.element.dataset.quiet=String(!!s&&p!==s)}function Zt(s){for(let[p,g]of Je)g.element.dataset.dim=String(!!s&&!s.includes(p))}let ue=m.createElement("div");ue.className="line-tabs",ue.hidden=!0,ue.setAttribute("role","tablist"),ue.setAttribute("aria-label","Proofs on this line"),ue.setAttribute("aria-orientation","vertical"),B.append(ue),ue.addEventListener("pointerleave",()=>Zt());let en=0,Bo="",zn;function ar(){if(en=0,ue.hidden)return;if(v.hidden||Te){Ir();return}let s=v.getBoundingClientRect();ue.style.transform=`translate3d(${s.left+1}px,${s.top+12}px,0)`,v.getAnimations().length&&(en=requestAnimationFrame(ar))}function Ir(s=!1){if(ue.hidden)return;zn?.cancel();let p=()=>{ue.hidden=!0,Bo="",cancelAnimationFrame(en),en=0,Fo++,tn.replaceChildren(),delete ue.dataset.tucking,Zt()};if(!s||ge.matches){p();return}zn=ue.animate([{opacity:1},{opacity:0}],{duration:140,easing:ke,fill:"forwards"}),zn.onfinish=()=>{zn?.cancel(),zn=void 0,p()}}function Ts(s){at(s,!1,!0)}function Ls(s){let p=Tn.get(s.id),g=p?.join(" ");if(!(!te.matches&&!Te&&!v.classList.contains("dock-card")&&O==="proof"&&!!p&&p.length>1&&g===Sn)||!g){Ir();return}g!==Bo&&(Bo=g,ue.replaceChildren(...p.flatMap(P=>{let C=i.find(U=>U.id===P);if(!C)return[];let T=gt(C),w=be("",()=>Ts(C));w.className="line-tab",w.dataset.finding=P,w.setAttribute("role","tab"),w.setAttribute("aria-label",T.label),w.style.setProperty("--mark",T.color),w.style.setProperty("--ink-mark",Qr(T.color));let z=m.createElement("span"),D=m.createElement("span"),F=m.createElement("span");return z.className="tab-chip",D.className="tab-first",F.className="tab-rest",D.textContent=T.label.charAt(0),F.textContent=T.label.slice(1),z.append(D,F),w.append(z),w.addEventListener("pointerenter",()=>Zt([P])),[w]})));for(let P of ue.querySelectorAll(".line-tab"))P.setAttribute("aria-selected",String(P.dataset.finding===s.id));ue.hidden&&(zn?.cancel(),ue.hidden=!1,ue.style.opacity="");for(let P of ue.querySelectorAll(".line-tab")){let C=P.querySelector(".tab-first").getBoundingClientRect().width,T=P.querySelector(".tab-rest").getBoundingClientRect().width,w=Math.round(Math.min(11,Math.max(6,(29-C)/2)));P.style.setProperty("--lead",`${w}px`),P.style.setProperty("--full",`${Math.ceil(1+w+C+T+12)}px`)}en||ar()}let jt=m.createElement("div"),qo=m.createElement("div");jt.className="morph-surface",qo.className="morph-cream",jt.hidden=!0,jt.setAttribute("aria-hidden","true"),jt.append(qo),B.insertBefore(jt,v);function Rs(s,p,g){if(ft?.(),ht(),_&&_e(!1,!0),Ot=void 0,Ut={x:p.left+M.scrollX,y:p.top+M.scrollY},Cn={left:!1,above:!1},Sn=Tn.get(s.id)?.join(" "),ge.matches||(ue.dataset.tucking=""),rt(s,!1,!1,"text"),v.style.removeProperty("height"),v.style.removeProperty("clip-path"),ge.matches){Zt();return}let b=v.getBoundingClientRect(),P=`translate3d(${b.left}px,${b.top}px,0)`;Object.assign(jt.style,{width:`${b.width}px`,height:`${b.height}px`,transform:P}),jt.hidden=!1,v.dataset.morphing="",$t=!0;let C=()=>{Nt?.cancel(),cn.forEach(w=>w.cancel()),Nt=void 0,cn=[],ft=void 0,$t=!1,jt.hidden=!0,delete v.dataset.morphing,Pn(),Zt()};ft=C,Nt=jt.animate([{transform:`translate3d(${p.left}px,${p.top}px,0) scale(${p.width/b.width},${p.height/b.height})`},{transform:P}],{duration:240,easing:ke,fill:"forwards"}),cn=[qo.animate([{opacity:1},{opacity:0}],{duration:150,easing:"cubic-bezier(.4,0,.2,1)",fill:"both"}),...[Kt,de,we,nt].map(w=>w.animate([{opacity:0},{opacity:1}],{duration:140,delay:100,easing:ke,fill:"backwards"}))];let T=[Nt,...cn];Promise.all(T.map(w=>w.finished)).then(()=>{ft===C&&C()},()=>{}),requestAnimationFrame(()=>$s(g))}let tn=m.createElement("div");tn.className="tab-ghosts",tn.inert=!0,tn.setAttribute("aria-hidden","true"),B.append(tn);let Wr=10,Fo=0;function $s(s){if(ue.hidden||ge.matches){delete ue.dataset.tucking;return}ar();let p=++Fo;ue.dataset.tucking="",tn.replaceChildren();let g=[...ue.querySelectorAll(".line-tab")].flatMap((b,P)=>{let C=s.get(b.dataset.finding??""),T=b.querySelector(".tab-chip");if(!C||!T)return[];let w=T.getBoundingClientRect(),z=parseFloat(b.style.getPropertyValue("--lead"))||10,D=Math.max(w.width,parseFloat(b.style.getPropertyValue("--full"))||w.width),F=C.left-(w.right-D+1+z),U=C.top+(C.height-w.height)/2-w.top,K=D-w.width,ce=(Fn,ve,X)=>{let Tt=m.createElement(Fn);return Tt.className=ve,X?.append(Tt),Tt},Ue=ce("div","tab-ghost"),He=ce("div","ghost-mover",Ue),Ke=ce("div","ghost-shape",He),Oe=ce("span","ghost-body",Ke),ze=ce("span","ghost-cap",Ke),dt=ce("span","ghost-clip",He),wt=ce("span","ghost-name",dt),nn=ce("span","ghost-first",wt),I=ce("span","ghost-rest",wt);nn.textContent=b.querySelector(".tab-first")?.textContent??"",I.textContent=b.querySelector(".tab-rest")?.textContent??"",b.getAttribute("aria-selected")==="true"&&(Ue.dataset.selected=""),Ue.style.setProperty("--mark",b.style.getPropertyValue("--mark")),Ue.style.setProperty("--ink-mark",b.style.getPropertyValue("--ink-mark")),Object.assign(Ue.style,{left:`${w.right-D}px`,top:`${w.top}px`,width:`${D}px`,height:`${w.height}px`}),Object.assign(ze.style,{width:`${Wr}px`}),Object.assign(Oe.style,{width:`${D-Wr+1}px`}),wt.style.left=`${1+z}px`,tn.append(Ue);let ne={duration:220,delay:P*10,easing:ke,fill:"both"};return[He.animate([{transform:`translate(${F}px,${U}px)`},{transform:"translate(0,0)"}],ne),ze.animate([{transform:"translateX(0)"},{transform:`translateX(${K}px)`}],ne),Oe.animate([{transform:"scaleX(1)"},{transform:`scaleX(${(w.width-Wr+1)/(D-Wr+1)})`}],ne),wt.animate([{transform:"translateX(0)"},{transform:`translateX(${K}px)`}],ne),I.animate([{opacity:1},{offset:.2,opacity:1},{offset:.7,opacity:0},{opacity:0}],ne)]});Promise.all(g.map(b=>b.finished.catch(()=>{}))).then(()=>{p===Fo&&(delete ue.dataset.tucking,tn.replaceChildren())})}let Ne=m.createElement("div");Ne.className="line-menu",Ne.hidden=!0,Ne.setAttribute("role","group"),Ne.setAttribute("aria-label","Proofs on this line");let Bn;function Ho(s=!1){clearTimeout(Bn),Ne.hidden||(Ne.hidden=!0,s||Zt())}function Ns(s,p){clearTimeout(Bn),ie.append(Ne),Ne.replaceChildren(...p.flatMap(g=>{let b=i.find(C=>C.id===g);if(!b)return[];let P=be(gt(b).label,()=>{let C=Ne.getBoundingClientRect(),T=new Map([...Ne.querySelectorAll(".line-name")].map(w=>[w.dataset.finding??"",w.getBoundingClientRect()]));Ho(!0),Rs(b,C,T)});return P.dataset.finding=g,P.className="line-name",P.style.setProperty("--mark",gt(b).color),P.addEventListener("pointerenter",()=>Zt([g])),[P]})),Object.assign(Ne.style,{left:s.style.left,top:s.style.top,minWidth:s.style.width}),Ne.hidden=!1,Zt(p)}Ne.addEventListener("pointerenter",()=>clearTimeout(Bn)),Ne.addEventListener("pointerleave",()=>{Bn=setTimeout(Ho,150)});function Fa(){ie.replaceChildren(),Je.clear(),Mt=[]}let It,jo="";function ir(s=!1){if(A?.("redraw-start"),ee)return;if(!Pe){Fa(),oe.textContent="",N();return}m.documentElement.setAttribute("data-proofmarks-on","");let p=ln(Ee.getBoundingClientRect());if(ie.style.left=`${-p.x}px`,ie.style.top=`${-p.y}px`,!It||It.width!==Se(m)){let T=Qe.flatMap(D=>{let F=D.range?.startContainer.parentElement?.closest("p,li,blockquote");return F?[F.getBoundingClientRect().right]:[]}).sort((D,F)=>D-F),w=T[Math.floor(T.length/2)]??t.getBoundingClientRect().right,z=es(t,w);It={width:Se(m),css:ts(z),left:bi(w,z.length>0,Se(m))}}oe.textContent!==It.css&&(oe.textContent=It.css),mt={width:Se(m),height:M.innerHeight},Ct=_?H.getBoundingClientRect():Re.getBoundingClientRect();let g=te.matches,b=new Set,P=B.activeElement?.dataset.finding;Mt=[];for(let[T,w]of Qe.entries()){if(w.finding.target||!w.range||!Y.visible(w.finding.rule))continue;let z=Xi(w).filter(X=>X.width>1&&X.height>1).map(ln),D=fi(z).map(X=>new DOMRect(X.left,X.top,X.right-X.left,X.bottom-X.top));if(!D.length)continue;let F={finding:w.finding,rects:D,hit:Qi(D),label:void 0};Mt.push(F);let U=gt(w.finding),K=ds(U,w.finding,new Set(D.map(X=>Math.round(X.top))).size),ce=Math.min(...D.map(X=>X.left)),Ue=Math.max(...D.map(X=>X.right)),He=Math.min(...D.map(X=>X.top)),Ke=Math.max(...D.map(X=>X.bottom)),Oe=w.range.startContainer.parentElement?.closest("p,li,blockquote"),ze=It.left,dt=gi(Se(m)-ze-16),wt=He,nn=JSON.stringify([D.map(X=>[X.x,X.y,X.width,X.height]),ze,wt,dt,g,U,w.finding,K]);if(b.add(w.finding.id),Vt===w.finding.id)continue;let I=Je.get(w.finding.id);if(I?.signature===nn){let X=I.element.querySelector(".label");F.label=X&&!X.hidden?ln(X.getBoundingClientRect()):void 0;continue}jo="",I?.element.remove();let ne=m.createElement("div");ne.dataset.findingGroup=w.finding.id,ne.dataset.severity=w.finding.severity??"flag",ne.dataset.status=w.finding.status??"open",ne.dataset.active=String(w.finding.id===En),ie.append(ne),Je.set(w.finding.id,{signature:nn,element:ne});let Fn=K.bracketOnly?[]:K.mark==="caret"?[{rect:new DOMRect((w.gapAfter?D.at(-1).right:D[0].x)-5,D[0].y,10,D[0].height),type:"caret",passage:!1}]:D.map(X=>({rect:X,type:K.mark,passage:!1}));if(K.bracket){let X=K.bracketOnly&&Oe?ln(Oe.getBoundingClientRect()):new DOMRect(ce,He,Ue-ce,Ke-He);Fn.push({rect:X,type:"bracket",passage:!0})}for(let[X,{rect:Tt,type:Vo,passage:qs}]of Fn.entries()){let bn=m.createElement("span");bn.className=qs?"passage":"rect",bn.dataset.mark=Vo,bn.dataset.finding=w.finding.id,bn.setAttribute("aria-hidden","true"),Object.assign(bn.style,{left:`${Tt.x}px`,top:`${Tt.y}px`,width:`${Tt.width}px`,height:`${Tt.height}px`}),ne.append(bn),rs(bn,Vo,U.color,lo(`${w.finding.id}:${X}:${Vo}`),(s||Mr===w.finding.id)&&!ge.matches,Mr===w.finding.id?0:T%3*35,Math.max(0,(parseFloat(M.getComputedStyle(Oe??t).lineHeight)||Tt.height+6)-Tt.height))}if(g)continue;let ve=m.createElement("button");ve.type="button",ve.textContent=U.label,ve.dataset.rule=U.label,ve.addEventListener("click",X=>{if(!Xn){if(_&&!te.matches){at(w.finding);return}if(te.matches||!X.detail||Ae){rt(w.finding,!0);return}Ce={x:X.clientX,y:X.clientY},wo(w.finding)}}),ve.className="label",ve.dataset.finding=w.finding.id,ve.style.setProperty("--mark",U.color),ve.setAttribute("aria-label",`${U.label}. Open proposal`),Object.assign(ve.style,{left:`${ze}px`,top:`${wt}px`,width:`${dt}px`}),dt<120&&(ve.style.fontSize="21px"),ve.addEventListener("blur",()=>it()),ve.addEventListener("focus",()=>{!Yn&&Ae&&rt(w.finding)}),ne.append(ve),ve.addEventListener("pointerenter",()=>{let X=Tn.get(w.finding.id);!X||X.length<2||ve.hidden||Ns(ve,X)}),ve.addEventListener("pointerleave",()=>{Bn=setTimeout(Ho,150)}),F.label=ln(ve.getBoundingClientRect()),P===w.finding.id&&(Yn=!0,ve.focus({preventScroll:!0}),Yn=!1)}for(let[T,w]of Je)if(!b.has(T)){if(P===T&&i.find(z=>z.id===T)?.status==="dismissed"){for(let D of w.element.querySelectorAll(".rect,.passage,.arrow"))D.remove();w.element.querySelector(".label")?.setAttribute("aria-label",`Dismissed ${l.find(D=>D.id===i.find(F=>F.id===T)?.rule)?.label??"proof"}. Open proposal`);continue}w.element.remove(),Je.delete(T)}if(!v.hidden){let T=i.find(w=>w.id===G);T&&(Pn(),An(T))}let C=i.find(T=>T.id===G);C&&(Pt.textContent=Go(C,!!Qe.find(T=>T.finding.id===G)?.range)??"",Pt.hidden=!Pt.textContent),Os(),zo(),Mr=void 0,A?.("redraw-end")}function Os(){if(te.matches)return;let s=Mt.flatMap(C=>{let T=Je.get(C.finding.id)?.element.querySelector(".label");if(!T)return[];let w=Math.min(...C.rects.map(z=>z.top));return[{region:C,label:T,anchor:w,rank:(C.finding.status??"open")==="open"?0:1,anchorLeft:Math.min(...C.rects.filter(z=>Math.abs(z.top-w)<1).map(z=>z.left)),anchorBottom:Math.max(...C.rects.map(z=>z.bottom))}]});Tn.clear();for(let C of Ur(s)){let T=C.map(w=>w.region.finding.id);for(let w of T)Tn.set(w,T)}for(let C of Ur(s))C.forEach(({label:T},w)=>{let z=T.dataset.rule??"",D=w?0:C.length-1,F=D?`${z} +${D}`:z;T.hidden=w>0,T.textContent!==F&&(T.textContent=F,T.setAttribute("aria-label",D?`${z} and ${D} more on this line. Open proposal`:`${z}. Open proposal`))});let p=s.map(({region:C,label:T,...w})=>{let z=ln(T.getBoundingClientRect());return{id:C.finding.id,...w,left:z.left,width:z.width,height:z.height}}),g=JSON.stringify(p);if(g===jo){Io();return}jo=g;let b=mi(p),P=new Map(b.filter(C=>!C.hidden).map(C=>[C.id,{x:C.left-4,y:C.top+14}]));for(let C of b){let T=Je.get(C.id).element,w=T.querySelector(".label"),z=Mt.find(U=>U.finding.id===C.id),D=P.get(C.head??C.id);w.style.left=`${C.left}px`,w.style.top=`${C.top}px`,z.label=C.hidden?void 0:new DOMRect(C.left,C.top,C.width,C.height);let F=JSON.stringify([D,z.rects.map(U=>[U.left,U.top,U.right,U.bottom]),gt(z.finding).color]);T.dataset.leader!==F&&(T.querySelector(".arrow")?.remove(),os(T,D,z.rects,gt(z.finding).color,!1,0,C.id),T.dataset.leader=F)}Io()}function Io(){if(!te.matches)for(let s of Mt){let p=Je.get(s.finding.id)?.element,g=p?.querySelector(".label");if(!g)continue;let b=Math.max(...s.rects.map(C=>C.bottom))<=M.scrollY||Math.min(...s.rects.map(C=>C.top))>=M.scrollY+M.innerHeight;g.inert=b,g.setAttribute("aria-hidden",String(b)),g.dataset.offscreen=String(b),s.label=b||g.hidden?void 0:ln(g.getBoundingClientRect());let P=p.querySelector(".arrow");P&&(P.dataset.offscreen=String(b))}}let Wo=!1;function it(){ee||br||(br=requestAnimationFrame(()=>{if(br=0,!Vt){if(Wo&&(Wo=!1,A?.("rematch-start"),va(),A?.("rematch-end"),At(),Mr)){it();return}ir(),ja(),Mo&&Ss()}}))}function st(){ee||(It=void 0,Wo=!0,it())}function qn(s){Xt(),ht(),et=!1,Pe=s;let p=new URL(M.location.href);p.searchParams.set("proof",s?"1":"0"),M.history.replaceState(M.history.state,"",p),!_&&!Fe.isOpen()&&(v.hidden=!0),At(),ir(s)}let Ha=s=>{let p=s.composedPath()[0],g=p instanceof HTMLElement&&(p.isContentEditable||!!p.closest('input,textarea,select,[contenteditable]:not([contenteditable="false"])')),b=Fi(s,{editable:g,card:!v.hidden&&!Yt,pill:Lt==="pill",help:!Me.hidden,badgeExpanded:Re.dataset.circle==="false"});if(b){if(s.preventDefault(),Ae=!0,Oo(),b==="escape"){if(O!=="proof"&&!v.hidden){za();return}Me.hidden?v.hidden?ye.setCircle(!0):yt():Lo(!1);return}if(b==="overview"||b==="why"||b==="settings"){v.hidden&&_e(!0),Xe(b);return}if(b==="help"){Lo();return}if(b==="dock"){s.stopPropagation(),lt.moveSlot(s.key),To();return}if(b==="undo"&&!$e.element.hidden&&!zt.hidden){$e.undo.disabled||$e.undo.click();return}if(!(O!=="proof"&&["accept","dismiss","undo","next","previous","previous-version","next-version"].includes(b))){if(b==="previous-version"||b==="next-version"){!v.hidden&&!Ie.hidden&&bo(b==="next-version"?1:-1);return}if(b==="accept"||b==="dismiss"||b==="undo"){let P=qe[b==="accept"?0:b==="dismiss"?1:2];!v.hidden&&!P.hidden&&!P.disabled&&P.click();return}Ce=void 0,b==="toggle-card"?v.hidden?_e(!0):yt():b==="toggle-marks"?(qn(!Pe),me.textContent=Pe?"Marks shown":"Marks hidden"):b==="next-open"||b==="previous-open"?(v.hidden&&_e(!0),Hr(b==="next-open"?1:-1)):(b==="next"||b==="previous")&&Hr(b==="next"?1:-1)}}},sr=(s,p)=>Pe&&p>=76?Mt.find(g=>g.hit.some(b=>gr(b,s+M.scrollX,p+M.scrollY)))?.finding:void 0;function Ds(s,p){let g=Ct&&gr(Ct,s,p);if(!Ne.hidden){let b=Ne.getBoundingClientRect();if(s>=b.left&&s<=b.right&&p>=b.top-4&&p<=b.bottom)return}if(!Mt.some(b=>b.label&&gr(b.label,s+M.scrollX,p+M.scrollY)&&(Tn.get(b.finding.id)?.length??0)>1))return g?void 0:Mt.find(b=>b.label&&gr(b.label,s+M.scrollX,p+M.scrollY))?.finding??sr(s,p)}function ja(){if(ee||Yt||_||et||$t||!Ce||Ae||Rt)return;if(Vn){Ce=void 0,ht(),v.hidden=!0,it();return}let{x:s,y:p}=Ce,g=Ds(s,p);if(v.contains(B.elementFromPoint(s,p))){clearTimeout(Et);return}if(g){if(clearTimeout(Et),Et=void 0,yr===g.id){v.hidden||ka();return}clearTimeout(xr),yr=g.id,!v.hidden||Date.now()-wa<600?rt(g,!1,!0):xr=setTimeout(()=>rt(g,!1,!0),150)}else clearTimeout(xr),yr=void 0,!v.hidden&&!Et&&(Et=setTimeout(()=>{Et=void 0,yt(!0)},75))}function Yr(){Wt||(Wt=requestAnimationFrame(()=>{Wt=0,ja()}))}let Ia=s=>{if(!(te.matches||s.pointerType==="touch"||!fo.matches)){if(Ft&&!_){let p=Re.getBoundingClientRect();(s.clientX<p.left||s.clientX>p.right||s.clientY<p.top||s.clientY>p.bottom)&&(Ft=!1)}Vn=s.buttons,Ae=!1,Ce={x:s.clientX,y:s.clientY},Rt&&(Math.hypot(s.clientX-Rt.x,s.clientY-Rt.y)>=8||sr(s.clientX,s.clientY)?.id!==Rt.id)&&(Rt=void 0),Yr()}},Yo=()=>{clearTimeout(dn),Rt=void 0,Ce=void 0,ht(),cancelAnimationFrame(Wt),Wt=0,Te&&(v.hidden=!0,it())},Wa=s=>{s.relatedTarget||Yo()},Ya=()=>{ge.matches&&Oo();let s=i.find(p=>p.id===G);s&&!v.hidden&&O==="proof"&&Bt(s),it()},Va=s=>{Ae=!1,Vn=0,Ce=s.pointerType==="touch"?void 0:{x:s.clientX,y:s.clientY},ht();let p=s.composedPath()[0];if(Xn=!1,!te.matches&&et&&!_&&!v.contains(p)&&!ue.contains(p)&&!Me.contains(p)&&!Le.contains(p)&&!H.contains(p)){Xn=!0,yt();return}te.matches&&Fe.isOpen()&&!Fe.element.contains(p)&&!Me.contains(p)&&!Le.contains(p)&&yt(),!te.matches&&!(p instanceof HTMLElement&&p.closest(".label"))&&!v.contains(p)&&!ue.contains(p)&&!Me.contains(p)&&!Le.contains(p)&&!H.contains(p)&&!sr(s.clientX,s.clientY)&&(_?_e(!1):et&&yt()),s.pointerType==="touch"?vr={x:s.clientX,y:s.clientY}:v.contains(p)||Yr()},Xa=s=>{if(Xn){Xn=!1;return}if(!s.detail||s.pointerType==="touch"||pe||m.getSelection()?.toString())return;let p=s.composedPath()[0];if(p.closest?.('a,button,input,textarea,select,summary,[role="button"],[contenteditable="true"]')||H.contains(p))return;if(v.contains(p)){let b=i.find(P=>P.id===G);b&&Te&&wo(b);return}let g=sr(s.clientX,s.clientY);if(g){if(te.matches){rt(g,!0);return}if(_){at(g);return}wo(g)}},_a=s=>{if(s.pointerType!=="touch"||!vr)return;let p=vr;vr=void 0;let g=s.composedPath()[0];if(Math.hypot(s.clientX-p.x,s.clientY-p.y)>8||g.closest?.("a,button,input,textarea,select")||m.getSelection()?.toString())return;let b=sr(s.clientX,s.clientY);b&&rt(b,!0)},Ua=M.scrollX,Ka=M.scrollY,Ga=()=>{if((Ua!==M.scrollX||Ka!==M.scrollY)&&(Ua=M.scrollX,Ka=M.scrollY,Xt()),Io(),et&&!_&&Lt==="text"){let s=i.find(p=>p.id===G);s&&An(s)}Yr()},Qa=()=>{Ee.style.setProperty("--layout-width",`${Se(m)}px`),It=void 0,Xt(),it(),To()},Ja=()=>qn(new URL(M.location.href).searchParams.get("proof")==="1");M.addEventListener("scroll",Ga,!0),M.addEventListener("resize",Qa),M.addEventListener("keydown",Ha,!0),M.addEventListener("pointerdown",Va,!0),M.addEventListener("popstate",Ja),M.addEventListener("pointermove",Ia,{passive:!0}),M.addEventListener("pointerup",_a,!0),M.addEventListener("click",Xa),m.fonts.addEventListener("loadingdone",it),ge.addEventListener("change",Ya),m.documentElement.addEventListener("pointerleave",Yo),M.addEventListener("mouseout",Wa);let Za=new ResizeObserver(s=>{let p=s[0]?.borderBoxSize[0];p&&p.inlineSize&&p.blockSize&&(_t={width:p.inlineSize,height:p.blockSize},Yr())});Za.observe(v);let ei=new ResizeObserver(()=>{Ct=_?H.getBoundingClientRect():Re.getBoundingClientRect(),Nr()});ei.observe(H);let Vr=new ResizeObserver(it);Vr.observe(t);let lr=new MutationObserver(()=>{Xt(),st()});lr.observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:["class","style","hidden","open","aria-hidden"]});let Fe=Vi({avoid:a,doc:m,win:M,host:Ee,shadow:B,card:v,panel:H,overview:()=>Xe("overview"),mobile:te,reduced:ge,close:yt,rect:s=>Qe.find(p=>p.finding.id===s)?.range?.getBoundingClientRect(),isKeyboard:()=>Ae}),lt=Yi({avoid:a,persistent:!0,storageKey:d?`proofmarks:badge-slot:${d}`:void 0,slot:S,doc:m,win:M,panel:H,pill:Re,mobile:te,reduced:ge,expanded:()=>_,keyboard:()=>Ae,changed:()=>{Fr(),jr(),Ct=_?H.getBoundingClientRect():Re.getBoundingClientRect(),Nr()}});At(),lt.refresh(),or=lt.closedClip(),vt();let zs=M.setTimeout(async()=>{if(ee)return;let s;try{s=await oi()}catch{ee||st();return}if(ee)return;ct=new FontFace("ProofmarksHand",ai(s),{weight:"400 700"}),m.fonts.add(ct);try{await m.fonts.load("500 18px ProofmarksHand")}catch{}if(ee)return;let p=i.find(g=>g.id===G);p&&!v.hidden&&O==="proof"&&Bt(p),M.setTimeout(()=>{ee||st()},0)},0),Bs=M.setInterval(()=>{if(ee||v.hidden||O!=="proof")return;let s=i.find(p=>p.id===G);s&&(s.status??"open")==="open"&&["pending","claimed"].includes(s.rewriteRequest?.status??"")&&(Bt(s),Ve(s))},1e3);return{setRoot(s){if(!(ee||s===t)){if(s.ownerDocument!==m)throw Error("Proofmarks root must stay in the same document.");Xt(),lr.disconnect(),Vr.unobserve(t),t=s,Qe=[],co.reset(),It=void 0,Vr.observe(t),lr.observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:["class","style","hidden","open","aria-hidden"]}),st()}},setAgents(s,p){if(ee)return;Z=s,he=p,yo();let g=i.find(b=>b.id===G);g&&O==="proof"&&!v.hidden&&Jt(g).text===void 0&&(g.status??"open")==="open"&&(Bt(g),Ve(g))},setCompanionStatus(s){if(ee)return;re=s;let p=ae.querySelector("[data-companion-status]");p&&(p.textContent=Uo(s))},setReview(s){if(ee)return;ht();let p=i.find(T=>T.id===G),g=te.matches?Fe.element:_?H:v,b=g.getBoundingClientRect().height,P=p&&Jt(p).text;if({findings:i,rules:l}=Mn(s),le=s.strictness??[],p&&s.findings.find(T=>T.id===p.id)?.status==="superseded"&&!v.hidden&&O==="proof"&&at(pt()[0],!1),!v.hidden){let T=i.find(w=>w.id===G);T&&O==="proof"&&(Bt(T),Ve(T))}gn(),At(),st(),vt();let C=i.find(T=>T.id===G);!v.hidden&&O==="proof"&&p?.id===C?.id&&P===void 0&&C&&Jt(C).text!==void 0&&!ge.matches&&(ut?.cancel(),Ze.forEach(T=>T.cancel()),ut=Cr(g,g.animate([{height:`${b}px`},{height:`${g.getBoundingClientRect().height}px`}],{duration:220,easing:ke})),Ze=[de.animate([{opacity:0},{opacity:1}],{duration:200,easing:ke})])},unmount(){ee||(ee=!0,cancelAnimationFrame(en),clearTimeout(Bn),M.clearInterval(Bs),Lr(),clearTimeout(dn),clearTimeout(kt),clearTimeout(po),$e.destroy(),De.destroy(),ye.destroy(),lt.destroy(),Fe.destroy(),clearTimeout($r),m.removeEventListener("visibilitychange",$a),Oo(),ht(),cancelAnimationFrame(Wt),cancelAnimationFrame(br),lr.disconnect(),Vr.disconnect(),Za.disconnect(),ei.disconnect(),Fa(),M.clearTimeout(zs),ct&&m.fonts.delete(ct),Ee.remove(),N(),M.removeEventListener("scroll",Ga,!0),M.removeEventListener("resize",Qa),M.removeEventListener("keydown",Ha,!0),M.removeEventListener("pointerdown",Va,!0),M.removeEventListener("popstate",Ja),M.removeEventListener("pointermove",Ia),M.removeEventListener("pointerup",_a,!0),M.removeEventListener("click",Xa),m.fonts.removeEventListener("loadingdone",it),ge.removeEventListener("change",Ya),m.documentElement.removeEventListener("pointerleave",Yo),M.removeEventListener("mouseout",Wa))}}}export{Wn as a,cc as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var p="Start Proofmarks: npx proofmarks dev";function k(n,l=fetch,r){let c=`${n.replace(/\/$/,"")}/__proofmarks/`,g;async function t(e,o){let s={};o!==void 0&&(s["Content-Type"]="application/json",s["X-Proofmarks-Token"]=(await u()).token);let[i,d]=e.split("?"),a=new URLSearchParams(d);a.set("action",i);let m=r?`${r}?${a}`:c+e,f=await l(m,{cache:"no-store",...o===void 0?{}:{method:"POST",headers:s,body:JSON.stringify(o)}});if(!f.headers.get("content-type")?.includes("application/json"))throw Error(`Couldn't reach Proofmarks (HTTP ${f.status}).`);let v=await f.json();if(!f.ok)throw Error(v.reason??`Couldn't reach Proofmarks (HTTP ${f.status}).`);return v}function u(){return g??=t("session").catch(e=>{throw g=void 0,e})}return{session:u,match:(e,o)=>t("match",{url:e,sample:o.slice(0,4e3)}),review:e=>t(`review?reviewId=${encodeURIComponent(e)}`),decision:(e,o,s,i,{expectedCopies:d,version:a,another:m}={})=>t(e==="request-rewrite"||e==="cancel-rewrite"?e:"decision",{action:e,reviewId:o,id:i?.id,...e==="cancel-rewrite"?{}:{revision:s.revision,...s.sourceRevision?{sourceRevision:s.sourceRevision}:{},source:s.source},...d?{expectedCopies:d}:{},...e==="accept"&&a!==void 0?{version:a}:{},...e==="request-rewrite"&&m?{another:m}:{}}),recheck:e=>t("review",{reviewId:e}),resetStrictness:e=>t("strictness",{rule:e}),agents:()=>t("agents"),target:e=>t("target",{target:e}),status:()=>t("status"),changes:e=>r?`${r}?${new URLSearchParams({action:"changes",reviewId:e})}`:`${c}changes?reviewId=${encodeURIComponent(e)}`}}function w(n,l,r){let c=n.document,g=n.EventSource,t,u=[],e,o=!1,s=()=>{r.review(),r.agents(),r.status()},i=()=>{t?.close(),t=void 0;for(let f of u)n.clearInterval(f);u=[],n.clearTimeout(e)},d=()=>{i(),s(),u.push(n.setInterval(r.review,1200),n.setInterval(()=>{r.agents(),r.status()},5e3))},a=()=>{if(i(),!l||!g){d();return}t=new g(l),e=n.setTimeout(d,5e3),t.addEventListener("ready",()=>{n.clearTimeout(e),s()}),t.addEventListener("review",()=>r.review()),t.addEventListener("agents",()=>r.agents()),t.addEventListener("error",()=>r.status()),u.push(n.setInterval(s,3e4))},m=()=>{o||(c.visibilityState==="hidden"?i():a())};return c.addEventListener("visibilitychange",m),c.visibilityState!=="hidden"&&a(),()=>{o=!0,i(),c.removeEventListener("visibilitychange",m)}}export{p as a,k as b,w as c};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export class ConfigError extends Error {}
|
|
2
|
+
export type ConfigDocument = { id: string; url?: string; format: 'markdown' | 'mdx' | 'html' | 'jinja'; source: string; review: string; write: boolean; sourcePath: string; reviewPath: string; logPath: string };
|
|
3
|
+
export type ProofmarksConfig = { version: 1; rebuild?: string; devServer?: string; origins: string[]; tailnetHosts: string[]; tailscaleUsers: string[]; projectRoot: string; roots: string[]; rules?: Record<string, boolean>; judge: { provider: 'jev' | 'fake'; model: string }; documents: ConfigDocument[] };
|
|
4
|
+
export function loadConfig(projectRoot: string): Promise<ProofmarksConfig>;
|