zcode-app-cli 3.16.2-38 → 3.16.3-39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/LICENSES/README.md +1 -1
  2. package/README.md +8 -2
  3. package/bin/zcode.js +8 -1
  4. package/docs/CONFIGURATION.md +1 -1
  5. package/docs/CONFIGURATION.zh-CN.md +1 -1
  6. package/docs/THIRD_PARTY_CONTENT.md +2 -2
  7. package/package.json +2 -2
  8. package/vendor/cli-config.cjs +21 -0
  9. package/vendor/extraction.json +9 -4
  10. package/vendor/node_modules/@zcode/tui/dist/index.js +19 -3
  11. package/vendor/packages/documents-plugin/.zcode-plugin/plugin.json +3 -2
  12. package/vendor/packages/documents-plugin/dist/server.mjs +201 -152
  13. package/vendor/packages/documents-plugin/dist/ui/bundle-0.txt +1 -1
  14. package/vendor/packages/documents-plugin/dist/ui/panel.html +1 -1
  15. package/vendor/packages/documents-plugin/package.json +1 -1
  16. package/vendor/packages/node-repl-host/dist/mcp/server.js +1 -1
  17. package/vendor/packages/pdf-plugin/.zcode-plugin/plugin.json +3 -2
  18. package/vendor/packages/pdf-plugin/dist/server.mjs +201 -152
  19. package/vendor/packages/pdf-plugin/dist/ui/bundle-0.txt +1 -1
  20. package/vendor/packages/pdf-plugin/dist/ui/panel.html +1 -1
  21. package/vendor/packages/pdf-plugin/package.json +1 -1
  22. package/vendor/packages/presentations-plugin/.zcode-plugin/plugin.json +3 -2
  23. package/vendor/packages/presentations-plugin/dist/server.mjs +201 -152
  24. package/vendor/packages/presentations-plugin/dist/ui/bundle-0.txt +1 -1
  25. package/vendor/packages/presentations-plugin/dist/ui/panel.html +1 -1
  26. package/vendor/packages/presentations-plugin/package.json +1 -1
  27. package/vendor/packages/spreadsheets-plugin/.zcode-plugin/plugin.json +3 -2
  28. package/vendor/packages/spreadsheets-plugin/dist/server.mjs +201 -152
  29. package/vendor/packages/spreadsheets-plugin/dist/ui/bundle-0.txt +1 -1
  30. package/vendor/packages/spreadsheets-plugin/dist/ui/panel.html +1 -1
  31. package/vendor/packages/spreadsheets-plugin/package.json +1 -1
  32. package/vendor/zcode.cjs +1033 -1031
  33. package/zcode-runtime.lock.json +3 -3
@@ -105,7 +105,7 @@ Boolean requesting whether a visible border and background is provided by the ho
105
105
  - omitted: host decides border`)}),MNe=q.object({method:q.literal("ui/request-display-mode"),params:q.object({mode:Qy.describe("The display mode being requested.")})}),$fe=q.object({mode:Qy.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),wfe=q.union([q.literal("model"),q.literal("app")]).describe("Tool visibility scope - who can access the tool."),CNe=q.object({resourceUri:q.string().optional(),visibility:q.array(wfe).optional().describe(`Who can access this tool. Default: ["model", "app"]
106
106
  - "model": Tool visible to and callable by the agent
107
107
  - "app": Tool callable by the app from this server only`),csp:q.never().optional(),permissions:q.never().optional()}),zNe=q.object({mimeTypes:q.array(q.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),TNe=q.object({method:q.literal("ui/download-file"),params:q.object({contents:q.array(q.union([Ad,Id])).describe("Resource contents to download \u2014 embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),ANe=q.object({method:q.literal("ui/message"),params:q.object({role:q.literal("user").describe('Message role, currently only "user" is supported.'),content:q.array(os).describe("Message content blocks (text, image, etc.).")})}),INe=q.object({method:q.literal("ui/notifications/sandbox-resource-ready"),params:q.object({html:q.string().describe("HTML content to load into the inner iframe."),sandbox:q.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:nD.optional().describe("CSP configuration from resource metadata."),permissions:iD.optional().describe("Sandbox permissions from resource metadata.")})}),kfe=q.object({method:q.literal("ui/notifications/tool-result"),params:Xc.describe("Standard MCP tool execution result.")}),fH=q.object({toolInfo:q.object({id:wa.optional().describe("JSON-RPC id of the tools/call request."),tool:Yc.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:lfe.optional().describe("Current color theme preference."),styles:yfe.optional().describe("Style configuration for theming the app."),displayMode:Qy.optional().describe("How the UI is currently displayed."),availableDisplayModes:q.array(Qy).optional().describe("Display modes the host supports."),containerDimensions:q.union([q.object({height:q.number().describe("Fixed container height in pixels.")}),q.object({maxHeight:q.union([q.number(),q.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(q.union([q.object({width:q.number().describe("Fixed container width in pixels.")}),q.object({maxWidth:q.union([q.number(),q.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
108
- container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:q.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:q.string().optional().describe("User's timezone in IANA format."),userAgent:q.string().optional().describe("Host application identifier."),platform:q.union([q.literal("web"),q.literal("desktop"),q.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:q.object({touch:q.boolean().optional().describe("Whether the device supports touch input."),hover:q.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:q.object({top:q.number().describe("Top safe area inset in pixels."),right:q.number().describe("Right safe area inset in pixels."),bottom:q.number().describe("Bottom safe area inset in pixels."),left:q.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),Mfe=q.object({method:q.literal("ui/notifications/host-context-changed"),params:fH.describe("Partial context update containing only changed fields.")}),RNe=q.object({method:q.literal("ui/update-model-context"),params:q.object({content:q.array(os).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:q.record(q.string(),q.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),LNe=q.object({method:q.literal("ui/initialize"),params:q.object({appInfo:is.describe("App identification (name and version)."),appCapabilities:Sfe.describe("Features and capabilities this app provides."),protocolVersion:q.string().describe("Protocol version this app supports.")})}),Cfe=q.object({protocolVersion:q.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:is.describe("Host application identification and version."),hostCapabilities:_fe.describe("Features and capabilities provided by the host."),hostContext:fH.describe("Rich context about the host environment.")}).passthrough(),zfe={target:"draft-2020-12"};async function dH(e,t){let n=e["~standard"];if(n.jsonSchema)return n.jsonSchema[t](zfe);throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function hH(e,t,n=""){let i=await e["~standard"].validate(t);if(i.issues){let r=i.issues.map(o=>{let a=o.path?.map(s=>typeof s=="object"?s.key:s).join(".");return a?`${a}: ${o.message}`:o.message}).join("; ");throw Error(n+r)}return i.value}function pH(e,t=document.documentElement){for(let[n,i]of Object.entries(e))i!==void 0&&t.style.setProperty(n,i)}function Tfe(e,t){let n={...e,...t};return t.experimental!==void 0&&(n.experimental={...e.experimental,...t.experimental}),t.tools!==void 0&&(n.tools={...e.tools,...t.tools}),n}var aw=class e extends QE{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new eD;_methods=new tD;setRequestHandler=(...t)=>{let[n,...i]=cH("request",t)??t;this._methods.claim(n,"setRequestHandler"),super.setRequestHandler.call(this,n,...i)};setNotificationHandler=(...t)=>{let[n,...i]=cH("notification",t)??t;this._methods.claim(n,"setNotificationHandler"),super.setNotificationHandler.call(this,n,...i)};removeRequestHandler=t=>{this._methods.release(t),super.removeRequestHandler(t)};removeNotificationHandler=t=>{this._methods.release(t),super.removeNotificationHandler(t)};replaceRequestHandler=(t,...n)=>{this._methods.replace(t),super.setRequestHandler.call(this,t,...n)};_assertInitialized(t){if(this._initializedSent)return;let n=`[ext-apps] App.${t}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(n);console.warn(`${n}. This will throw in a future release.`)}eventSchemas={toolinput:pfe,toolinputpartial:mfe,toolresult:kfe,toolcancelled:gfe,hostcontextchanged:Mfe};static ONE_SHOT_EVENTS=new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(t,n){n&&this._assertHandlerTiming(t),this._ensureEventSlot(t),this._events.setHandler(t,n)}addEventListener(t,n){this._assertHandlerTiming(t),this._ensureEventSlot(t),this._events.addEventListener(t,n)}removeEventListener(t,n){this._events.removeEventListener(t,n)}_ensureEventSlot(t){if(this._registeredEvents.has(t))return;let n=this.eventSchemas[t];if(!n)throw Error(`Unknown event: ${String(t)}`);this.setNotificationHandler(n.shape.method.value,{params:n.shape.params},i=>{let r=i;t==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...r}),this._events.dispatch(t,r)}),this._registeredEvents.add(t)}getEventHandler(t){return this._events.getHandler(t)}warnIfRequestHandlerReplaced(t,n,i){n&&i&&console.warn(`[MCP Apps] ${t} handler replaced. Previous handler will no longer be called.`)}constructor(t,n={},i={autoResize:!0}){super(i),this._appInfo=t,this._appCapabilities=n,this.options=i,this._methods.replace("notifications/cancelled"),this._methods.replace("notifications/progress"),!i.allowUnsafeEval&&q.config({jitless:!0}),this.replaceRequestHandler("ping",r=>(console.log("Received ping:",r.params),{})),this.setEventHandler("hostcontextchanged",void 0)}buildContext(t){return t}registerAppCapabilities(t){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._appCapabilities=Tfe(this._appCapabilities,t)}registerTool(t,n,i){if(this._registeredTools[t])throw Error(`Tool ${t} is already registered`);let r=this,o=()=>{r._initializedSent&&r._appCapabilities.tools?.listChanged&&r.sendToolListChanged()},a=n.inputSchema!==void 0,s={title:n.title,description:n.description,inputSchema:n.inputSchema,outputSchema:n.outputSchema,annotations:n.annotations,_meta:n._meta,enabled:!0,enable(){this.enabled=!0,o()},disable(){this.enabled=!1,o()},update(l){Object.assign(this,l),o()},remove(){r._registeredTools[t]===s&&(delete r._registeredTools[t],o())},handler:async(l,c)=>{if(!s.enabled)throw Error(`Tool ${t} is disabled`);let u;if(a){let d=s.inputSchema,f=d?await hH(d,l??{},`Invalid input for tool ${t}: `):l??{};u=await i(f,c)}else u=await i(c);return s.outputSchema&&!u.isError&&(u.structuredContent=await hH(s.outputSchema,u.structuredContent,`Invalid output for tool ${t}: `)),u}};return this._registeredTools[t]=s,!this._appCapabilities.tools&&!this.transport&&this.registerAppCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),o(),s}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(t,n)=>{let i=this._registeredTools[t.name];if(!i)throw Error(`Tool ${t.name} not found`);return i.handler(t.arguments,n)},this.onlisttools=async(t,n)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([i,r])=>r.enabled).map(async([i,r])=>{let o={name:i,title:r.title,description:r.description,inputSchema:r.inputSchema?await dH(r.inputSchema,"input"):{type:"object",properties:{}}};return r.outputSchema&&(o.outputSchema=await dH(r.outputSchema,"output")),r.annotations&&(o.annotations=r.annotations),r._meta&&(o._meta=r._meta),o}))}))}async sendToolListChanged(t={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:t})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(t){this.setEventHandler("toolinput",t)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(t){this.setEventHandler("toolinputpartial",t)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(t){this.setEventHandler("toolresult",t)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(t){this.setEventHandler("toolcancelled",t)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(t){this.setEventHandler("hostcontextchanged",t)}_onteardown;get onteardown(){return this._onteardown}set onteardown(t){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,t),this._onteardown=t,this.replaceRequestHandler("ui/resource-teardown",{params:bfe.shape.params,result:xfe},(n,i)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(n,i)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(t){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,t),this._oncalltool=t,this.replaceRequestHandler("tools/call",(n,i)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(n.params,i)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(t){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,t),this._onlisttools=t,this.replaceRequestHandler("tools/list",(n,i)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(n.params,i)})}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${t})`);break}}assertRequestHandlerCapability(t){switch(t){case"tools/call":case"tools/list":if(!this._appCapabilities.tools)throw Error(`Client does not support tool capability (required for ${t})`);return;default:return}}assertNotificationCapability(t){}async callServerTool(t,n){if(this._assertInitialized("callServerTool"),typeof t=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${t}"). Did you mean: callServerTool({ name: "${t}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:t},{onprogress:()=>{},resetTimeoutOnProgress:!0,...n})}async readServerResource(t,n){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:t},n)}async listServerResources(t,n){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:t},n)}async createSamplingMessage(t,n){return this._assertInitialized("createSamplingMessage"),await this.request({method:"sampling/createMessage",params:t},n)}sendMessage(t,n){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:t},ffe,n)}sendLog(t){return this.notification({method:"notifications/message",params:t})}updateModelContext(t,n){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:t},Wc,n)}openLink(t,n){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:t},dfe,n)}sendOpenLink=this.openLink;downloadFile(t,n){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:t},hfe,n)}requestTeardown(t={}){return this.notification({method:"ui/notifications/request-teardown",params:t})}requestDisplayMode(t,n){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:t},$fe,n)}sendSizeChanged(t){return this.notification({method:"ui/notifications/size-changed",params:t})}setupSizeChangedNotifications(){let t=!1,n=0,i=0,r=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1;let a=document.documentElement,s=a.style.height;a.style.height="max-content";let l=Math.ceil(a.getBoundingClientRect().height);a.style.height=s;let c=Math.ceil(window.innerWidth);(c!==n||l!==i)&&(n=c,i=l,this.sendSizeChanged({width:c,height:l}))}))};r();let o=new ResizeObserver(r);return o.observe(document.documentElement),o.observe(document.body),()=>o.disconnect()}async connect(t=new Jy(window.parent,window.parent),n){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1;try{await super.connect(t);let i=await this.request({method:"ui/initialize",params:{appCapabilities:this._appCapabilities,appInfo:this._appInfo,protocolVersion:afe}},Cfe,n);if(i===void 0)throw Error(`Server sent invalid initialize result: ${i}`);this._hostCapabilities=i.hostCapabilities,this._hostInfo=i.hostInfo,this._hostContext=i.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(i){throw this.close(),i}}};var Fn={name:"presentations",version:"0.2.0",title:{en:"Presentations","zh-CN":"\u6F14\u793A\u6587\u7A3F"},kinds:["pptx"]};var mH=Fn.version,gH=Fn.name,BNe=Fn.name,FNe=`ui://${Fn.name}/panel.html`,Afe=`ui://${Fn.name}/assets/`,vH=`ui://${Fn.name}/file/`;var ka=Fn.kinds,tb=100*1024*1024,qNe=512*1024*1024,rD=4*1024*1024,VNe=24*1024,eb=class extends Error{constructor(n,i){super(i);this.code=n;this.name="OfficeError"}};function nb(e){let t=e.toLowerCase().match(/\.([a-z]+)$/)?.[1];return ka.includes(t??"")?t:null}var Ife={en:{sep:", ",and:" and ",or:" or "},"zh-CN":{sep:"\u3001",and:"\u548C",or:"\u6216"}};function Vo(e,t="en",n="and"){let i=Ife[t];if(e.length<2)return e.join("");let r=e[e.length-1],o=t==="zh-CN"&&/^[\x20-\x7e]/.test(r)?` ${i[n]} `:i[n];return`${e.slice(0,-1).join(i.sep)}${o}${r}`}function Nd(e="en",t="and"){return Vo(ka.map(n=>`.${n}`),e,t)}var ss=(e,t)=>new eb("invalid_anchor",`Cannot read location "${e}". ${t}`),ls={docx:"Use p:N, p:N-M, t:N or t:N/rRcC.",pptx:"Use slide:N, slide:N-M or slide:N/shape:ID.",pdf:"Use page:N or page:N-M.",xlsx:"Use Sheet, Sheet!A1 or Sheet!A1:C9 (quote names with spaces: 'My sheet'!A1)."};function oD(e,t,n){if(!t)throw ss(e,ls[n]);let i=Number(t[1]),r=t[2]===void 0?i:Number(t[2]);if(!(i>=1)||!(r>=i)||r>1e6)throw ss(e,ls[n]);return{from:i,to:r}}function yH(e){let t=/^\$?([A-Za-z]{1,3})\$?(\d{1,7})$/.exec(e);if(!t)return null;let n=0;for(let r of t[1].toUpperCase())n=n*26+(r.charCodeAt(0)-64);let i=Number(t[2]);return i<1||i>1048576||n>16384?null:{row:i,col:n}}function Rfe(e){let t,n;if(e.startsWith("'")){let s=1;for(t="";s<e.length;s++)if(e[s]==="'")if(e[s+1]==="'")t+="'",s++;else break;else t+=e[s];if(s>=e.length||(n=e.slice(s+1),n&&!n.startsWith("!")))throw ss(e,ls.xlsx);n=n.slice(1)}else{let s=e.lastIndexOf("!");t=s<0?e:e.slice(0,s),n=s<0?"":e.slice(s+1)}if(!t||t.length>64)throw ss(e,ls.xlsx);if(!n)return{kind:"xlsx",sheet:t};let[i,r=i]=n.split(":"),o=yH(i),a=yH(r);if(!o||!a)throw ss(e,ls.xlsx);return{kind:"xlsx",sheet:t,range:{start:{row:Math.min(o.row,a.row),col:Math.min(o.col,a.col)},end:{row:Math.max(o.row,a.row),col:Math.max(o.col,a.col)}}}}function bH(e,t){let n=t.trim();if(!n||n.length>300)throw ss(t,ls[e]);switch(e){case"docx":{let i=/^t:(\d+)(?:\/r(\d+)c(\d+))?$/i.exec(n);if(i){let r=Number(i[1]);if(r<1)throw ss(n,ls.docx);if(i[2]===void 0)return{kind:e,type:"table",table:r};let o={row:Number(i[2]),col:Number(i[3])};if(o.row<1||o.col<1)throw ss(n,ls.docx);return{kind:e,type:"table",table:r,cell:o}}return{kind:e,type:"paragraph",...oD(n,/^p:(\d+)(?:-(?:p:)?(\d+))?$/i.exec(n),e)}}case"pptx":{let i=/^slide:(\d+)\/shape:([\w-]{1,32})$/i.exec(n);if(i){let r=Number(i[1]);if(r<1)throw ss(n,ls.pptx);return{kind:e,from:r,to:r,shape:i[2]}}return{kind:e,...oD(n,/^slide:(\d+)(?:-(?:slide:)?(\d+))?$/i.exec(n),e)}}case"pdf":return{kind:e,...oD(n,/^page:(\d+)(?:-(?:page:)?(\d+))?$/i.exec(n),e)};case"xlsx":return Rfe(n)}}function xH(e){let t=/^(.*?\.(?:docx|xlsx|pptx|pdf))(?:#(.*))?$/i.exec(e.trim());if(!t)throw new eb("invalid_anchor",`"${e}" is not a document anchor. Use <path>.docx|.xlsx|.pptx|.pdf optionally followed by #<location>.`);return{path:t[1],at:t[2]?.trim()?t[2].trim():null}}function ib(e,t){return t?`${e}#${t}`:e}var _H=e=>e>=55296&&e<=56319,SH=e=>e>=56320&&e<=57343;function lw(e,t,n=e.length){let i=Math.max(0,Math.min(t,e.length)),r=Math.max(i,Math.min(n,e.length));return i>0&&SH(e.charCodeAt(i))&&_H(e.charCodeAt(i-1))&&i--,r<e.length&&SH(e.charCodeAt(r))&&_H(e.charCodeAt(r-1))&&r--,e.slice(i,r)}var Lfe=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,cw=e=>e.replace(Lfe,"\uFFFD");function sw(e){return typeof e=="string"?cw(e):Array.isArray(e)?e.map(t=>sw(t)):e&&typeof e=="object"&&Object.getPrototypeOf(e)===Object.prototype?Object.fromEntries(Object.entries(e).map(([t,n])=>[t,sw(n)])):e}var $H=`${Fn.name}:windows:v1`,Efe=128;function wH(e){try{let t=JSON.parse(e.getItem($H)??"{}");return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function aD(e,t){let n=wH(e)[t];return!n||typeof n!="object"?{}:{...typeof n.path=="string"?{path:n.path}:{},...Array.isArray(n.recent)?{recent:n.recent.filter(i=>typeof i?.path=="string"&&nb(i.path)===i.kind)}:{}}}function kH(e,t,n){try{let i=wH(e),r={...aD(e,t),...n};delete i[t],i[t]=r;for(let o of Object.keys(i).slice(0,-Efe))delete i[o];e.setItem($H,JSON.stringify(i))}catch{}}var Xp=e=>e.filter(([t])=>ka.includes(t)).map(([,t])=>t),Dfe={docx:"Word",xlsx:"Excel",pptx:"PowerPoint",pdf:"PDF"},MH=ka.filter(e=>e!=="pdf"),CH=[...MH.length===3?["Office"]:MH.map(e=>Dfe[e]),...ka.includes("pdf")?["PDF"]:[]],rb=Fn.title.en,e5e=(()=>{let e=Vo(CH,"en","or");return`${/^[AEIOU]/.test(e)?"an":"a"} ${e} file`})(),t5e=`${Vo(CH)} files`,n5e=Nd("en","or"),i5e=Xp([["docx","report.docx#p:12"],["xlsx","model.xlsx#Revenue!B2:F9"],["pptx","deck.pptx#slide:3"],["pdf","paper.pdf#page:5"]]).join(", "),r5e=Xp([["docx","p:12"],["pptx","slide:3"],["pdf","page:5"],["xlsx","Revenue!B2:F9"]]).join(", "),o5e=Xp([["docx","Word paragraphs and tables (markdown)"],["xlsx","spreadsheet cells as a grid with formulas"],["pptx","slides with their shapes and speaker notes"],["pdf","PDF page text"]]).join(", "),a5e=Vo(Xp([["docx","paragraph"],["xlsx","cell range"],["pptx","slide"],["pptx","shape"],["pdf","page"]]),"en","or"),s5e=Vo(Xp([["pdf","PDF pages"],["docx","long paragraphs"]]))||"long passages",zH=Vo(Xp([["pptx","deck.pptx#slide:3"],["pdf","paper.pdf#page:2"],["docx","report.docx#p:12"],["xlsx","model.xlsx#Revenue!A1:H30"]]),"en","or");var TH=[{name:"capture_view",title:`Capture ${rb} view`,description:`Take a picture of a rendered document location in the ${rb} panel so you can see layout, charts, images and formatting that text extraction misses. Pass an anchor such as ${zH} (the document must be open in the panel; call open_document first), or omit it to capture what the user currently sees.`,inputSchema:{type:"object",properties:{anchor:{type:"string",maxLength:1200,description:"Location to capture; defaults to the visible view."},maxWidth:{type:"integer",minimum:320,maximum:2e3,description:"Maximum image width in pixels (default 1600)."}},additionalProperties:!1},annotations:{readOnlyHint:!0,idempotentHint:!0}}];function Ofe(){let e=crypto.randomUUID(),t=()=>n.getHostCapabilities()?.experimental?.["zcode/surface"]?.stateKey??e,n=new aw({name:gH,version:mH},{tools:{listChanged:!0},availableDisplayModes:["inline","fullscreen"]},{autoResize:!1}),i=[],r=new Map,o=new Set,a,s=c=>void window.dispatchEvent(new Event(`office:${c}`));return n.ontoolresult=c=>{i.push(c),i.length>20&&i.shift(),s("toolresult")},n.onhostcontextchanged=()=>s("hostchange"),n.onlisttools=async()=>({tools:TH}),n.oncalltool=async(c,u)=>{if(!TH.some(d=>d.name===c.name))return{isError:!0,content:[{type:"text",text:`The ${rb} page has no tool ${c.name}.`}]};try{let d=Date.now()+2e4;for(;!r.has(c.name)&&Date.now()<d;)await new Promise(p=>{let g=()=>(o.delete(g),p());o.add(g),setTimeout(g,500)});let f=r.get(c.name);if(!f)throw new Error(`The ${rb} panel is still loading; try again in a moment.`);let h=u;return await f(c.arguments??{},h.mcpReq?.signal??h.signal)}catch(d){return{isError:!0,content:[{type:"text",text:d instanceof Error?d.message:String(d)}]}}},window.addEventListener("pagehide",()=>{n.callServerTool({name:"release_view",arguments:{viewId:t()}}).catch(()=>{})}),{app:n,get viewId(){return t()},ready:()=>a??=n.connect(new Jy(window.parent,window.parent)).then(()=>s("hostchange")),readWindow(){let c=n.getHostCapabilities()?.experimental?.["zcode/surface"];if(!c?.stateKey)return{};try{return aD(localStorage,c.stateKey)}catch{return{}}},saveWindow(c){let u=n.getHostCapabilities()?.experimental?.["zcode/surface"];if(u?.stateKey)try{kH(localStorage,u.stateKey,c)}catch{}},readDocument(){return this.readWindow().path??null},saveDocument(c){this.saveWindow({path:c})},takeResults:()=>i.splice(0,i.length),handleTool(c,u){r.set(c,u);for(let d of o)d()},get context(){return n.getHostContext()},get capabilities(){return n.getHostCapabilities()}}}function Ho(){return window.__officeHost??=Ofe()}async function Nfe(e){let t=Ho();await t.ready();let i=(await t.app.readServerResource({uri:e})).contents[0];if(!i)throw new Error(`Empty resource ${e}`);return i}function Pfe(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}async function AH(e,t){let n=new Uint8Array(e.bytes),i=0;for(let r=0;r<e.chunks;r++){t?.throwIfAborted();let o=await Nfe(`${vH}${e.token}/${r}`);if(typeof o.blob!="string")throw new Error("File chunk is not binary");let a=Pfe(o.blob);n.set(a,i),i+=a.byteLength}if(i!==e.bytes)throw new Error("The file changed while it was loading; reload it.");return n.buffer}var uw=Ln(oo(),1);var ob=class extends Error{constructor(n,i){super(n);this.code=i;this.name="CallError"}};async function cs(e,t={}){let n=Ho();await n.ready();let i=await n.app.callServerTool({name:e,arguments:t}),r=i.structuredContent,o=r?.error;if(i.isError||o){let a=i.content?.[0]?.text;throw new ob(o?.message??a??`${e} failed`,o?.code)}return r}var Pd=e=>e.slice(e.lastIndexOf("/")+1),IH=e=>{let t=e.lastIndexOf("/");return t>0?e.slice(0,t):""};async function RH(e){let{id:t}=await cs("begin_file_import",{name:e.name,size:e.size});try{for(let i=0;i<e.size;i+=rD){let r=await new Promise((o,a)=>{let s=new FileReader;s.onload=()=>o(String(s.result).split(",")[1]),s.onerror=()=>a(s.error),s.readAsDataURL(e.slice(i,i+rD))});await cs("write_file_import",{id:t,offset:i,data:r})}return(await cs("finish_file_import",{id:t})).path}catch(n){throw await cs("cancel_file_import",{id:t}).catch(()=>{}),n}}var dw=(e,t)=>e.length>t?`${lw(e,0,t-1)}\u2026`:e;function sD(){return Ho().readWindow().recent??[]}function LH(e){Ho().saveWindow({recent:e})}function ab(e,t,n){let i=t instanceof ob?t.code:t?.name==="PasswordException"?"password":void 0,[r,o]=i&&e.errors[i]||e.errors.generic,a=t instanceof Error?t.message:String(t);return{path:n,title:r,detail:o||a}}function EH(){let[,e]=(0,uw.useState)(0);return(0,uw.useEffect)(()=>{let t=()=>e(n=>n+1);return window.addEventListener("office:hostchange",t),()=>window.removeEventListener("office:hostchange",t)},[]),Ho().context}var jfe={docx:"Word",xlsx:"Excel",pptx:"PowerPoint",pdf:"PDF"},OH=ka.map(e=>jfe[e]),Kp=e=>ka.includes(e),DH=Kp("docx")||Kp("pdf"),NH={en:`any ${Vo([...DH?["passage"]:[],...Kp("xlsx")?["cell"]:[],...Kp("pptx")?["slide"]:[]],"en","or")}`,zh:Vo([...DH?["\u6BB5\u843D"]:[],...Kp("xlsx")?["\u5355\u5143\u683C"]:[],...Kp("pptx")?["\u5E7B\u706F\u7247"]:[]],"zh-CN","or")},lD=Fn.title["zh-CN"].replace(/[\x20-\x7e]$/,"$& "),Ufe={title:Fn.title.en,openTitle:"Open a document",openFile:"Open file",emptyTitle:`Open your ${Vo(OH)} file`,emptyDescription:`Read alongside your conversation and discuss ${NH.en}.`,emptyCaption:`Choose a local file \xB7 ${Nd("en","or")}`,importing:"Importing\u2026",importTooLarge:`Choose a file no larger than ${tb/1024/1024} MiB.`,recent:"Recent",switchDocument:"Switch document",pagesAndOutline:"Pages and outline",outlineOnly:"Outline",pages:"Pages",slides:"Slides",outline:"Outline",find:"Find",findPlaceholder:"Find in document",findCount:(e,t)=>`${e} of ${t}`,noResults:"No results",previousMatch:"Previous match (\u21E7Enter)",nextMatch:"Next match (Enter)",closeFind:"Close (Esc)",more:"More",fitWidth:"Fit width",fitPage:"Fit page",actualSize:"Actual size",reload:"Reload from disk",previousPage:"Previous page",nextPage:"Next page",pageNumber:"Page number",ofPages:e=>`of ${e}`,zoomIn:"Zoom in (\u2318+)",zoomOut:"Zoom out (\u2318\u2212)",fit:"Fit",addToChat:"Add to chat",addShort:"Add",addToChatHint:"Attach this to your next message (\u2318/Ctrl+Enter)",added:"Added to chat",ask:"Ask",askPlaceholder:"Ask about this\u2026",send:"Send",cancel:"Cancel",sendKey:"send",cancelKey:"cancel",copy:"Copy",copied:"Copied",agent:"Agent",agentOf:(e,t)=>`Agent \xB7 ${e} of ${t}`,nextTarget:"Next",moreOn:(e,t)=>e===1?`1 more on ${t}`:`${e} more`,close:"Close",changed:"This file changed on disk.",reloadShort:"Reload",dismiss:"Dismiss",openAnother:"Open another file",sidePanel:"Open in side panel",meta:{pdf:e=>e===1?"1 page":`${e} pages`,pptx:e=>e===1?"1 slide":`${e} slides`,xlsx:e=>e===1?"1 sheet":`${e} sheets`,docx:e=>""},errors:{generic:["Couldn\u2019t open this document",""],password:["This PDF is password protected",`${Fn.title.en} can\u2019t open encrypted files yet.`],not_found:["This file no longer exists","It may have been moved or deleted."],file_too_large:["This file is too large to open",""],corrupt_file:["This file appears to be damaged",`${Fn.title.en} couldn\u2019t read its contents.`],unsupported_type:["This kind of file isn\u2019t supported",`${Fn.title.en} opens ${Nd()} files.`],path_outside_workspace:["This file is outside the workspace",""]},sendFailed:"The message was not sent.",contextFailed:"ZCode did not accept the reference.",where:{page:e=>`Page ${e}`,pages:(e,t)=>`Pages ${e}\u2013${t}`,pageLower:e=>`page ${e}`,slide:e=>`Slide ${e}`,slides:(e,t)=>`Slides ${e}\u2013${t}`,slideLower:e=>`slide ${e}`,shape:e=>`Slide ${e} \xB7 Shape`,paragraph:e=>`Paragraph ${e}`,paragraphs:(e,t)=>`Paragraphs ${e}\u2013${t}`,paragraphLower:e=>`paragraph ${e}`,table:e=>`Table ${e}`,cell:(e,t,n)=>`Table ${e} \xB7 R${t}C${n}`}},Bfe={title:Fn.title["zh-CN"],openTitle:"\u6253\u5F00\u6587\u6863",openFile:"\u6253\u5F00\u6587\u4EF6",emptyTitle:`\u6253\u5F00\u4F60\u7684 ${Vo(OH,"zh-CN")} \u6587\u4EF6`,emptyDescription:`\u8FB9\u770B\u8FB9\u804A\uFF0C\u9009\u4E2D${NH.zh}\u5373\u53EF\u5E26\u5165\u5BF9\u8BDD\u3002`,emptyCaption:`\u9009\u62E9\u672C\u5730\u6587\u4EF6 \xB7 ${Nd("zh-CN","or")}`,importing:"\u6B63\u5728\u5BFC\u5165\u2026",importTooLarge:`\u8BF7\u9009\u62E9\u4E0D\u8D85\u8FC7 ${tb/1024/1024} MiB \u7684\u6587\u4EF6\u3002`,recent:"\u6700\u8FD1",switchDocument:"\u5207\u6362\u6587\u6863",pagesAndOutline:"\u9875\u9762\u4E0E\u76EE\u5F55",outlineOnly:"\u76EE\u5F55",pages:"\u9875\u9762",slides:"\u5E7B\u706F\u7247",outline:"\u76EE\u5F55",find:"\u67E5\u627E",findPlaceholder:"\u5728\u6587\u6863\u4E2D\u67E5\u627E",findCount:(e,t)=>`${e} / ${t}`,noResults:"\u65E0\u7ED3\u679C",previousMatch:"\u4E0A\u4E00\u4E2A\uFF08\u21E7Enter\uFF09",nextMatch:"\u4E0B\u4E00\u4E2A\uFF08Enter\uFF09",closeFind:"\u5173\u95ED\uFF08Esc\uFF09",more:"\u66F4\u591A",fitWidth:"\u9002\u5E94\u5BBD\u5EA6",fitPage:"\u9002\u5E94\u9875\u9762",actualSize:"\u5B9E\u9645\u5927\u5C0F",reload:"\u4ECE\u78C1\u76D8\u91CD\u65B0\u52A0\u8F7D",previousPage:"\u4E0A\u4E00\u9875",nextPage:"\u4E0B\u4E00\u9875",pageNumber:"\u9875\u7801",ofPages:e=>`/ ${e}`,zoomIn:"\u653E\u5927\uFF08\u2318+\uFF09",zoomOut:"\u7F29\u5C0F\uFF08\u2318\u2212\uFF09",fit:"\u9002\u5E94",addToChat:"\u6DFB\u52A0\u5230\u5BF9\u8BDD",addShort:"\u6DFB\u52A0",addToChatHint:"\u9644\u52A0\u5230\u4E0B\u4E00\u6761\u6D88\u606F\uFF08\u2318/Ctrl+Enter\uFF09",added:"\u5DF2\u6DFB\u52A0\u5230\u5BF9\u8BDD",ask:"\u63D0\u95EE",askPlaceholder:"\u5C31\u8FD9\u91CC\u63D0\u95EE\u2026",send:"\u53D1\u9001",cancel:"\u53D6\u6D88",sendKey:"\u53D1\u9001",cancelKey:"\u53D6\u6D88",copy:"\u590D\u5236",copied:"\u5DF2\u590D\u5236",agent:"Agent",agentOf:(e,t)=>`Agent \xB7 \u7B2C ${e} \u5904\uFF0C\u5171 ${t} \u5904`,nextTarget:"\u4E0B\u4E00\u5904",moreOn:(e,t)=>e===1?`${t}\u8FD8\u6709 1 \u5904`:`\u8FD8\u6709 ${e} \u5904`,close:"\u5173\u95ED",changed:"\u6587\u4EF6\u5DF2\u5728\u78C1\u76D8\u4E0A\u66F4\u6539\u3002",reloadShort:"\u91CD\u65B0\u52A0\u8F7D",dismiss:"\u5FFD\u7565",openAnother:"\u6253\u5F00\u5176\u4ED6\u6587\u4EF6",sidePanel:"\u5728\u4FA7\u680F\u6253\u5F00",meta:{pdf:e=>`${e} \u9875`,pptx:e=>`${e} \u5F20\u5E7B\u706F\u7247`,xlsx:e=>`${e} \u4E2A\u5DE5\u4F5C\u8868`,docx:()=>""},errors:{generic:["\u65E0\u6CD5\u6253\u5F00\u8BE5\u6587\u6863",""],password:["\u8BE5 PDF \u53D7\u5BC6\u7801\u4FDD\u62A4",`${lD}\u6682\u4E0D\u652F\u6301\u6253\u5F00\u52A0\u5BC6\u6587\u4EF6\u3002`],not_found:["\u8BE5\u6587\u4EF6\u5DF2\u4E0D\u5B58\u5728","\u5B83\u53EF\u80FD\u5DF2\u88AB\u79FB\u52A8\u6216\u5220\u9664\u3002"],file_too_large:["\u6587\u4EF6\u592A\u5927\uFF0C\u65E0\u6CD5\u6253\u5F00",""],corrupt_file:["\u8BE5\u6587\u4EF6\u4F3C\u4E4E\u5DF2\u635F\u574F",`${lD}\u65E0\u6CD5\u8BFB\u53D6\u5176\u5185\u5BB9\u3002`],unsupported_type:["\u4E0D\u652F\u6301\u8FD9\u79CD\u6587\u4EF6",`${lD}\u53EF\u4EE5\u6253\u5F00 ${Nd("zh-CN")} \u6587\u4EF6\u3002`],path_outside_workspace:["\u8BE5\u6587\u4EF6\u4E0D\u5728\u5DE5\u4F5C\u533A\u5185",""]},sendFailed:"\u6D88\u606F\u672A\u53D1\u9001\u3002",contextFailed:"ZCode \u672A\u63A5\u53D7\u8BE5\u5F15\u7528\u3002",where:{page:e=>`\u7B2C ${e} \u9875`,pages:(e,t)=>`\u7B2C ${e}\u2013${t} \u9875`,pageLower:e=>`\u7B2C ${e} \u9875`,slide:e=>`\u7B2C ${e} \u5F20\u5E7B\u706F\u7247`,slides:(e,t)=>`\u7B2C ${e}\u2013${t} \u5F20\u5E7B\u706F\u7247`,slideLower:e=>`\u7B2C ${e} \u5F20\u5E7B\u706F\u7247`,shape:e=>`\u7B2C ${e} \u5F20\u5E7B\u706F\u7247 \xB7 \u5F62\u72B6`,paragraph:e=>`\u7B2C ${e} \u6BB5`,paragraphs:(e,t)=>`\u7B2C ${e}\u2013${t} \u6BB5`,paragraphLower:e=>`\u7B2C ${e} \u6BB5`,table:e=>`\u8868\u683C ${e}`,cell:(e,t,n)=>`\u8868\u683C ${e} \xB7 R${t}C${n}`}},PH=e=>e?.toLowerCase().startsWith("zh")?Bfe:Ufe;function hw(e,t,n=!1){let i=t.where,r;if(r=/^page:(\d+)(?:-(\d+))?$/.exec(e))return r[2]?i.pages(r[1],r[2]):n?i.pageLower(r[1]):i.page(r[1]);if(r=/^slide:(\d+)\/shape:/.exec(e))return i.shape(r[1]);if(r=/^slide:(\d+)(?:-(\d+))?$/.exec(e))return r[2]?i.slides(r[1],r[2]):n?i.slideLower(r[1]):i.slide(r[1]);if(r=/^p:(\d+)(?:-(\d+))?$/.exec(e))return r[2]?i.paragraphs(r[1],r[2]):n?i.paragraphLower(r[1]):i.paragraph(r[1]);if(r=/^t:(\d+)\/r(\d+)c(\d+)$/.exec(e))return i.cell(r[1],r[2],r[3]);if(r=/^t:(\d+)$/.exec(e))return i.table(r[1]);let o=e.lastIndexOf("!");return o>0?`${e.slice(0,o).replace(/^'(.*)'$/,"$1").replace(/''/g,"'")} \xB7 ${e.slice(o+1)}`:e.replace(/^'(.*)'$/,"$1")}var cD=Ln(zr(),1),Vfe={search:'<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>',x:'<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',"chevron-up":'<path d="m18 15-6-6-6 6"/>',"chevron-down":'<path d="m6 9 6 6 6-6"/>',minus:'<path d="M5 12h14"/>',plus:'<path d="M5 12h14"/><path d="M12 5v14"/>',ellipsis:'<circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/>',"panel-left":'<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/>',"file-text":'<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/>',copy:'<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>',"message-square-plus":'<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/><path d="M12 7v6"/><path d="M9 10h6"/>',"message-circle-question":'<path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><path d="M12 17h.01"/>',check:'<path d="M20 6 9 17l-5-5"/>',"rotate-cw":'<path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/>',"arrow-down":'<path d="M12 5v14"/><path d="m19 12-7 7-7-7"/>',"arrow-up":'<path d="m5 12 7-7 7 7"/><path d="M12 19V5"/>',"folder-open":'<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"/>',"maximize-2":'<polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" x2="14" y1="3" y2="10"/><line x1="3" x2="10" y1="21" y2="14"/>'};function rn({name:e,size:t=14,className:n}){return(0,cD.jsx)("svg",{className:`icon${n?` ${n}`:""}`,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",dangerouslySetInnerHTML:{__html:Vfe[e]}})}var Hfe={pdf:"PDF",docx:"W",xlsx:"X",pptx:"P"};function FH({kind:e}){return(0,cD.jsx)("span",{className:`filetype ${e}`,"aria-hidden":"true",children:Hfe[e]})}var _l=Ln(oo(),1);var Tt=Ln(zr(),1);function Zfe({handle:e,page:t,width:n,ratio:i,current:r,onPick:o,root:a}){let s=(0,_l.useRef)(null);return(0,_l.useEffect)(()=>{let l=s.current;if(!l||!e.thumbnail)return;let c=!1,u=new IntersectionObserver(d=>{c||!d.some(f=>f.isIntersecting)||(c=!0,u.disconnect(),e.thumbnail(t,n).then(f=>{l.replaceChildren(f),l.style.height=""},()=>{}))},{root:a.current,rootMargin:"300px 0px"});return u.observe(l),()=>u.disconnect()},[e,t,n,a]),(0,Tt.jsxs)("button",{type:"button",className:`thumb${r?" on":""}`,"aria-current":r?"page":void 0,onClick:()=>o(t),"data-page":t,children:[(0,Tt.jsx)("div",{ref:s,className:"mini",style:{width:n,height:Math.round(n*i)}}),(0,Tt.jsx)("span",{children:t})]})}var qH=e=>/^(?:page|slide):(\d+)/.exec(e)?.[1]??"";function VH({t:e,info:t,handle:n,page:i,tab:r,docked:o,onTab:a,onPage:s,onOutline:l}){let c=(0,_l.useRef)(null),u=!!(n?.thumbnail&&i),d=t.outline.length>0,f=u&&(r==="pages"||!d)?"pages":"outline",h=t.kind==="pptx"?9/16:1.294;(0,_l.useEffect)(()=>{let g=c.current?.querySelector("[aria-current=page]");g&&c.current&&(c.current.scrollTop=g.offsetTop-c.current.clientHeight/3)},[f]);let p=(()=>{if(!i)return-1;let g=-1;return t.outline.forEach((v,m)=>{let y=Number(qH(v.at));y&&y<=i.current&&(g=m)}),g})();return(0,Tt.jsxs)("nav",{className:`drawer${o?" docked":""}`,"aria-label":e.pagesAndOutline,children:[u&&d?(0,Tt.jsxs)("div",{className:"seg",role:"tablist",children:[(0,Tt.jsx)("button",{type:"button",role:"tab","aria-selected":f==="pages",className:f==="pages"?"on":"",onClick:()=>a("pages"),children:t.kind==="pptx"?e.slides:e.pages}),(0,Tt.jsx)("button",{type:"button",role:"tab","aria-selected":f==="outline",className:f==="outline"?"on":"",onClick:()=>a("outline"),children:e.outline})]}):null,(0,Tt.jsx)("div",{ref:c,className:f==="pages"?"thumbs":"outline",children:f==="pages"&&n&&i?Array.from({length:i.count},(g,v)=>(0,Tt.jsx)(Zfe,{handle:n,page:v+1,width:136,ratio:h,current:i.current===v+1,onPick:s,root:c},v)):t.outline.map((g,v)=>(0,Tt.jsxs)("button",{type:"button",className:`oi level-${Math.min(3,Math.max(1,g.level))}${v===p?" on":""}`,"aria-current":v===p?"page":void 0,title:g.label,onClick:()=>l(g.at),children:[(0,Tt.jsx)("span",{className:"label",children:g.label}),(0,Tt.jsx)("span",{className:"n",children:qH(g.at)})]},`${g.at}-${v}`))})]})}function HH({t:e,onBrowse:t,importing:n}){return(0,Tt.jsx)("div",{className:"empty",children:(0,Tt.jsxs)("div",{className:"empty-content",children:[(0,Tt.jsx)("h3",{children:e.emptyTitle}),(0,Tt.jsx)("p",{className:"empty-description",children:e.emptyDescription}),(0,Tt.jsxs)("button",{type:"button",className:"btn empty-open",onClick:t,disabled:n,children:[(0,Tt.jsx)(rn,{name:"folder-open",size:16}),n?e.importing:e.openFile]}),(0,Tt.jsx)("p",{className:"empty-caption",children:e.emptyCaption})]})})}var Gfe=["title","subtitle","line","line","short","heading","line","line","line","mid","figure"];function pw({kind:e}){if(e==="xlsx")return(0,Tt.jsx)("div",{className:"skeleton sheet","aria-busy":"true",children:Array.from({length:18},(n,i)=>(0,Tt.jsx)("div",{className:"skel-row"},i))});let t=e==="pptx";return(0,Tt.jsx)("div",{className:"skeleton","aria-busy":"true",children:[0,1].map(n=>(0,Tt.jsxs)("div",{className:`skelpage${t?" slide":""}`,children:[n===0&&!t?Gfe.map((i,r)=>(0,Tt.jsx)("div",{className:`skel ${i}`},r)):null,n===0&&t?(0,Tt.jsxs)(Tt.Fragment,{children:[(0,Tt.jsx)("div",{className:"skel title left"}),(0,Tt.jsx)("div",{className:"skel line"}),(0,Tt.jsx)("div",{className:"skel mid"})]}):null]},n))})}function mw({t:e,title:t,detail:n,onOpenAnother:i}){return(0,Tt.jsxs)("div",{className:"failed",role:"alert",children:[(0,Tt.jsx)(rn,{name:"file-text",size:28,className:"subtlest"}),(0,Tt.jsxs)("div",{children:[(0,Tt.jsx)("h3",{children:t}),n?(0,Tt.jsx)("p",{children:n}):null]}),(0,Tt.jsx)("button",{type:"button",className:"btn secondary",onClick:i,children:e.openAnother})]})}function ZH({t:e,onReload:t,onDismiss:n}){return(0,Tt.jsxs)("div",{className:"banner",role:"status",children:[(0,Tt.jsx)("span",{children:e.changed}),(0,Tt.jsx)("button",{type:"button",className:"btn sm primary",onClick:t,children:e.reloadShort}),(0,Tt.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.dismiss,"aria-label":e.dismiss,onClick:n,children:(0,Tt.jsx)(rn,{name:"x"})})]})}function Wfe({inputRef:e,t,importing:n,onImporting:i,onOpen:r,onError:o}){return(0,Tt.jsx)("input",{ref:e,type:"file",hidden:!0,accept:ka.map(a=>`.${a}`).join(","),disabled:n,onChange:async a=>{let s=a.currentTarget.files?.[0];if(a.currentTarget.value="",!!s){i(!0);try{if(s.size>tb)throw new Error(t.importTooLarge);r(await RH(s))}catch(l){o(l,s.name)}finally{i(!1)}}}})}function GH(e,t,n){let i=(0,_l.useRef)(null),[r,o]=(0,_l.useState)(!1);return{importing:r,browse:()=>i.current?.click(),input:(0,Tt.jsx)(Wfe,{inputRef:i,t:e,importing:r,onImporting:o,onOpen:t,onError:n})}}var dr=Ln(zr(),1);function WH({appRef:e,canvasRef:t,t:n,path:i,info:r,kind:o,showSkeleton:a,failure:s,nothing:l,onExpand:c,children:u}){return(0,dr.jsxs)("div",{ref:e,className:"app inline",children:[(0,dr.jsxs)("header",{className:"docbar",children:[(0,dr.jsxs)("div",{className:"doctitle static",title:i??void 0,children:[(0,dr.jsx)("span",{className:"name",children:i?Pd(i):n.title}),r&&n.meta[r.kind](r.units)?(0,dr.jsx)("span",{className:"meta",children:n.meta[r.kind](r.units)}):null]}),(0,dr.jsx)("span",{className:"spacer"}),(0,dr.jsxs)("button",{type:"button",className:"btn sm",title:n.sidePanel,onClick:c,children:[(0,dr.jsx)(rn,{name:"maximize-2",size:12}),n.sidePanel]})]}),(0,dr.jsx)("div",{className:"stage",children:(0,dr.jsxs)("div",{ref:t,className:"canvas",children:[u,a?(0,dr.jsx)(pw,{kind:o}):null,s?(0,dr.jsx)(mw,{t:n,title:s.title,detail:s.detail,onOpenAnother:c}):null,l?(0,dr.jsx)("div",{className:"failed muted",children:n.openTitle}):null,(0,dr.jsx)("button",{type:"button",className:"glance-cover","aria-label":n.sidePanel,onClick:c})]})})]})}var Yr=Ln(oo(),1);var gw=Ln(oo(),1),jd=8;function uD(e,t,n){let i=(0,gw.useRef)(null),{side:r,offset:o=8,dock:a=!1}=n;return(0,gw.useLayoutEffect)(()=>{let s=i.current,l=e.current;if(!s||!l)return;let c=0,u=()=>{c=0;let p=l.getBoundingClientRect(),g=s.offsetWidth,v=s.offsetHeight,m=t?.()??null,y=(w,z,A,M)=>{s.style.visibility="",s.style.left=`${Math.round(w)}px`,s.style.top=`${Math.round(z)}px`,s.dataset.side=A,s.style.setProperty("--tip",`${Math.round(Math.max(14,Math.min(g-14,M-w)))}px`)};if(!m){a?y((p.width-g)/2,jd,"none",p.width/2):s.style.visibility="hidden";return}if(m.bottom<p.top+4||m.top>p.bottom-4){s.style.visibility="hidden";return}let b=(m.left+m.right)/2-p.left,x=Math.max(jd,Math.min(p.width-g-jd,b-g/2)),_=m.top-p.top-v-o,S=m.bottom-p.top+o,$=_>=jd,C=S+v<=p.height-jd;(r==="top"||!C)&&$?y(x,_,"top",b):C?y(x,S,"bottom",b):y(x,r==="top"?jd:p.height-v-jd,"none",b)},d=()=>{c||(c=requestAnimationFrame(u))};u(),l.addEventListener("scroll",d,{capture:!0,passive:!0});let f=new ResizeObserver(d);f.observe(l),f.observe(s);let h=setInterval(d,250);return()=>{l.removeEventListener("scroll",d,{capture:!0}),f.disconnect(),clearInterval(h),c&&cancelAnimationFrame(c)}},[e,t,r,o,a]),i}var Pe=Ln(zr(),1);function dD({className:e,onClose:t,children:n,label:i}){let r=(0,Yr.useRef)(null);(0,Yr.useEffect)(()=>{let a=l=>{let c=l.target;!r.current?.contains(c)&&!c.closest?.("[data-menu-trigger]")&&t()},s=l=>{l.key==="Escape"&&(l.stopPropagation(),t())};return document.addEventListener("pointerdown",a,!0),document.addEventListener("keydown",s,!0),r.current?.querySelector("[role^=menuitem]")?.focus(),()=>{document.removeEventListener("pointerdown",a,!0),document.removeEventListener("keydown",s,!0)}},[t]);let o=a=>{if(a.key!=="ArrowDown"&&a.key!=="ArrowUp")return;a.preventDefault();let s=[...r.current?.querySelectorAll("[role^=menuitem]")??[]],l=s.indexOf(document.activeElement);s[(l+(a.key==="ArrowDown"?1:-1)+s.length)%s.length]?.focus()};return(0,Pe.jsx)("div",{ref:r,className:`menu ${e}`,role:"menu","aria-label":i,onKeyDown:o,children:n})}function Kc({icon:e,checked:t,children:n,hint:i,onSelect:r}){return(0,Pe.jsxs)("button",{type:"button",role:t===void 0?"menuitem":"menuitemradio","aria-checked":t,className:"mi",onClick:r,children:[(0,Pe.jsx)("span",{className:"mi-icon",children:t?(0,Pe.jsx)(rn,{name:"check",size:16}):e}),(0,Pe.jsx)("span",{className:"mi-label",children:n}),i?(0,Pe.jsx)("span",{className:"mi-hint",children:i}):null]})}function XH({t:e,query:t,total:n,index:i,onQuery:r,onStep:o,onClose:a}){let s=(0,Yr.useRef)(null);(0,Yr.useEffect)(()=>{s.current?.focus(),s.current?.select()},[]);let l=!t.trim()||n===null?"":n?e.findCount(i+1,n):e.noResults;return(0,Pe.jsxs)("div",{className:"docbar findbar",role:"search",children:[(0,Pe.jsxs)("label",{className:"findfield",children:[(0,Pe.jsx)(rn,{name:"search",className:"muted"}),(0,Pe.jsx)("input",{ref:s,className:"find-input",type:"text","aria-label":e.find,placeholder:e.findPlaceholder,value:t,onChange:c=>r(c.target.value),onKeyDown:c=>{c.key==="Enter"?(c.preventDefault(),o(c.shiftKey?-1:1)):c.key==="Escape"&&(c.preventDefault(),c.stopPropagation(),a())}}),(0,Pe.jsx)("span",{className:"count","aria-live":"polite",children:l})]}),(0,Pe.jsx)("button",{type:"button",className:"btn icon dim",title:e.previousMatch,"aria-label":e.previousMatch,disabled:!n,onClick:()=>o(-1),children:(0,Pe.jsx)(rn,{name:"chevron-up"})}),(0,Pe.jsx)("button",{type:"button",className:"btn icon dim",title:e.nextMatch,"aria-label":e.nextMatch,disabled:!n,onClick:()=>o(1),children:(0,Pe.jsx)(rn,{name:"chevron-down"})}),(0,Pe.jsx)("button",{type:"button",className:"btn icon dim",title:e.closeFind,"aria-label":e.closeFind,onClick:a,children:(0,Pe.jsx)(rn,{name:"x"})})]})}var Yfe=1500;function KH({t:e,frame:t,page:n,zoom:i,onPage:r,onZoom:o,onFit:a}){let s=(0,Yr.useRef)(null),[l,c]=(0,Yr.useState)(!0),[u,d]=(0,Yr.useState)(null),f=(0,Yr.useRef)(!1);(0,Yr.useEffect)(()=>{let p=t.current;if(!p)return;let g=0,v=()=>{clearTimeout(g),g=window.setTimeout(()=>{!f.current&&!s.current?.contains(document.activeElement)&&c(!1)},Yfe)},m=()=>{c(!0),v()},y=b=>{let x=p.getBoundingClientRect();b.clientY>x.bottom-80&&m()};return p.addEventListener("scroll",m,{capture:!0,passive:!0}),p.addEventListener("pointermove",y,{passive:!0}),v(),()=>{clearTimeout(g),p.removeEventListener("scroll",m,{capture:!0}),p.removeEventListener("pointermove",y)}},[t]);let h=()=>{let p=Number(u);d(null),Number.isInteger(p)&&p>=1&&r(Math.min(p,n.count))};return(0,Pe.jsxs)("div",{ref:s,className:`pill${l?"":" faded"}`,onPointerEnter:()=>{f.current=!0,c(!0)},onPointerLeave:()=>{f.current=!1},onFocus:()=>c(!0),children:[(0,Pe.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.previousPage,"aria-label":e.previousPage,disabled:n.current<=1,onClick:()=>r(n.current-1),children:(0,Pe.jsx)(rn,{name:"chevron-up"})}),(0,Pe.jsxs)("span",{className:"pg",children:[(0,Pe.jsx)("input",{className:"pgin","aria-label":e.pageNumber,inputMode:"numeric",style:{width:`${Math.max(2,String(n.count).length)+1.6}ch`},value:u??String(n.current),onFocus:p=>{d(String(n.current)),p.target.select()},onChange:p=>d(p.target.value.replace(/\D/g,"")),onBlur:()=>d(null),onKeyDown:p=>{p.key==="Enter"?(h(),p.currentTarget.blur()):p.key==="Escape"&&(p.stopPropagation(),d(null),p.currentTarget.blur())}}),(0,Pe.jsx)("span",{children:e.ofPages(n.count)})]}),(0,Pe.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.nextPage,"aria-label":e.nextPage,disabled:n.current>=n.count,onClick:()=>r(n.current+1),children:(0,Pe.jsx)(rn,{name:"chevron-down"})}),i?(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)("span",{className:"vsep"}),(0,Pe.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.zoomOut,"aria-label":e.zoomOut,disabled:i.mode!=="width"&&i.percent<=25,onClick:()=>o(-1),children:(0,Pe.jsx)(rn,{name:"minus"})}),(0,Pe.jsx)("button",{type:"button",className:"zoom",title:e.fitWidth,onClick:a,children:i.mode==="width"?e.fit:`${i.percent}%`}),(0,Pe.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.zoomIn,"aria-label":e.zoomIn,disabled:i.mode!=="width"&&i.percent>=400,onClick:()=>o(1),children:(0,Pe.jsx)(rn,{name:"plus"})})]}):null]})}var YH=e=>{e.target.closest("textarea")||e.preventDefault()};function JH({t:e,frame:t,locate:n,text:i,label:r,quote:o,short:a,mode:s,canAsk:l,copied:c,onAdd:u,onAsk:d,onCopy:f,onCancelAsk:h,onSend:p}){let g=s==="ask",v=uD(t,n,{side:g?"bottom":"top",dock:!0}),[m,y]=(0,Yr.useState)(""),[b,x]=(0,Yr.useState)(!1),_=async()=>{if(!m.trim()||b)return;x(!0);let S=await p(m.trim());x(!1),S&&y("")};return g?(0,Pe.jsxs)("div",{ref:v,className:"pop ask",role:"dialog","aria-label":e.ask,onMouseDown:YH,children:[(0,Pe.jsxs)("div",{className:"ctx",children:[(0,Pe.jsx)("span",{className:"where",children:r}),o?(0,Pe.jsxs)("span",{className:"q",children:["\u201C",o,"\u201D"]}):null]}),(0,Pe.jsx)("textarea",{autoFocus:!0,className:"textarea",rows:2,"aria-label":e.askPlaceholder,placeholder:e.askPlaceholder,value:m,onChange:S=>y(S.target.value),onKeyDown:S=>{S.key==="Enter"&&!S.shiftKey&&!S.nativeEvent.isComposing?(S.preventDefault(),_()):S.key==="Escape"&&(S.preventDefault(),S.stopPropagation(),h())}}),(0,Pe.jsxs)("div",{className:"row",children:[(0,Pe.jsxs)("span",{className:"hint",children:[(0,Pe.jsx)("kbd",{children:"\u21B5"})," ",e.sendKey]}),(0,Pe.jsx)("button",{type:"button",className:"btn sm",onClick:h,children:e.cancel}),(0,Pe.jsx)("button",{type:"button",className:"btn sm primary",disabled:!m.trim()||b,onClick:()=>void _(),children:e.send})]})]}):(0,Pe.jsxs)("div",{ref:v,className:"pop bar",role:"toolbar","aria-label":r,onMouseDown:YH,children:[i?null:(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)("span",{className:"where",children:r}),(0,Pe.jsx)("span",{className:"vsep"})]}),(0,Pe.jsx)("button",{type:"button",className:"btn lg",title:e.addToChatHint,onClick:u,disabled:s==="added",children:s==="added"?(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(rn,{name:"check",size:16,className:"ok"}),e.added]}):(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(rn,{name:"message-square-plus",size:16}),a?e.addShort:e.addToChat]})}),l?(0,Pe.jsxs)("button",{type:"button",className:"btn lg",onClick:d,children:[(0,Pe.jsx)(rn,{name:"message-circle-question",size:16}),e.ask]}):null,i?(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)("span",{className:"vsep"}),(0,Pe.jsx)("button",{type:"button",className:"btn icon lg dim",title:c?e.copied:e.copy,"aria-label":c?e.copied:e.copy,onClick:f,children:(0,Pe.jsx)(rn,{name:c?"check":"copy"})})]}):null]})}function QH({t:e,frame:t,locate:n,note:i,index:r,total:o,onNext:a,onClose:s}){let l=uD(t,n,{side:"bottom",offset:6,dock:!0});return(0,Pe.jsxs)("div",{ref:l,className:"callout",role:"note",children:[(0,Pe.jsxs)("div",{className:"body",children:[(0,Pe.jsxs)("div",{className:"who",children:[(0,Pe.jsx)("span",{className:"dot"}),o>1?e.agentOf(r+1,o):e.agent]}),i?(0,Pe.jsx)("div",{className:"text",children:i}):null]}),o>1?(0,Pe.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.nextTarget,"aria-label":e.nextTarget,onClick:a,children:(0,Pe.jsx)(rn,{name:"chevron-down"})}):null,(0,Pe.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.close,"aria-label":e.close,onClick:s,children:(0,Pe.jsx)(rn,{name:"x"})})]})}function eZ({text:e,down:t,raised:n,onClick:i}){return(0,Pe.jsxs)("button",{type:"button",className:`chip offscreen${n?" raised":""}`,onClick:i,children:[(0,Pe.jsx)("span",{className:"dot"}),e,(0,Pe.jsx)(rn,{name:t?"arrow-down":"arrow-up",size:12})]})}function tZ(e,t){return e.moreOn(t.length,hw(t[0],e,!0))}var ii=Ln(zr(),1);function nZ({t:e,recent:t,currentPath:n,onOpen:i,onBrowse:r,onClose:o}){return(0,ii.jsxs)(dD,{className:"switcher",label:e.switchDocument,onClose:o,children:[t.length?(0,ii.jsx)("div",{className:"mlabel",children:e.recent}):null,t.map(a=>(0,ii.jsx)(Kc,{icon:(0,ii.jsx)(FH,{kind:a.kind}),hint:a.path===n?(0,ii.jsx)(rn,{name:"check",size:16}):Pd(IH(a.path)),onSelect:()=>a.path===n?o():i(a.path),children:Pd(a.path)},a.path)),t.length?(0,ii.jsx)("div",{className:"msep"}):null,(0,ii.jsx)(Kc,{icon:(0,ii.jsx)(rn,{name:"folder-open",size:16}),onSelect:r,children:e.openFile})]})}function iZ({t:e,zoomable:t,zoomMode:n,onFit:i,onFind:r,onReload:o,onClose:a}){return(0,ii.jsxs)(dD,{className:"more",label:e.more,onClose:a,children:[t?(0,ii.jsxs)(ii.Fragment,{children:[(0,ii.jsx)(Kc,{checked:n==="width",onSelect:()=>i("width"),children:e.fitWidth}),(0,ii.jsx)(Kc,{checked:n==="page",onSelect:()=>i("page"),children:e.fitPage}),(0,ii.jsx)(Kc,{checked:n==="actual",hint:"100%",onSelect:()=>i("actual"),children:e.actualSize}),(0,ii.jsx)("div",{className:"msep"})]}):null,(0,ii.jsx)(Kc,{icon:(0,ii.jsx)(rn,{name:"search",size:16}),hint:"\u2318F",onSelect:r,children:e.find}),(0,ii.jsx)(Kc,{icon:(0,ii.jsx)(rn,{name:"rotate-cw",size:16}),onSelect:o,children:e.reload})]})}var Ma=Ln(oo(),1),sb={open:!1,query:"",total:null,index:-1};function rZ({viewer:e,docRef:t,ready:n,onOpen:i}){let[r,o]=(0,Ma.useState)(sb),a=(0,Ma.useRef)(0),s=(0,Ma.useCallback)(()=>{t.current&&(i(),o(d=>({...d,open:!0})),requestAnimationFrame(()=>{let d=document.querySelector(".findbar .find-input");d?.focus(),d?.select()}))},[t,i]),l=(0,Ma.useCallback)(()=>{a.current++,e.current?.clearFind(),o(sb)},[e]),c=(0,Ma.useCallback)(d=>{o(f=>({...f,query:d,total:d.trim()?f.total:null}))},[]);(0,Ma.useEffect)(()=>{if(!r.open||!n)return;let d=++a.current,f=setTimeout(async()=>{let h=e.current;if(!h)return;let p=await h.find(r.query).catch(()=>0);d===a.current&&(o(g=>({...g,total:p,index:p?0:-1})),p&&h.findGo(0))},200);return()=>clearTimeout(f)},[r.open,r.query,n,e]);let u=(0,Ma.useCallback)(d=>{if(!r.total)return;let f=(r.index+d+r.total)%r.total;o(h=>({...h,index:f})),e.current?.findGo(f)},[r.total,r.index,e]);return{find:r,setFind:o,openFind:s,closeFind:l,queryFind:c,stepFind:u}}var oZ=Ln(oo(),1);function aZ(e,t){(0,oZ.useEffect)(()=>{Ho().handleTool("capture_view",async i=>{let r=e.current;if(!r||!t.current)throw new Error(`No document is open in the ${Fn.title.en} panel. Call open_document first.`);let o=null;if(typeof i.anchor=="string"&&i.anchor.trim()){let l=xH(i.anchor);if(l.path.replace(/^\.\//,"")!==r.info.path)throw new Error(`The panel shows ${r.info.path}, not ${l.path}. Call open_document with that path first.`);o=l.at}let a=typeof i.maxWidth=="number"?Math.min(2e3,Math.max(320,i.maxWidth)):1600,s=await t.current.capture(o,a);return{content:[{type:"image",data:s.data,mimeType:"image/png"},{type:"text",text:`Captured ${ib(r.info.path,s.at)} (${s.width}\xD7${s.height} px).`}]}})},[e,t])}var vw=Ln(oo(),1);function sZ(e,t){let[n,i]=(0,vw.useState)(null);return(0,vw.useEffect)(()=>{let r=e.current;if(!r||!t||t.targets.length<2){i(null);return}let o=0,a=()=>{o=0;let c=r.getBoundingClientRect(),u=[],d=[];t.targets.forEach((h,p)=>{if(p===t.index)return;let g=h.locate();g&&(g.top>c.bottom-8?u.push(p):g.bottom<c.top+8&&d.push(p))});let f=u.length?{indexes:u,down:!0}:d.length?{indexes:d,down:!1}:null;i(h=>JSON.stringify(h)===JSON.stringify(f)?h:f)},s=()=>{o||(o=requestAnimationFrame(a))};a(),r.addEventListener("scroll",s,{capture:!0,passive:!0});let l=setInterval(s,500);return()=>{r.removeEventListener("scroll",s,{capture:!0}),clearInterval(l),o&&cancelAnimationFrame(o)}},[t,e]),[n,i]}var lZ=Ln(oo(),1);function cZ({docRef:e,viewer:t,picked:n,addReference:i,openFind:r,closeFind:o,clearSelection:a,paged:s,page:l,goToPage:c,drawer:u,setDrawer:d,docked:f,find:h,agent:p,setAgent:g}){(0,lZ.useEffect)(()=>{let v=m=>{if(m.defaultPrevented)return;let y=m.metaKey||m.ctrlKey,b=m.target?.closest?.("input, textarea, [contenteditable]"),x=m.key.toLowerCase();if(y&&x==="f"&&e.current)m.preventDefault(),r();else if(y&&m.key==="Enter"&&n)m.preventDefault(),i();else if(y&&(m.key==="="||m.key==="+"))m.preventDefault(),t.current?.zoom(1);else if(y&&m.key==="-")m.preventDefault(),t.current?.zoom(-1);else if(y&&m.key==="0")m.preventDefault(),t.current?.fit("width");else if(!y&&!b&&s&&l&&["ArrowLeft","ArrowRight","PageUp","PageDown"].includes(m.key)){m.preventDefault();let _=m.key==="ArrowLeft"||m.key==="PageUp";c(l.current+(_?-1:1))}else if(m.key==="Escape"&&!b){if(n)a();else if(u.open&&!f)d(_=>({..._,open:!1}));else if(h.open)o();else if(p?.visible)g({...p,visible:!1});else return;m.preventDefault()}};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[n,i,r,o,a,s,l,c,u.open,f,h.open,p,e,t,d,g])}var Hn=Ln(oo(),1);var kIe={},yw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xfe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function bw(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var uZ={exports:{}};var dZ;function Kfe(){return dZ||(dZ=1,(function(e,t){(function(n){e.exports=n()})(function(){return(function n(i,r,o){function a(c,u){if(!r[c]){if(!i[c]){var d=typeof bw=="function"&&bw;if(!u&&d)return d(c,!0);if(s)return s(c,!0);var f=new Error("Cannot find module '"+c+"'");throw f.code="MODULE_NOT_FOUND",f}var h=r[c]={exports:{}};i[c][0].call(h.exports,function(p){var g=i[c][1][p];return a(g||p)},h,h.exports,n,i,r,o)}return r[c].exports}for(var s=typeof bw=="function"&&bw,l=0;l<o.length;l++)a(o[l]);return a})({1:[function(n,i,r){var o=n("./utils"),a=n("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(l){for(var c,u,d,f,h,p,g,v=[],m=0,y=l.length,b=y,x=o.getTypeOf(l)!=="string";m<l.length;)b=y-m,d=x?(c=l[m++],u=m<y?l[m++]:0,m<y?l[m++]:0):(c=l.charCodeAt(m++),u=m<y?l.charCodeAt(m++):0,m<y?l.charCodeAt(m++):0),f=c>>2,h=(3&c)<<4|u>>4,p=1<b?(15&u)<<2|d>>6:64,g=2<b?63&d:64,v.push(s.charAt(f)+s.charAt(h)+s.charAt(p)+s.charAt(g));return v.join("")},r.decode=function(l){var c,u,d,f,h,p,g=0,v=0,m="data:";if(l.substr(0,m.length)===m)throw new Error("Invalid base64 input, it looks like a data url.");var y,b=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===s.charAt(64)&&b--,l.charAt(l.length-2)===s.charAt(64)&&b--,b%1!=0)throw new Error("Invalid base64 input, bad content length.");for(y=a.uint8array?new Uint8Array(0|b):new Array(0|b);g<l.length;)c=s.indexOf(l.charAt(g++))<<2|(f=s.indexOf(l.charAt(g++)))>>4,u=(15&f)<<4|(h=s.indexOf(l.charAt(g++)))>>2,d=(3&h)<<6|(p=s.indexOf(l.charAt(g++))),y[v++]=c,h!==64&&(y[v++]=u),p!==64&&(y[v++]=d);return y}},{"./support":30,"./utils":32}],2:[function(n,i,r){var o=n("./external"),a=n("./stream/DataWorker"),s=n("./stream/Crc32Probe"),l=n("./stream/DataLengthProbe");function c(u,d,f,h,p){this.compressedSize=u,this.uncompressedSize=d,this.crc32=f,this.compression=h,this.compressedContent=p}c.prototype={getContentWorker:function(){var u=new a(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),d=this;return u.on("end",function(){if(this.streamInfo.data_length!==d.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new a(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,d,f){return u.pipe(new s).pipe(new l("uncompressedSize")).pipe(d.compressWorker(f)).pipe(new l("compressedSize")).withStreamInfo("compression",d)},i.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,i,r){var o=n("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},r.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,i,r){var o=n("./utils"),a=(function(){for(var s,l=[],c=0;c<256;c++){s=c;for(var u=0;u<8;u++)s=1&s?3988292384^s>>>1:s>>>1;l[c]=s}return l})();i.exports=function(s,l){return s!==void 0&&s.length?o.getTypeOf(s)!=="string"?(function(c,u,d,f){var h=a,p=f+d;c^=-1;for(var g=f;g<p;g++)c=c>>>8^h[255&(c^u[g])];return-1^c})(0|l,s,s.length,0):(function(c,u,d,f){var h=a,p=f+d;c^=-1;for(var g=f;g<p;g++)c=c>>>8^h[255&(c^u.charCodeAt(g))];return-1^c})(0|l,s,s.length,0):0}},{"./utils":32}],5:[function(n,i,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(n,i,r){var o=null;o=typeof Promise<"u"?Promise:n("lie"),i.exports={Promise:o}},{lie:37}],7:[function(n,i,r){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",a=n("pako"),s=n("./utils"),l=n("./stream/GenericWorker"),c=o?"uint8array":"array";function u(d,f){l.call(this,"FlateWorker/"+d),this._pako=null,this._pakoAction=d,this._pakoOptions=f,this.meta={}}r.magic="\b\0",s.inherits(u,l),u.prototype.processChunk=function(d){this.meta=d.meta,this._pako===null&&this._createPako(),this._pako.push(s.transformTo(c,d.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new a[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var d=this;this._pako.onData=function(f){d.push({data:f,meta:d.meta})}},r.compressWorker=function(d){return new u("Deflate",d)},r.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,i,r){function o(h,p){var g,v="";for(g=0;g<p;g++)v+=String.fromCharCode(255&h),h>>>=8;return v}function a(h,p,g,v,m,y){var b,x,_=h.file,S=h.compression,$=y!==c.utf8encode,C=s.transformTo("string",y(_.name)),w=s.transformTo("string",c.utf8encode(_.name)),z=_.comment,A=s.transformTo("string",y(z)),M=s.transformTo("string",c.utf8encode(z)),T=w.length!==_.name.length,k=M.length!==z.length,I="",D="",E="",N=_.dir,F=_.date,G={crc32:0,compressedSize:0,uncompressedSize:0};p&&!g||(G.crc32=h.crc32,G.compressedSize=h.compressedSize,G.uncompressedSize=h.uncompressedSize);var P=0;p&&(P|=8),$||!T&&!k||(P|=2048);var O=0,V=0;N&&(O|=16),m==="UNIX"?(V=798,O|=(function(H,Q){var le=H;return H||(le=Q?16893:33204),(65535&le)<<16})(_.unixPermissions,N)):(V=20,O|=(function(H){return 63&(H||0)})(_.dosPermissions)),b=F.getUTCHours(),b<<=6,b|=F.getUTCMinutes(),b<<=5,b|=F.getUTCSeconds()/2,x=F.getUTCFullYear()-1980,x<<=4,x|=F.getUTCMonth()+1,x<<=5,x|=F.getUTCDate(),T&&(D=o(1,1)+o(u(C),4)+w,I+="up"+o(D.length,2)+D),k&&(E=o(1,1)+o(u(A),4)+M,I+="uc"+o(E.length,2)+E);var j="";return j+=`
108
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:q.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:q.string().optional().describe("User's timezone in IANA format."),userAgent:q.string().optional().describe("Host application identifier."),platform:q.union([q.literal("web"),q.literal("desktop"),q.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:q.object({touch:q.boolean().optional().describe("Whether the device supports touch input."),hover:q.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:q.object({top:q.number().describe("Top safe area inset in pixels."),right:q.number().describe("Right safe area inset in pixels."),bottom:q.number().describe("Bottom safe area inset in pixels."),left:q.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),Mfe=q.object({method:q.literal("ui/notifications/host-context-changed"),params:fH.describe("Partial context update containing only changed fields.")}),RNe=q.object({method:q.literal("ui/update-model-context"),params:q.object({content:q.array(os).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:q.record(q.string(),q.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),LNe=q.object({method:q.literal("ui/initialize"),params:q.object({appInfo:is.describe("App identification (name and version)."),appCapabilities:Sfe.describe("Features and capabilities this app provides."),protocolVersion:q.string().describe("Protocol version this app supports.")})}),Cfe=q.object({protocolVersion:q.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:is.describe("Host application identification and version."),hostCapabilities:_fe.describe("Features and capabilities provided by the host."),hostContext:fH.describe("Rich context about the host environment.")}).passthrough(),zfe={target:"draft-2020-12"};async function dH(e,t){let n=e["~standard"];if(n.jsonSchema)return n.jsonSchema[t](zfe);throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function hH(e,t,n=""){let i=await e["~standard"].validate(t);if(i.issues){let r=i.issues.map(o=>{let a=o.path?.map(s=>typeof s=="object"?s.key:s).join(".");return a?`${a}: ${o.message}`:o.message}).join("; ");throw Error(n+r)}return i.value}function pH(e,t=document.documentElement){for(let[n,i]of Object.entries(e))i!==void 0&&t.style.setProperty(n,i)}function Tfe(e,t){let n={...e,...t};return t.experimental!==void 0&&(n.experimental={...e.experimental,...t.experimental}),t.tools!==void 0&&(n.tools={...e.tools,...t.tools}),n}var aw=class e extends QE{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new eD;_methods=new tD;setRequestHandler=(...t)=>{let[n,...i]=cH("request",t)??t;this._methods.claim(n,"setRequestHandler"),super.setRequestHandler.call(this,n,...i)};setNotificationHandler=(...t)=>{let[n,...i]=cH("notification",t)??t;this._methods.claim(n,"setNotificationHandler"),super.setNotificationHandler.call(this,n,...i)};removeRequestHandler=t=>{this._methods.release(t),super.removeRequestHandler(t)};removeNotificationHandler=t=>{this._methods.release(t),super.removeNotificationHandler(t)};replaceRequestHandler=(t,...n)=>{this._methods.replace(t),super.setRequestHandler.call(this,t,...n)};_assertInitialized(t){if(this._initializedSent)return;let n=`[ext-apps] App.${t}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(n);console.warn(`${n}. This will throw in a future release.`)}eventSchemas={toolinput:pfe,toolinputpartial:mfe,toolresult:kfe,toolcancelled:gfe,hostcontextchanged:Mfe};static ONE_SHOT_EVENTS=new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(t,n){n&&this._assertHandlerTiming(t),this._ensureEventSlot(t),this._events.setHandler(t,n)}addEventListener(t,n){this._assertHandlerTiming(t),this._ensureEventSlot(t),this._events.addEventListener(t,n)}removeEventListener(t,n){this._events.removeEventListener(t,n)}_ensureEventSlot(t){if(this._registeredEvents.has(t))return;let n=this.eventSchemas[t];if(!n)throw Error(`Unknown event: ${String(t)}`);this.setNotificationHandler(n.shape.method.value,{params:n.shape.params},i=>{let r=i;t==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...r}),this._events.dispatch(t,r)}),this._registeredEvents.add(t)}getEventHandler(t){return this._events.getHandler(t)}warnIfRequestHandlerReplaced(t,n,i){n&&i&&console.warn(`[MCP Apps] ${t} handler replaced. Previous handler will no longer be called.`)}constructor(t,n={},i={autoResize:!0}){super(i),this._appInfo=t,this._appCapabilities=n,this.options=i,this._methods.replace("notifications/cancelled"),this._methods.replace("notifications/progress"),!i.allowUnsafeEval&&q.config({jitless:!0}),this.replaceRequestHandler("ping",r=>(console.log("Received ping:",r.params),{})),this.setEventHandler("hostcontextchanged",void 0)}buildContext(t){return t}registerAppCapabilities(t){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._appCapabilities=Tfe(this._appCapabilities,t)}registerTool(t,n,i){if(this._registeredTools[t])throw Error(`Tool ${t} is already registered`);let r=this,o=()=>{r._initializedSent&&r._appCapabilities.tools?.listChanged&&r.sendToolListChanged()},a=n.inputSchema!==void 0,s={title:n.title,description:n.description,inputSchema:n.inputSchema,outputSchema:n.outputSchema,annotations:n.annotations,_meta:n._meta,enabled:!0,enable(){this.enabled=!0,o()},disable(){this.enabled=!1,o()},update(l){Object.assign(this,l),o()},remove(){r._registeredTools[t]===s&&(delete r._registeredTools[t],o())},handler:async(l,c)=>{if(!s.enabled)throw Error(`Tool ${t} is disabled`);let u;if(a){let d=s.inputSchema,f=d?await hH(d,l??{},`Invalid input for tool ${t}: `):l??{};u=await i(f,c)}else u=await i(c);return s.outputSchema&&!u.isError&&(u.structuredContent=await hH(s.outputSchema,u.structuredContent,`Invalid output for tool ${t}: `)),u}};return this._registeredTools[t]=s,!this._appCapabilities.tools&&!this.transport&&this.registerAppCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),o(),s}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(t,n)=>{let i=this._registeredTools[t.name];if(!i)throw Error(`Tool ${t.name} not found`);return i.handler(t.arguments,n)},this.onlisttools=async(t,n)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([i,r])=>r.enabled).map(async([i,r])=>{let o={name:i,title:r.title,description:r.description,inputSchema:r.inputSchema?await dH(r.inputSchema,"input"):{type:"object",properties:{}}};return r.outputSchema&&(o.outputSchema=await dH(r.outputSchema,"output")),r.annotations&&(o.annotations=r.annotations),r._meta&&(o._meta=r._meta),o}))}))}async sendToolListChanged(t={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:t})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(t){this.setEventHandler("toolinput",t)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(t){this.setEventHandler("toolinputpartial",t)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(t){this.setEventHandler("toolresult",t)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(t){this.setEventHandler("toolcancelled",t)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(t){this.setEventHandler("hostcontextchanged",t)}_onteardown;get onteardown(){return this._onteardown}set onteardown(t){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,t),this._onteardown=t,this.replaceRequestHandler("ui/resource-teardown",{params:bfe.shape.params,result:xfe},(n,i)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(n,i)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(t){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,t),this._oncalltool=t,this.replaceRequestHandler("tools/call",(n,i)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(n.params,i)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(t){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,t),this._onlisttools=t,this.replaceRequestHandler("tools/list",(n,i)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(n.params,i)})}assertCapabilityForMethod(t){switch(t){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${t})`);break}}assertRequestHandlerCapability(t){switch(t){case"tools/call":case"tools/list":if(!this._appCapabilities.tools)throw Error(`Client does not support tool capability (required for ${t})`);return;default:return}}assertNotificationCapability(t){}async callServerTool(t,n){if(this._assertInitialized("callServerTool"),typeof t=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${t}"). Did you mean: callServerTool({ name: "${t}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:t},{onprogress:()=>{},resetTimeoutOnProgress:!0,...n})}async readServerResource(t,n){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:t},n)}async listServerResources(t,n){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:t},n)}async createSamplingMessage(t,n){return this._assertInitialized("createSamplingMessage"),await this.request({method:"sampling/createMessage",params:t},n)}sendMessage(t,n){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:t},ffe,n)}sendLog(t){return this.notification({method:"notifications/message",params:t})}updateModelContext(t,n){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:t},Wc,n)}openLink(t,n){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:t},dfe,n)}sendOpenLink=this.openLink;downloadFile(t,n){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:t},hfe,n)}requestTeardown(t={}){return this.notification({method:"ui/notifications/request-teardown",params:t})}requestDisplayMode(t,n){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:t},$fe,n)}sendSizeChanged(t){return this.notification({method:"ui/notifications/size-changed",params:t})}setupSizeChangedNotifications(){let t=!1,n=0,i=0,r=()=>{t||(t=!0,requestAnimationFrame(()=>{t=!1;let a=document.documentElement,s=a.style.height;a.style.height="max-content";let l=Math.ceil(a.getBoundingClientRect().height);a.style.height=s;let c=Math.ceil(window.innerWidth);(c!==n||l!==i)&&(n=c,i=l,this.sendSizeChanged({width:c,height:l}))}))};r();let o=new ResizeObserver(r);return o.observe(document.documentElement),o.observe(document.body),()=>o.disconnect()}async connect(t=new Jy(window.parent,window.parent),n){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1;try{await super.connect(t);let i=await this.request({method:"ui/initialize",params:{appCapabilities:this._appCapabilities,appInfo:this._appInfo,protocolVersion:afe}},Cfe,n);if(i===void 0)throw Error(`Server sent invalid initialize result: ${i}`);this._hostCapabilities=i.hostCapabilities,this._hostInfo=i.hostInfo,this._hostContext=i.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(i){throw this.close(),i}}};var Fn={name:"presentations",version:"0.2.1",title:{en:"Presentations","zh-CN":"\u6F14\u793A\u6587\u7A3F"},kinds:["pptx"]};var mH=Fn.version,gH=Fn.name,BNe=Fn.name,FNe=`ui://${Fn.name}/panel.html`,Afe=`ui://${Fn.name}/assets/`,vH=`ui://${Fn.name}/file/`;var ka=Fn.kinds,tb=100*1024*1024,qNe=512*1024*1024,rD=4*1024*1024,VNe=24*1024,eb=class extends Error{constructor(n,i){super(i);this.code=n;this.name="OfficeError"}};function nb(e){let t=e.toLowerCase().match(/\.([a-z]+)$/)?.[1];return ka.includes(t??"")?t:null}var Ife={en:{sep:", ",and:" and ",or:" or "},"zh-CN":{sep:"\u3001",and:"\u548C",or:"\u6216"}};function Vo(e,t="en",n="and"){let i=Ife[t];if(e.length<2)return e.join("");let r=e[e.length-1],o=t==="zh-CN"&&/^[\x20-\x7e]/.test(r)?` ${i[n]} `:i[n];return`${e.slice(0,-1).join(i.sep)}${o}${r}`}function Nd(e="en",t="and"){return Vo(ka.map(n=>`.${n}`),e,t)}var ss=(e,t)=>new eb("invalid_anchor",`Cannot read location "${e}". ${t}`),ls={docx:"Use p:N, p:N-M, t:N or t:N/rRcC.",pptx:"Use slide:N, slide:N-M or slide:N/shape:ID.",pdf:"Use page:N or page:N-M.",xlsx:"Use Sheet, Sheet!A1 or Sheet!A1:C9 (quote names with spaces: 'My sheet'!A1)."};function oD(e,t,n){if(!t)throw ss(e,ls[n]);let i=Number(t[1]),r=t[2]===void 0?i:Number(t[2]);if(!(i>=1)||!(r>=i)||r>1e6)throw ss(e,ls[n]);return{from:i,to:r}}function yH(e){let t=/^\$?([A-Za-z]{1,3})\$?(\d{1,7})$/.exec(e);if(!t)return null;let n=0;for(let r of t[1].toUpperCase())n=n*26+(r.charCodeAt(0)-64);let i=Number(t[2]);return i<1||i>1048576||n>16384?null:{row:i,col:n}}function Rfe(e){let t,n;if(e.startsWith("'")){let s=1;for(t="";s<e.length;s++)if(e[s]==="'")if(e[s+1]==="'")t+="'",s++;else break;else t+=e[s];if(s>=e.length||(n=e.slice(s+1),n&&!n.startsWith("!")))throw ss(e,ls.xlsx);n=n.slice(1)}else{let s=e.lastIndexOf("!");t=s<0?e:e.slice(0,s),n=s<0?"":e.slice(s+1)}if(!t||t.length>64)throw ss(e,ls.xlsx);if(!n)return{kind:"xlsx",sheet:t};let[i,r=i]=n.split(":"),o=yH(i),a=yH(r);if(!o||!a)throw ss(e,ls.xlsx);return{kind:"xlsx",sheet:t,range:{start:{row:Math.min(o.row,a.row),col:Math.min(o.col,a.col)},end:{row:Math.max(o.row,a.row),col:Math.max(o.col,a.col)}}}}function bH(e,t){let n=t.trim();if(!n||n.length>300)throw ss(t,ls[e]);switch(e){case"docx":{let i=/^t:(\d+)(?:\/r(\d+)c(\d+))?$/i.exec(n);if(i){let r=Number(i[1]);if(r<1)throw ss(n,ls.docx);if(i[2]===void 0)return{kind:e,type:"table",table:r};let o={row:Number(i[2]),col:Number(i[3])};if(o.row<1||o.col<1)throw ss(n,ls.docx);return{kind:e,type:"table",table:r,cell:o}}return{kind:e,type:"paragraph",...oD(n,/^p:(\d+)(?:-(?:p:)?(\d+))?$/i.exec(n),e)}}case"pptx":{let i=/^slide:(\d+)\/shape:([\w-]{1,32})$/i.exec(n);if(i){let r=Number(i[1]);if(r<1)throw ss(n,ls.pptx);return{kind:e,from:r,to:r,shape:i[2]}}return{kind:e,...oD(n,/^slide:(\d+)(?:-(?:slide:)?(\d+))?$/i.exec(n),e)}}case"pdf":return{kind:e,...oD(n,/^page:(\d+)(?:-(?:page:)?(\d+))?$/i.exec(n),e)};case"xlsx":return Rfe(n)}}function xH(e){let t=/^(.*?\.(?:docx|xlsx|pptx|pdf))(?:#(.*))?$/i.exec(e.trim());if(!t)throw new eb("invalid_anchor",`"${e}" is not a document anchor. Use <path>.docx|.xlsx|.pptx|.pdf optionally followed by #<location>.`);return{path:t[1],at:t[2]?.trim()?t[2].trim():null}}function ib(e,t){return t?`${e}#${t}`:e}var _H=e=>e>=55296&&e<=56319,SH=e=>e>=56320&&e<=57343;function lw(e,t,n=e.length){let i=Math.max(0,Math.min(t,e.length)),r=Math.max(i,Math.min(n,e.length));return i>0&&SH(e.charCodeAt(i))&&_H(e.charCodeAt(i-1))&&i--,r<e.length&&SH(e.charCodeAt(r))&&_H(e.charCodeAt(r-1))&&r--,e.slice(i,r)}var Lfe=/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,cw=e=>e.replace(Lfe,"\uFFFD");function sw(e){return typeof e=="string"?cw(e):Array.isArray(e)?e.map(t=>sw(t)):e&&typeof e=="object"&&Object.getPrototypeOf(e)===Object.prototype?Object.fromEntries(Object.entries(e).map(([t,n])=>[t,sw(n)])):e}var $H=`${Fn.name}:windows:v1`,Efe=128;function wH(e){try{let t=JSON.parse(e.getItem($H)??"{}");return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function aD(e,t){let n=wH(e)[t];return!n||typeof n!="object"?{}:{...typeof n.path=="string"?{path:n.path}:{},...Array.isArray(n.recent)?{recent:n.recent.filter(i=>typeof i?.path=="string"&&nb(i.path)===i.kind)}:{}}}function kH(e,t,n){try{let i=wH(e),r={...aD(e,t),...n};delete i[t],i[t]=r;for(let o of Object.keys(i).slice(0,-Efe))delete i[o];e.setItem($H,JSON.stringify(i))}catch{}}var Xp=e=>e.filter(([t])=>ka.includes(t)).map(([,t])=>t),Dfe={docx:"Word",xlsx:"Excel",pptx:"PowerPoint",pdf:"PDF"},MH=ka.filter(e=>e!=="pdf"),CH=[...MH.length===3?["Office"]:MH.map(e=>Dfe[e]),...ka.includes("pdf")?["PDF"]:[]],rb=Fn.title.en,e5e=(()=>{let e=Vo(CH,"en","or");return`${/^[AEIOU]/.test(e)?"an":"a"} ${e} file`})(),t5e=`${Vo(CH)} files`,n5e=Nd("en","or"),i5e=Xp([["docx","report.docx#p:12"],["xlsx","model.xlsx#Revenue!B2:F9"],["pptx","deck.pptx#slide:3"],["pdf","paper.pdf#page:5"]]).join(", "),r5e=Xp([["docx","p:12"],["pptx","slide:3"],["pdf","page:5"],["xlsx","Revenue!B2:F9"]]).join(", "),o5e=Xp([["docx","Word paragraphs and tables (markdown)"],["xlsx","spreadsheet cells as a grid with formulas"],["pptx","slides with their shapes and speaker notes"],["pdf","PDF page text"]]).join(", "),a5e=Vo(Xp([["docx","paragraph"],["xlsx","cell range"],["pptx","slide"],["pptx","shape"],["pdf","page"]]),"en","or"),s5e=Vo(Xp([["pdf","PDF pages"],["docx","long paragraphs"]]))||"long passages",zH=Vo(Xp([["pptx","deck.pptx#slide:3"],["pdf","paper.pdf#page:2"],["docx","report.docx#p:12"],["xlsx","model.xlsx#Revenue!A1:H30"]]),"en","or");var TH=[{name:"capture_view",title:`Capture ${rb} view`,description:`Take a picture of a rendered document location in the ${rb} panel so you can see layout, charts, images and formatting that text extraction misses. Pass an anchor such as ${zH} (the document must be open in the panel; call open_document first), or omit it to capture what the user currently sees.`,inputSchema:{type:"object",properties:{anchor:{type:"string",maxLength:1200,description:"Location to capture; defaults to the visible view."},maxWidth:{type:"integer",minimum:320,maximum:2e3,description:"Maximum image width in pixels (default 1600)."}},additionalProperties:!1},annotations:{readOnlyHint:!0,idempotentHint:!0}}];function Ofe(){let e=crypto.randomUUID(),t=()=>n.getHostCapabilities()?.experimental?.["zcode/surface"]?.stateKey??e,n=new aw({name:gH,version:mH},{tools:{listChanged:!0},availableDisplayModes:["inline","fullscreen"]},{autoResize:!1}),i=[],r=new Map,o=new Set,a,s=c=>void window.dispatchEvent(new Event(`office:${c}`));return n.ontoolresult=c=>{i.push(c),i.length>20&&i.shift(),s("toolresult")},n.onhostcontextchanged=()=>s("hostchange"),n.onlisttools=async()=>({tools:TH}),n.oncalltool=async(c,u)=>{if(!TH.some(d=>d.name===c.name))return{isError:!0,content:[{type:"text",text:`The ${rb} page has no tool ${c.name}.`}]};try{let d=Date.now()+2e4;for(;!r.has(c.name)&&Date.now()<d;)await new Promise(p=>{let g=()=>(o.delete(g),p());o.add(g),setTimeout(g,500)});let f=r.get(c.name);if(!f)throw new Error(`The ${rb} panel is still loading; try again in a moment.`);let h=u;return await f(c.arguments??{},h.mcpReq?.signal??h.signal)}catch(d){return{isError:!0,content:[{type:"text",text:d instanceof Error?d.message:String(d)}]}}},window.addEventListener("pagehide",()=>{n.callServerTool({name:"release_view",arguments:{viewId:t()}}).catch(()=>{})}),{app:n,get viewId(){return t()},ready:()=>a??=n.connect(new Jy(window.parent,window.parent)).then(()=>s("hostchange")),readWindow(){let c=n.getHostCapabilities()?.experimental?.["zcode/surface"];if(!c?.stateKey)return{};try{return aD(localStorage,c.stateKey)}catch{return{}}},saveWindow(c){let u=n.getHostCapabilities()?.experimental?.["zcode/surface"];if(u?.stateKey)try{kH(localStorage,u.stateKey,c)}catch{}},readDocument(){return this.readWindow().path??null},saveDocument(c){this.saveWindow({path:c})},takeResults:()=>i.splice(0,i.length),handleTool(c,u){r.set(c,u);for(let d of o)d()},get context(){return n.getHostContext()},get capabilities(){return n.getHostCapabilities()}}}function Ho(){return window.__officeHost??=Ofe()}async function Nfe(e){let t=Ho();await t.ready();let i=(await t.app.readServerResource({uri:e})).contents[0];if(!i)throw new Error(`Empty resource ${e}`);return i}function Pfe(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}async function AH(e,t){let n=new Uint8Array(e.bytes),i=0;for(let r=0;r<e.chunks;r++){t?.throwIfAborted();let o=await Nfe(`${vH}${e.token}/${r}`);if(typeof o.blob!="string")throw new Error("File chunk is not binary");let a=Pfe(o.blob);n.set(a,i),i+=a.byteLength}if(i!==e.bytes)throw new Error("The file changed while it was loading; reload it.");return n.buffer}var uw=Ln(oo(),1);var ob=class extends Error{constructor(n,i){super(n);this.code=i;this.name="CallError"}};async function cs(e,t={}){let n=Ho();await n.ready();let i=await n.app.callServerTool({name:e,arguments:t}),r=i.structuredContent,o=r?.error;if(i.isError||o){let a=i.content?.[0]?.text;throw new ob(o?.message??a??`${e} failed`,o?.code)}return r}var Pd=e=>e.slice(e.lastIndexOf("/")+1),IH=e=>{let t=e.lastIndexOf("/");return t>0?e.slice(0,t):""};async function RH(e){let{id:t}=await cs("begin_file_import",{name:e.name,size:e.size});try{for(let i=0;i<e.size;i+=rD){let r=await new Promise((o,a)=>{let s=new FileReader;s.onload=()=>o(String(s.result).split(",")[1]),s.onerror=()=>a(s.error),s.readAsDataURL(e.slice(i,i+rD))});await cs("write_file_import",{id:t,offset:i,data:r})}return(await cs("finish_file_import",{id:t})).path}catch(n){throw await cs("cancel_file_import",{id:t}).catch(()=>{}),n}}var dw=(e,t)=>e.length>t?`${lw(e,0,t-1)}\u2026`:e;function sD(){return Ho().readWindow().recent??[]}function LH(e){Ho().saveWindow({recent:e})}function ab(e,t,n){let i=t instanceof ob?t.code:t?.name==="PasswordException"?"password":void 0,[r,o]=i&&e.errors[i]||e.errors.generic,a=t instanceof Error?t.message:String(t);return{path:n,title:r,detail:o||a}}function EH(){let[,e]=(0,uw.useState)(0);return(0,uw.useEffect)(()=>{let t=()=>e(n=>n+1);return window.addEventListener("office:hostchange",t),()=>window.removeEventListener("office:hostchange",t)},[]),Ho().context}var jfe={docx:"Word",xlsx:"Excel",pptx:"PowerPoint",pdf:"PDF"},OH=ka.map(e=>jfe[e]),Kp=e=>ka.includes(e),DH=Kp("docx")||Kp("pdf"),NH={en:`any ${Vo([...DH?["passage"]:[],...Kp("xlsx")?["cell"]:[],...Kp("pptx")?["slide"]:[]],"en","or")}`,zh:Vo([...DH?["\u6BB5\u843D"]:[],...Kp("xlsx")?["\u5355\u5143\u683C"]:[],...Kp("pptx")?["\u5E7B\u706F\u7247"]:[]],"zh-CN","or")},lD=Fn.title["zh-CN"].replace(/[\x20-\x7e]$/,"$& "),Ufe={title:Fn.title.en,openTitle:"Open a document",openFile:"Open file",emptyTitle:`Open your ${Vo(OH)} file`,emptyDescription:`Read alongside your conversation and discuss ${NH.en}.`,emptyCaption:`Choose a local file \xB7 ${Nd("en","or")}`,importing:"Importing\u2026",importTooLarge:`Choose a file no larger than ${tb/1024/1024} MiB.`,recent:"Recent",switchDocument:"Switch document",pagesAndOutline:"Pages and outline",outlineOnly:"Outline",pages:"Pages",slides:"Slides",outline:"Outline",find:"Find",findPlaceholder:"Find in document",findCount:(e,t)=>`${e} of ${t}`,noResults:"No results",previousMatch:"Previous match (\u21E7Enter)",nextMatch:"Next match (Enter)",closeFind:"Close (Esc)",more:"More",fitWidth:"Fit width",fitPage:"Fit page",actualSize:"Actual size",reload:"Reload from disk",previousPage:"Previous page",nextPage:"Next page",pageNumber:"Page number",ofPages:e=>`of ${e}`,zoomIn:"Zoom in (\u2318+)",zoomOut:"Zoom out (\u2318\u2212)",fit:"Fit",addToChat:"Add to chat",addShort:"Add",addToChatHint:"Attach this to your next message (\u2318/Ctrl+Enter)",added:"Added to chat",ask:"Ask",askPlaceholder:"Ask about this\u2026",send:"Send",cancel:"Cancel",sendKey:"send",cancelKey:"cancel",copy:"Copy",copied:"Copied",agent:"Agent",agentOf:(e,t)=>`Agent \xB7 ${e} of ${t}`,nextTarget:"Next",moreOn:(e,t)=>e===1?`1 more on ${t}`:`${e} more`,close:"Close",changed:"This file changed on disk.",reloadShort:"Reload",dismiss:"Dismiss",openAnother:"Open another file",sidePanel:"Open in side panel",meta:{pdf:e=>e===1?"1 page":`${e} pages`,pptx:e=>e===1?"1 slide":`${e} slides`,xlsx:e=>e===1?"1 sheet":`${e} sheets`,docx:e=>""},errors:{generic:["Couldn\u2019t open this document",""],password:["This PDF is password protected",`${Fn.title.en} can\u2019t open encrypted files yet.`],not_found:["This file no longer exists","It may have been moved or deleted."],file_too_large:["This file is too large to open",""],corrupt_file:["This file appears to be damaged",`${Fn.title.en} couldn\u2019t read its contents.`],unsupported_type:["This kind of file isn\u2019t supported",`${Fn.title.en} opens ${Nd()} files.`],path_outside_workspace:["This file is outside the workspace",""]},sendFailed:"The message was not sent.",contextFailed:"ZCode did not accept the reference.",where:{page:e=>`Page ${e}`,pages:(e,t)=>`Pages ${e}\u2013${t}`,pageLower:e=>`page ${e}`,slide:e=>`Slide ${e}`,slides:(e,t)=>`Slides ${e}\u2013${t}`,slideLower:e=>`slide ${e}`,shape:e=>`Slide ${e} \xB7 Shape`,paragraph:e=>`Paragraph ${e}`,paragraphs:(e,t)=>`Paragraphs ${e}\u2013${t}`,paragraphLower:e=>`paragraph ${e}`,table:e=>`Table ${e}`,cell:(e,t,n)=>`Table ${e} \xB7 R${t}C${n}`}},Bfe={title:Fn.title["zh-CN"],openTitle:"\u6253\u5F00\u6587\u6863",openFile:"\u6253\u5F00\u6587\u4EF6",emptyTitle:`\u6253\u5F00\u4F60\u7684 ${Vo(OH,"zh-CN")} \u6587\u4EF6`,emptyDescription:`\u8FB9\u770B\u8FB9\u804A\uFF0C\u9009\u4E2D${NH.zh}\u5373\u53EF\u5E26\u5165\u5BF9\u8BDD\u3002`,emptyCaption:`\u9009\u62E9\u672C\u5730\u6587\u4EF6 \xB7 ${Nd("zh-CN","or")}`,importing:"\u6B63\u5728\u5BFC\u5165\u2026",importTooLarge:`\u8BF7\u9009\u62E9\u4E0D\u8D85\u8FC7 ${tb/1024/1024} MiB \u7684\u6587\u4EF6\u3002`,recent:"\u6700\u8FD1",switchDocument:"\u5207\u6362\u6587\u6863",pagesAndOutline:"\u9875\u9762\u4E0E\u76EE\u5F55",outlineOnly:"\u76EE\u5F55",pages:"\u9875\u9762",slides:"\u5E7B\u706F\u7247",outline:"\u76EE\u5F55",find:"\u67E5\u627E",findPlaceholder:"\u5728\u6587\u6863\u4E2D\u67E5\u627E",findCount:(e,t)=>`${e} / ${t}`,noResults:"\u65E0\u7ED3\u679C",previousMatch:"\u4E0A\u4E00\u4E2A\uFF08\u21E7Enter\uFF09",nextMatch:"\u4E0B\u4E00\u4E2A\uFF08Enter\uFF09",closeFind:"\u5173\u95ED\uFF08Esc\uFF09",more:"\u66F4\u591A",fitWidth:"\u9002\u5E94\u5BBD\u5EA6",fitPage:"\u9002\u5E94\u9875\u9762",actualSize:"\u5B9E\u9645\u5927\u5C0F",reload:"\u4ECE\u78C1\u76D8\u91CD\u65B0\u52A0\u8F7D",previousPage:"\u4E0A\u4E00\u9875",nextPage:"\u4E0B\u4E00\u9875",pageNumber:"\u9875\u7801",ofPages:e=>`/ ${e}`,zoomIn:"\u653E\u5927\uFF08\u2318+\uFF09",zoomOut:"\u7F29\u5C0F\uFF08\u2318\u2212\uFF09",fit:"\u9002\u5E94",addToChat:"\u6DFB\u52A0\u5230\u5BF9\u8BDD",addShort:"\u6DFB\u52A0",addToChatHint:"\u9644\u52A0\u5230\u4E0B\u4E00\u6761\u6D88\u606F\uFF08\u2318/Ctrl+Enter\uFF09",added:"\u5DF2\u6DFB\u52A0\u5230\u5BF9\u8BDD",ask:"\u63D0\u95EE",askPlaceholder:"\u5C31\u8FD9\u91CC\u63D0\u95EE\u2026",send:"\u53D1\u9001",cancel:"\u53D6\u6D88",sendKey:"\u53D1\u9001",cancelKey:"\u53D6\u6D88",copy:"\u590D\u5236",copied:"\u5DF2\u590D\u5236",agent:"Agent",agentOf:(e,t)=>`Agent \xB7 \u7B2C ${e} \u5904\uFF0C\u5171 ${t} \u5904`,nextTarget:"\u4E0B\u4E00\u5904",moreOn:(e,t)=>e===1?`${t}\u8FD8\u6709 1 \u5904`:`\u8FD8\u6709 ${e} \u5904`,close:"\u5173\u95ED",changed:"\u6587\u4EF6\u5DF2\u5728\u78C1\u76D8\u4E0A\u66F4\u6539\u3002",reloadShort:"\u91CD\u65B0\u52A0\u8F7D",dismiss:"\u5FFD\u7565",openAnother:"\u6253\u5F00\u5176\u4ED6\u6587\u4EF6",sidePanel:"\u5728\u4FA7\u680F\u6253\u5F00",meta:{pdf:e=>`${e} \u9875`,pptx:e=>`${e} \u5F20\u5E7B\u706F\u7247`,xlsx:e=>`${e} \u4E2A\u5DE5\u4F5C\u8868`,docx:()=>""},errors:{generic:["\u65E0\u6CD5\u6253\u5F00\u8BE5\u6587\u6863",""],password:["\u8BE5 PDF \u53D7\u5BC6\u7801\u4FDD\u62A4",`${lD}\u6682\u4E0D\u652F\u6301\u6253\u5F00\u52A0\u5BC6\u6587\u4EF6\u3002`],not_found:["\u8BE5\u6587\u4EF6\u5DF2\u4E0D\u5B58\u5728","\u5B83\u53EF\u80FD\u5DF2\u88AB\u79FB\u52A8\u6216\u5220\u9664\u3002"],file_too_large:["\u6587\u4EF6\u592A\u5927\uFF0C\u65E0\u6CD5\u6253\u5F00",""],corrupt_file:["\u8BE5\u6587\u4EF6\u4F3C\u4E4E\u5DF2\u635F\u574F",`${lD}\u65E0\u6CD5\u8BFB\u53D6\u5176\u5185\u5BB9\u3002`],unsupported_type:["\u4E0D\u652F\u6301\u8FD9\u79CD\u6587\u4EF6",`${lD}\u53EF\u4EE5\u6253\u5F00 ${Nd("zh-CN")} \u6587\u4EF6\u3002`],path_outside_workspace:["\u8BE5\u6587\u4EF6\u4E0D\u5728\u5DE5\u4F5C\u533A\u5185",""]},sendFailed:"\u6D88\u606F\u672A\u53D1\u9001\u3002",contextFailed:"ZCode \u672A\u63A5\u53D7\u8BE5\u5F15\u7528\u3002",where:{page:e=>`\u7B2C ${e} \u9875`,pages:(e,t)=>`\u7B2C ${e}\u2013${t} \u9875`,pageLower:e=>`\u7B2C ${e} \u9875`,slide:e=>`\u7B2C ${e} \u5F20\u5E7B\u706F\u7247`,slides:(e,t)=>`\u7B2C ${e}\u2013${t} \u5F20\u5E7B\u706F\u7247`,slideLower:e=>`\u7B2C ${e} \u5F20\u5E7B\u706F\u7247`,shape:e=>`\u7B2C ${e} \u5F20\u5E7B\u706F\u7247 \xB7 \u5F62\u72B6`,paragraph:e=>`\u7B2C ${e} \u6BB5`,paragraphs:(e,t)=>`\u7B2C ${e}\u2013${t} \u6BB5`,paragraphLower:e=>`\u7B2C ${e} \u6BB5`,table:e=>`\u8868\u683C ${e}`,cell:(e,t,n)=>`\u8868\u683C ${e} \xB7 R${t}C${n}`}},PH=e=>e?.toLowerCase().startsWith("zh")?Bfe:Ufe;function hw(e,t,n=!1){let i=t.where,r;if(r=/^page:(\d+)(?:-(\d+))?$/.exec(e))return r[2]?i.pages(r[1],r[2]):n?i.pageLower(r[1]):i.page(r[1]);if(r=/^slide:(\d+)\/shape:/.exec(e))return i.shape(r[1]);if(r=/^slide:(\d+)(?:-(\d+))?$/.exec(e))return r[2]?i.slides(r[1],r[2]):n?i.slideLower(r[1]):i.slide(r[1]);if(r=/^p:(\d+)(?:-(\d+))?$/.exec(e))return r[2]?i.paragraphs(r[1],r[2]):n?i.paragraphLower(r[1]):i.paragraph(r[1]);if(r=/^t:(\d+)\/r(\d+)c(\d+)$/.exec(e))return i.cell(r[1],r[2],r[3]);if(r=/^t:(\d+)$/.exec(e))return i.table(r[1]);let o=e.lastIndexOf("!");return o>0?`${e.slice(0,o).replace(/^'(.*)'$/,"$1").replace(/''/g,"'")} \xB7 ${e.slice(o+1)}`:e.replace(/^'(.*)'$/,"$1")}var cD=Ln(zr(),1),Vfe={search:'<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>',x:'<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',"chevron-up":'<path d="m18 15-6-6-6 6"/>',"chevron-down":'<path d="m6 9 6 6 6-6"/>',minus:'<path d="M5 12h14"/>',plus:'<path d="M5 12h14"/><path d="M12 5v14"/>',ellipsis:'<circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/>',"panel-left":'<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/>',"file-text":'<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/>',copy:'<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>',"message-square-plus":'<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/><path d="M12 7v6"/><path d="M9 10h6"/>',"message-circle-question":'<path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><path d="M12 17h.01"/>',check:'<path d="M20 6 9 17l-5-5"/>',"rotate-cw":'<path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/>',"arrow-down":'<path d="M12 5v14"/><path d="m19 12-7 7-7-7"/>',"arrow-up":'<path d="m5 12 7-7 7 7"/><path d="M12 19V5"/>',"folder-open":'<path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"/>',"maximize-2":'<polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" x2="14" y1="3" y2="10"/><line x1="3" x2="10" y1="21" y2="14"/>'};function rn({name:e,size:t=14,className:n}){return(0,cD.jsx)("svg",{className:`icon${n?` ${n}`:""}`,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",dangerouslySetInnerHTML:{__html:Vfe[e]}})}var Hfe={pdf:"PDF",docx:"W",xlsx:"X",pptx:"P"};function FH({kind:e}){return(0,cD.jsx)("span",{className:`filetype ${e}`,"aria-hidden":"true",children:Hfe[e]})}var _l=Ln(oo(),1);var Tt=Ln(zr(),1);function Zfe({handle:e,page:t,width:n,ratio:i,current:r,onPick:o,root:a}){let s=(0,_l.useRef)(null);return(0,_l.useEffect)(()=>{let l=s.current;if(!l||!e.thumbnail)return;let c=!1,u=new IntersectionObserver(d=>{c||!d.some(f=>f.isIntersecting)||(c=!0,u.disconnect(),e.thumbnail(t,n).then(f=>{l.replaceChildren(f),l.style.height=""},()=>{}))},{root:a.current,rootMargin:"300px 0px"});return u.observe(l),()=>u.disconnect()},[e,t,n,a]),(0,Tt.jsxs)("button",{type:"button",className:`thumb${r?" on":""}`,"aria-current":r?"page":void 0,onClick:()=>o(t),"data-page":t,children:[(0,Tt.jsx)("div",{ref:s,className:"mini",style:{width:n,height:Math.round(n*i)}}),(0,Tt.jsx)("span",{children:t})]})}var qH=e=>/^(?:page|slide):(\d+)/.exec(e)?.[1]??"";function VH({t:e,info:t,handle:n,page:i,tab:r,docked:o,onTab:a,onPage:s,onOutline:l}){let c=(0,_l.useRef)(null),u=!!(n?.thumbnail&&i),d=t.outline.length>0,f=u&&(r==="pages"||!d)?"pages":"outline",h=t.kind==="pptx"?9/16:1.294;(0,_l.useEffect)(()=>{let g=c.current?.querySelector("[aria-current=page]");g&&c.current&&(c.current.scrollTop=g.offsetTop-c.current.clientHeight/3)},[f]);let p=(()=>{if(!i)return-1;let g=-1;return t.outline.forEach((v,m)=>{let y=Number(qH(v.at));y&&y<=i.current&&(g=m)}),g})();return(0,Tt.jsxs)("nav",{className:`drawer${o?" docked":""}`,"aria-label":e.pagesAndOutline,children:[u&&d?(0,Tt.jsxs)("div",{className:"seg",role:"tablist",children:[(0,Tt.jsx)("button",{type:"button",role:"tab","aria-selected":f==="pages",className:f==="pages"?"on":"",onClick:()=>a("pages"),children:t.kind==="pptx"?e.slides:e.pages}),(0,Tt.jsx)("button",{type:"button",role:"tab","aria-selected":f==="outline",className:f==="outline"?"on":"",onClick:()=>a("outline"),children:e.outline})]}):null,(0,Tt.jsx)("div",{ref:c,className:f==="pages"?"thumbs":"outline",children:f==="pages"&&n&&i?Array.from({length:i.count},(g,v)=>(0,Tt.jsx)(Zfe,{handle:n,page:v+1,width:136,ratio:h,current:i.current===v+1,onPick:s,root:c},v)):t.outline.map((g,v)=>(0,Tt.jsxs)("button",{type:"button",className:`oi level-${Math.min(3,Math.max(1,g.level))}${v===p?" on":""}`,"aria-current":v===p?"page":void 0,title:g.label,onClick:()=>l(g.at),children:[(0,Tt.jsx)("span",{className:"label",children:g.label}),(0,Tt.jsx)("span",{className:"n",children:qH(g.at)})]},`${g.at}-${v}`))})]})}function HH({t:e,onBrowse:t,importing:n}){return(0,Tt.jsx)("div",{className:"empty",children:(0,Tt.jsxs)("div",{className:"empty-content",children:[(0,Tt.jsx)("h3",{children:e.emptyTitle}),(0,Tt.jsx)("p",{className:"empty-description",children:e.emptyDescription}),(0,Tt.jsxs)("button",{type:"button",className:"btn empty-open",onClick:t,disabled:n,children:[(0,Tt.jsx)(rn,{name:"folder-open",size:16}),n?e.importing:e.openFile]}),(0,Tt.jsx)("p",{className:"empty-caption",children:e.emptyCaption})]})})}var Gfe=["title","subtitle","line","line","short","heading","line","line","line","mid","figure"];function pw({kind:e}){if(e==="xlsx")return(0,Tt.jsx)("div",{className:"skeleton sheet","aria-busy":"true",children:Array.from({length:18},(n,i)=>(0,Tt.jsx)("div",{className:"skel-row"},i))});let t=e==="pptx";return(0,Tt.jsx)("div",{className:"skeleton","aria-busy":"true",children:[0,1].map(n=>(0,Tt.jsxs)("div",{className:`skelpage${t?" slide":""}`,children:[n===0&&!t?Gfe.map((i,r)=>(0,Tt.jsx)("div",{className:`skel ${i}`},r)):null,n===0&&t?(0,Tt.jsxs)(Tt.Fragment,{children:[(0,Tt.jsx)("div",{className:"skel title left"}),(0,Tt.jsx)("div",{className:"skel line"}),(0,Tt.jsx)("div",{className:"skel mid"})]}):null]},n))})}function mw({t:e,title:t,detail:n,onOpenAnother:i}){return(0,Tt.jsxs)("div",{className:"failed",role:"alert",children:[(0,Tt.jsx)(rn,{name:"file-text",size:28,className:"subtlest"}),(0,Tt.jsxs)("div",{children:[(0,Tt.jsx)("h3",{children:t}),n?(0,Tt.jsx)("p",{children:n}):null]}),(0,Tt.jsx)("button",{type:"button",className:"btn secondary",onClick:i,children:e.openAnother})]})}function ZH({t:e,onReload:t,onDismiss:n}){return(0,Tt.jsxs)("div",{className:"banner",role:"status",children:[(0,Tt.jsx)("span",{children:e.changed}),(0,Tt.jsx)("button",{type:"button",className:"btn sm primary",onClick:t,children:e.reloadShort}),(0,Tt.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.dismiss,"aria-label":e.dismiss,onClick:n,children:(0,Tt.jsx)(rn,{name:"x"})})]})}function Wfe({inputRef:e,t,importing:n,onImporting:i,onOpen:r,onError:o}){return(0,Tt.jsx)("input",{ref:e,type:"file",hidden:!0,accept:ka.map(a=>`.${a}`).join(","),disabled:n,onChange:async a=>{let s=a.currentTarget.files?.[0];if(a.currentTarget.value="",!!s){i(!0);try{if(s.size>tb)throw new Error(t.importTooLarge);r(await RH(s))}catch(l){o(l,s.name)}finally{i(!1)}}}})}function GH(e,t,n){let i=(0,_l.useRef)(null),[r,o]=(0,_l.useState)(!1);return{importing:r,browse:()=>i.current?.click(),input:(0,Tt.jsx)(Wfe,{inputRef:i,t:e,importing:r,onImporting:o,onOpen:t,onError:n})}}var dr=Ln(zr(),1);function WH({appRef:e,canvasRef:t,t:n,path:i,info:r,kind:o,showSkeleton:a,failure:s,nothing:l,onExpand:c,children:u}){return(0,dr.jsxs)("div",{ref:e,className:"app inline",children:[(0,dr.jsxs)("header",{className:"docbar",children:[(0,dr.jsxs)("div",{className:"doctitle static",title:i??void 0,children:[(0,dr.jsx)("span",{className:"name",children:i?Pd(i):n.title}),r&&n.meta[r.kind](r.units)?(0,dr.jsx)("span",{className:"meta",children:n.meta[r.kind](r.units)}):null]}),(0,dr.jsx)("span",{className:"spacer"}),(0,dr.jsxs)("button",{type:"button",className:"btn sm",title:n.sidePanel,onClick:c,children:[(0,dr.jsx)(rn,{name:"maximize-2",size:12}),n.sidePanel]})]}),(0,dr.jsx)("div",{className:"stage",children:(0,dr.jsxs)("div",{ref:t,className:"canvas",children:[u,a?(0,dr.jsx)(pw,{kind:o}):null,s?(0,dr.jsx)(mw,{t:n,title:s.title,detail:s.detail,onOpenAnother:c}):null,l?(0,dr.jsx)("div",{className:"failed muted",children:n.openTitle}):null,(0,dr.jsx)("button",{type:"button",className:"glance-cover","aria-label":n.sidePanel,onClick:c})]})})]})}var Yr=Ln(oo(),1);var gw=Ln(oo(),1),jd=8;function uD(e,t,n){let i=(0,gw.useRef)(null),{side:r,offset:o=8,dock:a=!1}=n;return(0,gw.useLayoutEffect)(()=>{let s=i.current,l=e.current;if(!s||!l)return;let c=0,u=()=>{c=0;let p=l.getBoundingClientRect(),g=s.offsetWidth,v=s.offsetHeight,m=t?.()??null,y=(w,z,A,M)=>{s.style.visibility="",s.style.left=`${Math.round(w)}px`,s.style.top=`${Math.round(z)}px`,s.dataset.side=A,s.style.setProperty("--tip",`${Math.round(Math.max(14,Math.min(g-14,M-w)))}px`)};if(!m){a?y((p.width-g)/2,jd,"none",p.width/2):s.style.visibility="hidden";return}if(m.bottom<p.top+4||m.top>p.bottom-4){s.style.visibility="hidden";return}let b=(m.left+m.right)/2-p.left,x=Math.max(jd,Math.min(p.width-g-jd,b-g/2)),_=m.top-p.top-v-o,S=m.bottom-p.top+o,$=_>=jd,C=S+v<=p.height-jd;(r==="top"||!C)&&$?y(x,_,"top",b):C?y(x,S,"bottom",b):y(x,r==="top"?jd:p.height-v-jd,"none",b)},d=()=>{c||(c=requestAnimationFrame(u))};u(),l.addEventListener("scroll",d,{capture:!0,passive:!0});let f=new ResizeObserver(d);f.observe(l),f.observe(s);let h=setInterval(d,250);return()=>{l.removeEventListener("scroll",d,{capture:!0}),f.disconnect(),clearInterval(h),c&&cancelAnimationFrame(c)}},[e,t,r,o,a]),i}var Pe=Ln(zr(),1);function dD({className:e,onClose:t,children:n,label:i}){let r=(0,Yr.useRef)(null);(0,Yr.useEffect)(()=>{let a=l=>{let c=l.target;!r.current?.contains(c)&&!c.closest?.("[data-menu-trigger]")&&t()},s=l=>{l.key==="Escape"&&(l.stopPropagation(),t())};return document.addEventListener("pointerdown",a,!0),document.addEventListener("keydown",s,!0),r.current?.querySelector("[role^=menuitem]")?.focus(),()=>{document.removeEventListener("pointerdown",a,!0),document.removeEventListener("keydown",s,!0)}},[t]);let o=a=>{if(a.key!=="ArrowDown"&&a.key!=="ArrowUp")return;a.preventDefault();let s=[...r.current?.querySelectorAll("[role^=menuitem]")??[]],l=s.indexOf(document.activeElement);s[(l+(a.key==="ArrowDown"?1:-1)+s.length)%s.length]?.focus()};return(0,Pe.jsx)("div",{ref:r,className:`menu ${e}`,role:"menu","aria-label":i,onKeyDown:o,children:n})}function Kc({icon:e,checked:t,children:n,hint:i,onSelect:r}){return(0,Pe.jsxs)("button",{type:"button",role:t===void 0?"menuitem":"menuitemradio","aria-checked":t,className:"mi",onClick:r,children:[(0,Pe.jsx)("span",{className:"mi-icon",children:t?(0,Pe.jsx)(rn,{name:"check",size:16}):e}),(0,Pe.jsx)("span",{className:"mi-label",children:n}),i?(0,Pe.jsx)("span",{className:"mi-hint",children:i}):null]})}function XH({t:e,query:t,total:n,index:i,onQuery:r,onStep:o,onClose:a}){let s=(0,Yr.useRef)(null);(0,Yr.useEffect)(()=>{s.current?.focus(),s.current?.select()},[]);let l=!t.trim()||n===null?"":n?e.findCount(i+1,n):e.noResults;return(0,Pe.jsxs)("div",{className:"docbar findbar",role:"search",children:[(0,Pe.jsxs)("label",{className:"findfield",children:[(0,Pe.jsx)(rn,{name:"search",className:"muted"}),(0,Pe.jsx)("input",{ref:s,className:"find-input",type:"text","aria-label":e.find,placeholder:e.findPlaceholder,value:t,onChange:c=>r(c.target.value),onKeyDown:c=>{c.key==="Enter"?(c.preventDefault(),o(c.shiftKey?-1:1)):c.key==="Escape"&&(c.preventDefault(),c.stopPropagation(),a())}}),(0,Pe.jsx)("span",{className:"count","aria-live":"polite",children:l})]}),(0,Pe.jsx)("button",{type:"button",className:"btn icon dim",title:e.previousMatch,"aria-label":e.previousMatch,disabled:!n,onClick:()=>o(-1),children:(0,Pe.jsx)(rn,{name:"chevron-up"})}),(0,Pe.jsx)("button",{type:"button",className:"btn icon dim",title:e.nextMatch,"aria-label":e.nextMatch,disabled:!n,onClick:()=>o(1),children:(0,Pe.jsx)(rn,{name:"chevron-down"})}),(0,Pe.jsx)("button",{type:"button",className:"btn icon dim",title:e.closeFind,"aria-label":e.closeFind,onClick:a,children:(0,Pe.jsx)(rn,{name:"x"})})]})}var Yfe=1500;function KH({t:e,frame:t,page:n,zoom:i,onPage:r,onZoom:o,onFit:a}){let s=(0,Yr.useRef)(null),[l,c]=(0,Yr.useState)(!0),[u,d]=(0,Yr.useState)(null),f=(0,Yr.useRef)(!1);(0,Yr.useEffect)(()=>{let p=t.current;if(!p)return;let g=0,v=()=>{clearTimeout(g),g=window.setTimeout(()=>{!f.current&&!s.current?.contains(document.activeElement)&&c(!1)},Yfe)},m=()=>{c(!0),v()},y=b=>{let x=p.getBoundingClientRect();b.clientY>x.bottom-80&&m()};return p.addEventListener("scroll",m,{capture:!0,passive:!0}),p.addEventListener("pointermove",y,{passive:!0}),v(),()=>{clearTimeout(g),p.removeEventListener("scroll",m,{capture:!0}),p.removeEventListener("pointermove",y)}},[t]);let h=()=>{let p=Number(u);d(null),Number.isInteger(p)&&p>=1&&r(Math.min(p,n.count))};return(0,Pe.jsxs)("div",{ref:s,className:`pill${l?"":" faded"}`,onPointerEnter:()=>{f.current=!0,c(!0)},onPointerLeave:()=>{f.current=!1},onFocus:()=>c(!0),children:[(0,Pe.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.previousPage,"aria-label":e.previousPage,disabled:n.current<=1,onClick:()=>r(n.current-1),children:(0,Pe.jsx)(rn,{name:"chevron-up"})}),(0,Pe.jsxs)("span",{className:"pg",children:[(0,Pe.jsx)("input",{className:"pgin","aria-label":e.pageNumber,inputMode:"numeric",style:{width:`${Math.max(2,String(n.count).length)+1.6}ch`},value:u??String(n.current),onFocus:p=>{d(String(n.current)),p.target.select()},onChange:p=>d(p.target.value.replace(/\D/g,"")),onBlur:()=>d(null),onKeyDown:p=>{p.key==="Enter"?(h(),p.currentTarget.blur()):p.key==="Escape"&&(p.stopPropagation(),d(null),p.currentTarget.blur())}}),(0,Pe.jsx)("span",{children:e.ofPages(n.count)})]}),(0,Pe.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.nextPage,"aria-label":e.nextPage,disabled:n.current>=n.count,onClick:()=>r(n.current+1),children:(0,Pe.jsx)(rn,{name:"chevron-down"})}),i?(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)("span",{className:"vsep"}),(0,Pe.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.zoomOut,"aria-label":e.zoomOut,disabled:i.mode!=="width"&&i.percent<=25,onClick:()=>o(-1),children:(0,Pe.jsx)(rn,{name:"minus"})}),(0,Pe.jsx)("button",{type:"button",className:"zoom",title:e.fitWidth,onClick:a,children:i.mode==="width"?e.fit:`${i.percent}%`}),(0,Pe.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.zoomIn,"aria-label":e.zoomIn,disabled:i.mode!=="width"&&i.percent>=400,onClick:()=>o(1),children:(0,Pe.jsx)(rn,{name:"plus"})})]}):null]})}var YH=e=>{e.target.closest("textarea")||e.preventDefault()};function JH({t:e,frame:t,locate:n,text:i,label:r,quote:o,short:a,mode:s,canAsk:l,copied:c,onAdd:u,onAsk:d,onCopy:f,onCancelAsk:h,onSend:p}){let g=s==="ask",v=uD(t,n,{side:g?"bottom":"top",dock:!0}),[m,y]=(0,Yr.useState)(""),[b,x]=(0,Yr.useState)(!1),_=async()=>{if(!m.trim()||b)return;x(!0);let S=await p(m.trim());x(!1),S&&y("")};return g?(0,Pe.jsxs)("div",{ref:v,className:"pop ask",role:"dialog","aria-label":e.ask,onMouseDown:YH,children:[(0,Pe.jsxs)("div",{className:"ctx",children:[(0,Pe.jsx)("span",{className:"where",children:r}),o?(0,Pe.jsxs)("span",{className:"q",children:["\u201C",o,"\u201D"]}):null]}),(0,Pe.jsx)("textarea",{autoFocus:!0,className:"textarea",rows:2,"aria-label":e.askPlaceholder,placeholder:e.askPlaceholder,value:m,onChange:S=>y(S.target.value),onKeyDown:S=>{S.key==="Enter"&&!S.shiftKey&&!S.nativeEvent.isComposing?(S.preventDefault(),_()):S.key==="Escape"&&(S.preventDefault(),S.stopPropagation(),h())}}),(0,Pe.jsxs)("div",{className:"row",children:[(0,Pe.jsxs)("span",{className:"hint",children:[(0,Pe.jsx)("kbd",{children:"\u21B5"})," ",e.sendKey]}),(0,Pe.jsx)("button",{type:"button",className:"btn sm",onClick:h,children:e.cancel}),(0,Pe.jsx)("button",{type:"button",className:"btn sm primary",disabled:!m.trim()||b,onClick:()=>void _(),children:e.send})]})]}):(0,Pe.jsxs)("div",{ref:v,className:"pop bar",role:"toolbar","aria-label":r,onMouseDown:YH,children:[i?null:(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)("span",{className:"where",children:r}),(0,Pe.jsx)("span",{className:"vsep"})]}),(0,Pe.jsx)("button",{type:"button",className:"btn lg",title:e.addToChatHint,onClick:u,disabled:s==="added",children:s==="added"?(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(rn,{name:"check",size:16,className:"ok"}),e.added]}):(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(rn,{name:"message-square-plus",size:16}),a?e.addShort:e.addToChat]})}),l?(0,Pe.jsxs)("button",{type:"button",className:"btn lg",onClick:d,children:[(0,Pe.jsx)(rn,{name:"message-circle-question",size:16}),e.ask]}):null,i?(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)("span",{className:"vsep"}),(0,Pe.jsx)("button",{type:"button",className:"btn icon lg dim",title:c?e.copied:e.copy,"aria-label":c?e.copied:e.copy,onClick:f,children:(0,Pe.jsx)(rn,{name:c?"check":"copy"})})]}):null]})}function QH({t:e,frame:t,locate:n,note:i,index:r,total:o,onNext:a,onClose:s}){let l=uD(t,n,{side:"bottom",offset:6,dock:!0});return(0,Pe.jsxs)("div",{ref:l,className:"callout",role:"note",children:[(0,Pe.jsxs)("div",{className:"body",children:[(0,Pe.jsxs)("div",{className:"who",children:[(0,Pe.jsx)("span",{className:"dot"}),o>1?e.agentOf(r+1,o):e.agent]}),i?(0,Pe.jsx)("div",{className:"text",children:i}):null]}),o>1?(0,Pe.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.nextTarget,"aria-label":e.nextTarget,onClick:a,children:(0,Pe.jsx)(rn,{name:"chevron-down"})}):null,(0,Pe.jsx)("button",{type:"button",className:"btn icon sm dim",title:e.close,"aria-label":e.close,onClick:s,children:(0,Pe.jsx)(rn,{name:"x"})})]})}function eZ({text:e,down:t,raised:n,onClick:i}){return(0,Pe.jsxs)("button",{type:"button",className:`chip offscreen${n?" raised":""}`,onClick:i,children:[(0,Pe.jsx)("span",{className:"dot"}),e,(0,Pe.jsx)(rn,{name:t?"arrow-down":"arrow-up",size:12})]})}function tZ(e,t){return e.moreOn(t.length,hw(t[0],e,!0))}var ii=Ln(zr(),1);function nZ({t:e,recent:t,currentPath:n,onOpen:i,onBrowse:r,onClose:o}){return(0,ii.jsxs)(dD,{className:"switcher",label:e.switchDocument,onClose:o,children:[t.length?(0,ii.jsx)("div",{className:"mlabel",children:e.recent}):null,t.map(a=>(0,ii.jsx)(Kc,{icon:(0,ii.jsx)(FH,{kind:a.kind}),hint:a.path===n?(0,ii.jsx)(rn,{name:"check",size:16}):Pd(IH(a.path)),onSelect:()=>a.path===n?o():i(a.path),children:Pd(a.path)},a.path)),t.length?(0,ii.jsx)("div",{className:"msep"}):null,(0,ii.jsx)(Kc,{icon:(0,ii.jsx)(rn,{name:"folder-open",size:16}),onSelect:r,children:e.openFile})]})}function iZ({t:e,zoomable:t,zoomMode:n,onFit:i,onFind:r,onReload:o,onClose:a}){return(0,ii.jsxs)(dD,{className:"more",label:e.more,onClose:a,children:[t?(0,ii.jsxs)(ii.Fragment,{children:[(0,ii.jsx)(Kc,{checked:n==="width",onSelect:()=>i("width"),children:e.fitWidth}),(0,ii.jsx)(Kc,{checked:n==="page",onSelect:()=>i("page"),children:e.fitPage}),(0,ii.jsx)(Kc,{checked:n==="actual",hint:"100%",onSelect:()=>i("actual"),children:e.actualSize}),(0,ii.jsx)("div",{className:"msep"})]}):null,(0,ii.jsx)(Kc,{icon:(0,ii.jsx)(rn,{name:"search",size:16}),hint:"\u2318F",onSelect:r,children:e.find}),(0,ii.jsx)(Kc,{icon:(0,ii.jsx)(rn,{name:"rotate-cw",size:16}),onSelect:o,children:e.reload})]})}var Ma=Ln(oo(),1),sb={open:!1,query:"",total:null,index:-1};function rZ({viewer:e,docRef:t,ready:n,onOpen:i}){let[r,o]=(0,Ma.useState)(sb),a=(0,Ma.useRef)(0),s=(0,Ma.useCallback)(()=>{t.current&&(i(),o(d=>({...d,open:!0})),requestAnimationFrame(()=>{let d=document.querySelector(".findbar .find-input");d?.focus(),d?.select()}))},[t,i]),l=(0,Ma.useCallback)(()=>{a.current++,e.current?.clearFind(),o(sb)},[e]),c=(0,Ma.useCallback)(d=>{o(f=>({...f,query:d,total:d.trim()?f.total:null}))},[]);(0,Ma.useEffect)(()=>{if(!r.open||!n)return;let d=++a.current,f=setTimeout(async()=>{let h=e.current;if(!h)return;let p=await h.find(r.query).catch(()=>0);d===a.current&&(o(g=>({...g,total:p,index:p?0:-1})),p&&h.findGo(0))},200);return()=>clearTimeout(f)},[r.open,r.query,n,e]);let u=(0,Ma.useCallback)(d=>{if(!r.total)return;let f=(r.index+d+r.total)%r.total;o(h=>({...h,index:f})),e.current?.findGo(f)},[r.total,r.index,e]);return{find:r,setFind:o,openFind:s,closeFind:l,queryFind:c,stepFind:u}}var oZ=Ln(oo(),1);function aZ(e,t){(0,oZ.useEffect)(()=>{Ho().handleTool("capture_view",async i=>{let r=e.current;if(!r||!t.current)throw new Error(`No document is open in the ${Fn.title.en} panel. Call open_document first.`);let o=null;if(typeof i.anchor=="string"&&i.anchor.trim()){let l=xH(i.anchor);if(l.path.replace(/^\.\//,"")!==r.info.path)throw new Error(`The panel shows ${r.info.path}, not ${l.path}. Call open_document with that path first.`);o=l.at}let a=typeof i.maxWidth=="number"?Math.min(2e3,Math.max(320,i.maxWidth)):1600,s=await t.current.capture(o,a);return{content:[{type:"image",data:s.data,mimeType:"image/png"},{type:"text",text:`Captured ${ib(r.info.path,s.at)} (${s.width}\xD7${s.height} px).`}]}})},[e,t])}var vw=Ln(oo(),1);function sZ(e,t){let[n,i]=(0,vw.useState)(null);return(0,vw.useEffect)(()=>{let r=e.current;if(!r||!t||t.targets.length<2){i(null);return}let o=0,a=()=>{o=0;let c=r.getBoundingClientRect(),u=[],d=[];t.targets.forEach((h,p)=>{if(p===t.index)return;let g=h.locate();g&&(g.top>c.bottom-8?u.push(p):g.bottom<c.top+8&&d.push(p))});let f=u.length?{indexes:u,down:!0}:d.length?{indexes:d,down:!1}:null;i(h=>JSON.stringify(h)===JSON.stringify(f)?h:f)},s=()=>{o||(o=requestAnimationFrame(a))};a(),r.addEventListener("scroll",s,{capture:!0,passive:!0});let l=setInterval(s,500);return()=>{r.removeEventListener("scroll",s,{capture:!0}),clearInterval(l),o&&cancelAnimationFrame(o)}},[t,e]),[n,i]}var lZ=Ln(oo(),1);function cZ({docRef:e,viewer:t,picked:n,addReference:i,openFind:r,closeFind:o,clearSelection:a,paged:s,page:l,goToPage:c,drawer:u,setDrawer:d,docked:f,find:h,agent:p,setAgent:g}){(0,lZ.useEffect)(()=>{let v=m=>{if(m.defaultPrevented)return;let y=m.metaKey||m.ctrlKey,b=m.target?.closest?.("input, textarea, [contenteditable]"),x=m.key.toLowerCase();if(y&&x==="f"&&e.current)m.preventDefault(),r();else if(y&&m.key==="Enter"&&n)m.preventDefault(),i();else if(y&&(m.key==="="||m.key==="+"))m.preventDefault(),t.current?.zoom(1);else if(y&&m.key==="-")m.preventDefault(),t.current?.zoom(-1);else if(y&&m.key==="0")m.preventDefault(),t.current?.fit("width");else if(!y&&!b&&s&&l&&["ArrowLeft","ArrowRight","PageUp","PageDown"].includes(m.key)){m.preventDefault();let _=m.key==="ArrowLeft"||m.key==="PageUp";c(l.current+(_?-1:1))}else if(m.key==="Escape"&&!b){if(n)a();else if(u.open&&!f)d(_=>({..._,open:!1}));else if(h.open)o();else if(p?.visible)g({...p,visible:!1});else return;m.preventDefault()}};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[n,i,r,o,a,s,l,c,u.open,f,h.open,p,e,t,d,g])}var Hn=Ln(oo(),1);var kIe={},yw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xfe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function bw(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var uZ={exports:{}};var dZ;function Kfe(){return dZ||(dZ=1,(function(e,t){(function(n){e.exports=n()})(function(){return(function n(i,r,o){function a(c,u){if(!r[c]){if(!i[c]){var d=typeof bw=="function"&&bw;if(!u&&d)return d(c,!0);if(s)return s(c,!0);var f=new Error("Cannot find module '"+c+"'");throw f.code="MODULE_NOT_FOUND",f}var h=r[c]={exports:{}};i[c][0].call(h.exports,function(p){var g=i[c][1][p];return a(g||p)},h,h.exports,n,i,r,o)}return r[c].exports}for(var s=typeof bw=="function"&&bw,l=0;l<o.length;l++)a(o[l]);return a})({1:[function(n,i,r){var o=n("./utils"),a=n("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(l){for(var c,u,d,f,h,p,g,v=[],m=0,y=l.length,b=y,x=o.getTypeOf(l)!=="string";m<l.length;)b=y-m,d=x?(c=l[m++],u=m<y?l[m++]:0,m<y?l[m++]:0):(c=l.charCodeAt(m++),u=m<y?l.charCodeAt(m++):0,m<y?l.charCodeAt(m++):0),f=c>>2,h=(3&c)<<4|u>>4,p=1<b?(15&u)<<2|d>>6:64,g=2<b?63&d:64,v.push(s.charAt(f)+s.charAt(h)+s.charAt(p)+s.charAt(g));return v.join("")},r.decode=function(l){var c,u,d,f,h,p,g=0,v=0,m="data:";if(l.substr(0,m.length)===m)throw new Error("Invalid base64 input, it looks like a data url.");var y,b=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===s.charAt(64)&&b--,l.charAt(l.length-2)===s.charAt(64)&&b--,b%1!=0)throw new Error("Invalid base64 input, bad content length.");for(y=a.uint8array?new Uint8Array(0|b):new Array(0|b);g<l.length;)c=s.indexOf(l.charAt(g++))<<2|(f=s.indexOf(l.charAt(g++)))>>4,u=(15&f)<<4|(h=s.indexOf(l.charAt(g++)))>>2,d=(3&h)<<6|(p=s.indexOf(l.charAt(g++))),y[v++]=c,h!==64&&(y[v++]=u),p!==64&&(y[v++]=d);return y}},{"./support":30,"./utils":32}],2:[function(n,i,r){var o=n("./external"),a=n("./stream/DataWorker"),s=n("./stream/Crc32Probe"),l=n("./stream/DataLengthProbe");function c(u,d,f,h,p){this.compressedSize=u,this.uncompressedSize=d,this.crc32=f,this.compression=h,this.compressedContent=p}c.prototype={getContentWorker:function(){var u=new a(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),d=this;return u.on("end",function(){if(this.streamInfo.data_length!==d.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),u},getCompressedWorker:function(){return new a(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(u,d,f){return u.pipe(new s).pipe(new l("uncompressedSize")).pipe(d.compressWorker(f)).pipe(new l("compressedSize")).withStreamInfo("compression",d)},i.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,i,r){var o=n("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},r.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,i,r){var o=n("./utils"),a=(function(){for(var s,l=[],c=0;c<256;c++){s=c;for(var u=0;u<8;u++)s=1&s?3988292384^s>>>1:s>>>1;l[c]=s}return l})();i.exports=function(s,l){return s!==void 0&&s.length?o.getTypeOf(s)!=="string"?(function(c,u,d,f){var h=a,p=f+d;c^=-1;for(var g=f;g<p;g++)c=c>>>8^h[255&(c^u[g])];return-1^c})(0|l,s,s.length,0):(function(c,u,d,f){var h=a,p=f+d;c^=-1;for(var g=f;g<p;g++)c=c>>>8^h[255&(c^u.charCodeAt(g))];return-1^c})(0|l,s,s.length,0):0}},{"./utils":32}],5:[function(n,i,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(n,i,r){var o=null;o=typeof Promise<"u"?Promise:n("lie"),i.exports={Promise:o}},{lie:37}],7:[function(n,i,r){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",a=n("pako"),s=n("./utils"),l=n("./stream/GenericWorker"),c=o?"uint8array":"array";function u(d,f){l.call(this,"FlateWorker/"+d),this._pako=null,this._pakoAction=d,this._pakoOptions=f,this.meta={}}r.magic="\b\0",s.inherits(u,l),u.prototype.processChunk=function(d){this.meta=d.meta,this._pako===null&&this._createPako(),this._pako.push(s.transformTo(c,d.data),!1)},u.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new a[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var d=this;this._pako.onData=function(f){d.push({data:f,meta:d.meta})}},r.compressWorker=function(d){return new u("Deflate",d)},r.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,i,r){function o(h,p){var g,v="";for(g=0;g<p;g++)v+=String.fromCharCode(255&h),h>>>=8;return v}function a(h,p,g,v,m,y){var b,x,_=h.file,S=h.compression,$=y!==c.utf8encode,C=s.transformTo("string",y(_.name)),w=s.transformTo("string",c.utf8encode(_.name)),z=_.comment,A=s.transformTo("string",y(z)),M=s.transformTo("string",c.utf8encode(z)),T=w.length!==_.name.length,k=M.length!==z.length,I="",D="",E="",N=_.dir,F=_.date,G={crc32:0,compressedSize:0,uncompressedSize:0};p&&!g||(G.crc32=h.crc32,G.compressedSize=h.compressedSize,G.uncompressedSize=h.uncompressedSize);var P=0;p&&(P|=8),$||!T&&!k||(P|=2048);var O=0,V=0;N&&(O|=16),m==="UNIX"?(V=798,O|=(function(H,Q){var le=H;return H||(le=Q?16893:33204),(65535&le)<<16})(_.unixPermissions,N)):(V=20,O|=(function(H){return 63&(H||0)})(_.dosPermissions)),b=F.getUTCHours(),b<<=6,b|=F.getUTCMinutes(),b<<=5,b|=F.getUTCSeconds()/2,x=F.getUTCFullYear()-1980,x<<=4,x|=F.getUTCMonth()+1,x<<=5,x|=F.getUTCDate(),T&&(D=o(1,1)+o(u(C),4)+w,I+="up"+o(D.length,2)+D),k&&(E=o(1,1)+o(u(A),4)+M,I+="uc"+o(E.length,2)+E);var j="";return j+=`
109
109
  \0`,j+=o(P,2),j+=S.magic,j+=o(b,2),j+=o(x,2),j+=o(G.crc32,4),j+=o(G.compressedSize,4),j+=o(G.uncompressedSize,4),j+=o(C.length,2),j+=o(I.length,2),{fileRecord:d.LOCAL_FILE_HEADER+j+C+I,dirRecord:d.CENTRAL_FILE_HEADER+o(V,2)+j+o(A.length,2)+"\0\0\0\0"+o(O,4)+o(v,4)+C+I+A}}var s=n("../utils"),l=n("../stream/GenericWorker"),c=n("../utf8"),u=n("../crc32"),d=n("../signature");function f(h,p,g,v){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=g,this.encodeFileName=v,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(f,l),f.prototype.push=function(h){var p=h.meta.percent||0,g=this.entriesCount,v=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,l.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:g?(p+100*(g-v-1))/g:100}}))},f.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var p=this.streamFiles&&!h.file.dir;if(p){var g=a(h,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},f.prototype.closedSource=function(h){this.accumulate=!1;var p=this.streamFiles&&!h.file.dir,g=a(h,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),p)this.push({data:(function(v){return d.DATA_DESCRIPTOR+o(v.crc32,4)+o(v.compressedSize,4)+o(v.uncompressedSize,4)})(h),meta:{percent:100}});else for(this.push({data:g.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},f.prototype.flush=function(){for(var h=this.bytesWritten,p=0;p<this.dirRecords.length;p++)this.push({data:this.dirRecords[p],meta:{percent:100}});var g=this.bytesWritten-h,v=(function(m,y,b,x,_){var S=s.transformTo("string",_(x));return d.CENTRAL_DIRECTORY_END+"\0\0\0\0"+o(m,2)+o(m,2)+o(y,4)+o(b,4)+o(S.length,2)+S})(this.dirRecords.length,g,h,this.zipComment,this.encodeFileName);this.push({data:v,meta:{percent:100}})},f.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},f.prototype.registerPrevious=function(h){this._sources.push(h);var p=this;return h.on("data",function(g){p.processChunk(g)}),h.on("end",function(){p.closedSource(p.previous.streamInfo),p._sources.length?p.prepareNextSource():p.end()}),h.on("error",function(g){p.error(g)}),this},f.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},f.prototype.error=function(h){var p=this._sources;if(!l.prototype.error.call(this,h))return!1;for(var g=0;g<p.length;g++)try{p[g].error(h)}catch{}return!0},f.prototype.lock=function(){l.prototype.lock.call(this);for(var h=this._sources,p=0;p<h.length;p++)h[p].lock()},i.exports=f},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,i,r){var o=n("../compressions"),a=n("./ZipFileWorker");r.generateWorker=function(s,l,c){var u=new a(l.streamFiles,c,l.platform,l.encodeFileName),d=0;try{s.forEach(function(f,h){d++;var p=(function(y,b){var x=y||b,_=o[x];if(!_)throw new Error(x+" is not a valid compression method !");return _})(h.options.compression,l.compression),g=h.options.compressionOptions||l.compressionOptions||{},v=h.dir,m=h.date;h._compressWorker(p,g).withStreamInfo("file",{name:f,dir:v,date:m,comment:h.comment||"",unixPermissions:h.unixPermissions,dosPermissions:h.dosPermissions}).pipe(u)}),u.entriesCount=d}catch(f){u.error(f)}return u}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,i,r){function o(){if(!(this instanceof o))return new o;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var a=new o;for(var s in this)typeof this[s]!="function"&&(a[s]=this[s]);return a}}(o.prototype=n("./object")).loadAsync=n("./load"),o.support=n("./support"),o.defaults=n("./defaults"),o.version="3.10.1",o.loadAsync=function(a,s){return new o().loadAsync(a,s)},o.external=n("./external"),i.exports=o},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,i,r){var o=n("./utils"),a=n("./external"),s=n("./utf8"),l=n("./zipEntries"),c=n("./stream/Crc32Probe"),u=n("./nodejsUtils");function d(f){return new a.Promise(function(h,p){var g=f.decompressed.getContentWorker().pipe(new c);g.on("error",function(v){p(v)}).on("end",function(){g.streamInfo.crc32!==f.decompressed.crc32?p(new Error("Corrupted zip : CRC32 mismatch")):h()}).resume()})}i.exports=function(f,h){var p=this;return h=o.extend(h||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:s.utf8decode}),u.isNode&&u.isStream(f)?a.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):o.prepareContent("the loaded zip file",f,!0,h.optimizedBinaryString,h.base64).then(function(g){var v=new l(h);return v.load(g),v}).then(function(g){var v=[a.Promise.resolve(g)],m=g.files;if(h.checkCRC32)for(var y=0;y<m.length;y++)v.push(d(m[y]));return a.Promise.all(v)}).then(function(g){for(var v=g.shift(),m=v.files,y=0;y<m.length;y++){var b=m[y],x=b.fileNameStr,_=o.resolve(b.fileNameStr);p.file(_,b.decompressed,{binary:!0,optimizedBinaryString:!0,date:b.date,dir:b.dir,comment:b.fileCommentStr.length?b.fileCommentStr:null,unixPermissions:b.unixPermissions,dosPermissions:b.dosPermissions,createFolders:h.createFolders}),b.dir||(p.file(_).unsafeOriginalName=x)}return v.zipComment.length&&(p.comment=v.zipComment),p})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,i,r){var o=n("../utils"),a=n("../stream/GenericWorker");function s(l,c){a.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}o.inherits(s,a),s.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(u){c.push({data:u,meta:{percent:0}})}).on("error",function(u){c.isPaused?this.generatedError=u:c.error(u)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},s.prototype.pause=function(){return!!a.prototype.pause.call(this)&&(this._stream.pause(),!0)},s.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},i.exports=s},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,i,r){var o=n("readable-stream").Readable;function a(s,l,c){o.call(this,l),this._helper=s;var u=this;s.on("data",function(d,f){u.push(d)||u._helper.pause(),c&&c(f)}).on("error",function(d){u.emit("error",d)}).on("end",function(){u.push(null)})}n("../utils").inherits(a,o),a.prototype._read=function(){this._helper.resume()},i.exports=a},{"../utils":32,"readable-stream":16}],14:[function(n,i,r){i.exports={isNode:typeof Buffer<"u",newBufferFrom:function(o,a){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(o,a);if(typeof o=="number")throw new Error('The "data" argument must not be a number');return new Buffer(o,a)},allocBuffer:function(o){if(Buffer.alloc)return Buffer.alloc(o);var a=new Buffer(o);return a.fill(0),a},isBuffer:function(o){return Buffer.isBuffer(o)},isStream:function(o){return o&&typeof o.on=="function"&&typeof o.pause=="function"&&typeof o.resume=="function"}}},{}],15:[function(n,i,r){function o(_,S,$){var C,w=s.getTypeOf(S),z=s.extend($||{},u);z.date=z.date||new Date,z.compression!==null&&(z.compression=z.compression.toUpperCase()),typeof z.unixPermissions=="string"&&(z.unixPermissions=parseInt(z.unixPermissions,8)),z.unixPermissions&&16384&z.unixPermissions&&(z.dir=!0),z.dosPermissions&&16&z.dosPermissions&&(z.dir=!0),z.dir&&(_=m(_)),z.createFolders&&(C=v(_))&&y.call(this,C,!0);var A=w==="string"&&z.binary===!1&&z.base64===!1;$&&$.binary!==void 0||(z.binary=!A),(S instanceof d&&S.uncompressedSize===0||z.dir||!S||S.length===0)&&(z.base64=!1,z.binary=!0,S="",z.compression="STORE",w="string");var M=null;M=S instanceof d||S instanceof l?S:p.isNode&&p.isStream(S)?new g(_,S):s.prepareContent(_,S,z.binary,z.optimizedBinaryString,z.base64);var T=new f(_,M,z);this.files[_]=T}var a=n("./utf8"),s=n("./utils"),l=n("./stream/GenericWorker"),c=n("./stream/StreamHelper"),u=n("./defaults"),d=n("./compressedObject"),f=n("./zipObject"),h=n("./generate"),p=n("./nodejsUtils"),g=n("./nodejs/NodejsStreamInputAdapter"),v=function(_){_.slice(-1)==="/"&&(_=_.substring(0,_.length-1));var S=_.lastIndexOf("/");return 0<S?_.substring(0,S):""},m=function(_){return _.slice(-1)!=="/"&&(_+="/"),_},y=function(_,S){return S=S!==void 0?S:u.createFolders,_=m(_),this.files[_]||o.call(this,_,null,{dir:!0,createFolders:S}),this.files[_]};function b(_){return Object.prototype.toString.call(_)==="[object RegExp]"}var x={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(_){var S,$,C;for(S in this.files)C=this.files[S],($=S.slice(this.root.length,S.length))&&S.slice(0,this.root.length)===this.root&&_($,C)},filter:function(_){var S=[];return this.forEach(function($,C){_($,C)&&S.push(C)}),S},file:function(_,S,$){if(arguments.length!==1)return _=this.root+_,o.call(this,_,S,$),this;if(b(_)){var C=_;return this.filter(function(z,A){return!A.dir&&C.test(z)})}var w=this.files[this.root+_];return w&&!w.dir?w:null},folder:function(_){if(!_)return this;if(b(_))return this.filter(function(w,z){return z.dir&&_.test(w)});var S=this.root+_,$=y.call(this,S),C=this.clone();return C.root=$.name,C},remove:function(_){_=this.root+_;var S=this.files[_];if(S||(_.slice(-1)!=="/"&&(_+="/"),S=this.files[_]),S&&!S.dir)delete this.files[_];else for(var $=this.filter(function(w,z){return z.name.slice(0,_.length)===_}),C=0;C<$.length;C++)delete this.files[$[C].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(_){var S,$={};try{if(($=s.extend(_||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:a.utf8encode})).type=$.type.toLowerCase(),$.compression=$.compression.toUpperCase(),$.type==="binarystring"&&($.type="string"),!$.type)throw new Error("No output type specified.");s.checkSupport($.type),$.platform!=="darwin"&&$.platform!=="freebsd"&&$.platform!=="linux"&&$.platform!=="sunos"||($.platform="UNIX"),$.platform==="win32"&&($.platform="DOS");var C=$.comment||this.comment||"";S=h.generateWorker(this,$,C)}catch(w){(S=new l("error")).error(w)}return new c(S,$.type||"string",$.mimeType)},generateAsync:function(_,S){return this.generateInternalStream(_).accumulate(S)},generateNodeStream:function(_,S){return(_=_||{}).type||(_.type="nodebuffer"),this.generateInternalStream(_).toNodejsStream(S)}};i.exports=x},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(n,i,r){i.exports=n("stream")},{stream:void 0}],17:[function(n,i,r){var o=n("./DataReader");function a(s){o.call(this,s);for(var l=0;l<this.data.length;l++)s[l]=255&s[l]}n("../utils").inherits(a,o),a.prototype.byteAt=function(s){return this.data[this.zero+s]},a.prototype.lastIndexOfSignature=function(s){for(var l=s.charCodeAt(0),c=s.charCodeAt(1),u=s.charCodeAt(2),d=s.charCodeAt(3),f=this.length-4;0<=f;--f)if(this.data[f]===l&&this.data[f+1]===c&&this.data[f+2]===u&&this.data[f+3]===d)return f-this.zero;return-1},a.prototype.readAndCheckSignature=function(s){var l=s.charCodeAt(0),c=s.charCodeAt(1),u=s.charCodeAt(2),d=s.charCodeAt(3),f=this.readData(4);return l===f[0]&&c===f[1]&&u===f[2]&&d===f[3]},a.prototype.readData=function(s){if(this.checkOffset(s),s===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},i.exports=a},{"../utils":32,"./DataReader":18}],18:[function(n,i,r){var o=n("../utils");function a(s){this.data=s,this.length=s.length,this.index=0,this.zero=0}a.prototype={checkOffset:function(s){this.checkIndex(this.index+s)},checkIndex:function(s){if(this.length<this.zero+s||s<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+s+"). Corrupted zip ?")},setIndex:function(s){this.checkIndex(s),this.index=s},skip:function(s){this.setIndex(this.index+s)},byteAt:function(){},readInt:function(s){var l,c=0;for(this.checkOffset(s),l=this.index+s-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=s,c},readString:function(s){return o.transformTo("string",this.readData(s))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var s=this.readInt(4);return new Date(Date.UTC(1980+(s>>25&127),(s>>21&15)-1,s>>16&31,s>>11&31,s>>5&63,(31&s)<<1))}},i.exports=a},{"../utils":32}],19:[function(n,i,r){var o=n("./Uint8ArrayReader");function a(s){o.call(this,s)}n("../utils").inherits(a,o),a.prototype.readData=function(s){this.checkOffset(s);var l=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},i.exports=a},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,i,r){var o=n("./DataReader");function a(s){o.call(this,s)}n("../utils").inherits(a,o),a.prototype.byteAt=function(s){return this.data.charCodeAt(this.zero+s)},a.prototype.lastIndexOfSignature=function(s){return this.data.lastIndexOf(s)-this.zero},a.prototype.readAndCheckSignature=function(s){return s===this.readData(4)},a.prototype.readData=function(s){this.checkOffset(s);var l=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},i.exports=a},{"../utils":32,"./DataReader":18}],21:[function(n,i,r){var o=n("./ArrayReader");function a(s){o.call(this,s)}n("../utils").inherits(a,o),a.prototype.readData=function(s){if(this.checkOffset(s),s===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+s);return this.index+=s,l},i.exports=a},{"../utils":32,"./ArrayReader":17}],22:[function(n,i,r){var o=n("../utils"),a=n("../support"),s=n("./ArrayReader"),l=n("./StringReader"),c=n("./NodeBufferReader"),u=n("./Uint8ArrayReader");i.exports=function(d){var f=o.getTypeOf(d);return o.checkSupport(f),f!=="string"||a.uint8array?f==="nodebuffer"?new c(d):a.uint8array?new u(o.transformTo("uint8array",d)):new s(o.transformTo("array",d)):new l(d)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,i,r){r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,i,r){var o=n("./GenericWorker"),a=n("../utils");function s(l){o.call(this,"ConvertWorker to "+l),this.destType=l}a.inherits(s,o),s.prototype.processChunk=function(l){this.push({data:a.transformTo(this.destType,l.data),meta:l.meta})},i.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(n,i,r){var o=n("./GenericWorker"),a=n("../crc32");function s(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(s,o),s.prototype.processChunk=function(l){this.streamInfo.crc32=a(l.data,this.streamInfo.crc32||0),this.push(l)},i.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,i,r){var o=n("../utils"),a=n("./GenericWorker");function s(l){a.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}o.inherits(s,a),s.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}a.prototype.processChunk.call(this,l)},i.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(n,i,r){var o=n("../utils"),a=n("./GenericWorker");function s(l){a.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(u){c.dataIsReady=!0,c.data=u,c.max=u&&u.length||0,c.type=o.getTypeOf(u),c.isPaused||c._tickAndRepeat()},function(u){c.error(u)})}o.inherits(s,a),s.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},i.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(n,i,r){function o(a){this.name=a||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(a){this.emit("data",a)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(a){this.emit("error",a)}return!0},error:function(a){return!this.isFinished&&(this.isPaused?this.generatedError=a:(this.isFinished=!0,this.emit("error",a),this.previous&&this.previous.error(a),this.cleanUp()),!0)},on:function(a,s){return this._listeners[a].push(s),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(a,s){if(this._listeners[a])for(var l=0;l<this._listeners[a].length;l++)this._listeners[a][l].call(this,s)},pipe:function(a){return a.registerPrevious(this)},registerPrevious:function(a){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=a.streamInfo,this.mergeStreamInfo(),this.previous=a;var s=this;return a.on("data",function(l){s.processChunk(l)}),a.on("end",function(){s.end()}),a.on("error",function(l){s.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var a=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),a=!0),this.previous&&this.previous.resume(),!a},flush:function(){},processChunk:function(a){this.push(a)},withStreamInfo:function(a,s){return this.extraStreamInfo[a]=s,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var a in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,a)&&(this.streamInfo[a]=this.extraStreamInfo[a])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var a="Worker "+this.name;return this.previous?this.previous+" -> "+a:a}},i.exports=o},{}],29:[function(n,i,r){var o=n("../utils"),a=n("./ConvertWorker"),s=n("./GenericWorker"),l=n("../base64"),c=n("../support"),u=n("../external"),d=null;if(c.nodestream)try{d=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function f(p,g){return new u.Promise(function(v,m){var y=[],b=p._internalType,x=p._outputType,_=p._mimeType;p.on("data",function(S,$){y.push(S),g&&g($)}).on("error",function(S){y=[],m(S)}).on("end",function(){try{var S=(function($,C,w){switch($){case"blob":return o.newBlob(o.transformTo("arraybuffer",C),w);case"base64":return l.encode(C);default:return o.transformTo($,C)}})(x,(function($,C){var w,z=0,A=null,M=0;for(w=0;w<C.length;w++)M+=C[w].length;switch($){case"string":return C.join("");case"array":return Array.prototype.concat.apply([],C);case"uint8array":for(A=new Uint8Array(M),w=0;w<C.length;w++)A.set(C[w],z),z+=C[w].length;return A;case"nodebuffer":return Buffer.concat(C);default:throw new Error("concat : unsupported type '"+$+"'")}})(b,y),_);v(S)}catch($){m($)}y=[]}).resume()})}function h(p,g,v){var m=g;switch(g){case"blob":case"arraybuffer":m="uint8array";break;case"base64":m="string"}try{this._internalType=m,this._outputType=g,this._mimeType=v,o.checkSupport(m),this._worker=p.pipe(new a(m)),p.lock()}catch(y){this._worker=new s("error"),this._worker.error(y)}}h.prototype={accumulate:function(p){return f(this,p)},on:function(p,g){var v=this;return p==="data"?this._worker.on(p,function(m){g.call(v,m.data,m.meta)}):this._worker.on(p,function(){o.delay(g,arguments,v)}),this},resume:function(){return o.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(p){if(o.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new d(this,{objectMode:this._outputType!=="nodebuffer"},p)}},i.exports=h},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,i,r){if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",r.nodebuffer=typeof Buffer<"u",r.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")r.blob=!1;else{var o=new ArrayBuffer(0);try{r.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var a=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);a.append(o),r.blob=a.getBlob("application/zip").size===0}catch{r.blob=!1}}}try{r.nodestream=!!n("readable-stream").Readable}catch{r.nodestream=!1}},{"readable-stream":16}],31:[function(n,i,r){for(var o=n("./utils"),a=n("./support"),s=n("./nodejsUtils"),l=n("./stream/GenericWorker"),c=new Array(256),u=0;u<256;u++)c[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;c[254]=c[254]=1;function d(){l.call(this,"utf-8 decode"),this.leftOver=null}function f(){l.call(this,"utf-8 encode")}r.utf8encode=function(h){return a.nodebuffer?s.newBufferFrom(h,"utf-8"):(function(p){var g,v,m,y,b,x=p.length,_=0;for(y=0;y<x;y++)(64512&(v=p.charCodeAt(y)))==55296&&y+1<x&&(64512&(m=p.charCodeAt(y+1)))==56320&&(v=65536+(v-55296<<10)+(m-56320),y++),_+=v<128?1:v<2048?2:v<65536?3:4;for(g=a.uint8array?new Uint8Array(_):new Array(_),y=b=0;b<_;y++)(64512&(v=p.charCodeAt(y)))==55296&&y+1<x&&(64512&(m=p.charCodeAt(y+1)))==56320&&(v=65536+(v-55296<<10)+(m-56320),y++),v<128?g[b++]=v:(v<2048?g[b++]=192|v>>>6:(v<65536?g[b++]=224|v>>>12:(g[b++]=240|v>>>18,g[b++]=128|v>>>12&63),g[b++]=128|v>>>6&63),g[b++]=128|63&v);return g})(h)},r.utf8decode=function(h){return a.nodebuffer?o.transformTo("nodebuffer",h).toString("utf-8"):(function(p){var g,v,m,y,b=p.length,x=new Array(2*b);for(g=v=0;g<b;)if((m=p[g++])<128)x[v++]=m;else if(4<(y=c[m]))x[v++]=65533,g+=y-1;else{for(m&=y===2?31:y===3?15:7;1<y&&g<b;)m=m<<6|63&p[g++],y--;1<y?x[v++]=65533:m<65536?x[v++]=m:(m-=65536,x[v++]=55296|m>>10&1023,x[v++]=56320|1023&m)}return x.length!==v&&(x.subarray?x=x.subarray(0,v):x.length=v),o.applyFromCharCode(x)})(h=o.transformTo(a.uint8array?"uint8array":"array",h))},o.inherits(d,l),d.prototype.processChunk=function(h){var p=o.transformTo(a.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(a.uint8array){var g=p;(p=new Uint8Array(g.length+this.leftOver.length)).set(this.leftOver,0),p.set(g,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var v=(function(y,b){var x;for((b=b||y.length)>y.length&&(b=y.length),x=b-1;0<=x&&(192&y[x])==128;)x--;return x<0||x===0?b:x+c[y[x]]>b?x:b})(p),m=p;v!==p.length&&(a.uint8array?(m=p.subarray(0,v),this.leftOver=p.subarray(v,p.length)):(m=p.slice(0,v),this.leftOver=p.slice(v,p.length))),this.push({data:r.utf8decode(m),meta:h.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=d,o.inherits(f,l),f.prototype.processChunk=function(h){this.push({data:r.utf8encode(h.data),meta:h.meta})},r.Utf8EncodeWorker=f},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,i,r){var o=n("./support"),a=n("./base64"),s=n("./nodejsUtils"),l=n("./external");function c(g){return g}function u(g,v){for(var m=0;m<g.length;++m)v[m]=255&g.charCodeAt(m);return v}n("setimmediate"),r.newBlob=function(g,v){r.checkSupport("blob");try{return new Blob([g],{type:v})}catch{try{var m=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return m.append(g),m.getBlob(v)}catch{throw new Error("Bug : can't construct the Blob.")}}};var d={stringifyByChunk:function(g,v,m){var y=[],b=0,x=g.length;if(x<=m)return String.fromCharCode.apply(null,g);for(;b<x;)v==="array"||v==="nodebuffer"?y.push(String.fromCharCode.apply(null,g.slice(b,Math.min(b+m,x)))):y.push(String.fromCharCode.apply(null,g.subarray(b,Math.min(b+m,x)))),b+=m;return y.join("")},stringifyByChar:function(g){for(var v="",m=0;m<g.length;m++)v+=String.fromCharCode(g[m]);return v},applyCanBeUsed:{uint8array:(function(){try{return o.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return o.nodebuffer&&String.fromCharCode.apply(null,s.allocBuffer(1)).length===1}catch{return!1}})()}};function f(g){var v=65536,m=r.getTypeOf(g),y=!0;if(m==="uint8array"?y=d.applyCanBeUsed.uint8array:m==="nodebuffer"&&(y=d.applyCanBeUsed.nodebuffer),y)for(;1<v;)try{return d.stringifyByChunk(g,m,v)}catch{v=Math.floor(v/2)}return d.stringifyByChar(g)}function h(g,v){for(var m=0;m<g.length;m++)v[m]=g[m];return v}r.applyFromCharCode=f;var p={};p.string={string:c,array:function(g){return u(g,new Array(g.length))},arraybuffer:function(g){return p.string.uint8array(g).buffer},uint8array:function(g){return u(g,new Uint8Array(g.length))},nodebuffer:function(g){return u(g,s.allocBuffer(g.length))}},p.array={string:f,array:c,arraybuffer:function(g){return new Uint8Array(g).buffer},uint8array:function(g){return new Uint8Array(g)},nodebuffer:function(g){return s.newBufferFrom(g)}},p.arraybuffer={string:function(g){return f(new Uint8Array(g))},array:function(g){return h(new Uint8Array(g),new Array(g.byteLength))},arraybuffer:c,uint8array:function(g){return new Uint8Array(g)},nodebuffer:function(g){return s.newBufferFrom(new Uint8Array(g))}},p.uint8array={string:f,array:function(g){return h(g,new Array(g.length))},arraybuffer:function(g){return g.buffer},uint8array:c,nodebuffer:function(g){return s.newBufferFrom(g)}},p.nodebuffer={string:f,array:function(g){return h(g,new Array(g.length))},arraybuffer:function(g){return p.nodebuffer.uint8array(g).buffer},uint8array:function(g){return h(g,new Uint8Array(g.length))},nodebuffer:c},r.transformTo=function(g,v){if(v=v||"",!g)return v;r.checkSupport(g);var m=r.getTypeOf(v);return p[m][g](v)},r.resolve=function(g){for(var v=g.split("/"),m=[],y=0;y<v.length;y++){var b=v[y];b==="."||b===""&&y!==0&&y!==v.length-1||(b===".."?m.pop():m.push(b))}return m.join("/")},r.getTypeOf=function(g){return typeof g=="string"?"string":Object.prototype.toString.call(g)==="[object Array]"?"array":o.nodebuffer&&s.isBuffer(g)?"nodebuffer":o.uint8array&&g instanceof Uint8Array?"uint8array":o.arraybuffer&&g instanceof ArrayBuffer?"arraybuffer":void 0},r.checkSupport=function(g){if(!o[g.toLowerCase()])throw new Error(g+" is not supported by this platform")},r.MAX_VALUE_16BITS=65535,r.MAX_VALUE_32BITS=-1,r.pretty=function(g){var v,m,y="";for(m=0;m<(g||"").length;m++)y+="\\x"+((v=g.charCodeAt(m))<16?"0":"")+v.toString(16).toUpperCase();return y},r.delay=function(g,v,m){setImmediate(function(){g.apply(m||null,v||[])})},r.inherits=function(g,v){function m(){}m.prototype=v.prototype,g.prototype=new m},r.extend=function(){var g,v,m={};for(g=0;g<arguments.length;g++)for(v in arguments[g])Object.prototype.hasOwnProperty.call(arguments[g],v)&&m[v]===void 0&&(m[v]=arguments[g][v]);return m},r.prepareContent=function(g,v,m,y,b){return l.Promise.resolve(v).then(function(x){return o.blob&&(x instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(x))!==-1)&&typeof FileReader<"u"?new l.Promise(function(_,S){var $=new FileReader;$.onload=function(C){_(C.target.result)},$.onerror=function(C){S(C.target.error)},$.readAsArrayBuffer(x)}):x}).then(function(x){var _=r.getTypeOf(x);return _?(_==="arraybuffer"?x=r.transformTo("uint8array",x):_==="string"&&(b?x=a.decode(x):m&&y!==!0&&(x=(function(S){return u(S,o.uint8array?new Uint8Array(S.length):new Array(S.length))})(x))),x):l.Promise.reject(new Error("Can't read the data of '"+g+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(n,i,r){var o=n("./reader/readerFor"),a=n("./utils"),s=n("./signature"),l=n("./zipEntry"),c=n("./support");function u(d){this.files=[],this.loadOptions=d}u.prototype={checkSignature:function(d){if(!this.reader.readAndCheckSignature(d)){this.reader.index-=4;var f=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+a.pretty(f)+", expected "+a.pretty(d)+")")}},isSignature:function(d,f){var h=this.reader.index;this.reader.setIndex(d);var p=this.reader.readString(4)===f;return this.reader.setIndex(h),p},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var d=this.reader.readData(this.zipCommentLength),f=c.uint8array?"uint8array":"array",h=a.transformTo(f,d);this.zipComment=this.loadOptions.decodeFileName(h)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var d,f,h,p=this.zip64EndOfCentralSize-44;0<p;)d=this.reader.readInt(2),f=this.reader.readInt(4),h=this.reader.readData(f),this.zip64ExtensibleData[d]={id:d,length:f,value:h}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var d,f;for(d=0;d<this.files.length;d++)f=this.files[d],this.reader.setIndex(f.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),f.readLocalPart(this.reader),f.handleUTF8(),f.processAttributes()},readCentralDir:function(){var d;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(d=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(d);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var d=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(d<0)throw this.isSignature(0,s.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(d);var f=d;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===a.MAX_VALUE_16BITS||this.diskWithCentralDirStart===a.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===a.MAX_VALUE_16BITS||this.centralDirRecords===a.MAX_VALUE_16BITS||this.centralDirSize===a.MAX_VALUE_32BITS||this.centralDirOffset===a.MAX_VALUE_32BITS){if(this.zip64=!0,(d=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(d),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var h=this.centralDirOffset+this.centralDirSize;this.zip64&&(h+=20,h+=12+this.zip64EndOfCentralSize);var p=f-h;if(0<p)this.isSignature(f,s.CENTRAL_FILE_HEADER)||(this.reader.zero=p);else if(p<0)throw new Error("Corrupted zip: missing "+Math.abs(p)+" bytes.")},prepareReader:function(d){this.reader=o(d)},load:function(d){this.prepareReader(d),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},i.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,i,r){var o=n("./reader/readerFor"),a=n("./utils"),s=n("./compressedObject"),l=n("./crc32"),c=n("./utf8"),u=n("./compressions"),d=n("./support");function f(h,p){this.options=h,this.loadOptions=p}f.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(h){var p,g;if(h.skip(22),this.fileNameLength=h.readInt(2),g=h.readInt(2),this.fileName=h.readData(this.fileNameLength),h.skip(g),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((p=(function(v){for(var m in u)if(Object.prototype.hasOwnProperty.call(u,m)&&u[m].magic===v)return u[m];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+a.pretty(this.compressionMethod)+" unknown (inner file : "+a.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,p,h.readData(this.compressedSize))},readCentralPart:function(h){this.versionMadeBy=h.readInt(2),h.skip(2),this.bitFlag=h.readInt(2),this.compressionMethod=h.readString(2),this.date=h.readDate(),this.crc32=h.readInt(4),this.compressedSize=h.readInt(4),this.uncompressedSize=h.readInt(4);var p=h.readInt(2);if(this.extraFieldsLength=h.readInt(2),this.fileCommentLength=h.readInt(2),this.diskNumberStart=h.readInt(2),this.internalFileAttributes=h.readInt(2),this.externalFileAttributes=h.readInt(4),this.localHeaderOffset=h.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");h.skip(p),this.readExtraFields(h),this.parseZIP64ExtraField(h),this.fileComment=h.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var h=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=o(this.extraFields[1].value);this.uncompressedSize===a.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===a.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===a.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===a.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var p,g,v,m=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4<m;)p=h.readInt(2),g=h.readInt(2),v=h.readData(g),this.extraFields[p]={id:p,length:g,value:v};h.setIndex(m)},handleUTF8:function(){var h=d.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var p=this.findExtraFieldUnicodePath();if(p!==null)this.fileNameStr=p;else{var g=a.transformTo(h,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(g)}var v=this.findExtraFieldUnicodeComment();if(v!==null)this.fileCommentStr=v;else{var m=a.transformTo(h,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(m)}}},findExtraFieldUnicodePath:function(){var h=this.extraFields[28789];if(h){var p=o(h.value);return p.readInt(1)!==1||l(this.fileName)!==p.readInt(4)?null:c.utf8decode(p.readData(h.length-5))}return null},findExtraFieldUnicodeComment:function(){var h=this.extraFields[25461];if(h){var p=o(h.value);return p.readInt(1)!==1||l(this.fileComment)!==p.readInt(4)?null:c.utf8decode(p.readData(h.length-5))}return null}},i.exports=f},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,i,r){function o(p,g,v){this.name=p,this.dir=v.dir,this.date=v.date,this.comment=v.comment,this.unixPermissions=v.unixPermissions,this.dosPermissions=v.dosPermissions,this._data=g,this._dataBinary=v.binary,this.options={compression:v.compression,compressionOptions:v.compressionOptions}}var a=n("./stream/StreamHelper"),s=n("./stream/DataWorker"),l=n("./utf8"),c=n("./compressedObject"),u=n("./stream/GenericWorker");o.prototype={internalStream:function(p){var g=null,v="string";try{if(!p)throw new Error("No output type specified.");var m=(v=p.toLowerCase())==="string"||v==="text";v!=="binarystring"&&v!=="text"||(v="string"),g=this._decompressWorker();var y=!this._dataBinary;y&&!m&&(g=g.pipe(new l.Utf8EncodeWorker)),!y&&m&&(g=g.pipe(new l.Utf8DecodeWorker))}catch(b){(g=new u("error")).error(b)}return new a(g,v,"")},async:function(p,g){return this.internalStream(p).accumulate(g)},nodeStream:function(p,g){return this.internalStream(p||"nodebuffer").toNodejsStream(g)},_compressWorker:function(p,g){if(this._data instanceof c&&this._data.compression.magic===p.magic)return this._data.getCompressedWorker();var v=this._decompressWorker();return this._dataBinary||(v=v.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(v,p,g)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof u?this._data:new s(this._data)}};for(var d=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],f=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},h=0;h<d.length;h++)o.prototype[d[h]]=f;i.exports=o},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,i,r){(function(o){var a,s,l=o.MutationObserver||o.WebKitMutationObserver;if(l){var c=0,u=new l(p),d=o.document.createTextNode("");u.observe(d,{characterData:!0}),a=function(){d.data=c=++c%2}}else if(o.setImmediate||o.MessageChannel===void 0)a="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var g=o.document.createElement("script");g.onreadystatechange=function(){p(),g.onreadystatechange=null,g.parentNode.removeChild(g),g=null},o.document.documentElement.appendChild(g)}:function(){setTimeout(p,0)};else{var f=new o.MessageChannel;f.port1.onmessage=p,a=function(){f.port2.postMessage(0)}}var h=[];function p(){var g,v;s=!0;for(var m=h.length;m;){for(v=h,h=[],g=-1;++g<m;)v[g]();m=h.length}s=!1}i.exports=function(g){h.push(g)!==1||s||a()}}).call(this,typeof yw<"u"?yw:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,i,r){var o=n("immediate");function a(){}var s={},l=["REJECTED"],c=["FULFILLED"],u=["PENDING"];function d(m){if(typeof m!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,m!==a&&g(this,m)}function f(m,y,b){this.promise=m,typeof y=="function"&&(this.onFulfilled=y,this.callFulfilled=this.otherCallFulfilled),typeof b=="function"&&(this.onRejected=b,this.callRejected=this.otherCallRejected)}function h(m,y,b){o(function(){var x;try{x=y(b)}catch(_){return s.reject(m,_)}x===m?s.reject(m,new TypeError("Cannot resolve promise with itself")):s.resolve(m,x)})}function p(m){var y=m&&m.then;if(m&&(typeof m=="object"||typeof m=="function")&&typeof y=="function")return function(){y.apply(m,arguments)}}function g(m,y){var b=!1;function x($){b||(b=!0,s.reject(m,$))}function _($){b||(b=!0,s.resolve(m,$))}var S=v(function(){y(_,x)});S.status==="error"&&x(S.value)}function v(m,y){var b={};try{b.value=m(y),b.status="success"}catch(x){b.status="error",b.value=x}return b}(i.exports=d).prototype.finally=function(m){if(typeof m!="function")return this;var y=this.constructor;return this.then(function(b){return y.resolve(m()).then(function(){return b})},function(b){return y.resolve(m()).then(function(){throw b})})},d.prototype.catch=function(m){return this.then(null,m)},d.prototype.then=function(m,y){if(typeof m!="function"&&this.state===c||typeof y!="function"&&this.state===l)return this;var b=new this.constructor(a);return this.state!==u?h(b,this.state===c?m:y,this.outcome):this.queue.push(new f(b,m,y)),b},f.prototype.callFulfilled=function(m){s.resolve(this.promise,m)},f.prototype.otherCallFulfilled=function(m){h(this.promise,this.onFulfilled,m)},f.prototype.callRejected=function(m){s.reject(this.promise,m)},f.prototype.otherCallRejected=function(m){h(this.promise,this.onRejected,m)},s.resolve=function(m,y){var b=v(p,y);if(b.status==="error")return s.reject(m,b.value);var x=b.value;if(x)g(m,x);else{m.state=c,m.outcome=y;for(var _=-1,S=m.queue.length;++_<S;)m.queue[_].callFulfilled(y)}return m},s.reject=function(m,y){m.state=l,m.outcome=y;for(var b=-1,x=m.queue.length;++b<x;)m.queue[b].callRejected(y);return m},d.resolve=function(m){return m instanceof this?m:s.resolve(new this(a),m)},d.reject=function(m){var y=new this(a);return s.reject(y,m)},d.all=function(m){var y=this;if(Object.prototype.toString.call(m)!=="[object Array]")return this.reject(new TypeError("must be an array"));var b=m.length,x=!1;if(!b)return this.resolve([]);for(var _=new Array(b),S=0,$=-1,C=new this(a);++$<b;)w(m[$],$);return C;function w(z,A){y.resolve(z).then(function(M){_[A]=M,++S!==b||x||(x=!0,s.resolve(C,_))},function(M){x||(x=!0,s.reject(C,M))})}},d.race=function(m){var y=this;if(Object.prototype.toString.call(m)!=="[object Array]")return this.reject(new TypeError("must be an array"));var b=m.length,x=!1;if(!b)return this.resolve([]);for(var _=-1,S=new this(a);++_<b;)$=m[_],y.resolve($).then(function(C){x||(x=!0,s.resolve(S,C))},function(C){x||(x=!0,s.reject(S,C))});var $;return S}},{immediate:36}],38:[function(n,i,r){var o={};(0,n("./lib/utils/common").assign)(o,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),i.exports=o},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,i,r){var o=n("./zlib/deflate"),a=n("./utils/common"),s=n("./utils/strings"),l=n("./zlib/messages"),c=n("./zlib/zstream"),u=Object.prototype.toString,d=0,f=-1,h=0,p=8;function g(m){if(!(this instanceof g))return new g(m);this.options=a.assign({level:f,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:h,to:""},m||{});var y=this.options;y.raw&&0<y.windowBits?y.windowBits=-y.windowBits:y.gzip&&0<y.windowBits&&y.windowBits<16&&(y.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var b=o.deflateInit2(this.strm,y.level,y.method,y.windowBits,y.memLevel,y.strategy);if(b!==d)throw new Error(l[b]);if(y.header&&o.deflateSetHeader(this.strm,y.header),y.dictionary){var x;if(x=typeof y.dictionary=="string"?s.string2buf(y.dictionary):u.call(y.dictionary)==="[object ArrayBuffer]"?new Uint8Array(y.dictionary):y.dictionary,(b=o.deflateSetDictionary(this.strm,x))!==d)throw new Error(l[b]);this._dict_set=!0}}function v(m,y){var b=new g(y);if(b.push(m,!0),b.err)throw b.msg||l[b.err];return b.result}g.prototype.push=function(m,y){var b,x,_=this.strm,S=this.options.chunkSize;if(this.ended)return!1;x=y===~~y?y:y===!0?4:0,typeof m=="string"?_.input=s.string2buf(m):u.call(m)==="[object ArrayBuffer]"?_.input=new Uint8Array(m):_.input=m,_.next_in=0,_.avail_in=_.input.length;do{if(_.avail_out===0&&(_.output=new a.Buf8(S),_.next_out=0,_.avail_out=S),(b=o.deflate(_,x))!==1&&b!==d)return this.onEnd(b),!(this.ended=!0);_.avail_out!==0&&(_.avail_in!==0||x!==4&&x!==2)||(this.options.to==="string"?this.onData(s.buf2binstring(a.shrinkBuf(_.output,_.next_out))):this.onData(a.shrinkBuf(_.output,_.next_out)))}while((0<_.avail_in||_.avail_out===0)&&b!==1);return x===4?(b=o.deflateEnd(this.strm),this.onEnd(b),this.ended=!0,b===d):x!==2||(this.onEnd(d),!(_.avail_out=0))},g.prototype.onData=function(m){this.chunks.push(m)},g.prototype.onEnd=function(m){m===d&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg},r.Deflate=g,r.deflate=v,r.deflateRaw=function(m,y){return(y=y||{}).raw=!0,v(m,y)},r.gzip=function(m,y){return(y=y||{}).gzip=!0,v(m,y)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,i,r){var o=n("./zlib/inflate"),a=n("./utils/common"),s=n("./utils/strings"),l=n("./zlib/constants"),c=n("./zlib/messages"),u=n("./zlib/zstream"),d=n("./zlib/gzheader"),f=Object.prototype.toString;function h(g){if(!(this instanceof h))return new h(g);this.options=a.assign({chunkSize:16384,windowBits:0,to:""},g||{});var v=this.options;v.raw&&0<=v.windowBits&&v.windowBits<16&&(v.windowBits=-v.windowBits,v.windowBits===0&&(v.windowBits=-15)),!(0<=v.windowBits&&v.windowBits<16)||g&&g.windowBits||(v.windowBits+=32),15<v.windowBits&&v.windowBits<48&&(15&v.windowBits)==0&&(v.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var m=o.inflateInit2(this.strm,v.windowBits);if(m!==l.Z_OK)throw new Error(c[m]);this.header=new d,o.inflateGetHeader(this.strm,this.header)}function p(g,v){var m=new h(v);if(m.push(g,!0),m.err)throw m.msg||c[m.err];return m.result}h.prototype.push=function(g,v){var m,y,b,x,_,S,$=this.strm,C=this.options.chunkSize,w=this.options.dictionary,z=!1;if(this.ended)return!1;y=v===~~v?v:v===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof g=="string"?$.input=s.binstring2buf(g):f.call(g)==="[object ArrayBuffer]"?$.input=new Uint8Array(g):$.input=g,$.next_in=0,$.avail_in=$.input.length;do{if($.avail_out===0&&($.output=new a.Buf8(C),$.next_out=0,$.avail_out=C),(m=o.inflate($,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&w&&(S=typeof w=="string"?s.string2buf(w):f.call(w)==="[object ArrayBuffer]"?new Uint8Array(w):w,m=o.inflateSetDictionary(this.strm,S)),m===l.Z_BUF_ERROR&&z===!0&&(m=l.Z_OK,z=!1),m!==l.Z_STREAM_END&&m!==l.Z_OK)return this.onEnd(m),!(this.ended=!0);$.next_out&&($.avail_out!==0&&m!==l.Z_STREAM_END&&($.avail_in!==0||y!==l.Z_FINISH&&y!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(b=s.utf8border($.output,$.next_out),x=$.next_out-b,_=s.buf2string($.output,b),$.next_out=x,$.avail_out=C-x,x&&a.arraySet($.output,$.output,b,x,0),this.onData(_)):this.onData(a.shrinkBuf($.output,$.next_out)))),$.avail_in===0&&$.avail_out===0&&(z=!0)}while((0<$.avail_in||$.avail_out===0)&&m!==l.Z_STREAM_END);return m===l.Z_STREAM_END&&(y=l.Z_FINISH),y===l.Z_FINISH?(m=o.inflateEnd(this.strm),this.onEnd(m),this.ended=!0,m===l.Z_OK):y!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!($.avail_out=0))},h.prototype.onData=function(g){this.chunks.push(g)},h.prototype.onEnd=function(g){g===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=g,this.msg=this.strm.msg},r.Inflate=h,r.inflate=p,r.inflateRaw=function(g,v){return(v=v||{}).raw=!0,p(g,v)},r.ungzip=p},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,i,r){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";r.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var u=c.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(var d in u)u.hasOwnProperty(d)&&(l[d]=u[d])}}return l},r.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var a={arraySet:function(l,c,u,d,f){if(c.subarray&&l.subarray)l.set(c.subarray(u,u+d),f);else for(var h=0;h<d;h++)l[f+h]=c[u+h]},flattenChunks:function(l){var c,u,d,f,h,p;for(c=d=0,u=l.length;c<u;c++)d+=l[c].length;for(p=new Uint8Array(d),c=f=0,u=l.length;c<u;c++)h=l[c],p.set(h,f),f+=h.length;return p}},s={arraySet:function(l,c,u,d,f){for(var h=0;h<d;h++)l[f+h]=c[u+h]},flattenChunks:function(l){return[].concat.apply([],l)}};r.setTyped=function(l){l?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,a)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,s))},r.setTyped(o)},{}],42:[function(n,i,r){var o=n("./common"),a=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch{a=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{s=!1}for(var l=new o.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function u(d,f){if(f<65537&&(d.subarray&&s||!d.subarray&&a))return String.fromCharCode.apply(null,o.shrinkBuf(d,f));for(var h="",p=0;p<f;p++)h+=String.fromCharCode(d[p]);return h}l[254]=l[254]=1,r.string2buf=function(d){var f,h,p,g,v,m=d.length,y=0;for(g=0;g<m;g++)(64512&(h=d.charCodeAt(g)))==55296&&g+1<m&&(64512&(p=d.charCodeAt(g+1)))==56320&&(h=65536+(h-55296<<10)+(p-56320),g++),y+=h<128?1:h<2048?2:h<65536?3:4;for(f=new o.Buf8(y),g=v=0;v<y;g++)(64512&(h=d.charCodeAt(g)))==55296&&g+1<m&&(64512&(p=d.charCodeAt(g+1)))==56320&&(h=65536+(h-55296<<10)+(p-56320),g++),h<128?f[v++]=h:(h<2048?f[v++]=192|h>>>6:(h<65536?f[v++]=224|h>>>12:(f[v++]=240|h>>>18,f[v++]=128|h>>>12&63),f[v++]=128|h>>>6&63),f[v++]=128|63&h);return f},r.buf2binstring=function(d){return u(d,d.length)},r.binstring2buf=function(d){for(var f=new o.Buf8(d.length),h=0,p=f.length;h<p;h++)f[h]=d.charCodeAt(h);return f},r.buf2string=function(d,f){var h,p,g,v,m=f||d.length,y=new Array(2*m);for(h=p=0;h<m;)if((g=d[h++])<128)y[p++]=g;else if(4<(v=l[g]))y[p++]=65533,h+=v-1;else{for(g&=v===2?31:v===3?15:7;1<v&&h<m;)g=g<<6|63&d[h++],v--;1<v?y[p++]=65533:g<65536?y[p++]=g:(g-=65536,y[p++]=55296|g>>10&1023,y[p++]=56320|1023&g)}return u(y,p)},r.utf8border=function(d,f){var h;for((f=f||d.length)>d.length&&(f=d.length),h=f-1;0<=h&&(192&d[h])==128;)h--;return h<0||h===0?f:h+l[d[h]]>f?h:f}},{"./common":41}],43:[function(n,i,r){i.exports=function(o,a,s,l){for(var c=65535&o|0,u=o>>>16&65535|0,d=0;s!==0;){for(s-=d=2e3<s?2e3:s;u=u+(c=c+a[l++]|0)|0,--d;);c%=65521,u%=65521}return c|u<<16|0}},{}],44:[function(n,i,r){i.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(n,i,r){var o=(function(){for(var a,s=[],l=0;l<256;l++){a=l;for(var c=0;c<8;c++)a=1&a?3988292384^a>>>1:a>>>1;s[l]=a}return s})();i.exports=function(a,s,l,c){var u=o,d=c+l;a^=-1;for(var f=c;f<d;f++)a=a>>>8^u[255&(a^s[f])];return-1^a}},{}],46:[function(n,i,r){var o,a=n("../utils/common"),s=n("./trees"),l=n("./adler32"),c=n("./crc32"),u=n("./messages"),d=0,f=4,h=0,p=-2,g=-1,v=4,m=2,y=8,b=9,x=286,_=30,S=19,$=2*x+1,C=15,w=3,z=258,A=z+w+1,M=42,T=113,k=1,I=2,D=3,E=4;function N(R,ie){return R.msg=u[ie],ie}function F(R){return(R<<1)-(4<R?9:0)}function G(R){for(var ie=R.length;0<=--ie;)R[ie]=0}function P(R){var ie=R.state,te=ie.pending;te>R.avail_out&&(te=R.avail_out),te!==0&&(a.arraySet(R.output,ie.pending_buf,ie.pending_out,te,R.next_out),R.next_out+=te,ie.pending_out+=te,R.total_out+=te,R.avail_out-=te,ie.pending-=te,ie.pending===0&&(ie.pending_out=0))}function O(R,ie){s._tr_flush_block(R,0<=R.block_start?R.block_start:-1,R.strstart-R.block_start,ie),R.block_start=R.strstart,P(R.strm)}function V(R,ie){R.pending_buf[R.pending++]=ie}function j(R,ie){R.pending_buf[R.pending++]=ie>>>8&255,R.pending_buf[R.pending++]=255&ie}function H(R,ie){var te,B,U=R.max_chain_length,W=R.strstart,ue=R.prev_length,de=R.nice_match,J=R.strstart>R.w_size-A?R.strstart-(R.w_size-A):0,ge=R.window,we=R.w_mask,X=R.prev,K=R.strstart+z,Ce=ge[W+ue-1],ye=ge[W+ue];R.prev_length>=R.good_match&&(U>>=2),de>R.lookahead&&(de=R.lookahead);do if(ge[(te=ie)+ue]===ye&&ge[te+ue-1]===Ce&&ge[te]===ge[W]&&ge[++te]===ge[W+1]){W+=2,te++;do;while(ge[++W]===ge[++te]&&ge[++W]===ge[++te]&&ge[++W]===ge[++te]&&ge[++W]===ge[++te]&&ge[++W]===ge[++te]&&ge[++W]===ge[++te]&&ge[++W]===ge[++te]&&ge[++W]===ge[++te]&&W<K);if(B=z-(K-W),W=K-z,ue<B){if(R.match_start=ie,de<=(ue=B))break;Ce=ge[W+ue-1],ye=ge[W+ue]}}while((ie=X[ie&we])>J&&--U!=0);return ue<=R.lookahead?ue:R.lookahead}function Q(R){var ie,te,B,U,W,ue,de,J,ge,we,X=R.w_size;do{if(U=R.window_size-R.lookahead-R.strstart,R.strstart>=X+(X-A)){for(a.arraySet(R.window,R.window,X,X,0),R.match_start-=X,R.strstart-=X,R.block_start-=X,ie=te=R.hash_size;B=R.head[--ie],R.head[ie]=X<=B?B-X:0,--te;);for(ie=te=X;B=R.prev[--ie],R.prev[ie]=X<=B?B-X:0,--te;);U+=X}if(R.strm.avail_in===0)break;if(ue=R.strm,de=R.window,J=R.strstart+R.lookahead,ge=U,we=void 0,we=ue.avail_in,ge<we&&(we=ge),te=we===0?0:(ue.avail_in-=we,a.arraySet(de,ue.input,ue.next_in,we,J),ue.state.wrap===1?ue.adler=l(ue.adler,de,we,J):ue.state.wrap===2&&(ue.adler=c(ue.adler,de,we,J)),ue.next_in+=we,ue.total_in+=we,we),R.lookahead+=te,R.lookahead+R.insert>=w)for(W=R.strstart-R.insert,R.ins_h=R.window[W],R.ins_h=(R.ins_h<<R.hash_shift^R.window[W+1])&R.hash_mask;R.insert&&(R.ins_h=(R.ins_h<<R.hash_shift^R.window[W+w-1])&R.hash_mask,R.prev[W&R.w_mask]=R.head[R.ins_h],R.head[R.ins_h]=W,W++,R.insert--,!(R.lookahead+R.insert<w)););}while(R.lookahead<A&&R.strm.avail_in!==0)}function le(R,ie){for(var te,B;;){if(R.lookahead<A){if(Q(R),R.lookahead<A&&ie===d)return k;if(R.lookahead===0)break}if(te=0,R.lookahead>=w&&(R.ins_h=(R.ins_h<<R.hash_shift^R.window[R.strstart+w-1])&R.hash_mask,te=R.prev[R.strstart&R.w_mask]=R.head[R.ins_h],R.head[R.ins_h]=R.strstart),te!==0&&R.strstart-te<=R.w_size-A&&(R.match_length=H(R,te)),R.match_length>=w)if(B=s._tr_tally(R,R.strstart-R.match_start,R.match_length-w),R.lookahead-=R.match_length,R.match_length<=R.max_lazy_match&&R.lookahead>=w){for(R.match_length--;R.strstart++,R.ins_h=(R.ins_h<<R.hash_shift^R.window[R.strstart+w-1])&R.hash_mask,te=R.prev[R.strstart&R.w_mask]=R.head[R.ins_h],R.head[R.ins_h]=R.strstart,--R.match_length!=0;);R.strstart++}else R.strstart+=R.match_length,R.match_length=0,R.ins_h=R.window[R.strstart],R.ins_h=(R.ins_h<<R.hash_shift^R.window[R.strstart+1])&R.hash_mask;else B=s._tr_tally(R,0,R.window[R.strstart]),R.lookahead--,R.strstart++;if(B&&(O(R,!1),R.strm.avail_out===0))return k}return R.insert=R.strstart<w-1?R.strstart:w-1,ie===f?(O(R,!0),R.strm.avail_out===0?D:E):R.last_lit&&(O(R,!1),R.strm.avail_out===0)?k:I}function se(R,ie){for(var te,B,U;;){if(R.lookahead<A){if(Q(R),R.lookahead<A&&ie===d)return k;if(R.lookahead===0)break}if(te=0,R.lookahead>=w&&(R.ins_h=(R.ins_h<<R.hash_shift^R.window[R.strstart+w-1])&R.hash_mask,te=R.prev[R.strstart&R.w_mask]=R.head[R.ins_h],R.head[R.ins_h]=R.strstart),R.prev_length=R.match_length,R.prev_match=R.match_start,R.match_length=w-1,te!==0&&R.prev_length<R.max_lazy_match&&R.strstart-te<=R.w_size-A&&(R.match_length=H(R,te),R.match_length<=5&&(R.strategy===1||R.match_length===w&&4096<R.strstart-R.match_start)&&(R.match_length=w-1)),R.prev_length>=w&&R.match_length<=R.prev_length){for(U=R.strstart+R.lookahead-w,B=s._tr_tally(R,R.strstart-1-R.prev_match,R.prev_length-w),R.lookahead-=R.prev_length-1,R.prev_length-=2;++R.strstart<=U&&(R.ins_h=(R.ins_h<<R.hash_shift^R.window[R.strstart+w-1])&R.hash_mask,te=R.prev[R.strstart&R.w_mask]=R.head[R.ins_h],R.head[R.ins_h]=R.strstart),--R.prev_length!=0;);if(R.match_available=0,R.match_length=w-1,R.strstart++,B&&(O(R,!1),R.strm.avail_out===0))return k}else if(R.match_available){if((B=s._tr_tally(R,0,R.window[R.strstart-1]))&&O(R,!1),R.strstart++,R.lookahead--,R.strm.avail_out===0)return k}else R.match_available=1,R.strstart++,R.lookahead--}return R.match_available&&(B=s._tr_tally(R,0,R.window[R.strstart-1]),R.match_available=0),R.insert=R.strstart<w-1?R.strstart:w-1,ie===f?(O(R,!0),R.strm.avail_out===0?D:E):R.last_lit&&(O(R,!1),R.strm.avail_out===0)?k:I}function ae(R,ie,te,B,U){this.good_length=R,this.max_lazy=ie,this.nice_length=te,this.max_chain=B,this.func=U}function Se(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=y,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new a.Buf16(2*$),this.dyn_dtree=new a.Buf16(2*(2*_+1)),this.bl_tree=new a.Buf16(2*(2*S+1)),G(this.dyn_ltree),G(this.dyn_dtree),G(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new a.Buf16(C+1),this.heap=new a.Buf16(2*x+1),G(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new a.Buf16(2*x+1),G(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ve(R){var ie;return R&&R.state?(R.total_in=R.total_out=0,R.data_type=m,(ie=R.state).pending=0,ie.pending_out=0,ie.wrap<0&&(ie.wrap=-ie.wrap),ie.status=ie.wrap?M:T,R.adler=ie.wrap===2?0:1,ie.last_flush=d,s._tr_init(ie),h):N(R,p)}function $e(R){var ie=ve(R);return ie===h&&(function(te){te.window_size=2*te.w_size,G(te.head),te.max_lazy_match=o[te.level].max_lazy,te.good_match=o[te.level].good_length,te.nice_match=o[te.level].nice_length,te.max_chain_length=o[te.level].max_chain,te.strstart=0,te.block_start=0,te.lookahead=0,te.insert=0,te.match_length=te.prev_length=w-1,te.match_available=0,te.ins_h=0})(R.state),ie}function je(R,ie,te,B,U,W){if(!R)return p;var ue=1;if(ie===g&&(ie=6),B<0?(ue=0,B=-B):15<B&&(ue=2,B-=16),U<1||b<U||te!==y||B<8||15<B||ie<0||9<ie||W<0||v<W)return N(R,p);B===8&&(B=9);var de=new Se;return(R.state=de).strm=R,de.wrap=ue,de.gzhead=null,de.w_bits=B,de.w_size=1<<de.w_bits,de.w_mask=de.w_size-1,de.hash_bits=U+7,de.hash_size=1<<de.hash_bits,de.hash_mask=de.hash_size-1,de.hash_shift=~~((de.hash_bits+w-1)/w),de.window=new a.Buf8(2*de.w_size),de.head=new a.Buf16(de.hash_size),de.prev=new a.Buf16(de.w_size),de.lit_bufsize=1<<U+6,de.pending_buf_size=4*de.lit_bufsize,de.pending_buf=new a.Buf8(de.pending_buf_size),de.d_buf=1*de.lit_bufsize,de.l_buf=3*de.lit_bufsize,de.level=ie,de.strategy=W,de.method=te,$e(R)}o=[new ae(0,0,0,0,function(R,ie){var te=65535;for(te>R.pending_buf_size-5&&(te=R.pending_buf_size-5);;){if(R.lookahead<=1){if(Q(R),R.lookahead===0&&ie===d)return k;if(R.lookahead===0)break}R.strstart+=R.lookahead,R.lookahead=0;var B=R.block_start+te;if((R.strstart===0||R.strstart>=B)&&(R.lookahead=R.strstart-B,R.strstart=B,O(R,!1),R.strm.avail_out===0)||R.strstart-R.block_start>=R.w_size-A&&(O(R,!1),R.strm.avail_out===0))return k}return R.insert=0,ie===f?(O(R,!0),R.strm.avail_out===0?D:E):(R.strstart>R.block_start&&(O(R,!1),R.strm.avail_out),k)}),new ae(4,4,8,4,le),new ae(4,5,16,8,le),new ae(4,6,32,32,le),new ae(4,4,16,16,se),new ae(8,16,32,32,se),new ae(8,16,128,128,se),new ae(8,32,128,256,se),new ae(32,128,258,1024,se),new ae(32,258,258,4096,se)],r.deflateInit=function(R,ie){return je(R,ie,y,15,8,0)},r.deflateInit2=je,r.deflateReset=$e,r.deflateResetKeep=ve,r.deflateSetHeader=function(R,ie){return R&&R.state?R.state.wrap!==2?p:(R.state.gzhead=ie,h):p},r.deflate=function(R,ie){var te,B,U,W;if(!R||!R.state||5<ie||ie<0)return R?N(R,p):p;if(B=R.state,!R.output||!R.input&&R.avail_in!==0||B.status===666&&ie!==f)return N(R,R.avail_out===0?-5:p);if(B.strm=R,te=B.last_flush,B.last_flush=ie,B.status===M)if(B.wrap===2)R.adler=0,V(B,31),V(B,139),V(B,8),B.gzhead?(V(B,(B.gzhead.text?1:0)+(B.gzhead.hcrc?2:0)+(B.gzhead.extra?4:0)+(B.gzhead.name?8:0)+(B.gzhead.comment?16:0)),V(B,255&B.gzhead.time),V(B,B.gzhead.time>>8&255),V(B,B.gzhead.time>>16&255),V(B,B.gzhead.time>>24&255),V(B,B.level===9?2:2<=B.strategy||B.level<2?4:0),V(B,255&B.gzhead.os),B.gzhead.extra&&B.gzhead.extra.length&&(V(B,255&B.gzhead.extra.length),V(B,B.gzhead.extra.length>>8&255)),B.gzhead.hcrc&&(R.adler=c(R.adler,B.pending_buf,B.pending,0)),B.gzindex=0,B.status=69):(V(B,0),V(B,0),V(B,0),V(B,0),V(B,0),V(B,B.level===9?2:2<=B.strategy||B.level<2?4:0),V(B,3),B.status=T);else{var ue=y+(B.w_bits-8<<4)<<8;ue|=(2<=B.strategy||B.level<2?0:B.level<6?1:B.level===6?2:3)<<6,B.strstart!==0&&(ue|=32),ue+=31-ue%31,B.status=T,j(B,ue),B.strstart!==0&&(j(B,R.adler>>>16),j(B,65535&R.adler)),R.adler=1}if(B.status===69)if(B.gzhead.extra){for(U=B.pending;B.gzindex<(65535&B.gzhead.extra.length)&&(B.pending!==B.pending_buf_size||(B.gzhead.hcrc&&B.pending>U&&(R.adler=c(R.adler,B.pending_buf,B.pending-U,U)),P(R),U=B.pending,B.pending!==B.pending_buf_size));)V(B,255&B.gzhead.extra[B.gzindex]),B.gzindex++;B.gzhead.hcrc&&B.pending>U&&(R.adler=c(R.adler,B.pending_buf,B.pending-U,U)),B.gzindex===B.gzhead.extra.length&&(B.gzindex=0,B.status=73)}else B.status=73;if(B.status===73)if(B.gzhead.name){U=B.pending;do{if(B.pending===B.pending_buf_size&&(B.gzhead.hcrc&&B.pending>U&&(R.adler=c(R.adler,B.pending_buf,B.pending-U,U)),P(R),U=B.pending,B.pending===B.pending_buf_size)){W=1;break}W=B.gzindex<B.gzhead.name.length?255&B.gzhead.name.charCodeAt(B.gzindex++):0,V(B,W)}while(W!==0);B.gzhead.hcrc&&B.pending>U&&(R.adler=c(R.adler,B.pending_buf,B.pending-U,U)),W===0&&(B.gzindex=0,B.status=91)}else B.status=91;if(B.status===91)if(B.gzhead.comment){U=B.pending;do{if(B.pending===B.pending_buf_size&&(B.gzhead.hcrc&&B.pending>U&&(R.adler=c(R.adler,B.pending_buf,B.pending-U,U)),P(R),U=B.pending,B.pending===B.pending_buf_size)){W=1;break}W=B.gzindex<B.gzhead.comment.length?255&B.gzhead.comment.charCodeAt(B.gzindex++):0,V(B,W)}while(W!==0);B.gzhead.hcrc&&B.pending>U&&(R.adler=c(R.adler,B.pending_buf,B.pending-U,U)),W===0&&(B.status=103)}else B.status=103;if(B.status===103&&(B.gzhead.hcrc?(B.pending+2>B.pending_buf_size&&P(R),B.pending+2<=B.pending_buf_size&&(V(B,255&R.adler),V(B,R.adler>>8&255),R.adler=0,B.status=T)):B.status=T),B.pending!==0){if(P(R),R.avail_out===0)return B.last_flush=-1,h}else if(R.avail_in===0&&F(ie)<=F(te)&&ie!==f)return N(R,-5);if(B.status===666&&R.avail_in!==0)return N(R,-5);if(R.avail_in!==0||B.lookahead!==0||ie!==d&&B.status!==666){var de=B.strategy===2?(function(J,ge){for(var we;;){if(J.lookahead===0&&(Q(J),J.lookahead===0)){if(ge===d)return k;break}if(J.match_length=0,we=s._tr_tally(J,0,J.window[J.strstart]),J.lookahead--,J.strstart++,we&&(O(J,!1),J.strm.avail_out===0))return k}return J.insert=0,ge===f?(O(J,!0),J.strm.avail_out===0?D:E):J.last_lit&&(O(J,!1),J.strm.avail_out===0)?k:I})(B,ie):B.strategy===3?(function(J,ge){for(var we,X,K,Ce,ye=J.window;;){if(J.lookahead<=z){if(Q(J),J.lookahead<=z&&ge===d)return k;if(J.lookahead===0)break}if(J.match_length=0,J.lookahead>=w&&0<J.strstart&&(X=ye[K=J.strstart-1])===ye[++K]&&X===ye[++K]&&X===ye[++K]){Ce=J.strstart+z;do;while(X===ye[++K]&&X===ye[++K]&&X===ye[++K]&&X===ye[++K]&&X===ye[++K]&&X===ye[++K]&&X===ye[++K]&&X===ye[++K]&&K<Ce);J.match_length=z-(Ce-K),J.match_length>J.lookahead&&(J.match_length=J.lookahead)}if(J.match_length>=w?(we=s._tr_tally(J,1,J.match_length-w),J.lookahead-=J.match_length,J.strstart+=J.match_length,J.match_length=0):(we=s._tr_tally(J,0,J.window[J.strstart]),J.lookahead--,J.strstart++),we&&(O(J,!1),J.strm.avail_out===0))return k}return J.insert=0,ge===f?(O(J,!0),J.strm.avail_out===0?D:E):J.last_lit&&(O(J,!1),J.strm.avail_out===0)?k:I})(B,ie):o[B.level].func(B,ie);if(de!==D&&de!==E||(B.status=666),de===k||de===D)return R.avail_out===0&&(B.last_flush=-1),h;if(de===I&&(ie===1?s._tr_align(B):ie!==5&&(s._tr_stored_block(B,0,0,!1),ie===3&&(G(B.head),B.lookahead===0&&(B.strstart=0,B.block_start=0,B.insert=0))),P(R),R.avail_out===0))return B.last_flush=-1,h}return ie!==f?h:B.wrap<=0?1:(B.wrap===2?(V(B,255&R.adler),V(B,R.adler>>8&255),V(B,R.adler>>16&255),V(B,R.adler>>24&255),V(B,255&R.total_in),V(B,R.total_in>>8&255),V(B,R.total_in>>16&255),V(B,R.total_in>>24&255)):(j(B,R.adler>>>16),j(B,65535&R.adler)),P(R),0<B.wrap&&(B.wrap=-B.wrap),B.pending!==0?h:1)},r.deflateEnd=function(R){var ie;return R&&R.state?(ie=R.state.status)!==M&&ie!==69&&ie!==73&&ie!==91&&ie!==103&&ie!==T&&ie!==666?N(R,p):(R.state=null,ie===T?N(R,-3):h):p},r.deflateSetDictionary=function(R,ie){var te,B,U,W,ue,de,J,ge,we=ie.length;if(!R||!R.state||(W=(te=R.state).wrap)===2||W===1&&te.status!==M||te.lookahead)return p;for(W===1&&(R.adler=l(R.adler,ie,we,0)),te.wrap=0,we>=te.w_size&&(W===0&&(G(te.head),te.strstart=0,te.block_start=0,te.insert=0),ge=new a.Buf8(te.w_size),a.arraySet(ge,ie,we-te.w_size,te.w_size,0),ie=ge,we=te.w_size),ue=R.avail_in,de=R.next_in,J=R.input,R.avail_in=we,R.next_in=0,R.input=ie,Q(te);te.lookahead>=w;){for(B=te.strstart,U=te.lookahead-(w-1);te.ins_h=(te.ins_h<<te.hash_shift^te.window[B+w-1])&te.hash_mask,te.prev[B&te.w_mask]=te.head[te.ins_h],te.head[te.ins_h]=B,B++,--U;);te.strstart=B,te.lookahead=w-1,Q(te)}return te.strstart+=te.lookahead,te.block_start=te.strstart,te.insert=te.lookahead,te.lookahead=0,te.match_length=te.prev_length=w-1,te.match_available=0,R.next_in=de,R.input=J,R.avail_in=ue,te.wrap=W,h},r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,i,r){i.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(n,i,r){i.exports=function(o,a){var s,l,c,u,d,f,h,p,g,v,m,y,b,x,_,S,$,C,w,z,A,M,T,k,I;s=o.state,l=o.next_in,k=o.input,c=l+(o.avail_in-5),u=o.next_out,I=o.output,d=u-(a-o.avail_out),f=u+(o.avail_out-257),h=s.dmax,p=s.wsize,g=s.whave,v=s.wnext,m=s.window,y=s.hold,b=s.bits,x=s.lencode,_=s.distcode,S=(1<<s.lenbits)-1,$=(1<<s.distbits)-1;e:do{b<15&&(y+=k[l++]<<b,b+=8,y+=k[l++]<<b,b+=8),C=x[y&S];t:for(;;){if(y>>>=w=C>>>24,b-=w,(w=C>>>16&255)===0)I[u++]=65535&C;else{if(!(16&w)){if((64&w)==0){C=x[(65535&C)+(y&(1<<w)-1)];continue t}if(32&w){s.mode=12;break e}o.msg="invalid literal/length code",s.mode=30;break e}z=65535&C,(w&=15)&&(b<w&&(y+=k[l++]<<b,b+=8),z+=y&(1<<w)-1,y>>>=w,b-=w),b<15&&(y+=k[l++]<<b,b+=8,y+=k[l++]<<b,b+=8),C=_[y&$];n:for(;;){if(y>>>=w=C>>>24,b-=w,!(16&(w=C>>>16&255))){if((64&w)==0){C=_[(65535&C)+(y&(1<<w)-1)];continue n}o.msg="invalid distance code",s.mode=30;break e}if(A=65535&C,b<(w&=15)&&(y+=k[l++]<<b,(b+=8)<w&&(y+=k[l++]<<b,b+=8)),h<(A+=y&(1<<w)-1)){o.msg="invalid distance too far back",s.mode=30;break e}if(y>>>=w,b-=w,(w=u-d)<A){if(g<(w=A-w)&&s.sane){o.msg="invalid distance too far back",s.mode=30;break e}if(T=m,(M=0)===v){if(M+=p-w,w<z){for(z-=w;I[u++]=m[M++],--w;);M=u-A,T=I}}else if(v<w){if(M+=p+v-w,(w-=v)<z){for(z-=w;I[u++]=m[M++],--w;);if(M=0,v<z){for(z-=w=v;I[u++]=m[M++],--w;);M=u-A,T=I}}}else if(M+=v-w,w<z){for(z-=w;I[u++]=m[M++],--w;);M=u-A,T=I}for(;2<z;)I[u++]=T[M++],I[u++]=T[M++],I[u++]=T[M++],z-=3;z&&(I[u++]=T[M++],1<z&&(I[u++]=T[M++]))}else{for(M=u-A;I[u++]=I[M++],I[u++]=I[M++],I[u++]=I[M++],2<(z-=3););z&&(I[u++]=I[M++],1<z&&(I[u++]=I[M++]))}break}}break}}while(l<c&&u<f);l-=z=b>>3,y&=(1<<(b-=z<<3))-1,o.next_in=l,o.next_out=u,o.avail_in=l<c?c-l+5:5-(l-c),o.avail_out=u<f?f-u+257:257-(u-f),s.hold=y,s.bits=b}},{}],49:[function(n,i,r){var o=n("../utils/common"),a=n("./adler32"),s=n("./crc32"),l=n("./inffast"),c=n("./inftrees"),u=1,d=2,f=0,h=-2,p=1,g=852,v=592;function m(M){return(M>>>24&255)+(M>>>8&65280)+((65280&M)<<8)+((255&M)<<24)}function y(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function b(M){var T;return M&&M.state?(T=M.state,M.total_in=M.total_out=T.total=0,M.msg="",T.wrap&&(M.adler=1&T.wrap),T.mode=p,T.last=0,T.havedict=0,T.dmax=32768,T.head=null,T.hold=0,T.bits=0,T.lencode=T.lendyn=new o.Buf32(g),T.distcode=T.distdyn=new o.Buf32(v),T.sane=1,T.back=-1,f):h}function x(M){var T;return M&&M.state?((T=M.state).wsize=0,T.whave=0,T.wnext=0,b(M)):h}function _(M,T){var k,I;return M&&M.state?(I=M.state,T<0?(k=0,T=-T):(k=1+(T>>4),T<48&&(T&=15)),T&&(T<8||15<T)?h:(I.window!==null&&I.wbits!==T&&(I.window=null),I.wrap=k,I.wbits=T,x(M))):h}function S(M,T){var k,I;return M?(I=new y,(M.state=I).window=null,(k=_(M,T))!==f&&(M.state=null),k):h}var $,C,w=!0;function z(M){if(w){var T;for($=new o.Buf32(512),C=new o.Buf32(32),T=0;T<144;)M.lens[T++]=8;for(;T<256;)M.lens[T++]=9;for(;T<280;)M.lens[T++]=7;for(;T<288;)M.lens[T++]=8;for(c(u,M.lens,0,288,$,0,M.work,{bits:9}),T=0;T<32;)M.lens[T++]=5;c(d,M.lens,0,32,C,0,M.work,{bits:5}),w=!1}M.lencode=$,M.lenbits=9,M.distcode=C,M.distbits=5}function A(M,T,k,I){var D,E=M.state;return E.window===null&&(E.wsize=1<<E.wbits,E.wnext=0,E.whave=0,E.window=new o.Buf8(E.wsize)),I>=E.wsize?(o.arraySet(E.window,T,k-E.wsize,E.wsize,0),E.wnext=0,E.whave=E.wsize):(I<(D=E.wsize-E.wnext)&&(D=I),o.arraySet(E.window,T,k-I,D,E.wnext),(I-=D)?(o.arraySet(E.window,T,k-I,I,0),E.wnext=I,E.whave=E.wsize):(E.wnext+=D,E.wnext===E.wsize&&(E.wnext=0),E.whave<E.wsize&&(E.whave+=D))),0}r.inflateReset=x,r.inflateReset2=_,r.inflateResetKeep=b,r.inflateInit=function(M){return S(M,15)},r.inflateInit2=S,r.inflate=function(M,T){var k,I,D,E,N,F,G,P,O,V,j,H,Q,le,se,ae,Se,ve,$e,je,R,ie,te,B,U=0,W=new o.Buf8(4),ue=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!M||!M.state||!M.output||!M.input&&M.avail_in!==0)return h;(k=M.state).mode===12&&(k.mode=13),N=M.next_out,D=M.output,G=M.avail_out,E=M.next_in,I=M.input,F=M.avail_in,P=k.hold,O=k.bits,V=F,j=G,ie=f;e:for(;;)switch(k.mode){case p:if(k.wrap===0){k.mode=13;break}for(;O<16;){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}if(2&k.wrap&&P===35615){W[k.check=0]=255&P,W[1]=P>>>8&255,k.check=s(k.check,W,2,0),O=P=0,k.mode=2;break}if(k.flags=0,k.head&&(k.head.done=!1),!(1&k.wrap)||(((255&P)<<8)+(P>>8))%31){M.msg="incorrect header check",k.mode=30;break}if((15&P)!=8){M.msg="unknown compression method",k.mode=30;break}if(O-=4,R=8+(15&(P>>>=4)),k.wbits===0)k.wbits=R;else if(R>k.wbits){M.msg="invalid window size",k.mode=30;break}k.dmax=1<<R,M.adler=k.check=1,k.mode=512&P?10:12,O=P=0;break;case 2:for(;O<16;){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}if(k.flags=P,(255&k.flags)!=8){M.msg="unknown compression method",k.mode=30;break}if(57344&k.flags){M.msg="unknown header flags set",k.mode=30;break}k.head&&(k.head.text=P>>8&1),512&k.flags&&(W[0]=255&P,W[1]=P>>>8&255,k.check=s(k.check,W,2,0)),O=P=0,k.mode=3;case 3:for(;O<32;){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}k.head&&(k.head.time=P),512&k.flags&&(W[0]=255&P,W[1]=P>>>8&255,W[2]=P>>>16&255,W[3]=P>>>24&255,k.check=s(k.check,W,4,0)),O=P=0,k.mode=4;case 4:for(;O<16;){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}k.head&&(k.head.xflags=255&P,k.head.os=P>>8),512&k.flags&&(W[0]=255&P,W[1]=P>>>8&255,k.check=s(k.check,W,2,0)),O=P=0,k.mode=5;case 5:if(1024&k.flags){for(;O<16;){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}k.length=P,k.head&&(k.head.extra_len=P),512&k.flags&&(W[0]=255&P,W[1]=P>>>8&255,k.check=s(k.check,W,2,0)),O=P=0}else k.head&&(k.head.extra=null);k.mode=6;case 6:if(1024&k.flags&&(F<(H=k.length)&&(H=F),H&&(k.head&&(R=k.head.extra_len-k.length,k.head.extra||(k.head.extra=new Array(k.head.extra_len)),o.arraySet(k.head.extra,I,E,H,R)),512&k.flags&&(k.check=s(k.check,I,H,E)),F-=H,E+=H,k.length-=H),k.length))break e;k.length=0,k.mode=7;case 7:if(2048&k.flags){if(F===0)break e;for(H=0;R=I[E+H++],k.head&&R&&k.length<65536&&(k.head.name+=String.fromCharCode(R)),R&&H<F;);if(512&k.flags&&(k.check=s(k.check,I,H,E)),F-=H,E+=H,R)break e}else k.head&&(k.head.name=null);k.length=0,k.mode=8;case 8:if(4096&k.flags){if(F===0)break e;for(H=0;R=I[E+H++],k.head&&R&&k.length<65536&&(k.head.comment+=String.fromCharCode(R)),R&&H<F;);if(512&k.flags&&(k.check=s(k.check,I,H,E)),F-=H,E+=H,R)break e}else k.head&&(k.head.comment=null);k.mode=9;case 9:if(512&k.flags){for(;O<16;){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}if(P!==(65535&k.check)){M.msg="header crc mismatch",k.mode=30;break}O=P=0}k.head&&(k.head.hcrc=k.flags>>9&1,k.head.done=!0),M.adler=k.check=0,k.mode=12;break;case 10:for(;O<32;){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}M.adler=k.check=m(P),O=P=0,k.mode=11;case 11:if(k.havedict===0)return M.next_out=N,M.avail_out=G,M.next_in=E,M.avail_in=F,k.hold=P,k.bits=O,2;M.adler=k.check=1,k.mode=12;case 12:if(T===5||T===6)break e;case 13:if(k.last){P>>>=7&O,O-=7&O,k.mode=27;break}for(;O<3;){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}switch(k.last=1&P,O-=1,3&(P>>>=1)){case 0:k.mode=14;break;case 1:if(z(k),k.mode=20,T!==6)break;P>>>=2,O-=2;break e;case 2:k.mode=17;break;case 3:M.msg="invalid block type",k.mode=30}P>>>=2,O-=2;break;case 14:for(P>>>=7&O,O-=7&O;O<32;){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}if((65535&P)!=(P>>>16^65535)){M.msg="invalid stored block lengths",k.mode=30;break}if(k.length=65535&P,O=P=0,k.mode=15,T===6)break e;case 15:k.mode=16;case 16:if(H=k.length){if(F<H&&(H=F),G<H&&(H=G),H===0)break e;o.arraySet(D,I,E,H,N),F-=H,E+=H,G-=H,N+=H,k.length-=H;break}k.mode=12;break;case 17:for(;O<14;){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}if(k.nlen=257+(31&P),P>>>=5,O-=5,k.ndist=1+(31&P),P>>>=5,O-=5,k.ncode=4+(15&P),P>>>=4,O-=4,286<k.nlen||30<k.ndist){M.msg="too many length or distance symbols",k.mode=30;break}k.have=0,k.mode=18;case 18:for(;k.have<k.ncode;){for(;O<3;){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}k.lens[ue[k.have++]]=7&P,P>>>=3,O-=3}for(;k.have<19;)k.lens[ue[k.have++]]=0;if(k.lencode=k.lendyn,k.lenbits=7,te={bits:k.lenbits},ie=c(0,k.lens,0,19,k.lencode,0,k.work,te),k.lenbits=te.bits,ie){M.msg="invalid code lengths set",k.mode=30;break}k.have=0,k.mode=19;case 19:for(;k.have<k.nlen+k.ndist;){for(;ae=(U=k.lencode[P&(1<<k.lenbits)-1])>>>16&255,Se=65535&U,!((se=U>>>24)<=O);){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}if(Se<16)P>>>=se,O-=se,k.lens[k.have++]=Se;else{if(Se===16){for(B=se+2;O<B;){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}if(P>>>=se,O-=se,k.have===0){M.msg="invalid bit length repeat",k.mode=30;break}R=k.lens[k.have-1],H=3+(3&P),P>>>=2,O-=2}else if(Se===17){for(B=se+3;O<B;){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}O-=se,R=0,H=3+(7&(P>>>=se)),P>>>=3,O-=3}else{for(B=se+7;O<B;){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}O-=se,R=0,H=11+(127&(P>>>=se)),P>>>=7,O-=7}if(k.have+H>k.nlen+k.ndist){M.msg="invalid bit length repeat",k.mode=30;break}for(;H--;)k.lens[k.have++]=R}}if(k.mode===30)break;if(k.lens[256]===0){M.msg="invalid code -- missing end-of-block",k.mode=30;break}if(k.lenbits=9,te={bits:k.lenbits},ie=c(u,k.lens,0,k.nlen,k.lencode,0,k.work,te),k.lenbits=te.bits,ie){M.msg="invalid literal/lengths set",k.mode=30;break}if(k.distbits=6,k.distcode=k.distdyn,te={bits:k.distbits},ie=c(d,k.lens,k.nlen,k.ndist,k.distcode,0,k.work,te),k.distbits=te.bits,ie){M.msg="invalid distances set",k.mode=30;break}if(k.mode=20,T===6)break e;case 20:k.mode=21;case 21:if(6<=F&&258<=G){M.next_out=N,M.avail_out=G,M.next_in=E,M.avail_in=F,k.hold=P,k.bits=O,l(M,j),N=M.next_out,D=M.output,G=M.avail_out,E=M.next_in,I=M.input,F=M.avail_in,P=k.hold,O=k.bits,k.mode===12&&(k.back=-1);break}for(k.back=0;ae=(U=k.lencode[P&(1<<k.lenbits)-1])>>>16&255,Se=65535&U,!((se=U>>>24)<=O);){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}if(ae&&(240&ae)==0){for(ve=se,$e=ae,je=Se;ae=(U=k.lencode[je+((P&(1<<ve+$e)-1)>>ve)])>>>16&255,Se=65535&U,!(ve+(se=U>>>24)<=O);){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}P>>>=ve,O-=ve,k.back+=ve}if(P>>>=se,O-=se,k.back+=se,k.length=Se,ae===0){k.mode=26;break}if(32&ae){k.back=-1,k.mode=12;break}if(64&ae){M.msg="invalid literal/length code",k.mode=30;break}k.extra=15&ae,k.mode=22;case 22:if(k.extra){for(B=k.extra;O<B;){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}k.length+=P&(1<<k.extra)-1,P>>>=k.extra,O-=k.extra,k.back+=k.extra}k.was=k.length,k.mode=23;case 23:for(;ae=(U=k.distcode[P&(1<<k.distbits)-1])>>>16&255,Se=65535&U,!((se=U>>>24)<=O);){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}if((240&ae)==0){for(ve=se,$e=ae,je=Se;ae=(U=k.distcode[je+((P&(1<<ve+$e)-1)>>ve)])>>>16&255,Se=65535&U,!(ve+(se=U>>>24)<=O);){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}P>>>=ve,O-=ve,k.back+=ve}if(P>>>=se,O-=se,k.back+=se,64&ae){M.msg="invalid distance code",k.mode=30;break}k.offset=Se,k.extra=15&ae,k.mode=24;case 24:if(k.extra){for(B=k.extra;O<B;){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}k.offset+=P&(1<<k.extra)-1,P>>>=k.extra,O-=k.extra,k.back+=k.extra}if(k.offset>k.dmax){M.msg="invalid distance too far back",k.mode=30;break}k.mode=25;case 25:if(G===0)break e;if(H=j-G,k.offset>H){if((H=k.offset-H)>k.whave&&k.sane){M.msg="invalid distance too far back",k.mode=30;break}Q=H>k.wnext?(H-=k.wnext,k.wsize-H):k.wnext-H,H>k.length&&(H=k.length),le=k.window}else le=D,Q=N-k.offset,H=k.length;for(G<H&&(H=G),G-=H,k.length-=H;D[N++]=le[Q++],--H;);k.length===0&&(k.mode=21);break;case 26:if(G===0)break e;D[N++]=k.length,G--,k.mode=21;break;case 27:if(k.wrap){for(;O<32;){if(F===0)break e;F--,P|=I[E++]<<O,O+=8}if(j-=G,M.total_out+=j,k.total+=j,j&&(M.adler=k.check=k.flags?s(k.check,D,j,N-j):a(k.check,D,j,N-j)),j=G,(k.flags?P:m(P))!==k.check){M.msg="incorrect data check",k.mode=30;break}O=P=0}k.mode=28;case 28:if(k.wrap&&k.flags){for(;O<32;){if(F===0)break e;F--,P+=I[E++]<<O,O+=8}if(P!==(4294967295&k.total)){M.msg="incorrect length check",k.mode=30;break}O=P=0}k.mode=29;case 29:ie=1;break e;case 30:ie=-3;break e;case 31:return-4;case 32:default:return h}return M.next_out=N,M.avail_out=G,M.next_in=E,M.avail_in=F,k.hold=P,k.bits=O,(k.wsize||j!==M.avail_out&&k.mode<30&&(k.mode<27||T!==4))&&A(M,M.output,M.next_out,j-M.avail_out)?(k.mode=31,-4):(V-=M.avail_in,j-=M.avail_out,M.total_in+=V,M.total_out+=j,k.total+=j,k.wrap&&j&&(M.adler=k.check=k.flags?s(k.check,D,j,M.next_out-j):a(k.check,D,j,M.next_out-j)),M.data_type=k.bits+(k.last?64:0)+(k.mode===12?128:0)+(k.mode===20||k.mode===15?256:0),(V==0&&j===0||T===4)&&ie===f&&(ie=-5),ie)},r.inflateEnd=function(M){if(!M||!M.state)return h;var T=M.state;return T.window&&(T.window=null),M.state=null,f},r.inflateGetHeader=function(M,T){var k;return M&&M.state?(2&(k=M.state).wrap)==0?h:((k.head=T).done=!1,f):h},r.inflateSetDictionary=function(M,T){var k,I=T.length;return M&&M.state?(k=M.state).wrap!==0&&k.mode!==11?h:k.mode===11&&a(1,T,I,0)!==k.check?-3:A(M,T,I,I)?(k.mode=31,-4):(k.havedict=1,f):h},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,i,r){var o=n("../utils/common"),a=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],s=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];i.exports=function(u,d,f,h,p,g,v,m){var y,b,x,_,S,$,C,w,z,A=m.bits,M=0,T=0,k=0,I=0,D=0,E=0,N=0,F=0,G=0,P=0,O=null,V=0,j=new o.Buf16(16),H=new o.Buf16(16),Q=null,le=0;for(M=0;M<=15;M++)j[M]=0;for(T=0;T<h;T++)j[d[f+T]]++;for(D=A,I=15;1<=I&&j[I]===0;I--);if(I<D&&(D=I),I===0)return p[g++]=20971520,p[g++]=20971520,m.bits=1,0;for(k=1;k<I&&j[k]===0;k++);for(D<k&&(D=k),M=F=1;M<=15;M++)if(F<<=1,(F-=j[M])<0)return-1;if(0<F&&(u===0||I!==1))return-1;for(H[1]=0,M=1;M<15;M++)H[M+1]=H[M]+j[M];for(T=0;T<h;T++)d[f+T]!==0&&(v[H[d[f+T]]++]=T);if($=u===0?(O=Q=v,19):u===1?(O=a,V-=257,Q=s,le-=257,256):(O=l,Q=c,-1),M=k,S=g,N=T=P=0,x=-1,_=(G=1<<(E=D))-1,u===1&&852<G||u===2&&592<G)return 1;for(;;){for(C=M-N,z=v[T]<$?(w=0,v[T]):v[T]>$?(w=Q[le+v[T]],O[V+v[T]]):(w=96,0),y=1<<M-N,k=b=1<<E;p[S+(P>>N)+(b-=y)]=C<<24|w<<16|z|0,b!==0;);for(y=1<<M-1;P&y;)y>>=1;if(y!==0?(P&=y-1,P+=y):P=0,T++,--j[M]==0){if(M===I)break;M=d[f+v[T]]}if(D<M&&(P&_)!==x){for(N===0&&(N=D),S+=k,F=1<<(E=M-N);E+N<I&&!((F-=j[E+N])<=0);)E++,F<<=1;if(G+=1<<E,u===1&&852<G||u===2&&592<G)return 1;p[x=P&_]=D<<24|E<<16|S-g|0}}return P!==0&&(p[S+P]=M-N<<24|64<<16|0),m.bits=D,0}},{"../utils/common":41}],51:[function(n,i,r){i.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(n,i,r){var o=n("../utils/common"),a=0,s=1;function l(U){for(var W=U.length;0<=--W;)U[W]=0}var c=0,u=29,d=256,f=d+1+u,h=30,p=19,g=2*f+1,v=15,m=16,y=7,b=256,x=16,_=17,S=18,$=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],C=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],w=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],A=new Array(2*(f+2));l(A);var M=new Array(2*h);l(M);var T=new Array(512);l(T);var k=new Array(256);l(k);var I=new Array(u);l(I);var D,E,N,F=new Array(h);function G(U,W,ue,de,J){this.static_tree=U,this.extra_bits=W,this.extra_base=ue,this.elems=de,this.max_length=J,this.has_stree=U&&U.length}function P(U,W){this.dyn_tree=U,this.max_code=0,this.stat_desc=W}function O(U){return U<256?T[U]:T[256+(U>>>7)]}function V(U,W){U.pending_buf[U.pending++]=255&W,U.pending_buf[U.pending++]=W>>>8&255}function j(U,W,ue){U.bi_valid>m-ue?(U.bi_buf|=W<<U.bi_valid&65535,V(U,U.bi_buf),U.bi_buf=W>>m-U.bi_valid,U.bi_valid+=ue-m):(U.bi_buf|=W<<U.bi_valid&65535,U.bi_valid+=ue)}function H(U,W,ue){j(U,ue[2*W],ue[2*W+1])}function Q(U,W){for(var ue=0;ue|=1&U,U>>>=1,ue<<=1,0<--W;);return ue>>>1}function le(U,W,ue){var de,J,ge=new Array(v+1),we=0;for(de=1;de<=v;de++)ge[de]=we=we+ue[de-1]<<1;for(J=0;J<=W;J++){var X=U[2*J+1];X!==0&&(U[2*J]=Q(ge[X]++,X))}}function se(U){var W;for(W=0;W<f;W++)U.dyn_ltree[2*W]=0;for(W=0;W<h;W++)U.dyn_dtree[2*W]=0;for(W=0;W<p;W++)U.bl_tree[2*W]=0;U.dyn_ltree[2*b]=1,U.opt_len=U.static_len=0,U.last_lit=U.matches=0}function ae(U){8<U.bi_valid?V(U,U.bi_buf):0<U.bi_valid&&(U.pending_buf[U.pending++]=U.bi_buf),U.bi_buf=0,U.bi_valid=0}function Se(U,W,ue,de){var J=2*W,ge=2*ue;return U[J]<U[ge]||U[J]===U[ge]&&de[W]<=de[ue]}function ve(U,W,ue){for(var de=U.heap[ue],J=ue<<1;J<=U.heap_len&&(J<U.heap_len&&Se(W,U.heap[J+1],U.heap[J],U.depth)&&J++,!Se(W,de,U.heap[J],U.depth));)U.heap[ue]=U.heap[J],ue=J,J<<=1;U.heap[ue]=de}function $e(U,W,ue){var de,J,ge,we,X=0;if(U.last_lit!==0)for(;de=U.pending_buf[U.d_buf+2*X]<<8|U.pending_buf[U.d_buf+2*X+1],J=U.pending_buf[U.l_buf+X],X++,de===0?H(U,J,W):(H(U,(ge=k[J])+d+1,W),(we=$[ge])!==0&&j(U,J-=I[ge],we),H(U,ge=O(--de),ue),(we=C[ge])!==0&&j(U,de-=F[ge],we)),X<U.last_lit;);H(U,b,W)}function je(U,W){var ue,de,J,ge=W.dyn_tree,we=W.stat_desc.static_tree,X=W.stat_desc.has_stree,K=W.stat_desc.elems,Ce=-1;for(U.heap_len=0,U.heap_max=g,ue=0;ue<K;ue++)ge[2*ue]!==0?(U.heap[++U.heap_len]=Ce=ue,U.depth[ue]=0):ge[2*ue+1]=0;for(;U.heap_len<2;)ge[2*(J=U.heap[++U.heap_len]=Ce<2?++Ce:0)]=1,U.depth[J]=0,U.opt_len--,X&&(U.static_len-=we[2*J+1]);for(W.max_code=Ce,ue=U.heap_len>>1;1<=ue;ue--)ve(U,ge,ue);for(J=K;ue=U.heap[1],U.heap[1]=U.heap[U.heap_len--],ve(U,ge,1),de=U.heap[1],U.heap[--U.heap_max]=ue,U.heap[--U.heap_max]=de,ge[2*J]=ge[2*ue]+ge[2*de],U.depth[J]=(U.depth[ue]>=U.depth[de]?U.depth[ue]:U.depth[de])+1,ge[2*ue+1]=ge[2*de+1]=J,U.heap[1]=J++,ve(U,ge,1),2<=U.heap_len;);U.heap[--U.heap_max]=U.heap[1],(function(ye,Qe){var mt,et,Le,Oe,ot,$t,Bt=Qe.dyn_tree,sn=Qe.max_code,ct=Qe.stat_desc.static_tree,pn=Qe.stat_desc.has_stree,zn=Qe.stat_desc.extra_bits,Ge=Qe.stat_desc.extra_base,Xe=Qe.stat_desc.max_length,ht=0;for(Oe=0;Oe<=v;Oe++)ye.bl_count[Oe]=0;for(Bt[2*ye.heap[ye.heap_max]+1]=0,mt=ye.heap_max+1;mt<g;mt++)Xe<(Oe=Bt[2*Bt[2*(et=ye.heap[mt])+1]+1]+1)&&(Oe=Xe,ht++),Bt[2*et+1]=Oe,sn<et||(ye.bl_count[Oe]++,ot=0,Ge<=et&&(ot=zn[et-Ge]),$t=Bt[2*et],ye.opt_len+=$t*(Oe+ot),pn&&(ye.static_len+=$t*(ct[2*et+1]+ot)));if(ht!==0){do{for(Oe=Xe-1;ye.bl_count[Oe]===0;)Oe--;ye.bl_count[Oe]--,ye.bl_count[Oe+1]+=2,ye.bl_count[Xe]--,ht-=2}while(0<ht);for(Oe=Xe;Oe!==0;Oe--)for(et=ye.bl_count[Oe];et!==0;)sn<(Le=ye.heap[--mt])||(Bt[2*Le+1]!==Oe&&(ye.opt_len+=(Oe-Bt[2*Le+1])*Bt[2*Le],Bt[2*Le+1]=Oe),et--)}})(U,W),le(ge,Ce,U.bl_count)}function R(U,W,ue){var de,J,ge=-1,we=W[1],X=0,K=7,Ce=4;for(we===0&&(K=138,Ce=3),W[2*(ue+1)+1]=65535,de=0;de<=ue;de++)J=we,we=W[2*(de+1)+1],++X<K&&J===we||(X<Ce?U.bl_tree[2*J]+=X:J!==0?(J!==ge&&U.bl_tree[2*J]++,U.bl_tree[2*x]++):X<=10?U.bl_tree[2*_]++:U.bl_tree[2*S]++,ge=J,Ce=(X=0)===we?(K=138,3):J===we?(K=6,3):(K=7,4))}function ie(U,W,ue){var de,J,ge=-1,we=W[1],X=0,K=7,Ce=4;for(we===0&&(K=138,Ce=3),de=0;de<=ue;de++)if(J=we,we=W[2*(de+1)+1],!(++X<K&&J===we)){if(X<Ce)for(;H(U,J,U.bl_tree),--X!=0;);else J!==0?(J!==ge&&(H(U,J,U.bl_tree),X--),H(U,x,U.bl_tree),j(U,X-3,2)):X<=10?(H(U,_,U.bl_tree),j(U,X-3,3)):(H(U,S,U.bl_tree),j(U,X-11,7));ge=J,Ce=(X=0)===we?(K=138,3):J===we?(K=6,3):(K=7,4)}}l(F);var te=!1;function B(U,W,ue,de){j(U,(c<<1)+(de?1:0),3),(function(J,ge,we,X){ae(J),V(J,we),V(J,~we),o.arraySet(J.pending_buf,J.window,ge,we,J.pending),J.pending+=we})(U,W,ue)}r._tr_init=function(U){te||((function(){var W,ue,de,J,ge,we=new Array(v+1);for(J=de=0;J<u-1;J++)for(I[J]=de,W=0;W<1<<$[J];W++)k[de++]=J;for(k[de-1]=J,J=ge=0;J<16;J++)for(F[J]=ge,W=0;W<1<<C[J];W++)T[ge++]=J;for(ge>>=7;J<h;J++)for(F[J]=ge<<7,W=0;W<1<<C[J]-7;W++)T[256+ge++]=J;for(ue=0;ue<=v;ue++)we[ue]=0;for(W=0;W<=143;)A[2*W+1]=8,W++,we[8]++;for(;W<=255;)A[2*W+1]=9,W++,we[9]++;for(;W<=279;)A[2*W+1]=7,W++,we[7]++;for(;W<=287;)A[2*W+1]=8,W++,we[8]++;for(le(A,f+1,we),W=0;W<h;W++)M[2*W+1]=5,M[2*W]=Q(W,5);D=new G(A,$,d+1,f,v),E=new G(M,C,0,h,v),N=new G(new Array(0),w,0,p,y)})(),te=!0),U.l_desc=new P(U.dyn_ltree,D),U.d_desc=new P(U.dyn_dtree,E),U.bl_desc=new P(U.bl_tree,N),U.bi_buf=0,U.bi_valid=0,se(U)},r._tr_stored_block=B,r._tr_flush_block=function(U,W,ue,de){var J,ge,we=0;0<U.level?(U.strm.data_type===2&&(U.strm.data_type=(function(X){var K,Ce=4093624447;for(K=0;K<=31;K++,Ce>>>=1)if(1&Ce&&X.dyn_ltree[2*K]!==0)return a;if(X.dyn_ltree[18]!==0||X.dyn_ltree[20]!==0||X.dyn_ltree[26]!==0)return s;for(K=32;K<d;K++)if(X.dyn_ltree[2*K]!==0)return s;return a})(U)),je(U,U.l_desc),je(U,U.d_desc),we=(function(X){var K;for(R(X,X.dyn_ltree,X.l_desc.max_code),R(X,X.dyn_dtree,X.d_desc.max_code),je(X,X.bl_desc),K=p-1;3<=K&&X.bl_tree[2*z[K]+1]===0;K--);return X.opt_len+=3*(K+1)+5+5+4,K})(U),J=U.opt_len+3+7>>>3,(ge=U.static_len+3+7>>>3)<=J&&(J=ge)):J=ge=ue+5,ue+4<=J&&W!==-1?B(U,W,ue,de):U.strategy===4||ge===J?(j(U,2+(de?1:0),3),$e(U,A,M)):(j(U,4+(de?1:0),3),(function(X,K,Ce,ye){var Qe;for(j(X,K-257,5),j(X,Ce-1,5),j(X,ye-4,4),Qe=0;Qe<ye;Qe++)j(X,X.bl_tree[2*z[Qe]+1],3);ie(X,X.dyn_ltree,K-1),ie(X,X.dyn_dtree,Ce-1)})(U,U.l_desc.max_code+1,U.d_desc.max_code+1,we+1),$e(U,U.dyn_ltree,U.dyn_dtree)),se(U),de&&ae(U)},r._tr_tally=function(U,W,ue){return U.pending_buf[U.d_buf+2*U.last_lit]=W>>>8&255,U.pending_buf[U.d_buf+2*U.last_lit+1]=255&W,U.pending_buf[U.l_buf+U.last_lit]=255&ue,U.last_lit++,W===0?U.dyn_ltree[2*ue]++:(U.matches++,W--,U.dyn_ltree[2*(k[ue]+d+1)]++,U.dyn_dtree[2*O(W)]++),U.last_lit===U.lit_bufsize-1},r._tr_align=function(U){j(U,2,3),H(U,b,A),(function(W){W.bi_valid===16?(V(W,W.bi_buf),W.bi_buf=0,W.bi_valid=0):8<=W.bi_valid&&(W.pending_buf[W.pending++]=255&W.bi_buf,W.bi_buf>>=8,W.bi_valid-=8)})(U)}},{"../utils/common":41}],53:[function(n,i,r){i.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(n,i,r){(function(o){(function(a,s){if(!a.setImmediate){var l,c,u,d,f=1,h={},p=!1,g=a.document,v=Object.getPrototypeOf&&Object.getPrototypeOf(a);v=v&&v.setTimeout?v:a,l={}.toString.call(a.process)==="[object process]"?function(x){process.nextTick(function(){y(x)})}:(function(){if(a.postMessage&&!a.importScripts){var x=!0,_=a.onmessage;return a.onmessage=function(){x=!1},a.postMessage("","*"),a.onmessage=_,x}})()?(d="setImmediate$"+Math.random()+"$",a.addEventListener?a.addEventListener("message",b,!1):a.attachEvent("onmessage",b),function(x){a.postMessage(d+x,"*")}):a.MessageChannel?((u=new MessageChannel).port1.onmessage=function(x){y(x.data)},function(x){u.port2.postMessage(x)}):g&&"onreadystatechange"in g.createElement("script")?(c=g.documentElement,function(x){var _=g.createElement("script");_.onreadystatechange=function(){y(x),_.onreadystatechange=null,c.removeChild(_),_=null},c.appendChild(_)}):function(x){setTimeout(y,0,x)},v.setImmediate=function(x){typeof x!="function"&&(x=new Function(""+x));for(var _=new Array(arguments.length-1),S=0;S<_.length;S++)_[S]=arguments[S+1];var $={callback:x,args:_};return h[f]=$,l(f),f++},v.clearImmediate=m}function m(x){delete h[x]}function y(x){if(p)setTimeout(y,0,x);else{var _=h[x];if(_){p=!0;try{(function(S){var $=S.callback,C=S.args;switch(C.length){case 0:$();break;case 1:$(C[0]);break;case 2:$(C[0],C[1]);break;case 3:$(C[0],C[1],C[2]);break;default:$.apply(s,C)}})(_)}finally{m(x),p=!1}}}}function b(x){x.source===a&&typeof x.data=="string"&&x.data.indexOf(d)===0&&y(+x.data.slice(d.length))}})(typeof self>"u"?o===void 0?this:o:self)}).call(this,typeof yw<"u"?yw:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(uZ)),uZ.exports}var Jfe=Kfe(),Qfe=Xfe(Jfe);function epe(e){var t;let n=((t=e.split(".").pop())==null?void 0:t.toLowerCase())||"";return{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",svg:"image/svg+xml",bmp:"image/bmp",tiff:"image/tiff",tif:"image/tiff",emf:"image/x-emf",wmf:"image/x-wmf",webp:"image/webp",mp4:"video/mp4",m4v:"video/mp4",webm:"video/webm",avi:"video/x-msvideo",mp3:"audio/mpeg",wav:"audio/wav",m4a:"audio/mp4",ogg:"audio/ogg"}[n]||"application/octet-stream"}function tpe(e){let t=e.search(/[?#]/);return t>=0?e.slice(0,t):e}function npe(e){let t=[];for(let n of e.replace(/\\/g,"/").split("/"))if(!(!n||n===".")){if(n===".."){t.pop();continue}t.push(n)}return t}function ipe(e){try{return decodeURIComponent(e)}catch{return e}}function LX(e){let t=npe(tpe(e)),n=t.lastIndexOf("media");return(n>=0&&n<t.length-1?t.slice(n+1):t.slice(-1)).join("/")}function EX(e){return`ppt/media/${LX(e).split("/").map(ipe).join("/")}`}function rN(e){let t=LX(e),n=EX(e),i=`ppt/media/${t}`;return n===i?[n]:[n,i]}function Hm(e,t){for(let n of rN(e)){let i=t.get(n);if(i)return{mediaPath:n,data:i}}}async function W5(e,t,n){return Hm(e,t)||n?.resolve(e)}function kh(e,t,n){let i=n.get(e);if(!i){let r=epe(e),o=new Blob([t],{type:r});i=URL.createObjectURL(o),n.set(e,i)}return i}var DX=Object.freeze({maxEntries:4e3,maxEntryUncompressedBytes:32*1024*1024,maxTotalUncompressedBytes:256*1024*1024,maxMediaBytes:192*1024*1024,maxConcurrency:8});function du(e){throw new Error(`PPTX zip limit exceeded: ${e}`)}function oN(e){return e.startsWith("ppt/media/")}function rpe(e){return e.split("/").map(t=>{try{return decodeURIComponent(t)}catch{return t}}).join("/")}function fr(e,t,n){e.set(t,n);let i=rpe(t);i!==t&&!e.has(i)&&e.set(i,n)}function ope(e){let t=e._data,n=t?.uncompressedSize;return typeof n=="number"&&Number.isFinite(n)?n:void 0}function ape(e){return new TextEncoder().encode(e).byteLength}var aN=class{constructor(t,n,i,r){this.entries=t,this.media=n,this.state=i,this.totalBytes=r,this.inflight=new Map,this.loadedPaths=new Set,this.totalCount=new Set(Array.from(t.values(),o=>o.path)).size}get loadedBytes(){var t;let n=0;for(let i of this.loadedPaths)n+=((t=this.media.get(i))==null?void 0:t.byteLength)??0;return n}get loadedCount(){return this.loadedPaths.size}async resolve(t){for(let n of rN(t)){let i=this.media.get(n);if(i)return{mediaPath:n,data:i}}for(let n of rN(t)){let i=this.entries.get(n);if(!i)continue;let r=await this.readEntry(i);return{mediaPath:n,data:r}}}async readEntry(t){let n=this.inflight.get(t.path);n||(n=OX(t.path,t.file,this.state).then(i=>(fr(this.media,t.path,i),this.loadedPaths.add(t.path),i)),this.inflight.set(t.path,n));try{return await n}finally{this.inflight.delete(t.path)}}};function Y5(e,t,n){if(n.limits.maxEntryUncompressedBytes!==void 0&&t>n.limits.maxEntryUncompressedBytes&&du(`${e} is ${t} bytes > maxEntryUncompressedBytes ${n.limits.maxEntryUncompressedBytes}`),n.knownSizeByPath.has(e))return;n.unknownTotalBytes+=t;let i=n.knownTotalBytes+n.unknownTotalBytes;if(n.limits.maxTotalUncompressedBytes!==void 0&&i>n.limits.maxTotalUncompressedBytes&&du(`total uncompressed bytes ${i} > maxTotalUncompressedBytes ${n.limits.maxTotalUncompressedBytes}`),oN(e)){n.unknownMediaBytes+=t;let r=n.knownMediaBytes+n.unknownMediaBytes;n.limits.maxMediaBytes!==void 0&&r>n.limits.maxMediaBytes&&du(`media bytes ${r} > maxMediaBytes ${n.limits.maxMediaBytes}`)}}async function tr(e,t,n){let i=await t.async("string");return Y5(e,ape(i),n),i}async function OX(e,t,n){let i=await t.async("uint8array");return Y5(e,i.byteLength,n),i}async function spe(e,t,n){if(n.knownSizeByPath.has(e)||n.limits.maxEntryUncompressedBytes===void 0&&n.limits.maxTotalUncompressedBytes===void 0)return;let i=await t.async("uint8array");Y5(e,i.byteLength,n)}async function lpe(e,t,n){if(e.length===0)return;let i=Math.min(t,e.length),r=0,o=Array.from({length:i},async()=>{for(;;){let a=r++;if(a>=e.length)return;await n(e[a])}});await Promise.all(o)}async function NX(e,t={}){return cpe(e,t,{lazyMedia:!0})}async function cpe(e,t,n){let i=t.maxConcurrency??8;(!Number.isInteger(i)||i<1)&&du(`maxConcurrency ${t.maxConcurrency} must be an integer >= 1`);let r=await Qfe.loadAsync(e),o=Object.entries(r.files).filter(([,f])=>!f.dir);t.maxEntries!==void 0&&o.length>t.maxEntries&&du(`entries ${o.length} > maxEntries ${t.maxEntries}`);let a=new Map,s=0,l=0;for(let[f,h]of o){let p=f.replace(/\\/g,"/"),g=ope(h);g!==void 0&&(a.set(p,g),t.maxEntryUncompressedBytes!==void 0&&g>t.maxEntryUncompressedBytes&&du(`${p} is ${g} bytes > maxEntryUncompressedBytes ${t.maxEntryUncompressedBytes}`),s+=g,t.maxTotalUncompressedBytes!==void 0&&s>t.maxTotalUncompressedBytes&&du(`total uncompressed bytes ${s} > maxTotalUncompressedBytes ${t.maxTotalUncompressedBytes}`),oN(p)&&(l+=g,t.maxMediaBytes!==void 0&&l>t.maxMediaBytes&&du(`media bytes ${l} > maxMediaBytes ${t.maxMediaBytes}`)))}let c={contentTypes:"",presentation:"",presentationRels:"",slides:new Map,slideRels:new Map,slideLayouts:new Map,slideLayoutRels:new Map,slideMasters:new Map,slideMasterRels:new Map,themes:new Map,themeOverrides:new Map,media:new Map,charts:new Map,chartRels:new Map,chartStyles:new Map,chartColors:new Map,diagramDrawings:new Map},u={limits:t,knownSizeByPath:a,knownTotalBytes:s,knownMediaBytes:l,unknownTotalBytes:0,unknownMediaBytes:0},d=new Map;return await lpe(o,i,async([f,h])=>{let p=f.replace(/\\/g,"/");if(p==="[Content_Types].xml"){c.contentTypes=await tr(p,h,u);return}if(p==="ppt/presentation.xml"){c.presentation=await tr(p,h,u);return}if(p==="ppt/_rels/presentation.xml.rels"){c.presentationRels=await tr(p,h,u);return}if(p==="ppt/tableStyles.xml"){c.tableStyles=await tr(p,h,u);return}if(oN(p)){if(n.lazyMedia){fr(d,p,{path:p,file:h});return}let g=await OX(p,h,u);fr(c.media,p,g);return}if(/^ppt\/slides\/_rels\/[^/]+\.xml\.rels$/.test(p)){fr(c.slideRels,p,await tr(p,h,u));return}if(/^ppt\/slides\/[^/]+\.xml$/.test(p)){fr(c.slides,p,await tr(p,h,u));return}if(/^ppt\/slideLayouts\/_rels\/[^/]+\.xml\.rels$/.test(p)){fr(c.slideLayoutRels,p,await tr(p,h,u));return}if(/^ppt\/slideLayouts\/[^/]+\.xml$/.test(p)){fr(c.slideLayouts,p,await tr(p,h,u));return}if(/^ppt\/slideMasters\/_rels\/[^/]+\.xml\.rels$/.test(p)){fr(c.slideMasterRels,p,await tr(p,h,u));return}if(/^ppt\/slideMasters\/[^/]+\.xml$/.test(p)){fr(c.slideMasters,p,await tr(p,h,u));return}if(/^ppt\/theme\/(?!themeOverride[^/]*\.xml$)[^/]+\.xml$/.test(p)){fr(c.themes,p,await tr(p,h,u));return}if(/^ppt\/theme\/themeOverride[^/]*\.xml$/.test(p)){c.themeOverrides&&fr(c.themeOverrides,p,await tr(p,h,u));return}if(/^ppt\/charts\/_rels\/[^/]+\.xml\.rels$/.test(p)){c.chartRels&&fr(c.chartRels,p,await tr(p,h,u));return}if(/^ppt\/charts\/(?!style[^/]*\.xml$)(?!colors[^/]*\.xml$)[^/]+\.xml$/.test(p)){fr(c.charts,p,await tr(p,h,u));return}if(/^ppt\/charts\/style[^/]*\.xml$/.test(p)){fr(c.chartStyles,p,await tr(p,h,u));return}if(/^ppt\/charts\/colors[^/]*\.xml$/.test(p)){fr(c.chartColors,p,await tr(p,h,u));return}if(/^ppt\/diagrams\/[^/]+\.xml$/.test(p)){fr(c.diagramDrawings,p,await tr(p,h,u));return}await spe(p,h,u)}),n.lazyMedia&&(c.mediaResolver=new aN(d,c.media,u,l)),c}var jl=class e{constructor(t){this.el=t}attr(t){if(!this.el)return;if(this.el.hasAttribute(t))return this.el.getAttribute(t);let n=t.indexOf(":"),i=n>=0?t.slice(n+1):t,r=n>=0?this.resolveAttributeNamespace(t.slice(0,n)):void 0;for(let o=0;o<this.el.attributes.length;o++){let a=this.el.attributes[o];if(a.localName===i&&(n<0||(r?a.namespaceURI===r:a.namespaceURI!==null)))return a.value}}resolveAttributeNamespace(t){var n;return((n=this.el)==null?void 0:n.lookupNamespaceURI(t))??(t==="r"?"http://schemas.openxmlformats.org/officeDocument/2006/relationships":void 0)}numAttr(t){let n=this.attr(t);if(n===void 0)return;let i=Number(n);return Number.isNaN(i)?void 0:i}child(t){if(!this.el)return new e(null);let n=this.el.children;for(let i=0;i<n.length;i++)if(n[i].localName===t)return new e(n[i]);return new e(null)}children(t){if(!this.el)return[];let n=[],i=this.el.children;for(let r=0;r<i.length;r++)(t===void 0||i[r].localName===t)&&n.push(new e(i[r]));return n}text(){return this.el?this.el.textContent??"":""}exists(){return this.el!==null}allChildren(){return this.children()}get localName(){var t;return((t=this.el)==null?void 0:t.localName)??""}get element(){return this.el}};function Kr(e){let t=new DOMParser().parseFromString(e,"application/xml"),n=t.querySelector("parsererror");return n?(console.warn("XML parse error:",n.textContent),new jl(null)):new jl(t.documentElement)}function Rs(e){return e?.trim().toLowerCase()==="external"}function upe(e){let t=e.search(/[?#]/);return t>=0?e.slice(0,t):e}function hZ(e){try{return decodeURIComponent(e)}catch{return e}}function lb(e){let t=new Map;if(!e)return t;let n=Kr(e);if(!n.exists())return t;let i=n.children("Relationship");for(let r of i){let o=r.attr("Id"),a=r.attr("Type"),s=r.attr("Target"),l=r.attr("TargetMode");o&&a!==void 0&&s!==void 0&&t.set(o,{type:a,target:s,targetMode:l})}return t}function Ia(e,t){let n=upe(t);if(n.startsWith("/"))return n.slice(1).replace(/\\/g,"/").split("/").map(hZ).join("/");let i=e.replace(/\\/g,"/").split("/").filter(Boolean),r=n.replace(/\\/g,"/").split("/").filter(Boolean).map(hZ),o=[...i];for(let a of r)a===".."?o.pop():a!=="."&&o.push(a);return o.join("/")}function De(e){return e/914400*96}function Zm(e){return e/6e4}function W2(e){return e/1e5}function dpe(e){return e*96/72}var hpe=["dk1","dk2","lt1","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"];function fpe(e){let t=e.child("srgbClr");if(t.exists())return t.attr("val");let n=e.child("sysClr");if(n.exists())return n.attr("lastClr")??n.attr("val")}function fZ(e){let t={};for(let i of e.children("font")){let r=i.attr("script"),o=i.attr("typeface");r&&o&&(t[r]=o)}let n={latin:e.child("latin").attr("typeface")??"",ea:e.child("ea").attr("typeface")??"",cs:e.child("cs").attr("typeface")??""};return Object.keys(t).length>0&&(n.scripts=t),n}function pZ(e){let t=e.child("themeElements"),n=t.exists()?t:e,i=n.child("clrScheme"),r=new Map;for(let h of hpe){let p=i.child(h);if(p.exists()){let g=fpe(p);g!==void 0&&r.set(h,g)}}let o=n.child("fontScheme"),a=fZ(o.child("majorFont")),s=fZ(o.child("minorFont")),l=n.child("fmtScheme"),c=l.child("fillStyleLst").allChildren(),u=l.child("bgFillStyleLst").allChildren(),d=l.child("lnStyleLst").allChildren(),f=l.child("effectStyleLst").allChildren();return{colorScheme:r,majorFont:a,minorFont:s,fillStyles:c,bgFillStyles:u,lineStyles:d,effectStyles:f}}function ppe(e){for(let t of["nvSpPr","nvPicPr","nvGraphicFramePr","nvCxnSpPr"]){let n=e.child(t);if(n.exists()&&n.child("nvPr").child("ph").exists())return!0}return!1}function mpe(e){let t=e.child("spPr").child("xfrm"),n=t.exists()?t:e.child("xfrm");if(!n.exists())return null;let i=n.child("off"),r=n.child("ext"),o=i.numAttr("x")??0,a=i.numAttr("y")??0,s=r.numAttr("cx")??0,l=r.numAttr("cy")??0;return{offX:o,offY:a,cx:s,cy:l}}function gpe(e){let t=e.child("grpSpPr");if(!t.exists())return null;let n=t.child("xfrm");if(!n.exists())return null;let i=n.child("off"),r=n.child("ext"),o=n.child("chOff"),a=n.child("chExt"),s=i.numAttr("x")??0,l=i.numAttr("y")??0,c=r.numAttr("cx")??0,u=r.numAttr("cy")??0,d=o.exists()?o.numAttr("x")??0:0,f=o.exists()?o.numAttr("y")??0:0,h=a.exists()?a.numAttr("cx")??c:c,p=a.exists()?a.numAttr("cy")??u:u;return{offX:s,offY:l,cx:c,cy:u,chOffX:d,chOffY:f,chExtCx:h>0?h:1,chExtCy:p>0?p:1}}function sN(e,t){let n=[];for(let i of e.allChildren()){if(i.localName==="grpSp"){let o=gpe(i);if(o&&o.chExtCx>0&&o.chExtCy>0){let a=o.cx/o.chExtCx,s=o.cy/o.chExtCy,l=o.offX-o.chOffX*a,c=o.offY-o.chOffY*s,u=t?{offX:t.offX+l*t.scaleX,offY:t.offY+c*t.scaleY,scaleX:t.scaleX*a,scaleY:t.scaleY*s}:{offX:l,offY:c,scaleX:a,scaleY:s};n.push(...sN(i,u))}else n.push(...sN(i,t));continue}if(!ppe(i))continue;let r=mpe(i);if(!r){n.push({node:i});continue}if(t){let o=t.offX+r.offX*t.scaleX,a=t.offY+r.offY*t.scaleY,s=r.cx*t.scaleX,l=r.cy*t.scaleY;n.push({node:i,absoluteXfrm:{position:{x:De(o),y:De(a)},size:{w:De(s),h:De(l)}}})}else n.push({node:i,absoluteXfrm:{position:{x:De(r.offX),y:De(r.offY)},size:{w:De(r.cx),h:De(r.cy)}}})}return n}function vpe(e){let t=new Map,n=e.element;if(!n)return t;let i=n.attributes;for(let r=0;r<i.length;r++){let o=i[r];t.set(o.localName,o.value)}return t}function ype(e){let t=e.child("cSld"),n=t.child("bg"),i=n.exists()?n:void 0,r=t.child("spTree"),o=e.child("clrMap"),a=vpe(o),s=e.child("txStyles"),l=s.child("titleStyle"),c=s.child("bodyStyle"),u=s.child("otherStyle"),d=e.child("defaultTextStyle"),f=sN(r,null),h=f.map(p=>p.node);return{colorMap:a,background:i,textStyles:{titleStyle:l.exists()?l:void 0,bodyStyle:c.exists()?c:void 0,otherStyle:u.exists()?u:void 0},defaultTextStyle:d.exists()?d:void 0,placeholders:h,placeholderEntries:f,spTree:r,rels:new Map}}var bpe=new Set(["1","true","t","on"]),xpe=new Set(["0","false","f","off"]);function yr(e,t=!1){if(e===void 0)return t;let n=e.trim().toLowerCase();return bpe.has(n)?!0:xpe.has(n)?!1:t}function _pe(e){return yr(e,!0)}function Spe(e){for(let t of["nvSpPr","nvPicPr","nvGraphicFramePr","nvCxnSpPr"]){let n=e.child(t);if(n.exists()&&n.child("nvPr").child("ph").exists())return!0}return!1}function $pe(e){let t=e.child("spPr").child("xfrm"),n=t.exists()?t:e.child("xfrm");if(!n.exists())return null;let i=n.child("off"),r=n.child("ext"),o=i.numAttr("x")??0,a=i.numAttr("y")??0,s=r.numAttr("cx")??0,l=r.numAttr("cy")??0;return{offX:o,offY:a,cx:s,cy:l}}function wpe(e){let t=e.child("grpSpPr");if(!t.exists())return null;let n=t.child("xfrm");if(!n.exists())return null;let i=n.child("off"),r=n.child("ext"),o=n.child("chOff"),a=n.child("chExt"),s=i.numAttr("x")??0,l=i.numAttr("y")??0,c=r.numAttr("cx")??0,u=r.numAttr("cy")??0,d=o.exists()?o.numAttr("x")??0:0,f=o.exists()?o.numAttr("y")??0:0,h=a.exists()?a.numAttr("cx")??c:c,p=a.exists()?a.numAttr("cy")??u:u;return{offX:s,offY:l,cx:c,cy:u,chOffX:d,chOffY:f,chExtCx:h>0?h:1,chExtCy:p>0?p:1}}function lN(e,t){let n=[];for(let i of e.allChildren()){if(i.localName==="grpSp"){let o=wpe(i);if(o&&o.chExtCx>0&&o.chExtCy>0){let a=o.cx/o.chExtCx,s=o.cy/o.chExtCy,l=o.offX-o.chOffX*a,c=o.offY-o.chOffY*s,u=t?{offX:t.offX+l*t.scaleX,offY:t.offY+c*t.scaleY,scaleX:t.scaleX*a,scaleY:t.scaleY*s}:{offX:l,offY:c,scaleX:a,scaleY:s},d=lN(i,u);n.push(...d)}else n.push(...lN(i,t));continue}if(!Spe(i))continue;let r=$pe(i);if(!r){n.push({node:i});continue}if(t){let o=t.offX+r.offX*t.scaleX,a=t.offY+r.offY*t.scaleY,s=r.cx*t.scaleX,l=r.cy*t.scaleY;n.push({node:i,absoluteXfrm:{position:{x:De(o),y:De(a)},size:{w:De(s),h:De(l)}}})}else n.push({node:i,absoluteXfrm:{position:{x:De(r.offX),y:De(r.offY)},size:{w:De(r.cx),h:De(r.cy)}}})}return n}function kpe(e){let t=new Map,n=e.element;if(!n)return t;let i=n.attributes;for(let r=0;r<i.length;r++){let o=i[r];t.set(o.localName,o.value)}return t}function Mpe(e){let t=e.child("cSld"),n=t.child("bg"),i=n.exists()?n:void 0,r=t.child("spTree"),o,a=e.child("clrMapOvr");if(a.exists()){let c=a.child("overrideClrMapping");c.exists()&&(o=kpe(c))}let s=lN(r,null),l=_pe(e.attr("showMasterSp"));return{colorMapOverride:o,background:i,placeholders:s,spTree:r,rels:new Map,showMasterSp:l}}function Cpe(e){let t=["nvSpPr","nvPicPr","nvGrpSpPr","nvGraphicFramePr","nvCxnSpPr"];for(let n of t){let i=e.child(n);if(i.exists())return{cNvPr:i.child("cNvPr"),nvPr:i.child("nvPr")}}return{cNvPr:e.child("cNvPr"),nvPr:e.child("nvPr")}}function zpe(e){let t=e.child("spPr");if(t.exists()){let r=t.child("xfrm");if(r.exists())return r}let n=e.child("grpSpPr");if(n.exists()){let r=n.child("xfrm");if(r.exists())return r}let i=e.child("xfrm");return i.exists()?i:e.child("__nonexistent__")}function Tpe(e){let t=e.child("ph");if(!t.exists())return;let n=t.attr("type"),i=t.numAttr("idx");return{type:n,idx:i}}function Ah(e){let{cNvPr:t,nvPr:n}=Cpe(e),i=t.attr("id")??"",r=t.attr("name")??"",o=zpe(e),a=o.child("off"),s=o.child("ext"),l={x:De(a.numAttr("x")??0),y:De(a.numAttr("y")??0)},c={w:De(s.numAttr("cx")??0),h:De(s.numAttr("cy")??0)},u=Zm(o.numAttr("rot")??0),d=yr(o.attr("flipH")),f=yr(o.attr("flipV")),h=Tpe(n),p,g=t.child("hlinkClick");return g.exists()&&(p={action:g.attr("action")??void 0,rId:g.attr("id")??g.attr("r:id")??void 0,tooltip:g.attr("tooltip")??void 0}),{id:i,name:r,position:l,size:c,rotation:u,flipH:d,flipV:f,placeholder:h,hlinkClick:p,source:e}}function Ape(e){let t=e.child("pPr"),n=t.numAttr("lvl")??0,i=[];for(let a of e.children("r")){let s=a.child("rPr"),l=a.child("t");i.push({text:l.text(),properties:s.exists()?s:void 0})}for(let a of e.allChildren())a.localName;let r=[];for(let a of e.allChildren()){let s=a.localName;if(s==="r"){let l=a.child("rPr"),c=a.child("t");r.push({text:c.text(),properties:l.exists()?l:void 0})}else if(s==="br"){let l=a.child("rPr");r.push({text:`
110
110
  `,properties:l.exists()?l:void 0})}else if(s==="tab")r.push({text:" "});else if(s==="fld"){let l=a.child("rPr"),c=a.child("t");r.push({text:c.text(),properties:l.exists()?l:void 0})}}let o=e.child("endParaRPr");return{properties:t.exists()?t:void 0,runs:r.length>0?r:i,level:n,endParaRPr:o.exists()?o:void 0}}function PX(e){if(!e.exists())return;let t=e.child("bodyPr"),n=e.child("lstStyle"),i=[];for(let r of e.children("p"))i.push(Ape(r));return{bodyProperties:t.exists()?t:void 0,listStyle:n.exists()?n:void 0,paragraphs:i}}var Ipe=["solidFill","gradFill","blipFill","pattFill","grpFill","noFill"];function Rpe(e){for(let t of Ipe){let n=e.child(t);if(n.exists())return n}}function Lpe(e){let t=new Map;for(let n of e.children("gd")){let i=n.attr("name"),r=n.attr("fmla")??"";if(!i)continue;let o=r.match(/val\s+(-?\d+)/);if(o)t.set(i,Number(o[1]));else{let a=Number(r);Number.isNaN(a)||t.set(i,a)}}return t}function Epe(e){let t=Ah(e),n=e.child("spPr"),i=n.child("prstGeom"),r=i.attr("prst"),o=i.child("avLst"),a=Lpe(o),s=n.child("custGeom"),l=s.exists()?s:void 0,c=Rpe(n),u=n.child("ln"),d=u.exists()?u:void 0,f,h;if(u.exists()){let y=u.child("headEnd");if(y.exists()){let x=y.attr("type");x&&x!=="none"&&(f={type:x,w:y.attr("w"),len:y.attr("len")})}let b=u.child("tailEnd");if(b.exists()){let x=b.attr("type");x&&x!=="none"&&(h={type:x,w:b.attr("w"),len:b.attr("len")})}}let p=e.child("txBody"),g=PX(p),v,m=e.child("txXfrm");if(m.exists()){let y=m.child("off"),b=m.child("ext"),x=n.child("xfrm"),_=x.child("off"),S=x.child("ext"),$=_.numAttr("x")??0,C=_.numAttr("y")??0,w=S.numAttr("cx")??0,z=S.numAttr("cy")??0,A=y.numAttr("x")??0,M=y.numAttr("y")??0,T=b.numAttr("cx")??0,k=b.numAttr("cy")??0;if(w>0&&z>0){let I=Zm(m.numAttr("rot")??0),D=A-$,E=M-C,N=Math.abs(Math.round(I))%360===180,F=N?w-(D+T):D,G=N?z-(E+k):E;v={x:De(F),y:De(G),w:De(T),h:De(k),rotation:I}}}return{...t,nodeType:"shape",presetGeometry:r,adjustments:a,customGeometry:l,fill:c,line:d,headEnd:f,tailEnd:h,textBody:g,textBoxBounds:v}}var xw=1e5;function jX(e){let t=Ah(e),n=e.child("blipFill"),i=n.child("blip"),r=i.attr("embed")??i.attr("r:embed"),o=i.attr("link")??i.attr("r:link"),a=n.child("srcRect"),s;if(a.exists()){let C=a.numAttr("t"),w=a.numAttr("b"),z=a.numAttr("l"),A=a.numAttr("r");(C!==void 0||w!==void 0||z!==void 0||A!==void 0)&&(s={top:(C??0)/xw,bottom:(w??0)/xw,left:(z??0)/xw,right:(A??0)/xw})}let l=e.child("spPr"),c=l.child("solidFill"),u=l.child("gradFill"),d=c.exists()?c:u.exists()?u:void 0,f=l.child("ln"),h=f.exists()?f:void 0,p=l.child("prstGeom"),g=p.exists()?p.attr("prst"):void 0,v=l.child("custGeom"),m=v.exists()?v:void 0,y=e.child("nvPicPr").child("nvPr"),b=y.child("videoFile"),x=y.child("audioFile"),_=b.exists(),S=x.exists(),$;return _?$=b.attr("link")??b.attr("r:link"):S&&($=x.attr("link")??x.attr("r:link")),{...t,nodeType:"picture",blipEmbed:r,blipLink:o,crop:s,fill:d,line:h,presetGeometry:g,customGeometry:m,isVideo:_||void 0,isAudio:S||void 0,mediaRId:$}}function Dpe(e){let t=e.numAttr("gridSpan")??1,n=e.numAttr("rowSpan")??1,i=yr(e.attr("hMerge")),r=yr(e.attr("vMerge")),o=e.child("txBody"),a=PX(o),s=e.child("tcPr");return{gridSpan:t,rowSpan:n,hMerge:i,vMerge:r,textBody:a,properties:s.exists()?s:void 0}}function Ope(e){let t=De(e.numAttr("h")??0),n=[];for(let i of e.children("tc"))n.push(Dpe(i));return{height:t,cells:n}}function Npe(e){return e.child("graphic").child("graphicData").child("tbl")}function Ppe(e){let t=e.child("tableStyleId");if(t.exists())return t.text()||t.attr("val")||void 0;let n=e.child("tblStyle");return n.exists()?n.attr("val")??(n.text()||void 0):e.attr("tblStyle")??void 0}function jpe(e){let t=Ah(e),n=Npe(e),i=n.child("tblGrid"),r=[];for(let l of i.children("gridCol"))r.push(De(l.numAttr("w")??0));let o=[];for(let l of n.children("tr"))o.push(Ope(l));let a=n.child("tblPr"),s=Ppe(a);return{...t,nodeType:"table",columns:r,rows:o,properties:a.exists()?a:void 0,tableStyleId:s}}var Upe=new Set(["sp","pic","grpSp","graphicFrame","cxnSp"]);function Bpe(e){let t=Ah(e),n=e.child("grpSpPr").child("xfrm"),i=n.child("chOff"),r=n.child("chExt"),o=i.exists()?{x:De(i.numAttr("x")??0),y:De(i.numAttr("y")??0)}:{x:0,y:0},a=(()=>{if(!r.exists())return{w:t.size.w,h:t.size.h};let l=r.numAttr("cx"),c=r.numAttr("cy");return{w:l!==void 0&&l>0?De(l):t.size.w,h:c!==void 0&&c>0?De(c):t.size.h}})(),s=[];for(let l of e.allChildren())Upe.has(l.localName)&&s.push(l);return{...t,nodeType:"group",childOffset:o,childExtent:a,children:s}}function Fpe(e,t,n){let i=Ah(e),r=e.child("graphic").child("graphicData"),o;for(let c of r.allChildren())if(c.localName==="chart"){o=c.attr("r:id")||c.attr("id");break}if(!o)return;let a=t.get(o);if(!a)return;let s=n.substring(0,n.lastIndexOf("/")),l=Ia(s,a.target);return{...i,nodeType:"chart",chartPath:l}}var qpe=new Set(["sp","pic","grpSp","graphicFrame","cxnSp"]),Vpe=["nvSpPr","nvPicPr","nvGrpSpPr","nvGraphicFramePr","nvCxnSpPr"];function UX(e){for(let t of Vpe){let n=e.child(t);if(n.exists()&&n.child("nvPr").child("ph").exists())return!0}return!1}function Hpe(e){return e.child("graphic").child("graphicData").child("tbl").exists()}function Zpe(e){return(e.child("graphic").child("graphicData").attr("uri")||"").includes("chart")}function Gpe(e){return(e.child("graphic").child("graphicData").attr("uri")||"").includes("diagram")}function Wpe(e){if(!e)return"";let t=e.lastIndexOf("/");return t>=0?e.substring(0,t):""}function Ype(e){let t=e.child("graphic").child("graphicData");if(!(t.attr("uri")||"").includes("ole"))return null;let n=o=>{let a=o.child("blipFill").child("blip");return!!(a.attr("embed")??a.attr("r:embed")??a.attr("link")??a.attr("r:link"))},i=t.child("oleObj");if(i.exists()){let o=i.child("pic");if(o.exists()&&n(o))return o}let r=t.child("AlternateContent");if(!r.exists())return null;for(let o of["Fallback","Choice"]){let a=r.child(o).child("oleObj");if(!a.exists())continue;let s=a.child("pic");if(s.exists()&&n(s))return s}return null}function Xpe(e){let t=Ype(e);if(!t)return;let n=Ah(e),i=jX(t);if(!(!i.blipEmbed&&!i.blipLink))return{...i,...n,nodeType:"picture",source:t}}function Kpe(e,t){let n=Kr(t).child("spTree"),i=[];if(n.exists())for(let r of n.allChildren())qpe.has(r.localName)&&i.push(r);return{...e,nodeType:"group",childOffset:{x:0,y:0},childExtent:{w:Math.max(1,e.size.w),h:Math.max(1,e.size.h)},children:i}}function Jpe(e,t){var n;if(!t.diagramDrawings)return;let i=Ah(e),r=Wpe(t.partPath),o=Array.from(t.rels.values()).filter(s=>s.type.includes("diagramDrawing")||s.target.includes("diagrams/drawing")).map(s=>{let l=s.target.match(/drawing(\d+)/);return{target:s.target,num:l?Number.parseInt(l[1],10):void 0}}),a=e.child("graphic").child("graphicData").child("relIds");if(a.exists()){let s=a.attr("r:dm")??a.attr("dm"),l=s?t.rels.get(s):void 0,c=(n=l?.target.match(/data(\d+)/))==null?void 0:n[1];if(c){let u=Number.parseInt(c,10);o.sort((d,f)=>{let h=d.num===void 0?Number.POSITIVE_INFINITY:Math.abs(d.num-u),p=f.num===void 0?Number.POSITIVE_INFINITY:Math.abs(f.num-u);return h-p})}}for(let s of o){let l=Ia(r,s.target),c=t.diagramDrawings.get(l);if(c)return Kpe(i,c)}}function X5(e,t){if(!(t.skipPlaceholders&&UX(e)))switch(e.localName){case"sp":case"cxnSp":return Epe(e);case"pic":return jX(e);case"grpSp":return Bpe(e);case"graphicFrame":return Hpe(e)?jpe(e):Zpe(e)?Fpe(e,t.rels,t.partPath??""):Gpe(e)?Jpe(e,t):Xpe(e);default:return}}function mZ(e){return yr(e,!0)}function BX(e){for(let[,t]of e)if(t.type.includes("slideLayout"))return t.target;return""}function FX(e,t,n,i="",r){let o=e.child("cSld"),a=o.child("bg"),s=a.exists()?a:void 0,l=o.child("spTree"),c=[];for(let h of l.allChildren()){let p=X5(h,{rels:n,partPath:i,diagramDrawings:r});p&&c.push(p)}let u=BX(n),d=mZ(e.attr("showMasterSp")),f=!mZ(e.attr("show"));return{index:t,hidden:f,nodes:c,background:s,layoutIndex:u,rels:n,slidePath:i,showMasterSp:d,nodesMaterialized:!0}}function Qpe(e,t,n,i=""){return{index:t,nodes:[],layoutIndex:BX(n),rels:n,slidePath:i,showMasterSp:!0,sourceXml:e,nodesMaterialized:!1}}function eme(e,t){if(e.nodesMaterialized)return;if(!e.sourceXml){e.nodesMaterialized=!0;return}let n=e.layoutIndex,i=FX(Kr(e.sourceXml),e.index,e.rels,e.slidePath,t);e.hidden=i.hidden,e.nodes=i.nodes,e.background=i.background,e.layoutIndex=n||i.layoutIndex,e.showMasterSp=i.showMasterSp,e.nodesMaterialized=!0,e.sourceXml=void 0}function hh(e){let t=e.lastIndexOf("/");return t>=0?e.substring(0,t):""}function _w(e){let t=hh(e),n=e.substring(e.lastIndexOf("/")+1);return`${t}/_rels/${n}.rels`}function tme(e){return e.includes("wps")||e.includes("kso")||e.includes("Kingsoft")||e.includes("WPS")}function cb(e,t){for(let[,n]of e)if(n.type.includes(t))return n}function nme(e,t){let n=[];for(let[i,r]of e)r.type.includes(t)&&n.push([i,r]);return n}function qX(e,t={}){var n,i,r,o;let a=Kr(e.presentation),s=lb(e.presentationRels),l=a.child("sldSz"),c=De(l.numAttr("cx")??9144e3),u=De(l.numAttr("cy")??6858e3),d=tme(e.presentation),f=a.child("defaultTextStyle"),h=new Map;for(let[M,T]of e.themes){let k=Kr(T);h.set(M,pZ(k))}let p=new Map,g=new Map;for(let[M,T]of e.slideMasters){let k=Kr(T),I=ype(k),D=_w(M),E=e.slideMasterRels.get(D);if(E){let N=lb(E);I.rels=N;let F=cb(N,"theme");if(F){let G=Ia(hh(M),F.target);g.set(M,G)}}p.set(M,I)}let v=new Map,m=new Map;for(let[M,T]of e.slideLayouts){let k=Kr(T),I=Mpe(k),D=_w(M),E=e.slideLayoutRels.get(D);if(E){let N=lb(E);I.rels=N;let F=cb(N,"slideMaster");if(F){let G=Ia(hh(M),F.target);m.set(M,G)}}v.set(M,I)}let y=new Map,b=new Map,x=new Map,_=new Map;for(let[M,T]of e.charts){let k=Kr(T);k.exists()&&y.set(M,k);let I=_w(M),D=(n=e.chartRels)==null?void 0:n.get(I);if(!D)continue;let E=lb(D),N=cb(E,"chartStyle");if(N){let j=Ia(hh(M),N.target),H=(i=e.chartStyles)==null?void 0:i.get(j);if(H){let Q=Kr(H);Q.exists()&&x.set(M,Q)}}let F=cb(E,"chartColorStyle");if(F){let j=Ia(hh(M),F.target),H=(r=e.chartColors)==null?void 0:r.get(j);if(H){let Q=Kr(H);Q.exists()&&_.set(M,Q)}}let G=cb(E,"themeOverride");if(!G)continue;let P=Ia(hh(M),G.target),O=((o=e.themeOverrides)==null?void 0:o.get(P))??e.themes.get(P);if(!O)continue;let V=Kr(O);V.exists()&&b.set(M,pZ(V))}let S=a.child("sldIdLst"),$=[];for(let M of S.children("sldId")){let T=M.attr("r:id")??M.attr("id");if(T){let k=s.get(T);if(k){let I=Ia("ppt",k.target);$.push(I)}}}if($.length===0){let M=nme(s,"slide");M.sort((T,k)=>{let I=parseInt(T[0].replace(/\D/g,""),10)||0,D=parseInt(k[0].replace(/\D/g,""),10)||0;return I-D});for(let[,T]of M)if(T.type.includes("/slide")&&!T.type.includes("slideLayout")&&!T.type.includes("slideMaster")){let k=Ia("ppt",T.target);$.push(k)}}let C=[],w=new Map;for(let M=0;M<$.length;M++){let T=$[M],k=e.slides.get(T);if(!k)continue;let I=_w(T),D=e.slideRels.get(I),E=D?lb(D):new Map,N=t.lazySlides?Qpe(k,M,E,T):FX(Kr(k),M,E,T,e.diagramDrawings);if(N.layoutIndex){let F=Ia(hh(T),N.layoutIndex);N.layoutIndex=F,w.set(M,F)}C.push(N)}let z;if(e.tableStyles){let M=Kr(e.tableStyles);M.exists()&&(z=M)}let A={width:c,height:u,slides:C,layouts:v,masters:p,themes:h,slideToLayout:w,layoutToMaster:m,masterToTheme:g,media:e.media,mediaResolver:e.mediaResolver,tableStyles:z,defaultTextStyle:f.exists()?f:void 0,charts:y,diagramDrawings:e.diagramDrawings,chartThemes:b,chartStyles:x,chartColorStyles:_,isWps:d};return t.lazySlides||rme(A),A}function cN(e){for(let t of["nvSpPr","nvPicPr","nvGrpSpPr","nvGraphicFramePr","nvCxnSpPr"]){let n=e.child(t);if(n.exists()){let i=n.child("nvPr").child("ph");if(i.exists()){let r=i.attr("type"),o=i.attr("idx"),a=o!==void 0?Number(o):void 0;return{type:r,idx:a!==void 0&&!isNaN(a)?a:void 0}}}}return{}}function gZ(e){let t=e.child("spPr").child("xfrm"),n=t.exists()?t:e.child("xfrm");if(n.exists()){let i=n.child("off"),r=n.child("ext"),o=i.numAttr("x"),a=r.numAttr("cx");if(o!==void 0&&a!==void 0)return{position:{x:De(i.numAttr("x")??0),y:De(i.numAttr("y")??0)},size:{w:De(r.numAttr("cx")??0),h:De(r.numAttr("cy")??0)}}}}function vZ(e,t,n){let i;for(let r of e){let o=cN(r.node);if(t!==void 0&&o.type===t&&n!==void 0&&o.idx===n||(t!==void 0&&o.type===t&&!i&&(i=r),n!==void 0&&o.idx===n&&t===void 0&&o.type===void 0))return r}if(t===void 0&&n!==void 0){for(let r of e)if(cN(r.node).idx===n)return r}return i}function ime(e){return e.placeholderEntries??e.placeholders.map(t=>({node:t}))}function rme(e){for(let t=0;t<e.slides.length;t++)VX(e,e.slides[t])}function VX(e,t){if(t.placeholderInheritanceResolved)return;let n=e.slideToLayout.get(t.index)||t.layoutIndex,i=n?e.layouts.get(n):void 0,r=n?e.layoutToMaster.get(n):void 0,o=r?e.masters.get(r):void 0;ame(t.nodes,i,o),t.placeholderInheritanceResolved=!0}function Gm(e,t){eme(t,e.diagramDrawings),VX(e,t)}function hD(e){let t=e.child("txBody");if(!t.exists())return;let n=t.child("bodyPr");return n.exists()?n:void 0}function fD(e,t){if(e.type)return;let n=cN(t);n.type&&(e.type=n.type)}function ome(e,t){let n=t.childExtent.w>0?t.size.w/t.childExtent.w:1,i=t.childExtent.h>0?t.size.h/t.childExtent.h:1;return n===0||i===0?e:{position:{x:t.childOffset.x+(e.position.x-t.position.x)/n,y:t.childOffset.y+(e.position.y-t.position.y)/i},size:{w:e.size.w/n,h:e.size.h/i}}}function yZ(e,t){return t.parentGroup?ome(e,t.parentGroup):e}function HX(e,t,n,i={}){if(!e.placeholder)return;let{type:r,idx:o}=e.placeholder,a=()=>{var u;return n?vZ(ime(n),((u=e.placeholder)==null?void 0:u.type)??r,o):void 0},s=e.size.w===0&&e.size.h===0,l=e.position.y<5;if(t){let u=vZ(t.placeholders,r,o);if(u){fD(e.placeholder,u.node);let d=u.absoluteXfrm??gZ(u.node);if(d){let f=yZ(d,i);s?(e.position=f.position,e.size=f.size):l&&(e.position=f.position)}if("textBody"in e&&e.textBody){let f=hD(u.node);f&&(e.textBody.layoutBodyProperties=f)}if(d){let f=a();if(f&&(fD(e.placeholder,f.node),"textBody"in e&&e.textBody&&!e.textBody.layoutBodyProperties)){let h=hD(f.node);h&&(e.textBody.layoutBodyProperties=h)}return}}}let c=a();if(c){fD(e.placeholder,c.node);let u=c.absoluteXfrm??gZ(c.node);if(u){let d=yZ(u,i);s?(e.position=d.position,e.size=d.size):l&&(e.position=d.position)}if("textBody"in e&&e.textBody&&!e.textBody.layoutBodyProperties){let d=hD(c.node);d&&(e.textBody.layoutBodyProperties=d)}}}function ame(e,t,n){for(let i of e)i.nodeType==="group"&&"children"in i,HX(i,t,n)}function sme(e,t,n,i,r,o){let a=e.slideToLayout.get(t.index)||"",s=e.layoutToMaster.get(a)||"",l=e.masterToTheme.get(s)||"",c=e.layouts.get(a)||{placeholders:[],spTree:{},rels:new Map,showMasterSp:!0},u=e.masters.get(s)||{colorMap:new Map,textStyles:{},placeholders:[],spTree:{},rels:new Map},d=e.themes.get(l)||{colorScheme:new Map,majorFont:{latin:"Calibri",ea:"",cs:""},minorFont:{latin:"Calibri",ea:"",cs:""},fillStyles:[],bgFillStyles:[],lineStyles:[],effectStyles:[]};return{presentation:e,slide:t,theme:d,master:u,layout:c,partPath:t.slidePath,layoutPath:a,masterPath:s,mediaUrlCache:n??new Map,colorCache:new Map,pdfjs:r,signal:o,chartInstances:i}}function Gt(e){let t=e.replace(/^#/,"");if(t.length!==6&&t.length!==3)return{r:0,g:0,b:0};let n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,i=parseInt(n,16);return{r:i>>16&255,g:i>>8&255,b:i&255}}function qn(e,t,n){let i=r=>Math.max(0,Math.min(255,Math.round(r)));return"#"+[i(e),i(t),i(n)].map(r=>r.toString(16).padStart(2,"0")).join("")}function Oa(e,t,n){let i=e/255,r=t/255,o=n/255,a=Math.max(i,r,o),s=Math.min(i,r,o),l=(a+s)/2,c=0,u=0;if(a!==s){let d=a-s;switch(u=l>.5?d/(2-a-s):d/(a+s),a){case i:c=((r-o)/d+(r<o?6:0))*60;break;case r:c=((o-i)/d+2)*60;break;case o:c=((i-r)/d+4)*60;break}}return{h:c,s:u,l}}function $o(e,t,n){if(e=(e%360+360)%360,t=Math.max(0,Math.min(1,t)),n=Math.max(0,Math.min(1,n)),t===0){let s=Math.round(n*255);return{r:s,g:s,b:s}}let i=(s,l,c)=>(c<0&&(c+=1),c>1&&(c-=1),c<1/6?s+(l-s)*6*c:c<1/2?l:c<2/3?s+(l-s)*(2/3-c)*6:s),r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,a=e/360;return{r:Math.round(i(o,r,a+1/3)*255),g:Math.round(i(o,r,a)*255),b:Math.round(i(o,r,a-1/3)*255)}}function Ll(e){let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function El(e){let t=e<=.0031308?e*12.92:1.055*e**.4166666666666667-.055;return Math.max(0,Math.min(255,Math.round(t*255)))}function ZX(e,t){let{r:n,g:i,b:r}=Gt(e),o=t/1e5,a=Ll(n),s=Ll(i),l=Ll(r);return qn(El(a*o+1*(1-o)),El(s*o+1*(1-o)),El(l*o+1*(1-o)))}function lme(e,t){let{r:n,g:i,b:r}=Gt(e),o=t/1e5;return qn(El(Ll(n)*o),El(Ll(i)*o),El(Ll(r)*o))}function cme(e,t){let{r:n,g:i,b:r}=Gt(e),{h:o,s:a,l:s}=Oa(n,i,r),l=Math.max(0,Math.min(1,s*(t/1e5))),c=$o(o,a,l);return qn(c.r,c.g,c.b)}function ume(e,t){let{r:n,g:i,b:r}=Gt(e),{h:o,s:a,l:s}=Oa(n,i,r),l=Math.max(0,Math.min(1,s+t/1e5)),c=$o(o,a,l);return qn(c.r,c.g,c.b)}function dme(e,t){let{r:n,g:i,b:r}=Gt(e),{h:o,s:a,l:s}=Oa(n,i,r),l=Math.max(0,Math.min(1,a*(t/1e5))),c=$o(o,l,s);return qn(c.r,c.g,c.b)}function hme(e,t){let{r:n,g:i,b:r}=Gt(e),{h:o,s:a,l:s}=Oa(n,i,r),l=o*(t/1e5)%360,c=$o(l,a,s);return qn(c.r,c.g,c.b)}function fme(e,t){let{r:n,g:i,b:r}=Gt(e),{h:o,s:a,l:s}=Oa(n,i,r),l=t/6e4,c=((o+l)%360+360)%360,u=$o(c,a,s);return qn(u.r,u.g,u.b)}function pme(e,t){let{r:n,g:i,b:r}=Gt(e),{h:o,s:a,l:s}=Oa(n,i,r),l=Math.max(0,Math.min(1,a+t/1e5)),c=$o(o,l,s);return qn(c.r,c.g,c.b)}function GX(e){return e/1e5*255}function K5(e,t,n){let i=Gt(e);return i[t]=n(i[t]),qn(i.r,i.g,i.b)}function pD(e,t,n){return K5(e,t,i=>i*(n/1e5))}function mD(e,t,n){return K5(e,t,i=>i+GX(n))}function gD(e,t,n){return K5(e,t,()=>GX(n))}function mme(e,t){let{r:n,g:i,b:r}=Gt(e),{h:o,s:a}=Oa(n,i,r),s=$o(o,a,t/1e5);return qn(s.r,s.g,s.b)}function gme(e,t){let{r:n,g:i,b:r}=Gt(e),{h:o,l:a}=Oa(n,i,r),s=$o(o,t/1e5,a);return qn(s.r,s.g,s.b)}function vme(e,t){let{r:n,g:i,b:r}=Gt(e),{s:o,l:a}=Oa(n,i,r),s=$o(t/6e4,o,a);return qn(s.r,s.g,s.b)}function yme(e){let{r:t,g:n,b:i}=Gt(e);return qn(255-t,255-n,255-i)}function bme(e){let{r:t,g:n,b:i}=Gt(e),r=.2126*t+.7152*n+.0722*i;return qn(r,r,r)}function xme(e){let{r:t,g:n,b:i}=Gt(e),{h:r,s:o,l:a}=Oa(t,n,i),s=$o(r+180,o,a);return qn(s.r,s.g,s.b)}function _me(e){let{r:t,g:n,b:i}=Gt(e);return qn(Ll(t)*255,Ll(n)*255,Ll(i)*255)}function Sme(e){let{r:t,g:n,b:i}=Gt(e);return qn(El(t/255),El(n/255),El(i/255))}function $me(e){return Math.max(0,Math.min(1,e/1e5))}function Ar(e,t){let n=e,i=1;for(let r of t)switch(r.name.startsWith("a:")?r.name.slice(2):r.name){case"tint":n=ZX(n,r.val);break;case"shade":n=lme(n,r.val);break;case"red":n=gD(n,"r",r.val);break;case"green":n=gD(n,"g",r.val);break;case"blue":n=gD(n,"b",r.val);break;case"redMod":n=pD(n,"r",r.val);break;case"greenMod":n=pD(n,"g",r.val);break;case"blueMod":n=pD(n,"b",r.val);break;case"redOff":n=mD(n,"r",r.val);break;case"greenOff":n=mD(n,"g",r.val);break;case"blueOff":n=mD(n,"b",r.val);break;case"lum":n=mme(n,r.val);break;case"lumMod":n=cme(n,r.val);break;case"lumOff":n=ume(n,r.val);break;case"sat":n=gme(n,r.val);break;case"satMod":n=dme(n,r.val);break;case"hue":n=vme(n,r.val);break;case"hueMod":n=hme(n,r.val);break;case"hueOff":n=fme(n,r.val);break;case"satOff":n=pme(n,r.val);break;case"inv":n=yme(n);break;case"gray":n=bme(n);break;case"comp":n=xme(n);break;case"gamma":n=_me(n);break;case"invGamma":n=Sme(n);break;case"alpha":i=$me(r.val);break;case"alphaMod":case"alphaModFix":i=Math.max(0,Math.min(1,i*(r.val/1e5)));break;case"alphaOff":i=Math.max(0,Math.min(1,i+r.val/1e5));break}return{color:n,alpha:i}}var vD={black:"#000000",white:"#FFFFFF",red:"#FF0000",green:"#008000",blue:"#0000FF",yellow:"#FFFF00",cyan:"#00FFFF",magenta:"#FF00FF",orange:"#FFA500",purple:"#800080",brown:"#A52A2A",pink:"#FFC0CB",gray:"#808080",grey:"#808080",lime:"#00FF00",navy:"#000080",teal:"#008080",maroon:"#800000",olive:"#808000",silver:"#C0C0C0",aqua:"#00FFFF",fuchsia:"#FF00FF",aliceBlue:"#F0F8FF",antiqueWhite:"#FAEBD7",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",blanchedAlmond:"#FFEBCD",blueViolet:"#8A2BE2",burlyWood:"#DEB887",cadetBlue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerBlue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",darkBlue:"#00008B",darkCyan:"#008B8B",darkGoldenrod:"#B8860B",darkGray:"#A9A9A9",darkGrey:"#A9A9A9",darkGreen:"#006400",darkKhaki:"#BDB76B",darkMagenta:"#8B008B",darkOliveGreen:"#556B2F",darkOrange:"#FF8C00",darkOrchid:"#9932CC",darkRed:"#8B0000",darkSalmon:"#E9967A",darkSeaGreen:"#8FBC8F",darkSlateBlue:"#483D8B",darkSlateGray:"#2F4F4F",darkSlateGrey:"#2F4F4F",darkTurquoise:"#00CED1",darkViolet:"#9400D3",deepPink:"#FF1493",deepSkyBlue:"#00BFFF",dimGray:"#696969",dimGrey:"#696969",dodgerBlue:"#1E90FF",firebrick:"#B22222",floralWhite:"#FFFAF0",forestGreen:"#228B22",gainsboro:"#DCDCDC",ghostWhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",greenYellow:"#ADFF2F",honeydew:"#F0FFF0",hotPink:"#FF69B4",indianRed:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderBlush:"#FFF0F5",lawnGreen:"#7CFC00",lemonChiffon:"#FFFACD",lightBlue:"#ADD8E6",lightCoral:"#F08080",lightCyan:"#E0FFFF",lightGoldenrodYellow:"#FAFAD2",lightGray:"#D3D3D3",lightGrey:"#D3D3D3",lightGreen:"#90EE90",lightPink:"#FFB6C1",lightSalmon:"#FFA07A",lightSeaGreen:"#20B2AA",lightSkyBlue:"#87CEFA",lightSlateGray:"#778899",lightSlateGrey:"#778899",lightSteelBlue:"#B0C4DE",lightYellow:"#FFFFE0",limeGreen:"#32CD32",linen:"#FAF0E6",mediumAquamarine:"#66CDAA",mediumBlue:"#0000CD",mediumOrchid:"#BA55D3",mediumPurple:"#9370DB",mediumSeaGreen:"#3CB371",mediumSlateBlue:"#7B68EE",mediumSpringGreen:"#00FA9A",mediumTurquoise:"#48D1CC",mediumVioletRed:"#C71585",midnightBlue:"#191970",mintCream:"#F5FFFA",mistyRose:"#FFE4E1",moccasin:"#FFE4B5",navajoWhite:"#FFDEAD",oldLace:"#FDF5E6",oliveDrab:"#6B8E23",orangeRed:"#FF4500",orchid:"#DA70D6",paleGoldenrod:"#EEE8AA",paleGreen:"#98FB98",paleTurquoise:"#AFEEEE",paleVioletRed:"#DB7093",papayaWhip:"#FFEFD5",peachPuff:"#FFDAB9",peru:"#CD853F",plum:"#DDA0DD",powderBlue:"#B0E0E6",rosyBrown:"#BC8F8F",royalBlue:"#4169E1",saddleBrown:"#8B4513",salmon:"#FA8072",sandyBrown:"#F4A460",seaGreen:"#2E8B57",seaShell:"#FFF5EE",sienna:"#A0522D",skyBlue:"#87CEEB",slateBlue:"#6A5ACD",slateGray:"#708090",slateGrey:"#708090",snow:"#FFFAFA",springGreen:"#00FF7F",steelBlue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",whiteSmoke:"#F5F5F5",yellowGreen:"#9ACD32"};function bZ(e){if(vD[e]!==void 0)return vD[e];let t=e.toLowerCase();for(let[n,i]of Object.entries(vD))if(n.toLowerCase()===t)return i}function wme(e){let t=[e.localName,e.attr("val")??""];for(let n of e.allChildren()){let i=n.localName,r=n.attr("val")??n.attr("amt");i&&t.push(`${i}:${r??""}`);for(let o of n.allChildren()){let a=o.localName,s=o.attr("val")??o.attr("amt");a&&t.push(`${a}:${s??""}`)}}return t.join("|")}function Ml(e){let t=[];for(let n of e.allChildren()){let i=n.localName,r=n.numAttr("val")??n.numAttr("amt");r!==void 0&&i?t.push({name:i,val:r}):(i==="inv"||i==="gray"||i==="comp"||i==="gamma"||i==="invGamma")&&t.push({name:i,val:0})}return t}function xZ(e,t){let n=e;if(t.layout.colorMapOverride){let r=t.layout.colorMapOverride.get(e);r&&(n=r)}if(n===e){let r=t.master.colorMap.get(e);r&&(n=r)}return t.theme.colorScheme.get(n)||t.theme.colorScheme.get(e)||"000000"}function on(e,t){let n=wme(e),i=t.colorCache.get(n);if(i)return i;let r=WX(e,t);return t.colorCache.set(n,r),r}function WX(e,t,n){for(let r of e.allChildren()){let o=r.localName,a=Ml(r);switch(o){case"srgbClr":{let s=r.attr("val")||"000000";return Ar(s,a)}case"schemeClr":{let s=r.attr("val")||"tx1";if(s.toLowerCase()==="phclr"&&n!=null&&n.exists()){let c=on(n,t),u=c.color.startsWith("#")?c.color.slice(1):c.color,d=Ar(u,a);return{color:d.color,alpha:d.alpha*c.alpha}}let l=xZ(s,t);return Ar(l,a)}case"sysClr":{let s=r.attr("lastClr")||r.attr("val")||"000000";return Ar(s,a)}case"prstClr":{let s=r.attr("val")||"black",l=bZ(s)||"#000000";return Ar(l.replace("#",""),a)}case"hslClr":{let s=(r.numAttr("hue")??0)/6e4,l=(r.numAttr("sat")??0)/1e5,c=(r.numAttr("lum")??0)/1e5,u=$o(s,l,c),d=qn(u.r,u.g,u.b).replace("#","");return Ar(d,a)}case"scrgbClr":{let s=Math.round((r.numAttr("r")??0)/1e5*255),l=Math.round((r.numAttr("g")??0)/1e5*255),c=Math.round((r.numAttr("b")??0)/1e5*255),u=qn(s,l,c).replace("#","");return Ar(u,a)}}}let i=e.localName;if(i==="srgbClr"){let r=e.attr("val")||"000000";return Ar(r,Ml(e))}if(i==="schemeClr"){let r=e.attr("val")||"tx1";if(r.toLowerCase()==="phclr"&&n!=null&&n.exists()){let a=on(n,t),s=a.color.startsWith("#")?a.color.slice(1):a.color,l=Ar(s,Ml(e));return{color:l.color,alpha:l.alpha*a.alpha}}let o=xZ(r,t);return Ar(o,Ml(e))}if(i==="sysClr"){let r=e.attr("lastClr")||e.attr("val")||"000000";return Ar(r,Ml(e))}if(i==="prstClr"){let r=e.attr("val")||"black",o=bZ(r)||"#000000";return Ar(o.replace("#",""),Ml(e))}if(i==="hslClr"){let r=(e.numAttr("hue")??0)/6e4,o=(e.numAttr("sat")??0)/1e5,a=(e.numAttr("lum")??0)/1e5,s=$o(r,o,a),l=qn(s.r,s.g,s.b).replace("#","");return Ar(l,Ml(e))}if(i==="scrgbClr"){let r=Math.round((e.numAttr("r")??0)/1e5*255),o=Math.round((e.numAttr("g")??0)/1e5*255),a=Math.round((e.numAttr("b")??0)/1e5*255),s=qn(r,o,a).replace("#","");return Ar(s,Ml(e))}return{color:"#000000",alpha:1}}function gr(e,t){let{color:n,alpha:i}=on(e,t);return oa(n,i)}function oa(e,t){let n=e.startsWith("#")?e:`#${e}`,{r:i,g:r,b:o}=Gt(n);return t>=1?n:`rgba(${i},${r},${o},${t.toFixed(3)})`}function tx(e,t,n){return n!=null&&n.exists()?WX(e,t,n):on(e,t)}function Ul(e,t){let n=e.child("solidFill");if(n.exists()){let{color:o,alpha:a}=on(n,t);return oa(o,a)}let i=e.child("gradFill");if(i.exists())return XX(i,t);if(e.child("blipFill").exists())return"";let r=e.child("pattFill");return r.exists()?YX(r,t):e.child("grpFill").exists()?t.groupFillNode?Ul(t.groupFillNode,t):"":e.child("noFill").exists()?"transparent":""}function YX(e,t,n){let i=e.attr("prst")??"solid",r="#000000",o="#ffffff",a=e.child("fgClr");if(a.exists()){let{color:d,alpha:f}=tx(a,t,n);r=oa(d,f)}let s=e.child("bgClr");if(s.exists()){let{color:d,alpha:f}=tx(s,t,n);o=oa(d,f)}let l=8,c=d=>`${d} 0 0 / ${l}px ${l}px, ${o}`,u=(d,f)=>`${d} 0 0 / ${l}px ${l}px, ${f} 0 0 / ${l}px ${l}px, ${o}`;switch(i){case"solid":case"solidDmnd":return r;case"pct5":case"pct10":case"pct20":case"pct25":return c(`radial-gradient(${r} 1px, transparent 1px)`);case"pct30":case"pct40":case"pct50":return c(`radial-gradient(${r} 1.5px, transparent 1.5px)`);case"pct60":case"pct70":case"pct75":case"pct80":case"pct90":return c(`radial-gradient(${r} 2.5px, transparent 2.5px)`);case"horz":case"ltHorz":case"narHorz":case"dkHorz":return c(`repeating-linear-gradient(0deg, ${r} 0px, ${r} 1px, transparent 1px, transparent ${l}px)`);case"vert":case"ltVert":case"narVert":case"dkVert":return c(`repeating-linear-gradient(90deg, ${r} 0px, ${r} 1px, transparent 1px, transparent ${l}px)`);case"dnDiag":case"ltDnDiag":case"narDnDiag":case"dkDnDiag":case"wdDnDiag":return c(`repeating-linear-gradient(45deg, ${r} 0px, ${r} 1px, transparent 1px, transparent ${l}px)`);case"upDiag":case"ltUpDiag":case"narUpDiag":case"dkUpDiag":case"wdUpDiag":return c(`repeating-linear-gradient(-45deg, ${r} 0px, ${r} 1px, transparent 1px, transparent ${l}px)`);case"smGrid":case"lgGrid":case"cross":return u(`repeating-linear-gradient(0deg, ${r} 0px, ${r} 1px, transparent 1px, transparent ${l}px)`,`repeating-linear-gradient(90deg, ${r} 0px, ${r} 1px, transparent 1px, transparent ${l}px)`);case"smCheck":case"lgCheck":case"diagCross":case"openDmnd":return u(`repeating-linear-gradient(45deg, ${r} 0px, ${r} 1px, transparent 1px, transparent ${l}px)`,`repeating-linear-gradient(-45deg, ${r} 0px, ${r} 1px, transparent 1px, transparent ${l}px)`);case"dotGrid":case"dotDmnd":return c(`radial-gradient(${r} 1px, transparent 1px)`);case"trellis":case"weave":return u(`repeating-linear-gradient(45deg, ${r} 0px, ${r} 2px, transparent 2px, transparent ${l}px)`,`repeating-linear-gradient(-45deg, ${r} 0px, ${r} 2px, transparent 2px, transparent ${l}px)`);case"dashDnDiag":case"dashUpDiag":case"dashHorz":case"dashVert":{let d=i.includes("Dn")?"45deg":i.includes("Up")?"-45deg":i.includes("Horz")?"0deg":"90deg";return c(`repeating-linear-gradient(${d}, ${r} 0px, ${r} 3px, transparent 3px, transparent ${l}px)`)}case"sphere":case"shingle":case"plaid":case"divot":case"zigZag":return c(`radial-gradient(${r} 2px, transparent 2px)`);default:return o}}function XX(e,t,n){let i=e.child("gsLst"),r=[];for(let l of i.children("gs")){let c=l.numAttr("pos")??0,u=W2(c)*100,{color:d,alpha:f}=tx(l,t,n);r.push({position:u,color:oa(d,f)})}if(r.length===0)return"";r.sort((l,c)=>l.position-c.position);let o=SZ(r),a=e.child("lin");if(a.exists())return`linear-gradient(${((Zm(a.numAttr("ang")??0)+90)%360).toFixed(1)}deg, ${o})`;let s=e.child("path");if(s.exists()){let l=s.attr("path");if(l==="circle"||l==="shape"||l==="rect"){let c=KX(s),{cx:u,cy:d}=JX(c),f=SZ(nx({stops:r,cx:u,cy:d,fillToRect:c}));return l==="rect"?`radial-gradient(closest-side at ${(u*100).toFixed(1)}% ${(d*100).toFixed(1)}%, ${f})`:`radial-gradient(ellipse at ${(u*100).toFixed(1)}% ${(d*100).toFixed(1)}%, ${f})`}}return`linear-gradient(180deg, ${o})`}function _x(e,t,n){let i=e.numAttr("w")??0,r=De(i),o="transparent",a=e.child("solidFill");if(a.exists()){let u=a.child("schemeClr");if(u.exists()&&(u.attr("val")??"").toLowerCase()==="phclr"&&n&&n.exists()){let d=on(n,t),f=d.color.startsWith("#")?d.color.slice(1):d.color,h=Ar(f,Ml(u));o=oa(h.color,h.alpha*d.alpha)}else{let d=on(a,t);o=oa(d.color,d.alpha)}}else if(n&&n.exists()&&(n.numAttr("idx")??0)>0){let u=n.numAttr("idx")??0;if(u>0&&t.theme.lineStyles&&t.theme.lineStyles.length>=u){let d=t.theme.lineStyles[u-1];if(r===0){let h=d.numAttr("w")??0;r=De(h)}let f=on(n,t);o=oa(f.color,f.alpha)}else{let d=on(n,t);o=oa(d.color,d.alpha),r===0&&u>0&&(r=u*.75)}}if(r===0&&n&&n.exists()){let u=n.numAttr("idx")??0;if(u>0&&t.theme.lineStyles&&t.theme.lineStyles.length>=u){let d=t.theme.lineStyles[u-1].numAttr("w")??0;r=De(d)}else u>0&&(r=u*.75)}r===0&&o!=="transparent"&&!e.child("noFill").exists()&&(r=1);let s="solid",l="solid",c=e.child("prstDash");if(c.exists()){let u=c.attr("val")||"solid";l=u,s=_Z(u)}if(s==="solid"&&n&&n.exists()){let u=n.numAttr("idx")??0;if(u>0&&t.theme.lineStyles&&t.theme.lineStyles.length>=u){let d=t.theme.lineStyles[u-1].child("prstDash");d.exists()&&(l=d.attr("val")||"solid",s=_Z(l))}}return{width:r,color:o,dash:s,dashKind:l}}function _Z(e){switch(e){case"solid":return"solid";case"dot":case"sysDot":return"dotted";case"dash":case"sysDash":case"lgDash":return"dashed";case"dashDot":case"lgDashDot":case"lgDashDotDot":case"sysDashDot":case"sysDashDotDot":return"dashed";default:return"solid"}}function KX(e){let t=e.child("fillToRect");if(t.exists())return{l:(t.numAttr("l")??0)/1e5,t:(t.numAttr("t")??0)/1e5,r:(t.numAttr("r")??0)/1e5,b:(t.numAttr("b")??0)/1e5}}function JX(e){return e?{cx:(e.l+(1-e.r))/2,cy:(e.t+(1-e.b))/2}:{cx:.5,cy:.5}}function yD(e){return Math.max(0,Math.min(1,e))}function kme(e,t={}){let n=e.fillToRect;if(!n)return 0;let i=Math.max(0,1-n.l-n.r),r=Math.max(0,1-n.t-n.b);if(i<=0&&r<=0)return 0;let o=e.cx??.5,a=e.cy??.5,s=Math.max(Math.abs(o),Math.abs(1-o)),l=Math.max(Math.abs(a),Math.abs(1-a));if(t.axis==="x")return s>0?yD(i/2/s):0;if(t.axis==="y")return l>0?yD(r/2/l):0;let c=t.width??1,u=t.height??1,d=Math.hypot(i/2*c,r/2*u),f=Math.hypot(s*c,l*u);return f>0?yD(d/f):0}function nx(e,t={}){let n=kme(e,t);return n<=0?e.stops:e.stops.map(i=>({...i,position:n*100+i.position*(1-n)}))}function SZ(e){return e.map(t=>`${t.color} ${t.position.toFixed(1)}%`).join(", ")}function QX(e,t,n){let i=e.child("gsLst"),r=[];for(let s of i.children("gs")){let l=s.numAttr("pos")??0,c=W2(l)*100,{color:u,alpha:d}=tx(s,t,n);r.push({position:c,color:oa(u,d)})}if(r.length===0)return null;r.sort((s,l)=>s.position-l.position);let o=e.child("lin");if(o.exists()){let s=Zm(o.numAttr("ang")??0);return{type:"linear",stops:r,angle:s,colorInterpolation:"linearRGB"}}let a=e.child("path");if(a.exists()){let s=a.attr("path");if(s==="circle"||s==="shape"||s==="rect"){let l=KX(a),{cx:c,cy:u}=JX(l);return{type:"radial",stops:r,angle:0,cx:c,cy:u,pathType:s,fillToRect:l,colorInterpolation:"linearRGB"}}}return{type:"linear",stops:r,angle:0,colorInterpolation:"linearRGB"}}function eK(e,t){let n=e.child("gradFill");return!n.exists()&&e.child("grpFill").exists()&&t.groupFillNode&&(n=t.groupFillNode.child("gradFill")),n.exists()?QX(n,t):null}function J5(e,t){let n=e.numAttr("idx")??0;return uN(e,t,t.theme.fillStyles,n)}function Mme(e,t){let n=e.numAttr("idx")??0;return n>=1001?uN(e,t,t.theme.bgFillStyles??[],n-1e3):uN(e,t,t.theme.fillStyles,n)}function uN(e,t,n,i){if(i<=0||(n?.length??0)<i)return{fillCss:gr(e,t),gradientFillData:null};let r=n?.[i-1];if(!(r!=null&&r.exists()))return{fillCss:gr(e,t),gradientFillData:null};if(r.localName==="solidFill"){let o=tx(r,t,e);return{fillCss:oa(o.color,o.alpha),gradientFillData:null}}return r.localName==="gradFill"?{fillCss:XX(r,t,e),gradientFillData:QX(r,t,e)}:r.localName==="pattFill"?{fillCss:YX(r,t,e),gradientFillData:null}:r.localName==="noFill"?{fillCss:"transparent",gradientFillData:null}:{fillCss:gr(e,t),gradientFillData:null}}function Cme(e,t){let n=e.child("gradFill");if(!n.exists())return null;let i=n.child("gsLst"),r=[];for(let c of i.children("gs")){let u=c.numAttr("pos")??0,d=W2(u)*100,{color:f,alpha:h}=on(c,t),p=oa(f,h);r.push({position:d,color:p})}if(r.length===0)return null;r.sort((c,u)=>c.position-u.position);let o=n.child("lin"),a=0;o.exists()&&(a=Zm(o.numAttr("ang")??0));let s=e.numAttr("w")??0,l=De(s);return l<=0&&(l=1),{stops:r,angle:a,width:l,colorInterpolation:"linearRGB"}}var zme=new Set(["http:","https:","mailto:"]),Tme=new Set(["http:","https:"]);function tK(e){try{return new URL(e).protocol.toLowerCase()}catch{return}}function Q5(e){let t=tK(e);return t!==void 0&&zme.has(t)}function Wm(e){let t=tK(e);return t!==void 0&&Tme.has(t)}var Ame=128;function Ime(e,t){if(!(t>0))return e;let n=e.trim();if(!n)return`${100/t}%`;if(n.length>Ame)return e;let i=Rme(n);return i?`${i.value/t}${i.unit||"%"}`:e}function Rme(e){let t=0;(e[t]==="-"||e[t]==="+")&&t++;let n=0;for(;Mk(e.charCodeAt(t));)t++,n++;if(e[t]===".")for(t++;Mk(e.charCodeAt(t));)t++,n++;if(n===0)return null;if(e[t]==="e"||e[t]==="E"){let o=t;t++,(e[t]==="-"||e[t]==="+")&&t++;let a=0;for(;Mk(e.charCodeAt(t));)t++,a++;a===0&&(t=o)}let i=Number(e.slice(0,t));if(!Number.isFinite(i))return null;let r=e.slice(t);return Ome(r)?{value:i,unit:r}:null}function e4(e){let t=Lme(e);if(t<0)return null;let n=e.slice(t+1).trim();return Dme(n)?{imageLayers:Eme(e.slice(0,t)),color:n}:null}function Lme(e){let t=0;for(let n=e.length-1;n>=0;n--){let i=e[n];if(i===")")t++;else if(i==="(")t>0&&t--;else if(i===","&&t===0)return n}return-1}function Eme(e){return e.split("0 0 / 8px 8px").join("").trimEnd()}function Dme(e){if(!e)return!1;if(e[0]==="#"){let n=e.length-1;if(![3,4,6,8].includes(n))return!1;for(let i=1;i<e.length;i++)if(!Nme(e.charCodeAt(i)))return!1;return!0}let t=e.toLowerCase();if(t.startsWith("rgb(")||t.startsWith("rgba("))return e.endsWith(")")&&!e.slice(0,-1).includes(")");for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);if(!nK(i))return!1}return!0}function Ome(e){if(!e||e==="%")return!0;for(let t=0;t<e.length;t++)if(!nK(e.charCodeAt(t)))return!1;return!0}function Mk(e){return e>=48&&e<=57}function nK(e){return e>=65&&e<=90||e>=97&&e<=122}function Nme(e){return Mk(e)||e>=65&&e<=70||e>=97&&e<=102}var Pme=0;function iK(e,t,n,i){let r=Math.round(e*i+255*(1-i)),o=Math.round(t*i+255*(1-i)),a=Math.round(n*i+255*(1-i));return`rgb(${r},${o},${a})`}function rK(e,t){if(t.includes("gradient")&&t.includes(" 0 0 / ")){let n=e4(t);if(n){e.style.backgroundImage=n.imageLayers,e.style.backgroundSize="8px 8px",e.style.backgroundRepeat="repeat",e.style.backgroundColor=n.color;return}}t.includes("gradient")||t.startsWith("url(")||t.includes("repeating-")?e.style.background=t:e.style.backgroundColor=t}function jme(e){let t=e*Math.PI/180;return{x1:50-50*Math.cos(t),y1:50-50*Math.sin(t),x2:50+50*Math.cos(t),y2:50+50*Math.sin(t)}}function $Z(e,t){let n="http://www.w3.org/2000/svg";for(let i of t){let r=document.createElementNS(n,"stop");r.setAttribute("offset",`${i.position}%`),r.setAttribute("stop-color",i.color),e.appendChild(r)}}function Ume(e,t,n,i){let r="http://www.w3.org/2000/svg",o=document.createElementNS(r,"svg");o.setAttribute("data-pptx-background-gradient","true"),o.setAttribute("viewBox",`0 0 ${n} ${i}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.style.position="absolute",o.style.left="0",o.style.top="0",o.style.width="100%",o.style.height="100%",o.style.pointerEvents="none",o.style.display="block";let a=document.createElementNS(r,"defs");o.appendChild(a);let s=`bg-grad-${++Pme}`;if(t.type==="radial"&&t.pathType==="rect"){let l=t.cx??.5,c=t.cy??.5,u=(m,y)=>{let b=nx(t,{axis:y}),x=[];for(let _ of b){let S=_.position/100;x.push({offset:m-S*m,color:_.color}),x.push({offset:m+S*(1-m),color:_.color})}return x.sort((_,S)=>_.offset-S.offset)},d=`${s}-h`,f=document.createElementNS(r,"linearGradient");f.setAttribute("id",d),f.setAttribute("color-interpolation",t.colorInterpolation??"linearRGB"),f.setAttribute("x1","0%"),f.setAttribute("y1","0%"),f.setAttribute("x2","100%"),f.setAttribute("y2","0%");for(let m of u(l,"x")){let y=document.createElementNS(r,"stop");y.setAttribute("offset",`${(m.offset*100).toFixed(2)}%`),y.setAttribute("stop-color",m.color),f.appendChild(y)}a.appendChild(f);let h=`${s}-v`,p=document.createElementNS(r,"linearGradient");p.setAttribute("id",h),p.setAttribute("color-interpolation",t.colorInterpolation??"linearRGB"),p.setAttribute("x1","0%"),p.setAttribute("y1","0%"),p.setAttribute("x2","0%"),p.setAttribute("y2","100%");for(let m of u(c,"y")){let y=document.createElementNS(r,"stop");y.setAttribute("offset",`${(m.offset*100).toFixed(2)}%`),y.setAttribute("stop-color",m.color),p.appendChild(y)}a.appendChild(p);let g=document.createElementNS(r,"g");g.setAttribute("style","isolation: isolate");let v=document.createElementNS(r,"rect");v.setAttribute("width",String(n)),v.setAttribute("height",String(i)),v.setAttribute("fill","black"),g.appendChild(v);for(let m of[d,h]){let y=document.createElementNS(r,"rect");y.setAttribute("width",String(n)),y.setAttribute("height",String(i)),y.setAttribute("fill",`url(#${m})`),y.setAttribute("style","mix-blend-mode: lighten"),g.appendChild(y)}o.appendChild(g)}else if(t.type==="radial"){let l=document.createElementNS(r,"radialGradient");l.setAttribute("id",s),l.setAttribute("color-interpolation",t.colorInterpolation??"linearRGB"),l.setAttribute("gradientUnits","userSpaceOnUse");let c=t.cx??.5,u=t.cy??.5;l.setAttribute("cx",String(c*n)),l.setAttribute("cy",String(u*i));let d=Math.max(c,1-c),f=Math.max(u,1-u);l.setAttribute("r",String(Math.hypot(d*n,f*i))),$Z(l,nx(t,{width:n,height:i})),a.appendChild(l);let h=document.createElementNS(r,"rect");h.setAttribute("width",String(n)),h.setAttribute("height",String(i)),h.setAttribute("fill",`url(#${s})`),o.appendChild(h)}else{let l=document.createElementNS(r,"linearGradient");l.setAttribute("id",s),l.setAttribute("color-interpolation",t.colorInterpolation??"linearRGB"),l.setAttribute("gradientUnits","userSpaceOnUse");let c=jme(t.angle);l.setAttribute("x1",String(c.x1/100*n)),l.setAttribute("y1",String(c.y1/100*i)),l.setAttribute("x2",String(c.x2/100*n)),l.setAttribute("y2",String(c.y2/100*i)),$Z(l,t.stops),a.appendChild(l);let u=document.createElementNS(r,"rect");u.setAttribute("width",String(n)),u.setAttribute("height",String(i)),u.setAttribute("fill",`url(#${s})`),o.appendChild(u)}e.style.position||(e.style.position="relative"),e.style.background="",e.querySelectorAll('svg[data-pptx-background-gradient="true"]').forEach(l=>{l.remove()}),e.insertBefore(o,e.firstChild)}function Bme(e,t,n){return oK(eK(e,t),t,n)}function oK(e,t,n){return e!=null&&e.pathType?(Ume(n,e,t.presentation.width,t.presentation.height),!0):!1}function Fme(e,t){let n,i=e.slide.rels;if(e.slide.background?(n=e.slide.background,i=e.slide.rels):e.layout.background?(n=e.layout.background,i=e.layout.rels):e.master.background&&(n=e.master.background,i=e.master.rels),!n){t.style.backgroundColor="#FFFFFF";return}let r=n.child("bgPr");if(r.exists()){qme(r,e,t,i);return}let o=n.child("bgRef");if(o.exists()){Vme(o,e,t);return}t.style.backgroundColor="#FFFFFF"}function qme(e,t,n,i){let r=e.child("solidFill");if(r.exists()){let{color:a,alpha:s}=on(r,t),l=a.startsWith("#")?a:`#${a}`;if(s<1){let{r:c,g:u,b:d}=Gt(l);n.style.backgroundColor=iK(c,u,d,s)}else n.style.backgroundColor=l;return}if(e.child("gradFill").exists()){if(Bme(e,t,n))return;let a=Ul(e,t);a&&(n.style.background=a);return}if(e.child("pattFill").exists()){let a=Ul(e,t);a&&rK(n,a);return}let o=e.child("blipFill");if(o.exists()){Hme(o,t,n,i);return}if(e.child("noFill").exists()){n.style.backgroundColor="#FFFFFF";return}}function Vme(e,t,n){var i,r;let o=e.numAttr("idx")??0;if(o>=1001&&o-1e3<=(((i=t.theme.bgFillStyles)==null?void 0:i.length)??0)||o>0&&o<=(((r=t.theme.fillStyles)==null?void 0:r.length)??0)){let{fillCss:l,gradientFillData:c}=Mme(e,t);if(oK(c,t,n))return;rK(n,l);return}let{color:a,alpha:s}=on(e,t);if(a&&a!=="#000000"){let l=a.startsWith("#")?a:`#${a}`;if(s<1){let{r:c,g:u,b:d}=Gt(l);n.style.backgroundColor=iK(c,u,d,s)}else n.style.backgroundColor=l}else n.style.backgroundColor="#FFFFFF"}function Hme(e,t,n,i){var r;let o=e.child("blip"),a=o.attr("embed")??o.attr("r:embed"),s=o.attr("link")??o.attr("r:link"),l=a??s;if(!l)return;let c=(i??t.slide.rels).get(l);if(!c)return;let u;if(Rs(c.targetMode)){if(!Wm(c.target))return;u=c.target}else{let d=Hm(c.target,t.presentation.media);if(!d){if(t.presentation.mediaResolver){let p=W5(c.target,t.presentation.media,t.presentation.mediaResolver).then(g=>{if(!g)return;let v=kh(g.mediaPath,g.data,t.mediaUrlCache);wZ(e,n,v)}).catch(()=>{});(r=t.asyncTasks)==null||r.push(p),t.asyncTasks}return}let{mediaPath:f,data:h}=d;u=kh(f,h,t.mediaUrlCache)}wZ(e,n,u)}function wZ(e,t,n){let i=Xme(e.child("blip"));if(i<1||e.child("srcRect").exists()){Zme(e,t,n,i);return}t.style.backgroundImage=`url("${n}")`;let r=e.child("stretch");r.exists()&&(Kme(t,r.child("fillRect")),t.style.backgroundRepeat="no-repeat"),e.child("tile").exists()&&(t.style.backgroundRepeat="repeat",t.style.backgroundSize="auto")}function Zme(e,t,n,i){t.style.position||(t.style.position="relative"),t.style.backgroundImage="",t.querySelectorAll('[data-pptx-background-image="true"]').forEach(l=>{l.remove()});let r=document.createElement("div");r.setAttribute("data-pptx-background-image","true"),r.style.position="absolute",r.style.pointerEvents="none",r.style.opacity=`${Number(i.toFixed(4))}`;let o=e.child("stretch"),a=o.exists()?o.child("fillRect"):new jl(null);Wme(r,a);let s=e.child("srcRect");if(s.exists()){r.style.overflow="hidden";let l=document.createElement("div");l.setAttribute("data-pptx-background-crop","true"),l.style.position="absolute",l.style.backgroundImage=`url("${n}")`,l.style.backgroundSize="100% 100%",l.style.backgroundRepeat="no-repeat",Yme(l,s),r.appendChild(l),t.insertBefore(r,t.firstChild);return}r.style.backgroundImage=`url("${n}")`,o.exists()&&(r.style.backgroundSize="100% 100%",r.style.backgroundRepeat="no-repeat"),e.child("tile").exists()&&(r.style.backgroundRepeat="repeat",r.style.backgroundSize="auto"),t.insertBefore(r,t.firstChild)}function Gme(e){if(!e.exists())return{left:0,top:0,width:100,height:100};let t=aa(e,"l"),n=aa(e,"t"),i=aa(e,"r"),r=aa(e,"b");return{left:t,top:n,width:100-t-i,height:100-n-r}}function Wme(e,t){let n=Gme(t);e.style.left=`${n.left}%`,e.style.top=`${n.top}%`,e.style.width=`${n.width}%`,e.style.height=`${n.height}%`}function Yme(e,t){let n=aa(t,"l")/100,i=aa(t,"t")/100,r=aa(t,"r")/100,o=aa(t,"b")/100,a=1-n-r,s=1-i-o;if(a<=.001||s<=.001){e.style.left="0%",e.style.top="0%",e.style.width="100%",e.style.height="100%";return}let l=1/a,c=1/s;e.style.left=`${-n*l*100}%`,e.style.top=`${-i*c*100}%`,e.style.width=`${l*100}%`,e.style.height=`${c*100}%`}function Xme(e){let t=1,n=e.child("alphaModFix");n.exists()&&(t*=(n.numAttr("amt")??1e5)/1e5);let i=e.child("alphaMod");i.exists()&&(t*=(i.numAttr("val")??1e5)/1e5);let r=e.child("alphaOff");return r.exists()&&(t+=(r.numAttr("val")??0)/1e5),Math.max(0,Math.min(1,t))}function aa(e,t){return(e.numAttr(t)??0)/1e3}function kZ(e,t){let n=e+t;return Math.abs(n)<1e-4?0:e/n*100}function Kme(e,t){if(!t.exists()){e.style.backgroundSize="100% 100%",e.style.backgroundPosition="";return}let n=aa(t,"l"),i=aa(t,"t"),r=aa(t,"r"),o=aa(t,"b"),a=100-n-r,s=100-i-o;e.style.backgroundSize=`${a}% ${s}%`,e.style.backgroundPosition=`${kZ(n,r)}% ${kZ(i,o)}%`}function Ck(e,t){var n,i;let r=(n=e?.bodyProperties)==null?void 0:n.child(t);if(r!=null&&r.exists())return r;let o=(i=e?.layoutBodyProperties)==null?void 0:i.child(t);if(o!=null&&o.exists())return o}var Jme=/^\+(mj|mn)-(lt|ea|cs)$/,Qme={lt:"latin",ea:"ea",cs:"cs"},ege=["Hans","Hant","Jpan","Hang"];function tge(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):typeof e=="string"&&e.length>0?[e]:[]}function nge(e){let t=e.toLowerCase();if(t.startsWith("zh"))return/-(tw|hk|mo)\b/.test(t)?"Hant":"Hans";if(t.startsWith("ja"))return"Jpan";if(t.startsWith("ko"))return"Hang";if(t.startsWith("ar"))return"Arab";if(t.startsWith("he"))return"Hebr";if(t.startsWith("th"))return"Thai";if(t.startsWith("hi")||t.startsWith("mr")||t.startsWith("ne"))return"Deva"}function ige(e,t){if(e){for(let n of tge(t)){let i=nge(n);if(i&&e[i])return e[i]}for(let n of ege)if(e[n])return e[n]}}function jb(e,t,n){let i=e.match(Jme);if(!i)return e;let r=i[1],o=i[2],a=r==="mj"?t.theme.majorFont:t.theme.minorFont,s=Qme[o],l=a[s];if(l)return l;if(o==="ea"){let c=ige(a.scripts,n);if(c)return c}return a.latin||a.ea||a.cs||e}function Tm(e,t,n){let i=new Set,r=[];for(let o of e){if(!o)continue;let a=jb(o,t,n).trim();if(!a)continue;let s=a.toLowerCase();i.has(s)||(i.add(s),r.push(a))}return r}var rge=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","emoji","math","fangsong"]),oge=["PingFang SC","Hiragino Sans GB","Noto Sans CJK SC","Source Han Sans SC","Arial Unicode MS","sans-serif"],age=new Set(["microsoft yahei","microsoft yahei ui","\u5FAE\u8F6F\u96C5\u9ED1","dengxian","\u7B49\u7EBF","simhei","\u9ED1\u4F53","heiti sc"]),sge={calibri:["Calibri","Aptos","Carlito","system-ui","Arial","Helvetica","sans-serif"],"calibri light":["Calibri Light","Aptos Display","Aptos","Carlito","system-ui","Arial","Helvetica","sans-serif"],aptos:["Aptos","system-ui","Arial","Helvetica","sans-serif"],"aptos display":["Aptos Display","Aptos","system-ui","Arial","Helvetica","sans-serif"],"microsoft yahei":["Microsoft YaHei","\u5FAE\u8F6F\u96C5\u9ED1"],"microsoft yahei ui":["Microsoft YaHei UI","Microsoft YaHei","\u5FAE\u8F6F\u96C5\u9ED1"],\u5FAE\u8F6F\u96C5\u9ED1:["\u5FAE\u8F6F\u96C5\u9ED1","Microsoft YaHei"],dengxian:["DengXian","\u7B49\u7EBF"],\u7B49\u7EBF:["\u7B49\u7EBF","DengXian"],simhei:["SimHei","\u9ED1\u4F53"],\u9ED1\u4F53:["\u9ED1\u4F53","SimHei"],"heiti sc":["Heiti SC","\u9ED1\u4F53","SimHei"]};function Yk(e){return e.trim().replace(/^['"]|['"]$/g,"").toLowerCase()}function lge(e){let t=Yk(e);return rge.has(t)?t:`"${e.trim().replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function MZ(e){let t=Yk(e);return sge[t]??[e.trim()]}function Am(e){let t=Array.isArray(e)?e.flatMap(MZ):MZ(e),n=t.some(r=>age.has(Yk(r)))?[...t,...oge]:t,i=new Set;return n.filter(r=>{let o=Yk(r);return i.has(o)?!1:(i.add(o),!0)}).map(lge).join(", ")}function cge(e){let t=e.replace(/\\/g,"/"),n=t.lastIndexOf("/");return n>=0?t.slice(0,n):""}function aK(e){let t=e.search(/[?#]/);return t>=0?e.slice(0,t):e}function Xk(e){return aK(e).replace(/\\/g,"/").replace(/^\/+/,"")}function uge(e,t){if(Rs(t.targetMode))return;let n=cge(e.slide.slidePath||"ppt/slides/slide1.xml"),i=Xk(Ia(n,t.target)),r=e.presentation.slides.findIndex(a=>Xk(a.slidePath||"")===i);if(r>=0)return r;let o=aK(t.target).match(/(?:^|[\\/])slide(\d+)\.xml$/i);if(o)return parseInt(o[1],10)-1}function CZ(e){let t=e.slide.index;if(t>=0&&t<e.presentation.slides.length)return t;let n=Xk(e.slide.slidePath||""),i=e.presentation.slides.findIndex(r=>Xk(r.slidePath||"")===n);return i>=0?i:0}function zZ(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function dge(e,t){let n=t.toLowerCase();for(let i of e.split("&")){let[r,...o]=i.split("=");if(zZ(r).toLowerCase()===n)return zZ(o.join("="))}}function hge(e,t){var n;let i=t.match(/^ppaction:\/\/hlinkshowjump\?(.+)$/i);if(!i)return;let r=(n=dge(i[1],"jump"))==null?void 0:n.toLowerCase(),o=e.presentation.slides.length;if(o!==0)switch(r){case"firstslide":return 0;case"lastslide":return o-1;case"nextslide":{let a=CZ(e)+1;return a<o?a:void 0}case"previousslide":{let a=CZ(e)-1;return a>=0?a:void 0}default:return}}function t4(e,t,n){if(t?.toLowerCase()==="ppaction://hlinksldjump"&&n)return uge(e,n);if(t)return hge(e,t)}function n4(e){return`Go to slide ${e+1}`}function sK(e){if(!e)return;let t=e.trim();if(!(t.length===0||t.length>32))return/^[+-]?(?:\d+(?:[.,]\d+)?|\d{1,3}(?:,\d{3})+(?:\.\d+)?)\s*(?:%|[A-Za-z]{1,4})?$/.test(t)?t:void 0}function fge(e){return sK(e)!==void 0}function TZ(e,t){t&&e.appendChild(document.createTextNode(t.replace(/ {2}/g," \xA0")))}function pge(e){let t=new Map,n=1;for(let i=0;i<e.length;i++){if(t.has(i))continue;let r="",o=-1;for(let a=i;a<e.length&&a<i+4;a++){let s=e[a].text;if(s===void 0||s===`
111
111
  `||s.includes(" ")||(r+=s,r.trim().length>32))break;a>i&&fge(r)&&(o=a)}if(o>i){let a=n++;for(let s=i;s<=o;s++)t.set(s,a);i=o}}return t}function Jc(e,t){if(!e||!e.exists())return new jl(null);let n=e.child(`lvl${t+1}pPr`);return n.exists()?n:e.child("defPPr")}function mge(e){if(!e||!e.type)return"other";let t=e.type;return t==="title"||t==="ctrTitle"?"title":t==="body"||t==="subTitle"||t==="obj"||t==="dt"||t==="ftr"||t==="sldNum"?"body":"other"}function AZ(e,t){for(let n of e){let i,r=n.child("nvSpPr");if(r.exists()&&(i=r.child("nvPr").child("ph")),!i||!i.exists()){let s=n.child("nvPicPr");s.exists()&&(i=s.child("nvPr").child("ph"))}if(!i||!i.exists())continue;let o=i.attr("type"),a=i.numAttr("idx");if(t.idx!==void 0&&a===t.idx||t.type&&o===t.type)return n}}function IZ(e){let t=e.child("txBody");if(!t.exists())return;let n=t.child("lstStyle");return n.exists()?n:void 0}function Ud(e,t){if(!t.exists())return;let n=t.attr("algn");n&&(e.align=n);let i=t.attr("rtl");i!==void 0&&(e.rtl=yr(i));let r=t.numAttr("marL");r!==void 0&&(e.marginLeft=De(r));let o=t.numAttr("indent");o!==void 0&&(e.textIndent=De(o));let a=t.numAttr("defTabSz");a!==void 0&&(e.defaultTabSize=De(a));let s=t.child("lnSpc");if(s.exists()){let m=s.child("spcPct");if(m.exists()){let b=m.numAttr("val");b!==void 0&&(e.lineHeight=`${(b/1e5).toFixed(3)}`)}let y=s.child("spcPts");if(y.exists()){let b=y.numAttr("val");b!==void 0&&(e.lineHeight=`${b/100}pt`,e.lineHeightAbsolute=!0)}}let l=t.child("spcBef");if(l.exists()){let m=l.child("spcPts");if(m.exists()){let b=m.numAttr("val");b!==void 0&&(e.spaceBefore=b/100)}let y=l.child("spcPct");if(y.exists()){let b=y.numAttr("val");b!==void 0&&(e.spaceBeforePct=b/1e5)}}let c=t.child("spcAft");if(c.exists()){let m=c.child("spcPts");if(m.exists()){let b=m.numAttr("val");b!==void 0&&(e.spaceAfter=b/100)}let y=c.child("spcPct");if(y.exists()){let b=y.numAttr("val");b!==void 0&&(e.spaceAfterPct=b/1e5)}}let u=t.child("buChar");u.exists()&&(e.bulletChar=u.attr("char")||"",e.bulletNone=!1);let d=t.child("buAutoNum");if(d.exists()){e.bulletAutoNum=d.attr("type")||"arabicPeriod";let m=d.numAttr("startAt");m!==void 0&&(e.bulletAutoNumStartAt=m),e.bulletNone=!1}t.child("buNone").exists()&&(e.bulletNone=!0,e.bulletChar=void 0,e.bulletAutoNum=void 0);let f=t.child("buFont");f.exists()&&(e.bulletFont=f.attr("typeface"));let h=t.child("buSzPct");if(h.exists()){let m=h.numAttr("val");m!==void 0&&(e.bulletSizePct=m/1e5,e.bulletSizePt=void 0)}let p=t.child("buSzPts");if(p.exists()){let m=p.numAttr("val");m!==void 0&&(e.bulletSizePt=m/100,e.bulletSizePct=void 0)}t.child("buSzTx").exists()&&(e.bulletSizePct=void 0,e.bulletSizePt=void 0),t.child("buClrTx").exists()&&(e.bulletColorFollowsText=!0,e.bulletColorNode=void 0);let g=t.child("buClr");g.exists()&&(e.bulletColorNode=g,e.bulletColorFollowsText=!1);let v=t.child("defRPr");v.exists()&&(e.defRPr=v,e.defRPrs??(e.defRPrs=[]),e.defRPrs.push(v))}function gge(e){if(!(e!=null&&e.exists()))return"none";if(e.child("gradFill").exists())return"explicit";let t=e.child("solidFill");if(!t.exists())return"none";let n=t.child("schemeClr").attr("val");return n==="tx1"||n==="tx2"?"defaultTextScheme":"explicit"}function _m(e,t,n){if(!t.exists())return;let i=t.numAttr("sz");i!==void 0&&(e.fontSize=i/100);let r=t.attr("b");r!==void 0&&(e.bold=yr(r));let o=t.attr("i");o!==void 0&&(e.italic=yr(o));let a=t.attr("u");a!==void 0&&a!=="none"&&(e.underline=!0),a==="none"&&(e.underline=!1);let s=t.attr("strike");s!==void 0&&s!=="noStrike"&&(e.strikethrough=!0),s==="noStrike"&&(e.strikethrough=!1);let l=t.child("highlight");l.exists()&&(e.highlightColor=gr(l,n));let c=t.child("uFill");if(c.exists()){let $=c.child("solidFill");$.exists()&&(e.underlineColor=gr($,n),e.underlineFollowsText=!1)}t.child("uFillTx").exists()&&(e.underlineFollowsText=!0,e.underlineColor=void 0);let u=t.child("solidFill");if(u.exists()){delete e.textGradientCss,delete e.textPatternCss,delete e.textNoFill;let{color:$,alpha:C}=on(u,n),w=$.startsWith("#")?$:`#${$}`;if(C<1){let{r:z,g:A,b:M}=i4(w);e.color=`rgba(${z},${A},${M},${C.toFixed(3)})`}else e.color=w}let d=t.child("gradFill");if(d.exists()){delete e.color,delete e.textPatternCss,delete e.textNoFill;let $=NZ(d,n);$&&(e.textGradientCss=$)}if(t.child("pattFill").exists()){delete e.color,delete e.textGradientCss,delete e.textNoFill;let $=Ul(t,n);$&&(e.textPatternCss=$)}let f=[],h=[t.attr("lang"),t.attr("altLang")];for(let $ of["latin","ea","cs"]){let C=t.child($);if(!C.exists())continue;let w=C.attr("typeface");w&&f.push(jb(w,n,h))}f.length>0&&(e.fontFamily=f[0],e.fontFamilyStack=f);let p=t.child("hlinkClick");if(p.exists()){let $=p.attr("id")??p.attr("r:id"),C=$?n.slide.rels.get($):void 0,w=p.attr("action"),z=t4(n,w,C);z!==void 0&&n.onNavigate?(e.hlinkSlideIndex=z,e.hlinkTooltip=p.attr("tooltip"),e.underline===void 0&&(e.underline=!0)):C&&Rs(C.targetMode)&&Q5(C.target)&&(e.hlinkClick=C.target,e.underline===void 0&&(e.underline=!0))}let g=t.numAttr("spc");g!==void 0&&(e.letterSpacingPt=g/100);let v=t.numAttr("kern");v!==void 0&&(e.kern=v/100);let m=t.attr("cap");m!==void 0&&(e.cap=m);let y=t.numAttr("baseline");y!==void 0&&(e.baseline=y);let b=t.child("effectLst"),x=b.child("outerShdw");if(x.exists()){let $=yge(x,n);$&&LZ(e,$)}let _=b.child("glow");if(_.exists()){let $=vge(_,n);$&&LZ(e,$)}t.child("noFill").exists()&&(delete e.color,delete e.textGradientCss,delete e.textPatternCss,e.textNoFill=!0);let S=t.child("ln");if(S.exists()&&!S.child("noFill").exists()){let $=S.numAttr("w");e.textOutlineWidth=$?De($):.75;let C=S.child("solidFill");if(C.exists()){let{color:z,alpha:A}=on(C,n);e.textOutlineColor=Y2(z,A)}let w=S.child("gradFill");w.exists()&&(e.textOutlineGradientCss=NZ(w,n))}}function lK(e,t,n){for(let i of t.defRPrs??[])_m(e,i,n)}function RZ(e,t){let n={};return lK(n,e,t),n}function i4(e){let t=e.replace(/^#/,""),n=parseInt(t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,16);return{r:n>>16&255,g:n>>8&255,b:n&255}}function Y2(e,t){let n=e.startsWith("#")?e:`#${e}`;if(t>=1)return n;let{r:i,g:r,b:o}=i4(n);return`rgba(${i},${r},${o},${t.toFixed(3)})`}function vge(e,t){let n=De(e.numAttr("rad")??0);if(!(n>0))return;let{color:i,alpha:r}=on(e,t);if(!(!i||r<=0))return`0px 0px ${n.toFixed(1)}px ${Y2(i,r)}`}function yge(e,t){let n=De(e.numAttr("dist")??0),i=De(e.numAttr("blurRad")??0),r=(e.numAttr("dir")??0)/6e4,o=n*Math.cos(r*Math.PI/180),a=n*Math.sin(r*Math.PI/180),{color:s,alpha:l}=on(e,t);if(!(!s||l<=0))return`${o.toFixed(1)}px ${a.toFixed(1)}px ${i.toFixed(1)}px ${Y2(s,l)}`}function LZ(e,t){e.textShadow=e.textShadow?`${e.textShadow}, ${t}`:t}function EZ(e,t){if(!(e!=null&&e.exists()))return;let n={};return _m(n,e,t),n.color}function DZ(e){if(!e)return;let t=e.trim().toLowerCase();if(t.startsWith("#")){let{r:l,g:c,b:u}=i4(t);return`${l},${c},${u},1`}let n=t.match(/^rgba?\(([^)]+)\)$/);if(!n)return t;let i=n[1].split(",").map(l=>l.trim());if(i.length<3)return t;let[r,o,a]=i,s=i[3]??"1";return`${Number(r)},${Number(o)},${Number(a)},${Number(s)}`}function OZ(e,t){let n=DZ(e),i=DZ(t);return n!==void 0&&n===i}function bge(e){return e?.child("solidFill").child("srgbClr").exists()??!1}function xge(e){return e?.child("hlinkClick").exists()??!1}function _ge(e){return!!e.hlinkClick||e.hlinkSlideIndex!==void 0}function Sge(e,t,n,i){if(!n)return!1;for(let o of t.runs){if(o===e||xge(o.properties))continue;let a=EZ(o.properties,i);if(OZ(n,a))return!0}let r=EZ(t.endParaRPr,i);return OZ(n,r)}function $ge(e,t,n,i,r,o){return _ge(n)?!r||i==="defaultTextScheme"?!0:i!=="explicit"||!bge(e.properties)?!1:Sge(e,t,n.color,o):!1}function NZ(e,t){let n=e.child("gsLst"),i=[];for(let a of n.children("gs")){let s=a.numAttr("pos")??0,l=W2(s)*100,{color:c,alpha:u}=on(a,t);i.push({position:l,color:Y2(c,u)})}if(i.length===0)return"";i.sort((a,s)=>a.position-s.position);let r=i.map(a=>`${a.color} ${a.position.toFixed(1)}%`).join(", "),o=e.child("lin");return o.exists()?`linear-gradient(${((Zm(o.numAttr("ang")??0)+90)%360).toFixed(1)}deg, ${r})`:`linear-gradient(180deg, ${r})`}function PZ(e,t){var n;if(e.style.background=t,!e.style.background&&t.includes(" 0 0 / 8px 8px, ")){let i=t.split(" 0 0 / 8px 8px, "),r=(n=i[i.length-1])==null?void 0:n.trim(),o=i.slice(0,-1).map(a=>a.trim());o.length>0&&(e.style.backgroundImage=o.join(", "),e.style.backgroundSize=o.map(()=>"8px 8px").join(", ")),r&&(e.style.backgroundColor=r)}e.style.webkitBackgroundClip="text",e.style.backgroundClip="text",e.style.color="transparent"}function wge(e,t){switch(e){case"arabicPeriod":return`${t}.`;case"arabicParenR":return`${t})`;case"arabicParenBoth":return`(${t})`;case"arabicPlain":return`${t}`;case"romanUcPeriod":return`${jZ(t)}.`;case"romanLcPeriod":return`${jZ(t).toLowerCase()}.`;case"alphaUcPeriod":return`${String.fromCharCode(64+((t-1)%26+1))}.`;case"alphaLcPeriod":return`${String.fromCharCode(96+((t-1)%26+1))}.`;case"alphaUcParenR":return`${String.fromCharCode(64+((t-1)%26+1))})`;case"alphaLcParenR":return`${String.fromCharCode(96+((t-1)%26+1))})`;default:return`${t}.`}}function jZ(e){let t=[1e3,900,500,400,100,90,50,40,10,9,5,4,1],n=["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"],i="",r=e;for(let o=0;o<t.length;o++)for(;r>=t[o];)i+=n[o],r-=t[o];return i}function cK(e,t,n,i,r){var o,a,s,l,c;let u=mge(t),d=1,f=0,h=Ck(e,"normAutofit");if(h!=null&&h.exists()){let b=h.numAttr("fontScale");b!==void 0&&(d=b/1e5);let x=h.numAttr("lnSpcReduction");x!==void 0&&(f=x/1e5)}let p=new Map,g=e.paragraphs.map((b,x)=>({index:x,visible:b.runs.some(_=>_.text!=null&&_.text.length>0)})).filter(b=>b.visible).map(b=>b.index),v=g[0],m=g[g.length-1],y=g.length===1?g[0]:void 0;for(let[b,x]of e.paragraphs.entries()){let _=document.createElement("div");_.style.width="100%",_.style.minWidth="0px",_.style.maxWidth="100%",_.style.boxSizing="border-box",_.style.overflowWrap="anywhere";let S=x.level;r!=null&&r.isVerticalText&&(_.style.wordBreak="keep-all");let $=x.runs.some(O=>O.text===`