@infinilabs/doc-detail 0.0.3 → 0.0.4

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.
@@ -1,4 +1,4 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }:root{--color-primary: #1677ff;--color-border: #d9d9d9;--color-primary-bg: #e6f4ff;--color-text-secondary: rgba(0,0,0,.65);--color-bg-layout: #f5f5f5}.dark{--color-primary: #1668dc;--color-border: #424242;--color-primary-bg: #15325b;--color-text-secondary: rgba(255,255,255,.65);--color-bg-layout: #000000}.float-left{float:left}.my-2{margin-top:.5rem;margin-bottom:.5rem}.mr-3{margin-right:.75rem}.children\\:size-4>*{width:1rem;height:1rem}.size-3{width:.75rem;height:.75rem}.size-6{width:1.5rem;height:1.5rem}.children\\:h-unset\\!>*{height:unset!important}.children\\:w-full\\!>*{width:100%!important}.h-full{height:100%}.min-w-3{min-width:.75rem}.w-1\\/2{width:50%}.w-24{width:6rem}.w-full{width:100%}.flex{display:flex}.inline-flex{display:inline-flex}.flex-1{flex:1 1 0%}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.rotate-90{--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-rotate:90deg;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-between{justify-content:space-between}.gap-0{gap:0}.gap-0\\.5{gap:.125rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-row-2{row-gap:.5rem}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.border{border-width:1px}.border-border{border-color:var(--color-border)}.rounded-lg{border-radius:.5rem}.border-solid{border-style:solid}.bg-black\\/3{background-color:#00000008}.bg-transparent{background-color:transparent}.dark .dark\\:bg-white\\/4{background-color:#ffffff0a}.\\[\\&\\>\\.docx\\]\\:p-0\\!>.docx{padding:0!important}.p-4{padding:1rem}.p-4\\!{padding:1rem!important}.pl-2{padding-left:.5rem}.text-3{font-size:.75rem}.text-3\\.5{font-size:.875rem}.text-4\\.5\\/6{font-size:1.125rem;line-height:1.5rem}.text-primary,.hover\\:text-primary:hover{color:var(--color-primary)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}@media(max-width:639.9px){.\\<sm\\:w-full{width:100%}}@keyframes x-markdown-fade-in{0%{opacity:0}to{opacity:1}}.x-markdown{--text-color: inherit;--font-size: inherit;--margin-block: 0 0 1em 0;--td-th-padding: .85em 1em;--pre-th-td-padding: 2px 0;--border-font-weight: 600;--padding-ul-ol: 0 0 0 1em;--margin-ul-ol: 0 0 1em 1.8em;--margin-li: .25em 0;--margin-pre: 1em 0;--padding-code-inline: .2em .4em;--margin-code-inline: 0 .2em;--code-inline-text: .85em;--small-border-radius: 2px;--image-margin: .5em 0;--hr-margin: 1.5em 0;--table-margin: 1em 0;font-size:var(--font-size);line-height:1.5714285714285714;width:100%;color:var(--text-color)}.x-markdown p,.x-markdown div,.x-markdown span,.x-markdown li{word-break:break-word;overflow-wrap:break-word}.x-markdown pre,.x-markdown code{word-break:break-word;overflow-wrap:break-word;white-space:pre-wrap}.x-markdown th,.x-markdown td{padding:var(--td-th-padding)}.x-markdown th{font-weight:var(--border-font-weight)}.x-markdown pre table{box-shadow:none}.x-markdown pre td,.x-markdown pre th{padding:var(--pre-th-td-padding);border:none;text-align:left}.x-markdown p{margin:var(--margin-block)}.x-markdown p:first-child{margin-top:0}.x-markdown p:last-child{margin-bottom:0}.x-markdown ul,.x-markdown ol{margin:var(--margin-ul-ol);padding:var(--padding-ul-ol)}.x-markdown ul:first-child,.x-markdown ol:first-child{margin-top:0}.x-markdown ul:last-child,.x-markdown ol:last-child{margin-bottom:0}.x-markdown ol>li{list-style:decimal}.x-markdown ul>li{list-style:disc}.x-markdown li{margin:var(--margin-li)}.x-markdown li:first-child{margin-top:0}.x-markdown li:last-child{margin-bottom:0}.x-markdown pre{margin:var(--margin-pre);overflow-x:auto}.x-markdown pre:first-child{margin-top:0}.x-markdown pre:last-child{margin-bottom:0}.x-markdown code{padding:var(--padding-code-inline);margin:var(--margin-code-inline);font-size:var(--code-inline-text);border-radius:var(--small-border-radius)}.x-markdown pre code{padding:0;margin:0;font-size:inherit;border-radius:0;line-height:2}.x-markdown img{max-width:100%;height:auto;margin:var(--image-margin)}.x-markdown hr{margin:var(--hr-margin)}.x-markdown table:not(pre){margin:var(--table-margin);border-collapse:collapse;display:block;width:max-content;max-width:100%;overflow:auto}.x-markdown table:not(pre):first-child{margin-top:0}.x-markdown table:not(pre):last-child{margin-bottom:0}.x-markdown .inline-katex .katex-display{display:inline-block;margin:0;text-align:initial;vertical-align:middle}.x-markdown .inline-katex .katex-display>.katex{display:inline-block;text-align:initial;white-space:normal}.x-markdown .inline-katex .katex-display>.katex>.katex-html{display:inline-block;position:static}.x-markdown .inline-katex .katex-display>.katex>.katex-html>.tag{position:static}")),document.head.appendChild(r)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}})();
1
+ (function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }:root{--color-primary: #1677ff;--color-border: #d9d9d9;--color-primary-bg: #e6f4ff;--color-text-secondary: rgba(0,0,0,.65);--color-bg-layout: #f5f5f5}.dark{--color-primary: #1668dc;--color-border: #424242;--color-primary-bg: #15325b;--color-text-secondary: rgba(255,255,255,.65);--color-bg-layout: #000000}.float-left{float:left}.my-2{margin-top:.5rem;margin-bottom:.5rem}.ml-2{margin-left:.5rem}.mr-3{margin-right:.75rem}.children\\:size-4>*{width:1rem;height:1rem}.size-3{width:.75rem;height:.75rem}.size-6{width:1.5rem;height:1.5rem}.children\\:h-unset\\!>*{height:unset!important}.children\\:w-full\\!>*{width:100%!important}.h-full{height:100%}.w-1\\/2{width:50%}.w-24{width:6rem}.w-full{width:100%}.flex{display:flex}.inline-flex{display:inline-flex}.flex-1{flex:1 1 0%}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.rotate-90{--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-rotate:90deg;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-between{justify-content:space-between}.gap-0{gap:0}.gap-0\\.5{gap:.125rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-row-2{row-gap:.5rem}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.border{border-width:1px}.border-border{border-color:var(--color-border)}.rounded-lg{border-radius:.5rem}.border-solid{border-style:solid}.bg-black\\/3{background-color:#00000008}.bg-transparent{background-color:transparent}.dark .dark\\:bg-white\\/4{background-color:#ffffff0a}.\\[\\&\\>\\.docx\\]\\:p-0\\!>.docx{padding:0!important}.p-4{padding:1rem}.p-4\\!{padding:1rem!important}.text-3{font-size:.75rem}.text-3\\.5{font-size:.875rem}.text-4\\.5\\/6{font-size:1.125rem;line-height:1.5rem}.text-primary,.hover\\:text-primary:hover{color:var(--color-primary)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}@media(max-width:639.9px){.\\<sm\\:w-full{width:100%}}@keyframes x-markdown-fade-in{0%{opacity:0}to{opacity:1}}.x-markdown{--text-color: inherit;--font-size: inherit;--margin-block: 0 0 1em 0;--td-th-padding: .85em 1em;--pre-th-td-padding: 2px 0;--border-font-weight: 600;--padding-ul-ol: 0 0 0 1em;--margin-ul-ol: 0 0 1em 1.8em;--margin-li: .25em 0;--margin-pre: 1em 0;--padding-code-inline: .2em .4em;--margin-code-inline: 0 .2em;--code-inline-text: .85em;--small-border-radius: 2px;--image-margin: .5em 0;--hr-margin: 1.5em 0;--table-margin: 1em 0;font-size:var(--font-size);line-height:1.5714285714285714;width:100%;color:var(--text-color)}.x-markdown p,.x-markdown div,.x-markdown span,.x-markdown li{word-break:break-word;overflow-wrap:break-word}.x-markdown pre,.x-markdown code{word-break:break-word;overflow-wrap:break-word;white-space:pre-wrap}.x-markdown th,.x-markdown td{padding:var(--td-th-padding)}.x-markdown th{font-weight:var(--border-font-weight)}.x-markdown pre table{box-shadow:none}.x-markdown pre td,.x-markdown pre th{padding:var(--pre-th-td-padding);border:none;text-align:left}.x-markdown p{margin:var(--margin-block)}.x-markdown p:first-child{margin-top:0}.x-markdown p:last-child{margin-bottom:0}.x-markdown ul,.x-markdown ol{margin:var(--margin-ul-ol);padding:var(--padding-ul-ol)}.x-markdown ul:first-child,.x-markdown ol:first-child{margin-top:0}.x-markdown ul:last-child,.x-markdown ol:last-child{margin-bottom:0}.x-markdown ol>li{list-style:decimal}.x-markdown ul>li{list-style:disc}.x-markdown li{margin:var(--margin-li)}.x-markdown li:first-child{margin-top:0}.x-markdown li:last-child{margin-bottom:0}.x-markdown pre{margin:var(--margin-pre);overflow-x:auto}.x-markdown pre:first-child{margin-top:0}.x-markdown pre:last-child{margin-bottom:0}.x-markdown code{padding:var(--padding-code-inline);margin:var(--margin-code-inline);font-size:var(--code-inline-text);border-radius:var(--small-border-radius)}.x-markdown pre code{padding:0;margin:0;font-size:inherit;border-radius:0;line-height:2}.x-markdown img{max-width:100%;height:auto;margin:var(--image-margin)}.x-markdown hr{margin:var(--hr-margin)}.x-markdown table:not(pre){margin:var(--table-margin);border-collapse:collapse;display:block;width:max-content;max-width:100%;overflow:auto}.x-markdown table:not(pre):first-child{margin-top:0}.x-markdown table:not(pre):last-child{margin-bottom:0}.x-markdown .inline-katex .katex-display{display:inline-block;margin:0;text-align:initial;vertical-align:middle}.x-markdown .inline-katex .katex-display>.katex{display:inline-block;text-align:initial;white-space:normal}.x-markdown .inline-katex .katex-display>.katex>.katex-html{display:inline-block;position:static}.x-markdown .inline-katex .katex-display>.katex>.katex-html>.tag{position:static}")),document.head.appendChild(r)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
2
  "use strict";var mL=n=>{throw TypeError(n)};var S1=(n,t,e)=>t.has(n)||mL("Cannot "+e);var kr=(n,t,e)=>(S1(n,t,"read from private field"),e?e.call(n):t.get(n)),Ao=(n,t,e)=>t.has(n)?mL("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),Ni=(n,t,e,r)=>(S1(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e),To=(n,t,e)=>(S1(n,t,"access private method"),e);var yL=(n,t,e,r)=>({set _(i){Ni(n,t,i,e)},get _(){return kr(n,t,r)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $t=require("react/jsx-runtime"),ng=require("antd"),Ld=require("lucide-react"),yt=require("react");var A1=typeof document<"u"?document.currentScript:null;const N3=yt.createContext({});function QQ(n){const t=yt.useRef(null);return t.current===null&&(t.current=n()),t.current}const EE=typeof window<"u",JQ=EE?yt.useLayoutEffect:yt.useEffect,ME=yt.createContext(null);function PE(n,t){n.indexOf(t)===-1&&n.push(t)}function kE(n,t){const e=n.indexOf(t);e>-1&&n.splice(e,1)}const Os=(n,t,e)=>e>t?t:e<n?n:e;function $A(n,t){return t?`${n}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:n}let Gf=()=>{},Bs=()=>{};process.env.NODE_ENV!=="production"&&(Gf=(n,t,e)=>{!n&&typeof console<"u"&&console.warn($A(t,e))},Bs=(n,t,e)=>{if(!n)throw new Error($A(t,e))});const Fs={},O3=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n);function B3(n){return typeof n=="object"&&n!==null}const F3=n=>/^0[^.\s]+$/u.test(n);function DE(n){let t;return()=>(t===void 0&&(t=n()),t)}const Fa=n=>n,tJ=(n,t)=>e=>t(n(e)),ig=(...n)=>n.reduce(tJ),bv=(n,t,e)=>{const r=t-n;return r===0?1:(e-n)/r};class LE{constructor(){this.subscriptions=[]}add(t){return PE(this.subscriptions,t),()=>kE(this.subscriptions,t)}notify(t,e,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,e,r);else for(let a=0;a<i;a++){const o=this.subscriptions[a];o&&o(t,e,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const co=n=>n*1e3,Oa=n=>n/1e3;function V3(n,t){return t?n*(1e3/t):0}const bL=new Set;function IE(n,t,e){n||bL.has(t)||(console.warn($A(t,e)),bL.add(t))}const z3=(n,t,e)=>(((1-3*e+3*t)*n+(3*e-6*t))*n+3*t)*n,eJ=1e-7,rJ=12;function nJ(n,t,e,r,i){let a,o,s=0;do o=t+(e-t)/2,a=z3(o,r,i)-n,a>0?e=o:t=o;while(Math.abs(a)>eJ&&++s<rJ);return o}function ag(n,t,e,r){if(n===t&&e===r)return Fa;const i=a=>nJ(a,0,1,n,e);return a=>a===0||a===1?a:z3(i(a),t,r)}const G3=n=>t=>t<=.5?n(2*t)/2:(2-n(2*(1-t)))/2,H3=n=>t=>1-n(1-t),U3=ag(.33,1.53,.69,.99),RE=H3(U3),W3=G3(RE),$3=n=>(n*=2)<1?.5*RE(n):.5*(2-Math.pow(2,-10*(n-1))),NE=n=>1-Math.sin(Math.acos(n)),j3=H3(NE),X3=G3(NE),iJ=ag(.42,0,1,1),aJ=ag(0,0,.58,1),Y3=ag(.42,0,.58,1),oJ=n=>Array.isArray(n)&&typeof n[0]!="number",q3=n=>Array.isArray(n)&&typeof n[0]=="number",_L={linear:Fa,easeIn:iJ,easeInOut:Y3,easeOut:aJ,circIn:NE,circInOut:X3,circOut:j3,backIn:RE,backInOut:W3,backOut:U3,anticipate:$3},sJ=n=>typeof n=="string",wL=n=>{if(q3(n)){Bs(n.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,e,r,i]=n;return ag(t,e,r,i)}else if(sJ(n))return Bs(_L[n]!==void 0,`Invalid easing type '${n}'`,"invalid-easing-type"),_L[n];return n},zm=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function lJ(n,t){let e=new Set,r=new Set,i=!1,a=!1;const o=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function l(c){o.has(c)&&(u.schedule(c),n()),c(s)}const u={schedule:(c,h=!1,f=!1)=>{const v=f&&i?e:r;return h&&o.add(c),v.has(c)||v.add(c),c},cancel:c=>{r.delete(c),o.delete(c)},process:c=>{if(s=c,i){a=!0;return}i=!0,[e,r]=[r,e],e.forEach(l),e.clear(),i=!1,a&&(a=!1,u.process(c))}};return u}const uJ=40;function Z3(n,t){let e=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>e=!0,o=zm.reduce((b,w)=>(b[w]=lJ(a),b),{}),{setup:s,read:l,resolveKeyframes:u,preUpdate:c,update:h,preRender:f,render:d,postRender:v}=o,m=()=>{const b=Fs.useManualTiming?i.timestamp:performance.now();e=!1,Fs.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(b-i.timestamp,uJ),1)),i.timestamp=b,i.isProcessing=!0,s.process(i),l.process(i),u.process(i),c.process(i),h.process(i),f.process(i),d.process(i),v.process(i),i.isProcessing=!1,e&&t&&(r=!1,n(m))},y=()=>{e=!0,r=!0,i.isProcessing||n(m)};return{schedule:zm.reduce((b,w)=>{const x=o[w];return b[w]=(A,T=!1,C=!1)=>(e||y(),x.schedule(A,T,C)),b},{}),cancel:b=>{for(let w=0;w<zm.length;w++)o[zm[w]].cancel(b)},state:i,steps:o}}const{schedule:Lr,cancel:Hl,state:Vn,steps:T1}=Z3(typeof requestAnimationFrame<"u"?requestAnimationFrame:Fa,!0);let h0;function cJ(){h0=void 0}const Wi={now:()=>(h0===void 0&&Wi.set(Vn.isProcessing||Fs.useManualTiming?Vn.timestamp:performance.now()),h0),set:n=>{h0=n,queueMicrotask(cJ)}},K3=n=>t=>typeof t=="string"&&t.startsWith(n),Q3=K3("--"),hJ=K3("var(--"),OE=n=>hJ(n)?fJ.test(n.split("/*")[0].trim()):!1,fJ=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Hf={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},_v={...Hf,transform:n=>Os(0,1,n)},Gm={...Hf,default:1},Zp=n=>Math.round(n*1e5)/1e5,BE=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function dJ(n){return n==null}const pJ=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,FE=(n,t)=>e=>!!(typeof e=="string"&&pJ.test(e)&&e.startsWith(n)||t&&!dJ(e)&&Object.prototype.hasOwnProperty.call(e,t)),J3=(n,t,e)=>r=>{if(typeof r!="string")return r;const[i,a,o,s]=r.match(BE);return{[n]:parseFloat(i),[t]:parseFloat(a),[e]:parseFloat(o),alpha:s!==void 0?parseFloat(s):1}},vJ=n=>Os(0,255,n),C1={...Hf,transform:n=>Math.round(vJ(n))},tc={test:FE("rgb","red"),parse:J3("red","green","blue"),transform:({red:n,green:t,blue:e,alpha:r=1})=>"rgba("+C1.transform(n)+", "+C1.transform(t)+", "+C1.transform(e)+", "+Zp(_v.transform(r))+")"};function gJ(n){let t="",e="",r="",i="";return n.length>5?(t=n.substring(1,3),e=n.substring(3,5),r=n.substring(5,7),i=n.substring(7,9)):(t=n.substring(1,2),e=n.substring(2,3),r=n.substring(3,4),i=n.substring(4,5),t+=t,e+=e,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(e,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const jA={test:FE("#"),parse:gJ,transform:tc.transform},og=n=>({test:t=>typeof t=="string"&&t.endsWith(n)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${n}`}),_l=og("deg"),Yo=og("%"),xe=og("px"),mJ=og("vh"),yJ=og("vw"),xL={...Yo,parse:n=>Yo.parse(n)/100,transform:n=>Yo.transform(n*100)},Kh={test:FE("hsl","hue"),parse:J3("hue","saturation","lightness"),transform:({hue:n,saturation:t,lightness:e,alpha:r=1})=>"hsla("+Math.round(n)+", "+Yo.transform(Zp(t))+", "+Yo.transform(Zp(e))+", "+Zp(_v.transform(r))+")"},hn={test:n=>tc.test(n)||jA.test(n)||Kh.test(n),parse:n=>tc.test(n)?tc.parse(n):Kh.test(n)?Kh.parse(n):jA.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?tc.transform(n):Kh.transform(n),getAnimatableNone:n=>{const t=hn.parse(n);return t.alpha=0,hn.transform(t)}},bJ=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function _J(n){return isNaN(n)&&typeof n=="string"&&(n.match(BE)?.length||0)+(n.match(bJ)?.length||0)>0}const tG="number",eG="color",wJ="var",xJ="var(",SL="${}",SJ=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function wv(n){const t=n.toString(),e=[],r={color:[],number:[],var:[]},i=[];let a=0;const s=t.replace(SJ,l=>(hn.test(l)?(r.color.push(a),i.push(eG),e.push(hn.parse(l))):l.startsWith(xJ)?(r.var.push(a),i.push(wJ),e.push(l)):(r.number.push(a),i.push(tG),e.push(parseFloat(l))),++a,SL)).split(SL);return{values:e,split:s,indexes:r,types:i}}function rG(n){return wv(n).values}function nG(n){const{split:t,types:e}=wv(n),r=t.length;return i=>{let a="";for(let o=0;o<r;o++)if(a+=t[o],i[o]!==void 0){const s=e[o];s===tG?a+=Zp(i[o]):s===eG?a+=hn.transform(i[o]):a+=i[o]}return a}}const AJ=n=>typeof n=="number"?0:hn.test(n)?hn.getAnimatableNone(n):n;function TJ(n){const t=rG(n);return nG(n)(t.map(AJ))}const Ul={test:_J,parse:rG,createTransformer:nG,getAnimatableNone:TJ};function E1(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*6*e:e<1/2?t:e<2/3?n+(t-n)*(2/3-e)*6:n}function CJ({hue:n,saturation:t,lightness:e,alpha:r}){n/=360,t/=100,e/=100;let i=0,a=0,o=0;if(!t)i=a=o=e;else{const s=e<.5?e*(1+t):e+t-e*t,l=2*e-s;i=E1(l,s,n+1/3),a=E1(l,s,n),o=E1(l,s,n-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function H0(n,t){return e=>e>0?t:n}const Br=(n,t,e)=>n+(t-n)*e,M1=(n,t,e)=>{const r=n*n,i=e*(t*t-r)+r;return i<0?0:Math.sqrt(i)},EJ=[jA,tc,Kh],MJ=n=>EJ.find(t=>t.test(n));function AL(n){const t=MJ(n);if(Gf(!!t,`'${n}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let e=t.parse(n);return t===Kh&&(e=CJ(e)),e}const TL=(n,t)=>{const e=AL(n),r=AL(t);if(!e||!r)return H0(n,t);const i={...e};return a=>(i.red=M1(e.red,r.red,a),i.green=M1(e.green,r.green,a),i.blue=M1(e.blue,r.blue,a),i.alpha=Br(e.alpha,r.alpha,a),tc.transform(i))},XA=new Set(["none","hidden"]);function PJ(n,t){return XA.has(n)?e=>e<=0?n:t:e=>e>=1?t:n}function kJ(n,t){return e=>Br(n,t,e)}function VE(n){return typeof n=="number"?kJ:typeof n=="string"?OE(n)?H0:hn.test(n)?TL:IJ:Array.isArray(n)?iG:typeof n=="object"?hn.test(n)?TL:DJ:H0}function iG(n,t){const e=[...n],r=e.length,i=n.map((a,o)=>VE(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)e[o]=i[o](a);return e}}function DJ(n,t){const e={...n,...t},r={};for(const i in e)n[i]!==void 0&&t[i]!==void 0&&(r[i]=VE(n[i])(n[i],t[i]));return i=>{for(const a in r)e[a]=r[a](i);return e}}function LJ(n,t){const e=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const a=t.types[i],o=n.indexes[a][r[a]],s=n.values[o]??0;e[i]=s,r[a]++}return e}const IJ=(n,t)=>{const e=Ul.createTransformer(t),r=wv(n),i=wv(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?XA.has(n)&&!i.values.length||XA.has(t)&&!r.values.length?PJ(n,t):ig(iG(LJ(r,i),i.values),e):(Gf(!0,`Complex values '${n}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),H0(n,t))};function aG(n,t,e){return typeof n=="number"&&typeof t=="number"&&typeof e=="number"?Br(n,t,e):VE(n)(n,t)}const RJ=n=>{const t=({timestamp:e})=>n(e);return{start:(e=!0)=>Lr.update(t,e),stop:()=>Hl(t),now:()=>Vn.isProcessing?Vn.timestamp:Wi.now()}},oG=(n,t,e=10)=>{let r="";const i=Math.max(Math.round(t/e),2);for(let a=0;a<i;a++)r+=Math.round(n(a/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},U0=2e4;function zE(n){let t=0;const e=50;let r=n.next(t);for(;!r.done&&t<U0;)t+=e,r=n.next(t);return t>=U0?1/0:t}function NJ(n,t=100,e){const r=e({...n,keyframes:[0,t]}),i=Math.min(zE(r),U0);return{type:"keyframes",ease:a=>r.next(i*a).value/t,duration:Oa(i)}}const OJ=5;function sG(n,t,e){const r=Math.max(t-OJ,0);return V3(e-n(r),t-r)}const Nr={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},P1=.001;function BJ({duration:n=Nr.duration,bounce:t=Nr.bounce,velocity:e=Nr.velocity,mass:r=Nr.mass}){let i,a;Gf(n<=co(Nr.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=Os(Nr.minDamping,Nr.maxDamping,o),n=Os(Nr.minDuration,Nr.maxDuration,Oa(n)),o<1?(i=u=>{const c=u*o,h=c*n,f=c-e,d=YA(u,o),v=Math.exp(-h);return P1-f/d*v},a=u=>{const h=u*o*n,f=h*e+e,d=Math.pow(o,2)*Math.pow(u,2)*n,v=Math.exp(-h),m=YA(Math.pow(u,2),o);return(-i(u)+P1>0?-1:1)*((f-d)*v)/m}):(i=u=>{const c=Math.exp(-u*n),h=(u-e)*n+1;return-P1+c*h},a=u=>{const c=Math.exp(-u*n),h=(e-u)*(n*n);return c*h});const s=5/n,l=VJ(i,a,s);if(n=co(n),isNaN(l))return{stiffness:Nr.stiffness,damping:Nr.damping,duration:n};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:n}}}const FJ=12;function VJ(n,t,e){let r=e;for(let i=1;i<FJ;i++)r=r-n(r)/t(r);return r}function YA(n,t){return n*Math.sqrt(1-t*t)}const zJ=["duration","bounce"],GJ=["stiffness","damping","mass"];function CL(n,t){return t.some(e=>n[e]!==void 0)}function HJ(n){let t={velocity:Nr.velocity,stiffness:Nr.stiffness,damping:Nr.damping,mass:Nr.mass,isResolvedFromDuration:!1,...n};if(!CL(n,GJ)&&CL(n,zJ))if(n.visualDuration){const e=n.visualDuration,r=2*Math.PI/(e*1.2),i=r*r,a=2*Os(.05,1,1-(n.bounce||0))*Math.sqrt(i);t={...t,mass:Nr.mass,stiffness:i,damping:a}}else{const e=BJ(n);t={...t,...e,mass:Nr.mass},t.isResolvedFromDuration=!0}return t}function W0(n=Nr.visualDuration,t=Nr.bounce){const e=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:t}:n;let{restSpeed:r,restDelta:i}=e;const a=e.keyframes[0],o=e.keyframes[e.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:u,mass:c,duration:h,velocity:f,isResolvedFromDuration:d}=HJ({...e,velocity:-Oa(e.velocity||0)}),v=f||0,m=u/(2*Math.sqrt(l*c)),y=o-a,g=Oa(Math.sqrt(l/c)),p=Math.abs(y)<5;r||(r=p?Nr.restSpeed.granular:Nr.restSpeed.default),i||(i=p?Nr.restDelta.granular:Nr.restDelta.default);let b;if(m<1){const x=YA(g,m);b=A=>{const T=Math.exp(-m*g*A);return o-T*((v+m*g*y)/x*Math.sin(x*A)+y*Math.cos(x*A))}}else if(m===1)b=x=>o-Math.exp(-g*x)*(y+(v+g*y)*x);else{const x=g*Math.sqrt(m*m-1);b=A=>{const T=Math.exp(-m*g*A),C=Math.min(x*A,300);return o-T*((v+m*g*y)*Math.sinh(C)+x*y*Math.cosh(C))/x}}const w={calculatedDuration:d&&h||null,next:x=>{const A=b(x);if(d)s.done=x>=h;else{let T=x===0?v:0;m<1&&(T=x===0?co(v):sG(b,x,A));const C=Math.abs(T)<=r,E=Math.abs(o-A)<=i;s.done=C&&E}return s.value=s.done?o:A,s},toString:()=>{const x=Math.min(zE(w),U0),A=oG(T=>w.next(x*T).value,x,30);return x+"ms "+A},toTransition:()=>{}};return w}W0.applyToOptions=n=>{const t=NJ(n,100,W0);return n.ease=t.ease,n.duration=co(t.duration),n.type="keyframes",n};function qA({keyframes:n,velocity:t=0,power:e=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:l,restDelta:u=.5,restSpeed:c}){const h=n[0],f={done:!1,value:h},d=C=>s!==void 0&&C<s||l!==void 0&&C>l,v=C=>s===void 0?l:l===void 0||Math.abs(s-C)<Math.abs(l-C)?s:l;let m=e*t;const y=h+m,g=o===void 0?y:o(y);g!==y&&(m=g-h);const p=C=>-m*Math.exp(-C/r),b=C=>g+p(C),w=C=>{const E=p(C),k=b(C);f.done=Math.abs(E)<=u,f.value=f.done?g:k};let x,A;const T=C=>{d(f.value)&&(x=C,A=W0({keyframes:[f.value,v(f.value)],velocity:sG(b,C,f.value),damping:i,stiffness:a,restDelta:u,restSpeed:c}))};return T(0),{calculatedDuration:null,next:C=>{let E=!1;return!A&&x===void 0&&(E=!0,w(C),T(C)),x!==void 0&&C>=x?A.next(C-x):(!E&&w(C),f)}}}function UJ(n,t,e){const r=[],i=e||Fs.mix||aG,a=n.length-1;for(let o=0;o<a;o++){let s=i(n[o],n[o+1]);if(t){const l=Array.isArray(t)?t[o]||Fa:t;s=ig(l,s)}r.push(s)}return r}function WJ(n,t,{clamp:e=!0,ease:r,mixer:i}={}){const a=n.length;if(Bs(a===t.length,"Both input and output ranges must be the same length","range-length"),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const o=n[0]===n[1];n[0]>n[a-1]&&(n=[...n].reverse(),t=[...t].reverse());const s=UJ(t,r,i),l=s.length,u=c=>{if(o&&c<n[0])return t[0];let h=0;if(l>1)for(;h<n.length-2&&!(c<n[h+1]);h++);const f=bv(n[h],n[h+1],c);return s[h](f)};return e?c=>u(Os(n[0],n[a-1],c)):u}function $J(n,t){const e=n[n.length-1];for(let r=1;r<=t;r++){const i=bv(0,t,r);n.push(Br(e,1,i))}}function jJ(n){const t=[0];return $J(t,n.length-1),t}function XJ(n,t){return n.map(e=>e*t)}function YJ(n,t){return n.map(()=>t||Y3).splice(0,n.length-1)}function Qh({duration:n=300,keyframes:t,times:e,ease:r="easeInOut"}){const i=oJ(r)?r.map(wL):wL(r),a={done:!1,value:t[0]},o=XJ(e&&e.length===t.length?e:jJ(t),n),s=WJ(o,t,{ease:Array.isArray(i)?i:YJ(t,i)});return{calculatedDuration:n,next:l=>(a.value=s(l),a.done=l>=n,a)}}const qJ=n=>n!==null;function GE(n,{repeat:t,repeatType:e="loop"},r,i=1){const a=n.filter(qJ),s=i<0||t&&e!=="loop"&&t%2===1?0:a.length-1;return!s||r===void 0?a[s]:r}const ZJ={decay:qA,inertia:qA,tween:Qh,keyframes:Qh,spring:W0};function lG(n){typeof n.type=="string"&&(n.type=ZJ[n.type])}class HE{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const KJ=n=>n/100;class UE extends HE{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:e}=this.options;e&&e.updatedAt!==Wi.now()&&this.tick(Wi.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;lG(t);const{type:e=Qh,repeat:r=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=t;let{keyframes:s}=t;const l=e||Qh;process.env.NODE_ENV!=="production"&&l!==Qh&&Bs(s.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${s}`,"spring-two-frames"),l!==Qh&&typeof s[0]!="number"&&(this.mixKeyframes=ig(KJ,aG(s[0],s[1])),s=[0,100]);const u=l({...t,keyframes:s});a==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...s].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=zE(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=u}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:r,totalDuration:i,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:s,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:f,repeatDelay:d,type:v,onUpdate:m,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-u*(this.playbackSpeed>=0?1:-1),p=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let b=this.currentTime,w=r;if(h){const C=Math.min(this.currentTime,i)/s;let E=Math.floor(C),k=C%1;!k&&C>=1&&(k=1),k===1&&E--,E=Math.min(E,h+1),E%2&&(f==="reverse"?(k=1-k,d&&(k-=d/s)):f==="mirror"&&(w=o)),b=Os(0,1,k)*s}const x=p?{done:!1,value:c[0]}:w.next(b);a&&(x.value=a(x.value));let{done:A}=x;!p&&l!==null&&(A=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return T&&v!==qA&&(x.value=GE(c,this.options,y,this.speed)),m&&m(x.value),T&&this.finish(),x}then(t,e){return this.finished.then(t,e)}get duration(){return Oa(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Oa(t)}get time(){return Oa(this.currentTime)}set time(t){t=co(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Wi.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=Oa(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=RJ,startTime:e}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=e??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Wi.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function QJ(n){for(let t=1;t<n.length;t++)n[t]??(n[t]=n[t-1])}const ec=n=>n*180/Math.PI,ZA=n=>{const t=ec(Math.atan2(n[1],n[0]));return KA(t)},JJ={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:n=>(Math.abs(n[0])+Math.abs(n[3]))/2,rotate:ZA,rotateZ:ZA,skewX:n=>ec(Math.atan(n[1])),skewY:n=>ec(Math.atan(n[2])),skew:n=>(Math.abs(n[1])+Math.abs(n[2]))/2},KA=n=>(n=n%360,n<0&&(n+=360),n),EL=ZA,ML=n=>Math.sqrt(n[0]*n[0]+n[1]*n[1]),PL=n=>Math.sqrt(n[4]*n[4]+n[5]*n[5]),ttt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ML,scaleY:PL,scale:n=>(ML(n)+PL(n))/2,rotateX:n=>KA(ec(Math.atan2(n[6],n[5]))),rotateY:n=>KA(ec(Math.atan2(-n[2],n[0]))),rotateZ:EL,rotate:EL,skewX:n=>ec(Math.atan(n[4])),skewY:n=>ec(Math.atan(n[1])),skew:n=>(Math.abs(n[1])+Math.abs(n[4]))/2};function QA(n){return n.includes("scale")?1:0}function JA(n,t){if(!n||n==="none")return QA(t);const e=n.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(e)r=ttt,i=e;else{const s=n.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=JJ,i=s}if(!i)return QA(t);const a=r[t],o=i[1].split(",").map(rtt);return typeof a=="function"?a(o):o[a]}const ett=(n,t)=>{const{transform:e="none"}=getComputedStyle(n);return JA(e,t)};function rtt(n){return parseFloat(n.trim())}const Uf=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Wf=new Set(Uf),kL=n=>n===Hf||n===xe,ntt=new Set(["x","y","z"]),itt=Uf.filter(n=>!ntt.has(n));function att(n){const t=[];return itt.forEach(e=>{const r=n.getValue(e);r!==void 0&&(t.push([e,r.get()]),r.set(e.startsWith("scale")?1:0))}),t}const vc={width:({x:n},{paddingLeft:t="0",paddingRight:e="0"})=>n.max-n.min-parseFloat(t)-parseFloat(e),height:({y:n},{paddingTop:t="0",paddingBottom:e="0"})=>n.max-n.min-parseFloat(t)-parseFloat(e),top:(n,{top:t})=>parseFloat(t),left:(n,{left:t})=>parseFloat(t),bottom:({y:n},{top:t})=>parseFloat(t)+(n.max-n.min),right:({x:n},{left:t})=>parseFloat(t)+(n.max-n.min),x:(n,{transform:t})=>JA(t,"x"),y:(n,{transform:t})=>JA(t,"y")};vc.translateX=vc.x;vc.translateY=vc.y;const gc=new Set;let tT=!1,eT=!1,rT=!1;function uG(){if(eT){const n=Array.from(gc).filter(r=>r.needsMeasurement),t=new Set(n.map(r=>r.element)),e=new Map;t.forEach(r=>{const i=att(r);i.length&&(e.set(r,i),r.render())}),n.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=e.get(r);i&&i.forEach(([a,o])=>{r.getValue(a)?.set(o)})}),n.forEach(r=>r.measureEndState()),n.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}eT=!1,tT=!1,gc.forEach(n=>n.complete(rT)),gc.clear()}function cG(){gc.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(eT=!0)})}function ott(){rT=!0,cG(),uG(),rT=!1}class WE{constructor(t,e,r,i,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=r,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(gc.add(this),tT||(tT=!0,Lr.read(cG),Lr.resolveKeyframes(uG))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:r,motionValue:i}=this;if(t[0]===null){const a=i?.get(),o=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&e){const s=r.readValue(e,o);s!=null&&(t[0]=s)}t[0]===void 0&&(t[0]=o),i&&a===void 0&&i.set(t[0])}QJ(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),gc.delete(this)}cancel(){this.state==="scheduled"&&(gc.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const stt=n=>n.startsWith("--");function ltt(n,t,e){stt(t)?n.style.setProperty(t,e):n.style[t]=e}const utt=DE(()=>window.ScrollTimeline!==void 0),ctt={};function htt(n,t){const e=DE(n);return()=>ctt[t]??e()}const hG=htt(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Lp=([n,t,e,r])=>`cubic-bezier(${n}, ${t}, ${e}, ${r})`,DL={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Lp([0,.65,.55,1]),circOut:Lp([.55,0,1,.45]),backIn:Lp([.31,.01,.66,-.59]),backOut:Lp([.33,1.53,.69,.99])};function fG(n,t){if(n)return typeof n=="function"?hG()?oG(n,t):"ease-out":q3(n)?Lp(n):Array.isArray(n)?n.map(e=>fG(e,t)||DL.easeOut):DL[n]}function ftt(n,t,e,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:s="easeOut",times:l}={},u=void 0){const c={[t]:e};l&&(c.offset=l);const h=fG(s,i);Array.isArray(h)&&(c.easing=h);const f={delay:r,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),n.animate(c,f)}function dG(n){return typeof n=="function"&&"applyToOptions"in n}function dtt({type:n,...t}){return dG(n)&&hG()?n.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class ptt extends HE{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:r,keyframes:i,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:s,onComplete:l}=t;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=t,Bs(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=dtt(t);this.animation=ftt(e,r,i,u,a),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const c=GE(i,this.options,s,this.speed);this.updateMotionValue?this.updateMotionValue(c):ltt(e,r,c),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Oa(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Oa(t)}get time(){return Oa(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=co(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&utt()?(this.animation.timeline=t,Fa):e(this)}}const pG={anticipate:$3,backInOut:W3,circInOut:X3};function vtt(n){return n in pG}function gtt(n){typeof n.ease=="string"&&vtt(n.ease)&&(n.ease=pG[n.ease])}const LL=10;class mtt extends ptt{constructor(t){gtt(t),lG(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:r,onComplete:i,element:a,...o}=this.options;if(!e)return;if(t!==void 0){e.set(t);return}const s=new UE({...o,autoplay:!1}),l=co(this.finishedTime??this.time);e.setWithVelocity(s.sample(l-LL).value,s.sample(l).value,LL),s.stop()}}const IL=(n,t)=>t==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(Ul.test(n)||n==="0")&&!n.startsWith("url("));function ytt(n){const t=n[0];if(n.length===1)return!0;for(let e=0;e<n.length;e++)if(n[e]!==t)return!0}function btt(n,t,e,r){const i=n[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=n[n.length-1],o=IL(i,t),s=IL(a,t);return Gf(o===s,`You are trying to animate ${t} from "${i}" to "${a}". "${o?a:i}" is not an animatable value.`,"value-not-animatable"),!o||!s?!1:ytt(n)||(e==="spring"||dG(e))&&r}function nT(n){n.duration=0,n.type="keyframes"}const _tt=new Set(["opacity","clipPath","filter","transform"]),wtt=DE(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function xtt(n){const{motionValue:t,name:e,repeatDelay:r,repeatType:i,damping:a,type:o}=n;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=t.owner.getProps();return wtt()&&e&&_tt.has(e)&&(e!=="transform"||!u)&&!l&&!r&&i!=="mirror"&&a!==0&&o!=="inertia"}const Stt=40;class Att extends HE{constructor({autoplay:t=!0,delay:e=0,type:r="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",keyframes:s,name:l,motionValue:u,element:c,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Wi.now();const f={autoplay:t,delay:e,type:r,repeat:i,repeatDelay:a,repeatType:o,name:l,motionValue:u,element:c,...h},d=c?.KeyframeResolver||WE;this.keyframeResolver=new d(s,(v,m,y)=>this.onKeyframesResolved(v,m,f,!y),l,u,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,r,i){this.keyframeResolver=void 0;const{name:a,type:o,velocity:s,delay:l,isHandoff:u,onUpdate:c}=r;this.resolvedAt=Wi.now(),btt(t,a,o,s)||((Fs.instantAnimations||!l)&&c?.(GE(t,r,e)),t[0]=t[t.length-1],nT(r),r.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Stt?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:e,...r,keyframes:t},d=!u&&xtt(f)?new mtt({...f,element:f.motionValue.owner.current}):new UE(f);d.finished.then(()=>this.notifyFinished()).catch(Fa),this.pendingTimeline&&(this.stopTimeline=d.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=d}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ott()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const Ttt=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ctt(n){const t=Ttt.exec(n);if(!t)return[,];const[,e,r,i]=t;return[`--${e??r}`,i]}const Ett=4;function vG(n,t,e=1){Bs(e<=Ett,`Max CSS variable fallback depth detected in property "${n}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,i]=Ctt(n);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return O3(o)?parseFloat(o):o}return OE(i)?vG(i,t,e+1):i}function $E(n,t){return n?.[t]??n?.default??n}const gG=new Set(["width","height","top","left","right","bottom",...Uf]),Mtt={test:n=>n==="auto",parse:n=>n},mG=n=>t=>t.test(n),yG=[Hf,xe,Yo,_l,yJ,mJ,Mtt],RL=n=>yG.find(mG(n));function Ptt(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||F3(n):!0}const ktt=new Set(["brightness","contrast","saturate","opacity"]);function Dtt(n){const[t,e]=n.slice(0,-1).split("(");if(t==="drop-shadow")return n;const[r]=e.match(BE)||[];if(!r)return n;const i=e.replace(r,"");let a=ktt.has(t)?1:0;return r!==e&&(a*=100),t+"("+a+i+")"}const Ltt=/\b([a-z-]*)\(.*?\)/gu,iT={...Ul,getAnimatableNone:n=>{const t=n.match(Ltt);return t?t.map(Dtt).join(" "):n}},NL={...Hf,transform:Math.round},Itt={rotate:_l,rotateX:_l,rotateY:_l,rotateZ:_l,scale:Gm,scaleX:Gm,scaleY:Gm,scaleZ:Gm,skew:_l,skewX:_l,skewY:_l,distance:xe,translateX:xe,translateY:xe,translateZ:xe,x:xe,y:xe,z:xe,perspective:xe,transformPerspective:xe,opacity:_v,originX:xL,originY:xL,originZ:xe},jE={borderWidth:xe,borderTopWidth:xe,borderRightWidth:xe,borderBottomWidth:xe,borderLeftWidth:xe,borderRadius:xe,radius:xe,borderTopLeftRadius:xe,borderTopRightRadius:xe,borderBottomRightRadius:xe,borderBottomLeftRadius:xe,width:xe,maxWidth:xe,height:xe,maxHeight:xe,top:xe,right:xe,bottom:xe,left:xe,padding:xe,paddingTop:xe,paddingRight:xe,paddingBottom:xe,paddingLeft:xe,margin:xe,marginTop:xe,marginRight:xe,marginBottom:xe,marginLeft:xe,backgroundPositionX:xe,backgroundPositionY:xe,...Itt,zIndex:NL,fillOpacity:_v,strokeOpacity:_v,numOctaves:NL},Rtt={...jE,color:hn,backgroundColor:hn,outlineColor:hn,fill:hn,stroke:hn,borderColor:hn,borderTopColor:hn,borderRightColor:hn,borderBottomColor:hn,borderLeftColor:hn,filter:iT,WebkitFilter:iT},bG=n=>Rtt[n];function _G(n,t){let e=bG(n);return e!==iT&&(e=Ul),e.getAnimatableNone?e.getAnimatableNone(t):void 0}const Ntt=new Set(["auto","none","0"]);function Ott(n,t,e){let r=0,i;for(;r<n.length&&!i;){const a=n[r];typeof a=="string"&&!Ntt.has(a)&&wv(a).values.length&&(i=n[r]),r++}if(i&&e)for(const a of t)n[a]=_G(e,i)}class Btt extends WE{constructor(t,e,r,i,a){super(t,e,r,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:r}=this;if(!e||!e.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),OE(u))){const c=vG(u,e.current);c!==void 0&&(t[l]=c),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!gG.has(r)||t.length!==2)return;const[i,a]=t,o=RL(i),s=RL(a);if(o!==s)if(kL(o)&&kL(s))for(let l=0;l<t.length;l++){const u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else vc[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,r=[];for(let i=0;i<t.length;i++)(t[i]===null||Ptt(t[i]))&&r.push(i);r.length&&Ott(t,r,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=vc[r](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const a=r.length-1,o=r[a];r[a]=vc[e](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([s,l])=>{t.getValue(s).set(l)}),this.resolveNoneKeyframes()}}function Ftt(n,t,e){if(n instanceof EventTarget)return[n];if(typeof n=="string"){let r=document;const i=e?.[n]??r.querySelectorAll(n);return i?Array.from(i):[]}return Array.from(n)}const wG=(n,t)=>t&&typeof n=="number"?t.transform(n):n;function Vtt(n){return B3(n)&&"offsetHeight"in n}const OL=30,ztt=n=>!isNaN(parseFloat(n));class Gtt{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const i=Wi.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){this.current=t,this.updatedAt=Wi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=ztt(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&IE(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new LE);const r=this.events[t].add(e);return t==="change"?()=>{r(),Lr.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,r){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Wi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>OL)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,OL);return V3(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Tf(n,t){return new Gtt(n,t)}const{schedule:XE}=Z3(queueMicrotask,!1),eo={x:!1,y:!1};function xG(){return eo.x||eo.y}function Htt(n){return n==="x"||n==="y"?eo[n]?null:(eo[n]=!0,()=>{eo[n]=!1}):eo.x||eo.y?null:(eo.x=eo.y=!0,()=>{eo.x=eo.y=!1})}function SG(n,t){const e=Ftt(n),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[e,i,()=>r.abort()]}function BL(n){return!(n.pointerType==="touch"||xG())}function Utt(n,t,e={}){const[r,i,a]=SG(n,e),o=s=>{if(!BL(s))return;const{target:l}=s,u=t(l,s);if(typeof u!="function"||!l)return;const c=h=>{BL(h)&&(u(h),l.removeEventListener("pointerleave",c))};l.addEventListener("pointerleave",c,i)};return r.forEach(s=>{s.addEventListener("pointerenter",o,i)}),a}const AG=(n,t)=>t?n===t?!0:AG(n,t.parentElement):!1,YE=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1,Wtt=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function $tt(n){return Wtt.has(n.tagName)||n.tabIndex!==-1}const f0=new WeakSet;function FL(n){return t=>{t.key==="Enter"&&n(t)}}function k1(n,t){n.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const jtt=(n,t)=>{const e=n.currentTarget;if(!e)return;const r=FL(()=>{if(f0.has(e))return;k1(e,"down");const i=FL(()=>{k1(e,"up")}),a=()=>k1(e,"cancel");e.addEventListener("keyup",i,t),e.addEventListener("blur",a,t)});e.addEventListener("keydown",r,t),e.addEventListener("blur",()=>e.removeEventListener("keydown",r),t)};function VL(n){return YE(n)&&!xG()}function Xtt(n,t,e={}){const[r,i,a]=SG(n,e),o=s=>{const l=s.currentTarget;if(!VL(s))return;f0.add(l);const u=t(l,s),c=(d,v)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),f0.has(l)&&f0.delete(l),VL(d)&&typeof u=="function"&&u(d,{success:v})},h=d=>{c(d,l===window||l===document||e.useGlobalTarget||AG(l,d.target))},f=d=>{c(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return r.forEach(s=>{(e.useGlobalTarget?window:s).addEventListener("pointerdown",o,i),Vtt(s)&&(s.addEventListener("focus",u=>jtt(u,i)),!$tt(s)&&!s.hasAttribute("tabindex")&&(s.tabIndex=0))}),a}function TG(n){return B3(n)&&"ownerSVGElement"in n}function Ytt(n){return TG(n)&&n.tagName==="svg"}const ri=n=>!!(n&&n.getVelocity),qtt=[...yG,hn,Ul],Ztt=n=>qtt.find(mG(n)),CG=yt.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});function Ktt(n=!0){const t=yt.useContext(ME);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:r,register:i}=t,a=yt.useId();yt.useEffect(()=>{if(n)return i(a)},[n]);const o=yt.useCallback(()=>n&&r&&r(a),[a,r,n]);return!e&&r?[!1,o]:[!0]}const EG=yt.createContext({strict:!1}),zL={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Cf={};for(const n in zL)Cf[n]={isEnabled:t=>zL[n].some(e=>!!t[e])};function Qtt(n){for(const t in n)Cf[t]={...Cf[t],...n[t]}}const Jtt=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function $0(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||Jtt.has(n)}let MG=n=>!$0(n);function tet(n){typeof n=="function"&&(MG=t=>t.startsWith("on")?!$0(t):n(t))}try{tet(require("@emotion/is-prop-valid").default)}catch{}function eet(n,t,e){const r={};for(const i in n)i==="values"&&typeof n.values=="object"||(MG(i)||e===!0&&$0(i)||!t&&!$0(i)||n.draggable&&i.startsWith("onDrag"))&&(r[i]=n[i]);return r}const o_=yt.createContext({});function s_(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}function xv(n){return typeof n=="string"||Array.isArray(n)}const qE=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ZE=["initial",...qE];function l_(n){return s_(n.animate)||ZE.some(t=>xv(n[t]))}function PG(n){return!!(l_(n)||n.variants)}function ret(n,t){if(l_(n)){const{initial:e,animate:r}=n;return{initial:e===!1||xv(e)?e:void 0,animate:xv(r)?r:void 0}}return n.inherit!==!1?t:{}}function net(n){const{initial:t,animate:e}=ret(n,yt.useContext(o_));return yt.useMemo(()=>({initial:t,animate:e}),[GL(t),GL(e)])}function GL(n){return Array.isArray(n)?n.join(" "):n}function HL(n,t){return t.max===t.min?0:n/(t.max-t.min)*100}const Id={correct:(n,t)=>{if(!t.target)return n;if(typeof n=="string")if(xe.test(n))n=parseFloat(n);else return n;const e=HL(n,t.target.x),r=HL(n,t.target.y);return`${e}% ${r}%`}},iet={correct:(n,{treeScale:t,projectionDelta:e})=>{const r=n,i=Ul.parse(n);if(i.length>5)return r;const a=Ul.createTransformer(n),o=typeof i[0]!="number"?1:0,s=e.x.scale*t.x,l=e.y.scale*t.y;i[0+o]/=s,i[1+o]/=l;const u=Br(s,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),a(i)}},aT={borderRadius:{...Id,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Id,borderTopRightRadius:Id,borderBottomLeftRadius:Id,borderBottomRightRadius:Id,boxShadow:iet};function kG(n,{layout:t,layoutId:e}){return Wf.has(n)||n.startsWith("origin")||(t||e!==void 0)&&(!!aT[n]||n==="opacity")}const aet={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},oet=Uf.length;function set(n,t,e){let r="",i=!0;for(let a=0;a<oet;a++){const o=Uf[a],s=n[o];if(s===void 0)continue;let l=!0;if(typeof s=="number"?l=s===(o.startsWith("scale")?1:0):l=parseFloat(s)===0,!l||e){const u=wG(s,jE[o]);if(!l){i=!1;const c=aet[o]||o;r+=`${c}(${u}) `}e&&(t[o]=u)}}return r=r.trim(),e?r=e(t,i?"":r):i&&(r="none"),r}function KE(n,t,e){const{style:r,vars:i,transformOrigin:a}=n;let o=!1,s=!1;for(const l in t){const u=t[l];if(Wf.has(l)){o=!0;continue}else if(Q3(l)){i[l]=u;continue}else{const c=wG(u,jE[l]);l.startsWith("origin")?(s=!0,a[l]=c):r[l]=c}}if(t.transform||(o||e?r.transform=set(t,n.transform,e):r.transform&&(r.transform="none")),s){const{originX:l="50%",originY:u="50%",originZ:c=0}=a;r.transformOrigin=`${l} ${u} ${c}`}}const QE=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function DG(n,t,e){for(const r in t)!ri(t[r])&&!kG(r,e)&&(n[r]=t[r])}function uet({transformTemplate:n},t){return yt.useMemo(()=>{const e=QE();return KE(e,t,n),Object.assign({},e.vars,e.style)},[t])}function cet(n,t){const e=n.style||{},r={};return DG(r,e,n),Object.assign(r,uet(n,t)),r}function het(n,t){const e={},r=cet(n,t);return n.drag&&n.dragListener!==!1&&(e.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(e.tabIndex=0),e.style=r,e}const fet={offset:"stroke-dashoffset",array:"stroke-dasharray"},det={offset:"strokeDashoffset",array:"strokeDasharray"};function pet(n,t,e=1,r=0,i=!0){n.pathLength=1;const a=i?fet:det;n[a.offset]=xe.transform(-r);const o=xe.transform(t),s=xe.transform(e);n[a.array]=`${o} ${s}`}function LG(n,{attrX:t,attrY:e,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},l,u,c){if(KE(n,s,u),l){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:h,style:f}=n;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=c?.transformBox??"fill-box",delete h.transformBox),t!==void 0&&(h.x=t),e!==void 0&&(h.y=e),r!==void 0&&(h.scale=r),i!==void 0&&pet(h,i,a,o,!1)}const IG=()=>({...QE(),attrs:{}}),RG=n=>typeof n=="string"&&n.toLowerCase()==="svg";function vet(n,t,e,r){const i=yt.useMemo(()=>{const a=IG();return LG(a,t,RG(r),n.transformTemplate,n.style),{...a.attrs,style:{...a.style}}},[t]);if(n.style){const a={};DG(a,n.style,n),i.style={...a,...i.style}}return i}const get=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function JE(n){return typeof n!="string"||n.includes("-")?!1:!!(get.indexOf(n)>-1||/[A-Z]/u.test(n))}function met(n,t,e,{latestValues:r},i,a=!1){const s=(JE(n)?vet:het)(t,r,i,n),l=eet(t,typeof n=="string",a),u=n!==yt.Fragment?{...l,...s,ref:e}:{},{children:c}=t,h=yt.useMemo(()=>ri(c)?c.get():c,[c]);return yt.createElement(n,{...u,children:h})}function UL(n){const t=[{},{}];return n?.values.forEach((e,r)=>{t[0][r]=e.get(),t[1][r]=e.getVelocity()}),t}function tM(n,t,e,r){if(typeof t=="function"){const[i,a]=UL(r);t=t(e!==void 0?e:n.custom,i,a)}if(typeof t=="string"&&(t=n.variants&&n.variants[t]),typeof t=="function"){const[i,a]=UL(r);t=t(e!==void 0?e:n.custom,i,a)}return t}function d0(n){return ri(n)?n.get():n}function yet({scrapeMotionValuesFromProps:n,createRenderState:t},e,r,i){return{latestValues:bet(e,r,i,n),renderState:t()}}function bet(n,t,e,r){const i={},a=r(n,{});for(const f in a)i[f]=d0(a[f]);let{initial:o,animate:s}=n;const l=l_(n),u=PG(n);t&&u&&!l&&n.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let c=e?e.initial===!1:!1;c=c||o===!1;const h=c?s:o;if(h&&typeof h!="boolean"&&!s_(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const v=tM(n,f[d]);if(v){const{transitionEnd:m,transition:y,...g}=v;for(const p in g){let b=g[p];if(Array.isArray(b)){const w=c?b.length-1:0;b=b[w]}b!==null&&(i[p]=b)}for(const p in m)i[p]=m[p]}}}return i}const NG=n=>(t,e)=>{const r=yt.useContext(o_),i=yt.useContext(ME),a=()=>yet(n,t,r,i);return e?a():QQ(a)};function eM(n,t,e){const{style:r}=n,i={};for(const a in r)(ri(r[a])||t.style&&ri(t.style[a])||kG(a,n)||e?.getValue(a)?.liveStyle!==void 0)&&(i[a]=r[a]);return i}const _et=NG({scrapeMotionValuesFromProps:eM,createRenderState:QE});function OG(n,t,e){const r=eM(n,t,e);for(const i in n)if(ri(n[i])||ri(t[i])){const a=Uf.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[a]=n[i]}return r}const wet=NG({scrapeMotionValuesFromProps:OG,createRenderState:IG}),xet=Symbol.for("motionComponentSymbol");function Jh(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function Aet(n,t,e){return yt.useCallback(r=>{r&&n.onMount&&n.onMount(r),t&&(r?t.mount(r):t.unmount()),e&&(typeof e=="function"?e(r):Jh(e)&&(e.current=r))},[t])}const rM=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Tet="framerAppearId",BG="data-"+rM(Tet),FG=yt.createContext({});function Cet(n,t,e,r,i){const{visualElement:a}=yt.useContext(o_),o=yt.useContext(EG),s=yt.useContext(ME),l=yt.useContext(CG).reducedMotion,u=yt.useRef(null);r=r||o.renderer,!u.current&&r&&(u.current=r(n,{visualState:t,parent:a,props:e,presenceContext:s,blockInitialAnimation:s?s.initial===!1:!1,reducedMotionConfig:l}));const c=u.current,h=yt.useContext(FG);c&&!c.projection&&i&&(c.type==="html"||c.type==="svg")&&Eet(u.current,e,i,h);const f=yt.useRef(!1);yt.useInsertionEffect(()=>{c&&f.current&&c.update(e,s)});const d=e[BG],v=yt.useRef(!!d&&!window.MotionHandoffIsComplete?.(d)&&window.MotionHasOptimisedAnimation?.(d));return JQ(()=>{c&&(f.current=!0,window.MotionIsMounted=!0,c.updateFeatures(),c.scheduleRenderMicrotask(),v.current&&c.animationState&&c.animationState.animateChanges())}),yt.useEffect(()=>{c&&(!v.current&&c.animationState&&c.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(d)}),v.current=!1),c.enteringChildren=void 0)}),c}function Eet(n,t,e,r){const{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=t;n.projection=new e(n.latestValues,t["data-framer-portal-id"]?void 0:VG(n.parent)),n.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Jh(s),visualElement:n,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,crossfade:c,layoutScroll:l,layoutRoot:u})}function VG(n){if(n)return n.options.allowProjection!==!1?n.projection:VG(n.parent)}function D1(n,{forwardMotionProps:t=!1}={},e,r){e&&Qtt(e);const i=JE(n)?wet:_et;function a(s,l){let u;const c={...yt.useContext(CG),...s,layoutId:Met(s)},{isStatic:h}=c,f=net(s),d=i(s,h);if(!h&&EE){Pet(c,e);const v=ket(c);u=v.MeasureLayout,f.visualElement=Cet(n,d,c,r,v.ProjectionNode)}return $t.jsxs(o_.Provider,{value:f,children:[u&&f.visualElement?$t.jsx(u,{visualElement:f.visualElement,...c}):null,met(n,s,Aet(d,f.visualElement,l),d,h,t)]})}a.displayName=`motion.${typeof n=="string"?n:`create(${n.displayName??n.name??""})`}`;const o=yt.forwardRef(a);return o[xet]=n,o}function Met({layoutId:n}){const t=yt.useContext(N3).id;return t&&n!==void 0?t+"-"+n:n}function Pet(n,t){const e=yt.useContext(EG).strict;if(process.env.NODE_ENV!=="production"&&t&&e){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";n.ignoreStrict?Gf(!1,r,"lazy-strict-mode"):Bs(!1,r,"lazy-strict-mode")}}function ket(n){const{drag:t,layout:e}=Cf;if(!t&&!e)return{};const r={...t,...e};return{MeasureLayout:t?.isEnabled(n)||e?.isEnabled(n)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Det(n,t){if(typeof Proxy>"u")return D1;const e=new Map,r=(a,o)=>D1(a,o,n,t),i=(a,o)=>(process.env.NODE_ENV!=="production"&&IE(!1,"motion() is deprecated. Use motion.create() instead."),r(a,o));return new Proxy(i,{get:(a,o)=>o==="create"?r:(e.has(o)||e.set(o,D1(o,void 0,n,t)),e.get(o))})}function zG({top:n,left:t,right:e,bottom:r}){return{x:{min:t,max:e},y:{min:n,max:r}}}function Let({x:n,y:t}){return{top:t.min,right:n.max,bottom:t.max,left:n.min}}function Iet(n,t){if(!t)return n;const e=t({x:n.left,y:n.top}),r=t({x:n.right,y:n.bottom});return{top:e.y,left:e.x,bottom:r.y,right:r.x}}function L1(n){return n===void 0||n===1}function oT({scale:n,scaleX:t,scaleY:e}){return!L1(n)||!L1(t)||!L1(e)}function Hu(n){return oT(n)||GG(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function GG(n){return WL(n.x)||WL(n.y)}function WL(n){return n&&n!=="0%"}function j0(n,t,e){const r=n-e,i=t*r;return e+i}function $L(n,t,e,r,i){return i!==void 0&&(n=j0(n,i,r)),j0(n,e,r)+t}function sT(n,t=0,e=1,r,i){n.min=$L(n.min,t,e,r,i),n.max=$L(n.max,t,e,r,i)}function HG(n,{x:t,y:e}){sT(n.x,t.translate,t.scale,t.originPoint),sT(n.y,e.translate,e.scale,e.originPoint)}const jL=.999999999999,XL=1.0000000000001;function Ret(n,t,e,r=!1){const i=e.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=e[s],o=a.projectionDelta;const{visualElement:l}=a.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&ef(n,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,HG(n,o)),r&&Hu(a.latestValues)&&ef(n,a.latestValues))}t.x<XL&&t.x>jL&&(t.x=1),t.y<XL&&t.y>jL&&(t.y=1)}function tf(n,t){n.min=n.min+t,n.max=n.max+t}function YL(n,t,e,r,i=.5){const a=Br(n.min,n.max,i);sT(n,t,e,a,r)}function ef(n,t){YL(n.x,t.x,t.scaleX,t.scale,t.originX),YL(n.y,t.y,t.scaleY,t.scale,t.originY)}function UG(n,t){return zG(Iet(n.getBoundingClientRect(),t))}function Net(n,t,e){const r=UG(n,e),{scroll:i}=t;return i&&(tf(r.x,i.offset.x),tf(r.y,i.offset.y)),r}const qL=()=>({translate:0,scale:1,origin:0,originPoint:0}),rf=()=>({x:qL(),y:qL()}),ZL=()=>({min:0,max:0}),mn=()=>({x:ZL(),y:ZL()}),lT={current:null},WG={current:!1};function Oet(){if(WG.current=!0,!!EE)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),t=()=>lT.current=n.matches;n.addEventListener("change",t),t()}else lT.current=!1}const Bet=new WeakMap;function Fet(n,t,e){for(const r in t){const i=t[r],a=e[r];if(ri(i))n.addValue(r,i);else if(ri(a))n.addValue(r,Tf(i,{owner:n}));else if(a!==i)if(n.hasValue(r)){const o=n.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=n.getStaticValue(r);n.addValue(r,Tf(o!==void 0?o:i,{owner:n}))}}for(const r in e)t[r]===void 0&&n.removeValue(r);return t}const KL=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Vet{scrapeMotionValuesFromProps(t,e,r){return{}}constructor({parent:t,props:e,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=WE,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=Wi.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,Lr.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=e,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=l_(e),this.isVariantNode=PG(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const f in h){const d=h[f];l[f]!==void 0&&ri(d)&&d.set(l[f])}}mount(t){this.current=t,Bet.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,r)=>this.bindToMotionValue(r,e)),WG.current||Oet(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:lT.current,process.env.NODE_ENV!=="production"&&IE(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Hl(this.notifyUpdate),Hl(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Wf.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Lr.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),a&&a(),e.owner&&e.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Cf){const e=Cf[t];if(!e)continue;const{isEnabled:r,Feature:i}=e;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):mn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let r=0;r<KL.length;r++){const i=KL[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,o=t[a];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=Fet(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const r=this.values.get(t);e!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&e!==void 0&&(r=Tf(e===null?void 0:e,{owner:this}),this.addValue(t,r)),r}readValue(t,e){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(O3(r)||F3(r))?r=parseFloat(r):!Ztt(r)&&Ul.test(e)&&(r=_G(t,e)),this.setBaseTarget(t,ri(r)?r.get():r)),ri(r)?r.get():r}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let r;if(typeof e=="string"||typeof e=="object"){const a=tM(this.props,e,this.presenceContext?.custom);a&&(r=a[t])}if(e&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!ri(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,e){return this.events[t]||(this.events[t]=new LE),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){XE.render(this.render)}}class $G extends Vet{constructor(){super(...arguments),this.KeyframeResolver=Btt}sortInstanceNodePosition(t,e){return t.compareDocumentPosition(e)&2?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:r}){delete e[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ri(t)&&(this.childSubscription=t.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}function jG(n,{style:t,vars:e},r,i){const a=n.style;let o;for(o in t)a[o]=t[o];i?.applyProjectionStyles(a,r);for(o in e)a.setProperty(o,e[o])}function zet(n){return window.getComputedStyle(n)}class Get extends $G{constructor(){super(...arguments),this.type="html",this.renderInstance=jG}readValueFromInstance(t,e){if(Wf.has(e))return this.projection?.isProjecting?QA(e):ett(t,e);{const r=zet(t),i=(Q3(e)?r.getPropertyValue(e):r[e])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:e}){return UG(t,e)}build(t,e,r){KE(t,e,r.transformTemplate)}scrapeMotionValuesFromProps(t,e,r){return eM(t,e,r)}}const XG=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Het(n,t,e,r){jG(n,t,void 0,r);for(const i in t.attrs)n.setAttribute(XG.has(i)?i:rM(i),t.attrs[i])}class Uet extends $G{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=mn}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Wf.has(e)){const r=bG(e);return r&&r.default||0}return e=XG.has(e)?e:rM(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,r){return OG(t,e,r)}build(t,e,r){LG(t,e,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,e,r,i){Het(t,e,r,i)}mount(t){this.isSVGTag=RG(t.tagName),super.mount(t)}}const Wet=(n,t)=>JE(n)?new Uet(t):new Get(t,{allowProjection:n!==yt.Fragment});function ff(n,t,e){const r=n.getProps();return tM(r,t,e!==void 0?e:r.custom,n)}const uT=n=>Array.isArray(n);function $et(n,t,e){n.hasValue(t)?n.getValue(t).set(e):n.addValue(t,Tf(e))}function jet(n){return uT(n)?n[n.length-1]||0:n}function Xet(n,t){const e=ff(n,t);let{transitionEnd:r={},transition:i={},...a}=e||{};a={...a,...r};for(const o in a){const s=jet(a[o]);$et(n,o,s)}}function Yet(n){return!!(ri(n)&&n.add)}function cT(n,t){const e=n.getValue("willChange");if(Yet(e))return e.add(t);if(!e&&Fs.WillChange){const r=new Fs.WillChange("auto");n.addValue("willChange",r),r.add(t)}}function YG(n){return n.props[BG]}const qet=n=>n!==null;function Zet(n,{repeat:t,repeatType:e="loop"},r){const i=n.filter(qet),a=t&&e!=="loop"&&t%2===1?0:i.length-1;return i[a]}const Ket={type:"spring",stiffness:500,damping:25,restSpeed:10},Qet=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),Jet={type:"keyframes",duration:.8},trt={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ert=(n,{keyframes:t})=>t.length>2?Jet:Wf.has(n)?n.startsWith("scale")?Qet(t[1]):Ket:trt;function rrt({when:n,delay:t,delayChildren:e,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:o,repeatDelay:s,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const nM=(n,t,e,r={},i,a)=>o=>{const s=$E(r,n)||{},l=s.delay||r.delay||0;let{elapsed:u=0}=r;u=u-co(l);const c={keyframes:Array.isArray(e)?e:[null,e],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-u,onUpdate:f=>{t.set(f),s.onUpdate&&s.onUpdate(f)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:n,motionValue:t,element:a?void 0:i};rrt(s)||Object.assign(c,ert(n,c)),c.duration&&(c.duration=co(c.duration)),c.repeatDelay&&(c.repeatDelay=co(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(nT(c),c.delay===0&&(h=!0)),(Fs.instantAnimations||Fs.skipAnimations)&&(h=!0,nT(c),c.delay=0),c.allowFlatten=!s.type&&!s.ease,h&&!a&&t.get()!==void 0){const f=Zet(c.keyframes,s);if(f!==void 0){Lr.update(()=>{c.onUpdate(f),c.onComplete()});return}}return s.isSync?new UE(c):new Att(c)};function nrt({protectedKeys:n,needsAnimating:t},e){const r=n.hasOwnProperty(e)&&t[e]!==!0;return t[e]=!1,r}function qG(n,t,{delay:e=0,transitionOverride:r,type:i}={}){let{transition:a=n.getDefaultTransition(),transitionEnd:o,...s}=t;r&&(a=r);const l=[],u=i&&n.animationState&&n.animationState.getState()[i];for(const c in s){const h=n.getValue(c,n.latestValues[c]??null),f=s[c];if(f===void 0||u&&nrt(u,c))continue;const d={delay:e,...$E(a||{},c)},v=h.get();if(v!==void 0&&!h.isAnimating&&!Array.isArray(f)&&f===v&&!d.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const g=YG(n);if(g){const p=window.MotionHandoffAnimation(g,c,Lr);p!==null&&(d.startTime=p,m=!0)}}cT(n,c),h.start(nM(c,h,f,n.shouldReduceMotion&&gG.has(c)?{type:!1}:d,n,m));const y=h.animation;y&&l.push(y)}return o&&Promise.all(l).then(()=>{Lr.update(()=>{o&&Xet(n,o)})}),l}function ZG(n,t,e,r=0,i=1){const a=Array.from(n).sort((u,c)=>u.sortNodePosition(c)).indexOf(t),o=n.size,s=(o-1)*r;return typeof e=="function"?e(a,o):i===1?a*r:s-a*r}function hT(n,t,e={}){const r=ff(n,t,e.type==="exit"?n.presenceContext?.custom:void 0);let{transition:i=n.getDefaultTransition()||{}}=r||{};e.transitionOverride&&(i=e.transitionOverride);const a=r?()=>Promise.all(qG(n,r,e)):()=>Promise.resolve(),o=n.variantChildren&&n.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:h}=i;return irt(n,t,l,u,c,h,e)}:()=>Promise.resolve(),{when:s}=i;if(s){const[l,u]=s==="beforeChildren"?[a,o]:[o,a];return l().then(()=>u())}else return Promise.all([a(),o(e.delay)])}function irt(n,t,e=0,r=0,i=0,a=1,o){const s=[];for(const l of n.variantChildren)l.notify("AnimationStart",t),s.push(hT(l,t,{...o,delay:e+(typeof r=="function"?0:r)+ZG(n.variantChildren,l,r,i,a)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(s)}function art(n,t,e={}){n.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(a=>hT(n,a,e));r=Promise.all(i)}else if(typeof t=="string")r=hT(n,t,e);else{const i=typeof t=="function"?ff(n,t,e.custom):t;r=Promise.all(qG(n,i,e))}return r.then(()=>{n.notify("AnimationComplete",t)})}function KG(n,t){if(!Array.isArray(t))return!1;const e=t.length;if(e!==n.length)return!1;for(let r=0;r<e;r++)if(t[r]!==n[r])return!1;return!0}const ort=ZE.length;function QG(n){if(!n)return;if(!n.isControllingVariants){const e=n.parent?QG(n.parent)||{}:{};return n.props.initial!==void 0&&(e.initial=n.props.initial),e}const t={};for(let e=0;e<ort;e++){const r=ZE[e],i=n.props[r];(xv(i)||i===!1)&&(t[r]=i)}return t}const srt=[...qE].reverse(),lrt=qE.length;function urt(n){return t=>Promise.all(t.map(({animation:e,options:r})=>art(n,e,r)))}function crt(n){let t=urt(n),e=QL(),r=!0;const i=l=>(u,c)=>{const h=ff(n,c,l==="exit"?n.presenceContext?.custom:void 0);if(h){const{transition:f,transitionEnd:d,...v}=h;u={...u,...v,...d}}return u};function a(l){t=l(n)}function o(l){const{props:u}=n,c=QG(n.parent)||{},h=[],f=new Set;let d={},v=1/0;for(let y=0;y<lrt;y++){const g=srt[y],p=e[g],b=u[g]!==void 0?u[g]:c[g],w=xv(b),x=g===l?p.isActive:null;x===!1&&(v=y);let A=b===c[g]&&b!==u[g]&&w;if(A&&r&&n.manuallyAnimateOnMount&&(A=!1),p.protectedKeys={...d},!p.isActive&&x===null||!b&&!p.prevProp||s_(b)||typeof b=="boolean")continue;const T=hrt(p.prevProp,b);let C=T||g===l&&p.isActive&&!A&&w||y>v&&w,E=!1;const k=Array.isArray(b)?b:[b];let D=k.reduce(i(g),{});x===!1&&(D={});const{prevResolvedValues:L={}}=p,R={...L,...D},P=z=>{C=!0,f.has(z)&&(E=!0,f.delete(z)),p.needsAnimating[z]=!0;const G=n.getValue(z);G&&(G.liveStyle=!1)};for(const z in R){const G=D[z],U=L[z];if(d.hasOwnProperty(z))continue;let K=!1;uT(G)&&uT(U)?K=!KG(G,U):K=G!==U,K?G!=null?P(z):f.add(z):G!==void 0&&f.has(z)?P(z):p.protectedKeys[z]=!0}p.prevProp=b,p.prevResolvedValues=D,p.isActive&&(d={...d,...D}),r&&n.blockInitialAnimation&&(C=!1);const O=A&&T;C&&(!O||E)&&h.push(...k.map(z=>{const G={type:g};if(typeof z=="string"&&r&&!O&&n.manuallyAnimateOnMount&&n.parent){const{parent:U}=n,K=ff(U,z);if(U.enteringChildren&&K){const{delayChildren:W}=K.transition||{};G.delay=ZG(U.enteringChildren,n,W)}}return{animation:z,options:G}}))}if(f.size){const y={};if(typeof u.initial!="boolean"){const g=ff(n,Array.isArray(u.initial)?u.initial[0]:u.initial);g&&g.transition&&(y.transition=g.transition)}f.forEach(g=>{const p=n.getBaseTarget(g),b=n.getValue(g);b&&(b.liveStyle=!0),y[g]=p??null}),h.push({animation:y})}let m=!!h.length;return r&&(u.initial===!1||u.initial===u.animate)&&!n.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(h):Promise.resolve()}function s(l,u){if(e[l].isActive===u)return Promise.resolve();n.variantChildren?.forEach(h=>h.animationState?.setActive(l,u)),e[l].isActive=u;const c=o(l);for(const h in e)e[h].protectedKeys={};return c}return{animateChanges:o,setActive:s,setAnimateFunction:a,getState:()=>e,reset:()=>{e=QL()}}}function hrt(n,t){return typeof t=="string"?t!==n:Array.isArray(t)?!KG(t,n):!1}function du(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function QL(){return{animate:du(!0),whileInView:du(),whileHover:du(),whileTap:du(),whileDrag:du(),whileFocus:du(),exit:du()}}class tu{constructor(t){this.isMounted=!1,this.node=t}update(){}}class frt extends tu{constructor(t){super(t),t.animationState||(t.animationState=crt(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();s_(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let drt=0;class prt extends tu{constructor(){super(...arguments),this.id=drt++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const vrt={animation:{Feature:frt},exit:{Feature:prt}};function Sv(n,t,e,r={passive:!0}){return n.addEventListener(t,e,r),()=>n.removeEventListener(t,e)}function sg(n){return{point:{x:n.pageX,y:n.pageY}}}const grt=n=>t=>YE(t)&&n(t,sg(t));function Kp(n,t,e,r){return Sv(n,t,grt(e),r)}const JG=1e-4,mrt=1-JG,yrt=1+JG,tH=.01,brt=0-tH,_rt=0+tH;function vi(n){return n.max-n.min}function wrt(n,t,e){return Math.abs(n-t)<=e}function JL(n,t,e,r=.5){n.origin=r,n.originPoint=Br(t.min,t.max,n.origin),n.scale=vi(e)/vi(t),n.translate=Br(e.min,e.max,n.origin)-n.originPoint,(n.scale>=mrt&&n.scale<=yrt||isNaN(n.scale))&&(n.scale=1),(n.translate>=brt&&n.translate<=_rt||isNaN(n.translate))&&(n.translate=0)}function Qp(n,t,e,r){JL(n.x,t.x,e.x,r?r.originX:void 0),JL(n.y,t.y,e.y,r?r.originY:void 0)}function tI(n,t,e){n.min=e.min+t.min,n.max=n.min+vi(t)}function xrt(n,t,e){tI(n.x,t.x,e.x),tI(n.y,t.y,e.y)}function eI(n,t,e){n.min=t.min-e.min,n.max=n.min+vi(t)}function X0(n,t,e){eI(n.x,t.x,e.x),eI(n.y,t.y,e.y)}function Ea(n){return[n("x"),n("y")]}const eH=({current:n})=>n?n.ownerDocument.defaultView:null,rI=(n,t)=>Math.abs(n-t);function Srt(n,t){const e=rI(n.x,t.x),r=rI(n.y,t.y);return Math.sqrt(e**2+r**2)}class rH{constructor(t,e,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:a=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=R1(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,v=Srt(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!d&&!v)return;const{point:m}=f,{timestamp:y}=Vn;this.history.push({...m,timestamp:y});const{onStart:g,onMove:p}=this.handlers;d||(g&&g(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),p&&p(this.lastMoveEvent,f)},this.handlePointerMove=(f,d)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=I1(d,this.transformPagePoint),Lr.update(this.updatePoint,!0)},this.handlePointerUp=(f,d)=>{this.end();const{onEnd:v,onSessionEnd:m,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const g=R1(f.type==="pointercancel"?this.lastMoveEventInfo:I1(d,this.transformPagePoint),this.history);this.startEvent&&v&&v(f,g),m&&m(f,g)},!YE(t))return;this.dragSnapToOrigin=a,this.handlers=e,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=i||window;const s=sg(t),l=I1(s,this.transformPagePoint),{point:u}=l,{timestamp:c}=Vn;this.history=[{...u,timestamp:c}];const{onSessionStart:h}=e;h&&h(t,R1(l,this.history)),this.removeListeners=ig(Kp(this.contextWindow,"pointermove",this.handlePointerMove),Kp(this.contextWindow,"pointerup",this.handlePointerUp),Kp(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Hl(this.updatePoint)}}function I1(n,t){return t?{point:t(n.point)}:n}function nI(n,t){return{x:n.x-t.x,y:n.y-t.y}}function R1({point:n},t){return{point:n,delta:nI(n,nH(t)),offset:nI(n,Art(t)),velocity:Trt(t,.1)}}function Art(n){return n[0]}function nH(n){return n[n.length-1]}function Trt(n,t){if(n.length<2)return{x:0,y:0};let e=n.length-1,r=null;const i=nH(n);for(;e>=0&&(r=n[e],!(i.timestamp-r.timestamp>co(t)));)e--;if(!r)return{x:0,y:0};const a=Oa(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Crt(n,{min:t,max:e},r){return t!==void 0&&n<t?n=r?Br(t,n,r.min):Math.max(n,t):e!==void 0&&n>e&&(n=r?Br(e,n,r.max):Math.min(n,e)),n}function iI(n,t,e){return{min:t!==void 0?n.min+t:void 0,max:e!==void 0?n.max+e-(n.max-n.min):void 0}}function Ert(n,{top:t,left:e,bottom:r,right:i}){return{x:iI(n.x,e,i),y:iI(n.y,t,r)}}function aI(n,t){let e=t.min-n.min,r=t.max-n.max;return t.max-t.min<n.max-n.min&&([e,r]=[r,e]),{min:e,max:r}}function Mrt(n,t){return{x:aI(n.x,t.x),y:aI(n.y,t.y)}}function Prt(n,t){let e=.5;const r=vi(n),i=vi(t);return i>r?e=bv(t.min,t.max-r,n.min):r>i&&(e=bv(n.min,n.max-i,t.min)),Os(0,1,e)}function krt(n,t){const e={};return t.min!==void 0&&(e.min=t.min-n.min),t.max!==void 0&&(e.max=t.max-n.min),e}const fT=.35;function Drt(n=fT){return n===!1?n=0:n===!0&&(n=fT),{x:oI(n,"left","right"),y:oI(n,"top","bottom")}}function oI(n,t,e){return{min:sI(n,t),max:sI(n,e)}}function sI(n,t){return typeof n=="number"?n:n[t]||0}const Lrt=new WeakMap;class Irt{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=mn(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:e=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const a=h=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(sg(h).point)},o=(h,f)=>{const{drag:d,dragPropagation:v,onDragStart:m}=this.getProps();if(d&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Htt(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ea(g=>{let p=this.getAxisMotionValue(g).get()||0;if(Yo.test(p)){const{projection:b}=this.visualElement;if(b&&b.layout){const w=b.layout.layoutBox[g];w&&(p=vi(w)*(parseFloat(p)/100))}}this.originPoint[g]=p}),m&&Lr.postRender(()=>m(h,f)),cT(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},s=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:v,onDirectionLock:m,onDrag:y}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:g}=f;if(v&&this.currentDirection===null){this.currentDirection=Rrt(g),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,g),this.updateAxis("y",f.point,g),this.visualElement.render(),y&&y(h,f)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>Ea(h=>this.getAnimationState(h)==="paused"&&this.getAxisMotionValue(h).animation?.play()),{dragSnapToOrigin:c}=this.getProps();this.panSession=new rH(t,{onSessionStart:a,onStart:o,onMove:s,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:r,contextWindow:eH(this.visualElement)})}stop(t,e){const r=t||this.latestPointerEvent,i=e||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!r)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:s}=this.getProps();s&&Lr.postRender(()=>s(r,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,r){const{drag:i}=this.getProps();if(!r||!Hm(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=Crt(o,this.constraints[t],this.elastic[t])),a.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&Jh(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Ert(r.layoutBox,t):this.constraints=!1,this.elastic=Drt(e),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ea(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=krt(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!Jh(t))return!1;const r=t.current;Bs(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=Net(r,i.root,this.visualElement.getTransformPagePoint());let o=Mrt(i.layout.layoutBox,a);if(e){const s=e(Let(o));this.hasMutatedConstraints=!!s,s&&(o=zG(s))}return o}startAnimation(t){const{drag:e,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Ea(c=>{if(!Hm(c,e,this.currentDirection))return;let h=l&&l[c]||{};o&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,v={type:"inertia",velocity:r?t[c]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...a,...h};return this.startAxisValueAnimation(c,v)});return Promise.all(u).then(s)}startAxisValueAnimation(t,e){const r=this.getAxisMotionValue(t);return cT(this.visualElement,t),r.start(nM(t,r,0,e,this.visualElement,!1))}stopAnimation(){Ea(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ea(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[e];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ea(e=>{const{drag:r}=this.getProps();if(!Hm(e,r,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(e);if(i&&i.layout){const{min:o,max:s}=i.layout.layoutBox[e];a.set(t[e]-Br(o,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:r}=this.visualElement;if(!Jh(e)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ea(o=>{const s=this.getAxisMotionValue(o);if(s&&this.constraints!==!1){const l=s.get();i[o]=Prt({min:l,max:l},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ea(o=>{if(!Hm(o,t,null))return;const s=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];s.set(Br(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;Lrt.set(this.visualElement,this);const t=this.visualElement.current,e=Kp(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Jh(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Lr.read(r);const o=Sv(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ea(c=>{const h=this.getAxisMotionValue(c);h&&(this.originPoint[c]+=l[c].translate,h.set(h.get()+l[c].translate))}),this.visualElement.render())}));return()=>{o(),e(),a(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:o=fT,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:r,dragPropagation:i,dragConstraints:a,dragElastic:o,dragMomentum:s}}}function Hm(n,t,e){return(t===!0||t===n)&&(e===null||e===n)}function Rrt(n,t=10){let e=null;return Math.abs(n.y)>t?e="y":Math.abs(n.x)>t&&(e="x"),e}class Nrt extends tu{constructor(t){super(t),this.removeGroupControls=Fa,this.removeListeners=Fa,this.controls=new Irt(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Fa}unmount(){this.removeGroupControls(),this.removeListeners()}}const lI=n=>(t,e)=>{n&&Lr.postRender(()=>n(t,e))};class Ort extends tu{constructor(){super(...arguments),this.removePointerDownListener=Fa}onPointerDown(t){this.session=new rH(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:eH(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:lI(t),onStart:lI(e),onMove:r,onEnd:(a,o)=>{delete this.session,i&&Lr.postRender(()=>i(a,o))}}}mount(){this.removePointerDownListener=Kp(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const p0={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let N1=!1;class Brt extends yt.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:r,layoutId:i}=this.props,{projection:a}=t;a&&(e.group&&e.group.add(a),r&&r.register&&i&&r.register(a),N1&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),p0.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:r,drag:i,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,N1=!0,i||t.layoutDependency!==e||e===void 0||t.isPresent!==a?o.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?o.promote():o.relegate()||Lr.postRender(()=>{const s=o.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),XE.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:r}=this.props,{projection:i}=t;N1=!0,i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function iH(n){const[t,e]=Ktt(),r=yt.useContext(N3);return $t.jsx(Brt,{...n,layoutGroup:r,switchLayoutGroup:yt.useContext(FG),isPresent:t,safeToRemove:e})}function Frt(n,t,e){const r=ri(n)?n:Tf(n);return r.start(nM("",r,t,e)),r.animation}const Vrt=(n,t)=>n.depth-t.depth;class zrt{constructor(){this.children=[],this.isDirty=!1}add(t){PE(this.children,t),this.isDirty=!0}remove(t){kE(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Vrt),this.isDirty=!1,this.children.forEach(t)}}function Grt(n,t){const e=Wi.now(),r=({timestamp:i})=>{const a=i-e;a>=t&&(Hl(r),n(a-t))};return Lr.setup(r,!0),()=>Hl(r)}const aH=["TopLeft","TopRight","BottomLeft","BottomRight"],Hrt=aH.length,uI=n=>typeof n=="string"?parseFloat(n):n,cI=n=>typeof n=="number"||xe.test(n);function Urt(n,t,e,r,i,a){i?(n.opacity=Br(0,e.opacity??1,Wrt(r)),n.opacityExit=Br(t.opacity??1,0,$rt(r))):a&&(n.opacity=Br(t.opacity??1,e.opacity??1,r));for(let o=0;o<Hrt;o++){const s=`border${aH[o]}Radius`;let l=hI(t,s),u=hI(e,s);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||cI(l)===cI(u)?(n[s]=Math.max(Br(uI(l),uI(u),r),0),(Yo.test(u)||Yo.test(l))&&(n[s]+="%")):n[s]=u}(t.rotate||e.rotate)&&(n.rotate=Br(t.rotate||0,e.rotate||0,r))}function hI(n,t){return n[t]!==void 0?n[t]:n.borderRadius}const Wrt=oH(0,.5,j3),$rt=oH(.5,.95,Fa);function oH(n,t,e){return r=>r<n?0:r>t?1:e(bv(n,t,r))}function fI(n,t){n.min=t.min,n.max=t.max}function Qa(n,t){fI(n.x,t.x),fI(n.y,t.y)}function dI(n,t){n.translate=t.translate,n.scale=t.scale,n.originPoint=t.originPoint,n.origin=t.origin}function pI(n,t,e,r,i){return n-=t,n=j0(n,1/e,r),i!==void 0&&(n=j0(n,1/i,r)),n}function jrt(n,t=0,e=1,r=.5,i,a=n,o=n){if(Yo.test(t)&&(t=parseFloat(t),t=Br(o.min,o.max,t/100)-o.min),typeof t!="number")return;let s=Br(a.min,a.max,r);n===a&&(s-=t),n.min=pI(n.min,t,e,s,i),n.max=pI(n.max,t,e,s,i)}function vI(n,t,[e,r,i],a,o){jrt(n,t[e],t[r],t[i],t.scale,a,o)}const Xrt=["x","scaleX","originX"],Yrt=["y","scaleY","originY"];function gI(n,t,e,r){vI(n.x,t,Xrt,e?e.x:void 0,r?r.x:void 0),vI(n.y,t,Yrt,e?e.y:void 0,r?r.y:void 0)}function mI(n){return n.translate===0&&n.scale===1}function sH(n){return mI(n.x)&&mI(n.y)}function yI(n,t){return n.min===t.min&&n.max===t.max}function qrt(n,t){return yI(n.x,t.x)&&yI(n.y,t.y)}function bI(n,t){return Math.round(n.min)===Math.round(t.min)&&Math.round(n.max)===Math.round(t.max)}function lH(n,t){return bI(n.x,t.x)&&bI(n.y,t.y)}function _I(n){return vi(n.x)/vi(n.y)}function wI(n,t){return n.translate===t.translate&&n.scale===t.scale&&n.originPoint===t.originPoint}class Zrt{constructor(){this.members=[]}add(t){PE(this.members,t),t.scheduleRender()}remove(t){if(kE(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(t){const e=this.members.findIndex(i=>t===i);if(e===0)return!1;let r;for(let i=e;i>=0;i--){const a=this.members[i];if(a.isPresent!==!1){r=a;break}}return r?(this.promote(r),!0):!1}promote(t,e){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,e&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:r}=t;e.onExitComplete&&e.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Krt(n,t,e){let r="";const i=n.x.translate/t.x,a=n.y.translate/t.y,o=e?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),e){const{transformPerspective:u,rotate:c,rotateX:h,rotateY:f,skewX:d,skewY:v}=e;u&&(r=`perspective(${u}px) ${r}`),c&&(r+=`rotate(${c}deg) `),h&&(r+=`rotateX(${h}deg) `),f&&(r+=`rotateY(${f}deg) `),d&&(r+=`skewX(${d}deg) `),v&&(r+=`skewY(${v}deg) `)}const s=n.x.scale*t.x,l=n.y.scale*t.y;return(s!==1||l!==1)&&(r+=`scale(${s}, ${l})`),r||"none"}const O1=["","X","Y","Z"],Qrt=1e3;let Jrt=0;function B1(n,t,e,r){const{latestValues:i}=t;i[n]&&(e[n]=i[n],t.setStaticValue(n,0),r&&(r[n]=0))}function uH(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:t}=n.options;if(!t)return;const e=YG(t);if(window.MotionHasOptimisedAnimation(e,"transform")){const{layout:i,layoutId:a}=n.options;window.MotionCancelOptimisedAnimation(e,"transform",Lr,!(i||a))}const{parent:r}=n;r&&!r.hasCheckedOptimisedAppear&&uH(r)}function cH({attachResizeListener:n,defaultParent:t,measureScroll:e,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},s=t?.()){this.id=Jrt++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(rnt),this.nodes.forEach(ont),this.nodes.forEach(snt),this.nodes.forEach(nnt)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new zrt)}addEventListener(o,s){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new LE),this.eventHandlers.get(o).add(s)}notifyListeners(o,...s){const l=this.eventHandlers.get(o);l&&l.notify(...s)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=TG(o)&&!Ytt(o),this.instance=o;const{layoutId:s,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||s)&&(this.isLayoutDirty=!0),n){let c,h=0;const f=()=>this.root.updateBlockedByResize=!1;Lr.read(()=>{h=window.innerWidth}),n(o,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,c&&c(),c=Grt(f,250),p0.hasAnimatedSinceResize&&(p0.hasAnimatedSinceResize=!1,this.nodes.forEach(AI)))})}s&&this.root.registerSharedNode(s,this),this.options.animate!==!1&&u&&(s||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||u.getDefaultTransition()||fnt,{onLayoutAnimationStart:m,onLayoutAnimationComplete:y}=u.getProps(),g=!this.targetLayout||!lH(this.targetLayout,d),p=!h&&f;if(this.options.layoutRoot||this.resumeFrom||p||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const b={...$E(v,"layout"),onPlay:m,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b),this.setAnimationOrigin(c,p)}else h||AI(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Hl(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(lnt),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&uH(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:s,layout:l}=this.options;if(s===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(xI);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(SI);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ant),this.nodes.forEach(tnt),this.nodes.forEach(ent)):this.nodes.forEach(SI),this.clearAllSnapshots();const s=Wi.now();Vn.delta=Os(0,1e3/60,s-Vn.timestamp),Vn.timestamp=s,Vn.isProcessing=!0,T1.update.process(Vn),T1.preRender.process(Vn),T1.render.process(Vn),Vn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,XE.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(int),this.sharedNodes.forEach(unt)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Lr.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Lr.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!vi(this.snapshot.measuredBox.x)&&!vi(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=mn(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:s}=this.options;s&&s.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let s=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(s=!1),s&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:e(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,s=this.projectionDelta&&!sH(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&this.instance&&(s||Hu(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const s=this.measurePageBox();let l=this.removeElementScroll(s);return o&&(l=this.removeTransform(l)),dnt(l),{animationId:this.root.animationId,measuredBox:s,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return mn();const s=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(pnt))){const{scroll:u}=this.root;u&&(tf(s.x,u.offset.x),tf(s.y,u.offset.y))}return s}removeElementScroll(o){const s=mn();if(Qa(s,o),this.scroll?.wasRoot)return s;for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:c,options:h}=u;u!==this.root&&c&&h.layoutScroll&&(c.wasRoot&&Qa(s,o),tf(s.x,c.offset.x),tf(s.y,c.offset.y))}return s}applyTransform(o,s=!1){const l=mn();Qa(l,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];!s&&c.options.layoutScroll&&c.scroll&&c!==c.root&&ef(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),Hu(c.latestValues)&&ef(l,c.latestValues)}return Hu(this.latestValues)&&ef(l,this.latestValues),l}removeTransform(o){const s=mn();Qa(s,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Hu(u.latestValues))continue;oT(u.latestValues)&&u.updateSnapshot();const c=mn(),h=u.measurePageBox();Qa(c,h),gI(s,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return Hu(this.latestValues)&&gI(s,this.latestValues),s}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Vn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const s=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=s.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=s.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=s.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==s;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:h}=this.options;if(!this.layout||!(c||h))return;this.resolvedRelativeTargetAt=Vn.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=mn(),this.targetWithTransforms=mn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),xrt(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Qa(this.target,this.layout.layoutBox),HG(this.target,this.targetDelta)):Qa(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||oT(this.parent.latestValues)||GG(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,s,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=mn(),this.relativeTargetOrigin=mn(),X0(this.relativeTargetOrigin,s,l),Qa(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),s=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),s&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Vn.timestamp&&(l=!1),l)return;const{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;Qa(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;Ret(this.layoutCorrected,this.treeScale,this.path,s),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=mn());const{target:d}=o;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(dI(this.prevProjectionDelta.x,this.projectionDelta.x),dI(this.prevProjectionDelta.y,this.projectionDelta.y)),Qp(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!wI(this.projectionDelta.x,this.prevProjectionDelta.x)||!wI(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const s=this.getStack();s&&s.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=rf(),this.projectionDelta=rf(),this.projectionDeltaWithTransform=rf()}setAnimationOrigin(o,s=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},h=rf();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!s;const f=mn(),d=l?l.source:void 0,v=this.layout?this.layout.source:void 0,m=d!==v,y=this.getStack(),g=!y||y.members.length<=1,p=!!(m&&!g&&this.options.crossfade===!0&&!this.path.some(hnt));this.animationProgress=0;let b;this.mixTargetDelta=w=>{const x=w/1e3;TI(h.x,o.x,x),TI(h.y,o.y,x),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(X0(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),cnt(this.relativeTarget,this.relativeTargetOrigin,f,x),b&&qrt(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=mn()),Qa(b,this.relativeTarget)),m&&(this.animationValues=c,Urt(c,u,this.latestValues,x,p,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=x},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Hl(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Lr.update(()=>{p0.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Tf(0)),this.currentAnimation=Frt(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:s=>{this.mixTargetDelta(s),o.onUpdate&&o.onUpdate(s)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Qrt),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:c}=o;if(!(!s||!l||!u)){if(this!==o&&this.layout&&u&&hH(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||mn();const h=vi(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const f=vi(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}Qa(s,l),ef(s,c),Qp(this.projectionDeltaWithTransform,this.layoutCorrected,s,c)}}registerSharedNode(o,s){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Zrt),this.sharedNodes.get(o).add(s);const u=s.options.initialPromotionConfig;s.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(s):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let s=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(s=!0),!s)return;const u={};l.z&&B1("z",o,u,this.animationValues);for(let c=0;c<O1.length;c++)B1(`rotate${O1[c]}`,o,u,this.animationValues),B1(`skew${O1[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}applyProjectionStyles(o,s){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=d0(s?.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=d0(s?.pointerEvents)||""),this.hasProjected&&!Hu(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=Krt(this.projectionDeltaWithTransform,this.treeScale,c);l&&(h=l(c,h)),o.transform=h;const{x:f,y:d}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,u.animationValues?o.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:o.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const v in aT){if(c[v]===void 0)continue;const{correct:m,applyTo:y,isCSSVariable:g}=aT[v],p=h==="none"?c[v]:m(c[v],u);if(y){const b=y.length;for(let w=0;w<b;w++)o[y[w]]=p}else g?this.options.visualElement.renderState.vars[v]=p:o[v]=p}this.options.layoutId&&(o.pointerEvents=u===this?d0(s?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(xI),this.root.sharedNodes.clear()}}}function tnt(n){n.updateLayout()}function ent(n){const t=n.resumeFrom?.snapshot||n.snapshot;if(n.isLead()&&n.layout&&t&&n.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:r}=n.layout,{animationType:i}=n.options,a=t.source!==n.layout.source;i==="size"?Ea(c=>{const h=a?t.measuredBox[c]:t.layoutBox[c],f=vi(h);h.min=e[c].min,h.max=h.min+f}):hH(i,t.layoutBox,e)&&Ea(c=>{const h=a?t.measuredBox[c]:t.layoutBox[c],f=vi(e[c]);h.max=h.min+f,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[c].max=n.relativeTarget[c].min+f)});const o=rf();Qp(o,e,t.layoutBox);const s=rf();a?Qp(s,n.applyTransform(r,!0),t.measuredBox):Qp(s,e,t.layoutBox);const l=!sH(o);let u=!1;if(!n.resumeFrom){const c=n.getClosestProjectingParent();if(c&&!c.resumeFrom){const{snapshot:h,layout:f}=c;if(h&&f){const d=mn();X0(d,t.layoutBox,h.layoutBox);const v=mn();X0(v,e,f.layoutBox),lH(d,v)||(u=!0),c.options.layoutRoot&&(n.relativeTarget=v,n.relativeTargetOrigin=d,n.relativeParent=c)}}}n.notifyListeners("didUpdate",{layout:e,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(n.isLead()){const{onExitComplete:e}=n.options;e&&e()}n.options.transition=void 0}function rnt(n){n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function nnt(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function int(n){n.clearSnapshot()}function xI(n){n.clearMeasurements()}function SI(n){n.isLayoutDirty=!1}function ant(n){const{visualElement:t}=n.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),n.resetTransform()}function AI(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function ont(n){n.resolveTargetDelta()}function snt(n){n.calcProjection()}function lnt(n){n.resetSkewAndRotation()}function unt(n){n.removeLeadSnapshot()}function TI(n,t,e){n.translate=Br(t.translate,0,e),n.scale=Br(t.scale,1,e),n.origin=t.origin,n.originPoint=t.originPoint}function CI(n,t,e,r){n.min=Br(t.min,e.min,r),n.max=Br(t.max,e.max,r)}function cnt(n,t,e,r){CI(n.x,t.x,e.x,r),CI(n.y,t.y,e.y,r)}function hnt(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const fnt={duration:.45,ease:[.4,0,.1,1]},EI=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),MI=EI("applewebkit/")&&!EI("chrome/")?Math.round:Fa;function PI(n){n.min=MI(n.min),n.max=MI(n.max)}function dnt(n){PI(n.x),PI(n.y)}function hH(n,t,e){return n==="position"||n==="preserve-aspect"&&!wrt(_I(t),_I(e),.2)}function pnt(n){return n!==n.root&&n.scroll?.wasRoot}const vnt=cH({attachResizeListener:(n,t)=>Sv(n,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),F1={current:void 0},fH=cH({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!F1.current){const n=new vnt({});n.mount(window),n.setOptions({layoutScroll:!0}),F1.current=n}return F1.current},resetTransform:(n,t)=>{n.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),gnt={pan:{Feature:Ort},drag:{Feature:Nrt,ProjectionNode:fH,MeasureLayout:iH}};function kI(n,t,e){const{props:r}=n;n.animationState&&r.whileHover&&n.animationState.setActive("whileHover",e==="Start");const i="onHover"+e,a=r[i];a&&Lr.postRender(()=>a(t,sg(t)))}class mnt extends tu{mount(){const{current:t}=this.node;t&&(this.unmount=Utt(t,(e,r)=>(kI(this.node,r,"Start"),i=>kI(this.node,i,"End"))))}unmount(){}}class ynt extends tu{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ig(Sv(this.node.current,"focus",()=>this.onFocus()),Sv(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function DI(n,t,e){const{props:r}=n;if(n.current instanceof HTMLButtonElement&&n.current.disabled)return;n.animationState&&r.whileTap&&n.animationState.setActive("whileTap",e==="Start");const i="onTap"+(e==="End"?"":e),a=r[i];a&&Lr.postRender(()=>a(t,sg(t)))}class bnt extends tu{mount(){const{current:t}=this.node;t&&(this.unmount=Xtt(t,(e,r)=>(DI(this.node,r,"Start"),(i,{success:a})=>DI(this.node,i,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const dT=new WeakMap,V1=new WeakMap,_nt=n=>{const t=dT.get(n.target);t&&t(n)},wnt=n=>{n.forEach(_nt)};function xnt({root:n,...t}){const e=n||document;V1.has(e)||V1.set(e,{});const r=V1.get(e),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(wnt,{root:n,...t})),r[i]}function Snt(n,t,e){const r=xnt(t);return dT.set(n,e),r.observe(n),()=>{dT.delete(n),r.unobserve(n)}}const Ant={some:0,all:1};class Tnt extends tu{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:r,amount:i="some",once:a}=t,o={root:e?e.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Ant[i]},s=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,a&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),f=u?c:h;f&&f(l)};return Snt(this.node.current,o,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(Cnt(t,e))&&this.startObserver()}unmount(){}}function Cnt({viewport:n={}},{viewport:t={}}={}){return e=>n[e]!==t[e]}const Ent={inView:{Feature:Tnt},tap:{Feature:bnt},focus:{Feature:ynt},hover:{Feature:mnt}},Mnt={layout:{ProjectionNode:fH,MeasureLayout:iH}},Pnt={...vrt,...Ent,...gnt,...Mnt},dH=Det(Pnt,Wet),ci=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),pT=[.001,0,0,.001,0,0],z1=1.35,Ji={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},Go={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Av="pdfjs_internal_editor_",Me={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},Xe={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},pH={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Bn={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},Jp={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Zr={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},Uh={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},lg={ERRORS:0,WARNINGS:1,INFOS:5},Ef={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},Um={moveTo:0,lineTo:1,curveTo:2,closePath:3},vH={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let u_=lg.WARNINGS;function knt(n){Number.isInteger(n)&&(u_=n)}function Dnt(){return u_}function c_(n){u_>=lg.INFOS&&console.info(`Info: ${n}`)}function Pe(n){u_>=lg.WARNINGS&&console.warn(`Warning: ${n}`)}function _r(n){throw new Error(n)}function Qe(n,t){n||_r(t)}function Lnt(n){switch(n?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function iM(n,t=null,e=null){if(!n)return null;if(e&&typeof n=="string"&&(e.addDefaultProtocol&&n.startsWith("www.")&&n.match(/\./g)?.length>=2&&(n=`http://${n}`),e.tryConvertEncoding))try{n=Bnt(n)}catch{}const r=t?URL.parse(n,t):URL.parse(n);return Lnt(r)?r:null}function aM(n,t,e=!1){const r=URL.parse(n);return r?(r.hash=t,r.href):e&&iM(n,"http://example.com")?n.split("#",1)[0]+`${t?`#${t}`:""}`:""}function Oe(n,t,e,r=!1){return Object.defineProperty(n,t,{value:e,enumerable:!r,configurable:!0,writable:!1}),e}const Vc=(function(){function t(e,r){this.message=e,this.name=r}return t.prototype=new Error,t.constructor=t,t})();class LI extends Vc{constructor(t,e){super(t,"PasswordException"),this.code=e}}class G1 extends Vc{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class Y0 extends Vc{constructor(t){super(t,"InvalidPDFException")}}class Tv extends Vc{constructor(t,e,r){super(t,"ResponseException"),this.status=e,this.missing=r}}class Int extends Vc{constructor(t){super(t,"FormatError")}}class Vs extends Vc{constructor(t){super(t,"AbortException")}}function gH(n){(typeof n!="object"||n?.length===void 0)&&_r("Invalid argument for bytesToString");const t=n.length,e=8192;if(t<e)return String.fromCharCode.apply(null,n);const r=[];for(let i=0;i<t;i+=e){const a=Math.min(i+e,t),o=n.subarray(i,a);r.push(String.fromCharCode.apply(null,o))}return r.join("")}function ug(n){typeof n!="string"&&_r("Invalid argument for stringToBytes");const t=n.length,e=new Uint8Array(t);for(let r=0;r<t;++r)e[r]=n.charCodeAt(r)&255;return e}function Rnt(n){return String.fromCharCode(n>>24&255,n>>16&255,n>>8&255,n&255)}function Nnt(){const n=new Uint8Array(4);return n[0]=1,new Uint32Array(n.buffer,0,1)[0]===1}function Ont(){try{return new Function(""),!0}catch{return!1}}class In{static get isLittleEndian(){return Oe(this,"isLittleEndian",Nnt())}static get isEvalSupported(){return Oe(this,"isEvalSupported",Ont())}static get isOffscreenCanvasSupported(){return Oe(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return Oe(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){const{platform:t,userAgent:e}=navigator;return Oe(this,"platform",{isAndroid:e.includes("Android"),isLinux:t.includes("Linux"),isMac:t.includes("Mac"),isWindows:t.includes("Win"),isFirefox:e.includes("Firefox")})}static get isCSSRoundSupported(){return Oe(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const H1=Array.from(Array(256).keys(),n=>n.toString(16).padStart(2,"0"));class Qt{static makeHexColor(t,e,r){return`#${H1[t]}${H1[e]}${H1[r]}`}static domMatrixToTransform(t){return[t.a,t.b,t.c,t.d,t.e,t.f]}static scaleMinMax(t,e){let r;t[0]?(t[0]<0&&(r=e[0],e[0]=e[2],e[2]=r),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(r=e[1],e[1]=e[3],e[3]=r),e[1]*=t[3],e[3]*=t[3]):(r=e[0],e[0]=e[1],e[1]=r,r=e[2],e[2]=e[3],e[3]=r,t[1]<0&&(r=e[1],e[1]=e[3],e[3]=r),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(r=e[0],e[0]=e[2],e[2]=r),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static multiplyByDOMMatrix(t,e){return[t[0]*e.a+t[2]*e.b,t[1]*e.a+t[3]*e.b,t[0]*e.c+t[2]*e.d,t[1]*e.c+t[3]*e.d,t[0]*e.e+t[2]*e.f+t[4],t[1]*e.e+t[3]*e.f+t[5]]}static applyTransform(t,e,r=0){const i=t[r],a=t[r+1];t[r]=i*e[0]+a*e[2]+e[4],t[r+1]=i*e[1]+a*e[3]+e[5]}static applyTransformToBezier(t,e,r=0){const i=e[0],a=e[1],o=e[2],s=e[3],l=e[4],u=e[5];for(let c=0;c<6;c+=2){const h=t[r+c],f=t[r+c+1];t[r+c]=h*i+f*o+l,t[r+c+1]=h*a+f*s+u}}static applyInverseTransform(t,e){const r=t[0],i=t[1],a=e[0]*e[3]-e[1]*e[2];t[0]=(r*e[3]-i*e[2]+e[2]*e[5]-e[4]*e[3])/a,t[1]=(-r*e[1]+i*e[0]+e[4]*e[1]-e[5]*e[0])/a}static axialAlignedBoundingBox(t,e,r){const i=e[0],a=e[1],o=e[2],s=e[3],l=e[4],u=e[5],c=t[0],h=t[1],f=t[2],d=t[3];let v=i*c+l,m=v,y=i*f+l,g=y,p=s*h+u,b=p,w=s*d+u,x=w;if(a!==0||o!==0){const A=a*c,T=a*f,C=o*h,E=o*d;v+=C,g+=C,y+=E,m+=E,p+=A,x+=A,w+=T,b+=T}r[0]=Math.min(r[0],v,y,m,g),r[1]=Math.min(r[1],p,w,b,x),r[2]=Math.max(r[2],v,y,m,g),r[3]=Math.max(r[3],p,w,b,x)}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t,e){const r=t[0],i=t[1],a=t[2],o=t[3],s=r**2+i**2,l=r*a+i*o,u=a**2+o**2,c=(s+u)/2,h=Math.sqrt(c**2-(s*u-l**2));e[0]=Math.sqrt(c+h||1),e[1]=Math.sqrt(c-h||1)}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const r=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),i=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(r>i)return null;const a=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),o=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return a>o?null:[r,a,i,o]}static pointBoundingBox(t,e,r){r[0]=Math.min(r[0],t),r[1]=Math.min(r[1],e),r[2]=Math.max(r[2],t),r[3]=Math.max(r[3],e)}static rectBoundingBox(t,e,r,i,a){a[0]=Math.min(a[0],t,r),a[1]=Math.min(a[1],e,i),a[2]=Math.max(a[2],t,r),a[3]=Math.max(a[3],e,i)}static#t(t,e,r,i,a,o,s,l,u,c){if(u<=0||u>=1)return;const h=1-u,f=u*u,d=f*u,v=h*(h*(h*t+3*u*e)+3*f*r)+d*i,m=h*(h*(h*a+3*u*o)+3*f*s)+d*l;c[0]=Math.min(c[0],v),c[1]=Math.min(c[1],m),c[2]=Math.max(c[2],v),c[3]=Math.max(c[3],m)}static#e(t,e,r,i,a,o,s,l,u,c,h,f){if(Math.abs(u)<1e-12){Math.abs(c)>=1e-12&&this.#t(t,e,r,i,a,o,s,l,-h/c,f);return}const d=c**2-4*h*u;if(d<0)return;const v=Math.sqrt(d),m=2*u;this.#t(t,e,r,i,a,o,s,l,(-c+v)/m,f),this.#t(t,e,r,i,a,o,s,l,(-c-v)/m,f)}static bezierBoundingBox(t,e,r,i,a,o,s,l,u){u[0]=Math.min(u[0],t,s),u[1]=Math.min(u[1],e,l),u[2]=Math.max(u[2],t,s),u[3]=Math.max(u[3],e,l),this.#e(t,r,a,s,e,i,o,l,3*(-t+3*(r-a)+s),6*(t-2*r+a),3*(r-t),u),this.#e(t,r,a,s,e,i,o,l,3*(-e+3*(i-o)+l),6*(e-2*i+o),3*(i-e),u)}}function Bnt(n){return decodeURIComponent(escape(n))}let U1=null,II=null;function mH(n){return U1||(U1=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,II=new Map([["ſt","ſt"]])),n.replaceAll(U1,(t,e,r)=>e?e.normalize("NFKC"):II.get(r))}function oM(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const n=new Uint8Array(32);return crypto.getRandomValues(n),gH(n)}const sM="pdfjs_internal_id_";function Fnt(n,t,e){if(!Array.isArray(e)||e.length<2)return!1;const[r,i,...a]=e;if(!n(r)&&!Number.isInteger(r)||!t(i))return!1;const o=a.length;let s=!0;switch(i.name){case"XYZ":if(o<2||o>3)return!1;break;case"Fit":case"FitB":return o===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(o>1)return!1;break;case"FitR":if(o!==4)return!1;s=!1;break;default:return!1}for(const l of a)if(!(typeof l=="number"||s&&l===null))return!1;return!0}function Jn(n,t,e){return Math.min(Math.max(n,t),e)}function yH(n){return Uint8Array.prototype.toBase64?n.toBase64():btoa(gH(n))}function Vnt(n){return Uint8Array.fromBase64?Uint8Array.fromBase64(n):ug(atob(n))}typeof Promise.try!="function"&&(Promise.try=function(n,...t){return new Promise(e=>{e(n(...t))})});typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(n){return n.reduce((t,e)=>t+e,0)});class Cv{static textContent(t){const e=[],r={items:e,styles:Object.create(null)};function i(a){if(!a)return;let o=null;const s=a.name;if(s==="#text")o=a.value;else if(Cv.shouldBuildText(s))a?.attributes?.textContent?o=a.attributes.textContent:a.value&&(o=a.value);else return;if(o!==null&&e.push({str:o}),!!a.children)for(const l of a.children)i(l)}return i(t),r}static shouldBuildText(t){return!(t==="textarea"||t==="input"||t==="option"||t==="select")}}class lM{static setupStorage(t,e,r,i,a){const o=i.getValue(e,{value:null});switch(r.name){case"textarea":if(o.value!==null&&(t.textContent=o.value),a==="print")break;t.addEventListener("input",s=>{i.setValue(e,{value:s.target.value})});break;case"input":if(r.attributes.type==="radio"||r.attributes.type==="checkbox"){if(o.value===r.attributes.xfaOn?t.setAttribute("checked",!0):o.value===r.attributes.xfaOff&&t.removeAttribute("checked"),a==="print")break;t.addEventListener("change",s=>{i.setValue(e,{value:s.target.checked?s.target.getAttribute("xfaOn"):s.target.getAttribute("xfaOff")})})}else{if(o.value!==null&&t.setAttribute("value",o.value),a==="print")break;t.addEventListener("input",s=>{i.setValue(e,{value:s.target.value})})}break;case"select":if(o.value!==null){t.setAttribute("value",o.value);for(const s of r.children)s.attributes.value===o.value?s.attributes.selected=!0:s.attributes.hasOwnProperty("selected")&&delete s.attributes.selected}t.addEventListener("input",s=>{const l=s.target.options,u=l.selectedIndex===-1?"":l[l.selectedIndex].value;i.setValue(e,{value:u})});break}}static setAttributes({html:t,element:e,storage:r=null,intent:i,linkService:a}){const{attributes:o}=e,s=t instanceof HTMLAnchorElement;o.type==="radio"&&(o.name=`${o.name}-${i}`);for(const[l,u]of Object.entries(o))if(u!=null)switch(l){case"class":u.length&&t.setAttribute(l,u.join(" "));break;case"dataId":break;case"id":t.setAttribute("data-element-id",u);break;case"style":Object.assign(t.style,u);break;case"textContent":t.textContent=u;break;default:(!s||l!=="href"&&l!=="newWindow")&&t.setAttribute(l,u)}s&&a.addLinkAttributes(t,o.href,o.newWindow),r&&o.dataId&&this.setupStorage(t,o.dataId,e,r)}static render(t){const e=t.annotationStorage,r=t.linkService,i=t.xfaHtml,a=t.intent||"display",o=document.createElement(i.name);i.attributes&&this.setAttributes({html:o,element:i,intent:a,linkService:r});const s=a!=="richText",l=t.div;if(l.append(o),t.viewport){const h=`matrix(${t.viewport.transform.join(",")})`;l.style.transform=h}s&&l.setAttribute("class","xfaLayer xfaFont");const u=[];if(i.children.length===0){if(i.value){const h=document.createTextNode(i.value);o.append(h),s&&Cv.shouldBuildText(i.name)&&u.push(h)}return{textDivs:u}}const c=[[i,-1,o]];for(;c.length>0;){const[h,f,d]=c.at(-1);if(f+1===h.children.length){c.pop();continue}const v=h.children[++c.at(-1)[1]];if(v===null)continue;const{name:m}=v;if(m==="#text"){const g=document.createTextNode(v.value);u.push(g),d.append(g);continue}const y=v?.attributes?.xmlns?document.createElementNS(v.attributes.xmlns,m):document.createElement(m);if(d.append(y),v.attributes&&this.setAttributes({html:y,element:v,storage:e,intent:a,linkService:r}),v.children?.length>0)c.push([v,-1,y]);else if(v.value){const g=document.createTextNode(v.value);s&&Cv.shouldBuildText(m)&&u.push(g),y.append(g)}}for(const h of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))h.setAttribute("readOnly",!0);return{textDivs:u}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}const ws="http://www.w3.org/2000/svg";class Cc{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function $f(n,t="text"){if(Ip(n,document.baseURI)){const e=await fetch(n);if(!e.ok)throw new Error(e.statusText);switch(t){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"json":return e.json()}return e.text()}return new Promise((e,r)=>{const i=new XMLHttpRequest;i.open("GET",n,!0),i.responseType=t,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(t){case"arraybuffer":case"blob":case"json":e(i.response);return}e(i.responseText);return}r(new Error(i.statusText))}},i.send(null)})}class cg{constructor({viewBox:t,userUnit:e,scale:r,rotation:i,offsetX:a=0,offsetY:o=0,dontFlip:s=!1}){this.viewBox=t,this.userUnit=e,this.scale=r,this.rotation=i,this.offsetX=a,this.offsetY=o,r*=e;const l=(t[2]+t[0])/2,u=(t[3]+t[1])/2;let c,h,f,d;switch(i%=360,i<0&&(i+=360),i){case 180:c=-1,h=0,f=0,d=1;break;case 90:c=0,h=1,f=1,d=0;break;case 270:c=0,h=-1,f=-1,d=0;break;case 0:c=1,h=0,f=0,d=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}s&&(f=-f,d=-d);let v,m,y,g;c===0?(v=Math.abs(u-t[1])*r+a,m=Math.abs(l-t[0])*r+o,y=(t[3]-t[1])*r,g=(t[2]-t[0])*r):(v=Math.abs(l-t[0])*r+a,m=Math.abs(u-t[1])*r+o,y=(t[2]-t[0])*r,g=(t[3]-t[1])*r),this.transform=[c*r,h*r,f*r,d*r,v-c*r*l-f*r*u,m-h*r*l-d*r*u],this.width=y,this.height=g}get rawDims(){const t=this.viewBox;return Oe(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone({scale:t=this.scale,rotation:e=this.rotation,offsetX:r=this.offsetX,offsetY:i=this.offsetY,dontFlip:a=!1}={}){return new cg({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:e,offsetX:r,offsetY:i,dontFlip:a})}convertToViewportPoint(t,e){const r=[t,e];return Qt.applyTransform(r,this.transform),r}convertToViewportRectangle(t){const e=[t[0],t[1]];Qt.applyTransform(e,this.transform);const r=[t[2],t[3]];return Qt.applyTransform(r,this.transform),[e[0],e[1],r[0],r[1]]}convertToPdfPoint(t,e){const r=[t,e];return Qt.applyInverseTransform(r,this.transform),r}}class h_ extends Vc{constructor(t,e=0){super(t,"RenderingCancelledException"),this.extraDelay=e}}function hg(n){const t=n.length;let e=0;for(;e<t&&n[e].trim()==="";)e++;return n.substring(e,e+5).toLowerCase()==="data:"}function f_(n){return typeof n=="string"&&/\.pdf$/i.test(n)}function bH(n){return[n]=n.split(/[#?]/,1),n.substring(n.lastIndexOf("/")+1)}function _H(n,t="document.pdf"){if(typeof n!="string")return t;if(hg(n))return Pe('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const r=(s=>{try{return new URL(s)}catch{try{return new URL(decodeURIComponent(s))}catch{try{return new URL(s,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(s),"https://foo.bar")}catch{return null}}}}})(n);if(!r)return t;const i=s=>{try{let l=decodeURIComponent(s);return l.includes("/")?(l=l.split("/").at(-1),l.test(/^\.pdf$/i)?l:s):l}catch{return s}},a=/\.pdf$/i,o=r.pathname.split("/").at(-1);if(a.test(o))return i(o);if(r.searchParams.size>0){const s=Array.from(r.searchParams.values()).reverse();for(const u of s)if(a.test(u))return i(u);const l=Array.from(r.searchParams.keys()).reverse();for(const u of l)if(a.test(u))return i(u)}if(r.hash){const l=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(r.hash);if(l)return i(l[0])}return t}class RI{started=Object.create(null);times=[];time(t){t in this.started&&Pe(`Timer is already running for ${t}`),this.started[t]=Date.now()}timeEnd(t){t in this.started||Pe(`Timer has not been started for ${t}`),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let e=0;for(const{name:r}of this.times)e=Math.max(r.length,e);for(const{name:r,start:i,end:a}of this.times)t.push(`${r.padEnd(e)} ${a-i}ms
3
3
  `);return t.join("")}}function Ip(n,t){const e=t?URL.parse(n,t):URL.parse(n);return e?.protocol==="http:"||e?.protocol==="https:"}function sa(n){n.preventDefault()}function Or(n){n.preventDefault(),n.stopPropagation()}function znt(n){console.log("Deprecated API usage: "+n)}class q0{static#t;static toDateObject(t){if(t instanceof Date)return t;if(!t||typeof t!="string")return null;this.#t||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const e=this.#t.exec(t);if(!e)return null;const r=parseInt(e[1],10);let i=parseInt(e[2],10);i=i>=1&&i<=12?i-1:0;let a=parseInt(e[3],10);a=a>=1&&a<=31?a:1;let o=parseInt(e[4],10);o=o>=0&&o<=23?o:0;let s=parseInt(e[5],10);s=s>=0&&s<=59?s:0;let l=parseInt(e[6],10);l=l>=0&&l<=59?l:0;const u=e[7]||"Z";let c=parseInt(e[8],10);c=c>=0&&c<=23?c:0;let h=parseInt(e[9],10)||0;return h=h>=0&&h<=59?h:0,u==="-"?(o+=c,s+=h):u==="+"&&(o-=c,s-=h),new Date(Date.UTC(r,i,a,o,s,l))}}function wH(n,{scale:t=1,rotation:e=0}){const{width:r,height:i}=n.attributes.style,a=[0,0,parseInt(r),parseInt(i)];return new cg({viewBox:a,userUnit:1,scale:t,rotation:e})}function jf(n){if(n.startsWith("#")){const t=parseInt(n.slice(1),16);return[(t&16711680)>>16,(t&65280)>>8,t&255]}return n.startsWith("rgb(")?n.slice(4,-1).split(",").map(t=>parseInt(t)):n.startsWith("rgba(")?n.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):(Pe(`Not a valid color format: "${n}"`),[0,0,0])}function Gnt(n){const t=document.createElement("span");t.style.visibility="hidden",t.style.colorScheme="only light",document.body.append(t);for(const e of n.keys()){t.style.color=e;const r=window.getComputedStyle(t).color;n.set(e,jf(r))}t.remove()}function Rr(n){const{a:t,b:e,c:r,d:i,e:a,f:o}=n.getTransform();return[t,e,r,i,a,o]}function Co(n){const{a:t,b:e,c:r,d:i,e:a,f:o}=n.getTransform().invertSelf();return[t,e,r,i,a,o]}function Wl(n,t,e=!1,r=!0){if(t instanceof cg){const{pageWidth:i,pageHeight:a}=t.rawDims,{style:o}=n,s=In.isCSSRoundSupported,l=`var(--total-scale-factor) * ${i}px`,u=`var(--total-scale-factor) * ${a}px`,c=s?`round(down, ${l}, var(--scale-round-x))`:`calc(${l})`,h=s?`round(down, ${u}, var(--scale-round-y))`:`calc(${u})`;!e||t.rotation%180===0?(o.width=c,o.height=h):(o.width=h,o.height=c)}r&&n.setAttribute("data-main-rotation",t.rotation)}class vo{constructor(){const{pixelRatio:t}=vo;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(t,e,r,i,a=-1){let o=1/0,s=1/0,l=1/0;r=vo.capPixels(r,a),r>0&&(o=Math.sqrt(r/(t*e))),i!==-1&&(s=i/t,l=i/e);const u=Math.min(o,s,l);return this.sx>u||this.sy>u?(this.sx=u,this.sy=u,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(t,e){if(e>=0){const r=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+e/100));return t>0?Math.min(t,r):r}return t}}const Z0=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class Hnt{static get isDarkMode(){return Oe(this,"isDarkMode",!!window?.matchMedia?.("(prefers-color-scheme: dark)").matches)}}class xH{static get commentForegroundColor(){const t=document.createElement("span");t.classList.add("comment","sidebar");const{style:e}=t;e.width=e.height="0",e.display="none",e.color="var(--comment-fg-color)",document.body.append(t);const{color:r}=window.getComputedStyle(t);return t.remove(),Oe(this,"commentForegroundColor",jf(r))}}function SH(n,t,e,r){r=Math.min(Math.max(r??1,0),1);const i=255*(1-r);return n=Math.round(n*r+i),t=Math.round(t*r+i),e=Math.round(e*r+i),[n,t,e]}function NI(n,t){const e=n[0]/255,r=n[1]/255,i=n[2]/255,a=Math.max(e,r,i),o=Math.min(e,r,i),s=(a+o)/2;if(a===o)t[0]=t[1]=0;else{const l=a-o;switch(t[1]=s<.5?l/(a+o):l/(2-a-o),a){case e:t[0]=((r-i)/l+(r<i?6:0))*60;break;case r:t[0]=((i-e)/l+2)*60;break;case i:t[0]=((e-r)/l+4)*60;break}}t[2]=s}function vT(n,t){const e=n[0],r=n[1],i=n[2],a=(1-Math.abs(2*i-1))*r,o=a*(1-Math.abs(e/60%2-1)),s=i-a/2;switch(Math.floor(e/60)){case 0:t[0]=a+s,t[1]=o+s,t[2]=s;break;case 1:t[0]=o+s,t[1]=a+s,t[2]=s;break;case 2:t[0]=s,t[1]=a+s,t[2]=o+s;break;case 3:t[0]=s,t[1]=o+s,t[2]=a+s;break;case 4:t[0]=o+s,t[1]=s,t[2]=a+s;break;case 5:case 6:t[0]=a+s,t[1]=s,t[2]=o+s;break}}function OI(n){return n<=.03928?n/12.92:((n+.055)/1.055)**2.4}function BI(n,t,e){vT(n,e),e.map(OI);const r=.2126*e[0]+.7152*e[1]+.0722*e[2];vT(t,e),e.map(OI);const i=.2126*e[0]+.7152*e[1]+.0722*e[2];return r>i?(r+.05)/(i+.05):(i+.05)/(r+.05)}const FI=new Map;function AH(n,t){const e=n[0]+n[1]*256+n[2]*65536+t[0]*16777216+t[1]*4294967296+t[2]*1099511627776;let r=FI.get(e);if(r)return r;const i=new Float32Array(9),a=i.subarray(0,3),o=i.subarray(3,6);NI(n,o);const s=i.subarray(6,9);NI(t,s);const l=s[2]<.5,u=l?12:4.5;if(o[2]=l?Math.sqrt(o[2]):1-Math.sqrt(1-o[2]),BI(o,s,a)<u){let c,h;l?(c=o[2],h=1):(c=0,h=o[2]);const f=.005;for(;h-c>f;){const d=o[2]=(c+h)/2;l===BI(o,s,a)<u?c=d:h=d}o[2]=l?h:c}return vT(o,a),r=Qt.makeHexColor(Math.round(a[0]*255),Math.round(a[1]*255),Math.round(a[2]*255)),FI.set(e,r),r}function uM({html:n,dir:t,className:e},r){const i=document.createDocumentFragment();if(typeof n=="string"){const a=document.createElement("p");a.dir=t||"auto";const o=n.split(/(?:\r\n?|\n)/);for(let s=0,l=o.length;s<l;++s){const u=o[s];a.append(document.createTextNode(u)),s<l-1&&a.append(document.createElement("br"))}i.append(a)}else lM.render({xfaHtml:n,div:i,intent:"richText"});i.firstChild.classList.add("richText",e),r.append(i)}class tv{#t=null;#e=null;#n;#r=null;#o=null;#i=null;#a=null;#s=null;static#u=null;constructor(t){this.#n=t,tv.#u||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){const t=this.#t=document.createElement("div");t.classList.add("editToolbar","hidden"),t.setAttribute("role","toolbar");const e=this.#n._uiManager._signal;e instanceof AbortSignal&&!e.aborted&&(t.addEventListener("contextmenu",sa,{signal:e}),t.addEventListener("pointerdown",tv.#l,{signal:e}));const r=this.#r=document.createElement("div");r.className="buttons",t.append(r);const i=this.#n.toolbarPosition;if(i){const{style:a}=t,o=this.#n._uiManager.direction==="ltr"?1-i[0]:i[0];a.insetInlineEnd=`${100*o}%`,a.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return t}get div(){return this.#t}static#l(t){t.stopPropagation()}#f(t){this.#n._focusEventsAllowed=!1,Or(t)}#h(t){this.#n._focusEventsAllowed=!0,Or(t)}#d(t){const e=this.#n._uiManager._signal;return!(e instanceof AbortSignal)||e.aborted?!1:(t.addEventListener("focusin",this.#f.bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",this.#h.bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",sa,{signal:e}),!0)}hide(){this.#t.classList.add("hidden"),this.#e?.hideDropdown()}show(){this.#t.classList.remove("hidden"),this.#o?.shown(),this.#i?.shown()}addDeleteButton(){const{editorType:t,_uiManager:e}=this.#n,r=document.createElement("button");r.classList.add("basic","deleteButton"),r.tabIndex=0,r.setAttribute("data-l10n-id",tv.#u[t]),this.#d(r)&&r.addEventListener("click",i=>{e.delete()},{signal:e._signal}),this.#r.append(r)}get#g(){const t=document.createElement("div");return t.className="divider",t}async addAltText(t){const e=await t.render();this.#d(e),this.#r.append(e,this.#g),this.#o=t}addComment(t,e=null){if(this.#i)return;const r=t.renderForToolbar();if(!r)return;this.#d(r);const i=this.#a=this.#g;e?(this.#r.insertBefore(r,e),this.#r.insertBefore(i,e)):this.#r.append(r,i),this.#i=t,t.toolbar=this}addColorPicker(t){if(this.#e)return;this.#e=t;const e=t.renderButton();this.#d(e),this.#r.append(e,this.#g)}async addEditSignatureButton(t){const e=this.#s=await t.renderEditButton(this.#n);this.#d(e),this.#r.append(e,this.#g)}removeButton(t){t==="comment"&&(this.#i?.removeToolbarCommentButton(),this.#i=null,this.#a?.remove(),this.#a=null)}async addButton(t,e){switch(t){case"colorPicker":this.addColorPicker(e);break;case"altText":await this.addAltText(e);break;case"editSignature":await this.addEditSignatureButton(e);break;case"delete":this.addDeleteButton();break;case"comment":this.addComment(e);break}}async addButtonBefore(t,e,r){const i=this.#r.querySelector(r);i&&t==="comment"&&this.addComment(e,i)}updateEditSignatureButton(t){this.#s&&(this.#s.title=t)}remove(){this.#t.remove(),this.#e?.destroy(),this.#e=null}}class Unt{#t=null;#e=null;#n;constructor(t){this.#n=t}#r(){const t=this.#e=document.createElement("div");t.className="editToolbar",t.setAttribute("role","toolbar");const e=this.#n._signal;e instanceof AbortSignal&&!e.aborted&&t.addEventListener("contextmenu",sa,{signal:e});const r=this.#t=document.createElement("div");return r.className="buttons",t.append(r),this.#n.hasCommentManager()&&this.#i("commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{this.#n.commentSelection("floating_button")}),this.#i("highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{this.#n.highlightSelection("floating_button")}),t}#o(t,e){let r=0,i=0;for(const a of t){const o=a.y+a.height;if(o<r)continue;const s=a.x+(e?a.width:0);if(o>r){i=s,r=o;continue}e?s>i&&(i=s):s<i&&(i=s)}return[e?1-i:i,r]}show(t,e,r){const[i,a]=this.#o(e,r),{style:o}=this.#e||=this.#r();t.append(this.#e),o.insetInlineEnd=`${100*i}%`,o.top=`calc(${100*a}% + var(--editor-toolbar-vert-offset))`}hide(){this.#e.remove()}#i(t,e,r,i){const a=document.createElement("button");a.classList.add("basic",t),a.tabIndex=0,a.setAttribute("data-l10n-id",e);const o=document.createElement("span");a.append(o),o.className="visuallyHidden",o.setAttribute("data-l10n-id",r);const s=this.#n._signal;s instanceof AbortSignal&&!s.aborted&&(a.addEventListener("contextmenu",sa,{signal:s}),a.addEventListener("click",i,{signal:s})),this.#t.append(a)}}function TH(n,t,e){for(const r of e)t.addEventListener(r,n[r].bind(n))}class Wnt{#t=0;get id(){return`${Av}${this.#t++}`}}class cM{#t=oM();#e=0;#n=null;static get _isSVGFittingCanvas(){const t='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',r=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),i=new Image;i.src=t;const a=i.decode().then(()=>(r.drawImage(i,0,0,1,1,0,0,1,3),new Uint32Array(r.getImageData(0,0,1,1).data.buffer)[0]===0));return Oe(this,"_isSVGFittingCanvas",a)}async#r(t,e){this.#n||=new Map;let r=this.#n.get(t);if(r===null)return null;if(r?.bitmap)return r.refCounter+=1,r;try{r||={bitmap:null,id:`image_${this.#t}_${this.#e++}`,refCounter:0,isSvg:!1};let i;if(typeof e=="string"?(r.url=e,i=await $f(e,"blob")):e instanceof File?i=r.file=e:e instanceof Blob&&(i=e),i.type==="image/svg+xml"){const a=cM._isSVGFittingCanvas,o=new FileReader,s=new Image,l=new Promise((u,c)=>{s.onload=()=>{r.bitmap=s,r.isSvg=!0,u()},o.onload=async()=>{const h=r.svgUrl=o.result;s.src=await a?`${h}#svgView(preserveAspectRatio(none))`:h},s.onerror=o.onerror=c});o.readAsDataURL(i),await l}else r.bitmap=await createImageBitmap(i);r.refCounter=1}catch(i){Pe(i),r=null}return this.#n.set(t,r),r&&this.#n.set(r.id,r),r}async getFromFile(t){const{lastModified:e,name:r,size:i,type:a}=t;return this.#r(`${e}_${r}_${i}_${a}`,t)}async getFromUrl(t){return this.#r(t,t)}async getFromBlob(t,e){const r=await e;return this.#r(t,r)}async getFromId(t){this.#n||=new Map;const e=this.#n.get(t);if(!e)return null;if(e.bitmap)return e.refCounter+=1,e;if(e.file)return this.getFromFile(e.file);if(e.blobPromise){const{blobPromise:r}=e;return delete e.blobPromise,this.getFromBlob(e.id,r)}return this.getFromUrl(e.url)}getFromCanvas(t,e){this.#n||=new Map;let r=this.#n.get(t);if(r?.bitmap)return r.refCounter+=1,r;const i=new OffscreenCanvas(e.width,e.height);return i.getContext("2d").drawImage(e,0,0),r={bitmap:i.transferToImageBitmap(),id:`image_${this.#t}_${this.#e++}`,refCounter:1,isSvg:!1},this.#n.set(t,r),this.#n.set(r.id,r),r}getSvgUrl(t){const e=this.#n.get(t);return e?.isSvg?e.svgUrl:null}deleteId(t){this.#n||=new Map;const e=this.#n.get(t);if(!e||(e.refCounter-=1,e.refCounter!==0))return;const{bitmap:r}=e;if(!e.url&&!e.file){const i=new OffscreenCanvas(r.width,r.height);i.getContext("bitmaprenderer").transferFromImageBitmap(r),e.blobPromise=i.convertToBlob()}r.close?.(),e.bitmap=null}isValidId(t){return t.startsWith(`image_${this.#t}_`)}}class $nt{#t=[];#e=!1;#n;#r=-1;constructor(t=128){this.#n=t}add({cmd:t,undo:e,post:r,mustExec:i,type:a=NaN,overwriteIfSameType:o=!1,keepUndo:s=!1}){if(i&&t(),this.#e)return;const l={cmd:t,undo:e,post:r,type:a};if(this.#r===-1){this.#t.length>0&&(this.#t.length=0),this.#r=0,this.#t.push(l);return}if(o&&this.#t[this.#r].type===a){s&&(l.undo=this.#t[this.#r].undo),this.#t[this.#r]=l;return}const u=this.#r+1;u===this.#n?this.#t.splice(0,1):(this.#r=u,u<this.#t.length&&this.#t.splice(u)),this.#t.push(l)}undo(){if(this.#r===-1)return;this.#e=!0;const{undo:t,post:e}=this.#t[this.#r];t(),e?.(),this.#e=!1,this.#r-=1}redo(){if(this.#r<this.#t.length-1){this.#r+=1,this.#e=!0;const{cmd:t,post:e}=this.#t[this.#r];t(),e?.(),this.#e=!1}}hasSomethingToUndo(){return this.#r!==-1}hasSomethingToRedo(){return this.#r<this.#t.length-1}cleanType(t){if(this.#r!==-1){for(let e=this.#r;e>=0;e--)if(this.#t[e].type!==t){this.#t.splice(e+1,this.#r-e),this.#r=e;return}this.#t.length=0,this.#r=-1}}destroy(){this.#t=null}}class fg{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=In.platform;for(const[r,i,a={}]of t)for(const o of r){const s=o.startsWith("mac+");e&&s?(this.callbacks.set(o.slice(4),{callback:i,options:a}),this.allKeys.add(o.split("+").at(-1))):!e&&!s&&(this.callbacks.set(o,{callback:i,options:a}),this.allKeys.add(o.split("+").at(-1)))}}#t(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const e=this.buffer.join("+");return this.buffer.length=0,e}exec(t,e){if(!this.allKeys.has(e.key))return;const r=this.callbacks.get(this.#t(e));if(!r)return;const{callback:i,options:{bubbles:a=!1,args:o=[],checker:s=null}}=r;s&&!s(t,e)||(i.bind(t,...o,e)(),a||Or(e))}}class hM{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return Gnt(t),Oe(this,"_colors",t)}convert(t){const e=jf(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[r,i]of this._colors)if(i.every((a,o)=>a===e[o]))return hM._colorsMapping.get(r);return e}getHexCode(t){const e=this._colors.get(t);return e?Qt.makeHexColor(...e):t}}class zs{#t=new AbortController;#e=null;#n=null;#r=new Map;#o=new Map;#i=null;#a=null;#s=null;#u=new $nt;#l=null;#f=null;#h=null;#d=0;#g=new Set;#p=null;#c=null;#v=new Set;_editorUndoBar=null;#m=!1;#b=!1;#y=!1;#T=null;#S=null;#_=null;#E=null;#x=!1;#A=null;#k=new Wnt;#M=!1;#P=!1;#B=!1;#L=null;#R=null;#F=null;#N=null;#W=null;#C=Me.NONE;#w=new Set;#I=null;#V=null;#G=null;#X=null;#j=null;#Y={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#H=[0,0];#O=null;#$=null;#Q=null;#J=null;#z=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const t=zs.prototype,e=o=>o.#$.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&o.hasSomethingToControl(),r=(o,{target:s})=>{if(s instanceof HTMLInputElement){const{type:l}=s;return l!=="text"&&l!=="number"}return!0},i=this.TRANSLATE_SMALL,a=this.TRANSLATE_BIG;return Oe(this,"_keyboardManager",new fg([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:r}],[["ctrl+z","mac+meta+z"],t.undo,{checker:r}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:r}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:r}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(o,{target:s})=>!(s instanceof HTMLButtonElement)&&o.#$.contains(s)&&!o.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(o,{target:s})=>!(s instanceof HTMLButtonElement)&&o.#$.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-i,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-a,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[i,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[a,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-i],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-a],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,i],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,a],checker:e}]]))}constructor(t,e,r,i,a,o,s,l,u,c,h,f,d,v,m,y){const g=this._signal=this.#t.signal;this.#$=t,this.#Q=e,this.#J=r,this.#i=i,this.#l=a,this.#V=o,this.#j=l,this._eventBus=s,s._on("editingaction",this.onEditingAction.bind(this),{signal:g}),s._on("pagechanging",this.onPageChanging.bind(this),{signal:g}),s._on("scalechanging",this.onScaleChanging.bind(this),{signal:g}),s._on("rotationchanging",this.onRotationChanging.bind(this),{signal:g}),s._on("setpreference",this.onSetPreference.bind(this),{signal:g}),s._on("switchannotationeditorparams",p=>this.updateParams(p.type,p.value),{signal:g}),window.addEventListener("pointerdown",()=>{this.#P=!0},{capture:!0,signal:g}),window.addEventListener("pointerup",()=>{this.#P=!1},{capture:!0,signal:g}),this.#lt(),this.#ft(),this.#et(),this.#a=l.annotationStorage,this.#T=l.filterFactory,this.#G=u,this.#E=c||null,this.#m=h,this.#b=f,this.#y=d,this.#W=v||null,this.viewParameters={realScale:Cc.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=m||null,this._supportsPinchToZoom=y!==!1,a?.setSidebarUiManager(this)}destroy(){this.#z?.resolve(),this.#z=null,this.#t?.abort(),this.#t=null,this._signal=null;for(const t of this.#o.values())t.destroy();this.#o.clear(),this.#r.clear(),this.#v.clear(),this.#N?.clear(),this.#e=null,this.#w.clear(),this.#u.destroy(),this.#i?.destroy(),this.#l?.destroy(),this.#V?.destroy(),this.#A?.hide(),this.#A=null,this.#F?.destroy(),this.#F=null,this.#n=null,this.#S&&(clearTimeout(this.#S),this.#S=null),this.#O&&(clearTimeout(this.#O),this.#O=null),this._editorUndoBar?.destroy(),this.#j=null}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return this.#W}get useNewAltTextFlow(){return this.#b}get useNewAltTextWhenAddingImage(){return this.#y}get hcmFilter(){return Oe(this,"hcmFilter",this.#G?this.#T.addHCMFilter(this.#G.foreground,this.#G.background):"none")}get direction(){return Oe(this,"direction",getComputedStyle(this.#$).direction)}get _highlightColors(){return Oe(this,"_highlightColors",this.#E?new Map(this.#E.split(",").map(t=>(t=t.split("=").map(e=>e.trim()),t[1]=t[1].toUpperCase(),t))):null)}get highlightColors(){const{_highlightColors:t}=this;if(!t)return Oe(this,"highlightColors",null);const e=new Map,r=!!this.#G;for(const[i,a]of t){const o=i.endsWith("_HCM");if(r&&o){e.set(i.replace("_HCM",""),a);continue}!r&&!o&&e.set(i,a)}return Oe(this,"highlightColors",e)}get highlightColorNames(){return Oe(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}getNonHCMColor(t){if(!this._highlightColors)return t;const e=this.highlightColorNames.get(t);return this._highlightColors.get(e)||t}getNonHCMColorName(t){return this.highlightColorNames.get(t)||t}setCurrentDrawingSession(t){t?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#h=t}setMainHighlightColorPicker(t){this.#F=t}editAltText(t,e=!1){this.#i?.editAltText(this,t,e)}hasCommentManager(){return!!this.#l}editComment(t,e,r,i){this.#l?.showDialog(this,t,e,r,i)}selectComment(t,e){this.#o.get(t)?.getEditorByUID(e)?.toggleComment(!0,!0)}updateComment(t){this.#l?.updateComment(t.getData())}updatePopupColor(t){this.#l?.updatePopupColor(t)}removeComment(t){this.#l?.removeComments([t.uid])}toggleComment(t,e,r=void 0){this.#l?.toggleCommentPopup(t,e,r)}makeCommentColor(t,e){return t&&this.#l?.makeCommentColor(t,e)||null}getCommentDialogElement(){return this.#l?.dialogElement||null}async waitForEditorsRendered(t){if(this.#o.has(t-1))return;const{resolve:e,promise:r}=Promise.withResolvers(),i=a=>{a.pageNumber===t&&(this._eventBus._off("editorsrendered",i),e())};this._eventBus.on("editorsrendered",i),await r}getSignature(t){this.#V?.getSignature({uiManager:this,editor:t})}get signatureManager(){return this.#V}switchToMode(t,e){this._eventBus.on("annotationeditormodechanged",e,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,e){this._eventBus.dispatch("setpreference",{source:this,name:t,value:e})}onSetPreference({name:t,value:e}){t==="enableNewAltTextWhenAddingImage"&&(this.#y=e)}onPageChanging({pageNumber:t}){this.#d=t-1}focusMainContainer(){this.#$.focus()}findParent(t,e){for(const r of this.#o.values()){const{x:i,y:a,width:o,height:s}=r.div.getBoundingClientRect();if(t>=i&&t<=i+o&&e>=a&&e<=a+s)return r}return null}disableUserSelect(t=!1){this.#Q.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#v.add(t)}removeShouldRescale(t){this.#v.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*Cc.PDF_TO_CSS_UNITS;for(const e of this.#v)e.onScaleChanging();this.#h?.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}#K({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}#tt(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const r of this.#o.values())if(r.hasTextLayer(t))return r;return null}highlightSelection(t="",e=!1){const r=document.getSelection();if(!r||r.isCollapsed)return;const{anchorNode:i,anchorOffset:a,focusNode:o,focusOffset:s}=r,l=r.toString(),c=this.#K(r).closest(".textLayer"),h=this.getSelectionBoxes(c);if(!h)return;r.empty();const f=this.#tt(c),d=this.#C===Me.NONE,v=()=>{const m=f?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:h,anchorNode:i,anchorOffset:a,focusNode:o,focusOffset:s,text:l});d&&this.showAllEditors("highlight",!0,!0),e&&m?.editComment()};if(d){this.switchToMode(Me.HIGHLIGHT,v);return}v()}commentSelection(t=""){this.highlightSelection(t,!0)}#ot(){const t=document.getSelection();if(!t||t.isCollapsed)return;const r=this.#K(t).closest(".textLayer"),i=this.getSelectionBoxes(r);i&&(this.#A||=new Unt(this),this.#A.show(r,i,this.direction==="ltr"))}getAndRemoveDataFromAnnotationStorage(t){if(!this.#a)return null;const e=`${Av}${t}`,r=this.#a.getRawValue(e);return r&&this.#a.remove(e),r}addToAnnotationStorage(t){!t.isEmpty()&&this.#a&&!this.#a.has(t.id)&&this.#a.setValue(t.id,t)}a11yAlert(t,e=null){const r=this.#J;r&&(r.setAttribute("data-l10n-id",t),e?r.setAttribute("data-l10n-args",JSON.stringify(e)):r.removeAttribute("data-l10n-args"))}#st(){const t=document.getSelection();if(!t||t.isCollapsed){this.#I&&(this.#A?.hide(),this.#I=null,this.#D({hasSelectedText:!1}));return}const{anchorNode:e}=t;if(e===this.#I)return;const i=this.#K(t).closest(".textLayer");if(!i){this.#I&&(this.#A?.hide(),this.#I=null,this.#D({hasSelectedText:!1}));return}if(this.#A?.hide(),this.#I=e,this.#D({hasSelectedText:!0}),!(this.#C!==Me.HIGHLIGHT&&this.#C!==Me.NONE)&&(this.#C===Me.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#x=this.isShiftKeyDown,!this.isShiftKeyDown)){const a=this.#C===Me.HIGHLIGHT?this.#tt(i):null;if(a?.toggleDrawing(),this.#P){const o=new AbortController,s=this.combinedSignal(o),l=u=>{u.type==="pointerup"&&u.button!==0||(o.abort(),a?.toggleDrawing(!0),u.type==="pointerup"&&this.#q("main_toolbar"))};window.addEventListener("pointerup",l,{signal:s}),window.addEventListener("blur",l,{signal:s})}else a?.toggleDrawing(!0),this.#q("main_toolbar")}}#q(t=""){this.#C===Me.HIGHLIGHT?this.highlightSelection(t):this.#m&&this.#ot()}#lt(){document.addEventListener("selectionchange",this.#st.bind(this),{signal:this._signal})}#ut(){if(this.#_)return;this.#_=new AbortController;const t=this.combinedSignal(this.#_);window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})}#ct(){this.#_?.abort(),this.#_=null}blur(){if(this.isShiftKeyDown=!1,this.#x&&(this.#x=!1,this.#q("main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of this.#w)if(e.div.contains(t)){this.#R=[e,t],e._focusEventsAllowed=!1;break}}focus(){if(!this.#R)return;const[t,e]=this.#R;this.#R=null,e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),e.focus()}#et(){if(this.#L)return;this.#L=new AbortController;const t=this.combinedSignal(this.#L);window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})}#ht(){this.#L?.abort(),this.#L=null}#rt(){if(this.#f)return;this.#f=new AbortController;const t=this.combinedSignal(this.#f);document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})}#nt(){this.#f?.abort(),this.#f=null}#ft(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#et(),this.#rt()}removeEditListeners(){this.#ht(),this.#nt()}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const r of this.#c)if(r.isHandlingMimeForPasting(e)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(const e of t.dataTransfer.items)for(const r of this.#c)if(r.isHandlingMimeForPasting(e.type)){r.paste(e,this.currentLayer),t.preventDefault();return}}copy(t){if(t.preventDefault(),this.#e?.commitOrRemove(),!this.hasSelection)return;const e=[];for(const r of this.#w){const i=r.serialize(!0);i&&e.push(i)}e.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t),this.delete()}async paste(t){t.preventDefault();const{clipboardData:e}=t;for(const a of e.items)for(const o of this.#c)if(o.isHandlingMimeForPasting(a.type)){o.paste(a,this.currentLayer);return}let r=e.getData("application/pdfjs");if(!r)return;try{r=JSON.parse(r)}catch(a){Pe(`paste: "${a.message}".`);return}if(!Array.isArray(r))return;this.unselectAll();const i=this.currentLayer;try{const a=[];for(const l of r){const u=await i.deserialize(l);if(!u)return;a.push(u)}const o=()=>{for(const l of a)this.#it(l);this.#at(a)},s=()=>{for(const l of a)l.remove()};this.addCommands({cmd:o,undo:s,mustExec:!0})}catch(a){Pe(`paste: "${a.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),this.#C!==Me.NONE&&!this.isEditorHandlingKeyboard&&zs._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!1,this.#x&&(this.#x=!1,this.#q("main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu");break}}#D(t){Object.entries(t).some(([r,i])=>this.#Y[r]!==i)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#Y,t)}),this.#C===Me.HIGHLIGHT&&t.hasSelectedEditor===!1&&this.#U([[Xe.HIGHLIGHT_FREE,!0]]))}#U(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#ut(),this.#rt(),this.#D({isEditing:this.#C!==Me.NONE,isEmpty:this.#Z(),hasSomethingToUndo:this.#u.hasSomethingToUndo(),hasSomethingToRedo:this.#u.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ct(),this.#nt(),this.#D({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#c){this.#c=t;for(const e of this.#c)this.#U(e.defaultPropertiesToUpdate)}}getId(){return this.#k.id}get currentLayer(){return this.#o.get(this.#d)}getLayer(t){return this.#o.get(t)}get currentPageIndex(){return this.#d}addLayer(t){this.#o.set(t.pageIndex,t),this.#M?t.enable():t.disable()}removeLayer(t){this.#o.delete(t.pageIndex)}async updateMode(t,e=null,r=!1,i=!1,a=!1){if(this.#C!==t&&!(this.#z&&(await this.#z.promise,!this.#z))){if(this.#z=Promise.withResolvers(),this.#h?.commitOrRemove(),this.#C===Me.POPUP&&this.#l?.hideSidebar(),this.#l?.destroyPopup(),this.#C=t,t===Me.NONE){this.setEditingState(!1),this.#pt();for(const o of this.#r.values())o.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),this.#z.resolve();return}for(const o of this.#r.values())o.addStandaloneCommentButton();t===Me.SIGNATURE&&await this.#V?.loadSignatures(),this.setEditingState(!0),await this.#dt(),this.unselectAll();for(const o of this.#o.values())o.updateMode(t);if(t===Me.POPUP){this.#n||=await this.#j.getAnnotationsByType(new Set(this.#c.map(l=>l._editorType)));const o=new Set,s=[];for(const l of this.#r.values()){const{annotationElementId:u,hasComment:c,deleted:h}=l;u&&o.add(u),c&&!h&&s.push(l.getData())}for(const l of this.#n){const{id:u,popupRef:c,contentsObj:h}=l;c&&h?.str&&!o.has(u)&&!this.#g.has(u)&&s.push(l)}this.#l?.showSidebar(s)}if(!e){r&&this.addNewEditorFromKeyboard(),this.#z.resolve();return}for(const o of this.#r.values())o.uid===e?(this.setSelected(o),a?o.editComment():i?o.enterInEditMode():o.focus()):o.unselect();this.#z.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t.mode!==this.#C&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...t})}updateParams(t,e){if(this.#c){switch(t){case Xe.CREATE:this.currentLayer.addNewEditor(e);return;case Xe.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#X||=new Map).set(t,e),this.showAllEditors("highlight",e);break}if(this.hasSelection)for(const r of this.#w)r.updateParams(t,e);else for(const r of this.#c)r.updateDefaultParams(t,e)}}showAllEditors(t,e,r=!1){for(const a of this.#r.values())a.editorType===t&&a.show(e);(this.#X?.get(Xe.HIGHLIGHT_SHOW_ALL)??!0)!==e&&this.#U([[Xe.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(t=!1){if(this.#B!==t){this.#B=t;for(const e of this.#o.values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}async#dt(){if(!this.#M){this.#M=!0;const t=[];for(const e of this.#o.values())t.push(e.enable());await Promise.all(t);for(const e of this.#r.values())e.enable()}}#pt(){if(this.unselectAll(),this.#M){this.#M=!1;for(const t of this.#o.values())t.disable();for(const t of this.#r.values())t.disable()}}*getEditors(t){for(const e of this.#r.values())e.pageIndex===t&&(yield e)}getEditor(t){return this.#r.get(t)}addEditor(t){this.#r.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#S&&clearTimeout(this.#S),this.#S=setTimeout(()=>{this.focusMainContainer(),this.#S=null},0)),this.#r.delete(t.id),t.annotationElementId&&this.#N?.delete(t.annotationElementId),this.unselect(t),(!t.annotationElementId||!this.#g.has(t.annotationElementId))&&this.#a?.remove(t.id)}addDeletedAnnotationElement(t){this.#g.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#g.has(t)}removeDeletedAnnotationElement(t){this.#g.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#it(t){const e=this.#o.get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#e!==t&&(this.#e=t,t&&this.#U(t.propertiesToUpdate))}get#vt(){let t=null;for(t of this.#w);return t}updateUI(t){this.#vt===t&&this.#U(t.propertiesToUpdate)}updateUIForDefaultProperties(t){this.#U(t.defaultPropertiesToUpdate)}toggleSelected(t){if(this.#w.has(t)){this.#w.delete(t),t.unselect(),this.#D({hasSelectedEditor:this.hasSelection});return}this.#w.add(t),t.select(),this.#U(t.propertiesToUpdate),this.#D({hasSelectedEditor:!0})}setSelected(t){this.updateToolbar({mode:t.mode,editId:t.id}),this.#h?.commitOrRemove();for(const e of this.#w)e!==t&&e.unselect();this.#w.clear(),this.#w.add(t),t.select(),this.#U(t.propertiesToUpdate),this.#D({hasSelectedEditor:!0})}isSelected(t){return this.#w.has(t)}get firstSelectedEditor(){return this.#w.values().next().value}unselect(t){t.unselect(),this.#w.delete(t),this.#D({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#w.size!==0}get isEnterHandled(){return this.#w.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#u.undo(),this.#D({hasSomethingToUndo:this.#u.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#Z()}),this._editorUndoBar?.hide()}redo(){this.#u.redo(),this.#D({hasSomethingToUndo:!0,hasSomethingToRedo:this.#u.hasSomethingToRedo(),isEmpty:this.#Z()})}addCommands(t){this.#u.add(t),this.#D({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#Z()})}cleanUndoStack(t){this.#u.cleanType(t)}#Z(){if(this.#r.size===0)return!0;if(this.#r.size===1)for(const t of this.#r.values())return t.isEmpty();return!1}delete(){this.commitOrRemove();const t=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!t)return;const e=t?[t]:[...this.#w],r=()=>{this._editorUndoBar?.show(i,e.length===1?e[0].editorType:e.length);for(const a of e)a.remove()},i=()=>{for(const a of e)this.#it(a)};this.addCommands({cmd:r,undo:i,mustExec:!0})}commitOrRemove(){this.#e?.commitOrRemove()}hasSomethingToControl(){return this.#e||this.hasSelection}#at(t){for(const e of this.#w)e.unselect();this.#w.clear();for(const e of t)e.isEmpty()||(this.#w.add(e),e.select());this.#D({hasSelectedEditor:this.hasSelection})}selectAll(){for(const t of this.#w)t.commit();this.#at(this.#r.values())}unselectAll(){if(!(this.#e&&(this.#e.commitOrRemove(),this.#C!==Me.NONE))&&!this.#h?.commitOrRemove()&&this.hasSelection){for(const t of this.#w)t.unselect();this.#w.clear(),this.#D({hasSelectedEditor:!1})}}translateSelectedEditors(t,e,r=!1){if(r||this.commitOrRemove(),!this.hasSelection)return;this.#H[0]+=t,this.#H[1]+=e;const[i,a]=this.#H,o=[...this.#w],s=1e3;this.#O&&clearTimeout(this.#O),this.#O=setTimeout(()=>{this.#O=null,this.#H[0]=this.#H[1]=0,this.addCommands({cmd:()=>{for(const l of o)this.#r.has(l.id)&&(l.translateInPage(i,a),l.translationDone())},undo:()=>{for(const l of o)this.#r.has(l.id)&&(l.translateInPage(-i,-a),l.translationDone())},mustExec:!1})},s);for(const l of o)l.translateInPage(t,e),l.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#p=new Map;for(const t of this.#w)this.#p.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#p)return!1;this.disableUserSelect(!1);const t=this.#p;this.#p=null;let e=!1;for(const[{x:i,y:a,pageIndex:o},s]of t)s.newX=i,s.newY=a,s.newPageIndex=o,e||=i!==s.savedX||a!==s.savedY||o!==s.savedPageIndex;if(!e)return!1;const r=(i,a,o,s)=>{if(this.#r.has(i.id)){const l=this.#o.get(s);l?i._setParentAndPosition(l,a,o):(i.pageIndex=s,i.x=a,i.y=o)}};return this.addCommands({cmd:()=>{for(const[i,{newX:a,newY:o,newPageIndex:s}]of t)r(i,a,o,s)},undo:()=>{for(const[i,{savedX:a,savedY:o,savedPageIndex:s}]of t)r(i,a,o,s)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(this.#p)for(const r of this.#p.keys())r.drag(t,e)}rebuild(t){if(t.parent===null){const e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#w.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#e===t}getActive(){return this.#e}getMode(){return this.#C}isEditingMode(){return this.#C!==Me.NONE}get imageManager(){return Oe(this,"imageManager",new cM)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let u=0,c=e.rangeCount;u<c;u++)if(!t.contains(e.getRangeAt(u).commonAncestorContainer))return null;const{x:r,y:i,width:a,height:o}=t.getBoundingClientRect();let s;switch(t.getAttribute("data-main-rotation")){case"90":s=(u,c,h,f)=>({x:(c-i)/o,y:1-(u+h-r)/a,width:f/o,height:h/a});break;case"180":s=(u,c,h,f)=>({x:1-(u+h-r)/a,y:1-(c+f-i)/o,width:h/a,height:f/o});break;case"270":s=(u,c,h,f)=>({x:1-(c+f-i)/o,y:(u-r)/a,width:f/o,height:h/a});break;default:s=(u,c,h,f)=>({x:(u-r)/a,y:(c-i)/o,width:h/a,height:f/o});break}const l=[];for(let u=0,c=e.rangeCount;u<c;u++){const h=e.getRangeAt(u);if(!h.collapsed)for(const{x:f,y:d,width:v,height:m}of h.getClientRects())v===0||m===0||l.push(s(f,d,v,m))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:t,id:e}){(this.#s||=new Map).set(t,e)}removeChangedExistingAnnotation({annotationElementId:t}){this.#s?.delete(t)}renderAnnotationElement(t){const e=this.#s?.get(t.data.id);if(!e)return;const r=this.#a.getRawValue(e);r&&(this.#C===Me.NONE&&!r.hasBeenModified||r.renderAnnotationElement(t))}setMissingCanvas(t,e,r){const i=this.#N?.get(t);i&&(i.setCanvas(e,r),this.#N.delete(t))}addMissingCanvas(t,e){(this.#N||=new Map).set(t,e)}}class Fo{#t=null;#e=!1;#n=null;#r=null;#o=null;#i=null;#a=!1;#s=null;#u=null;#l=null;#f=null;#h=!1;static#d=null;static _l10n=null;constructor(t){this.#u=t,this.#h=t._uiManager.useNewAltTextFlow,Fo.#d||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(t){Fo._l10n??=t}async render(){const t=this.#n=document.createElement("button");t.className="altText",t.tabIndex="0";const e=this.#r=document.createElement("span");t.append(e),this.#h?(t.classList.add("new"),t.setAttribute("data-l10n-id",Fo.#d.missing),e.setAttribute("data-l10n-id",Fo.#d["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const r=this.#u._uiManager._signal;t.addEventListener("contextmenu",sa,{signal:r}),t.addEventListener("pointerdown",a=>a.stopPropagation(),{signal:r});const i=a=>{a.preventDefault(),this.#u._uiManager.editAltText(this.#u),this.#h&&this.#u._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#g}})};return t.addEventListener("click",i,{capture:!0,signal:r}),t.addEventListener("keydown",a=>{a.target===t&&a.key==="Enter"&&(this.#a=!0,i(a))},{signal:r}),await this.#p(),t}get#g(){return this.#t&&"added"||this.#t===null&&this.guessedText&&"review"||"missing"}finish(){this.#n&&(this.#n.focus({focusVisible:this.#a}),this.#a=!1)}isEmpty(){return this.#h?this.#t===null:!this.#t&&!this.#e}hasData(){return this.#h?this.#t!==null||!!this.#l:this.isEmpty()}get guessedText(){return this.#l}async setGuessedText(t){this.#t===null&&(this.#l=t,this.#f=await Fo._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t}),this.#p())}toggleAltTextBadge(t=!1){if(!this.#h||this.#t){this.#s?.remove(),this.#s=null;return}if(!this.#s){const e=this.#s=document.createElement("div");e.className="noAltTextBadge",this.#u.div.append(e)}this.#s.classList.toggle("hidden",!t)}serialize(t){let e=this.#t;return!t&&this.#l===e&&(e=this.#f),{altText:e,decorative:this.#e,guessedText:this.#l,textWithDisclaimer:this.#f}}get data(){return{altText:this.#t,decorative:this.#e}}set data({altText:t,decorative:e,guessedText:r,textWithDisclaimer:i,cancel:a=!1}){r&&(this.#l=r,this.#f=i),!(this.#t===t&&this.#e===e)&&(a||(this.#t=t,this.#e=e),this.#p())}toggle(t=!1){this.#n&&(!t&&this.#i&&(clearTimeout(this.#i),this.#i=null),this.#n.disabled=!t)}shown(){this.#u._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#g}})}destroy(){this.#n?.remove(),this.#n=null,this.#r=null,this.#o=null,this.#s?.remove(),this.#s=null}async#p(){const t=this.#n;if(!t)return;if(this.#h){if(t.classList.toggle("done",!!this.#t),t.setAttribute("data-l10n-id",Fo.#d[this.#g]),this.#r?.setAttribute("data-l10n-id",Fo.#d[`${this.#g}-label`]),!this.#t){this.#o?.remove();return}}else{if(!this.#t&&!this.#e){t.classList.remove("done"),this.#o?.remove();return}t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let e=this.#o;if(!e){this.#o=e=document.createElement("span"),e.className="tooltip",e.setAttribute("role","tooltip"),e.id=`alt-text-tooltip-${this.#u.id}`;const i=100,a=this.#u._uiManager._signal;a.addEventListener("abort",()=>{clearTimeout(this.#i),this.#i=null},{once:!0}),t.addEventListener("mouseenter",()=>{this.#i=setTimeout(()=>{this.#i=null,this.#o.classList.add("show"),this.#u._reportTelemetry({action:"alt_text_tooltip"})},i)},{signal:a}),t.addEventListener("mouseleave",()=>{this.#i&&(clearTimeout(this.#i),this.#i=null),this.#o?.classList.remove("show")},{signal:a})}this.#e?e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(e.removeAttribute("data-l10n-id"),e.textContent=this.#t),e.parentNode||t.append(e),this.#u.getElementForAltText()?.setAttribute("aria-describedby",e.id)}}class Wm{#t=null;#e=null;#n=!1;#r=null;#o=null;#i=null;#a=null;#s=null;#u=!1;#l=null;constructor(t){this.#r=t}renderForToolbar(){const t=this.#e=document.createElement("button");return t.className="comment",this.#f(t,!1)}renderForStandalone(){const t=this.#t=document.createElement("button");t.className="annotationCommentButton";const e=this.#r.commentButtonPosition;if(e){const{style:r}=t;r.insetInlineEnd=`calc(${100*(this.#r._uiManager.direction==="ltr"?1-e[0]:e[0])}% - var(--comment-button-dim))`,r.top=`calc(${100*e[1]}% - var(--comment-button-dim))`;const i=this.#r.commentButtonColor;i&&(r.backgroundColor=i)}return this.#f(t,!0)}focusButton(){setTimeout(()=>{(this.#t??this.#e)?.focus()},0)}onUpdatedColor(){if(!this.#t)return;const t=this.#r.commentButtonColor;t&&(this.#t.style.backgroundColor=t),this.#r._uiManager.updatePopupColor(this.#r)}get commentButtonWidth(){return(this.#t?.getBoundingClientRect().width??0)/this.#r.parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(this.#l)return this.#l;if(!this.#t)return null;const{x:t,y:e,height:r}=this.#t.getBoundingClientRect(),{x:i,y:a,width:o,height:s}=this.#r.parent.boundingClientRect;return[(t-i)/o,(e+r-a)/s]}set commentPopupPositionInLayer(t){this.#l=t}hasDefaultPopupPosition(){return this.#l===null}removeStandaloneCommentButton(){this.#t?.remove(),this.#t=null}removeToolbarCommentButton(){this.#e?.remove(),this.#e=null}setCommentButtonStates({selected:t,hasPopup:e}){this.#t&&(this.#t.classList.toggle("selected",t),this.#t.ariaExpanded=e)}#f(t,e){if(!this.#r._uiManager.hasCommentManager())return null;t.tabIndex="0",t.ariaHasPopup="dialog",e?(t.ariaControls="commentPopup",t.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(t.ariaControlsElements=[this.#r._uiManager.getCommentDialogElement()],t.setAttribute("data-l10n-id","pdfjs-editor-edit-comment-button"));const r=this.#r._uiManager._signal;if(!(r instanceof AbortSignal)||r.aborted)return t;t.addEventListener("contextmenu",sa,{signal:r}),e&&(t.addEventListener("focusin",a=>{this.#r._focusEventsAllowed=!1,Or(a)},{capture:!0,signal:r}),t.addEventListener("focusout",a=>{this.#r._focusEventsAllowed=!0,Or(a)},{capture:!0,signal:r})),t.addEventListener("pointerdown",a=>a.stopPropagation(),{signal:r});const i=a=>{a.preventDefault(),t===this.#e?this.edit():this.#r.toggleComment(!0)};return t.addEventListener("click",i,{capture:!0,signal:r}),t.addEventListener("keydown",a=>{a.target===t&&a.key==="Enter"&&(this.#n=!0,i(a))},{signal:r}),t.addEventListener("pointerenter",()=>{this.#r.toggleComment(!1,!0)},{signal:r}),t.addEventListener("pointerleave",()=>{this.#r.toggleComment(!1,!1)},{signal:r}),t}edit(t){const e=this.commentPopupPositionInLayer;let r,i;if(e)[r,i]=e;else{[r,i]=this.#r.commentButtonPosition;const{width:c,height:h,x:f,y:d}=this.#r;r=f+r*c,i=d+i*h}const a=this.#r.parent.boundingClientRect,{x:o,y:s,width:l,height:u}=a;this.#r._uiManager.editComment(this.#r,o+r*l,s+i*u,{...t,parentDimensions:a})}finish(){this.#e&&(this.#e.focus({focusVisible:this.#n}),this.#n=!1)}isDeleted(){return this.#u||this.#a===""}isEmpty(){return this.#a===null}hasBeenEdited(){return this.isDeleted()||this.#a!==this.#o}serialize(){return this.data}get data(){return{text:this.#a,richText:this.#i,date:this.#s,deleted:this.isDeleted()}}set data(t){if(t!==this.#a&&(this.#i=null),t===null){this.#a="",this.#u=!0;return}this.#a=t,this.#s=new Date,this.#u=!1}setInitialText(t,e=null){this.#o=t,this.data=t,this.#s=null,this.#i=e}shown(){}destroy(){this.#e?.remove(),this.#e=null,this.#t?.remove(),this.#t=null,this.#a="",this.#i=null,this.#s=null,this.#r=null,this.#n=!1,this.#u=!1}}class dg{#t;#e=!1;#n=null;#r;#o;#i;#a;#s=null;#u;#l=null;#f;#h=null;constructor({container:t,isPinchingDisabled:e=null,isPinchingStopped:r=null,onPinchStart:i=null,onPinching:a=null,onPinchEnd:o=null,signal:s}){this.#t=t,this.#n=r,this.#r=e,this.#o=i,this.#i=a,this.#a=o,this.#f=new AbortController,this.#u=AbortSignal.any([s,this.#f.signal]),t.addEventListener("touchstart",this.#d.bind(this),{passive:!1,signal:this.#u})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/vo.pixelRatio}#d(t){if(this.#r?.())return;if(t.touches.length===1){if(this.#s)return;const i=this.#s=new AbortController,a=AbortSignal.any([this.#u,i.signal]),o=this.#t,s={capture:!0,signal:a,passive:!1},l=u=>{u.pointerType==="touch"&&(this.#s?.abort(),this.#s=null)};o.addEventListener("pointerdown",u=>{u.pointerType==="touch"&&(Or(u),l(u))},s),o.addEventListener("pointerup",l,s),o.addEventListener("pointercancel",l,s);return}if(!this.#h){this.#h=new AbortController;const i=AbortSignal.any([this.#u,this.#h.signal]),a=this.#t,o={signal:i,capture:!1,passive:!1};a.addEventListener("touchmove",this.#g.bind(this),o);const s=this.#p.bind(this);a.addEventListener("touchend",s,o),a.addEventListener("touchcancel",s,o),o.capture=!0,a.addEventListener("pointerdown",Or,o),a.addEventListener("pointermove",Or,o),a.addEventListener("pointercancel",Or,o),a.addEventListener("pointerup",Or,o),this.#o?.()}if(Or(t),t.touches.length!==2||this.#n?.()){this.#l=null;return}let[e,r]=t.touches;e.identifier>r.identifier&&([e,r]=[r,e]),this.#l={touch0X:e.screenX,touch0Y:e.screenY,touch1X:r.screenX,touch1Y:r.screenY}}#g(t){if(!this.#l||t.touches.length!==2)return;Or(t);let[e,r]=t.touches;e.identifier>r.identifier&&([e,r]=[r,e]);const{screenX:i,screenY:a}=e,{screenX:o,screenY:s}=r,l=this.#l,{touch0X:u,touch0Y:c,touch1X:h,touch1Y:f}=l,d=h-u,v=f-c,m=o-i,y=s-a,g=Math.hypot(m,y)||1,p=Math.hypot(d,v)||1;if(!this.#e&&Math.abs(p-g)<=dg.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=i,l.touch0Y=a,l.touch1X=o,l.touch1Y=s,!this.#e){this.#e=!0;return}const b=[(i+o)/2,(a+s)/2];this.#i?.(b,p,g)}#p(t){t.touches.length>=2||(this.#h&&(this.#h.abort(),this.#h=null,this.#a?.()),this.#l&&(Or(t),this.#l=null,this.#e=!1))}destroy(){this.#f?.abort(),this.#f=null,this.#s?.abort(),this.#s=null}}class he{#t=null;#e=null;#n=null;#r=null;#o=null;#i=!1;#a=null;#s="";#u=null;#l=null;#f=null;#h=null;#d=null;#g="";#p=!1;#c=null;#v=!1;#m=!1;#b=!1;#y=null;#T=0;#S=0;#_=null;#E=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#x=!1;#A=he._zIndex++;static _borderLineWidth=-1;static _colorManager=new hM;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const t=he.prototype._resizeWithKeyboard,e=zs.TRANSLATE_SMALL,r=zs.TRANSLATE_BIG;return Oe(this,"_resizerKeyboardManager",new fg([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-r,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[r,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-r]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,r]}],[["Escape","mac+Escape"],he.prototype._stopResizingWithKeyboard]]))}constructor(t){this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null,this.annotationElementId=t.annotationElementId||null,this.creationDate=t.creationDate||new Date,this.modificationDate=t.modificationDate||null;const{rotation:e,rawDims:{pageWidth:r,pageHeight:i,pageX:a,pageY:o}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,i],this.pageTranslation=[a,o];const[s,l]=this.parentDimensions;this.x=t.x/s,this.y=t.y/l,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return Oe(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new jnt({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e){if(he._l10n??=t,he._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),he._borderLineWidth!==-1)return;const r=getComputedStyle(document.documentElement);he._borderLineWidth=parseFloat(r.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){_r("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#x}set _isDraggable(t){this.#x=t,this.div?.classList.toggle("draggable",t)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(t*2),this.y+=this.width*t/(e*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(t*2),this.y-=this.width*t/(e*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#A}setParent(t){t!==null?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):(this.#O(),this.#h?.remove(),this.#h=null),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#p?this.#p=!1:this.parent.setSelected(this))}focusout(t){!this._focusEventsAllowed||!this.isAttachedToDOM||t.relatedTarget?.closest(`#${this.id}`)||(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,r,i){const[a,o]=this.parentDimensions;[r,i]=this.screenToPageTranslation(r,i),this.x=(t+r)/a,this.y=(e+i)/o,this.fixAndSetPosition()}_moveAfterPaste(t,e){const[r,i]=this.parentDimensions;this.setAt(t*r,e*i,this.width*r,this.height*i),this._onTranslated()}#k([t,e],r,i){[r,i]=this.screenToPageTranslation(r,i),this.x+=r/t,this.y+=i/e,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(t,e){this.#k(this.parentDimensions,t,e)}translateInPage(t,e){this.#c||=[this.x,this.y,this.width,this.height],this.#k(this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(t,e){this.#c||=[this.x,this.y,this.width,this.height];const{div:r,parentDimensions:[i,a]}=this;if(this.x+=t/i,this.y+=e/a,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:h,y:f}=this.div.getBoundingClientRect();this.parent.findNewParent(this,h,f)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:o,y:s}=this;const[l,u]=this.getBaseTranslation();o+=l,s+=u;const{style:c}=r;c.left=`${(100*o).toFixed(2)}%`,c.top=`${(100*s).toFixed(2)}%`,this._onTranslating(o,s),r.scrollIntoView({block:"nearest"})}_onTranslating(t,e){}_onTranslated(t,e){}get _hasBeenMoved(){return!!this.#c&&(this.#c[0]!==this.x||this.#c[1]!==this.y)}get _hasBeenResized(){return!!this.#c&&(this.#c[2]!==this.width||this.#c[3]!==this.height)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:r}=he,i=r/t,a=r/e;switch(this.rotation){case 90:return[-i,a];case 180:return[i,a];case 270:return[i,-a];default:return[-i,-a]}}get _mustFixPosition(){return!0}fixAndSetPosition(t=this.rotation){const{div:{style:e},pageDimensions:[r,i]}=this;let{x:a,y:o,width:s,height:l}=this;if(s*=r,l*=i,a*=r,o*=i,this._mustFixPosition)switch(t){case 0:a=Jn(a,0,r-s),o=Jn(o,0,i-l);break;case 90:a=Jn(a,0,r-l),o=Jn(o,s,i);break;case 180:a=Jn(a,s,r),o=Jn(o,l,i);break;case 270:a=Jn(a,l,r),o=Jn(o,0,i-s);break}this.x=a/=r,this.y=o/=i;const[u,c]=this.getBaseTranslation();a+=u,o+=c,e.left=`${(100*a).toFixed(2)}%`,e.top=`${(100*o).toFixed(2)}%`,this.moveInDOM()}static#M(t,e,r){switch(r){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}screenToPageTranslation(t,e){return he.#M(t,e,this.parentRotation)}pageTranslationToScreen(t,e){return he.#M(t,e,360-this.parentRotation)}#P(t){switch(t){case 90:{const[e,r]=this.pageDimensions;return[0,-e/r,r/e,0]}case 180:return[-1,0,0,-1];case 270:{const[e,r]=this.pageDimensions;return[0,e/r,-r/e,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,r]}=this;return[e*t,r*t]}setDims(){const{div:{style:t},width:e,height:r}=this;t.width=`${(100*e).toFixed(2)}%`,t.height=`${(100*r).toFixed(2)}%`}getInitialTranslation(){return[0,0]}#B(){if(this.#u)return;this.#u=document.createElement("div"),this.#u.classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const r of t){const i=document.createElement("div");this.#u.append(i),i.classList.add("resizer",r),i.setAttribute("data-resizer-name",r),i.addEventListener("pointerdown",this.#L.bind(this,r),{signal:e}),i.addEventListener("contextmenu",sa,{signal:e}),i.tabIndex=-1}this.div.prepend(this.#u)}#L(t,e){e.preventDefault();const{isMac:r}=In.platform;if(e.button!==0||e.ctrlKey&&r)return;this.#n?.toggle(!1);const i=this._isDraggable;this._isDraggable=!1,this.#l=[e.screenX,e.screenY];const a=new AbortController,o=this._uiManager.combinedSignal(a);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#N.bind(this,t),{passive:!0,capture:!0,signal:o}),window.addEventListener("touchmove",Or,{passive:!1,signal:o}),window.addEventListener("contextmenu",sa,{signal:o}),this.#f={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const s=this.parent.div.style.cursor,l=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const u=()=>{a.abort(),this.parent.togglePointerEvents(!0),this.#n?.toggle(!0),this._isDraggable=i,this.parent.div.style.cursor=s,this.div.style.cursor=l,this.#F()};window.addEventListener("pointerup",u,{signal:o}),window.addEventListener("blur",u,{signal:o})}#R(t,e,r,i){this.width=r,this.height=i,this.x=t,this.y=e,this.setDims(),this.fixAndSetPosition(),this._onResized()}_onResized(){}#F(){if(!this.#f)return;const{savedX:t,savedY:e,savedWidth:r,savedHeight:i}=this.#f;this.#f=null;const a=this.x,o=this.y,s=this.width,l=this.height;a===t&&o===e&&s===r&&l===i||this.addCommands({cmd:this.#R.bind(this,a,o,s,l),undo:this.#R.bind(this,t,e,r,i),mustExec:!0})}static _round(t){return Math.round(t*1e4)/1e4}#N(t,e){const[r,i]=this.parentDimensions,a=this.x,o=this.y,s=this.width,l=this.height,u=he.MIN_SIZE/r,c=he.MIN_SIZE/i,h=this.#P(this.rotation),f=(F,z)=>[h[0]*F+h[2]*z,h[1]*F+h[3]*z],d=this.#P(360-this.rotation),v=(F,z)=>[d[0]*F+d[2]*z,d[1]*F+d[3]*z];let m,y,g=!1,p=!1;switch(t){case"topLeft":g=!0,m=(F,z)=>[0,0],y=(F,z)=>[F,z];break;case"topMiddle":m=(F,z)=>[F/2,0],y=(F,z)=>[F/2,z];break;case"topRight":g=!0,m=(F,z)=>[F,0],y=(F,z)=>[0,z];break;case"middleRight":p=!0,m=(F,z)=>[F,z/2],y=(F,z)=>[0,z/2];break;case"bottomRight":g=!0,m=(F,z)=>[F,z],y=(F,z)=>[0,0];break;case"bottomMiddle":m=(F,z)=>[F/2,z],y=(F,z)=>[F/2,0];break;case"bottomLeft":g=!0,m=(F,z)=>[0,z],y=(F,z)=>[F,0];break;case"middleLeft":p=!0,m=(F,z)=>[0,z/2],y=(F,z)=>[F,z/2];break}const b=m(s,l),w=y(s,l);let x=f(...w);const A=he._round(a+x[0]),T=he._round(o+x[1]);let C=1,E=1,k,D;if(e.fromKeyboard)({deltaX:k,deltaY:D}=e);else{const{screenX:F,screenY:z}=e,[G,U]=this.#l;[k,D]=this.screenToPageTranslation(F-G,z-U),this.#l[0]=F,this.#l[1]=z}if([k,D]=v(k/r,D/i),g){const F=Math.hypot(s,l);C=E=Math.max(Math.min(Math.hypot(w[0]-b[0]-k,w[1]-b[1]-D)/F,1/s,1/l),u/s,c/l)}else p?C=Jn(Math.abs(w[0]-b[0]-k),u,1)/s:E=Jn(Math.abs(w[1]-b[1]-D),c,1)/l;const L=he._round(s*C),R=he._round(l*E);x=f(...y(L,R));const P=A-x[0],O=T-x[1];this.#c||=[this.x,this.y,this.width,this.height],this.width=L,this.height=R,this.x=P,this.y=O,this.setDims(),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#n?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#m)return this._editToolbar;this._editToolbar=new tv(this),this.div.append(this._editToolbar.render());const{toolbarButtons:t}=this;if(t)for(const[e,r]of t)await this._editToolbar.addButton(e,r);return this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton("comment")}removeEditToolbar(){this._editToolbar?.remove(),this._editToolbar=null,this.#n?.destroy()}addContainer(t){const e=this._editToolbar?.div;e?e.before(t):this.div.append(t)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return this.#n||(Fo.initialize(he._l10n),this.#n=new Fo(this),this.#t&&(this.#n.data=this.#t,this.#t=null)),this.#n}get altTextData(){return this.#n?.data}set altTextData(t){this.#n&&(this.#n.data=t)}get guessedAltText(){return this.#n?.guessedText}async setGuessedAltText(t){await this.#n?.setGuessedText(t)}serializeAltText(t){return this.#n?.serialize(t)}hasAltText(){return!!this.#n&&!this.#n.isEmpty()}hasAltTextData(){return this.#n?.hasData()??!1}focusCommentButton(){this.#r?.focusButton()}addCommentButton(){return this.#r||=new Wm(this)}addStandaloneCommentButton(){if(this.#o){this._uiManager.isEditingMode()&&this.#o.classList.remove("hidden");return}this.hasComment&&(this.#o=this.#r.renderForStandalone(),this.div.append(this.#o))}removeStandaloneCommentButton(){this.#r.removeStandaloneCommentButton(),this.#o=null}hideStandaloneCommentButton(){this.#o?.classList.add("hidden")}get comment(){const{data:{richText:t,text:e,date:r,deleted:i}}=this.#r;return{text:e,richText:t,date:r,deleted:i,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(t){this.#r||=new Wm(this),this.#r.data=t,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:t,popupRef:e,richText:r}){if(!e||(this.#r||=new Wm(this),this.#r.setInitialText(t,r),!this.annotationElementId))return;const i=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);i&&this.updateFromAnnotationLayer(i)}get hasEditedComment(){return this.#r?.hasBeenEdited()}get hasDeletedComment(){return this.#r?.isDeleted()}get hasComment(){return!!this.#r&&!this.#r.isEmpty()&&!this.#r.isDeleted()}async editComment(t){this.#r||=new Wm(this),this.#r.edit(t)}toggleComment(t,e=void 0){this.hasComment&&this._uiManager.toggleComment(this,t,e)}setSelectedCommentButton(t){this.#r.setSelectedButton(t)}addComment(t){if(this.hasEditedComment){const[,,,i]=t.rect,[a]=this.pageDimensions,[o]=this.pageTranslation,s=o+a+1,l=i-100,u=s+180;t.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[s,l,u,i]}}}updateFromAnnotationLayer({popup:{contents:t,deleted:e}}){this.#r.data=e?null:t}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){const t=this.div=document.createElement("div");t.setAttribute("data-editor-rotation",(360-this.rotation)%360),t.className=this.name,t.setAttribute("id",this.id),t.tabIndex=this.#i?-1:0,t.setAttribute("role","application"),this.defaultL10nId&&t.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||t.classList.add("hidden"),this.setInForeground(),this.#G();const[e,r]=this.parentDimensions;this.parentRotation%180!==0&&(t.style.maxWidth=`${(100*r/e).toFixed(2)}%`,t.style.maxHeight=`${(100*e/r).toFixed(2)}%`);const[i,a]=this.getInitialTranslation();return this.translate(i,a),TH(this,t,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#E||=new dg({container:t,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#W.bind(this),onPinching:this.#C.bind(this),onPinchEnd:this.#w.bind(this),signal:this._uiManager._signal})),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),t}#W(){this.#f={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#n?.toggle(!1),this.parent.togglePointerEvents(!1)}#C(t,e,r){let a=.7*(r/e)+1-.7;if(a===1)return;const o=this.#P(this.rotation),s=(A,T)=>[o[0]*A+o[2]*T,o[1]*A+o[3]*T],[l,u]=this.parentDimensions,c=this.x,h=this.y,f=this.width,d=this.height,v=he.MIN_SIZE/l,m=he.MIN_SIZE/u;a=Math.max(Math.min(a,1/f,1/d),v/f,m/d);const y=he._round(f*a),g=he._round(d*a);if(y===f&&g===d)return;this.#c||=[c,h,f,d];const p=s(f/2,d/2),b=he._round(c+p[0]),w=he._round(h+p[1]),x=s(y/2,g/2);this.x=b-x[0],this.y=w-x[1],this.width=y,this.height=g,this.setDims(),this.fixAndSetPosition(),this._onResizing()}#w(){this.#n?.toggle(!0),this.parent.togglePointerEvents(!0),this.#F()}pointerdown(t){const{isMac:e}=In.platform;if(t.button!==0||t.ctrlKey&&e){t.preventDefault();return}if(this.#p=!0,this._isDraggable){this.#V(t);return}this.#I(t)}#I(t){const{isMac:e}=In.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}#V(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();let r=!1;const i=new AbortController,a=this._uiManager.combinedSignal(i),o={capture:!0,passive:!1,signal:a},s=u=>{i.abort(),this.#a=null,this.#p=!1,this._uiManager.endDragSession()||this.#I(u),r&&this._onStopDragging()};e&&(this.#T=t.clientX,this.#S=t.clientY,this.#a=t.pointerId,this.#s=t.pointerType,window.addEventListener("pointermove",u=>{r||(r=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());const{clientX:c,clientY:h,pointerId:f}=u;if(f!==this.#a){Or(u);return}const[d,v]=this.screenToPageTranslation(c-this.#T,h-this.#S);this.#T=c,this.#S=h,this._uiManager.dragSelectedEditors(d,v)},o),window.addEventListener("touchmove",Or,o),window.addEventListener("pointerdown",u=>{u.pointerType===this.#s&&(this.#E||u.isPrimary)&&s(u),Or(u)},o));const l=u=>{if(!this.#a||this.#a===u.pointerId){s(u);return}Or(u)};window.addEventListener("pointerup",l,{signal:a}),window.addEventListener("blur",l,{signal:a})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.#y=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(t,e,r){t.changeParent(this),this.x=e,this.y=r,this.fixAndSetPosition(),this._onTranslated()}getRect(t,e,r=this.rotation){const i=this.parentScale,[a,o]=this.pageDimensions,[s,l]=this.pageTranslation,u=t/i,c=e/i,h=this.x*a,f=this.y*o,d=this.width*a,v=this.height*o;switch(r){case 0:return[h+u+s,o-f-c-v+l,h+u+d+s,o-f-c+l];case 90:return[h+c+s,o-f+u+l,h+c+v+s,o-f+u+d+l];case 180:return[h-u-d+s,o-f+c+l,h-u+s,o-f+c+v+l];case 270:return[h-c-v+s,o-f-u-d+l,h-c+s,o-f-u+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[r,i,a,o]=t,s=a-r,l=o-i;switch(this.rotation){case 0:return[r,e-o,s,l];case 90:return[r,e-i,l,s];case 180:return[a,e-i,s,l];case 270:return[a,e-o,l,s];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&he._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){this.#r?.onUpdatedColor()}getData(){const{comment:{text:t,color:e,date:r,opacity:i,deleted:a,richText:o},uid:s,pageIndex:l,creationDate:u,modificationDate:c}=this;return{id:s,pageIndex:l,rect:this.getPDFRect(),richText:o,contentsObj:{str:t},creationDate:u,modificationDate:r||c,popupRef:!a,color:e,opacity:i}}onceAdded(t){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),this.#m=!0,!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),this.#m=!1,!0):!1}isInEditMode(){return this.#m}shouldGetKeyboardEvents(){return this.#b}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:t,left:e,bottom:r,right:i}=this.getClientDimensions(),{innerHeight:a,innerWidth:o}=window;return e<o&&i>0&&t<a&&r>0}#G(){if(this.#d||!this.div)return;this.#d=new AbortController;const t=this._uiManager.combinedSignal(this.#d);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})}rebuild(){this.#G()}rotate(t){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(t=!1,e=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||""}}static async deserialize(t,e,r){const i=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:r,annotationElementId:t.annotationElementId,creationDate:t.creationDate,modificationDate:t.modificationDate});i.rotation=t.rotation,i.#t=t.accessibilityData,i._isCopy=t.isCopy||!1;const[a,o]=i.pageDimensions,[s,l,u,c]=i.getRectInCurrentCoords(t.rect,o);return i.x=s/a,i.y=l/o,i.width=u/a,i.height=c/o,i}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.#d?.abort(),this.#d=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#y&&(clearTimeout(this.#y),this.#y=null),this.#O(),this.removeEditToolbar(),this.#_){for(const t of this.#_.values())clearTimeout(t);this.#_=null}this.parent=null,this.#E?.destroy(),this.#E=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#B(),this.#u.classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction==="ltr"?[1,0]:[0,0]}get commentButtonPositionInPage(){const{commentButtonPosition:[t,e]}=this,[r,i,a,o]=this.getPDFRect();return[he._round(r+(a-r)*t),he._round(i+(o-i)*(1-e))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return this.#r.commentPopupPositionInLayer}set commentPopupPosition(t){this.#r.commentPopupPositionInLayer=t}hasDefaultPopupPosition(){return this.#r.hasDefaultPopupPosition()}get commentButtonWidth(){return this.#r.commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(t){this.#r.setCommentButtonStates(t)}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!=="Enter")return;this._uiManager.setSelected(this),this.#f={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const e=this.#u.children;if(!this.#e){this.#e=Array.from(e);const o=this.#X.bind(this),s=this.#j.bind(this),l=this._uiManager._signal;for(const u of this.#e){const c=u.getAttribute("data-resizer-name");u.setAttribute("role","spinbutton"),u.addEventListener("keydown",o,{signal:l}),u.addEventListener("blur",s,{signal:l}),u.addEventListener("focus",this.#Y.bind(this,c),{signal:l}),u.setAttribute("data-l10n-id",he._l10nResizer[c])}}const r=this.#e[0];let i=0;for(const o of e){if(o===r)break;i++}const a=(360-this.rotation+this.parentRotation)%360/90*(this.#e.length/4);if(a!==i){if(a<i)for(let s=0;s<i-a;s++)this.#u.append(this.#u.firstChild);else if(a>i)for(let s=0;s<a-i;s++)this.#u.firstChild.before(this.#u.lastChild);let o=0;for(const s of e){const u=this.#e[o++].getAttribute("data-resizer-name");s.setAttribute("data-l10n-id",he._l10nResizer[u])}}this.#H(0),this.#b=!0,this.#u.firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#X(t){he._resizerKeyboardManager.exec(this,t)}#j(t){this.#b&&t.relatedTarget?.parentNode!==this.#u&&this.#O()}#Y(t){this.#g=this.#b?t:""}#H(t){if(this.#e)for(const e of this.#e)e.tabIndex=t}_resizeWithKeyboard(t,e){this.#b&&this.#N(this.#g,{deltaX:t,deltaY:e,fromKeyboard:!0})}#O(){this.#b=!1,this.#H(-1),this.#F()}_stopResizingWithKeyboard(){this.#O(),this.div.focus()}select(){if(this.isSelected&&this._editToolbar){this._editToolbar.show();return}if(this.isSelected=!0,this.makeResizable(),this.div?.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()});return}this._editToolbar?.show(),this.#n?.toggleAltTextBadge(!1)}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){this.isSelected&&(this.isSelected=!1,this.#u?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#n?.toggleAltTextBadge(!0),this.hasComment&&this._uiManager.toggleComment(this,!1,!1))}updateParams(t,e){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(t){t.target.nodeName!=="BUTTON"&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.id}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#v}set isEditing(t){this.#v=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t,e=!1){if(e){this.#_||=new Map;const{action:r}=t;let i=this.#_.get(r);i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(t),this.#_.delete(r),this.#_.size===0&&(this.#_=null)},he._telemetryTimeout),this.#_.set(r,i);return}t.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(t=this._isVisible){this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),this.#i=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#i=!0}updateFakeAnnotationElement(t){if(!this.#h&&!this.deleted){this.#h=t.addFakeAnnotation(this);return}if(this.deleted){this.#h.remove(),this.#h=null;return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#h.updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;let e=t.container.querySelector(".annotationContent");if(!e)e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.container.prepend(e);else if(e.nodeName==="CANVAS"){const r=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),r.before(e)}return e}resetAnnotationElement(t){const{firstChild:e}=t.container;e?.nodeName==="DIV"&&e.classList.contains("annotationContent")&&e.remove()}}class jnt extends he{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const VI=3285377520,ma=4294901760,Eo=65535;class CH{constructor(t){this.h1=t?t&4294967295:VI,this.h2=t?t&4294967295:VI}update(t){let e,r;if(typeof t=="string"){e=new Uint8Array(t.length*2),r=0;for(let m=0,y=t.length;m<y;m++){const g=t.charCodeAt(m);g<=255?e[r++]=g:(e[r++]=g>>>8,e[r++]=g&255)}}else if(ArrayBuffer.isView(t))e=t.slice(),r=e.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const i=r>>2,a=r-i*4,o=new Uint32Array(e.buffer,0,i);let s=0,l=0,u=this.h1,c=this.h2;const h=3432918353,f=461845907,d=h&Eo,v=f&Eo;for(let m=0;m<i;m++)m&1?(s=o[m],s=s*h&ma|s*d&Eo,s=s<<15|s>>>17,s=s*f&ma|s*v&Eo,u^=s,u=u<<13|u>>>19,u=u*5+3864292196):(l=o[m],l=l*h&ma|l*d&Eo,l=l<<15|l>>>17,l=l*f&ma|l*v&Eo,c^=l,c=c<<13|c>>>19,c=c*5+3864292196);switch(s=0,a){case 3:s^=e[i*4+2]<<16;case 2:s^=e[i*4+1]<<8;case 1:s^=e[i*4],s=s*h&ma|s*d&Eo,s=s<<15|s>>>17,s=s*f&ma|s*v&Eo,i&1?u^=s:c^=s}this.h1=u,this.h2=c}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=t*3981806797&ma|t*36045&Eo,e=e*4283543511&ma|((e<<16|t>>>16)*2950163797&ma)>>>16,t^=e>>>1,t=t*444984403&ma|t*60499&Eo,e=e*3301882366&ma|((e<<16|t>>>16)*3120437893&ma)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const gT=Object.freeze({map:null,hash:"",transfer:void 0});class fM{#t=!1;#e=null;#n=null;#r=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const r=this.#r.get(t);return r===void 0?e:Object.assign(e,r)}getRawValue(t){return this.#r.get(t)}remove(t){const e=this.#r.get(t);if(e!==void 0&&(e instanceof he&&this.#n.delete(e.annotationElementId),this.#r.delete(t),this.#r.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function")){for(const r of this.#r.values())if(r instanceof he)return;this.onAnnotationEditor(null)}}setValue(t,e){const r=this.#r.get(t);let i=!1;if(r!==void 0)for(const[a,o]of Object.entries(e))r[a]!==o&&(i=!0,r[a]=o);else i=!0,this.#r.set(t,e);i&&this.#o(),e instanceof he&&((this.#n||=new Map).set(e.annotationElementId,e),typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(e.constructor._type))}has(t){return this.#r.has(t)}get size(){return this.#r.size}#o(){this.#t||(this.#t=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this.#t&&(this.#t=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new EH(this)}get serializable(){if(this.#r.size===0)return gT;const t=new Map,e=new CH,r=[],i=Object.create(null);let a=!1;for(const[o,s]of this.#r){const l=s instanceof he?s.serialize(!1,i):s;l&&(t.set(o,l),e.update(`${o}:${JSON.stringify(l)}`),a||=!!l.bitmap)}if(a)for(const o of t.values())o.bitmap&&r.push(o.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:r}:gT}get editorStats(){let t=null;const e=new Map;let r=0,i=0;for(const a of this.#r.values()){if(!(a instanceof he)){a.popup&&(a.popup.deleted?i+=1:r+=1);continue}a.isCommentDeleted?i+=1:a.hasEditedComment&&(r+=1);const o=a.telemetryFinalData;if(!o)continue;const{type:s}=o;e.has(s)||e.set(s,Object.getPrototypeOf(a).constructor),t||=Object.create(null);const l=t[s]||=new Map;for(const[u,c]of Object.entries(o)){if(u==="type")continue;let h=l.get(u);h||(h=new Map,l.set(u,h));const f=h.get(c)??0;h.set(c,f+1)}}if((i>0||r>0)&&(t||=Object.create(null),t.comments={deleted:i,edited:r}),!t)return null;for(const[a,o]of e)t[a]=o.computeTelemetryFinalData(t[a]);return t}resetModifiedIds(){this.#e=null}updateEditor(t,e){const r=this.#n?.get(t);return r?(r.updateFromAnnotationLayer(e),!0):!1}getEditor(t){return this.#n?.get(t)||null}get modifiedIds(){if(this.#e)return this.#e;const t=[];if(this.#n)for(const e of this.#n.values())e.serialize()&&t.push(e.annotationElementId);return this.#e={ids:new Set(t),hash:t.join(",")}}[Symbol.iterator](){return this.#r.entries()}}class EH extends fM{#t;constructor(t){super();const{map:e,hash:r,transfer:i}=t.serializable,a=structuredClone(e,i?{transfer:i}:null);this.#t={map:a,hash:r,transfer:i}}get print(){_r("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#t}get modifiedIds(){return Oe(this,"modifiedIds",{ids:new Set,hash:""})}}class Xnt{#t=new Set;constructor({ownerDocument:t=globalThis.document,styleElement:e=null}){this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#t.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:t,disableFontFace:e,_inspectFont:r}){if(!(!t||this.#t.has(t.loadedName))){if(Qe(!e,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:i,src:a,style:o}=t,s=new FontFace(i,a,o);this.addNativeFontFace(s);try{await s.load(),this.#t.add(i),r?.(t)}catch{Pe(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(s)}return}_r("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo){await this.loadSystemFont(t);return}if(this.isFontLoadingAPISupported){const r=t.createNativeFontFace();if(r){this.addNativeFontFace(r);try{await r.loaded}catch(i){throw Pe(`Failed to load font '${r.family}': '${i}'.`),t.disableFontFace=!0,i}}return}const e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise(r=>{const i=this._queueLoadingCallback(r);this._prepareFontLoadEvent(t,i)})}}get isFontLoadingAPISupported(){const t=!!this._document?.fonts;return Oe(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){return Oe(this,"isSyncFontLoadingSupported",ci||In.platform.isFirefox)}_queueLoadingCallback(t){function e(){for(Qe(!i.done,"completeRequest() cannot be called twice."),i.done=!0;r.length>0&&r[0].done;){const a=r.shift();setTimeout(a.callback,0)}}const{loadingRequests:r}=this,i={done:!1,complete:e,callback:t};return r.push(i),i}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return Oe(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){function r(w,x){return w.charCodeAt(x)<<24|w.charCodeAt(x+1)<<16|w.charCodeAt(x+2)<<8|w.charCodeAt(x+3)&255}function i(w,x,A,T){const C=w.substring(0,x),E=w.substring(x+A);return C+T+E}let a,o;const s=this._document.createElement("canvas");s.width=1,s.height=1;const l=s.getContext("2d");let u=0;function c(w,x){if(++u>30){Pe("Load test font never loaded."),x();return}if(l.font="30px "+w,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){x();return}setTimeout(c.bind(null,w,x))}const h=`lt${Date.now()}${this.loadTestFontId++}`;let f=this._loadTestFont;f=i(f,976,h.length,h);const v=16,m=1482184792;let y=r(f,v);for(a=0,o=h.length-3;a<o;a+=4)y=y-m+r(h,a)|0;a<h.length&&(y=y-m+r(h+"XXX",a)|0),f=i(f,v,4,Rnt(y));const g=`url(data:font/opentype;base64,${btoa(f)});`,p=`@font-face {font-family:"${h}";src:${g}}`;this.insertRule(p);const b=this._document.createElement("div");b.style.visibility="hidden",b.style.width=b.style.height="10px",b.style.position="absolute",b.style.top=b.style.left="0px";for(const w of[t.loadedName,h]){const x=this._document.createElement("span");x.textContent="Hi",x.style.fontFamily=w,b.append(x)}this._document.body.append(b),c(h,()=>{b.remove(),e.complete()})}}class Ynt{#t;constructor(t,e=null,r,i){this.compiledGlyphs=Object.create(null),this.#t=t,this._inspectFont=e,r&&Object.assign(this,r),i&&(this.charProcOperatorList=i)}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(!this.cssFontInfo)t=new FontFace(this.loadedName,this.data,{});else{const e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}return this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=`url(data:${this.mimetype};base64,${yH(this.data)});`;let e;if(!this.cssFontInfo)e=`@font-face {font-family:"${this.loadedName}";src:${t}}`;else{let r=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(r+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),e=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${r}src:${t}}`}return this._inspectFont?.(this,t),e}getPathGenerator(t,e){if(this.compiledGlyphs[e]!==void 0)return this.compiledGlyphs[e];const r=this.loadedName+"_path_"+e;let i;try{i=t.get(r)}catch(o){Pe(`getPathGenerator - ignoring character: "${o}".`)}const a=new Path2D(i||"");return this.fontExtraProperties||t.delete(r),this.compiledGlyphs[e]=a}get black(){return this.#t.black}get bold(){return this.#t.bold}get disableFontFace(){return this.#t.disableFontFace??!1}get fontExtraProperties(){return this.#t.fontExtraProperties??!1}get isInvalidPDFjsFont(){return this.#t.isInvalidPDFjsFont}get isType3Font(){return this.#t.isType3Font}get italic(){return this.#t.italic}get missingFile(){return this.#t.missingFile}get remeasure(){return this.#t.remeasure}get vertical(){return this.#t.vertical}get ascent(){return this.#t.ascent}get defaultWidth(){return this.#t.defaultWidth}get descent(){return this.#t.descent}get bbox(){return this.#t.bbox}get fontMatrix(){return this.#t.fontMatrix}get fallbackName(){return this.#t.fallbackName}get loadedName(){return this.#t.loadedName}get mimetype(){return this.#t.mimetype}get name(){return this.#t.name}get data(){return this.#t.data}clearData(){this.#t.clearData()}get cssFontInfo(){return this.#t.cssFontInfo}get systemFontInfo(){return this.#t.systemFontInfo}get defaultVMetrics(){return this.#t.defaultVMetrics}}function qnt(n){if(n instanceof URL)return n.href;if(typeof n=="string"){if(ci)return n;const t=URL.parse(n,window.location);if(t)return t.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function Znt(n){if(ci&&typeof Buffer<"u"&&n instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength)return n;if(typeof n=="string")return ug(n);if(n instanceof ArrayBuffer||ArrayBuffer.isView(n)||typeof n=="object"&&!isNaN(n?.length))return new Uint8Array(n);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function $m(n){if(typeof n!="string")return null;if(n.endsWith("/"))return n;throw new Error(`Invalid factory url: "${n}" must include trailing slash.`)}const mT=n=>typeof n=="object"&&Number.isInteger(n?.num)&&n.num>=0&&Number.isInteger(n?.gen)&&n.gen>=0,Knt=n=>typeof n=="object"&&typeof n?.name=="string",MH=Fnt.bind(null,mT,Knt);class Qnt{#t=new Map;#e=Promise.resolve();postMessage(t,e){const r={data:structuredClone(t,e?{transfer:e}:null)};this.#e.then(()=>{for(const[i]of this.#t)i.call(this,r)})}addEventListener(t,e,r=null){let i=null;if(r?.signal instanceof AbortSignal){const{signal:a}=r;if(a.aborted){Pe("LoopbackPort - cannot use an `aborted` signal.");return}const o=()=>this.removeEventListener(t,e);i=()=>a.removeEventListener("abort",o),a.addEventListener("abort",o)}this.#t.set(e,i)}removeEventListener(t,e){this.#t.get(e)?.(),this.#t.delete(e)}terminate(){for(const[,t]of this.#t)t?.();this.#t.clear()}}const jm={DATA:1,ERROR:2},ln={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function zI(){}function Fi(n){if(n instanceof Vs||n instanceof Y0||n instanceof LI||n instanceof Tv||n instanceof G1)return n;switch(n instanceof Error||typeof n=="object"&&n!==null||_r('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),n.name){case"AbortException":return new Vs(n.message);case"InvalidPDFException":return new Y0(n.message);case"PasswordException":return new LI(n.message,n.code);case"ResponseException":return new Tv(n.message,n.status,n.missing);case"UnknownErrorException":return new G1(n.message,n.details)}return new G1(n.message,n.toString())}class Rp{#t=new AbortController;constructor(t,e,r){this.sourceName=t,this.targetName=e,this.comObj=r,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),r.addEventListener("message",this.#e.bind(this),{signal:this.#t.signal})}#e({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream){this.#r(t);return}if(t.callback){const r=t.callbackId,i=this.callbackCapabilities[r];if(!i)throw new Error(`Cannot resolve callback ${r}`);if(delete this.callbackCapabilities[r],t.callback===jm.DATA)i.resolve(t.data);else if(t.callback===jm.ERROR)i.reject(Fi(t.reason));else throw new Error("Unexpected callback case");return}const e=this.actionHandler[t.action];if(!e)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const r=this.sourceName,i=t.sourceName,a=this.comObj;Promise.try(e,t.data).then(function(o){a.postMessage({sourceName:r,targetName:i,callback:jm.DATA,callbackId:t.callbackId,data:o})},function(o){a.postMessage({sourceName:r,targetName:i,callback:jm.ERROR,callbackId:t.callbackId,reason:Fi(o)})});return}if(t.streamId){this.#n(t);return}e(t.data)}on(t,e){const r=this.actionHandler;if(r[t])throw new Error(`There is already an actionName called "${t}"`);r[t]=e}send(t,e,r){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},r)}sendWithPromise(t,e,r){const i=this.callbackId++,a=Promise.withResolvers();this.callbackCapabilities[i]=a;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:i,data:e},r)}catch(o){a.reject(o)}return a.promise}sendWithStream(t,e,r,i){const a=this.streamId++,o=this.sourceName,s=this.targetName,l=this.comObj;return new ReadableStream({start:u=>{const c=Promise.withResolvers();return this.streamControllers[a]={controller:u,startCall:c,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:o,targetName:s,action:t,streamId:a,data:e,desiredSize:u.desiredSize},i),c.promise},pull:u=>{const c=Promise.withResolvers();return this.streamControllers[a].pullCall=c,l.postMessage({sourceName:o,targetName:s,stream:ln.PULL,streamId:a,desiredSize:u.desiredSize}),c.promise},cancel:u=>{Qe(u instanceof Error,"cancel must have a valid reason");const c=Promise.withResolvers();return this.streamControllers[a].cancelCall=c,this.streamControllers[a].isClosed=!0,l.postMessage({sourceName:o,targetName:s,stream:ln.CANCEL,streamId:a,reason:Fi(u)}),c.promise}},r)}#n(t){const e=t.streamId,r=this.sourceName,i=t.sourceName,a=this.comObj,o=this,s=this.actionHandler[t.action],l={enqueue(u,c=1,h){if(this.isCancelled)return;const f=this.desiredSize;this.desiredSize-=c,f>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),a.postMessage({sourceName:r,targetName:i,stream:ln.ENQUEUE,streamId:e,chunk:u},h)},close(){this.isCancelled||(this.isCancelled=!0,a.postMessage({sourceName:r,targetName:i,stream:ln.CLOSE,streamId:e}),delete o.streamSinks[e])},error(u){Qe(u instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,a.postMessage({sourceName:r,targetName:i,stream:ln.ERROR,streamId:e,reason:Fi(u)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};l.sinkCapability.resolve(),l.ready=l.sinkCapability.promise,this.streamSinks[e]=l,Promise.try(s,t.data,l).then(function(){a.postMessage({sourceName:r,targetName:i,stream:ln.START_COMPLETE,streamId:e,success:!0})},function(u){a.postMessage({sourceName:r,targetName:i,stream:ln.START_COMPLETE,streamId:e,reason:Fi(u)})})}#r(t){const e=t.streamId,r=this.sourceName,i=t.sourceName,a=this.comObj,o=this.streamControllers[e],s=this.streamSinks[e];switch(t.stream){case ln.START_COMPLETE:t.success?o.startCall.resolve():o.startCall.reject(Fi(t.reason));break;case ln.PULL_COMPLETE:t.success?o.pullCall.resolve():o.pullCall.reject(Fi(t.reason));break;case ln.PULL:if(!s){a.postMessage({sourceName:r,targetName:i,stream:ln.PULL_COMPLETE,streamId:e,success:!0});break}s.desiredSize<=0&&t.desiredSize>0&&s.sinkCapability.resolve(),s.desiredSize=t.desiredSize,Promise.try(s.onPull||zI).then(function(){a.postMessage({sourceName:r,targetName:i,stream:ln.PULL_COMPLETE,streamId:e,success:!0})},function(u){a.postMessage({sourceName:r,targetName:i,stream:ln.PULL_COMPLETE,streamId:e,reason:Fi(u)})});break;case ln.ENQUEUE:if(Qe(o,"enqueue should have stream controller"),o.isClosed)break;o.controller.enqueue(t.chunk);break;case ln.CLOSE:if(Qe(o,"close should have stream controller"),o.isClosed)break;o.isClosed=!0,o.controller.close(),this.#o(o,e);break;case ln.ERROR:Qe(o,"error should have stream controller"),o.controller.error(Fi(t.reason)),this.#o(o,e);break;case ln.CANCEL_COMPLETE:t.success?o.cancelCall.resolve():o.cancelCall.reject(Fi(t.reason)),this.#o(o,e);break;case ln.CANCEL:if(!s)break;const l=Fi(t.reason);Promise.try(s.onCancel||zI,l).then(function(){a.postMessage({sourceName:r,targetName:i,stream:ln.CANCEL_COMPLETE,streamId:e,success:!0})},function(u){a.postMessage({sourceName:r,targetName:i,stream:ln.CANCEL_COMPLETE,streamId:e,reason:Fi(u)})}),s.sinkCapability.reject(l),s.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async#o(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[e]}destroy(){this.#t?.abort(),this.#t=null}}class PH{#t=!1;constructor({enableHWA:t=!1}){this.#t=t}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const r=this._createCanvas(t,e);return{canvas:r,context:r.getContext("2d",{willReadFrequently:!this.#t})}}reset(t,e,r){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||r<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=r}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){_r("Abstract method `_createCanvas` called.")}}class Jnt extends PH{constructor({ownerDocument:t=globalThis.document,enableHWA:e=!1}){super({enableHWA:e}),this._document=t}_createCanvas(t,e){const r=this._document.createElement("canvas");return r.width=t,r.height=e,r}}class kH{constructor({baseUrl:t=null,isCompressed:e=!0}){this.baseUrl=t,this.isCompressed=e}async fetch({name:t}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!t)throw new Error("CMap name must be specified.");const e=this.baseUrl+t+(this.isCompressed?".bcmap":"");return this._fetch(e).then(r=>({cMapData:r,isCompressed:this.isCompressed})).catch(r=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${e}`)})}async _fetch(t){_r("Abstract method `_fetch` called.")}}class GI extends kH{async _fetch(t){const e=await $f(t,this.isCompressed?"arraybuffer":"text");return e instanceof ArrayBuffer?new Uint8Array(e):ug(e)}}class DH{addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,r,i,a){return"none"}destroy(t=!1){}}class tit extends DH{#t;#e;#n;#r;#o;#i;#a=0;constructor({docId:t,ownerDocument:e=globalThis.document}){super(),this.#r=t,this.#o=e}get#s(){return this.#e||=new Map}get#u(){return this.#i||=new Map}get#l(){if(!this.#n){const t=this.#o.createElement("div"),{style:e}=t;e.visibility="hidden",e.contain="strict",e.width=e.height=0,e.position="absolute",e.top=e.left=0,e.zIndex=-1;const r=this.#o.createElementNS(ws,"svg");r.setAttribute("width",0),r.setAttribute("height",0),this.#n=this.#o.createElementNS(ws,"defs"),t.append(r),r.append(this.#n),this.#o.body.append(t)}return this.#n}#f(t){if(t.length===1){const l=t[0],u=new Array(256);for(let h=0;h<256;h++)u[h]=l[h]/255;const c=u.join(",");return[c,c,c]}const[e,r,i]=t,a=new Array(256),o=new Array(256),s=new Array(256);for(let l=0;l<256;l++)a[l]=e[l]/255,o[l]=r[l]/255,s[l]=i[l]/255;return[a.join(","),o.join(","),s.join(",")]}#h(t){if(this.#t===void 0){this.#t="";const e=this.#o.URL;e!==this.#o.baseURI&&(hg(e)?Pe('#createUrl: ignore "data:"-URL for performance reasons.'):this.#t=aM(e,""))}return`url(${this.#t}#${t})`}addFilter(t){if(!t)return"none";let e=this.#s.get(t);if(e)return e;const[r,i,a]=this.#f(t),o=t.length===1?r:`${r}${i}${a}`;if(e=this.#s.get(o),e)return this.#s.set(t,e),e;const s=`g_${this.#r}_transfer_map_${this.#a++}`,l=this.#h(s);this.#s.set(t,l),this.#s.set(o,l);const u=this.#p(s);return this.#v(r,i,a,u),l}addHCMFilter(t,e){const r=`${t}-${e}`,i="base";let a=this.#u.get(i);if(a?.key===r||(a?(a.filter?.remove(),a.key=r,a.url="none",a.filter=null):(a={key:r,url:"none",filter:null},this.#u.set(i,a)),!t||!e))return a.url;const o=this.#b(t);t=Qt.makeHexColor(...o);const s=this.#b(e);if(e=Qt.makeHexColor(...s),this.#l.style.color="",t==="#000000"&&e==="#ffffff"||t===e)return a.url;const l=new Array(256);for(let d=0;d<=255;d++){const v=d/255;l[d]=v<=.03928?v/12.92:((v+.055)/1.055)**2.4}const u=l.join(","),c=`g_${this.#r}_hcm_filter`,h=a.filter=this.#p(c);this.#v(u,u,u,h),this.#g(h);const f=(d,v)=>{const m=o[d]/255,y=s[d]/255,g=new Array(v+1);for(let p=0;p<=v;p++)g[p]=m+p/v*(y-m);return g.join(",")};return this.#v(f(0,5),f(1,5),f(2,5),h),a.url=this.#h(c),a.url}addAlphaFilter(t){let e=this.#s.get(t);if(e)return e;const[r]=this.#f([t]),i=`alpha_${r}`;if(e=this.#s.get(i),e)return this.#s.set(t,e),e;const a=`g_${this.#r}_alpha_map_${this.#a++}`,o=this.#h(a);this.#s.set(t,o),this.#s.set(i,o);const s=this.#p(a);return this.#m(r,s),o}addLuminosityFilter(t){let e=this.#s.get(t||"luminosity");if(e)return e;let r,i;if(t?([r]=this.#f([t]),i=`luminosity_${r}`):i="luminosity",e=this.#s.get(i),e)return this.#s.set(t,e),e;const a=`g_${this.#r}_luminosity_map_${this.#a++}`,o=this.#h(a);this.#s.set(t,o),this.#s.set(i,o);const s=this.#p(a);return this.#d(s),t&&this.#m(r,s),o}addHighlightHCMFilter(t,e,r,i,a){const o=`${e}-${r}-${i}-${a}`;let s=this.#u.get(t);if(s?.key===o||(s?(s.filter?.remove(),s.key=o,s.url="none",s.filter=null):(s={key:o,url:"none",filter:null},this.#u.set(t,s)),!e||!r))return s.url;const[l,u]=[e,r].map(this.#b.bind(this));let c=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),h=Math.round(.2126*u[0]+.7152*u[1]+.0722*u[2]),[f,d]=[i,a].map(this.#b.bind(this));h<c&&([c,h,f,d]=[h,c,d,f]),this.#l.style.color="";const v=(g,p,b)=>{const w=new Array(256),x=(h-c)/b,A=g/255,T=(p-g)/(255*b);let C=0;for(let E=0;E<=b;E++){const k=Math.round(c+E*x),D=A+E*T;for(let L=C;L<=k;L++)w[L]=D;C=k+1}for(let E=C;E<256;E++)w[E]=w[C-1];return w.join(",")},m=`g_${this.#r}_hcm_${t}_filter`,y=s.filter=this.#p(m);return this.#g(y),this.#v(v(f[0],d[0],5),v(f[1],d[1],5),v(f[2],d[2],5),y),s.url=this.#h(m),s.url}destroy(t=!1){t&&this.#i?.size||(this.#n?.parentNode.parentNode.remove(),this.#n=null,this.#e?.clear(),this.#e=null,this.#i?.clear(),this.#i=null,this.#a=0)}#d(t){const e=this.#o.createElementNS(ws,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(e)}#g(t){const e=this.#o.createElementNS(ws,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(e)}#p(t){const e=this.#o.createElementNS(ws,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),this.#l.append(e),e}#c(t,e,r){const i=this.#o.createElementNS(ws,e);i.setAttribute("type","discrete"),i.setAttribute("tableValues",r),t.append(i)}#v(t,e,r,i){const a=this.#o.createElementNS(ws,"feComponentTransfer");i.append(a),this.#c(a,"feFuncR",t),this.#c(a,"feFuncG",e),this.#c(a,"feFuncB",r)}#m(t,e){const r=this.#o.createElementNS(ws,"feComponentTransfer");e.append(r),this.#c(r,"feFuncA",t)}#b(t){return this.#l.style.color=t,jf(getComputedStyle(this.#l).getPropertyValue("color"))}}class LH{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!t)throw new Error("Font filename must be specified.");const e=`${this.baseUrl}${t}`;return this._fetch(e).catch(r=>{throw new Error(`Unable to load font data at: ${e}`)})}async _fetch(t){_r("Abstract method `_fetch` called.")}}class HI extends LH{async _fetch(t){const e=await $f(t,"arraybuffer");return new Uint8Array(e)}}class IH{constructor({baseUrl:t=null}){this.baseUrl=t}async fetch({filename:t}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!t)throw new Error("Wasm filename must be specified.");const e=`${this.baseUrl}${t}`;return this._fetch(e).catch(r=>{throw new Error(`Unable to load wasm data at: ${e}`)})}async _fetch(t){_r("Abstract method `_fetch` called.")}}class UI extends IH{async _fetch(t){const e=await $f(t,"arraybuffer");return new Uint8Array(e)}}ci&&Pe("Please use the `legacy` build in Node.js environments.");async function dM(n){const e=await process.getBuiltinModule("fs").promises.readFile(n);return new Uint8Array(e)}class eit extends DH{}class rit extends PH{_createCanvas(t,e){return process.getBuiltinModule("module").createRequire(typeof document>"u"?require("url").pathToFileURL(__filename).href:A1&&A1.tagName.toUpperCase()==="SCRIPT"&&A1.src||new URL("doc-detail.cjs",document.baseURI).href)("@napi-rs/canvas").createCanvas(t,e)}}class nit extends kH{async _fetch(t){return dM(t)}}class iit extends LH{async _fetch(t){return dM(t)}}class ait extends IH{async _fetch(t){return dM(t)}}const ph="__forcedDependency",{floor:WI,ceil:$I}=Math;function Xm(n,t,e,r,i,a){n[t*4+0]=Math.min(n[t*4+0],e),n[t*4+1]=Math.min(n[t*4+1],r),n[t*4+2]=Math.max(n[t*4+2],i),n[t*4+3]=Math.max(n[t*4+3],a)}const yT=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];class oit{#t;#e;constructor(t,e){this.#t=t,this.#e=e}get length(){return this.#t.length}isEmpty(t){return this.#t[t]===yT}minX(t){return this.#e[t*4+0]/256}minY(t){return this.#e[t*4+1]/256}maxX(t){return(this.#e[t*4+2]+1)/256}maxY(t){return(this.#e[t*4+3]+1)/256}}const Ym=(n,t)=>{if(!n)return;let e=n.get(t);return e||(e={dependencies:new Set,isRenderingOperation:!1},n.set(t,e)),e};class sit{#t={__proto__:null};#e={__proto__:null,transform:[],moveText:[],sameLineText:[],[ph]:[]};#n=new Map;#r=[];#o=[];#i=[[1,0,0,1,0,0]];#a=[-1/0,-1/0,1/0,1/0];#s=new Float64Array([1/0,1/0,-1/0,-1/0]);#u=-1;#l=new Set;#f=new Map;#h=new Map;#d;#g;#p;#c;#v;constructor(t,e,r=!1){this.#d=t.width,this.#g=t.height,this.#m(e),r&&(this.#v=new Map)}growOperationsCount(t){t>=this.#c.length&&this.#m(t,this.#c)}#m(t,e){const r=new ArrayBuffer(t*4);this.#p=new Uint8ClampedArray(r),this.#c=new Uint32Array(r),e&&e.length>0?(this.#c.set(e),this.#c.fill(yT,e.length)):this.#c.fill(yT)}save(t){return this.#t={__proto__:this.#t},this.#e={__proto__:this.#e,transform:{__proto__:this.#e.transform},moveText:{__proto__:this.#e.moveText},sameLineText:{__proto__:this.#e.sameLineText},[ph]:{__proto__:this.#e[ph]}},this.#a={__proto__:this.#a},this.#r.push(t),this}restore(t){const e=Object.getPrototypeOf(this.#t);if(e===null)return this;this.#t=e,this.#e=Object.getPrototypeOf(this.#e),this.#a=Object.getPrototypeOf(this.#a);const r=this.#r.pop();return r!==void 0&&(Ym(this.#v,t)?.dependencies.add(r),this.#c[t]=this.#c[r]),this}recordOpenMarker(t){return this.#r.push(t),this}getOpenMarker(){return this.#r.length===0?null:this.#r.at(-1)}recordCloseMarker(t){const e=this.#r.pop();return e!==void 0&&(Ym(this.#v,t)?.dependencies.add(e),this.#c[t]=this.#c[e]),this}beginMarkedContent(t){return this.#o.push(t),this}endMarkedContent(t){const e=this.#o.pop();return e!==void 0&&(Ym(this.#v,t)?.dependencies.add(e),this.#c[t]=this.#c[e]),this}pushBaseTransform(t){return this.#i.push(Qt.multiplyByDOMMatrix(this.#i.at(-1),t.getTransform())),this}popBaseTransform(){return this.#i.length>1&&this.#i.pop(),this}recordSimpleData(t,e){return this.#t[t]=e,this}recordIncrementalData(t,e){return this.#e[t].push(e),this}resetIncrementalData(t,e){return this.#e[t].length=0,this}recordNamedData(t,e){return this.#n.set(t,e),this}recordSimpleDataFromNamed(t,e,r){this.#t[t]=this.#n.get(e)??r}recordFutureForcedDependency(t,e){return this.recordIncrementalData(ph,e),this}inheritSimpleDataAsFutureForcedDependencies(t){for(const e of t)e in this.#t&&this.recordFutureForcedDependency(e,this.#t[e]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const t of this.#l)this.recordFutureForcedDependency(ph,t);return this}resetBBox(t){return this.#u!==t&&(this.#u=t,this.#s[0]=1/0,this.#s[1]=1/0,this.#s[2]=-1/0,this.#s[3]=-1/0),this}recordClipBox(t,e,r,i,a,o){const s=Qt.multiplyByDOMMatrix(this.#i.at(-1),e.getTransform()),l=[1/0,1/0,-1/0,-1/0];Qt.axialAlignedBoundingBox([r,a,i,o],s,l);const u=Qt.intersect(this.#a,l);return u?(this.#a[0]=u[0],this.#a[1]=u[1],this.#a[2]=u[2],this.#a[3]=u[3]):(this.#a[0]=this.#a[1]=1/0,this.#a[2]=this.#a[3]=-1/0),this}recordBBox(t,e,r,i,a,o){const s=this.#a;if(s[0]===1/0)return this;const l=Qt.multiplyByDOMMatrix(this.#i.at(-1),e.getTransform());if(s[0]===-1/0)return Qt.axialAlignedBoundingBox([r,a,i,o],l,this.#s),this;const u=[1/0,1/0,-1/0,-1/0];return Qt.axialAlignedBoundingBox([r,a,i,o],l,u),this.#s[0]=Math.min(this.#s[0],Math.max(u[0],s[0])),this.#s[1]=Math.min(this.#s[1],Math.max(u[1],s[1])),this.#s[2]=Math.max(this.#s[2],Math.min(u[2],s[2])),this.#s[3]=Math.max(this.#s[3],Math.min(u[3],s[3])),this}recordCharacterBBox(t,e,r,i=1,a=0,o=0,s){const l=r.bbox;let u,c;if(l&&(u=l[2]!==l[0]&&l[3]!==l[1]&&this.#h.get(r),u!==!1&&(c=[0,0,0,0],Qt.axialAlignedBoundingBox(l,r.fontMatrix,c),(i!==1||a!==0||o!==0)&&Qt.scaleMinMax([i,0,0,-i,a,o],c),u)))return this.recordBBox(t,e,c[0],c[2],c[1],c[3]);if(!s)return this.recordFullPageBBox(t);const h=s();return l&&c&&u===void 0&&(u=c[0]<=a-h.actualBoundingBoxLeft&&c[2]>=a+h.actualBoundingBoxRight&&c[1]<=o-h.actualBoundingBoxAscent&&c[3]>=o+h.actualBoundingBoxDescent,this.#h.set(r,u),u)?this.recordBBox(t,e,c[0],c[2],c[1],c[3]):this.recordBBox(t,e,a-h.actualBoundingBoxLeft,a+h.actualBoundingBoxRight,o-h.actualBoundingBoxAscent,o+h.actualBoundingBoxDescent)}recordFullPageBBox(t){return this.#s[0]=Math.max(0,this.#a[0]),this.#s[1]=Math.max(0,this.#a[1]),this.#s[2]=Math.min(this.#d,this.#a[2]),this.#s[3]=Math.min(this.#g,this.#a[3]),this}getSimpleIndex(t){return this.#t[t]}recordDependencies(t,e){const r=this.#l,i=this.#t,a=this.#e;for(const o of e)o in this.#t?r.add(i[o]):o in a&&a[o].forEach(r.add,r);return this}recordNamedDependency(t,e){return this.#n.has(e)&&this.#l.add(this.#n.get(e)),this}recordOperation(t,e=!1){if(this.recordDependencies(t,[ph]),this.#v){const r=Ym(this.#v,t),{dependencies:i}=r;this.#l.forEach(i.add,i),this.#r.forEach(i.add,i),this.#o.forEach(i.add,i),i.delete(t),r.isRenderingOperation=!0}if(this.#u===t){const r=WI(this.#s[0]*256/this.#d),i=WI(this.#s[1]*256/this.#g),a=$I(this.#s[2]*256/this.#d),o=$I(this.#s[3]*256/this.#g);Xm(this.#p,t,r,i,a,o);for(const s of this.#l)s!==t&&Xm(this.#p,s,r,i,a,o);for(const s of this.#r)s!==t&&Xm(this.#p,s,r,i,a,o);for(const s of this.#o)s!==t&&Xm(this.#p,s,r,i,a,o);e||(this.#l.clear(),this.#u=-1)}return this}recordShowTextOperation(t,e=!1){const r=Array.from(this.#l);this.recordOperation(t,e),this.recordIncrementalData("sameLineText",t);for(const i of r)this.recordIncrementalData("sameLineText",i);return this}bboxToClipBoxDropOperation(t,e=!1){return this.#u===t&&(this.#u=-1,this.#a[0]=Math.max(this.#a[0],this.#s[0]),this.#a[1]=Math.max(this.#a[1],this.#s[1]),this.#a[2]=Math.min(this.#a[2],this.#s[2]),this.#a[3]=Math.min(this.#a[3],this.#s[3]),e||this.#l.clear()),this}_takePendingDependencies(){const t=this.#l;return this.#l=new Set,t}_extractOperation(t){const e=this.#f.get(t);return this.#f.delete(t),e}_pushPendingDependencies(t){for(const e of t)this.#l.add(e)}take(){return this.#h.clear(),new oit(this.#c,this.#p)}takeDebugMetadata(){return this.#v}}class K0{#t;#e;#n;#r=0;#o=0;constructor(t,e,r){if(t instanceof K0&&t.#n===!!r)return t;this.#t=t,this.#e=e,this.#n=!!r}growOperationsCount(){throw new Error("Unreachable")}save(t){return this.#o++,this.#t.save(this.#e),this}restore(t){return this.#o>0&&(this.#t.restore(this.#e),this.#o--),this}recordOpenMarker(t){return this.#r++,this}getOpenMarker(){return this.#r>0?this.#e:this.#t.getOpenMarker()}recordCloseMarker(t){return this.#r--,this}beginMarkedContent(t){return this}endMarkedContent(t){return this}pushBaseTransform(t){return this.#t.pushBaseTransform(t),this}popBaseTransform(){return this.#t.popBaseTransform(),this}recordSimpleData(t,e){return this.#t.recordSimpleData(t,this.#e),this}recordIncrementalData(t,e){return this.#t.recordIncrementalData(t,this.#e),this}resetIncrementalData(t,e){return this.#t.resetIncrementalData(t,this.#e),this}recordNamedData(t,e){return this}recordSimpleDataFromNamed(t,e,r){return this.#t.recordSimpleDataFromNamed(t,e,this.#e),this}recordFutureForcedDependency(t,e){return this.#t.recordFutureForcedDependency(t,this.#e),this}inheritSimpleDataAsFutureForcedDependencies(t){return this.#t.inheritSimpleDataAsFutureForcedDependencies(t),this}inheritPendingDependenciesAsFutureForcedDependencies(){return this.#t.inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(t){return this.#n||this.#t.resetBBox(this.#e),this}recordClipBox(t,e,r,i,a,o){return this.#n||this.#t.recordClipBox(this.#e,e,r,i,a,o),this}recordBBox(t,e,r,i,a,o){return this.#n||this.#t.recordBBox(this.#e,e,r,i,a,o),this}recordCharacterBBox(t,e,r,i,a,o,s){return this.#n||this.#t.recordCharacterBBox(this.#e,e,r,i,a,o,s),this}recordFullPageBBox(t){return this.#n||this.#t.recordFullPageBBox(this.#e),this}getSimpleIndex(t){return this.#t.getSimpleIndex(t)}recordDependencies(t,e){return this.#t.recordDependencies(this.#e,e),this}recordNamedDependency(t,e){return this.#t.recordNamedDependency(this.#e,e),this}recordOperation(t){return this.#t.recordOperation(this.#e,!0),this}recordShowTextOperation(t){return this.#t.recordShowTextOperation(this.#e,!0),this}bboxToClipBoxDropOperation(t){return this.#n||this.#t.bboxToClipBoxDropOperation(this.#e,!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}}const ya={stroke:["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],fill:["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],imageXObject:["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],rawFillPath:["filter","fillColor","fillAlpha"],showText:["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],transform:["transform"],transformAndFill:["transform","fillColor"]},Gn={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function bT(n,t){if(!t)return;const e=t[2]-t[0],r=t[3]-t[1],i=new Path2D;i.rect(t[0],t[1],e,r),n.clip(i)}class pM{isModifyingCurrentTransform(){return!1}getPattern(){_r("Abstract method `getPattern` called.")}}class lit extends pM{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;this._type==="axial"?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const r of this._colorStops)e.addColorStop(r[0],r[1]);return e}getPattern(t,e,r,i){let a;if(i===Gn.STROKE||i===Gn.FILL){const o=e.current.getClippedPathBoundingBox(i,Rr(t))||[0,0,0,0],s=Math.ceil(o[2]-o[0])||1,l=Math.ceil(o[3]-o[1])||1,u=e.cachedCanvases.getCanvas("pattern",s,l),c=u.context;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.beginPath(),c.rect(0,0,c.canvas.width,c.canvas.height),c.translate(-o[0],-o[1]),r=Qt.transform(r,[1,0,0,1,o[0],o[1]]),c.transform(...e.baseTransform),this.matrix&&c.transform(...this.matrix),bT(c,this._bbox),c.fillStyle=this._createGradient(c),c.fill(),a=t.createPattern(u.canvas,"no-repeat");const h=new DOMMatrix(r);a.setTransform(h)}else bT(t,this._bbox),a=this._createGradient(t);return a}}function W1(n,t,e,r,i,a,o,s){const l=t.coords,u=t.colors,c=n.data,h=n.width*4;let f;l[e+1]>l[r+1]&&(f=e,e=r,r=f,f=a,a=o,o=f),l[r+1]>l[i+1]&&(f=r,r=i,i=f,f=o,o=s,s=f),l[e+1]>l[r+1]&&(f=e,e=r,r=f,f=a,a=o,o=f);const d=(l[e]+t.offsetX)*t.scaleX,v=(l[e+1]+t.offsetY)*t.scaleY,m=(l[r]+t.offsetX)*t.scaleX,y=(l[r+1]+t.offsetY)*t.scaleY,g=(l[i]+t.offsetX)*t.scaleX,p=(l[i+1]+t.offsetY)*t.scaleY;if(v>=p)return;const b=u[a],w=u[a+1],x=u[a+2],A=u[o],T=u[o+1],C=u[o+2],E=u[s],k=u[s+1],D=u[s+2],L=Math.round(v),R=Math.round(p);let P,O,F,z,G,U,K,W;for(let X=L;X<=R;X++){if(X<y){const Mt=X<v?0:(v-X)/(v-y);P=d-(d-m)*Mt,O=b-(b-A)*Mt,F=w-(w-T)*Mt,z=x-(x-C)*Mt}else{let Mt;X>p?Mt=1:y===p?Mt=0:Mt=(y-X)/(y-p),P=m-(m-g)*Mt,O=A-(A-E)*Mt,F=T-(T-k)*Mt,z=C-(C-D)*Mt}let Q;X<v?Q=0:X>p?Q=1:Q=(v-X)/(v-p),G=d-(d-g)*Q,U=b-(b-E)*Q,K=w-(w-k)*Q,W=x-(x-D)*Q;const at=Math.round(Math.min(P,G)),rt=Math.round(Math.max(P,G));let Rt=h*X+at*4;for(let Mt=at;Mt<=rt;Mt++)Q=(P-Mt)/(P-G),Q<0?Q=0:Q>1&&(Q=1),c[Rt++]=O-(O-U)*Q|0,c[Rt++]=F-(F-K)*Q|0,c[Rt++]=z-(z-W)*Q|0,c[Rt++]=255}}function uit(n,t,e){const r=t.coords,i=t.colors;let a,o;switch(t.type){case"lattice":const s=t.verticesPerRow,l=Math.floor(r.length/s)-1,u=s-1;for(a=0;a<l;a++){let c=a*s;for(let h=0;h<u;h++,c++)W1(n,e,r[c],r[c+1],r[c+s],i[c],i[c+1],i[c+s]),W1(n,e,r[c+s+1],r[c+1],r[c+s],i[c+s+1],i[c+1],i[c+s])}break;case"triangles":for(a=0,o=r.length;a<o;a+=3)W1(n,e,r[a],r[a+1],r[a+2],i[a],i[a+1],i[a+2]);break;default:throw new Error("illegal figure")}}class cit extends pM{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[6],this._background=t[7],this.matrix=null}_createMeshCanvas(t,e,r){const s=Math.floor(this._bounds[0]),l=Math.floor(this._bounds[1]),u=Math.ceil(this._bounds[2])-s,c=Math.ceil(this._bounds[3])-l,h=Math.min(Math.ceil(Math.abs(u*t[0]*1.1)),3e3),f=Math.min(Math.ceil(Math.abs(c*t[1]*1.1)),3e3),d=u/h,v=c/f,m={coords:this._coords,colors:this._colors,offsetX:-s,offsetY:-l,scaleX:1/d,scaleY:1/v},y=h+4,g=f+4,p=r.getCanvas("mesh",y,g),b=p.context,w=b.createImageData(h,f);if(e){const A=w.data;for(let T=0,C=A.length;T<C;T+=4)A[T]=e[0],A[T+1]=e[1],A[T+2]=e[2],A[T+3]=255}for(const A of this._figures)uit(w,A,m);return b.putImageData(w,2,2),{canvas:p.canvas,offsetX:s-2*d,offsetY:l-2*v,scaleX:d,scaleY:v}}isModifyingCurrentTransform(){return!0}getPattern(t,e,r,i){bT(t,this._bbox);const a=new Float32Array(2);if(i===Gn.SHADING)Qt.singularValueDecompose2dScale(Rr(t),a);else if(this.matrix){Qt.singularValueDecompose2dScale(this.matrix,a);const[s,l]=a;Qt.singularValueDecompose2dScale(e.baseTransform,a),a[0]*=s,a[1]*=l}else Qt.singularValueDecompose2dScale(e.baseTransform,a);const o=this._createMeshCanvas(a,i===Gn.SHADING?null:this._background,e.cachedCanvases);return i!==Gn.SHADING&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(o.offsetX,o.offsetY),t.scale(o.scaleX,o.scaleY),t.createPattern(o.canvas,"no-repeat")}}class hit extends pM{getPattern(){return"hotpink"}}function fit(n){switch(n[0]){case"RadialAxial":return new lit(n);case"Mesh":return new cit(n);case"Dummy":return new hit}throw new Error(`Unknown IR type: ${n[0]}`)}const jI={COLORED:1,UNCOLORED:2};class vM{static MAX_PATTERN_SIZE=3e3;constructor(t,e,r,i){this.color=t[1],this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.ctx=e,this.canvasGraphicsFactory=r,this.baseTransform=i}createPatternCanvas(t,e){const{bbox:r,operatorList:i,paintType:a,tilingType:o,color:s,canvasGraphicsFactory:l}=this;let{xstep:u,ystep:c}=this;u=Math.abs(u),c=Math.abs(c),c_("TilingType: "+o);const h=r[0],f=r[1],d=r[2],v=r[3],m=d-h,y=v-f,g=new Float32Array(2);Qt.singularValueDecompose2dScale(this.matrix,g);const[p,b]=g;Qt.singularValueDecompose2dScale(this.baseTransform,g);const w=p*g[0],x=b*g[1];let A=m,T=y,C=!1,E=!1;const k=Math.ceil(u*w),D=Math.ceil(c*x),L=Math.ceil(m*w),R=Math.ceil(y*x);k>=L?A=u:C=!0,D>=R?T=c:E=!0;const P=this.getSizeAndScale(A,this.ctx.canvas.width,w),O=this.getSizeAndScale(T,this.ctx.canvas.height,x),F=t.cachedCanvases.getCanvas("pattern",P.size,O.size),z=F.context,G=l.createCanvasGraphics(z,e);if(G.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(G,a,s),z.translate(-P.scale*h,-O.scale*f),G.transform(0,P.scale,0,0,O.scale,0,0),z.save(),G.dependencyTracker?.save(),this.clipBbox(G,h,f,d,v),G.baseTransform=Rr(G.ctx),G.executeOperatorList(i),G.endDrawing(),G.dependencyTracker?.restore(),z.restore(),C||E){const U=F.canvas;C&&(A=u),E&&(T=c);const K=this.getSizeAndScale(A,this.ctx.canvas.width,w),W=this.getSizeAndScale(T,this.ctx.canvas.height,x),X=K.size,Q=W.size,at=t.cachedCanvases.getCanvas("pattern-workaround",X,Q),rt=at.context,Rt=C?Math.floor(m/u):0,Mt=E?Math.floor(y/c):0;for(let xt=0;xt<=Rt;xt++)for(let vt=0;vt<=Mt;vt++)rt.drawImage(U,X*xt,Q*vt,X,Q,0,0,X,Q);return{canvas:at.canvas,scaleX:K.scale,scaleY:W.scale,offsetX:h,offsetY:f}}return{canvas:F.canvas,scaleX:P.scale,scaleY:O.scale,offsetX:h,offsetY:f}}getSizeAndScale(t,e,r){const i=Math.max(vM.MAX_PATTERN_SIZE,e);let a=Math.ceil(t*r);return a>=i?a=i:r=a/t,{scale:r,size:a}}clipBbox(t,e,r,i,a){const o=i-e,s=a-r;t.ctx.rect(e,r,o,s),Qt.axialAlignedBoundingBox([e,r,i,a],Rr(t.ctx),t.current.minMax),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,r){const i=t.ctx,a=t.current;switch(e){case jI.COLORED:const{fillStyle:o,strokeStyle:s}=this.ctx;i.fillStyle=a.fillColor=o,i.strokeStyle=a.strokeColor=s;break;case jI.UNCOLORED:i.fillStyle=i.strokeStyle=r,a.fillColor=a.strokeColor=r;break;default:throw new Int(`Unsupported paint type: ${e}`)}}isModifyingCurrentTransform(){return!1}getPattern(t,e,r,i,a){let o=r;i!==Gn.SHADING&&(o=Qt.transform(o,e.baseTransform),this.matrix&&(o=Qt.transform(o,this.matrix)));const s=this.createPatternCanvas(e,a);let l=new DOMMatrix(o);l=l.translate(s.offsetX,s.offsetY),l=l.scale(1/s.scaleX,1/s.scaleY);const u=t.createPattern(s.canvas,"repeat");return u.setTransform(l),u}}function dit({src:n,srcPos:t=0,dest:e,width:r,height:i,nonBlackColor:a=4294967295,inverseDecode:o=!1}){const s=In.isLittleEndian?4278190080:255,[l,u]=o?[a,s]:[s,a],c=r>>3,h=r&7,f=n.length;e=new Uint32Array(e.buffer);let d=0;for(let v=0;v<i;v++){for(const y=t+c;t<y;t++){const g=t<f?n[t]:255;e[d++]=g&128?u:l,e[d++]=g&64?u:l,e[d++]=g&32?u:l,e[d++]=g&16?u:l,e[d++]=g&8?u:l,e[d++]=g&4?u:l,e[d++]=g&2?u:l,e[d++]=g&1?u:l}if(h===0)continue;const m=t<f?n[t++]:255;for(let y=0;y<h;y++)e[d++]=m&1<<7-y?u:l}return{srcPos:t,destPos:d}}const XI=16,YI=100,pit=15,qI=10,Vi=16,$1=new DOMMatrix,ea=new Float32Array(2),nf=new Float32Array([1/0,1/0,-1/0,-1/0]);function vit(n,t){if(n._removeMirroring)throw new Error("Context is already forwarding operations.");n.__originalSave=n.save,n.__originalRestore=n.restore,n.__originalRotate=n.rotate,n.__originalScale=n.scale,n.__originalTranslate=n.translate,n.__originalTransform=n.transform,n.__originalSetTransform=n.setTransform,n.__originalResetTransform=n.resetTransform,n.__originalClip=n.clip,n.__originalMoveTo=n.moveTo,n.__originalLineTo=n.lineTo,n.__originalBezierCurveTo=n.bezierCurveTo,n.__originalRect=n.rect,n.__originalClosePath=n.closePath,n.__originalBeginPath=n.beginPath,n._removeMirroring=()=>{n.save=n.__originalSave,n.restore=n.__originalRestore,n.rotate=n.__originalRotate,n.scale=n.__originalScale,n.translate=n.__originalTranslate,n.transform=n.__originalTransform,n.setTransform=n.__originalSetTransform,n.resetTransform=n.__originalResetTransform,n.clip=n.__originalClip,n.moveTo=n.__originalMoveTo,n.lineTo=n.__originalLineTo,n.bezierCurveTo=n.__originalBezierCurveTo,n.rect=n.__originalRect,n.closePath=n.__originalClosePath,n.beginPath=n.__originalBeginPath,delete n._removeMirroring},n.save=function(){t.save(),this.__originalSave()},n.restore=function(){t.restore(),this.__originalRestore()},n.translate=function(e,r){t.translate(e,r),this.__originalTranslate(e,r)},n.scale=function(e,r){t.scale(e,r),this.__originalScale(e,r)},n.transform=function(e,r,i,a,o,s){t.transform(e,r,i,a,o,s),this.__originalTransform(e,r,i,a,o,s)},n.setTransform=function(e,r,i,a,o,s){t.setTransform(e,r,i,a,o,s),this.__originalSetTransform(e,r,i,a,o,s)},n.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},n.rotate=function(e){t.rotate(e),this.__originalRotate(e)},n.clip=function(e){t.clip(e),this.__originalClip(e)},n.moveTo=function(e,r){t.moveTo(e,r),this.__originalMoveTo(e,r)},n.lineTo=function(e,r){t.lineTo(e,r),this.__originalLineTo(e,r)},n.bezierCurveTo=function(e,r,i,a,o,s){t.bezierCurveTo(e,r,i,a,o,s),this.__originalBezierCurveTo(e,r,i,a,o,s)},n.rect=function(e,r,i,a){t.rect(e,r,i,a),this.__originalRect(e,r,i,a)},n.closePath=function(){t.closePath(),this.__originalClosePath()},n.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}class git{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,r){let i;return this.cache[t]!==void 0?(i=this.cache[t],this.canvasFactory.reset(i,e,r)):(i=this.canvasFactory.create(e,r),this.cache[t]=i),i}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function qm(n,t,e,r,i,a,o,s,l,u){const[c,h,f,d,v,m]=Rr(n);if(h===0&&f===0){const p=o*c+v,b=Math.round(p),w=s*d+m,x=Math.round(w),A=(o+l)*c+v,T=Math.abs(Math.round(A)-b)||1,C=(s+u)*d+m,E=Math.abs(Math.round(C)-x)||1;return n.setTransform(Math.sign(c),0,0,Math.sign(d),b,x),n.drawImage(t,e,r,i,a,0,0,T,E),n.setTransform(c,h,f,d,v,m),[T,E]}if(c===0&&d===0){const p=s*f+v,b=Math.round(p),w=o*h+m,x=Math.round(w),A=(s+u)*f+v,T=Math.abs(Math.round(A)-b)||1,C=(o+l)*h+m,E=Math.abs(Math.round(C)-x)||1;return n.setTransform(0,Math.sign(h),Math.sign(f),0,b,x),n.drawImage(t,e,r,i,a,0,0,E,T),n.setTransform(c,h,f,d,v,m),[E,T]}n.drawImage(t,e,r,i,a,o,s,l,u);const y=Math.hypot(c,h),g=Math.hypot(f,d);return[y*l,g*u]}class ZI{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=pT;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=Bn.FILL;textRise=0;fillColor="#000000";strokeColor="#000000";patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps="none";constructor(t,e,r){r?.(this),this.clipBox=new Float32Array([0,0,t,e]),this.minMax=nf.slice()}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t.minMax=this.minMax.slice(),t}getPathBoundingBox(t=Gn.FILL,e=null){const r=this.minMax.slice();if(t===Gn.STROKE){e||_r("Stroke bounding box must include transform."),Qt.singularValueDecompose2dScale(e,ea);const i=ea[0]*this.lineWidth/2,a=ea[1]*this.lineWidth/2;r[0]-=i,r[1]-=a,r[2]+=i,r[3]+=a}return r}updateClipFromPath(){const t=Qt.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(t){this.clipBox.set(t,0),this.minMax.set(nf,0)}getClippedPathBoundingBox(t=Gn.FILL,e=null){return Qt.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function KI(n,t){if(t instanceof ImageData){n.putImageData(t,0,0);return}const e=t.height,r=t.width,i=e%Vi,a=(e-i)/Vi,o=i===0?a:a+1,s=n.createImageData(r,Vi);let l=0,u;const c=t.data,h=s.data;let f,d,v,m;if(t.kind===Jp.GRAYSCALE_1BPP){const y=c.byteLength,g=new Uint32Array(h.buffer,0,h.byteLength>>2),p=g.length,b=r+7>>3,w=4294967295,x=In.isLittleEndian?4278190080:255;for(f=0;f<o;f++){for(v=f<a?Vi:i,u=0,d=0;d<v;d++){const A=y-l;let T=0;const C=A>b?r:A*8-7,E=C&-8;let k=0,D=0;for(;T<E;T+=8)D=c[l++],g[u++]=D&128?w:x,g[u++]=D&64?w:x,g[u++]=D&32?w:x,g[u++]=D&16?w:x,g[u++]=D&8?w:x,g[u++]=D&4?w:x,g[u++]=D&2?w:x,g[u++]=D&1?w:x;for(;T<C;T++)k===0&&(D=c[l++],k=128),g[u++]=D&k?w:x,k>>=1}for(;u<p;)g[u++]=0;n.putImageData(s,0,f*Vi)}}else if(t.kind===Jp.RGBA_32BPP){for(d=0,m=r*Vi*4,f=0;f<a;f++)h.set(c.subarray(l,l+m)),l+=m,n.putImageData(s,0,d),d+=Vi;f<o&&(m=r*i*4,h.set(c.subarray(l,l+m)),n.putImageData(s,0,d))}else if(t.kind===Jp.RGB_24BPP)for(v=Vi,m=r*v,f=0;f<o;f++){for(f>=a&&(v=i,m=r*v),u=0,d=m;d--;)h[u++]=c[l++],h[u++]=c[l++],h[u++]=c[l++],h[u++]=255;n.putImageData(s,0,f*Vi)}else throw new Error(`bad image kind: ${t.kind}`)}function QI(n,t){if(t.bitmap){n.drawImage(t.bitmap,0,0);return}const e=t.height,r=t.width,i=e%Vi,a=(e-i)/Vi,o=i===0?a:a+1,s=n.createImageData(r,Vi);let l=0;const u=t.data,c=s.data;for(let h=0;h<o;h++){const f=h<a?Vi:i;({srcPos:l}=dit({src:u,srcPos:l,dest:c,width:r,height:f,nonBlackColor:0})),n.putImageData(s,0,h*Vi)}}function Rd(n,t){const e=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const r of e)n[r]!==void 0&&(t[r]=n[r]);n.setLineDash!==void 0&&(t.setLineDash(n.getLineDash()),t.lineDashOffset=n.lineDashOffset)}function Zm(n){n.strokeStyle=n.fillStyle="#000000",n.fillRule="nonzero",n.globalAlpha=1,n.lineWidth=1,n.lineCap="butt",n.lineJoin="miter",n.miterLimit=10,n.globalCompositeOperation="source-over",n.font="10px sans-serif",n.setLineDash!==void 0&&(n.setLineDash([]),n.lineDashOffset=0);const{filter:t}=n;t!=="none"&&t!==""&&(n.filter="none")}function JI(n,t){if(t)return!0;Qt.singularValueDecompose2dScale(n,ea);const e=Math.fround(vo.pixelRatio*Cc.PDF_TO_CSS_UNITS);return ea[0]<=e&&ea[1]<=e}const mit=["butt","round","square"],yit=["miter","round","bevel"],bit={},tR={};class df{constructor(t,e,r,i,a,{optionalContentConfig:o,markedContentStack:s=null},l,u,c){this.ctx=t,this.current=new ZI(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=r,this.canvasFactory=i,this.filterFactory=a,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=s||[],this.optionalContentConfig=o,this.cachedCanvases=new git(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=u,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=c??null}getObject(t,e,r=null){return typeof e=="string"?(this.dependencyTracker?.recordNamedDependency(t,e),e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e)):r}beginDrawing({transform:t,viewport:e,transparency:r=!1,background:i=null}){const a=this.ctx.canvas.width,o=this.ctx.canvas.height,s=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,a,o),this.ctx.fillStyle=s,r){const l=this.cachedCanvases.getCanvas("transparent",a,o);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(...Rr(this.compositeCtx))}this.ctx.save(),Zm(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...e.transform),this.viewportScale=e.scale,this.baseTransform=Rr(this.ctx)}executeOperatorList(t,e,r,i,a){const o=t.argsArray,s=t.fnArray;let l=e||0;const u=o.length;if(u===l)return l;const c=u-l>qI&&typeof r=="function",h=c?Date.now()+pit:0;let f=0;const d=this.commonObjs,v=this.objs;let m,y;for(;;){if(i!==void 0&&l===i.nextBreakPoint)return i.breakIt(l,r),l;if(!a||a(l))if(m=s[l],y=o[l]??null,m!==Ef.dependency)y===null?this[m](l):this[m](l,...y);else for(const g of y){this.dependencyTracker?.recordNamedData(g,l);const p=g.startsWith("g_")?d:v;if(!p.has(g))return p.get(g,r),l}if(l++,l===u)return l;if(c&&++f>qI){if(Date.now()>h)return r(),l;f=0}}}#t(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#t(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#e()}#e(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}}_scaleImage(t,e){const r=t.width??t.displayWidth,i=t.height??t.displayHeight;let a=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),s=r,l=i,u="prescale1",c,h;for(;a>2&&s>1||o>2&&l>1;){let f=s,d=l;a>2&&s>1&&(f=s>=16384?Math.floor(s/2)-1||1:Math.ceil(s/2),a/=s/f),o>2&&l>1&&(d=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,o/=l/d),c=this.cachedCanvases.getCanvas(u,f,d),h=c.context,h.clearRect(0,0,f,d),h.drawImage(t,0,0,s,l,0,0,f,d),t=c.canvas,s=f,l=d,u=u==="prescale1"?"prescale2":"prescale1"}return{img:t,paintWidth:s,paintHeight:l}}_createMaskCanvas(t,e){const r=this.ctx,{width:i,height:a}=e,o=this.current.fillColor,s=this.current.patternFill,l=Rr(r);let u,c,h,f;if((e.bitmap||e.data)&&e.count>1){const k=e.bitmap||e.data.buffer;c=JSON.stringify(s?l:[l.slice(0,4),o]),u=this._cachedBitmapsMap.get(k),u||(u=new Map,this._cachedBitmapsMap.set(k,u));const D=u.get(c);if(D&&!s){const L=Math.round(Math.min(l[0],l[2])+l[4]),R=Math.round(Math.min(l[1],l[3])+l[5]);return this.dependencyTracker?.recordDependencies(t,ya.transformAndFill),{canvas:D,offsetX:L,offsetY:R}}h=D}h||(f=this.cachedCanvases.getCanvas("maskCanvas",i,a),QI(f.context,e));let d=Qt.transform(l,[1/i,0,0,-1/a,0,0]);d=Qt.transform(d,[1,0,0,1,0,-a]);const v=nf.slice();Qt.axialAlignedBoundingBox([0,0,i,a],d,v);const[m,y,g,p]=v,b=Math.round(g-m)||1,w=Math.round(p-y)||1,x=this.cachedCanvases.getCanvas("fillCanvas",b,w),A=x.context,T=m,C=y;A.translate(-T,-C),A.transform(...d),h||(h=this._scaleImage(f.canvas,Co(A)),h=h.img,u&&s&&u.set(c,h)),A.imageSmoothingEnabled=JI(Rr(A),e.interpolate),qm(A,h,0,0,h.width,h.height,0,0,i,a),A.globalCompositeOperation="source-in";const E=Qt.transform(Co(A),[1,0,0,1,-T,-C]);return A.fillStyle=s?o.getPattern(r,this,E,Gn.FILL,t):o,A.fillRect(0,0,i,a),u&&!s&&(this.cachedCanvases.delete("fillCanvas"),u.set(c,x.canvas)),this.dependencyTracker?.recordDependencies(t,ya.transformAndFill),{canvas:x.canvas,offsetX:Math.round(T),offsetY:Math.round(C)}}setLineWidth(t,e){this.dependencyTracker?.recordSimpleData("lineWidth",t),e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(t,e){this.dependencyTracker?.recordSimpleData("lineCap",t),this.ctx.lineCap=mit[e]}setLineJoin(t,e){this.dependencyTracker?.recordSimpleData("lineJoin",t),this.ctx.lineJoin=yit[e]}setMiterLimit(t,e){this.dependencyTracker?.recordSimpleData("miterLimit",t),this.ctx.miterLimit=e}setDash(t,e,r){this.dependencyTracker?.recordSimpleData("dash",t);const i=this.ctx;i.setLineDash!==void 0&&(i.setLineDash(e),i.lineDashOffset=r)}setRenderingIntent(t,e){}setFlatness(t,e){}setGState(t,e){for(const[r,i]of e)switch(r){case"LW":this.setLineWidth(t,i);break;case"LC":this.setLineCap(t,i);break;case"LJ":this.setLineJoin(t,i);break;case"ML":this.setMiterLimit(t,i);break;case"D":this.setDash(t,i[0],i[1]);break;case"RI":this.setRenderingIntent(t,i);break;case"FL":this.setFlatness(t,i);break;case"Font":this.setFont(t,i[0],i[1]);break;case"CA":this.dependencyTracker?.recordSimpleData("strokeAlpha",t),this.current.strokeAlpha=i;break;case"ca":this.dependencyTracker?.recordSimpleData("fillAlpha",t),this.ctx.globalAlpha=this.current.fillAlpha=i;break;case"BM":this.dependencyTracker?.recordSimpleData("globalCompositeOperation",t),this.ctx.globalCompositeOperation=i;break;case"SMask":this.dependencyTracker?.recordSimpleData("SMask",t),this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.dependencyTracker?.recordSimpleData("filter",t),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(t){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,r=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,a=this.cachedCanvases.getCanvas(i,e,r);this.suspendedCtx=this.ctx;const o=this.ctx=a.context;o.setTransform(this.suspendedCtx.getTransform()),Rd(this.suspendedCtx,o),vit(o,this.suspendedCtx),this.setGState(t,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Rd(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask,r=this.suspendedCtx;this.composeSMask(r,e,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(t,e,r,i){const a=i[0],o=i[1],s=i[2]-a,l=i[3]-o;s===0||l===0||(this.genericComposeSMask(e.context,r,s,l,e.subtype,e.backdrop,e.transferMap,a,o,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(r.canvas,0,0),t.restore())}genericComposeSMask(t,e,r,i,a,o,s,l,u,c,h){let f=t.canvas,d=l-c,v=u-h;if(o)if(d<0||v<0||d+r>f.width||v+i>f.height){const y=this.cachedCanvases.getCanvas("maskExtension",r,i),g=y.context;g.drawImage(f,-d,-v),g.globalCompositeOperation="destination-atop",g.fillStyle=o,g.fillRect(0,0,r,i),g.globalCompositeOperation="source-over",f=y.canvas,d=v=0}else{t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const y=new Path2D;y.rect(d,v,r,i),t.clip(y),t.globalCompositeOperation="destination-atop",t.fillStyle=o,t.fillRect(d,v,r,i),t.restore()}e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0),a==="Alpha"&&s?e.filter=this.filterFactory.addAlphaFilter(s):a==="Luminosity"&&(e.filter=this.filterFactory.addLuminosityFilter(s));const m=new Path2D;m.rect(l,u,r,i),e.clip(m),e.globalCompositeOperation="destination-in",e.drawImage(f,d,v,r,i,l,u,r,i),e.restore()}save(t){this.inSMaskMode&&Rd(this.ctx,this.suspendedCtx),this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone(),this.dependencyTracker?.save(t)}restore(t){if(this.dependencyTracker?.restore(t),this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&Rd(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(t,e,r,i,a,o,s){this.dependencyTracker?.recordIncrementalData("transform",t),this.ctx.transform(e,r,i,a,o,s),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,r,i){let[a]=r;if(!i){a||=r[0]=new Path2D,this[e](t,a);return}if(this.dependencyTracker!==null){const o=e===Ef.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(t).recordBBox(t,this.ctx,i[0]-o,i[2]+o,i[1]-o,i[3]+o).recordDependencies(t,["transform"])}if(!(a instanceof Path2D)){const o=r[0]=new Path2D;for(let s=0,l=a.length;s<l;)switch(a[s++]){case Um.moveTo:o.moveTo(a[s++],a[s++]);break;case Um.lineTo:o.lineTo(a[s++],a[s++]);break;case Um.curveTo:o.bezierCurveTo(a[s++],a[s++],a[s++],a[s++],a[s++],a[s++]);break;case Um.closePath:o.closePath();break;default:Pe(`Unrecognized drawing path operator: ${a[s-1]}`);break}a=o}Qt.axialAlignedBoundingBox(i,Rr(this.ctx),this.current.minMax),this[e](t,a),this._pathStartIdx=t}closePath(t){this.ctx.closePath()}stroke(t,e,r=!0){const i=this.ctx,a=this.current.strokeColor;if(i.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof a=="object"&&a?.getPattern){const o=a.isModifyingCurrentTransform()?i.getTransform():null;if(i.save(),i.strokeStyle=a.getPattern(i,this,Co(i),Gn.STROKE,t),o){const s=new Path2D;s.addPath(e,i.getTransform().invertSelf().multiplySelf(o)),e=s}this.rescaleAndStroke(e,!1),i.restore()}else this.rescaleAndStroke(e,!0);this.dependencyTracker?.recordDependencies(t,ya.stroke),r&&this.consumePath(t,e,this.current.getClippedPathBoundingBox(Gn.STROKE,Rr(this.ctx))),i.globalAlpha=this.current.fillAlpha}closeStroke(t,e){this.stroke(t,e)}fill(t,e,r=!0){const i=this.ctx,a=this.current.fillColor,o=this.current.patternFill;let s=!1;if(o){const u=a.isModifyingCurrentTransform()?i.getTransform():null;if(this.dependencyTracker?.save(t),i.save(),i.fillStyle=a.getPattern(i,this,Co(i),Gn.FILL,t),u){const c=new Path2D;c.addPath(e,i.getTransform().invertSelf().multiplySelf(u)),e=c}s=!0}const l=this.current.getClippedPathBoundingBox();this.contentVisible&&l!==null&&(this.pendingEOFill?(i.fill(e,"evenodd"),this.pendingEOFill=!1):i.fill(e)),this.dependencyTracker?.recordDependencies(t,ya.fill),s&&(i.restore(),this.dependencyTracker?.restore(t)),r&&this.consumePath(t,e,l)}eoFill(t,e){this.pendingEOFill=!0,this.fill(t,e)}fillStroke(t,e){this.fill(t,e,!1),this.stroke(t,e,!1),this.consumePath(t,e)}eoFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}closeFillStroke(t,e){this.fillStroke(t,e)}closeEOFillStroke(t,e){this.pendingEOFill=!0,this.fillStroke(t,e)}endPath(t,e){this.consumePath(t,e)}rawFillPath(t,e){this.ctx.fill(e),this.dependencyTracker?.recordDependencies(t,ya.rawFillPath).recordOperation(t)}clip(t){this.dependencyTracker?.recordFutureForcedDependency("clipMode",t),this.pendingClip=bit}eoClip(t){this.dependencyTracker?.recordFutureForcedDependency("clipMode",t),this.pendingClip=tR}beginText(t){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,this.dependencyTracker?.recordOpenMarker(t).resetIncrementalData("sameLineText").resetIncrementalData("moveText",t)}endText(t){const e=this.pendingTextPaths,r=this.ctx;if(this.dependencyTracker){const{dependencyTracker:i}=this;e!==void 0&&i.recordFutureForcedDependency("textClip",i.getOpenMarker()).recordFutureForcedDependency("textClip",t),i.recordCloseMarker(t)}if(e!==void 0){const i=new Path2D,a=r.getTransform().invertSelf();for(const{transform:o,x:s,y:l,fontSize:u,path:c}of e)c&&i.addPath(c,new DOMMatrix(o).preMultiplySelf(a).translate(s,l).scale(u,-u));r.clip(i)}delete this.pendingTextPaths}setCharSpacing(t,e){this.dependencyTracker?.recordSimpleData("charSpacing",t),this.current.charSpacing=e}setWordSpacing(t,e){this.dependencyTracker?.recordSimpleData("wordSpacing",t),this.current.wordSpacing=e}setHScale(t,e){this.dependencyTracker?.recordSimpleData("hScale",t),this.current.textHScale=e/100}setLeading(t,e){this.dependencyTracker?.recordSimpleData("leading",t),this.current.leading=-e}setFont(t,e,r){this.dependencyTracker?.recordSimpleData("font",t).recordSimpleDataFromNamed("fontObj",e,t);const i=this.commonObjs.get(e),a=this.current;if(!i)throw new Error(`Can't find font for ${e}`);if(a.fontMatrix=i.fontMatrix||pT,(a.fontMatrix[0]===0||a.fontMatrix[3]===0)&&Pe("Invalid font matrix for font "+e),r<0?(r=-r,a.fontDirection=-1):a.fontDirection=1,this.current.font=i,this.current.fontSize=r,i.isType3Font)return;const o=i.loadedName||"sans-serif",s=i.systemFontInfo?.css||`"${o}", ${i.fallbackName}`;let l="normal";i.black?l="900":i.bold&&(l="bold");const u=i.italic?"italic":"normal";let c=r;r<XI?c=XI:r>YI&&(c=YI),this.current.fontSizeScale=r/c,this.ctx.font=`${u} ${l} ${c}px ${s}`}setTextRenderingMode(t,e){this.dependencyTracker?.recordSimpleData("textRenderingMode",t),this.current.textRenderingMode=e}setTextRise(t,e){this.dependencyTracker?.recordSimpleData("textRise",t),this.current.textRise=e}moveText(t,e,r){this.dependencyTracker?.resetIncrementalData("sameLineText").recordIncrementalData("moveText",t),this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=r}setLeadingMoveText(t,e,r){this.setLeading(t,-r),this.moveText(t,e,r)}setTextMatrix(t,e){this.dependencyTracker?.recordSimpleData("textMatrix",t);const{current:r}=this;r.textMatrix=e,r.textMatrixScale=Math.hypot(e[0],e[1]),r.x=r.lineX=0,r.y=r.lineY=0}nextLine(t){this.moveText(t,0,this.current.leading),this.dependencyTracker?.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??t)}#n(t,e,r){const i=new Path2D;return i.addPath(t,new DOMMatrix(r).invertSelf().multiplySelf(e)),i}paintChar(t,e,r,i,a,o){const s=this.ctx,l=this.current,u=l.font,c=l.textRenderingMode,h=l.fontSize/l.fontSizeScale,f=c&Bn.FILL_STROKE_MASK,d=!!(c&Bn.ADD_TO_PATH_FLAG),v=l.patternFill&&!u.missingFile,m=l.patternStroke&&!u.missingFile;let y;if((u.disableFontFace||d||v||m)&&!u.missingFile&&(y=u.getPathGenerator(this.commonObjs,e)),y&&(u.disableFontFace||v||m)){s.save(),s.translate(r,i),s.scale(h,-h),this.dependencyTracker?.recordCharacterBBox(t,s,u);let g;if(f===Bn.FILL||f===Bn.FILL_STROKE)if(a){g=s.getTransform(),s.setTransform(...a);const p=this.#n(y,g,a);s.fill(p)}else s.fill(y);if(f===Bn.STROKE||f===Bn.FILL_STROKE)if(o){g||=s.getTransform(),s.setTransform(...o);const{a:p,b,c:w,d:x}=g,A=Qt.inverseTransform(o),T=Qt.transform([p,b,w,x,0,0],A);Qt.singularValueDecompose2dScale(T,ea),s.lineWidth*=Math.max(ea[0],ea[1])/h,s.stroke(this.#n(y,g,o))}else s.lineWidth/=h,s.stroke(y);s.restore()}else(f===Bn.FILL||f===Bn.FILL_STROKE)&&(s.fillText(e,r,i),this.dependencyTracker?.recordCharacterBBox(t,s,u,h,r,i,()=>s.measureText(e))),(f===Bn.STROKE||f===Bn.FILL_STROKE)&&(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(t,s,u,h,r,i,()=>s.measureText(e)).recordDependencies(t,ya.stroke),s.strokeText(e,r,i));d&&((this.pendingTextPaths||=[]).push({transform:Rr(s),x:r,y:i,fontSize:h,path:y}),this.dependencyTracker?.recordCharacterBBox(t,s,u,h,r,i))}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let r=!1;for(let i=3;i<e.length;i+=4)if(e[i]>0&&e[i]<255){r=!0;break}return Oe(this,"isFontSubpixelAAEnabled",r)}showText(t,e){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(t,ya.showText).resetBBox(t),this.current.textRenderingMode&Bn.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency("textClip",t).inheritPendingDependenciesAsFutureForcedDependencies());const r=this.current,i=r.font;if(i.isType3Font){this.showType3Text(t,e),this.dependencyTracker?.recordShowTextOperation(t);return}const a=r.fontSize;if(a===0){this.dependencyTracker?.recordOperation(t);return}const o=this.ctx,s=r.fontSizeScale,l=r.charSpacing,u=r.wordSpacing,c=r.fontDirection,h=r.textHScale*c,f=e.length,d=i.vertical,v=d?1:-1,m=i.defaultVMetrics,y=a*r.fontMatrix[0],g=r.textRenderingMode===Bn.FILL&&!i.disableFontFace&&!r.patternFill;o.save(),r.textMatrix&&o.transform(...r.textMatrix),o.translate(r.x,r.y+r.textRise),c>0?o.scale(h,-1):o.scale(h,1);let p,b;if(r.patternFill){o.save();const C=r.fillColor.getPattern(o,this,Co(o),Gn.FILL,t);p=Rr(o),o.restore(),o.fillStyle=C}if(r.patternStroke){o.save();const C=r.strokeColor.getPattern(o,this,Co(o),Gn.STROKE,t);b=Rr(o),o.restore(),o.strokeStyle=C}let w=r.lineWidth;const x=r.textMatrixScale;if(x===0||w===0){const C=r.textRenderingMode&Bn.FILL_STROKE_MASK;(C===Bn.STROKE||C===Bn.FILL_STROKE)&&(w=this.getSinglePixelWidth())}else w/=x;if(s!==1&&(o.scale(s,s),w/=s),o.lineWidth=w,i.isInvalidPDFjsFont){const C=[];let E=0;for(const D of e)C.push(D.unicode),E+=D.width;const k=C.join("");if(o.fillText(k,0,0),this.dependencyTracker!==null){const D=o.measureText(k);this.dependencyTracker.recordBBox(t,this.ctx,-D.actualBoundingBoxLeft,D.actualBoundingBoxRight,-D.actualBoundingBoxAscent,D.actualBoundingBoxDescent).recordShowTextOperation(t)}r.x+=E*y*h,o.restore(),this.compose();return}let A=0,T;for(T=0;T<f;++T){const C=e[T];if(typeof C=="number"){A+=v*C*a/1e3;continue}let E=!1;const k=(C.isSpace?u:0)+l,D=C.fontChar,L=C.accent;let R,P,O=C.width;if(d){const G=C.vmetric||m,U=-(C.vmetric?G[1]:O*.5)*y,K=G[2]*y;O=G?-G[0]:O,R=U/s,P=(A+K)/s}else R=A/s,P=0;let F;if(i.remeasure&&O>0){F=o.measureText(D);const G=F.width*1e3/a*s;if(O<G&&this.isFontSubpixelAAEnabled){const U=O/G;E=!0,o.save(),o.scale(U,1),R/=U}else O!==G&&(R+=(O-G)/2e3*a/s)}if(this.contentVisible&&(C.isInFont||i.missingFile)){if(g&&!L)o.fillText(D,R,P),this.dependencyTracker?.recordCharacterBBox(t,o,F?{bbox:null}:i,a/s,R,P,()=>F??o.measureText(D));else if(this.paintChar(t,D,R,P,p,b),L){const G=R+a*L.offset.x/s,U=P-a*L.offset.y/s;this.paintChar(t,L.fontChar,G,U,p,b)}}const z=d?O*y-k*c:O*y+k*c;A+=z,E&&o.restore()}d?r.y-=A:r.x+=A*h,o.restore(),this.compose(),this.dependencyTracker?.recordShowTextOperation(t)}showType3Text(t,e){const r=this.ctx,i=this.current,a=i.font,o=i.fontSize,s=i.fontDirection,l=a.vertical?1:-1,u=i.charSpacing,c=i.wordSpacing,h=i.textHScale*s,f=i.fontMatrix||pT,d=e.length,v=i.textRenderingMode===Bn.INVISIBLE;let m,y,g,p;if(v||o===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,r.save(),i.textMatrix&&r.transform(...i.textMatrix),r.translate(i.x,i.y+i.textRise),r.scale(h,s);const b=this.dependencyTracker;for(this.dependencyTracker=b?new K0(b,t):null,m=0;m<d;++m){if(y=e[m],typeof y=="number"){p=l*y*o/1e3,this.ctx.translate(p,0),i.x+=p*h;continue}const w=(y.isSpace?c:0)+u,x=a.charProcOperatorList[y.operatorListId];x?this.contentVisible&&(this.save(),r.scale(o,o),r.transform(...f),this.executeOperatorList(x),this.restore()):Pe(`Type3 character "${y.operatorListId}" is not available.`);const A=[y.width,0];Qt.applyTransform(A,f),g=A[0]*o+w,r.translate(g,0),i.x+=g*h}r.restore(),b&&(this.dependencyTracker=b)}setCharWidth(t,e,r){}setCharWidthAndBounds(t,e,r,i,a,o,s){const l=new Path2D;l.rect(i,a,o-i,s-a),this.ctx.clip(l),this.dependencyTracker?.recordBBox(t,this.ctx,i,o,a,s).recordClipBox(t,this.ctx,i,o,a,s),this.endPath(t)}getColorN_Pattern(t,e){let r;if(e[0]==="TilingPattern"){const i=this.baseTransform||Rr(this.ctx),a={createCanvasGraphics:(o,s)=>new df(o,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new K0(this.dependencyTracker,s,!0):null)};r=new vM(e,this.ctx,a,i)}else r=this._getPattern(t,e[1],e[2]);return r}setStrokeColorN(t,...e){this.dependencyTracker?.recordSimpleData("strokeColor",t),this.current.strokeColor=this.getColorN_Pattern(t,e),this.current.patternStroke=!0}setFillColorN(t,...e){this.dependencyTracker?.recordSimpleData("fillColor",t),this.current.fillColor=this.getColorN_Pattern(t,e),this.current.patternFill=!0}setStrokeRGBColor(t,e){this.dependencyTracker?.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor=e,this.current.patternStroke=!1}setStrokeTransparent(t){this.dependencyTracker?.recordSimpleData("strokeColor",t),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(t,e){this.dependencyTracker?.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor=e,this.current.patternFill=!1}setFillTransparent(t){this.dependencyTracker?.recordSimpleData("fillColor",t),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(t,e,r=null){let i;return this.cachedPatterns.has(e)?i=this.cachedPatterns.get(e):(i=fit(this.getObject(t,e)),this.cachedPatterns.set(e,i)),r&&(i.matrix=r),i}shadingFill(t,e){if(!this.contentVisible)return;const r=this.ctx;this.save(t);const i=this._getPattern(t,e);r.fillStyle=i.getPattern(r,this,Co(r),Gn.SHADING,t);const a=Co(r);if(a){const{width:o,height:s}=r.canvas,l=nf.slice();Qt.axialAlignedBoundingBox([0,0,o,s],a,l);const[u,c,h,f]=l;this.ctx.fillRect(u,c,h-u,f-c)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(t).recordFullPageBBox(t).recordDependencies(t,ya.transform).recordDependencies(t,ya.fill).recordOperation(t),this.compose(this.current.getClippedPathBoundingBox()),this.restore(t)}beginInlineImage(){_r("Should not call beginInlineImage")}beginImageData(){_r("Should not call beginImageData")}paintFormXObjectBegin(t,e,r){if(this.contentVisible&&(this.save(t),this.baseTransformStack.push(this.baseTransform),e&&this.transform(t,...e),this.baseTransform=Rr(this.ctx),r)){Qt.axialAlignedBoundingBox(r,this.baseTransform,this.current.minMax);const[i,a,o,s]=r,l=new Path2D;l.rect(i,a,o-i,s-a),this.ctx.clip(l),this.dependencyTracker?.recordClipBox(t,this.ctx,i,o,a,s),this.endPath(t)}}paintFormXObjectEnd(t){this.contentVisible&&(this.restore(t),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t,e){if(!this.contentVisible)return;this.save(t),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const r=this.ctx;e.isolated||c_("TODO: Support non-isolated groups."),e.knockout&&Pe("Knockout groups not supported.");const i=Rr(r);if(e.matrix&&r.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let a=nf.slice();Qt.axialAlignedBoundingBox(e.bbox,Rr(r),a);const o=[0,0,r.canvas.width,r.canvas.height];a=Qt.intersect(a,o)||[0,0,0,0];const s=Math.floor(a[0]),l=Math.floor(a[1]),u=Math.max(Math.ceil(a[2])-s,1),c=Math.max(Math.ceil(a[3])-l,1);this.current.startNewPathAndClipBox([0,0,u,c]);let h="groupAt"+this.groupLevel;e.smask&&(h+="_smask_"+this.smaskCounter++%2);const f=this.cachedCanvases.getCanvas(h,u,c),d=f.context;d.translate(-s,-l),d.transform(...i);let v=new Path2D;const[m,y,g,p]=e.bbox;if(v.rect(m,y,g-m,p-y),e.matrix){const b=new Path2D;b.addPath(v,new DOMMatrix(e.matrix)),v=b}d.clip(v),e.smask&&this.smaskStack.push({canvas:f.canvas,context:d,offsetX:s,offsetY:l,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}),(!e.smask||this.dependencyTracker)&&(r.setTransform(1,0,0,1,0,0),r.translate(s,l),r.save()),Rd(r,d),this.ctx=d,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(r),this.setGState(t,[["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(r),this.groupLevel++}endGroup(t,e){if(!this.contentVisible)return;this.groupLevel--;const r=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,this.dependencyTracker?.popBaseTransform(),e.smask)this.tempSMask=this.smaskStack.pop(),this.restore(t),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();const a=Rr(this.ctx);this.restore(t),this.ctx.save(),this.ctx.setTransform(...a);const o=nf.slice();Qt.axialAlignedBoundingBox([0,0,r.canvas.width,r.canvas.height],a,o),this.ctx.drawImage(r.canvas,0,0),this.ctx.restore(),this.compose(o)}}beginAnnotation(t,e,r,i,a,o){if(this.#t(),Zm(this.ctx),this.ctx.save(),this.save(t),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),r){const s=r[2]-r[0],l=r[3]-r[1];if(o&&this.annotationCanvasMap){i=i.slice(),i[4]-=r[0],i[5]-=r[1],r=r.slice(),r[0]=r[1]=0,r[2]=s,r[3]=l,Qt.singularValueDecompose2dScale(Rr(this.ctx),ea);const{viewportScale:u}=this,c=Math.ceil(s*this.outputScaleX*u),h=Math.ceil(l*this.outputScaleY*u);this.annotationCanvas=this.canvasFactory.create(c,h);const{canvas:f,context:d}=this.annotationCanvas;this.annotationCanvasMap.set(e,f),this.annotationCanvas.savedCtx=this.ctx,this.ctx=d,this.ctx.save(),this.ctx.setTransform(ea[0],0,0,-ea[1],0,l*ea[1]),Zm(this.ctx)}else{Zm(this.ctx),this.endPath(t);const u=new Path2D;u.rect(r[0],r[1],s,l),this.ctx.clip(u)}}this.current=new ZI(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(t,...i),this.transform(t,...a)}endAnnotation(t){this.annotationCanvas&&(this.ctx.restore(),this.#e(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t,e){if(!this.contentVisible)return;const r=e.count;e=this.getObject(t,e.data,e),e.count=r;const i=this.ctx,a=this._createMaskCanvas(t,e),o=a.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(o,a.offsetX,a.offsetY),this.dependencyTracker?.resetBBox(t).recordBBox(t,this.ctx,a.offsetX,a.offsetX+o.width,a.offsetY,a.offsetY+o.height).recordOperation(t),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e,r,i=0,a=0,o,s){if(!this.contentVisible)return;e=this.getObject(t,e.data,e);const l=this.ctx;l.save();const u=Rr(l);l.transform(r,i,a,o,0,0);const c=this._createMaskCanvas(t,e);l.setTransform(1,0,0,1,c.offsetX-u[4],c.offsetY-u[5]),this.dependencyTracker?.resetBBox(t);for(let h=0,f=s.length;h<f;h+=2){const d=Qt.transform(u,[r,i,a,o,s[h],s[h+1]]);l.drawImage(c.canvas,d[4],d[5]),this.dependencyTracker?.recordBBox(t,this.ctx,d[4],d[4]+c.canvas.width,d[5],d[5]+c.canvas.height)}l.restore(),this.compose(),this.dependencyTracker?.recordOperation(t)}paintImageMaskXObjectGroup(t,e){if(!this.contentVisible)return;const r=this.ctx,i=this.current.fillColor,a=this.current.patternFill;this.dependencyTracker?.resetBBox(t).recordDependencies(t,ya.transformAndFill);for(const o of e){const{data:s,width:l,height:u,transform:c}=o,h=this.cachedCanvases.getCanvas("maskCanvas",l,u),f=h.context;f.save();const d=this.getObject(t,s,o);QI(f,d),f.globalCompositeOperation="source-in",f.fillStyle=a?i.getPattern(f,this,Co(r),Gn.FILL,t):i,f.fillRect(0,0,l,u),f.restore(),r.save(),r.transform(...c),r.scale(1,-1),qm(r,h.canvas,0,0,l,u,0,-1,1,1),this.dependencyTracker?.recordBBox(t,r,0,l,0,u),r.restore()}this.compose(),this.dependencyTracker?.recordOperation(t)}paintImageXObject(t,e){if(!this.contentVisible)return;const r=this.getObject(t,e);if(!r){Pe("Dependent image isn't ready yet");return}this.paintInlineImageXObject(t,r)}paintImageXObjectRepeat(t,e,r,i,a){if(!this.contentVisible)return;const o=this.getObject(t,e);if(!o){Pe("Dependent image isn't ready yet");return}const s=o.width,l=o.height,u=[];for(let c=0,h=a.length;c<h;c+=2)u.push({transform:[r,0,0,i,a[c],a[c+1]],x:0,y:0,w:s,h:l});this.paintInlineImageXObjectGroup(t,o,u)}applyTransferMapsToCanvas(t){return this.current.transferMaps!=="none"&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if(this.current.transferMaps==="none")return t.bitmap;const{bitmap:e,width:r,height:i}=t,a=this.cachedCanvases.getCanvas("inlineImage",r,i),o=a.context;return o.filter=this.current.transferMaps,o.drawImage(e,0,0),o.filter="none",a.canvas}paintInlineImageXObject(t,e){if(!this.contentVisible)return;const r=e.width,i=e.height,a=this.ctx;this.save(t);const{filter:o}=a;o!=="none"&&o!==""&&(a.filter="none"),a.scale(1/r,-1/i);let s;if(e.bitmap)s=this.applyTransferMapsToBitmap(e);else if(typeof HTMLElement=="function"&&e instanceof HTMLElement||!e.data)s=e;else{const c=this.cachedCanvases.getCanvas("inlineImage",r,i).context;KI(c,e),s=this.applyTransferMapsToCanvas(c)}const l=this._scaleImage(s,Co(a));a.imageSmoothingEnabled=JI(Rr(a),e.interpolate),this.dependencyTracker?.resetBBox(t).recordBBox(t,a,0,r,-i,0).recordDependencies(t,ya.imageXObject).recordOperation(t),qm(a,l.img,0,0,l.paintWidth,l.paintHeight,0,-i,r,i),this.compose(),this.restore(t)}paintInlineImageXObjectGroup(t,e,r){if(!this.contentVisible)return;const i=this.ctx;let a;if(e.bitmap)a=e.bitmap;else{const o=e.width,s=e.height,u=this.cachedCanvases.getCanvas("inlineImage",o,s).context;KI(u,e),a=this.applyTransferMapsToCanvas(u)}this.dependencyTracker?.resetBBox(t);for(const o of r)i.save(),i.transform(...o.transform),i.scale(1,-1),qm(i,a,o.x,o.y,o.w,o.h,0,-1,1,1),this.dependencyTracker?.recordBBox(t,i,0,1,-1,0),i.restore();this.dependencyTracker?.recordOperation(t),this.compose()}paintSolidColorImageMask(t){this.contentVisible&&(this.dependencyTracker?.resetBBox(t).recordBBox(t,this.ctx,0,1,0,1).recordDependencies(t,ya.fill).recordOperation(t),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t,e){}markPointProps(t,e,r){}beginMarkedContent(t,e){this.dependencyTracker?.beginMarkedContent(t),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e,r){this.dependencyTracker?.beginMarkedContent(t),e==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(r)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(t){this.dependencyTracker?.endMarkedContent(t),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(t){}endCompat(t){}consumePath(t,e,r){const i=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(r);const a=this.ctx;this.pendingClip?(i||(this.pendingClip===tR?a.clip(e,"evenodd"):a.clip(e)),this.pendingClip=null,this.dependencyTracker?.bboxToClipBoxDropOperation(t).recordFutureForcedDependency("clipPath",t)):this.dependencyTracker?.recordOperation(t),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=Rr(this.ctx);if(t[1]===0&&t[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),r=Math.hypot(t[0],t[2]),i=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(r,i)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:t}=this.current,{a:e,b:r,c:i,d:a}=this.ctx.getTransform();let o,s;if(r===0&&i===0){const l=Math.abs(e),u=Math.abs(a);if(l===u)if(t===0)o=s=1/l;else{const c=l*t;o=s=c<1?1/c:1}else if(t===0)o=1/l,s=1/u;else{const c=l*t,h=u*t;o=c<1?1/c:1,s=h<1?1/h:1}}else{const l=Math.abs(e*a-r*i),u=Math.hypot(e,r),c=Math.hypot(i,a);if(t===0)o=c/l,s=u/l;else{const h=t*l;o=c>h?c/h:1,s=u>h?u/h:1}}this._cachedScaleForStroking[0]=o,this._cachedScaleForStroking[1]=s}return this._cachedScaleForStroking}rescaleAndStroke(t,e){const{ctx:r,current:{lineWidth:i}}=this,[a,o]=this.getScaleForStroking();if(a===o){r.lineWidth=(i||1)*a,r.stroke(t);return}const s=r.getLineDash();e&&r.save(),r.scale(a,o),$1.a=1/a,$1.d=1/o;const l=new Path2D;if(l.addPath(t,$1),s.length>0){const u=Math.max(a,o);r.setLineDash(s.map(c=>c/u)),r.lineDashOffset/=u}r.lineWidth=i||1,r.stroke(l),e&&r.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(const n in Ef)df.prototype[n]!==void 0&&(df.prototype[Ef[n]]=df.prototype[n]);class pf{#t;#e;#n;static strings=["fontFamily","fontWeight","italicAngle"];static write(t){const e=new TextEncoder,r={};let i=0;for(const u of pf.strings){const c=e.encode(t[u]);r[u]=c,i+=4+c.length}const a=new ArrayBuffer(i),o=new Uint8Array(a),s=new DataView(a);let l=0;for(const u of pf.strings){const c=r[u],h=c.length;s.setUint32(l,h),o.set(c,l+4),l+=4+h}return Qe(l===a.byteLength,"CssFontInfo.write: Buffer overflow"),a}constructor(t){this.#t=t,this.#e=new DataView(this.#t),this.#n=new TextDecoder}#r(t){Qe(t<pf.strings.length,"Invalid string index");let e=0;for(let i=0;i<t;i++)e+=this.#e.getUint32(e)+4;const r=this.#e.getUint32(e);return this.#n.decode(new Uint8Array(this.#t,e+4,r))}get fontFamily(){return this.#r(0)}get fontWeight(){return this.#r(1)}get italicAngle(){return this.#r(2)}}class vf{#t;#e;#n;static strings=["css","loadedName","baseFontName","src"];static write(t){const e=new TextEncoder,r={};let i=0;for(const f of vf.strings){const d=e.encode(t[f]);r[f]=d,i+=4+d.length}i+=4;let a,o,s=1+i;t.style&&(a=e.encode(t.style.style),o=e.encode(t.style.weight),s+=4+a.length+4+o.length);const l=new ArrayBuffer(s),u=new Uint8Array(l),c=new DataView(l);let h=0;c.setUint8(h++,t.guessFallback?1:0),c.setUint32(h,0),h+=4,i=0;for(const f of vf.strings){const d=r[f],v=d.length;i+=4+v,c.setUint32(h,v),u.set(d,h+4),h+=4+v}return c.setUint32(h-i-4,i),t.style&&(c.setUint32(h,a.length),u.set(a,h+4),h+=4+a.length,c.setUint32(h,o.length),u.set(o,h+4),h+=4+o.length),Qe(h<=l.byteLength,"SubstitionInfo.write: Buffer overflow"),l.transferToFixedLength(h)}constructor(t){this.#t=t,this.#e=new DataView(this.#t),this.#n=new TextDecoder}get guessFallback(){return this.#e.getUint8(0)!==0}#r(t){Qe(t<vf.strings.length,"Invalid string index");let e=5;for(let i=0;i<t;i++)e+=this.#e.getUint32(e)+4;const r=this.#e.getUint32(e);return this.#n.decode(new Uint8Array(this.#t,e+4,r))}get css(){return this.#r(0)}get loadedName(){return this.#r(1)}get baseFontName(){return this.#r(2)}get src(){return this.#r(3)}get style(){let t=1;t+=4+this.#e.getUint32(t);const e=this.#e.getUint32(t),r=this.#n.decode(new Uint8Array(this.#t,t+4,e));t+=4+e;const i=this.#e.getUint32(t),a=this.#n.decode(new Uint8Array(this.#t,t+4,i));return{style:r,weight:a}}}class vr{static bools=["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"];static numbers=["ascent","defaultWidth","descent"];static strings=["fallbackName","loadedName","mimetype","name"];static#t=Math.ceil(this.bools.length*2/8);static#e=this.#t+this.numbers.length*8;static#n=this.#e+1+8;static#r=this.#n+1+48;static#o=this.#r+1+6;#i;#a;#s;constructor({data:t,extra:e}){this.#i=t,this.#a=new TextDecoder,this.#s=new DataView(this.#i),e&&Object.assign(this,e)}#u(t){Qe(t<vr.bools.length,"Invalid boolean index");const e=Math.floor(t/4),r=t*2%8,i=this.#s.getUint8(e)>>r&3;return i===0?void 0:i===2}get black(){return this.#u(0)}get bold(){return this.#u(1)}get disableFontFace(){return this.#u(2)}get fontExtraProperties(){return this.#u(3)}get isInvalidPDFjsFont(){return this.#u(4)}get isType3Font(){return this.#u(5)}get italic(){return this.#u(6)}get missingFile(){return this.#u(7)}get remeasure(){return this.#u(8)}get vertical(){return this.#u(9)}#l(t){return Qe(t<vr.numbers.length,"Invalid number index"),this.#s.getFloat64(vr.#t+t*8)}get ascent(){return this.#l(0)}get defaultWidth(){return this.#l(1)}get descent(){return this.#l(2)}get bbox(){let t=vr.#e;if(this.#s.getUint8(t)===0)return;t+=1;const r=[];for(let i=0;i<4;i++)r.push(this.#s.getInt16(t,!0)),t+=2;return r}get fontMatrix(){let t=vr.#n;if(this.#s.getUint8(t)===0)return;t+=1;const r=[];for(let i=0;i<6;i++)r.push(this.#s.getFloat64(t,!0)),t+=8;return r}get defaultVMetrics(){let t=vr.#r;if(this.#s.getUint8(t)===0)return;t+=1;const r=[];for(let i=0;i<3;i++)r.push(this.#s.getInt16(t,!0)),t+=2;return r}#f(t){Qe(t<vr.strings.length,"Invalid string index");let e=vr.#o+4;for(let a=0;a<t;a++)e+=this.#s.getUint32(e)+4;const r=this.#s.getUint32(e),i=new Uint8Array(r);return i.set(new Uint8Array(this.#i,e+4,r)),this.#a.decode(i)}get fallbackName(){return this.#f(0)}get loadedName(){return this.#f(1)}get mimetype(){return this.#f(2)}get name(){return this.#f(3)}get data(){let t=vr.#o;const e=this.#s.getUint32(t);t+=4+e;const r=this.#s.getUint32(t);t+=4+r;const i=this.#s.getUint32(t);t+=4+i;const a=this.#s.getUint32(t);if(a!==0)return new Uint8Array(this.#i,t+4,a)}clearData(){let t=vr.#o;const e=this.#s.getUint32(t);t+=4+e;const r=this.#s.getUint32(t);t+=4+r;const i=this.#s.getUint32(t);t+=4+i;const a=this.#s.getUint32(t);new Uint8Array(this.#i,t+4,a).fill(0),this.#s.setUint32(t,0)}get cssFontInfo(){let t=vr.#o;const e=this.#s.getUint32(t);t+=4+e;const r=this.#s.getUint32(t);t+=4+r;const i=this.#s.getUint32(t);if(i===0)return null;const a=new Uint8Array(i);return a.set(new Uint8Array(this.#i,t+4,i)),new pf(a.buffer)}get systemFontInfo(){let t=vr.#o;const e=this.#s.getUint32(t);t+=4+e;const r=this.#s.getUint32(t);if(r===0)return null;const i=new Uint8Array(r);return i.set(new Uint8Array(this.#i,t+4,r)),new vf(i.buffer)}static write(t){const e=t.systemFontInfo?vf.write(t.systemFontInfo):null,r=t.cssFontInfo?pf.write(t.cssFontInfo):null,i=new TextEncoder,a={};let o=0;for(const m of vr.strings)a[m]=i.encode(t[m]),o+=4+a[m].length;const s=vr.#o+4+o+4+(e?e.byteLength:0)+4+(r?r.byteLength:0)+4+(t.data?t.data.length:0),l=new ArrayBuffer(s),u=new Uint8Array(l),c=new DataView(l);let h=0;const f=vr.bools.length;let d=0,v=0;for(let m=0;m<f;m++){const y=t[vr.bools[m]];d|=(y===void 0?0:y?2:1)<<v,v+=2,(v===8||m===f-1)&&(c.setUint8(h++,d),d=0,v=0)}Qe(h===vr.#t,"FontInfo.write: Boolean properties offset mismatch");for(const m of vr.numbers)c.setFloat64(h,t[m]),h+=8;if(Qe(h===vr.#e,"FontInfo.write: Number properties offset mismatch"),t.bbox){c.setUint8(h++,4);for(const m of t.bbox)c.setInt16(h,m,!0),h+=2}else c.setUint8(h++,0),h+=8;if(Qe(h===vr.#n,"FontInfo.write: BBox properties offset mismatch"),t.fontMatrix){c.setUint8(h++,6);for(const m of t.fontMatrix)c.setFloat64(h,m,!0),h+=8}else c.setUint8(h++,0),h+=48;if(Qe(h===vr.#r,"FontInfo.write: FontMatrix properties offset mismatch"),t.defaultVMetrics){c.setUint8(h++,1);for(const m of t.defaultVMetrics)c.setInt16(h,m,!0),h+=2}else c.setUint8(h++,0),h+=6;Qe(h===vr.#o,"FontInfo.write: DefaultVMetrics properties offset mismatch"),c.setUint32(vr.#o,0),h+=4;for(const m of vr.strings){const y=a[m],g=y.length;c.setUint32(h,g),u.set(y,h+4),h+=4+g}if(c.setUint32(vr.#o,h-vr.#o-4),!e)c.setUint32(h,0),h+=4;else{const m=e.byteLength;c.setUint32(h,m),Qe(h+4+m<=l.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),u.set(new Uint8Array(e),h+4),h+=4+m}if(!r)c.setUint32(h,0),h+=4;else{const m=r.byteLength;c.setUint32(h,m),Qe(h+4+m<=l.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),u.set(new Uint8Array(r),h+4),h+=4+m}return t.data===void 0?(c.setUint32(h,0),h+=4):(c.setUint32(h,t.data.length),u.set(t.data,h+4),h+=4+t.data.length),Qe(h<=l.byteLength,"FontInfo.write: Buffer overflow"),l.transferToFixedLength(h)}}class Fl{static#t=null;static#e="";static get workerPort(){return this.#t}static set workerPort(t){if(!(typeof Worker<"u"&&t instanceof Worker)&&t!==null)throw new Error("Invalid `workerPort` type.");this.#t=t}static get workerSrc(){return this.#e}static set workerSrc(t){if(typeof t!="string")throw new Error("Invalid `workerSrc` type.");this.#e=t}}class _it{#t;#e;constructor({parsedData:t,rawData:e}){this.#t=t,this.#e=e}getRaw(){return this.#e}get(t){return this.#t.get(t)??null}[Symbol.iterator](){return this.#t.entries()}}const Wh=Symbol("INTERNAL");class wit{#t=!1;#e=!1;#n=!1;#r=!0;constructor(t,{name:e,intent:r,usage:i,rbGroups:a}){this.#t=!!(t&Ji.DISPLAY),this.#e=!!(t&Ji.PRINT),this.name=e,this.intent=r,this.usage=i,this.rbGroups=a}get visible(){if(this.#n)return this.#r;if(!this.#r)return!1;const{print:t,view:e}=this.usage;return this.#t?e?.viewState!=="OFF":this.#e?t?.printState!=="OFF":!0}_setVisible(t,e,r=!1){t!==Wh&&_r("Internal method `_setVisible` called."),this.#n=r,this.#r=e}}class xit{#t=null;#e=new Map;#n=null;#r=null;constructor(t,e=Ji.DISPLAY){if(this.renderingIntent=e,this.name=null,this.creator=null,t!==null){this.name=t.name,this.creator=t.creator,this.#r=t.order;for(const r of t.groups)this.#e.set(r.id,new wit(e,r));if(t.baseState==="OFF")for(const r of this.#e.values())r._setVisible(Wh,!1);for(const r of t.on)this.#e.get(r)._setVisible(Wh,!0);for(const r of t.off)this.#e.get(r)._setVisible(Wh,!1);this.#n=this.getHash()}}#o(t){const e=t.length;if(e<2)return!0;const r=t[0];for(let i=1;i<e;i++){const a=t[i];let o;if(Array.isArray(a))o=this.#o(a);else if(this.#e.has(a))o=this.#e.get(a).visible;else return Pe(`Optional content group not found: ${a}`),!0;switch(r){case"And":if(!o)return!1;break;case"Or":if(o)return!0;break;case"Not":return!o;default:return!0}}return r==="And"}isVisible(t){if(this.#e.size===0)return!0;if(!t)return c_("Optional content group not defined."),!0;if(t.type==="OCG")return this.#e.has(t.id)?this.#e.get(t.id).visible:(Pe(`Optional content group not found: ${t.id}`),!0);if(t.type==="OCMD"){if(t.expression)return this.#o(t.expression);if(!t.policy||t.policy==="AnyOn"){for(const e of t.ids){if(!this.#e.has(e))return Pe(`Optional content group not found: ${e}`),!0;if(this.#e.get(e).visible)return!0}return!1}else if(t.policy==="AllOn"){for(const e of t.ids){if(!this.#e.has(e))return Pe(`Optional content group not found: ${e}`),!0;if(!this.#e.get(e).visible)return!1}return!0}else if(t.policy==="AnyOff"){for(const e of t.ids){if(!this.#e.has(e))return Pe(`Optional content group not found: ${e}`),!0;if(!this.#e.get(e).visible)return!0}return!1}else if(t.policy==="AllOff"){for(const e of t.ids){if(!this.#e.has(e))return Pe(`Optional content group not found: ${e}`),!0;if(this.#e.get(e).visible)return!1}return!0}return Pe(`Unknown optional content policy ${t.policy}.`),!0}return Pe(`Unknown group type ${t.type}.`),!0}setVisibility(t,e=!0,r=!0){const i=this.#e.get(t);if(!i){Pe(`Optional content group not found: ${t}`);return}if(r&&e&&i.rbGroups.length)for(const a of i.rbGroups)for(const o of a)o!==t&&this.#e.get(o)?._setVisible(Wh,!1,!0);i._setVisible(Wh,!!e,!0),this.#t=null}setOCGState({state:t,preserveRB:e}){let r;for(const i of t){switch(i){case"ON":case"OFF":case"Toggle":r=i;continue}const a=this.#e.get(i);if(a)switch(r){case"ON":this.setVisibility(i,!0,e);break;case"OFF":this.setVisibility(i,!1,e);break;case"Toggle":this.setVisibility(i,!a.visible,e);break}}this.#t=null}get hasInitialVisibility(){return this.#n===null||this.getHash()===this.#n}getOrder(){return this.#e.size?this.#r?this.#r.slice():[...this.#e.keys()]:null}getGroup(t){return this.#e.get(t)||null}getHash(){if(this.#t!==null)return this.#t;const t=new CH;for(const[e,r]of this.#e)t.update(`${e}:${r.visible}`);return this.#t=t.hexdigest()}[Symbol.iterator](){return this.#e.entries()}}class Sit{constructor(t,{disableRange:e=!1,disableStream:r=!1}){Qe(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:i,initialData:a,progressiveDone:o,contentDispositionFilename:s}=t;if(this._queuedChunks=[],this._progressiveDone=o,this._contentDispositionFilename=s,a?.length>0){const l=a instanceof Uint8Array&&a.byteLength===a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!r,this._isRangeSupported=!e,this._contentLength=i,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener((l,u)=>{this._onReceiveData({begin:l,chunk:u})}),t.addProgressListener((l,u)=>{this._onProgress({loaded:l,total:u})}),t.addProgressiveReadListener(l=>{this._onReceiveData({chunk:l})}),t.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),t.transportReady()}_onReceiveData({begin:t,chunk:e}){const r=e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer;if(t===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r);else{const i=this._rangeReaders.some(function(a){return a._begin!==t?!1:(a._enqueue(r),!0)});Qe(i,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){t.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){Qe(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new Ait(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const r=new Tit(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(r),r}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}}class Ait{constructor(t,e,r=!1,i=null){this._stream=t,this._done=r||!1,this._filename=f_(i)?i:null,this._queuedChunks=e||[],this._loaded=0;for(const a of this._queuedChunks)this._loaded+=a.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class Tit{constructor(t,e,r){this._stream=t,this._begin=e,this._end=r,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length===0)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function Cit(n){let t=!0,e=r("filename\\*","i").exec(n);if(e){e=e[1];let c=s(e);return c=unescape(c),c=l(c),c=u(c),a(c)}if(e=o(n),e){const c=u(e);return a(c)}if(e=r("filename","i").exec(n),e){e=e[1];let c=s(e);return c=u(c),a(c)}function r(c,h){return new RegExp("(?:^|;)\\s*"+c+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',h)}function i(c,h){if(c){if(!/^[\x00-\xFF]+$/.test(h))return h;try{const f=new TextDecoder(c,{fatal:!0}),d=ug(h);h=f.decode(d),t=!1}catch{}}return h}function a(c){return t&&/[\x80-\xff]/.test(c)&&(c=i("utf-8",c),t&&(c=i("iso-8859-1",c))),c}function o(c){const h=[];let f;const d=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(f=d.exec(c))!==null;){let[,m,y,g]=f;if(m=parseInt(m,10),m in h){if(m===0)break;continue}h[m]=[y,g]}const v=[];for(let m=0;m<h.length&&m in h;++m){let[y,g]=h[m];g=s(g),y&&(g=unescape(g),m===0&&(g=l(g))),v.push(g)}return v.join("")}function s(c){if(c.startsWith('"')){const h=c.slice(1).split('\\"');for(let f=0;f<h.length;++f){const d=h[f].indexOf('"');d!==-1&&(h[f]=h[f].slice(0,d),h.length=f+1),h[f]=h[f].replaceAll(/\\(.)/g,"$1")}c=h.join('"')}return c}function l(c){const h=c.indexOf("'");if(h===-1)return c;const f=c.slice(0,h),v=c.slice(h+1).replace(/^[^']*'/,"");return i(f,v)}function u(c){return!c.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(c)?c:c.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(h,f,d,v){if(d==="q"||d==="Q")return v=v.replaceAll("_"," "),v=v.replaceAll(/=([0-9a-fA-F]{2})/g,function(m,y){return String.fromCharCode(parseInt(y,16))}),i(f,v);try{v=atob(v)}catch{}return i(f,v)})}return""}function RH(n,t){const e=new Headers;if(!n||!t||typeof t!="object")return e;for(const r in t){const i=t[r];i!==void 0&&e.append(r,i)}return e}function d_(n){return URL.parse(n)?.origin??null}function NH({responseHeaders:n,isHttp:t,rangeChunkSize:e,disableRange:r}){const i={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(n.get("Content-Length"),10);return!Number.isInteger(a)||(i.suggestedLength=a,a<=2*e)||r||!t||n.get("Accept-Ranges")!=="bytes"||(n.get("Content-Encoding")||"identity")!=="identity"||(i.allowRangeRequests=!0),i}function OH(n){const t=n.get("Content-Disposition");if(t){let e=Cit(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch{}if(f_(e))return e}return null}function pg(n,t){return new Tv(`Unexpected server response (${n}) while retrieving PDF "${t}".`,n,n===404||n===0&&t.startsWith("file:"))}function BH(n){return n===200||n===206}function FH(n,t,e){return{method:"GET",headers:n,signal:e.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function VH(n){return n instanceof Uint8Array?n.buffer:n instanceof ArrayBuffer?n:(Pe(`getArrayBuffer - unexpected data format: ${n}`),new Uint8Array(n).buffer)}class Eit{_responseOrigin=null;constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.headers=RH(this.isHttp,t.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Qe(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new Mit(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const r=new Pit(this,t,e);return this._rangeRequestReaders.push(r),r}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class Mit{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange;const r=new Headers(t.headers),i=e.url;fetch(i,FH(r,this._withCredentials,this._abortController)).then(a=>{if(t._responseOrigin=d_(a.url),!BH(a.status))throw pg(a.status,i);this._reader=a.body.getReader(),this._headersCapability.resolve();const o=a.headers,{allowRangeRequests:s,suggestedLength:l}=NH({responseHeaders:o,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=s,this._contentLength=l||this._contentLength,this._filename=OH(o),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Vs("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:VH(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class Pit{constructor(t,e,r){this._stream=t,this._reader=null,this._loaded=0;const i=t.source;this._withCredentials=i.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!i.disableStream,this._abortController=new AbortController;const a=new Headers(t.headers);a.append("Range",`bytes=${e}-${r-1}`);const o=i.url;fetch(o,FH(a,this._withCredentials,this._abortController)).then(s=>{const l=d_(s.url);if(l!==t._responseOrigin)throw new Error(`Expected range response-origin "${l}" to match "${t._responseOrigin}".`);if(!BH(s.status))throw pg(s.status,o);this._readCapability.resolve(),this._reader=s.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:VH(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}const j1=200,X1=206;function kit(n){const t=n.response;return typeof t!="string"?t:ug(t).buffer}class Dit{_responseOrigin=null;constructor({url:t,httpHeaders:e,withCredentials:r}){this.url=t,this.isHttp=/^https?:/i.test(t),this.headers=RH(this.isHttp,e),this.withCredentials=r||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(t){const e=new XMLHttpRequest,r=this.currXhrId++,i=this.pendingRequests[r]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const[a,o]of this.headers)e.setRequestHeader(a,o);return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),i.expectedStatus=X1):i.expectedStatus=j1,e.responseType="arraybuffer",Qe(t.onError,"Expected `onError` callback to be provided."),e.onerror=()=>{t.onError(e.status)},e.onreadystatechange=this.onStateChange.bind(this,r),e.onprogress=this.onProgress.bind(this,r),i.onHeadersReceived=t.onHeadersReceived,i.onDone=t.onDone,i.onError=t.onError,i.onProgress=t.onProgress,e.send(null),r}onProgress(t,e){const r=this.pendingRequests[t];r&&r.onProgress?.(e)}onStateChange(t,e){const r=this.pendingRequests[t];if(!r)return;const i=r.xhr;if(i.readyState>=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),i.readyState!==4||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],i.status===0&&this.isHttp){r.onError(i.status);return}const a=i.status||j1;if(!(a===j1&&r.expectedStatus===X1)&&a!==r.expectedStatus){r.onError(i.status);return}const s=kit(i);if(a===X1){const l=i.getResponseHeader("Content-Range"),u=/bytes (\d+)-(\d+)\/(\d+)/.exec(l);u?r.onDone({begin:parseInt(u[1],10),chunk:s}):(Pe('Missing or invalid "Content-Range" header.'),r.onError(0))}else s?r.onDone({begin:0,chunk:s}):r.onError(i.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}class Lit{constructor(t){this._source=t,this._manager=new Dit(t),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return Qe(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new Iit(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const r=new Rit(this._manager,t,e);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class Iit{constructor(t,e){this._manager=t,this._url=e.url,this._fullRequestId=t.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t);this._manager._responseOrigin=d_(e.responseURL);const r=e.getAllResponseHeaders(),i=new Headers(r?r.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(s=>{const[l,...u]=s.split(": ");return[l,u.join(": ")]}):[]),{allowRangeRequests:a,suggestedLength:o}=NH({responseHeaders:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});a&&(this._isRangeSupported=!0),this._contentLength=o||this._contentLength,this._filename=OH(i),this._isRangeSupported&&this._manager.abortRequest(t),this._headersCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=pg(t,this._url),this._headersCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersCapability.reject(t);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class Rit{constructor(t,e,r){this._manager=t,this._url=t.url,this._requestId=t.request({begin:e,end:r,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){const t=d_(this._manager.getRequestXhr(this._requestId)?.responseURL);t!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${t}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(this)}_onDone(t){const e=t.chunk;this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError??=pg(t,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const Nit=/^[a-z][a-z0-9\-+.]+:/i;function Oit(n){if(Nit.test(n))return new URL(n);const t=process.getBuiltinModule("url");return new URL(t.pathToFileURL(n))}class Bit{constructor(t){this.source=t,this.url=Oit(t.url),Qe(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Qe(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new Fit(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const r=new Vit(this,t,e);return this._rangeRequestReaders.push(r),r}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}}class Fit{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const r=process.getBuiltinModule("fs");r.promises.lstat(this._url).then(i=>{this._contentLength=i.size,this._setReadableStream(r.createReadStream(this._url)),this._headersCapability.resolve()},i=>{i.code==="ENOENT"&&(i=pg(0,this._url.href)),this._storedError=i,this._headersCapability.reject(i)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",e=>{this._error(e)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Vs("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class Vit{constructor(t,e,r){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const i=t.source;this._isStreamingSupported=!i.disableStream;const a=process.getBuiltinModule("fs");this._setReadableStream(a.createReadStream(this._url,{start:e,end:r-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();return t===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",e=>{this._error(e)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const Nd=Symbol("INITIAL_DATA");class zH{#t=Object.create(null);#e(t){return this.#t[t]||={...Promise.withResolvers(),data:Nd}}get(t,e=null){if(e){const i=this.#e(t);return i.promise.then(()=>e(i.data)),null}const r=this.#t[t];if(!r||r.data===Nd)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return r.data}has(t){const e=this.#t[t];return!!e&&e.data!==Nd}delete(t){const e=this.#t[t];return!e||e.data===Nd?!1:(delete this.#t[t],!0)}resolve(t,e=null){const r=this.#e(t);r.data=e,r.resolve()}clear(){for(const t in this.#t){const{data:e}=this.#t[t];e?.bitmap?.close()}this.#t=Object.create(null)}*[Symbol.iterator](){for(const t in this.#t){const{data:e}=this.#t[t];e!==Nd&&(yield[t,e])}}}const zit=1e5,eR=30;let Ev=class Ta{#t=Promise.withResolvers();#e=null;#n=!1;#r=!!globalThis.FontInspector?.enabled;#o=null;#i=null;#a=0;#s=0;#u=null;#l=null;#f=0;#h=0;#d=Object.create(null);#g=[];#p=null;#c=[];#v=new WeakMap;#m=null;static#b=new Map;static#y=new Map;static#T=new WeakMap;static#S=null;static#_=new Set;constructor({textContentSource:t,container:e,viewport:r}){if(t instanceof ReadableStream)this.#p=t;else if(typeof t=="object")this.#p=new ReadableStream({start(l){l.enqueue(t),l.close()}});else throw new Error('No "textContentSource" parameter specified.');this.#e=this.#l=e,this.#h=r.scale*vo.pixelRatio,this.#f=r.rotation,this.#i={div:null,properties:null,ctx:null};const{pageWidth:i,pageHeight:a,pageX:o,pageY:s}=r.rawDims;this.#m=[1,0,0,-1,-o,s+a],this.#s=i,this.#a=a,Ta.#P(),Wl(e,r),this.#t.promise.finally(()=>{Ta.#_.delete(this),this.#i=null,this.#d=null}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:t,isFirefox:e}=In.platform;return Oe(this,"fontFamilyMap",new Map([["sans-serif",`${t&&e?"Calibri, ":""}sans-serif`],["monospace",`${t&&e?"Lucida Console, ":""}monospace`]]))}render(){const t=()=>{this.#u.read().then(({value:e,done:r})=>{if(r){this.#t.resolve();return}this.#o??=e.lang,Object.assign(this.#d,e.styles),this.#E(e.items),t()},this.#t.reject)};return this.#u=this.#p.getReader(),Ta.#_.add(this),t(),this.#t.promise}update({viewport:t,onBefore:e=null}){const r=t.scale*vo.pixelRatio,i=t.rotation;if(i!==this.#f&&(e?.(),this.#f=i,Wl(this.#l,{rotation:i})),r!==this.#h){e?.(),this.#h=r;const a={div:null,properties:null,ctx:Ta.#k(this.#o)};for(const o of this.#c)a.properties=this.#v.get(o),a.div=o,this.#A(a)}}cancel(){const t=new Vs("TextLayer task cancelled.");this.#u?.cancel(t).catch(()=>{}),this.#u=null,this.#t.reject(t)}get textDivs(){return this.#c}get textContentItemsStr(){return this.#g}#E(t){if(this.#n)return;this.#i.ctx??=Ta.#k(this.#o);const e=this.#c,r=this.#g;for(const i of t){if(e.length>zit){Pe("Ignoring additional textDivs for performance reasons."),this.#n=!0;return}if(i.str===void 0){if(i.type==="beginMarkedContentProps"||i.type==="beginMarkedContent"){const a=this.#e;this.#e=document.createElement("span"),this.#e.classList.add("markedContent"),i.id&&this.#e.setAttribute("id",`${i.id}`),a.append(this.#e)}else i.type==="endMarkedContent"&&(this.#e=this.#e.parentNode);continue}r.push(i.str),this.#x(i)}}#x(t){const e=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};this.#c.push(e);const i=Qt.transform(this.#m,t.transform);let a=Math.atan2(i[1],i[0]);const o=this.#d[t.fontName];o.vertical&&(a+=Math.PI/2);let s=this.#r&&o.fontSubstitution||o.fontFamily;s=Ta.fontFamilyMap.get(s)||s;const l=Math.hypot(i[2],i[3]),u=l*Ta.#B(s,o,this.#o);let c,h;a===0?(c=i[4],h=i[5]-u):(c=i[4]+u*Math.sin(a),h=i[5]-u*Math.cos(a));const f="calc(var(--total-scale-factor) *",d=e.style;this.#e===this.#l?(d.left=`${(100*c/this.#s).toFixed(2)}%`,d.top=`${(100*h/this.#a).toFixed(2)}%`):(d.left=`${f}${c.toFixed(2)}px)`,d.top=`${f}${h.toFixed(2)}px)`),d.fontSize=`${f}${(Ta.#S*l).toFixed(2)}px)`,d.fontFamily=s,r.fontSize=l,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,this.#r&&(e.dataset.fontName=o.fontSubstitutionLoadedName||t.fontName),a!==0&&(r.angle=a*(180/Math.PI));let v=!1;if(t.str.length>1)v=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const m=Math.abs(t.transform[0]),y=Math.abs(t.transform[3]);m!==y&&Math.max(m,y)/Math.min(m,y)>1.5&&(v=!0)}if(v&&(r.canvasWidth=o.vertical?t.height:t.width),this.#v.set(e,r),this.#i.div=e,this.#i.properties=r,this.#A(this.#i),r.hasText&&this.#e.append(e),r.hasEOL){const m=document.createElement("br");m.setAttribute("role","presentation"),this.#e.append(m)}}#A(t){const{div:e,properties:r,ctx:i}=t,{style:a}=e;let o="";if(Ta.#S>1&&(o=`scale(${1/Ta.#S})`),r.canvasWidth!==0&&r.hasText){const{fontFamily:s}=a,{canvasWidth:l,fontSize:u}=r;Ta.#M(i,u*this.#h,s);const{width:c}=i.measureText(e.textContent);c>0&&(o=`scaleX(${l*this.#h/c}) ${o}`)}r.angle!==0&&(o=`rotate(${r.angle}deg) ${o}`),o.length>0&&(a.transform=o)}static cleanup(){if(!(this.#_.size>0)){this.#b.clear();for(const{canvas:t}of this.#y.values())t.remove();this.#y.clear()}}static#k(t=null){let e=this.#y.get(t||="");if(!e){const r=document.createElement("canvas");r.className="hiddenCanvasElement",r.lang=t,document.body.append(r),e=r.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#y.set(t,e),this.#T.set(e,{size:0,family:""})}return e}static#M(t,e,r){const i=this.#T.get(t);e===i.size&&r===i.family||(t.font=`${e}px ${r}`,i.size=e,i.family=r)}static#P(){if(this.#S!==null)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),this.#S=t.getBoundingClientRect().height,t.remove()}static#B(t,e,r){const i=this.#b.get(t);if(i)return i;const a=this.#k(r);a.canvas.width=a.canvas.height=eR,this.#M(a,eR,t);const o=a.measureText(""),s=o.fontBoundingBoxAscent,l=Math.abs(o.fontBoundingBoxDescent);a.canvas.width=a.canvas.height=0;let u=.8;return s?u=s/(s+l):(In.platform.isFirefox&&Pe("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),e.ascent?u=e.ascent:e.descent&&(u=1+e.descent)),this.#b.set(t,u),u}};const Git=100;function gM(n={}){typeof n=="string"||n instanceof URL?n={url:n}:(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});const t=new mM,{docId:e}=t,r=n.url?qnt(n.url):null,i=n.data?Znt(n.data):null,a=n.httpHeaders||null,o=n.withCredentials===!0,s=n.password??null,l=n.range instanceof yM?n.range:null,u=Number.isInteger(n.rangeChunkSize)&&n.rangeChunkSize>0?n.rangeChunkSize:2**16;let c=n.worker instanceof Mf?n.worker:null;const h=n.verbosity,f=typeof n.docBaseUrl=="string"&&!hg(n.docBaseUrl)?n.docBaseUrl:null,d=$m(n.cMapUrl),v=n.cMapPacked!==!1,m=n.CMapReaderFactory||(ci?nit:GI),y=$m(n.iccUrl),g=$m(n.standardFontDataUrl),p=n.StandardFontDataFactory||(ci?iit:HI),b=$m(n.wasmUrl),w=n.WasmFactory||(ci?ait:UI),x=n.stopAtErrors!==!0,A=Number.isInteger(n.maxImageSize)&&n.maxImageSize>-1?n.maxImageSize:-1,T=n.isEvalSupported!==!1,C=typeof n.isOffscreenCanvasSupported=="boolean"?n.isOffscreenCanvasSupported:!ci,E=typeof n.isImageDecoderSupported=="boolean"?n.isImageDecoderSupported:!ci&&(In.platform.isFirefox||!globalThis.chrome),k=Number.isInteger(n.canvasMaxAreaInBytes)?n.canvasMaxAreaInBytes:-1,D=typeof n.disableFontFace=="boolean"?n.disableFontFace:ci,L=n.fontExtraProperties===!0,R=n.enableXfa===!0,P=n.ownerDocument||globalThis.document,O=n.disableRange===!0,F=n.disableStream===!0,z=n.disableAutoFetch===!0,G=n.pdfBug===!0,U=n.CanvasFactory||(ci?rit:Jnt),K=n.FilterFactory||(ci?eit:tit),W=n.enableHWA===!0,X=n.useWasm!==!1,Q=l?l.length:n.length??NaN,at=typeof n.useSystemFonts=="boolean"?n.useSystemFonts:!ci&&!D,rt=typeof n.useWorkerFetch=="boolean"?n.useWorkerFetch:!!(m===GI&&p===HI&&w===UI&&d&&g&&b&&Ip(d,document.baseURI)&&Ip(g,document.baseURI)&&Ip(b,document.baseURI)),Rt=null;knt(h);const Mt={canvasFactory:new U({ownerDocument:P,enableHWA:W}),filterFactory:new K({docId:e,ownerDocument:P}),cMapReaderFactory:rt?null:new m({baseUrl:d,isCompressed:v}),standardFontDataFactory:rt?null:new p({baseUrl:g}),wasmFactory:rt?null:new w({baseUrl:b})};c||(c=Mf.create({verbosity:h,port:Fl.workerPort}),t._worker=c);const xt={docId:e,apiVersion:"5.4.296",data:i,password:s,disableAutoFetch:z,rangeChunkSize:u,length:Q,docBaseUrl:f,enableXfa:R,evaluatorOptions:{maxImageSize:A,disableFontFace:D,ignoreErrors:x,isEvalSupported:T,isOffscreenCanvasSupported:C,isImageDecoderSupported:E,canvasMaxAreaInBytes:k,fontExtraProperties:L,useSystemFonts:at,useWasm:X,useWorkerFetch:rt,cMapUrl:d,iccUrl:y,standardFontDataUrl:g,wasmUrl:b}},vt={ownerDocument:P,pdfBug:G,styleElement:Rt,loadingParams:{disableAutoFetch:z,enableXfa:R}};return c.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(c.destroyed)throw new Error("Worker was destroyed");const Et=c.messageHandler.sendWithPromise("GetDocRequest",xt,i?[i.buffer]:null);let _t;if(l)_t=new Sit(l,{disableRange:O,disableStream:F});else if(!i){if(!r)throw new Error("getDocument - no `url` parameter provided.");const Dt=Ip(r)?Eit:ci?Bit:Lit;_t=new Dt({url:r,length:Q,httpHeaders:a,withCredentials:o,rangeChunkSize:u,disableRange:O,disableStream:F})}return Et.then(Dt=>{if(t.destroyed)throw new Error("Loading aborted");if(c.destroyed)throw new Error("Worker was destroyed");const zt=new Rp(e,Dt,c.port),N=new Wit(zt,t,_t,vt,Mt,W);t._transport=N,zt.send("Ready",null)})}).catch(t._capability.reject),t}class mM{static#t=0;_capability=Promise.withResolvers();_transport=null;_worker=null;docId=`d${mM.#t++}`;destroyed=!1;onPassword=null;onProgress=null;get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}}let yM=class{#t=Promise.withResolvers();#e=[];#n=[];#r=[];#o=[];constructor(t,e,r=!1,i=null){this.length=t,this.initialData=e,this.progressiveDone=r,this.contentDispositionFilename=i}addRangeListener(t){this.#o.push(t)}addProgressListener(t){this.#r.push(t)}addProgressiveReadListener(t){this.#n.push(t)}addProgressiveDoneListener(t){this.#e.push(t)}onDataRange(t,e){for(const r of this.#o)r(t,e)}onDataProgress(t,e){this.#t.promise.then(()=>{for(const r of this.#r)r(t,e)})}onDataProgressiveRead(t){this.#t.promise.then(()=>{for(const e of this.#n)e(t)})}onDataProgressiveDone(){this.#t.promise.then(()=>{for(const t of this.#e)t()})}transportReady(){this.#t.resolve()}requestDataRange(t,e){_r("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};class Hit{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return Oe(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getAnnotationsByType(t,e){return this._transport.getAnnotationsByType(t,e)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(t=!1){return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class Uit{#t=!1;constructor(t,e,r,i=!1){this._pageIndex=t,this._pageInfo=e,this._transport=r,this._stats=i?new RI:null,this._pdfBug=i,this.commonObjs=r.commonObjs,this.objs=new zH,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:t,rotation:e=this.rotate,offsetX:r=0,offsetY:i=0,dontFlip:a=!1}={}){return new cg({viewBox:this.view,userUnit:this.userUnit,scale:t,rotation:e,offsetX:r,offsetY:i,dontFlip:a})}getAnnotations({intent:t="display"}={}){const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return Oe(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:t,canvas:e=t.canvas,viewport:r,intent:i="display",annotationMode:a=Go.ENABLE,transform:o=null,background:s=null,optionalContentConfigPromise:l=null,annotationCanvasMap:u=null,pageColors:c=null,printAnnotationStorage:h=null,isEditing:f=!1,recordOperations:d=!1,operationsFilter:v=null}){this._stats?.time("Overall");const m=this._transport.getRenderingIntent(i,a,h,f),{renderingIntent:y,cacheKey:g}=m;this.#t=!1,l||=this._transport.getOptionalContentConfig(y);let p=this._intentStates.get(g);p||(p=Object.create(null),this._intentStates.set(g,p)),p.streamReaderCancelTimeout&&(clearTimeout(p.streamReaderCancelTimeout),p.streamReaderCancelTimeout=null);const b=!!(y&Ji.PRINT);p.displayReadyCapability||(p.displayReadyCapability=Promise.withResolvers(),p.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(m));const w=!!(this._pdfBug&&globalThis.StepperManager?.enabled),x=!this.recordedBBoxes&&(d||w),A=E=>{if(p.renderTasks.delete(T),x){const k=T.gfx?.dependencyTracker.take();k&&(T.stepper&&T.stepper.setOperatorBBoxes(k,T.gfx.dependencyTracker.takeDebugMetadata()),d&&(this.recordedBBoxes=k))}b&&(this.#t=!0),this.#e(),E?(T.capability.reject(E),this._abortOperatorList({intentState:p,reason:E instanceof Error?E:new Error(E)})):T.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},T=new af({callback:A,params:{canvas:e,canvasContext:t,dependencyTracker:x?new sit(e,p.operatorList.length,w):null,viewport:r,transform:o,background:s},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:u,operatorList:p.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!b,pdfBug:this._pdfBug,pageColors:c,enableHWA:this._transport.enableHWA,operationsFilter:v});(p.renderTasks||=new Set).add(T);const C=T.task;return Promise.all([p.displayReadyCapability.promise,l]).then(([E,k])=>{if(this.destroyed){A();return}if(this._stats?.time("Rendering"),!(k.renderingIntent&y))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");T.initializeGraphics({transparency:E,optionalContentConfig:k}),T.operatorListChanged()}).catch(A),C}getOperatorList({intent:t="display",annotationMode:e=Go.ENABLE,printAnnotationStorage:r=null,isEditing:i=!1}={}){function a(){s.operatorList.lastChunk&&(s.opListReadCapability.resolve(s.operatorList),s.renderTasks.delete(l))}const o=this._transport.getRenderingIntent(t,e,r,i,!0);let s=this._intentStates.get(o.cacheKey);s||(s=Object.create(null),this._intentStates.set(o.cacheKey,s));let l;return s.opListReadCapability||(l=Object.create(null),l.operatorListChanged=a,s.opListReadCapability=Promise.withResolvers(),(s.renderTasks||=new Set).add(l),s.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(o)),s.opListReadCapability.promise}streamTextContent({includeMarkedContent:t=!1,disableNormalization:e=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:t===!0,disableNormalization:e===!0},{highWaterMark:100,size(i){return i.items.length}})}getTextContent(t={}){if(this._transport._htmlForXfa)return this.getXfa().then(r=>Cv.textContent(r));const e=this.streamTextContent(t);return new Promise(function(r,i){function a(){o.read().then(function({value:l,done:u}){if(u){r(s);return}s.lang??=l.lang,Object.assign(s.styles,l.styles),s.items.push(...l.items),a()},i)}const o=e.getReader(),s={items:[],styles:Object.create(null),lang:null};a()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const r of e.renderTasks)t.push(r.completed),r.cancel();return this.objs.clear(),this.#t=!1,Promise.all(t)}cleanup(t=!1){this.#t=!0;const e=this.#e();return t&&e&&(this._stats&&=new RI),e}#e(){if(!this.#t||this.destroyed)return!1;for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#t=!1,!0}_startRenderPage(t,e){const r=this._intentStates.get(e);r&&(this._stats?.timeEnd("Page Request"),r.displayReadyCapability?.resolve(t))}_renderPageChunk(t,e){for(let r=0,i=t.length;r<i;r++)e.operatorList.fnArray.push(t.fnArray[r]),e.operatorList.argsArray.push(t.argsArray[r]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(const r of e.renderTasks)r.operatorListChanged();t.lastChunk&&this.#e()}_pumpOperatorList({renderingIntent:t,cacheKey:e,annotationStorageSerializable:r,modifiedIds:i}){const{map:a,transfer:o}=r,l=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:a,modifiedIds:i},o).getReader(),u=this._intentStates.get(e);u.streamReader=l;const c=()=>{l.read().then(({value:h,done:f})=>{if(f){u.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(h,u),c())},h=>{if(u.streamReader=null,!this._transport.destroyed){if(u.operatorList){u.operatorList.lastChunk=!0;for(const f of u.renderTasks)f.operatorListChanged();this.#e()}if(u.displayReadyCapability)u.displayReadyCapability.reject(h);else if(u.opListReadCapability)u.opListReadCapability.reject(h);else throw h}})};c()}_abortOperatorList({intentState:t,reason:e,force:r=!1}){if(t.streamReader){if(t.streamReaderCancelTimeout&&(clearTimeout(t.streamReaderCancelTimeout),t.streamReaderCancelTimeout=null),!r){if(t.renderTasks.size>0)return;if(e instanceof h_){let i=Git;e.extraDelay>0&&e.extraDelay<1e3&&(i+=e.extraDelay),t.streamReaderCancelTimeout=setTimeout(()=>{t.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:t,reason:e,force:!0})},i);return}}if(t.streamReader.cancel(new Vs(e.message)).catch(()=>{}),t.streamReader=null,!this._transport.destroyed){for(const[i,a]of this._intentStates)if(a===t){this._intentStates.delete(i);break}this.cleanup()}}}get stats(){return this._stats}}var El,oo,Ts,fc,a_,dc,pc,mi,v0,GH,HH,Np,Af,g0;const Dr=class Dr{constructor({name:t=null,port:e=null,verbosity:r=Dnt()}={}){Ao(this,mi);Ao(this,El,Promise.withResolvers());Ao(this,oo,null);Ao(this,Ts,null);Ao(this,fc,null);if(this.name=t,this.destroyed=!1,this.verbosity=r,e){if(kr(Dr,pc).has(e))throw new Error("Cannot use more than one PDFWorker per port.");kr(Dr,pc).set(e,this),To(this,mi,GH).call(this,e)}else To(this,mi,HH).call(this)}get promise(){return kr(this,El).promise}get port(){return kr(this,Ts)}get messageHandler(){return kr(this,oo)}destroy(){this.destroyed=!0,kr(this,fc)?.terminate(),Ni(this,fc,null),kr(Dr,pc).delete(kr(this,Ts)),Ni(this,Ts,null),kr(this,oo)?.destroy(),Ni(this,oo,null)}static create(t){const e=kr(this,pc).get(t?.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new Dr(t)}static get workerSrc(){if(Fl.workerSrc)return Fl.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Oe(this,"_setupFakeWorkerGlobal",(async()=>kr(this,Af,g0)?kr(this,Af,g0):(await import(this.workerSrc)).WorkerMessageHandler)())}};El=new WeakMap,oo=new WeakMap,Ts=new WeakMap,fc=new WeakMap,a_=new WeakMap,dc=new WeakMap,pc=new WeakMap,mi=new WeakSet,v0=function(){kr(this,El).resolve(),kr(this,oo).send("configure",{verbosity:this.verbosity})},GH=function(t){Ni(this,Ts,t),Ni(this,oo,new Rp("main","worker",t)),kr(this,oo).on("ready",()=>{}),To(this,mi,v0).call(this)},HH=function(){if(kr(Dr,dc)||kr(Dr,Af,g0)){To(this,mi,Np).call(this);return}let{workerSrc:t}=Dr;try{Dr._isSameOrigin(window.location,t)||(t=Dr._createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),r=new Rp("main","worker",e),i=()=>{a.abort(),r.destroy(),e.terminate(),this.destroyed?kr(this,El).reject(new Error("Worker was destroyed")):To(this,mi,Np).call(this)},a=new AbortController;e.addEventListener("error",()=>{kr(this,fc)||i()},{signal:a.signal}),r.on("test",s=>{if(a.abort(),this.destroyed||!s){i();return}Ni(this,oo,r),Ni(this,Ts,e),Ni(this,fc,e),To(this,mi,v0).call(this)}),r.on("ready",s=>{if(a.abort(),this.destroyed){i();return}try{o()}catch{To(this,mi,Np).call(this)}});const o=()=>{const s=new Uint8Array;r.send("test",s,[s.buffer])};o();return}catch{c_("The worker has been disabled.")}To(this,mi,Np).call(this)},Np=function(){kr(Dr,dc)||(Pe("Setting up fake worker."),Ni(Dr,dc,!0)),Dr._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){kr(this,El).reject(new Error("Worker was destroyed"));return}const e=new Qnt;Ni(this,Ts,e);const r=`fake${yL(Dr,a_)._++}`,i=new Rp(r+"_worker",r,e);t.setup(i,e),Ni(this,oo,new Rp(r,r+"_worker",e)),To(this,mi,v0).call(this)}).catch(t=>{kr(this,El).reject(new Error(`Setting up fake worker failed: "${t.message}".`))})},Af=new WeakSet,g0=function(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}},Ao(Dr,Af),Ao(Dr,a_,0),Ao(Dr,dc,!1),Ao(Dr,pc,new WeakMap),ci&&(Ni(Dr,dc,!0),Fl.workerSrc||="./pdf.worker.mjs"),Dr._isSameOrigin=(t,e)=>{const r=URL.parse(t);if(!r?.origin||r.origin==="null")return!1;const i=new URL(e,r);return r.origin===i.origin},Dr._createCDNWrapper=t=>{const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},Dr.fromPort=t=>{if(znt("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return Dr.create(t)};let Mf=Dr;class Wit{#t=new Map;#e=new Map;#n=new Map;#r=new Map;#o=null;constructor(t,e,r,i,a,o){this.messageHandler=t,this.loadingTask=e,this.commonObjs=new zH,this.fontLoader=new Xnt({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this.loadingParams=i.loadingParams,this._params=i,this.canvasFactory=a.canvasFactory,this.filterFactory=a.filterFactory,this.cMapReaderFactory=a.cMapReaderFactory,this.standardFontDataFactory=a.standardFontDataFactory,this.wasmFactory=a.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=o,this.setupMessageHandler()}#i(t,e=null){const r=this.#t.get(t);if(r)return r;const i=this.messageHandler.sendWithPromise(t,e);return this.#t.set(t,i),i}get annotationStorage(){return Oe(this,"annotationStorage",new fM)}getRenderingIntent(t,e=Go.ENABLE,r=null,i=!1,a=!1){let o=Ji.DISPLAY,s=gT;switch(t){case"any":o=Ji.ANY;break;case"display":break;case"print":o=Ji.PRINT;break;default:Pe(`getRenderingIntent - invalid intent: ${t}`)}const l=o&Ji.PRINT&&r instanceof EH?r:this.annotationStorage;switch(e){case Go.DISABLE:o+=Ji.ANNOTATIONS_DISABLE;break;case Go.ENABLE:break;case Go.ENABLE_FORMS:o+=Ji.ANNOTATIONS_FORMS;break;case Go.ENABLE_STORAGE:o+=Ji.ANNOTATIONS_STORAGE,s=l.serializable;break;default:Pe(`getRenderingIntent - invalid annotationMode: ${e}`)}i&&(o+=Ji.IS_EDITING),a&&(o+=Ji.OPLIST);const{ids:u,hash:c}=l.modifiedIds,h=[o,s.hash,c];return{renderingIntent:o,cacheKey:h.join("_"),annotationStorageSerializable:s,modifiedIds:u}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#o?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const r of this.#e.values())t.push(r._destroy());this.#e.clear(),this.#n.clear(),this.#r.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);return t.push(e),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#t.clear(),this.filterFactory.destroy(),Ev.cleanup(),this._networkStream?.cancelAllRequests(new Vs("Worker was terminated.")),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",(r,i)=>{Qe(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=a=>{this._lastProgress={loaded:a.loaded,total:a.total}},i.onPull=()=>{this._fullReader.read().then(function({value:a,done:o}){if(o){i.close();return}Qe(a instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(a),1,[a])}).catch(a=>{i.error(a)})},i.onCancel=a=>{this._fullReader.cancel(a),i.ready.catch(o=>{if(!this.destroyed)throw o})}}),t.on("ReaderHeadersReady",async r=>{await this._fullReader.headersReady;const{isStreamingSupported:i,isRangeSupported:a,contentLength:o}=this._fullReader;return(!i||!a)&&(this._lastProgress&&e.onProgress?.(this._lastProgress),this._fullReader.onProgress=s=>{e.onProgress?.({loaded:s.loaded,total:s.total})}),{isStreamingSupported:i,isRangeSupported:a,contentLength:o}}),t.on("GetRangeReader",(r,i)=>{Qe(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const a=this._networkStream.getRangeReader(r.begin,r.end);if(!a){i.close();return}i.onPull=()=>{a.read().then(function({value:o,done:s}){if(s){i.close();return}Qe(o instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(o),1,[o])}).catch(o=>{i.error(o)})},i.onCancel=o=>{a.cancel(o),i.ready.catch(s=>{if(!this.destroyed)throw s})}}),t.on("GetDoc",({pdfInfo:r})=>{this._numPages=r.numPages,this._htmlForXfa=r.htmlForXfa,delete r.htmlForXfa,e._capability.resolve(new Hit(r,this))}),t.on("DocException",r=>{e._capability.reject(Fi(r))}),t.on("PasswordRequest",r=>{this.#o=Promise.withResolvers();try{if(!e.onPassword)throw Fi(r);const i=a=>{a instanceof Error?this.#o.reject(a):this.#o.resolve({password:a})};e.onPassword(i,r.code)}catch(i){this.#o.reject(i)}return this.#o.promise}),t.on("DataLoaded",r=>{e.onProgress?.({loaded:r.length,total:r.length}),this.downloadInfoCapability.resolve(r)}),t.on("StartRenderPage",r=>{if(this.destroyed)return;this.#e.get(r.pageIndex)._startRenderPage(r.transparency,r.cacheKey)}),t.on("commonobj",([r,i,a])=>{if(this.destroyed||this.commonObjs.has(r))return null;switch(i){case"Font":if("error"in a){const c=a.error;Pe(`Error during font loading: ${c}`),this.commonObjs.resolve(r,c);break}const o=new vr(a),s=this._params.pdfBug&&globalThis.FontInspector?.enabled?(c,h)=>globalThis.FontInspector.fontAdded(c,h):null,l=new Ynt(o,s,a.extra,a.charProcOperatorList);this.fontLoader.bind(l).catch(()=>t.sendWithPromise("FontFallback",{id:r})).finally(()=>{!l.fontExtraProperties&&l.data&&l.clearData(),this.commonObjs.resolve(r,l)});break;case"CopyLocalImage":const{imageRef:u}=a;Qe(u,"The imageRef must be defined.");for(const c of this.#e.values())for(const[,h]of c.objs)if(h?.ref===u)return h.dataLen?(this.commonObjs.resolve(r,structuredClone(h)),h.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(r,a);break;default:throw new Error(`Got unknown common object type ${i}`)}return null}),t.on("obj",([r,i,a,o])=>{if(this.destroyed)return;const s=this.#e.get(i);if(!s.objs.has(r)){if(s._intentStates.size===0){o?.bitmap?.close();return}switch(a){case"Image":case"Pattern":s.objs.resolve(r,o);break;default:throw new Error(`Got unknown object type ${a}`)}}}),t.on("DocProgress",r=>{this.destroyed||e.onProgress?.({loaded:r.loaded,total:r.total})}),t.on("FetchBinaryData",async r=>{if(this.destroyed)throw new Error("Worker was destroyed.");const i=this[r.type];if(!i)throw new Error(`${r.type} not initialized, see the \`useWorkerFetch\` parameter.`);return i.fetch(r)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&Pe("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:t,transfer:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},e).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,r=this.#n.get(e);if(r)return r;const i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(a=>{if(this.destroyed)throw new Error("Transport destroyed");a.refStr&&this.#r.set(a.refStr,t);const o=new Uit(e,a,this,this._params.pdfBug);return this.#e.set(e,o),o});return this.#n.set(e,i),i}getPageIndex(t){return mT(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return this.#i("GetFieldObjects")}hasJSActions(){return this.#i("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return typeof t!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getAnnotationsByType(t,e){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:t,pageIndexesToSkip:e})}getDocJSActions(){return this.#i("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return this.#i("GetOptionalContentConfig").then(e=>new xit(e,t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=this.#t.get(t);if(e)return e;const r=this.messageHandler.sendWithPromise(t,null).then(i=>({info:i[0],metadata:i[1]?new _it(i[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#t.set(t,r),r}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(t=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const e of this.#e.values())if(!e.cleanup())throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#t.clear(),this.filterFactory.destroy(!0),Ev.cleanup()}}cachedPageNumber(t){if(!mT(t))return null;const e=t.gen===0?`${t.num}R`:`${t.num}R${t.gen}`;return this.#r.get(e)??null}}class $it{#t=null;onContinue=null;onError=null;constructor(t){this.#t=t}get promise(){return this.#t.capability.promise}cancel(t=0){this.#t.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#t.operatorList;if(!t)return!1;const{annotationCanvasMap:e}=this.#t;return t.form||t.canvas&&e?.size>0}}class af{#t=null;static#e=new WeakSet;constructor({callback:t,params:e,objs:r,commonObjs:i,annotationCanvasMap:a,operatorList:o,pageIndex:s,canvasFactory:l,filterFactory:u,useRequestAnimationFrame:c=!1,pdfBug:h=!1,pageColors:f=null,enableHWA:d=!1,operationsFilter:v=null}){this.callback=t,this.params=e,this.objs=r,this.commonObjs=i,this.annotationCanvasMap=a,this.operatorListIdx=null,this.operatorList=o,this._pageIndex=s,this.canvasFactory=l,this.filterFactory=u,this._pdfBug=h,this.pageColors=f,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=c===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new $it(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=e.canvas,this._canvasContext=e.canvas?null:e.canvasContext,this._enableHWA=d,this._dependencyTracker=e.dependencyTracker,this._operationsFilter=v}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:e}){if(this.cancelled)return;if(this._canvas){if(af.#e.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");af.#e.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:r,transform:i,background:a,dependencyTracker:o}=this.params,s=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new df(s,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors,o),this.gfx.beginDrawing({transform:i,viewport:r,transparency:t,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,e=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#t&&(window.cancelAnimationFrame(this.#t),this.#t=null),af.#e.delete(this._canvas),t||=new h_(`Rendering cancelled, page ${this._pageIndex+1}`,e),this.callback(t),this.task.onError?.(t)}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.gfx.dependencyTracker?.growOperationsCount(this.operatorList.fnArray.length),this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#t=window.requestAnimationFrame(()=>{this.#t=null,this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper,this._operationsFilter),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),af.#e.delete(this._canvas),this.callback())))}}const bM="5.4.296",UH="f56dc8601";class ta{#t=null;#e=null;#n;#r=null;#o=!1;#i=!1;#a=null;#s;#u=null;#l=null;static#f=null;static get _keyboardManager(){return Oe(this,"_keyboardManager",new fg([[["Escape","mac+Escape"],ta.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],ta.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],ta.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],ta.prototype._moveToPrevious],[["Home","mac+Home"],ta.prototype._moveToBeginning],[["End","mac+End"],ta.prototype._moveToEnd]]))}constructor({editor:t=null,uiManager:e=null}){t?(this.#i=!1,this.#a=t):this.#i=!0,this.#l=t?._uiManager||e,this.#s=this.#l._eventBus,this.#n=t?.color?.toUpperCase()||this.#l?.highlightColors.values().next().value||"#FFFF98",ta.#f||=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"})}renderButton(){const t=this.#t=document.createElement("button");t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.ariaHasPopup="true",this.#a&&(t.ariaControls=`${this.#a.id}_colorpicker_dropdown`);const e=this.#l._signal;t.addEventListener("click",this.#p.bind(this),{signal:e}),t.addEventListener("keydown",this.#g.bind(this),{signal:e});const r=this.#e=document.createElement("span");return r.className="swatch",r.ariaHidden="true",r.style.backgroundColor=this.#n,t.append(r),t}renderMainDropdown(){const t=this.#r=this.#h();return t.ariaOrientation="horizontal",t.ariaLabelledBy="highlightColorPickerLabel",t}#h(){const t=document.createElement("div"),e=this.#l._signal;t.addEventListener("contextmenu",sa,{signal:e}),t.className="dropdown",t.role="listbox",t.ariaMultiSelectable="false",t.ariaOrientation="vertical",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),this.#a&&(t.id=`${this.#a.id}_colorpicker_dropdown`);for(const[r,i]of this.#l.highlightColors){const a=document.createElement("button");a.tabIndex="0",a.role="option",a.setAttribute("data-color",i),a.title=r,a.setAttribute("data-l10n-id",ta.#f[r]);const o=document.createElement("span");a.append(o),o.className="swatch",o.style.backgroundColor=i,a.ariaSelected=i===this.#n,a.addEventListener("click",this.#d.bind(this,i),{signal:e}),t.append(a)}return t.addEventListener("keydown",this.#g.bind(this),{signal:e}),t}#d(t,e){e.stopPropagation(),this.#s.dispatch("switchannotationeditorparams",{source:this,type:Xe.HIGHLIGHT_COLOR,value:t}),this.updateColor(t)}_colorSelectFromKeyboard(t){if(t.target===this.#t){this.#p(t);return}const e=t.target.getAttribute("data-color");e&&this.#d(e,t)}_moveToNext(t){if(!this.#v){this.#p(t);return}if(t.target===this.#t){this.#r.firstChild?.focus();return}t.target.nextSibling?.focus()}_moveToPrevious(t){if(t.target===this.#r?.firstChild||t.target===this.#t){this.#v&&this._hideDropdownFromKeyboard();return}this.#v||this.#p(t),t.target.previousSibling?.focus()}_moveToBeginning(t){if(!this.#v){this.#p(t);return}this.#r.firstChild?.focus()}_moveToEnd(t){if(!this.#v){this.#p(t);return}this.#r.lastChild?.focus()}#g(t){ta._keyboardManager.exec(this,t)}#p(t){if(this.#v){this.hideDropdown();return}if(this.#o=t.detail===0,this.#u||(this.#u=new AbortController,window.addEventListener("pointerdown",this.#c.bind(this),{signal:this.#l.combinedSignal(this.#u)})),this.#t.ariaExpanded="true",this.#r){this.#r.classList.remove("hidden");return}const e=this.#r=this.#h();this.#t.append(e)}#c(t){this.#r?.contains(t.target)||this.hideDropdown()}hideDropdown(){this.#r?.classList.add("hidden"),this.#t.ariaExpanded="false",this.#u?.abort(),this.#u=null}get#v(){return this.#r&&!this.#r.classList.contains("hidden")}_hideDropdownFromKeyboard(){if(!this.#i){if(!this.#v){this.#a?.unselect();return}this.hideDropdown(),this.#t.focus({preventScroll:!0,focusVisible:this.#o})}}updateColor(t){if(this.#e&&(this.#e.style.backgroundColor=t),!this.#r)return;const e=this.#l.highlightColors.values();for(const r of this.#r.children)r.ariaSelected=e.next().value===t.toUpperCase()}destroy(){this.#t?.remove(),this.#t=null,this.#e=null,this.#r?.remove(),this.#r=null}}class Mv{#t=null;#e=null;#n=null;static#r=null;constructor(t){this.#e=t,this.#n=t._uiManager,Mv.#r||=Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"})}renderButton(){if(this.#t)return this.#t;const{editorType:t,colorType:e,colorValue:r}=this.#e,i=this.#t=document.createElement("input");return i.type="color",i.value=r||"#000000",i.className="basicColorPicker",i.tabIndex=0,i.setAttribute("data-l10n-id",Mv.#r[t]),i.addEventListener("input",()=>{this.#n.updateParams(e,i.value)},{signal:this.#n._signal}),i}update(t){this.#t&&(this.#t.value=t)}destroy(){this.#t?.remove(),this.#t=null}hideDropdown(){}}function rR(n){return Math.floor(Math.max(0,Math.min(1,n))*255).toString(16).padStart(2,"0")}function Od(n){return Math.max(0,Math.min(255,255*n))}class nR{static CMYK_G([t,e,r,i]){return["G",1-Math.min(1,.3*t+.59*r+.11*e+i)]}static G_CMYK([t]){return["CMYK",0,0,0,1-t]}static G_RGB([t]){return["RGB",t,t,t]}static G_rgb([t]){return t=Od(t),[t,t,t]}static G_HTML([t]){const e=rR(t);return`#${e}${e}${e}`}static RGB_G([t,e,r]){return["G",.3*t+.59*e+.11*r]}static RGB_rgb(t){return t.map(Od)}static RGB_HTML(t){return`#${t.map(rR).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([t,e,r,i]){return["RGB",1-Math.min(1,t+i),1-Math.min(1,r+i),1-Math.min(1,e+i)]}static CMYK_rgb([t,e,r,i]){return[Od(1-Math.min(1,t+i)),Od(1-Math.min(1,r+i)),Od(1-Math.min(1,e+i))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK([t,e,r]){const i=1-t,a=1-e,o=1-r,s=Math.min(i,a,o);return["CMYK",i,a,o,s]}}class jit{create(t,e,r=!1){if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),r||(i.setAttribute("width",`${t}px`),i.setAttribute("height",`${e}px`)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${t} ${e}`),i}createElement(t){if(typeof t!="string")throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){_r("Abstract method `_createSVG` called.")}}class Pv extends jit{_createSVG(t){return document.createElementNS(ws,t)}}const Xit=9,Ec=new WeakSet,Yit=new Date().getTimezoneOffset()*60*1e3;class iR{static create(t){switch(t.data.annotationType){case Zr.LINK:return new _M(t);case Zr.TEXT:return new Zit(t);case Zr.WIDGET:switch(t.data.fieldType){case"Tx":return new Kit(t);case"Btn":return t.data.radioButton?new WH(t):t.data.checkBox?new Jit(t):new tat(t);case"Ch":return new eat(t);case"Sig":return new Qit(t)}return new zc(t);case Zr.POPUP:return new _T(t);case Zr.FREETEXT:return new $H(t);case Zr.LINE:return new nat(t);case Zr.SQUARE:return new iat(t);case Zr.CIRCLE:return new aat(t);case Zr.POLYLINE:return new jH(t);case Zr.CARET:return new sat(t);case Zr.INK:return new wM(t);case Zr.POLYGON:return new oat(t);case Zr.HIGHLIGHT:return new XH(t);case Zr.UNDERLINE:return new lat(t);case Zr.SQUIGGLY:return new uat(t);case Zr.STRIKEOUT:return new cat(t);case Zr.STAMP:return new YH(t);case Zr.FILEATTACHMENT:return new hat(t);default:return new zr(t)}}}class zr{#t=null;#e=!1;#n=null;constructor(t,{isRenderable:e=!1,ignoreBorder:r=!1,createQuadrilaterals:i=!1}={}){this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableComment=t.enableComment,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,e&&(this.container=this._createContainer(r)),i&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:t,richText:e}){return!!(t?.str||e?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return zr._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){const{data:t}=this,e=this.annotationStorage?.getEditor(t.id);return e?e.getData():t}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){const t=this.annotationStorage?.getEditor(this.data.id);if(t)return t.commentButtonPositionInPage;const{quadPoints:e,inkLists:r,rect:i}=this.data;let a=-1/0,o=-1/0;if(e?.length>=8){for(let s=0;s<e.length;s+=8)e[s+1]>o?(o=e[s+1],a=e[s+2]):e[s+1]===o&&(a=Math.max(a,e[s+2]));return[a,o]}if(r?.length>=1){for(const s of r)for(let l=0,u=s.length;l<u;l+=2)s[l+1]>o?(o=s[l+1],a=s[l]):s[l+1]===o&&(a=Math.max(a,s[l]));if(a!==1/0)return[a,o]}return i?[i[2],i[3]]:null}_normalizePoint(t){const{page:{view:e},viewport:{rawDims:{pageWidth:r,pageHeight:i,pageX:a,pageY:o}}}=this.parent;return t[1]=e[3]-t[1]+e[1],t[0]=100*(t[0]-a)/r,t[1]=100*(t[1]-o)/i,t}get commentText(){const{data:t}=this;return this.annotationStorage.getRawValue(`${Av}${t.id}`)?.popup?.contents||t.contentsObj?.str||""}set commentText(t){const{data:e}=this,r={deleted:!t,contents:t||""};this.annotationStorage.updateEditor(e.id,{popup:r})||this.annotationStorage.setValue(`${Av}${e.id}`,{id:e.id,annotationType:e.annotationType,pageIndex:this.parent.page._pageIndex,popup:r,popupRef:e.popupRef,modificationDate:new Date}),t||this.removePopup()}removePopup(){(this.#n?.popup||this.popup)?.remove(),this.#n=this.popup=null}updateEdited(t){if(!this.container)return;t.rect&&(this.#t||={rect:this.data.rect.slice(0)});const{rect:e,popup:r}=t;e&&this.#r(e);let i=this.#n?.popup||this.popup;!i&&r?.text&&(this._createPopup(r),i=this.#n.popup),i&&(i.updateEdited(t),r?.deleted&&(i.remove(),this.#n=null,this.popup=null))}resetEdited(){this.#t&&(this.#r(this.#t.rect),this.#n?.popup.resetEdited(),this.#t=null)}#r(t){const{container:{style:e},data:{rect:r,rotation:i},parent:{viewport:{rawDims:{pageWidth:a,pageHeight:o,pageX:s,pageY:l}}}}=this;r?.splice(0,4,...t),e.left=`${100*(t[0]-s)/a}%`,e.top=`${100*(o-t[3]+l)/o}%`,i===0?(e.width=`${100*(t[2]-t[0])/a}%`,e.height=`${100*(t[3]-t[1])/o}%`):this.setRotation(i)}_createContainer(t){const{data:e,parent:{page:r,viewport:i}}=this,a=document.createElement("section");a.setAttribute("data-annotation-id",e.id),!(this instanceof zc)&&!(this instanceof _M)&&(a.tabIndex=0);const{style:o}=a;if(o.zIndex=this.parent.zIndex,this.parent.zIndex+=2,e.alternativeText&&(a.title=e.alternativeText),e.noRotate&&a.classList.add("norotate"),!e.rect||this instanceof _T){const{rotation:m}=e;return!e.hasOwnCanvas&&m!==0&&this.setRotation(m,a),a}const{width:s,height:l}=this;if(!t&&e.borderStyle.width>0){o.borderWidth=`${e.borderStyle.width}px`;const m=e.borderStyle.horizontalCornerRadius,y=e.borderStyle.verticalCornerRadius;if(m>0||y>0){const p=`calc(${m}px * var(--total-scale-factor)) / calc(${y}px * var(--total-scale-factor))`;o.borderRadius=p}else if(this instanceof WH){const p=`calc(${s}px * var(--total-scale-factor)) / calc(${l}px * var(--total-scale-factor))`;o.borderRadius=p}switch(e.borderStyle.style){case Uh.SOLID:o.borderStyle="solid";break;case Uh.DASHED:o.borderStyle="dashed";break;case Uh.BEVELED:Pe("Unimplemented border style: beveled");break;case Uh.INSET:Pe("Unimplemented border style: inset");break;case Uh.UNDERLINE:o.borderBottomStyle="solid";break}const g=e.borderColor||null;g?(this.#e=!0,o.borderColor=Qt.makeHexColor(g[0]|0,g[1]|0,g[2]|0)):o.borderWidth=0}const u=Qt.normalizeRect([e.rect[0],r.view[3]-e.rect[1]+r.view[1],e.rect[2],r.view[3]-e.rect[3]+r.view[1]]),{pageWidth:c,pageHeight:h,pageX:f,pageY:d}=i.rawDims;o.left=`${100*(u[0]-f)/c}%`,o.top=`${100*(u[1]-d)/h}%`;const{rotation:v}=e;return e.hasOwnCanvas||v===0?(o.width=`${100*s/c}%`,o.height=`${100*l/h}%`):this.setRotation(v,a),a}setRotation(t,e=this.container){if(!this.data.rect)return;const{pageWidth:r,pageHeight:i}=this.parent.viewport.rawDims;let{width:a,height:o}=this;t%180!==0&&([a,o]=[o,a]),e.style.width=`${100*a/r}%`,e.style.height=`${100*o/i}%`,e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(e,r,i)=>{const a=i.detail[e],o=a[0],s=a.slice(1);i.target.style[r]=nR[`${o}_HTML`](s),this.annotationStorage.setValue(this.data.id,{[r]:nR[`${o}_rgb`](s)})};return Oe(this,"_commonActions",{display:e=>{const{display:r}=e.detail,i=r%2===1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:r===1||r===2})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{const{hidden:r}=e.detail;this.container.style.visibility=r?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:r,noView:r})},focus:e=>{setTimeout(()=>e.target.focus({preventScroll:!1}),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.readonly},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:e=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:e=>{const r=e.detail.rotation;this.setRotation(r),this.annotationStorage.setValue(this.data.id,{rotation:r})}})}_dispatchEventFromSandbox(t,e){const r=this._commonActions;for(const i of Object.keys(e.detail))(t[i]||r[i])?.(e)}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const r=this._commonActions;for(const[i,a]of Object.entries(e)){const o=r[i];if(o){const s={detail:{[i]:a},target:t};o(s),delete e[i]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,r,i,a]=this.data.rect.map(m=>Math.fround(m));if(t.length===8){const[m,y,g,p]=t.subarray(2,6);if(i===m&&a===y&&e===g&&r===p)return}const{style:o}=this.container;let s;if(this.#e){const{borderColor:m,borderWidth:y}=o;o.borderWidth=0,s=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${m}" stroke-width="${y}">`],this.container.classList.add("hasBorder")}const l=i-e,u=a-r,{svgFactory:c}=this,h=c.createElement("svg");h.classList.add("quadrilateralsContainer"),h.setAttribute("width",0),h.setAttribute("height",0),h.role="none";const f=c.createElement("defs");h.append(f);const d=c.createElement("clipPath"),v=`clippath_${this.data.id}`;d.setAttribute("id",v),d.setAttribute("clipPathUnits","objectBoundingBox"),f.append(d);for(let m=2,y=t.length;m<y;m+=8){const g=t[m],p=t[m+1],b=t[m+2],w=t[m+3],x=c.createElement("rect"),A=(b-e)/l,T=(a-p)/u,C=(g-b)/l,E=(p-w)/u;x.setAttribute("x",A),x.setAttribute("y",T),x.setAttribute("width",C),x.setAttribute("height",E),d.append(x),s?.push(`<rect vector-effect="non-scaling-stroke" x="${A}" y="${T}" width="${C}" height="${E}"/>`)}this.#e&&(s.push("</g></svg>')"),o.backgroundImage=s.join("")),this.container.append(h),this.container.style.clipPath=`url(#${v})`}_createPopup(t=null){const{data:e}=this;let r,i;t?(r={str:t.text},i=t.date):(r=e.contentsObj,i=e.modificationDate);const a=this.#n=new _T({data:{color:e.color,titleObj:e.titleObj,modificationDate:i,contentsObj:r,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]});this.parent._commentManager||this.parent.div.append(a.render())}get hasPopupElement(){return!!(this.#n||this.popup||this.data.popupRef)}get extraPopupElement(){return this.#n}render(){_r("Abstract method `AnnotationElement.render` called")}_getElementsByName(t,e=null){const r=[];if(this._fieldObjects){const i=this._fieldObjects[t];if(i)for(const{page:a,id:o,exportValues:s}of i){if(a===-1||o===e)continue;const l=typeof s=="string"?s:null,u=document.querySelector(`[data-element-id="${o}"]`);if(u&&!Ec.has(u)){Pe(`_getElementsByName - element not allowed: ${o}`);continue}r.push({id:o,exportValue:l,domElement:u})}return r}for(const i of document.getElementsByName(t)){const{exportValue:a}=i,o=i.getAttribute("data-element-id");o!==e&&Ec.has(i)&&r.push({id:o,exportValue:a,domElement:i})}return r}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}}class qit extends zr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.editor=t.editor}render(){return this.container.className="editorAnnotation",this.container}createOrUpdatePopup(){const{editor:t}=this;t.hasComment&&(this._createPopup(t.comment),this.extraPopupElement.popup.renderCommentButton())}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(t){this.editor.comment=t,t||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.container.remove(),this.container=null,this.removePopup()}}class _M extends zr{constructor(t,e=null){super(t,{isRenderable:!0,ignoreBorder:!!e?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,r=document.createElement("a");r.setAttribute("data-element-id",t.id);let i=!1;return t.url?(e.addLinkAttributes(r,t.url,t.newWindow),i=!0):t.action?(this._bindNamedAction(r,t.action,t.overlaidText),i=!0):t.attachment?(this.#e(r,t.attachment,t.overlaidText,t.attachmentDest),i=!0):t.setOCGState?(this.#n(r,t.setOCGState,t.overlaidText),i=!0):t.dest?(this._bindLink(r,t.dest,t.overlaidText),i=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(r,t),i=!0),t.resetForm?(this._bindResetFormAction(r,t.resetForm),i=!0):this.isTooltipOnly&&!i&&(this._bindLink(r,""),i=!0)),this.container.classList.add("linkAnnotation"),i&&this.container.append(r),this.container}#t(){this.container.setAttribute("data-internal-link","")}_bindLink(t,e,r=""){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||e==="")&&this.#t(),r&&(t.title=r)}_bindNamedAction(t,e,r=""){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),r&&(t.title=r),this.#t()}#e(t,e,r="",i=null){t.href=this.linkService.getAnchorUrl(""),e.description?t.title=e.description:r&&(t.title=r),t.onclick=()=>(this.downloadManager?.openOrDownloadData(e.content,e.filename,i),!1),this.#t()}#n(t,e,r=""){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),r&&(t.title=r),this.#t()}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const r=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const i of Object.keys(e.actions)){const a=r.get(i);a&&(t[a]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:i}}),!1))}e.overlaidText&&(t.title=e.overlaidText),t.onclick||(t.onclick=()=>!1),this.#t()}_bindResetFormAction(t,e){const r=t.onclick;if(r||(t.href=this.linkService.getAnchorUrl("")),this.#t(),!this._fieldObjects){Pe('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),r||(t.onclick=()=>!1);return}t.onclick=()=>{r?.();const{fields:i,refs:a,include:o}=e,s=[];if(i.length!==0||a.length!==0){const c=new Set(a);for(const h of i){const f=this._fieldObjects[h]||[];for(const{id:d}of f)c.add(d)}for(const h of Object.values(this._fieldObjects))for(const f of h)c.has(f.id)===o&&s.push(f)}else for(const c of Object.values(this._fieldObjects))s.push(...c);const l=this.annotationStorage,u=[];for(const c of s){const{id:h}=c;switch(u.push(h),c.type){case"text":{const d=c.defaultValue||"";l.setValue(h,{value:d});break}case"checkbox":case"radiobutton":{const d=c.defaultValue===c.exportValues;l.setValue(h,{value:d});break}case"combobox":case"listbox":{const d=c.defaultValue||"";l.setValue(h,{value:d});break}default:continue}const f=document.querySelector(`[data-element-id="${h}"]`);if(f){if(!Ec.has(f)){Pe(`_bindResetFormAction - element not allowed: ${h}`);continue}}else continue;f.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:u,name:"ResetForm"}}),!1}}}class Zit extends zr{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class zc extends zr{render(){return this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&(t.previousSibling?.nodeName==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return In.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,r,i,a){r.includes("mouse")?t.addEventListener(r,o=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:a(o),shift:o.shiftKey,modifier:this._getKeyModifier(o)}})}):t.addEventListener(r,o=>{if(r==="blur"){if(!e.focused||!o.relatedTarget)return;e.focused=!1}else if(r==="focus"){if(e.focused)return;e.focused=!0}a&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:a(o)}})})}_setEventListeners(t,e,r,i){for(const[a,o]of r)(o==="Action"||this.data.actions?.[o])&&((o==="Focus"||o==="Blur")&&(e||={focused:!1}),this._setEventListener(t,e,a,o,i),o==="Focus"&&!this.data.actions?.Blur?this._setEventListener(t,e,"blur","Blur",null):o==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(t,e,"focus","Focus",null))}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=e===null?"transparent":Qt.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:r}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||Xit,a=t.style;let o;const s=2,l=u=>Math.round(10*u)/10;if(this.data.multiLine){const u=Math.abs(this.data.rect[3]-this.data.rect[1]-s),c=Math.round(u/(z1*i))||1,h=u/c;o=Math.min(i,l(h/z1))}else{const u=Math.abs(this.data.rect[3]-this.data.rect[1]-s);o=Math.min(i,l(u/z1))}a.fontSize=`calc(${o}px * var(--total-scale-factor))`,a.color=Qt.makeHexColor(r[0],r[1],r[2]),this.data.textAlignment!==null&&(a.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class Kit extends zc{constructor(t){const e=t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue;super(t,{isRenderable:e})}setPropertyOnSiblings(t,e,r,i){const a=this.annotationStorage;for(const o of this._getElementsByName(t.name,t.id))o.domElement&&(o.domElement[e]=r),a.setValue(o.id,{[i]:r})}render(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let r=null;if(this.renderForms){const i=t.getValue(e,{value:this.data.fieldValue});let a=i.value||"";const o=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;o&&a.length>o&&(a=a.slice(0,o));let s=i.formattedValue||this.data.textContent?.join(`
4
4
  `)||null;s&&this.data.comb&&(s=s.replaceAll(/\s+/g,""));const l={userValue:a,formattedValue:s,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(r=document.createElement("textarea"),r.textContent=s??a,this.data.doNotScroll&&(r.style.overflowY="hidden")):(r=document.createElement("input"),r.type=this.data.password?"password":"text",r.setAttribute("value",s??a),this.data.doNotScroll&&(r.style.overflowX="hidden")),this.data.hasOwnCanvas&&(r.hidden=!0),Ec.add(r),r.setAttribute("data-element-id",e),r.disabled=this.data.readOnly,r.name=this.data.fieldName,r.tabIndex=0;const{datetimeFormat:u,datetimeType:c,timeStep:h}=this.data,f=!!c&&this.enableScripting;u&&(r.title=u),this._setRequired(r,this.data.required),o&&(r.maxLength=o),r.addEventListener("input",v=>{t.setValue(e,{value:v.target.value}),this.setPropertyOnSiblings(r,"value",v.target.value,"value"),l.formattedValue=null}),r.addEventListener("resetform",v=>{const m=this.data.defaultFieldValue??"";r.value=l.userValue=m,l.formattedValue=null});let d=v=>{const{formattedValue:m}=l;m!=null&&(v.target.value=m),v.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){r.addEventListener("focus",m=>{if(l.focused)return;const{target:y}=m;if(f&&(y.type=c,h&&(y.step=h)),l.userValue){const g=l.userValue;if(f)if(c==="time"){const p=new Date(g),b=[p.getHours(),p.getMinutes(),p.getSeconds()];y.value=b.map(w=>w.toString().padStart(2,"0")).join(":")}else y.value=new Date(g-Yit).toISOString().split(c==="date"?"T":".",1)[0];else y.value=g}l.lastCommittedValue=y.value,l.commitKey=1,this.data.actions?.Focus||(l.focused=!0)}),r.addEventListener("updatefromsandbox",m=>{this.showElementAndHideCanvas(m.target);const y={value(g){l.userValue=g.detail.value??"",f||t.setValue(e,{value:l.userValue.toString()}),g.target.value=l.userValue},formattedValue(g){const{formattedValue:p}=g.detail;l.formattedValue=p,p!=null&&g.target!==document.activeElement&&(g.target.value=p);const b={formattedValue:p};f&&(b.value=p),t.setValue(e,b)},selRange(g){g.target.setSelectionRange(...g.detail.selRange)},charLimit:g=>{const{charLimit:p}=g.detail,{target:b}=g;if(p===0){b.removeAttribute("maxLength");return}b.setAttribute("maxLength",p);let w=l.userValue;!w||w.length<=p||(w=w.slice(0,p),b.value=l.userValue=w,t.setValue(e,{value:w}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:w,willCommit:!0,commitKey:1,selStart:b.selectionStart,selEnd:b.selectionEnd}}))}};this._dispatchEventFromSandbox(y,m)}),r.addEventListener("keydown",m=>{l.commitKey=1;let y=-1;if(m.key==="Escape"?y=0:m.key==="Enter"&&!this.data.multiLine?y=2:m.key==="Tab"&&(l.commitKey=3),y===-1)return;const{value:g}=m.target;l.lastCommittedValue!==g&&(l.lastCommittedValue=g,l.userValue=g,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:g,willCommit:!0,commitKey:y,selStart:m.target.selectionStart,selEnd:m.target.selectionEnd}}))});const v=d;d=null,r.addEventListener("blur",m=>{if(!l.focused||!m.relatedTarget)return;this.data.actions?.Blur||(l.focused=!1);const{target:y}=m;let{value:g}=y;if(f){if(g&&c==="time"){const p=g.split(":").map(b=>parseInt(b,10));g=new Date(2e3,0,1,p[0],p[1],p[2]||0).valueOf(),y.step=""}else g.includes("T")||(g=`${g}T00:00`),g=new Date(g).valueOf();y.type="text"}l.userValue=g,l.lastCommittedValue!==g&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:g,willCommit:!0,commitKey:l.commitKey,selStart:m.target.selectionStart,selEnd:m.target.selectionEnd}}),v(m)}),this.data.actions?.Keystroke&&r.addEventListener("beforeinput",m=>{l.lastCommittedValue=null;const{data:y,target:g}=m,{value:p,selectionStart:b,selectionEnd:w}=g;let x=b,A=w;switch(m.inputType){case"deleteWordBackward":{const T=p.substring(0,b).match(/\w*[^\w]*$/);T&&(x-=T[0].length);break}case"deleteWordForward":{const T=p.substring(b).match(/^[^\w]*\w*/);T&&(A+=T[0].length);break}case"deleteContentBackward":b===w&&(x-=1);break;case"deleteContentForward":b===w&&(A+=1);break}m.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:p,change:y||"",willCommit:!1,selStart:x,selEnd:A}})}),this._setEventListeners(r,l,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],m=>m.target.value)}if(d&&r.addEventListener("blur",d),this.data.comb){const m=(this.data.rect[2]-this.data.rect[0])/o;r.classList.add("comb"),r.style.letterSpacing=`calc(${m}px * var(--total-scale-factor) - 1ch)`}}else r=document.createElement("div"),r.textContent=this.data.fieldValue,r.style.verticalAlign="middle",r.style.display="table-cell",this.data.hasOwnCanvas&&(r.hidden=!0);return this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class Qit extends zc{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class Jit extends zc{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,r=e.id;let i=t.getValue(r,{value:e.exportValue===e.fieldValue}).value;typeof i=="string"&&(i=i!=="Off",t.setValue(r,{value:i})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const a=document.createElement("input");return Ec.add(a),a.setAttribute("data-element-id",r),a.disabled=e.readOnly,this._setRequired(a,this.data.required),a.type="checkbox",a.name=e.fieldName,i&&a.setAttribute("checked",!0),a.setAttribute("exportValue",e.exportValue),a.tabIndex=0,a.addEventListener("change",o=>{const{name:s,checked:l}=o.target;for(const u of this._getElementsByName(s,r)){const c=l&&u.exportValue===e.exportValue;u.domElement&&(u.domElement.checked=c),t.setValue(u.id,{value:c})}t.setValue(r,{value:l})}),a.addEventListener("resetform",o=>{const s=e.defaultFieldValue||"Off";o.target.checked=s===e.exportValue}),this.enableScripting&&this.hasJSActions&&(a.addEventListener("updatefromsandbox",o=>{const s={value(l){l.target.checked=l.detail.value!=="Off",t.setValue(r,{value:l.target.checked})}};this._dispatchEventFromSandbox(s,o)}),this._setEventListeners(a,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],o=>o.target.checked)),this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class WH extends zc{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,r=e.id;let i=t.getValue(r,{value:e.fieldValue===e.buttonValue}).value;if(typeof i=="string"&&(i=i!==e.buttonValue,t.setValue(r,{value:i})),i)for(const o of this._getElementsByName(e.fieldName,r))t.setValue(o.id,{value:!1});const a=document.createElement("input");if(Ec.add(a),a.setAttribute("data-element-id",r),a.disabled=e.readOnly,this._setRequired(a,this.data.required),a.type="radio",a.name=e.fieldName,i&&a.setAttribute("checked",!0),a.tabIndex=0,a.addEventListener("change",o=>{const{name:s,checked:l}=o.target;for(const u of this._getElementsByName(s,r))t.setValue(u.id,{value:!1});t.setValue(r,{value:l})}),a.addEventListener("resetform",o=>{const s=e.defaultFieldValue;o.target.checked=s!=null&&s===e.buttonValue}),this.enableScripting&&this.hasJSActions){const o=e.buttonValue;a.addEventListener("updatefromsandbox",s=>{const l={value:u=>{const c=o===u.detail.value;for(const h of this._getElementsByName(u.target.name)){const f=c&&h.id===r;h.domElement&&(h.domElement.checked=f),t.setValue(h.id,{value:f})}}};this._dispatchEventFromSandbox(l,s)}),this._setEventListeners(a,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],s=>s.target.checked)}return this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class tat extends _M{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",r=>{this._dispatchEventFromSandbox({},r)})),t}}class eat extends zc{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,r=t.getValue(e,{value:this.data.fieldValue}),i=document.createElement("select");Ec.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,this._setRequired(i,this.data.required),i.name=this.data.fieldName,i.tabIndex=0;let a=this.data.combo&&this.data.options.length>0;this.data.combo||(i.size=this.data.options.length,this.data.multiSelect&&(i.multiple=!0)),i.addEventListener("resetform",c=>{const h=this.data.defaultFieldValue;for(const f of i.options)f.selected=f.value===h});for(const c of this.data.options){const h=document.createElement("option");h.textContent=c.displayValue,h.value=c.exportValue,r.value.includes(c.exportValue)&&(h.setAttribute("selected",!0),a=!1),i.append(h)}let o=null;if(a){const c=document.createElement("option");c.value=" ",c.setAttribute("hidden",!0),c.setAttribute("selected",!0),i.prepend(c),o=()=>{c.remove(),i.removeEventListener("input",o),o=null},i.addEventListener("input",o)}const s=c=>{const h=c?"value":"textContent",{options:f,multiple:d}=i;return d?Array.prototype.filter.call(f,v=>v.selected).map(v=>v[h]):f.selectedIndex===-1?null:f[f.selectedIndex][h]};let l=s(!1);const u=c=>{const h=c.target.options;return Array.prototype.map.call(h,f=>({displayValue:f.textContent,exportValue:f.value}))};return this.enableScripting&&this.hasJSActions?(i.addEventListener("updatefromsandbox",c=>{const h={value(f){o?.();const d=f.detail.value,v=new Set(Array.isArray(d)?d:[d]);for(const m of i.options)m.selected=v.has(m.value);t.setValue(e,{value:s(!0)}),l=s(!1)},multipleSelection(f){i.multiple=!0},remove(f){const d=i.options,v=f.detail.remove;d[v].selected=!1,i.remove(v),d.length>0&&Array.prototype.findIndex.call(d,y=>y.selected)===-1&&(d[0].selected=!0),t.setValue(e,{value:s(!0),items:u(f)}),l=s(!1)},clear(f){for(;i.length!==0;)i.remove(0);t.setValue(e,{value:null,items:[]}),l=s(!1)},insert(f){const{index:d,displayValue:v,exportValue:m}=f.detail.insert,y=i.children[d],g=document.createElement("option");g.textContent=v,g.value=m,y?y.before(g):i.append(g),t.setValue(e,{value:s(!0),items:u(f)}),l=s(!1)},items(f){const{items:d}=f.detail;for(;i.length!==0;)i.remove(0);for(const v of d){const{displayValue:m,exportValue:y}=v,g=document.createElement("option");g.textContent=m,g.value=y,i.append(g)}i.options.length>0&&(i.options[0].selected=!0),t.setValue(e,{value:s(!0),items:u(f)}),l=s(!1)},indices(f){const d=new Set(f.detail.indices);for(const v of f.target.options)v.selected=d.has(v.index);t.setValue(e,{value:s(!0)}),l=s(!1)},editable(f){f.target.disabled=!f.detail.editable}};this._dispatchEventFromSandbox(h,c)}),i.addEventListener("input",c=>{const h=s(!0),f=s(!1);t.setValue(e,{value:h}),c.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:l,change:f,changeEx:h,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(i,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],c=>c.target.value)):i.addEventListener("input",function(c){t.setValue(e,{value:s(!0)})}),this.data.combo&&this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class _T extends zr{constructor(t){const{data:e,elements:r,parent:i}=t,a=!!i._commentManager;if(super(t,{isRenderable:!a&&zr._hasPopupData(e)}),this.elements=r,a&&zr._hasPopupData(e)){const o=this.popup=this.#t();for(const s of r)s.popup=o}else this.popup=null}#t(){return new rat({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open,commentManager:this.parent._commentManager})}render(){const{container:t}=this;t.classList.add("popupAnnotation"),t.role="comment";const e=this.popup=this.#t(),r=[];for(const i of this.elements)i.popup=e,i.container.ariaHasPopup="dialog",r.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",r.map(i=>`${sM}${i}`).join(",")),this.container}}class rat{#t=null;#e=this.#W.bind(this);#n=this.#V.bind(this);#r=this.#I.bind(this);#o=this.#w.bind(this);#i=null;#a=null;#s=null;#u=null;#l=null;#f=null;#h=null;#d=!1;#g=null;#p=null;#c=null;#v=null;#m=null;#b=null;#y=null;#T=null;#S=null;#_=null;#E=!1;#x=null;#A=null;constructor({container:t,color:e,elements:r,titleObj:i,modificationDate:a,contentsObj:o,richText:s,parent:l,rect:u,parentRect:c,open:h,commentManager:f=null}){this.#a=t,this.#S=i,this.#s=o,this.#T=s,this.#f=l,this.#i=e,this.#y=u,this.#h=c,this.#l=r,this.#t=f,this.#x=r[0],this.#u=q0.toDateObject(a),this.trigger=r.flatMap(d=>d.getElementsToTriggerPopup()),f?this.renderCommentButton():(this.#k(),this.#a.hidden=!0,h&&this.#w())}#k(){if(this.#p)return;this.#p=new AbortController;const{signal:t}=this.#p;for(const e of this.trigger)e.addEventListener("click",this.#o,{signal:t}),e.addEventListener("pointerenter",this.#r,{signal:t}),e.addEventListener("pointerleave",this.#n,{signal:t}),e.classList.add("popupTriggerArea");for(const e of this.#l)e.container?.addEventListener("keydown",this.#e,{signal:t})}#M(){const t=this.#l.find(e=>e.hasCommentButton);t&&(this.#m=t._normalizePoint(t.commentButtonPosition))}renderCommentButton(){if(this.#v||(this.#m||this.#M(),!this.#m))return;const{signal:t}=this.#p=new AbortController,e=!!this.#x.extraPopupElement,r=()=>{this.#t.toggleCommentPopup(this,!0,void 0,!e)},i=()=>{this.#t.toggleCommentPopup(this,!1,!0,!e)},a=()=>{this.#t.toggleCommentPopup(this,!1,!1)};if(e){this.#v=this.#x.container;for(const o of this.trigger)o.ariaHasPopup="dialog",o.ariaControls="commentPopup",o.addEventListener("keydown",this.#e,{signal:t}),o.addEventListener("click",r,{signal:t}),o.addEventListener("pointerenter",i,{signal:t}),o.addEventListener("pointerleave",a,{signal:t}),o.classList.add("popupTriggerArea")}else{const o=this.#v=document.createElement("button");o.className="annotationCommentButton";const s=this.#x.container;o.style.zIndex=s.style.zIndex+1,o.tabIndex=0,o.ariaHasPopup="dialog",o.ariaControls="commentPopup",o.setAttribute("data-l10n-id","pdfjs-show-comment-button"),this.#B(),this.#P(),o.addEventListener("keydown",this.#e,{signal:t}),o.addEventListener("click",r,{signal:t}),o.addEventListener("pointerenter",i,{signal:t}),o.addEventListener("pointerleave",a,{signal:t}),s.after(o)}}#P(){if(this.#x.extraPopupElement&&!this.#x.editor)return;this.renderCommentButton();const[t,e]=this.#m,{style:r}=this.#v;r.left=`calc(${t}%)`,r.top=`calc(${e}% - var(--comment-button-dim))`}#B(){this.#x.extraPopupElement||(this.renderCommentButton(),this.#v.style.backgroundColor=this.commentButtonColor||"")}get commentButtonColor(){const{color:t,opacity:e}=this.#x.commentData;return t?this.#f._commentManager.makeCommentColor(t,e):null}focusCommentButton(){setTimeout(()=>{this.#v?.focus()},0)}getData(){const{richText:t,color:e,opacity:r,creationDate:i,modificationDate:a}=this.#x.commentData;return{contentsObj:{str:this.comment},richText:t,color:e,opacity:r,creationDate:i,modificationDate:a}}get elementBeforePopup(){return this.#v}get comment(){return this.#A||=this.#x.commentText,this.#A}set comment(t){t!==this.comment&&(this.#x.commentText=this.#A=t)}get parentBoundingClientRect(){return this.#x.layer.getBoundingClientRect()}setCommentButtonStates({selected:t,hasPopup:e}){this.#v&&(this.#v.classList.toggle("selected",t),this.#v.ariaExpanded=e)}setSelectedCommentButton(t){this.#v.classList.toggle("selected",t)}get commentPopupPosition(){if(this.#b)return this.#b;const{x:t,y:e,height:r}=this.#v.getBoundingClientRect(),{x:i,y:a,width:o,height:s}=this.#x.layer.getBoundingClientRect();return[(t-i)/o,(e+r-a)/s]}set commentPopupPosition(t){this.#b=t}hasDefaultPopupPosition(){return this.#b===null}get commentButtonPosition(){return this.#m}get commentButtonWidth(){return this.#v.getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(t){const[e,r]=this.#b||this.commentButtonPosition.map(u=>u/100),i=this.parentBoundingClientRect,{x:a,y:o,width:s,height:l}=i;this.#t.showDialog(null,this,a+e*s,o+r*l,{...t,parentDimensions:i})}render(){if(this.#g)return;const t=this.#g=document.createElement("div");if(t.className="popup",this.#i){const r=t.style.outlineColor=Qt.makeHexColor(...this.#i);t.style.backgroundColor=`color-mix(in srgb, ${r} 30%, white)`}const e=document.createElement("span");if(e.className="header",this.#S?.str){const r=document.createElement("span");r.className="title",e.append(r),{dir:r.dir,str:r.textContent}=this.#S}if(t.append(e),this.#u){const r=document.createElement("time");r.className="popupDate",r.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),r.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#u.valueOf()})),r.dateTime=this.#u.toISOString(),e.append(r)}uM({html:this.#L||this.#s.str,dir:this.#s?.dir,className:"popupContent"},t),this.#a.append(t)}get#L(){const t=this.#T,e=this.#s;return t?.str&&(!e?.str||e.str===t.str)&&this.#T.html||null}get#R(){return this.#L?.attributes?.style?.fontSize||0}get#F(){return this.#L?.attributes?.style?.color||null}#N(t){const e=[],r={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},i={style:{color:this.#F,fontSize:this.#R?`calc(${this.#R}px * var(--total-scale-factor))`:""}};for(const a of t.split(`
@@ -169,4 +169,4 @@ echarts.use([`+L+"]);":"Unknown series "+D))}return}if(h==="tooltip"){if(b){proc
169
169
  `)),Ye(r));var p=d?i6(d):null;d&&!p&&(process.env.NODE_ENV!=="production"&&(r=Si("Invalid parser name "+d+`.
170
170
  `,"Illegal config:",c,`.
171
171
  `)),Ye(r)),a.push({dimIdx:g.index,parser:p,comparator:new o6(f,v)})});var o=t.sourceFormat;o!==ii&&o!==$a&&(process.env.NODE_ENV!=="production"&&(r='sourceFormat "'+o+'" is not supported yet'),Ye(r));for(var s=[],l=0,u=t.count();l<u;l++)s.push(t.getRawDataItem(l));return s.sort(function(c,h){for(var f=0;f<a.length;f++){var d=a[f],v=t.retrieveValueFromItem(c,d.dimIdx),m=t.retrieveValueFromItem(h,d.dimIdx);d.parser&&(v=d.parser(v),m=d.parser(m));var y=d.comparator.evaluate(v,m);if(y!==0)return y}return 0}),{data:s}}};function IMt(n){n.registerTransform(DMt),n.registerTransform(LMt)}var RMt=(function(n){et(t,n);function t(){var e=n!==null&&n.apply(this,arguments)||this;return e.type="dataset",e}return t.prototype.init=function(e,r,i){n.prototype.init.call(this,e,r,i),this._sourceManager=new c6(this),JO(this)},t.prototype.mergeOption=function(e,r){n.prototype.mergeOption.call(this,e,r),JO(this)},t.prototype.optionUpdated=function(){this._sourceManager.dirty()},t.prototype.getSourceManager=function(){return this._sourceManager},t.type="dataset",t.defaultOption={seriesLayoutBy:qo},t})(Te),NMt=(function(n){et(t,n);function t(){var e=n!==null&&n.apply(this,arguments)||this;return e.type="dataset",e}return t.type="dataset",t})(Ar);function OMt(n){n.registerComponentModel(RMt),n.registerComponentView(NMt)}var Lo=ts.CMD;function uf(n,t){return Math.abs(n-t)<1e-5}function wE(n){var t=n.data,e=n.len(),r=[],i,a=0,o=0,s=0,l=0;function u(R,P){i&&i.length>2&&r.push(i),i=[R,P]}function c(R,P,O,F){uf(R,O)&&uf(P,F)||i.push(R,P,O,F,O,F)}function h(R,P,O,F,z,G){var U=Math.abs(P-R),K=Math.tan(U/4)*4/3,W=P<R?-1:1,X=Math.cos(R),Q=Math.sin(R),at=Math.cos(P),rt=Math.sin(P),Rt=X*z+O,Mt=Q*G+F,xt=at*z+O,vt=rt*G+F,Et=z*K*W,_t=G*K*W;i.push(Rt-Et*Q,Mt+_t*X,xt+Et*rt,vt-_t*at,xt,vt)}for(var f,d,v,m,y=0;y<e;){var g=t[y++],p=y===1;switch(p&&(a=t[y],o=t[y+1],s=a,l=o,(g===Lo.L||g===Lo.C||g===Lo.Q)&&(i=[s,l])),g){case Lo.M:a=s=t[y++],o=l=t[y++],u(s,l);break;case Lo.L:f=t[y++],d=t[y++],c(a,o,f,d),a=f,o=d;break;case Lo.C:i.push(t[y++],t[y++],t[y++],t[y++],a=t[y++],o=t[y++]);break;case Lo.Q:f=t[y++],d=t[y++],v=t[y++],m=t[y++],i.push(a+2/3*(f-a),o+2/3*(d-o),v+2/3*(f-v),m+2/3*(d-m),v,m),a=v,o=m;break;case Lo.A:var b=t[y++],w=t[y++],x=t[y++],A=t[y++],T=t[y++],C=t[y++]+T;y+=1;var E=!t[y++];f=Math.cos(T)*x+b,d=Math.sin(T)*A+w,p?(s=f,l=d,u(s,l)):c(a,o,f,d),a=Math.cos(C)*x+b,o=Math.sin(C)*A+w;for(var k=(E?-1:1)*Math.PI/2,D=T;E?D>C:D<C;D+=k){var L=E?Math.max(D+k,C):Math.min(D+k,C);h(D,L,b,w,x,A)}break;case Lo.R:s=a=t[y++],l=o=t[y++],f=s+t[y++],d=l+t[y++],u(f,l),c(f,l,f,d),c(f,d,s,d),c(s,d,s,l),c(s,l,f,l);break;case Lo.Z:i&&c(a,o,s,l),a=s,o=l;break}}return i&&i.length>2&&r.push(i),r}function xE(n,t,e,r,i,a,o,s,l,u){if(uf(n,e)&&uf(t,r)&&uf(i,o)&&uf(a,s)){l.push(o,s);return}var c=2/u,h=c*c,f=o-n,d=s-t,v=Math.sqrt(f*f+d*d);f/=v,d/=v;var m=e-n,y=r-t,g=i-o,p=a-s,b=m*m+y*y,w=g*g+p*p;if(b<h&&w<h){l.push(o,s);return}var x=f*m+d*y,A=-f*g-d*p,T=b-x*x,C=w-A*A;if(T<h&&x>=0&&C<h&&A>=0){l.push(o,s);return}var E=[],k=[];Xl(n,e,i,o,.5,E),Xl(t,r,a,s,.5,k),xE(E[0],k[0],E[1],k[1],E[2],k[2],E[3],k[3],l,u),xE(E[4],k[4],E[5],k[5],E[6],k[6],E[7],k[7],l,u)}function BMt(n,t){var e=wE(n),r=[];t=t||1;for(var i=0;i<e.length;i++){var a=e[i],o=[],s=a[0],l=a[1];o.push(s,l);for(var u=2;u<a.length;){var c=a[u++],h=a[u++],f=a[u++],d=a[u++],v=a[u++],m=a[u++];xE(s,l,c,h,f,d,v,m,o,t),s=v,l=m}r.push(o)}return r}function AX(n,t,e){var r=n[t],i=n[1-t],a=Math.abs(r/i),o=Math.ceil(Math.sqrt(a*e)),s=Math.floor(e/o);s===0&&(s=1,o=e);for(var l=[],u=0;u<o;u++)l.push(s);var c=o*s,h=e-c;if(h>0)for(var u=0;u<h;u++)l[u%o]+=1;return l}function e3(n,t,e){for(var r=n.r0,i=n.r,a=n.startAngle,o=n.endAngle,s=Math.abs(o-a),l=s*i,u=i-r,c=l>Math.abs(u),h=AX([l,u],c?0:1,t),f=(c?s:u)/h.length,d=0;d<h.length;d++)for(var v=(c?u:s)/h[d],m=0;m<h[d];m++){var y={};c?(y.startAngle=a+f*d,y.endAngle=a+f*(d+1),y.r0=r+v*m,y.r=r+v*(m+1)):(y.startAngle=a+v*m,y.endAngle=a+v*(m+1),y.r0=r+f*d,y.r=r+f*(d+1)),y.clockwise=n.clockwise,y.cx=n.cx,y.cy=n.cy,e.push(y)}}function FMt(n,t,e){for(var r=n.width,i=n.height,a=r>i,o=AX([r,i],a?0:1,t),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",c=a?"y":"x",h=n[s]/o.length,f=0;f<o.length;f++)for(var d=n[l]/o[f],v=0;v<o[f];v++){var m={};m[u]=f*h,m[c]=v*d,m[s]=h,m[l]=d,m.x+=n.x,m.y+=n.y,e.push(m)}}function r3(n,t,e,r){return n*r-e*t}function VMt(n,t,e,r,i,a,o,s){var l=e-n,u=r-t,c=o-i,h=s-a,f=r3(c,h,l,u);if(Math.abs(f)<1e-6)return null;var d=n-i,v=t-a,m=r3(d,v,c,h)/f;return m<0||m>1?null:new de(m*l+n,m*u+t)}function zMt(n,t,e){var r=new de;de.sub(r,e,t),r.normalize();var i=new de;de.sub(i,n,t);var a=i.dot(r);return a}function zh(n,t){var e=n[n.length-1];e&&e[0]===t[0]&&e[1]===t[1]||n.push(t)}function GMt(n,t,e){for(var r=n.length,i=[],a=0;a<r;a++){var o=n[a],s=n[(a+1)%r],l=VMt(o[0],o[1],s[0],s[1],t.x,t.y,e.x,e.y);l&&i.push({projPt:zMt(l,t,e),pt:l,idx:a})}if(i.length<2)return[{points:n},{points:n}];i.sort(function(y,g){return y.projPt-g.projPt});var u=i[0],c=i[i.length-1];if(c.idx<u.idx){var h=u;u=c,c=h}for(var f=[u.pt.x,u.pt.y],d=[c.pt.x,c.pt.y],v=[f],m=[d],a=u.idx+1;a<=c.idx;a++)zh(v,n[a].slice());zh(v,d),zh(v,f);for(var a=c.idx+1;a<=u.idx+r;a++)zh(m,n[a%r].slice());return zh(m,f),zh(m,d),[{points:v},{points:m}]}function n3(n){var t=n.points,e=[],r=[];L_(t,e,r);var i=new pe(e[0],e[1],r[0]-e[0],r[1]-e[1]),a=i.width,o=i.height,s=i.x,l=i.y,u=new de,c=new de;return a>o?(u.x=c.x=s+a/2,u.y=l,c.y=l+o):(u.y=c.y=l+o/2,u.x=s,c.x=s+a),GMt(t,u,c)}function Kb(n,t,e,r){if(e===1)r.push(t);else{var i=Math.floor(e/2),a=n(t);Kb(n,a[0],i,r),Kb(n,a[1],e-i,r)}return r}function HMt(n,t){for(var e=[],r=0;r<t;r++)e.push(u2(n));return e}function UMt(n,t){t.setStyle(n.style),t.z=n.z,t.z2=n.z2,t.zlevel=n.zlevel}function WMt(n){for(var t=[],e=0;e<n.length;)t.push([n[e++],n[e++]]);return t}function $Mt(n,t){var e=[],r=n.shape,i;switch(n.type){case"rect":FMt(r,t,e),i=Le;break;case"sector":e3(r,t,e),i=Ti;break;case"circle":e3({r0:0,r:r.r,startAngle:0,endAngle:Math.PI*2,cx:r.cx,cy:r.cy},t,e),i=Ti;break;default:var a=n.getComputedTransform(),o=a?Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1],a[2]*a[2]+a[3]*a[3])):1,s=gt(BMt(n.getUpdatedPathProxy(),o),function(g){return WMt(g)}),l=s.length;if(l===0)Kb(n3,{points:s[0]},t,e);else if(l===t)for(var u=0;u<l;u++)e.push({points:s[u]});else{var c=0,h=gt(s,function(g){var p=[],b=[];L_(g,p,b);var w=(b[1]-p[1])*(b[0]-p[0]);return c+=w,{poly:g,area:w}});h.sort(function(g,p){return p.area-g.area});for(var f=t,u=0;u<l;u++){var d=h[u];if(f<=0)break;var v=u===l-1?f:Math.ceil(d.area/c*t);v<0||(Kb(n3,{points:d.poly},v,e),f-=v)}}i=Ci;break}if(!i)return HMt(n,t);for(var m=[],u=0;u<e.length;u++){var y=new i;y.setShape(e[u]),UMt(n,y),m.push(y)}return m}function jMt(n,t){var e=n.length,r=t.length;if(e===r)return[n,t];for(var i=[],a=[],o=e<r?n:t,s=Math.min(e,r),l=Math.abs(r-e)/6,u=(s-2)/6,c=Math.ceil(l/u)+1,h=[o[0],o[1]],f=l,d=2;d<s;){var v=o[d-2],m=o[d-1],y=o[d++],g=o[d++],p=o[d++],b=o[d++],w=o[d++],x=o[d++];if(f<=0){h.push(y,g,p,b,w,x);continue}for(var A=Math.min(f,c-1)+1,T=1;T<=A;T++){var C=T/A;Xl(v,y,p,w,C,i),Xl(m,g,b,x,C,a),v=i[3],m=a[3],h.push(i[1],a[1],i[2],a[2],v,m),y=i[5],g=a[5],p=i[6],b=a[6]}f-=A-1}return o===n?[h,t]:[n,h]}function i3(n,t){for(var e=n.length,r=n[e-2],i=n[e-1],a=[],o=0;o<t.length;)a[o++]=r,a[o++]=i;return a}function XMt(n,t){for(var e,r,i,a=[],o=[],s=0;s<Math.max(n.length,t.length);s++){var l=n[s],u=t[s],c=void 0,h=void 0;l?u?(e=jMt(l,u),c=e[0],h=e[1],r=c,i=h):(h=i3(i||l,l),c=l):(c=i3(r||u,u),h=u),a.push(c),o.push(h)}return[a,o]}function a3(n){for(var t=0,e=0,r=0,i=n.length,a=0,o=i-2;a<i;o=a,a+=2){var s=n[o],l=n[o+1],u=n[a],c=n[a+1],h=s*c-u*l;t+=h,e+=(s+u)*h,r+=(l+c)*h}return t===0?[n[0]||0,n[1]||0]:[e/t/3,r/t/3,t]}function YMt(n,t,e,r){for(var i=(n.length-2)/6,a=1/0,o=0,s=n.length,l=s-2,u=0;u<i;u++){for(var c=u*6,h=0,f=0;f<s;f+=2){var d=f===0?c:(c+f-2)%l+2,v=n[d]-e[0],m=n[d+1]-e[1],y=t[f]-r[0],g=t[f+1]-r[1],p=y-v,b=g-m;h+=p*p+b*b}h<a&&(a=h,o=u)}return o}function qMt(n){for(var t=[],e=n.length,r=0;r<e;r+=2)t[r]=n[e-r-2],t[r+1]=n[e-r-1];return t}function ZMt(n,t,e,r){for(var i=[],a,o=0;o<n.length;o++){var s=n[o],l=t[o],u=a3(s),c=a3(l);a==null&&(a=u[2]<0!=c[2]<0);var h=[],f=[],d=0,v=1/0,m=[],y=s.length;a&&(s=qMt(s));for(var g=YMt(s,l,u,c)*6,p=y-2,b=0;b<p;b+=2){var w=(g+b)%p+2;h[b+2]=s[w]-u[0],h[b+3]=s[w+1]-u[1]}h[0]=s[g]-u[0],h[1]=s[g+1]-u[1];for(var x=r/e,A=-r/2;A<=r/2;A+=x){for(var T=Math.sin(A),C=Math.cos(A),E=0,b=0;b<s.length;b+=2){var k=h[b],D=h[b+1],L=l[b]-c[0],R=l[b+1]-c[1],P=L*C-R*T,O=L*T+R*C;m[b]=P,m[b+1]=O;var F=P-k,z=O-D;E+=F*F+z*z}if(E<v){v=E,d=A;for(var G=0;G<m.length;G++)f[G]=m[G]}}i.push({from:h,to:f,fromCp:u,toCp:c,rotation:-d})}return i}function Qb(n){return n.__isCombineMorphing}var TX="__mOriginal_";function Jb(n,t,e){var r=TX+t,i=n[r]||n[t];n[r]||(n[r]=n[t]);var a=e.replace,o=e.after,s=e.before;n[t]=function(){var l=arguments,u;return s&&s.apply(this,l),a?u=a.apply(this,l):u=i.apply(this,l),o&&o.apply(this,l),u}}function yv(n,t){var e=TX+t;n[e]&&(n[t]=n[e],n[e]=null)}function o3(n,t){for(var e=0;e<n.length;e++)for(var r=n[e],i=0;i<r.length;){var a=r[i],o=r[i+1];r[i++]=t[0]*a+t[2]*o+t[4],r[i++]=t[1]*a+t[3]*o+t[5]}}function CX(n,t){var e=n.getUpdatedPathProxy(),r=t.getUpdatedPathProxy(),i=XMt(wE(e),wE(r)),a=i[0],o=i[1],s=n.getComputedTransform(),l=t.getComputedTransform();function u(){this.transform=null}s&&o3(a,s),l&&o3(o,l),Jb(t,"updateTransform",{replace:u}),t.transform=null;var c=ZMt(a,o,10,Math.PI),h=[];Jb(t,"buildPath",{replace:function(f){for(var d=t.__morphT,v=1-d,m=[],y=0;y<c.length;y++){var g=c[y],p=g.from,b=g.to,w=g.rotation*d,x=g.fromCp,A=g.toCp,T=Math.sin(w),C=Math.cos(w);S0(m,x,A,d);for(var E=0;E<p.length;E+=2){var k=p[E],D=p[E+1],L=b[E],R=b[E+1],P=k*v+L*d,O=D*v+R*d;h[E]=P*C-O*T+m[0],h[E+1]=P*T+O*C+m[1]}var F=h[0],z=h[1];f.moveTo(F,z);for(var E=2;E<p.length;){var L=h[E++],R=h[E++],G=h[E++],U=h[E++],K=h[E++],W=h[E++];F===L&&z===R&&G===K&&U===W?f.lineTo(K,W):f.bezierCurveTo(L,R,G,U,K,W),F=K,z=W}}}})}function jP(n,t,e){if(!n||!t)return t;var r=e.done,i=e.during;CX(n,t),t.__morphT=0;function a(){yv(t,"buildPath"),yv(t,"updateTransform"),t.__morphT=-1,t.createPathProxy(),t.dirtyShape()}return t.animateTo({__morphT:1},Yt({during:function(o){t.dirtyShape(),i&&i(o)},done:function(){a(),r&&r()}},e)),t}function KMt(n,t,e,r,i,a){var o=16;n=i===e?0:Math.round(32767*(n-e)/(i-e)),t=a===r?0:Math.round(32767*(t-r)/(a-r));for(var s=0,l,u=(1<<o)/2;u>0;u/=2){var c=0,h=0;(n&u)>0&&(c=1),(t&u)>0&&(h=1),s+=u*u*(3*c^h),h===0&&(c===1&&(n=u-1-n,t=u-1-t),l=n,n=t,t=l)}return s}function t_(n){var t=1/0,e=1/0,r=-1/0,i=-1/0,a=gt(n,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),c=l.x+l.width/2+(u?u[4]:0),h=l.y+l.height/2+(u?u[5]:0);return t=Math.min(c,t),e=Math.min(h,e),r=Math.max(c,r),i=Math.max(h,i),[c,h]}),o=gt(a,function(s,l){return{cp:s,z:KMt(s[0],s[1],t,e,r,i),path:n[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function EX(n){return $Mt(n.path,n.count)}function SE(){return{fromIndividuals:[],toIndividuals:[],count:0}}function QMt(n,t,e){var r=[];function i(x){for(var A=0;A<x.length;A++){var T=x[A];Qb(T)?i(T.childrenRef()):T instanceof Ae&&r.push(T)}}i(n);var a=r.length;if(!a)return SE();var o=e.dividePath||EX,s=o({path:t,count:a});if(s.length!==a)return console.error("Invalid morphing: unmatched splitted path"),SE();r=t_(r),s=t_(s);for(var l=e.done,u=e.during,c=e.individualDelay,h=new Ms,f=0;f<a;f++){var d=r[f],v=s[f];v.parent=t,v.copyTransform(h),c||CX(d,v)}t.__isCombineMorphing=!0,t.childrenRef=function(){return s};function m(x){for(var A=0;A<s.length;A++)s[A].addSelfToZr(x)}Jb(t,"addSelfToZr",{after:function(x){m(x)}}),Jb(t,"removeSelfFromZr",{after:function(x){for(var A=0;A<s.length;A++)s[A].removeSelfFromZr(x)}});function y(){t.__isCombineMorphing=!1,t.__morphT=-1,t.childrenRef=null,yv(t,"addSelfToZr"),yv(t,"removeSelfFromZr")}var g=s.length;if(c)for(var p=g,b=function(){p--,p===0&&(y(),l&&l())},f=0;f<g;f++){var w=c?Yt({delay:(e.delay||0)+c(f,g,r[f],s[f]),done:b},e):e;jP(r[f],s[f],w)}else t.__morphT=0,t.animateTo({__morphT:1},Yt({during:function(x){for(var A=0;A<g;A++){var T=s[A];T.__morphT=t.__morphT,T.dirtyShape()}u&&u(x)},done:function(){y();for(var x=0;x<n.length;x++)yv(n[x],"updateTransform");l&&l()}},e));return t.__zr&&m(t.__zr),{fromIndividuals:r,toIndividuals:s,count:g}}function JMt(n,t,e){var r=t.length,i=[],a=e.dividePath||EX;function o(d){for(var v=0;v<d.length;v++){var m=d[v];Qb(m)?o(m.childrenRef()):m instanceof Ae&&i.push(m)}}if(Qb(n)){o(n.childrenRef());var s=i.length;if(s<r)for(var l=0,u=s;u<r;u++)i.push(u2(i[l++%s]));i.length=r}else{i=a({path:n,count:r});for(var c=n.getComputedTransform(),u=0;u<i.length;u++)i[u].setLocalTransform(c);if(i.length!==r)return console.error("Invalid morphing: unmatched splitted path"),SE()}i=t_(i),t=t_(t);for(var h=e.individualDelay,u=0;u<r;u++){var f=h?Yt({delay:(e.delay||0)+h(u,r,i[u],t[u])},e):e;jP(i[u],t[u],f)}return{fromIndividuals:i,toIndividuals:t,count:t.length}}function s3(n){return pt(n[0])}function l3(n,t){for(var e=[],r=n.length,i=0;i<r;i++)e.push({one:n[i],many:[]});for(var i=0;i<t.length;i++){var a=t[i].length,o=void 0;for(o=0;o<a;o++)e[o%r].many.push(t[i][o])}for(var s=0,i=r-1;i>=0;i--)if(!e[i].many.length){var l=e[s].many;if(l.length<=1)if(s)s=0;else return e;var a=l.length,u=Math.ceil(a/2);e[i].many=l.slice(u,a),e[s].many=l.slice(0,u),s++}return e}var t2t={clone:function(n){for(var t=[],e=1-Math.pow(1-n.path.style.opacity,1/n.count),r=0;r<n.count;r++){var i=u2(n.path);i.setStyle("opacity",e),t.push(i)}return t},split:null};function RA(n,t,e,r,i,a){if(!n.length||!t.length)return;var o=Jf("update",r,i);if(!(o&&o.duration>0))return;var s=r.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,c;s3(n)&&(u=n,c=t),s3(t)&&(u=t,c=n);function h(g,p,b,w,x){var A=g.many,T=g.one;if(A.length===1&&!x){var C=p?A[0]:T,E=p?T:A[0];if(Qb(C))h({many:[C],one:E},!0,b,w,!0);else{var k=s?Yt({delay:s(b,w)},l):l;jP(C,E,k),a(C,E,C,E,k)}}else for(var D=Yt({dividePath:t2t[e],individualDelay:s&&function(z,G,U,K){return s(z+b,w)}},l),L=p?QMt(A,T,D):JMt(T,A,D),R=L.fromIndividuals,P=L.toIndividuals,O=R.length,F=0;F<O;F++){var k=s?Yt({delay:s(F,O)},l):l;a(R[F],P[F],p?A[F]:g.one,p?g.one:A[F],k)}}for(var f=u?u===n:n.length>t.length,d=u?l3(c,u):l3(f?t:n,[f?n:t]),v=0,m=0;m<d.length;m++)v+=d[m].many.length;for(var y=0,m=0;m<d.length;m++)h(d[m],f,y,v),y+=d[m].many.length}function Yu(n){if(!n)return[];if(pt(n)){for(var t=[],e=0;e<n.length;e++)t.push(Yu(n[e]));return t}var r=[];return n.traverse(function(i){i instanceof Ae&&!i.disableMorphing&&!i.invisible&&!i.ignore&&r.push(i)}),r}var MX=1e4,e2t=0,u3=1,c3=2,r2t=Ie();function n2t(n,t){for(var e=n.dimensions,r=0;r<e.length;r++){var i=n.getDimensionInfo(e[r]);if(i&&i.otherDims[t]===0)return e[r]}}function i2t(n,t,e){var r=n.getDimensionInfo(e),i=r&&r.ordinalMeta;if(r){var a=n.get(r.name,t);return i&&i.categories[a]||a+""}}function h3(n,t,e,r){var i=r?"itemChildGroupId":"itemGroupId",a=n2t(n,i);if(a){var o=i2t(n,t,a);return o}var s=n.getRawDataItem(t),l=r?"childGroupId":"groupId";if(s&&s[l])return s[l]+"";if(!r)return e||n.getId(t)}function f3(n){var t=[];return B(n,function(e){var r=e.data,i=e.dataGroupId;if(r.count()>MX){process.env.NODE_ENV!=="production"&&Er("Universal transition is disabled on large data > 10k.");return}for(var a=r.getIndices(),o=0;o<a.length;o++)t.push({data:r,groupId:h3(r,o,i,!1),childGroupId:h3(r,o,i,!0),divide:e.divide,dataIndex:o})}),t}function NA(n,t,e){n.traverse(function(r){r instanceof Ae&&wr(r,{style:{opacity:0}},t,{dataIndex:e,isFrom:!0})})}function OA(n){if(n.parent){var t=n.getComputedTransform();n.setLocalTransform(t),n.parent.remove(n)}}function Gh(n){n.stopAnimation(),n.isGroup&&n.traverse(function(t){t.stopAnimation()})}function a2t(n,t,e){var r=Jf("update",e,t);r&&n.traverse(function(i){if(i instanceof Ha){var a=Zft(i);a&&i.animateFrom({style:a},r)}})}function o2t(n,t){var e=n.length;if(e!==t.length)return!1;for(var r=0;r<e;r++){var i=n[r],a=t[r];if(i.data.getId(i.dataIndex)!==a.data.getId(a.dataIndex))return!1}return!0}function PX(n,t,e){var r=f3(n),i=f3(t);function a(b,w,x,A,T){(x||b)&&w.animateFrom({style:x&&x!==b?ht(ht({},x.style),b.style):b.style},T)}var o=!1,s=e2t,l=Gt(),u=Gt();r.forEach(function(b){b.groupId&&l.set(b.groupId,!0),b.childGroupId&&u.set(b.childGroupId,!0)});for(var c=0;c<i.length;c++){var h=i[c].groupId;if(u.get(h)){s=u3;break}var f=i[c].childGroupId;if(f&&l.get(f)){s=c3;break}}function d(b,w){return function(x){var A=x.data,T=x.dataIndex;return w?A.getId(T):b?s===u3?x.childGroupId:x.groupId:s===c3?x.childGroupId:x.groupId}}var v=o2t(r,i),m={};if(!v)for(var c=0;c<i.length;c++){var y=i[c],g=y.data.getItemGraphicEl(y.dataIndex);g&&(m[g.id]=!0)}function p(b,w){var x=r[w],A=i[b],T=A.data.hostModel,C=x.data.getItemGraphicEl(x.dataIndex),E=A.data.getItemGraphicEl(A.dataIndex);if(C===E){E&&a2t(E,A.dataIndex,T);return}C&&m[C.id]||E&&(Gh(E),C?(Gh(C),OA(C),o=!0,RA(Yu(C),Yu(E),A.divide,T,b,a)):NA(E,T,b))}new $s(r,i,d(!0,v),d(!1,v),null,"multiple").update(p).updateManyToOne(function(b,w){var x=i[b],A=x.data,T=A.hostModel,C=A.getItemGraphicEl(x.dataIndex),E=qe(gt(w,function(k){return r[k].data.getItemGraphicEl(r[k].dataIndex)}),function(k){return k&&k!==C&&!m[k.id]});C&&(Gh(C),E.length?(B(E,function(k){Gh(k),OA(k)}),o=!0,RA(Yu(E),Yu(C),x.divide,T,b,a)):NA(C,T,x.dataIndex))}).updateOneToMany(function(b,w){var x=r[w],A=x.data.getItemGraphicEl(x.dataIndex);if(!(A&&m[A.id])){var T=qe(gt(b,function(E){return i[E].data.getItemGraphicEl(i[E].dataIndex)}),function(E){return E&&E!==A}),C=i[b[0]].data.hostModel;T.length&&(B(T,function(E){return Gh(E)}),A?(Gh(A),OA(A),o=!0,RA(Yu(A),Yu(T),x.divide,C,b[0],a)):B(T,function(E){return NA(E,C,b[0])}))}}).updateManyToMany(function(b,w){new $s(w,b,function(x){return r[x].data.getId(r[x].dataIndex)},function(x){return i[x].data.getId(i[x].dataIndex)}).update(function(x,A){p(b[x],w[A])}).execute()}).execute(),o&&B(t,function(b){var w=b.data,x=w.hostModel,A=x&&e.getViewOfSeriesModel(x),T=Jf("update",x,0);A&&x.isAnimationEnabled()&&T&&T.duration>0&&A.group.traverse(function(C){C instanceof Ae&&!C.animators.length&&C.animateFrom({style:{opacity:0}},T)})})}function d3(n){var t=n.getModel("universalTransition").get("seriesKey");return t||n.id}function p3(n){return pt(n)?n.sort().join(","):n}function Tl(n){if(n.hostModel)return n.hostModel.getModel("universalTransition").get("divideShape")}function s2t(n,t){var e=Gt(),r=Gt(),i=Gt();B(n.oldSeries,function(o,s){var l=n.oldDataGroupIds[s],u=n.oldData[s],c=d3(o),h=p3(c);r.set(h,{dataGroupId:l,data:u}),pt(c)&&B(c,function(f){i.set(f,{key:h,dataGroupId:l,data:u})})});function a(o){e.get(o)&&Er("Duplicated seriesKey in universalTransition "+o)}return B(t.updatedSeries,function(o){if(o.isUniversalTransitionEnabled()&&o.isAnimationEnabled()){var s=o.get("dataGroupId"),l=o.getData(),u=d3(o),c=p3(u),h=r.get(c);if(h)process.env.NODE_ENV!=="production"&&a(c),e.set(c,{oldSeries:[{dataGroupId:h.dataGroupId,divide:Tl(h.data),data:h.data}],newSeries:[{dataGroupId:s,divide:Tl(l),data:l}]});else if(pt(u)){process.env.NODE_ENV!=="production"&&a(c);var f=[];B(u,function(m){var y=r.get(m);y.data&&f.push({dataGroupId:y.dataGroupId,divide:Tl(y.data),data:y.data})}),f.length&&e.set(c,{oldSeries:f,newSeries:[{dataGroupId:s,data:l,divide:Tl(l)}]})}else{var d=i.get(u);if(d){var v=e.get(d.key);v||(v={oldSeries:[{dataGroupId:d.dataGroupId,data:d.data,divide:Tl(d.data)}],newSeries:[]},e.set(d.key,v)),v.newSeries.push({dataGroupId:s,data:l,divide:Tl(l)})}}}}),e}function v3(n,t){for(var e=0;e<n.length;e++){var r=t.seriesIndex!=null&&t.seriesIndex===n[e].seriesIndex||t.seriesId!=null&&t.seriesId===n[e].id;if(r)return e}}function l2t(n,t,e,r){var i=[],a=[];B(nr(n.from),function(o){var s=v3(t.oldSeries,o);s>=0&&i.push({dataGroupId:t.oldDataGroupIds[s],data:t.oldData[s],divide:Tl(t.oldData[s]),groupIdDim:o.dimension})}),B(nr(n.to),function(o){var s=v3(e.updatedSeries,o);if(s>=0){var l=e.updatedSeries[s].getData();a.push({dataGroupId:t.oldDataGroupIds[s],data:l,divide:Tl(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&PX(i,a,r)}function u2t(n){n.registerUpdateLifecycle("series:beforeupdate",function(t,e,r){B(nr(r.seriesTransition),function(i){B(nr(i.to),function(a){for(var o=r.updatedSeries,s=0;s<o.length;s++)(a.seriesIndex!=null&&a.seriesIndex===o[s].seriesIndex||a.seriesId!=null&&a.seriesId===o[s].id)&&(o[s][I0]=!0)})})}),n.registerUpdateLifecycle("series:transition",function(t,e,r){var i=r2t(e);if(i.oldSeries&&r.updatedSeries&&r.optionChanged){var a=r.seriesTransition;if(a)B(nr(a),function(d){l2t(d,i,r,e)});else{var o=s2t(i,r);B(o.keys(),function(d){var v=o.get(d);PX(v.oldSeries,v.newSeries,e)})}B(r.updatedSeries,function(d){d[I0]&&(d[I0]=!1)})}for(var s=t.getSeries(),l=i.oldSeries=[],u=i.oldDataGroupIds=[],c=i.oldData=[],h=0;h<s.length;h++){var f=s[h].getData();f.count()<MX&&(l.push(s[h]),u.push(s[h].get("dataGroupId")),c.push(f))}})}_e([_yt]);_e([vyt]);_e([zyt,e0t,h0t,W0t,ebt,Gbt,v_t,Q_t,_wt,Cwt,Nwt,P1t,txt,hxt,Ext,Dxt,Gxt,Yxt,aSt,hSt,wSt,nAt]);_e(xAt);_e(YAt);_e(C8);_e(sTt);_e(hj);_e(hTt);_e(_Tt);_e(sCt);_e(CCt);_e(Vg);_e(UCt);_e(jCt);_e(rEt);_e(uEt);_e(vEt);_e(wEt);_e(DEt);_e(qEt);_e(vX);_e(gX);_e(vMt);_e(wX);_e(xX);_e(_Mt);_e(IMt);_e(OMt);_e(u2t);_e(Nmt);var G0=1;function zi(n){var t=60,e=62,r=45,i=47,a=33,o=39,s=34,l=63,u=`\r
172
- >/= `,c=0;return G0=1,kX((function h(){for(var f=[];n[c];){if(n.charCodeAt(c)==t){if(n.charCodeAt(c+1)===i)return c=n.indexOf(">",c),f;if(n.charCodeAt(c+1)===a){if(n.charCodeAt(c+2)==r){for(;n.charCodeAt(c)!==e||n.charCodeAt(c-1)!=r||n.charCodeAt(c-2)!=r||c==-1;)c=n.indexOf(">",c+1);c===-1&&(c=n.length)}else for(c+=2;n.charCodeAt(c)!==e;c++);c++;continue}if(n.charCodeAt(c+1)===l){c=n.indexOf(">",c),c++;continue}for(var d=++c;u.indexOf(n[c])===-1;c++);for(var v=n.slice(d,c),m=!1,y={};n.charCodeAt(c)!==e;c++){var g=n.charCodeAt(c);if(g>64&&g<91||g>96&&g<123){for(d=c;u.indexOf(n[c])===-1;c++);for(var p=n.slice(d,c),b=n.charCodeAt(c);b!==o&&b!==s;)c++,b=n.charCodeAt(c);var w=n[c],x=++c;c=n.indexOf(w,x);var A=n.slice(x,c);m||(y={},m=!0),y[p]=A}}var T=[];n.charCodeAt(c-1)!==i&&(c++,T=h()),f.push({children:T,tagName:v,attrs:y})}else{var C=c;(c=n.indexOf("<",c)-1)===-2&&(c=n.length);var E=n.slice(C,c+1);E.length>0&&f.push(E)}c++}return f})())}function kX(n){var t={};if(n===void 0)return{};if(n.length===1&&typeof n[0]=="string")return n[0];for(var e in n.forEach((function(r){if(t[r.tagName]||(t[r.tagName]=[]),typeof r=="object"){var i=kX(r.children);typeof i=="object"&&(r.attrs&&(i.attrs=r.attrs),i.attrs===void 0?i.attrs={order:G0}:i.attrs.order=G0),G0++,t[r.tagName].push(i)}})),t)t[e].length==1&&(t[e]=t[e][0]);return t}function cf(n){return Math.abs(n)>2e4?"emu":"point"}function ar(n){return n/12700}function Bo(n){return n/20}function e_(n){return n/100}function uw(n){return n/6e4}function Cl(n){return n/1e5}function BA(n){var t=Math.ceil(n/26),e=(n%26||26)-1+65;return String.fromCharCode(e).repeat(t)}function Vr(n,t,e){var r={type:"solidFill"};if(n["a:srgbClr"])r.color="#"+n["a:srgbClr"].attrs.val;else if(n["a:schemeClr"]){var i=n["a:schemeClr"].attrs.val;e&&(i=e.getColorThemeName(i)),r.color=t.getColor(i)}else if(n["a:sysClr"])r.color="#"+n["a:sysClr"].attrs.lastClr;else if(n["a:prstClr"]){var a=q.get(n["a:prstClr"],["attrs","val"]);r.color=(function(f){var d,v=["white","AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenRod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","DarkOrange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","GoldenRod","Gray","Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory","Khaki","Lavender","LavenderBlush","LawnGreen","LemonChiffon","LightBlue","LightCoral","LightCyan","LightGoldenRodYellow","LightGray","LightGrey","LightGreen","LightPink","LightSalmon","LightSeaGreen","LightSkyBlue","LightSlateGray","LightSlateGrey","LightSteelBlue","LightYellow","Lime","LimeGreen","Linen","Magenta","Maroon","MediumAquaMarine","MediumBlue","MediumOrchid","MediumPurple","MediumSeaGreen","MediumSlateBlue","MediumSpringGreen","MediumTurquoise","MediumVioletRed","MidnightBlue","MintCream","MistyRose","Moccasin","NavajoWhite","Navy","OldLace","Olive","OliveDrab","Orange","OrangeRed","Orchid","PaleGoldenRod","PaleGreen","PaleTurquoise","PaleVioletRed","PapayaWhip","PeachPuff","Peru","Pink","Plum","PowderBlue","Purple","RebeccaPurple","Red","RosyBrown","RoyalBlue","SaddleBrown","Salmon","SandyBrown","SeaGreen","SeaShell","Sienna","Silver","SkyBlue","SlateBlue","SlateGray","SlateGrey","Snow","SpringGreen","SteelBlue","Tan","Teal","Thistle","Tomato","Turquoise","Violet","Wheat","White","WhiteSmoke","Yellow","YellowGreen"],m=["ffffff","f0f8ff","faebd7","00ffff","7fffd4","f0ffff","f5f5dc","ffe4c4","000000","ffebcd","0000ff","8a2be2","a52a2a","deb887","5f9ea0","7fff00","d2691e","ff7f50","6495ed","fff8dc","dc143c","00ffff","00008b","008b8b","b8860b","a9a9a9","a9a9a9","006400","bdb76b","8b008b","556b2f","ff8c00","9932cc","8b0000","e9967a","8fbc8f","483d8b","2f4f4f","2f4f4f","00ced1","9400d3","ff1493","00bfff","696969","696969","1e90ff","b22222","fffaf0","228b22","ff00ff","dcdcdc","f8f8ff","ffd700","daa520","808080","808080","008000","adff2f","f0fff0","ff69b4","cd5c5c","4b0082","fffff0","f0e68c","e6e6fa","fff0f5","7cfc00","fffacd","add8e6","f08080","e0ffff","fafad2","d3d3d3","d3d3d3","90ee90","ffb6c1","ffa07a","20b2aa","87cefa","778899","778899","b0c4de","ffffe0","00ff00","32cd32","faf0e6","ff00ff","800000","66cdaa","0000cd","ba55d3","9370db","3cb371","7b68ee","00fa9a","48d1cc","c71585","191970","f5fffa","ffe4e1","ffe4b5","ffdead","000080","fdf5e6","808000","6b8e23","ffa500","ff4500","da70d6","eee8aa","98fb98","afeeee","db7093","ffefd5","ffdab9","cd853f","ffc0cb","dda0dd","b0e0e6","800080","663399","ff0000","bc8f8f","4169e1","8b4513","fa8072","f4a460","2e8b57","fff5ee","a0522d","c0c0c0","87ceeb","6a5acd","708090","708090","fffafa","00ff7f","4682b4","d2b48c","008080","d8bfd8","ff6347","40e0d0","ee82ee","f5deb3","ffffff","f5f5f5","ffff00","9acd32"],y=v.indexOf(f);return y!=-1&&(d=m[y]),"#".concat(d||"000000")})(a)}var o=n["a:srgbClr"]||n["a:schemeClr"]||n["a:sysClr"],s=q.get(o,["a:alpha","attrs","val"],1e5);r.alpha=s/1e5;var l=q.get(o,["a:shade","attrs","val"]);l&&(r.shade=l/1e5);var u=q.get(o,["a:lumMod","attrs","val"]);u&&(r.lumMod=u/1e5);var c=q.get(o,["a:lumOff","attrs","val"]);c&&(r.lumOff=c/1e5);var h=q.get(o,["a:tint","attrs","val"]);return h&&(r.tint=h/1e5),r}function zg(n,t,e){var r,i={type:"blipFill"},a=q.get(n,["a:blip","attrs","r:embed"]);if(a){var o=(r=e.rels[a])===null||r===void 0?void 0:r.target;o&&(i.base64=t.getMedia(o))}var s=q.get(n,["a:blip","a:alphaModFix","attrs","amt"]);s&&(i.alpha=s/1e5);var l=q.get(n,["a:stretch","a:fillRect","attrs"]);return l&&(i.fillRect={},l.b&&(i.fillRect.b=l.b/1e5),l.t&&(i.fillRect.t=l.t/1e5),l.r&&(i.fillRect.r=l.r/1e5),l.l&&(i.fillRect.l=l.l/1e5)),i}function Gg(n,t,e){var r={type:"gradFill",tileRect:{},lin:{},gsList:[]};r.flip=n.attrs.flip,r.path=q.get(n,["a:path","attrs","path"])||"linear",r.rotWithShape=n.attrs.rotWithShape==="1",q.get(n,["a:lin","attrs","ang"])&&(r.lin.ang=uw(n["a:lin"].attrs.ang)),q.get(n,["a:lin","attrs","scaled"])&&(r.lin.scaled=n["a:lin"].attrs.scaled==="1");var i=q.get(n,["a:gsLst","a:gs"])||[];return r.gsList=i.map((function(a){return{color:Vr(a,t,e),pos:Cl(a.attrs.pos)}})),q.get(n,["a:tileRect","attrs","l"])&&(r.tileRect.l=Cl(n["a:tileRect"].attrs.l)),q.get(n,["a:tileRect","attrs","t"])&&(r.tileRect.t=Cl(n["a:tileRect"].attrs.t)),q.get(n,["a:tileRect","attrs","r"])&&(r.tileRect.r=Cl(n["a:tileRect"].attrs.r)),q.get(n,["a:tileRect","attrs","b"])&&(r.tileRect.b=Cl(n["a:tileRect"].attrs.b)),r}function FA(n){return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function VA(n){return n<.0031308?12.92*n:1.055*Math.pow(n,1/2.4)-.055}function g3(n,t){var e=n[0],r=n[1],i=n[2],a=FA(e/255)*t,o=FA(r/255)*t,s=FA(i/255)*t;return[Math.round(255*VA(a)),Math.round(255*VA(o)),Math.round(255*VA(s))]}function zA(n,t,e){var r=n/255,i=t/255,a=e/255,o=Math.max(r,i,a),s=Math.min(r,i,a),l=o-s,u=0,c=(o+s)/2;return l===0?u=0:o===r?u=(i-a)/l%6:o===i?u=(a-r)/l+2:o===a&&(u=(r-i)/l+4),(u=Math.round(60*u))<0&&(u+=360),{h:u,s:l===0||c===0||c===1?0:l/(1-Math.abs(2*c-1)),l:c}}function GA(n,t,e){var r,i,a,o=(1-Math.abs(2*e-1))*t,s=o*(1-Math.abs(n/60%2-1)),l=e-o/2;return n<60?(r=o,i=s,a=0):n<120?(r=s,i=o,a=0):n<180?(r=0,i=o,a=s):n<240?(r=0,i=s,a=o):n<300?(r=s,i=0,a=o):(r=o,i=0,a=s),[r=Math.round(255*(r+l)),i=Math.round(255*(i+l)),a=Math.round(255*(a+l))]}function Ke(n,t){if(!n||n.type==="none")return"";if(n.type==="solidFill"&&/^#[\da-fA-F]{3,6}$/.test(n.color)){var e=parseInt(n.color.substr(1,2),16),r=parseInt(n.color.substr(3,2),16),i=parseInt(n.color.substr(5,2),16);if(n.shade){var a=g3([e,r,i],n.shade);e=a[0],r=a[1],i=a[2]}if(n.lumMod){var o=(function(c,h,f,d){var v=zA(c,h,f),m=v.h,y=v.l*d;return y>=1&&(y=1),GA(m,v.s,y)})(e,r,i,n.lumMod);e=o[0],r=o[1],i=o[2]}if(n.lumOff&&(o=(function(c,h,f,d){var v=zA(c,h,f),m=v.h,y=d+v.l;return y>1&&(y=1),GA(m,v.s,y)})(e,r,i,n.lumOff),e=o[0],r=o[1],i=o[2]),n.tint||t?.light){var s=(function(c,h,f,d){var v=zA(c,h,f),m=v.h,y=v.l;return d>=1&&(d=1),GA(m,v.s,y*d+(1-d))})(e,r,i,n.tint||t?.light);e=s[0],r=s[1],i=s[2]}if(t?.dark){var l=g3([e,r,i],t?.dark);e=l[0],r=l[1],i=l[2]}var u=n.alpha;return"rgba(".concat(e,",").concat(r,",").concat(i,",").concat(u,")")}}var Hg=(function(){function n(t,e,r){var i,a;this.uuid=fut(),this.offset={x:0,y:0},this.extend={w:0,h:0},this.rotate=0,this.order=0,this.flipV=!1,this.flipH=!1,this.source=t,this.ctx=e,this.group=r;var o=q.get(t,["p:nvSpPr","p:nvPr"]);if(o){var s=q.get(o,"p:ph");s&&s.attrs&&(this.idx=s.attrs.idx,this.type=s.attrs.type),q.get(o,["attrs","userDrawn"])&&(this.userDrawn=q.get(o,["attrs","userDrawn"])==="1")}if(this.order=q.get(t,"attrs.order",0),this.source["p:spPr"]){if(u=this.getXfrm()){var l=this.group&&(!((i=this.ctx.pptx)===null||i===void 0)&&i.wps||cf(parseInt(u["a:off"].attrs.x))==="point")?Bo:ar;this.offset={x:Math.round(l(parseInt(u["a:off"].attrs.x))),y:Math.round(l(parseInt(u["a:off"].attrs.y)))},this.extend={w:Math.round(l(parseInt(u["a:ext"].attrs.cx))),h:Math.round(l(parseInt(u["a:ext"].attrs.cy||"0")))},this.rotate=uw(parseInt(q.get(u,"attrs.rot",0))),this.flipV=q.get(u,"attrs.flipV")==="1",this.flipH=q.get(u,"attrs.flipH")==="1"}}else if(this.source["p:xfrm"]){var u=this.source["p:xfrm"];l=this.group&&(!((a=this.ctx.pptx)===null||a===void 0)&&a.wps||cf(parseInt(u["a:off"].attrs.x))==="point")?Bo:ar,this.offset={x:Math.round(l(parseInt(u["a:off"].attrs.x))),y:Math.round(l(parseInt(u["a:off"].attrs.y)))},this.extend={w:Math.round(l(parseInt(u["a:ext"].attrs.cx))),h:Math.round(l(parseInt(u["a:ext"].attrs.cy)))}}if(r){var c=r.extend,h=r.chExtend,f=r.chOffset,d=h.w===0?0:c.w/h.w,v=h.h===0?0:c.h/h.h;this.extend.w=this.extend.w*d,this.extend.h=this.extend.h*v,this.offset.x=(this.offset.x-f.x)*d,this.offset.y=(this.offset.y-f.y)*v}}return Object.defineProperty(n.prototype,"theme",{get:function(){return(this.ctx.sliderMaster||this.ctx).theme},enumerable:!1,configurable:!0}),n.prototype.getColorThemeName=function(t){return this.ctx.getColorThemeName(t)},n.prototype.getXfrm=function(){var t=this.source["p:spPr"]["a:xfrm"];return t||(this.idx?t=this.ctx.getNodeInheritAttrsByIdx(this.idx,["p:spPr","a:xfrm"]):this.type&&(t=this.ctx.getNodeInheritAttrsByType(this.type,["p:spPr","a:xfrm"]))),t},n})(),c2t=(function(){function n(t,e){this.props={},this.inheritProps={},this.source=t,this.node=e,this._getInheritBodyProps(),this._parseBodyProps(),this._parseLstStyle(),this._parseText()}return n.prototype._getInheritBodyProps=function(){var t,e=this.node.ctx,r=this.node.type,i=this.node.idx;if(r||i)switch(e.slideType){case"slideMaster":break;case"slideLayout":(t=r?e.slideMaster.getNodeByType(r):e.slideMaster.getNodeByIdx(i))&&(this.inheritProps=q.get(t,["textBody","props"])||{});break;case"slide":(t=r?e.slideLayout.slideMaster.getNodeByType(r):e.slideLayout.slideMaster.getNodeByIdx(i))&&Object.assign(this.inheritProps,q.get(t,["textBody","props"])||{}),(t=r?e.slideLayout.getNodeByType(r):e.slideLayout.getNodeByIdx(i))&&Object.assign(this.inheritProps,q.get(t,["textBody","props"])||{})}},n.prototype._parseBodyProps=function(){var t=this,e=q.get(this.source,["a:bodyPr","attrs"])||{};Object.keys(e).forEach((function(o){switch(o){case"anchor":t.props.anchor=e[o];break;case"rtlCol":t.props.rtlCol=e[o]==="1";break;case"lIns":case"rIns":case"tIns":case"bIns":t.props[o]=ar(parseInt(e[o]));break;case"order":break;default:t.props[o]=e[o]}}));var r=q.get(this.source,["a:bodyPr","a:normAutofit","attrs"]);if(r){this.props.normAutofit={};var i=r.fontScale;i&&(this.props.normAutofit.fontScale=Cl(parseInt(i)));var a=r.lnSpcReduction;a&&(this.props.normAutofit.lnSpcReduction=Cl(parseInt(a)))}},n.prototype._parseLstStyle=function(){var t=this,e={},r=q.get(this.source,"a:lstStyle")||{};Object.keys(r).forEach((function(i){if(i.startsWith("a:")&&i.endsWith("pPr")){var a=i.substr(2,i.length-5);e[a]={props:t._formatPPr(r[i])};var o=q.get(r[i],["a:defRPr"]);e[a].defRPr=t._formatRPr(o)}})),this.lstStyle=e},n.prototype._parseText=function(){var t=this,e=q.get(this.source,["a:p"])||[];Array.isArray(e)||(e=[e]),this.paragraphs=e.map((function(r){return t._parseParagraph(r)}))},n.prototype._parseParagraph=function(t){var e=this,r={props:{},inheritProps:{},inheritRProps:{},endParaRProps:{},rows:[]},i=q.get(t,["a:pPr"])||{};r.props=this._formatPPr(i);var a=q.get(t,["a:endParaRPr"]);r.endParaRProps=this._formatRPr(a);var o=q.get(t,["a:r"])||[];Array.isArray(o)||(o=[o]);var s=q.get(t,["a:br"])||[];return Array.isArray(s)||(s=[s]),(o=o.concat(s.map((function(l){return Vt({isBr:!0},l)})))).sort((function(l,u){return q.get(l,["attrs","order"])-q.get(u,["attrs","order"])})),r.rows=o.map((function(l){return e._parseRow(l)})),r.inheritProps=this._getInheritPProps(r.props.level),r.inheritRProps=this._getInheritRProps(r.props.level),r},n.prototype._getInheritPProps=function(t){t===void 0&&(t="0");var e,r={},i=this.node.ctx,a=this.node.type,o=this.node.idx;switch(i.slideType){case"slideMaster":this.node.isTextBox?Object.assign(r,q.get(i.defaultTextStyle,["lvl".concat(t?+t+1:1),"props"])||{}):Object.assign(r,q.get(i,["textStyles","otherStyle","lvl".concat(t?+t+1:1),"props"])||{});break;case"slideLayout":this.node.isTextBox?Object.assign(r,q.get(i.slideMaster.defaultTextStyle,["lvl".concat(t?+t+1:1),"props"])||{}):Object.assign(r,q.get(i.slideMaster,["textStyles","otherStyle","lvl".concat(t?+t+1:1),"props"])||{}),(a||o)&&(e=a?i.slideMaster.getNodeByType(a):i.slideMaster.getNodeByIdx(o))&&Object.assign(r,q.get(e,["textBody","lstStyle","lvl".concat(t?+t+1:1),"props"])||{});break;case"slide":this.node.isTextBox?Object.assign(r,q.get(i.slideLayout.slideMaster.defaultTextStyle,["lvl".concat(t?+t+1:1),"props"])||{}):Object.assign(r,q.get(i.slideLayout.slideMaster,["textStyles","otherStyle","lvl".concat(t?+t+1:1),"props"])||{}),(a||o)&&(["subTitle","ctrTitle","title"].includes(a)&&Object.assign(r,q.get(i.slideLayout.slideMaster,["textStyles","titleStyle","lvl".concat(t?+t+1:1),"props"])||{}),(e=a?i.slideLayout.slideMaster.getNodeByType(a):i.slideLayout.slideMaster.getNodeByIdx(o))&&Object.assign(r,q.get(e,["textBody","lstStyle","lvl".concat(t?+t+1:1),"props"])||{}),(e=a?i.slideLayout.getNodeByType(a):i.slideLayout.getNodeByIdx(o))&&Object.assign(r,q.get(e,["textBody","lstStyle","lvl".concat(t?+t+1:1),"props"])||{}))}return r},n.prototype._getInheritRProps=function(t){t===void 0&&(t="0");var e,r={},i=this.node.ctx,a=this.node.type,o=this.node.idx;switch(i.slideType){case"slideMaster":this.node.isTextBox?Object.assign(r,q.get(i.defaultTextStyle,["lvl".concat(t?+t+1:1),"defRPr"])||{}):Object.assign(r,q.get(i,["textStyles","otherStyle","lvl".concat(t?+t+1:1),"defRPr"])||{});break;case"slideLayout":this.node.isTextBox?Object.assign(r,q.get(i.slideMaster.defaultTextStyle,["lvl".concat(t?+t+1:1),"defRPr"])||{}):Object.assign(r,q.get(i.slideMaster,["textStyles","otherStyle","lvl".concat(t?+t+1:1),"defRPr"])||{}),(a||o)&&(e=a?i.slideMaster.getNodeByType(a):i.slideMaster.getNodeByIdx(o))&&(r=q.get(e,["textBody","lstStyle","lvl".concat(t?+t+1:1),"defRPr"])||{});break;case"slide":this.node.isTextBox?Object.assign(r,q.get(i.slideLayout.slideMaster.defaultTextStyle,["lvl".concat(t?+t+1:1),"defRPr"])||{}):Object.assign(r,q.get(i.slideLayout.slideMaster,["textStyles","otherStyle","lvl".concat(t?+t+1:1),"defRPr"])||{}),(a||o)&&(["subTitle","ctrTitle","title"].includes(a)&&Object.assign(r,q.get(i.slideLayout.slideMaster,["textStyles","titleStyle","lvl".concat(t?+t+1:1),"defRPr"])||{}),(e=a?i.slideLayout.slideMaster.getNodeByType(a):i.slideLayout.slideMaster.getNodeByIdx(o))&&Object.assign(r,q.get(e,["textBody","lstStyle","lvl".concat(t?+t+1:1),"defRPr"])||{}),(e=a?i.slideLayout.getNodeByType(a):i.slideLayout.getNodeByIdx(o))&&Object.assign(r,q.get(e,["textBody","lstStyle","lvl".concat(t?+t+1:1),"defRPr"])||{}))}var s=q.get(this.node.source,["p:style","a:fontRef"]);return q.get(s,"a:schemeClr")&&(r.color=Vr(s,this.node.theme,this.node)),q.get(this.lstStyle,["lvl".concat(t?+t+1:1),"defRPr"])&&Object.assign(r,q.get(this.lstStyle,["lvl".concat(t?+t+1:1),"defRPr"])),r},n.prototype._formatPPr=function(t){var e={},r=q.get(t,"attrs")||{};return Object.keys(r).forEach((function(i){switch(i){case"algn":e.align=r[i];break;case"marL":e.marginLeft=ar(parseInt(r[i]));break;case"indent":e.indent=ar(parseInt(r[i]));break;case"lvl":e.level=r[i]}})),q.get(t,["a:lnSpc","a:spcPct","attrs","val"])&&(e.lineHeight=parseInt(t["a:lnSpc"]["a:spcPct"].attrs.val)/1e5),q.get(t,["a:buAutoNum","attrs","type"])&&(e.buAutoNum=t["a:buAutoNum"].attrs.type),q.get(t,["a:buChar","attrs","char"])&&(e.buChar=t["a:buChar"].attrs.char),q.get(t,["a:spcBef","a:spcPts","attrs","val"])&&(e.spaceBefore=e_(parseInt(t["a:spcBef"]["a:spcPts"].attrs.val))),q.get(t,["a:spcAft","a:spcPts","attrs","val"])&&(e.spaceAfter=e_(parseInt(t["a:spcAft"]["a:spcPts"].attrs.val))),q.get(t,["a:defRPr"])&&(e.defRPr=this._formatRPr(q.get(t,["a:defRPr"]))),e},n.prototype._parseRow=function(t){if(t.isBr)return{isBr:!0};var e={props:{},text:""},r=q.get(t,["a:rPr"])||{};return e.props=this._formatRPr(r),e.text=q.get(t,"a:t")||"",e},n.prototype._formatRPr=function(t){var e={},r=q.get(t,"attrs")||{};Object.keys(r).forEach((function(o){switch(o){case"sz":e.size=parseInt(r[o])/100;break;case"b":e.bold=r[o]==="1";break;case"i":e.italic=r[o]==="1";break;case"u":e.underline=r[o];break;case"strike":e.strike=r[o];break;case"order":case"dirty":break;default:e[o]=r[o]}}));var i=q.get(t,"a:solidFill");i&&(e.color=Vr(i,this.node.theme,this.node));var a=q.get(t,"a:highlight");return a&&(e.background=Vr(a,this.node.theme,this.node)),e.typeface=q.get(t,["a:ea","attrs","typeface"]),e},n})();function hf(n,t,e){var r={};if(!q.get(n,"a:noFill")){q.get(n,"attrs.w")&&(r.width=ar(parseInt(q.get(n,"attrs.w"))));var i=q.get(n,"a:solidFill");i&&(r.color=Vr(i,t,e));var a=q.get(n,"a:prstDash");if(a&&(r.type=a.attrs.val),q.get(n,["a:miter"])&&(r.lineJoin="miter"),q.get(n,["a:bevel"])&&(r.lineJoin="bevel"),q.get(n,["a:round"])&&(r.lineJoin="round"),q.get(n,["a:miter","attrs","lim"])&&(r.miterLim=ar(parseInt(q.get(n,["a:miter","attrs","lim"])))),q.get(n,["a:headEnd"])){var o=q.get(n,["a:headEnd","attrs"]);r.headEnd={type:o.type,len:o.len,w:o.w}}if(q.get(n,["a:tailEnd"])){var s=q.get(n,["a:tailEnd","attrs"]);r.tailEnd={type:s.type,len:s.len,w:s.w}}return r}}var rg=(function(n){function t(e,r,i,a){var o=n.call(this,e,i,a)||this;return o.border={},o.prstGeom={},o.isTextBox=!1,o.pptx=r,o._parseShape(),o._parIsTextBox(),o._parsePrstGeom(),o._parseBackground(),o._parseBorder(),o._parseTxt(),o}return yg(t,n),t.prototype._parseShape=function(){if(this.shape=q.get(this.source,["p:spPr","a:prstGeom","attrs","prst"]),!this.shape&&q.get(this.source,["p:spPr","a:custGeom"])){this.shape="customGeom";var e=q.get(this.source,["p:spPr","a:custGeom","a:pathLst","a:path"]),r=[],i=[],a=function(s){switch(s){case"a:moveTo":case"a:cubicBezTo":case"a:lnTo":i=Array.isArray(e[s])?e[s]:[e[s]],r=r.concat(i.map((function(l){return{order:l.attrs.order,type:s.split(":")[1],points:(Array.isArray(l["a:pt"])?l["a:pt"]:[l["a:pt"]]).map((function(u){return[ar(parseInt(q.get(u,["attrs","x"]))),ar(parseInt(q.get(u,["attrs","y"])))]}))}})));break;case"a:close":i=Array.isArray(e[s])?e[s]:[e[s]],r=r.concat(i.map((function(l){return{order:l.attrs.order,type:s.split(":")[1]}})))}};for(var o in e)a(o);r.sort((function(s,l){return s.order-l.order})),this.prstGeom.pathList=r,q.get(e,["attrs","w"])&&(this.prstGeom.w=ar(parseInt(q.get(e,["attrs","w"])))),q.get(e,["attrs","h"])&&(this.prstGeom.h=ar(parseInt(q.get(e,["attrs","h"]))))}},t.prototype._parIsTextBox=function(){this.isTextBox=q.get(this.source,["p:nvSpPr","p:cNvSpPr","attrs","txBox"])==="1"},t.prototype._parsePrstGeom=function(){var e=this,r=q.get(this.source,["p:spPr","a:prstGeom"]),i=q.get(r,["a:avLst","a:gd"]);i&&(Array.isArray(i)||(i=[i]),this.prstGeom.gd=i.map((function(a){var o=["pie","chord","arc"].includes(e.shape)||["blockArc"].includes(e.shape)&&["adj1","adj2"].includes(a.attrs.name)?uw(parseInt(a.attrs.fmla.split(" ")[1])):Cl(parseInt(a.attrs.fmla.split(" ")[1]));return{name:a.attrs.name,fmla:o}})))},t.prototype._parseBackground=function(){if(!q.get(this.source,["p:spPr","a:noFill"]))if(q.get(this.source,["p:spPr","a:grpFill"])&&this.group)this.background=this.group.getBackground();else{var e=q.get(this.source,["p:spPr","a:solidFill"]);if(e)this.background=Vr(e,this.theme,this);else{var r=q.get(this.source,["p:spPr","a:gradFill"]);if(r)this.background=Gg(r,this.theme,this);else{var i=q.get(this.source,["p:spPr","a:blipFill"]);if(i)this.background=zg(i,this.pptx,this.ctx);else{var a=q.get(this.source,["p:style","a:fillRef"]);a&&(this.background=Vr(a,this.theme,this))}}}}},t.prototype._parseBorder=function(){var e=q.get(this.source,["p:style","a:lnRef"]);if(e){var r=parseInt(e.attrs.idx),i=this.theme.getLineStyle(r);this.border=Vt(Vt({},i),this.border),this.border.color&&this.border.color.color||(this.border.color=Vr(e,this.theme,this))}var a=q.get(this.source,["p:spPr","a:ln"]);a&&Object.assign(this.border,hf(a,this.theme,this)),this.border.color&&this.border.color.color&&!this.border.width&&(this.border.width=t.defaultBorderWidth)},t.prototype._parseTxt=function(){this.textBody=new c2t(q.get(this.source,["p:txBody"]),this)},t.defaultBorderWidth=.75,t})(Hg),r_=(function(n){function t(e,r,i,a,o){var s,l,u=n.call(this,r,a,o)||this;u.userDrawn=!0,u.pptx=i,u.path=e;var c=q.get(u.source,["p:blipFill","a:srcRect"]);c&&(u.clip={},c.attrs.b&&(u.clip.b=parseInt(c.attrs.b)/1e5),c.attrs.t&&(u.clip.t=parseInt(c.attrs.t)/1e5),c.attrs.l&&(u.clip.l=parseInt(c.attrs.l)/1e5),c.attrs.r&&(u.clip.r=parseInt(c.attrs.r)/1e5));var h=q.get(r,["p:nvPicPr","p:nvPr","a:audioFile","attrs","r:link"]);if(h){var f=(s=u.ctx.rels[h])===null||s===void 0?void 0:s.target;u.audioFile=u.pptx.getMedia(f)}var d=q.get(r,["p:nvPicPr","p:nvPr","a:videoFile","attrs","r:link"]);if(d){var v=(l=u.ctx.rels[d])===null||l===void 0?void 0:l.target;u.videoFile=u.pptx.getMedia(v)}return u}return yg(t,n),Object.defineProperty(t.prototype,"base64",{get:function(){return this.pptx.getMedia(this.path)},enumerable:!1,configurable:!0}),t})(Hg),DX=(function(n){function t(e,r,i,a){var o=n.call(this,e,i,a)||this;return o.userDrawn=!0,o.props={tableStyleId:""},o.tableGrid={gridCol:[]},o.tr=[],o.tableStyles={},o.pptx=r,o._parseTableProps(),o._parseTableGrid(),o._parseTr(),o._parseInheritStyles(),o}return yg(t,n),Object.defineProperty(t.prototype,"slideMaster",{get:function(){return this.ctx.slideMaster||this.ctx},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"theme",{get:function(){return this.slideMaster.theme},enumerable:!1,configurable:!0}),t.prototype._parseTableProps=function(){var e=q.get(this.source,["a:graphic","a:graphicData","a:tbl","a:tblPr"]);this.props.tableStyleId=q.get(e,"a:tableStyleId"),this.tableStyles=q.get(this.slideMaster.tableStyles,this.props.tableStyleId)||{},q.get(e,["attrs","bandCol"])==="1"&&(this.props.bandCol=!0),q.get(e,["attrs","bandRow"])==="1"&&(this.props.bandRow=!0),q.get(e,["attrs","firstCol"])==="1"&&(this.props.firstCol=!0),q.get(e,["attrs","firstRow"])==="1"&&(this.props.firstRow=!0),q.get(e,["attrs","lastCol"])==="1"&&(this.props.lastCol=!0),q.get(e,["attrs","lastRow"])==="1"&&(this.props.lastRow=!0)},t.prototype._parseTableGrid=function(){var e=q.get(this.source,["a:graphic","a:graphicData","a:tbl","a:tblGrid","a:gridCol"]);if(e)for(var r=0;r<e.length;r++){var i=q.get(e[r],["attrs","w"]);this.tableGrid.gridCol.push({width:ar(parseInt(i))})}},t.prototype._parseTr=function(){var e=[],r=q.get(this.source,["a:graphic","a:graphicData","a:tbl","a:tr"]);Array.isArray(r)||(r=[r]);for(var i=0;i<r.length;i++){var a={props:{},td:[]},o=r[i];a.props.height=ar(parseInt(q.get(o,["attrs","h"])));var s=q.get(o,["a:tc"]);Array.isArray(s)||(s=[s]);for(var l=0;l<s.length;l++)a.td.push(this._parseTd(s[l]));e.push(a)}this.tr=e},t.prototype._parseTd=function(e){var r,i,a,o,s=this,l={props:{border:{}},paragraphs:[]},u=q.get(e,["a:tcPr","attrs"]);u?.marB&&(l.props.marB=ar(parseInt(u?.marB))),u?.marT&&(l.props.marT=ar(parseInt(u?.marT))),u?.marL&&(l.props.marL=ar(parseInt(u?.marL))),u?.marR&&(l.props.marR=ar(parseInt(u?.marR))),u?.anchor&&(l.props.anchor=u?.anchor);var c=q.get(e,["a:tcPr"]);q.get(c,["a:lnR"])&&(l.props.border.right=hf(q.get(c,["a:lnR"]),this.theme,this.ctx)),q.get(c,["a:lnL"])&&(l.props.border.left=hf(q.get(c,["a:lnL"]),this.theme,this.ctx)),q.get(c,["a:lnT"])&&(l.props.border.top=hf(q.get(c,["a:lnT"]),this.theme,this.ctx)),q.get(c,["a:lnB"])&&(l.props.border.bottom=hf(q.get(c,["a:lnB"]),this.theme,this.ctx)),!((r=e?.attrs)===null||r===void 0)&&r.rowSpan&&(l.props.rowSpan=parseInt(e.attrs.rowSpan)),!((i=e?.attrs)===null||i===void 0)&&i.gridSpan&&(l.props.gridSpan=parseInt(e.attrs.gridSpan)),!((a=e?.attrs)===null||a===void 0)&&a.vMerge&&(l.props.vMerge=e.attrs.vMerge==="1"),!((o=e?.attrs)===null||o===void 0)&&o.hMerge&&(l.props.hMerge=e.attrs.hMerge==="1");var h=q.get(e,["a:tcPr","a:solidFill"]);h&&(l.props.background=Vr(h,this.theme,this.ctx));var f=q.get(e,["a:txBody"]),d=q.get(f,["a:p"]);return Array.isArray(d)||(d=[d]),l.paragraphs=d.map((function(v){return s._parseParagraph(v)})),l},t.prototype._parseParagraph=function(e){var r=this,i={props:{},inheritProps:{},inheritRProps:{},endParaRProps:{},rows:[]},a=q.get(e,["a:pPr"])||{};i.props=this._formatPPr(a);var o=q.get(e,["a:endParaRPr"]);i.endParaRProps=this._formatRPr(o);var s=q.get(e,["a:r"])||[];Array.isArray(s)||(s=[s]);var l=q.get(e,["a:br"])||[];return Array.isArray(l)||(l=[l]),(s=s.concat(l.map((function(u){return Vt({isBr:!0},u)})))).sort((function(u,c){return q.get(u,["attrs","order"])-q.get(c,["attrs","order"])})),i.rows=s.map((function(u){return r._parseRow(u)})),i},t.prototype._parseRow=function(e){if(e.isBr)return{isBr:!0};var r={props:{},text:""},i=q.get(e,["a:rPr"])||{};return r.props=this._formatRPr(i),r.text=q.get(e,"a:t")||"",r},t.prototype._formatPPr=function(e){var r={},i=q.get(e,"attrs")||{};return Object.keys(i).forEach((function(a){a==="algn"&&(r.align=i[a])})),q.get(e,["a:lnSpc","a:spcPct","attrs","val"])&&(r.lineHeight=parseInt(e["a:lnSpc"]["a:spcPct"].attrs.val)/1e5),q.get(e,["a:buAutoNum","attrs","type"])&&(r.buAutoNum=e["a:buAutoNum"].attrs.type),q.get(e,["a:buChar","attrs","char"])&&(r.buChar=e["a:buChar"].attrs.char),q.get(e,["a:spcBef","a:spcPts","attrs","val"])&&(r.spaceBefore=e_(parseInt(e["a:spcBef"]["a:spcPts"].attrs.val))),q.get(e,["a:spcAft","a:spcPts","attrs","val"])&&(r.spaceAfter=e_(parseInt(e["a:spcAft"]["a:spcPts"].attrs.val))),r},t.prototype._formatRPr=function(e){var r={},i=q.get(e,"attrs")||{};Object.keys(i).forEach((function(s){switch(s){case"sz":r.size=parseInt(i[s])/100;break;case"b":r.bold=i[s]==="1";break;case"i":r.italic=i[s]==="1";break;case"u":r.underline=i[s];break;case"strike":r.strike=i[s];break;case"order":case"dirty":break;default:r[s]=i[s]}}));var a=q.get(e,"a:solidFill");a&&(r.color=Vr(a,this.theme,this.ctx));var o=q.get(e,"a:highlight");return o&&(r.background=Vr(o,this.theme,this.ctx)),r.typeface=q.get(e,["a:ea","attrs","typeface"]),r},t.prototype._isLastCol=function(e,r){var i,a;if(r===e.length-1)return!0;for(var o=r+1;o<e.length;o++)if(!(!((i=e[o].props)===null||i===void 0)&&i.hMerge)&&!(!((a=e[o].props)===null||a===void 0)&&a.vMerge))return!1;return!0},t.prototype._isBandRow=function(e){var r;return!((r=this.props)===null||r===void 0)&&r.firstRow?e%2==1:e%2==0},t.prototype._isBandCol=function(e){var r;return!((r=this.props)===null||r===void 0)&&r.firstCol?e%2==1:e%2==0},t.prototype._parseInheritStyles=function(){var e,r,i,a,o,s,l,u,c=this,h=(r=(e=this.tableStyles)===null||e===void 0?void 0:e.wholeTbl)===null||r===void 0?void 0:r.tcStyle,f=(a=(i=this.tableStyles)===null||i===void 0?void 0:i.wholeTbl)===null||a===void 0?void 0:a.tcTxStyle,d=(s=(o=this.slideMaster.defaultTextStyle)===null||o===void 0?void 0:o.lvl1)===null||s===void 0?void 0:s.props,v=(u=(l=this.slideMaster.defaultTextStyle)===null||l===void 0?void 0:l.lvl1)===null||u===void 0?void 0:u.defRPr;this.tr.forEach((function(m,y){m.td.forEach((function(g,p){var b,w,x,A,T,C,E,k,D,L,R,P,O,F,z,G,U,K,W,X,Q,at,rt,Rt,Mt,xt,vt,Et,_t,Dt,zt,N,lt,ot,Y,j,tt,bt,mt,ct,Pt,Ht,Lt,qt,we,ce,rr,$r,jr,Cn,er,Gr,En,Xr,Mi,as,De=Vt(Vt({},d),h),xr=Vt(Vt({},v),f);c.props.firstRow&&y===0?(De=Vt(Vt(Vt({},De),(w=(b=c.tableStyles)===null||b===void 0?void 0:b.firstRow)===null||w===void 0?void 0:w.tcStyle),{border:Vt(Vt({},De?.border),(T=(A=(x=c.tableStyles)===null||x===void 0?void 0:x.firstRow)===null||A===void 0?void 0:A.tcStyle)===null||T===void 0?void 0:T.border)}),xr=Vt(Vt({},xr),(E=(C=c.tableStyles)===null||C===void 0?void 0:C.firstRow)===null||E===void 0?void 0:E.tcTxStyle)):c.props.lastRow&&y===c.tr.length-1?(De=Vt(Vt(Vt({},De),(D=(k=c.tableStyles)===null||k===void 0?void 0:k.lastRow)===null||D===void 0?void 0:D.tcStyle),{border:Vt(Vt({},De?.border),(P=(R=(L=c.tableStyles)===null||L===void 0?void 0:L.lastRow)===null||R===void 0?void 0:R.tcStyle)===null||P===void 0?void 0:P.border)}),xr=Vt(Vt({},xr),(F=(O=c.tableStyles)===null||O===void 0?void 0:O.lastRow)===null||F===void 0?void 0:F.tcTxStyle)):c.props.firstCol&&p===0?(De=Vt(Vt(Vt({},De),(G=(z=c.tableStyles)===null||z===void 0?void 0:z.firstCol)===null||G===void 0?void 0:G.tcStyle),{border:Vt(Vt({},De?.border),(W=(K=(U=c.tableStyles)===null||U===void 0?void 0:U.firstCol)===null||K===void 0?void 0:K.tcStyle)===null||W===void 0?void 0:W.border)}),xr=Vt(Vt({},xr),(Q=(X=c.tableStyles)===null||X===void 0?void 0:X.firstCol)===null||Q===void 0?void 0:Q.tcTxStyle)):c.props.lastCol&&c._isLastCol(m.td,p)?(De=Vt(Vt(Vt({},De),(rt=(at=c.tableStyles)===null||at===void 0?void 0:at.lastCol)===null||rt===void 0?void 0:rt.tcStyle),{border:Vt(Vt({},De?.border),(xt=(Mt=(Rt=c.tableStyles)===null||Rt===void 0?void 0:Rt.lastCol)===null||Mt===void 0?void 0:Mt.tcStyle)===null||xt===void 0?void 0:xt.border)}),xr=Vt(Vt({},xr),(Et=(vt=c.tableStyles)===null||vt===void 0?void 0:vt.lastCol)===null||Et===void 0?void 0:Et.tcTxStyle)):(c.props.bandRow&&(c._isBandRow(y)?(De=Vt(Vt(Vt({},De),(Dt=(_t=c.tableStyles)===null||_t===void 0?void 0:_t.band1H)===null||Dt===void 0?void 0:Dt.tcStyle),{border:Vt(Vt({},De?.border),(lt=(N=(zt=c.tableStyles)===null||zt===void 0?void 0:zt.band1H)===null||N===void 0?void 0:N.tcStyle)===null||lt===void 0?void 0:lt.border)}),xr=Vt(Vt({},xr),(Y=(ot=c.tableStyles)===null||ot===void 0?void 0:ot.band1H)===null||Y===void 0?void 0:Y.tcTxStyle)):(De=Vt(Vt(Vt({},De),(tt=(j=c.tableStyles)===null||j===void 0?void 0:j.band2V)===null||tt===void 0?void 0:tt.tcStyle),{border:Vt(Vt({},De?.border),(ct=(mt=(bt=c.tableStyles)===null||bt===void 0?void 0:bt.band2V)===null||mt===void 0?void 0:mt.tcStyle)===null||ct===void 0?void 0:ct.border)}),xr=Vt(Vt({},xr),(Ht=(Pt=c.tableStyles)===null||Pt===void 0?void 0:Pt.band2V)===null||Ht===void 0?void 0:Ht.tcTxStyle))),c.props.bandCol&&(c._isBandCol(p)?(De=Vt(Vt(Vt({},De),(qt=(Lt=c.tableStyles)===null||Lt===void 0?void 0:Lt.band1V)===null||qt===void 0?void 0:qt.tcStyle),{border:Vt(Vt({},De?.border),(rr=(ce=(we=c.tableStyles)===null||we===void 0?void 0:we.band1V)===null||ce===void 0?void 0:ce.tcStyle)===null||rr===void 0?void 0:rr.border)}),xr=Vt(Vt({},xr),(jr=($r=c.tableStyles)===null||$r===void 0?void 0:$r.band1V)===null||jr===void 0?void 0:jr.tcTxStyle)):(De=Vt(Vt(Vt({},De),(er=(Cn=c.tableStyles)===null||Cn===void 0?void 0:Cn.band2H)===null||er===void 0?void 0:er.tcStyle),{border:Vt(Vt({},De?.border),(Xr=(En=(Gr=c.tableStyles)===null||Gr===void 0?void 0:Gr.band2H)===null||En===void 0?void 0:En.tcStyle)===null||Xr===void 0?void 0:Xr.border)}),xr=Vt(Vt({},xr),(as=(Mi=c.tableStyles)===null||Mi===void 0?void 0:Mi.band2H)===null||as===void 0?void 0:as.tcTxStyle)))),g.inheritTcStyle=De,g.inheritTcTxStyle=xr}))}))},t})(Hg),XP=(function(){function n(t,e,r,i){if(this.offset={x:0,y:0},this.chOffset={x:0,y:0},this.extend={w:0,h:0},this.chExtend={w:0,h:0},this.rotate=0,this.nodes=[],this.flipV=!1,this.flipH=!1,this.userDrawn=!0,this.order=q.get(t,["attrs","order"]),this.pptx=e,this.ctx=r,this.source=t,this.group=i,this.source["p:grpSpPr"]){var a=q.get(this.source,["p:grpSpPr","a:xfrm"]);if(a&&(this.offset={x:Math.round(this.group&&this.pptx.wps?Bo(parseInt(a["a:off"].attrs.x)):ar(parseInt(a["a:off"].attrs.x))),y:Math.round(this.group&&this.pptx.wps?Bo(parseInt(a["a:off"].attrs.y)):ar(parseInt(a["a:off"].attrs.y)))},this.chOffset={x:Math.round(cf(a["a:chOff"].attrs.x)==="point"||this.pptx.wps?Bo(parseInt(a["a:chOff"].attrs.x)):ar(parseInt(a["a:chOff"].attrs.x))),y:Math.round(cf(a["a:chOff"].attrs.y)==="point"||this.pptx.wps?Bo(parseInt(a["a:chOff"].attrs.y)):ar(parseInt(a["a:chOff"].attrs.y)))},this.chExtend={w:Math.round(cf(a["a:chExt"].attrs.cx)==="point"||this.pptx.wps?Bo(parseInt(a["a:chExt"].attrs.cx)):ar(parseInt(a["a:chExt"].attrs.cx))),h:Math.round(cf(a["a:chExt"].attrs.cy)==="point"||this.pptx.wps?Bo(parseInt(a["a:chExt"].attrs.cy)):ar(parseInt(a["a:chExt"].attrs.cy)))},this.extend={w:Math.round(this.group&&this.pptx.wps?Bo(parseInt(a["a:ext"].attrs.cx)):ar(parseInt(a["a:ext"].attrs.cx))),h:Math.round(this.group&&this.pptx.wps?Bo(parseInt(a["a:ext"].attrs.cy)):ar(parseInt(a["a:ext"].attrs.cy)))},this.rotate=uw(parseInt(q.get(a,"attrs.rot",0))),this.flipV=q.get(a,"attrs.flipV")==="1",this.flipH=q.get(a,"attrs.flipH")==="1"),i){var o=i.extend,s=i.chExtend,l=i.chOffset,u=o.w/s.w,c=o.h/s.h;this.extend.w=this.extend.w*u,this.extend.h=this.extend.h*c,this.offset.x=(this.offset.x-l.x)*u,this.offset.y=(this.offset.y-l.y)*c}}this._parseBackground(),this._parseNodes()}return n.prototype.getBackground=function(){return this.background&&this.background.type!=="none"?this.background:this.group?this.group.getBackground():void 0},n.prototype._parseBackground=function(){var t=q.get(this.source,["p:grpSpPr"]);t&&t["a:solidFill"]?this.background=Vr(t["a:solidFill"],this.ctx.theme,this.ctx):t&&t["a:gradFill"]?this.background=Gg(t["a:gradFill"],this.ctx.theme,this.ctx):t&&t["a:blipFill"]&&(this.background=zg(t["a:blipFill"],this.pptx,this.ctx))},n.prototype._parseNodes=function(){var t=this.source;Ug(this.nodes,t,this.pptx,this.ctx,this)},n})(),LX=(function(n){function t(e,r,i,a){var o=n.call(this,e,i,a)||this;return o.nodes=[],o.pptx=r,o}return yg(t,n),t.prototype.parseNode=function(){return bn(this,void 0,void 0,(function(){var e,r,i,a,o,s,l,u,c;return _n(this,(function(h){switch(h.label){case 0:return h.trys.push([0,3,,4]),(e=q.get(this.source,["a:graphic","a:graphicData","dgm:relIds","attrs","r:dm"]))&&this.ctx.rels[e]?(r=this.ctx.rels[e].target,a=zi,[4,this.pptx.getXmlByPath(r)]):[2];case 1:return i=a.apply(void 0,[h.sent()]),(o=q.get(i,["dgm:dataModel","dgm:extLst","a:ext","dsp:dataModelExt","attrs","relId"]))&&this.ctx.rels[o]?(s=this.ctx.rels[o].target,[4,this.pptx.getXmlByPath(s)]):[2];case 2:return l=(l=h.sent()).replace(/dsp:/g,"p:"),u=zi(l),c=q.get(u,["p:drawing","p:spTree"]),Ug(this.nodes,c,this.pptx,this.ctx),[3,4];case 3:return h.sent(),[3,4];case 4:return[2]}}))}))},t})(Hg),IX=(function(n){function t(e,r,i,a){var o=n.call(this,e,i,a)||this;return o.options={title:{},tooltip:{},legend:{},series:[],color:[]},o.userDrawn=!0,o.pptx=r,o}return yg(t,n),Object.defineProperty(t.prototype,"slideMaster",{get:function(){return this.ctx.slideMaster||this.ctx},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"theme",{get:function(){return this.slideMaster.theme},enumerable:!1,configurable:!0}),t.prototype.parseNode=function(){return bn(this,void 0,void 0,(function(){var e,r,i,a,o,s;return _n(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),(e=q.get(this.source,["a:graphic","a:graphicData","c:chart","attrs","r:id"]))&&this.ctx.rels[e]?(r=this.ctx.rels[e].target,a=zi,[4,this.pptx.getXmlByPath(r)]):[2];case 1:return i=a.apply(void 0,[l.sent()]),o=q.get(i,["c:chartSpace","c:chart"]),s=q.get(o,["c:plotArea"]),q.get(s,["c:lineChart"])?this.parseLine(q.get(s,["c:lineChart"]),o):q.get(s,["c:line3DChart"])?this.parseLine(q.get(s,["c:line3DChart"]),o):q.get(s,["c:areaChart"])?this.parseAreaLine(q.get(s,["c:areaChart"]),o):q.get(s,["c:area3DChart"])?this.parseAreaLine(q.get(s,["c:area3DChart"]),o):q.get(s,["c:barChart"])?this.parseBar(q.get(s,["c:barChart"]),o):q.get(s,["c:bar3DChart"])?this.parseBar(q.get(s,["c:bar3DChart"]),o):q.get(s,["c:pieChart"])?this.parsePie(q.get(s,["c:pieChart"])):q.get(s,["c:pie3DChart"])?this.parsePie(q.get(s,["c:pie3DChart"])):q.get(s,["c:doughnutChart"])&&this.parseDoughnutChart(q.get(s,["c:doughnutChart"])),[3,3];case 2:return l.sent(),[3,3];case 3:return[2]}}))}))},t.prototype.parseAreaLine=function(e,r){this.parseLine(e,r),this.options.series=this.options.series.map((function(i){return i.areaStyle={},i}))},t.prototype.parseLine=function(e,r){var i=q.get(e,["c:ser"]);Array.isArray(i)||(i=[i]),this.options.title={top:"top",left:"center",text:this.parseChartTitle(q.get(r,["c:title"]))},this.options.xAxis={type:"category",data:this.getCategory(i[0])},this.options.yAxis={type:"value"},this.options.series=this.parseLineSeries(i,e),this.options.color=this.parseLineColors(i),this.options.legend={bottom:"bottom",left:"center"},q.get(e,["c:grouping","attrs","val"])==="percentStacked"&&(this.options.tooltip.valueFormatter=function(a){return(100*a).toFixed(2)+"%"})},t.prototype.parseBar=function(e,r){var i=q.get(e,["c:ser"]);Array.isArray(i)||(i=[i]),this.options.title={top:"top",left:"center",text:this.parseChartTitle(q.get(r,["c:title"]))},q.get(e,["c:barDir","attrs","val"])==="bar"?(this.options.yAxis={type:"category",data:this.getCategory(i[0])},this.options.xAxis={type:"value"}):(this.options.xAxis={type:"category",data:this.getCategory(i[0])},this.options.yAxis={type:"value"}),this.options.series=this.parseBarSeries(i,e),this.options.color=this.parseBarColors(i),this.options.legend={bottom:"bottom",left:"center"},q.get(e,["c:grouping","attrs","val"])==="percentStacked"&&(this.options.tooltip.valueFormatter=function(a){return(100*a).toFixed(2)+"%"})},t.prototype.parsePie=function(e){var r=q.get(e,["c:ser"]);this.options.title={top:"top",left:"center",text:this.parsePieTitle(r)},this.options.color=this.parsePieColors(r),this.options.series=[this.parsePieSeries(r,e)],this.options.legend={bottom:"bottom",left:"center"}},t.prototype.parseDoughnutChart=function(e){var r=q.get(e,["c:ser"]);this.options.title.text=this.parsePieTitle(r),this.options.color=this.parsePieColors(r),this.options.series=[this.parsePieSeries(r,e)],this.options.legend={bottom:"bottom",left:"center"}},t.prototype.parsePieTitle=function(e){return q.get(e,["c:tx","c:strRef","c:strCache","c:pt","c:v"])},t.prototype.parseChartTitle=function(e){var r=q.get(e,["c:tx","c:rich","a:p"]);return Array.isArray(r)||(r=[r]),r.map((function(i){var a=q.get(i,["a:r"]);return Array.isArray(a)||(a=[a]),a.map((function(o){return q.get(o,["a:t"])||""})).join("")})).join("")||"图表标题"},t.prototype.parseBarColors=function(e){var r=this;return e.map((function(i){return Ke(Vr(q.get(i,["c:spPr","a:solidFill"]),r.theme,r.ctx))}))},t.prototype.parseLineColors=function(e){var r=this;return e.map((function(i){return Ke(Vr(q.get(i,["c:spPr","a:ln","a:solidFill"])||q.get(i,["c:spPr","a:solidFill"]),r.theme,r.ctx))}))},t.prototype.parsePieColors=function(e){var r=this,i=[],a=q.get(e,["c:dPt"]);return Array.isArray(a)||(a=[a]),a.forEach((function(o){i.push(Ke(Vr(q.get(o,["c:spPr","a:solidFill"]),r.theme,r.ctx)))})),i},t.prototype.parsePieSeries=function(e,r){var i={type:"pie",radius:"80%",startAngle:90,data:[]};q.get(r,["c:holeSize","attrs","val"])&&(i.radius=["".concat(.8*q.get(r,["c:holeSize","attrs","val"]),"%"),"80%"]);var a=q.get(r,["c:firstSliceAng","attrs","val"]);a&&(i.startAngle=90-a);for(var o=this.getCategory(e),s=this.getVal(e),l=0;l<o.length;l++)i.data.push({name:o[l],value:s[l]});return i},t.prototype.parseBarSeries=function(e,r){var i,a=this,o=q.get(r,["c:grouping","attrs","val"]);o==="stacked"?i="Ad":o==="percentStacked"&&(i="total");var s=e.map((function(u){return{type:"bar",name:q.get(u,["c:tx","c:strRef","c:strCache","c:pt","c:v"]),data:a.getVal(u),stack:i}}));if(o==="percentStacked"){var l=[];s.forEach((function(u,c){l=c===0?rv([],u.data,!0):l.map((function(h,f){return h+u.data[f]}))})),s.forEach((function(u){u.data=u.data.map((function(c,h){return l[h]<=0?0:c/l[h]}))}))}return s},t.prototype.parseLineSeries=function(e,r){var i,a=this,o=q.get(r,["c:grouping","attrs","val"]);o==="stacked"?i="Ad":o==="percentStacked"&&(i="total");var s=e.map((function(u){return{type:"line",name:q.get(u,["c:tx","c:strRef","c:strCache","c:pt","c:v"]),data:a.getVal(u),stack:i}}));if(i==="total"){var l=[];s.forEach((function(u,c){l=c===0?rv([],u.data,!0):l.map((function(h,f){return h+u.data[f]}))})),s.forEach((function(u){u.data=u.data.map((function(c,h){return l[h]<=0?0:c/l[h]}))}))}return s},t.prototype.getCategory=function(e){if(q.get(e,["c:cat","c:strRef"])){var r=q.get(e,["c:cat","c:strRef","c:strCache","c:pt"]);return Array.isArray(r)||(r=[r]),r.map((function(i){return q.get(i,["c:v"])}))}if(q.get(e,["c:cat","c:numRef"]))return r=q.get(e,["c:cat","c:numRef","c:numCache","c:pt"]),Array.isArray(r)||(r=[r]),r.map((function(i){return q.get(i,["c:v"])}))},t.prototype.getVal=function(e){var r=q.get(e,["c:val","c:numRef","c:numCache","c:pt"]);return Array.isArray(r)||(r=[r]),r.map((function(i){return+q.get(i,["c:v"])}))},t})(Hg);function m3(n){var t={},e=q.get(n,"attrs")||{};return Object.keys(e).forEach((function(r){switch(r){case"algn":t.align=e[r];break;case"marL":t.marginLeft=ar(parseInt(e[r]));break;case"indent":t.indent=ar(parseInt(e[r]));break;case"lvl":t.level=e[r]}})),q.get(n,["a:lnSpc","a:spcPct","attrs","val"])&&(t.lineHeight=parseInt(n["a:lnSpc"]["a:spcPct"].attrs.val)/1e5),t}function y3(n,t,e){var r={},i=q.get(n,"attrs")||{};Object.keys(i).forEach((function(o){switch(o){case"sz":r.size=parseInt(i[o])/100;break;case"b":r.bold=i[o]==="1";break;case"i":r.italic=i[o]==="1";break;case"u":r.underline=i[o];break;case"strike":r.strike=i[o];break;case"order":case"dirty":break;default:r[o]=i[o]}}));var a=q.get(n,"a:solidFill");return a&&(r.color=Vr(a,t,e)),r}function Ug(n,t,e,r,i){return bn(this,void 0,void 0,(function(){var a,o,s,l,u,c,h,f,d,v,m,y,g,p,b,w,x,A,T,C,E;return _n(this,(function(k){switch(k.label){case 0:for(s in o=[],a=t)o.push(s);l=0,k.label=1;case 1:if(!(l<o.length))return[3,17];if(!((s=o[l])in a))return[3,16];switch(u=s){case"p:sp":return[3,2];case"p:pic":return[3,3];case"p:cxnSp":return[3,4];case"p:graphicFrame":return[3,5];case"p:grpSp":return[3,14]}return[3,15];case 2:for(c=Array.isArray(t[u])?t[u]:[t[u]],C=0;C<c.length;C++)g=c[C],n.push(new rg(g,e,r,i));return[3,16];case 3:for(h=Array.isArray(t[u])?t[u]:[t[u]],C=0;C<h.length;C++)f=h[C],d=f["p:blipFill"]["a:blip"].attrs["r:embed"],v=r.rels[d].target,m=new r_(v,f,e,r,i),n.push(m);return[3,16];case 4:for(y=Array.isArray(t[u])?t[u]:[t[u]],C=0;C<y.length;C++)g=y[C],n.push(new rg(g,e,r,i));return[3,16];case 5:p=Array.isArray(t[u])?t[u]:[t[u]],C=0,k.label=6;case 6:if(!(C<p.length))return[3,13];switch(b=p[C],w=q.get(b,["a:graphic","a:graphicData","attrs","uri"]),w){case"http://schemas.openxmlformats.org/drawingml/2006/table":return[3,7];case"http://schemas.openxmlformats.org/drawingml/2006/diagram":return[3,8];case"http://schemas.openxmlformats.org/drawingml/2006/chart":return[3,10]}return[3,12];case 7:return n.push(new DX(b,e,r,i)),[3,12];case 8:return[4,(x=new LX(b,e,r,i)).parseNode()];case 9:return k.sent(),n.push(x),[3,12];case 10:return[4,(A=new IX(b,e,r,i)).parseNode()];case 11:return k.sent(),n.push(A),[3,12];case 12:return C++,[3,6];case 13:return[3,16];case 14:for(T=Array.isArray(t[u])?t[u]:[t[u]],C=0;C<T.length;C++)E=T[C],n.push(new XP(E,e,r,i));return[3,16];case 15:return[3,16];case 16:return l++,[3,1];case 17:return[2]}}))}))}var h2t=(function(){function n(t,e,r){this.slideType="slide",this.rels={},this.background={type:"none"},this.nodes=[],this.name=t,this.source=e,this.pptx=r}return Object.defineProperty(n.prototype,"index",{get:function(){if(!this.name)return 0;var t=this.name.match(/(\d+)/);return t?parseInt(t[0]):1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"slideMaster",{get:function(){return this.slideLayout&&this.slideLayout.slideMaster},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"theme",{get:function(){return this.slideMaster.theme},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"_relsPath",{get:function(){return this.name.replace("slides/slide","slides/_rels/slide")+".rels"},enumerable:!1,configurable:!0}),n.prototype.load=function(){return bn(this,void 0,void 0,(function(){return _n(this,(function(t){switch(t.label){case 0:return[4,this._loadRels()];case 1:return t.sent(),this._loadBackground(),[4,this._loadNodes()];case 2:return t.sent(),[2]}}))}))},n.prototype._loadRels=function(){return bn(this,void 0,void 0,(function(){var t,e,r,i=this;return _n(this,(function(a){switch(a.label){case 0:return e=zi,[4,this.pptx.getXmlByPath(this._relsPath)];case 1:return t=e.apply(void 0,[a.sent()]),r=q.get(t,["Relationships","Relationship"])||[],Array.isArray(r)||(r=[r]),r.forEach((function(o){switch(q.get(o,["attrs","Type"])){case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout":var s=o.attrs.Target.replace("../","ppt/");s.startsWith("/ppt")&&(s=s.substr(1)),i.slideLayout=i.pptx.getSlideLayout(s);break;case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image":case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio":case"http://schemas.microsoft.com/office/2007/relationships/media":case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video":case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramLayout":case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramData":case"http://schemas.microsoft.com/office/2007/relationships/diagramDrawing":case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramColors":case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart":var l=o.attrs.Target.replace("../","ppt/");l.startsWith("/ppt")&&(l=l.substr(1)),i.rels[o.attrs.Id]={type:o.attrs.Type.split("/").pop(),target:l}}})),[2]}}))}))},n.prototype._loadBackground=function(){var t=q.get(this.source,["p:sld","p:cSld","p:bg","p:bgPr"]);t&&t["a:solidFill"]?this.background=Vr(t["a:solidFill"],this.theme,this):t&&t["a:gradFill"]?this.background=Gg(t["a:gradFill"],this.theme,this):t&&t["a:blipFill"]&&(this.background=zg(t["a:blipFill"],this.pptx,this))},n.prototype._loadNodes=function(){return bn(this,void 0,void 0,(function(){var t;return _n(this,(function(e){switch(e.label){case 0:return t=q.get(this.source,["p:sld","p:cSld","p:spTree"]),[4,Ug(this.nodes,t,this.pptx,this)];case 1:return e.sent(),[2]}}))}))},n.prototype.getColorThemeName=function(t){return this.slideLayout.getColorThemeName(t)},n.prototype.getNodeInheritAttrsByType=function(t,e){var r=this.slideLayout.getNodeByType(t),i=q.get(r.source,e);return i||this.slideLayout.getNodeInheritAttrsByType(t,e)},n.prototype.getNodeInheritAttrsByIdx=function(t,e){var r=this.slideLayout.getNodeByIdx(t),i=q.get(r.source,e);return i||this.slideLayout.getNodeInheritAttrsByIdx(t,e)},n})(),f2t=(function(){function n(t,e,r){this.slideType="slideLayout",this.rels={},this.background={type:"none"},this.nodes=[],this.name=t,this.source=e,this.pptx=r}return Object.defineProperty(n.prototype,"_relsPath",{get:function(){return this.name.replace("slideLayouts/slideLayout","slideLayouts/_rels/slideLayout")+".rels"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"theme",{get:function(){return this.slideMaster.theme},enumerable:!1,configurable:!0}),n.prototype.load=function(){return bn(this,void 0,void 0,(function(){return _n(this,(function(t){switch(t.label){case 0:return[4,this._loadRels()];case 1:return t.sent(),[4,this._loadBackground()];case 2:return t.sent(),[4,this._loadNodes()];case 3:return t.sent(),[2]}}))}))},n.prototype._loadRels=function(){return bn(this,void 0,void 0,(function(){var t,e,r,i=this;return _n(this,(function(a){switch(a.label){case 0:return e=zi,[4,this.pptx.getXmlByPath(this._relsPath)];case 1:return t=e.apply(void 0,[a.sent()]),r=q.get(t,["Relationships","Relationship"])||[],Array.isArray(r)||(r=[r]),r.forEach((function(o){switch(q.get(o,["attrs","Type"])){case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster":var s=o.attrs.Target.replace("../","ppt/");s.startsWith("/ppt")&&(s=s.substr(1)),i.slideMaster=i.pptx.getSlideMaster(s);break;case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image":case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio":case"http://schemas.microsoft.com/office/2007/relationships/media":case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video":var l=o.attrs.Target.replace("../","ppt/");l.startsWith("/ppt")&&(l=l.substr(1)),i.rels[o.attrs.Id]={type:o.attrs.Type.split("/").pop(),target:l}}})),[2]}}))}))},n.prototype._loadBackground=function(){return bn(this,void 0,void 0,(function(){var t;return _n(this,(function(e){return(t=q.get(this.source,["p:sldLayout","p:cSld","p:bg","p:bgPr"]))&&t["a:solidFill"]?this.background=Vr(t["a:solidFill"],this.theme):t&&t["a:gradFill"]?this.background=Gg(t["a:gradFill"],this.theme,this):t&&t["a:blipFill"]&&(this.background=zg(t["a:blipFill"],this.pptx,this)),[2]}))}))},n.prototype._loadNodes=function(){return bn(this,void 0,void 0,(function(){var t;return _n(this,(function(e){return t=q.get(this.source,["p:sldLayout","p:cSld","p:spTree"]),Ug(this.nodes,t,this.pptx,this),[2]}))}))},n.prototype.getColorThemeName=function(t){return this.slideMaster.getColorThemeName(t)},n.prototype.getNodeByType=function(t){return this.nodes.find((function(e){return e.type===t}))},n.prototype.getNodeByIdx=function(t){return this.nodes.find((function(e){return e.idx===t}))},n.prototype.getNodeInheritAttrsByType=function(t,e){var r=this.slideMaster.getNodeByType(t);return r&&q.get(r.source,e)},n.prototype.getNodeInheritAttrsByIdx=function(t,e){var r=this.slideMaster.getNodeByIdx(t);return r&&q.get(r.source,e)},n})(),d2t=(function(){function n(t,e,r){this.slideType="slideMaster",this.rels={},this.background={type:"none"},this.textStyles={titleStyle:{},bodyStyle:{},otherStyle:{}},this.defaultTextStyle={},this.nodes=[],this.tableStyles={},this.name=t,this.source=e,this.pptx=r,this.load()}return Object.defineProperty(n.prototype,"_relsPath",{get:function(){return this.name.replace("slideMasters/slideMaster","slideMasters/_rels/slideMaster")+".rels"},enumerable:!1,configurable:!0}),n.prototype.load=function(){return bn(this,void 0,void 0,(function(){return _n(this,(function(t){switch(t.label){case 0:return[4,this._parseRels()];case 1:return t.sent(),this._parseColorMap(),this._parseBackground(),this._parseTextStyles(),this._parseTableStyles(),this._parseDefaultTextStyle(),this._loadNodes(),[2]}}))}))},n.prototype._parseRels=function(){return bn(this,void 0,void 0,(function(){var t,e,r,i=this;return _n(this,(function(a){switch(a.label){case 0:return e=zi,[4,this.pptx.getXmlByPath(this._relsPath)];case 1:return t=e.apply(void 0,[a.sent()]),r=q.get(t,["Relationships","Relationship"])||[],Array.isArray(r)||(r=[r]),r.forEach((function(o){switch(q.get(o,["attrs","Type"])){case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme":var s=o.attrs.Target.replace("../","ppt/");s.startsWith("/ppt")&&(s=s.substr(1)),i.theme=i.pptx.getTheme(s);break;case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image":case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio":case"http://schemas.microsoft.com/office/2007/relationships/media":case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video":var l=o.attrs.Target.replace("../","ppt/");l.startsWith("/ppt")&&(l=l.substr(1)),i.rels[o.attrs.Id]={type:o.attrs.Type.split("/").pop(),target:l}}})),[2]}}))}))},n.prototype._parseColorMap=function(){this.colorMap=q.omit(q.get(this.source,["p:sldMaster","p:clrMap","attrs"])||{},["order"])},n.prototype.getColorThemeName=function(t){return this.colorMap[t]||t},n.prototype._parseBackground=function(){var t=q.get(this.source,["p:sldMaster","p:cSld","p:bg","p:bgPr"]),e=q.get(this.source,["p:sldMaster","p:cSld","p:bg","p:bgRef"]);t&&t["a:solidFill"]?this.background=Vr(t["a:solidFill"],this.theme,this):t&&t["a:gradFill"]?this.background=Gg(t["a:gradFill"],this.theme,this):t&&t["a:blipFill"]?this.background=zg(t["a:blipFill"],this.pptx,this):e&&(this.background=Vr(e,this.theme,this))},n.prototype._parseDefaultTextStyle=function(){var t=this,e=this.pptx.defaultTextStyleSource;Object.keys(e).forEach((function(r){if(r.startsWith("a:")&&r.endsWith("pPr")){var i=r.substr(2,r.length-5),a=q.get(e[r],["a:defRPr"]);t.defaultTextStyle[i]={props:m3(e[r]),defRPr:y3(a,t.theme,t)}}}))},n.prototype._parseTextStyles=function(){var t=this,e=q.get(this.source,["p:sldMaster","p:txStyles"]);["titleStyle","bodyStyle","otherStyle"].forEach((function(r){var i=t.textStyles[r],a=q.get(e,"p:".concat(r))||{};Object.keys(a).forEach((function(o){if(o.startsWith("a:")&&o.endsWith("pPr")){var s=o.substr(2,o.length-5);i[s]={},i[s].props=m3(a[o]);var l=q.get(a[o],["a:defRPr"]);i[s].defRPr=y3(l,t.theme,t)}}))}))},n.prototype._parseTableStyles=function(){var t=this,e={},r=q.get(this.pptx.tableStyles,["a:tblStyleLst","a:tblStyle"])||[];Array.isArray(r)||(r=[r]),r.forEach((function(i){var a=q.get(i,["attrs","styleId"]);e[a]={},Object.keys(i).forEach((function(o){if(o.startsWith("a:")){var s=o.substr(2);e[a][s]={};var l=q.get(i[o],["a:tcStyle"]);if(l){var u={};q.get(l,["a:fill","a:solidFill"])&&(u.background=Vr(q.get(l,["a:fill","a:solidFill"]),t.theme,t));var c=q.get(l,"a:tcBdr");c&&(u.border={},Object.keys(c).forEach((function(d){if(d.startsWith("a:")){var v=d.substr(2),m=q.get(c[d],["a:ln"]);u.border[v]=hf(m,t.theme,t)}}))),e[a][s].tcStyle=u}var h=q.get(i[o],["a:tcTxStyle"]);if(h){var f={};f.color=Vr(h,t.theme,t),q.get(h,["attrs","b"])==="on"&&(f.bold=!0),e[a][s].tcTxStyle=f}}}))})),this.tableStyles=e},n.prototype._loadNodes=function(){return bn(this,void 0,void 0,(function(){var t;return _n(this,(function(e){return t=q.get(this.source,["p:sldMaster","p:cSld","p:spTree"]),Ug(this.nodes,t,this.pptx,this),[2]}))}))},n.prototype.getNodeByType=function(t){return this.nodes.find((function(e){return e.type===t}))},n.prototype.getNodeByIdx=function(t){return this.nodes.find((function(e){return e.idx===t}))},n.prototype.getNodeInheritAttrsByType=function(t,e){},n.prototype.getNodeInheritAttrsByIdx=function(t,e){},n})(),p2t=(function(){function n(t,e,r){this.clrScheme={},this.borderScheme=[],this.name=t,this.source=e,this.pptx=r,this._parseClrScheme(),this._parseLineStyleLst()}return n.prototype._parseClrScheme=function(){var t=q.get(this.source,["a:theme","a:themeElements","a:clrScheme"]);for(var e in t)if(e.startsWith("a:")){var r=e.substring(2),i=q.get(t[e],["a:sysClr","attrs","lastClr"])||q.get(t[e],["a:srgbClr","attrs","val"]);this.clrScheme[r]="#"+i}},n.prototype._parseLineStyleLst=function(){var t=this,e=q.get(this.source,["a:theme","a:themeElements","a:fmtScheme","a:lnStyleLst","a:ln"])||[];this.borderScheme=e.map((function(r){var i={color:{}};return q.get(r,["attrs","w"])&&(i.width=ar(parseInt(q.get(r,["attrs","w"])))),q.get(r,["attrs","algn"])&&(i.algn=q.get(r,["attrs","algn"])),q.get(r,["attrs","cap"])&&(i.cap=q.get(r,["attrs","cap"])),q.get(r,["attrs","cmpd"])&&(i.cmpd=q.get(r,["attrs","cmpd"])),q.get(r,["a:miter","attrs","lim"])&&(i.miterLim=ar(parseInt(q.get(r,["a:miter","attrs","lim"])))),q.get(r,["a:prstDash","attrs","val"])&&(i.type=q.get(r,["a:prstDash","attrs","val"])),q.get(r,["a:solidFill"])&&(i.color=Vr(q.get(r,["a:solidFill"]),t)),i}))},n.prototype.getColor=function(t){if(t!=="phClr")return this.clrScheme[t]||this.defaultColor},n.prototype.getLineStyle=function(t){return this.borderScheme[t-1]},n})(),b3=(function(){function n(){this.slides=[],this.slideLayouts=[],this.slideMaster=[],this.themes=[],this.medias={},this.wps=!1}return n.prototype.load=function(t){return bn(this,void 0,void 0,(function(){var e,r;return _n(this,(function(i){switch(i.label){case 0:return e=new O4,r=this,[4,e.loadAsync(t)];case 1:return r._zipContents=i.sent(),[4,this._loadThumbnail()];case 2:return i.sent(),[4,this._loadMedia()];case 3:return i.sent(),[4,this._loadPresentation()];case 4:return i.sent(),[4,this._loadContentTypes()];case 5:return i.sent(),[2]}}))}))},n.prototype._loadThumbnail=function(){return bn(this,void 0,void 0,(function(){var t;return _n(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),this._zipContents.files["docProps/thumbnail.jpeg"]?[4,this._zipContents.files["docProps/thumbnail.jpeg"].async("base64")]:[3,2];case 1:t=e.sent(),this.thumbnail="data:image/jpeg;base64,"+t,e.label=2;case 2:return[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},n.prototype._loadPresentation=function(){return bn(this,void 0,void 0,(function(){var t,e,r,i,a,o;return _n(this,(function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),[4,this._zipContents.files["ppt/presentation.xml"].async("text")];case 1:return t=s.sent(),e=zi(t),r=e["p:presentation"]["p:sldSz"].attrs,this.width=ar(parseInt(r.cx)),this.height=ar(parseInt(r.cy)),this.defaultTextStyleSource=q.get(e,["p:presentation","p:defaultTextStyle"]),this._zipContents.files["docProps/app.xml"]?[4,this._zipContents.files["docProps/app.xml"].async("text")]:[3,3];case 2:i=s.sent(),a=zi(i),o=q.get(a,["Properties","Application"]),this.wps=o?.includes("WPS")||!1,s.label=3;case 3:return[3,5];case 4:return s.sent(),[3,5];case 5:return[2]}}))}))},n.prototype._loadContentTypes=function(){return bn(this,void 0,void 0,(function(){var t,e,r,i,a,o,s,l,u,c,h,f,d,v,m,y,g,p,b,w,x;return _n(this,(function(A){switch(A.label){case 0:return A.trys.push([0,22,,23]),e=zi,[4,this._zipContents.files["[Content_Types].xml"].async("text")];case 1:if(t=e.apply(void 0,[A.sent()]),r=t.Types.Override,!(i=r.filter((function(T){return T.attrs.ContentType==="application/vnd.openxmlformats-officedocument.theme+xml"}))))return[3,5];a=0,o=i,A.label=2;case 2:return a<o.length?(s=o[a],p=s.attrs.PartName.substr(1),l=zi,[4,this._zipContents.files[p].async("text")]):[3,5];case 3:b=l.apply(void 0,[A.sent()]),this.themes.push(new p2t(p,b,this)),A.label=4;case 4:return a++,[3,2];case 5:return(u=r.find((function(T){return T.attrs.ContentType==="application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml"})))?(p=u.attrs.PartName.substr(1),c=zi,[4,this._zipContents.files[p].async("text")]):[3,7];case 6:b=c.apply(void 0,[A.sent()]),this.tableStyles=b,A.label=7;case 7:h=r.filter((function(T){return T.attrs.ContentType==="application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml"})),g=0,A.label=8;case 8:return g<h.length?(p=h[g].attrs.PartName.substr(1),f=zi,[4,this._zipContents.files[p].async("text")]):[3,11];case 9:b=f.apply(void 0,[A.sent()]),this.slideMaster.push(new d2t(p,b,this)),A.label=10;case 10:return g++,[3,8];case 11:d=r.filter((function(T){return T.attrs.ContentType==="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"})),g=0,A.label=12;case 12:return g<d.length?(p=d[g].attrs.PartName.substr(1),v=zi,[4,this._zipContents.files[p].async("text")]):[3,16];case 13:return b=v.apply(void 0,[A.sent()]),[4,(m=new f2t(p,b,this)).load()];case 14:A.sent(),this.slideLayouts.push(m),A.label=15;case 15:return g++,[3,12];case 16:y=r.filter((function(T){return T.attrs.ContentType==="application/vnd.openxmlformats-officedocument.presentationml.slide+xml"})),g=0,A.label=17;case 17:return g<y.length?(p=y[g].attrs.PartName.substr(1),w=zi,[4,this._zipContents.files[p].async("text")]):[3,21];case 18:return b=w.apply(void 0,[A.sent()]),[4,(x=new h2t(p,b,this)).load()];case 19:A.sent(),this.slides.push(x),A.label=20;case 20:return g++,[3,17];case 21:return this.slides.sort((function(T,C){return T.index-C.index})),[3,23];case 22:return A.sent(),[3,23];case 23:return[2]}}))}))},n.prototype._loadMedia=function(){return bn(this,void 0,void 0,(function(){var t,e,r,i,a,o,s,l,u,c,h,f,d,v=this;return _n(this,(function(m){switch(m.label){case 0:t=Object.keys(this._zipContents.files).filter((function(g){return g.startsWith("ppt/media/image")})).map((function(g){return v._zipContents.files[g]})),e=0,r=t,m.label=1;case 1:return e<r.length?(i=r[e],a=(function(g){var p;switch(g){case"jpg":case"jpeg":p="image/jpeg";break;case"png":p="image/png";break;case"gif":p="image/gif";break;case"emf":p="image/x-emf";break;case"wmf":p="image/x-wmf";break;default:p="image/*"}return p})((y=i.name).substr(2+(~-y.lastIndexOf(".")>>>0))),[4,i.async("base64")]):[3,4];case 2:o=m.sent(),this.medias[i.name]="data:".concat(a,";base64,").concat(o),m.label=3;case 3:return e++,[3,1];case 4:s=Object.keys(this._zipContents.files).filter((function(g){return g.startsWith("ppt/media/media")&&["mp3","wav","ogg","mp4","webm"].includes(g.split(".").pop().toLowerCase())})).map((function(g){return v._zipContents.files[g]})),l=0,u=s,m.label=5;case 5:return l<u.length?(c=u[l],h=c.name.split(".").pop().toLowerCase(),[4,c.async("arraybuffer")]):[3,8];case 6:f=m.sent(),d=new Blob([f],{type:"".concat(["mp3","wav"].includes(h)?"audio":"video","/").concat(h)}),this.medias[c.name]=URL.createObjectURL(d),m.label=7;case 7:return l++,[3,5];case 8:return[2]}var y}))}))},n.prototype.getXmlByPath=function(t){return bn(this,void 0,void 0,(function(){return _n(this,(function(e){switch(e.label){case 0:if(!this._zipContents.files[t])throw new Error("文件不存在");return[4,this._zipContents.files[t].async("text")];case 1:return[2,e.sent()]}}))}))},n.prototype.getSlideLayout=function(t){return this.slideLayouts.find((function(e){return e.name===t}))},n.prototype.getSlideMaster=function(t){return this.slideMaster.find((function(e){return e.name===t}))},n.prototype.getTheme=function(t){return this.themes.find((function(e){return e.name===t}))},n.prototype.getMedia=function(t){return this.medias[t]},n})();function AE(n){var t=n.extend,e=n.offset,r=n.clip,i=n.base64,a=n.audioFile,o=n.videoFile,s=document.createElement("div");s.style.setProperty("position","absolute"),s.style.setProperty("left",e.x+"px"),s.style.setProperty("top",e.y+"px");var l,u,c,h,f=document.createElement("div");f.style.setProperty("position","absolute"),f.style.setProperty("left","0"),f.style.setProperty("top","0"),f.style.setProperty("width",t.w+"px"),f.style.setProperty("height",t.h+"px"),f.style.setProperty("overflow","hidden"),r?(l=t.w/(1-(r.l===void 0?0:r.l)-(r.r===void 0?0:r.r)),u=t.h/(1-(r.t===void 0?0:r.t)-(r.b===void 0?0:r.b)),c=-1*l*(r.l===void 0?0:r.l),h=-1*u*(r.t===void 0?0:r.t)):(l=t.w,u=t.h,c=0);var d=document.createElement("img");if(d.src=i,d.width=l,d.height=u,d.style.setProperty("position","absolute"),d.style.setProperty("left",c+"px"),d.style.setProperty("top",h+"px"),f.append(d),s.append(f),a){var v=document.createElement("audio");v.style.position="absolute",v.style.left="0",v.style.top="0",v.src=a,v.controls=!0,v.style.transform="translate(-50%)",s.append(v)}if(o){var m=document.createElement("video");m.style.position="absolute",m.style.left="0",m.style.top="0",m.width=t.w,m.height=t.h,m.src=o,m.controls=!0,s.append(m)}return s}function v2t(n,t,e){var r,i=n.props,a=n.text,o=Vt(Vt({},t),i),s=document.createElement("span");s.innerHTML=typeof a=="string"?a:"";var l=18;o.size&&(!((r=e?.normAutofit)===null||r===void 0)&&r.fontScale?(l=o.size*e.normAutofit.fontScale,s.style.fontSize=l+"px"):(l=o.size,s.style.fontSize=l+"px"));var u=Ke(o.color);u&&(s.style.color=u);var c=/^[^\u4e00-\u9fff]+$/;if(o.typeface)switch(s.style.fontFamily=o.typeface,o.typeface){case"DengXian":c.test(a)&&(s.style.letterSpacing=-.04*l+"px");break;case"DengXian Light":c.test(a)&&(s.style.letterSpacing=-.05*l+"px");break;case"STLiti":case"SimSun":case"NSimSun":case"SimHei":c.test(a)&&(s.style.fontSize=.85*parseInt(s.style.fontSize)+"px");break;case"华文中宋":case"Fira Sans Extra Condensed Medium":s.style.fontSize=.85*parseInt(s.style.fontSize)+"px";break;case"FangSong":s.style.letterSpacing=-.08*l+"px"}else c.test(a)&&(s.style.letterSpacing=-.04*l+"px");return o.bold&&(s.style.fontWeight="bold"),o.italic&&(s.style.fontStyle="italic"),o.underline&&o.underline!=="none"&&(s.style.textDecoration="underline"),o.background&&(s.style.backgroundColor=Ke(o.background)),s.style.wordBreak="break-word",s}function g2t(n,t,e){var r=document.createElement("span"),i=n.firstElementChild;switch(r.style.fontSize=i.style.fontSize,r.style.color=i.style.color,r.style.fontWeight=i.style.fontWeight,r.style.fontStyle=i.style.fontStyle,r.style.marginRight="10px",t.buAutoNum){case"arabicPeriod":default:r.textContent=e+".";break;case"circleNumDbPlain":r.textContent=["①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","⑰","⑱","⑲","⑳"][e-1]||e+"";break;case"romanUcPeriod":r.textContent=(function(a){var o=[{value:1e3,numeral:"M"},{value:900,numeral:"CM"},{value:500,numeral:"D"},{value:400,numeral:"CD"},{value:100,numeral:"C"},{value:90,numeral:"XC"},{value:50,numeral:"L"},{value:40,numeral:"XL"},{value:10,numeral:"X"},{value:9,numeral:"IX"},{value:5,numeral:"V"},{value:4,numeral:"IV"},{value:1,numeral:"I"}];if(typeof a!="number"||a<1||a>3999)throw new Error("Input must be a number between 1 and 3999.");for(var s="",l=0;l<o.length;l++)for(;a>=o[l].value;)s+=o[l].numeral,a-=o[l].value;return s})(e)+".";break;case"alphaUcPeriod":r.textContent=BA(e)+".";break;case"alphaLcPeriod":r.textContent=BA(e).toLowerCase()+".";break;case"alphaLcParenR":r.textContent=BA(e).toLowerCase()+")";break;case"ea1JpnChsDbPeriod":r.textContent=(function(a){var o=["〇","一","二","三","四","五","六","七","八","九"];if(!Number.isInteger(a)||a<0)return"";for(var s="",l=a.toString(),u=0;u<l.length;u++)s+=o[parseInt(l[u],10)];return s})(e)+"."}n.prepend(r)}function n_(n,t,e){var r,i,a,o;t===void 0&&(t=0),e===void 0&&(e={});var s=n.inheritProps,l=n.inheritRProps,u=n.props,c=n.rows,h=Vt(Vt({},s),u),f=function(){for(var A,T,C=0,E=0,k=c;E<k.length;E++){var D=k[E];D.props&&D.props.size&&(C=Math.max(C,D.props.size))}var L=((T=(A=e?.bodyProps)===null||A===void 0?void 0:A.normAutofit)===null||T===void 0?void 0:T.fontScale)||1;return(C||l.size||18)*L},d=document.createElement("div"),v=e.isFirst?0:h.spaceBefore||0,m=e.isLast?0:h.spaceAfter||0;d.style.margin="".concat(Math.floor(.2*f()),"px 0 0 0"),d.style.padding="".concat(Math.floor(v),"px 0px ").concat(Math.floor(m),"px 0px");var y=document.createElement("p");y.style.margin="0",y.style.padding="0px",y.style.wordBreak="break-word",y.style.textAlign=h.align&&{ctr:"center",l:"left",r:"right",dist:"justify"}[h.align]||"center",h.align==="dist"&&(y.style.textAlignLast="justify");var g=h.hasOwnProperty("lineHeight")?h.lineHeight:1;if(!((i=(r=e.bodyProps)===null||r===void 0?void 0:r.normAutofit)===null||i===void 0)&&i.lnSpcReduction&&(g*=1-((o=(a=e.bodyProps)===null||a===void 0?void 0:a.normAutofit)===null||o===void 0?void 0:o.lnSpcReduction)),y.style.lineHeight=g+"",y.style.fontSize=f()+"px",c.length){for(var p=0,b=c;p<b.length;p++){var w=b[p];w.isBr?y.appendChild(document.createElement("br")):y.appendChild(v2t(w,Vt(Vt({},l),{marginTop:Math.floor(.2*f())}),e.bodyProps))}h.buAutoNum?g2t(y,h,t):h.buChar&&(function(A,T){var C=document.createElement("span"),E=A.firstElementChild;C.style.color=E.style.color,C.style.fontSize=E.style.fontSize,C.textContent={n:"■",l:"●",u:"◆",p:"□",ü:"✔",Ø:"➢","•":"•"}[T.buChar]||"■",C.style.marginRight="10px",A.prepend(C)})(y,h),y.style.paddingLeft=(h.marginLeft||0)+(h.indent||0)+"px"}else{var x=document.createElement("span");x.innerHTML="&nbsp;",x.style.fontSize=l.size+"px",y.appendChild(x)}return d.appendChild(y),d}var RX="http://www.w3.org/2000/svg";function Ct(n){return document.createElementNS(RX,n)}function bs(n){var t=n.extend;return .16667*Math.min(t.w,t.h)}function ue(n,t,e){e===void 0&&(e=0);var r=t.prstGeom,i=(r?.gd||[]).find((function(a){return a.name===n}));return i?i.fmla:e}function St(n,t,e){e===void 0&&(e=0);var r=t.extend,i=t.prstGeom,a=(i?.gd||[]).find((function(o){return o.name===n}));return a?Math.min(r.w,r.h)*a.fmla:e}function _3(n,t,e){e===void 0&&(e=0);var r=t.extend,i=t.prstGeom,a=(i?.gd||[]).find((function(o){return o.name===n}));return a?Math.max(r.w,r.h)*a.fmla:e}function es(n,t){var e=0;switch(n){case"sm":e=1*t;break;case"med":e=1.5*t;break;case"lg":e=2.5*t}return Math.max(e,2)}function w3(n,t,e,r){r===void 0&&(r=!1);var i=n.border,a=i===void 0?{}:i,o=n.uuid,s=a.headEnd,l=a.width,u=a.color,c=a.tailEnd,h=r?s:c,f=h.len,d=f===void 0?"med":f,v=h.w,m=v===void 0?"med":v,y=es(d,l),g=es(m,l),p=Ct("defs"),b=Ct("marker"),w="marker-".concat(o,"-").concat(r?"start":"end");b.setAttribute("id",w),b.setAttribute("viewBox","0 0 ".concat(2*y," ").concat(2*g)),b.setAttribute("refX",y+"px"),b.setAttribute("refY",g+"px"),b.setAttribute("markerWidth",2*y+"px"),b.setAttribute("markerHeight",2*g+"px"),b.setAttribute("orient","auto"),b.setAttribute("markerUnits","userSpaceOnUse");var x=Ct("ellipse");x.setAttribute("cx",y+"px"),x.setAttribute("cy",g+"px"),x.setAttribute("rx",y+"px"),x.setAttribute("ry",g+"px"),x.setAttribute("fill",Ke(u)||"transparent"),b.appendChild(x),p.appendChild(b),t.appendChild(p),e.setAttribute(r?"marker-start":"marker-end","url(#".concat(w,")"))}function x3(n,t,e,r){r===void 0&&(r=!1);var i=n.border,a=i===void 0?{}:i,o=n.uuid,s=a.headEnd,l=a.width,u=a.color,c=a.tailEnd,h=r?s:c,f=h.len,d=f===void 0?"med":f,v=h.w,m=v===void 0?"med":v,y=es(d,l),g=es(m,l),p=Ct("defs"),b=Ct("marker"),w="marker-".concat(o,"-").concat(r?"start":"end");b.setAttribute("id",w),b.setAttribute("viewBox","0 0 ".concat(2*y," ").concat(2*g)),b.setAttribute("refX",(r?.9*y:1.1*y)+"px"),b.setAttribute("refY",g+"px"),b.setAttribute("markerWidth",2*y+"px"),b.setAttribute("markerHeight",2*g+"px"),b.setAttribute("orient","auto"),b.setAttribute("markerUnits","userSpaceOnUse");var x=Ct("path"),A=r?["M ".concat(2*y,",0"),"L 0,".concat(g),"L ".concat(2*y,",").concat(2*g),"Z"].join(" "):["M 0,0","L ".concat(2*y,",").concat(g),"L 0,".concat(2*g),"Z"].join(" ");x.setAttribute("d",A),x.setAttribute("fill",Ke(u)||"transparent"),b.appendChild(x),p.appendChild(b),t.appendChild(p),e.setAttribute(r?"marker-start":"marker-end","url(#".concat(w,")"))}function S3(n,t,e,r){r===void 0&&(r=!1);var i=n.border,a=i===void 0?{}:i,o=n.uuid,s=a.headEnd,l=a.width,u=a.color,c=a.tailEnd,h=r?s:c,f=h.len,d=f===void 0?"med":f,v=h.w,m=v===void 0?"med":v,y=es(d,l),g=es(m,l),p=Ct("defs"),b=Ct("marker"),w="marker-".concat(o,"-").concat(r?"start":"end");b.setAttribute("id",w),b.setAttribute("viewBox","0 0 ".concat(2*y," ").concat(2*g)),b.setAttribute("refX",y+"px"),b.setAttribute("refY",g+"px"),b.setAttribute("markerWidth",2*y+"px"),b.setAttribute("markerHeight",2*g+"px"),b.setAttribute("orient","auto"),b.setAttribute("markerUnits","userSpaceOnUse");var x=Ct("path"),A=["M 0,".concat(g),"L ".concat(y,",0"),"L ".concat(2*y,",").concat(g),"L ".concat(y,",").concat(2*g),"Z"].join(" ");x.setAttribute("d",A),x.setAttribute("fill",Ke(u)||"transparent"),b.appendChild(x),p.appendChild(b),t.appendChild(p),e.setAttribute(r?"marker-start":"marker-end","url(#".concat(w,")"))}function A3(n,t,e,r){r===void 0&&(r=!1);var i=n.border,a=i===void 0?{}:i,o=n.uuid,s=a.headEnd,l=a.width,u=a.color,c=a.tailEnd,h=r?s:c,f=h.len,d=f===void 0?"med":f,v=h.w,m=v===void 0?"med":v,y=es(d,l),g=es(m,l),p=Ct("defs"),b=Ct("marker"),w="marker-".concat(o,"-").concat(r?"start":"end");b.setAttribute("id",w),b.setAttribute("viewBox","0 0 ".concat(2*y+2*l," ").concat(2*g+2*l));var x=r?m==="lg"?2*l:3*l:m==="lg"?2*y:2*y-l;b.setAttribute("refX",x+"px"),b.setAttribute("refY",g+l+"px"),b.setAttribute("markerWidth",2*y+"px"),b.setAttribute("markerHeight",2*g+"px"),b.setAttribute("orient","auto"),b.setAttribute("markerUnits","userSpaceOnUse");var A=Ct("path"),T=r?["M ".concat(2*y+l,", ").concat(l),"L ".concat(l,",").concat(g+l),"L ".concat(2*y+l,",").concat(2*g+l)].join(" "):["M ".concat(l,", ").concat(l),"L ".concat(2*y+l,",").concat(g+l),"L ".concat(l,",").concat(2*g+l)].join(" ");A.setAttribute("d",T),A.setAttribute("stroke-width",l+"px"),A.setAttribute("stroke",Ke(u)||"transparent"),A.setAttribute("fill","transparent"),A.setAttribute("stroke-linecap","round"),A.setAttribute("stroke-linejoin","miter"),A.style.overflow="visible",b.appendChild(A),p.appendChild(b),t.appendChild(p),e.setAttribute(r?"marker-start":"marker-end","url(#".concat(w,")"))}function T3(n,t,e,r){r===void 0&&(r=!1);var i=n.border,a=i===void 0?{}:i,o=n.uuid,s=a.headEnd,l=a.width,u=a.color,c=a.tailEnd,h=r?s:c,f=h.len,d=f===void 0?"med":f,v=h.w,m=v===void 0?"med":v,y=es(d,l),g=es(m,l),p=Ct("defs"),b=Ct("marker"),w="marker-".concat(o,"-").concat(r?"start":"end");b.setAttribute("id",w),b.setAttribute("viewBox","0 0 ".concat(2*y," ").concat(2*g));var x=r?m==="sm"?1.5*l:2*l:m==="sm"?2*y-1.5*l:2*y-2*l;b.setAttribute("refX",x+"px"),b.setAttribute("refY",g+"px"),b.setAttribute("markerWidth",2*y+"px"),b.setAttribute("markerHeight",2*g+"px"),b.setAttribute("orient","auto"),b.setAttribute("markerUnits","userSpaceOnUse");var A=Ct("path"),T=r?["M 0, ".concat(g),"L ".concat(2*y,",0"),"L ".concat(y,",").concat(g),"L ".concat(2*y,",").concat(2*g),"Z"].join(" "):["M 0,0","L ".concat(2*y,",").concat(g),"L 0,".concat(2*g),"L ".concat(y,",").concat(g),"Z"].join(" ");A.setAttribute("d",T),A.setAttribute("fill",Ke(u)||"transparent"),A.style.overflow="visible",b.appendChild(A),p.appendChild(b),t.appendChild(p),e.setAttribute(r?"marker-start":"marker-end","url(#".concat(w,")"))}function Mp(n,t,e){var r=n.border,i=r===void 0?{}:r;n.extend;var a=i.headEnd,o=i.tailEnd;if(a&&a.type!=="none")switch(a.type){case"triangle":x3(n,t,e,!0);break;case"oval":w3(n,t,e,!0);break;case"diamond":S3(n,t,e,!0);break;case"arrow":A3(n,t,e,!0);break;case"stealth":T3(n,t,e,!0)}if(o&&o.type!=="none")switch(o.type){case"triangle":x3(n,t,e,!1);break;case"oval":w3(n,t,e,!1);break;case"diamond":S3(n,t,e,!1);break;case"arrow":A3(n,t,e,!1);break;case"stealth":T3(n,t,e,!1)}}function C3(n){var t=n.extend,e=Ct("rect");return e.setAttribute("x","0"),e.setAttribute("y","0"),e.setAttribute("width",t.w+"px"),e.setAttribute("height",t.h+"px"),e}function Kn(n,t,e,r,i){var a=n*Math.PI/180;return[a===0||a===2*Math.PI?t+r:a===Math.PI?t-r:a===Math.PI/2||a===3*Math.PI/2?t:a>0&&a<Math.PI/2||a>3*Math.PI/2&&a<2*Math.PI?t+Math.sqrt(1/(1/Math.pow(r,2)+Math.pow(Math.tan(a),2)/Math.pow(i,2))):t-Math.sqrt(1/(1/Math.pow(r,2)+Math.pow(Math.tan(a),2)/Math.pow(i,2))),a===0||a===2*Math.PI||a===Math.PI?e:a===Math.PI/2?e+i:a===3*Math.PI/2?e-i:a>Math.PI&&a<2*Math.PI?e-Math.sqrt(1/(1/Math.pow(i,2)+Math.pow(1/Math.tan(a),2)/Math.pow(r,2))):e+Math.sqrt(1/(1/Math.pow(i,2)+Math.pow(1/Math.tan(a),2)/Math.pow(r,2)))]}function Pp(n,t){var e=0;return(t>n&&t-n>180||t<n&&n-t<180)&&(e=1),e}function kp(n){var t=n.extend,e=.146*t.w,r=.146*t.h;return{top:r,bottom:r,left:e,right:e,w:t.w-2*e,h:t.h-2*r}}function TE(n){var t=n.extend,e=n.offset,r=n.border,i=n.background,a=n.rotate,o=n.flipH,s=n.flipV,l=document.createElement("div"),u=e.x,c=e.y;l.className="shape-wrapper shape-".concat(n.shape),l.style.setProperty("position","absolute"),l.style.setProperty("width",(t.w||1)+"px"),l.style.setProperty("height",(t.h||1)+"px"),l.style.setProperty("left",u+"px"),l.style.setProperty("top",c+"px");var h,f=document.createElementNS(RX,"svg");f.style.setProperty("position","absolute"),f.setAttribute("width","100%"),f.setAttribute("height","100%"),f.style.setProperty("left","0"),f.style.setProperty("top","0"),f.style.overflow="visible";var d={left:0,top:0,bottom:0,w:t.w,h:t.h},v=!0;switch(n.shape){case"customGeom":h=(function(g){var p=g.prstGeom,b=p===void 0?{}:p,w=g.extend,x=b.pathList,A=b.w,T=b.h,C=Ct("path"),E={moveTo:"M",lnTo:"L",cubicBezTo:"C",close:"Z"},k=w.w/A,D=w.h/T,L=x.map((function(R){var P=E[R.type],O=Array.isArray(R.points)?R.points.map((function(F){return"".concat(F[0]*k,",").concat(F[1]*D)})).join(" "):"";return O?"".concat(P," ").concat(O):"".concat(P)})).join(" ");return C.setAttribute("d",L),C.style.fillRule="evenodd",C})(n),Mp(n,f,h);break;case"flowChartProcess":case"rect":h=C3(n);break;case"snip1Rect":h=(function(g){var p=g.extend,b=Ct("polygon"),w=St("adj",g,bs(g)),x=["0,0","".concat(p.w-w,",0"),"".concat(p.w,",").concat(w),"".concat(p.w,",").concat(p.h),"0,".concat(p.h)].join(" ");return b.setAttribute("points",x),b})(n);break;case"snip2SameRect":h=(function(g){var p=g.extend,b=Ct("polygon"),w=St("adj1",g,bs(g)),x=St("adj2",g,0),A=[[w,0],[p.w-w,0],[p.w,w],[p.w,p.h-x],[p.w-x,p.h],[x,p.h],[0,p.h-x],[0,w]].map((function(T){return"".concat(T[0],",").concat(T[1])})).join(" ");return b.setAttribute("points",A),b})(n);break;case"snip2DiagRect":h=(function(g){var p=g.extend,b=Ct("polygon"),w=St("adj1",g,0),x=St("adj2",g,bs(g)),A=[[w,0],[p.w-x,0],[p.w,x],[p.w,p.h-w],[p.w-w,p.h],[x,p.h],[0,p.h-x],[0,w]].map((function(T){return"".concat(T[0],",").concat(T[1])})).join(" ");return b.setAttribute("points",A),b})(n);break;case"snipRoundRect":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj1",g,bs(g)),x=St("adj2",g,bs(g)),A=["M ".concat(w,",0"),"L ".concat(p.w-x,",0"),"L ".concat(p.w,",").concat(x),"L ".concat(p.w,",").concat(p.h),"L 0,".concat(p.h),"L 0,".concat(w),"Q 0,0 ".concat(w,",0"),"Z"].join(" ");return b.setAttribute("d",A),b})(n);break;case"roundRect":h=(function(g){var p=C3(g),b=St("adj",g,bs(g));return p.setAttribute("rx",b+"px"),p.setAttribute("ry",b+"px"),p})(n);break;case"round1Rect":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj",g,bs(g)),x=["M 0,0","L ".concat(p.w-w,",0"),"Q ".concat(p.w,",0 ").concat(p.w,",").concat(w),"L ".concat(p.w,",").concat(p.h),"L 0,".concat(p.h),"Z"].join(" ");return b.setAttribute("d",x),b})(n);break;case"round2SameRect":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj1",g,bs(g)),x=St("adj2",g,0),A=["M ".concat(w,",0"),"L ".concat(p.w-w,",0"),"Q ".concat(p.w,",0 ").concat(p.w,",").concat(w),"L ".concat(p.w,",").concat(p.h-x),"Q ".concat(p.w,",").concat(p.h," ").concat(p.w-x,",").concat(p.h),"L ".concat(x,",").concat(p.h),"Q 0,".concat(p.h," 0,").concat(p.h-x),"L 0,".concat(w),"Q 0,0 ".concat(w,",0"),"Z"].join(" ");return b.setAttribute("d",A),b})(n);break;case"round2DiagRect":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj1",g,bs(g)),x=St("adj2",g,0),A=["M ".concat(w,",0"),"L ".concat(p.w-x,",0"),"Q ".concat(p.w,",0 ").concat(p.w,",").concat(x),"L ".concat(p.w,",").concat(p.h-w),"Q ".concat(p.w,",").concat(p.h," ").concat(p.w-w,",").concat(p.h),"L ".concat(x,",").concat(p.h),"Q 0,".concat(p.h," 0,").concat(p.h-x),"L 0,".concat(w),"Q 0,0 ".concat(w,",0"),"Z"].join(" ");return b.setAttribute("d",A),b})(n);break;case"triangle":h=(function(g){var p=g.extend,b=Ct("polygon"),w=["".concat(p.w/2,",0"),"0,".concat(p.h),"".concat(p.w,",").concat(p.h)].join(" ");return b.setAttribute("points",w),b})(n);break;case"rtTriangle":h=(function(g){var p=g.extend,b=Ct("polygon"),w=["0,".concat(p.h),"0,0","".concat(p.w,",").concat(p.h)].join(" ");return b.setAttribute("points",w),b})(n);break;case"ellipse":h=(function(g){var p=g.extend,b=Ct("ellipse"),w=p.w/2,x=p.h/2,A=w,T=x;return b.setAttribute("cx",w+"px"),b.setAttribute("cy",x+"px"),b.setAttribute("rx",A+"px"),b.setAttribute("ry",T+"px"),b})(n);break;case"line":h=(function(g){var p=g.extend,b=Ct("path"),w=["M 0,0","L ".concat(p.w,",").concat(p.h)].join(" ");return b.setAttribute("d",w),b})(n),Mp(n,f,h),v=!1;break;case"straightConnector1":h=(function(g){var p=g.extend,b=Ct("path"),w=["M 0,0","L ".concat(p.w,",").concat(p.h)].join(" ");return b.setAttribute("d",w),b})(n),Mp(n,f,h),v=!1;break;case"bentConnector3":h=(function(g){var p=g.extend,b=Ct("path"),w=_3("adj1",g,.5*Math.max(p.w,p.h)),x=["M 0,0","L ".concat(w,",0"),"L ".concat(w,",").concat(p.h),"L ".concat(p.w,",").concat(p.h)].join(" ");return b.setAttribute("d",x),b})(n),Mp(n,f,h),v=!1;break;case"curvedConnector3":h=(function(g){var p=g.extend,b=Ct("path"),w=_3("adj1",g,.5*Math.max(p.w,p.h)),x=["M0,0","Q".concat(w,",0 ").concat(w,",").concat(p.h/2),"T".concat(p.w,",").concat(p.h)].join(" ");return b.setAttribute("d",x),b})(n),Mp(n,f,h),v=!1;break;case"parallelogram":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj",g,.5*Math.min(p.w,p.h)),x=["M".concat(w,",0"),"L".concat(p.w,",0"),"L".concat(p.w-w,",").concat(p.h),"L0,".concat(p.h),"Z"].join(" ");return b.setAttribute("d",x),b})(n),d=(function(g){var p=g.extend,b=St("adj",g,.5*Math.min(p.w,p.h)),w=.84*(p.w-b),x=.08*p.h+b/p.w*p.h*.42;return{top:x,bottom:x,left:(p.w-w)/2,right:(p.w-w)/2,w,h:p.h-2*x}})(n);break;case"trapezoid":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj",g,.25*Math.min(p.w,p.h)),x=["M".concat(w,",0"),"L".concat(p.w-w,",0"),"L".concat(p.w,",").concat(p.h),"L0,".concat(p.h),"Z"].join(" ");return b.setAttribute("d",x),b})(n),d=(function(g){var p=g.extend,b=St("adj",g,.5*Math.min(p.w,p.h)),w=b/p.w*.66*p.h,x=.66*b;return{top:w,bottom:0,left:x,right:x,w:p.w-2*x,h:p.h-w}})(n);break;case"diamond":h=(function(g){var p=g.extend,b=Ct("path"),w=["M".concat(p.w/2,",0"),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w/2,",").concat(p.h),"L0,".concat(p.h/2),"Z"].join(" ");return b.setAttribute("d",w),b})(n),d=(function(g){var p=g.extend,b=.25*p.h,w=.25*p.w;return{top:b,bottom:b,left:w,right:w,w:.5*p.w,h:.5*p.h}})(n);break;case"pentagon":h=(function(g){var p=g.extend,b=Ct("path"),w=["M".concat(p.w/2,",0"),"L".concat(p.w,",").concat(.3771*p.h),"L".concat(.808*p.w,",").concat(p.h),"L".concat(.192*p.w,",").concat(p.h),"L0,".concat(.3771*p.h),"Z"].join(" ");return b.setAttribute("d",w),b})(n),d=(function(g){var p=g.extend,b=.227*p.h,w=.192*p.w;return{top:b,bottom:0,left:w,right:w,w:.616*p.w,h:.773*p.h}})(n);break;case"hexagon":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj",g,.25*Math.min(p.w,p.h)),x=["M".concat(w,",0"),"L".concat(p.w-w,",0"),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-w,",").concat(p.h),"L".concat(w,",").concat(p.h),"L0,".concat(p.h/2),"Z"].join(" ");return b.setAttribute("d",x),b})(n),d=(function(g){var p=g.extend,b=St("adj",g,.25*Math.min(p.w,p.h)),w=.098*p.h+b/p.w*.38*p.h,x=.088*p.w+.422*b;return{top:w,bottom:w,left:x,right:x,w:p.w-2*x,h:p.h-2*w}})(n);break;case"heptagon":h=(function(g){var p=g.extend,b=Ct("path"),w=["M".concat(p.w/2,",0"),"L".concat(.9*p.w,",").concat(.2*p.h),"L".concat(p.w,",").concat(.642*p.h),"L".concat(.722*p.w,",").concat(p.h),"L".concat(.278*p.w,",").concat(p.h),"L0,".concat(.642*p.h),"L".concat(.1*p.w,",").concat(.2*p.h),"Z"].join(" ");return b.setAttribute("d",w),b})(n),d=(function(g){var p=g.extend;return{top:.2*p.h,bottom:.2*p.h,left:.1*p.w,right:.1*p.w,w:.8*p.w,h:.6*p.h}})(n);break;case"octagon":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj",g,.29*Math.min(p.w,p.h)),x=["M".concat(w,",0"),"L".concat(p.w-w,",0"),"L".concat(p.w,",").concat(w),"L".concat(p.w,",").concat(p.h-w),"L".concat(p.w-w,",").concat(p.h),"L".concat(w,",").concat(p.h),"L0,".concat(p.h-w),"L0,".concat(w),"Z"].join(" ");return b.setAttribute("d",x),b})(n),d=(function(g){var p=g.extend,b=St("adj",g,.29*Math.min(p.w,p.h));return{top:.5*b,bottom:.5*b,left:.5*b,right:.5*b,w:p.w-b,h:p.h-b}})(n);break;case"decagon":h=(function(g){var p=g.extend,b=Ct("path"),w=.344,x=.117,A=.19,T=["M".concat(p.w*w,",0"),"L".concat(.656*p.w,",0"),"L".concat(.883*p.w,",").concat(p.h*A),"L".concat(p.w,",").concat(.5*p.h),"L".concat(.883*p.w,",").concat(.81*p.h),"L".concat(.656*p.w,",").concat(p.h),"L".concat(p.w*w,",").concat(p.h),"L".concat(p.w*x,",").concat(.81*p.h),"L0,".concat(.5*p.h),"L".concat(p.w*x,",").concat(p.h*A),"Z"].join(" ");return b.setAttribute("d",T),b})(n),d=(function(g){var p=g.extend,b=.117,w=.19;return{top:p.h*w,bottom:p.h*w,left:p.w*b,right:p.w*b,w:.766*p.w,h:.62*p.h}})(n);break;case"dodecagon":h=(function(g){var p=g.extend,b=Ct("path"),w=.364,x=.133,A=.135,T=["M".concat(p.w*w,",0"),"L".concat(.636*p.w,",0"),"L".concat(.867*p.w,",").concat(p.h*A),"L".concat(p.w,",").concat(p.h*w),"L".concat(p.w,",").concat(.636*p.h),"L".concat(.867*p.w,",").concat(.865*p.h),"L".concat(.636*p.w,",").concat(p.h),"L".concat(p.w*w,",").concat(p.h),"L".concat(p.w*x,",").concat(.865*p.h),"L0,".concat(.636*p.h),"L0,".concat(p.h*w),"L".concat(p.w*x,",").concat(p.h*A),"Z"].join(" ");return b.setAttribute("d",T),b})(n),d=(function(g){var p=g.extend,b=.133,w=.135;return{top:p.h*w,bottom:p.h*w,left:p.w*b,right:p.w*b,w:.734*p.w,h:.73*p.h}})(n);break;case"pie":h=(function(g){var p=g.extend,b=Ct("path"),w=ue("adj1",g,360),x=ue("adj2",g,270),A=p.w/2,T=p.h/2,C=p.w/2,E=p.h/2,k=Kn(w,C,E,A,T),D=k[0],L=k[1],R=Kn(x,C,E,A,T),P=R[0],O=R[1],F=Pp(w,x),z="M".concat(C,",").concat(E,", L").concat(D," ").concat(L," A ").concat(A," ").concat(T," 0 ").concat(F," ").concat(1," ").concat(P," ").concat(O," Z");return b.setAttribute("d",z),b})(n),d=kp(n);break;case"arc":h=(function(g){var p=g.extend,b=Ct("path"),w=ue("adj1",g,270),x=ue("adj2",g,0),A=p.w/2,T=p.h/2,C=p.w/2,E=p.h/2,k=Kn(w,C,E,A,T),D=k[0],L=k[1],R=Kn(x,C,E,A,T),P=R[0],O=R[1],F=Pp(w,x),z="M".concat(D,",").concat(L," A ").concat(A," ").concat(T," 0 ").concat(F," ").concat(1," ").concat(P," ").concat(O);return b.setAttribute("d",z),b})(n),v=!1;break;case"bracketPair":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj",g,.16667*Math.min(p.w,p.h)),x=["M".concat(w,",").concat(p.h),"Q".concat(0,",").concat(p.h," ").concat(0,",").concat(p.h-w),"L".concat(0,",").concat(w),"Q".concat(0,",").concat(0," ").concat(w,",").concat(0),"M".concat(p.w-w,",").concat(0),"Q".concat(p.w,",").concat(0," ").concat(p.w,",").concat(w),"L".concat(p.w,",").concat(p.h-w),"Q".concat(p.w,",").concat(p.h," ").concat(p.w-w,",").concat(p.h)].join(" ");return b.setAttribute("d",x),b})(n),d=(function(g){var p=g.extend,b=.285*St("adj",g,.16667*Math.min(p.w,p.h));return{top:b,bottom:b,left:b,right:b,w:p.w-2*b,h:p.h-2*b}})(n),v=!1;break;case"bracePair":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj",g,.083335*Math.min(p.w,p.h)),x=["M".concat(2*w,",").concat(p.h),"Q".concat(w,",").concat(p.h," ").concat(w,",").concat(p.h-w),"L".concat(w,",").concat(p.h/2+w),"Q".concat(w,",").concat(p.h/2," ").concat(0,",").concat(p.h/2),"Q".concat(w,",").concat(p.h/2," ").concat(w,",").concat(p.h/2-w),"L".concat(w,",").concat(w),"Q".concat(w,",").concat(0," ").concat(2*w,",").concat(0),"M".concat(p.w-2*w,",").concat(0),"Q".concat(p.w-w,",").concat(0," ").concat(p.w-w,",").concat(w),"L".concat(p.w-w,",").concat(p.h/2-w),"Q".concat(p.w-w,",").concat(p.h/2," ").concat(p.w,",").concat(p.h/2),"Q".concat(p.w-w,",").concat(p.h/2," ").concat(p.w-w,",").concat(p.h/2+w),"L".concat(p.w-w,",").concat(p.h-w),"Q".concat(p.w-w,",").concat(p.h," ").concat(p.w-2*w,",").concat(p.h)].join(" ");return b.setAttribute("d",x),b})(n),d=(function(g){var p=g.extend,b=.285*St("adj",g,.16667*Math.min(p.w,p.h));return{top:b,bottom:b,left:b,right:b,w:p.w-2*b,h:p.h-2*b}})(n),v=!1;break;case"chord":h=(function(g){var p=g.extend,b=Ct("path"),w=ue("adj1",g,45),x=ue("adj2",g,270),A=p.w/2,T=p.h/2,C=p.w/2,E=p.h/2,k=Kn(w,C,E,A,T),D=k[0],L=k[1],R=Kn(x,C,E,A,T),P=R[0],O=R[1],F=Pp(w,x),z="M".concat(D," ").concat(L," A ").concat(A," ").concat(T," 0 ").concat(F," ").concat(1," ").concat(P," ").concat(O," Z");return b.setAttribute("d",z),b})(n),d=kp(n);break;case"teardrop":h=(function(g){var p=g.extend,b=Ct("path"),w=ue("adj",g,1),x=p.w/2,A=p.h/2,T=p.w/2,C=p.h/2,E=Kn(0,T,C,x,A),k=E[0],D=E[1],L=Kn(270,T,C,x,A),R=L[0],P=L[1],O=Pp(0,270),F="M".concat(k," ").concat(D," A ").concat(x," ").concat(A," 0 ").concat(O," ").concat(1," ").concat(R," ").concat(P),z=x*w,G=T+z,U=C-A*z/(p.w/2),K=(p.w/2+G)/2,W=(p.h/2+U)/2;return F+=" Q".concat(K,",0 ").concat(G,",").concat(U),F+=" Q".concat(p.w,",").concat(W," ").concat(T+x,",").concat(C),b.setAttribute("d",F),b})(n),d=kp(n);break;case"frame":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj1",g,.12*Math.min(p.w,p.h)),x=["M0,0","L".concat(p.w,",0"),"L".concat(p.w,",").concat(p.h),"L0,".concat(p.h),"Z","M".concat(w,",").concat(w),"L".concat(w,",").concat(p.h-w),"L".concat(p.w-w,",").concat(p.h-w),"L".concat(p.w-w,",").concat(w),"Z"].join(" ");return b.setAttribute("d",x),b})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.12*Math.min(p.w,p.h));return{top:b,bottom:b,left:b,right:b,w:p.w-2*b,h:p.h-2*b}})(n);break;case"halfFrame":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj1",g,.333*Math.min(p.w,p.h)),x=Math.min(St("adj2",g,.333*Math.min(p.w,p.h)),p.w*(1-w/p.h)),A=["M0,0","L".concat(p.w,",0"),"L".concat(p.w*(1-w/p.h),",").concat(w),"L".concat(x,",").concat(w),"L".concat(x,",").concat(p.h*(1-x/p.w)),"L0,".concat(p.h),"Z"].join(" ");return b.setAttribute("d",A),b})(n);break;case"corner":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj1",g,.5*Math.min(p.w,p.h)),x=St("adj2",g,.5*Math.min(p.w,p.h)),A=["M0,0","L".concat(x,",0"),"L".concat(x,",").concat(p.h-w),"L".concat(p.w,",").concat(p.h-w),"L".concat(p.w,",").concat(p.h),"L0,".concat(p.h),"Z"].join(" ");return b.setAttribute("d",A),b})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h));return{top:p.h-b,bottom:0,left:0,right:0,w:p.w,h:b}})(n);break;case"diagStripe":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj",g,.5*Math.min(p.w,p.h)),x=p.w*w/p.h,A=["M".concat(x,",0"),"L".concat(p.w,",0"),"L0,".concat(p.h),"L0,".concat(w),"Z"].join(" ");return b.setAttribute("d",A),b})(n),d=(function(g){var p=g.extend,b=ue("adj",g,.5),w=.5*(1-b)*p.h,x=.5*(1-b)*p.w;return{top:0,bottom:w,left:0,right:x,w:p.w-x,h:p.h-w}})(n);break;case"plus":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj",g,.25*Math.min(p.w,p.h)),x=["M".concat(w,",0"),"L".concat(p.w-w,",0"),"L".concat(p.w-w,",").concat(w),"L".concat(p.w,",").concat(w),"L".concat(p.w,",").concat(p.h-w),"L".concat(p.w-w,",").concat(p.h-w),"L".concat(p.w-w,",").concat(p.h),"L".concat(w,",").concat(p.h),"L".concat(w,",").concat(p.h-w),"L0,".concat(p.h-w),"L0,".concat(w),"L".concat(w,",").concat(w),"Z"].join(" ");return b.setAttribute("d",x),b})(n),d=(function(g){var p=g.extend,b=St("adj",g,.25*Math.min(p.w,p.h));return{top:b,bottom:b,left:0,right:0,w:p.w,h:p.h-2*b}})(n);break;case"plaque":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj",g,.16667*Math.min(p.w,p.h)),x=["M".concat(w,",0"),"L".concat(p.w-w,",0"),"Q".concat(p.w-w,",").concat(w," ").concat(p.w,",").concat(w),"L".concat(p.w,",").concat(p.h-w),"Q".concat(p.w-w,",").concat(p.h-w," ").concat(p.w-w,",").concat(p.h),"L".concat(w,",").concat(p.h),"Q".concat(w,",").concat(p.h-w," 0,").concat(p.h-w),"L0,".concat(w),"Q".concat(w,",").concat(w," ").concat(w,",0"),"Z"].join(" ");return b.setAttribute("d",x),b})(n),d=(function(g){var p=g.extend,b=St("adj",g,.16667*Math.min(p.w,p.h));return{top:.72*b,bottom:.72*b,left:.72*b,right:.72*b,w:p.w-1.44*b,h:p.w-1.44*b}})(n);break;case"can":h=(function(g){var p=g.extend,b=g.background,w=Ct("g"),x=Ct("path"),A=St("adj",g,.25*Math.min(p.w,p.h)),T=["M0,".concat(A/2),"L0,".concat(p.h-A/2),"A".concat(p.w/2,",").concat(A/2," 0 0 0 ").concat(p.w,",").concat(p.h-A/2),"L".concat(p.w,",").concat(A/2),"A".concat(p.w/2,",").concat(A/2," 0 0 1 0,").concat(A/2),"Z"].join(" ");x.setAttribute("d",T);var C=Ct("ellipse"),E=p.w/2,k=A/2,D=p.w/2,L=A/2;return C.setAttribute("cx",E+"px"),C.setAttribute("cy",k+"px"),C.setAttribute("rx",D+"px"),C.setAttribute("ry",L+"px"),b?.type==="solidFill"&&C.setAttribute("fill",Ke(b,{light:.5})||"transparent"),w.appendChild(x),w.appendChild(C),w})(n),d=(function(g){var p=g.extend,b=St("adj",g,.25*Math.min(p.w,p.h));return{top:b,bottom:0,left:0,right:0,w:p.w,h:p.h-b}})(n);break;case"cube":h=(function(g){var p=g.extend,b=g.background,w=St("adj",g,.25*Math.min(p.w,p.h)),x=Ct("g"),A=Ct("path"),T=["M0,".concat(w),"L".concat(p.w-w,",").concat(w),"L".concat(p.w-w,",").concat(p.h),"L0,".concat(p.h),"Z"].join(" ");A.setAttribute("d",T);var C=Ct("path"),E=["M0,".concat(w),"L".concat(w,",0"),"L".concat(p.w,",0"),"L".concat(p.w-w,",").concat(w),"Z"].join(" ");C.setAttribute("d",E),b?.type==="solidFill"&&C.setAttribute("fill",Ke(b,{light:.8})||"transparent");var k=Ct("path"),D=["M".concat(p.w,",0"),"L".concat(p.w-w,",").concat(w),"L".concat(p.w-w,",").concat(p.h),"L".concat(p.w,",").concat(p.h-w),"Z"].join(" ");return k.setAttribute("d",D),b?.type==="solidFill"&&k.setAttribute("fill",Ke(b,{dark:.6})||"transparent"),x.appendChild(A),x.appendChild(C),x.appendChild(k),x})(n),d=(function(g){var p=g.extend,b=St("adj",g,.25*Math.min(p.w,p.h));return{top:b,bottom:0,left:0,right:b,w:p.w-b,h:p.h-b}})(n);break;case"bevel":h=(function(g){var p=g.extend,b=g.background,w=St("adj",g,.125*Math.min(p.w,p.h)),x=Ct("g"),A=Ct("path"),T=["M".concat(w,",").concat(w),"L".concat(p.w-w,",").concat(w),"L".concat(p.w-w,",").concat(p.h-w),"L".concat(w,",").concat(p.h-w),"Z"].join(" ");A.setAttribute("d",T);var C=Ct("path"),E=["M0,0","L".concat(w,",").concat(w),"L".concat(p.w-w,",").concat(w),"L".concat(p.w,",0"),"Z"].join(" ");C.setAttribute("d",E),b?.type==="solidFill"&&C.setAttribute("fill",Ke(b,{light:.8})||"transparent");var k=Ct("path"),D=["M".concat(p.w,",0"),"L".concat(p.w-w,",").concat(w),"L".concat(p.w-w,",").concat(p.h-w),"L".concat(p.w,",").concat(p.h),"Z"].join(" ");k.setAttribute("d",D),b?.type==="solidFill"&&k.setAttribute("fill",Ke(b,{dark:.6})||"transparent");var L=Ct("path"),R=["M".concat(p.w,",").concat(p.h),"L".concat(p.w-w,",").concat(p.h-w),"L".concat(w,",").concat(p.h-w),"L0,".concat(p.h),"Z"].join(" ");L.setAttribute("d",R),b?.type==="solidFill"&&L.setAttribute("fill",Ke(b,{dark:.625})||"transparent");var P=Ct("path"),O=["M0,".concat(p.h),"L".concat(w,",").concat(p.h-w),"L".concat(w,",").concat(w),"L0,0","Z"].join(" ");return P.setAttribute("d",O),b?.type==="solidFill"&&P.setAttribute("fill",Ke(b,{light:.6})||"transparent"),x.appendChild(A),x.appendChild(C),x.appendChild(k),x.appendChild(L),x.appendChild(P),x})(n),d=(function(g){var p=g.extend,b=St("adj",g,.125*Math.min(p.w,p.h));return{top:b,bottom:b,left:b,right:b,w:p.w-2*b,h:p.h-2*b}})(n);break;case"donut":h=(function(g){var p=g.extend,b=St("adj",g,.25*Math.min(p.w,p.h)),w=Ct("path"),x=["M0,".concat(p.h/2),"A".concat(p.w/2,",").concat(p.h/2," 0 1,1 0,").concat(p.h/2+1),"Z","M".concat(p.w-b,",").concat(p.h/2),"A".concat(p.w/2-b,",").concat(p.h/2-b," 0 1,0 ").concat(p.w-b,",").concat(p.h/2+1),"Z"].join(" ");return w.setAttribute("d",x),w})(n),d=kp(n);break;case"noSmoking":h=(function(g){var p=g.extend,b=St("adj",g,.25*Math.min(p.w,p.h)),w=Ct("path"),x=Math.atan(p.h/p.w),A=b/2/Math.sin(x),T=p.w/2,C=p.h/2,E=-1*p.h/p.w,k=p.h*A/p.w,D=p.w/2-b,L=p.h/2-b,R=-2*D*D*E*k,P=Math.sqrt(Math.pow(2*D*D*E*k,2)-4*(L*L+D*D*E*E)*D*D*(k*k-L*L)),O=2*(L*L+D*D*E*E),F=(R-P)/O,z=E*F+k,G=(R+P)/O,U=E*G+k,K=-p.h*A/p.w,W=-2*D*D*E*K,X=Math.sqrt(Math.pow(2*D*D*E*K,2)-4*(L*L+D*D*E*E)*D*D*(K*K-L*L)),Q=2*(L*L+D*D*E*E),at=(W-X)/Q,rt=E*at+K,Rt=(W+X)/Q,Mt=E*Rt+K,xt=["M0,".concat(p.h/2),"A".concat(p.w/2,",").concat(p.h/2," 0 1,1 0,").concat(p.h/2+1),"Z","M".concat(T+G,",").concat(C-U),"A".concat(D,",").concat(L," 0 0 0 ").concat(T+F,",").concat(C-z),"Z","M".concat(T+at,",").concat(C-rt),"A".concat(D,",").concat(L," 0 0 0 ").concat(T+Rt,",").concat(C-Mt),"Z"].join(" ");return w.setAttribute("d",xt),w})(n),d=kp(n);break;case"rightArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=St("adj2",g,.5*Math.min(p.w,p.h)),x=Ct("path"),A=["M0,".concat(p.h/2-b/2),"L".concat(p.w-w,",").concat(p.h/2-b/2),"L".concat(p.w-w,",0"),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-w,",").concat(p.h),"L".concat(p.w-w,",").concat(p.h/2+b/2),"L0,".concat(p.h/2+b/2),"Z"].join(" ");return x.setAttribute("d",A),x})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=b*St("adj2",g,.5*Math.min(p.w,p.h))/p.h;return{top:p.h/2-b/2,bottom:p.h/2-b/2,left:0,right:w,w:p.w-w,h:b}})(n);break;case"leftArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=St("adj2",g,.5*Math.min(p.w,p.h)),x=Ct("path"),A=["M0,".concat(p.h/2),"L".concat(w,",0"),"L".concat(w,",").concat(p.h/2-b/2),"L".concat(p.w,",").concat(p.h/2-b/2),"L".concat(p.w,",").concat(p.h/2+b/2),"L".concat(w,",").concat(p.h/2+b/2),"L".concat(w,",").concat(p.h),"Z"].join(" ");return x.setAttribute("d",A),x})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=b*St("adj2",g,.5*Math.min(p.w,p.h))/p.h;return{top:p.h/2-b/2,bottom:p.h/2-b/2,left:w,right:0,w:p.w-w,h:b}})(n);break;case"upArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=St("adj2",g,.5*Math.min(p.w,p.h)),x=Ct("path"),A=["M".concat(p.w/2,",0"),"L".concat(p.w,",").concat(w),"L".concat(p.w/2+b/2,",").concat(w),"L".concat(p.w/2+b/2,",").concat(p.h),"L".concat(p.w/2-b/2,",").concat(p.h),"L".concat(p.w/2-b/2,",").concat(w),"L0,".concat(w),"Z"].join(" ");return x.setAttribute("d",A),x})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=b*St("adj2",g,.5*Math.min(p.w,p.h))/p.w;return{top:w,bottom:0,left:p.w/2-b/2,right:p.w/2-b/2,w:b,h:p.h-w}})(n);break;case"downArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=St("adj2",g,.5*Math.min(p.w,p.h)),x=Ct("path"),A=["M".concat(p.w/2,",").concat(p.h),"L0,".concat(p.h-w),"L".concat(p.w/2-b/2,",").concat(p.h-w),"L".concat(p.w/2-b/2,",0"),"L".concat(p.w/2+b/2,",0"),"L".concat(p.w/2+b/2,",").concat(p.h-w),"L".concat(p.w,",").concat(p.h-w),"Z"].join(" ");return x.setAttribute("d",A),x})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=b*St("adj2",g,.5*Math.min(p.w,p.h))/p.w;return{top:0,bottom:w,left:p.w/2-b/2,right:p.w/2-b/2,w:b,h:p.h-w}})(n);break;case"leftRightArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=St("adj2",g,.5*Math.min(p.w,p.h)),x=Ct("path"),A=["M0,".concat(p.h/2),"L".concat(w,",0"),"L".concat(w,",").concat(p.h/2-b/2),"L".concat(p.w-w,",").concat(p.h/2-b/2),"L".concat(p.w-w,",0"),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-w,",").concat(p.h),"L".concat(p.w-w,",").concat(p.h/2+b/2),"L".concat(w,",").concat(p.h/2+b/2),"L".concat(w,",").concat(p.h),"Z"].join(" ");return x.setAttribute("d",A),x})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=b*St("adj2",g,.5*Math.min(p.w,p.h))/p.h;return{top:p.h/2-b/2,bottom:p.h/2-b/2,left:w,right:w,w:p.w-2*w,h:b}})(n);break;case"upDownArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=St("adj2",g,.5*Math.min(p.w,p.h)),x=Ct("path"),A=["M".concat(p.w/2,",").concat(p.h),"L0,".concat(p.h-w),"L".concat(p.w/2-b/2,",").concat(p.h-w),"L".concat(p.w/2-b/2,",").concat(w),"L0,".concat(w),"L".concat(p.w/2,",0"),"L".concat(p.w,",").concat(w),"L".concat(p.w/2+b/2,",").concat(w),"L".concat(p.w/2+b/2,",").concat(p.h-w),"L".concat(p.w,",").concat(p.h-w),"Z"].join(" ");return x.setAttribute("d",A),x})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=b*St("adj2",g,.5*Math.min(p.w,p.h))/p.w;return{top:w,bottom:w,left:p.w/2-b/2,right:p.w/2-b/2,w:b,h:p.h-2*w}})(n);break;case"quadArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.225*Math.min(p.w,p.h)),w=St("adj2",g,.225*Math.min(p.w,p.h)),x=St("adj3",g,.225*Math.min(p.w,p.h)),A=Ct("path"),T=["M0,".concat(p.h/2),"L".concat(x,",").concat(p.h/2-w),"L".concat(x,",").concat(p.h/2-b/2),"L".concat(p.w/2-b/2,",").concat(p.h/2-b/2),"L".concat(p.w/2-b/2,",").concat(x),"L".concat(p.w/2-w,",").concat(x),"L".concat(p.w/2,",0"),"L".concat(p.w/2+w,",").concat(x),"L".concat(p.w/2+b/2,",").concat(x),"L".concat(p.w/2+b/2,",").concat(p.h/2-b/2),"L".concat(p.w-x,",").concat(p.h/2-b/2),"L".concat(p.w-x,",").concat(p.h/2-w),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-x,",").concat(p.h/2+w),"L".concat(p.w-x,",").concat(p.h/2+b/2),"L".concat(p.w/2+b/2,",").concat(p.h/2+b/2),"L".concat(p.w/2+b/2,",").concat(p.h-x),"L".concat(p.w/2+w,",").concat(p.h-x),"L".concat(p.w/2,",").concat(p.h),"L".concat(p.w/2-w,",").concat(p.h-x),"L".concat(p.w/2-b/2,",").concat(p.h-x),"L".concat(p.w/2-b/2,",").concat(p.h/2+b/2),"L".concat(x,",").concat(p.h/2+b/2),"L".concat(x,",").concat(p.h/2+w),"Z"].join(" ");return A.setAttribute("d",T),A})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.225*Math.min(p.w,p.h)),w=St("adj2",g,.225*Math.min(p.w,p.h)),x=St("adj3",g,.225*Math.min(p.w,p.h)),A=w===0?0:b*x/w/2;return{top:p.h/2-b/2,bottom:p.h/2-b/2,left:A,right:A,w:p.w-2*A,h:b}})(n);break;case"leftRightUpArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.225*Math.min(p.w,p.h)),w=St("adj2",g,.225*Math.min(p.w,p.h)),x=St("adj3",g,.225*Math.min(p.w,p.h)),A=Ct("path");b>2*w&&(b=2*w);var T=["M0,".concat(p.h-w),"L".concat(x,",").concat(p.h-2*w),"L".concat(x,",").concat(p.h-w-b/2),"L".concat(p.w/2-b/2,",").concat(p.h-w-b/2),"L".concat(p.w/2-b/2,",").concat(x),"L".concat(p.w/2-w,",").concat(x),"L".concat(p.w/2,",0"),"L".concat(p.w/2+w,",").concat(x),"L".concat(p.w/2+b/2,",").concat(x),"L".concat(p.w/2+b/2,",").concat(p.h-w-b/2),"L".concat(p.w-x,",").concat(p.h-w-b/2),"L".concat(p.w-x,",").concat(p.h-2*w),"L".concat(p.w,",").concat(p.h-w),"L".concat(p.w-x,",").concat(p.h),"L".concat(p.w-x,",").concat(p.h-w+b/2),"L".concat(x,",").concat(p.h-w+b/2),"L".concat(x,",").concat(p.h),"Z"].join(" ");return A.setAttribute("d",T),A})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.225*Math.min(p.w,p.h)),w=St("adj2",g,.225*Math.min(p.w,p.h)),x=St("adj3",g,.225*Math.min(p.w,p.h)),A=w===0?0:b*x/w/2;return{top:p.h-w-b/2,bottom:w-b/2,left:A,right:A,w:p.w-2*A,h:b}})(n);break;case"bentArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.25*Math.min(p.w,p.h)),w=St("adj2",g,.25*Math.min(p.w,p.h)),x=St("adj3",g,.25*Math.min(p.w,p.h)),A=St("adj4",g,.4375*Math.min(p.w,p.h)),T=Ct("path");b>2*w&&(b=2*w);var C=A-b;C<0&&(C=0);var E=["M0,".concat(p.h),"L0,".concat(w-b/2+A),"A".concat(A," ").concat(A," 0 0 1 ").concat(A," ").concat(w-b/2),"L".concat(p.w-x,",").concat(w-b/2),"L".concat(p.w-x,",0"),"L".concat(p.w,",").concat(w),"L".concat(p.w-x,",").concat(2*w),"L".concat(p.w-x,",").concat(w+b/2),"L".concat(b+C,",").concat(w+b/2),"A".concat(C," ").concat(C," 0 0 0 ").concat(b," ").concat(w+b/2+C),"L".concat(b,",").concat(p.h),"Z"].join(" ");return T.setAttribute("d",E),T})(n);break;case"uturnArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.25*Math.min(p.w,p.h)),w=St("adj2",g,.25*Math.min(p.w,p.h)),x=St("adj3",g,.25*Math.min(p.w,p.h)),A=St("adj4",g,.4375*Math.min(p.w,p.h)),T=St("adj5",g,.75*Math.min(p.w,p.h)),C=Ct("path");b>2*w&&(b=2*w),T<x&&(T=x+b),A>T-x&&(A=T-x);var E=A-b;E>T-x-b&&(E=T-x-b),E<0&&(E=0);var k=w-b/2,D=["M0,".concat(p.h),"L0,".concat(A),"A".concat(A," ").concat(A," 0 0 1 ").concat(A," 0"),"L".concat(p.w-A-k,",0"),"A".concat(A," ").concat(A," 0 0 1 ").concat(p.w-k," ").concat(A),"L".concat(p.w-k,",").concat(T-x),"L".concat(p.w,",").concat(T-x),"L".concat(p.w-w,",").concat(T),"L".concat(p.w-2*w,",").concat(T-x),"L".concat(p.w-w-b/2,",").concat(T-x),"L".concat(p.w-w-b/2,",").concat(b+E),"A".concat(E," ").concat(E," 0 0 0 ").concat(p.w-E-w-b/2," ").concat(b),"L".concat(b+E,",").concat(b),"A".concat(E," ").concat(E," 0 0 0 ").concat(b," ").concat(b+E),"L".concat(b,",").concat(p.h),"Z"].join(" ");return C.setAttribute("d",D),C})(n);break;case"leftUpArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.25*Math.min(p.w,p.h)),w=St("adj2",g,.25*Math.min(p.w,p.h)),x=St("adj3",g,.25*Math.min(p.w,p.h));b>2*w&&(b=2*w);var A=Math.min(p.w,p.h)-2*w;x>A&&(x=A),x<0&&(x=0);var T=w-b/2,C=Ct("path"),E=["M0,".concat(p.h-w),"L".concat(x,",").concat(p.h-2*w),"L".concat(x,",").concat(p.h-w-b/2),"L".concat(p.w-w-b/2,",").concat(p.h-w-b/2),"L".concat(p.w-w-b/2,",").concat(x),"L".concat(p.w-2*w,",").concat(x),"L".concat(p.w-w,",0"),"L".concat(p.w,",").concat(x),"L".concat(p.w-T,",").concat(x),"L".concat(p.w-T,",").concat(p.h-T),"L".concat(x,",").concat(p.h-T),"L".concat(x,",").concat(p.h),"Z"].join(" ");return C.setAttribute("d",E),C})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.25*Math.min(p.w,p.h)),w=St("adj2",g,.25*Math.min(p.w,p.h)),x=St("adj3",g,.25*Math.min(p.w,p.h));b>2*w&&(b=2*w);var A=Math.min(p.w,p.h)-2*w;x>A&&(x=A),x<0&&(x=0);var T=w===0?0:b*x/w/2;return{top:p.h-w-b/2,bottom:w-b/2,left:T,right:w,w:p.w-T-w,h:b}})(n);break;case"bentUpArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.25*Math.min(p.w,p.h)),w=St("adj2",g,.25*Math.min(p.w,p.h)),x=St("adj3",g,.25*Math.min(p.w,p.h));b>2*w&&(b=2*w);var A=Math.min(p.w,p.h)-2*w;x>A&&(x=A),x<0&&(x=0);var T=w-b/2,C=Ct("path"),E=["M0,".concat(p.h),"L0,".concat(p.h-b),"L".concat(p.w-w-b/2,",").concat(p.h-b),"L".concat(p.w-w-b/2,",").concat(x),"L".concat(p.w-2*w,",").concat(x),"L".concat(p.w-w,",0"),"L".concat(p.w,",").concat(x),"L".concat(p.w-T,",").concat(x),"L".concat(p.w-T,",").concat(p.h),"Z"].join(" ");return C.setAttribute("d",E),C})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.25*Math.min(p.w,p.h));return{top:p.h-b,bottom:0,left:0,right:0,w:p.w,h:b}})(n);break;case"curvedRightArrow":h=(function(g){var p=g.extend,b=g.background,w=St("adj1",g,.25*Math.min(p.w,p.h)),x=St("adj2",g,.5*Math.min(p.w,p.h)),A=St("adj3",g,.25*Math.min(p.w,p.h));w>x&&(w=x);var T=x/2-w/2,C=(p.h-x/2-w/2)/2,E=(p.h-T-w)/2,k=Ct("g"),D=Ct("path"),L=["M".concat(p.w,",0"),"A ".concat(p.w," ").concat(C," 0 0 0 ").concat(0," ").concat(C),"L0,".concat(E+w),"A ".concat(p.w," ").concat(E," 0 0 1 ").concat(p.w," ").concat(w),"Z"].join(" ");D.setAttribute("d",L),b?.type==="solidFill"&&D.setAttribute("fill",Ke(b,{dark:.6})||"transparent");var R=Ct("path"),P=["M0,".concat(C),"A ".concat(p.w," ").concat(C," 0 0 0 ").concat(p.w-A," ").concat(p.h-x/2-w/2),"L".concat(p.w-A,",").concat(p.h-x),"L".concat(p.w,",").concat(p.h-x/2),"L".concat(p.w-A,",").concat(p.h),"L".concat(p.w-A,",").concat(p.h-T),"A ".concat(p.w," ").concat(E," 0 0 1 0 ").concat(w+E),"Z"].join(" ");return R.setAttribute("d",P),k.appendChild(D),k.appendChild(R),k})(n);break;case"curvedLeftArrow":h=(function(g){var p=g.extend,b=g.background,w=St("adj1",g,.25*Math.min(p.w,p.h)),x=St("adj2",g,.5*Math.min(p.w,p.h)),A=St("adj3",g,.25*Math.min(p.w,p.h));w>x&&(w=x);var T=x/2-w/2,C=(p.h-x/2-w/2)/2,E=(p.h-T-w)/2,k=Ct("g"),D=Ct("path"),L=["M0,".concat(p.h-x/2),"L".concat(A,",").concat(p.h-x),"L".concat(A,",").concat(p.h-x/2-w/2),"A".concat(p.w," ").concat(C," 0 0 0 ").concat(p.w," ").concat(C),"L".concat(p.w,",").concat(E+w),"A ".concat(p.w," ").concat(E," 0 0 1 ").concat(A," ").concat(p.h-T),"L".concat(A,",").concat(p.h),"Z"].join(" ");D.setAttribute("d",L);var R=Ct("path"),P=["M0,0","A ".concat(p.w," ").concat(C," 0 0 1 ").concat(p.w," ").concat(C),"L".concat(p.w,",").concat(E+w),"A ".concat(p.w," ").concat(E," 0 0 0 ").concat(0," ").concat(w),"Z"].join(" ");return R.setAttribute("d",P),b?.type==="solidFill"&&R.setAttribute("fill",Ke(b,{dark:.6})||"transparent"),k.appendChild(D),k.appendChild(R),k})(n);break;case"curvedUpArrow":h=(function(g){var p=g.extend,b=g.background,w=St("adj1",g,.25*Math.min(p.w,p.h)),x=St("adj2",g,.5*Math.min(p.w,p.h)),A=St("adj3",g,.25*Math.min(p.w,p.h));w>x&&(w=x);var T=x/2-w/2,C=(p.w-x/2-w/2)/2,E=(p.w-T-w)/2,k=Ct("g"),D=Ct("path"),L=["M".concat(p.w-x/2,",").concat(0),"L".concat(p.w-x,",").concat(A),"L".concat(p.w-x/2-w/2,",").concat(A),"A".concat(C," ").concat(p.h," 0 0 1 ").concat(C," ").concat(p.h),"L".concat(C+w,",").concat(p.h),"A".concat(E," ").concat(p.h," 0 0 0 ").concat(p.w-T," ").concat(A),"L".concat(p.w,",").concat(A),"Z"].join(" ");D.setAttribute("d",L);var R=Ct("path"),P=["M".concat(w,",0"),"L".concat(0,",").concat(0),"A ".concat(C," ").concat(p.h," 0 0 0 ").concat(C," ").concat(p.h),"L".concat(C+w,",").concat(p.h),"A ".concat(E," ").concat(p.h," 0 0 1 ").concat(w," ").concat(0),"Z"].join(" ");return R.setAttribute("d",P),b?.type==="solidFill"&&R.setAttribute("fill",Ke(b,{dark:.6})||"transparent"),k.appendChild(D),k.appendChild(R),k})(n);break;case"curvedDownArrow":h=(function(g){var p=g.extend,b=g.background,w=St("adj1",g,.25*Math.min(p.w,p.h)),x=St("adj2",g,.5*Math.min(p.w,p.h)),A=St("adj3",g,.25*Math.min(p.w,p.h));w>x&&(w=x);var T=x/2-w/2,C=(p.w-x/2-w/2)/2,E=(p.w-T-w)/2,k=Ct("g"),D=Ct("path"),L=["M".concat(0,",").concat(p.h),"L".concat(w,",").concat(p.h),"A".concat(E," ").concat(p.h," 0 0 1 ").concat(E+w," ").concat(0),"L".concat(C,",").concat(0),"A".concat(C," ").concat(p.h," 0 0 0 ").concat(0," ").concat(p.h),"Z"].join(" ");D.setAttribute("d",L),b?.type==="solidFill"&&D.setAttribute("fill",Ke(b,{dark:.6})||"transparent");var R=Ct("path"),P=["M".concat(p.w-x/2,",").concat(p.h),"L".concat(p.w-x,",").concat(p.h-A),"L".concat(p.w-x/2-w/2,",").concat(p.h-A),"A ".concat(C," ").concat(p.h," 0 0 0 ").concat(C," ").concat(0),"L".concat(C+w,",").concat(0),"A ".concat(E," ").concat(p.h," 0 0 1 ").concat(p.w-T," ").concat(p.h-A),"L".concat(p.w,",").concat(p.h-A),"Z"].join(" ");return R.setAttribute("d",P),k.appendChild(D),k.appendChild(R),k})(n);break;case"stripedRightArrow":h=(function(g){var p=g.extend,b=Ct("g"),w=Math.min(p.w,p.h),x=ue("adj1",g,.5)*p.h,A=ue("adj2",g,.5)*w,T=w/8,C=w/16,E=w/32,k=5*w/32,D=p.h/2-x/2,L=p.h/2+x/2,R=Ct("path");R.setAttribute("d",["M".concat(0,",").concat(D),"L".concat(E,",").concat(D),"L".concat(E,",").concat(L),"L".concat(0,",").concat(L),"Z"].join(" "));var P=Ct("path");P.setAttribute("d",["M".concat(C,",").concat(D),"L".concat(T,",").concat(D),"L".concat(T,",").concat(L),"L".concat(C,",").concat(L),"Z"].join(" "));var O=Ct("path"),F=["M".concat(k,",").concat(D),"L".concat(p.w-A,",").concat(D),"L".concat(p.w-A,",").concat(0),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-A,",").concat(p.h),"L".concat(p.w-A,",").concat(L),"L".concat(k,",").concat(L),"Z"].join(" ");return O.setAttribute("d",F),b.appendChild(O),b.appendChild(R),b.appendChild(P),b})(n),d=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj1",g,.5)*p.h,x=w*(ue("adj2",g,.5)*b)/p.h;return{top:p.h/2-w/2,bottom:p.h/2-w/2,left:0,right:x,w:p.w-x,h:w}})(n);break;case"notchedRightArrow":h=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj1",g,.5)*p.h,x=ue("adj2",g,.5)*b,A=w*x/p.h,T=p.h/2-w/2,C=p.h/2+w/2,E=Ct("path"),k=["M".concat(0,",").concat(T),"L".concat(p.w-x,",").concat(T),"L".concat(p.w-x,",").concat(0),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-x,",").concat(p.h),"L".concat(p.w-x,",").concat(C),"L".concat(0,",").concat(C),"L".concat(A,",").concat(p.h/2),"Z"].join(" ");return E.setAttribute("d",k),E})(n),d=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj1",g,.5)*p.h,x=ue("adj2",g,.5)*b,A=w*x/p.h,T=w*x/p.h;return{top:p.h/2-w/2,bottom:p.h/2-w/2,left:A,right:T,w:p.w-A-T,h:w}})(n);break;case"homePlate":h=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj",g,.5)*b,x=Ct("path"),A=["M".concat(0,",").concat(0),"L".concat(p.w-w,",").concat(0),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-w,",").concat(p.h),"L".concat(0,",").concat(p.h),"Z"].join(" ");return x.setAttribute("d",A),x})(n),d=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj",g,.5)*b;return{top:0,bottom:0,left:0,right:w/2,w:p.w-w/2,h:p.h}})(n);break;case"chevron":h=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj",g,.5)*b,x=Ct("path"),A=["M".concat(0,",").concat(0),"L".concat(p.w-w,",").concat(0),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-w,",").concat(p.h),"L".concat(0,",").concat(p.h),"L".concat(w,",").concat(p.h/2),"Z"].join(" ");return x.setAttribute("d",A),x})(n),d=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj",g,.5)*b;return{top:0,bottom:0,left:w,right:w,w:p.w-2*w,h:p.h}})(n);break;case"blockArc":h=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=Ct("path"),x=ue("adj1",g,180),A=ue("adj2",g,0),T=St("adj3",g,.25*b),C=p.w/2,E=p.h/2,k=p.w/2,D=p.h/2,L=p.w/2-T,R=p.h/2-T,P=Kn(x,C,E,k,D),O=P[0],F=P[1],z=Kn(A,C,E,k,D),G=z[0],U=z[1],K=Kn(x,C,E,L,R),W=K[0],X=K[1],Q=Kn(A,C,E,L,R),at=Q[0],rt=Q[1],Rt=Pp(x,A),Mt=["M".concat(O,",").concat(F),"A".concat(k," ").concat(D," 0 ").concat(Rt," 1 ").concat(G," ").concat(U),"L".concat(at,",").concat(rt),"A".concat(L," ").concat(R," 0 ").concat(Rt," 0 ").concat(W," ").concat(X),"Z"].join(" ");return w.setAttribute("d",Mt),w})(n),d=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj1",g,180),x=ue("adj2",g,0),A=St("adj3",g,.25*b),T=p.w/2,C=p.h/2,E=p.w/2,k=p.h/2,D=p.w/2-A,L=p.h/2-A,R=Kn(w,T,C,E,k),P=R[0],O=R[1],F=Kn(x,T,C,E,k),z=F[0],G=F[1],U=Kn(w,T,C,D,L),K=U[0],W=U[1],X=Kn(x,T,C,D,L),Q=[[P,O],[z,G],[K,W],[X[0],X[1]]];Q.push(),w>x&&Q.push([p.w,p.h/2]),(x>180&&x<=360&&w<180||w>x&&x>=0&&x<180&&w<180)&&Q.push([0,p.h/2]),(w<x&&w<90&&x>90||w>x&&x>90||w>x&&w<90)&&Q.push([p.w/2,p.h]),(w<x&&w<270&&x>270||w>x&&x>270||w>x&&w<270)&&Q.push([p.w/2,0]);var at=1/0,rt=1/0,Rt=-1/0,Mt=-1/0;return Q.forEach((function(xt){at=Math.min(xt[0],at),rt=Math.min(xt[1],rt),Rt=Math.max(xt[0],Rt),Mt=Math.max(xt[1],Mt)})),{top:rt,bottom:p.h-Mt,left:at,right:p.w-Rt,w:Rt-at,h:Mt-rt}})(n);break;case"foldedCorner":h=(function(g){var p=g.extend,b=g.background,w=Ct("g"),x=Ct("path"),A=St("adj",g,.16667*Math.min(p.w,p.h)),T=["M0,0","L".concat(p.w,",0"),"L".concat(p.w,",").concat(p.h-A),"L".concat(p.w-A,",").concat(p.h),"L".concat(0,",").concat(p.h),"Z"].join(" ");x.setAttribute("d",T);var C=A*Math.cos(Math.PI/4)/Math.cos(Math.PI/6)*Math.cos(75/180*Math.PI),E=Ct("path"),k=["M".concat(p.w-A+C,", ").concat(p.h-A+C),"L".concat(p.w,",").concat(p.h-A),"L".concat(p.w-A,",").concat(p.h),"Z"].join(" ");return E.setAttribute("d",k),b?.type==="solidFill"&&E.setAttribute("fill",Ke(b,{dark:.6})||"transparent"),w.appendChild(x),w.appendChild(E),w})(n),d=(function(g){var p=g.extend,b=St("adj",g,.16667*Math.min(p.w,p.h));return{top:0,bottom:b,left:0,right:0,w:p.w,h:p.h-b}})(n);break;case"rightArrowCallout":h=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj1",g,.25)*b,x=ue("adj2",g,.25)*b,A=ue("adj3",g,.25)*b,T=ue("adj4",g,.64977)*p.w,C=Ct("path"),E=["M".concat(0,",").concat(0),"L".concat(T,",").concat(0),"L".concat(T,",").concat(p.h/2-w/2),"L".concat(p.w-A,",").concat(p.h/2-w/2),"L".concat(p.w-A,",").concat(p.h/2-x),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-A,",").concat(p.h/2+x),"L".concat(p.w-A,",").concat(p.h/2+w/2),"L".concat(T,",").concat(p.h/2+w/2),"L".concat(T,",").concat(p.h),"L".concat(0,",").concat(p.h),"Z"].join(" ");return C.setAttribute("d",E),C})(n),d=(function(g){var p=g.extend,b=ue("adj4",g,.64977)*p.w;return{top:0,bottom:0,left:0,right:p.w-b,w:b,h:p.h}})(n);break;case"leftArrowCallout":h=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj1",g,.25)*b,x=ue("adj2",g,.25)*b,A=ue("adj3",g,.25)*b,T=ue("adj4",g,.64977)*p.w,C=Ct("path"),E=["M".concat(0,",").concat(p.h/2),"L".concat(A,",").concat(p.h/2-x),"L".concat(A,",").concat(p.h/2-w/2),"L".concat(p.w-T,",").concat(p.h/2-w/2),"L".concat(p.w-T,",").concat(0),"L".concat(p.w,",").concat(0),"L".concat(p.w,",").concat(p.h),"L".concat(p.w-T,",").concat(p.h),"L".concat(p.w-T,",").concat(p.h/2+w/2),"L".concat(A,",").concat(p.h/2+w/2),"L".concat(A,",").concat(p.h/2+x),"Z"].join(" ");return C.setAttribute("d",E),C})(n),d=(function(g){var p=g.extend,b=ue("adj4",g,.64977)*p.w;return{top:0,bottom:0,left:p.w-b,right:0,w:b,h:p.h}})(n);break;case"upArrowCallout":h=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj1",g,.25)*b,x=ue("adj2",g,.25)*b,A=ue("adj3",g,.25)*b,T=ue("adj4",g,.64977)*p.h,C=Ct("path"),E=["M".concat(0,",").concat(p.h-T),"L".concat(p.w/2-w/2,",").concat(p.h-T),"L".concat(p.w/2-w/2,",").concat(A),"L".concat(p.w/2-x,",").concat(A),"L".concat(p.w/2,",").concat(0),"L".concat(p.w/2+x,",").concat(A),"L".concat(p.w/2+w/2,",").concat(A),"L".concat(p.w/2+w/2,",").concat(p.h-T),"L".concat(p.w,",").concat(p.h-T),"L".concat(p.w,",").concat(p.h),"L".concat(0,",").concat(p.h),"Z"].join(" ");return C.setAttribute("d",E),C})(n),d=(function(g){var p=g.extend,b=ue("adj4",g,.64977)*p.h;return{top:p.h-b,bottom:0,left:0,right:0,w:p.w,h:b}})(n);break;case"downArrowCallout":h=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj1",g,.25)*b,x=ue("adj2",g,.25)*b,A=ue("adj3",g,.25)*b,T=ue("adj4",g,.64977)*p.h,C=Ct("path"),E=["M".concat(0,",").concat(0),"L".concat(p.w,",").concat(0),"L".concat(p.w,",").concat(T),"L".concat(p.w/2+w/2,",").concat(T),"L".concat(p.w/2+w/2,",").concat(p.h-A),"L".concat(p.w/2+x,",").concat(p.h-A),"L".concat(p.w/2,",").concat(p.h),"L".concat(p.w/2-x,",").concat(p.h-A),"L".concat(p.w/2-w/2,",").concat(p.h-A),"L".concat(p.w/2-w/2,",").concat(T),"L".concat(0,",").concat(T),"Z"].join(" ");return C.setAttribute("d",E),C})(n),d=(function(g){var p=g.extend,b=ue("adj4",g,.64977)*p.h;return{top:0,bottom:p.h-b,left:0,right:0,w:p.w,h:b}})(n);break;case"leftRightArrowCallout":h=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj1",g,.25)*b,x=ue("adj2",g,.25)*b,A=ue("adj3",g,.25)*b,T=ue("adj4",g,.48123)*p.w,C=Ct("path"),E=["M".concat(0,",").concat(p.h/2),"L".concat(A,",").concat(p.h/2-x),"L".concat(A,",").concat(p.h/2-w/2),"L".concat(p.w/2-T/2,",").concat(p.h/2-w/2),"L".concat(p.w/2-T/2,",").concat(0),"L".concat(p.w/2+T/2,",").concat(0),"L".concat(p.w/2+T/2,",").concat(p.h/2-w/2),"L".concat(p.w-A,",").concat(p.h/2-w/2),"L".concat(p.w-A,",").concat(p.h/2-x),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-A,",").concat(p.h/2+x),"L".concat(p.w-A,",").concat(p.h/2+w/2),"L".concat(p.w/2+T/2,",").concat(p.h/2+w/2),"L".concat(p.w/2+T/2,",").concat(p.h),"L".concat(p.w/2-T/2,",").concat(p.h),"L".concat(p.w/2-T/2,",").concat(p.h/2+w/2),"L".concat(A,",").concat(p.h/2+w/2),"L".concat(A,",").concat(p.h/2+x),"Z"].join(" ");return C.setAttribute("d",E),C})(n),d=(function(g){var p=g.extend,b=ue("adj4",g,.48123)*p.w;return{top:0,bottom:0,left:p.w/2-b/2,right:p.w/2-b/2,w:b,h:p.h}})(n);break;case"quadArrowCallout":h=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj1",g,.18515)*b,x=ue("adj2",g,.18515)*b,A=ue("adj3",g,.18515)*b,T=ue("adj4",g,.48123)*p.w,C=ue("adj4",g,.48123)*p.h,E=Ct("path"),k=["M".concat(0,",").concat(p.h/2),"L".concat(A,",").concat(p.h/2-x),"L".concat(A,",").concat(p.h/2-w/2),"L".concat(p.w/2-T/2,",").concat(p.h/2-w/2),"L".concat(p.w/2-T/2,",").concat(p.h/2-C/2),"L".concat(p.w/2-w/2,",").concat(p.h/2-C/2),"L".concat(p.w/2-w/2,",").concat(A),"L".concat(p.w/2-x,",").concat(A),"L".concat(p.w/2,",").concat(0),"L".concat(p.w/2+x,",").concat(A),"L".concat(p.w/2+w/2,",").concat(A),"L".concat(p.w/2+w/2,",").concat(p.h/2-C/2),"L".concat(p.w/2+T/2,",").concat(p.h/2-C/2),"L".concat(p.w/2+T/2,",").concat(p.h/2-w/2),"L".concat(p.w-A,",").concat(p.h/2-w/2),"L".concat(p.w-A,",").concat(p.h/2-x),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-A,",").concat(p.h/2+x),"L".concat(p.w-A,",").concat(p.h/2+w/2),"L".concat(p.w/2+T/2,",").concat(p.h/2+w/2),"L".concat(p.w/2+T/2,",").concat(p.h/2+C/2),"L".concat(p.w/2+w/2,",").concat(p.h/2+C/2),"L".concat(p.w/2+w/2,",").concat(p.h-A),"L".concat(p.w/2+x,",").concat(p.h-A),"L".concat(p.w/2,",").concat(p.h),"L".concat(p.w/2-x,",").concat(p.h-A),"L".concat(p.w/2-w/2,",").concat(p.h-A),"L".concat(p.w/2-w/2,",").concat(p.h/2+C/2),"L".concat(p.w/2-T/2,",").concat(p.h/2+C/2),"L".concat(p.w/2-T/2,",").concat(p.h/2+w/2),"L".concat(A,",").concat(p.h/2+w/2),"L".concat(A,",").concat(p.h/2+x),"Z"].join(" ");return E.setAttribute("d",k),E})(n),d=(function(g){var p=g.extend,b=ue("adj4",g,.48123)*p.w,w=ue("adj4",g,.48123)*p.h;return{top:p.h/2-w/2,bottom:p.h/2-w/2,left:p.w/2-b/2,right:p.w/2-b/2,w:b,h:w}})(n)}h&&(v?i?.type==="blipFill"?(function(g,p,b){var w=g.background,x=w===void 0?{}:w,A=g.extend,T=x.base64,C=x.alpha,E=x.fillRect,k=E===void 0?{}:E,D=k.b,L=D===void 0?0:D,R=k.t,P=R===void 0?0:R,O=k.l,F=O===void 0?0:O,z=k.r,G=z===void 0?0:z,U=Ct("defs"),K=Ct("pattern");K.setAttribute("id","background_"+g.uuid),K.setAttribute("patternUnits","userSpaceOnUse"),K.setAttribute("width",A.w+""),K.setAttribute("height",A.h+"");var W=Ct("image");W.setAttribute("href",T),W.setAttribute("preserveAspectRatio","none");var X=A.w*F,Q=A.h*P,at=A.w*(1-F-G),rt=A.h*(1-P-L);W.setAttribute("width",at+""),W.setAttribute("height",rt+""),W.setAttribute("x",X+""),W.setAttribute("y",Q+""),typeof C=="number"&&W.setAttribute("opacity",C+""),K.appendChild(W),U.appendChild(K),p.appendChild(U),b.setAttribute("fill","url(#background_".concat(g.uuid,")"))})(n,f,h):i?.type==="gradFill"?(function(g,p,b){var w=g.background,x=w===void 0?{}:w;g.extend;var A=x.gsList,T=x.lin,C=x.path,E=x.tileRect,k=E===void 0?{}:E,D=Ct("defs"),L=Ct(C==="circle"?"radialGradient":"linearGradient");L.setAttribute("id","background_grad_fill_"+g.uuid);var R=A||[];if(R.sort((function(G,U){return G.pos-U.pos})),R.forEach((function(G){var U=Ct("stop");U.setAttribute("offset","".concat(100*G.pos,"%")),U.setAttribute("stop-color",Ke(G.color)),L.appendChild(U)})),C==="circle"){var P=k.r,O=k.l,F=k.t,z=k.b;P===-1?L.setAttribute("cx","100%"):O===-1&&L.setAttribute("cx","0%"),F===-1?L.setAttribute("cy","0%"):z===-1&&L.setAttribute("cy","100%")}else T?.ang&&L.setAttribute("gradientTransform","rotate(".concat(T.ang,")"));D.appendChild(L),p.appendChild(D),b.setAttribute("fill","url(#background_grad_fill_".concat(g.uuid,")"))})(n,f,h):h.setAttribute("fill",Ke(i)||"transparent"):h.setAttribute("fill","transparent"),r.width?(h.setAttribute("stroke-width",r.width+"px"),h.setAttribute("stroke",Ke(r.color)||"transparent")):h.setAttribute("stroke-width","0"),h.setAttribute("stroke-dasharray",(function(g){return g&&g.type!=="solid"?({sysDot:[1,1],sysDash:[3,1],dash:[4,3],dashDot:[4,3,1,3],lgDash:[8,3],lgDashDot:[8,3,1,3],lgDashDotDot:[8,3,1,3,1,3]}[g.type]||[]).map((function(p){return p*g.width})).join(","):""})(r)),h.setAttribute("stroke-linecap",r.cap&&{sq:"square",rnd:"round",flat:"butt"}[r.cap]||"square"),h.setAttribute("stroke-linejoin",r.lineJoin||"round"),r.lineJoin==="miter"&&h.setAttribute("stroke-miterlimit",r.miterLim+""),f.appendChild(h));var m=[];o&&m.push("scaleX(-1)"),s&&m.push("scaleY(-1)"),f.style.setProperty("transform",m.join(" ")),l.appendChild(f);var y=(function(g,p,b){var w;b===void 0&&(b=!1);var x=g.inheritProps,A=g.props,T=g.paragraphs;if(!T||T.length===0)return null;var C=Vt(Vt({},x),A),E=document.createElement("div");switch(E.className="text-wrapper",E.style.boxSizing="border-box",E.style.position="absolute",E.style.left=p.left+"px",C.vert==="eaVert"?(E.style.writingMode="vertical-rl",E.style.height=p.h+"px"):E.style.width=p.w+"px",C.anchor){case"b":E.style.bottom=p.bottom+"px";break;case"t":E.style.top=p.top+"px";break;case"ctr":E.style.top=p.top+p.h/2+"px",E.style.transform="translateY(-50%)";break;default:b?E.style.top=p.top+"px":(E.style.top=p.top+p.h/2+"px",E.style.transform="translateY(-50%)")}var k=[C.hasOwnProperty("tIns")?Math.floor(C.tIns)+"px":"3px",C.hasOwnProperty("rIns")?Math.floor(C.rIns)+"px":"5px",C.hasOwnProperty("bIns")?Math.floor(C.bIns)+"px":"3px",C.hasOwnProperty("lIns")?Math.floor(C.lIns)+"px":"5px"];E.style.padding=k.join(" ");for(var D={},L=0,R=function(F){var z=Vt(Vt({},F.inheritProps),F.props),G=void 0;if(z.buAutoNum){var U=z.level?+z.level:0;D[U]||(D[U]=0),!((w=F.rows)===null||w===void 0)&&w.length&&D[U]++,Object.keys(D).forEach((function(K){+K>U&&(D[K]=0)})),G=n_(F,D[U],{isFirst:L===0,isLast:T.length-1===L,bodyProps:C})}else G=n_(F,0,{isFirst:L===0,isLast:T.length-1===L,bodyProps:C});E.appendChild(G),L++},P=0,O=T;P<O.length;P++)R(O[P]);return E})(n.textBody,d,n.isTextBox);return y&&l.appendChild(y),a&&l.style.setProperty("transform","rotate(".concat(a,"deg)")),l}function NX(n){var t=document.createElement("div"),e=n.extend;n.chExtend;var r=n.offset;n.chOffset;var i=n.flipV,a=n.flipH,o=n.rotate,s=r.x,l=r.y,u=e.w,c=e.h;t.className="group",t.style.position="absolute",t.style.left=s+"px",t.style.top=l+"px",t.style.width=u+"px",t.style.height=c+"px";var h=[];a&&h.push("scaleX(-1)"),i&&h.push("scaleY(-1)"),o&&h.push("rotate(".concat(o,"deg)")),t.style.transformOrigin="center center",t.style.transform=h.join(" ");for(var f=0;f<n.nodes.length;f++){var d=n.nodes[f],v=void 0;d instanceof r_?v=AE(d):d instanceof rg?v=TE(d):d instanceof XP&&(v=NX(d)),v&&t.appendChild(v)}return t}var so={};function E3(n,t){so[n]||(so[n]=[]),so[n].push(t)}function l0(n,t){if(so[n])for(var e=0;e<so[n].length;e++)so[n][e](t)}function HA(n,t){so?so[n]&&(so[n]=so[n].filter((function(e){return e!==t}))):so[n]=[]}var M3=(function(){function n(t,e,r){this.scale=1,this.wrapper=t,this.pptx=e,this.options=r,this._calcScaleAndRenderPort()}return n.prototype._calcScaleAndRenderPort=function(){var t=this.options.viewPort.width/this.pptx.width;this.scale=t;var e=this.options.viewPort.width,r=this.pptx.height*this.scale;this.renderPort={width:e,height:r,left:0,top:0}},n.prototype.renderSlide=function(t){var e=this.pptx.slides[t],r=document.createElement("div");r.classList.add("pptx-preview-slide-wrapper"),r.classList.add("pptx-preview-slide-wrapper-".concat(t)),r.style.setProperty("width",this.renderPort.width+"px"),r.style.setProperty("height",this.renderPort.height+"px"),r.style.setProperty("position",this.options.mode==="slide"?"absolute":"relative"),this.options.mode==="slide"&&r.style.setProperty("top",(this.options.viewPort.height-this.renderPort.height)/2+"px"),r.style.margin="0 auto 10px",r.style.setProperty("background","#fff"),r.style.setProperty("overflow","hidden"),this._renderBackground(e,r),this._renderSlideMaster(e.slideMaster,r),this._renderSlideLayout(e.slideLayout,r),this._renderSlide(e,r),this.wrapper.append(r)},n.prototype._renderSlideMaster=function(t,e){var r=document.createElement("div");r.classList.add("slide-master-wrapper"),r.style.setProperty("position","absolute"),r.style.setProperty("left","0"),r.style.setProperty("top","0"),r.style.setProperty("width",this.pptx.width+"px"),r.style.setProperty("height",this.pptx.height+"px"),r.style.setProperty("transform","scale(".concat(this.scale,")")),r.style.setProperty("transform-origin","0 0");var i=rv([],t.nodes,!0).filter((function(s){return s.userDrawn}));i.sort((function(s,l){return s.order>l.order?1:-1}));for(var a=0;a<i.length;a++){var o=this._renderNode(i[a]);o&&r.append(o)}e.append(r)},n.prototype._renderSlideLayout=function(t,e){var r=document.createElement("div");r.classList.add("slide-layout-wrapper"),r.style.setProperty("position","absolute"),r.style.setProperty("left","0"),r.style.setProperty("top","0"),r.style.setProperty("width",this.pptx.width+"px"),r.style.setProperty("height",this.pptx.height+"px"),r.style.setProperty("transform","scale(".concat(this.scale,")")),r.style.setProperty("transform-origin","0 0");var i=rv([],t.nodes,!0).filter((function(s){return s.userDrawn}));i.sort((function(s,l){return s.order>l.order?1:-1}));for(var a=0;a<i.length;a++){var o=this._renderNode(i[a]);o&&r.append(o)}e.append(r)},n.prototype._renderSlide=function(t,e){var r=document.createElement("div");r.classList.add("slide-wrapper"),r.style.setProperty("position","absolute"),r.style.setProperty("left","0"),r.style.setProperty("top","0"),r.style.setProperty("width",this.pptx.width+"px"),r.style.setProperty("height",this.pptx.height+"px"),r.style.setProperty("transform","scale(".concat(this.scale,")")),r.style.setProperty("transform-origin","0 0");var i=rv([],t.nodes,!0);i.sort((function(s,l){return s.order>l.order?1:-1}));for(var a=0;a<i.length;a++){var o=this._renderNode(i[a]);o&&r.append(o)}e.append(r)},n.prototype._renderNode=function(t){return t instanceof r_?AE(t):t instanceof rg?TE(t):t instanceof XP?NX(t):t instanceof LX?(function(e){var r=document.createElement("div"),i=e.extend,a=e.offset,o=e.flipV,s=e.flipH,l=e.rotate,u=a.x,c=a.y,h=i.w,f=i.h;r.className="smart-chart-diagram",r.style.position="absolute",r.style.left=u+"px",r.style.top=c+"px",r.style.width=h+"px",r.style.height=f+"px";var d=[];s&&d.push("scaleX(-1)"),o&&d.push("scaleY(-1)"),l&&d.push("rotate(".concat(l,"deg)")),r.style.transformOrigin="center center",r.style.transform=d.join(" ");for(var v=0;v<e.nodes.length;v++){var m=e.nodes[v],y=void 0;m instanceof r_?y=AE(m):m instanceof rg&&(y=TE(m)),y&&r.appendChild(y)}return r})(t):t instanceof DX?(function(e){var r=e.extend,i=e.offset,a=e.tr,o=e.tableGrid.gridCol,s=document.createElement("div");s.style.position="absolute",s.style.left=i.x+"px",s.style.top=i.y+"px",s.style.width=r.w+"px",s.style.height=r.h+"px";var l=document.createElement("table");return l.style.borderCollapse="collapse",a.forEach((function(u){var c=u.props,h=u.td,f=c.height,d=document.createElement("tr");d.style.height=f+"px",h.forEach((function(v,m){var y,g,p=v.props,b=v.inheritTcStyle,w=v.inheritTcTxStyle,x=v.paragraphs;if(!p.vMerge&&!p.hMerge){var A=document.createElement("td");A.style.width=(((y=o[m])===null||y===void 0?void 0:y.width)||30)+"px",p.rowSpan&&A.setAttribute("rowspan",p.rowSpan+""),p.gridSpan&&A.setAttribute("colspan",p.gridSpan+"");var T=p.background||b.background;T&&(A.style.background=Ke(T));var C=Vt(Vt({},b.border),p.border),E=function(U){return U?U.toLowerCase().includes("dash")?"dashed":U.toLowerCase().includes("dot")?"dotted":"solid":"solid"};C.bottom&&(A.style.borderBottom="".concat(C.bottom.width,"px ").concat(E(C.bottom.type)," ").concat(Ke(C.bottom.color))),C.top&&(A.style.borderTop="".concat(C.top.width,"px ").concat(E(C.top.type)," ").concat(Ke(C.top.color))),C.left&&(A.style.borderLeft="".concat(C.left.width,"px ").concat(E(C.left.type)," ").concat(Ke(C.left.color))),C.right&&(A.style.borderRight="".concat(C.right.width,"px ").concat(E(C.right.type)," ").concat(Ke(C.right.color)));var k=document.createElement("div");switch(k.className="text-wrapper",k.style.boxSizing="border-box",k.style.width="100%",k.style.height="100%",k.style.overflow="hidden",k.style.display="flex",k.style.flexDirection="column",p.anchor){case"b":k.style.justifyContent="flex-end";break;case"t":k.style.justifyContent="flex-start";break;case"ctr":k.style.justifyContent="center"}var D=[p.hasOwnProperty("marT")?Math.floor(p.marT)+"px":"3px",p.hasOwnProperty("marR")?Math.floor(p.marR-1)+"px":"5px",p.hasOwnProperty("marB")?Math.floor(p.marB)+"px":"3px",p.hasOwnProperty("marL")?Math.floor(p.marL-1)+"px":"5px"];k.style.padding=D.join(" ");for(var L=Vt({},p),R={},P=x.map((function(U){return Vt(Vt({},U),{props:Vt({align:"l"},U.props),inheritRProps:Vt(Vt({},U.inheritRProps),w)})})),O=0,F=function(U){var K=Vt(Vt({},U.inheritProps),U.props),W=void 0;if(K.buAutoNum){var X=K.level?+K.level:0;R[X]||(R[X]=0),!((g=U.rows)===null||g===void 0)&&g.length&&R[X]++,Object.keys(R).forEach((function(Q){+Q>X&&(R[Q]=0)})),W=n_(U,R[X],{isFirst:O===0,isLast:x.length-1===O,bodyProps:L})}else W=n_(U,0,{isFirst:O===0,isLast:x.length-1===O,bodyProps:L});k.appendChild(W),O++},z=0,G=P;z<G.length;z++)F(G[z]);A.append(k),d.append(A)}})),l.append(d)})),s.append(l),s})(t):t instanceof IX?(function(e){var r=document.createElement("div"),i=e.extend,a=e.offset,o=e.flipV,s=e.flipH,l=e.rotate,u=e.options,c=a.x,h=a.y,f=i.w,d=i.h;r.className="chart-node",r.style.position="absolute",r.style.left=c+"px",r.style.top=h+"px",r.style.width=f+"px",r.style.height=d+"px";var v=[];return s&&v.push("scaleX(-1)"),o&&v.push("scaleY(-1)"),l&&v.push("rotate(".concat(l,"deg)")),r.style.transformOrigin="center center",r.style.transform=v.join(" "),setTimeout((function(){var m=ngt(r,null,{renderer:"svg"});m.setOption(u),E3("destroy",(function(){m&&m.dispose(),m&&(m=null)})),E3("removeSlide",(function(){m&&m.dispose(),m&&(m=null)}))}),0),r})(t):void 0},n.prototype._renderBackground=function(t,e){var r,i=document.createElement("div");i.classList.add("slide-background"),i.style.setProperty("position","absolute"),i.style.setProperty("left","0"),i.style.setProperty("top","0"),i.style.setProperty("width","100%"),i.style.setProperty("height","100%");var a=t.background;if(a.type==="none"&&(a=t.slideLayout.background),a.type==="none"&&(a=t.slideMaster.background),a.type==="blipFill"){var o=a,s=o.base64,l=o.alpha,u=o.fillRect,c=u===void 0?{}:u,h=c.b,f=h===void 0?0:h,d=c.t,v=d===void 0?0:d,m=c.l,y=m===void 0?0:m,g=c.r,p=g===void 0?0:g,b=this.renderPort.width*y,w=this.renderPort.height*v,x=this.renderPort.width*(1-y-p),A=this.renderPort.height*(1-v-f);i.style.backgroundImage="url(".concat(s,")"),i.style.backgroundSize="".concat(x," ").concat(A),i.style.backgroundPosition="".concat(b,"px ").concat(w,"px"),l&&(i.style.opacity=l+""),i.style.backgroundRepeat="no-repeat"}else if(a.type==="solidFill"){var T=Ke(t.background)||Ke(t.slideLayout.background)||Ke(t.slideMaster.background);T?i.style.setProperty("background",T):i.style.setProperty("background","#fff")}else if(a.type==="gradFill")if(a.path==="circle"){var C=a.tileRect||{},E=(f=C.b,v=C.t,y=C.l,"radial-gradient(circle at ");(p=C.r)===-1?E+=" right":y===-1&&(E+=" left"),v===-1?E+=" top":f===-1&&(E+=" bottom"),f||v||y||p||(E+=" center"),E+=",",E+=a.gsList.map((function(D){return"".concat(Ke(D.color)," ").concat(100*D.pos+"%")})).join(","),i.style.setProperty("background",E)}else{var k=((r=a?.lin)===null||r===void 0?void 0:r.ang)||0;E="linear-gradient(".concat(k+90,"deg,"),E+=a.gsList.map((function(D){return"".concat(Ke(D.color)," ").concat(100*D.pos+"%")})).join(","),i.style.setProperty("background",E)}e.append(i)},n})(),m2t=(function(){function n(t,e){this.currentIndex=-1,this.dom=t,this.options=e,this._renderWrapper()}return Object.defineProperty(n.prototype,"slideCount",{get:function(){var t,e;return(e=(t=this.pptx)===null||t===void 0?void 0:t.slides)===null||e===void 0?void 0:e.length},enumerable:!1,configurable:!0}),n.prototype._renderWrapper=function(){var t=document.createElement("div");t.classList.add("pptx-preview-wrapper"),t.setAttribute("position","relative"),t.style.setProperty("background","#000"),t.style.setProperty("width",this.options.width+"px"),this.options.height&&t.style.setProperty("height",this.options.height+"px"),t.style.setProperty("position","relative"),t.style.setProperty("margin","0 auto"),this.options.height&&t.style.setProperty("overflow-y","auto"),this.dom.append(t),this.wrapper=t},n.prototype.renderNextButton=function(){var t=document.createElement("div");t.classList.add("pptx-preview-wrapper-next"),t.style.setProperty("position","absolute"),t.style.setProperty("bottom","20px"),t.style.setProperty("right","80px"),t.style.setProperty("z-index","100"),t.style.setProperty("cursor","pointer"),t.style.setProperty("width","40px"),t.style.setProperty("height","40px"),t.style.setProperty("background","#666666"),t.style.setProperty("border-radius","100%");var e=document.createElement("div");return e.style.setProperty("width","10px"),e.style.setProperty("height","10px"),e.style.setProperty("border-left","2px solid #fff"),e.style.setProperty("border-bottom","2px solid #fff"),e.style.setProperty("transform","rotate(225deg)"),e.style.setProperty("position","absolute"),e.style.setProperty("top","15px"),e.style.setProperty("left","15px"),t.append(e),t},n.prototype.renderPreButton=function(){var t=document.createElement("div");t.classList.add("pptx-preview-wrapper-next"),t.style.setProperty("position","absolute"),t.style.setProperty("bottom","20px"),t.style.setProperty("right","140px"),t.style.setProperty("z-index","100"),t.style.setProperty("cursor","pointer"),t.style.setProperty("width","40px"),t.style.setProperty("height","40px"),t.style.setProperty("background","#666666"),t.style.setProperty("border-radius","100%");var e=document.createElement("div");return e.style.setProperty("width","10px"),e.style.setProperty("height","10px"),e.style.setProperty("border-left","2px solid #fff"),e.style.setProperty("border-bottom","2px solid #fff"),e.style.setProperty("transform","rotate(45deg)"),e.style.setProperty("position","absolute"),e.style.setProperty("top","15px"),e.style.setProperty("left","15px"),t.append(e),t},n.prototype.updatePagination=function(){var t=this.wrapper.querySelector(".pptx-preview-wrapper-pagination");t&&(t.innerText="".concat(this.currentIndex+1,"/").concat(this.slideCount))},n.prototype.renderPagination=function(t){var e=document.createElement("div");e.classList.add("pptx-preview-wrapper-pagination"),e.innerText="".concat(this.currentIndex+1,"/").concat(this.slideCount),e.style.setProperty("position","absolute"),e.style.setProperty("bottom","33px"),e.style.setProperty("right","20px"),e.style.setProperty("color","#666666"),e.style.setProperty("font-size","14px"),e.style.setProperty("z-index","100"),t.append(e)},n.prototype.removeCurrentSlide=function(){var t=this.wrapper.querySelector(".pptx-preview-slide-wrapper-".concat(this.currentIndex));t&&this.wrapper.removeChild(t),l0("removeSlide")},n.prototype.renderNextSlide=function(){this.removeCurrentSlide(),this.currentIndex=this.currentIndex<this.slideCount-1?this.currentIndex+1:0,this.htmlRender.renderSlide(this.currentIndex),this.updatePagination()},n.prototype.renderPreSlide=function(){this.removeCurrentSlide(),this.currentIndex=this.currentIndex>0?this.currentIndex-1:this.slideCount-1,this.htmlRender.renderSlide(this.currentIndex),this.updatePagination()},n.prototype._addPre=function(t){},n.prototype.preview=function(t){var e=this;return l0("destroy"),HA("destroy"),new Promise((function(r,i){e.wrapper.innerHTML="";var a=e.pptx=new b3;a.load(t).then((function(){try{var o=e.htmlRender=new M3(e.wrapper,a,{viewPort:{width:e.options.width,height:e.options.height},mode:e.options.mode});if(e.options.mode==="slide"){var s=e.renderNextButton();s.onclick=function(){e.renderNextSlide()},e.wrapper.append(s);var l=e.renderPreButton();l.onclick=function(){e.renderPreSlide()},e.wrapper.append(l),e.renderPagination(e.wrapper),e._addPre(e.wrapper),e.currentIndex=0,o.renderSlide(0)}else for(var u=0;u<a.slides.length;u++)o.renderSlide(u);r(a)}catch(c){i(c)}})).catch((function(o){i(o)}))}))},n.prototype.load=function(t){var e=this;return l0("destroy"),HA("destroy"),new Promise((function(r,i){e.wrapper.innerHTML="";var a=e.pptx=new b3;a.load(t).then((function(){try{e.htmlRender=new M3(e.wrapper,a,{viewPort:{width:e.options.width,height:e.options.height},mode:e.options.mode}),r(a)}catch(o){i(o)}})).catch((function(o){i(o)}))}))},n.prototype.renderSingleSlide=function(t){this.removeCurrentSlide(),this.currentIndex=t,this.htmlRender.renderSlide(this.currentIndex)},n.prototype.destroy=function(){l0("destroy"),HA("destroy")},n})();function y2t(n,t){return new m2t(n,t)}const b2t=n=>{const{url:t}=n,e=yt.useRef(null),r=async()=>{if(!e.current)return;const i=y2t(e.current,{width:960,height:540}),o=await(await fetch(t)).arrayBuffer();i.preview(o)};return yt.useEffect(()=>{r()},[t]),$t.jsx("div",{ref:e})},_2t=n=>{const{data:t,i18n:e}=n,r=(a,o)=>a==="markdown"?$t.jsx(N4,{url:o}):a==="pdf"?$t.jsx(uot,{url:o,...n}):a==="docx"?$t.jsx(aut,{url:o,...n}):a==="pptx"?$t.jsx(b2t,{url:o,...n}):null;return(()=>{const{url:a}=t,o=t?.metadata?.content_type;if(!(!o||!a))return o==="image"?$t.jsx("img",{src:a,className:"w-full"}):o==="video"?$t.jsx("video",{src:a,className:"w-full",controls:!0}):$t.jsx(ng.Collapse,{size:"small",defaultActiveKey:["preview"],classNames:{root:"bg-transparent",body:"p-4!"},items:[{key:"preview",label:e?.labels?.preview??"Preview",children:r(o,a)}]})})()},w2t=n=>{const{data:t,i18n:e}=n;return $t.jsx(ng.Collapse,{size:"small",classNames:{root:"bg-transparent",body:"p-4!"},items:[{key:"ai-interpretation",label:e?.labels?.aiInterpretation??"AI Interpretation",children:$t.jsx(N4,{content:t?.metadata?.ai_insights})}]})},x2t=(n,t)=>{const e=new Array(n.length+t.length);for(let r=0;r<n.length;r++)e[r]=n[r];for(let r=0;r<t.length;r++)e[n.length+r]=t[r];return e},S2t=(n,t)=>({classGroupId:n,validator:t}),OX=(n=new Map,t=null,e)=>({nextPart:n,validators:t,classGroupId:e}),i_="-",P3=[],A2t="arbitrary..",T2t=n=>{const t=E2t(n),{conflictingClassGroups:e,conflictingClassGroupModifiers:r}=n;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return C2t(o);const s=o.split(i_),l=s[0]===""&&s.length>1?1:0;return BX(s,l,t)},getConflictingClassGroupIds:(o,s)=>{if(s){const l=r[o],u=e[o];return l?u?x2t(u,l):l:u||P3}return e[o]||P3}}},BX=(n,t,e)=>{if(n.length-t===0)return e.classGroupId;const i=n[t],a=e.nextPart.get(i);if(a){const u=BX(n,t+1,a);if(u)return u}const o=e.validators;if(o===null)return;const s=t===0?n.join(i_):n.slice(t).join(i_),l=o.length;for(let u=0;u<l;u++){const c=o[u];if(c.validator(s))return c.classGroupId}},C2t=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=n.slice(1,-1),e=t.indexOf(":"),r=t.slice(0,e);return r?A2t+r:void 0})(),E2t=n=>{const{theme:t,classGroups:e}=n;return M2t(e,t)},M2t=(n,t)=>{const e=OX();for(const r in n){const i=n[r];YP(i,e,r,t)}return e},YP=(n,t,e,r)=>{const i=n.length;for(let a=0;a<i;a++){const o=n[a];P2t(o,t,e,r)}},P2t=(n,t,e,r)=>{if(typeof n=="string"){k2t(n,t,e);return}if(typeof n=="function"){D2t(n,t,e,r);return}L2t(n,t,e,r)},k2t=(n,t,e)=>{const r=n===""?t:FX(t,n);r.classGroupId=e},D2t=(n,t,e,r)=>{if(I2t(n)){YP(n(r),t,e,r);return}t.validators===null&&(t.validators=[]),t.validators.push(S2t(e,n))},L2t=(n,t,e,r)=>{const i=Object.entries(n),a=i.length;for(let o=0;o<a;o++){const[s,l]=i[o];YP(l,FX(t,s),e,r)}},FX=(n,t)=>{let e=n;const r=t.split(i_),i=r.length;for(let a=0;a<i;a++){const o=r[a];let s=e.nextPart.get(o);s||(s=OX(),e.nextPart.set(o,s)),e=s}return e},I2t=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,R2t=n=>{if(n<1)return{get:()=>{},set:()=>{}};let t=0,e=Object.create(null),r=Object.create(null);const i=(a,o)=>{e[a]=o,t++,t>n&&(t=0,r=e,e=Object.create(null))};return{get(a){let o=e[a];if(o!==void 0)return o;if((o=r[a])!==void 0)return i(a,o),o},set(a,o){a in e?e[a]=o:i(a,o)}}},CE="!",k3=":",N2t=[],D3=(n,t,e,r,i)=>({modifiers:n,hasImportantModifier:t,baseClassName:e,maybePostfixModifierPosition:r,isExternal:i}),O2t=n=>{const{prefix:t,experimentalParseClassName:e}=n;let r=i=>{const a=[];let o=0,s=0,l=0,u;const c=i.length;for(let m=0;m<c;m++){const y=i[m];if(o===0&&s===0){if(y===k3){a.push(i.slice(l,m)),l=m+1;continue}if(y==="/"){u=m;continue}}y==="["?o++:y==="]"?o--:y==="("?s++:y===")"&&s--}const h=a.length===0?i:i.slice(l);let f=h,d=!1;h.endsWith(CE)?(f=h.slice(0,-1),d=!0):h.startsWith(CE)&&(f=h.slice(1),d=!0);const v=u&&u>l?u-l:void 0;return D3(a,d,f,v)};if(t){const i=t+k3,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):D3(N2t,!1,o,void 0,!0)}if(e){const i=r;r=a=>e({className:a,parseClassName:i})}return r},B2t=n=>{const t=new Map;return n.orderSensitiveModifiers.forEach((e,r)=>{t.set(e,1e6+r)}),e=>{const r=[];let i=[];for(let a=0;a<e.length;a++){const o=e[a],s=o[0]==="[",l=t.has(o);s||l?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},F2t=n=>({cache:R2t(n.cacheSize),parseClassName:O2t(n),sortModifiers:B2t(n),...T2t(n)}),V2t=/\s+/,z2t=(n,t)=>{const{parseClassName:e,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=n.trim().split(V2t);let l="";for(let u=s.length-1;u>=0;u-=1){const c=s[u],{isExternal:h,modifiers:f,hasImportantModifier:d,baseClassName:v,maybePostfixModifierPosition:m}=e(c);if(h){l=c+(l.length>0?" "+l:l);continue}let y=!!m,g=r(y?v.substring(0,m):v);if(!g){if(!y){l=c+(l.length>0?" "+l:l);continue}if(g=r(v),!g){l=c+(l.length>0?" "+l:l);continue}y=!1}const p=f.length===0?"":f.length===1?f[0]:a(f).join(":"),b=d?p+CE:p,w=b+g;if(o.indexOf(w)>-1)continue;o.push(w);const x=i(g,y);for(let A=0;A<x.length;++A){const T=x[A];o.push(b+T)}l=c+(l.length>0?" "+l:l)}return l},G2t=(...n)=>{let t=0,e,r,i="";for(;t<n.length;)(e=n[t++])&&(r=VX(e))&&(i&&(i+=" "),i+=r);return i},VX=n=>{if(typeof n=="string")return n;let t,e="";for(let r=0;r<n.length;r++)n[r]&&(t=VX(n[r]))&&(e&&(e+=" "),e+=t);return e},H2t=(n,...t)=>{let e,r,i,a;const o=l=>{const u=t.reduce((c,h)=>h(c),n());return e=F2t(u),r=e.cache.get,i=e.cache.set,a=s,s(l)},s=l=>{const u=r(l);if(u)return u;const c=z2t(l,e);return i(l,c),c};return a=o,(...l)=>a(G2t(...l))},U2t=[],gn=n=>{const t=e=>e[n]||U2t;return t.isThemeGetter=!0,t},zX=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,GX=/^\((?:(\w[\w-]*):)?(.+)\)$/i,W2t=/^\d+\/\d+$/,$2t=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,j2t=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,X2t=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Y2t=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,q2t=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Hh=n=>W2t.test(n),Ge=n=>!!n&&!Number.isNaN(Number(n)),bl=n=>!!n&&Number.isInteger(Number(n)),UA=n=>n.endsWith("%")&&Ge(n.slice(0,-1)),_s=n=>$2t.test(n),Z2t=()=>!0,K2t=n=>j2t.test(n)&&!X2t.test(n),HX=()=>!1,Q2t=n=>Y2t.test(n),J2t=n=>q2t.test(n),tPt=n=>!te(n)&&!ee(n),ePt=n=>hd(n,$X,HX),te=n=>zX.test(n),Gu=n=>hd(n,jX,K2t),WA=n=>hd(n,oPt,Ge),L3=n=>hd(n,UX,HX),rPt=n=>hd(n,WX,J2t),u0=n=>hd(n,XX,Q2t),ee=n=>GX.test(n),Dp=n=>fd(n,jX),nPt=n=>fd(n,sPt),I3=n=>fd(n,UX),iPt=n=>fd(n,$X),aPt=n=>fd(n,WX),c0=n=>fd(n,XX,!0),hd=(n,t,e)=>{const r=zX.exec(n);return r?r[1]?t(r[1]):e(r[2]):!1},fd=(n,t,e=!1)=>{const r=GX.exec(n);return r?r[1]?t(r[1]):e:!1},UX=n=>n==="position"||n==="percentage",WX=n=>n==="image"||n==="url",$X=n=>n==="length"||n==="size"||n==="bg-size",jX=n=>n==="length",oPt=n=>n==="number",sPt=n=>n==="family-name",XX=n=>n==="shadow",lPt=()=>{const n=gn("color"),t=gn("font"),e=gn("text"),r=gn("font-weight"),i=gn("tracking"),a=gn("leading"),o=gn("breakpoint"),s=gn("container"),l=gn("spacing"),u=gn("radius"),c=gn("shadow"),h=gn("inset-shadow"),f=gn("text-shadow"),d=gn("drop-shadow"),v=gn("blur"),m=gn("perspective"),y=gn("aspect"),g=gn("ease"),p=gn("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],x=()=>[...w(),ee,te],A=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],C=()=>[ee,te,l],E=()=>[Hh,"full","auto",...C()],k=()=>[bl,"none","subgrid",ee,te],D=()=>["auto",{span:["full",bl,ee,te]},bl,ee,te],L=()=>[bl,"auto",ee,te],R=()=>["auto","min","max","fr",ee,te],P=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],O=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...C()],z=()=>[Hh,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],G=()=>[n,ee,te],U=()=>[...w(),I3,L3,{position:[ee,te]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",iPt,ePt,{size:[ee,te]}],X=()=>[UA,Dp,Gu],Q=()=>["","none","full",u,ee,te],at=()=>["",Ge,Dp,Gu],rt=()=>["solid","dashed","dotted","double"],Rt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Mt=()=>[Ge,UA,I3,L3],xt=()=>["","none",v,ee,te],vt=()=>["none",Ge,ee,te],Et=()=>["none",Ge,ee,te],_t=()=>[Ge,ee,te],Dt=()=>[Hh,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[_s],breakpoint:[_s],color:[Z2t],container:[_s],"drop-shadow":[_s],ease:["in","out","in-out"],font:[tPt],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[_s],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[_s],shadow:[_s],spacing:["px",Ge],text:[_s],"text-shadow":[_s],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Hh,te,ee,y]}],container:["container"],columns:[{columns:[Ge,te,ee,s]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:x()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:E()}],"inset-x":[{"inset-x":E()}],"inset-y":[{"inset-y":E()}],start:[{start:E()}],end:[{end:E()}],top:[{top:E()}],right:[{right:E()}],bottom:[{bottom:E()}],left:[{left:E()}],visibility:["visible","invisible","collapse"],z:[{z:[bl,"auto",ee,te]}],basis:[{basis:[Hh,"full","auto",s,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ge,Hh,"auto","initial","none",te]}],grow:[{grow:["",Ge,ee,te]}],shrink:[{shrink:["",Ge,ee,te]}],order:[{order:[bl,"first","last","none",ee,te]}],"grid-cols":[{"grid-cols":k()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":k()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":R()}],"auto-rows":[{"auto-rows":R()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...P(),"normal"]}],"justify-items":[{"justify-items":[...O(),"normal"]}],"justify-self":[{"justify-self":["auto",...O()]}],"align-content":[{content:["normal",...P()]}],"align-items":[{items:[...O(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...O(),{baseline:["","last"]}]}],"place-content":[{"place-content":P()}],"place-items":[{"place-items":[...O(),"baseline"]}],"place-self":[{"place-self":["auto",...O()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[s,"screen",...z()]}],"min-w":[{"min-w":[s,"screen","none",...z()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[o]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",e,Dp,Gu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ee,WA]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",UA,te]}],"font-family":[{font:[nPt,te,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,ee,te]}],"line-clamp":[{"line-clamp":[Ge,"none",ee,WA]}],leading:[{leading:[a,...C()]}],"list-image":[{"list-image":["none",ee,te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ee,te]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:G()}],"text-color":[{text:G()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...rt(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ge,"from-font","auto",ee,Gu]}],"text-decoration-color":[{decoration:G()}],"underline-offset":[{"underline-offset":[Ge,"auto",ee,te]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee,te]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ee,te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},bl,ee,te],radial:["",ee,te],conic:[bl,ee,te]},aPt,rPt]}],"bg-color":[{bg:G()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:G()}],"gradient-via":[{via:G()}],"gradient-to":[{to:G()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:at()}],"border-w-x":[{"border-x":at()}],"border-w-y":[{"border-y":at()}],"border-w-s":[{"border-s":at()}],"border-w-e":[{"border-e":at()}],"border-w-t":[{"border-t":at()}],"border-w-r":[{"border-r":at()}],"border-w-b":[{"border-b":at()}],"border-w-l":[{"border-l":at()}],"divide-x":[{"divide-x":at()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":at()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...rt(),"hidden","none"]}],"divide-style":[{divide:[...rt(),"hidden","none"]}],"border-color":[{border:G()}],"border-color-x":[{"border-x":G()}],"border-color-y":[{"border-y":G()}],"border-color-s":[{"border-s":G()}],"border-color-e":[{"border-e":G()}],"border-color-t":[{"border-t":G()}],"border-color-r":[{"border-r":G()}],"border-color-b":[{"border-b":G()}],"border-color-l":[{"border-l":G()}],"divide-color":[{divide:G()}],"outline-style":[{outline:[...rt(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ge,ee,te]}],"outline-w":[{outline:["",Ge,Dp,Gu]}],"outline-color":[{outline:G()}],shadow:[{shadow:["","none",c,c0,u0]}],"shadow-color":[{shadow:G()}],"inset-shadow":[{"inset-shadow":["none",h,c0,u0]}],"inset-shadow-color":[{"inset-shadow":G()}],"ring-w":[{ring:at()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:G()}],"ring-offset-w":[{"ring-offset":[Ge,Gu]}],"ring-offset-color":[{"ring-offset":G()}],"inset-ring-w":[{"inset-ring":at()}],"inset-ring-color":[{"inset-ring":G()}],"text-shadow":[{"text-shadow":["none",f,c0,u0]}],"text-shadow-color":[{"text-shadow":G()}],opacity:[{opacity:[Ge,ee,te]}],"mix-blend":[{"mix-blend":[...Rt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Rt()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ge]}],"mask-image-linear-from-pos":[{"mask-linear-from":Mt()}],"mask-image-linear-to-pos":[{"mask-linear-to":Mt()}],"mask-image-linear-from-color":[{"mask-linear-from":G()}],"mask-image-linear-to-color":[{"mask-linear-to":G()}],"mask-image-t-from-pos":[{"mask-t-from":Mt()}],"mask-image-t-to-pos":[{"mask-t-to":Mt()}],"mask-image-t-from-color":[{"mask-t-from":G()}],"mask-image-t-to-color":[{"mask-t-to":G()}],"mask-image-r-from-pos":[{"mask-r-from":Mt()}],"mask-image-r-to-pos":[{"mask-r-to":Mt()}],"mask-image-r-from-color":[{"mask-r-from":G()}],"mask-image-r-to-color":[{"mask-r-to":G()}],"mask-image-b-from-pos":[{"mask-b-from":Mt()}],"mask-image-b-to-pos":[{"mask-b-to":Mt()}],"mask-image-b-from-color":[{"mask-b-from":G()}],"mask-image-b-to-color":[{"mask-b-to":G()}],"mask-image-l-from-pos":[{"mask-l-from":Mt()}],"mask-image-l-to-pos":[{"mask-l-to":Mt()}],"mask-image-l-from-color":[{"mask-l-from":G()}],"mask-image-l-to-color":[{"mask-l-to":G()}],"mask-image-x-from-pos":[{"mask-x-from":Mt()}],"mask-image-x-to-pos":[{"mask-x-to":Mt()}],"mask-image-x-from-color":[{"mask-x-from":G()}],"mask-image-x-to-color":[{"mask-x-to":G()}],"mask-image-y-from-pos":[{"mask-y-from":Mt()}],"mask-image-y-to-pos":[{"mask-y-to":Mt()}],"mask-image-y-from-color":[{"mask-y-from":G()}],"mask-image-y-to-color":[{"mask-y-to":G()}],"mask-image-radial":[{"mask-radial":[ee,te]}],"mask-image-radial-from-pos":[{"mask-radial-from":Mt()}],"mask-image-radial-to-pos":[{"mask-radial-to":Mt()}],"mask-image-radial-from-color":[{"mask-radial-from":G()}],"mask-image-radial-to-color":[{"mask-radial-to":G()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[Ge]}],"mask-image-conic-from-pos":[{"mask-conic-from":Mt()}],"mask-image-conic-to-pos":[{"mask-conic-to":Mt()}],"mask-image-conic-from-color":[{"mask-conic-from":G()}],"mask-image-conic-to-color":[{"mask-conic-to":G()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ee,te]}],filter:[{filter:["","none",ee,te]}],blur:[{blur:xt()}],brightness:[{brightness:[Ge,ee,te]}],contrast:[{contrast:[Ge,ee,te]}],"drop-shadow":[{"drop-shadow":["","none",d,c0,u0]}],"drop-shadow-color":[{"drop-shadow":G()}],grayscale:[{grayscale:["",Ge,ee,te]}],"hue-rotate":[{"hue-rotate":[Ge,ee,te]}],invert:[{invert:["",Ge,ee,te]}],saturate:[{saturate:[Ge,ee,te]}],sepia:[{sepia:["",Ge,ee,te]}],"backdrop-filter":[{"backdrop-filter":["","none",ee,te]}],"backdrop-blur":[{"backdrop-blur":xt()}],"backdrop-brightness":[{"backdrop-brightness":[Ge,ee,te]}],"backdrop-contrast":[{"backdrop-contrast":[Ge,ee,te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ge,ee,te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ge,ee,te]}],"backdrop-invert":[{"backdrop-invert":["",Ge,ee,te]}],"backdrop-opacity":[{"backdrop-opacity":[Ge,ee,te]}],"backdrop-saturate":[{"backdrop-saturate":[Ge,ee,te]}],"backdrop-sepia":[{"backdrop-sepia":["",Ge,ee,te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ee,te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ge,"initial",ee,te]}],ease:[{ease:["linear","initial",g,ee,te]}],delay:[{delay:[Ge,ee,te]}],animate:[{animate:["none",p,ee,te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,ee,te]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:vt()}],"rotate-x":[{"rotate-x":vt()}],"rotate-y":[{"rotate-y":vt()}],"rotate-z":[{"rotate-z":vt()}],scale:[{scale:Et()}],"scale-x":[{"scale-x":Et()}],"scale-y":[{"scale-y":Et()}],"scale-z":[{"scale-z":Et()}],"scale-3d":["scale-3d"],skew:[{skew:_t()}],"skew-x":[{"skew-x":_t()}],"skew-y":[{"skew-y":_t()}],transform:[{transform:[ee,te,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Dt()}],"translate-x":[{"translate-x":Dt()}],"translate-y":[{"translate-y":Dt()}],"translate-z":[{"translate-z":Dt()}],"translate-none":["translate-none"],accent:[{accent:G()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:G()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ee,te]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ee,te]}],fill:[{fill:["none",...G()]}],"stroke-w":[{stroke:[Ge,Dp,Gu,WA]}],stroke:[{stroke:["none",...G()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},uPt=H2t(lPt),cPt=(...n)=>uPt(Xf(n)),YX=n=>{const{icon:t,children:e,onMouseOver:r,onMouseOut:i,...a}=n,[o,s]=yt.useState(!1),l=c=>{s(!0),r?.(c)},u=c=>{s(!1),i?.(c)};return $t.jsxs(ng.Button,{...a,color:"primary",variant:"filled",shape:"round",className:"gap-0",onMouseOver:l,onMouseOut:u,children:[$t.jsx("span",{className:"inline-flex items-center children:size-4",children:t}),$t.jsx(dH.span,{className:"overflow-hidden",initial:!1,animate:{width:o?"auto":0,opacity:Number(o),paddingLeft:Number(o)*8},children:e})]})},{Text:R3}=ng.Typography,hPt=n=>{const{data:t,i18n:e,extraButtons:r,className:i,openSourceButtonProps:a,...o}=n,[s,l]=yt.useState(!1),u=[{label:e?.labels?.type??"Type",value:t?.type},{label:e?.labels?.size??"Size",value:t?.size},{label:e?.labels?.createdBy??"Created At",value:t?.created},{label:e?.labels?.createdBy??"Created By",value:t?.owner?.title},{label:e?.labels?.updatedAt??"Updated At",value:t?.updated}];return $t.jsxs("div",{className:cPt("flex flex-col h-full overflow-hidden",i),...o,children:[$t.jsxs("div",{children:[$t.jsx("img",{src:t?.icon,className:"size-6 mr-3 float-left"}),$t.jsx("div",{className:"text-4.5/6 text-primary",children:t?.title})]}),$t.jsxs("div",{className:"flex items-center justify-between my-2",children:[$t.jsxs(R3,{type:"secondary",className:"inline-flex items-center gap-0.5 text-3",children:[$t.jsx("div",{children:t?.source?.name??"-"}),$t.jsx(Ld.ChevronRight,{className:"size-3"}),$t.jsx("div",{children:t?.category??"-"}),$t.jsx(Ld.Minus,{className:"size-3 rotate-90"}),$t.jsx("div",{children:t?.owner?.title??"-"}),$t.jsx(Ld.Dot,{className:"size-3"}),$t.jsx("div",{children:t?.updated??"-"}),$t.jsx(Ld.Ellipsis,{className:"pl-2 min-w-3 size-3 hover:text-primary transition cursor-pointer",onClick:()=>{l(c=>!c)}})]}),$t.jsxs("div",{className:"inline-flex gap-2",children:[r,$t.jsx(YX,{icon:$t.jsx(Ld.SquareArrowOutUpRight,{}),onClick:()=>{window.open(t.url)},...a,children:e?.buttons?.openSource??"Open Source"})]})]}),$t.jsx(dH.div,{className:"bg-black/3 dark:bg-white/4 rounded-lg overflow-hidden",initial:!1,animate:{height:s?"auto":0,opacity:s?1:0,marginBottom:s?"1rem":0},children:$t.jsx("div",{className:"flex flex-wrap gap-row-2 p-4",children:u.map(c=>{const{label:h,value:f}=c;return $t.jsxs("div",{className:"w-1/2 inline-flex items-center <sm:w-full",children:[$t.jsx(R3,{type:"secondary",className:"w-24",children:h}),$t.jsx("span",{className:"text-3.5",children:f??"-"})]},h)})})}),$t.jsxs("div",{className:"flex flex-col gap-4 flex-1 overflow-auto",children:[$t.jsx(_2t,{...n}),$t.jsx(w2t,{...n})]})]})};exports.ActionButton=YX;exports.DocDetail=hPt;
172
+ >/= `,c=0;return G0=1,kX((function h(){for(var f=[];n[c];){if(n.charCodeAt(c)==t){if(n.charCodeAt(c+1)===i)return c=n.indexOf(">",c),f;if(n.charCodeAt(c+1)===a){if(n.charCodeAt(c+2)==r){for(;n.charCodeAt(c)!==e||n.charCodeAt(c-1)!=r||n.charCodeAt(c-2)!=r||c==-1;)c=n.indexOf(">",c+1);c===-1&&(c=n.length)}else for(c+=2;n.charCodeAt(c)!==e;c++);c++;continue}if(n.charCodeAt(c+1)===l){c=n.indexOf(">",c),c++;continue}for(var d=++c;u.indexOf(n[c])===-1;c++);for(var v=n.slice(d,c),m=!1,y={};n.charCodeAt(c)!==e;c++){var g=n.charCodeAt(c);if(g>64&&g<91||g>96&&g<123){for(d=c;u.indexOf(n[c])===-1;c++);for(var p=n.slice(d,c),b=n.charCodeAt(c);b!==o&&b!==s;)c++,b=n.charCodeAt(c);var w=n[c],x=++c;c=n.indexOf(w,x);var A=n.slice(x,c);m||(y={},m=!0),y[p]=A}}var T=[];n.charCodeAt(c-1)!==i&&(c++,T=h()),f.push({children:T,tagName:v,attrs:y})}else{var C=c;(c=n.indexOf("<",c)-1)===-2&&(c=n.length);var E=n.slice(C,c+1);E.length>0&&f.push(E)}c++}return f})())}function kX(n){var t={};if(n===void 0)return{};if(n.length===1&&typeof n[0]=="string")return n[0];for(var e in n.forEach((function(r){if(t[r.tagName]||(t[r.tagName]=[]),typeof r=="object"){var i=kX(r.children);typeof i=="object"&&(r.attrs&&(i.attrs=r.attrs),i.attrs===void 0?i.attrs={order:G0}:i.attrs.order=G0),G0++,t[r.tagName].push(i)}})),t)t[e].length==1&&(t[e]=t[e][0]);return t}function cf(n){return Math.abs(n)>2e4?"emu":"point"}function ar(n){return n/12700}function Bo(n){return n/20}function e_(n){return n/100}function uw(n){return n/6e4}function Cl(n){return n/1e5}function BA(n){var t=Math.ceil(n/26),e=(n%26||26)-1+65;return String.fromCharCode(e).repeat(t)}function Vr(n,t,e){var r={type:"solidFill"};if(n["a:srgbClr"])r.color="#"+n["a:srgbClr"].attrs.val;else if(n["a:schemeClr"]){var i=n["a:schemeClr"].attrs.val;e&&(i=e.getColorThemeName(i)),r.color=t.getColor(i)}else if(n["a:sysClr"])r.color="#"+n["a:sysClr"].attrs.lastClr;else if(n["a:prstClr"]){var a=q.get(n["a:prstClr"],["attrs","val"]);r.color=(function(f){var d,v=["white","AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenRod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","DarkOrange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","GoldenRod","Gray","Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory","Khaki","Lavender","LavenderBlush","LawnGreen","LemonChiffon","LightBlue","LightCoral","LightCyan","LightGoldenRodYellow","LightGray","LightGrey","LightGreen","LightPink","LightSalmon","LightSeaGreen","LightSkyBlue","LightSlateGray","LightSlateGrey","LightSteelBlue","LightYellow","Lime","LimeGreen","Linen","Magenta","Maroon","MediumAquaMarine","MediumBlue","MediumOrchid","MediumPurple","MediumSeaGreen","MediumSlateBlue","MediumSpringGreen","MediumTurquoise","MediumVioletRed","MidnightBlue","MintCream","MistyRose","Moccasin","NavajoWhite","Navy","OldLace","Olive","OliveDrab","Orange","OrangeRed","Orchid","PaleGoldenRod","PaleGreen","PaleTurquoise","PaleVioletRed","PapayaWhip","PeachPuff","Peru","Pink","Plum","PowderBlue","Purple","RebeccaPurple","Red","RosyBrown","RoyalBlue","SaddleBrown","Salmon","SandyBrown","SeaGreen","SeaShell","Sienna","Silver","SkyBlue","SlateBlue","SlateGray","SlateGrey","Snow","SpringGreen","SteelBlue","Tan","Teal","Thistle","Tomato","Turquoise","Violet","Wheat","White","WhiteSmoke","Yellow","YellowGreen"],m=["ffffff","f0f8ff","faebd7","00ffff","7fffd4","f0ffff","f5f5dc","ffe4c4","000000","ffebcd","0000ff","8a2be2","a52a2a","deb887","5f9ea0","7fff00","d2691e","ff7f50","6495ed","fff8dc","dc143c","00ffff","00008b","008b8b","b8860b","a9a9a9","a9a9a9","006400","bdb76b","8b008b","556b2f","ff8c00","9932cc","8b0000","e9967a","8fbc8f","483d8b","2f4f4f","2f4f4f","00ced1","9400d3","ff1493","00bfff","696969","696969","1e90ff","b22222","fffaf0","228b22","ff00ff","dcdcdc","f8f8ff","ffd700","daa520","808080","808080","008000","adff2f","f0fff0","ff69b4","cd5c5c","4b0082","fffff0","f0e68c","e6e6fa","fff0f5","7cfc00","fffacd","add8e6","f08080","e0ffff","fafad2","d3d3d3","d3d3d3","90ee90","ffb6c1","ffa07a","20b2aa","87cefa","778899","778899","b0c4de","ffffe0","00ff00","32cd32","faf0e6","ff00ff","800000","66cdaa","0000cd","ba55d3","9370db","3cb371","7b68ee","00fa9a","48d1cc","c71585","191970","f5fffa","ffe4e1","ffe4b5","ffdead","000080","fdf5e6","808000","6b8e23","ffa500","ff4500","da70d6","eee8aa","98fb98","afeeee","db7093","ffefd5","ffdab9","cd853f","ffc0cb","dda0dd","b0e0e6","800080","663399","ff0000","bc8f8f","4169e1","8b4513","fa8072","f4a460","2e8b57","fff5ee","a0522d","c0c0c0","87ceeb","6a5acd","708090","708090","fffafa","00ff7f","4682b4","d2b48c","008080","d8bfd8","ff6347","40e0d0","ee82ee","f5deb3","ffffff","f5f5f5","ffff00","9acd32"],y=v.indexOf(f);return y!=-1&&(d=m[y]),"#".concat(d||"000000")})(a)}var o=n["a:srgbClr"]||n["a:schemeClr"]||n["a:sysClr"],s=q.get(o,["a:alpha","attrs","val"],1e5);r.alpha=s/1e5;var l=q.get(o,["a:shade","attrs","val"]);l&&(r.shade=l/1e5);var u=q.get(o,["a:lumMod","attrs","val"]);u&&(r.lumMod=u/1e5);var c=q.get(o,["a:lumOff","attrs","val"]);c&&(r.lumOff=c/1e5);var h=q.get(o,["a:tint","attrs","val"]);return h&&(r.tint=h/1e5),r}function zg(n,t,e){var r,i={type:"blipFill"},a=q.get(n,["a:blip","attrs","r:embed"]);if(a){var o=(r=e.rels[a])===null||r===void 0?void 0:r.target;o&&(i.base64=t.getMedia(o))}var s=q.get(n,["a:blip","a:alphaModFix","attrs","amt"]);s&&(i.alpha=s/1e5);var l=q.get(n,["a:stretch","a:fillRect","attrs"]);return l&&(i.fillRect={},l.b&&(i.fillRect.b=l.b/1e5),l.t&&(i.fillRect.t=l.t/1e5),l.r&&(i.fillRect.r=l.r/1e5),l.l&&(i.fillRect.l=l.l/1e5)),i}function Gg(n,t,e){var r={type:"gradFill",tileRect:{},lin:{},gsList:[]};r.flip=n.attrs.flip,r.path=q.get(n,["a:path","attrs","path"])||"linear",r.rotWithShape=n.attrs.rotWithShape==="1",q.get(n,["a:lin","attrs","ang"])&&(r.lin.ang=uw(n["a:lin"].attrs.ang)),q.get(n,["a:lin","attrs","scaled"])&&(r.lin.scaled=n["a:lin"].attrs.scaled==="1");var i=q.get(n,["a:gsLst","a:gs"])||[];return r.gsList=i.map((function(a){return{color:Vr(a,t,e),pos:Cl(a.attrs.pos)}})),q.get(n,["a:tileRect","attrs","l"])&&(r.tileRect.l=Cl(n["a:tileRect"].attrs.l)),q.get(n,["a:tileRect","attrs","t"])&&(r.tileRect.t=Cl(n["a:tileRect"].attrs.t)),q.get(n,["a:tileRect","attrs","r"])&&(r.tileRect.r=Cl(n["a:tileRect"].attrs.r)),q.get(n,["a:tileRect","attrs","b"])&&(r.tileRect.b=Cl(n["a:tileRect"].attrs.b)),r}function FA(n){return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function VA(n){return n<.0031308?12.92*n:1.055*Math.pow(n,1/2.4)-.055}function g3(n,t){var e=n[0],r=n[1],i=n[2],a=FA(e/255)*t,o=FA(r/255)*t,s=FA(i/255)*t;return[Math.round(255*VA(a)),Math.round(255*VA(o)),Math.round(255*VA(s))]}function zA(n,t,e){var r=n/255,i=t/255,a=e/255,o=Math.max(r,i,a),s=Math.min(r,i,a),l=o-s,u=0,c=(o+s)/2;return l===0?u=0:o===r?u=(i-a)/l%6:o===i?u=(a-r)/l+2:o===a&&(u=(r-i)/l+4),(u=Math.round(60*u))<0&&(u+=360),{h:u,s:l===0||c===0||c===1?0:l/(1-Math.abs(2*c-1)),l:c}}function GA(n,t,e){var r,i,a,o=(1-Math.abs(2*e-1))*t,s=o*(1-Math.abs(n/60%2-1)),l=e-o/2;return n<60?(r=o,i=s,a=0):n<120?(r=s,i=o,a=0):n<180?(r=0,i=o,a=s):n<240?(r=0,i=s,a=o):n<300?(r=s,i=0,a=o):(r=o,i=0,a=s),[r=Math.round(255*(r+l)),i=Math.round(255*(i+l)),a=Math.round(255*(a+l))]}function Ke(n,t){if(!n||n.type==="none")return"";if(n.type==="solidFill"&&/^#[\da-fA-F]{3,6}$/.test(n.color)){var e=parseInt(n.color.substr(1,2),16),r=parseInt(n.color.substr(3,2),16),i=parseInt(n.color.substr(5,2),16);if(n.shade){var a=g3([e,r,i],n.shade);e=a[0],r=a[1],i=a[2]}if(n.lumMod){var o=(function(c,h,f,d){var v=zA(c,h,f),m=v.h,y=v.l*d;return y>=1&&(y=1),GA(m,v.s,y)})(e,r,i,n.lumMod);e=o[0],r=o[1],i=o[2]}if(n.lumOff&&(o=(function(c,h,f,d){var v=zA(c,h,f),m=v.h,y=d+v.l;return y>1&&(y=1),GA(m,v.s,y)})(e,r,i,n.lumOff),e=o[0],r=o[1],i=o[2]),n.tint||t?.light){var s=(function(c,h,f,d){var v=zA(c,h,f),m=v.h,y=v.l;return d>=1&&(d=1),GA(m,v.s,y*d+(1-d))})(e,r,i,n.tint||t?.light);e=s[0],r=s[1],i=s[2]}if(t?.dark){var l=g3([e,r,i],t?.dark);e=l[0],r=l[1],i=l[2]}var u=n.alpha;return"rgba(".concat(e,",").concat(r,",").concat(i,",").concat(u,")")}}var Hg=(function(){function n(t,e,r){var i,a;this.uuid=fut(),this.offset={x:0,y:0},this.extend={w:0,h:0},this.rotate=0,this.order=0,this.flipV=!1,this.flipH=!1,this.source=t,this.ctx=e,this.group=r;var o=q.get(t,["p:nvSpPr","p:nvPr"]);if(o){var s=q.get(o,"p:ph");s&&s.attrs&&(this.idx=s.attrs.idx,this.type=s.attrs.type),q.get(o,["attrs","userDrawn"])&&(this.userDrawn=q.get(o,["attrs","userDrawn"])==="1")}if(this.order=q.get(t,"attrs.order",0),this.source["p:spPr"]){if(u=this.getXfrm()){var l=this.group&&(!((i=this.ctx.pptx)===null||i===void 0)&&i.wps||cf(parseInt(u["a:off"].attrs.x))==="point")?Bo:ar;this.offset={x:Math.round(l(parseInt(u["a:off"].attrs.x))),y:Math.round(l(parseInt(u["a:off"].attrs.y)))},this.extend={w:Math.round(l(parseInt(u["a:ext"].attrs.cx))),h:Math.round(l(parseInt(u["a:ext"].attrs.cy||"0")))},this.rotate=uw(parseInt(q.get(u,"attrs.rot",0))),this.flipV=q.get(u,"attrs.flipV")==="1",this.flipH=q.get(u,"attrs.flipH")==="1"}}else if(this.source["p:xfrm"]){var u=this.source["p:xfrm"];l=this.group&&(!((a=this.ctx.pptx)===null||a===void 0)&&a.wps||cf(parseInt(u["a:off"].attrs.x))==="point")?Bo:ar,this.offset={x:Math.round(l(parseInt(u["a:off"].attrs.x))),y:Math.round(l(parseInt(u["a:off"].attrs.y)))},this.extend={w:Math.round(l(parseInt(u["a:ext"].attrs.cx))),h:Math.round(l(parseInt(u["a:ext"].attrs.cy)))}}if(r){var c=r.extend,h=r.chExtend,f=r.chOffset,d=h.w===0?0:c.w/h.w,v=h.h===0?0:c.h/h.h;this.extend.w=this.extend.w*d,this.extend.h=this.extend.h*v,this.offset.x=(this.offset.x-f.x)*d,this.offset.y=(this.offset.y-f.y)*v}}return Object.defineProperty(n.prototype,"theme",{get:function(){return(this.ctx.sliderMaster||this.ctx).theme},enumerable:!1,configurable:!0}),n.prototype.getColorThemeName=function(t){return this.ctx.getColorThemeName(t)},n.prototype.getXfrm=function(){var t=this.source["p:spPr"]["a:xfrm"];return t||(this.idx?t=this.ctx.getNodeInheritAttrsByIdx(this.idx,["p:spPr","a:xfrm"]):this.type&&(t=this.ctx.getNodeInheritAttrsByType(this.type,["p:spPr","a:xfrm"]))),t},n})(),c2t=(function(){function n(t,e){this.props={},this.inheritProps={},this.source=t,this.node=e,this._getInheritBodyProps(),this._parseBodyProps(),this._parseLstStyle(),this._parseText()}return n.prototype._getInheritBodyProps=function(){var t,e=this.node.ctx,r=this.node.type,i=this.node.idx;if(r||i)switch(e.slideType){case"slideMaster":break;case"slideLayout":(t=r?e.slideMaster.getNodeByType(r):e.slideMaster.getNodeByIdx(i))&&(this.inheritProps=q.get(t,["textBody","props"])||{});break;case"slide":(t=r?e.slideLayout.slideMaster.getNodeByType(r):e.slideLayout.slideMaster.getNodeByIdx(i))&&Object.assign(this.inheritProps,q.get(t,["textBody","props"])||{}),(t=r?e.slideLayout.getNodeByType(r):e.slideLayout.getNodeByIdx(i))&&Object.assign(this.inheritProps,q.get(t,["textBody","props"])||{})}},n.prototype._parseBodyProps=function(){var t=this,e=q.get(this.source,["a:bodyPr","attrs"])||{};Object.keys(e).forEach((function(o){switch(o){case"anchor":t.props.anchor=e[o];break;case"rtlCol":t.props.rtlCol=e[o]==="1";break;case"lIns":case"rIns":case"tIns":case"bIns":t.props[o]=ar(parseInt(e[o]));break;case"order":break;default:t.props[o]=e[o]}}));var r=q.get(this.source,["a:bodyPr","a:normAutofit","attrs"]);if(r){this.props.normAutofit={};var i=r.fontScale;i&&(this.props.normAutofit.fontScale=Cl(parseInt(i)));var a=r.lnSpcReduction;a&&(this.props.normAutofit.lnSpcReduction=Cl(parseInt(a)))}},n.prototype._parseLstStyle=function(){var t=this,e={},r=q.get(this.source,"a:lstStyle")||{};Object.keys(r).forEach((function(i){if(i.startsWith("a:")&&i.endsWith("pPr")){var a=i.substr(2,i.length-5);e[a]={props:t._formatPPr(r[i])};var o=q.get(r[i],["a:defRPr"]);e[a].defRPr=t._formatRPr(o)}})),this.lstStyle=e},n.prototype._parseText=function(){var t=this,e=q.get(this.source,["a:p"])||[];Array.isArray(e)||(e=[e]),this.paragraphs=e.map((function(r){return t._parseParagraph(r)}))},n.prototype._parseParagraph=function(t){var e=this,r={props:{},inheritProps:{},inheritRProps:{},endParaRProps:{},rows:[]},i=q.get(t,["a:pPr"])||{};r.props=this._formatPPr(i);var a=q.get(t,["a:endParaRPr"]);r.endParaRProps=this._formatRPr(a);var o=q.get(t,["a:r"])||[];Array.isArray(o)||(o=[o]);var s=q.get(t,["a:br"])||[];return Array.isArray(s)||(s=[s]),(o=o.concat(s.map((function(l){return Vt({isBr:!0},l)})))).sort((function(l,u){return q.get(l,["attrs","order"])-q.get(u,["attrs","order"])})),r.rows=o.map((function(l){return e._parseRow(l)})),r.inheritProps=this._getInheritPProps(r.props.level),r.inheritRProps=this._getInheritRProps(r.props.level),r},n.prototype._getInheritPProps=function(t){t===void 0&&(t="0");var e,r={},i=this.node.ctx,a=this.node.type,o=this.node.idx;switch(i.slideType){case"slideMaster":this.node.isTextBox?Object.assign(r,q.get(i.defaultTextStyle,["lvl".concat(t?+t+1:1),"props"])||{}):Object.assign(r,q.get(i,["textStyles","otherStyle","lvl".concat(t?+t+1:1),"props"])||{});break;case"slideLayout":this.node.isTextBox?Object.assign(r,q.get(i.slideMaster.defaultTextStyle,["lvl".concat(t?+t+1:1),"props"])||{}):Object.assign(r,q.get(i.slideMaster,["textStyles","otherStyle","lvl".concat(t?+t+1:1),"props"])||{}),(a||o)&&(e=a?i.slideMaster.getNodeByType(a):i.slideMaster.getNodeByIdx(o))&&Object.assign(r,q.get(e,["textBody","lstStyle","lvl".concat(t?+t+1:1),"props"])||{});break;case"slide":this.node.isTextBox?Object.assign(r,q.get(i.slideLayout.slideMaster.defaultTextStyle,["lvl".concat(t?+t+1:1),"props"])||{}):Object.assign(r,q.get(i.slideLayout.slideMaster,["textStyles","otherStyle","lvl".concat(t?+t+1:1),"props"])||{}),(a||o)&&(["subTitle","ctrTitle","title"].includes(a)&&Object.assign(r,q.get(i.slideLayout.slideMaster,["textStyles","titleStyle","lvl".concat(t?+t+1:1),"props"])||{}),(e=a?i.slideLayout.slideMaster.getNodeByType(a):i.slideLayout.slideMaster.getNodeByIdx(o))&&Object.assign(r,q.get(e,["textBody","lstStyle","lvl".concat(t?+t+1:1),"props"])||{}),(e=a?i.slideLayout.getNodeByType(a):i.slideLayout.getNodeByIdx(o))&&Object.assign(r,q.get(e,["textBody","lstStyle","lvl".concat(t?+t+1:1),"props"])||{}))}return r},n.prototype._getInheritRProps=function(t){t===void 0&&(t="0");var e,r={},i=this.node.ctx,a=this.node.type,o=this.node.idx;switch(i.slideType){case"slideMaster":this.node.isTextBox?Object.assign(r,q.get(i.defaultTextStyle,["lvl".concat(t?+t+1:1),"defRPr"])||{}):Object.assign(r,q.get(i,["textStyles","otherStyle","lvl".concat(t?+t+1:1),"defRPr"])||{});break;case"slideLayout":this.node.isTextBox?Object.assign(r,q.get(i.slideMaster.defaultTextStyle,["lvl".concat(t?+t+1:1),"defRPr"])||{}):Object.assign(r,q.get(i.slideMaster,["textStyles","otherStyle","lvl".concat(t?+t+1:1),"defRPr"])||{}),(a||o)&&(e=a?i.slideMaster.getNodeByType(a):i.slideMaster.getNodeByIdx(o))&&(r=q.get(e,["textBody","lstStyle","lvl".concat(t?+t+1:1),"defRPr"])||{});break;case"slide":this.node.isTextBox?Object.assign(r,q.get(i.slideLayout.slideMaster.defaultTextStyle,["lvl".concat(t?+t+1:1),"defRPr"])||{}):Object.assign(r,q.get(i.slideLayout.slideMaster,["textStyles","otherStyle","lvl".concat(t?+t+1:1),"defRPr"])||{}),(a||o)&&(["subTitle","ctrTitle","title"].includes(a)&&Object.assign(r,q.get(i.slideLayout.slideMaster,["textStyles","titleStyle","lvl".concat(t?+t+1:1),"defRPr"])||{}),(e=a?i.slideLayout.slideMaster.getNodeByType(a):i.slideLayout.slideMaster.getNodeByIdx(o))&&Object.assign(r,q.get(e,["textBody","lstStyle","lvl".concat(t?+t+1:1),"defRPr"])||{}),(e=a?i.slideLayout.getNodeByType(a):i.slideLayout.getNodeByIdx(o))&&Object.assign(r,q.get(e,["textBody","lstStyle","lvl".concat(t?+t+1:1),"defRPr"])||{}))}var s=q.get(this.node.source,["p:style","a:fontRef"]);return q.get(s,"a:schemeClr")&&(r.color=Vr(s,this.node.theme,this.node)),q.get(this.lstStyle,["lvl".concat(t?+t+1:1),"defRPr"])&&Object.assign(r,q.get(this.lstStyle,["lvl".concat(t?+t+1:1),"defRPr"])),r},n.prototype._formatPPr=function(t){var e={},r=q.get(t,"attrs")||{};return Object.keys(r).forEach((function(i){switch(i){case"algn":e.align=r[i];break;case"marL":e.marginLeft=ar(parseInt(r[i]));break;case"indent":e.indent=ar(parseInt(r[i]));break;case"lvl":e.level=r[i]}})),q.get(t,["a:lnSpc","a:spcPct","attrs","val"])&&(e.lineHeight=parseInt(t["a:lnSpc"]["a:spcPct"].attrs.val)/1e5),q.get(t,["a:buAutoNum","attrs","type"])&&(e.buAutoNum=t["a:buAutoNum"].attrs.type),q.get(t,["a:buChar","attrs","char"])&&(e.buChar=t["a:buChar"].attrs.char),q.get(t,["a:spcBef","a:spcPts","attrs","val"])&&(e.spaceBefore=e_(parseInt(t["a:spcBef"]["a:spcPts"].attrs.val))),q.get(t,["a:spcAft","a:spcPts","attrs","val"])&&(e.spaceAfter=e_(parseInt(t["a:spcAft"]["a:spcPts"].attrs.val))),q.get(t,["a:defRPr"])&&(e.defRPr=this._formatRPr(q.get(t,["a:defRPr"]))),e},n.prototype._parseRow=function(t){if(t.isBr)return{isBr:!0};var e={props:{},text:""},r=q.get(t,["a:rPr"])||{};return e.props=this._formatRPr(r),e.text=q.get(t,"a:t")||"",e},n.prototype._formatRPr=function(t){var e={},r=q.get(t,"attrs")||{};Object.keys(r).forEach((function(o){switch(o){case"sz":e.size=parseInt(r[o])/100;break;case"b":e.bold=r[o]==="1";break;case"i":e.italic=r[o]==="1";break;case"u":e.underline=r[o];break;case"strike":e.strike=r[o];break;case"order":case"dirty":break;default:e[o]=r[o]}}));var i=q.get(t,"a:solidFill");i&&(e.color=Vr(i,this.node.theme,this.node));var a=q.get(t,"a:highlight");return a&&(e.background=Vr(a,this.node.theme,this.node)),e.typeface=q.get(t,["a:ea","attrs","typeface"]),e},n})();function hf(n,t,e){var r={};if(!q.get(n,"a:noFill")){q.get(n,"attrs.w")&&(r.width=ar(parseInt(q.get(n,"attrs.w"))));var i=q.get(n,"a:solidFill");i&&(r.color=Vr(i,t,e));var a=q.get(n,"a:prstDash");if(a&&(r.type=a.attrs.val),q.get(n,["a:miter"])&&(r.lineJoin="miter"),q.get(n,["a:bevel"])&&(r.lineJoin="bevel"),q.get(n,["a:round"])&&(r.lineJoin="round"),q.get(n,["a:miter","attrs","lim"])&&(r.miterLim=ar(parseInt(q.get(n,["a:miter","attrs","lim"])))),q.get(n,["a:headEnd"])){var o=q.get(n,["a:headEnd","attrs"]);r.headEnd={type:o.type,len:o.len,w:o.w}}if(q.get(n,["a:tailEnd"])){var s=q.get(n,["a:tailEnd","attrs"]);r.tailEnd={type:s.type,len:s.len,w:s.w}}return r}}var rg=(function(n){function t(e,r,i,a){var o=n.call(this,e,i,a)||this;return o.border={},o.prstGeom={},o.isTextBox=!1,o.pptx=r,o._parseShape(),o._parIsTextBox(),o._parsePrstGeom(),o._parseBackground(),o._parseBorder(),o._parseTxt(),o}return yg(t,n),t.prototype._parseShape=function(){if(this.shape=q.get(this.source,["p:spPr","a:prstGeom","attrs","prst"]),!this.shape&&q.get(this.source,["p:spPr","a:custGeom"])){this.shape="customGeom";var e=q.get(this.source,["p:spPr","a:custGeom","a:pathLst","a:path"]),r=[],i=[],a=function(s){switch(s){case"a:moveTo":case"a:cubicBezTo":case"a:lnTo":i=Array.isArray(e[s])?e[s]:[e[s]],r=r.concat(i.map((function(l){return{order:l.attrs.order,type:s.split(":")[1],points:(Array.isArray(l["a:pt"])?l["a:pt"]:[l["a:pt"]]).map((function(u){return[ar(parseInt(q.get(u,["attrs","x"]))),ar(parseInt(q.get(u,["attrs","y"])))]}))}})));break;case"a:close":i=Array.isArray(e[s])?e[s]:[e[s]],r=r.concat(i.map((function(l){return{order:l.attrs.order,type:s.split(":")[1]}})))}};for(var o in e)a(o);r.sort((function(s,l){return s.order-l.order})),this.prstGeom.pathList=r,q.get(e,["attrs","w"])&&(this.prstGeom.w=ar(parseInt(q.get(e,["attrs","w"])))),q.get(e,["attrs","h"])&&(this.prstGeom.h=ar(parseInt(q.get(e,["attrs","h"]))))}},t.prototype._parIsTextBox=function(){this.isTextBox=q.get(this.source,["p:nvSpPr","p:cNvSpPr","attrs","txBox"])==="1"},t.prototype._parsePrstGeom=function(){var e=this,r=q.get(this.source,["p:spPr","a:prstGeom"]),i=q.get(r,["a:avLst","a:gd"]);i&&(Array.isArray(i)||(i=[i]),this.prstGeom.gd=i.map((function(a){var o=["pie","chord","arc"].includes(e.shape)||["blockArc"].includes(e.shape)&&["adj1","adj2"].includes(a.attrs.name)?uw(parseInt(a.attrs.fmla.split(" ")[1])):Cl(parseInt(a.attrs.fmla.split(" ")[1]));return{name:a.attrs.name,fmla:o}})))},t.prototype._parseBackground=function(){if(!q.get(this.source,["p:spPr","a:noFill"]))if(q.get(this.source,["p:spPr","a:grpFill"])&&this.group)this.background=this.group.getBackground();else{var e=q.get(this.source,["p:spPr","a:solidFill"]);if(e)this.background=Vr(e,this.theme,this);else{var r=q.get(this.source,["p:spPr","a:gradFill"]);if(r)this.background=Gg(r,this.theme,this);else{var i=q.get(this.source,["p:spPr","a:blipFill"]);if(i)this.background=zg(i,this.pptx,this.ctx);else{var a=q.get(this.source,["p:style","a:fillRef"]);a&&(this.background=Vr(a,this.theme,this))}}}}},t.prototype._parseBorder=function(){var e=q.get(this.source,["p:style","a:lnRef"]);if(e){var r=parseInt(e.attrs.idx),i=this.theme.getLineStyle(r);this.border=Vt(Vt({},i),this.border),this.border.color&&this.border.color.color||(this.border.color=Vr(e,this.theme,this))}var a=q.get(this.source,["p:spPr","a:ln"]);a&&Object.assign(this.border,hf(a,this.theme,this)),this.border.color&&this.border.color.color&&!this.border.width&&(this.border.width=t.defaultBorderWidth)},t.prototype._parseTxt=function(){this.textBody=new c2t(q.get(this.source,["p:txBody"]),this)},t.defaultBorderWidth=.75,t})(Hg),r_=(function(n){function t(e,r,i,a,o){var s,l,u=n.call(this,r,a,o)||this;u.userDrawn=!0,u.pptx=i,u.path=e;var c=q.get(u.source,["p:blipFill","a:srcRect"]);c&&(u.clip={},c.attrs.b&&(u.clip.b=parseInt(c.attrs.b)/1e5),c.attrs.t&&(u.clip.t=parseInt(c.attrs.t)/1e5),c.attrs.l&&(u.clip.l=parseInt(c.attrs.l)/1e5),c.attrs.r&&(u.clip.r=parseInt(c.attrs.r)/1e5));var h=q.get(r,["p:nvPicPr","p:nvPr","a:audioFile","attrs","r:link"]);if(h){var f=(s=u.ctx.rels[h])===null||s===void 0?void 0:s.target;u.audioFile=u.pptx.getMedia(f)}var d=q.get(r,["p:nvPicPr","p:nvPr","a:videoFile","attrs","r:link"]);if(d){var v=(l=u.ctx.rels[d])===null||l===void 0?void 0:l.target;u.videoFile=u.pptx.getMedia(v)}return u}return yg(t,n),Object.defineProperty(t.prototype,"base64",{get:function(){return this.pptx.getMedia(this.path)},enumerable:!1,configurable:!0}),t})(Hg),DX=(function(n){function t(e,r,i,a){var o=n.call(this,e,i,a)||this;return o.userDrawn=!0,o.props={tableStyleId:""},o.tableGrid={gridCol:[]},o.tr=[],o.tableStyles={},o.pptx=r,o._parseTableProps(),o._parseTableGrid(),o._parseTr(),o._parseInheritStyles(),o}return yg(t,n),Object.defineProperty(t.prototype,"slideMaster",{get:function(){return this.ctx.slideMaster||this.ctx},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"theme",{get:function(){return this.slideMaster.theme},enumerable:!1,configurable:!0}),t.prototype._parseTableProps=function(){var e=q.get(this.source,["a:graphic","a:graphicData","a:tbl","a:tblPr"]);this.props.tableStyleId=q.get(e,"a:tableStyleId"),this.tableStyles=q.get(this.slideMaster.tableStyles,this.props.tableStyleId)||{},q.get(e,["attrs","bandCol"])==="1"&&(this.props.bandCol=!0),q.get(e,["attrs","bandRow"])==="1"&&(this.props.bandRow=!0),q.get(e,["attrs","firstCol"])==="1"&&(this.props.firstCol=!0),q.get(e,["attrs","firstRow"])==="1"&&(this.props.firstRow=!0),q.get(e,["attrs","lastCol"])==="1"&&(this.props.lastCol=!0),q.get(e,["attrs","lastRow"])==="1"&&(this.props.lastRow=!0)},t.prototype._parseTableGrid=function(){var e=q.get(this.source,["a:graphic","a:graphicData","a:tbl","a:tblGrid","a:gridCol"]);if(e)for(var r=0;r<e.length;r++){var i=q.get(e[r],["attrs","w"]);this.tableGrid.gridCol.push({width:ar(parseInt(i))})}},t.prototype._parseTr=function(){var e=[],r=q.get(this.source,["a:graphic","a:graphicData","a:tbl","a:tr"]);Array.isArray(r)||(r=[r]);for(var i=0;i<r.length;i++){var a={props:{},td:[]},o=r[i];a.props.height=ar(parseInt(q.get(o,["attrs","h"])));var s=q.get(o,["a:tc"]);Array.isArray(s)||(s=[s]);for(var l=0;l<s.length;l++)a.td.push(this._parseTd(s[l]));e.push(a)}this.tr=e},t.prototype._parseTd=function(e){var r,i,a,o,s=this,l={props:{border:{}},paragraphs:[]},u=q.get(e,["a:tcPr","attrs"]);u?.marB&&(l.props.marB=ar(parseInt(u?.marB))),u?.marT&&(l.props.marT=ar(parseInt(u?.marT))),u?.marL&&(l.props.marL=ar(parseInt(u?.marL))),u?.marR&&(l.props.marR=ar(parseInt(u?.marR))),u?.anchor&&(l.props.anchor=u?.anchor);var c=q.get(e,["a:tcPr"]);q.get(c,["a:lnR"])&&(l.props.border.right=hf(q.get(c,["a:lnR"]),this.theme,this.ctx)),q.get(c,["a:lnL"])&&(l.props.border.left=hf(q.get(c,["a:lnL"]),this.theme,this.ctx)),q.get(c,["a:lnT"])&&(l.props.border.top=hf(q.get(c,["a:lnT"]),this.theme,this.ctx)),q.get(c,["a:lnB"])&&(l.props.border.bottom=hf(q.get(c,["a:lnB"]),this.theme,this.ctx)),!((r=e?.attrs)===null||r===void 0)&&r.rowSpan&&(l.props.rowSpan=parseInt(e.attrs.rowSpan)),!((i=e?.attrs)===null||i===void 0)&&i.gridSpan&&(l.props.gridSpan=parseInt(e.attrs.gridSpan)),!((a=e?.attrs)===null||a===void 0)&&a.vMerge&&(l.props.vMerge=e.attrs.vMerge==="1"),!((o=e?.attrs)===null||o===void 0)&&o.hMerge&&(l.props.hMerge=e.attrs.hMerge==="1");var h=q.get(e,["a:tcPr","a:solidFill"]);h&&(l.props.background=Vr(h,this.theme,this.ctx));var f=q.get(e,["a:txBody"]),d=q.get(f,["a:p"]);return Array.isArray(d)||(d=[d]),l.paragraphs=d.map((function(v){return s._parseParagraph(v)})),l},t.prototype._parseParagraph=function(e){var r=this,i={props:{},inheritProps:{},inheritRProps:{},endParaRProps:{},rows:[]},a=q.get(e,["a:pPr"])||{};i.props=this._formatPPr(a);var o=q.get(e,["a:endParaRPr"]);i.endParaRProps=this._formatRPr(o);var s=q.get(e,["a:r"])||[];Array.isArray(s)||(s=[s]);var l=q.get(e,["a:br"])||[];return Array.isArray(l)||(l=[l]),(s=s.concat(l.map((function(u){return Vt({isBr:!0},u)})))).sort((function(u,c){return q.get(u,["attrs","order"])-q.get(c,["attrs","order"])})),i.rows=s.map((function(u){return r._parseRow(u)})),i},t.prototype._parseRow=function(e){if(e.isBr)return{isBr:!0};var r={props:{},text:""},i=q.get(e,["a:rPr"])||{};return r.props=this._formatRPr(i),r.text=q.get(e,"a:t")||"",r},t.prototype._formatPPr=function(e){var r={},i=q.get(e,"attrs")||{};return Object.keys(i).forEach((function(a){a==="algn"&&(r.align=i[a])})),q.get(e,["a:lnSpc","a:spcPct","attrs","val"])&&(r.lineHeight=parseInt(e["a:lnSpc"]["a:spcPct"].attrs.val)/1e5),q.get(e,["a:buAutoNum","attrs","type"])&&(r.buAutoNum=e["a:buAutoNum"].attrs.type),q.get(e,["a:buChar","attrs","char"])&&(r.buChar=e["a:buChar"].attrs.char),q.get(e,["a:spcBef","a:spcPts","attrs","val"])&&(r.spaceBefore=e_(parseInt(e["a:spcBef"]["a:spcPts"].attrs.val))),q.get(e,["a:spcAft","a:spcPts","attrs","val"])&&(r.spaceAfter=e_(parseInt(e["a:spcAft"]["a:spcPts"].attrs.val))),r},t.prototype._formatRPr=function(e){var r={},i=q.get(e,"attrs")||{};Object.keys(i).forEach((function(s){switch(s){case"sz":r.size=parseInt(i[s])/100;break;case"b":r.bold=i[s]==="1";break;case"i":r.italic=i[s]==="1";break;case"u":r.underline=i[s];break;case"strike":r.strike=i[s];break;case"order":case"dirty":break;default:r[s]=i[s]}}));var a=q.get(e,"a:solidFill");a&&(r.color=Vr(a,this.theme,this.ctx));var o=q.get(e,"a:highlight");return o&&(r.background=Vr(o,this.theme,this.ctx)),r.typeface=q.get(e,["a:ea","attrs","typeface"]),r},t.prototype._isLastCol=function(e,r){var i,a;if(r===e.length-1)return!0;for(var o=r+1;o<e.length;o++)if(!(!((i=e[o].props)===null||i===void 0)&&i.hMerge)&&!(!((a=e[o].props)===null||a===void 0)&&a.vMerge))return!1;return!0},t.prototype._isBandRow=function(e){var r;return!((r=this.props)===null||r===void 0)&&r.firstRow?e%2==1:e%2==0},t.prototype._isBandCol=function(e){var r;return!((r=this.props)===null||r===void 0)&&r.firstCol?e%2==1:e%2==0},t.prototype._parseInheritStyles=function(){var e,r,i,a,o,s,l,u,c=this,h=(r=(e=this.tableStyles)===null||e===void 0?void 0:e.wholeTbl)===null||r===void 0?void 0:r.tcStyle,f=(a=(i=this.tableStyles)===null||i===void 0?void 0:i.wholeTbl)===null||a===void 0?void 0:a.tcTxStyle,d=(s=(o=this.slideMaster.defaultTextStyle)===null||o===void 0?void 0:o.lvl1)===null||s===void 0?void 0:s.props,v=(u=(l=this.slideMaster.defaultTextStyle)===null||l===void 0?void 0:l.lvl1)===null||u===void 0?void 0:u.defRPr;this.tr.forEach((function(m,y){m.td.forEach((function(g,p){var b,w,x,A,T,C,E,k,D,L,R,P,O,F,z,G,U,K,W,X,Q,at,rt,Rt,Mt,xt,vt,Et,_t,Dt,zt,N,lt,ot,Y,j,tt,bt,mt,ct,Pt,Ht,Lt,qt,we,ce,rr,$r,jr,Cn,er,Gr,En,Xr,Mi,as,De=Vt(Vt({},d),h),xr=Vt(Vt({},v),f);c.props.firstRow&&y===0?(De=Vt(Vt(Vt({},De),(w=(b=c.tableStyles)===null||b===void 0?void 0:b.firstRow)===null||w===void 0?void 0:w.tcStyle),{border:Vt(Vt({},De?.border),(T=(A=(x=c.tableStyles)===null||x===void 0?void 0:x.firstRow)===null||A===void 0?void 0:A.tcStyle)===null||T===void 0?void 0:T.border)}),xr=Vt(Vt({},xr),(E=(C=c.tableStyles)===null||C===void 0?void 0:C.firstRow)===null||E===void 0?void 0:E.tcTxStyle)):c.props.lastRow&&y===c.tr.length-1?(De=Vt(Vt(Vt({},De),(D=(k=c.tableStyles)===null||k===void 0?void 0:k.lastRow)===null||D===void 0?void 0:D.tcStyle),{border:Vt(Vt({},De?.border),(P=(R=(L=c.tableStyles)===null||L===void 0?void 0:L.lastRow)===null||R===void 0?void 0:R.tcStyle)===null||P===void 0?void 0:P.border)}),xr=Vt(Vt({},xr),(F=(O=c.tableStyles)===null||O===void 0?void 0:O.lastRow)===null||F===void 0?void 0:F.tcTxStyle)):c.props.firstCol&&p===0?(De=Vt(Vt(Vt({},De),(G=(z=c.tableStyles)===null||z===void 0?void 0:z.firstCol)===null||G===void 0?void 0:G.tcStyle),{border:Vt(Vt({},De?.border),(W=(K=(U=c.tableStyles)===null||U===void 0?void 0:U.firstCol)===null||K===void 0?void 0:K.tcStyle)===null||W===void 0?void 0:W.border)}),xr=Vt(Vt({},xr),(Q=(X=c.tableStyles)===null||X===void 0?void 0:X.firstCol)===null||Q===void 0?void 0:Q.tcTxStyle)):c.props.lastCol&&c._isLastCol(m.td,p)?(De=Vt(Vt(Vt({},De),(rt=(at=c.tableStyles)===null||at===void 0?void 0:at.lastCol)===null||rt===void 0?void 0:rt.tcStyle),{border:Vt(Vt({},De?.border),(xt=(Mt=(Rt=c.tableStyles)===null||Rt===void 0?void 0:Rt.lastCol)===null||Mt===void 0?void 0:Mt.tcStyle)===null||xt===void 0?void 0:xt.border)}),xr=Vt(Vt({},xr),(Et=(vt=c.tableStyles)===null||vt===void 0?void 0:vt.lastCol)===null||Et===void 0?void 0:Et.tcTxStyle)):(c.props.bandRow&&(c._isBandRow(y)?(De=Vt(Vt(Vt({},De),(Dt=(_t=c.tableStyles)===null||_t===void 0?void 0:_t.band1H)===null||Dt===void 0?void 0:Dt.tcStyle),{border:Vt(Vt({},De?.border),(lt=(N=(zt=c.tableStyles)===null||zt===void 0?void 0:zt.band1H)===null||N===void 0?void 0:N.tcStyle)===null||lt===void 0?void 0:lt.border)}),xr=Vt(Vt({},xr),(Y=(ot=c.tableStyles)===null||ot===void 0?void 0:ot.band1H)===null||Y===void 0?void 0:Y.tcTxStyle)):(De=Vt(Vt(Vt({},De),(tt=(j=c.tableStyles)===null||j===void 0?void 0:j.band2V)===null||tt===void 0?void 0:tt.tcStyle),{border:Vt(Vt({},De?.border),(ct=(mt=(bt=c.tableStyles)===null||bt===void 0?void 0:bt.band2V)===null||mt===void 0?void 0:mt.tcStyle)===null||ct===void 0?void 0:ct.border)}),xr=Vt(Vt({},xr),(Ht=(Pt=c.tableStyles)===null||Pt===void 0?void 0:Pt.band2V)===null||Ht===void 0?void 0:Ht.tcTxStyle))),c.props.bandCol&&(c._isBandCol(p)?(De=Vt(Vt(Vt({},De),(qt=(Lt=c.tableStyles)===null||Lt===void 0?void 0:Lt.band1V)===null||qt===void 0?void 0:qt.tcStyle),{border:Vt(Vt({},De?.border),(rr=(ce=(we=c.tableStyles)===null||we===void 0?void 0:we.band1V)===null||ce===void 0?void 0:ce.tcStyle)===null||rr===void 0?void 0:rr.border)}),xr=Vt(Vt({},xr),(jr=($r=c.tableStyles)===null||$r===void 0?void 0:$r.band1V)===null||jr===void 0?void 0:jr.tcTxStyle)):(De=Vt(Vt(Vt({},De),(er=(Cn=c.tableStyles)===null||Cn===void 0?void 0:Cn.band2H)===null||er===void 0?void 0:er.tcStyle),{border:Vt(Vt({},De?.border),(Xr=(En=(Gr=c.tableStyles)===null||Gr===void 0?void 0:Gr.band2H)===null||En===void 0?void 0:En.tcStyle)===null||Xr===void 0?void 0:Xr.border)}),xr=Vt(Vt({},xr),(as=(Mi=c.tableStyles)===null||Mi===void 0?void 0:Mi.band2H)===null||as===void 0?void 0:as.tcTxStyle)))),g.inheritTcStyle=De,g.inheritTcTxStyle=xr}))}))},t})(Hg),XP=(function(){function n(t,e,r,i){if(this.offset={x:0,y:0},this.chOffset={x:0,y:0},this.extend={w:0,h:0},this.chExtend={w:0,h:0},this.rotate=0,this.nodes=[],this.flipV=!1,this.flipH=!1,this.userDrawn=!0,this.order=q.get(t,["attrs","order"]),this.pptx=e,this.ctx=r,this.source=t,this.group=i,this.source["p:grpSpPr"]){var a=q.get(this.source,["p:grpSpPr","a:xfrm"]);if(a&&(this.offset={x:Math.round(this.group&&this.pptx.wps?Bo(parseInt(a["a:off"].attrs.x)):ar(parseInt(a["a:off"].attrs.x))),y:Math.round(this.group&&this.pptx.wps?Bo(parseInt(a["a:off"].attrs.y)):ar(parseInt(a["a:off"].attrs.y)))},this.chOffset={x:Math.round(cf(a["a:chOff"].attrs.x)==="point"||this.pptx.wps?Bo(parseInt(a["a:chOff"].attrs.x)):ar(parseInt(a["a:chOff"].attrs.x))),y:Math.round(cf(a["a:chOff"].attrs.y)==="point"||this.pptx.wps?Bo(parseInt(a["a:chOff"].attrs.y)):ar(parseInt(a["a:chOff"].attrs.y)))},this.chExtend={w:Math.round(cf(a["a:chExt"].attrs.cx)==="point"||this.pptx.wps?Bo(parseInt(a["a:chExt"].attrs.cx)):ar(parseInt(a["a:chExt"].attrs.cx))),h:Math.round(cf(a["a:chExt"].attrs.cy)==="point"||this.pptx.wps?Bo(parseInt(a["a:chExt"].attrs.cy)):ar(parseInt(a["a:chExt"].attrs.cy)))},this.extend={w:Math.round(this.group&&this.pptx.wps?Bo(parseInt(a["a:ext"].attrs.cx)):ar(parseInt(a["a:ext"].attrs.cx))),h:Math.round(this.group&&this.pptx.wps?Bo(parseInt(a["a:ext"].attrs.cy)):ar(parseInt(a["a:ext"].attrs.cy)))},this.rotate=uw(parseInt(q.get(a,"attrs.rot",0))),this.flipV=q.get(a,"attrs.flipV")==="1",this.flipH=q.get(a,"attrs.flipH")==="1"),i){var o=i.extend,s=i.chExtend,l=i.chOffset,u=o.w/s.w,c=o.h/s.h;this.extend.w=this.extend.w*u,this.extend.h=this.extend.h*c,this.offset.x=(this.offset.x-l.x)*u,this.offset.y=(this.offset.y-l.y)*c}}this._parseBackground(),this._parseNodes()}return n.prototype.getBackground=function(){return this.background&&this.background.type!=="none"?this.background:this.group?this.group.getBackground():void 0},n.prototype._parseBackground=function(){var t=q.get(this.source,["p:grpSpPr"]);t&&t["a:solidFill"]?this.background=Vr(t["a:solidFill"],this.ctx.theme,this.ctx):t&&t["a:gradFill"]?this.background=Gg(t["a:gradFill"],this.ctx.theme,this.ctx):t&&t["a:blipFill"]&&(this.background=zg(t["a:blipFill"],this.pptx,this.ctx))},n.prototype._parseNodes=function(){var t=this.source;Ug(this.nodes,t,this.pptx,this.ctx,this)},n})(),LX=(function(n){function t(e,r,i,a){var o=n.call(this,e,i,a)||this;return o.nodes=[],o.pptx=r,o}return yg(t,n),t.prototype.parseNode=function(){return bn(this,void 0,void 0,(function(){var e,r,i,a,o,s,l,u,c;return _n(this,(function(h){switch(h.label){case 0:return h.trys.push([0,3,,4]),(e=q.get(this.source,["a:graphic","a:graphicData","dgm:relIds","attrs","r:dm"]))&&this.ctx.rels[e]?(r=this.ctx.rels[e].target,a=zi,[4,this.pptx.getXmlByPath(r)]):[2];case 1:return i=a.apply(void 0,[h.sent()]),(o=q.get(i,["dgm:dataModel","dgm:extLst","a:ext","dsp:dataModelExt","attrs","relId"]))&&this.ctx.rels[o]?(s=this.ctx.rels[o].target,[4,this.pptx.getXmlByPath(s)]):[2];case 2:return l=(l=h.sent()).replace(/dsp:/g,"p:"),u=zi(l),c=q.get(u,["p:drawing","p:spTree"]),Ug(this.nodes,c,this.pptx,this.ctx),[3,4];case 3:return h.sent(),[3,4];case 4:return[2]}}))}))},t})(Hg),IX=(function(n){function t(e,r,i,a){var o=n.call(this,e,i,a)||this;return o.options={title:{},tooltip:{},legend:{},series:[],color:[]},o.userDrawn=!0,o.pptx=r,o}return yg(t,n),Object.defineProperty(t.prototype,"slideMaster",{get:function(){return this.ctx.slideMaster||this.ctx},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"theme",{get:function(){return this.slideMaster.theme},enumerable:!1,configurable:!0}),t.prototype.parseNode=function(){return bn(this,void 0,void 0,(function(){var e,r,i,a,o,s;return _n(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),(e=q.get(this.source,["a:graphic","a:graphicData","c:chart","attrs","r:id"]))&&this.ctx.rels[e]?(r=this.ctx.rels[e].target,a=zi,[4,this.pptx.getXmlByPath(r)]):[2];case 1:return i=a.apply(void 0,[l.sent()]),o=q.get(i,["c:chartSpace","c:chart"]),s=q.get(o,["c:plotArea"]),q.get(s,["c:lineChart"])?this.parseLine(q.get(s,["c:lineChart"]),o):q.get(s,["c:line3DChart"])?this.parseLine(q.get(s,["c:line3DChart"]),o):q.get(s,["c:areaChart"])?this.parseAreaLine(q.get(s,["c:areaChart"]),o):q.get(s,["c:area3DChart"])?this.parseAreaLine(q.get(s,["c:area3DChart"]),o):q.get(s,["c:barChart"])?this.parseBar(q.get(s,["c:barChart"]),o):q.get(s,["c:bar3DChart"])?this.parseBar(q.get(s,["c:bar3DChart"]),o):q.get(s,["c:pieChart"])?this.parsePie(q.get(s,["c:pieChart"])):q.get(s,["c:pie3DChart"])?this.parsePie(q.get(s,["c:pie3DChart"])):q.get(s,["c:doughnutChart"])&&this.parseDoughnutChart(q.get(s,["c:doughnutChart"])),[3,3];case 2:return l.sent(),[3,3];case 3:return[2]}}))}))},t.prototype.parseAreaLine=function(e,r){this.parseLine(e,r),this.options.series=this.options.series.map((function(i){return i.areaStyle={},i}))},t.prototype.parseLine=function(e,r){var i=q.get(e,["c:ser"]);Array.isArray(i)||(i=[i]),this.options.title={top:"top",left:"center",text:this.parseChartTitle(q.get(r,["c:title"]))},this.options.xAxis={type:"category",data:this.getCategory(i[0])},this.options.yAxis={type:"value"},this.options.series=this.parseLineSeries(i,e),this.options.color=this.parseLineColors(i),this.options.legend={bottom:"bottom",left:"center"},q.get(e,["c:grouping","attrs","val"])==="percentStacked"&&(this.options.tooltip.valueFormatter=function(a){return(100*a).toFixed(2)+"%"})},t.prototype.parseBar=function(e,r){var i=q.get(e,["c:ser"]);Array.isArray(i)||(i=[i]),this.options.title={top:"top",left:"center",text:this.parseChartTitle(q.get(r,["c:title"]))},q.get(e,["c:barDir","attrs","val"])==="bar"?(this.options.yAxis={type:"category",data:this.getCategory(i[0])},this.options.xAxis={type:"value"}):(this.options.xAxis={type:"category",data:this.getCategory(i[0])},this.options.yAxis={type:"value"}),this.options.series=this.parseBarSeries(i,e),this.options.color=this.parseBarColors(i),this.options.legend={bottom:"bottom",left:"center"},q.get(e,["c:grouping","attrs","val"])==="percentStacked"&&(this.options.tooltip.valueFormatter=function(a){return(100*a).toFixed(2)+"%"})},t.prototype.parsePie=function(e){var r=q.get(e,["c:ser"]);this.options.title={top:"top",left:"center",text:this.parsePieTitle(r)},this.options.color=this.parsePieColors(r),this.options.series=[this.parsePieSeries(r,e)],this.options.legend={bottom:"bottom",left:"center"}},t.prototype.parseDoughnutChart=function(e){var r=q.get(e,["c:ser"]);this.options.title.text=this.parsePieTitle(r),this.options.color=this.parsePieColors(r),this.options.series=[this.parsePieSeries(r,e)],this.options.legend={bottom:"bottom",left:"center"}},t.prototype.parsePieTitle=function(e){return q.get(e,["c:tx","c:strRef","c:strCache","c:pt","c:v"])},t.prototype.parseChartTitle=function(e){var r=q.get(e,["c:tx","c:rich","a:p"]);return Array.isArray(r)||(r=[r]),r.map((function(i){var a=q.get(i,["a:r"]);return Array.isArray(a)||(a=[a]),a.map((function(o){return q.get(o,["a:t"])||""})).join("")})).join("")||"图表标题"},t.prototype.parseBarColors=function(e){var r=this;return e.map((function(i){return Ke(Vr(q.get(i,["c:spPr","a:solidFill"]),r.theme,r.ctx))}))},t.prototype.parseLineColors=function(e){var r=this;return e.map((function(i){return Ke(Vr(q.get(i,["c:spPr","a:ln","a:solidFill"])||q.get(i,["c:spPr","a:solidFill"]),r.theme,r.ctx))}))},t.prototype.parsePieColors=function(e){var r=this,i=[],a=q.get(e,["c:dPt"]);return Array.isArray(a)||(a=[a]),a.forEach((function(o){i.push(Ke(Vr(q.get(o,["c:spPr","a:solidFill"]),r.theme,r.ctx)))})),i},t.prototype.parsePieSeries=function(e,r){var i={type:"pie",radius:"80%",startAngle:90,data:[]};q.get(r,["c:holeSize","attrs","val"])&&(i.radius=["".concat(.8*q.get(r,["c:holeSize","attrs","val"]),"%"),"80%"]);var a=q.get(r,["c:firstSliceAng","attrs","val"]);a&&(i.startAngle=90-a);for(var o=this.getCategory(e),s=this.getVal(e),l=0;l<o.length;l++)i.data.push({name:o[l],value:s[l]});return i},t.prototype.parseBarSeries=function(e,r){var i,a=this,o=q.get(r,["c:grouping","attrs","val"]);o==="stacked"?i="Ad":o==="percentStacked"&&(i="total");var s=e.map((function(u){return{type:"bar",name:q.get(u,["c:tx","c:strRef","c:strCache","c:pt","c:v"]),data:a.getVal(u),stack:i}}));if(o==="percentStacked"){var l=[];s.forEach((function(u,c){l=c===0?rv([],u.data,!0):l.map((function(h,f){return h+u.data[f]}))})),s.forEach((function(u){u.data=u.data.map((function(c,h){return l[h]<=0?0:c/l[h]}))}))}return s},t.prototype.parseLineSeries=function(e,r){var i,a=this,o=q.get(r,["c:grouping","attrs","val"]);o==="stacked"?i="Ad":o==="percentStacked"&&(i="total");var s=e.map((function(u){return{type:"line",name:q.get(u,["c:tx","c:strRef","c:strCache","c:pt","c:v"]),data:a.getVal(u),stack:i}}));if(i==="total"){var l=[];s.forEach((function(u,c){l=c===0?rv([],u.data,!0):l.map((function(h,f){return h+u.data[f]}))})),s.forEach((function(u){u.data=u.data.map((function(c,h){return l[h]<=0?0:c/l[h]}))}))}return s},t.prototype.getCategory=function(e){if(q.get(e,["c:cat","c:strRef"])){var r=q.get(e,["c:cat","c:strRef","c:strCache","c:pt"]);return Array.isArray(r)||(r=[r]),r.map((function(i){return q.get(i,["c:v"])}))}if(q.get(e,["c:cat","c:numRef"]))return r=q.get(e,["c:cat","c:numRef","c:numCache","c:pt"]),Array.isArray(r)||(r=[r]),r.map((function(i){return q.get(i,["c:v"])}))},t.prototype.getVal=function(e){var r=q.get(e,["c:val","c:numRef","c:numCache","c:pt"]);return Array.isArray(r)||(r=[r]),r.map((function(i){return+q.get(i,["c:v"])}))},t})(Hg);function m3(n){var t={},e=q.get(n,"attrs")||{};return Object.keys(e).forEach((function(r){switch(r){case"algn":t.align=e[r];break;case"marL":t.marginLeft=ar(parseInt(e[r]));break;case"indent":t.indent=ar(parseInt(e[r]));break;case"lvl":t.level=e[r]}})),q.get(n,["a:lnSpc","a:spcPct","attrs","val"])&&(t.lineHeight=parseInt(n["a:lnSpc"]["a:spcPct"].attrs.val)/1e5),t}function y3(n,t,e){var r={},i=q.get(n,"attrs")||{};Object.keys(i).forEach((function(o){switch(o){case"sz":r.size=parseInt(i[o])/100;break;case"b":r.bold=i[o]==="1";break;case"i":r.italic=i[o]==="1";break;case"u":r.underline=i[o];break;case"strike":r.strike=i[o];break;case"order":case"dirty":break;default:r[o]=i[o]}}));var a=q.get(n,"a:solidFill");return a&&(r.color=Vr(a,t,e)),r}function Ug(n,t,e,r,i){return bn(this,void 0,void 0,(function(){var a,o,s,l,u,c,h,f,d,v,m,y,g,p,b,w,x,A,T,C,E;return _n(this,(function(k){switch(k.label){case 0:for(s in o=[],a=t)o.push(s);l=0,k.label=1;case 1:if(!(l<o.length))return[3,17];if(!((s=o[l])in a))return[3,16];switch(u=s){case"p:sp":return[3,2];case"p:pic":return[3,3];case"p:cxnSp":return[3,4];case"p:graphicFrame":return[3,5];case"p:grpSp":return[3,14]}return[3,15];case 2:for(c=Array.isArray(t[u])?t[u]:[t[u]],C=0;C<c.length;C++)g=c[C],n.push(new rg(g,e,r,i));return[3,16];case 3:for(h=Array.isArray(t[u])?t[u]:[t[u]],C=0;C<h.length;C++)f=h[C],d=f["p:blipFill"]["a:blip"].attrs["r:embed"],v=r.rels[d].target,m=new r_(v,f,e,r,i),n.push(m);return[3,16];case 4:for(y=Array.isArray(t[u])?t[u]:[t[u]],C=0;C<y.length;C++)g=y[C],n.push(new rg(g,e,r,i));return[3,16];case 5:p=Array.isArray(t[u])?t[u]:[t[u]],C=0,k.label=6;case 6:if(!(C<p.length))return[3,13];switch(b=p[C],w=q.get(b,["a:graphic","a:graphicData","attrs","uri"]),w){case"http://schemas.openxmlformats.org/drawingml/2006/table":return[3,7];case"http://schemas.openxmlformats.org/drawingml/2006/diagram":return[3,8];case"http://schemas.openxmlformats.org/drawingml/2006/chart":return[3,10]}return[3,12];case 7:return n.push(new DX(b,e,r,i)),[3,12];case 8:return[4,(x=new LX(b,e,r,i)).parseNode()];case 9:return k.sent(),n.push(x),[3,12];case 10:return[4,(A=new IX(b,e,r,i)).parseNode()];case 11:return k.sent(),n.push(A),[3,12];case 12:return C++,[3,6];case 13:return[3,16];case 14:for(T=Array.isArray(t[u])?t[u]:[t[u]],C=0;C<T.length;C++)E=T[C],n.push(new XP(E,e,r,i));return[3,16];case 15:return[3,16];case 16:return l++,[3,1];case 17:return[2]}}))}))}var h2t=(function(){function n(t,e,r){this.slideType="slide",this.rels={},this.background={type:"none"},this.nodes=[],this.name=t,this.source=e,this.pptx=r}return Object.defineProperty(n.prototype,"index",{get:function(){if(!this.name)return 0;var t=this.name.match(/(\d+)/);return t?parseInt(t[0]):1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"slideMaster",{get:function(){return this.slideLayout&&this.slideLayout.slideMaster},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"theme",{get:function(){return this.slideMaster.theme},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"_relsPath",{get:function(){return this.name.replace("slides/slide","slides/_rels/slide")+".rels"},enumerable:!1,configurable:!0}),n.prototype.load=function(){return bn(this,void 0,void 0,(function(){return _n(this,(function(t){switch(t.label){case 0:return[4,this._loadRels()];case 1:return t.sent(),this._loadBackground(),[4,this._loadNodes()];case 2:return t.sent(),[2]}}))}))},n.prototype._loadRels=function(){return bn(this,void 0,void 0,(function(){var t,e,r,i=this;return _n(this,(function(a){switch(a.label){case 0:return e=zi,[4,this.pptx.getXmlByPath(this._relsPath)];case 1:return t=e.apply(void 0,[a.sent()]),r=q.get(t,["Relationships","Relationship"])||[],Array.isArray(r)||(r=[r]),r.forEach((function(o){switch(q.get(o,["attrs","Type"])){case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout":var s=o.attrs.Target.replace("../","ppt/");s.startsWith("/ppt")&&(s=s.substr(1)),i.slideLayout=i.pptx.getSlideLayout(s);break;case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image":case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio":case"http://schemas.microsoft.com/office/2007/relationships/media":case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video":case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramLayout":case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramData":case"http://schemas.microsoft.com/office/2007/relationships/diagramDrawing":case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramColors":case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart":var l=o.attrs.Target.replace("../","ppt/");l.startsWith("/ppt")&&(l=l.substr(1)),i.rels[o.attrs.Id]={type:o.attrs.Type.split("/").pop(),target:l}}})),[2]}}))}))},n.prototype._loadBackground=function(){var t=q.get(this.source,["p:sld","p:cSld","p:bg","p:bgPr"]);t&&t["a:solidFill"]?this.background=Vr(t["a:solidFill"],this.theme,this):t&&t["a:gradFill"]?this.background=Gg(t["a:gradFill"],this.theme,this):t&&t["a:blipFill"]&&(this.background=zg(t["a:blipFill"],this.pptx,this))},n.prototype._loadNodes=function(){return bn(this,void 0,void 0,(function(){var t;return _n(this,(function(e){switch(e.label){case 0:return t=q.get(this.source,["p:sld","p:cSld","p:spTree"]),[4,Ug(this.nodes,t,this.pptx,this)];case 1:return e.sent(),[2]}}))}))},n.prototype.getColorThemeName=function(t){return this.slideLayout.getColorThemeName(t)},n.prototype.getNodeInheritAttrsByType=function(t,e){var r=this.slideLayout.getNodeByType(t),i=q.get(r.source,e);return i||this.slideLayout.getNodeInheritAttrsByType(t,e)},n.prototype.getNodeInheritAttrsByIdx=function(t,e){var r=this.slideLayout.getNodeByIdx(t),i=q.get(r.source,e);return i||this.slideLayout.getNodeInheritAttrsByIdx(t,e)},n})(),f2t=(function(){function n(t,e,r){this.slideType="slideLayout",this.rels={},this.background={type:"none"},this.nodes=[],this.name=t,this.source=e,this.pptx=r}return Object.defineProperty(n.prototype,"_relsPath",{get:function(){return this.name.replace("slideLayouts/slideLayout","slideLayouts/_rels/slideLayout")+".rels"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"theme",{get:function(){return this.slideMaster.theme},enumerable:!1,configurable:!0}),n.prototype.load=function(){return bn(this,void 0,void 0,(function(){return _n(this,(function(t){switch(t.label){case 0:return[4,this._loadRels()];case 1:return t.sent(),[4,this._loadBackground()];case 2:return t.sent(),[4,this._loadNodes()];case 3:return t.sent(),[2]}}))}))},n.prototype._loadRels=function(){return bn(this,void 0,void 0,(function(){var t,e,r,i=this;return _n(this,(function(a){switch(a.label){case 0:return e=zi,[4,this.pptx.getXmlByPath(this._relsPath)];case 1:return t=e.apply(void 0,[a.sent()]),r=q.get(t,["Relationships","Relationship"])||[],Array.isArray(r)||(r=[r]),r.forEach((function(o){switch(q.get(o,["attrs","Type"])){case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster":var s=o.attrs.Target.replace("../","ppt/");s.startsWith("/ppt")&&(s=s.substr(1)),i.slideMaster=i.pptx.getSlideMaster(s);break;case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image":case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio":case"http://schemas.microsoft.com/office/2007/relationships/media":case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video":var l=o.attrs.Target.replace("../","ppt/");l.startsWith("/ppt")&&(l=l.substr(1)),i.rels[o.attrs.Id]={type:o.attrs.Type.split("/").pop(),target:l}}})),[2]}}))}))},n.prototype._loadBackground=function(){return bn(this,void 0,void 0,(function(){var t;return _n(this,(function(e){return(t=q.get(this.source,["p:sldLayout","p:cSld","p:bg","p:bgPr"]))&&t["a:solidFill"]?this.background=Vr(t["a:solidFill"],this.theme):t&&t["a:gradFill"]?this.background=Gg(t["a:gradFill"],this.theme,this):t&&t["a:blipFill"]&&(this.background=zg(t["a:blipFill"],this.pptx,this)),[2]}))}))},n.prototype._loadNodes=function(){return bn(this,void 0,void 0,(function(){var t;return _n(this,(function(e){return t=q.get(this.source,["p:sldLayout","p:cSld","p:spTree"]),Ug(this.nodes,t,this.pptx,this),[2]}))}))},n.prototype.getColorThemeName=function(t){return this.slideMaster.getColorThemeName(t)},n.prototype.getNodeByType=function(t){return this.nodes.find((function(e){return e.type===t}))},n.prototype.getNodeByIdx=function(t){return this.nodes.find((function(e){return e.idx===t}))},n.prototype.getNodeInheritAttrsByType=function(t,e){var r=this.slideMaster.getNodeByType(t);return r&&q.get(r.source,e)},n.prototype.getNodeInheritAttrsByIdx=function(t,e){var r=this.slideMaster.getNodeByIdx(t);return r&&q.get(r.source,e)},n})(),d2t=(function(){function n(t,e,r){this.slideType="slideMaster",this.rels={},this.background={type:"none"},this.textStyles={titleStyle:{},bodyStyle:{},otherStyle:{}},this.defaultTextStyle={},this.nodes=[],this.tableStyles={},this.name=t,this.source=e,this.pptx=r,this.load()}return Object.defineProperty(n.prototype,"_relsPath",{get:function(){return this.name.replace("slideMasters/slideMaster","slideMasters/_rels/slideMaster")+".rels"},enumerable:!1,configurable:!0}),n.prototype.load=function(){return bn(this,void 0,void 0,(function(){return _n(this,(function(t){switch(t.label){case 0:return[4,this._parseRels()];case 1:return t.sent(),this._parseColorMap(),this._parseBackground(),this._parseTextStyles(),this._parseTableStyles(),this._parseDefaultTextStyle(),this._loadNodes(),[2]}}))}))},n.prototype._parseRels=function(){return bn(this,void 0,void 0,(function(){var t,e,r,i=this;return _n(this,(function(a){switch(a.label){case 0:return e=zi,[4,this.pptx.getXmlByPath(this._relsPath)];case 1:return t=e.apply(void 0,[a.sent()]),r=q.get(t,["Relationships","Relationship"])||[],Array.isArray(r)||(r=[r]),r.forEach((function(o){switch(q.get(o,["attrs","Type"])){case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme":var s=o.attrs.Target.replace("../","ppt/");s.startsWith("/ppt")&&(s=s.substr(1)),i.theme=i.pptx.getTheme(s);break;case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image":case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/audio":case"http://schemas.microsoft.com/office/2007/relationships/media":case"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video":var l=o.attrs.Target.replace("../","ppt/");l.startsWith("/ppt")&&(l=l.substr(1)),i.rels[o.attrs.Id]={type:o.attrs.Type.split("/").pop(),target:l}}})),[2]}}))}))},n.prototype._parseColorMap=function(){this.colorMap=q.omit(q.get(this.source,["p:sldMaster","p:clrMap","attrs"])||{},["order"])},n.prototype.getColorThemeName=function(t){return this.colorMap[t]||t},n.prototype._parseBackground=function(){var t=q.get(this.source,["p:sldMaster","p:cSld","p:bg","p:bgPr"]),e=q.get(this.source,["p:sldMaster","p:cSld","p:bg","p:bgRef"]);t&&t["a:solidFill"]?this.background=Vr(t["a:solidFill"],this.theme,this):t&&t["a:gradFill"]?this.background=Gg(t["a:gradFill"],this.theme,this):t&&t["a:blipFill"]?this.background=zg(t["a:blipFill"],this.pptx,this):e&&(this.background=Vr(e,this.theme,this))},n.prototype._parseDefaultTextStyle=function(){var t=this,e=this.pptx.defaultTextStyleSource;Object.keys(e).forEach((function(r){if(r.startsWith("a:")&&r.endsWith("pPr")){var i=r.substr(2,r.length-5),a=q.get(e[r],["a:defRPr"]);t.defaultTextStyle[i]={props:m3(e[r]),defRPr:y3(a,t.theme,t)}}}))},n.prototype._parseTextStyles=function(){var t=this,e=q.get(this.source,["p:sldMaster","p:txStyles"]);["titleStyle","bodyStyle","otherStyle"].forEach((function(r){var i=t.textStyles[r],a=q.get(e,"p:".concat(r))||{};Object.keys(a).forEach((function(o){if(o.startsWith("a:")&&o.endsWith("pPr")){var s=o.substr(2,o.length-5);i[s]={},i[s].props=m3(a[o]);var l=q.get(a[o],["a:defRPr"]);i[s].defRPr=y3(l,t.theme,t)}}))}))},n.prototype._parseTableStyles=function(){var t=this,e={},r=q.get(this.pptx.tableStyles,["a:tblStyleLst","a:tblStyle"])||[];Array.isArray(r)||(r=[r]),r.forEach((function(i){var a=q.get(i,["attrs","styleId"]);e[a]={},Object.keys(i).forEach((function(o){if(o.startsWith("a:")){var s=o.substr(2);e[a][s]={};var l=q.get(i[o],["a:tcStyle"]);if(l){var u={};q.get(l,["a:fill","a:solidFill"])&&(u.background=Vr(q.get(l,["a:fill","a:solidFill"]),t.theme,t));var c=q.get(l,"a:tcBdr");c&&(u.border={},Object.keys(c).forEach((function(d){if(d.startsWith("a:")){var v=d.substr(2),m=q.get(c[d],["a:ln"]);u.border[v]=hf(m,t.theme,t)}}))),e[a][s].tcStyle=u}var h=q.get(i[o],["a:tcTxStyle"]);if(h){var f={};f.color=Vr(h,t.theme,t),q.get(h,["attrs","b"])==="on"&&(f.bold=!0),e[a][s].tcTxStyle=f}}}))})),this.tableStyles=e},n.prototype._loadNodes=function(){return bn(this,void 0,void 0,(function(){var t;return _n(this,(function(e){return t=q.get(this.source,["p:sldMaster","p:cSld","p:spTree"]),Ug(this.nodes,t,this.pptx,this),[2]}))}))},n.prototype.getNodeByType=function(t){return this.nodes.find((function(e){return e.type===t}))},n.prototype.getNodeByIdx=function(t){return this.nodes.find((function(e){return e.idx===t}))},n.prototype.getNodeInheritAttrsByType=function(t,e){},n.prototype.getNodeInheritAttrsByIdx=function(t,e){},n})(),p2t=(function(){function n(t,e,r){this.clrScheme={},this.borderScheme=[],this.name=t,this.source=e,this.pptx=r,this._parseClrScheme(),this._parseLineStyleLst()}return n.prototype._parseClrScheme=function(){var t=q.get(this.source,["a:theme","a:themeElements","a:clrScheme"]);for(var e in t)if(e.startsWith("a:")){var r=e.substring(2),i=q.get(t[e],["a:sysClr","attrs","lastClr"])||q.get(t[e],["a:srgbClr","attrs","val"]);this.clrScheme[r]="#"+i}},n.prototype._parseLineStyleLst=function(){var t=this,e=q.get(this.source,["a:theme","a:themeElements","a:fmtScheme","a:lnStyleLst","a:ln"])||[];this.borderScheme=e.map((function(r){var i={color:{}};return q.get(r,["attrs","w"])&&(i.width=ar(parseInt(q.get(r,["attrs","w"])))),q.get(r,["attrs","algn"])&&(i.algn=q.get(r,["attrs","algn"])),q.get(r,["attrs","cap"])&&(i.cap=q.get(r,["attrs","cap"])),q.get(r,["attrs","cmpd"])&&(i.cmpd=q.get(r,["attrs","cmpd"])),q.get(r,["a:miter","attrs","lim"])&&(i.miterLim=ar(parseInt(q.get(r,["a:miter","attrs","lim"])))),q.get(r,["a:prstDash","attrs","val"])&&(i.type=q.get(r,["a:prstDash","attrs","val"])),q.get(r,["a:solidFill"])&&(i.color=Vr(q.get(r,["a:solidFill"]),t)),i}))},n.prototype.getColor=function(t){if(t!=="phClr")return this.clrScheme[t]||this.defaultColor},n.prototype.getLineStyle=function(t){return this.borderScheme[t-1]},n})(),b3=(function(){function n(){this.slides=[],this.slideLayouts=[],this.slideMaster=[],this.themes=[],this.medias={},this.wps=!1}return n.prototype.load=function(t){return bn(this,void 0,void 0,(function(){var e,r;return _n(this,(function(i){switch(i.label){case 0:return e=new O4,r=this,[4,e.loadAsync(t)];case 1:return r._zipContents=i.sent(),[4,this._loadThumbnail()];case 2:return i.sent(),[4,this._loadMedia()];case 3:return i.sent(),[4,this._loadPresentation()];case 4:return i.sent(),[4,this._loadContentTypes()];case 5:return i.sent(),[2]}}))}))},n.prototype._loadThumbnail=function(){return bn(this,void 0,void 0,(function(){var t;return _n(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),this._zipContents.files["docProps/thumbnail.jpeg"]?[4,this._zipContents.files["docProps/thumbnail.jpeg"].async("base64")]:[3,2];case 1:t=e.sent(),this.thumbnail="data:image/jpeg;base64,"+t,e.label=2;case 2:return[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},n.prototype._loadPresentation=function(){return bn(this,void 0,void 0,(function(){var t,e,r,i,a,o;return _n(this,(function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),[4,this._zipContents.files["ppt/presentation.xml"].async("text")];case 1:return t=s.sent(),e=zi(t),r=e["p:presentation"]["p:sldSz"].attrs,this.width=ar(parseInt(r.cx)),this.height=ar(parseInt(r.cy)),this.defaultTextStyleSource=q.get(e,["p:presentation","p:defaultTextStyle"]),this._zipContents.files["docProps/app.xml"]?[4,this._zipContents.files["docProps/app.xml"].async("text")]:[3,3];case 2:i=s.sent(),a=zi(i),o=q.get(a,["Properties","Application"]),this.wps=o?.includes("WPS")||!1,s.label=3;case 3:return[3,5];case 4:return s.sent(),[3,5];case 5:return[2]}}))}))},n.prototype._loadContentTypes=function(){return bn(this,void 0,void 0,(function(){var t,e,r,i,a,o,s,l,u,c,h,f,d,v,m,y,g,p,b,w,x;return _n(this,(function(A){switch(A.label){case 0:return A.trys.push([0,22,,23]),e=zi,[4,this._zipContents.files["[Content_Types].xml"].async("text")];case 1:if(t=e.apply(void 0,[A.sent()]),r=t.Types.Override,!(i=r.filter((function(T){return T.attrs.ContentType==="application/vnd.openxmlformats-officedocument.theme+xml"}))))return[3,5];a=0,o=i,A.label=2;case 2:return a<o.length?(s=o[a],p=s.attrs.PartName.substr(1),l=zi,[4,this._zipContents.files[p].async("text")]):[3,5];case 3:b=l.apply(void 0,[A.sent()]),this.themes.push(new p2t(p,b,this)),A.label=4;case 4:return a++,[3,2];case 5:return(u=r.find((function(T){return T.attrs.ContentType==="application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml"})))?(p=u.attrs.PartName.substr(1),c=zi,[4,this._zipContents.files[p].async("text")]):[3,7];case 6:b=c.apply(void 0,[A.sent()]),this.tableStyles=b,A.label=7;case 7:h=r.filter((function(T){return T.attrs.ContentType==="application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml"})),g=0,A.label=8;case 8:return g<h.length?(p=h[g].attrs.PartName.substr(1),f=zi,[4,this._zipContents.files[p].async("text")]):[3,11];case 9:b=f.apply(void 0,[A.sent()]),this.slideMaster.push(new d2t(p,b,this)),A.label=10;case 10:return g++,[3,8];case 11:d=r.filter((function(T){return T.attrs.ContentType==="application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml"})),g=0,A.label=12;case 12:return g<d.length?(p=d[g].attrs.PartName.substr(1),v=zi,[4,this._zipContents.files[p].async("text")]):[3,16];case 13:return b=v.apply(void 0,[A.sent()]),[4,(m=new f2t(p,b,this)).load()];case 14:A.sent(),this.slideLayouts.push(m),A.label=15;case 15:return g++,[3,12];case 16:y=r.filter((function(T){return T.attrs.ContentType==="application/vnd.openxmlformats-officedocument.presentationml.slide+xml"})),g=0,A.label=17;case 17:return g<y.length?(p=y[g].attrs.PartName.substr(1),w=zi,[4,this._zipContents.files[p].async("text")]):[3,21];case 18:return b=w.apply(void 0,[A.sent()]),[4,(x=new h2t(p,b,this)).load()];case 19:A.sent(),this.slides.push(x),A.label=20;case 20:return g++,[3,17];case 21:return this.slides.sort((function(T,C){return T.index-C.index})),[3,23];case 22:return A.sent(),[3,23];case 23:return[2]}}))}))},n.prototype._loadMedia=function(){return bn(this,void 0,void 0,(function(){var t,e,r,i,a,o,s,l,u,c,h,f,d,v=this;return _n(this,(function(m){switch(m.label){case 0:t=Object.keys(this._zipContents.files).filter((function(g){return g.startsWith("ppt/media/image")})).map((function(g){return v._zipContents.files[g]})),e=0,r=t,m.label=1;case 1:return e<r.length?(i=r[e],a=(function(g){var p;switch(g){case"jpg":case"jpeg":p="image/jpeg";break;case"png":p="image/png";break;case"gif":p="image/gif";break;case"emf":p="image/x-emf";break;case"wmf":p="image/x-wmf";break;default:p="image/*"}return p})((y=i.name).substr(2+(~-y.lastIndexOf(".")>>>0))),[4,i.async("base64")]):[3,4];case 2:o=m.sent(),this.medias[i.name]="data:".concat(a,";base64,").concat(o),m.label=3;case 3:return e++,[3,1];case 4:s=Object.keys(this._zipContents.files).filter((function(g){return g.startsWith("ppt/media/media")&&["mp3","wav","ogg","mp4","webm"].includes(g.split(".").pop().toLowerCase())})).map((function(g){return v._zipContents.files[g]})),l=0,u=s,m.label=5;case 5:return l<u.length?(c=u[l],h=c.name.split(".").pop().toLowerCase(),[4,c.async("arraybuffer")]):[3,8];case 6:f=m.sent(),d=new Blob([f],{type:"".concat(["mp3","wav"].includes(h)?"audio":"video","/").concat(h)}),this.medias[c.name]=URL.createObjectURL(d),m.label=7;case 7:return l++,[3,5];case 8:return[2]}var y}))}))},n.prototype.getXmlByPath=function(t){return bn(this,void 0,void 0,(function(){return _n(this,(function(e){switch(e.label){case 0:if(!this._zipContents.files[t])throw new Error("文件不存在");return[4,this._zipContents.files[t].async("text")];case 1:return[2,e.sent()]}}))}))},n.prototype.getSlideLayout=function(t){return this.slideLayouts.find((function(e){return e.name===t}))},n.prototype.getSlideMaster=function(t){return this.slideMaster.find((function(e){return e.name===t}))},n.prototype.getTheme=function(t){return this.themes.find((function(e){return e.name===t}))},n.prototype.getMedia=function(t){return this.medias[t]},n})();function AE(n){var t=n.extend,e=n.offset,r=n.clip,i=n.base64,a=n.audioFile,o=n.videoFile,s=document.createElement("div");s.style.setProperty("position","absolute"),s.style.setProperty("left",e.x+"px"),s.style.setProperty("top",e.y+"px");var l,u,c,h,f=document.createElement("div");f.style.setProperty("position","absolute"),f.style.setProperty("left","0"),f.style.setProperty("top","0"),f.style.setProperty("width",t.w+"px"),f.style.setProperty("height",t.h+"px"),f.style.setProperty("overflow","hidden"),r?(l=t.w/(1-(r.l===void 0?0:r.l)-(r.r===void 0?0:r.r)),u=t.h/(1-(r.t===void 0?0:r.t)-(r.b===void 0?0:r.b)),c=-1*l*(r.l===void 0?0:r.l),h=-1*u*(r.t===void 0?0:r.t)):(l=t.w,u=t.h,c=0);var d=document.createElement("img");if(d.src=i,d.width=l,d.height=u,d.style.setProperty("position","absolute"),d.style.setProperty("left",c+"px"),d.style.setProperty("top",h+"px"),f.append(d),s.append(f),a){var v=document.createElement("audio");v.style.position="absolute",v.style.left="0",v.style.top="0",v.src=a,v.controls=!0,v.style.transform="translate(-50%)",s.append(v)}if(o){var m=document.createElement("video");m.style.position="absolute",m.style.left="0",m.style.top="0",m.width=t.w,m.height=t.h,m.src=o,m.controls=!0,s.append(m)}return s}function v2t(n,t,e){var r,i=n.props,a=n.text,o=Vt(Vt({},t),i),s=document.createElement("span");s.innerHTML=typeof a=="string"?a:"";var l=18;o.size&&(!((r=e?.normAutofit)===null||r===void 0)&&r.fontScale?(l=o.size*e.normAutofit.fontScale,s.style.fontSize=l+"px"):(l=o.size,s.style.fontSize=l+"px"));var u=Ke(o.color);u&&(s.style.color=u);var c=/^[^\u4e00-\u9fff]+$/;if(o.typeface)switch(s.style.fontFamily=o.typeface,o.typeface){case"DengXian":c.test(a)&&(s.style.letterSpacing=-.04*l+"px");break;case"DengXian Light":c.test(a)&&(s.style.letterSpacing=-.05*l+"px");break;case"STLiti":case"SimSun":case"NSimSun":case"SimHei":c.test(a)&&(s.style.fontSize=.85*parseInt(s.style.fontSize)+"px");break;case"华文中宋":case"Fira Sans Extra Condensed Medium":s.style.fontSize=.85*parseInt(s.style.fontSize)+"px";break;case"FangSong":s.style.letterSpacing=-.08*l+"px"}else c.test(a)&&(s.style.letterSpacing=-.04*l+"px");return o.bold&&(s.style.fontWeight="bold"),o.italic&&(s.style.fontStyle="italic"),o.underline&&o.underline!=="none"&&(s.style.textDecoration="underline"),o.background&&(s.style.backgroundColor=Ke(o.background)),s.style.wordBreak="break-word",s}function g2t(n,t,e){var r=document.createElement("span"),i=n.firstElementChild;switch(r.style.fontSize=i.style.fontSize,r.style.color=i.style.color,r.style.fontWeight=i.style.fontWeight,r.style.fontStyle=i.style.fontStyle,r.style.marginRight="10px",t.buAutoNum){case"arabicPeriod":default:r.textContent=e+".";break;case"circleNumDbPlain":r.textContent=["①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","⑰","⑱","⑲","⑳"][e-1]||e+"";break;case"romanUcPeriod":r.textContent=(function(a){var o=[{value:1e3,numeral:"M"},{value:900,numeral:"CM"},{value:500,numeral:"D"},{value:400,numeral:"CD"},{value:100,numeral:"C"},{value:90,numeral:"XC"},{value:50,numeral:"L"},{value:40,numeral:"XL"},{value:10,numeral:"X"},{value:9,numeral:"IX"},{value:5,numeral:"V"},{value:4,numeral:"IV"},{value:1,numeral:"I"}];if(typeof a!="number"||a<1||a>3999)throw new Error("Input must be a number between 1 and 3999.");for(var s="",l=0;l<o.length;l++)for(;a>=o[l].value;)s+=o[l].numeral,a-=o[l].value;return s})(e)+".";break;case"alphaUcPeriod":r.textContent=BA(e)+".";break;case"alphaLcPeriod":r.textContent=BA(e).toLowerCase()+".";break;case"alphaLcParenR":r.textContent=BA(e).toLowerCase()+")";break;case"ea1JpnChsDbPeriod":r.textContent=(function(a){var o=["〇","一","二","三","四","五","六","七","八","九"];if(!Number.isInteger(a)||a<0)return"";for(var s="",l=a.toString(),u=0;u<l.length;u++)s+=o[parseInt(l[u],10)];return s})(e)+"."}n.prepend(r)}function n_(n,t,e){var r,i,a,o;t===void 0&&(t=0),e===void 0&&(e={});var s=n.inheritProps,l=n.inheritRProps,u=n.props,c=n.rows,h=Vt(Vt({},s),u),f=function(){for(var A,T,C=0,E=0,k=c;E<k.length;E++){var D=k[E];D.props&&D.props.size&&(C=Math.max(C,D.props.size))}var L=((T=(A=e?.bodyProps)===null||A===void 0?void 0:A.normAutofit)===null||T===void 0?void 0:T.fontScale)||1;return(C||l.size||18)*L},d=document.createElement("div"),v=e.isFirst?0:h.spaceBefore||0,m=e.isLast?0:h.spaceAfter||0;d.style.margin="".concat(Math.floor(.2*f()),"px 0 0 0"),d.style.padding="".concat(Math.floor(v),"px 0px ").concat(Math.floor(m),"px 0px");var y=document.createElement("p");y.style.margin="0",y.style.padding="0px",y.style.wordBreak="break-word",y.style.textAlign=h.align&&{ctr:"center",l:"left",r:"right",dist:"justify"}[h.align]||"center",h.align==="dist"&&(y.style.textAlignLast="justify");var g=h.hasOwnProperty("lineHeight")?h.lineHeight:1;if(!((i=(r=e.bodyProps)===null||r===void 0?void 0:r.normAutofit)===null||i===void 0)&&i.lnSpcReduction&&(g*=1-((o=(a=e.bodyProps)===null||a===void 0?void 0:a.normAutofit)===null||o===void 0?void 0:o.lnSpcReduction)),y.style.lineHeight=g+"",y.style.fontSize=f()+"px",c.length){for(var p=0,b=c;p<b.length;p++){var w=b[p];w.isBr?y.appendChild(document.createElement("br")):y.appendChild(v2t(w,Vt(Vt({},l),{marginTop:Math.floor(.2*f())}),e.bodyProps))}h.buAutoNum?g2t(y,h,t):h.buChar&&(function(A,T){var C=document.createElement("span"),E=A.firstElementChild;C.style.color=E.style.color,C.style.fontSize=E.style.fontSize,C.textContent={n:"■",l:"●",u:"◆",p:"□",ü:"✔",Ø:"➢","•":"•"}[T.buChar]||"■",C.style.marginRight="10px",A.prepend(C)})(y,h),y.style.paddingLeft=(h.marginLeft||0)+(h.indent||0)+"px"}else{var x=document.createElement("span");x.innerHTML="&nbsp;",x.style.fontSize=l.size+"px",y.appendChild(x)}return d.appendChild(y),d}var RX="http://www.w3.org/2000/svg";function Ct(n){return document.createElementNS(RX,n)}function bs(n){var t=n.extend;return .16667*Math.min(t.w,t.h)}function ue(n,t,e){e===void 0&&(e=0);var r=t.prstGeom,i=(r?.gd||[]).find((function(a){return a.name===n}));return i?i.fmla:e}function St(n,t,e){e===void 0&&(e=0);var r=t.extend,i=t.prstGeom,a=(i?.gd||[]).find((function(o){return o.name===n}));return a?Math.min(r.w,r.h)*a.fmla:e}function _3(n,t,e){e===void 0&&(e=0);var r=t.extend,i=t.prstGeom,a=(i?.gd||[]).find((function(o){return o.name===n}));return a?Math.max(r.w,r.h)*a.fmla:e}function es(n,t){var e=0;switch(n){case"sm":e=1*t;break;case"med":e=1.5*t;break;case"lg":e=2.5*t}return Math.max(e,2)}function w3(n,t,e,r){r===void 0&&(r=!1);var i=n.border,a=i===void 0?{}:i,o=n.uuid,s=a.headEnd,l=a.width,u=a.color,c=a.tailEnd,h=r?s:c,f=h.len,d=f===void 0?"med":f,v=h.w,m=v===void 0?"med":v,y=es(d,l),g=es(m,l),p=Ct("defs"),b=Ct("marker"),w="marker-".concat(o,"-").concat(r?"start":"end");b.setAttribute("id",w),b.setAttribute("viewBox","0 0 ".concat(2*y," ").concat(2*g)),b.setAttribute("refX",y+"px"),b.setAttribute("refY",g+"px"),b.setAttribute("markerWidth",2*y+"px"),b.setAttribute("markerHeight",2*g+"px"),b.setAttribute("orient","auto"),b.setAttribute("markerUnits","userSpaceOnUse");var x=Ct("ellipse");x.setAttribute("cx",y+"px"),x.setAttribute("cy",g+"px"),x.setAttribute("rx",y+"px"),x.setAttribute("ry",g+"px"),x.setAttribute("fill",Ke(u)||"transparent"),b.appendChild(x),p.appendChild(b),t.appendChild(p),e.setAttribute(r?"marker-start":"marker-end","url(#".concat(w,")"))}function x3(n,t,e,r){r===void 0&&(r=!1);var i=n.border,a=i===void 0?{}:i,o=n.uuid,s=a.headEnd,l=a.width,u=a.color,c=a.tailEnd,h=r?s:c,f=h.len,d=f===void 0?"med":f,v=h.w,m=v===void 0?"med":v,y=es(d,l),g=es(m,l),p=Ct("defs"),b=Ct("marker"),w="marker-".concat(o,"-").concat(r?"start":"end");b.setAttribute("id",w),b.setAttribute("viewBox","0 0 ".concat(2*y," ").concat(2*g)),b.setAttribute("refX",(r?.9*y:1.1*y)+"px"),b.setAttribute("refY",g+"px"),b.setAttribute("markerWidth",2*y+"px"),b.setAttribute("markerHeight",2*g+"px"),b.setAttribute("orient","auto"),b.setAttribute("markerUnits","userSpaceOnUse");var x=Ct("path"),A=r?["M ".concat(2*y,",0"),"L 0,".concat(g),"L ".concat(2*y,",").concat(2*g),"Z"].join(" "):["M 0,0","L ".concat(2*y,",").concat(g),"L 0,".concat(2*g),"Z"].join(" ");x.setAttribute("d",A),x.setAttribute("fill",Ke(u)||"transparent"),b.appendChild(x),p.appendChild(b),t.appendChild(p),e.setAttribute(r?"marker-start":"marker-end","url(#".concat(w,")"))}function S3(n,t,e,r){r===void 0&&(r=!1);var i=n.border,a=i===void 0?{}:i,o=n.uuid,s=a.headEnd,l=a.width,u=a.color,c=a.tailEnd,h=r?s:c,f=h.len,d=f===void 0?"med":f,v=h.w,m=v===void 0?"med":v,y=es(d,l),g=es(m,l),p=Ct("defs"),b=Ct("marker"),w="marker-".concat(o,"-").concat(r?"start":"end");b.setAttribute("id",w),b.setAttribute("viewBox","0 0 ".concat(2*y," ").concat(2*g)),b.setAttribute("refX",y+"px"),b.setAttribute("refY",g+"px"),b.setAttribute("markerWidth",2*y+"px"),b.setAttribute("markerHeight",2*g+"px"),b.setAttribute("orient","auto"),b.setAttribute("markerUnits","userSpaceOnUse");var x=Ct("path"),A=["M 0,".concat(g),"L ".concat(y,",0"),"L ".concat(2*y,",").concat(g),"L ".concat(y,",").concat(2*g),"Z"].join(" ");x.setAttribute("d",A),x.setAttribute("fill",Ke(u)||"transparent"),b.appendChild(x),p.appendChild(b),t.appendChild(p),e.setAttribute(r?"marker-start":"marker-end","url(#".concat(w,")"))}function A3(n,t,e,r){r===void 0&&(r=!1);var i=n.border,a=i===void 0?{}:i,o=n.uuid,s=a.headEnd,l=a.width,u=a.color,c=a.tailEnd,h=r?s:c,f=h.len,d=f===void 0?"med":f,v=h.w,m=v===void 0?"med":v,y=es(d,l),g=es(m,l),p=Ct("defs"),b=Ct("marker"),w="marker-".concat(o,"-").concat(r?"start":"end");b.setAttribute("id",w),b.setAttribute("viewBox","0 0 ".concat(2*y+2*l," ").concat(2*g+2*l));var x=r?m==="lg"?2*l:3*l:m==="lg"?2*y:2*y-l;b.setAttribute("refX",x+"px"),b.setAttribute("refY",g+l+"px"),b.setAttribute("markerWidth",2*y+"px"),b.setAttribute("markerHeight",2*g+"px"),b.setAttribute("orient","auto"),b.setAttribute("markerUnits","userSpaceOnUse");var A=Ct("path"),T=r?["M ".concat(2*y+l,", ").concat(l),"L ".concat(l,",").concat(g+l),"L ".concat(2*y+l,",").concat(2*g+l)].join(" "):["M ".concat(l,", ").concat(l),"L ".concat(2*y+l,",").concat(g+l),"L ".concat(l,",").concat(2*g+l)].join(" ");A.setAttribute("d",T),A.setAttribute("stroke-width",l+"px"),A.setAttribute("stroke",Ke(u)||"transparent"),A.setAttribute("fill","transparent"),A.setAttribute("stroke-linecap","round"),A.setAttribute("stroke-linejoin","miter"),A.style.overflow="visible",b.appendChild(A),p.appendChild(b),t.appendChild(p),e.setAttribute(r?"marker-start":"marker-end","url(#".concat(w,")"))}function T3(n,t,e,r){r===void 0&&(r=!1);var i=n.border,a=i===void 0?{}:i,o=n.uuid,s=a.headEnd,l=a.width,u=a.color,c=a.tailEnd,h=r?s:c,f=h.len,d=f===void 0?"med":f,v=h.w,m=v===void 0?"med":v,y=es(d,l),g=es(m,l),p=Ct("defs"),b=Ct("marker"),w="marker-".concat(o,"-").concat(r?"start":"end");b.setAttribute("id",w),b.setAttribute("viewBox","0 0 ".concat(2*y," ").concat(2*g));var x=r?m==="sm"?1.5*l:2*l:m==="sm"?2*y-1.5*l:2*y-2*l;b.setAttribute("refX",x+"px"),b.setAttribute("refY",g+"px"),b.setAttribute("markerWidth",2*y+"px"),b.setAttribute("markerHeight",2*g+"px"),b.setAttribute("orient","auto"),b.setAttribute("markerUnits","userSpaceOnUse");var A=Ct("path"),T=r?["M 0, ".concat(g),"L ".concat(2*y,",0"),"L ".concat(y,",").concat(g),"L ".concat(2*y,",").concat(2*g),"Z"].join(" "):["M 0,0","L ".concat(2*y,",").concat(g),"L 0,".concat(2*g),"L ".concat(y,",").concat(g),"Z"].join(" ");A.setAttribute("d",T),A.setAttribute("fill",Ke(u)||"transparent"),A.style.overflow="visible",b.appendChild(A),p.appendChild(b),t.appendChild(p),e.setAttribute(r?"marker-start":"marker-end","url(#".concat(w,")"))}function Mp(n,t,e){var r=n.border,i=r===void 0?{}:r;n.extend;var a=i.headEnd,o=i.tailEnd;if(a&&a.type!=="none")switch(a.type){case"triangle":x3(n,t,e,!0);break;case"oval":w3(n,t,e,!0);break;case"diamond":S3(n,t,e,!0);break;case"arrow":A3(n,t,e,!0);break;case"stealth":T3(n,t,e,!0)}if(o&&o.type!=="none")switch(o.type){case"triangle":x3(n,t,e,!1);break;case"oval":w3(n,t,e,!1);break;case"diamond":S3(n,t,e,!1);break;case"arrow":A3(n,t,e,!1);break;case"stealth":T3(n,t,e,!1)}}function C3(n){var t=n.extend,e=Ct("rect");return e.setAttribute("x","0"),e.setAttribute("y","0"),e.setAttribute("width",t.w+"px"),e.setAttribute("height",t.h+"px"),e}function Kn(n,t,e,r,i){var a=n*Math.PI/180;return[a===0||a===2*Math.PI?t+r:a===Math.PI?t-r:a===Math.PI/2||a===3*Math.PI/2?t:a>0&&a<Math.PI/2||a>3*Math.PI/2&&a<2*Math.PI?t+Math.sqrt(1/(1/Math.pow(r,2)+Math.pow(Math.tan(a),2)/Math.pow(i,2))):t-Math.sqrt(1/(1/Math.pow(r,2)+Math.pow(Math.tan(a),2)/Math.pow(i,2))),a===0||a===2*Math.PI||a===Math.PI?e:a===Math.PI/2?e+i:a===3*Math.PI/2?e-i:a>Math.PI&&a<2*Math.PI?e-Math.sqrt(1/(1/Math.pow(i,2)+Math.pow(1/Math.tan(a),2)/Math.pow(r,2))):e+Math.sqrt(1/(1/Math.pow(i,2)+Math.pow(1/Math.tan(a),2)/Math.pow(r,2)))]}function Pp(n,t){var e=0;return(t>n&&t-n>180||t<n&&n-t<180)&&(e=1),e}function kp(n){var t=n.extend,e=.146*t.w,r=.146*t.h;return{top:r,bottom:r,left:e,right:e,w:t.w-2*e,h:t.h-2*r}}function TE(n){var t=n.extend,e=n.offset,r=n.border,i=n.background,a=n.rotate,o=n.flipH,s=n.flipV,l=document.createElement("div"),u=e.x,c=e.y;l.className="shape-wrapper shape-".concat(n.shape),l.style.setProperty("position","absolute"),l.style.setProperty("width",(t.w||1)+"px"),l.style.setProperty("height",(t.h||1)+"px"),l.style.setProperty("left",u+"px"),l.style.setProperty("top",c+"px");var h,f=document.createElementNS(RX,"svg");f.style.setProperty("position","absolute"),f.setAttribute("width","100%"),f.setAttribute("height","100%"),f.style.setProperty("left","0"),f.style.setProperty("top","0"),f.style.overflow="visible";var d={left:0,top:0,bottom:0,w:t.w,h:t.h},v=!0;switch(n.shape){case"customGeom":h=(function(g){var p=g.prstGeom,b=p===void 0?{}:p,w=g.extend,x=b.pathList,A=b.w,T=b.h,C=Ct("path"),E={moveTo:"M",lnTo:"L",cubicBezTo:"C",close:"Z"},k=w.w/A,D=w.h/T,L=x.map((function(R){var P=E[R.type],O=Array.isArray(R.points)?R.points.map((function(F){return"".concat(F[0]*k,",").concat(F[1]*D)})).join(" "):"";return O?"".concat(P," ").concat(O):"".concat(P)})).join(" ");return C.setAttribute("d",L),C.style.fillRule="evenodd",C})(n),Mp(n,f,h);break;case"flowChartProcess":case"rect":h=C3(n);break;case"snip1Rect":h=(function(g){var p=g.extend,b=Ct("polygon"),w=St("adj",g,bs(g)),x=["0,0","".concat(p.w-w,",0"),"".concat(p.w,",").concat(w),"".concat(p.w,",").concat(p.h),"0,".concat(p.h)].join(" ");return b.setAttribute("points",x),b})(n);break;case"snip2SameRect":h=(function(g){var p=g.extend,b=Ct("polygon"),w=St("adj1",g,bs(g)),x=St("adj2",g,0),A=[[w,0],[p.w-w,0],[p.w,w],[p.w,p.h-x],[p.w-x,p.h],[x,p.h],[0,p.h-x],[0,w]].map((function(T){return"".concat(T[0],",").concat(T[1])})).join(" ");return b.setAttribute("points",A),b})(n);break;case"snip2DiagRect":h=(function(g){var p=g.extend,b=Ct("polygon"),w=St("adj1",g,0),x=St("adj2",g,bs(g)),A=[[w,0],[p.w-x,0],[p.w,x],[p.w,p.h-w],[p.w-w,p.h],[x,p.h],[0,p.h-x],[0,w]].map((function(T){return"".concat(T[0],",").concat(T[1])})).join(" ");return b.setAttribute("points",A),b})(n);break;case"snipRoundRect":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj1",g,bs(g)),x=St("adj2",g,bs(g)),A=["M ".concat(w,",0"),"L ".concat(p.w-x,",0"),"L ".concat(p.w,",").concat(x),"L ".concat(p.w,",").concat(p.h),"L 0,".concat(p.h),"L 0,".concat(w),"Q 0,0 ".concat(w,",0"),"Z"].join(" ");return b.setAttribute("d",A),b})(n);break;case"roundRect":h=(function(g){var p=C3(g),b=St("adj",g,bs(g));return p.setAttribute("rx",b+"px"),p.setAttribute("ry",b+"px"),p})(n);break;case"round1Rect":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj",g,bs(g)),x=["M 0,0","L ".concat(p.w-w,",0"),"Q ".concat(p.w,",0 ").concat(p.w,",").concat(w),"L ".concat(p.w,",").concat(p.h),"L 0,".concat(p.h),"Z"].join(" ");return b.setAttribute("d",x),b})(n);break;case"round2SameRect":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj1",g,bs(g)),x=St("adj2",g,0),A=["M ".concat(w,",0"),"L ".concat(p.w-w,",0"),"Q ".concat(p.w,",0 ").concat(p.w,",").concat(w),"L ".concat(p.w,",").concat(p.h-x),"Q ".concat(p.w,",").concat(p.h," ").concat(p.w-x,",").concat(p.h),"L ".concat(x,",").concat(p.h),"Q 0,".concat(p.h," 0,").concat(p.h-x),"L 0,".concat(w),"Q 0,0 ".concat(w,",0"),"Z"].join(" ");return b.setAttribute("d",A),b})(n);break;case"round2DiagRect":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj1",g,bs(g)),x=St("adj2",g,0),A=["M ".concat(w,",0"),"L ".concat(p.w-x,",0"),"Q ".concat(p.w,",0 ").concat(p.w,",").concat(x),"L ".concat(p.w,",").concat(p.h-w),"Q ".concat(p.w,",").concat(p.h," ").concat(p.w-w,",").concat(p.h),"L ".concat(x,",").concat(p.h),"Q 0,".concat(p.h," 0,").concat(p.h-x),"L 0,".concat(w),"Q 0,0 ".concat(w,",0"),"Z"].join(" ");return b.setAttribute("d",A),b})(n);break;case"triangle":h=(function(g){var p=g.extend,b=Ct("polygon"),w=["".concat(p.w/2,",0"),"0,".concat(p.h),"".concat(p.w,",").concat(p.h)].join(" ");return b.setAttribute("points",w),b})(n);break;case"rtTriangle":h=(function(g){var p=g.extend,b=Ct("polygon"),w=["0,".concat(p.h),"0,0","".concat(p.w,",").concat(p.h)].join(" ");return b.setAttribute("points",w),b})(n);break;case"ellipse":h=(function(g){var p=g.extend,b=Ct("ellipse"),w=p.w/2,x=p.h/2,A=w,T=x;return b.setAttribute("cx",w+"px"),b.setAttribute("cy",x+"px"),b.setAttribute("rx",A+"px"),b.setAttribute("ry",T+"px"),b})(n);break;case"line":h=(function(g){var p=g.extend,b=Ct("path"),w=["M 0,0","L ".concat(p.w,",").concat(p.h)].join(" ");return b.setAttribute("d",w),b})(n),Mp(n,f,h),v=!1;break;case"straightConnector1":h=(function(g){var p=g.extend,b=Ct("path"),w=["M 0,0","L ".concat(p.w,",").concat(p.h)].join(" ");return b.setAttribute("d",w),b})(n),Mp(n,f,h),v=!1;break;case"bentConnector3":h=(function(g){var p=g.extend,b=Ct("path"),w=_3("adj1",g,.5*Math.max(p.w,p.h)),x=["M 0,0","L ".concat(w,",0"),"L ".concat(w,",").concat(p.h),"L ".concat(p.w,",").concat(p.h)].join(" ");return b.setAttribute("d",x),b})(n),Mp(n,f,h),v=!1;break;case"curvedConnector3":h=(function(g){var p=g.extend,b=Ct("path"),w=_3("adj1",g,.5*Math.max(p.w,p.h)),x=["M0,0","Q".concat(w,",0 ").concat(w,",").concat(p.h/2),"T".concat(p.w,",").concat(p.h)].join(" ");return b.setAttribute("d",x),b})(n),Mp(n,f,h),v=!1;break;case"parallelogram":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj",g,.5*Math.min(p.w,p.h)),x=["M".concat(w,",0"),"L".concat(p.w,",0"),"L".concat(p.w-w,",").concat(p.h),"L0,".concat(p.h),"Z"].join(" ");return b.setAttribute("d",x),b})(n),d=(function(g){var p=g.extend,b=St("adj",g,.5*Math.min(p.w,p.h)),w=.84*(p.w-b),x=.08*p.h+b/p.w*p.h*.42;return{top:x,bottom:x,left:(p.w-w)/2,right:(p.w-w)/2,w,h:p.h-2*x}})(n);break;case"trapezoid":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj",g,.25*Math.min(p.w,p.h)),x=["M".concat(w,",0"),"L".concat(p.w-w,",0"),"L".concat(p.w,",").concat(p.h),"L0,".concat(p.h),"Z"].join(" ");return b.setAttribute("d",x),b})(n),d=(function(g){var p=g.extend,b=St("adj",g,.5*Math.min(p.w,p.h)),w=b/p.w*.66*p.h,x=.66*b;return{top:w,bottom:0,left:x,right:x,w:p.w-2*x,h:p.h-w}})(n);break;case"diamond":h=(function(g){var p=g.extend,b=Ct("path"),w=["M".concat(p.w/2,",0"),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w/2,",").concat(p.h),"L0,".concat(p.h/2),"Z"].join(" ");return b.setAttribute("d",w),b})(n),d=(function(g){var p=g.extend,b=.25*p.h,w=.25*p.w;return{top:b,bottom:b,left:w,right:w,w:.5*p.w,h:.5*p.h}})(n);break;case"pentagon":h=(function(g){var p=g.extend,b=Ct("path"),w=["M".concat(p.w/2,",0"),"L".concat(p.w,",").concat(.3771*p.h),"L".concat(.808*p.w,",").concat(p.h),"L".concat(.192*p.w,",").concat(p.h),"L0,".concat(.3771*p.h),"Z"].join(" ");return b.setAttribute("d",w),b})(n),d=(function(g){var p=g.extend,b=.227*p.h,w=.192*p.w;return{top:b,bottom:0,left:w,right:w,w:.616*p.w,h:.773*p.h}})(n);break;case"hexagon":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj",g,.25*Math.min(p.w,p.h)),x=["M".concat(w,",0"),"L".concat(p.w-w,",0"),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-w,",").concat(p.h),"L".concat(w,",").concat(p.h),"L0,".concat(p.h/2),"Z"].join(" ");return b.setAttribute("d",x),b})(n),d=(function(g){var p=g.extend,b=St("adj",g,.25*Math.min(p.w,p.h)),w=.098*p.h+b/p.w*.38*p.h,x=.088*p.w+.422*b;return{top:w,bottom:w,left:x,right:x,w:p.w-2*x,h:p.h-2*w}})(n);break;case"heptagon":h=(function(g){var p=g.extend,b=Ct("path"),w=["M".concat(p.w/2,",0"),"L".concat(.9*p.w,",").concat(.2*p.h),"L".concat(p.w,",").concat(.642*p.h),"L".concat(.722*p.w,",").concat(p.h),"L".concat(.278*p.w,",").concat(p.h),"L0,".concat(.642*p.h),"L".concat(.1*p.w,",").concat(.2*p.h),"Z"].join(" ");return b.setAttribute("d",w),b})(n),d=(function(g){var p=g.extend;return{top:.2*p.h,bottom:.2*p.h,left:.1*p.w,right:.1*p.w,w:.8*p.w,h:.6*p.h}})(n);break;case"octagon":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj",g,.29*Math.min(p.w,p.h)),x=["M".concat(w,",0"),"L".concat(p.w-w,",0"),"L".concat(p.w,",").concat(w),"L".concat(p.w,",").concat(p.h-w),"L".concat(p.w-w,",").concat(p.h),"L".concat(w,",").concat(p.h),"L0,".concat(p.h-w),"L0,".concat(w),"Z"].join(" ");return b.setAttribute("d",x),b})(n),d=(function(g){var p=g.extend,b=St("adj",g,.29*Math.min(p.w,p.h));return{top:.5*b,bottom:.5*b,left:.5*b,right:.5*b,w:p.w-b,h:p.h-b}})(n);break;case"decagon":h=(function(g){var p=g.extend,b=Ct("path"),w=.344,x=.117,A=.19,T=["M".concat(p.w*w,",0"),"L".concat(.656*p.w,",0"),"L".concat(.883*p.w,",").concat(p.h*A),"L".concat(p.w,",").concat(.5*p.h),"L".concat(.883*p.w,",").concat(.81*p.h),"L".concat(.656*p.w,",").concat(p.h),"L".concat(p.w*w,",").concat(p.h),"L".concat(p.w*x,",").concat(.81*p.h),"L0,".concat(.5*p.h),"L".concat(p.w*x,",").concat(p.h*A),"Z"].join(" ");return b.setAttribute("d",T),b})(n),d=(function(g){var p=g.extend,b=.117,w=.19;return{top:p.h*w,bottom:p.h*w,left:p.w*b,right:p.w*b,w:.766*p.w,h:.62*p.h}})(n);break;case"dodecagon":h=(function(g){var p=g.extend,b=Ct("path"),w=.364,x=.133,A=.135,T=["M".concat(p.w*w,",0"),"L".concat(.636*p.w,",0"),"L".concat(.867*p.w,",").concat(p.h*A),"L".concat(p.w,",").concat(p.h*w),"L".concat(p.w,",").concat(.636*p.h),"L".concat(.867*p.w,",").concat(.865*p.h),"L".concat(.636*p.w,",").concat(p.h),"L".concat(p.w*w,",").concat(p.h),"L".concat(p.w*x,",").concat(.865*p.h),"L0,".concat(.636*p.h),"L0,".concat(p.h*w),"L".concat(p.w*x,",").concat(p.h*A),"Z"].join(" ");return b.setAttribute("d",T),b})(n),d=(function(g){var p=g.extend,b=.133,w=.135;return{top:p.h*w,bottom:p.h*w,left:p.w*b,right:p.w*b,w:.734*p.w,h:.73*p.h}})(n);break;case"pie":h=(function(g){var p=g.extend,b=Ct("path"),w=ue("adj1",g,360),x=ue("adj2",g,270),A=p.w/2,T=p.h/2,C=p.w/2,E=p.h/2,k=Kn(w,C,E,A,T),D=k[0],L=k[1],R=Kn(x,C,E,A,T),P=R[0],O=R[1],F=Pp(w,x),z="M".concat(C,",").concat(E,", L").concat(D," ").concat(L," A ").concat(A," ").concat(T," 0 ").concat(F," ").concat(1," ").concat(P," ").concat(O," Z");return b.setAttribute("d",z),b})(n),d=kp(n);break;case"arc":h=(function(g){var p=g.extend,b=Ct("path"),w=ue("adj1",g,270),x=ue("adj2",g,0),A=p.w/2,T=p.h/2,C=p.w/2,E=p.h/2,k=Kn(w,C,E,A,T),D=k[0],L=k[1],R=Kn(x,C,E,A,T),P=R[0],O=R[1],F=Pp(w,x),z="M".concat(D,",").concat(L," A ").concat(A," ").concat(T," 0 ").concat(F," ").concat(1," ").concat(P," ").concat(O);return b.setAttribute("d",z),b})(n),v=!1;break;case"bracketPair":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj",g,.16667*Math.min(p.w,p.h)),x=["M".concat(w,",").concat(p.h),"Q".concat(0,",").concat(p.h," ").concat(0,",").concat(p.h-w),"L".concat(0,",").concat(w),"Q".concat(0,",").concat(0," ").concat(w,",").concat(0),"M".concat(p.w-w,",").concat(0),"Q".concat(p.w,",").concat(0," ").concat(p.w,",").concat(w),"L".concat(p.w,",").concat(p.h-w),"Q".concat(p.w,",").concat(p.h," ").concat(p.w-w,",").concat(p.h)].join(" ");return b.setAttribute("d",x),b})(n),d=(function(g){var p=g.extend,b=.285*St("adj",g,.16667*Math.min(p.w,p.h));return{top:b,bottom:b,left:b,right:b,w:p.w-2*b,h:p.h-2*b}})(n),v=!1;break;case"bracePair":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj",g,.083335*Math.min(p.w,p.h)),x=["M".concat(2*w,",").concat(p.h),"Q".concat(w,",").concat(p.h," ").concat(w,",").concat(p.h-w),"L".concat(w,",").concat(p.h/2+w),"Q".concat(w,",").concat(p.h/2," ").concat(0,",").concat(p.h/2),"Q".concat(w,",").concat(p.h/2," ").concat(w,",").concat(p.h/2-w),"L".concat(w,",").concat(w),"Q".concat(w,",").concat(0," ").concat(2*w,",").concat(0),"M".concat(p.w-2*w,",").concat(0),"Q".concat(p.w-w,",").concat(0," ").concat(p.w-w,",").concat(w),"L".concat(p.w-w,",").concat(p.h/2-w),"Q".concat(p.w-w,",").concat(p.h/2," ").concat(p.w,",").concat(p.h/2),"Q".concat(p.w-w,",").concat(p.h/2," ").concat(p.w-w,",").concat(p.h/2+w),"L".concat(p.w-w,",").concat(p.h-w),"Q".concat(p.w-w,",").concat(p.h," ").concat(p.w-2*w,",").concat(p.h)].join(" ");return b.setAttribute("d",x),b})(n),d=(function(g){var p=g.extend,b=.285*St("adj",g,.16667*Math.min(p.w,p.h));return{top:b,bottom:b,left:b,right:b,w:p.w-2*b,h:p.h-2*b}})(n),v=!1;break;case"chord":h=(function(g){var p=g.extend,b=Ct("path"),w=ue("adj1",g,45),x=ue("adj2",g,270),A=p.w/2,T=p.h/2,C=p.w/2,E=p.h/2,k=Kn(w,C,E,A,T),D=k[0],L=k[1],R=Kn(x,C,E,A,T),P=R[0],O=R[1],F=Pp(w,x),z="M".concat(D," ").concat(L," A ").concat(A," ").concat(T," 0 ").concat(F," ").concat(1," ").concat(P," ").concat(O," Z");return b.setAttribute("d",z),b})(n),d=kp(n);break;case"teardrop":h=(function(g){var p=g.extend,b=Ct("path"),w=ue("adj",g,1),x=p.w/2,A=p.h/2,T=p.w/2,C=p.h/2,E=Kn(0,T,C,x,A),k=E[0],D=E[1],L=Kn(270,T,C,x,A),R=L[0],P=L[1],O=Pp(0,270),F="M".concat(k," ").concat(D," A ").concat(x," ").concat(A," 0 ").concat(O," ").concat(1," ").concat(R," ").concat(P),z=x*w,G=T+z,U=C-A*z/(p.w/2),K=(p.w/2+G)/2,W=(p.h/2+U)/2;return F+=" Q".concat(K,",0 ").concat(G,",").concat(U),F+=" Q".concat(p.w,",").concat(W," ").concat(T+x,",").concat(C),b.setAttribute("d",F),b})(n),d=kp(n);break;case"frame":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj1",g,.12*Math.min(p.w,p.h)),x=["M0,0","L".concat(p.w,",0"),"L".concat(p.w,",").concat(p.h),"L0,".concat(p.h),"Z","M".concat(w,",").concat(w),"L".concat(w,",").concat(p.h-w),"L".concat(p.w-w,",").concat(p.h-w),"L".concat(p.w-w,",").concat(w),"Z"].join(" ");return b.setAttribute("d",x),b})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.12*Math.min(p.w,p.h));return{top:b,bottom:b,left:b,right:b,w:p.w-2*b,h:p.h-2*b}})(n);break;case"halfFrame":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj1",g,.333*Math.min(p.w,p.h)),x=Math.min(St("adj2",g,.333*Math.min(p.w,p.h)),p.w*(1-w/p.h)),A=["M0,0","L".concat(p.w,",0"),"L".concat(p.w*(1-w/p.h),",").concat(w),"L".concat(x,",").concat(w),"L".concat(x,",").concat(p.h*(1-x/p.w)),"L0,".concat(p.h),"Z"].join(" ");return b.setAttribute("d",A),b})(n);break;case"corner":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj1",g,.5*Math.min(p.w,p.h)),x=St("adj2",g,.5*Math.min(p.w,p.h)),A=["M0,0","L".concat(x,",0"),"L".concat(x,",").concat(p.h-w),"L".concat(p.w,",").concat(p.h-w),"L".concat(p.w,",").concat(p.h),"L0,".concat(p.h),"Z"].join(" ");return b.setAttribute("d",A),b})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h));return{top:p.h-b,bottom:0,left:0,right:0,w:p.w,h:b}})(n);break;case"diagStripe":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj",g,.5*Math.min(p.w,p.h)),x=p.w*w/p.h,A=["M".concat(x,",0"),"L".concat(p.w,",0"),"L0,".concat(p.h),"L0,".concat(w),"Z"].join(" ");return b.setAttribute("d",A),b})(n),d=(function(g){var p=g.extend,b=ue("adj",g,.5),w=.5*(1-b)*p.h,x=.5*(1-b)*p.w;return{top:0,bottom:w,left:0,right:x,w:p.w-x,h:p.h-w}})(n);break;case"plus":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj",g,.25*Math.min(p.w,p.h)),x=["M".concat(w,",0"),"L".concat(p.w-w,",0"),"L".concat(p.w-w,",").concat(w),"L".concat(p.w,",").concat(w),"L".concat(p.w,",").concat(p.h-w),"L".concat(p.w-w,",").concat(p.h-w),"L".concat(p.w-w,",").concat(p.h),"L".concat(w,",").concat(p.h),"L".concat(w,",").concat(p.h-w),"L0,".concat(p.h-w),"L0,".concat(w),"L".concat(w,",").concat(w),"Z"].join(" ");return b.setAttribute("d",x),b})(n),d=(function(g){var p=g.extend,b=St("adj",g,.25*Math.min(p.w,p.h));return{top:b,bottom:b,left:0,right:0,w:p.w,h:p.h-2*b}})(n);break;case"plaque":h=(function(g){var p=g.extend,b=Ct("path"),w=St("adj",g,.16667*Math.min(p.w,p.h)),x=["M".concat(w,",0"),"L".concat(p.w-w,",0"),"Q".concat(p.w-w,",").concat(w," ").concat(p.w,",").concat(w),"L".concat(p.w,",").concat(p.h-w),"Q".concat(p.w-w,",").concat(p.h-w," ").concat(p.w-w,",").concat(p.h),"L".concat(w,",").concat(p.h),"Q".concat(w,",").concat(p.h-w," 0,").concat(p.h-w),"L0,".concat(w),"Q".concat(w,",").concat(w," ").concat(w,",0"),"Z"].join(" ");return b.setAttribute("d",x),b})(n),d=(function(g){var p=g.extend,b=St("adj",g,.16667*Math.min(p.w,p.h));return{top:.72*b,bottom:.72*b,left:.72*b,right:.72*b,w:p.w-1.44*b,h:p.w-1.44*b}})(n);break;case"can":h=(function(g){var p=g.extend,b=g.background,w=Ct("g"),x=Ct("path"),A=St("adj",g,.25*Math.min(p.w,p.h)),T=["M0,".concat(A/2),"L0,".concat(p.h-A/2),"A".concat(p.w/2,",").concat(A/2," 0 0 0 ").concat(p.w,",").concat(p.h-A/2),"L".concat(p.w,",").concat(A/2),"A".concat(p.w/2,",").concat(A/2," 0 0 1 0,").concat(A/2),"Z"].join(" ");x.setAttribute("d",T);var C=Ct("ellipse"),E=p.w/2,k=A/2,D=p.w/2,L=A/2;return C.setAttribute("cx",E+"px"),C.setAttribute("cy",k+"px"),C.setAttribute("rx",D+"px"),C.setAttribute("ry",L+"px"),b?.type==="solidFill"&&C.setAttribute("fill",Ke(b,{light:.5})||"transparent"),w.appendChild(x),w.appendChild(C),w})(n),d=(function(g){var p=g.extend,b=St("adj",g,.25*Math.min(p.w,p.h));return{top:b,bottom:0,left:0,right:0,w:p.w,h:p.h-b}})(n);break;case"cube":h=(function(g){var p=g.extend,b=g.background,w=St("adj",g,.25*Math.min(p.w,p.h)),x=Ct("g"),A=Ct("path"),T=["M0,".concat(w),"L".concat(p.w-w,",").concat(w),"L".concat(p.w-w,",").concat(p.h),"L0,".concat(p.h),"Z"].join(" ");A.setAttribute("d",T);var C=Ct("path"),E=["M0,".concat(w),"L".concat(w,",0"),"L".concat(p.w,",0"),"L".concat(p.w-w,",").concat(w),"Z"].join(" ");C.setAttribute("d",E),b?.type==="solidFill"&&C.setAttribute("fill",Ke(b,{light:.8})||"transparent");var k=Ct("path"),D=["M".concat(p.w,",0"),"L".concat(p.w-w,",").concat(w),"L".concat(p.w-w,",").concat(p.h),"L".concat(p.w,",").concat(p.h-w),"Z"].join(" ");return k.setAttribute("d",D),b?.type==="solidFill"&&k.setAttribute("fill",Ke(b,{dark:.6})||"transparent"),x.appendChild(A),x.appendChild(C),x.appendChild(k),x})(n),d=(function(g){var p=g.extend,b=St("adj",g,.25*Math.min(p.w,p.h));return{top:b,bottom:0,left:0,right:b,w:p.w-b,h:p.h-b}})(n);break;case"bevel":h=(function(g){var p=g.extend,b=g.background,w=St("adj",g,.125*Math.min(p.w,p.h)),x=Ct("g"),A=Ct("path"),T=["M".concat(w,",").concat(w),"L".concat(p.w-w,",").concat(w),"L".concat(p.w-w,",").concat(p.h-w),"L".concat(w,",").concat(p.h-w),"Z"].join(" ");A.setAttribute("d",T);var C=Ct("path"),E=["M0,0","L".concat(w,",").concat(w),"L".concat(p.w-w,",").concat(w),"L".concat(p.w,",0"),"Z"].join(" ");C.setAttribute("d",E),b?.type==="solidFill"&&C.setAttribute("fill",Ke(b,{light:.8})||"transparent");var k=Ct("path"),D=["M".concat(p.w,",0"),"L".concat(p.w-w,",").concat(w),"L".concat(p.w-w,",").concat(p.h-w),"L".concat(p.w,",").concat(p.h),"Z"].join(" ");k.setAttribute("d",D),b?.type==="solidFill"&&k.setAttribute("fill",Ke(b,{dark:.6})||"transparent");var L=Ct("path"),R=["M".concat(p.w,",").concat(p.h),"L".concat(p.w-w,",").concat(p.h-w),"L".concat(w,",").concat(p.h-w),"L0,".concat(p.h),"Z"].join(" ");L.setAttribute("d",R),b?.type==="solidFill"&&L.setAttribute("fill",Ke(b,{dark:.625})||"transparent");var P=Ct("path"),O=["M0,".concat(p.h),"L".concat(w,",").concat(p.h-w),"L".concat(w,",").concat(w),"L0,0","Z"].join(" ");return P.setAttribute("d",O),b?.type==="solidFill"&&P.setAttribute("fill",Ke(b,{light:.6})||"transparent"),x.appendChild(A),x.appendChild(C),x.appendChild(k),x.appendChild(L),x.appendChild(P),x})(n),d=(function(g){var p=g.extend,b=St("adj",g,.125*Math.min(p.w,p.h));return{top:b,bottom:b,left:b,right:b,w:p.w-2*b,h:p.h-2*b}})(n);break;case"donut":h=(function(g){var p=g.extend,b=St("adj",g,.25*Math.min(p.w,p.h)),w=Ct("path"),x=["M0,".concat(p.h/2),"A".concat(p.w/2,",").concat(p.h/2," 0 1,1 0,").concat(p.h/2+1),"Z","M".concat(p.w-b,",").concat(p.h/2),"A".concat(p.w/2-b,",").concat(p.h/2-b," 0 1,0 ").concat(p.w-b,",").concat(p.h/2+1),"Z"].join(" ");return w.setAttribute("d",x),w})(n),d=kp(n);break;case"noSmoking":h=(function(g){var p=g.extend,b=St("adj",g,.25*Math.min(p.w,p.h)),w=Ct("path"),x=Math.atan(p.h/p.w),A=b/2/Math.sin(x),T=p.w/2,C=p.h/2,E=-1*p.h/p.w,k=p.h*A/p.w,D=p.w/2-b,L=p.h/2-b,R=-2*D*D*E*k,P=Math.sqrt(Math.pow(2*D*D*E*k,2)-4*(L*L+D*D*E*E)*D*D*(k*k-L*L)),O=2*(L*L+D*D*E*E),F=(R-P)/O,z=E*F+k,G=(R+P)/O,U=E*G+k,K=-p.h*A/p.w,W=-2*D*D*E*K,X=Math.sqrt(Math.pow(2*D*D*E*K,2)-4*(L*L+D*D*E*E)*D*D*(K*K-L*L)),Q=2*(L*L+D*D*E*E),at=(W-X)/Q,rt=E*at+K,Rt=(W+X)/Q,Mt=E*Rt+K,xt=["M0,".concat(p.h/2),"A".concat(p.w/2,",").concat(p.h/2," 0 1,1 0,").concat(p.h/2+1),"Z","M".concat(T+G,",").concat(C-U),"A".concat(D,",").concat(L," 0 0 0 ").concat(T+F,",").concat(C-z),"Z","M".concat(T+at,",").concat(C-rt),"A".concat(D,",").concat(L," 0 0 0 ").concat(T+Rt,",").concat(C-Mt),"Z"].join(" ");return w.setAttribute("d",xt),w})(n),d=kp(n);break;case"rightArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=St("adj2",g,.5*Math.min(p.w,p.h)),x=Ct("path"),A=["M0,".concat(p.h/2-b/2),"L".concat(p.w-w,",").concat(p.h/2-b/2),"L".concat(p.w-w,",0"),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-w,",").concat(p.h),"L".concat(p.w-w,",").concat(p.h/2+b/2),"L0,".concat(p.h/2+b/2),"Z"].join(" ");return x.setAttribute("d",A),x})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=b*St("adj2",g,.5*Math.min(p.w,p.h))/p.h;return{top:p.h/2-b/2,bottom:p.h/2-b/2,left:0,right:w,w:p.w-w,h:b}})(n);break;case"leftArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=St("adj2",g,.5*Math.min(p.w,p.h)),x=Ct("path"),A=["M0,".concat(p.h/2),"L".concat(w,",0"),"L".concat(w,",").concat(p.h/2-b/2),"L".concat(p.w,",").concat(p.h/2-b/2),"L".concat(p.w,",").concat(p.h/2+b/2),"L".concat(w,",").concat(p.h/2+b/2),"L".concat(w,",").concat(p.h),"Z"].join(" ");return x.setAttribute("d",A),x})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=b*St("adj2",g,.5*Math.min(p.w,p.h))/p.h;return{top:p.h/2-b/2,bottom:p.h/2-b/2,left:w,right:0,w:p.w-w,h:b}})(n);break;case"upArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=St("adj2",g,.5*Math.min(p.w,p.h)),x=Ct("path"),A=["M".concat(p.w/2,",0"),"L".concat(p.w,",").concat(w),"L".concat(p.w/2+b/2,",").concat(w),"L".concat(p.w/2+b/2,",").concat(p.h),"L".concat(p.w/2-b/2,",").concat(p.h),"L".concat(p.w/2-b/2,",").concat(w),"L0,".concat(w),"Z"].join(" ");return x.setAttribute("d",A),x})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=b*St("adj2",g,.5*Math.min(p.w,p.h))/p.w;return{top:w,bottom:0,left:p.w/2-b/2,right:p.w/2-b/2,w:b,h:p.h-w}})(n);break;case"downArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=St("adj2",g,.5*Math.min(p.w,p.h)),x=Ct("path"),A=["M".concat(p.w/2,",").concat(p.h),"L0,".concat(p.h-w),"L".concat(p.w/2-b/2,",").concat(p.h-w),"L".concat(p.w/2-b/2,",0"),"L".concat(p.w/2+b/2,",0"),"L".concat(p.w/2+b/2,",").concat(p.h-w),"L".concat(p.w,",").concat(p.h-w),"Z"].join(" ");return x.setAttribute("d",A),x})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=b*St("adj2",g,.5*Math.min(p.w,p.h))/p.w;return{top:0,bottom:w,left:p.w/2-b/2,right:p.w/2-b/2,w:b,h:p.h-w}})(n);break;case"leftRightArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=St("adj2",g,.5*Math.min(p.w,p.h)),x=Ct("path"),A=["M0,".concat(p.h/2),"L".concat(w,",0"),"L".concat(w,",").concat(p.h/2-b/2),"L".concat(p.w-w,",").concat(p.h/2-b/2),"L".concat(p.w-w,",0"),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-w,",").concat(p.h),"L".concat(p.w-w,",").concat(p.h/2+b/2),"L".concat(w,",").concat(p.h/2+b/2),"L".concat(w,",").concat(p.h),"Z"].join(" ");return x.setAttribute("d",A),x})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=b*St("adj2",g,.5*Math.min(p.w,p.h))/p.h;return{top:p.h/2-b/2,bottom:p.h/2-b/2,left:w,right:w,w:p.w-2*w,h:b}})(n);break;case"upDownArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=St("adj2",g,.5*Math.min(p.w,p.h)),x=Ct("path"),A=["M".concat(p.w/2,",").concat(p.h),"L0,".concat(p.h-w),"L".concat(p.w/2-b/2,",").concat(p.h-w),"L".concat(p.w/2-b/2,",").concat(w),"L0,".concat(w),"L".concat(p.w/2,",0"),"L".concat(p.w,",").concat(w),"L".concat(p.w/2+b/2,",").concat(w),"L".concat(p.w/2+b/2,",").concat(p.h-w),"L".concat(p.w,",").concat(p.h-w),"Z"].join(" ");return x.setAttribute("d",A),x})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.5*Math.min(p.w,p.h)),w=b*St("adj2",g,.5*Math.min(p.w,p.h))/p.w;return{top:w,bottom:w,left:p.w/2-b/2,right:p.w/2-b/2,w:b,h:p.h-2*w}})(n);break;case"quadArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.225*Math.min(p.w,p.h)),w=St("adj2",g,.225*Math.min(p.w,p.h)),x=St("adj3",g,.225*Math.min(p.w,p.h)),A=Ct("path"),T=["M0,".concat(p.h/2),"L".concat(x,",").concat(p.h/2-w),"L".concat(x,",").concat(p.h/2-b/2),"L".concat(p.w/2-b/2,",").concat(p.h/2-b/2),"L".concat(p.w/2-b/2,",").concat(x),"L".concat(p.w/2-w,",").concat(x),"L".concat(p.w/2,",0"),"L".concat(p.w/2+w,",").concat(x),"L".concat(p.w/2+b/2,",").concat(x),"L".concat(p.w/2+b/2,",").concat(p.h/2-b/2),"L".concat(p.w-x,",").concat(p.h/2-b/2),"L".concat(p.w-x,",").concat(p.h/2-w),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-x,",").concat(p.h/2+w),"L".concat(p.w-x,",").concat(p.h/2+b/2),"L".concat(p.w/2+b/2,",").concat(p.h/2+b/2),"L".concat(p.w/2+b/2,",").concat(p.h-x),"L".concat(p.w/2+w,",").concat(p.h-x),"L".concat(p.w/2,",").concat(p.h),"L".concat(p.w/2-w,",").concat(p.h-x),"L".concat(p.w/2-b/2,",").concat(p.h-x),"L".concat(p.w/2-b/2,",").concat(p.h/2+b/2),"L".concat(x,",").concat(p.h/2+b/2),"L".concat(x,",").concat(p.h/2+w),"Z"].join(" ");return A.setAttribute("d",T),A})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.225*Math.min(p.w,p.h)),w=St("adj2",g,.225*Math.min(p.w,p.h)),x=St("adj3",g,.225*Math.min(p.w,p.h)),A=w===0?0:b*x/w/2;return{top:p.h/2-b/2,bottom:p.h/2-b/2,left:A,right:A,w:p.w-2*A,h:b}})(n);break;case"leftRightUpArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.225*Math.min(p.w,p.h)),w=St("adj2",g,.225*Math.min(p.w,p.h)),x=St("adj3",g,.225*Math.min(p.w,p.h)),A=Ct("path");b>2*w&&(b=2*w);var T=["M0,".concat(p.h-w),"L".concat(x,",").concat(p.h-2*w),"L".concat(x,",").concat(p.h-w-b/2),"L".concat(p.w/2-b/2,",").concat(p.h-w-b/2),"L".concat(p.w/2-b/2,",").concat(x),"L".concat(p.w/2-w,",").concat(x),"L".concat(p.w/2,",0"),"L".concat(p.w/2+w,",").concat(x),"L".concat(p.w/2+b/2,",").concat(x),"L".concat(p.w/2+b/2,",").concat(p.h-w-b/2),"L".concat(p.w-x,",").concat(p.h-w-b/2),"L".concat(p.w-x,",").concat(p.h-2*w),"L".concat(p.w,",").concat(p.h-w),"L".concat(p.w-x,",").concat(p.h),"L".concat(p.w-x,",").concat(p.h-w+b/2),"L".concat(x,",").concat(p.h-w+b/2),"L".concat(x,",").concat(p.h),"Z"].join(" ");return A.setAttribute("d",T),A})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.225*Math.min(p.w,p.h)),w=St("adj2",g,.225*Math.min(p.w,p.h)),x=St("adj3",g,.225*Math.min(p.w,p.h)),A=w===0?0:b*x/w/2;return{top:p.h-w-b/2,bottom:w-b/2,left:A,right:A,w:p.w-2*A,h:b}})(n);break;case"bentArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.25*Math.min(p.w,p.h)),w=St("adj2",g,.25*Math.min(p.w,p.h)),x=St("adj3",g,.25*Math.min(p.w,p.h)),A=St("adj4",g,.4375*Math.min(p.w,p.h)),T=Ct("path");b>2*w&&(b=2*w);var C=A-b;C<0&&(C=0);var E=["M0,".concat(p.h),"L0,".concat(w-b/2+A),"A".concat(A," ").concat(A," 0 0 1 ").concat(A," ").concat(w-b/2),"L".concat(p.w-x,",").concat(w-b/2),"L".concat(p.w-x,",0"),"L".concat(p.w,",").concat(w),"L".concat(p.w-x,",").concat(2*w),"L".concat(p.w-x,",").concat(w+b/2),"L".concat(b+C,",").concat(w+b/2),"A".concat(C," ").concat(C," 0 0 0 ").concat(b," ").concat(w+b/2+C),"L".concat(b,",").concat(p.h),"Z"].join(" ");return T.setAttribute("d",E),T})(n);break;case"uturnArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.25*Math.min(p.w,p.h)),w=St("adj2",g,.25*Math.min(p.w,p.h)),x=St("adj3",g,.25*Math.min(p.w,p.h)),A=St("adj4",g,.4375*Math.min(p.w,p.h)),T=St("adj5",g,.75*Math.min(p.w,p.h)),C=Ct("path");b>2*w&&(b=2*w),T<x&&(T=x+b),A>T-x&&(A=T-x);var E=A-b;E>T-x-b&&(E=T-x-b),E<0&&(E=0);var k=w-b/2,D=["M0,".concat(p.h),"L0,".concat(A),"A".concat(A," ").concat(A," 0 0 1 ").concat(A," 0"),"L".concat(p.w-A-k,",0"),"A".concat(A," ").concat(A," 0 0 1 ").concat(p.w-k," ").concat(A),"L".concat(p.w-k,",").concat(T-x),"L".concat(p.w,",").concat(T-x),"L".concat(p.w-w,",").concat(T),"L".concat(p.w-2*w,",").concat(T-x),"L".concat(p.w-w-b/2,",").concat(T-x),"L".concat(p.w-w-b/2,",").concat(b+E),"A".concat(E," ").concat(E," 0 0 0 ").concat(p.w-E-w-b/2," ").concat(b),"L".concat(b+E,",").concat(b),"A".concat(E," ").concat(E," 0 0 0 ").concat(b," ").concat(b+E),"L".concat(b,",").concat(p.h),"Z"].join(" ");return C.setAttribute("d",D),C})(n);break;case"leftUpArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.25*Math.min(p.w,p.h)),w=St("adj2",g,.25*Math.min(p.w,p.h)),x=St("adj3",g,.25*Math.min(p.w,p.h));b>2*w&&(b=2*w);var A=Math.min(p.w,p.h)-2*w;x>A&&(x=A),x<0&&(x=0);var T=w-b/2,C=Ct("path"),E=["M0,".concat(p.h-w),"L".concat(x,",").concat(p.h-2*w),"L".concat(x,",").concat(p.h-w-b/2),"L".concat(p.w-w-b/2,",").concat(p.h-w-b/2),"L".concat(p.w-w-b/2,",").concat(x),"L".concat(p.w-2*w,",").concat(x),"L".concat(p.w-w,",0"),"L".concat(p.w,",").concat(x),"L".concat(p.w-T,",").concat(x),"L".concat(p.w-T,",").concat(p.h-T),"L".concat(x,",").concat(p.h-T),"L".concat(x,",").concat(p.h),"Z"].join(" ");return C.setAttribute("d",E),C})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.25*Math.min(p.w,p.h)),w=St("adj2",g,.25*Math.min(p.w,p.h)),x=St("adj3",g,.25*Math.min(p.w,p.h));b>2*w&&(b=2*w);var A=Math.min(p.w,p.h)-2*w;x>A&&(x=A),x<0&&(x=0);var T=w===0?0:b*x/w/2;return{top:p.h-w-b/2,bottom:w-b/2,left:T,right:w,w:p.w-T-w,h:b}})(n);break;case"bentUpArrow":h=(function(g){var p=g.extend,b=St("adj1",g,.25*Math.min(p.w,p.h)),w=St("adj2",g,.25*Math.min(p.w,p.h)),x=St("adj3",g,.25*Math.min(p.w,p.h));b>2*w&&(b=2*w);var A=Math.min(p.w,p.h)-2*w;x>A&&(x=A),x<0&&(x=0);var T=w-b/2,C=Ct("path"),E=["M0,".concat(p.h),"L0,".concat(p.h-b),"L".concat(p.w-w-b/2,",").concat(p.h-b),"L".concat(p.w-w-b/2,",").concat(x),"L".concat(p.w-2*w,",").concat(x),"L".concat(p.w-w,",0"),"L".concat(p.w,",").concat(x),"L".concat(p.w-T,",").concat(x),"L".concat(p.w-T,",").concat(p.h),"Z"].join(" ");return C.setAttribute("d",E),C})(n),d=(function(g){var p=g.extend,b=St("adj1",g,.25*Math.min(p.w,p.h));return{top:p.h-b,bottom:0,left:0,right:0,w:p.w,h:b}})(n);break;case"curvedRightArrow":h=(function(g){var p=g.extend,b=g.background,w=St("adj1",g,.25*Math.min(p.w,p.h)),x=St("adj2",g,.5*Math.min(p.w,p.h)),A=St("adj3",g,.25*Math.min(p.w,p.h));w>x&&(w=x);var T=x/2-w/2,C=(p.h-x/2-w/2)/2,E=(p.h-T-w)/2,k=Ct("g"),D=Ct("path"),L=["M".concat(p.w,",0"),"A ".concat(p.w," ").concat(C," 0 0 0 ").concat(0," ").concat(C),"L0,".concat(E+w),"A ".concat(p.w," ").concat(E," 0 0 1 ").concat(p.w," ").concat(w),"Z"].join(" ");D.setAttribute("d",L),b?.type==="solidFill"&&D.setAttribute("fill",Ke(b,{dark:.6})||"transparent");var R=Ct("path"),P=["M0,".concat(C),"A ".concat(p.w," ").concat(C," 0 0 0 ").concat(p.w-A," ").concat(p.h-x/2-w/2),"L".concat(p.w-A,",").concat(p.h-x),"L".concat(p.w,",").concat(p.h-x/2),"L".concat(p.w-A,",").concat(p.h),"L".concat(p.w-A,",").concat(p.h-T),"A ".concat(p.w," ").concat(E," 0 0 1 0 ").concat(w+E),"Z"].join(" ");return R.setAttribute("d",P),k.appendChild(D),k.appendChild(R),k})(n);break;case"curvedLeftArrow":h=(function(g){var p=g.extend,b=g.background,w=St("adj1",g,.25*Math.min(p.w,p.h)),x=St("adj2",g,.5*Math.min(p.w,p.h)),A=St("adj3",g,.25*Math.min(p.w,p.h));w>x&&(w=x);var T=x/2-w/2,C=(p.h-x/2-w/2)/2,E=(p.h-T-w)/2,k=Ct("g"),D=Ct("path"),L=["M0,".concat(p.h-x/2),"L".concat(A,",").concat(p.h-x),"L".concat(A,",").concat(p.h-x/2-w/2),"A".concat(p.w," ").concat(C," 0 0 0 ").concat(p.w," ").concat(C),"L".concat(p.w,",").concat(E+w),"A ".concat(p.w," ").concat(E," 0 0 1 ").concat(A," ").concat(p.h-T),"L".concat(A,",").concat(p.h),"Z"].join(" ");D.setAttribute("d",L);var R=Ct("path"),P=["M0,0","A ".concat(p.w," ").concat(C," 0 0 1 ").concat(p.w," ").concat(C),"L".concat(p.w,",").concat(E+w),"A ".concat(p.w," ").concat(E," 0 0 0 ").concat(0," ").concat(w),"Z"].join(" ");return R.setAttribute("d",P),b?.type==="solidFill"&&R.setAttribute("fill",Ke(b,{dark:.6})||"transparent"),k.appendChild(D),k.appendChild(R),k})(n);break;case"curvedUpArrow":h=(function(g){var p=g.extend,b=g.background,w=St("adj1",g,.25*Math.min(p.w,p.h)),x=St("adj2",g,.5*Math.min(p.w,p.h)),A=St("adj3",g,.25*Math.min(p.w,p.h));w>x&&(w=x);var T=x/2-w/2,C=(p.w-x/2-w/2)/2,E=(p.w-T-w)/2,k=Ct("g"),D=Ct("path"),L=["M".concat(p.w-x/2,",").concat(0),"L".concat(p.w-x,",").concat(A),"L".concat(p.w-x/2-w/2,",").concat(A),"A".concat(C," ").concat(p.h," 0 0 1 ").concat(C," ").concat(p.h),"L".concat(C+w,",").concat(p.h),"A".concat(E," ").concat(p.h," 0 0 0 ").concat(p.w-T," ").concat(A),"L".concat(p.w,",").concat(A),"Z"].join(" ");D.setAttribute("d",L);var R=Ct("path"),P=["M".concat(w,",0"),"L".concat(0,",").concat(0),"A ".concat(C," ").concat(p.h," 0 0 0 ").concat(C," ").concat(p.h),"L".concat(C+w,",").concat(p.h),"A ".concat(E," ").concat(p.h," 0 0 1 ").concat(w," ").concat(0),"Z"].join(" ");return R.setAttribute("d",P),b?.type==="solidFill"&&R.setAttribute("fill",Ke(b,{dark:.6})||"transparent"),k.appendChild(D),k.appendChild(R),k})(n);break;case"curvedDownArrow":h=(function(g){var p=g.extend,b=g.background,w=St("adj1",g,.25*Math.min(p.w,p.h)),x=St("adj2",g,.5*Math.min(p.w,p.h)),A=St("adj3",g,.25*Math.min(p.w,p.h));w>x&&(w=x);var T=x/2-w/2,C=(p.w-x/2-w/2)/2,E=(p.w-T-w)/2,k=Ct("g"),D=Ct("path"),L=["M".concat(0,",").concat(p.h),"L".concat(w,",").concat(p.h),"A".concat(E," ").concat(p.h," 0 0 1 ").concat(E+w," ").concat(0),"L".concat(C,",").concat(0),"A".concat(C," ").concat(p.h," 0 0 0 ").concat(0," ").concat(p.h),"Z"].join(" ");D.setAttribute("d",L),b?.type==="solidFill"&&D.setAttribute("fill",Ke(b,{dark:.6})||"transparent");var R=Ct("path"),P=["M".concat(p.w-x/2,",").concat(p.h),"L".concat(p.w-x,",").concat(p.h-A),"L".concat(p.w-x/2-w/2,",").concat(p.h-A),"A ".concat(C," ").concat(p.h," 0 0 0 ").concat(C," ").concat(0),"L".concat(C+w,",").concat(0),"A ".concat(E," ").concat(p.h," 0 0 1 ").concat(p.w-T," ").concat(p.h-A),"L".concat(p.w,",").concat(p.h-A),"Z"].join(" ");return R.setAttribute("d",P),k.appendChild(D),k.appendChild(R),k})(n);break;case"stripedRightArrow":h=(function(g){var p=g.extend,b=Ct("g"),w=Math.min(p.w,p.h),x=ue("adj1",g,.5)*p.h,A=ue("adj2",g,.5)*w,T=w/8,C=w/16,E=w/32,k=5*w/32,D=p.h/2-x/2,L=p.h/2+x/2,R=Ct("path");R.setAttribute("d",["M".concat(0,",").concat(D),"L".concat(E,",").concat(D),"L".concat(E,",").concat(L),"L".concat(0,",").concat(L),"Z"].join(" "));var P=Ct("path");P.setAttribute("d",["M".concat(C,",").concat(D),"L".concat(T,",").concat(D),"L".concat(T,",").concat(L),"L".concat(C,",").concat(L),"Z"].join(" "));var O=Ct("path"),F=["M".concat(k,",").concat(D),"L".concat(p.w-A,",").concat(D),"L".concat(p.w-A,",").concat(0),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-A,",").concat(p.h),"L".concat(p.w-A,",").concat(L),"L".concat(k,",").concat(L),"Z"].join(" ");return O.setAttribute("d",F),b.appendChild(O),b.appendChild(R),b.appendChild(P),b})(n),d=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj1",g,.5)*p.h,x=w*(ue("adj2",g,.5)*b)/p.h;return{top:p.h/2-w/2,bottom:p.h/2-w/2,left:0,right:x,w:p.w-x,h:w}})(n);break;case"notchedRightArrow":h=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj1",g,.5)*p.h,x=ue("adj2",g,.5)*b,A=w*x/p.h,T=p.h/2-w/2,C=p.h/2+w/2,E=Ct("path"),k=["M".concat(0,",").concat(T),"L".concat(p.w-x,",").concat(T),"L".concat(p.w-x,",").concat(0),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-x,",").concat(p.h),"L".concat(p.w-x,",").concat(C),"L".concat(0,",").concat(C),"L".concat(A,",").concat(p.h/2),"Z"].join(" ");return E.setAttribute("d",k),E})(n),d=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj1",g,.5)*p.h,x=ue("adj2",g,.5)*b,A=w*x/p.h,T=w*x/p.h;return{top:p.h/2-w/2,bottom:p.h/2-w/2,left:A,right:T,w:p.w-A-T,h:w}})(n);break;case"homePlate":h=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj",g,.5)*b,x=Ct("path"),A=["M".concat(0,",").concat(0),"L".concat(p.w-w,",").concat(0),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-w,",").concat(p.h),"L".concat(0,",").concat(p.h),"Z"].join(" ");return x.setAttribute("d",A),x})(n),d=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj",g,.5)*b;return{top:0,bottom:0,left:0,right:w/2,w:p.w-w/2,h:p.h}})(n);break;case"chevron":h=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj",g,.5)*b,x=Ct("path"),A=["M".concat(0,",").concat(0),"L".concat(p.w-w,",").concat(0),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-w,",").concat(p.h),"L".concat(0,",").concat(p.h),"L".concat(w,",").concat(p.h/2),"Z"].join(" ");return x.setAttribute("d",A),x})(n),d=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj",g,.5)*b;return{top:0,bottom:0,left:w,right:w,w:p.w-2*w,h:p.h}})(n);break;case"blockArc":h=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=Ct("path"),x=ue("adj1",g,180),A=ue("adj2",g,0),T=St("adj3",g,.25*b),C=p.w/2,E=p.h/2,k=p.w/2,D=p.h/2,L=p.w/2-T,R=p.h/2-T,P=Kn(x,C,E,k,D),O=P[0],F=P[1],z=Kn(A,C,E,k,D),G=z[0],U=z[1],K=Kn(x,C,E,L,R),W=K[0],X=K[1],Q=Kn(A,C,E,L,R),at=Q[0],rt=Q[1],Rt=Pp(x,A),Mt=["M".concat(O,",").concat(F),"A".concat(k," ").concat(D," 0 ").concat(Rt," 1 ").concat(G," ").concat(U),"L".concat(at,",").concat(rt),"A".concat(L," ").concat(R," 0 ").concat(Rt," 0 ").concat(W," ").concat(X),"Z"].join(" ");return w.setAttribute("d",Mt),w})(n),d=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj1",g,180),x=ue("adj2",g,0),A=St("adj3",g,.25*b),T=p.w/2,C=p.h/2,E=p.w/2,k=p.h/2,D=p.w/2-A,L=p.h/2-A,R=Kn(w,T,C,E,k),P=R[0],O=R[1],F=Kn(x,T,C,E,k),z=F[0],G=F[1],U=Kn(w,T,C,D,L),K=U[0],W=U[1],X=Kn(x,T,C,D,L),Q=[[P,O],[z,G],[K,W],[X[0],X[1]]];Q.push(),w>x&&Q.push([p.w,p.h/2]),(x>180&&x<=360&&w<180||w>x&&x>=0&&x<180&&w<180)&&Q.push([0,p.h/2]),(w<x&&w<90&&x>90||w>x&&x>90||w>x&&w<90)&&Q.push([p.w/2,p.h]),(w<x&&w<270&&x>270||w>x&&x>270||w>x&&w<270)&&Q.push([p.w/2,0]);var at=1/0,rt=1/0,Rt=-1/0,Mt=-1/0;return Q.forEach((function(xt){at=Math.min(xt[0],at),rt=Math.min(xt[1],rt),Rt=Math.max(xt[0],Rt),Mt=Math.max(xt[1],Mt)})),{top:rt,bottom:p.h-Mt,left:at,right:p.w-Rt,w:Rt-at,h:Mt-rt}})(n);break;case"foldedCorner":h=(function(g){var p=g.extend,b=g.background,w=Ct("g"),x=Ct("path"),A=St("adj",g,.16667*Math.min(p.w,p.h)),T=["M0,0","L".concat(p.w,",0"),"L".concat(p.w,",").concat(p.h-A),"L".concat(p.w-A,",").concat(p.h),"L".concat(0,",").concat(p.h),"Z"].join(" ");x.setAttribute("d",T);var C=A*Math.cos(Math.PI/4)/Math.cos(Math.PI/6)*Math.cos(75/180*Math.PI),E=Ct("path"),k=["M".concat(p.w-A+C,", ").concat(p.h-A+C),"L".concat(p.w,",").concat(p.h-A),"L".concat(p.w-A,",").concat(p.h),"Z"].join(" ");return E.setAttribute("d",k),b?.type==="solidFill"&&E.setAttribute("fill",Ke(b,{dark:.6})||"transparent"),w.appendChild(x),w.appendChild(E),w})(n),d=(function(g){var p=g.extend,b=St("adj",g,.16667*Math.min(p.w,p.h));return{top:0,bottom:b,left:0,right:0,w:p.w,h:p.h-b}})(n);break;case"rightArrowCallout":h=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj1",g,.25)*b,x=ue("adj2",g,.25)*b,A=ue("adj3",g,.25)*b,T=ue("adj4",g,.64977)*p.w,C=Ct("path"),E=["M".concat(0,",").concat(0),"L".concat(T,",").concat(0),"L".concat(T,",").concat(p.h/2-w/2),"L".concat(p.w-A,",").concat(p.h/2-w/2),"L".concat(p.w-A,",").concat(p.h/2-x),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-A,",").concat(p.h/2+x),"L".concat(p.w-A,",").concat(p.h/2+w/2),"L".concat(T,",").concat(p.h/2+w/2),"L".concat(T,",").concat(p.h),"L".concat(0,",").concat(p.h),"Z"].join(" ");return C.setAttribute("d",E),C})(n),d=(function(g){var p=g.extend,b=ue("adj4",g,.64977)*p.w;return{top:0,bottom:0,left:0,right:p.w-b,w:b,h:p.h}})(n);break;case"leftArrowCallout":h=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj1",g,.25)*b,x=ue("adj2",g,.25)*b,A=ue("adj3",g,.25)*b,T=ue("adj4",g,.64977)*p.w,C=Ct("path"),E=["M".concat(0,",").concat(p.h/2),"L".concat(A,",").concat(p.h/2-x),"L".concat(A,",").concat(p.h/2-w/2),"L".concat(p.w-T,",").concat(p.h/2-w/2),"L".concat(p.w-T,",").concat(0),"L".concat(p.w,",").concat(0),"L".concat(p.w,",").concat(p.h),"L".concat(p.w-T,",").concat(p.h),"L".concat(p.w-T,",").concat(p.h/2+w/2),"L".concat(A,",").concat(p.h/2+w/2),"L".concat(A,",").concat(p.h/2+x),"Z"].join(" ");return C.setAttribute("d",E),C})(n),d=(function(g){var p=g.extend,b=ue("adj4",g,.64977)*p.w;return{top:0,bottom:0,left:p.w-b,right:0,w:b,h:p.h}})(n);break;case"upArrowCallout":h=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj1",g,.25)*b,x=ue("adj2",g,.25)*b,A=ue("adj3",g,.25)*b,T=ue("adj4",g,.64977)*p.h,C=Ct("path"),E=["M".concat(0,",").concat(p.h-T),"L".concat(p.w/2-w/2,",").concat(p.h-T),"L".concat(p.w/2-w/2,",").concat(A),"L".concat(p.w/2-x,",").concat(A),"L".concat(p.w/2,",").concat(0),"L".concat(p.w/2+x,",").concat(A),"L".concat(p.w/2+w/2,",").concat(A),"L".concat(p.w/2+w/2,",").concat(p.h-T),"L".concat(p.w,",").concat(p.h-T),"L".concat(p.w,",").concat(p.h),"L".concat(0,",").concat(p.h),"Z"].join(" ");return C.setAttribute("d",E),C})(n),d=(function(g){var p=g.extend,b=ue("adj4",g,.64977)*p.h;return{top:p.h-b,bottom:0,left:0,right:0,w:p.w,h:b}})(n);break;case"downArrowCallout":h=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj1",g,.25)*b,x=ue("adj2",g,.25)*b,A=ue("adj3",g,.25)*b,T=ue("adj4",g,.64977)*p.h,C=Ct("path"),E=["M".concat(0,",").concat(0),"L".concat(p.w,",").concat(0),"L".concat(p.w,",").concat(T),"L".concat(p.w/2+w/2,",").concat(T),"L".concat(p.w/2+w/2,",").concat(p.h-A),"L".concat(p.w/2+x,",").concat(p.h-A),"L".concat(p.w/2,",").concat(p.h),"L".concat(p.w/2-x,",").concat(p.h-A),"L".concat(p.w/2-w/2,",").concat(p.h-A),"L".concat(p.w/2-w/2,",").concat(T),"L".concat(0,",").concat(T),"Z"].join(" ");return C.setAttribute("d",E),C})(n),d=(function(g){var p=g.extend,b=ue("adj4",g,.64977)*p.h;return{top:0,bottom:p.h-b,left:0,right:0,w:p.w,h:b}})(n);break;case"leftRightArrowCallout":h=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj1",g,.25)*b,x=ue("adj2",g,.25)*b,A=ue("adj3",g,.25)*b,T=ue("adj4",g,.48123)*p.w,C=Ct("path"),E=["M".concat(0,",").concat(p.h/2),"L".concat(A,",").concat(p.h/2-x),"L".concat(A,",").concat(p.h/2-w/2),"L".concat(p.w/2-T/2,",").concat(p.h/2-w/2),"L".concat(p.w/2-T/2,",").concat(0),"L".concat(p.w/2+T/2,",").concat(0),"L".concat(p.w/2+T/2,",").concat(p.h/2-w/2),"L".concat(p.w-A,",").concat(p.h/2-w/2),"L".concat(p.w-A,",").concat(p.h/2-x),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-A,",").concat(p.h/2+x),"L".concat(p.w-A,",").concat(p.h/2+w/2),"L".concat(p.w/2+T/2,",").concat(p.h/2+w/2),"L".concat(p.w/2+T/2,",").concat(p.h),"L".concat(p.w/2-T/2,",").concat(p.h),"L".concat(p.w/2-T/2,",").concat(p.h/2+w/2),"L".concat(A,",").concat(p.h/2+w/2),"L".concat(A,",").concat(p.h/2+x),"Z"].join(" ");return C.setAttribute("d",E),C})(n),d=(function(g){var p=g.extend,b=ue("adj4",g,.48123)*p.w;return{top:0,bottom:0,left:p.w/2-b/2,right:p.w/2-b/2,w:b,h:p.h}})(n);break;case"quadArrowCallout":h=(function(g){var p=g.extend,b=Math.min(p.w,p.h),w=ue("adj1",g,.18515)*b,x=ue("adj2",g,.18515)*b,A=ue("adj3",g,.18515)*b,T=ue("adj4",g,.48123)*p.w,C=ue("adj4",g,.48123)*p.h,E=Ct("path"),k=["M".concat(0,",").concat(p.h/2),"L".concat(A,",").concat(p.h/2-x),"L".concat(A,",").concat(p.h/2-w/2),"L".concat(p.w/2-T/2,",").concat(p.h/2-w/2),"L".concat(p.w/2-T/2,",").concat(p.h/2-C/2),"L".concat(p.w/2-w/2,",").concat(p.h/2-C/2),"L".concat(p.w/2-w/2,",").concat(A),"L".concat(p.w/2-x,",").concat(A),"L".concat(p.w/2,",").concat(0),"L".concat(p.w/2+x,",").concat(A),"L".concat(p.w/2+w/2,",").concat(A),"L".concat(p.w/2+w/2,",").concat(p.h/2-C/2),"L".concat(p.w/2+T/2,",").concat(p.h/2-C/2),"L".concat(p.w/2+T/2,",").concat(p.h/2-w/2),"L".concat(p.w-A,",").concat(p.h/2-w/2),"L".concat(p.w-A,",").concat(p.h/2-x),"L".concat(p.w,",").concat(p.h/2),"L".concat(p.w-A,",").concat(p.h/2+x),"L".concat(p.w-A,",").concat(p.h/2+w/2),"L".concat(p.w/2+T/2,",").concat(p.h/2+w/2),"L".concat(p.w/2+T/2,",").concat(p.h/2+C/2),"L".concat(p.w/2+w/2,",").concat(p.h/2+C/2),"L".concat(p.w/2+w/2,",").concat(p.h-A),"L".concat(p.w/2+x,",").concat(p.h-A),"L".concat(p.w/2,",").concat(p.h),"L".concat(p.w/2-x,",").concat(p.h-A),"L".concat(p.w/2-w/2,",").concat(p.h-A),"L".concat(p.w/2-w/2,",").concat(p.h/2+C/2),"L".concat(p.w/2-T/2,",").concat(p.h/2+C/2),"L".concat(p.w/2-T/2,",").concat(p.h/2+w/2),"L".concat(A,",").concat(p.h/2+w/2),"L".concat(A,",").concat(p.h/2+x),"Z"].join(" ");return E.setAttribute("d",k),E})(n),d=(function(g){var p=g.extend,b=ue("adj4",g,.48123)*p.w,w=ue("adj4",g,.48123)*p.h;return{top:p.h/2-w/2,bottom:p.h/2-w/2,left:p.w/2-b/2,right:p.w/2-b/2,w:b,h:w}})(n)}h&&(v?i?.type==="blipFill"?(function(g,p,b){var w=g.background,x=w===void 0?{}:w,A=g.extend,T=x.base64,C=x.alpha,E=x.fillRect,k=E===void 0?{}:E,D=k.b,L=D===void 0?0:D,R=k.t,P=R===void 0?0:R,O=k.l,F=O===void 0?0:O,z=k.r,G=z===void 0?0:z,U=Ct("defs"),K=Ct("pattern");K.setAttribute("id","background_"+g.uuid),K.setAttribute("patternUnits","userSpaceOnUse"),K.setAttribute("width",A.w+""),K.setAttribute("height",A.h+"");var W=Ct("image");W.setAttribute("href",T),W.setAttribute("preserveAspectRatio","none");var X=A.w*F,Q=A.h*P,at=A.w*(1-F-G),rt=A.h*(1-P-L);W.setAttribute("width",at+""),W.setAttribute("height",rt+""),W.setAttribute("x",X+""),W.setAttribute("y",Q+""),typeof C=="number"&&W.setAttribute("opacity",C+""),K.appendChild(W),U.appendChild(K),p.appendChild(U),b.setAttribute("fill","url(#background_".concat(g.uuid,")"))})(n,f,h):i?.type==="gradFill"?(function(g,p,b){var w=g.background,x=w===void 0?{}:w;g.extend;var A=x.gsList,T=x.lin,C=x.path,E=x.tileRect,k=E===void 0?{}:E,D=Ct("defs"),L=Ct(C==="circle"?"radialGradient":"linearGradient");L.setAttribute("id","background_grad_fill_"+g.uuid);var R=A||[];if(R.sort((function(G,U){return G.pos-U.pos})),R.forEach((function(G){var U=Ct("stop");U.setAttribute("offset","".concat(100*G.pos,"%")),U.setAttribute("stop-color",Ke(G.color)),L.appendChild(U)})),C==="circle"){var P=k.r,O=k.l,F=k.t,z=k.b;P===-1?L.setAttribute("cx","100%"):O===-1&&L.setAttribute("cx","0%"),F===-1?L.setAttribute("cy","0%"):z===-1&&L.setAttribute("cy","100%")}else T?.ang&&L.setAttribute("gradientTransform","rotate(".concat(T.ang,")"));D.appendChild(L),p.appendChild(D),b.setAttribute("fill","url(#background_grad_fill_".concat(g.uuid,")"))})(n,f,h):h.setAttribute("fill",Ke(i)||"transparent"):h.setAttribute("fill","transparent"),r.width?(h.setAttribute("stroke-width",r.width+"px"),h.setAttribute("stroke",Ke(r.color)||"transparent")):h.setAttribute("stroke-width","0"),h.setAttribute("stroke-dasharray",(function(g){return g&&g.type!=="solid"?({sysDot:[1,1],sysDash:[3,1],dash:[4,3],dashDot:[4,3,1,3],lgDash:[8,3],lgDashDot:[8,3,1,3],lgDashDotDot:[8,3,1,3,1,3]}[g.type]||[]).map((function(p){return p*g.width})).join(","):""})(r)),h.setAttribute("stroke-linecap",r.cap&&{sq:"square",rnd:"round",flat:"butt"}[r.cap]||"square"),h.setAttribute("stroke-linejoin",r.lineJoin||"round"),r.lineJoin==="miter"&&h.setAttribute("stroke-miterlimit",r.miterLim+""),f.appendChild(h));var m=[];o&&m.push("scaleX(-1)"),s&&m.push("scaleY(-1)"),f.style.setProperty("transform",m.join(" ")),l.appendChild(f);var y=(function(g,p,b){var w;b===void 0&&(b=!1);var x=g.inheritProps,A=g.props,T=g.paragraphs;if(!T||T.length===0)return null;var C=Vt(Vt({},x),A),E=document.createElement("div");switch(E.className="text-wrapper",E.style.boxSizing="border-box",E.style.position="absolute",E.style.left=p.left+"px",C.vert==="eaVert"?(E.style.writingMode="vertical-rl",E.style.height=p.h+"px"):E.style.width=p.w+"px",C.anchor){case"b":E.style.bottom=p.bottom+"px";break;case"t":E.style.top=p.top+"px";break;case"ctr":E.style.top=p.top+p.h/2+"px",E.style.transform="translateY(-50%)";break;default:b?E.style.top=p.top+"px":(E.style.top=p.top+p.h/2+"px",E.style.transform="translateY(-50%)")}var k=[C.hasOwnProperty("tIns")?Math.floor(C.tIns)+"px":"3px",C.hasOwnProperty("rIns")?Math.floor(C.rIns)+"px":"5px",C.hasOwnProperty("bIns")?Math.floor(C.bIns)+"px":"3px",C.hasOwnProperty("lIns")?Math.floor(C.lIns)+"px":"5px"];E.style.padding=k.join(" ");for(var D={},L=0,R=function(F){var z=Vt(Vt({},F.inheritProps),F.props),G=void 0;if(z.buAutoNum){var U=z.level?+z.level:0;D[U]||(D[U]=0),!((w=F.rows)===null||w===void 0)&&w.length&&D[U]++,Object.keys(D).forEach((function(K){+K>U&&(D[K]=0)})),G=n_(F,D[U],{isFirst:L===0,isLast:T.length-1===L,bodyProps:C})}else G=n_(F,0,{isFirst:L===0,isLast:T.length-1===L,bodyProps:C});E.appendChild(G),L++},P=0,O=T;P<O.length;P++)R(O[P]);return E})(n.textBody,d,n.isTextBox);return y&&l.appendChild(y),a&&l.style.setProperty("transform","rotate(".concat(a,"deg)")),l}function NX(n){var t=document.createElement("div"),e=n.extend;n.chExtend;var r=n.offset;n.chOffset;var i=n.flipV,a=n.flipH,o=n.rotate,s=r.x,l=r.y,u=e.w,c=e.h;t.className="group",t.style.position="absolute",t.style.left=s+"px",t.style.top=l+"px",t.style.width=u+"px",t.style.height=c+"px";var h=[];a&&h.push("scaleX(-1)"),i&&h.push("scaleY(-1)"),o&&h.push("rotate(".concat(o,"deg)")),t.style.transformOrigin="center center",t.style.transform=h.join(" ");for(var f=0;f<n.nodes.length;f++){var d=n.nodes[f],v=void 0;d instanceof r_?v=AE(d):d instanceof rg?v=TE(d):d instanceof XP&&(v=NX(d)),v&&t.appendChild(v)}return t}var so={};function E3(n,t){so[n]||(so[n]=[]),so[n].push(t)}function l0(n,t){if(so[n])for(var e=0;e<so[n].length;e++)so[n][e](t)}function HA(n,t){so?so[n]&&(so[n]=so[n].filter((function(e){return e!==t}))):so[n]=[]}var M3=(function(){function n(t,e,r){this.scale=1,this.wrapper=t,this.pptx=e,this.options=r,this._calcScaleAndRenderPort()}return n.prototype._calcScaleAndRenderPort=function(){var t=this.options.viewPort.width/this.pptx.width;this.scale=t;var e=this.options.viewPort.width,r=this.pptx.height*this.scale;this.renderPort={width:e,height:r,left:0,top:0}},n.prototype.renderSlide=function(t){var e=this.pptx.slides[t],r=document.createElement("div");r.classList.add("pptx-preview-slide-wrapper"),r.classList.add("pptx-preview-slide-wrapper-".concat(t)),r.style.setProperty("width",this.renderPort.width+"px"),r.style.setProperty("height",this.renderPort.height+"px"),r.style.setProperty("position",this.options.mode==="slide"?"absolute":"relative"),this.options.mode==="slide"&&r.style.setProperty("top",(this.options.viewPort.height-this.renderPort.height)/2+"px"),r.style.margin="0 auto 10px",r.style.setProperty("background","#fff"),r.style.setProperty("overflow","hidden"),this._renderBackground(e,r),this._renderSlideMaster(e.slideMaster,r),this._renderSlideLayout(e.slideLayout,r),this._renderSlide(e,r),this.wrapper.append(r)},n.prototype._renderSlideMaster=function(t,e){var r=document.createElement("div");r.classList.add("slide-master-wrapper"),r.style.setProperty("position","absolute"),r.style.setProperty("left","0"),r.style.setProperty("top","0"),r.style.setProperty("width",this.pptx.width+"px"),r.style.setProperty("height",this.pptx.height+"px"),r.style.setProperty("transform","scale(".concat(this.scale,")")),r.style.setProperty("transform-origin","0 0");var i=rv([],t.nodes,!0).filter((function(s){return s.userDrawn}));i.sort((function(s,l){return s.order>l.order?1:-1}));for(var a=0;a<i.length;a++){var o=this._renderNode(i[a]);o&&r.append(o)}e.append(r)},n.prototype._renderSlideLayout=function(t,e){var r=document.createElement("div");r.classList.add("slide-layout-wrapper"),r.style.setProperty("position","absolute"),r.style.setProperty("left","0"),r.style.setProperty("top","0"),r.style.setProperty("width",this.pptx.width+"px"),r.style.setProperty("height",this.pptx.height+"px"),r.style.setProperty("transform","scale(".concat(this.scale,")")),r.style.setProperty("transform-origin","0 0");var i=rv([],t.nodes,!0).filter((function(s){return s.userDrawn}));i.sort((function(s,l){return s.order>l.order?1:-1}));for(var a=0;a<i.length;a++){var o=this._renderNode(i[a]);o&&r.append(o)}e.append(r)},n.prototype._renderSlide=function(t,e){var r=document.createElement("div");r.classList.add("slide-wrapper"),r.style.setProperty("position","absolute"),r.style.setProperty("left","0"),r.style.setProperty("top","0"),r.style.setProperty("width",this.pptx.width+"px"),r.style.setProperty("height",this.pptx.height+"px"),r.style.setProperty("transform","scale(".concat(this.scale,")")),r.style.setProperty("transform-origin","0 0");var i=rv([],t.nodes,!0);i.sort((function(s,l){return s.order>l.order?1:-1}));for(var a=0;a<i.length;a++){var o=this._renderNode(i[a]);o&&r.append(o)}e.append(r)},n.prototype._renderNode=function(t){return t instanceof r_?AE(t):t instanceof rg?TE(t):t instanceof XP?NX(t):t instanceof LX?(function(e){var r=document.createElement("div"),i=e.extend,a=e.offset,o=e.flipV,s=e.flipH,l=e.rotate,u=a.x,c=a.y,h=i.w,f=i.h;r.className="smart-chart-diagram",r.style.position="absolute",r.style.left=u+"px",r.style.top=c+"px",r.style.width=h+"px",r.style.height=f+"px";var d=[];s&&d.push("scaleX(-1)"),o&&d.push("scaleY(-1)"),l&&d.push("rotate(".concat(l,"deg)")),r.style.transformOrigin="center center",r.style.transform=d.join(" ");for(var v=0;v<e.nodes.length;v++){var m=e.nodes[v],y=void 0;m instanceof r_?y=AE(m):m instanceof rg&&(y=TE(m)),y&&r.appendChild(y)}return r})(t):t instanceof DX?(function(e){var r=e.extend,i=e.offset,a=e.tr,o=e.tableGrid.gridCol,s=document.createElement("div");s.style.position="absolute",s.style.left=i.x+"px",s.style.top=i.y+"px",s.style.width=r.w+"px",s.style.height=r.h+"px";var l=document.createElement("table");return l.style.borderCollapse="collapse",a.forEach((function(u){var c=u.props,h=u.td,f=c.height,d=document.createElement("tr");d.style.height=f+"px",h.forEach((function(v,m){var y,g,p=v.props,b=v.inheritTcStyle,w=v.inheritTcTxStyle,x=v.paragraphs;if(!p.vMerge&&!p.hMerge){var A=document.createElement("td");A.style.width=(((y=o[m])===null||y===void 0?void 0:y.width)||30)+"px",p.rowSpan&&A.setAttribute("rowspan",p.rowSpan+""),p.gridSpan&&A.setAttribute("colspan",p.gridSpan+"");var T=p.background||b.background;T&&(A.style.background=Ke(T));var C=Vt(Vt({},b.border),p.border),E=function(U){return U?U.toLowerCase().includes("dash")?"dashed":U.toLowerCase().includes("dot")?"dotted":"solid":"solid"};C.bottom&&(A.style.borderBottom="".concat(C.bottom.width,"px ").concat(E(C.bottom.type)," ").concat(Ke(C.bottom.color))),C.top&&(A.style.borderTop="".concat(C.top.width,"px ").concat(E(C.top.type)," ").concat(Ke(C.top.color))),C.left&&(A.style.borderLeft="".concat(C.left.width,"px ").concat(E(C.left.type)," ").concat(Ke(C.left.color))),C.right&&(A.style.borderRight="".concat(C.right.width,"px ").concat(E(C.right.type)," ").concat(Ke(C.right.color)));var k=document.createElement("div");switch(k.className="text-wrapper",k.style.boxSizing="border-box",k.style.width="100%",k.style.height="100%",k.style.overflow="hidden",k.style.display="flex",k.style.flexDirection="column",p.anchor){case"b":k.style.justifyContent="flex-end";break;case"t":k.style.justifyContent="flex-start";break;case"ctr":k.style.justifyContent="center"}var D=[p.hasOwnProperty("marT")?Math.floor(p.marT)+"px":"3px",p.hasOwnProperty("marR")?Math.floor(p.marR-1)+"px":"5px",p.hasOwnProperty("marB")?Math.floor(p.marB)+"px":"3px",p.hasOwnProperty("marL")?Math.floor(p.marL-1)+"px":"5px"];k.style.padding=D.join(" ");for(var L=Vt({},p),R={},P=x.map((function(U){return Vt(Vt({},U),{props:Vt({align:"l"},U.props),inheritRProps:Vt(Vt({},U.inheritRProps),w)})})),O=0,F=function(U){var K=Vt(Vt({},U.inheritProps),U.props),W=void 0;if(K.buAutoNum){var X=K.level?+K.level:0;R[X]||(R[X]=0),!((g=U.rows)===null||g===void 0)&&g.length&&R[X]++,Object.keys(R).forEach((function(Q){+Q>X&&(R[Q]=0)})),W=n_(U,R[X],{isFirst:O===0,isLast:x.length-1===O,bodyProps:L})}else W=n_(U,0,{isFirst:O===0,isLast:x.length-1===O,bodyProps:L});k.appendChild(W),O++},z=0,G=P;z<G.length;z++)F(G[z]);A.append(k),d.append(A)}})),l.append(d)})),s.append(l),s})(t):t instanceof IX?(function(e){var r=document.createElement("div"),i=e.extend,a=e.offset,o=e.flipV,s=e.flipH,l=e.rotate,u=e.options,c=a.x,h=a.y,f=i.w,d=i.h;r.className="chart-node",r.style.position="absolute",r.style.left=c+"px",r.style.top=h+"px",r.style.width=f+"px",r.style.height=d+"px";var v=[];return s&&v.push("scaleX(-1)"),o&&v.push("scaleY(-1)"),l&&v.push("rotate(".concat(l,"deg)")),r.style.transformOrigin="center center",r.style.transform=v.join(" "),setTimeout((function(){var m=ngt(r,null,{renderer:"svg"});m.setOption(u),E3("destroy",(function(){m&&m.dispose(),m&&(m=null)})),E3("removeSlide",(function(){m&&m.dispose(),m&&(m=null)}))}),0),r})(t):void 0},n.prototype._renderBackground=function(t,e){var r,i=document.createElement("div");i.classList.add("slide-background"),i.style.setProperty("position","absolute"),i.style.setProperty("left","0"),i.style.setProperty("top","0"),i.style.setProperty("width","100%"),i.style.setProperty("height","100%");var a=t.background;if(a.type==="none"&&(a=t.slideLayout.background),a.type==="none"&&(a=t.slideMaster.background),a.type==="blipFill"){var o=a,s=o.base64,l=o.alpha,u=o.fillRect,c=u===void 0?{}:u,h=c.b,f=h===void 0?0:h,d=c.t,v=d===void 0?0:d,m=c.l,y=m===void 0?0:m,g=c.r,p=g===void 0?0:g,b=this.renderPort.width*y,w=this.renderPort.height*v,x=this.renderPort.width*(1-y-p),A=this.renderPort.height*(1-v-f);i.style.backgroundImage="url(".concat(s,")"),i.style.backgroundSize="".concat(x," ").concat(A),i.style.backgroundPosition="".concat(b,"px ").concat(w,"px"),l&&(i.style.opacity=l+""),i.style.backgroundRepeat="no-repeat"}else if(a.type==="solidFill"){var T=Ke(t.background)||Ke(t.slideLayout.background)||Ke(t.slideMaster.background);T?i.style.setProperty("background",T):i.style.setProperty("background","#fff")}else if(a.type==="gradFill")if(a.path==="circle"){var C=a.tileRect||{},E=(f=C.b,v=C.t,y=C.l,"radial-gradient(circle at ");(p=C.r)===-1?E+=" right":y===-1&&(E+=" left"),v===-1?E+=" top":f===-1&&(E+=" bottom"),f||v||y||p||(E+=" center"),E+=",",E+=a.gsList.map((function(D){return"".concat(Ke(D.color)," ").concat(100*D.pos+"%")})).join(","),i.style.setProperty("background",E)}else{var k=((r=a?.lin)===null||r===void 0?void 0:r.ang)||0;E="linear-gradient(".concat(k+90,"deg,"),E+=a.gsList.map((function(D){return"".concat(Ke(D.color)," ").concat(100*D.pos+"%")})).join(","),i.style.setProperty("background",E)}e.append(i)},n})(),m2t=(function(){function n(t,e){this.currentIndex=-1,this.dom=t,this.options=e,this._renderWrapper()}return Object.defineProperty(n.prototype,"slideCount",{get:function(){var t,e;return(e=(t=this.pptx)===null||t===void 0?void 0:t.slides)===null||e===void 0?void 0:e.length},enumerable:!1,configurable:!0}),n.prototype._renderWrapper=function(){var t=document.createElement("div");t.classList.add("pptx-preview-wrapper"),t.setAttribute("position","relative"),t.style.setProperty("background","#000"),t.style.setProperty("width",this.options.width+"px"),this.options.height&&t.style.setProperty("height",this.options.height+"px"),t.style.setProperty("position","relative"),t.style.setProperty("margin","0 auto"),this.options.height&&t.style.setProperty("overflow-y","auto"),this.dom.append(t),this.wrapper=t},n.prototype.renderNextButton=function(){var t=document.createElement("div");t.classList.add("pptx-preview-wrapper-next"),t.style.setProperty("position","absolute"),t.style.setProperty("bottom","20px"),t.style.setProperty("right","80px"),t.style.setProperty("z-index","100"),t.style.setProperty("cursor","pointer"),t.style.setProperty("width","40px"),t.style.setProperty("height","40px"),t.style.setProperty("background","#666666"),t.style.setProperty("border-radius","100%");var e=document.createElement("div");return e.style.setProperty("width","10px"),e.style.setProperty("height","10px"),e.style.setProperty("border-left","2px solid #fff"),e.style.setProperty("border-bottom","2px solid #fff"),e.style.setProperty("transform","rotate(225deg)"),e.style.setProperty("position","absolute"),e.style.setProperty("top","15px"),e.style.setProperty("left","15px"),t.append(e),t},n.prototype.renderPreButton=function(){var t=document.createElement("div");t.classList.add("pptx-preview-wrapper-next"),t.style.setProperty("position","absolute"),t.style.setProperty("bottom","20px"),t.style.setProperty("right","140px"),t.style.setProperty("z-index","100"),t.style.setProperty("cursor","pointer"),t.style.setProperty("width","40px"),t.style.setProperty("height","40px"),t.style.setProperty("background","#666666"),t.style.setProperty("border-radius","100%");var e=document.createElement("div");return e.style.setProperty("width","10px"),e.style.setProperty("height","10px"),e.style.setProperty("border-left","2px solid #fff"),e.style.setProperty("border-bottom","2px solid #fff"),e.style.setProperty("transform","rotate(45deg)"),e.style.setProperty("position","absolute"),e.style.setProperty("top","15px"),e.style.setProperty("left","15px"),t.append(e),t},n.prototype.updatePagination=function(){var t=this.wrapper.querySelector(".pptx-preview-wrapper-pagination");t&&(t.innerText="".concat(this.currentIndex+1,"/").concat(this.slideCount))},n.prototype.renderPagination=function(t){var e=document.createElement("div");e.classList.add("pptx-preview-wrapper-pagination"),e.innerText="".concat(this.currentIndex+1,"/").concat(this.slideCount),e.style.setProperty("position","absolute"),e.style.setProperty("bottom","33px"),e.style.setProperty("right","20px"),e.style.setProperty("color","#666666"),e.style.setProperty("font-size","14px"),e.style.setProperty("z-index","100"),t.append(e)},n.prototype.removeCurrentSlide=function(){var t=this.wrapper.querySelector(".pptx-preview-slide-wrapper-".concat(this.currentIndex));t&&this.wrapper.removeChild(t),l0("removeSlide")},n.prototype.renderNextSlide=function(){this.removeCurrentSlide(),this.currentIndex=this.currentIndex<this.slideCount-1?this.currentIndex+1:0,this.htmlRender.renderSlide(this.currentIndex),this.updatePagination()},n.prototype.renderPreSlide=function(){this.removeCurrentSlide(),this.currentIndex=this.currentIndex>0?this.currentIndex-1:this.slideCount-1,this.htmlRender.renderSlide(this.currentIndex),this.updatePagination()},n.prototype._addPre=function(t){},n.prototype.preview=function(t){var e=this;return l0("destroy"),HA("destroy"),new Promise((function(r,i){e.wrapper.innerHTML="";var a=e.pptx=new b3;a.load(t).then((function(){try{var o=e.htmlRender=new M3(e.wrapper,a,{viewPort:{width:e.options.width,height:e.options.height},mode:e.options.mode});if(e.options.mode==="slide"){var s=e.renderNextButton();s.onclick=function(){e.renderNextSlide()},e.wrapper.append(s);var l=e.renderPreButton();l.onclick=function(){e.renderPreSlide()},e.wrapper.append(l),e.renderPagination(e.wrapper),e._addPre(e.wrapper),e.currentIndex=0,o.renderSlide(0)}else for(var u=0;u<a.slides.length;u++)o.renderSlide(u);r(a)}catch(c){i(c)}})).catch((function(o){i(o)}))}))},n.prototype.load=function(t){var e=this;return l0("destroy"),HA("destroy"),new Promise((function(r,i){e.wrapper.innerHTML="";var a=e.pptx=new b3;a.load(t).then((function(){try{e.htmlRender=new M3(e.wrapper,a,{viewPort:{width:e.options.width,height:e.options.height},mode:e.options.mode}),r(a)}catch(o){i(o)}})).catch((function(o){i(o)}))}))},n.prototype.renderSingleSlide=function(t){this.removeCurrentSlide(),this.currentIndex=t,this.htmlRender.renderSlide(this.currentIndex)},n.prototype.destroy=function(){l0("destroy"),HA("destroy")},n})();function y2t(n,t){return new m2t(n,t)}const b2t=n=>{const{url:t}=n,e=yt.useRef(null),r=async()=>{if(!e.current)return;const i=y2t(e.current,{width:960,height:540}),o=await(await fetch(t)).arrayBuffer();i.preview(o)};return yt.useEffect(()=>{r()},[t]),$t.jsx("div",{ref:e})},_2t=n=>{const{data:t,i18n:e}=n,r=(a,o)=>a==="markdown"?$t.jsx(N4,{url:o}):a==="pdf"?$t.jsx(uot,{url:o,...n}):a==="docx"?$t.jsx(aut,{url:o,...n}):a==="pptx"?$t.jsx(b2t,{url:o,...n}):null;return(()=>{const{url:a}=t,o=t?.metadata?.content_type;if(!(!o||!a))return o==="image"?$t.jsx("img",{src:a,className:"w-full"}):o==="video"?$t.jsx("video",{src:a,className:"w-full",controls:!0}):$t.jsx(ng.Collapse,{size:"small",defaultActiveKey:["preview"],classNames:{root:"bg-transparent",body:"p-4!"},items:[{key:"preview",label:e?.labels?.preview??"Preview",children:r(o,a)}]})})()},w2t=n=>{const{data:t,i18n:e}=n;return $t.jsx(ng.Collapse,{size:"small",classNames:{root:"bg-transparent",body:"p-4!"},items:[{key:"ai-interpretation",label:e?.labels?.aiInterpretation??"AI Interpretation",children:$t.jsx(N4,{content:t?.metadata?.ai_insights})}]})},x2t=(n,t)=>{const e=new Array(n.length+t.length);for(let r=0;r<n.length;r++)e[r]=n[r];for(let r=0;r<t.length;r++)e[n.length+r]=t[r];return e},S2t=(n,t)=>({classGroupId:n,validator:t}),OX=(n=new Map,t=null,e)=>({nextPart:n,validators:t,classGroupId:e}),i_="-",P3=[],A2t="arbitrary..",T2t=n=>{const t=E2t(n),{conflictingClassGroups:e,conflictingClassGroupModifiers:r}=n;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return C2t(o);const s=o.split(i_),l=s[0]===""&&s.length>1?1:0;return BX(s,l,t)},getConflictingClassGroupIds:(o,s)=>{if(s){const l=r[o],u=e[o];return l?u?x2t(u,l):l:u||P3}return e[o]||P3}}},BX=(n,t,e)=>{if(n.length-t===0)return e.classGroupId;const i=n[t],a=e.nextPart.get(i);if(a){const u=BX(n,t+1,a);if(u)return u}const o=e.validators;if(o===null)return;const s=t===0?n.join(i_):n.slice(t).join(i_),l=o.length;for(let u=0;u<l;u++){const c=o[u];if(c.validator(s))return c.classGroupId}},C2t=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=n.slice(1,-1),e=t.indexOf(":"),r=t.slice(0,e);return r?A2t+r:void 0})(),E2t=n=>{const{theme:t,classGroups:e}=n;return M2t(e,t)},M2t=(n,t)=>{const e=OX();for(const r in n){const i=n[r];YP(i,e,r,t)}return e},YP=(n,t,e,r)=>{const i=n.length;for(let a=0;a<i;a++){const o=n[a];P2t(o,t,e,r)}},P2t=(n,t,e,r)=>{if(typeof n=="string"){k2t(n,t,e);return}if(typeof n=="function"){D2t(n,t,e,r);return}L2t(n,t,e,r)},k2t=(n,t,e)=>{const r=n===""?t:FX(t,n);r.classGroupId=e},D2t=(n,t,e,r)=>{if(I2t(n)){YP(n(r),t,e,r);return}t.validators===null&&(t.validators=[]),t.validators.push(S2t(e,n))},L2t=(n,t,e,r)=>{const i=Object.entries(n),a=i.length;for(let o=0;o<a;o++){const[s,l]=i[o];YP(l,FX(t,s),e,r)}},FX=(n,t)=>{let e=n;const r=t.split(i_),i=r.length;for(let a=0;a<i;a++){const o=r[a];let s=e.nextPart.get(o);s||(s=OX(),e.nextPart.set(o,s)),e=s}return e},I2t=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,R2t=n=>{if(n<1)return{get:()=>{},set:()=>{}};let t=0,e=Object.create(null),r=Object.create(null);const i=(a,o)=>{e[a]=o,t++,t>n&&(t=0,r=e,e=Object.create(null))};return{get(a){let o=e[a];if(o!==void 0)return o;if((o=r[a])!==void 0)return i(a,o),o},set(a,o){a in e?e[a]=o:i(a,o)}}},CE="!",k3=":",N2t=[],D3=(n,t,e,r,i)=>({modifiers:n,hasImportantModifier:t,baseClassName:e,maybePostfixModifierPosition:r,isExternal:i}),O2t=n=>{const{prefix:t,experimentalParseClassName:e}=n;let r=i=>{const a=[];let o=0,s=0,l=0,u;const c=i.length;for(let m=0;m<c;m++){const y=i[m];if(o===0&&s===0){if(y===k3){a.push(i.slice(l,m)),l=m+1;continue}if(y==="/"){u=m;continue}}y==="["?o++:y==="]"?o--:y==="("?s++:y===")"&&s--}const h=a.length===0?i:i.slice(l);let f=h,d=!1;h.endsWith(CE)?(f=h.slice(0,-1),d=!0):h.startsWith(CE)&&(f=h.slice(1),d=!0);const v=u&&u>l?u-l:void 0;return D3(a,d,f,v)};if(t){const i=t+k3,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):D3(N2t,!1,o,void 0,!0)}if(e){const i=r;r=a=>e({className:a,parseClassName:i})}return r},B2t=n=>{const t=new Map;return n.orderSensitiveModifiers.forEach((e,r)=>{t.set(e,1e6+r)}),e=>{const r=[];let i=[];for(let a=0;a<e.length;a++){const o=e[a],s=o[0]==="[",l=t.has(o);s||l?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},F2t=n=>({cache:R2t(n.cacheSize),parseClassName:O2t(n),sortModifiers:B2t(n),...T2t(n)}),V2t=/\s+/,z2t=(n,t)=>{const{parseClassName:e,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=n.trim().split(V2t);let l="";for(let u=s.length-1;u>=0;u-=1){const c=s[u],{isExternal:h,modifiers:f,hasImportantModifier:d,baseClassName:v,maybePostfixModifierPosition:m}=e(c);if(h){l=c+(l.length>0?" "+l:l);continue}let y=!!m,g=r(y?v.substring(0,m):v);if(!g){if(!y){l=c+(l.length>0?" "+l:l);continue}if(g=r(v),!g){l=c+(l.length>0?" "+l:l);continue}y=!1}const p=f.length===0?"":f.length===1?f[0]:a(f).join(":"),b=d?p+CE:p,w=b+g;if(o.indexOf(w)>-1)continue;o.push(w);const x=i(g,y);for(let A=0;A<x.length;++A){const T=x[A];o.push(b+T)}l=c+(l.length>0?" "+l:l)}return l},G2t=(...n)=>{let t=0,e,r,i="";for(;t<n.length;)(e=n[t++])&&(r=VX(e))&&(i&&(i+=" "),i+=r);return i},VX=n=>{if(typeof n=="string")return n;let t,e="";for(let r=0;r<n.length;r++)n[r]&&(t=VX(n[r]))&&(e&&(e+=" "),e+=t);return e},H2t=(n,...t)=>{let e,r,i,a;const o=l=>{const u=t.reduce((c,h)=>h(c),n());return e=F2t(u),r=e.cache.get,i=e.cache.set,a=s,s(l)},s=l=>{const u=r(l);if(u)return u;const c=z2t(l,e);return i(l,c),c};return a=o,(...l)=>a(G2t(...l))},U2t=[],gn=n=>{const t=e=>e[n]||U2t;return t.isThemeGetter=!0,t},zX=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,GX=/^\((?:(\w[\w-]*):)?(.+)\)$/i,W2t=/^\d+\/\d+$/,$2t=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,j2t=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,X2t=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Y2t=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,q2t=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Hh=n=>W2t.test(n),Ge=n=>!!n&&!Number.isNaN(Number(n)),bl=n=>!!n&&Number.isInteger(Number(n)),UA=n=>n.endsWith("%")&&Ge(n.slice(0,-1)),_s=n=>$2t.test(n),Z2t=()=>!0,K2t=n=>j2t.test(n)&&!X2t.test(n),HX=()=>!1,Q2t=n=>Y2t.test(n),J2t=n=>q2t.test(n),tPt=n=>!te(n)&&!ee(n),ePt=n=>hd(n,$X,HX),te=n=>zX.test(n),Gu=n=>hd(n,jX,K2t),WA=n=>hd(n,oPt,Ge),L3=n=>hd(n,UX,HX),rPt=n=>hd(n,WX,J2t),u0=n=>hd(n,XX,Q2t),ee=n=>GX.test(n),Dp=n=>fd(n,jX),nPt=n=>fd(n,sPt),I3=n=>fd(n,UX),iPt=n=>fd(n,$X),aPt=n=>fd(n,WX),c0=n=>fd(n,XX,!0),hd=(n,t,e)=>{const r=zX.exec(n);return r?r[1]?t(r[1]):e(r[2]):!1},fd=(n,t,e=!1)=>{const r=GX.exec(n);return r?r[1]?t(r[1]):e:!1},UX=n=>n==="position"||n==="percentage",WX=n=>n==="image"||n==="url",$X=n=>n==="length"||n==="size"||n==="bg-size",jX=n=>n==="length",oPt=n=>n==="number",sPt=n=>n==="family-name",XX=n=>n==="shadow",lPt=()=>{const n=gn("color"),t=gn("font"),e=gn("text"),r=gn("font-weight"),i=gn("tracking"),a=gn("leading"),o=gn("breakpoint"),s=gn("container"),l=gn("spacing"),u=gn("radius"),c=gn("shadow"),h=gn("inset-shadow"),f=gn("text-shadow"),d=gn("drop-shadow"),v=gn("blur"),m=gn("perspective"),y=gn("aspect"),g=gn("ease"),p=gn("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],x=()=>[...w(),ee,te],A=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],C=()=>[ee,te,l],E=()=>[Hh,"full","auto",...C()],k=()=>[bl,"none","subgrid",ee,te],D=()=>["auto",{span:["full",bl,ee,te]},bl,ee,te],L=()=>[bl,"auto",ee,te],R=()=>["auto","min","max","fr",ee,te],P=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],O=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...C()],z=()=>[Hh,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],G=()=>[n,ee,te],U=()=>[...w(),I3,L3,{position:[ee,te]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",iPt,ePt,{size:[ee,te]}],X=()=>[UA,Dp,Gu],Q=()=>["","none","full",u,ee,te],at=()=>["",Ge,Dp,Gu],rt=()=>["solid","dashed","dotted","double"],Rt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Mt=()=>[Ge,UA,I3,L3],xt=()=>["","none",v,ee,te],vt=()=>["none",Ge,ee,te],Et=()=>["none",Ge,ee,te],_t=()=>[Ge,ee,te],Dt=()=>[Hh,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[_s],breakpoint:[_s],color:[Z2t],container:[_s],"drop-shadow":[_s],ease:["in","out","in-out"],font:[tPt],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[_s],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[_s],shadow:[_s],spacing:["px",Ge],text:[_s],"text-shadow":[_s],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Hh,te,ee,y]}],container:["container"],columns:[{columns:[Ge,te,ee,s]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:x()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:E()}],"inset-x":[{"inset-x":E()}],"inset-y":[{"inset-y":E()}],start:[{start:E()}],end:[{end:E()}],top:[{top:E()}],right:[{right:E()}],bottom:[{bottom:E()}],left:[{left:E()}],visibility:["visible","invisible","collapse"],z:[{z:[bl,"auto",ee,te]}],basis:[{basis:[Hh,"full","auto",s,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ge,Hh,"auto","initial","none",te]}],grow:[{grow:["",Ge,ee,te]}],shrink:[{shrink:["",Ge,ee,te]}],order:[{order:[bl,"first","last","none",ee,te]}],"grid-cols":[{"grid-cols":k()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":k()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":R()}],"auto-rows":[{"auto-rows":R()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...P(),"normal"]}],"justify-items":[{"justify-items":[...O(),"normal"]}],"justify-self":[{"justify-self":["auto",...O()]}],"align-content":[{content:["normal",...P()]}],"align-items":[{items:[...O(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...O(),{baseline:["","last"]}]}],"place-content":[{"place-content":P()}],"place-items":[{"place-items":[...O(),"baseline"]}],"place-self":[{"place-self":["auto",...O()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[s,"screen",...z()]}],"min-w":[{"min-w":[s,"screen","none",...z()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[o]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",e,Dp,Gu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ee,WA]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",UA,te]}],"font-family":[{font:[nPt,te,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,ee,te]}],"line-clamp":[{"line-clamp":[Ge,"none",ee,WA]}],leading:[{leading:[a,...C()]}],"list-image":[{"list-image":["none",ee,te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ee,te]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:G()}],"text-color":[{text:G()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...rt(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ge,"from-font","auto",ee,Gu]}],"text-decoration-color":[{decoration:G()}],"underline-offset":[{"underline-offset":[Ge,"auto",ee,te]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee,te]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ee,te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},bl,ee,te],radial:["",ee,te],conic:[bl,ee,te]},aPt,rPt]}],"bg-color":[{bg:G()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:G()}],"gradient-via":[{via:G()}],"gradient-to":[{to:G()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:at()}],"border-w-x":[{"border-x":at()}],"border-w-y":[{"border-y":at()}],"border-w-s":[{"border-s":at()}],"border-w-e":[{"border-e":at()}],"border-w-t":[{"border-t":at()}],"border-w-r":[{"border-r":at()}],"border-w-b":[{"border-b":at()}],"border-w-l":[{"border-l":at()}],"divide-x":[{"divide-x":at()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":at()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...rt(),"hidden","none"]}],"divide-style":[{divide:[...rt(),"hidden","none"]}],"border-color":[{border:G()}],"border-color-x":[{"border-x":G()}],"border-color-y":[{"border-y":G()}],"border-color-s":[{"border-s":G()}],"border-color-e":[{"border-e":G()}],"border-color-t":[{"border-t":G()}],"border-color-r":[{"border-r":G()}],"border-color-b":[{"border-b":G()}],"border-color-l":[{"border-l":G()}],"divide-color":[{divide:G()}],"outline-style":[{outline:[...rt(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ge,ee,te]}],"outline-w":[{outline:["",Ge,Dp,Gu]}],"outline-color":[{outline:G()}],shadow:[{shadow:["","none",c,c0,u0]}],"shadow-color":[{shadow:G()}],"inset-shadow":[{"inset-shadow":["none",h,c0,u0]}],"inset-shadow-color":[{"inset-shadow":G()}],"ring-w":[{ring:at()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:G()}],"ring-offset-w":[{"ring-offset":[Ge,Gu]}],"ring-offset-color":[{"ring-offset":G()}],"inset-ring-w":[{"inset-ring":at()}],"inset-ring-color":[{"inset-ring":G()}],"text-shadow":[{"text-shadow":["none",f,c0,u0]}],"text-shadow-color":[{"text-shadow":G()}],opacity:[{opacity:[Ge,ee,te]}],"mix-blend":[{"mix-blend":[...Rt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Rt()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ge]}],"mask-image-linear-from-pos":[{"mask-linear-from":Mt()}],"mask-image-linear-to-pos":[{"mask-linear-to":Mt()}],"mask-image-linear-from-color":[{"mask-linear-from":G()}],"mask-image-linear-to-color":[{"mask-linear-to":G()}],"mask-image-t-from-pos":[{"mask-t-from":Mt()}],"mask-image-t-to-pos":[{"mask-t-to":Mt()}],"mask-image-t-from-color":[{"mask-t-from":G()}],"mask-image-t-to-color":[{"mask-t-to":G()}],"mask-image-r-from-pos":[{"mask-r-from":Mt()}],"mask-image-r-to-pos":[{"mask-r-to":Mt()}],"mask-image-r-from-color":[{"mask-r-from":G()}],"mask-image-r-to-color":[{"mask-r-to":G()}],"mask-image-b-from-pos":[{"mask-b-from":Mt()}],"mask-image-b-to-pos":[{"mask-b-to":Mt()}],"mask-image-b-from-color":[{"mask-b-from":G()}],"mask-image-b-to-color":[{"mask-b-to":G()}],"mask-image-l-from-pos":[{"mask-l-from":Mt()}],"mask-image-l-to-pos":[{"mask-l-to":Mt()}],"mask-image-l-from-color":[{"mask-l-from":G()}],"mask-image-l-to-color":[{"mask-l-to":G()}],"mask-image-x-from-pos":[{"mask-x-from":Mt()}],"mask-image-x-to-pos":[{"mask-x-to":Mt()}],"mask-image-x-from-color":[{"mask-x-from":G()}],"mask-image-x-to-color":[{"mask-x-to":G()}],"mask-image-y-from-pos":[{"mask-y-from":Mt()}],"mask-image-y-to-pos":[{"mask-y-to":Mt()}],"mask-image-y-from-color":[{"mask-y-from":G()}],"mask-image-y-to-color":[{"mask-y-to":G()}],"mask-image-radial":[{"mask-radial":[ee,te]}],"mask-image-radial-from-pos":[{"mask-radial-from":Mt()}],"mask-image-radial-to-pos":[{"mask-radial-to":Mt()}],"mask-image-radial-from-color":[{"mask-radial-from":G()}],"mask-image-radial-to-color":[{"mask-radial-to":G()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[Ge]}],"mask-image-conic-from-pos":[{"mask-conic-from":Mt()}],"mask-image-conic-to-pos":[{"mask-conic-to":Mt()}],"mask-image-conic-from-color":[{"mask-conic-from":G()}],"mask-image-conic-to-color":[{"mask-conic-to":G()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ee,te]}],filter:[{filter:["","none",ee,te]}],blur:[{blur:xt()}],brightness:[{brightness:[Ge,ee,te]}],contrast:[{contrast:[Ge,ee,te]}],"drop-shadow":[{"drop-shadow":["","none",d,c0,u0]}],"drop-shadow-color":[{"drop-shadow":G()}],grayscale:[{grayscale:["",Ge,ee,te]}],"hue-rotate":[{"hue-rotate":[Ge,ee,te]}],invert:[{invert:["",Ge,ee,te]}],saturate:[{saturate:[Ge,ee,te]}],sepia:[{sepia:["",Ge,ee,te]}],"backdrop-filter":[{"backdrop-filter":["","none",ee,te]}],"backdrop-blur":[{"backdrop-blur":xt()}],"backdrop-brightness":[{"backdrop-brightness":[Ge,ee,te]}],"backdrop-contrast":[{"backdrop-contrast":[Ge,ee,te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ge,ee,te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ge,ee,te]}],"backdrop-invert":[{"backdrop-invert":["",Ge,ee,te]}],"backdrop-opacity":[{"backdrop-opacity":[Ge,ee,te]}],"backdrop-saturate":[{"backdrop-saturate":[Ge,ee,te]}],"backdrop-sepia":[{"backdrop-sepia":["",Ge,ee,te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ee,te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ge,"initial",ee,te]}],ease:[{ease:["linear","initial",g,ee,te]}],delay:[{delay:[Ge,ee,te]}],animate:[{animate:["none",p,ee,te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,ee,te]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:vt()}],"rotate-x":[{"rotate-x":vt()}],"rotate-y":[{"rotate-y":vt()}],"rotate-z":[{"rotate-z":vt()}],scale:[{scale:Et()}],"scale-x":[{"scale-x":Et()}],"scale-y":[{"scale-y":Et()}],"scale-z":[{"scale-z":Et()}],"scale-3d":["scale-3d"],skew:[{skew:_t()}],"skew-x":[{"skew-x":_t()}],"skew-y":[{"skew-y":_t()}],transform:[{transform:[ee,te,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Dt()}],"translate-x":[{"translate-x":Dt()}],"translate-y":[{"translate-y":Dt()}],"translate-z":[{"translate-z":Dt()}],"translate-none":["translate-none"],accent:[{accent:G()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:G()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ee,te]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ee,te]}],fill:[{fill:["none",...G()]}],"stroke-w":[{stroke:[Ge,Dp,Gu,WA]}],stroke:[{stroke:["none",...G()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},uPt=H2t(lPt),cPt=(...n)=>uPt(Xf(n)),YX=n=>{const{icon:t,children:e,onMouseOver:r,onMouseOut:i,...a}=n,[o,s]=yt.useState(!1),l=c=>{s(!0),r?.(c)},u=c=>{s(!1),i?.(c)};return $t.jsxs(ng.Button,{...a,color:"primary",variant:"filled",shape:"round",className:"gap-0",onMouseOver:l,onMouseOut:u,children:[$t.jsx("span",{className:"inline-flex items-center children:size-4",children:t}),$t.jsx(dH.span,{className:"overflow-hidden",initial:!1,animate:{width:o?"auto":0,opacity:Number(o),paddingLeft:Number(o)*8},children:e})]})},{Text:R3}=ng.Typography,hPt=n=>{const{data:t,i18n:e,extraButtons:r,className:i,openSourceButtonProps:a,...o}=n,[s,l]=yt.useState(!1),u=[{label:e?.labels?.type??"Type",value:t?.type},{label:e?.labels?.size??"Size",value:t?.size},{label:e?.labels?.createdBy??"Created At",value:t?.created},{label:e?.labels?.createdBy??"Created By",value:t?.owner?.title},{label:e?.labels?.updatedAt??"Updated At",value:t?.updated}];return $t.jsxs("div",{className:cPt("flex flex-col h-full overflow-hidden",i),...o,children:[$t.jsxs("div",{children:[$t.jsx("img",{src:t?.icon,className:"size-6 mr-3 float-left"}),$t.jsx("div",{className:"text-4.5/6 text-primary",children:t?.title})]}),$t.jsxs("div",{className:"flex items-center justify-between my-2",children:[$t.jsxs(R3,{type:"secondary",className:"inline-flex items-center gap-0.5 text-3",children:[$t.jsx("div",{children:t?.source?.name??"-"}),$t.jsx(Ld.ChevronRight,{className:"size-3"}),$t.jsx("div",{children:t?.category??"-"}),$t.jsx(Ld.Minus,{className:"size-3 rotate-90"}),$t.jsx("div",{children:t?.owner?.title??"-"}),$t.jsx(Ld.Dot,{className:"size-3"}),$t.jsx("div",{children:t?.updated??"-"}),$t.jsx(Ld.Ellipsis,{className:"ml-2 size-3 hover:text-primary transition cursor-pointer",onClick:()=>{l(c=>!c)}})]}),$t.jsxs("div",{className:"inline-flex gap-2",children:[r,$t.jsx(YX,{icon:$t.jsx(Ld.SquareArrowOutUpRight,{}),onClick:()=>{window.open(t.url)},...a,children:e?.buttons?.openSource??"Open Source"})]})]}),$t.jsx(dH.div,{className:"bg-black/3 dark:bg-white/4 rounded-lg overflow-hidden",initial:!1,animate:{height:s?"auto":0,opacity:s?1:0,marginBottom:s?"1rem":0},children:$t.jsx("div",{className:"flex flex-wrap gap-row-2 p-4",children:u.map(c=>{const{label:h,value:f}=c;return $t.jsxs("div",{className:"w-1/2 inline-flex items-center <sm:w-full",children:[$t.jsx(R3,{type:"secondary",className:"w-24",children:h}),$t.jsx("span",{className:"text-3.5",children:f??"-"})]},h)})})}),$t.jsxs("div",{className:"flex flex-col gap-4 flex-1 overflow-auto",children:[$t.jsx(_2t,{...n}),$t.jsx(w2t,{...n})]})]})};exports.ActionButton=YX;exports.DocDetail=hPt;