mulmoclaude 0.5.1 → 0.5.2
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.
- package/client/assets/{html2canvas-Cx501zZr-BORHg-NU.js → html2canvas-Cx501zZr-Bug0qRNv.js} +1 -1
- package/client/assets/{index-BeeoDtvq.js → index-DbTz2Mfs.js} +6 -6
- package/client/assets/{index.es-D4YyL_Dg-CB_ogqQG.js → index.es-D4YyL_Dg-BgT6a3Nd.js} +1 -1
- package/client/index.html +1 -1
- package/package.json +1 -1
- package/server/api/routes/pdf.ts +18 -10
- package/src/plugins/presentHtml/View.vue +6 -1
- package/src/utils/image/rewriteHtmlImageRefs.ts +50 -0
|
@@ -97,12 +97,12 @@ ${this.parser.parse(Ph)}</blockquote>
|
|
|
97
97
|
${Ph}</tr>
|
|
98
98
|
`}tablecell(Ph){let Fh=this.parser.parseInline(Ph.tokens),Ih=Ph.header?`th`:`td`;return(Ph.align?`<${Ih} align="${Ph.align}">`:`<${Ih}>`)+Fh+`</${Ih}>
|
|
99
99
|
`}strong({tokens:Ph}){return`<strong>${this.parser.parseInline(Ph)}</strong>`}em({tokens:Ph}){return`<em>${this.parser.parseInline(Ph)}</em>`}codespan({text:Ph}){return`<code>${O$4(Ph,!0)}</code>`}br(Ph){return`<br>`}del({tokens:Ph}){return`<del>${this.parser.parseInline(Ph)}</del>`}link({href:Ph,title:Fh,tokens:Ih}){let Lh=this.parser.parseInline(Ih),Rh=J$4(Ph);if(Rh===null)return Lh;Ph=Rh;let zh=`<a href="`+Ph+`"`;return Fh&&(zh+=` title="`+O$4(Fh)+`"`),zh+=`>`+Lh+`</a>`,zh}image({href:Ph,title:Fh,text:Ih,tokens:Lh}){Lh&&(Ih=this.parser.parseInline(Lh,this.parser.textRenderer));let Rh=J$4(Ph);if(Rh===null)return O$4(Ih);Ph=Rh;let zh=`<img src="${Ph}" alt="${O$4(Ih)}"`;return Fh&&(zh+=` title="${O$4(Fh)}"`),zh+=`>`,zh}text(Ph){return`tokens`in Ph&&Ph.tokens?this.parser.parseInline(Ph.tokens):`escaped`in Ph&&Ph.escaped?Ph.text:O$4(Ph.text)}},L$5=class{strong({text:Ph}){return Ph}em({text:Ph}){return Ph}codespan({text:Ph}){return Ph}del({text:Ph}){return Ph}html({text:Ph}){return Ph}text({text:Ph}){return Ph}link({text:Ph}){return``+Ph}image({text:Ph}){return``+Ph}br(){return``}checkbox({raw:Ph}){return Ph}},b$4=class Ph{options;renderer;textRenderer;constructor(Ph){this.options=Ph||T$4,this.options.renderer=this.options.renderer||new y$3,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new L$5}static parse(Fh,Ih){return new Ph(Ih).parse(Fh)}static parseInline(Fh,Ih){return new Ph(Ih).parseInline(Fh)}parse(Ph){this.renderer.parser=this;let Fh=``;for(let Ih=0;Ih<Ph.length;Ih++){let Lh=Ph[Ih];if(this.options.extensions?.renderers?.[Lh.type]){let Ph=Lh,Ih=this.options.extensions.renderers[Ph.type].call({parser:this},Ph);if(Ih!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(Ph.type)){Fh+=Ih||``;continue}}let Rh=Lh;switch(Rh.type){case`space`:Fh+=this.renderer.space(Rh);break;case`hr`:Fh+=this.renderer.hr(Rh);break;case`heading`:Fh+=this.renderer.heading(Rh);break;case`code`:Fh+=this.renderer.code(Rh);break;case`table`:Fh+=this.renderer.table(Rh);break;case`blockquote`:Fh+=this.renderer.blockquote(Rh);break;case`list`:Fh+=this.renderer.list(Rh);break;case`checkbox`:Fh+=this.renderer.checkbox(Rh);break;case`html`:Fh+=this.renderer.html(Rh);break;case`def`:Fh+=this.renderer.def(Rh);break;case`paragraph`:Fh+=this.renderer.paragraph(Rh);break;case`text`:Fh+=this.renderer.text(Rh);break;default:{let Ph=`Token with "`+Rh.type+`" type was not found.`;if(this.options.silent)return console.error(Ph),``;throw Error(Ph)}}}return Fh}parseInline(Ph,Fh=this.renderer){this.renderer.parser=this;let Ih=``;for(let Lh=0;Lh<Ph.length;Lh++){let Rh=Ph[Lh];if(this.options.extensions?.renderers?.[Rh.type]){let Ph=this.options.extensions.renderers[Rh.type].call({parser:this},Rh);if(Ph!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(Rh.type)){Ih+=Ph||``;continue}}let zh=Rh;switch(zh.type){case`escape`:Ih+=Fh.text(zh);break;case`html`:Ih+=Fh.html(zh);break;case`link`:Ih+=Fh.link(zh);break;case`image`:Ih+=Fh.image(zh);break;case`checkbox`:Ih+=Fh.checkbox(zh);break;case`strong`:Ih+=Fh.strong(zh);break;case`em`:Ih+=Fh.em(zh);break;case`codespan`:Ih+=Fh.codespan(zh);break;case`br`:Ih+=Fh.br(zh);break;case`del`:Ih+=Fh.del(zh);break;case`text`:Ih+=Fh.text(zh);break;default:{let Ph=`Token with "`+zh.type+`" type was not found.`;if(this.options.silent)return console.error(Ph),``;throw Error(Ph)}}}return Ih}},P$4=class{options;block;constructor(Ph){this.options=Ph||T$4}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(Ph){return Ph}postprocess(Ph){return Ph}processAllTokens(Ph){return Ph}emStrongMask(Ph){return Ph}provideLexer(Ph=this.block){return Ph?x$4.lex:x$4.lexInline}provideParser(Ph=this.block){return Ph?b$4.parse:b$4.parseInline}},D$4=class{defaults=z$5();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=b$4;Renderer=y$3;TextRenderer=L$5;Lexer=x$4;Tokenizer=w$4;Hooks=P$4;constructor(...Ph){this.use(...Ph)}walkTokens(Ph,Fh){let Ih=[];for(let Lh of Ph)switch(Ih=Ih.concat(Fh.call(this,Lh)),Lh.type){case`table`:{let Ph=Lh;for(let Lh of Ph.header)Ih=Ih.concat(this.walkTokens(Lh.tokens,Fh));for(let Lh of Ph.rows)for(let Ph of Lh)Ih=Ih.concat(this.walkTokens(Ph.tokens,Fh));break}case`list`:{let Ph=Lh;Ih=Ih.concat(this.walkTokens(Ph.items,Fh));break}default:{let Ph=Lh;this.defaults.extensions?.childTokens?.[Ph.type]?this.defaults.extensions.childTokens[Ph.type].forEach(Lh=>{let Rh=Ph[Lh].flat(1/0);Ih=Ih.concat(this.walkTokens(Rh,Fh))}):Ph.tokens&&(Ih=Ih.concat(this.walkTokens(Ph.tokens,Fh)))}}return Ih}use(...Ph){let Fh=this.defaults.extensions||{renderers:{},childTokens:{}};return Ph.forEach(Ph=>{let Ih={...Ph};if(Ih.async=this.defaults.async||Ih.async||!1,Ph.extensions&&(Ph.extensions.forEach(Ph=>{if(!Ph.name)throw Error(`extension name required`);if(`renderer`in Ph){let Ih=Fh.renderers[Ph.name];Ih?Fh.renderers[Ph.name]=function(...Fh){let Lh=Ph.renderer.apply(this,Fh);return Lh===!1&&(Lh=Ih.apply(this,Fh)),Lh}:Fh.renderers[Ph.name]=Ph.renderer}if(`tokenizer`in Ph){if(!Ph.level||Ph.level!==`block`&&Ph.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let Ih=Fh[Ph.level];Ih?Ih.unshift(Ph.tokenizer):Fh[Ph.level]=[Ph.tokenizer],Ph.start&&(Ph.level===`block`?Fh.startBlock?Fh.startBlock.push(Ph.start):Fh.startBlock=[Ph.start]:Ph.level===`inline`&&(Fh.startInline?Fh.startInline.push(Ph.start):Fh.startInline=[Ph.start]))}`childTokens`in Ph&&Ph.childTokens&&(Fh.childTokens[Ph.name]=Ph.childTokens)}),Ih.extensions=Fh),Ph.renderer){let Fh=this.defaults.renderer||new y$3(this.defaults);for(let Ih in Ph.renderer){if(!(Ih in Fh))throw Error(`renderer '${Ih}' does not exist`);if([`options`,`parser`].includes(Ih))continue;let Lh=Ih,Rh=Ph.renderer[Lh],zh=Fh[Lh];Fh[Lh]=(...Ph)=>{let Ih=Rh.apply(Fh,Ph);return Ih===!1&&(Ih=zh.apply(Fh,Ph)),Ih||``}}Ih.renderer=Fh}if(Ph.tokenizer){let Fh=this.defaults.tokenizer||new w$4(this.defaults);for(let Ih in Ph.tokenizer){if(!(Ih in Fh))throw Error(`tokenizer '${Ih}' does not exist`);if([`options`,`rules`,`lexer`].includes(Ih))continue;let Lh=Ih,Rh=Ph.tokenizer[Lh],zh=Fh[Lh];Fh[Lh]=(...Ph)=>{let Ih=Rh.apply(Fh,Ph);return Ih===!1&&(Ih=zh.apply(Fh,Ph)),Ih}}Ih.tokenizer=Fh}if(Ph.hooks){let Fh=this.defaults.hooks||new P$4;for(let Ih in Ph.hooks){if(!(Ih in Fh))throw Error(`hook '${Ih}' does not exist`);if([`options`,`block`].includes(Ih))continue;let Lh=Ih,Rh=Ph.hooks[Lh],zh=Fh[Lh];P$4.passThroughHooks.has(Ih)?Fh[Lh]=Ph=>{if(this.defaults.async&&P$4.passThroughHooksRespectAsync.has(Ih))return(async()=>{let Ih=await Rh.call(Fh,Ph);return zh.call(Fh,Ih)})();let Lh=Rh.call(Fh,Ph);return zh.call(Fh,Lh)}:Fh[Lh]=(...Ph)=>{if(this.defaults.async)return(async()=>{let Ih=await Rh.apply(Fh,Ph);return Ih===!1&&(Ih=await zh.apply(Fh,Ph)),Ih})();let Ih=Rh.apply(Fh,Ph);return Ih===!1&&(Ih=zh.apply(Fh,Ph)),Ih}}Ih.hooks=Fh}if(Ph.walkTokens){let Fh=this.defaults.walkTokens,Lh=Ph.walkTokens;Ih.walkTokens=function(Ph){let Ih=[];return Ih.push(Lh.call(this,Ph)),Fh&&(Ih=Ih.concat(Fh.call(this,Ph))),Ih}}this.defaults={...this.defaults,...Ih}}),this}setOptions(Ph){return this.defaults={...this.defaults,...Ph},this}lexer(Ph,Fh){return x$4.lex(Ph,Fh??this.defaults)}parser(Ph,Fh){return b$4.parse(Ph,Fh??this.defaults)}parseMarkdown(Ph){return(Fh,Ih)=>{let Lh={...Ih},Rh={...this.defaults,...Lh},zh=this.onError(!!Rh.silent,!!Rh.async);if(this.defaults.async===!0&&Lh.async===!1)return zh(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof Fh>`u`||Fh===null)return zh(Error(`marked(): input parameter is undefined or null`));if(typeof Fh!=`string`)return zh(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(Fh)+`, string expected`));if(Rh.hooks&&(Rh.hooks.options=Rh,Rh.hooks.block=Ph),Rh.async)return(async()=>{let Ih=Rh.hooks?await Rh.hooks.preprocess(Fh):Fh,Lh=await(Rh.hooks?await Rh.hooks.provideLexer(Ph):Ph?x$4.lex:x$4.lexInline)(Ih,Rh),zh=Rh.hooks?await Rh.hooks.processAllTokens(Lh):Lh;Rh.walkTokens&&await Promise.all(this.walkTokens(zh,Rh.walkTokens));let Bh=await(Rh.hooks?await Rh.hooks.provideParser(Ph):Ph?b$4.parse:b$4.parseInline)(zh,Rh);return Rh.hooks?await Rh.hooks.postprocess(Bh):Bh})().catch(zh);try{Rh.hooks&&(Fh=Rh.hooks.preprocess(Fh));let Ih=(Rh.hooks?Rh.hooks.provideLexer(Ph):Ph?x$4.lex:x$4.lexInline)(Fh,Rh);Rh.hooks&&(Ih=Rh.hooks.processAllTokens(Ih)),Rh.walkTokens&&this.walkTokens(Ih,Rh.walkTokens);let Lh=(Rh.hooks?Rh.hooks.provideParser(Ph):Ph?b$4.parse:b$4.parseInline)(Ih,Rh);return Rh.hooks&&(Lh=Rh.hooks.postprocess(Lh)),Lh}catch(Ph){return zh(Ph)}}}onError(Ph,Fh){return Ih=>{if(Ih.message+=`
|
|
100
|
-
Please report this to https://github.com/markedjs/marked.`,Ph){let Ph=`<p>An error occurred:</p><pre>`+O$4(Ih.message+``,!0)+`</pre>`;return Fh?Promise.resolve(Ph):Ph}if(Fh)return Promise.reject(Ih);throw Ih}}},M$4=new D$4;function g$3(Ph,Fh){return M$4.parse(Ph,Fh)}g$3.options=g$3.setOptions=function(Ph){return M$4.setOptions(Ph),g$3.defaults=M$4.defaults,G$4(g$3.defaults),g$3},g$3.getDefaults=z$5,g$3.defaults=T$4,g$3.use=function(...Ph){return M$4.use(...Ph),g$3.defaults=M$4.defaults,G$4(g$3.defaults),g$3},g$3.walkTokens=function(Ph,Fh){return M$4.walkTokens(Ph,Fh)},g$3.parseInline=M$4.parseInline,g$3.Parser=b$4,g$3.parser=b$4.parse,g$3.Renderer=y$3,g$3.TextRenderer=L$5,g$3.Lexer=x$4,g$3.lexer=x$4.lex,g$3.Tokenizer=w$4,g$3.Hooks=P$4,g$3.parse=g$3;var jt$2=g$3.options,Ft$2=g$3.setOptions,Ut$2=g$3.use,Kt$2=g$3.walkTokens,Wt$2=g$3.parseInline,Xt$2=g$3,Jt$2=b$4.parse,Vt$2=x$4.lex;function isCrossOriginHttpUrl(Ph,Fh){if(!Ph.startsWith(`http://`)&&!Ph.startsWith(`https://`))return!1;try{return new URL(Ph).origin!==Fh}catch{return!1}}function handleExternalLinkClick(Ph){if(Ph.button!==0||Ph.ctrlKey||Ph.metaKey||Ph.shiftKey)return!1;let Fh=Ph.target;if(!Fh)return!1;let Ih=Fh.closest(`a`);if(!Ih)return!1;let Lh=Ih.href;return isCrossOriginHttpUrl(Lh,window.location.origin)?(Ph.preventDefault(),window.open(Lh,`_blank`,`noopener,noreferrer`),!0):!1}function isExternalHref(Ph){if(!Ph||Ph.startsWith(`//`)||Ph.startsWith(`http://`)||Ph.startsWith(`https://`)||Ph.startsWith(`mailto:`)||Ph.startsWith(`tel:`)||Ph.startsWith(`ftp://`))return!0;let Fh=Ph.indexOf(`:`);if(Fh>0){let Ih=Ph.indexOf(`/`);if(Ih===-1||Ih>Fh)return!0}return!1}function resolveWorkspaceLink(Ph,Fh){if(!Fh||isExternalHref(Fh)||Fh.startsWith(`#`))return null;let Ih=stripFragmentAndQuery$1(Fh);if(Ih.length===0)return null;let Lh;if(Ih.startsWith(`/`))Lh=Ih.slice(1);else{let Fh=posixDirname(Ph);Lh=Fh===``?Ih:`${Fh}/${Ih}`}return normalizeWorkspacePath(Lh)}function stripFragmentAndQuery$1(Ph){let Fh=Ph.indexOf(`#`),Ih=Ph.indexOf(`?`),Lh=Ph.length;return Fh!==-1&&Fh<Lh&&(Lh=Fh),Ih!==-1&&Ih<Lh&&(Lh=Ih),Ph.slice(0,Lh)}function extractSessionIdFromPath(Ph){let Fh=`chat/`,Ih=`.jsonl`;if(!Ph.startsWith(`chat/`)||!Ph.endsWith(`.jsonl`))return null;let Lh=Ph.slice(5,Ph.length-6);return Lh.length===0||Lh.includes(`/`)?null:Lh}function posixDirname(Ph){let Fh=Ph.lastIndexOf(`/`);return Fh===-1?``:Ph.slice(0,Fh)}function normalizeWorkspacePath(Ph){if(Ph.length===0)return null;let Fh=Ph.split(`/`),Ih=[];for(let Ph of Fh)if(!(Ph===``||Ph===`.`)){if(Ph===`..`){if(Ih.length===0)return null;Ih.pop();continue}Ih.push(Ph)}return Ih.length===0?null:Ih.join(`/`)}var WIKI_PAGE_PATTERN=/(?:data\/)?wiki\/pages\/([^/]+)\.md$/,CHAT_LOG_PREFIX=`conversations/`;function classifyWorkspacePath(Ph){if(!Ph||isExternalHref(Ph)||Ph.startsWith(`#`))return null;let Fh=stripFragmentAndQuery(Ph);if(Fh.length===0)return null;let Ih=normalizePath(Fh);if(!Ih)return null;let Lh=Ih.match(WIKI_PAGE_PATTERN);if(Lh)return{kind:`wiki`,slug:Lh[1]};if(Ih.startsWith(CHAT_LOG_PREFIX)){let Ph=extractSessionIdFromPath(Ih.slice(14));if(Ph)return{kind:`session`,sessionId:Ph}}return{kind:`file`,path:Ih}}function resolveWikiHref(Ph,Fh){return isExternalHref(Ph)?Ph:Ph.startsWith(`./`)||Ph.startsWith(`../`)||!Ph.includes(`/`)?`${Fh}/${Ph}`:Ph}function stripFragmentAndQuery(Ph){let Fh=Ph.indexOf(`#`),Ih=Ph.indexOf(`?`),Lh=Ph.length;return Fh!==-1&&Fh<Lh&&(Lh=Fh),Ih!==-1&&Ih<Lh&&(Lh=Ih),Ph.slice(0,Lh)}function normalizePath(Ph){if(Ph.length===0)return null;let Fh=Ph.split(`/`),Ih=[];for(let Ph of Fh)if(!(Ph===``||Ph===`.`)){if(Ph===`..`){if(Ih.length===0)return null;Ih.pop();continue}Ih.push(Ph)}return Ih.length===0?null:Ih.join(`/`)}var APP_API_KEY=Symbol(`appApi`);function provideAppApi(Ph){provide(APP_API_KEY,Ph)}function useAppApi(){let Ph=inject(APP_API_KEY);if(!Ph)throw Error(`useAppApi() called outside an App.vue subtree — provideAppApi must run first.`);return Ph}var EVENT_TYPES={status:`status`,text:`text`,toolCall:`tool_call`,toolCallResult:`tool_call_result`,toolResult:`tool_result`,switchRole:`switch_role`,error:`error`,claudeSessionId:`claude_session_id`,sessionFinished:`session_finished`,sessionMeta:`session_meta`,rolesUpdated:`roles_updated`,generationStarted:`generation_started`,generationFinished:`generation_finished`},GENERATION_KINDS={beatImage:`beatImage`,characterImage:`characterImage`,beatAudio:`beatAudio`,movie:`movie`};function generationKey(Ph,Fh,Ih){return`${Ph}\u001f${Fh}\u001f${Ih}`}var CHAT_SERVICE_ROUTES={message:`/api/transports/:transportId/chats/:externalChatId`,connect:`/api/transports/:transportId/chats/:externalChatId/connect`},API_ROUTES={health:`/api/health`,sandbox:`/api/sandbox`,agent:{run:`/api/agent`,cancel:`/api/agent/cancel`,internal:{toolResult:`/api/internal/tool-result`,switchRole:`/api/internal/switch-role`}},chart:{present:`/api/present-chart`},chatIndex:{rebuild:`/api/chat-index/rebuild`},chatService:CHAT_SERVICE_ROUTES,config:{base:`/api/config`,settings:`/api/config/settings`,mcp:`/api/config/mcp`,workspaceDirs:`/api/config/workspace-dirs`,referenceDirs:`/api/config/reference-dirs`,schedulerOverrides:`/api/config/scheduler-overrides`},files:{tree:`/api/files/tree`,dir:`/api/files/dir`,content:`/api/files/content`,raw:`/api/files/raw`,refRoots:`/api/files/ref-roots`},html:{generate:`/api/generate-html`,edit:`/api/edit-html`,present:`/api/present-html`},image:{generate:`/api/generate-image`,edit:`/api/edit-image`,upload:`/api/images`,update:`/api/images/update`},mcpTools:{list:`/api/mcp-tools`,invoke:`/api/mcp-tools/:tool`},notifications:{test:`/api/notifications/test`},mulmoScript:{save:`/api/mulmo-script`,updateBeat:`/api/mulmo-script/update-beat`,updateScript:`/api/mulmo-script/update-script`,beatImage:`/api/mulmo-script/beat-image`,beatAudio:`/api/mulmo-script/beat-audio`,generateBeatAudio:`/api/mulmo-script/generate-beat-audio`,renderBeat:`/api/mulmo-script/render-beat`,uploadBeatImage:`/api/mulmo-script/upload-beat-image`,characterImage:`/api/mulmo-script/character-image`,renderCharacter:`/api/mulmo-script/render-character`,uploadCharacterImage:`/api/mulmo-script/upload-character-image`,movieStatus:`/api/mulmo-script/movie-status`,generateMovie:`/api/mulmo-script/generate-movie`,downloadMovie:`/api/mulmo-script/download-movie`},pdf:{markdown:`/api/pdf/markdown`},plugins:{presentDocument:`/api/present-document`,updateMarkdown:`/api/markdowns/update`,presentSpreadsheet:`/api/present-spreadsheet`,updateSpreadsheet:`/api/spreadsheets/update`,mindmap:`/api/mindmap`,quiz:`/api/quiz`,form:`/api/form`,canvas:`/api/canvas`,present3d:`/api/present3d`},roles:{list:`/api/roles`,manage:`/api/roles/manage`},scheduler:{base:`/api/scheduler`,tasks:`/api/scheduler/tasks`,task:`/api/scheduler/tasks/:id`,taskRun:`/api/scheduler/tasks/:id/run`,logs:`/api/scheduler/logs`},sessions:{list:`/api/sessions`,detail:`/api/sessions/:id`,markRead:`/api/sessions/:id/mark-read`},skills:{list:`/api/skills`,detail:`/api/skills/:name`,create:`/api/skills`,update:`/api/skills/:name`,remove:`/api/skills/:name`},sources:{list:`/api/sources`,create:`/api/sources`,remove:`/api/sources/:slug`,rebuild:`/api/sources/rebuild`,manage:`/api/sources/manage`},news:{items:`/api/news/items`,itemBody:`/api/news/items/:id/body`,readState:`/api/news/read-state`},todos:{list:`/api/todos`,dispatch:`/api/todos`,items:`/api/todos/items`,item:`/api/todos/items/:id`,itemMove:`/api/todos/items/:id/move`,columns:`/api/todos/columns`,column:`/api/todos/columns/:id`,columnsOrder:`/api/todos/columns/order`},wiki:{base:`/api/wiki`}};function errorMessage(Ph,Fh){return Ph instanceof Error?Ph.message:Fh===void 0?String(Ph):Fh}function isRecord(Ph){return typeof Ph==`object`&&!!Ph&&!Array.isArray(Ph)}function isObj(Ph){return typeof Ph==`object`&&!!Ph}function isNonEmptyString(Ph){return typeof Ph==`string`&&Ph.trim().length>0}function hasStringProp(Ph,Fh){return isRecord(Ph)&&typeof Ph[Fh]==`string`}var authToken=null;function setAuthToken(Ph){authToken=Ph}function buildQueryString(Ph){if(!Ph)return``;let Fh=[];for(let[Ih,Lh]of Object.entries(Ph))Lh!==void 0&&Fh.push(`${encodeURIComponent(Ih)}=${encodeURIComponent(String(Lh))}`);return Fh.length===0?``:`?${Fh.join(`&`)}`}function buildHeaders(Ph,Fh){let Ih={...Ph.headers??{}};return Fh&&Ih[`Content-Type`]===void 0&&(Ih[`Content-Type`]=`application/json`),authToken&&Ih.Authorization===void 0&&(Ih.Authorization=`Bearer ${authToken}`),Ih}async function extractError(Ph){let Fh=Ph.status;try{let Ih=await Ph.clone().json();if(hasStringProp(Ih,`error`))return{error:Ih.error,status:Fh}}catch{}return{error:Ph.statusText||`Request failed (${Fh})`,status:Fh}}async function apiCall(Ph,Fh={}){let Ih=Fh.method??`GET`,Lh=Fh.body!==void 0,Rh=`${Ph}${buildQueryString(Fh.query)}`,zh={method:Ih,headers:buildHeaders(Fh,Lh),signal:Fh.signal};Lh&&(zh.body=JSON.stringify(Fh.body));let Bh;try{Bh=await fetch(Rh,zh)}catch(Ph){return{ok:!1,error:errorMessage(Ph),status:0}}if(!Bh.ok){let{error:Ph,status:Fh}=await extractError(Bh);return{ok:!1,error:Ph,status:Fh}}try{return{ok:!0,data:await Bh.json()}}catch(Ph){return{ok:!1,error:`Invalid JSON response: ${errorMessage(Ph)}`,status:Bh.status}}}function apiGet(Ph,Fh,Ih={}){return apiCall(Ph,{...Ih,method:`GET`,query:Fh})}function apiPost(Ph,Fh,Ih={}){return apiCall(Ph,{...Ih,method:`POST`,body:Fh})}function apiPut(Ph,Fh,Ih={}){return apiCall(Ph,{...Ih,method:`PUT`,body:Fh})}function apiDelete(Ph,Fh,Ih={}){return apiCall(Ph,{...Ih,method:`DELETE`,body:Fh})}async function apiFetchRaw(Ph,Fh={}){let Ih=`${Ph}${buildQueryString(Fh.query)}`,Lh={method:Fh.method??`GET`,headers:buildHeaders(Fh,!1),body:Fh.body,signal:Fh.signal};return fetch(Ih,Lh)}function usePdfDownload(){let Ph=ref(!1),Fh=ref(null);async function Ih(Ih,Lh){Fh.value=null,Ph.value=!0;let Rh=null;try{let Ph=await apiFetchRaw(API_ROUTES.pdf.markdown,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({markdown:Ih,filename:Lh})});if(!Ph.ok){let Ih=await Ph.text().catch(()=>``);Fh.value=`PDF error ${Ph.status}: ${Ih}`;return}let zh=await Ph.blob();Rh=URL.createObjectURL(zh);let Bh=document.createElement(`a`);Bh.href=Rh,Bh.download=Lh,Bh.click()}catch(Ph){Fh.value=errorMessage(Ph)}finally{Rh&&URL.revokeObjectURL(Rh),Ph.value=!1}}return{pdfDownloading:Ph,pdfError:Fh,downloadPdf:Ih}}function useClipboardCopy(Ph=2e3){let Fh=ref(!1);async function Ih(Ih){try{await navigator.clipboard.writeText(Ih),Fh.value=!0,setTimeout(()=>{Fh.value=!1},Ph)}catch{}}return{copied:Fh,copy:Ih}}var UNSAFE_FILENAME_CHARS=/[/\\:*?"<>|]/g;function toSafeFilename(Ph,Fh=`download`){return Ph.replace(UNSAFE_FILENAME_CHARS,`_`).trim()||Fh}function formatLocalDate(Ph){let Fh=new Date(Ph);return`${Fh.getFullYear()}-${String(Fh.getMonth()+1).padStart(2,`0`)}-${String(Fh.getDate()).padStart(2,`0`)}`}function buildPdfFilename(Ph){return`${toSafeFilename(Ph.name??``,Ph.fallback)}-${formatLocalDate(Ph.timestampMs??Date.now())}.pdf`}var MAX_TITLE_CHARS=50;function extractTextResponseTitle(Ph){let Fh=null;for(let Ih of Ph.split(`
|
|
100
|
+
Please report this to https://github.com/markedjs/marked.`,Ph){let Ph=`<p>An error occurred:</p><pre>`+O$4(Ih.message+``,!0)+`</pre>`;return Fh?Promise.resolve(Ph):Ph}if(Fh)return Promise.reject(Ih);throw Ih}}},M$4=new D$4;function g$3(Ph,Fh){return M$4.parse(Ph,Fh)}g$3.options=g$3.setOptions=function(Ph){return M$4.setOptions(Ph),g$3.defaults=M$4.defaults,G$4(g$3.defaults),g$3},g$3.getDefaults=z$5,g$3.defaults=T$4,g$3.use=function(...Ph){return M$4.use(...Ph),g$3.defaults=M$4.defaults,G$4(g$3.defaults),g$3},g$3.walkTokens=function(Ph,Fh){return M$4.walkTokens(Ph,Fh)},g$3.parseInline=M$4.parseInline,g$3.Parser=b$4,g$3.parser=b$4.parse,g$3.Renderer=y$3,g$3.TextRenderer=L$5,g$3.Lexer=x$4,g$3.lexer=x$4.lex,g$3.Tokenizer=w$4,g$3.Hooks=P$4,g$3.parse=g$3;var jt$2=g$3.options,Ft$2=g$3.setOptions,Ut$2=g$3.use,Kt$2=g$3.walkTokens,Wt$2=g$3.parseInline,Xt$2=g$3,Jt$2=b$4.parse,Vt$2=x$4.lex;function isCrossOriginHttpUrl(Ph,Fh){if(!Ph.startsWith(`http://`)&&!Ph.startsWith(`https://`))return!1;try{return new URL(Ph).origin!==Fh}catch{return!1}}function handleExternalLinkClick(Ph){if(Ph.button!==0||Ph.ctrlKey||Ph.metaKey||Ph.shiftKey)return!1;let Fh=Ph.target;if(!Fh)return!1;let Ih=Fh.closest(`a`);if(!Ih)return!1;let Lh=Ih.href;return isCrossOriginHttpUrl(Lh,window.location.origin)?(Ph.preventDefault(),window.open(Lh,`_blank`,`noopener,noreferrer`),!0):!1}function isExternalHref(Ph){if(!Ph||Ph.startsWith(`//`)||Ph.startsWith(`http://`)||Ph.startsWith(`https://`)||Ph.startsWith(`mailto:`)||Ph.startsWith(`tel:`)||Ph.startsWith(`ftp://`))return!0;let Fh=Ph.indexOf(`:`);if(Fh>0){let Ih=Ph.indexOf(`/`);if(Ih===-1||Ih>Fh)return!0}return!1}function resolveWorkspaceLink(Ph,Fh){if(!Fh||isExternalHref(Fh)||Fh.startsWith(`#`))return null;let Ih=stripFragmentAndQuery$1(Fh);if(Ih.length===0)return null;let Lh;if(Ih.startsWith(`/`))Lh=Ih.slice(1);else{let Fh=posixDirname(Ph);Lh=Fh===``?Ih:`${Fh}/${Ih}`}return normalizeWorkspacePath$1(Lh)}function stripFragmentAndQuery$1(Ph){let Fh=Ph.indexOf(`#`),Ih=Ph.indexOf(`?`),Lh=Ph.length;return Fh!==-1&&Fh<Lh&&(Lh=Fh),Ih!==-1&&Ih<Lh&&(Lh=Ih),Ph.slice(0,Lh)}function extractSessionIdFromPath(Ph){let Fh=`chat/`,Ih=`.jsonl`;if(!Ph.startsWith(`chat/`)||!Ph.endsWith(`.jsonl`))return null;let Lh=Ph.slice(5,Ph.length-6);return Lh.length===0||Lh.includes(`/`)?null:Lh}function posixDirname(Ph){let Fh=Ph.lastIndexOf(`/`);return Fh===-1?``:Ph.slice(0,Fh)}function normalizeWorkspacePath$1(Ph){if(Ph.length===0)return null;let Fh=Ph.split(`/`),Ih=[];for(let Ph of Fh)if(!(Ph===``||Ph===`.`)){if(Ph===`..`){if(Ih.length===0)return null;Ih.pop();continue}Ih.push(Ph)}return Ih.length===0?null:Ih.join(`/`)}var WIKI_PAGE_PATTERN=/(?:data\/)?wiki\/pages\/([^/]+)\.md$/,CHAT_LOG_PREFIX=`conversations/`;function classifyWorkspacePath(Ph){if(!Ph||isExternalHref(Ph)||Ph.startsWith(`#`))return null;let Fh=stripFragmentAndQuery(Ph);if(Fh.length===0)return null;let Ih=normalizePath(Fh);if(!Ih)return null;let Lh=Ih.match(WIKI_PAGE_PATTERN);if(Lh)return{kind:`wiki`,slug:Lh[1]};if(Ih.startsWith(CHAT_LOG_PREFIX)){let Ph=extractSessionIdFromPath(Ih.slice(14));if(Ph)return{kind:`session`,sessionId:Ph}}return{kind:`file`,path:Ih}}function resolveWikiHref(Ph,Fh){return isExternalHref(Ph)?Ph:Ph.startsWith(`./`)||Ph.startsWith(`../`)||!Ph.includes(`/`)?`${Fh}/${Ph}`:Ph}function stripFragmentAndQuery(Ph){let Fh=Ph.indexOf(`#`),Ih=Ph.indexOf(`?`),Lh=Ph.length;return Fh!==-1&&Fh<Lh&&(Lh=Fh),Ih!==-1&&Ih<Lh&&(Lh=Ih),Ph.slice(0,Lh)}function normalizePath(Ph){if(Ph.length===0)return null;let Fh=Ph.split(`/`),Ih=[];for(let Ph of Fh)if(!(Ph===``||Ph===`.`)){if(Ph===`..`){if(Ih.length===0)return null;Ih.pop();continue}Ih.push(Ph)}return Ih.length===0?null:Ih.join(`/`)}var APP_API_KEY=Symbol(`appApi`);function provideAppApi(Ph){provide(APP_API_KEY,Ph)}function useAppApi(){let Ph=inject(APP_API_KEY);if(!Ph)throw Error(`useAppApi() called outside an App.vue subtree — provideAppApi must run first.`);return Ph}var EVENT_TYPES={status:`status`,text:`text`,toolCall:`tool_call`,toolCallResult:`tool_call_result`,toolResult:`tool_result`,switchRole:`switch_role`,error:`error`,claudeSessionId:`claude_session_id`,sessionFinished:`session_finished`,sessionMeta:`session_meta`,rolesUpdated:`roles_updated`,generationStarted:`generation_started`,generationFinished:`generation_finished`},GENERATION_KINDS={beatImage:`beatImage`,characterImage:`characterImage`,beatAudio:`beatAudio`,movie:`movie`};function generationKey(Ph,Fh,Ih){return`${Ph}\u001f${Fh}\u001f${Ih}`}var CHAT_SERVICE_ROUTES={message:`/api/transports/:transportId/chats/:externalChatId`,connect:`/api/transports/:transportId/chats/:externalChatId/connect`},API_ROUTES={health:`/api/health`,sandbox:`/api/sandbox`,agent:{run:`/api/agent`,cancel:`/api/agent/cancel`,internal:{toolResult:`/api/internal/tool-result`,switchRole:`/api/internal/switch-role`}},chart:{present:`/api/present-chart`},chatIndex:{rebuild:`/api/chat-index/rebuild`},chatService:CHAT_SERVICE_ROUTES,config:{base:`/api/config`,settings:`/api/config/settings`,mcp:`/api/config/mcp`,workspaceDirs:`/api/config/workspace-dirs`,referenceDirs:`/api/config/reference-dirs`,schedulerOverrides:`/api/config/scheduler-overrides`},files:{tree:`/api/files/tree`,dir:`/api/files/dir`,content:`/api/files/content`,raw:`/api/files/raw`,refRoots:`/api/files/ref-roots`},html:{generate:`/api/generate-html`,edit:`/api/edit-html`,present:`/api/present-html`},image:{generate:`/api/generate-image`,edit:`/api/edit-image`,upload:`/api/images`,update:`/api/images/update`},mcpTools:{list:`/api/mcp-tools`,invoke:`/api/mcp-tools/:tool`},notifications:{test:`/api/notifications/test`},mulmoScript:{save:`/api/mulmo-script`,updateBeat:`/api/mulmo-script/update-beat`,updateScript:`/api/mulmo-script/update-script`,beatImage:`/api/mulmo-script/beat-image`,beatAudio:`/api/mulmo-script/beat-audio`,generateBeatAudio:`/api/mulmo-script/generate-beat-audio`,renderBeat:`/api/mulmo-script/render-beat`,uploadBeatImage:`/api/mulmo-script/upload-beat-image`,characterImage:`/api/mulmo-script/character-image`,renderCharacter:`/api/mulmo-script/render-character`,uploadCharacterImage:`/api/mulmo-script/upload-character-image`,movieStatus:`/api/mulmo-script/movie-status`,generateMovie:`/api/mulmo-script/generate-movie`,downloadMovie:`/api/mulmo-script/download-movie`},pdf:{markdown:`/api/pdf/markdown`},plugins:{presentDocument:`/api/present-document`,updateMarkdown:`/api/markdowns/update`,presentSpreadsheet:`/api/present-spreadsheet`,updateSpreadsheet:`/api/spreadsheets/update`,mindmap:`/api/mindmap`,quiz:`/api/quiz`,form:`/api/form`,canvas:`/api/canvas`,present3d:`/api/present3d`},roles:{list:`/api/roles`,manage:`/api/roles/manage`},scheduler:{base:`/api/scheduler`,tasks:`/api/scheduler/tasks`,task:`/api/scheduler/tasks/:id`,taskRun:`/api/scheduler/tasks/:id/run`,logs:`/api/scheduler/logs`},sessions:{list:`/api/sessions`,detail:`/api/sessions/:id`,markRead:`/api/sessions/:id/mark-read`},skills:{list:`/api/skills`,detail:`/api/skills/:name`,create:`/api/skills`,update:`/api/skills/:name`,remove:`/api/skills/:name`},sources:{list:`/api/sources`,create:`/api/sources`,remove:`/api/sources/:slug`,rebuild:`/api/sources/rebuild`,manage:`/api/sources/manage`},news:{items:`/api/news/items`,itemBody:`/api/news/items/:id/body`,readState:`/api/news/read-state`},todos:{list:`/api/todos`,dispatch:`/api/todos`,items:`/api/todos/items`,item:`/api/todos/items/:id`,itemMove:`/api/todos/items/:id/move`,columns:`/api/todos/columns`,column:`/api/todos/columns/:id`,columnsOrder:`/api/todos/columns/order`},wiki:{base:`/api/wiki`}};function errorMessage(Ph,Fh){return Ph instanceof Error?Ph.message:Fh===void 0?String(Ph):Fh}function isRecord(Ph){return typeof Ph==`object`&&!!Ph&&!Array.isArray(Ph)}function isObj(Ph){return typeof Ph==`object`&&!!Ph}function isNonEmptyString(Ph){return typeof Ph==`string`&&Ph.trim().length>0}function hasStringProp(Ph,Fh){return isRecord(Ph)&&typeof Ph[Fh]==`string`}var authToken=null;function setAuthToken(Ph){authToken=Ph}function buildQueryString(Ph){if(!Ph)return``;let Fh=[];for(let[Ih,Lh]of Object.entries(Ph))Lh!==void 0&&Fh.push(`${encodeURIComponent(Ih)}=${encodeURIComponent(String(Lh))}`);return Fh.length===0?``:`?${Fh.join(`&`)}`}function buildHeaders(Ph,Fh){let Ih={...Ph.headers??{}};return Fh&&Ih[`Content-Type`]===void 0&&(Ih[`Content-Type`]=`application/json`),authToken&&Ih.Authorization===void 0&&(Ih.Authorization=`Bearer ${authToken}`),Ih}async function extractError(Ph){let Fh=Ph.status;try{let Ih=await Ph.clone().json();if(hasStringProp(Ih,`error`))return{error:Ih.error,status:Fh}}catch{}return{error:Ph.statusText||`Request failed (${Fh})`,status:Fh}}async function apiCall(Ph,Fh={}){let Ih=Fh.method??`GET`,Lh=Fh.body!==void 0,Rh=`${Ph}${buildQueryString(Fh.query)}`,zh={method:Ih,headers:buildHeaders(Fh,Lh),signal:Fh.signal};Lh&&(zh.body=JSON.stringify(Fh.body));let Bh;try{Bh=await fetch(Rh,zh)}catch(Ph){return{ok:!1,error:errorMessage(Ph),status:0}}if(!Bh.ok){let{error:Ph,status:Fh}=await extractError(Bh);return{ok:!1,error:Ph,status:Fh}}try{return{ok:!0,data:await Bh.json()}}catch(Ph){return{ok:!1,error:`Invalid JSON response: ${errorMessage(Ph)}`,status:Bh.status}}}function apiGet(Ph,Fh,Ih={}){return apiCall(Ph,{...Ih,method:`GET`,query:Fh})}function apiPost(Ph,Fh,Ih={}){return apiCall(Ph,{...Ih,method:`POST`,body:Fh})}function apiPut(Ph,Fh,Ih={}){return apiCall(Ph,{...Ih,method:`PUT`,body:Fh})}function apiDelete(Ph,Fh,Ih={}){return apiCall(Ph,{...Ih,method:`DELETE`,body:Fh})}async function apiFetchRaw(Ph,Fh={}){let Ih=`${Ph}${buildQueryString(Fh.query)}`,Lh={method:Fh.method??`GET`,headers:buildHeaders(Fh,!1),body:Fh.body,signal:Fh.signal};return fetch(Ih,Lh)}function usePdfDownload(){let Ph=ref(!1),Fh=ref(null);async function Ih(Ih,Lh){Fh.value=null,Ph.value=!0;let Rh=null;try{let Ph=await apiFetchRaw(API_ROUTES.pdf.markdown,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({markdown:Ih,filename:Lh})});if(!Ph.ok){let Ih=await Ph.text().catch(()=>``);Fh.value=`PDF error ${Ph.status}: ${Ih}`;return}let zh=await Ph.blob();Rh=URL.createObjectURL(zh);let Bh=document.createElement(`a`);Bh.href=Rh,Bh.download=Lh,Bh.click()}catch(Ph){Fh.value=errorMessage(Ph)}finally{Rh&&URL.revokeObjectURL(Rh),Ph.value=!1}}return{pdfDownloading:Ph,pdfError:Fh,downloadPdf:Ih}}function useClipboardCopy(Ph=2e3){let Fh=ref(!1);async function Ih(Ih){try{await navigator.clipboard.writeText(Ih),Fh.value=!0,setTimeout(()=>{Fh.value=!1},Ph)}catch{}}return{copied:Fh,copy:Ih}}var UNSAFE_FILENAME_CHARS=/[/\\:*?"<>|]/g;function toSafeFilename(Ph,Fh=`download`){return Ph.replace(UNSAFE_FILENAME_CHARS,`_`).trim()||Fh}function formatLocalDate(Ph){let Fh=new Date(Ph);return`${Fh.getFullYear()}-${String(Fh.getMonth()+1).padStart(2,`0`)}-${String(Fh.getDate()).padStart(2,`0`)}`}function buildPdfFilename(Ph){return`${toSafeFilename(Ph.name??``,Ph.fallback)}-${formatLocalDate(Ph.timestampMs??Date.now())}.pdf`}var MAX_TITLE_CHARS=50;function extractTextResponseTitle(Ph){let Fh=null;for(let Ih of Ph.split(`
|
|
101
101
|
`)){let Ph=Ih.trim();if(Ph){if(Ph.startsWith(`# `))return Ph.slice(2).trim().slice(0,MAX_TITLE_CHARS);Fh===null&&(Fh=Ph)}}return(Fh??``).slice(0,MAX_TITLE_CHARS)}var _hoisted_1$70={class:`h-full flex flex-col`},_hoisted_2$69={key:0,class:`flex items-center justify-end gap-2 px-3 py-2 border-b border-gray-100 shrink-0`},_hoisted_3$65=[`disabled`],_hoisted_4$52={class:`material-icons text-base`},_hoisted_5$46=[`title`],_hoisted_6$45={class:`text-response-container`},_hoisted_7$42={class:`text-response-content-wrapper`},_hoisted_8$39={class:`p-6`},_hoisted_9$34={class:`max-w-3xl mx-auto space-y-4`},_hoisted_10$33={class:`flex justify-between items-start mb-2 text-sm text-gray-500`},_hoisted_11$30={class:`font-medium text-gray-700`},_hoisted_12$29={key:0,class:`italic`},_hoisted_13$27=[`innerHTML`],_hoisted_14$25={"data-testid":`text-response-edit-summary`},_hoisted_15$23=[`disabled`],_hoisted_16$21=[`title`],_hoisted_17$21={class:`material-icons`},View_vue_vue_type_script_setup_true_lang_default$15=defineComponent({__name:`View`,props:{selectedResult:{},editable:{type:Boolean,default:!0},editableSource:{default:void 0}},emits:[`updateResult`,`updateSource`],setup(Ph,{emit:Fh}){let{t:Ih}=useI18n(),Lh=useAppApi(),Rh=Ph,zh=Fh,Bh=computed(()=>Rh.selectedResult.data?.text??``),Vh=computed(()=>Rh.editableSource===void 0?Bh.value:Rh.editableSource),Hh=ref(Vh.value);watch(Vh,Ph=>{Hh.value=Ph});let Uh=computed(()=>Rh.selectedResult.data?.role??`assistant`),Wh=computed(()=>Rh.selectedResult.data?.transportKind??``),Gh=computed(()=>{if(!Bh.value)return``;let Ph=Bh.value,Fh=Ph.trim();if(Fh.startsWith(`{`)&&Fh.endsWith(`}`)||Fh.startsWith(`[`)&&Fh.endsWith(`]`))try{JSON.parse(Fh),Ph="```json\n"+Fh+"\n```"}catch{}return Ph=Ph.replace(/<think>([\s\S]*?)<\/think>/g,(Ph,Fh)=>`<div class="think-block">${g$3(Fh.trim())}</div>`),g$3(Ph,{breaks:!0,gfm:!0})}),Kh=computed(()=>{switch(Uh.value){case`system`:return`System`;case`user`:return`You`;default:return`Assistant`}}),qh=computed(()=>{switch(Uh.value){case`system`:return`bg-blue-50 border-blue-200`;case`user`:return`bg-green-50 border-green-200`;default:return`bg-purple-50 border-purple-200`}}),Jh=computed(()=>Hh.value!==Vh.value);function Yh(){Jh.value&&(Rh.editableSource===void 0?zh(`updateResult`,{...Rh.selectedResult,data:{...Rh.selectedResult.data,text:Hh.value}}):zh(`updateSource`,Hh.value),tg.value&&(tg.value.open=!1))}let Xh=computed(()=>(Rh.selectedResult.data?.role??`assistant`)===`assistant`);function Zh(Ph){if(handleExternalLinkClick(Ph))return;let Fh=Ph.target.closest(`a`);if(!Fh)return;let Ih=Fh.getAttribute(`href`);!Ih||Ih.startsWith(`#`)||classifyWorkspacePath(Ih)&&(Ph.preventDefault(),Lh.navigateToWorkspacePath(Ih))}let{pdfDownloading:Qh,pdfError:$h,downloadPdf:eg}=usePdfDownload(),tg=ref(),ng=ref(!1);function rg(Ph){ng.value=Ph.target.open}onMounted(()=>{tg.value?.addEventListener(`toggle`,rg)}),onBeforeUnmount(()=>{tg.value?.removeEventListener(`toggle`,rg)});function ig(){tg.value&&(tg.value.open=!1),Hh.value=Vh.value}let{copied:ag,copy:og}=useClipboardCopy();async function sg(){await og(Rh.selectedResult.data?.text??``)}async function cg(){let Ph=Rh.selectedResult.data?.text??``;await eg(Ph,buildPdfFilename({name:extractTextResponseTitle(Ph),fallback:`chat`,timestampMs:Lh.getResultTimestamp(Rh.selectedResult.uuid)}))}return(Fh,Lh)=>(openBlock(),createElementBlock(`div`,_hoisted_1$70,[Xh.value?(openBlock(),createElementBlock(`div`,_hoisted_2$69,[createBaseVNode(`button`,{class:`h-8 px-2.5 flex items-center gap-1 rounded bg-green-600 hover:bg-green-700 text-white text-sm disabled:opacity-60 disabled:cursor-not-allowed transition-colors`,disabled:unref(Qh),onClick:cg},[createBaseVNode(`span`,_hoisted_4$52,toDisplayString$1(unref(Qh)?`hourglass_empty`:`download`),1),createTextVNode(` `+toDisplayString$1(unref(Ih)(`pluginTextResponse.pdf`)),1)],8,_hoisted_3$65),unref($h)?(openBlock(),createElementBlock(`span`,{key:0,class:`text-xs text-red-500`,title:unref($h)},toDisplayString$1(unref(Ih)(`pluginTextResponse.pdfFailed`)),9,_hoisted_5$46)):createCommentVNode(``,!0)])):createCommentVNode(``,!0),createBaseVNode(`div`,{class:`flex-1 overflow-hidden relative`,onClickCapture:Zh},[createBaseVNode(`div`,_hoisted_6$45,[createBaseVNode(`div`,_hoisted_7$42,[createBaseVNode(`div`,_hoisted_8$39,[createBaseVNode(`div`,_hoisted_9$34,[createBaseVNode(`div`,{class:normalizeClass([`rounded-lg border border-gray-300 bg-white shadow-sm p-5`,qh.value])},[createBaseVNode(`div`,_hoisted_10$33,[createBaseVNode(`span`,_hoisted_11$30,toDisplayString$1(Kh.value),1),Wh.value?(openBlock(),createElementBlock(`span`,_hoisted_12$29,toDisplayString$1(Wh.value),1)):createCommentVNode(``,!0)]),createBaseVNode(`div`,{class:`markdown-content prose prose-slate max-w-none leading-relaxed text-gray-900`,innerHTML:Gh.value},null,8,_hoisted_13$27)],2)])])]),Ph.editable?(openBlock(),createElementBlock(`details`,{key:0,ref_key:`detailsEl`,ref:tg,class:`text-response-source`,"data-testid":`text-response-edit`},[createBaseVNode(`summary`,_hoisted_14$25,toDisplayString$1(unref(Ih)(`pluginTextResponse.editContent`)),1),withDirectives(createBaseVNode(`textarea`,{"onUpdate:modelValue":Lh[0]||=Ph=>Hh.value=Ph,class:`text-response-editor`,spellcheck:`false`,"data-testid":`text-response-edit-textarea`},null,512),[[vModelText,Hh.value]]),createBaseVNode(`button`,{class:`apply-btn`,disabled:!Jh.value,"data-testid":`text-response-apply-btn`,onClick:Yh},toDisplayString$1(unref(Ih)(`pluginTextResponse.applyChanges`)),9,_hoisted_15$23)],512)):createCommentVNode(``,!0)]),withDirectives(createBaseVNode(`button`,{class:`copy-btn`,title:unref(ag)?unref(Ih)(`pluginTextResponse.copiedLabel`):unref(Ih)(`pluginTextResponse.copyLabel`),onClick:sg},[createBaseVNode(`span`,_hoisted_17$21,toDisplayString$1(unref(ag)?`check`:`content_copy`),1)],8,_hoisted_16$21),[[vShow,!ng.value]]),withDirectives(createBaseVNode(`button`,{class:`cancel-btn`,onClick:ig},toDisplayString$1(unref(Ih)(`pluginTextResponse.cancel`)),513),[[vShow,ng.value]])],32)]))}}),_plugin_vue_export_helper_default=(Ph,Fh)=>{let Ih=Ph.__vccOpts||Ph;for(let[Ph,Lh]of Fh)Ih[Ph]=Lh;return Ih},View_default$15=_plugin_vue_export_helper_default(View_vue_vue_type_script_setup_true_lang_default$15,[[`__scopeId`,`data-v-d850c9ce`]]),Preview_vue_vue_type_script_setup_true_lang_default$15=defineComponent({__name:`Preview`,props:{result:{}},setup(Ph){let Fh=Ph,Ih=computed(()=>Fh.result.data?.role??`assistant`),Lh=computed(()=>{switch(Ih.value){case`system`:return`text-blue-700`;case`user`:return`text-green-700 font-medium`;default:return`text-gray-700`}}),Rh=computed(()=>zh(Fh.result.data?.text??``));function zh(Ph){let Fh=g$3(Ph,{breaks:!0,gfm:!0}).replace(/<\/(td|th)>/gi,` `).replace(/<\/(p|h[1-6]|li|tr|blockquote|pre|div)>/gi,`$&
|
|
102
102
|
`).replace(/<br\s*\/?>/gi,`
|
|
103
103
|
`);return(new DOMParser().parseFromString(Fh,`text/html`).body.textContent??``).replace(/\n{3,}/g,`
|
|
104
104
|
|
|
105
|
-
`).trim()}return(Ph,Fh)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`preview-text p-2 text-sm leading-snug`,Lh.value])},toDisplayString$1(Rh.value),3))}}),Preview_default$15=_plugin_vue_export_helper_default(Preview_vue_vue_type_script_setup_true_lang_default$15,[[`__scopeId`,`data-v-dde9750a`]]),plugin={...pluginCore,viewComponent:View_default$15,previewComponent:Preview_default$15,samples},textResponse_default={plugin},TOOL_NAME$11=`presentDocument`;function isFilePath(Ph){return Ph.endsWith(`.md`)?Ph.startsWith(`artifacts/documents/`):!1}var toolDefinition$14={type:`function`,name:TOOL_NAME$11,description:`Display a document in markdown format.`,prompt:`Use the ${TOOL_NAME$11} tool when the user asks for a document that combines text with embedded images — guides, reports, tutorials, articles, or any structured content with visuals. Prefer this over standalone image generation when the user wants informational content with supporting visuals.\n\nFormat embedded images as: `,parameters:{type:`object`,properties:{title:{type:`string`,description:`Title for the document`},markdown:{type:`string`,description:`The markdown content to display. Describe embedded images in the following format: . IMPORTANT: For embedded images, you MUST use the EXACT placeholder path '__too_be_replaced_image_path__'.`},filenamePrefix:{type:`string`,description:`Short English filename prefix (without extension). Use lowercase with hyphens, e.g. 'project-summary'. The server sanitizes the value and appends a random id to prevent collisions.`}},required:[`title`,`markdown`,`filenamePrefix`]}},imageBumps=reactive({});function getImageBump(Ph){return imageBumps[Ph]??0}function bumpImage(Ph){imageBumps[Ph]=Date.now()}function resolveImageSrc(Ph){return Ph.startsWith(`data:`)?Ph:`${API_ROUTES.files.raw}?path=${encodeURIComponent(Ph)}`}function resolveImageSrcFresh(Ph){if(Ph.startsWith(`data:`))return Ph;let Fh=`${API_ROUTES.files.raw}?path=${encodeURIComponent(Ph)}`,Ih=getImageBump(Ph);return Ih>0?`${Fh}&v=${Ih}`:Fh}function shouldSkip(Ph){return!!(Ph.startsWith(`data:`)||Ph.startsWith(`http://`)||Ph.startsWith(`https://`)||Ph.startsWith(`/api/`))}function resolveWorkspacePath(Ph,Fh){let Ih=Fh.startsWith(`/`),Lh=[...Ih?[]:Ph.split(`/`).filter(Ph=>Ph!==``&&Ph!==`.`)],Rh=(Ih?Fh.slice(1):Fh).split(`/`);for(let Ph of Rh)if(!(Ph===``||Ph===`.`)){if(Ph===`..`){if(Lh.length===0)return null;Lh.pop();continue}Lh.push(Ph)}return Lh.length===0?null:Lh.join(`/`)}function extractBracketedAlt(Ph){if(!Ph.startsWith(`![`))return null;let Fh=1;for(let Ih=2;Ih<Ph.length;Ih++){let Lh=Ph[Ih];if(Lh===`[`)Fh++;else if(Lh===`]`&&(Fh--,Fh===0))return Ph.slice(2,Ih)}return null}function rewriteImageToken(Ph,Fh){let Ih=(Ph.href??``).trim();if(Ih===``||shouldSkip(Ih))return null;let Lh=resolveWorkspacePath(Fh,Ih);if(Lh===null)return null;let Rh=resolveImageSrc(Lh),zh=extractBracketedAlt(Ph.raw)??Ph.text??``;return Ph.title?`}")`:``}function isSkippable(Ph){return Ph.type===`code`||Ph.type===`codespan`||Ph.type===`html`}function getContainerChildren(Ph){let Fh=Ph;return Array.isArray(Fh.tokens)&&Fh.tokens.length>0?Fh.tokens:Array.isArray(Fh.items)&&Fh.items.length>0?Fh.items:null}function renderContainerChildren(Ph,Fh,Ih,Lh){let Rh=Fh.map(Ph=>Ph.raw??``).join(``);if(Rh===``)return!1;let zh=Ph.indexOf(Rh);if(zh<0)return!1;zh>0&&Lh.push(Ph.slice(0,zh));for(let Ph of Fh)renderToken(Ph,Ih,Lh);let Bh=Ph.slice(zh+Rh.length);return Bh&&Lh.push(Bh),!0}function renderToken(Ph,Fh,Ih){if(isSkippable(Ph)){Ih.push(Ph.raw);return}if(Ph.type===`image`){let Lh=rewriteImageToken(Ph,Fh);Ih.push(Lh??Ph.raw);return}let Lh=Ph.raw??``,Rh=getContainerChildren(Ph);Rh&&renderContainerChildren(Lh,Rh,Fh,Ih)||Ih.push(Lh)}function rewriteMarkdownImageRefs(Ph,Fh=``){let Ih=g$3.lexer(Ph),Lh=[];for(let Ph of Ih)renderToken(Ph,Fh,Lh);return Lh.join(``)}var TASK_LINE=/^(\s*(?:>\s*)*)([-*+]|\d+[.)])(\s+)\[([ xX])\]/,FENCE_LINE=/^( {0,3})(`{3,}|~{3,})/,BLOCKQUOTE_PREFIX=/^(\s*(?:>\s?)+)/;function stepFence(Ph,Fh){let Ih=Ph.match(BLOCKQUOTE_PREFIX),Lh=Ih?Ph.slice(Ih[0].length):Ph,Rh=Lh.match(FENCE_LINE);if(Rh){let Ph=Rh[2];if(!Fh.inFence)return Fh.inFence=!0,Fh.marker=Ph,!0;let Ih=Lh.slice(Rh[0].length);return Fh.marker&&Ph[0]===Fh.marker[0]&&Ph.length>=Fh.marker.length&&/^\s*$/.test(Ih)?(Fh.inFence=!1,Fh.marker=null,!0):!0}return Fh.inFence}function flipMark(Ph,Fh){let[Ih,Lh,Rh,zh,Bh]=Fh;return`${Lh}${Rh}${zh}[${Bh===` `?`x`:` `}]`+Ph.slice(Ih.length)}function findTaskLines(Ph){let Fh=Ph.split(`
|
|
105
|
+
`).trim()}return(Ph,Fh)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`preview-text p-2 text-sm leading-snug`,Lh.value])},toDisplayString$1(Rh.value),3))}}),Preview_default$15=_plugin_vue_export_helper_default(Preview_vue_vue_type_script_setup_true_lang_default$15,[[`__scopeId`,`data-v-dde9750a`]]),plugin={...pluginCore,viewComponent:View_default$15,previewComponent:Preview_default$15,samples},textResponse_default={plugin},TOOL_NAME$11=`presentDocument`;function isFilePath(Ph){return Ph.endsWith(`.md`)?Ph.startsWith(`artifacts/documents/`):!1}var toolDefinition$14={type:`function`,name:TOOL_NAME$11,description:`Display a document in markdown format.`,prompt:`Use the ${TOOL_NAME$11} tool when the user asks for a document that combines text with embedded images — guides, reports, tutorials, articles, or any structured content with visuals. Prefer this over standalone image generation when the user wants informational content with supporting visuals.\n\nFormat embedded images as: `,parameters:{type:`object`,properties:{title:{type:`string`,description:`Title for the document`},markdown:{type:`string`,description:`The markdown content to display. Describe embedded images in the following format: . IMPORTANT: For embedded images, you MUST use the EXACT placeholder path '__too_be_replaced_image_path__'.`},filenamePrefix:{type:`string`,description:`Short English filename prefix (without extension). Use lowercase with hyphens, e.g. 'project-summary'. The server sanitizes the value and appends a random id to prevent collisions.`}},required:[`title`,`markdown`,`filenamePrefix`]}},imageBumps=reactive({});function getImageBump(Ph){return imageBumps[Ph]??0}function bumpImage(Ph){imageBumps[Ph]=Date.now()}function resolveImageSrc(Ph){return Ph.startsWith(`data:`)?Ph:`${API_ROUTES.files.raw}?path=${encodeURIComponent(Ph)}`}function resolveImageSrcFresh(Ph){if(Ph.startsWith(`data:`))return Ph;let Fh=`${API_ROUTES.files.raw}?path=${encodeURIComponent(Ph)}`,Ih=getImageBump(Ph);return Ih>0?`${Fh}&v=${Ih}`:Fh}function shouldSkip$1(Ph){return!!(Ph.startsWith(`data:`)||Ph.startsWith(`http://`)||Ph.startsWith(`https://`)||Ph.startsWith(`/api/`))}function resolveWorkspacePath(Ph,Fh){let Ih=Fh.startsWith(`/`),Lh=[...Ih?[]:Ph.split(`/`).filter(Ph=>Ph!==``&&Ph!==`.`)],Rh=(Ih?Fh.slice(1):Fh).split(`/`);for(let Ph of Rh)if(!(Ph===``||Ph===`.`)){if(Ph===`..`){if(Lh.length===0)return null;Lh.pop();continue}Lh.push(Ph)}return Lh.length===0?null:Lh.join(`/`)}function extractBracketedAlt(Ph){if(!Ph.startsWith(`![`))return null;let Fh=1;for(let Ih=2;Ih<Ph.length;Ih++){let Lh=Ph[Ih];if(Lh===`[`)Fh++;else if(Lh===`]`&&(Fh--,Fh===0))return Ph.slice(2,Ih)}return null}function rewriteImageToken(Ph,Fh){let Ih=(Ph.href??``).trim();if(Ih===``||shouldSkip$1(Ih))return null;let Lh=resolveWorkspacePath(Fh,Ih);if(Lh===null)return null;let Rh=resolveImageSrc(Lh),zh=extractBracketedAlt(Ph.raw)??Ph.text??``;return Ph.title?`}")`:``}function isSkippable(Ph){return Ph.type===`code`||Ph.type===`codespan`||Ph.type===`html`}function getContainerChildren(Ph){let Fh=Ph;return Array.isArray(Fh.tokens)&&Fh.tokens.length>0?Fh.tokens:Array.isArray(Fh.items)&&Fh.items.length>0?Fh.items:null}function renderContainerChildren(Ph,Fh,Ih,Lh){let Rh=Fh.map(Ph=>Ph.raw??``).join(``);if(Rh===``)return!1;let zh=Ph.indexOf(Rh);if(zh<0)return!1;zh>0&&Lh.push(Ph.slice(0,zh));for(let Ph of Fh)renderToken(Ph,Ih,Lh);let Bh=Ph.slice(zh+Rh.length);return Bh&&Lh.push(Bh),!0}function renderToken(Ph,Fh,Ih){if(isSkippable(Ph)){Ih.push(Ph.raw);return}if(Ph.type===`image`){let Lh=rewriteImageToken(Ph,Fh);Ih.push(Lh??Ph.raw);return}let Lh=Ph.raw??``,Rh=getContainerChildren(Ph);Rh&&renderContainerChildren(Lh,Rh,Fh,Ih)||Ih.push(Lh)}function rewriteMarkdownImageRefs(Ph,Fh=``){let Ih=g$3.lexer(Ph),Lh=[];for(let Ph of Ih)renderToken(Ph,Fh,Lh);return Lh.join(``)}var TASK_LINE=/^(\s*(?:>\s*)*)([-*+]|\d+[.)])(\s+)\[([ xX])\]/,FENCE_LINE=/^( {0,3})(`{3,}|~{3,})/,BLOCKQUOTE_PREFIX=/^(\s*(?:>\s?)+)/;function stepFence(Ph,Fh){let Ih=Ph.match(BLOCKQUOTE_PREFIX),Lh=Ih?Ph.slice(Ih[0].length):Ph,Rh=Lh.match(FENCE_LINE);if(Rh){let Ph=Rh[2];if(!Fh.inFence)return Fh.inFence=!0,Fh.marker=Ph,!0;let Ih=Lh.slice(Rh[0].length);return Fh.marker&&Ph[0]===Fh.marker[0]&&Ph.length>=Fh.marker.length&&/^\s*$/.test(Ih)?(Fh.inFence=!1,Fh.marker=null,!0):!0}return Fh.inFence}function flipMark(Ph,Fh){let[Ih,Lh,Rh,zh,Bh]=Fh;return`${Lh}${Rh}${zh}[${Bh===` `?`x`:` `}]`+Ph.slice(Ih.length)}function findTaskLines(Ph){let Fh=Ph.split(`
|
|
106
106
|
`),Ih={inFence:!1,marker:null},Lh=[];for(let Ph=0;Ph<Fh.length;Ph++){let Rh=Fh[Ph];stepFence(Rh,Ih)||TASK_LINE.test(Rh)&&Lh.push(Ph)}return Lh}function toggleTaskAt(Ph,Fh){if(!Number.isInteger(Fh)||Fh<0)return null;let Ih=findTaskLines(Ph);if(Fh>=Ih.length)return null;let Lh=Ih[Fh],Rh=Ph.split(`
|
|
107
107
|
`),zh=Rh[Lh].match(TASK_LINE);return zh?(Rh[Lh]=flipMark(Rh[Lh],zh),Rh.join(`
|
|
108
108
|
`)):null}function makeTasksInteractive(Ph){return Ph.replace(/<input ([^>]*)disabled="" type="checkbox">/g,`<input $1class="md-task" type="checkbox">`)}var _hoisted_1$69={class:`markdown-container`},_hoisted_2$68={key:0,class:`min-h-full p-8 flex items-center justify-center`},_hoisted_3$64={class:`text-gray-500`},_hoisted_4$51={key:1,class:`min-h-full p-8 flex items-center justify-center`},_hoisted_5$45={class:`load-error-banner`,role:`alert`},_hoisted_6$44={key:2,class:`min-h-full p-8 flex items-center justify-center`},_hoisted_7$41={class:`text-gray-500`},_hoisted_8$38={class:`flex items-center justify-end gap-2 px-3 py-2 border-b border-gray-100 shrink-0`},_hoisted_9$33=[`disabled`],_hoisted_10$32={class:`material-icons text-base`},_hoisted_11$29=[`title`],_hoisted_12$28={key:0,class:`load-error-banner`,role:`alert`},_hoisted_13$26={class:`markdown-content-wrapper`},_hoisted_14$24={class:`p-4`},_hoisted_15$22=[`innerHTML`],_hoisted_16$20={class:`bottom-bar-wrapper`},_hoisted_17$20={class:`editor-actions`},_hoisted_18$20=[`disabled`],_hoisted_19$20={key:0,class:`save-error`,role:`alert`},_hoisted_20$16=[`title`],_hoisted_21$16={class:`material-icons`},View_vue_vue_type_script_setup_true_lang_default$14=defineComponent({__name:`View`,props:{selectedResult:{}},emits:[`updateResult`],setup(Ph,{emit:Fh}){let{t:Ih}=useI18n(),Lh=Ph,Rh=Fh,zh=useAppApi(),Bh=ref(!1),Vh=ref(!1),Hh=ref(null),Uh=ref(null),Wh=ref(``),Gh=ref(``);async function Kh(){Uh.value=null;let Ph=Lh.selectedResult.data?.markdown;if(!Ph){Wh.value=``,Gh.value=``;return}if(isFilePath(Ph)){Bh.value=!0;let Fh=await apiGet(API_ROUTES.files.content,{path:Ph});if(!Fh.ok){Uh.value=Fh.error,Bh.value=!1;return}Wh.value=Fh.data.content??``,Bh.value=!1}else Wh.value=Ph;Gh.value=Wh.value}Kh();let qh=computed(()=>Gh.value!==Wh.value),Jh=computed(()=>{if(!Wh.value)return``;let Ph=Lh.selectedResult.data?.markdown,Fh=typeof Ph==`string`&&isFilePath(Ph)?Ph.slice(0,Ph.lastIndexOf(`/`)):``;return makeTasksInteractive(g$3(rewriteMarkdownImageRefs(Wh.value,Fh)))});watch(()=>Lh.selectedResult?.viewState?.scrollToAnchor,Ph=>{Ph&&nextTick$1(()=>{let Fh=document.getElementById(Ph);Fh?Fh.scrollIntoView({behavior:`smooth`,block:`start`}):console.warn(`Anchor element with id "${Ph}" not found`)})});let Yh=ref(),Xh=ref(!1),{copied:Zh,copy:Qh}=useClipboardCopy();function $h(Ph){let Fh=Ph.target.open;Xh.value=Fh,Fh||(Gh.value=Wh.value,Hh.value=null)}function eg(){Yh.value&&(Yh.value.open=!1)}async function tg(){await Qh(Wh.value)}let{pdfDownloading:ng,pdfError:rg,downloadPdf:ig}=usePdfDownload();async function ag(){if(!Wh.value)return;let Ph=Lh.selectedResult.data?.filenamePrefix||Lh.selectedResult.title||``,Fh=Lh.selectedResult.uuid,Ih=buildPdfFilename({name:Ph,fallback:`document`,timestampMs:Fh?zh.getResultTimestamp(Fh):void 0});await ig(Wh.value,Ih)}async function og(){let Ph=Lh.selectedResult.data?.markdown;if(Ph){if(Hh.value=null,isFilePath(Ph)){Vh.value=!0;let Fh=await apiPut(API_ROUTES.plugins.updateMarkdown,{relativePath:Ph,markdown:Gh.value});if(Vh.value=!1,!Fh.ok){Hh.value=Fh.error;return}}Wh.value=Gh.value,Rh(`updateResult`,{...Lh.selectedResult,data:{...Lh.selectedResult.data,markdown:isFilePath(Ph)?Ph:Gh.value,pdfPath:void 0}}),Yh.value&&(Yh.value.open=!1)}}let sg=Promise.resolve();async function cg(Ph,Fh){if(Lh.selectedResult.data?.markdown!==Ph)return;let Ih=await apiPut(API_ROUTES.plugins.updateMarkdown,{relativePath:Ph,markdown:Fh});if(Lh.selectedResult.data?.markdown===Ph){if(!Ih.ok){Hh.value=Ih.error,await Kh();return}Hh.value=null}}function lg(Ph){let Fh=Ph.target;if(!(Fh instanceof HTMLInputElement)||Fh.type!==`checkbox`||!Fh.classList.contains(`md-task`))return;if(Xh.value){Fh.checked=!Fh.checked;return}let zh=Ph.currentTarget.querySelectorAll(`input.md-task`),Bh=Array.from(zh).indexOf(Fh);if(Bh<0)return;if(findTaskLines(Wh.value).length!==zh.length){Fh.checked=!Fh.checked,Hh.value=Ih(`pluginMarkdown.taskCountMismatch`);return}let Vh=toggleTaskAt(Wh.value,Bh);if(Vh===null){Fh.checked=!Fh.checked;return}Wh.value=Vh,Gh.value=Vh;let Uh=Lh.selectedResult.data?.markdown;typeof Uh==`string`&&isFilePath(Uh)?sg=sg.then(()=>cg(Uh,Vh)):Rh(`updateResult`,{...Lh.selectedResult,data:{...Lh.selectedResult.data,markdown:Vh,pdfPath:void 0}})}return watch(()=>Lh.selectedResult.data?.markdown,()=>{Kh()}),(Ph,Fh)=>(openBlock(),createElementBlock(`div`,_hoisted_1$69,[Bh.value?(openBlock(),createElementBlock(`div`,_hoisted_2$68,[createBaseVNode(`div`,_hoisted_3$64,toDisplayString$1(unref(Ih)(`pluginMarkdown.loading`)),1)])):Uh.value&&!Wh.value?(openBlock(),createElementBlock(`div`,_hoisted_4$51,[createBaseVNode(`div`,_hoisted_5$45,toDisplayString$1(unref(Ih)(`pluginMarkdown.loadFailed`,{error:Uh.value})),1)])):Wh.value?(openBlock(),createElementBlock(Fragment,{key:3},[createBaseVNode(`div`,_hoisted_8$38,[createBaseVNode(`button`,{class:`h-8 px-2.5 flex items-center gap-1 rounded bg-green-600 hover:bg-green-700 text-white text-sm disabled:opacity-60 disabled:cursor-not-allowed transition-colors`,disabled:unref(ng),onClick:ag},[createBaseVNode(`span`,_hoisted_10$32,toDisplayString$1(unref(ng)?`hourglass_empty`:`download`),1),createTextVNode(` `+toDisplayString$1(unref(Ih)(`pluginMarkdown.pdf`)),1)],8,_hoisted_9$33),unref(rg)?(openBlock(),createElementBlock(`span`,{key:0,class:`text-xs text-red-500`,title:unref(rg)},toDisplayString$1(unref(Ih)(`pluginMarkdown.pdfFailedShort`)),9,_hoisted_11$29)):createCommentVNode(``,!0)]),Uh.value?(openBlock(),createElementBlock(`div`,_hoisted_12$28,toDisplayString$1(unref(Ih)(`pluginMarkdown.refreshFailed`,{error:Uh.value})),1)):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_13$26,[createBaseVNode(`div`,_hoisted_14$24,[createBaseVNode(`div`,{class:`markdown-content prose prose-slate max-w-none`,onClick:lg,innerHTML:Jh.value},null,8,_hoisted_15$22)])]),createBaseVNode(`div`,_hoisted_16$20,[createBaseVNode(`details`,{ref_key:`sourceDetails`,ref:Yh,class:`markdown-source`,onToggle:$h},[createBaseVNode(`summary`,null,toDisplayString$1(unref(Ih)(`pluginMarkdown.editSource`)),1),withDirectives(createBaseVNode(`textarea`,{"onUpdate:modelValue":Fh[0]||=Ph=>Gh.value=Ph,class:`markdown-editor`,spellcheck:`false`},null,512),[[vModelText,Gh.value]]),createBaseVNode(`div`,_hoisted_17$20,[createBaseVNode(`button`,{class:`apply-btn`,disabled:!qh.value||Vh.value,onClick:og},toDisplayString$1(Vh.value?unref(Ih)(`pluginMarkdown.saving`):unref(Ih)(`pluginMarkdown.applyChanges`)),9,_hoisted_18$20),createBaseVNode(`button`,{class:`cancel-btn`,onClick:eg},toDisplayString$1(unref(Ih)(`pluginMarkdown.cancel`)),1)]),Hh.value?(openBlock(),createElementBlock(`p`,_hoisted_19$20,toDisplayString$1(unref(Ih)(`pluginMarkdown.saveError`,{error:Hh.value})),1)):createCommentVNode(``,!0)],544),withDirectives(createBaseVNode(`button`,{class:`copy-btn`,title:unref(Zh)?unref(Ih)(`pluginMarkdown.copiedLabel`):unref(Ih)(`pluginMarkdown.copyLabel`),onClick:tg},[createBaseVNode(`span`,_hoisted_21$16,toDisplayString$1(unref(Zh)?`check`:`content_copy`),1)],8,_hoisted_20$16),[[vShow,!Xh.value]])])],64)):(openBlock(),createElementBlock(`div`,_hoisted_6$44,[createBaseVNode(`div`,_hoisted_7$41,toDisplayString$1(unref(Ih)(`pluginMarkdown.noContent`)),1)]))]))}}),View_default$14=_plugin_vue_export_helper_default(View_vue_vue_type_script_setup_true_lang_default$14,[[`__scopeId`,`data-v-6920dff7`]]);function extractFirstH1(Ph){for(let Fh of splitLines(Ph)){if(Fh.length<2||Fh[0]!==`#`||!isInlineSpace(Fh.charCodeAt(1)))continue;let Ph=Fh.slice(2).trim();if(Ph.length>0)return Ph}return null}function splitLines(Ph){return Ph.split(/\r\n|\r|\n/)}function isInlineSpace(Ph){return Ph===32||Ph===9}var _hoisted_1$68={class:`p-2 bg-purple-100 rounded overflow-hidden`},_hoisted_2$67={class:`text-sm text-gray-800 font-medium truncate`},_hoisted_3$63={key:0,class:`text-xs text-gray-500 mt-1 line-clamp-4 whitespace-pre-line`},Preview_vue_vue_type_script_setup_true_lang_default$14=defineComponent({__name:`Preview`,props:{result:{}},setup(Ph){let Fh=Ph,Ih=ref(``);async function Lh(){let Ph=Fh.result.data?.markdown;if(!Ph||!isFilePath(Ph)){Ih.value=``;return}let Lh=await apiGet(API_ROUTES.files.content,{path:Ph});if(!Lh.ok){Ih.value=``;return}Ih.value=Lh.data.content??``}Lh(),watch(()=>Fh.result.data?.markdown,Lh);let Rh=computed(()=>{if(Fh.result.title)return Fh.result.title;let Ph=zh.value;if(Ph){let Fh=extractFirstH1(Ph);if(Fh)return Fh}return`Markdown Document`}),zh=computed(()=>{let Ph=Fh.result.data?.markdown;return Ph?isFilePath(Ph)?Ih.value:Ph:``});function Bh(Ph){return Ph.split(`
|
|
@@ -284,7 +284,7 @@ T* `):Ph.join(` Tj
|
|
|
284
284
|
`),Fh}},Cross:{createAppearanceStream:function(Ph){var Fh={D:{Off:$$4.RadioButton.Cross.OffPushDown},N:{}};return Fh.N[Ph]=$$4.RadioButton.Cross.YesNormal,Fh.D[Ph]=$$4.RadioButton.Cross.YesPushDown,Fh},getCA:function(){return`8`},YesNormal:function(Ph){var Fh=ts$1(Ph);Fh.scope=Ph.scope;var Ih=[],Lh=$$4.internal.calculateCross(Ph);return Ih.push(`q`),Ih.push(`1 1 `+Q$3($$4.internal.getWidth(Ph)-2)+` `+Q$3($$4.internal.getHeight(Ph)-2)+` re`),Ih.push(`W`),Ih.push(`n`),Ih.push(Q$3(Lh.x1.x)+` `+Q$3(Lh.x1.y)+` m`),Ih.push(Q$3(Lh.x2.x)+` `+Q$3(Lh.x2.y)+` l`),Ih.push(Q$3(Lh.x4.x)+` `+Q$3(Lh.x4.y)+` m`),Ih.push(Q$3(Lh.x3.x)+` `+Q$3(Lh.x3.y)+` l`),Ih.push(`s`),Ih.push(`Q`),Fh.stream=Ih.join(`
|
|
285
285
|
`),Fh},YesPushDown:function(Ph){var Fh=ts$1(Ph);Fh.scope=Ph.scope;var Ih=$$4.internal.calculateCross(Ph),Lh=[];return Lh.push(`0.749023 g`),Lh.push(`0 0 `+Q$3($$4.internal.getWidth(Ph))+` `+Q$3($$4.internal.getHeight(Ph))+` re`),Lh.push(`f`),Lh.push(`q`),Lh.push(`1 1 `+Q$3($$4.internal.getWidth(Ph)-2)+` `+Q$3($$4.internal.getHeight(Ph)-2)+` re`),Lh.push(`W`),Lh.push(`n`),Lh.push(Q$3(Ih.x1.x)+` `+Q$3(Ih.x1.y)+` m`),Lh.push(Q$3(Ih.x2.x)+` `+Q$3(Ih.x2.y)+` l`),Lh.push(Q$3(Ih.x4.x)+` `+Q$3(Ih.x4.y)+` m`),Lh.push(Q$3(Ih.x3.x)+` `+Q$3(Ih.x3.y)+` l`),Lh.push(`s`),Lh.push(`Q`),Fh.stream=Lh.join(`
|
|
286
286
|
`),Fh},OffPushDown:function(Ph){var Fh=ts$1(Ph);Fh.scope=Ph.scope;var Ih=[];return Ih.push(`0.749023 g`),Ih.push(`0 0 `+Q$3($$4.internal.getWidth(Ph))+` `+Q$3($$4.internal.getHeight(Ph))+` re`),Ih.push(`f`),Fh.stream=Ih.join(`
|
|
287
|
-
`),Fh}}},createDefaultAppearanceStream:function(Ph){var Fh=Ph.scope.internal.getFont(Ph.fontName,Ph.fontStyle).id,Ih=Ph.scope.__private__.encodeColorString(Ph.color);return`/`+Fh+` `+Ph.fontSize+` Tf `+Ih}};$$4.internal={Bezier_C:.551915024494,calculateCross:function(Ph){var Fh=$$4.internal.getWidth(Ph),Ih=$$4.internal.getHeight(Ph),Lh=Math.min(Fh,Ih);return{x1:{x:(Fh-Lh)/2,y:(Ih-Lh)/2+Lh},x2:{x:(Fh-Lh)/2+Lh,y:(Ih-Lh)/2},x3:{x:(Fh-Lh)/2,y:(Ih-Lh)/2},x4:{x:(Fh-Lh)/2+Lh,y:(Ih-Lh)/2+Lh}}}},$$4.internal.getWidth=function(Ph){var Fh=0;return e$4(Ph)===`object`&&(Fh=es$1(Ph.Rect[2])),Fh},$$4.internal.getHeight=function(Ph){var Fh=0;return e$4(Ph)===`object`&&(Fh=es$1(Ph.Rect[3])),Fh};var Ms$1=qo$1.addField=function(Ph){if(ms$1(this,Ph),!(Ph instanceof bs$1))throw Error(`Invalid argument passed to jsPDF.addField.`);var Fh;return(Fh=Ph).scope.internal.acroformPlugin.printedOut&&(Fh.scope.internal.acroformPlugin.printedOut=!1,Fh.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),Fh.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(Fh),Ph.page=Ph.scope.internal.getCurrentPageInfo().pageNumber,this};qo$1.AcroFormChoiceField=xs$1,qo$1.AcroFormListBox=Ss$1,qo$1.AcroFormComboBox=Cs$1,qo$1.AcroFormEditBox=ws$1,qo$1.AcroFormButton=Ts$1,qo$1.AcroFormPushButton=Es$1,qo$1.AcroFormRadioButton=Ds$1,qo$1.AcroFormCheckBox=ks$1,qo$1.AcroFormTextField=As$1,qo$1.AcroFormPasswordField=js$1,qo$1.AcroFormAppearance=$$4,qo$1.AcroForm={ChoiceField:xs$1,ListBox:Ss$1,ComboBox:Cs$1,EditBox:ws$1,Button:Ts$1,PushButton:Es$1,RadioButton:Ds$1,CheckBox:ks$1,TextField:As$1,PasswordField:js$1,Appearance:$$4},Z$3.AcroForm={ChoiceField:xs$1,ListBox:Ss$1,ComboBox:Cs$1,EditBox:ws$1,Button:Ts$1,PushButton:Es$1,RadioButton:Ds$1,CheckBox:ks$1,TextField:As$1,PasswordField:js$1,Appearance:$$4},Z$3.AcroForm;function Ns$1(Ph){return Ph.reduce(function(Ph,Fh,Ih){return Ph[Fh]=Ih,Ph},{})}(function(Ph){var Fh=`addImage_`;Ph.__addimage__={};var Ih=`UNKNOWN`,Lh={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},Rh=Ph.__addimage__.getImageFileTypeByImageData=function(Ph,Fh){var Rh,zh,Bh,Vh,Hh,Uh=Ih;if((Fh||=Ih)===`RGBA`||Ph.data!==void 0&&Ph.data instanceof Uint8ClampedArray&&`height`in Ph&&`width`in Ph)return`RGBA`;if(ng(Ph))for(Hh in Lh)for(Bh=Lh[Hh],Rh=0;Rh<Bh.length;Rh+=1){for(Vh=!0,zh=0;zh<Bh[Rh].length;zh+=1)if(Bh[Rh][zh]!==void 0&&Bh[Rh][zh]!==Ph[zh]){Vh=!1;break}if(!0===Vh){Uh=Hh;break}}else for(Hh in Lh)for(Bh=Lh[Hh],Rh=0;Rh<Bh.length;Rh+=1){for(Vh=!0,zh=0;zh<Bh[Rh].length;zh+=1)if(Bh[Rh][zh]!==void 0&&Bh[Rh][zh]!==Ph.charCodeAt(zh)){Vh=!1;break}if(!0===Vh){Uh=Hh;break}}return Uh===Ih&&Fh!==Ih&&(Uh=Fh),Uh},zh=function Ph(Fh){for(var Ih=this.internal.write,Lh=this.internal.putStream,Rh=(0,this.internal.getFilters)();Rh.indexOf(`FlateEncode`)!==-1;)Rh.splice(Rh.indexOf(`FlateEncode`),1);Fh.objectId=this.internal.newObject();var zh=[];if(zh.push({key:`Type`,value:`/XObject`}),zh.push({key:`Subtype`,value:`/Image`}),zh.push({key:`Width`,value:Fh.width}),zh.push({key:`Height`,value:Fh.height}),Fh.colorSpace===Zh.INDEXED?zh.push({key:`ColorSpace`,value:`[/Indexed /DeviceRGB `+(Fh.palette.length/3-1)+` `+(`sMask`in Fh&&Fh.sMask!==void 0?Fh.objectId+2:Fh.objectId+1)+` 0 R]`}):(zh.push({key:`ColorSpace`,value:`/`+Fh.colorSpace}),Fh.colorSpace===Zh.DEVICE_CMYK&&zh.push({key:`Decode`,value:`[1 0 1 0 1 0 1 0]`})),zh.push({key:`BitsPerComponent`,value:Fh.bitsPerComponent}),`decodeParameters`in Fh&&Fh.decodeParameters!==void 0&&zh.push({key:`DecodeParms`,value:`<<`+Fh.decodeParameters+`>>`}),`transparency`in Fh&&Array.isArray(Fh.transparency)&&Fh.transparency.length>0){for(var Bh=``,Vh=0,Hh=Fh.transparency.length;Vh<Hh;Vh++)Bh+=Fh.transparency[Vh]+` `+Fh.transparency[Vh]+` `;zh.push({key:`Mask`,value:`[`+Bh+`]`})}Fh.sMask!==void 0&&zh.push({key:`SMask`,value:Fh.objectId+1+` 0 R`});var Uh=Fh.filter===void 0?void 0:[`/`+Fh.filter];if(Lh({data:Fh.data,additionalKeyValues:zh,alreadyAppliedFilters:Uh,objectId:Fh.objectId}),Ih(`endobj`),`sMask`in Fh&&Fh.sMask!==void 0){var Wh=Fh.sMaskBitsPerComponent??Fh.bitsPerComponent,Gh={width:Fh.width,height:Fh.height,colorSpace:`DeviceGray`,bitsPerComponent:Wh,data:Fh.sMask};`filter`in Fh&&(Gh.decodeParameters=`/Predictor ${Fh.predictor} /Colors 1 /BitsPerComponent ${Wh} /Columns ${Fh.width}`,Gh.filter=Fh.filter),Ph.call(this,Gh)}if(Fh.colorSpace===Zh.INDEXED){var Kh=this.internal.newObject();Lh({data:ig(new Uint8Array(Fh.palette)),objectId:Kh}),Ih(`endobj`)}},Bh=function(){var Ph=this.internal.collections[Fh+`images`];for(var Ih in Ph)zh.call(this,Ph[Ih])},Vh=function(){var Ph,Ih=this.internal.collections[Fh+`images`],Lh=this.internal.write;for(var Rh in Ih)Lh(`/I`+(Ph=Ih[Rh]).index,Ph.objectId,`0`,`R`)},Hh=function(){this.internal.collections[Fh+`images`]||(this.internal.collections[Fh+`images`]={},this.internal.events.subscribe(`putResources`,Bh),this.internal.events.subscribe(`putXobjectDict`,Vh))},Uh=function(){var Ph=this.internal.collections[Fh+`images`];return Hh.call(this),Ph},Wh=function(){return Object.keys(this.internal.collections[Fh+`images`]).length},Gh=function(Fh){return typeof Ph[`process`+Fh.toUpperCase()]==`function`},Kh=function(Ph){return e$4(Ph)===`object`&&Ph.nodeType===1},qh=function(Fh,Ih){if(Fh.nodeName===`IMG`&&Fh.hasAttribute(`src`)){var Lh=``+Fh.getAttribute(`src`);if(Lh.indexOf(`data:image/`)===0)return So$1(unescape(Lh).split(`base64,`).pop());var Rh=Ph.loadFile(Lh,!0);if(Rh!==void 0)return Rh}if(Fh.nodeName===`CANVAS`){if(Fh.width===0||Fh.height===0)throw Error(`Given canvas must have data. Canvas width: `+Fh.width+`, height: `+Fh.height);var zh;switch(Ih){case`PNG`:zh=`image/png`;break;case`WEBP`:zh=`image/webp`;break;default:zh=`image/jpeg`}return So$1(Fh.toDataURL(zh,1).split(`base64,`).pop())}},Jh=function(Ph){var Ih=this.internal.collections[Fh+`images`];if(Ih){for(var Lh in Ih)if(Ph===Ih[Lh].alias)return Ih[Lh]}},Yh=function(Ph,Fh,Ih){return Ph||Fh||(Ph=-96,Fh=-96),Ph<0&&(Ph=-1*Ih.width*72/Ph/this.internal.scaleFactor),Fh<0&&(Fh=-1*Ih.height*72/Fh/this.internal.scaleFactor),Ph===0&&(Ph=Fh*Ih.width/Ih.height),Fh===0&&(Fh=Ph*Ih.height/Ih.width),[Ph,Fh]},Xh=function(Ph,Fh,Ih,Lh,Rh,zh){var Bh=Yh.call(this,Ih,Lh,Rh),Vh=this.internal.getCoordinateString,Hh=this.internal.getVerticalCoordinateString,Wh=Uh.call(this);if(Ih=Bh[0],Lh=Bh[1],Wh[Rh.index]=Rh,zh){zh*=Math.PI/180;var Gh=Math.cos(zh),Kh=Math.sin(zh),qh=function(Ph){return Ph.toFixed(4)},Jh=[qh(Gh),qh(Kh),qh(-1*Kh),qh(Gh),0,0,`cm`]}this.internal.write(`q`),zh?(this.internal.write([1,`0`,`0`,1,Vh(Ph),Hh(Fh+Lh),`cm`].join(` `)),this.internal.write(Jh.join(` `)),this.internal.write([Vh(Ih),`0`,`0`,Vh(Lh),`0`,`0`,`cm`].join(` `))):this.internal.write([Vh(Ih),`0`,`0`,Vh(Lh),Vh(Ph),Hh(Fh+Lh),`cm`].join(` `)),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,`cm`].join(` `)),this.internal.write(`/I`+Rh.index+` Do`),this.internal.write(`Q`)},Zh=Ph.color_spaces={DEVICE_RGB:`DeviceRGB`,DEVICE_GRAY:`DeviceGray`,DEVICE_CMYK:`DeviceCMYK`,CAL_GREY:`CalGray`,CAL_RGB:`CalRGB`,LAB:`Lab`,ICC_BASED:`ICCBased`,INDEXED:`Indexed`,PATTERN:`Pattern`,SEPARATION:`Separation`,DEVICE_N:`DeviceN`};Ph.decode={DCT_DECODE:`DCTDecode`,FLATE_DECODE:`FlateDecode`,LZW_DECODE:`LZWDecode`,JPX_DECODE:`JPXDecode`,JBIG2_DECODE:`JBIG2Decode`,ASCII85_DECODE:`ASCII85Decode`,ASCII_HEX_DECODE:`ASCIIHexDecode`,RUN_LENGTH_DECODE:`RunLengthDecode`,CCITT_FAX_DECODE:`CCITTFaxDecode`};var Qh=Ph.image_compression={NONE:`NONE`,FAST:`FAST`,MEDIUM:`MEDIUM`,SLOW:`SLOW`},$h=Ph.__addimage__.sHashCode=function(Ph){var Fh,Ih,Lh=0;if(typeof Ph==`string`)for(Ih=Ph.length,Fh=0;Fh<Ih;Fh++)Lh=(Lh<<5)-Lh+Ph.charCodeAt(Fh),Lh|=0;else if(ng(Ph))for(Ih=Ph.byteLength/2,Fh=0;Fh<Ih;Fh++)Lh=(Lh<<5)-Lh+Ph[Fh],Lh|=0;return Lh},eg=Ph.__addimage__.validateStringAsBase64=function(Ph){(Ph||=``).toString().trim();var Fh=!0;return Ph.length===0&&(Fh=!1),Ph.length%4!=0&&(Fh=!1),!1===/^[A-Za-z0-9+/]+$/.test(Ph.substr(0,Ph.length-2))&&(Fh=!1),!1===/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(Ph.substr(-2))&&(Fh=!1),Fh},tg=Ph.__addimage__.extractImageFromDataUrl=function(Ph){if(Ph==null||!(Ph=Ph.trim()).startsWith(`data:`))return null;var Fh=Ph.indexOf(`,`);return Fh<0?null:Ph.substring(0,Fh).trim().endsWith(`base64`)?Ph.substring(Fh+1):null};Ph.__addimage__.isArrayBuffer=function(Ph){return Ph instanceof ArrayBuffer};var ng=Ph.__addimage__.isArrayBufferView=function(Ph){return Ph instanceof Int8Array||Ph instanceof Uint8Array||Ph instanceof Uint8ClampedArray||Ph instanceof Int16Array||Ph instanceof Uint16Array||Ph instanceof Int32Array||Ph instanceof Uint32Array||Ph instanceof Float32Array||Ph instanceof Float64Array},rg=Ph.__addimage__.binaryStringToUint8Array=function(Ph){for(var Fh=Ph.length,Ih=new Uint8Array(Fh),Lh=0;Lh<Fh;Lh++)Ih[Lh]=Ph.charCodeAt(Lh);return Ih},ig=Ph.__addimage__.arrayBufferToBinaryString=function(Ph){for(var Fh=``,Ih=ng(Ph)?Ph:new Uint8Array(Ph),Lh=0;Lh<Ih.length;Lh+=8192)Fh+=String.fromCharCode.apply(null,Ih.subarray(Lh,Lh+8192));return Fh};Ph.addImage=function(){var Ph,Fh,Lh,Rh,zh,Bh,Vh,Uh,Wh;if(typeof arguments[1]==`number`?(Fh=Ih,Lh=arguments[1],Rh=arguments[2],zh=arguments[3],Bh=arguments[4],Vh=arguments[5],Uh=arguments[6],Wh=arguments[7]):(Fh=arguments[1],Lh=arguments[2],Rh=arguments[3],zh=arguments[4],Bh=arguments[5],Vh=arguments[6],Uh=arguments[7],Wh=arguments[8]),e$4(Ph=arguments[0])===`object`&&!Kh(Ph)&&`imageData`in Ph){var Gh=Ph;Ph=Gh.imageData,Fh=Gh.format||Fh||Ih,Lh=Gh.x||Lh||0,Rh=Gh.y||Rh||0,zh=Gh.w||Gh.width||zh,Bh=Gh.h||Gh.height||Bh,Vh=Gh.alias||Vh,Uh=Gh.compression||Uh,Wh=Gh.rotation||Gh.angle||Wh}var qh=this.internal.getFilters();if(Uh===void 0&&qh.indexOf(`FlateEncode`)!==-1&&(Uh=`SLOW`),isNaN(Lh)||isNaN(Rh))throw Error(`Invalid coordinates passed to jsPDF.addImage`);Hh.call(this);var Jh=ag.call(this,Ph,Fh,Vh,Uh);return Xh.call(this,Lh,Rh,zh,Bh,Jh,Wh),this};var ag=function(Fh,Lh,zh,Bh){var Vh,Hh,Uh;if(typeof Fh==`string`&&Rh(Fh)===Ih){Fh=unescape(Fh);var Yh=og(Fh,!1);(Yh!==``||(Yh=Ph.loadFile(Fh,!0))!==void 0)&&(Fh=Yh)}if(Kh(Fh)&&(Fh=qh(Fh,Lh)),Lh=Rh(Fh,Lh),!Gh(Lh))throw Error(`addImage does not support files of type '`+Lh+`', please ensure that a plugin for '`+Lh+`' support is added.`);if(((Uh=zh)==null||Uh.length===0)&&(zh=function(Ph){return typeof Ph==`string`||ng(Ph)?$h(Ph):ng(Ph.data)?$h(Ph.data):null}(Fh)),(Vh=Jh.call(this,zh))||(Fh instanceof Uint8Array||Lh===`RGBA`||(Hh=Fh,Fh=rg(Fh)),Vh=this[`process`+Lh.toUpperCase()](Fh,Wh.call(this),zh,function(Fh){return Fh&&typeof Fh==`string`&&(Fh=Fh.toUpperCase()),Fh in Ph.image_compression?Fh:Qh.NONE}(Bh),Hh)),!Vh)throw Error(`An unknown error occurred whilst processing the image.`);return Vh},og=Ph.__addimage__.convertBase64ToBinaryString=function(Ph,Fh){Fh=typeof Fh!=`boolean`||Fh;var Ih,Lh=``;if(typeof Ph==`string`){Ih=tg(Ph)??Ph;try{Lh=So$1(Ih)}catch(Ph){if(Fh)throw eg(Ih)?Error(`atob-Error in jsPDF.convertBase64ToBinaryString `+Ph.message):Error(`Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString `)}}return Lh};Ph.getImageProperties=function(Fh){var Lh,zh,Bh=``;if(Kh(Fh)&&(Fh=qh(Fh)),typeof Fh==`string`&&Rh(Fh)===Ih&&((Bh=og(Fh,!1))===``&&(Bh=Ph.loadFile(Fh)||``),Fh=Bh),zh=Rh(Fh),!Gh(zh))throw Error(`addImage does not support files of type '`+zh+`', please ensure that a plugin for '`+zh+`' support is added.`);if(Fh instanceof Uint8Array||(Fh=rg(Fh)),!(Lh=this[`process`+zh.toUpperCase()](Fh)))throw Error(`An unknown error occurred whilst processing the image`);return Lh.fileType=zh,Lh}})(Z$3.API),function(Ph){var Fh=function(Ph){if(Ph!==void 0&&Ph!=``)return!0};Z$3.API.events.push([`addPage`,function(Ph){this.internal.getPageInfo(Ph.pageNumber).pageContext.annotations=[]}]),Ph.events.push([`putPage`,function(Ph){for(var Ih,Lh,Rh,zh=this.internal.getCoordinateString,Bh=this.internal.getVerticalCoordinateString,Vh=this.internal.getPageInfoByObjId(Ph.objId),Hh=Ph.pageContext.annotations,Uh=!1,Wh=0;Wh<Hh.length&&!Uh;Wh++)switch((Ih=Hh[Wh]).type){case`link`:(Fh(Ih.options.url)||Fh(Ih.options.pageNumber))&&(Uh=!0);break;case`reference`:case`text`:case`freetext`:Uh=!0}if(Uh!=0){this.internal.write(`/Annots [`);for(var Gh=0;Gh<Hh.length;Gh++){Ih=Hh[Gh];var Kh=this.internal.pdfEscape,qh=this.internal.getEncryptor(Ph.objId);switch(Ih.type){case`reference`:this.internal.write(` `+Ih.object.objId+` 0 R `);break;case`text`:var Jh=this.internal.newAdditionalObject(),Yh=this.internal.newAdditionalObject(),Xh=this.internal.getEncryptor(Jh.objId),Zh=Ih.title||`Note`;Rh=`<</Type /Annot /Subtype /Text `+(Lh=`/Rect [`+zh(Ih.bounds.x)+` `+Bh(Ih.bounds.y+Ih.bounds.h)+` `+zh(Ih.bounds.x+Ih.bounds.w)+` `+Bh(Ih.bounds.y)+`] `)+`/Contents (`+Kh(Xh(Ih.contents))+`)`,Rh+=` /Popup `+Yh.objId+` 0 R`,Rh+=` /P `+Vh.objId+` 0 R`,Rh+=` /T (`+Kh(Xh(Zh))+`) >>`,Jh.content=Rh;var Qh=Jh.objId+` 0 R`;Rh=`<</Type /Annot /Subtype /Popup `+(Lh=`/Rect [`+zh(Ih.bounds.x+30)+` `+Bh(Ih.bounds.y+Ih.bounds.h)+` `+zh(Ih.bounds.x+Ih.bounds.w+30)+` `+Bh(Ih.bounds.y)+`] `)+` /Parent `+Qh,Ih.open&&(Rh+=` /Open true`),Rh+=` >>`,Yh.content=Rh,this.internal.write(Jh.objId,`0 R`,Yh.objId,`0 R`);break;case`freetext`:Lh=`/Rect [`+zh(Ih.bounds.x)+` `+Bh(Ih.bounds.y)+` `+zh(Ih.bounds.x+Ih.bounds.w)+` `+Bh(Ih.bounds.y+Ih.bounds.h)+`] `;var $h=`font: Helvetica,sans-serif 12.0pt; text-align:left; color:#`+(Ih.color||`#000000`);Rh=`<</Type /Annot /Subtype /FreeText `+Lh+`/Contents (`+Kh(qh(Ih.contents))+`)`,Rh+=` /DS(`+Kh(qh($h))+`)`,Rh+=` /Border [0 0 0]`,Rh+=` >>`,this.internal.write(Rh);break;case`link`:if(Ih.options.name){var eg=this.annotations._nameMap[Ih.options.name];Ih.options.pageNumber=eg.page,Ih.options.top=eg.y}else Ih.options.top||(Ih.options.top=0);if(Lh=`/Rect [`+Ih.finalBounds.x+` `+Ih.finalBounds.y+` `+Ih.finalBounds.w+` `+Ih.finalBounds.h+`] `,Rh=``,Ih.options.url)Rh=`<</Type /Annot /Subtype /Link `+Lh+`/Border [0 0 0] /A <</S /URI /URI (`+Kh(qh(Ih.options.url))+`) >>`;else if(Ih.options.pageNumber)switch(Rh=`<</Type /Annot /Subtype /Link `+Lh+`/Border [0 0 0] /Dest [`+this.internal.getPageInfo(Ih.options.pageNumber).objId+` 0 R`,Ih.options.magFactor=Ih.options.magFactor||`XYZ`,Ih.options.magFactor){case`Fit`:Rh+=` /Fit]`;break;case`FitH`:Rh+=` /FitH `+Ih.options.top+`]`;break;case`FitV`:Ih.options.left=Ih.options.left||0,Rh+=` /FitV `+Ih.options.left+`]`;break;default:var tg=Bh(Ih.options.top);Ih.options.left=Ih.options.left||0,Ih.options.zoom===void 0&&(Ih.options.zoom=0),Rh+=` /XYZ `+Ih.options.left+` `+tg+` `+Ih.options.zoom+`]`}Rh!=``&&(Rh+=` >>`,this.internal.write(Rh))}}this.internal.write(`]`)}}]),Ph.createAnnotation=function(Ph){var Fh=this.internal.getCurrentPageInfo();switch(Ph.type){case`link`:this.link(Ph.bounds.x,Ph.bounds.y,Ph.bounds.w,Ph.bounds.h,Ph);break;case`text`:case`freetext`:Fh.pageContext.annotations.push(Ph)}},Ph.link=function(Ph,Fh,Ih,Lh,Rh){var zh=this.internal.getCurrentPageInfo(),Bh=this.internal.getCoordinateString,Vh=this.internal.getVerticalCoordinateString;zh.pageContext.annotations.push({finalBounds:{x:Bh(Ph),y:Vh(Fh),w:Bh(Ph+Ih),h:Vh(Fh+Lh)},options:Rh,type:`link`})},Ph.textWithLink=function(Ph,Fh,Ih,Lh){var Rh,zh,Bh=this.getTextWidth(Ph),Vh=this.internal.getLineHeight()/this.internal.scaleFactor;if(Lh.maxWidth!==void 0){zh=Lh.maxWidth;var Hh=this.splitTextToSize(Ph,zh).length;Rh=Math.ceil(Vh*Hh)}else zh=Bh,Rh=Vh;return this.text(Ph,Fh,Ih,Lh),Ih+=.2*Vh,Lh.align===`center`&&(Fh-=Bh/2),Lh.align===`right`&&(Fh-=Bh),this.link(Fh,Ih-Vh,zh,Rh,Lh),Bh},Ph.getTextWidth=function(Ph){var Fh=this.internal.getFontSize();return this.getStringUnitWidth(Ph)*Fh/this.internal.scaleFactor}}(Z$3.API),function(Ph){var Fh={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},Ih={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},Lh={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},Rh=[1570,1571,1573,1575];Ph.__arabicParser__={};var zh=Ph.__arabicParser__.isInArabicSubstitutionA=function(Ph){return Fh[Ph.charCodeAt(0)]!==void 0},Bh=Ph.__arabicParser__.isArabicLetter=function(Ph){return typeof Ph==`string`&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(Ph)},Vh=Ph.__arabicParser__.isArabicEndLetter=function(Ph){return Bh(Ph)&&zh(Ph)&&Fh[Ph.charCodeAt(0)].length<=2},Hh=Ph.__arabicParser__.isArabicAlfLetter=function(Ph){return Bh(Ph)&&Rh.indexOf(Ph.charCodeAt(0))>=0};Ph.__arabicParser__.arabicLetterHasIsolatedForm=function(Ph){return Bh(Ph)&&zh(Ph)&&Fh[Ph.charCodeAt(0)].length>=1};var Uh=Ph.__arabicParser__.arabicLetterHasFinalForm=function(Ph){return Bh(Ph)&&zh(Ph)&&Fh[Ph.charCodeAt(0)].length>=2};Ph.__arabicParser__.arabicLetterHasInitialForm=function(Ph){return Bh(Ph)&&zh(Ph)&&Fh[Ph.charCodeAt(0)].length>=3};var Wh=Ph.__arabicParser__.arabicLetterHasMedialForm=function(Ph){return Bh(Ph)&&zh(Ph)&&Fh[Ph.charCodeAt(0)].length==4},Gh=Ph.__arabicParser__.resolveLigatures=function(Ph){var Fh=0,Lh=Ih,Rh=``,zh=0;for(Fh=0;Fh<Ph.length;Fh+=1)Lh[Ph.charCodeAt(Fh)]===void 0?(Lh=Ih,Rh+=Ph.charAt(Fh-zh),Fh-=zh,zh=0):(zh++,typeof(Lh=Lh[Ph.charCodeAt(Fh)])==`number`&&(Rh+=String.fromCharCode(Lh),Lh=Ih,zh=0),Fh===Ph.length-1&&(Lh=Ih,Rh+=Ph.charAt(Fh-(zh-1)),Fh-=zh-1,zh=0));return Rh};Ph.__arabicParser__.isArabicDiacritic=function(Ph){return Ph!==void 0&&Lh[Ph.charCodeAt(0)]!==void 0};var Kh=Ph.__arabicParser__.getCorrectForm=function(Ph,Fh,Ih){return Bh(Ph)?!1===zh(Ph)?-1:!Uh(Ph)||!Bh(Fh)&&!Bh(Ih)||!Bh(Ih)&&Vh(Fh)||Vh(Ph)&&!Bh(Fh)||Vh(Ph)&&Hh(Fh)||Vh(Ph)&&Vh(Fh)?0:Wh(Ph)&&Bh(Fh)&&!Vh(Fh)&&Bh(Ih)&&Uh(Ih)?3:Vh(Ph)||!Bh(Ih)?1:2:-1},qh=function(Ph){var Ih=0,Lh=0,Rh=0,zh=``,Vh=``,Hh=``,Uh=(Ph||=``).split(`\\s+`),Wh=[];for(Ih=0;Ih<Uh.length;Ih+=1){for(Wh.push(``),Lh=0;Lh<Uh[Ih].length;Lh+=1)zh=Uh[Ih][Lh],Vh=Uh[Ih][Lh-1],Hh=Uh[Ih][Lh+1],Bh(zh)?(Rh=Kh(zh,Vh,Hh),Wh[Ih]+=Rh===-1?zh:String.fromCharCode(Fh[zh.charCodeAt(0)][Rh])):Wh[Ih]+=zh;Wh[Ih]=Gh(Wh[Ih])}return Wh.join(` `)},Jh=Ph.__arabicParser__.processArabic=Ph.processArabic=function(){var Ph,Fh=typeof arguments[0]==`string`?arguments[0]:arguments[0].text,Ih=[];if(Array.isArray(Fh)){var Lh=0;for(Ih=[],Lh=0;Lh<Fh.length;Lh+=1)Array.isArray(Fh[Lh])?Ih.push([qh(Fh[Lh][0]),Fh[Lh][1],Fh[Lh][2]]):Ih.push([qh(Fh[Lh])]);Ph=Ih}else Ph=qh(Fh);return typeof arguments[0]==`string`?Ph:(arguments[0].text=Ph,arguments[0])};Ph.events.push([`preProcessText`,Jh])}(Z$3.API),Z$3.API.autoPrint=function(Ph){var Fh;return(Ph||={}).variant=Ph.variant||`non-conform`,Ph.variant===`javascript`?this.addJS(`print({});`):(this.internal.events.subscribe(`postPutResources`,function(){Fh=this.internal.newObject(),this.internal.out(`<<`),this.internal.out(`/S /Named`),this.internal.out(`/Type /Action`),this.internal.out(`/N /Print`),this.internal.out(`>>`),this.internal.out(`endobj`)}),this.internal.events.subscribe(`putCatalog`,function(){this.internal.out(`/OpenAction `+Fh+` 0 R`)})),this},function(Ph){var Fh=function(){var Ph=void 0;Object.defineProperty(this,`pdf`,{get:function(){return Ph},set:function(Fh){Ph=Fh}});var Fh=150;Object.defineProperty(this,`width`,{get:function(){return Fh},set:function(Ph){Fh=isNaN(Ph)||!1===Number.isInteger(Ph)||Ph<0?150:Ph,this.getContext(`2d`).pageWrapXEnabled&&(this.getContext(`2d`).pageWrapX=Fh+1)}});var Ih=300;Object.defineProperty(this,`height`,{get:function(){return Ih},set:function(Ph){Ih=isNaN(Ph)||!1===Number.isInteger(Ph)||Ph<0?300:Ph,this.getContext(`2d`).pageWrapYEnabled&&(this.getContext(`2d`).pageWrapY=Ih+1)}});var Lh=[];Object.defineProperty(this,`childNodes`,{get:function(){return Lh},set:function(Ph){Lh=Ph}});var Rh={};Object.defineProperty(this,`style`,{get:function(){return Rh},set:function(Ph){Rh=Ph}}),Object.defineProperty(this,`parentNode`,{})};Fh.prototype.getContext=function(Ph,Fh){var Ih;if((Ph||=`2d`)!==`2d`)return null;for(Ih in Fh)this.pdf.context2d.hasOwnProperty(Ih)&&(this.pdf.context2d[Ih]=Fh[Ih]);return this.pdf.context2d._canvas=this,this.pdf.context2d},Fh.prototype.toDataURL=function(){throw Error(`toDataURL is not implemented.`)},Ph.events.push([`initialized`,function(){this.canvas=new Fh,this.canvas.pdf=this}])}(Z$3.API),function(Ph){var Fh={left:0,top:0,bottom:0,right:0},Ih=!1,Lh=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},Fh),this.internal.__cell__.margins.width=this.getPageWidth(),Rh.call(this))},Rh=function(){this.internal.__cell__.lastCell=new zh,this.internal.__cell__.pages=1},zh=function(){var Ph=arguments[0];Object.defineProperty(this,`x`,{enumerable:!0,get:function(){return Ph},set:function(Fh){Ph=Fh}});var Fh=arguments[1];Object.defineProperty(this,`y`,{enumerable:!0,get:function(){return Fh},set:function(Ph){Fh=Ph}});var Ih=arguments[2];Object.defineProperty(this,`width`,{enumerable:!0,get:function(){return Ih},set:function(Ph){Ih=Ph}});var Lh=arguments[3];Object.defineProperty(this,`height`,{enumerable:!0,get:function(){return Lh},set:function(Ph){Lh=Ph}});var Rh=arguments[4];Object.defineProperty(this,`text`,{enumerable:!0,get:function(){return Rh},set:function(Ph){Rh=Ph}});var zh=arguments[5];Object.defineProperty(this,`lineNumber`,{enumerable:!0,get:function(){return zh},set:function(Ph){zh=Ph}});var Bh=arguments[6];return Object.defineProperty(this,`align`,{enumerable:!0,get:function(){return Bh},set:function(Ph){Bh=Ph}}),this};zh.prototype.clone=function(){return new zh(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},zh.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},Ph.setHeaderFunction=function(Ph){return Lh.call(this),this.internal.__cell__.headerFunction=typeof Ph==`function`?Ph:void 0,this},Ph.getTextDimensions=function(Ph,Fh){Lh.call(this);var Ih=(Fh||={}).fontSize||this.getFontSize(),Rh=Fh.font||this.getFont(),zh=Fh.scaleFactor||this.internal.scaleFactor,Bh=0,Vh=0,Hh=0,Uh=this;if(!Array.isArray(Ph)&&typeof Ph!=`string`){if(typeof Ph!=`number`)throw Error(`getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.`);Ph=String(Ph)}var Wh=Fh.maxWidth;Wh>0?typeof Ph==`string`?Ph=this.splitTextToSize(Ph,Wh):Object.prototype.toString.call(Ph)===`[object Array]`&&(Ph=Ph.reduce(function(Ph,Fh){return Ph.concat(Uh.splitTextToSize(Fh,Wh))},[])):Ph=Array.isArray(Ph)?Ph:[Ph];for(var Gh=0;Gh<Ph.length;Gh++)Bh<(Hh=this.getStringUnitWidth(Ph[Gh],{font:Rh})*Ih)&&(Bh=Hh);return Bh!==0&&(Vh=Ph.length),{w:Bh/=zh,h:Math.max((Vh*Ih*this.getLineHeightFactor()-Ih*(this.getLineHeightFactor()-1))/zh,0)}},Ph.cellAddPage=function(){Lh.call(this),this.addPage();var Ph=this.internal.__cell__.margins||Fh;return this.internal.__cell__.lastCell=new zh(Ph.left,Ph.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var Bh=Ph.cell=function(){var Ph=arguments[0]instanceof zh?arguments[0]:new zh(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]);Lh.call(this);var Rh=this.internal.__cell__.lastCell,Bh=this.internal.__cell__.padding,Vh=this.internal.__cell__.margins||Fh,Hh=this.internal.__cell__.tableHeaderRow,Uh=this.internal.__cell__.printHeaders;return Rh.lineNumber!==void 0&&(Rh.lineNumber===Ph.lineNumber?(Ph.x=(Rh.x||0)+(Rh.width||0),Ph.y=Rh.y||0):Rh.y+Rh.height+Ph.height+Vh.bottom>this.getPageHeight()?(this.cellAddPage(),Ph.y=Vh.top,Uh&&Hh&&(this.printHeaderRow(Ph.lineNumber,!0),Ph.y+=Hh[0].height)):Ph.y=Rh.y+Rh.height||Ph.y),Ph.text[0]!==void 0&&(this.rect(Ph.x,Ph.y,Ph.width,Ph.height,!0===Ih?`FD`:void 0),Ph.align===`right`?this.text(Ph.text,Ph.x+Ph.width-Bh,Ph.y+Bh,{align:`right`,baseline:`top`}):Ph.align===`center`?this.text(Ph.text,Ph.x+Ph.width/2,Ph.y+Bh,{align:`center`,baseline:`top`,maxWidth:Ph.width-Bh-Bh}):this.text(Ph.text,Ph.x+Bh,Ph.y+Bh,{align:`left`,baseline:`top`,maxWidth:Ph.width-Bh-Bh})),this.internal.__cell__.lastCell=Ph,this};Ph.table=function(Ph,Ih,Hh,Uh,Wh){if(Lh.call(this),!Hh)throw Error(`No data for PDF table.`);var Gh,Kh,qh,Jh,Yh=[],Xh=[],Zh=[],Qh={},$h={},eg=[],tg=[],ng=(Wh||={}).autoSize||!1,rg=!1!==Wh.printHeaders,ig=Wh.css&&Wh.css[`font-size`]!==void 0?16*Wh.css[`font-size`]:Wh.fontSize||12,ag=Wh.margins||Object.assign({width:this.getPageWidth()},Fh),og=typeof Wh.padding==`number`?Wh.padding:3,sg=Wh.headerBackgroundColor||`#c8c8c8`,cg=Wh.headerTextColor||`#000`;if(Rh.call(this),this.internal.__cell__.printHeaders=rg,this.internal.__cell__.margins=ag,this.internal.__cell__.table_font_size=ig,this.internal.__cell__.padding=og,this.internal.__cell__.headerBackgroundColor=sg,this.internal.__cell__.headerTextColor=cg,this.setFontSize(ig),Uh==null)Xh=Yh=Object.keys(Hh[0]),Zh=Yh.map(function(){return`left`});else if(Array.isArray(Uh)&&e$4(Uh[0])===`object`)for(Yh=Uh.map(function(Ph){return Ph.name}),Xh=Uh.map(function(Ph){return Ph.prompt||Ph.name||``}),Zh=Uh.map(function(Ph){return Ph.align||`left`}),Gh=0;Gh<Uh.length;Gh+=1)$h[Uh[Gh].name]=.7499990551181103*Uh[Gh].width;else Array.isArray(Uh)&&typeof Uh[0]==`string`&&(Xh=Yh=Uh,Zh=Yh.map(function(){return`left`}));if(ng||Array.isArray(Uh)&&typeof Uh[0]==`string`)for(Gh=0;Gh<Yh.length;Gh+=1){for(Qh[Jh=Yh[Gh]]=Hh.map(function(Ph){return Ph[Jh]}),this.setFont(void 0,`bold`),eg.push(this.getTextDimensions(Xh[Gh],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),Kh=Qh[Jh],this.setFont(void 0,`normal`),qh=0;qh<Kh.length;qh+=1)eg.push(this.getTextDimensions(Kh[qh],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);$h[Jh]=Math.max.apply(null,eg)+og+og,eg=[]}if(rg){var lg={};for(Gh=0;Gh<Yh.length;Gh+=1)lg[Yh[Gh]]={},lg[Yh[Gh]].text=Xh[Gh],lg[Yh[Gh]].align=Zh[Gh];var ug=Vh.call(this,lg,$h);tg=Yh.map(function(Fh){return new zh(Ph,Ih,$h[Fh],ug,lg[Fh].text,void 0,lg[Fh].align)}),this.setTableHeaderRow(tg),this.printHeaderRow(1,!1)}var dg=Uh.reduce(function(Ph,Fh){return Ph[Fh.name]=Fh.align,Ph},{});for(Gh=0;Gh<Hh.length;Gh+=1){`rowStart`in Wh&&Wh.rowStart instanceof Function&&Wh.rowStart({row:Gh,data:Hh[Gh]},this);var fg=Vh.call(this,Hh[Gh],$h);for(qh=0;qh<Yh.length;qh+=1){var pg=Hh[Gh][Yh[qh]];`cellStart`in Wh&&Wh.cellStart instanceof Function&&Wh.cellStart({row:Gh,col:qh,data:pg},this),Bh.call(this,new zh(Ph,Ih,$h[Yh[qh]],fg,pg,Gh+2,dg[Yh[qh]]))}}return this.internal.__cell__.table_x=Ph,this.internal.__cell__.table_y=Ih,this};var Vh=function(Ph,Fh){var Ih=this.internal.__cell__.padding,Lh=this.internal.__cell__.table_font_size,Rh=this.internal.scaleFactor;return Object.keys(Ph).map(function(Lh){var Rh=Ph[Lh];return this.splitTextToSize(Rh.hasOwnProperty(`text`)?Rh.text:Rh,Fh[Lh]-Ih-Ih)},this).map(function(Ph){return this.getLineHeightFactor()*Ph.length*Lh/Rh+Ih+Ih},this).reduce(function(Ph,Fh){return Math.max(Ph,Fh)},0)};Ph.setTableHeaderRow=function(Ph){Lh.call(this),this.internal.__cell__.tableHeaderRow=Ph},Ph.printHeaderRow=function(Ph,Fh){if(Lh.call(this),!this.internal.__cell__.tableHeaderRow)throw Error(`Property tableHeaderRow does not exist.`);var Rh;if(Ih=!0,typeof this.internal.__cell__.headerFunction==`function`){var Vh=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new zh(Vh[0],Vh[1],Vh[2],Vh[3],void 0,-1)}this.setFont(void 0,`bold`);for(var Hh=[],Uh=0;Uh<this.internal.__cell__.tableHeaderRow.length;Uh+=1){Rh=this.internal.__cell__.tableHeaderRow[Uh].clone(),Fh&&(Rh.y=this.internal.__cell__.margins.top||0,Hh.push(Rh)),Rh.lineNumber=Ph;var Wh=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),Bh.call(this,Rh),this.setTextColor(Wh)}Hh.length>0&&this.setTableHeaderRow(Hh),this.setFont(void 0,`normal`),Ih=!1}}(Z$3.API);var Ps$1={italic:[`italic`,`oblique`,`normal`],oblique:[`oblique`,`italic`,`normal`],normal:[`normal`,`oblique`,`italic`]},Fs$1=[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`],Is$1=Ns$1(Fs$1),Ls$1=[100,200,300,400,500,600,700,800,900],Rs$1=Ns$1(Ls$1);function zs$1(Ph){var Fh=Ph.family.replace(/"|'/g,``).toLowerCase(),Ih=function(Ph){return Ps$1[Ph||=`normal`]?Ph:`normal`}(Ph.style),Lh=function(Ph){return Ph?typeof Ph==`number`?Ph>=100&&Ph<=900&&Ph%100==0?Ph:400:/^\d00$/.test(Ph)?parseInt(Ph):Ph===`bold`?700:400:400}(Ph.weight),Rh=function(Ph){return typeof Is$1[Ph||=`normal`]==`number`?Ph:`normal`}(Ph.stretch);return{family:Fh,style:Ih,weight:Lh,stretch:Rh,src:Ph.src||[],ref:Ph.ref||{name:Fh,style:[Rh,Ih,Lh].join(` `)}}}function Bs$1(Ph,Fh,Ih,Lh){var Rh;for(Rh=Ih;Rh>=0&&Rh<Fh.length;Rh+=Lh)if(Ph[Fh[Rh]])return Ph[Fh[Rh]];for(Rh=Ih;Rh>=0&&Rh<Fh.length;Rh-=Lh)if(Ph[Fh[Rh]])return Ph[Fh[Rh]]}var Vs$1={"sans-serif":`helvetica`,fixed:`courier`,monospace:`courier`,terminal:`courier`,cursive:`times`,fantasy:`times`,serif:`times`},Hs$1={caption:`times`,icon:`times`,menu:`times`,"message-box":`times`,"small-caption":`times`,"status-bar":`times`};function Us$1(Ph){return[Ph.stretch,Ph.style,Ph.weight,Ph.family].join(` `)}function Ws$1(Ph){return Ph.trimLeft()}function Gs$1(Ph,Fh){for(var Ih=0;Ih<Ph.length;){if(Ph.charAt(Ih)===Fh)return[Ph.substring(0,Ih),Ph.substring(Ih+1)];Ih+=1}return null}function Ks$1(Ph){var Fh=Ph.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return Fh===null?null:[Fh[0],Ph.substring(Fh[0].length)]}var qs$1,Js$1,Ys$1,Xs$1,Zs$1,Qs$1=[`times`];function $s$1(Ph,Fh,Ih,Lh,Rh){var zh=4,Bh=nc$1;switch(Rh){case Z$3.API.image_compression.FAST:zh=1,Bh=tc$1;break;case Z$3.API.image_compression.MEDIUM:zh=6,Bh=rc$1;break;case Z$3.API.image_compression.SLOW:zh=9,Bh=ic$1}Ph=function(Ph,Fh,Ih,Lh){for(var Rh,zh=Ph.length/Fh,Bh=new Uint8Array(Ph.length+zh),Vh=[ec$1,tc$1,nc$1,rc$1,ic$1],Hh=0;Hh<zh;Hh+=1){var Uh=Hh*Fh,Wh=Ph.subarray(Uh,Uh+Fh);if(Lh)Bh.set(Lh(Wh,Ih,Rh),Uh+Hh);else{for(var Gh=Vh.length,Kh=[],qh=0;qh<Gh;qh+=1)Kh[qh]=Vh[qh](Wh,Ih,Rh);var Jh=oc$1(Kh.concat());Bh.set(Kh[Jh],Uh+Hh)}Rh=Wh}return Bh}(Ph,Fh,Math.ceil(Ih*Lh/8),Bh);var Vh=me$3(Ph,{level:zh});return Z$3.API.__addimage__.arrayBufferToBinaryString(Vh)}function ec$1(Ph){var Fh=Array.apply([],Ph);return Fh.unshift(0),Fh}function tc$1(Ph,Fh){var Ih=Ph.length,Lh=[];Lh[0]=1;for(var Rh=0;Rh<Ih;Rh+=1){var zh=Ph[Rh-Fh]||0;Lh[Rh+1]=Ph[Rh]-zh+256&255}return Lh}function nc$1(Ph,Fh,Ih){var Lh=Ph.length,Rh=[];Rh[0]=2;for(var zh=0;zh<Lh;zh+=1){var Bh=Ih&&Ih[zh]||0;Rh[zh+1]=Ph[zh]-Bh+256&255}return Rh}function rc$1(Ph,Fh,Ih){var Lh=Ph.length,Rh=[];Rh[0]=3;for(var zh=0;zh<Lh;zh+=1){var Bh=Ph[zh-Fh]||0,Vh=Ih&&Ih[zh]||0;Rh[zh+1]=Ph[zh]+256-(Bh+Vh>>>1)&255}return Rh}function ic$1(Ph,Fh,Ih){var Lh=Ph.length,Rh=[];Rh[0]=4;for(var zh=0;zh<Lh;zh+=1){var Bh=ac$1(Ph[zh-Fh]||0,Ih&&Ih[zh]||0,Ih&&Ih[zh-Fh]||0);Rh[zh+1]=Ph[zh]-Bh+256&255}return Rh}function ac$1(Ph,Fh,Ih){if(Ph===Fh&&Fh===Ih)return Ph;var Lh=Math.abs(Fh-Ih),Rh=Math.abs(Ph-Ih),zh=Math.abs(Ph+Fh-Ih-Ih);return Lh<=Rh&&Lh<=zh?Ph:Rh<=zh?Fh:Ih}function oc$1(Ph){var Fh=Ph.map(function(Ph){return Ph.reduce(function(Ph,Fh){return Ph+Math.abs(Fh)},0)});return Fh.indexOf(Math.min.apply(null,Fh))}function sc$1(Ph,Fh,Ih){var Lh=Fh*Ih,Rh=Math.floor(Lh/8),zh=16-(Lh-8*Rh+Ih),Bh=(1<<Ih)-1;return lc$1(Ph,Rh)>>zh&Bh}function cc$1(Ph,Fh,Ih,Lh){var Rh=Ih*Lh,zh=Math.floor(Rh/8),Bh=16-(Rh-8*zh+Lh),Vh=(1<<Lh)-1,Hh=(Fh&Vh)<<Bh;(function(Ph,Fh,Ih){if(Fh+1<Ph.byteLength)Ph.setUint16(Fh,Ih,!1);else{var Lh=Ih>>8&255;Ph.setUint8(Fh,Lh)}})(Ph,zh,lc$1(Ph,zh)&~(Vh<<Bh)&65535|Hh)}function lc$1(Ph,Fh){return Fh+1<Ph.byteLength?Ph.getUint16(Fh,!1):Ph.getUint8(Fh)<<8}function uc$1(Ph){var Fh=0;if(Ph[Fh++]!==71||Ph[Fh++]!==73||Ph[Fh++]!==70||Ph[Fh++]!==56||(Ph[Fh++]+1&253)!=56||Ph[Fh++]!==97)throw Error(`Invalid GIF 87a/89a header.`);var Ih=Ph[Fh++]|Ph[Fh++]<<8,Lh=Ph[Fh++]|Ph[Fh++]<<8,Rh=Ph[Fh++],zh=Rh>>7,Bh=1<<1+(7&Rh);Ph[Fh++],Ph[Fh++];var Vh=null,Hh=null;zh&&(Vh=Fh,Hh=Bh,Fh+=3*Bh);var Uh=!0,Wh=[],Gh=0,Kh=null,qh=0,Jh=null;for(this.width=Ih,this.height=Lh;Uh&&Fh<Ph.length;)switch(Ph[Fh++]){case 33:switch(Ph[Fh++]){case 255:if(Ph[Fh]!==11||Ph[Fh+1]==78&&Ph[Fh+2]==69&&Ph[Fh+3]==84&&Ph[Fh+4]==83&&Ph[Fh+5]==67&&Ph[Fh+6]==65&&Ph[Fh+7]==80&&Ph[Fh+8]==69&&Ph[Fh+9]==50&&Ph[Fh+10]==46&&Ph[Fh+11]==48&&Ph[Fh+12]==3&&Ph[Fh+13]==1&&Ph[Fh+16]==0)Fh+=14,Jh=Ph[Fh++]|Ph[Fh++]<<8,Fh++;else for(Fh+=12;;){if(!((sg=Ph[Fh++])>=0))throw Error(`Invalid block size`);if(sg===0)break;Fh+=sg}break;case 249:if(Ph[Fh++]!==4||Ph[Fh+4]!==0)throw Error(`Invalid graphics extension block.`);var Yh=Ph[Fh++];Gh=Ph[Fh++]|Ph[Fh++]<<8,Kh=Ph[Fh++],1&Yh||(Kh=null),qh=Yh>>2&7,Fh++;break;case 254:for(;;){if(!((sg=Ph[Fh++])>=0))throw Error(`Invalid block size`);if(sg===0)break;Fh+=sg}break;default:throw Error(`Unknown graphic control label: 0x`+Ph[Fh-1].toString(16))}break;case 44:var Xh=Ph[Fh++]|Ph[Fh++]<<8,Zh=Ph[Fh++]|Ph[Fh++]<<8,Qh=Ph[Fh++]|Ph[Fh++]<<8,$h=Ph[Fh++]|Ph[Fh++]<<8,eg=Ph[Fh++],tg=eg>>6&1,ng=1<<1+(7&eg),rg=Vh,ig=Hh,ag=!1;eg>>7&&(ag=!0,rg=Fh,ig=ng,Fh+=3*ng);var og=Fh;for(Fh++;;){var sg;if(!((sg=Ph[Fh++])>=0))throw Error(`Invalid block size`);if(sg===0)break;Fh+=sg}Wh.push({x:Xh,y:Zh,width:Qh,height:$h,has_local_palette:ag,palette_offset:rg,palette_size:ig,data_offset:og,data_length:Fh-og,transparent_index:Kh,interlaced:!!tg,delay:Gh,disposal:qh});break;case 59:Uh=!1;break;default:throw Error(`Unknown gif block: 0x`+Ph[Fh-1].toString(16))}this.numFrames=function(){return Wh.length},this.loopCount=function(){return Jh},this.frameInfo=function(Ph){if(Ph<0||Ph>=Wh.length)throw Error(`Frame index out of range.`);return Wh[Ph]},this.decodeAndBlitFrameBGRA=function(Fh,Lh){var Rh=this.frameInfo(Fh),zh=Rh.width*Rh.height;if(zh>536870912)throw Error(`Image dimensions exceed 512MB, which is too large.`);var Bh=new Uint8Array(zh);dc$1(Ph,Rh.data_offset,Bh,zh);var Vh=Rh.palette_offset,Hh=Rh.transparent_index;Hh===null&&(Hh=256);var Uh=Rh.width,Wh=Ih-Uh,Gh=Uh,Kh=4*(Rh.y*Ih+Rh.x),qh=4*((Rh.y+Rh.height)*Ih+Rh.x),Jh=Kh,Yh=4*Wh;!0===Rh.interlaced&&(Yh+=4*Ih*7);for(var Xh=8,Zh=0,Qh=Bh.length;Zh<Qh;++Zh){var $h=Bh[Zh];if(Gh===0&&(Gh=Uh,(Jh+=Yh)>=qh&&(Yh=4*Wh+4*Ih*(Xh-1),Jh=Kh+(Uh+Wh)*(Xh<<1),Xh>>=1)),$h===Hh)Jh+=4;else{var eg=Ph[Vh+3*$h],tg=Ph[Vh+3*$h+1],ng=Ph[Vh+3*$h+2];Lh[Jh++]=ng,Lh[Jh++]=tg,Lh[Jh++]=eg,Lh[Jh++]=255}--Gh}},this.decodeAndBlitFrameRGBA=function(Fh,Lh){var Rh=this.frameInfo(Fh),zh=Rh.width*Rh.height;if(zh>536870912)throw Error(`Image dimensions exceed 512MB, which is too large.`);var Bh=new Uint8Array(zh);dc$1(Ph,Rh.data_offset,Bh,zh);var Vh=Rh.palette_offset,Hh=Rh.transparent_index;Hh===null&&(Hh=256);var Uh=Rh.width,Wh=Ih-Uh,Gh=Uh,Kh=4*(Rh.y*Ih+Rh.x),qh=4*((Rh.y+Rh.height)*Ih+Rh.x),Jh=Kh,Yh=4*Wh;!0===Rh.interlaced&&(Yh+=4*Ih*7);for(var Xh=8,Zh=0,Qh=Bh.length;Zh<Qh;++Zh){var $h=Bh[Zh];if(Gh===0&&(Gh=Uh,(Jh+=Yh)>=qh&&(Yh=4*Wh+4*Ih*(Xh-1),Jh=Kh+(Uh+Wh)*(Xh<<1),Xh>>=1)),$h===Hh)Jh+=4;else{var eg=Ph[Vh+3*$h],tg=Ph[Vh+3*$h+1],ng=Ph[Vh+3*$h+2];Lh[Jh++]=eg,Lh[Jh++]=tg,Lh[Jh++]=ng,Lh[Jh++]=255}--Gh}}}function dc$1(Ph,Fh,Ih,Lh){for(var Rh=Ph[Fh++],zh=1<<Rh,Bh=zh+1,Vh=Bh+1,Hh=Rh+1,Uh=(1<<Hh)-1,Wh=0,Gh=0,Kh=0,qh=Ph[Fh++],Jh=new Int32Array(4096),Yh=null;;){for(;Wh<16&&qh!==0;)Gh|=Ph[Fh++]<<Wh,Wh+=8,qh===1?qh=Ph[Fh++]:--qh;if(Wh<Hh)break;var Xh=Gh&Uh;if(Gh>>=Hh,Wh-=Hh,Xh!==zh){if(Xh===Bh)break;for(var Zh=Xh<Vh?Xh:Yh,Qh=0,$h=Zh;$h>zh;)$h=Jh[$h]>>8,++Qh;var eg=$h;if(Kh+Qh+(Zh===Xh?0:1)>Lh)return void go$1.log(`Warning, gif stream longer than expected.`);Ih[Kh++]=eg;var tg=Kh+=Qh;for(Zh!==Xh&&(Ih[Kh++]=eg),$h=Zh;Qh--;)$h=Jh[$h],Ih[--tg]=255&$h,$h>>=8;Yh!==null&&Vh<4096&&(Jh[Vh++]=Yh<<8|eg,Vh>=Uh+1&&Hh<12&&(++Hh,Uh=Uh<<1|1)),Yh=Xh}else Vh=Bh+1,Uh=(1<<(Hh=Rh+1))-1,Yh=null}return Kh!==Lh&&go$1.log(`Warning, gif stream shorter than expected.`),Ih}function fc$1(Ph){var Fh,Ih,Lh,Rh,zh,Bh=Math.floor,Vh=Array(64),Hh=Array(64),Uh=Array(64),Wh=Array(64),Gh=Array(65535),Kh=Array(65535),qh=Array(64),Jh=Array(64),Yh=[],Xh=0,Zh=7,Qh=Array(64),$h=Array(64),eg=Array(64),tg=Array(256),ng=Array(2048),rg=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],ig=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],ag=[0,1,2,3,4,5,6,7,8,9,10,11],og=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],sg=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],cg=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],lg=[0,1,2,3,4,5,6,7,8,9,10,11],ug=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],dg=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function fg(Ph,Fh){for(var Ih=0,Lh=0,Rh=[],zh=1;zh<=16;zh++){for(var Bh=1;Bh<=Ph[zh];Bh++)Rh[Fh[Lh]]=[],Rh[Fh[Lh]][0]=Ih,Rh[Fh[Lh]][1]=zh,Lh++,Ih++;Ih*=2}return Rh}function pg(Ph){for(var Fh=Ph[0],Ih=Ph[1]-1;Ih>=0;)Fh&1<<Ih&&(Xh|=1<<Zh),Ih--,--Zh<0&&(Xh==255?(mg(255),mg(0)):mg(Xh),Zh=7,Xh=0)}function mg(Ph){Yh.push(Ph)}function hg(Ph){mg(Ph>>8&255),mg(255&Ph)}function gg(Ph,Fh,Ih,Lh,Rh){for(var zh,Bh=Rh[0],Vh=Rh[240],Hh=function(Ph,Fh){var Ih,Lh,Rh,zh,Bh,Vh,Hh,Uh,Wh,Gh,Kh=0;for(Wh=0;Wh<8;++Wh){Ih=Ph[Kh],Lh=Ph[Kh+1],Rh=Ph[Kh+2],zh=Ph[Kh+3],Bh=Ph[Kh+4],Vh=Ph[Kh+5],Hh=Ph[Kh+6];var Jh=Ih+(Uh=Ph[Kh+7]),Yh=Ih-Uh,Xh=Lh+Hh,Zh=Lh-Hh,Qh=Rh+Vh,$h=Rh-Vh,eg=zh+Bh,tg=zh-Bh,ng=Jh+eg,rg=Jh-eg,ig=Xh+Qh,ag=Xh-Qh;Ph[Kh]=ng+ig,Ph[Kh+4]=ng-ig;var og=.707106781*(ag+rg);Ph[Kh+2]=rg+og,Ph[Kh+6]=rg-og;var sg=.382683433*((ng=tg+$h)-(ag=Zh+Yh)),cg=.5411961*ng+sg,lg=1.306562965*ag+sg,ug=.707106781*(ig=$h+Zh),dg=Yh+ug,fg=Yh-ug;Ph[Kh+5]=fg+cg,Ph[Kh+3]=fg-cg,Ph[Kh+1]=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.max(Ph,1),100),zh!=Ph&&(function(Ph){for(var Fh=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],Ih=0;Ih<64;Ih++){var Lh=Bh((Fh[Ih]*Ph+50)/100);Lh=Math.min(Math.max(Lh,1),255),Vh[rg[Ih]]=Lh}for(var Rh=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],zh=0;zh<64;zh++){var Gh=Bh((Rh[zh]*Ph+50)/100);Gh=Math.min(Math.max(Gh,1),255),Hh[rg[zh]]=Gh}for(var Kh=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],qh=0,Jh=0;Jh<8;Jh++)for(var Yh=0;Yh<8;Yh++)Uh[qh]=1/(Vh[rg[qh]]*Kh[Jh]*Kh[Yh]*8),Wh[qh]=1/(Hh[rg[qh]]*Kh[Jh]*Kh[Yh]*8),qh++}(Math.floor(Ph<50?5e3/Ph:200-2*Ph)),zh=Ph)}this.encode=function(Ph,zh){zh&&_g(zh),Yh=[],Xh=0,Zh=7,hg(65496),hg(65504),hg(16),mg(74),mg(70),mg(73),mg(70),mg(0),mg(1),mg(1),mg(0),hg(1),hg(1),mg(0),mg(0),function(){hg(65499),hg(132),mg(0);for(var Ph=0;Ph<64;Ph++)mg(Vh[Ph]);mg(1);for(var Fh=0;Fh<64;Fh++)mg(Hh[Fh])}(),function(Ph,Fh){hg(65472),hg(17),mg(8),hg(Fh),hg(Ph),mg(3),mg(1),mg(17),mg(0),mg(2),mg(17),mg(1),mg(3),mg(17),mg(1)}(Ph.width,Ph.height),function(){hg(65476),hg(418),mg(0);for(var Ph=0;Ph<16;Ph++)mg(ig[Ph+1]);for(var Fh=0;Fh<=11;Fh++)mg(ag[Fh]);mg(16);for(var Ih=0;Ih<16;Ih++)mg(og[Ih+1]);for(var Lh=0;Lh<=161;Lh++)mg(sg[Lh]);mg(1);for(var Rh=0;Rh<16;Rh++)mg(cg[Rh+1]);for(var zh=0;zh<=11;zh++)mg(lg[zh]);mg(17);for(var Bh=0;Bh<16;Bh++)mg(ug[Bh+1]);for(var Vh=0;Vh<=161;Vh++)mg(dg[Vh])}(),hg(65498),hg(12),mg(3),mg(1),mg(0),mg(2),mg(17),mg(3),mg(17),mg(0),mg(63),mg(0);var Bh=0,Gh=0,Kh=0;Xh=0,Zh=7,this.encode.displayName=`_encode_`;for(var qh,Jh,tg,rg,fg,vg,yg,bg,xg,Sg=Ph.data,Cg=Ph.width,wg=Ph.height,Tg=4*Cg,Eg=0;Eg<wg;){for(qh=0;qh<Tg;){for(fg=Tg*Eg+qh,yg=-1,bg=0,xg=0;xg<64;xg++)vg=fg+(bg=xg>>3)*Tg+(yg=4*(7&xg)),Eg+bg>=wg&&(vg-=Tg*(Eg+1+bg-wg)),qh+yg>=Tg&&(vg-=qh+yg-Tg+4),Jh=Sg[vg++],tg=Sg[vg++],rg=Sg[vg++],Qh[xg]=(ng[Jh]+ng[tg+256|0]+ng[rg+512|0]>>16)-128,$h[xg]=(ng[Jh+768|0]+ng[tg+1024|0]+ng[rg+1280|0]>>16)-128,eg[xg]=(ng[Jh+1280|0]+ng[tg+1536|0]+ng[rg+1792|0]>>16)-128;Bh=gg(Qh,Uh,Bh,Fh,Lh),Gh=gg($h,Wh,Gh,Ih,Rh),Kh=gg(eg,Wh,Kh,Ih,Rh),qh+=32}Eg+=8}if(Zh>=0){var Dg=[];Dg[1]=Zh+1,Dg[0]=(1<<Zh+1)-1,pg(Dg)}return hg(65497),new Uint8Array(Yh)},Ph||=50,function(){for(var Ph=String.fromCharCode,Fh=0;Fh<256;Fh++)tg[Fh]=Ph(Fh)}(),Fh=fg(ig,ag),Ih=fg(cg,lg),Lh=fg(og,sg),Rh=fg(ug,dg),function(){for(var Ph=1,Fh=2,Ih=1;Ih<=15;Ih++){for(var Lh=Ph;Lh<Fh;Lh++)Kh[32767+Lh]=Ih,Gh[32767+Lh]=[],Gh[32767+Lh][1]=Ih,Gh[32767+Lh][0]=Lh;for(var Rh=-(Fh-1);Rh<=-Ph;Rh++)Kh[32767+Rh]=Ih,Gh[32767+Rh]=[],Gh[32767+Rh][1]=Ih,Gh[32767+Rh][0]=Fh-1+Rh;Ph<<=1,Fh<<=1}}(),function(){for(var Ph=0;Ph<256;Ph++)ng[Ph]=19595*Ph,ng[Ph+256|0]=38470*Ph,ng[Ph+512|0]=7471*Ph+32768,ng[Ph+768|0]=-11059*Ph,ng[Ph+1024|0]=-21709*Ph,ng[Ph+1280|0]=32768*Ph+8421375,ng[Ph+1536|0]=-27439*Ph,ng[Ph+1792|0]=-5329*Ph}(),_g(Ph)}function pc$1(Ph,Fh){if(this.pos=0,this.buffer=Ph,this.datav=new DataView(Ph.buffer),this.is_with_alpha=!!Fh,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,[`BM`,`BA`,`CI`,`CP`,`IC`,`PT`].indexOf(this.flag)===-1)throw Error(`Invalid BMP File`);this.parseHeader(),this.parseBGR()}function mc$1(Ph){function Fh(Ph){if(!Ph)throw Error(`assert :P`)}function Ih(Ph,Fh,Ih){for(var Lh=0;4>Lh;Lh++)if(Ph[Fh+Lh]!=Ih.charCodeAt(Lh))return!0;return!1}function Lh(Ph,Fh,Ih,Lh,Rh){for(var zh=0;zh<Rh;zh++)Ph[Fh+zh]=Ih[Lh+zh]}function Rh(Ph,Fh,Ih,Lh){for(var Rh=0;Rh<Lh;Rh++)Ph[Fh+Rh]=Ih}function zh(Ph){return new Int32Array(Ph)}function Bh(Ph,Fh){for(var Ih=[],Lh=0;Lh<Ph;Lh++)Ih.push(new Fh);return Ih}function Vh(Ph,Fh){var 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++Ph.bb,Ph.u-=8;rg(Ph)&&(Ph.h=1,Ph.u=0)}function $h(Ph,Ih){if(Fh(0<=Ih),!Ph.h&&Ih<=yy){var Lh=ng(Ph)&vy[Ih];return Ph.u+=Ih,Qh(Ph),Lh}return Ph.h=1,Ph.u=0}function eg(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function tg(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function ng(Ph){return Ph.Ra>>>(Ph.u&by-1)>>>0}function rg(Ph){return Fh(Ph.bb<=Ph.Sb),Ph.h||Ph.bb==Ph.Sb&&Ph.u>by}function ig(Ph,Fh){Ph.u=Fh,Ph.h=rg(Ph)}function ag(Ph){Ph.u>=xy&&(Fh(Ph.u>=xy),Qh(Ph))}function og(Ph){Fh(Ph!=null&&Ph.oa!=null),Ph.pa<Ph.Zc?(Ph.I=(Ph.oa[Ph.pa++]|Ph.I<<8)>>>0,Ph.b+=8):(Fh(Ph!=null&&Ph.oa!=null),Ph.pa<Ph.Yc?(Ph.b+=8,Ph.I=Ph.oa[Ph.pa++]|Ph.I<<8):Ph.Ka?Ph.b=0:(Ph.I<<=8,Ph.b+=8,Ph.Ka=1))}function sg(Ph){return Yh(Ph,1)}function cg(Ph,Fh){var Ih=Ph.Ca;0>Ph.b&&og(Ph);var Lh=Ph.b,Rh=Ih*Fh>>>8,zh=(Ph.I>>>Lh>Rh)+0;for(zh?(Ih-=Rh,Ph.I-=Rh+1<<Lh>>>0):Ih=Rh+1,Lh=Ih,Rh=0;256<=Lh;)Rh+=8,Lh>>=8;return Lh=7^Rh+Sy[Lh],Ph.b-=Lh,Ph.Ca=(Ih<<Lh)-1,zh}function lg(Ph,Fh,Ih){Ph[Fh+0]=Ih>>24&255,Ph[Fh+1]=Ih>>16&255,Ph[Fh+2]=Ih>>8&255,Ph[Fh+3]=255&Ih}function ug(Ph,Fh){return Ph[Fh+0]|Ph[Fh+1]<<8}function dg(Ph,Fh){return ug(Ph,Fh)|Ph[Fh+2]<<16}function fg(Ph,Fh){return ug(Ph,Fh)|ug(Ph,Fh+2)<<16}function pg(Ph,Ih){var Lh=1<<Ih;return Fh(Ph!=null),Fh(0<Ih),Ph.X=zh(Lh),Ph.X==null?0:(Ph.Mb=32-Ih,Ph.Xa=Ih,1)}function mg(Ph,Ih){Fh(Ph!=null),Fh(Ih!=null),Fh(Ph.Xa==Ih.Xa),Lh(Ih.X,0,Ph.X,0,1<<Ih.Xa)}function hg(){this.X=[],this.Xa=this.Mb=0}function gg(Ph,Ih,Lh,Rh){Fh(Lh!=null),Fh(Rh!=null);var zh=Lh[0],Bh=Rh[0];return zh==0&&(zh=(Ph*Bh+Ih/2)/Ih),Bh==0&&(Bh=(Ih*zh+Ph/2)/Ph),0>=zh||0>=Bh?0:(Lh[0]=zh,Rh[0]=Bh,1)}function _g(Ph,Fh){return Ph+(1<<Fh)-1>>>Fh}function vg(Ph,Fh){return((4278255360&Ph)+(4278255360&Fh)>>>0&4278255360)+((16711935&Ph)+(16711935&Fh)>>>0&16711935)>>>0}function yg(Fh,Ih){Ph[Ih]=function(Ih,Lh,Rh,zh,Bh,Vh,Hh){var Uh;for(Uh=0;Uh<Bh;++Uh){var Wh=Ph[Fh](Vh[Hh+Uh-1],Rh,zh+Uh);Vh[Hh+Uh]=vg(Ih[Lh+Uh],Wh)}}}function bg(){this.ud=this.hd=this.jd=0}function xg(Ph,Fh){return((4278124286&(Ph^Fh))>>>1)+(Ph&Fh)>>>0}function Sg(Ph){return 0<=Ph&&256>Ph?Ph:0>Ph?0:255<Ph?255:void 0}function Cg(Ph,Fh){return Sg(Ph+(Ph-Fh+.5>>1))}function wg(Ph,Fh,Ih){return Math.abs(Fh-Ih)-Math.abs(Ph-Ih)}function Tg(Ph,Fh,Ih,Lh,Rh,zh,Bh){for(Lh=zh[Bh-1],Ih=0;Ih<Rh;++Ih)zh[Bh+Ih]=Lh=vg(Ph[Fh+Ih],Lh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ih][15]=Ph[Fh+`0`]}function Lg(Ph){return Ph==wb||Ph==Tb||Ph==Eb||Ph==Db}function Rg(){this.eb=[],this.size=this.A=this.fb=0}function zg(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function Bg(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new Rg,this.f.kb=new zg,this.sd=null}function Vg(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function Hg(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function Ug(Ph){return alert(`todo:WebPSamplerProcessPlane`),Ph.T}function Wg(Ph,Fh){var Ih=Ph.T,Rh=Fh.ba.f.RGBA,zh=Rh.eb,Bh=Rh.fb+Ph.ka*Rh.A,Vh=Qb[Fh.ba.S],Hh=Ph.y,Uh=Ph.O,Wh=Ph.f,Gh=Ph.N,Kh=Ph.ea,qh=Ph.W,Jh=Fh.cc,Yh=Fh.dc,Xh=Fh.Mc,Zh=Fh.Nc,Qh=Ph.ka,$h=Ph.ka+Ph.T,eg=Ph.U,tg=eg+1>>1;for(Qh==0?Vh(Hh,Uh,null,null,Wh,Gh,Kh,qh,Wh,Gh,Kh,qh,zh,Bh,null,null,eg):(Vh(Fh.ec,Fh.fc,Hh,Uh,Jh,Yh,Xh,Zh,Wh,Gh,Kh,qh,zh,Bh-Rh.A,zh,Bh,eg),++Ih);Qh+2<$h;Qh+=2)Jh=Wh,Yh=Gh,Xh=Kh,Zh=qh,Gh+=Ph.Rc,qh+=Ph.Rc,Bh+=2*Rh.A,Vh(Hh,(Uh+=2*Ph.fa)-Ph.fa,Hh,Uh,Jh,Yh,Xh,Zh,Wh,Gh,Kh,qh,zh,Bh-Rh.A,zh,Bh,eg);return Uh+=Ph.fa,Ph.j+$h<Ph.o?(Lh(Fh.ec,Fh.fc,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kh+sg-og];for(Kh+=tg,Uh+=tg;Uh>=Rh;)Uh-=Rh,++Hh,Vh!=null&&Hh<=Bh&&!(Hh%16)&&Vh(Ph,Hh);if(Fh(Kh<=zh),Uh&Qh&&($h=e_(Gh,Uh,Hh)),Zh!=null)for(;qh<Kh;)tg=Ih[qh++],Zh.X[(506832829*tg&4294967295)>>>Zh.Mb]=tg}else{if(!(tg<Yh))break t;for(eg=tg-280,Fh(Zh!=null);qh<Kh;)tg=Ih[qh++],Zh.X[(506832829*tg&4294967295)>>>Zh.Mb]=tg;tg=Kh,Fh(!(eg>>>(og=Zh).Xa)),Ih[tg]=og.X[eg],eg=!0}eg||Fh(Wh.h==rg(Wh))}if(Ph.Pb&&Wh.h&&Kh<zh)Fh(Ph.m.h),Ph.a=5,Ph.m=Ph.wd,Ph.$=Ph.xd,0<Ph.s.ua&&mg(Ph.s.vb,Ph.s.Wa);else{if(Wh.h)break t;Vh?.(Ph,Hh>Bh?Bh:Hh),Ph.a=0,Ph.$=Kh-Lh}return 1}return Ph.a=3,0}function s_(Ph){Fh(Ph!=null),Ph.vc=null,Ph.yc=null,Ph.Ya=null;var Ih=Ph.Wa;Ih!=null&&(Ih.X=null),Ph.vb=null,Fh(Ph!=null)}function c_(){var Fh=new zv;return Fh==null?null:(Fh.a=0,Fh.xb=Xb,Ig(`Predictor`,`VP8LPredictors`),Ig(`Predictor`,`VP8LPredictors_C`),Ig(`PredictorAdd`,`VP8LPredictorsAdd`),Ig(`PredictorAdd`,`VP8LPredictorsAdd_C`),Ty=Eg,jy=Og,My=Ag,Ny=jg,Py=Mg,Fy=Ng,Iy=Pg,Ph.VP8LMapColor32b=Dy,Ph.VP8LMapColor8b=ky,Fh)}function l_(Ph,Ih,Lh,Vh,Hh){var Uh=1,Kh=[Ph],Jh=[Ih],Yh=Vh.m,Xh=Vh.s,Zh=null,Qh=0;t:for(;;){if(Lh)for(;Uh&&$h(Yh,1);){var eg=Kh,tg=Jh,rg=Vh,og=1,sg=rg.m,c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g*Lg,Gh),Gg=Fg,Kg=Bh(Gg,qh);if(Kg==null)var qg=null;else Fh(65536>=Gg),qg=Kg;var Jg=zh(Ig);if(qg==null||Jg==null||Wg==null){Dg.a=1;break r}var Yg=Wg;for(wg=Eg=0;wg<Fg;++wg){var Xg=qg[wg],Zg=Xg.G,Qg=Xg.H,e_=0,t_=1,n_=0;for(Tg=0;5>Tg;++Tg){Ug=Ab[Tg],Zg[Tg]=Yg,Qg[Tg]=Eg,!Tg&&0<Ag&&(Ug+=1<<Ag);n:{var r_,i_=Ug,a_=Dg,c_=Jg,u_=Yg,d_=Eg,f_=0,p_=a_.m,m_=$h(p_,1);if(Rh(c_,0,0,i_),m_){var h_=$h(p_,1)+1,g_=$h(p_,$h(p_,1)==0?1:8);c_[g_]=1,h_==2&&(c_[g_=$h(p_,8)]=1);var __=1}else{var v_=zh(19),y_=$h(p_,4)+4;if(19<y_){a_.a=3;var b_=0;break n}for(r_=0;r_<y_;++r_)v_[Mb[r_]]=$h(p_,3);var x_=void 0,S_=void 0,C_=a_,w_=v_,T_=i_,E_=c_,D_=0,O_=C_.m,k_=8,A_=Bh(128,Gh);i:for(;Wh(A_,0,7,w_,19);){if($h(O_,1)){if((x_=2+$h(O_,2+2*$h(O_,3)))>T_)break i}else x_=T_;for(S_=0;S_<T_&&x_--;){ag(O_);var j_=A_[0+(127&ng(O_))];ig(O_,O_.u+j_.g);var M_=j_.value;if(16>M_)E_[S_++]=M_,M_!=0&&(k_=M_);else{var N_=M_==16,P_=M_-16,F_=kb[P_],I_=$h(O_,Ob[P_])+F_;if(S_+I_>T_)break i;for(var L_=N_?k_:0;0<I_--;)E_[S_++]=L_}}D_=1;break i}D_||(C_.a=3),__=D_}(__&&=!p_.h)&&(f_=Wh(u_,d_,8,c_,i_)),__&&f_!=0?b_=f_:(a_.a=3,b_=0)}if(b_==0)break r;if(t_&&jb[Tg]==1&&(t_=Yg[Eg].g==0),e_+=Yg[Eg].g,Eg+=b_,3>=Tg){var R_,z_=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.V,Ph.Ua=Ph.Ba+Lh+Ih,1)}function d_(Ph,Ih){var Lh=Ph.C,Rh=Ih-Lh,zh=Ph.V,Bh=Ph.Ba+Ph.c*Lh;for(Fh(Ih<=Ph.l.o);0<Rh;){var Vh=16<Rh?16:Rh,Hh=Ph.l.ma,Uh=Ph.l.width,Wh=Uh*Vh,Gh=Hh.ca,Kh=Hh.tb+Uh*Lh,qh=Ph.Ta,Jh=Ph.Ua;t_(Ph,Vh,zh,Bh),ab(qh,Jh,Gh,Kh,Wh),i_(Hh,Lh,Lh+Vh,Gh,Kh,Uh),Rh-=Vh,zh+=Vh*Ph.c,Lh+=Vh}Fh(Lh==Ih),Ph.C=Ph.Ma=Ih}function f_(){this.ub=this.yd=this.td=this.Rb=0}function p_(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function m_(){this.Fb=this.Bb=this.Cb=0,this.Zb=zh(4),this.Lb=zh(4)}function h_(){this.Yb=function(){var Ph=[];return function Ph(Fh,Ih,Lh){for(var Rh=Lh[Ih],zh=0;zh<Rh&&(Fh.push(Lh.length>Ih+1?[]:0),!(Lh.length<Ih+1));zh++)Ph(Fh[zh],Ih+1,Lh)}(Ph,0,[3,11]),Ph}()}function g_(){this.jb=zh(3),this.Wc=Vh([4,8],h_),this.Xc=Vh([4,17],h_)}function __(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new zh(4),this.od=new zh(4)}function v_(){this.ld=this.La=this.dd=this.tc=0}function y_(){this.Na=this.la=0}function b_(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function x_(){this.ad=zh(384),this.Za=0,this.Ob=zh(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function S_(){this.uc=this.M=this.Nb=0,this.wa=Array(new v_),this.Y=0,this.ya=Array(new x_),this.aa=0,this.l=new E_}function C_(){this.y=zh(16),this.f=zh(8),this.ea=zh(8)}function w_(){this.cb=this.a=0,this.sc=``,this.m=new eg,this.Od=new f_,this.Kc=new p_,this.ed=new __,this.Qa=new m_,this.Ic=this.$c=this.Aa=0,this.D=new S_,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=Bh(8,eg),this.ia=0,this.pb=Bh(4,b_),this.Pa=new g_,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new C_),this.Hd=0,this.rb=Array(new y_),this.sb=0,this.wa=Array(new v_),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new x_),this.L=this.aa=0,this.gd=Vh([4,2],v_),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function T_(Ph,Fh){return 0>Ph?0:Ph>Fh?Fh:Ph}function E_(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma=`void`,this.put=`VP8IoPutHook`,this.ac=`VP8IoSetupHook`,this.bc=`VP8IoTeardownHook`,this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function D_(){var Ph=new w_;return Ph!=null&&(Ph.a=0,Ph.sc=`OK`,Ph.cb=0,Ph.Xb=0,Rb||=j_),Ph}function O_(Ph,Fh,Ih){return Ph.a==0&&(Ph.a=Fh,Ph.sc=Ih,Ph.cb=0),0}function k_(Ph,Fh,Ih){return 3<=Ih&&Ph[Fh+0]==157&&Ph[Fh+1]==1&&Ph[Fh+2]==42}function A_(Ph,Ih){if(Ph==null)return 0;if(Ph.a=0,Ph.sc=`OK`,Ih==null)return O_(Ph,2,`null VP8Io passed to VP8GetHeaders()`);var Lh=Ih.data,zh=Ih.w,Bh=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Rh,1,8,zh,Bh,Vh)}function Pv(Ph,Fh,Ih,Lh,Rh,zh,Bh,Vh){Ev(Ph,Fh+4,1,Rh,8,zh,Bh,Vh),Ev(Ih,Lh+4,1,Rh,8,zh,Bh,Vh)}function Fv(){this.ba=new Bg,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new Hg,this.memory=0,this.Ib=`OutputFunc`,this.Jb=`OutputAlphaFunc`,this.Nd=`OutputRowFunc`}function Iv(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function Lv(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function Rv(){this.ua=0,this.Wa=new hg,this.vb=new hg,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new qh,this.yc=new Gh}function zv(){this.xb=this.a=0,this.l=new E_,this.ca=new Bg,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new tg,this.Pb=0,this.wd=new tg,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new Rv,this.ab=0,this.gc=Bh(4,Lv),this.Oc=0}function Bv(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new E_,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function Vv(Ph,Fh,Ih,Lh,Rh,zh,Bh){for(Ph=Ph==null?0:Ph[Fh+0],Fh=0;Fh<Bh;++Fh)Rh[zh+Fh]=Ph+Ih[Lh+Fh]&255,Ph=Rh[zh+Fh]}function Hv(Ph,Fh,Ih,Lh,Rh,zh,Bh){var Vh;if(Ph==null)Vv(null,null,Ih,Lh,Rh,zh,Bh);else for(Vh=0;Vh<Bh;++Vh)Rh[zh+Vh]=Ph[Fh+Vh]+Ih[Lh+Vh]&255}function Uv(Ph,Fh,Ih,Lh,Rh,zh,Bh){if(Ph==null)Vv(null,null,Ih,Lh,Rh,zh,Bh);else{var Vh,Hh=Ph[Fh+0],Uh=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)return $h;if(Qh=!!(2&Xh),!eg&&qh)return 3;if(Vh!=null&&(Vh[0]=!!(16&Xh)),Hh!=null&&(Hh[0]=Qh),Uh!=null&&(Uh[0]=0),Hh=Gh[0],Xh=Kh[0],qh&&Qh&&Wh==null){$h=0;break}if(4>Rh){$h=7;break}if(eg&&qh||!eg&&!qh&&!Ih(Ph,Lh[0],`ALPH`)){Rh=[Rh],Yh.na=[Yh.na],Yh.P=[Yh.P],Yh.Sa=[Yh.Sa];t:{og=Ph,$h=Lh,eg=Rh;var cg=Yh.gb;rg=Yh.na,ig=Yh.P,ag=Yh.Sa,sg=22,Fh(og!=null),Fh(eg!=null),ng=$h[0];var lg=eg[0];for(Fh(rg!=null),Fh(ag!=null),rg[0]=null,ig[0]=null,ag[0]=0;;){if($h[0]=ng,eg[0]=lg,8>lg){$h=7;break t}var ug=fg(og,ng+4);if(4294967286<ug){$h=3;break t}var pg=8+ug+1&-2;if(sg+=pg,0<cg&&sg>cg){$h=3;break t}if(!Ih(og,ng,`VP8 `)||!Ih(og,ng,`VP8L`)){$h=0;break t}if(lg[0]<pg){$h=7;break t}Ih(og,ng,`ALPH`)||(rg[0]=og,ig[0]=ng+8,ag[0]=ug),ng+=pg,lg-=pg}}if(Rh=Rh[0],Yh.na=Yh.na[0],Yh.P=Yh.P[0],Yh.Sa=Yh.Sa[0],$h!=0)break}Rh=[Rh],Yh.Ja=[Yh.Ja],Yh.xa=[Yh.xa];t:if(cg=Ph,$h=Lh,eg=Rh,rg=Yh.gb[0],ig=Yh.Ja,ag=Yh.xa,og=$h[0],ng=!Ih(cg,og,`VP8 `),sg=!Ih(cg,og,`VP8L`),Fh(cg!=null),Fh(eg!=null),Fh(ig!=null),Fh(ag!=null),8>eg[0])$h=7;else{if(ng||sg){if(cg=fg(cg,og+4),12<=rg&&cg>rg-12){$h=3;break t}if(Jh&&cg>eg[0]-8){$h=7;break t}ig[0]=cg,$h[0]+=8,eg[0]-=8,ag[0]=sg}else ag[0]=5<=eg[0]&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,vy=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],yy=24,by=32,xy=8,Sy=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];yg(`Predictor0`,`PredictorAdd0`),Ph.Predictor0=function(){return 4278190080},Ph.Predictor1=function(Ph){return Ph},Ph.Predictor2=function(Ph,Fh,Ih){return Fh[Ih+0]},Ph.Predictor3=function(Ph,Fh,Ih){return Fh[Ih+1]},Ph.Predictor4=function(Ph,Fh,Ih){return Fh[Ih-1]},Ph.Predictor5=function(Ph,Fh,Ih){return xg(xg(Ph,Fh[Ih+1]),Fh[Ih+0])},Ph.Predictor6=function(Ph,Fh,Ih){return xg(Ph,Fh[Ih-1])},Ph.Predictor7=function(Ph,Fh,Ih){return xg(Ph,Fh[Ih+0])},Ph.Predictor8=function(Ph,Fh,Ih){return xg(Fh[Ih-1],Fh[Ih+0])},Ph.Predictor9=function(Ph,Fh,Ih){return xg(Fh[Ih+0],Fh[Ih+1])},Ph.Predictor10=function(Ph,Fh,Ih){return xg(xg(Ph,Fh[Ih-1]),xg(Fh[Ih+0],Fh[Ih+1]))},Ph.Predictor11=function(Ph,Fh,Ih){var Lh=Fh[Ih+0];return 0>=wg(Lh>>24&255,Ph>>24&255,(Fh=Fh[Ih-1])>>24&255)+wg(Lh>>16&255,Ph>>16&255,Fh>>16&255)+wg(Lh>>8&255,Ph>>8&255,Fh>>8&255)+wg(255&Lh,255&Ph,255&Fh)?Lh:Ph},Ph.Predictor12=function(Ph,Fh,Ih){var Lh=Fh[Ih+0];return(Sg((Ph>>24&255)+(Lh>>24&255)-((Fh=Fh[Ih-1])>>24&255))<<24|Sg((Ph>>16&255)+(Lh>>16&255)-(Fh>>16&255))<<16|Sg((Ph>>8&255)+(Lh>>8&255)-(Fh>>8&255))<<8|Sg((255&Ph)+(255&Lh)-(255&Fh)))>>>0},Ph.Predictor13=function(Ph,Fh,Ih){var Lh=Fh[Ih-1];return(Cg((Ph=xg(Ph,Fh[Ih+0]))>>24&255,Lh>>24&255)<<24|Cg(Ph>>16&255,Lh>>16&255)<<16|Cg(Ph>>8&255,Lh>>8&255)<<8|Cg(255&Ph,255&Lh))>>>0};var Cy=Ph.PredictorAdd0;Ph.PredictorAdd1=Tg,yg(`Predictor2`,`PredictorAdd2`),yg(`Predictor3`,`PredictorAdd3`),yg(`Predictor4`,`PredictorAdd4`),yg(`Predictor5`,`PredictorAdd5`),yg(`Predictor6`,`PredictorAdd6`),yg(`Predictor7`,`PredictorAdd7`),yg(`Predictor8`,`PredictorAdd8`),yg(`Predictor9`,`PredictorAdd9`),yg(`Predictor10`,`PredictorAdd10`),yg(`Predictor11`,`PredictorAdd11`),yg(`Predictor12`,`PredictorAdd12`),yg(`Predictor13`,`PredictorAdd13`);var wy=Ph.PredictorAdd2;kg(`ColorIndexInverseTransform`,`MapARGB`,`32b`,function(Ph){return Ph>>8&255},function(Ph){return Ph}),kg(`VP8LColorIndexInverseTransformAlpha`,`MapAlpha`,`8b`,function(Ph){return Ph},function(Ph){return Ph>>8&255});var Ty,Ey=Ph.ColorIndexInverseTransform,Dy=Ph.MapARGB,Oy=Ph.VP8LColorIndexInverseTransformAlpha,ky=Ph.MapAlpha,Ay=Ph.VP8LPredictorsAdd=[];Ay.length=16,(Ph.VP8LPredictors=[]).length=16,(Ph.VP8LPredictorsAdd_C=[]).length=16,(Ph.VP8LPredictors_C=[]).length=16;var jy,My,Ny,Py,Fy,Iy,Ly,Ry,zy,By,Vy,Hy,Uy,Wy,Gy,Ky,qy,Jy,Yy,Xy,Zy,Qy,$y,eb,tb,nb,ib,ab,ob=zh(511),sb=zh(2041),cb=zh(225),ub=zh(767),db=0,fb=sb,pb=cb,mb=ub,hb=ob,gb=0,vb=1,yb=2,bb=3,xb=4,Sb=5,Cb=6,wb=7,Tb=8,Eb=9,Db=10,Ob=[2,3,7],kb=[3,3,11],Ab=[280,256,256,256,40],jb=[0,1,1,1,0],Mb=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Nb=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Pb=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Fb=8,Ib=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],Lb=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],Rb=null,zb=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],Bb=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],Vb=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],Hb=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],Ub=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],Wb=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],Gb=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Kb=[],qb=[],Jb=[],Yb=1,Xb=2,Zb=[],Qb=[];Xv(`UpsampleRgbLinePair`,ny,3),Xv(`UpsampleBgrLinePair`,ry,3),Xv(`UpsampleRgbaLinePair`,cy,4),Xv(`UpsampleBgraLinePair`,sy,4),Xv(`UpsampleArgbLinePair`,oy,4),Xv(`UpsampleRgba4444LinePair`,ay,2),Xv(`UpsampleRgb565LinePair`,iy,2);var $b=Ph.UpsampleRgbLinePair,ex=Ph.UpsampleBgrLinePair,tx=Ph.UpsampleRgbaLinePair,nx=Ph.UpsampleBgraLinePair,rx=Ph.UpsampleArgbLinePair,ix=Ph.UpsampleRgba4444LinePair,ax=Ph.UpsampleRgb565LinePair,ox=16,sx=1<<ox-1,cx=-227,lx=482,ux=6,dx=(256<<ux)-1,fx=0,px=zh(256),mx=zh(256),hx=zh(256),gx=zh(256),_x=zh(lx-cx),vx=zh(lx-cx);ly(`YuvToRgbRow`,ny,3),ly(`YuvToBgrRow`,ry,3),ly(`YuvToRgbaRow`,cy,4),ly(`YuvToBgraRow`,sy,4),ly(`YuvToArgbRow`,oy,4),ly(`YuvToRgba4444Row`,ay,2),ly(`YuvToRgb565Row`,iy,2);var yx=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],bx=[0,2,8],xx=[8,7,6,4,4,2,2,2,1,1,1,1],Sx=1;this.WebPDecodeRGBA=function(Ph,Ih,Vh,Hh,Uh){var Wh=vb,Gh=new Fv,Kh=new Bg;Gh.ba=Kh,Kh.S=Wh,Kh.width=[Kh.width],Kh.height=[Kh.height];var qh=Kh.width,Jh=Kh.height,Yh=new Vg;if(Yh==null||Ph==null)var Xh=2;else Fh(Yh!=null),Xh=py(Ph,Ih,Vh,Yh.width,Yh.height,Yh.Pd,Yh.Qd,Yh.format,null);if(Xh==0?(qh!=null&&(qh[0]=Yh.width[0]),Jh!=null&&(Jh[0]=Yh.height[0]),qh=1):qh=0,qh){Kh.width=Kh.width[0],Kh.height=Kh.height[0],Hh!=null&&(Hh[0]=Kh.width),Uh!=null&&(Uh[0]=Kh.height);t:{if(Hh=new E_,(Uh=new Iv).data=Ph,Uh.w=Ih,Uh.ha=Vh,Uh.kd=1,Ih=[0],Fh(Uh!=null),((Ph=py(Uh.data,Uh.w,Uh.ha,null,null,null,Ih,null,Uh))==0||Ph==7)&&Ih[0]&&(Ph=4),(Ih=Ph)==0){if(Fh(Gh!=null),Hh.data=Uh.data,Hh.w=Uh.w+Uh.offset,Hh.ha=Uh.ha-Uh.offset,Hh.put=qg,Hh.ac=Kg,Hh.bc=Jg,Hh.ma=Gh,Uh.xa){if((Ph=c_())==null){Gh=1;break t}if(function(Ph,Ih){var Lh=[0],Rh=[0],zh=[0];e:for(;;){if(Ph==null)return 0;if(Ih==null)return Ph.a=2,0;if(Ph.l=Ih,Ph.a=0,Zh(Ph.m,Ih.data,Ih.w,Ih.ha),!Yg(Ph.m,Lh,Rh,zh)){Ph.a=3;break e}if(Ph.xb=Xb,Ih.width=Lh[0],Ih.height=Rh[0],!l_(Lh[0],Rh[0],1,Ph,null))break e;return 1}return Fh(Ph.a!=0),0}(Ph,Hh)){if(Hh=(Ih=gy(Hh.width,Hh.height,Gh.Oa,Gh.ba))==0){e:{Hh=Ph;r:for(;;){if(Hh==null){Hh=0;break e}if(Fh(Hh.s.yc!=null),Fh(Hh.s.Ya!=null),Fh(0<Hh.s.Wb),Fh((Vh=Hh.l)!=null),Fh((Uh=Vh.ma)!=null),Hh.xb!=0){if(Hh.ca=Uh.ba,Hh.tb=Uh.tb,Fh(Hh.ca!=null),!my(Uh.Oa,Vh,bb)){Hh.a=2;break r}if(!u_(Hh,Vh.width)||Vh.da)break r;if((Vh.da||Lg(Hh.ca.S))&&Yv(),11>Hh.ca.S||(alert(`todo:WebPInitConvertARGBToYUV`),Hh.ca.f.kb.F!=null&&Yv()),Hh.Pb&&0<Hh.s.ua&&Hh.s.vb.X==null&&!pg(Hh.s.vb,Hh.s.Wa.Xa)){Hh.a=1;break r}Hh.xb=0}if(!o_(Hh,Hh.V,Hh.Ba,Hh.c,Hh.i,Vh.o,n_))break r;Uh.Dc=Hh.Ma,Hh=1;break e}Fh(Hh.a!=0),Hh=0}Hh=!Hh}Hh&&(Ih=Ph.a)}else Ih=Ph.a}else{if((Ph=new D_)==null){Gh=1;break t}if(Ph.Fa=Uh.na,Ph.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){var Ih={},Lh=0,Rh=!1,zh=0,Bh=0;if(Ih.frames=[],!function(Ph,Fh){for(var Ih=0;Ih<4;Ih++)if(Ph[Fh+Ih]!=`RIFF`.charCodeAt(Ih))return!0;return!1}(Ph,Fh)){for(Kh(Ph,Fh+=4),Fh+=8;Fh<Ph.length;){var Vh=Uh(Ph,Fh),Hh=Kh(Ph,Fh+=4);Fh+=4;var qh=Hh+(1&Hh);switch(Vh){case`VP8 `:case`VP8L`:Ih.frames[Lh]===void 0&&(Ih.frames[Lh]={}),(Xh=Ih.frames[Lh]).src_off=Rh?Bh:Fh-8,Xh.src_size=zh+Hh+8,Lh++,Rh&&(Rh=!1,zh=0,Bh=0);break;case`VP8X`:(Xh=Ih.header={}).feature_flags=Ph[Fh];var Jh=Fh+4;Xh.canvas_width=1+Gh(Ph,Jh),Jh+=3,Xh.canvas_height=1+Gh(Ph,Jh),Jh+=3;break;case`ALPH`:Rh=!0,zh=qh+8,Bh=Fh-8;break;case`ANIM`:(Xh=Ih.header).bgcolor=Kh(Ph,Fh),Jh=Fh+4,Xh.loop_count=Wh(Ph,Jh),Jh+=2;break;case`ANMF`:var Yh,Xh;(Xh=Ih.frames[Lh]={}).offset_x=2*Gh(Ph,Fh),Fh+=3,Xh.offset_y=2*Gh(Ph,Fh),Fh+=3,Xh.width=1+Gh(Ph,Fh),Fh+=3,Xh.height=1+Gh(Ph,Fh),Fh+=3,Xh.duration=Gh(Ph,Fh),Fh+=3,Yh=Ph[Fh++],Xh.dispose=1&Yh,Xh.blend=Yh>>1&1}Vh!=`ANMF`&&(Fh+=qh)}return Ih}}(Zh,0);Qh.response=Zh,Qh.rgbaoutput=!0,Qh.dataurl=!1;var $h=Qh.header?Qh.header:null,eg=Qh.frames?Qh.frames:null;if($h){$h.loop_counter=$h.loop_count,qh=[$h.canvas_height],Jh=[$h.canvas_width];for(var tg=0;tg<eg.length&&eg[tg].blend!=0;tg++);}var ng=eg[0],rg=Xh.WebPDecodeRGBA(Zh,ng.src_off,ng.src_size,Jh,qh);ng.rgba=rg,ng.imgwidth=Jh[0],ng.imgheight=qh[0];for(var ig=0;ig<Jh[0]*qh[0]*4;ig++)Yh[ig]=rg[ig];return this.width=Jh,this.height=qh,this.data=Yh,this}function hc$1(){var Ph,Fh=this.internal.__metadata__.metadata,Ih=unescape(encodeURIComponent(Fh));Ph=this.internal.__metadata__.rawXml?Ih:`<x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="`+this.internal.__metadata__.namespaceUri+`"><jspdf:metadata>`+Ih.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)+`</jspdf:metadata></rdf:Description></rdf:RDF></x:xmpmeta>`,this.internal.__metadata__.metadataObjectNumber=this.internal.newObject(),this.internal.write(`<< /Type /Metadata /Subtype /XML /Length `+Ph.length+` >>`),this.internal.write(`stream`),this.internal.write(Ph),this.internal.write(`endstream`),this.internal.write(`endobj`)}function gc$1(){this.internal.__metadata__.metadataObjectNumber&&this.internal.write(`/Metadata `+this.internal.__metadata__.metadataObjectNumber+` 0 R`)}(function(Ph){var Fh,Ih,Lh,Rh,zh,Bh,Vh,Hh,Uh,Wh=function(Ph){return Ph||={},this.isStrokeTransparent=Ph.isStrokeTransparent||!1,this.strokeOpacity=Ph.strokeOpacity||1,this.strokeStyle=Ph.strokeStyle||`#000000`,this.fillStyle=Ph.fillStyle||`#000000`,this.isFillTransparent=Ph.isFillTransparent||!1,this.fillOpacity=Ph.fillOpacity||1,this.font=Ph.font||`10px sans-serif`,this.textBaseline=Ph.textBaseline||`alphabetic`,this.textAlign=Ph.textAlign||`left`,this.lineWidth=Ph.lineWidth||1,this.lineJoin=Ph.lineJoin||`miter`,this.lineCap=Ph.lineCap||`butt`,this.path=Ph.path||[],this.transform=Ph.transform===void 0?new Hh:Ph.transform.clone(),this.globalCompositeOperation=Ph.globalCompositeOperation||`normal`,this.globalAlpha=Ph.globalAlpha||1,this.clip_path=Ph.clip_path||[],this.currentPoint=Ph.currentPoint||new Bh,this.miterLimit=Ph.miterLimit||10,this.lastPoint=Ph.lastPoint||new Bh,this.lineDashOffset=Ph.lineDashOffset||0,this.lineDash=Ph.lineDash||[],this.margin=Ph.margin||[0,0,0,0],this.prevPageLastElemOffset=Ph.prevPageLastElemOffset||0,this.ignoreClearRect=typeof Ph.ignoreClearRect!=`boolean`||Ph.ignoreClearRect,this};Ph.events.push([`initialized`,function(){this.context2d=new Gh(this),Fh=this.internal.f2,Ih=this.internal.getCoordinateString,Lh=this.internal.getVerticalCoordinateString,Rh=this.internal.getHorizontalCoordinate,zh=this.internal.getVerticalCoordinate,Bh=this.internal.Point,Vh=this.internal.Rectangle,Hh=this.internal.Matrix,Uh=new Wh}]);var Gh=function(Ph){Object.defineProperty(this,`canvas`,{get:function(){return{parentNode:!1,style:!1}}});var Fh=Ph;Object.defineProperty(this,`pdf`,{get:function(){return Fh}});var Ih=!1;Object.defineProperty(this,`pageWrapXEnabled`,{get:function(){return Ih},set:function(Ph){Ih=!!Ph}});var Lh=!1;Object.defineProperty(this,`pageWrapYEnabled`,{get:function(){return Lh},set:function(Ph){Lh=!!Ph}});var Rh=0;Object.defineProperty(this,`posX`,{get:function(){return Rh},set:function(Ph){isNaN(Ph)||(Rh=Ph)}});var zh=0;Object.defineProperty(this,`posY`,{get:function(){return zh},set:function(Ph){isNaN(Ph)||(zh=Ph)}}),Object.defineProperty(this,`margin`,{get:function(){return Uh.margin},set:function(Ph){var Fh;typeof Ph==`number`?Fh=[Ph,Ph,Ph,Ph]:((Fh=[,,,,])[0]=Ph[0],Fh[1]=Ph.length>=2?Ph[1]:Fh[0],Fh[2]=Ph.length>=3?Ph[2]:Fh[0],Fh[3]=Ph.length>=4?Ph[3]:Fh[1]),Uh.margin=Fh}});var Bh=!1;Object.defineProperty(this,`autoPaging`,{get:function(){return Bh},set:function(Ph){Bh=Ph}});var Vh=0;Object.defineProperty(this,`lastBreak`,{get:function(){return Vh},set:function(Ph){Vh=Ph}});var Hh=[];Object.defineProperty(this,`pageBreaks`,{get:function(){return Hh},set:function(Ph){Hh=Ph}}),Object.defineProperty(this,`ctx`,{get:function(){return Uh},set:function(Ph){Ph instanceof Wh&&(Uh=Ph)}}),Object.defineProperty(this,`path`,{get:function(){return Uh.path},set:function(Ph){Uh.path=Ph}});var Gh=[];Object.defineProperty(this,`ctxStack`,{get:function(){return Gh},set:function(Ph){Gh=Ph}}),Object.defineProperty(this,`fillStyle`,{get:function(){return this.ctx.fillStyle},set:function(Ph){var Fh=Kh(Ph);this.ctx.fillStyle=Fh.style,this.ctx.isFillTransparent=Fh.a===0,this.ctx.fillOpacity=Fh.a,this.pdf.setFillColor(Fh.r,Fh.g,Fh.b,{a:Fh.a}),this.pdf.setTextColor(Fh.r,Fh.g,Fh.b,{a:Fh.a})}}),Object.defineProperty(this,`strokeStyle`,{get:function(){return this.ctx.strokeStyle},set:function(Ph){var Fh=Kh(Ph);this.ctx.strokeStyle=Fh.style,this.ctx.isStrokeTransparent=Fh.a===0,this.ctx.strokeOpacity=Fh.a,Fh.a===0?this.pdf.setDrawColor(255,255,255):(Fh.a,this.pdf.setDrawColor(Fh.r,Fh.g,Fh.b))}}),Object.defineProperty(this,`lineCap`,{get:function(){return this.ctx.lineCap},set:function(Ph){[`butt`,`round`,`square`].indexOf(Ph)!==-1&&(this.ctx.lineCap=Ph,this.pdf.setLineCap(Ph))}}),Object.defineProperty(this,`lineWidth`,{get:function(){return this.ctx.lineWidth},set:function(Ph){isNaN(Ph)||(this.ctx.lineWidth=Ph,this.pdf.setLineWidth(Ph))}}),Object.defineProperty(this,`lineJoin`,{get:function(){return this.ctx.lineJoin},set:function(Ph){[`bevel`,`round`,`miter`].indexOf(Ph)!==-1&&(this.ctx.lineJoin=Ph,this.pdf.setLineJoin(Ph))}}),Object.defineProperty(this,`miterLimit`,{get:function(){return this.ctx.miterLimit},set:function(Ph){isNaN(Ph)||(this.ctx.miterLimit=Ph,this.pdf.setMiterLimit(Ph))}}),Object.defineProperty(this,`textBaseline`,{get:function(){return this.ctx.textBaseline},set:function(Ph){this.ctx.textBaseline=Ph}}),Object.defineProperty(this,`textAlign`,{get:function(){return this.ctx.textAlign},set:function(Ph){[`right`,`end`,`center`,`left`,`start`].indexOf(Ph)!==-1&&(this.ctx.textAlign=Ph)}});var qh=null,Jh=null,Yh=null;Object.defineProperty(this,`fontFaces`,{get:function(){return Yh},set:function(Ph){qh=null,Jh=null,Yh=Ph}}),Object.defineProperty(this,`font`,{get:function(){return this.ctx.font},set:function(Ph){var Fh;if(this.ctx.font=Ph,(Fh=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(Ph))!==null){var Ih=Fh[1];Fh[2];var Lh=Fh[3],Rh=Fh[4];Fh[5];var zh=Fh[6],Bh=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Rh)[2];Rh=Math.floor(Bh===`px`?parseFloat(Rh)*this.pdf.internal.scaleFactor:Bh===`em`?parseFloat(Rh)*this.pdf.getFontSize():parseFloat(Rh)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Rh);var Vh=function(Ph){var Fh,Ih,Lh=[],Rh=Ph.trim();if(Rh===``)return Qs$1;if(Rh in Hs$1)return[Hs$1[Rh]];for(;Rh!==``;){switch(Ih=null,Fh=(Rh=Ws$1(Rh)).charAt(0)){case`"`:case`'`:Ih=Gs$1(Rh.substring(1),Fh);break;default:Ih=Ks$1(Rh)}if(Ih===null||(Lh.push(Ih[0]),(Rh=Ws$1(Ih[1]))!==``&&Rh.charAt(0)!==`,`))return Qs$1;Rh=Rh.replace(/^,/,``)}return Lh}(zh);if(this.fontFaces){var Hh=function(Ph,Fh,Ih){for(var Lh=(Ih||={}).defaultFontFamily||`times`,Rh=Object.assign({},Vs$1,Ih.genericFontFamilies||{}),zh=null,Bh=null,Vh=0;Vh<Fh.length;++Vh)if(Rh[(zh=zs$1(Fh[Vh])).family]&&(zh.family=Rh[zh.family]),Ph.hasOwnProperty(zh.family)){Bh=Ph[zh.family];break}if(!(Bh||=Ph[Lh]))throw Error(`Could not find a font-family for the rule '`+Us$1(zh)+`' and default family '`+Lh+`'.`);if(Bh=function(Ph,Fh){if(Fh[Ph])return Fh[Ph];var Ih=Is$1[Ph],Lh=Bs$1(Fh,Fs$1,Ih,Ih<=Is$1.normal?-1:1);if(!Lh)throw Error(`Could not find a matching font-stretch value for `+Ph);return Lh}(zh.stretch,Bh),Bh=function(Ph,Fh){if(Fh[Ph])return Fh[Ph];for(var Ih=Ps$1[Ph],Lh=0;Lh<Ih.length;++Lh)if(Fh[Ih[Lh]])return Fh[Ih[Lh]];throw Error(`Could not find a matching font-style for `+Ph)}(zh.style,Bh),!(Bh=function(Ph,Fh){if(Fh[Ph])return Fh[Ph];if(Ph===400&&Fh[500])return Fh[500];if(Ph===500&&Fh[400])return Fh[400];var Ih=Rs$1[Ph],Lh=Bs$1(Fh,Ls$1,Ih,Ph<400?-1:1);if(!Lh)throw Error(`Could not find a matching font-weight for value `+Ph);return Lh}(zh.weight,Bh)))throw Error(`Failed to resolve a font for the rule '`+Us$1(zh)+`'.`);return Bh}(function(Ph,Fh){var Ih=Ph.getFontList(),Lh=JSON.stringify(Ih);return(qh===null||Jh!==Lh)&&(qh=function(Ph){for(var Fh={},Ih=0;Ih<Ph.length;++Ih){var Lh=zs$1(Ph[Ih]),Rh=Lh.family,zh=Lh.stretch,Bh=Lh.style,Vh=Lh.weight;Fh[Rh]=Fh[Rh]||{},Fh[Rh][zh]=Fh[Rh][zh]||{},Fh[Rh][zh][Bh]=Fh[Rh][zh][Bh]||{},Fh[Rh][zh][Bh][Vh]=Lh}return Fh}(function(Ph){var Fh=[];return Object.keys(Ph).forEach(function(Ih){Ph[Ih].forEach(function(Ph){var Lh=null;switch(Ph){case`bold`:Lh={family:Ih,weight:`bold`};break;case`italic`:Lh={family:Ih,style:`italic`};break;case`bolditalic`:Lh={family:Ih,weight:`bold`,style:`italic`};break;case``:case`normal`:Lh={family:Ih}}Lh!==null&&(Lh.ref={name:Ih,style:Ph},Fh.push(Lh))})}),Fh}(Ih).concat(Fh)),Jh=Lh),qh}(this.pdf,this.fontFaces),Vh.map(function(Ph){return{family:Ph,stretch:`normal`,weight:Lh,style:Ih}}));this.pdf.setFont(Hh.ref.name,Hh.ref.style)}else{var Uh=``;(Lh===`bold`||parseInt(Lh,10)>=700||Ih===`bold`)&&(Uh=`bold`),Ih===`italic`&&(Uh+=`italic`),Uh.length===0&&(Uh=`normal`);for(var Wh=``,Gh={arial:`Helvetica`,Arial:`Helvetica`,verdana:`Helvetica`,Verdana:`Helvetica`,helvetica:`Helvetica`,Helvetica:`Helvetica`,"sans-serif":`Helvetica`,fixed:`Courier`,monospace:`Courier`,terminal:`Courier`,cursive:`Times`,fantasy:`Times`,serif:`Times`},Kh=0;Kh<Vh.length;Kh++){if(this.pdf.internal.getFont(Vh[Kh],Uh,{noFallback:!0,disableWarning:!0})!==void 0){Wh=Vh[Kh];break}if(Uh===`bolditalic`&&this.pdf.internal.getFont(Vh[Kh],`bold`,{noFallback:!0,disableWarning:!0})!==void 0)Wh=Vh[Kh],Uh=`bold`;else if(this.pdf.internal.getFont(Vh[Kh],`normal`,{noFallback:!0,disableWarning:!0})!==void 0){Wh=Vh[Kh],Uh=`normal`;break}}if(Wh===``){for(var Yh=0;Yh<Vh.length;Yh++)if(Gh[Vh[Yh]]){Wh=Gh[Vh[Yh]];break}}Wh=Wh===``?`Times`:Wh,this.pdf.setFont(Wh,Uh)}}}}),Object.defineProperty(this,`globalCompositeOperation`,{get:function(){return this.ctx.globalCompositeOperation},set:function(Ph){this.ctx.globalCompositeOperation=Ph}}),Object.defineProperty(this,`globalAlpha`,{get:function(){return this.ctx.globalAlpha},set:function(Ph){this.ctx.globalAlpha=Ph}}),Object.defineProperty(this,`lineDashOffset`,{get:function(){return this.ctx.lineDashOffset},set:function(Ph){this.ctx.lineDashOffset=Ph,_g.call(this)}}),Object.defineProperty(this,`lineDash`,{get:function(){return this.ctx.lineDash},set:function(Ph){this.ctx.lineDash=Ph,_g.call(this)}}),Object.defineProperty(this,`ignoreClearRect`,{get:function(){return this.ctx.ignoreClearRect},set:function(Ph){this.ctx.ignoreClearRect=!!Ph}})};Gh.prototype.setLineDash=function(Ph){this.lineDash=Ph},Gh.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},Gh.prototype.fill=function(){eg.call(this,`fill`,!1)},Gh.prototype.stroke=function(){eg.call(this,`stroke`,!1)},Gh.prototype.beginPath=function(){this.path=[{type:`begin`}]},Gh.prototype.moveTo=function(Ph,Fh){if(isNaN(Ph)||isNaN(Fh))throw go$1.error(`jsPDF.context2d.moveTo: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.moveTo`);var Ih=this.ctx.transform.applyToPoint(new Bh(Ph,Fh));this.path.push({type:`mt`,x:Ih.x,y:Ih.y}),this.ctx.lastPoint=new Bh(Ph,Fh)},Gh.prototype.closePath=function(){var Ph=new Bh(0,0),Fh=0;for(Fh=this.path.length-1;Fh!==-1;Fh--)if(this.path[Fh].type===`begin`&&e$4(this.path[Fh+1])===`object`&&typeof this.path[Fh+1].x==`number`){Ph=new Bh(this.path[Fh+1].x,this.path[Fh+1].y);break}this.path.push({type:`close`}),this.ctx.lastPoint=new Bh(Ph.x,Ph.y)},Gh.prototype.lineTo=function(Ph,Fh){if(isNaN(Ph)||isNaN(Fh))throw go$1.error(`jsPDF.context2d.lineTo: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.lineTo`);var Ih=this.ctx.transform.applyToPoint(new Bh(Ph,Fh));this.path.push({type:`lt`,x:Ih.x,y:Ih.y}),this.ctx.lastPoint=new Bh(Ih.x,Ih.y)},Gh.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),eg.call(this,null,!0)},Gh.prototype.quadraticCurveTo=function(Ph,Fh,Ih,Lh){if(isNaN(Ih)||isNaN(Lh)||isNaN(Ph)||isNaN(Fh))throw go$1.error(`jsPDF.context2d.quadraticCurveTo: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.quadraticCurveTo`);var Rh=this.ctx.transform.applyToPoint(new Bh(Ih,Lh)),zh=this.ctx.transform.applyToPoint(new Bh(Ph,Fh));this.path.push({type:`qct`,x1:zh.x,y1:zh.y,x:Rh.x,y:Rh.y}),this.ctx.lastPoint=new Bh(Rh.x,Rh.y)},Gh.prototype.bezierCurveTo=function(Ph,Fh,Ih,Lh,Rh,zh){if(isNaN(Rh)||isNaN(zh)||isNaN(Ph)||isNaN(Fh)||isNaN(Ih)||isNaN(Lh))throw go$1.error(`jsPDF.context2d.bezierCurveTo: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.bezierCurveTo`);var Vh=this.ctx.transform.applyToPoint(new Bh(Rh,zh)),Hh=this.ctx.transform.applyToPoint(new Bh(Ph,Fh)),Uh=this.ctx.transform.applyToPoint(new Bh(Ih,Lh));this.path.push({type:`bct`,x1:Hh.x,y1:Hh.y,x2:Uh.x,y2:Uh.y,x:Vh.x,y:Vh.y}),this.ctx.lastPoint=new Bh(Vh.x,Vh.y)},Gh.prototype.arc=function(Ph,Fh,Ih,Lh,Rh,zh){if(isNaN(Ph)||isNaN(Fh)||isNaN(Ih)||isNaN(Lh)||isNaN(Rh))throw go$1.error(`jsPDF.context2d.arc: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.arc`);if(zh=!!zh,!this.ctx.transform.isIdentity){var Vh=this.ctx.transform.applyToPoint(new Bh(Ph,Fh));Ph=Vh.x,Fh=Vh.y;var Hh=this.ctx.transform.applyToPoint(new Bh(0,Ih)),Uh=this.ctx.transform.applyToPoint(new Bh(0,0));Ih=Math.sqrt((Hh.x-Uh.x)**2+(Hh.y-Uh.y)**2)}Math.abs(Rh-Lh)>=2*Math.PI&&(Lh=0,Rh=2*Math.PI),this.path.push({type:`arc`,x:Ph,y:Fh,radius:Ih,startAngle:Lh,endAngle:Rh,counterclockwise:zh})},Gh.prototype.arcTo=function(Ph,Fh,Ih,Lh,Rh){throw Error(`arcTo not implemented.`)},Gh.prototype.rect=function(Ph,Fh,Ih,Lh){if(isNaN(Ph)||isNaN(Fh)||isNaN(Ih)||isNaN(Lh))throw go$1.error(`jsPDF.context2d.rect: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.rect`);this.moveTo(Ph,Fh),this.lineTo(Ph+Ih,Fh),this.lineTo(Ph+Ih,Fh+Lh),this.lineTo(Ph,Fh+Lh),this.lineTo(Ph,Fh),this.lineTo(Ph+Ih,Fh),this.lineTo(Ph,Fh)},Gh.prototype.fillRect=function(Ph,Fh,Ih,Lh){if(isNaN(Ph)||isNaN(Fh)||isNaN(Ih)||isNaN(Lh))throw go$1.error(`jsPDF.context2d.fillRect: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.fillRect`);if(!qh.call(this)){var Rh={};this.lineCap!==`butt`&&(Rh.lineCap=this.lineCap,this.lineCap=`butt`),this.lineJoin!==`miter`&&(Rh.lineJoin=this.lineJoin,this.lineJoin=`miter`),this.beginPath(),this.rect(Ph,Fh,Ih,Lh),this.fill(),Rh.hasOwnProperty(`lineCap`)&&(this.lineCap=Rh.lineCap),Rh.hasOwnProperty(`lineJoin`)&&(this.lineJoin=Rh.lineJoin)}},Gh.prototype.strokeRect=function(Ph,Fh,Ih,Lh){if(isNaN(Ph)||isNaN(Fh)||isNaN(Ih)||isNaN(Lh))throw go$1.error(`jsPDF.context2d.strokeRect: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.strokeRect`);Jh.call(this)||(this.beginPath(),this.rect(Ph,Fh,Ih,Lh),this.stroke())},Gh.prototype.clearRect=function(Ph,Fh,Ih,Lh){if(isNaN(Ph)||isNaN(Fh)||isNaN(Ih)||isNaN(Lh))throw go$1.error(`jsPDF.context2d.clearRect: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.clearRect`);this.ignoreClearRect||(this.fillStyle=`#ffffff`,this.fillRect(Ph,Fh,Ih,Lh))},Gh.prototype.save=function(Ph){Ph=typeof Ph!=`boolean`||Ph;for(var Fh=this.pdf.internal.getCurrentPageInfo().pageNumber,Ih=0;Ih<this.pdf.internal.getNumberOfPages();Ih++)this.pdf.setPage(Ih+1),this.pdf.internal.out(`q`);if(this.pdf.setPage(Fh),Ph){this.ctx.fontSize=this.pdf.internal.getFontSize();var Lh=new Wh(this.ctx);this.ctxStack.push(this.ctx),this.ctx=Lh}},Gh.prototype.restore=function(Ph){Ph=typeof Ph!=`boolean`||Ph;for(var Fh=this.pdf.internal.getCurrentPageInfo().pageNumber,Ih=0;Ih<this.pdf.internal.getNumberOfPages();Ih++)this.pdf.setPage(Ih+1),this.pdf.internal.out(`Q`);this.pdf.setPage(Fh),Ph&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},Gh.prototype.toDataURL=function(){throw Error(`toDataUrl not implemented.`)};var Kh=function(Ph){var Fh,Ih,Lh,Rh;if(!0===Ph.isCanvasGradient&&(Ph=Ph.getColor()),!Ph)return{r:0,g:0,b:0,a:0,style:Ph};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(Ph))Fh=0,Ih=0,Lh=0,Rh=0;else{var zh=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(Ph);if(zh!==null)Fh=parseInt(zh[1]),Ih=parseInt(zh[2]),Lh=parseInt(zh[3]),Rh=1;else if((zh=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(Ph))!==null)Fh=parseInt(zh[1]),Ih=parseInt(zh[2]),Lh=parseInt(zh[3]),Rh=parseFloat(zh[4]);else{if(Rh=1,typeof Ph==`string`&&Ph.charAt(0)!==`#`){var Bh=new xo$1(Ph);Ph=Bh.ok?Bh.toHex():`#000000`}Ph.length===4?(Fh=Ph.substring(1,2),Fh+=Fh,Ih=Ph.substring(2,3),Ih+=Ih,Lh=Ph.substring(3,4),Lh+=Lh):(Fh=Ph.substring(1,3),Ih=Ph.substring(3,5),Lh=Ph.substring(5,7)),Fh=parseInt(Fh,16),Ih=parseInt(Ih,16),Lh=parseInt(Lh,16)}}return{r:Fh,g:Ih,b:Lh,a:Rh,style:Ph}},qh=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},Jh=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};Gh.prototype.fillText=function(Ph,Fh,Ih,Lh){if(isNaN(Fh)||isNaN(Ih)||typeof Ph!=`string`)throw go$1.error(`jsPDF.context2d.fillText: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.fillText`);if(Lh=isNaN(Lh)?void 0:Lh,!qh.call(this)){var Rh=mg(this.ctx.transform.rotation),zh=this.ctx.transform.scaleX;cg.call(this,{text:Ph,x:Fh,y:Ih,scale:zh,angle:Rh,align:this.textAlign,maxWidth:Lh})}},Gh.prototype.strokeText=function(Ph,Fh,Ih,Lh){if(isNaN(Fh)||isNaN(Ih)||typeof Ph!=`string`)throw go$1.error(`jsPDF.context2d.strokeText: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.strokeText`);if(!Jh.call(this)){Lh=isNaN(Lh)?void 0:Lh;var Rh=mg(this.ctx.transform.rotation),zh=this.ctx.transform.scaleX;cg.call(this,{text:Ph,x:Fh,y:Ih,scale:zh,renderingMode:`stroke`,angle:Rh,align:this.textAlign,maxWidth:Lh})}},Gh.prototype.measureText=function(Ph){if(typeof Ph!=`string`)throw go$1.error(`jsPDF.context2d.measureText: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.measureText`);var Fh=this.pdf,Ih=this.pdf.internal.scaleFactor,Lh=Fh.internal.getFontSize(),Rh=Fh.getStringUnitWidth(Ph)*Lh/Fh.internal.scaleFactor;return new function(Ph){var Fh=(Ph||={}).width||0;return Object.defineProperty(this,`width`,{get:function(){return Fh}}),this}({width:Rh*=Math.round(96*Ih/72*1e4)/1e4})},Gh.prototype.scale=function(Ph,Fh){if(isNaN(Ph)||isNaN(Fh))throw go$1.error(`jsPDF.context2d.scale: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.scale`);var Ih=new Hh(Ph,0,0,Fh,0,0);this.ctx.transform=this.ctx.transform.multiply(Ih)},Gh.prototype.rotate=function(Ph){if(isNaN(Ph))throw go$1.error(`jsPDF.context2d.rotate: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.rotate`);var Fh=new Hh(Math.cos(Ph),Math.sin(Ph),-Math.sin(Ph),Math.cos(Ph),0,0);this.ctx.transform=this.ctx.transform.multiply(Fh)},Gh.prototype.translate=function(Ph,Fh){if(isNaN(Ph)||isNaN(Fh))throw go$1.error(`jsPDF.context2d.translate: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.translate`);var Ih=new Hh(1,0,0,1,Ph,Fh);this.ctx.transform=this.ctx.transform.multiply(Ih)},Gh.prototype.transform=function(Ph,Fh,Ih,Lh,Rh,zh){if(isNaN(Ph)||isNaN(Fh)||isNaN(Ih)||isNaN(Lh)||isNaN(Rh)||isNaN(zh))throw go$1.error(`jsPDF.context2d.transform: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.transform`);var Bh=new Hh(Ph,Fh,Ih,Lh,Rh,zh);this.ctx.transform=this.ctx.transform.multiply(Bh)},Gh.prototype.setTransform=function(Ph,Fh,Ih,Lh,Rh,zh){Ph=isNaN(Ph)?1:Ph,Fh=isNaN(Fh)?0:Fh,Ih=isNaN(Ih)?0:Ih,Lh=isNaN(Lh)?1:Lh,Rh=isNaN(Rh)?0:Rh,zh=isNaN(zh)?0:zh,this.ctx.transform=new Hh(Ph,Fh,Ih,Lh,Rh,zh)};var Yh=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};Gh.prototype.drawImage=function(Ph,Fh,Ih,Lh,Rh,zh,Bh,Uh,Wh){var Gh=this.pdf.getImageProperties(Ph),Kh=1,qh=1,Jh=1,Zh=1;Lh!==void 0&&Uh!==void 0&&(Jh=Uh/Lh,Zh=Wh/Rh,Kh=Gh.width/Lh*Uh/Lh,qh=Gh.height/Rh*Wh/Rh),zh===void 0&&(zh=Fh,Bh=Ih,Fh=0,Ih=0),Lh!==void 0&&Uh===void 0&&(Uh=Lh,Wh=Rh),Lh===void 0&&Uh===void 0&&(Uh=Gh.width,Wh=Gh.height);var eg=this.ctx.transform.decompose(),ng=mg(eg.rotate.shx),rg=new Hh,ig=(rg=(rg=(rg=rg.multiply(eg.translate)).multiply(eg.skew)).multiply(eg.scale)).applyToRectangle(new Vh(zh-Fh*Jh,Bh-Ih*Zh,Lh*Kh,Rh*qh));if(this.autoPaging){for(var ag,og=Xh.call(this,ig),sg=[],cg=0;cg<og.length;cg+=1)sg.indexOf(og[cg])===-1&&sg.push(og[cg]);$h(sg);for(var lg=sg[0],ug=sg[sg.length-1],dg=lg;dg<ug+1;dg++){this.pdf.setPage(dg);var fg=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],pg=dg===1?this.posY+this.margin[0]:this.margin[0],hg=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],gg=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],_g=dg===1?0:hg+(dg-2)*gg;if(this.ctx.clip_path.length!==0){var vg=this.path;ag=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=Qh(ag,this.posX+this.margin[3],-_g+pg+this.ctx.prevPageLastElemOffset),tg.call(this,`fill`,!0),this.path=vg}var yg=JSON.parse(JSON.stringify(ig));yg=Qh([yg],this.posX+this.margin[3],-_g+pg+this.ctx.prevPageLastElemOffset)[0];var bg=(dg>lg||dg<ug)&&Yh.call(this);bg&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],fg,gg,null).clip().discardPath()),this.pdf.addImage(Ph,`JPEG`,yg.x,yg.y,yg.w,yg.h,null,null,ng),bg&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(Ph,`JPEG`,ig.x,ig.y,ig.w,ig.h,null,null,ng)};var Xh=function(Ph,Fh,Ih){var Lh=[];Fh||=this.pdf.internal.pageSize.width,Ih||=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var Rh=this.posY+this.ctx.prevPageLastElemOffset;switch(Ph.type){default:case`mt`:case`lt`:Lh.push(Math.floor((Ph.y+Rh)/Ih)+1);break;case`arc`:Lh.push(Math.floor((Ph.y+Rh-Ph.radius)/Ih)+1),Lh.push(Math.floor((Ph.y+Rh+Ph.radius)/Ih)+1);break;case`qct`:var zh=hg(this.ctx.lastPoint.x,this.ctx.lastPoint.y,Ph.x1,Ph.y1,Ph.x,Ph.y);Lh.push(Math.floor((zh.y+Rh)/Ih)+1),Lh.push(Math.floor((zh.y+zh.h+Rh)/Ih)+1);break;case`bct`:var Bh=gg(this.ctx.lastPoint.x,this.ctx.lastPoint.y,Ph.x1,Ph.y1,Ph.x2,Ph.y2,Ph.x,Ph.y);Lh.push(Math.floor((Bh.y+Rh)/Ih)+1),Lh.push(Math.floor((Bh.y+Bh.h+Rh)/Ih)+1);break;case`rect`:Lh.push(Math.floor((Ph.y+Rh)/Ih)+1),Lh.push(Math.floor((Ph.y+Ph.h+Rh)/Ih)+1)}for(var Vh=0;Vh<Lh.length;Vh+=1)for(;this.pdf.internal.getNumberOfPages()<Lh[Vh];)Zh.call(this);return Lh},Zh=function(){var Ph=this.fillStyle,Fh=this.strokeStyle,Ih=this.font,Lh=this.lineCap,Rh=this.lineWidth,zh=this.lineJoin;this.pdf.addPage(),this.fillStyle=Ph,this.strokeStyle=Fh,this.font=Ih,this.lineCap=Lh,this.lineWidth=Rh,this.lineJoin=zh},Qh=function(Ph,Fh,Ih){for(var Lh=0;Lh<Ph.length;Lh++)switch(Ph[Lh].type){case`bct`:Ph[Lh].x2+=Fh,Ph[Lh].y2+=Ih;case`qct`:Ph[Lh].x1+=Fh,Ph[Lh].y1+=Ih;default:Ph[Lh].x+=Fh,Ph[Lh].y+=Ih}return Ph},$h=function(Ph){return Ph.sort(function(Ph,Fh){return Ph-Fh})},eg=function(Ph,Fh){var Ih=this.fillStyle,Lh=this.strokeStyle,Rh=this.lineCap,zh=this.lineWidth,Bh=Math.abs(zh*this.ctx.transform.scaleX),Vh=this.lineJoin;if(this.autoPaging){for(var Hh,Uh,Wh=JSON.parse(JSON.stringify(this.path)),Gh=JSON.parse(JSON.stringify(this.path)),Kh=[],qh=0;qh<Gh.length;qh++)if(Gh[qh].x!==void 0)for(var Jh=Xh.call(this,Gh[qh]),eg=0;eg<Jh.length;eg+=1)Kh.indexOf(Jh[eg])===-1&&Kh.push(Jh[eg]);for(var ng=0;ng<Kh.length;ng++)for(;this.pdf.internal.getNumberOfPages()<Kh[ng];)Zh.call(this);$h(Kh);for(var rg=Kh[0],ig=Kh[Kh.length-1],ag=rg;ag<ig+1;ag++){this.pdf.setPage(ag),this.fillStyle=Ih,this.strokeStyle=Lh,this.lineCap=Rh,this.lineWidth=Bh,this.lineJoin=Vh;var og=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],sg=ag===1?this.posY+this.margin[0]:this.margin[0],cg=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],lg=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],ug=ag===1?0:cg+(ag-2)*lg;if(this.ctx.clip_path.length!==0){var dg=this.path;Hh=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=Qh(Hh,this.posX+this.margin[3],-ug+sg+this.ctx.prevPageLastElemOffset),tg.call(this,Ph,!0),this.path=dg}if(Uh=JSON.parse(JSON.stringify(Wh)),this.path=Qh(Uh,this.posX+this.margin[3],-ug+sg+this.ctx.prevPageLastElemOffset),!1===Fh||ag===0){var fg=(ag>rg||ag<ig)&&Yh.call(this);fg&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],og,lg,null).clip().discardPath()),tg.call(this,Ph,Fh),fg&&this.pdf.restoreGraphicsState()}this.lineWidth=zh}this.path=Wh}else this.lineWidth=Bh,tg.call(this,Ph,Fh),this.lineWidth=zh},tg=function(Ph,Fh){if((Ph!==`stroke`||Fh||!Jh.call(this))&&(Ph===`stroke`||Fh||!qh.call(this))){for(var Ih,Lh,Rh=[],zh=this.path,Bh=0;Bh<zh.length;Bh++){var Vh=zh[Bh];switch(Vh.type){case`begin`:Rh.push({begin:!0});break;case`close`:Rh.push({close:!0});break;case`mt`:Rh.push({start:Vh,deltas:[],abs:[]});break;case`lt`:var Hh=Rh.length;if(zh[Bh-1]&&!isNaN(zh[Bh-1].x)&&(Ih=[Vh.x-zh[Bh-1].x,Vh.y-zh[Bh-1].y],Hh>0)){for(;Hh>=0;Hh--)if(!0!==Rh[Hh-1].close&&!0!==Rh[Hh-1].begin){Rh[Hh-1].deltas.push(Ih),Rh[Hh-1].abs.push(Vh);break}}break;case`bct`:Ih=[Vh.x1-zh[Bh-1].x,Vh.y1-zh[Bh-1].y,Vh.x2-zh[Bh-1].x,Vh.y2-zh[Bh-1].y,Vh.x-zh[Bh-1].x,Vh.y-zh[Bh-1].y],Rh[Rh.length-1].deltas.push(Ih);break;case`qct`:var Uh=zh[Bh-1].x+2/3*(Vh.x1-zh[Bh-1].x),Wh=zh[Bh-1].y+2/3*(Vh.y1-zh[Bh-1].y),Gh=Vh.x+2/3*(Vh.x1-Vh.x),Kh=Vh.y+2/3*(Vh.y1-Vh.y),Yh=Vh.x,Xh=Vh.y;Ih=[Uh-zh[Bh-1].x,Wh-zh[Bh-1].y,Gh-zh[Bh-1].x,Kh-zh[Bh-1].y,Yh-zh[Bh-1].x,Xh-zh[Bh-1].y],Rh[Rh.length-1].deltas.push(Ih);break;case`arc`:Rh.push({deltas:[],abs:[],arc:!0}),Array.isArray(Rh[Rh.length-1].abs)&&Rh[Rh.length-1].abs.push(Vh)}}Lh=Fh?null:Ph===`stroke`?`stroke`:`fill`;for(var Zh=!1,Qh=0;Qh<Rh.length;Qh++)if(Rh[Qh].arc)for(var $h=Rh[Qh].abs,eg=0;eg<$h.length;eg++){var tg=$h[eg];tg.type===`arc`?ig.call(this,tg.x,tg.y,tg.radius,tg.startAngle,tg.endAngle,tg.counterclockwise,void 0,Fh,!Zh):lg.call(this,tg.x,tg.y),Zh=!0}else if(!0===Rh[Qh].close)this.pdf.internal.out(`h`),Zh=!1;else if(!0!==Rh[Qh].begin){var ng=Rh[Qh].start.x,rg=Rh[Qh].start.y;ug.call(this,Rh[Qh].deltas,ng,rg),Zh=!0}Lh&&ag.call(this,Lh),Fh&&og.call(this)}},ng=function(Ph){var Fh=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,Ih=Fh*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case`bottom`:return Ph-Ih;case`top`:return Ph+Fh-Ih;case`hanging`:return Ph+Fh-2*Ih;case`middle`:return Ph+Fh/2-Ih;default:return Ph}},rg=function(Ph){return Ph+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};Gh.prototype.createLinearGradient=function(){var Ph=function(){};return Ph.colorStops=[],Ph.addColorStop=function(Ph,Fh){this.colorStops.push([Ph,Fh])},Ph.getColor=function(){return this.colorStops.length===0?`#000000`:this.colorStops[0][1]},Ph.isCanvasGradient=!0,Ph},Gh.prototype.createPattern=function(){return this.createLinearGradient()},Gh.prototype.createRadialGradient=function(){return this.createLinearGradient()};var ig=function(Ph,Fh,Ih,Lh,Rh,zh,Bh,Vh,Hh){for(var Uh=fg.call(this,Ih,Lh,Rh,zh),Wh=0;Wh<Uh.length;Wh++){var Gh=Uh[Wh];Wh===0&&(Hh?sg.call(this,Gh.x1+Ph,Gh.y1+Fh):lg.call(this,Gh.x1+Ph,Gh.y1+Fh)),dg.call(this,Ph,Fh,Gh.x2,Gh.y2,Gh.x3,Gh.y3,Gh.x4,Gh.y4)}Vh?og.call(this):ag.call(this,Bh)},ag=function(Ph){switch(Ph){case`stroke`:this.pdf.internal.out(`S`);break;case`fill`:this.pdf.internal.out(`f`)}},og=function(){this.pdf.clip(),this.pdf.discardPath()},sg=function(Ph,Fh){this.pdf.internal.out(Ih(Ph)+` `+Lh(Fh)+` m`)},cg=function(Ph){var Fh;switch(Ph.align){case`right`:case`end`:Fh=`right`;break;case`center`:Fh=`center`;break;default:Fh=`left`}var Ih,Lh,Rh,zh=this.pdf.getTextDimensions(Ph.text),Uh=ng.call(this,Ph.y),Wh=rg.call(this,Uh)-zh.h,Gh=this.ctx.transform.applyToPoint(new Bh(Ph.x,Uh));if(this.autoPaging){var Kh=this.ctx.transform.decompose(),qh=new Hh;qh=(qh=(qh=qh.multiply(Kh.translate)).multiply(Kh.skew)).multiply(Kh.scale);for(var Jh=this.ctx.transform.applyToRectangle(new Vh(Ph.x,Uh,zh.w,zh.h)),Zh=qh.applyToRectangle(new Vh(Ph.x,Wh,zh.w,zh.h)),eg=Xh.call(this,Zh),ig=[],ag=0;ag<eg.length;ag+=1)ig.indexOf(eg[ag])===-1&&ig.push(eg[ag]);$h(ig);for(var og=ig[0],sg=ig[ig.length-1],cg=og;cg<sg+1;cg++){this.pdf.setPage(cg);var lg=cg===1?this.posY+this.margin[0]:this.margin[0],ug=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],dg=this.pdf.internal.pageSize.height-this.margin[2],fg=dg-this.margin[0],pg=this.pdf.internal.pageSize.width-this.margin[1],mg=pg-this.margin[3],hg=cg===1?0:ug+(cg-2)*fg;if(this.ctx.clip_path.length!==0){var gg=this.path;Ih=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=Qh(Ih,this.posX+this.margin[3],-1*hg+lg),tg.call(this,`fill`,!0),this.path=gg}var _g=Qh([JSON.parse(JSON.stringify(Zh))],this.posX+this.margin[3],-hg+lg+this.ctx.prevPageLastElemOffset)[0];Ph.scale>=.01&&(Lh=this.pdf.internal.getFontSize(),this.pdf.setFontSize(Lh*Ph.scale),Rh=this.lineWidth,this.lineWidth=Rh*Ph.scale);var vg=this.autoPaging!==`text`;if(vg||_g.y+_g.h<=dg){if(vg||_g.y>=lg&&_g.x<=pg){var yg=vg?Ph.text:this.pdf.splitTextToSize(Ph.text,Ph.maxWidth||pg-_g.x)[0],bg=Qh([JSON.parse(JSON.stringify(Jh))],this.posX+this.margin[3],-hg+lg+this.ctx.prevPageLastElemOffset)[0],xg=vg&&(cg>og||cg<sg)&&Yh.call(this);xg&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],mg,fg,null).clip().discardPath()),this.pdf.text(yg,bg.x,bg.y,{angle:Ph.angle,align:Fh,renderingMode:Ph.renderingMode}),xg&&this.pdf.restoreGraphicsState()}}else _g.y<dg&&(this.ctx.prevPageLastElemOffset+=dg-_g.y);Ph.scale>=.01&&(this.pdf.setFontSize(Lh),this.lineWidth=Rh)}}else Ph.scale>=.01&&(Lh=this.pdf.internal.getFontSize(),this.pdf.setFontSize(Lh*Ph.scale),Rh=this.lineWidth,this.lineWidth=Rh*Ph.scale),this.pdf.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ih),y4:Ph*Math.sin(Ih)}},mg=function(Ph){return 180*Ph/Math.PI},hg=function(Ph,Fh,Ih,Lh,Rh,zh){var Bh=Ph+.5*(Ih-Ph),Hh=Fh+.5*(Lh-Fh),Uh=Rh+.5*(Ih-Rh),Wh=zh+.5*(Lh-zh),Gh=Math.min(Ph,Rh,Bh,Uh),Kh=Math.max(Ph,Rh,Bh,Uh),qh=Math.min(Fh,zh,Hh,Wh),Jh=Math.max(Fh,zh,Hh,Wh);return new Vh(Gh,qh,Kh-Gh,Jh-qh)},gg=function(Ph,Fh,Ih,Lh,Rh,zh,Bh,Hh){var Uh,Wh,Gh,Kh,qh,Jh,Yh,Xh,Zh,Qh,$h,eg,tg,ng,rg=Ih-Ph,ig=Lh-Fh,ag=Rh-Ih,og=zh-Lh,sg=Bh-Rh,cg=Hh-zh;for(Wh=0;Wh<41;Wh++)Zh=(Yh=(Gh=Ph+(Uh=Wh/40)*rg)+Uh*((qh=Ih+Uh*ag)-Gh))+Uh*(qh+Uh*(Rh+Uh*sg-qh)-Yh),Qh=(Xh=(Kh=Fh+Uh*ig)+Uh*((Jh=Lh+Uh*og)-Kh))+Uh*(Jh+Uh*(zh+Uh*cg-Jh)-Xh),Wh==0?($h=Zh,eg=Qh,tg=Zh,ng=Qh):($h=Math.min($h,Zh),eg=Math.min(eg,Qh),tg=Math.max(tg,Zh),ng=Math.max(ng,Qh));return new Vh(Math.round($h),Math.round(eg),Math.round(tg-$h),Math.round(ng-eg))},_g=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var Ph,Fh,Ih=(Ph=this.ctx.lineDash,Fh=this.ctx.lineDashOffset,JSON.stringify({lineDash:Ph,lineDashOffset:Fh}));this.prevLineDash!==Ih&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=Ih)}}})(Z$3.API),function(Ph){var Fh=function(Ph){var Fh,Ih,Lh,Rh,zh,Bh,Vh,Hh,Uh,Wh;for(/[^\x00-\xFF]/.test(Ph),Ih=[],Lh=0,Rh=(Ph+=Fh=`\0\0\0\0`.slice(Ph.length%4||4)).length;Rh>Lh;Lh+=4)(zh=(Ph.charCodeAt(Lh)<<24)+(Ph.charCodeAt(Lh+1)<<16)+(Ph.charCodeAt(Lh+2)<<8)+Ph.charCodeAt(Lh+3))===0?Ih.push(122):(Bh=(zh=((zh=((zh=((zh=(zh-(Wh=zh%85))/85)-(Uh=zh%85))/85)-(Hh=zh%85))/85)-(Vh=zh%85))/85)%85,Ih.push(Bh+33,Vh+33,Hh+33,Uh+33,Wh+33));return function(Ph,Fh){for(var Ih=Fh;Ih>0;Ih--)Ph.pop()}(Ih,Fh.length),String.fromCharCode.apply(String,Ih)+`~>`},Ih=function(Ph){var Fh,Ih,Lh,Rh,zh,Bh=String,Vh=`length`,Hh=255,Uh=`charCodeAt`,Wh=`slice`,Gh=`replace`;for(Ph[Wh](-2),Ph=Ph[Wh](0,-2)[Gh](/\s/g,``)[Gh](`z`,`!!!!!`),Lh=[],Rh=0,zh=(Ph+=Fh=`uuuuu`[Wh](Ph[Vh]%5||5))[Vh];zh>Rh;Rh+=5)Ih=52200625*(Ph[Uh](Rh)-33)+614125*(Ph[Uh](Rh+1)-33)+7225*(Ph[Uh](Rh+2)-33)+85*(Ph[Uh](Rh+3)-33)+(Ph[Uh](Rh+4)-33),Lh.push(Hh&Ih>>24,Hh&Ih>>16,Hh&Ih>>8,Hh&Ih);return function(Ph,Fh){for(var Ih=Fh;Ih>0;Ih--)Ph.pop()}(Lh,Fh[Vh]),Bh.fromCharCode.apply(Bh,Lh)},Lh=function(Ph){return Ph.split(``).map(function(Ph){return(`0`+Ph.charCodeAt().toString(16)).slice(-2)}).join(``)+`>`},Rh=function(Ph){var Fh=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((Ph=Ph.replace(/\s/g,``)).indexOf(`>`)!==-1&&(Ph=Ph.substr(0,Ph.indexOf(`>`))),Ph.length%2&&(Ph+=`0`),!1===Fh.test(Ph))return``;for(var Ih=``,Lh=0;Lh<Ph.length;Lh+=2)Ih+=String.fromCharCode(`0x`+(Ph[Lh]+Ph[Lh+1]));return Ih},zh=function(Ph){for(var Fh=new Uint8Array(Ph.length),Ih=Ph.length;Ih--;)Fh[Ih]=Ph.charCodeAt(Ih);return(Fh=me$3(Fh)).reduce(function(Ph,Fh){return Ph+String.fromCharCode(Fh)},``)};Ph.processDataByFilters=function(Ph,Bh){var Vh=0,Hh=Ph||``,Uh=[];for(typeof(Bh||=[])==`string`&&(Bh=[Bh]),Vh=0;Vh<Bh.length;Vh+=1)switch(Bh[Vh]){case`ASCII85Decode`:case`/ASCII85Decode`:Hh=Ih(Hh),Uh.push(`/ASCII85Encode`);break;case`ASCII85Encode`:case`/ASCII85Encode`:Hh=Fh(Hh),Uh.push(`/ASCII85Decode`);break;case`ASCIIHexDecode`:case`/ASCIIHexDecode`:Hh=Rh(Hh),Uh.push(`/ASCIIHexEncode`);break;case`ASCIIHexEncode`:case`/ASCIIHexEncode`:Hh=Lh(Hh),Uh.push(`/ASCIIHexDecode`);break;case`FlateEncode`:case`/FlateEncode`:Hh=zh(Hh),Uh.push(`/FlateDecode`);break;default:throw Error(`The filter: "`+Bh[Vh]+`" is not implemented`)}return{data:Hh,reverseChain:Uh.reverse().join(` `)}}}(Z$3.API),function(Ph){Ph.loadFile=function(Ph,Fh,Ih){return function(Ph,Fh,Ih){Fh=!1!==Fh,Ih=typeof Ih==`function`?Ih:function(){};var Lh=void 0;try{Lh=function(Ph,Fh,Ih){var Lh=new XMLHttpRequest,Rh=0,zh=function(Ph){var Fh=Ph.length,Ih=[],Lh=String.fromCharCode;for(Rh=0;Rh<Fh;Rh+=1)Ih.push(Lh(255&Ph.charCodeAt(Rh)));return Ih.join(``)};if(Lh.open(`GET`,Ph,!Fh),Lh.overrideMimeType(`text/plain; charset=x-user-defined`),!1===Fh&&(Lh.onload=function(){Lh.status===200?Ih(zh(this.responseText)):Ih(void 0)}),Lh.send(null),Fh&&Lh.status===200)return zh(Lh.responseText)}(Ph,Fh,Ih)}catch{}return Lh}(Ph,Fh,Ih)},Ph.allowFsRead=void 0,Ph.loadImageFile=Ph.loadFile}(Z$3.API),function(Ph){function Fh(){return(X$3.html2canvas?Promise.resolve(X$3.html2canvas):__vitePreload(()=>import(`./html2canvas-Cx501zZr-BORHg-NU.js`).then(Ph=>c$2(Ph.default)),[])).catch(function(Ph){return Promise.reject(Error(`Could not load html2canvas: `+Ph))}).then(function(Ph){return Ph.default?Ph.default:Ph})}function Ih(){return(X$3.DOMPurify?Promise.resolve(X$3.DOMPurify):__vitePreload(()=>import(`./purify.es-Fx1Nqyry-BwJECkqS.js`),[])).catch(function(Ph){return Promise.reject(Error(`Could not load dompurify: `+Ph))}).then(function(Ph){return Ph.default?Ph.default:Ph})}var Lh=function(Ph){var Fh=e$4(Ph);return Fh===`undefined`?`undefined`:Fh===`string`||Ph instanceof String?`string`:Fh===`number`||Ph instanceof Number?`number`:Fh===`function`||Ph instanceof Function?`function`:Ph&&Ph.constructor===Array?`array`:Ph&&Ph.nodeType===1?`element`:Fh===`object`?`object`:`unknown`},Rh=function(Ph,Fh){var Ih=document.createElement(Ph);for(var Lh in Fh.className&&(Ih.className=Fh.className),Fh.innerHTML&&Fh.dompurify&&(Ih.innerHTML=Fh.dompurify.sanitize(Fh.innerHTML)),Fh.style)Ih.style[Lh]=Fh.style[Lh];return Ih},zh=function Ph(Fh,Ih){for(var Lh=Fh.nodeType===3?document.createTextNode(Fh.nodeValue):Fh.cloneNode(!1),Rh=Fh.firstChild;Rh;Rh=Rh.nextSibling)!0!==Ih&&Rh.nodeType===1&&Rh.nodeName===`SCRIPT`||Lh.appendChild(Ph(Rh,Ih));return Fh.nodeType===1&&(Fh.nodeName===`CANVAS`?(Lh.width=Fh.width,Lh.height=Fh.height,Lh.getContext(`2d`).drawImage(Fh,0,0)):Fh.nodeName!==`TEXTAREA`&&Fh.nodeName!==`SELECT`||(Lh.value=Fh.value),Lh.addEventListener(`load`,function(){Lh.scrollTop=Fh.scrollTop,Lh.scrollLeft=Fh.scrollLeft},!0)),Lh},Bh=function Ph(Fh){var Ih=Object.assign(Ph.convert(Promise.resolve()),JSON.parse(JSON.stringify(Ph.template))),Lh=Ph.convert(Promise.resolve(),Ih);return(Lh=Lh.setProgress(1,Ph,1,[Ph])).set(Fh)};(Bh.prototype=Object.create(Promise.prototype)).constructor=Bh,Bh.convert=function(Ph,Fh){return Ph.__proto__=Fh||Bh.prototype,Ph},Bh.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:`file.pdf`,margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:`transparent`}},Bh.prototype.from=function(Ph,Fh){return this.then(function(){switch(Fh||=function(Ph){switch(Lh(Ph)){case`string`:return`string`;case`element`:return Ph.nodeName.toLowerCase()===`canvas`?`canvas`:`element`;default:return`unknown`}}(Ph),Fh){case`string`:return this.then(Ih).then(function(Fh){return this.set({src:Rh(`div`,{innerHTML:Ph,dompurify:Fh})})});case`element`:return this.set({src:Ph});case`canvas`:return this.set({canvas:Ph});case`img`:return this.set({img:Ph});default:return this.error(`Unknown source type.`)}})},Bh.prototype.to=function(Ph){switch(Ph){case`container`:return this.toContainer();case`canvas`:return this.toCanvas();case`img`:return this.toImg();case`pdf`:return this.toPdf();default:return this.error(`Invalid target.`)}},Bh.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error(`Cannot duplicate - no source HTML.`)},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var Ph={position:`relative`,display:`inline-block`,width:(typeof this.opt.width!=`number`||isNaN(this.opt.width)||typeof this.opt.windowWidth!=`number`||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+`px`,left:0,right:0,top:0,margin:`auto`,backgroundColor:this.opt.backgroundColor},Fh=zh(this.prop.src,this.opt.html2canvas.javascriptEnabled);Fh.tagName===`BODY`&&(Ph.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+`px`),this.prop.overlay=Rh(`div`,{className:`html2pdf__overlay`,style:{position:`fixed`,overflow:`hidden`,zIndex:1e3,left:`-100000px`,right:0,bottom:0,top:0}}),this.prop.container=Rh(`div`,{className:`html2pdf__container`,style:Ph}),this.prop.container.appendChild(Fh),this.prop.container.firstChild.appendChild(Rh(`div`,{style:{clear:`both`,border:`0 none transparent`,margin:0,padding:0,height:0}})),this.prop.container.style.float=`none`,this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position=`relative`,this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+`px`})},Bh.prototype.toCanvas=function(){return this.thenList([function(){return document.body.contains(this.prop.container)||this.toContainer()}]).then(Fh).then(function(Ph){var Fh=Object.assign({},this.opt.html2canvas);return delete Fh.onrendered,Ph(this.prop.container,Fh)}).then(function(Ph){(this.opt.html2canvas.onrendered||function(){})(Ph),this.prop.canvas=Ph,document.body.removeChild(this.prop.overlay)})},Bh.prototype.toContext2d=function(){return this.thenList([function(){return document.body.contains(this.prop.container)||this.toContainer()}]).then(Fh).then(function(Ph){var Fh=this.opt.jsPDF,Ih=this.opt.fontFaces,Lh=typeof this.opt.width!=`number`||isNaN(this.opt.width)||typeof this.opt.windowWidth!=`number`||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,Rh=Object.assign({async:!0,allowTaint:!0,scale:Lh,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:`#ffffff`,imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete Rh.onrendered,Fh.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,Fh.context2d.posX=this.opt.x,Fh.context2d.posY=this.opt.y,Fh.context2d.margin=this.opt.margin,Fh.context2d.fontFaces=Ih,Ih)for(var zh=0;zh<Ih.length;++zh){var Bh=Ih[zh],Vh=Bh.src.find(function(Ph){return Ph.format===`truetype`});Vh&&Fh.addFont(Vh.url,Bh.ref.name,Bh.ref.style)}return Rh.windowHeight=Rh.windowHeight||0,Rh.windowHeight=Rh.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):Rh.windowHeight,Fh.context2d.save(!0),Ph(this.prop.container,Rh)}).then(function(Ph){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(Ph),this.prop.canvas=Ph,document.body.removeChild(this.prop.overlay)})},Bh.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var Ph=this.prop.canvas.toDataURL(`image/`+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement(`img`),this.prop.img.src=Ph})},Bh.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},Bh.prototype.output=function(Ph,Fh,Ih){return(Ih||=`pdf`).toLowerCase()===`img`||Ih.toLowerCase()===`image`?this.outputImg(Ph,Fh):this.outputPdf(Ph,Fh)},Bh.prototype.outputPdf=function(Ph,Fh){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(Ph,Fh)})},Bh.prototype.outputImg=function(Ph){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(Ph){case void 0:case`img`:return this.prop.img;case`datauristring`:case`dataurlstring`:return this.prop.img.src;case`datauri`:case`dataurl`:return document.location.href=this.prop.img.src;default:throw`Image output type "`+Ph+`" is not supported.`}})},Bh.prototype.save=function(Ph){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(Ph?{filename:Ph}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},Bh.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},Bh.prototype.set=function(Ph){if(Lh(Ph)!==`object`)return this;var Fh=Object.keys(Ph||{}).map(function(Fh){if(Fh in Bh.template.prop)return function(){this.prop[Fh]=Ph[Fh]};switch(Fh){case`margin`:return this.setMargin.bind(this,Ph.margin);case`jsPDF`:return function(){return this.opt.jsPDF=Ph.jsPDF,this.setPageSize()};case`pageSize`:return this.setPageSize.bind(this,Ph.pageSize);default:return function(){this.opt[Fh]=Ph[Fh]}}},this);return this.then(function(){return this.thenList(Fh)})},Bh.prototype.get=function(Ph,Fh){return this.then(function(){var Ih=Ph in Bh.template.prop?this.prop[Ph]:this.opt[Ph];return Fh?Fh(Ih):Ih})},Bh.prototype.setMargin=function(Ph){return this.then(function(){switch(Lh(Ph)){case`number`:Ph=[Ph,Ph,Ph,Ph];case`array`:if(Ph.length===2&&(Ph=[Ph[0],Ph[1],Ph[0],Ph[1]]),Ph.length===4)break;default:return this.error(`Invalid margin array.`)}this.opt.margin=Ph}).then(this.setPageSize)},Bh.prototype.setPageSize=function(Ph){function Fh(Ph,Fh){return Math.floor(Ph*Fh/72*96)}return this.then(function(){(Ph||=Z$3.getPageSize(this.opt.jsPDF)).hasOwnProperty(`inner`)||(Ph.inner={width:Ph.width-this.opt.margin[1]-this.opt.margin[3],height:Ph.height-this.opt.margin[0]-this.opt.margin[2]},Ph.inner.px={width:Fh(Ph.inner.width,Ph.k),height:Fh(Ph.inner.height,Ph.k)},Ph.inner.ratio=Ph.inner.height/Ph.inner.width),this.prop.pageSize=Ph})},Bh.prototype.setProgress=function(Ph,Fh,Ih,Lh){return Ph!=null&&(this.progress.val=Ph),Fh!=null&&(this.progress.state=Fh),Ih!=null&&(this.progress.n=Ih),Lh!=null&&(this.progress.stack=Lh),this.progress.ratio=this.progress.val/this.progress.state,this},Bh.prototype.updateProgress=function(Ph,Fh,Ih,Lh){return this.setProgress(Ph?this.progress.val+Ph:null,Fh||null,Ih?this.progress.n+Ih:null,Lh?this.progress.stack.concat(Lh):null)},Bh.prototype.then=function(Ph,Fh){var Ih=this;return this.thenCore(Ph,Fh,function(Ph,Fh){return Ih.updateProgress(null,null,1,[Ph]),Promise.prototype.then.call(this,function(Fh){return Ih.updateProgress(null,Ph),Fh}).then(Ph,Fh).then(function(Ph){return Ih.updateProgress(1),Ph})})},Bh.prototype.thenCore=function(Ph,Fh,Ih){Ih||=Promise.prototype.then;var Lh=this;Ph&&=Ph.bind(Lh),Fh&&=Fh.bind(Lh);var Rh=Promise.toString().indexOf(`[native code]`)!==-1&&Promise.name===`Promise`?Lh:Bh.convert(Object.assign({},Lh),Promise.prototype),zh=Ih.call(Rh,Ph,Fh);return Bh.convert(zh,Lh.__proto__)},Bh.prototype.thenExternal=function(Ph,Fh){return Promise.prototype.then.call(this,Ph,Fh)},Bh.prototype.thenList=function(Ph){var Fh=this;return Ph.forEach(function(Ph){Fh=Fh.thenCore(Ph)}),Fh},Bh.prototype.catch=function(Ph){Ph&&=Ph.bind(this);var Fh=Promise.prototype.catch.call(this,Ph);return Bh.convert(Fh,this)},Bh.prototype.catchExternal=function(Ph){return Promise.prototype.catch.call(this,Ph)},Bh.prototype.error=function(Ph){return this.then(function(){throw Error(Ph)})},Bh.prototype.using=Bh.prototype.set,Bh.prototype.saveAs=Bh.prototype.save,Bh.prototype.export=Bh.prototype.output,Bh.prototype.run=Bh.prototype.then,Z$3.getPageSize=function(Ph,Fh,Ih){if(e$4(Ph)===`object`){var Lh=Ph;Ph=Lh.orientation,Fh=Lh.unit||Fh,Ih=Lh.format||Ih}Fh||=`mm`,Ih||=`a4`,Ph=(``+(Ph||`P`)).toLowerCase();var Rh,zh=(``+Ih).toLowerCase(),Bh={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(Fh){case`pt`:Rh=1;break;case`mm`:Rh=72/25.4;break;case`cm`:Rh=72/2.54;break;case`in`:Rh=72;break;case`px`:Rh=.75;break;case`pc`:case`em`:Rh=12;break;case`ex`:Rh=6;break;default:throw`Invalid unit: `+Fh}var Vh,Hh=0,Uh=0;if(Bh.hasOwnProperty(zh))Hh=Bh[zh][1]/Rh,Uh=Bh[zh][0]/Rh;else try{Hh=Ih[1],Uh=Ih[0]}catch{throw Error(`Invalid format: `+Ih)}if(Ph===`p`||Ph===`portrait`)Ph=`p`,Uh>Hh&&(Vh=Uh,Uh=Hh,Hh=Vh);else{if(Ph!==`l`&&Ph!==`landscape`)throw`Invalid orientation: `+Ph;Ph=`l`,Hh>Uh&&(Vh=Uh,Uh=Hh,Hh=Vh)}return{width:Uh,height:Hh,unit:Fh,k:Rh,orientation:Ph}},Ph.html=function(Ph,Fh){(Fh||={}).callback=Fh.callback||function(){},Fh.html2canvas=Fh.html2canvas||{},Fh.html2canvas.canvas=Fh.html2canvas.canvas||this.canvas,Fh.jsPDF=Fh.jsPDF||this,Fh.fontFaces=Fh.fontFaces?Fh.fontFaces.map(zs$1):null;var Ih=new Bh(Fh);return Fh.worker?Ih:Ih.from(Ph).doCallback()}}(Z$3.API),Z$3.API.addJS=function(Ph){var Fh,Ih,Lh=function(Ph){for(var Fh=``,Ih=0;Ih<Ph.length;Ih++){var Lh=Ph[Ih];if(Lh===`(`||Lh===`)`){for(var Rh=0,zh=Ih-1;zh>=0&&Ph[zh]===`\\`;zh--)Rh++;Fh+=Rh%2==0?`\\`+Lh:Lh}else Fh+=Lh}return Fh}(Ph);return this.internal.events.subscribe(`postPutResources`,function(){Fh=this.internal.newObject(),this.internal.out(`<<`),this.internal.out(`/Names [(EmbeddedJS) `+(Fh+1)+` 0 R]`),this.internal.out(`>>`),this.internal.out(`endobj`),Ih=this.internal.newObject(),this.internal.out(`<<`),this.internal.out(`/S /JavaScript`),this.internal.out(`/JS (`+Lh+`)`),this.internal.out(`>>`),this.internal.out(`endobj`)}),this.internal.events.subscribe(`putCatalog`,function(){Fh!==void 0&&Ih!==void 0&&this.internal.out(`/Names <</JavaScript `+Fh+` 0 R>>`)}),this},function(Ph){var Fh;Ph.events.push([`postPutResources`,function(){var Ph=this,Ih=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var Lh=Ph.outline.render().split(/\r\n/),Rh=0;Rh<Lh.length;Rh++){var zh=Lh[Rh],Bh=Ih.exec(zh);if(Bh!=null){var Vh=Bh[1];Ph.internal.newObjectDeferredBegin(Vh,!1)}Ph.internal.write(zh)}if(this.outline.createNamedDestinations){var Hh=this.internal.pages.length,Uh=[];for(Rh=0;Rh<Hh;Rh++){var Wh=Ph.internal.newObject();Uh.push(Wh);var Gh=Ph.internal.getPageInfo(Rh+1);Ph.internal.write(`<< /D[`+Gh.objId+` 0 R /XYZ null null null]>> endobj`)}var Kh=Ph.internal.newObject();for(Ph.internal.write(`<< /Names [ `),Rh=0;Rh<Uh.length;Rh++)Ph.internal.write(`(page_`+(Rh+1)+`)`+Uh[Rh]+` 0 R`);Ph.internal.write(` ] >>`,`endobj`),Fh=Ph.internal.newObject(),Ph.internal.write(`<< /Dests `+Kh+` 0 R`),Ph.internal.write(`>>`,`endobj`)}}]),Ph.events.push([`putCatalog`,function(){var Ph=this;Ph.outline.root.children.length>0&&(Ph.internal.write(`/Outlines`,this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&Ph.internal.write(`/Names `+Fh+` 0 R`))}]),Ph.events.push([`initialized`,function(){var Ph=this;Ph.outline={createNamedDestinations:!1,root:{children:[]}},Ph.outline.add=function(Ph,Fh,Ih){var Lh={title:Fh,options:Ih,children:[]};return Ph??=this.root,Ph.children.push(Lh),Lh},Ph.outline.render=function(){return this.ctx={},this.ctx.val=``,this.ctx.pdf=Ph,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},Ph.outline.genIds_r=function(Fh){Fh.id=Ph.internal.newObjectDeferred();for(var Ih=0;Ih<Fh.children.length;Ih++)this.genIds_r(Fh.children[Ih])},Ph.outline.renderRoot=function(Ph){this.objStart(Ph),this.line(`/Type /Outlines`),Ph.children.length>0&&(this.line(`/First `+this.makeRef(Ph.children[0])),this.line(`/Last `+this.makeRef(Ph.children[Ph.children.length-1]))),this.line(`/Count `+this.count_r({count:0},Ph)),this.objEnd()},Ph.outline.renderItems=function(Fh){for(var Ih=this.ctx.pdf.internal.getVerticalCoordinateString,Lh=0;Lh<Fh.children.length;Lh++){var Rh=Fh.children[Lh];this.objStart(Rh),this.line(`/Title `+this.makeString(Rh.title)),this.line(`/Parent `+this.makeRef(Fh)),Lh>0&&this.line(`/Prev `+this.makeRef(Fh.children[Lh-1])),Lh<Fh.children.length-1&&this.line(`/Next `+this.makeRef(Fh.children[Lh+1])),Rh.children.length>0&&(this.line(`/First `+this.makeRef(Rh.children[0])),this.line(`/Last `+this.makeRef(Rh.children[Rh.children.length-1])));var zh=this.count=this.count_r({count:0},Rh);if(zh>0&&this.line(`/Count `+zh),Rh.options&&Rh.options.pageNumber){var Bh=Ph.internal.getPageInfo(Rh.options.pageNumber);this.line(`/Dest [`+Bh.objId+` 0 R /XYZ 0 `+Ih(0)+` 0]`)}this.objEnd()}for(var Vh=0;Vh<Fh.children.length;Vh++)this.renderItems(Fh.children[Vh])},Ph.outline.line=function(Ph){this.ctx.val+=Ph+`\r
|
|
287
|
+
`),Fh}}},createDefaultAppearanceStream:function(Ph){var Fh=Ph.scope.internal.getFont(Ph.fontName,Ph.fontStyle).id,Ih=Ph.scope.__private__.encodeColorString(Ph.color);return`/`+Fh+` `+Ph.fontSize+` Tf `+Ih}};$$4.internal={Bezier_C:.551915024494,calculateCross:function(Ph){var Fh=$$4.internal.getWidth(Ph),Ih=$$4.internal.getHeight(Ph),Lh=Math.min(Fh,Ih);return{x1:{x:(Fh-Lh)/2,y:(Ih-Lh)/2+Lh},x2:{x:(Fh-Lh)/2+Lh,y:(Ih-Lh)/2},x3:{x:(Fh-Lh)/2,y:(Ih-Lh)/2},x4:{x:(Fh-Lh)/2+Lh,y:(Ih-Lh)/2+Lh}}}},$$4.internal.getWidth=function(Ph){var Fh=0;return e$4(Ph)===`object`&&(Fh=es$1(Ph.Rect[2])),Fh},$$4.internal.getHeight=function(Ph){var Fh=0;return e$4(Ph)===`object`&&(Fh=es$1(Ph.Rect[3])),Fh};var Ms$1=qo$1.addField=function(Ph){if(ms$1(this,Ph),!(Ph instanceof bs$1))throw Error(`Invalid argument passed to jsPDF.addField.`);var Fh;return(Fh=Ph).scope.internal.acroformPlugin.printedOut&&(Fh.scope.internal.acroformPlugin.printedOut=!1,Fh.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),Fh.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(Fh),Ph.page=Ph.scope.internal.getCurrentPageInfo().pageNumber,this};qo$1.AcroFormChoiceField=xs$1,qo$1.AcroFormListBox=Ss$1,qo$1.AcroFormComboBox=Cs$1,qo$1.AcroFormEditBox=ws$1,qo$1.AcroFormButton=Ts$1,qo$1.AcroFormPushButton=Es$1,qo$1.AcroFormRadioButton=Ds$1,qo$1.AcroFormCheckBox=ks$1,qo$1.AcroFormTextField=As$1,qo$1.AcroFormPasswordField=js$1,qo$1.AcroFormAppearance=$$4,qo$1.AcroForm={ChoiceField:xs$1,ListBox:Ss$1,ComboBox:Cs$1,EditBox:ws$1,Button:Ts$1,PushButton:Es$1,RadioButton:Ds$1,CheckBox:ks$1,TextField:As$1,PasswordField:js$1,Appearance:$$4},Z$3.AcroForm={ChoiceField:xs$1,ListBox:Ss$1,ComboBox:Cs$1,EditBox:ws$1,Button:Ts$1,PushButton:Es$1,RadioButton:Ds$1,CheckBox:ks$1,TextField:As$1,PasswordField:js$1,Appearance:$$4},Z$3.AcroForm;function Ns$1(Ph){return Ph.reduce(function(Ph,Fh,Ih){return Ph[Fh]=Ih,Ph},{})}(function(Ph){var Fh=`addImage_`;Ph.__addimage__={};var Ih=`UNKNOWN`,Lh={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},Rh=Ph.__addimage__.getImageFileTypeByImageData=function(Ph,Fh){var Rh,zh,Bh,Vh,Hh,Uh=Ih;if((Fh||=Ih)===`RGBA`||Ph.data!==void 0&&Ph.data instanceof Uint8ClampedArray&&`height`in Ph&&`width`in Ph)return`RGBA`;if(ng(Ph))for(Hh in Lh)for(Bh=Lh[Hh],Rh=0;Rh<Bh.length;Rh+=1){for(Vh=!0,zh=0;zh<Bh[Rh].length;zh+=1)if(Bh[Rh][zh]!==void 0&&Bh[Rh][zh]!==Ph[zh]){Vh=!1;break}if(!0===Vh){Uh=Hh;break}}else for(Hh in Lh)for(Bh=Lh[Hh],Rh=0;Rh<Bh.length;Rh+=1){for(Vh=!0,zh=0;zh<Bh[Rh].length;zh+=1)if(Bh[Rh][zh]!==void 0&&Bh[Rh][zh]!==Ph.charCodeAt(zh)){Vh=!1;break}if(!0===Vh){Uh=Hh;break}}return Uh===Ih&&Fh!==Ih&&(Uh=Fh),Uh},zh=function Ph(Fh){for(var Ih=this.internal.write,Lh=this.internal.putStream,Rh=(0,this.internal.getFilters)();Rh.indexOf(`FlateEncode`)!==-1;)Rh.splice(Rh.indexOf(`FlateEncode`),1);Fh.objectId=this.internal.newObject();var zh=[];if(zh.push({key:`Type`,value:`/XObject`}),zh.push({key:`Subtype`,value:`/Image`}),zh.push({key:`Width`,value:Fh.width}),zh.push({key:`Height`,value:Fh.height}),Fh.colorSpace===Zh.INDEXED?zh.push({key:`ColorSpace`,value:`[/Indexed /DeviceRGB `+(Fh.palette.length/3-1)+` `+(`sMask`in Fh&&Fh.sMask!==void 0?Fh.objectId+2:Fh.objectId+1)+` 0 R]`}):(zh.push({key:`ColorSpace`,value:`/`+Fh.colorSpace}),Fh.colorSpace===Zh.DEVICE_CMYK&&zh.push({key:`Decode`,value:`[1 0 1 0 1 0 1 0]`})),zh.push({key:`BitsPerComponent`,value:Fh.bitsPerComponent}),`decodeParameters`in Fh&&Fh.decodeParameters!==void 0&&zh.push({key:`DecodeParms`,value:`<<`+Fh.decodeParameters+`>>`}),`transparency`in Fh&&Array.isArray(Fh.transparency)&&Fh.transparency.length>0){for(var Bh=``,Vh=0,Hh=Fh.transparency.length;Vh<Hh;Vh++)Bh+=Fh.transparency[Vh]+` `+Fh.transparency[Vh]+` `;zh.push({key:`Mask`,value:`[`+Bh+`]`})}Fh.sMask!==void 0&&zh.push({key:`SMask`,value:Fh.objectId+1+` 0 R`});var Uh=Fh.filter===void 0?void 0:[`/`+Fh.filter];if(Lh({data:Fh.data,additionalKeyValues:zh,alreadyAppliedFilters:Uh,objectId:Fh.objectId}),Ih(`endobj`),`sMask`in Fh&&Fh.sMask!==void 0){var Wh=Fh.sMaskBitsPerComponent??Fh.bitsPerComponent,Gh={width:Fh.width,height:Fh.height,colorSpace:`DeviceGray`,bitsPerComponent:Wh,data:Fh.sMask};`filter`in Fh&&(Gh.decodeParameters=`/Predictor ${Fh.predictor} /Colors 1 /BitsPerComponent ${Wh} /Columns ${Fh.width}`,Gh.filter=Fh.filter),Ph.call(this,Gh)}if(Fh.colorSpace===Zh.INDEXED){var Kh=this.internal.newObject();Lh({data:ig(new Uint8Array(Fh.palette)),objectId:Kh}),Ih(`endobj`)}},Bh=function(){var Ph=this.internal.collections[Fh+`images`];for(var Ih in Ph)zh.call(this,Ph[Ih])},Vh=function(){var Ph,Ih=this.internal.collections[Fh+`images`],Lh=this.internal.write;for(var Rh in Ih)Lh(`/I`+(Ph=Ih[Rh]).index,Ph.objectId,`0`,`R`)},Hh=function(){this.internal.collections[Fh+`images`]||(this.internal.collections[Fh+`images`]={},this.internal.events.subscribe(`putResources`,Bh),this.internal.events.subscribe(`putXobjectDict`,Vh))},Uh=function(){var Ph=this.internal.collections[Fh+`images`];return Hh.call(this),Ph},Wh=function(){return Object.keys(this.internal.collections[Fh+`images`]).length},Gh=function(Fh){return typeof Ph[`process`+Fh.toUpperCase()]==`function`},Kh=function(Ph){return e$4(Ph)===`object`&&Ph.nodeType===1},qh=function(Fh,Ih){if(Fh.nodeName===`IMG`&&Fh.hasAttribute(`src`)){var Lh=``+Fh.getAttribute(`src`);if(Lh.indexOf(`data:image/`)===0)return So$1(unescape(Lh).split(`base64,`).pop());var Rh=Ph.loadFile(Lh,!0);if(Rh!==void 0)return Rh}if(Fh.nodeName===`CANVAS`){if(Fh.width===0||Fh.height===0)throw Error(`Given canvas must have data. Canvas width: `+Fh.width+`, height: `+Fh.height);var zh;switch(Ih){case`PNG`:zh=`image/png`;break;case`WEBP`:zh=`image/webp`;break;default:zh=`image/jpeg`}return So$1(Fh.toDataURL(zh,1).split(`base64,`).pop())}},Jh=function(Ph){var Ih=this.internal.collections[Fh+`images`];if(Ih){for(var Lh in Ih)if(Ph===Ih[Lh].alias)return Ih[Lh]}},Yh=function(Ph,Fh,Ih){return Ph||Fh||(Ph=-96,Fh=-96),Ph<0&&(Ph=-1*Ih.width*72/Ph/this.internal.scaleFactor),Fh<0&&(Fh=-1*Ih.height*72/Fh/this.internal.scaleFactor),Ph===0&&(Ph=Fh*Ih.width/Ih.height),Fh===0&&(Fh=Ph*Ih.height/Ih.width),[Ph,Fh]},Xh=function(Ph,Fh,Ih,Lh,Rh,zh){var Bh=Yh.call(this,Ih,Lh,Rh),Vh=this.internal.getCoordinateString,Hh=this.internal.getVerticalCoordinateString,Wh=Uh.call(this);if(Ih=Bh[0],Lh=Bh[1],Wh[Rh.index]=Rh,zh){zh*=Math.PI/180;var Gh=Math.cos(zh),Kh=Math.sin(zh),qh=function(Ph){return Ph.toFixed(4)},Jh=[qh(Gh),qh(Kh),qh(-1*Kh),qh(Gh),0,0,`cm`]}this.internal.write(`q`),zh?(this.internal.write([1,`0`,`0`,1,Vh(Ph),Hh(Fh+Lh),`cm`].join(` `)),this.internal.write(Jh.join(` `)),this.internal.write([Vh(Ih),`0`,`0`,Vh(Lh),`0`,`0`,`cm`].join(` `))):this.internal.write([Vh(Ih),`0`,`0`,Vh(Lh),Vh(Ph),Hh(Fh+Lh),`cm`].join(` `)),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,`cm`].join(` `)),this.internal.write(`/I`+Rh.index+` Do`),this.internal.write(`Q`)},Zh=Ph.color_spaces={DEVICE_RGB:`DeviceRGB`,DEVICE_GRAY:`DeviceGray`,DEVICE_CMYK:`DeviceCMYK`,CAL_GREY:`CalGray`,CAL_RGB:`CalRGB`,LAB:`Lab`,ICC_BASED:`ICCBased`,INDEXED:`Indexed`,PATTERN:`Pattern`,SEPARATION:`Separation`,DEVICE_N:`DeviceN`};Ph.decode={DCT_DECODE:`DCTDecode`,FLATE_DECODE:`FlateDecode`,LZW_DECODE:`LZWDecode`,JPX_DECODE:`JPXDecode`,JBIG2_DECODE:`JBIG2Decode`,ASCII85_DECODE:`ASCII85Decode`,ASCII_HEX_DECODE:`ASCIIHexDecode`,RUN_LENGTH_DECODE:`RunLengthDecode`,CCITT_FAX_DECODE:`CCITTFaxDecode`};var Qh=Ph.image_compression={NONE:`NONE`,FAST:`FAST`,MEDIUM:`MEDIUM`,SLOW:`SLOW`},$h=Ph.__addimage__.sHashCode=function(Ph){var Fh,Ih,Lh=0;if(typeof Ph==`string`)for(Ih=Ph.length,Fh=0;Fh<Ih;Fh++)Lh=(Lh<<5)-Lh+Ph.charCodeAt(Fh),Lh|=0;else if(ng(Ph))for(Ih=Ph.byteLength/2,Fh=0;Fh<Ih;Fh++)Lh=(Lh<<5)-Lh+Ph[Fh],Lh|=0;return Lh},eg=Ph.__addimage__.validateStringAsBase64=function(Ph){(Ph||=``).toString().trim();var Fh=!0;return Ph.length===0&&(Fh=!1),Ph.length%4!=0&&(Fh=!1),!1===/^[A-Za-z0-9+/]+$/.test(Ph.substr(0,Ph.length-2))&&(Fh=!1),!1===/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(Ph.substr(-2))&&(Fh=!1),Fh},tg=Ph.__addimage__.extractImageFromDataUrl=function(Ph){if(Ph==null||!(Ph=Ph.trim()).startsWith(`data:`))return null;var Fh=Ph.indexOf(`,`);return Fh<0?null:Ph.substring(0,Fh).trim().endsWith(`base64`)?Ph.substring(Fh+1):null};Ph.__addimage__.isArrayBuffer=function(Ph){return Ph instanceof ArrayBuffer};var ng=Ph.__addimage__.isArrayBufferView=function(Ph){return Ph instanceof Int8Array||Ph instanceof Uint8Array||Ph instanceof Uint8ClampedArray||Ph instanceof Int16Array||Ph instanceof Uint16Array||Ph instanceof Int32Array||Ph instanceof Uint32Array||Ph instanceof Float32Array||Ph instanceof Float64Array},rg=Ph.__addimage__.binaryStringToUint8Array=function(Ph){for(var Fh=Ph.length,Ih=new Uint8Array(Fh),Lh=0;Lh<Fh;Lh++)Ih[Lh]=Ph.charCodeAt(Lh);return Ih},ig=Ph.__addimage__.arrayBufferToBinaryString=function(Ph){for(var Fh=``,Ih=ng(Ph)?Ph:new Uint8Array(Ph),Lh=0;Lh<Ih.length;Lh+=8192)Fh+=String.fromCharCode.apply(null,Ih.subarray(Lh,Lh+8192));return Fh};Ph.addImage=function(){var Ph,Fh,Lh,Rh,zh,Bh,Vh,Uh,Wh;if(typeof arguments[1]==`number`?(Fh=Ih,Lh=arguments[1],Rh=arguments[2],zh=arguments[3],Bh=arguments[4],Vh=arguments[5],Uh=arguments[6],Wh=arguments[7]):(Fh=arguments[1],Lh=arguments[2],Rh=arguments[3],zh=arguments[4],Bh=arguments[5],Vh=arguments[6],Uh=arguments[7],Wh=arguments[8]),e$4(Ph=arguments[0])===`object`&&!Kh(Ph)&&`imageData`in Ph){var Gh=Ph;Ph=Gh.imageData,Fh=Gh.format||Fh||Ih,Lh=Gh.x||Lh||0,Rh=Gh.y||Rh||0,zh=Gh.w||Gh.width||zh,Bh=Gh.h||Gh.height||Bh,Vh=Gh.alias||Vh,Uh=Gh.compression||Uh,Wh=Gh.rotation||Gh.angle||Wh}var qh=this.internal.getFilters();if(Uh===void 0&&qh.indexOf(`FlateEncode`)!==-1&&(Uh=`SLOW`),isNaN(Lh)||isNaN(Rh))throw Error(`Invalid coordinates passed to jsPDF.addImage`);Hh.call(this);var Jh=ag.call(this,Ph,Fh,Vh,Uh);return Xh.call(this,Lh,Rh,zh,Bh,Jh,Wh),this};var ag=function(Fh,Lh,zh,Bh){var Vh,Hh,Uh;if(typeof Fh==`string`&&Rh(Fh)===Ih){Fh=unescape(Fh);var Yh=og(Fh,!1);(Yh!==``||(Yh=Ph.loadFile(Fh,!0))!==void 0)&&(Fh=Yh)}if(Kh(Fh)&&(Fh=qh(Fh,Lh)),Lh=Rh(Fh,Lh),!Gh(Lh))throw Error(`addImage does not support files of type '`+Lh+`', please ensure that a plugin for '`+Lh+`' support is added.`);if(((Uh=zh)==null||Uh.length===0)&&(zh=function(Ph){return typeof Ph==`string`||ng(Ph)?$h(Ph):ng(Ph.data)?$h(Ph.data):null}(Fh)),(Vh=Jh.call(this,zh))||(Fh instanceof Uint8Array||Lh===`RGBA`||(Hh=Fh,Fh=rg(Fh)),Vh=this[`process`+Lh.toUpperCase()](Fh,Wh.call(this),zh,function(Fh){return Fh&&typeof Fh==`string`&&(Fh=Fh.toUpperCase()),Fh in Ph.image_compression?Fh:Qh.NONE}(Bh),Hh)),!Vh)throw Error(`An unknown error occurred whilst processing the image.`);return Vh},og=Ph.__addimage__.convertBase64ToBinaryString=function(Ph,Fh){Fh=typeof Fh!=`boolean`||Fh;var Ih,Lh=``;if(typeof Ph==`string`){Ih=tg(Ph)??Ph;try{Lh=So$1(Ih)}catch(Ph){if(Fh)throw eg(Ih)?Error(`atob-Error in jsPDF.convertBase64ToBinaryString `+Ph.message):Error(`Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString `)}}return Lh};Ph.getImageProperties=function(Fh){var Lh,zh,Bh=``;if(Kh(Fh)&&(Fh=qh(Fh)),typeof Fh==`string`&&Rh(Fh)===Ih&&((Bh=og(Fh,!1))===``&&(Bh=Ph.loadFile(Fh)||``),Fh=Bh),zh=Rh(Fh),!Gh(zh))throw Error(`addImage does not support files of type '`+zh+`', please ensure that a plugin for '`+zh+`' support is added.`);if(Fh instanceof Uint8Array||(Fh=rg(Fh)),!(Lh=this[`process`+zh.toUpperCase()](Fh)))throw Error(`An unknown error occurred whilst processing the image`);return Lh.fileType=zh,Lh}})(Z$3.API),function(Ph){var Fh=function(Ph){if(Ph!==void 0&&Ph!=``)return!0};Z$3.API.events.push([`addPage`,function(Ph){this.internal.getPageInfo(Ph.pageNumber).pageContext.annotations=[]}]),Ph.events.push([`putPage`,function(Ph){for(var Ih,Lh,Rh,zh=this.internal.getCoordinateString,Bh=this.internal.getVerticalCoordinateString,Vh=this.internal.getPageInfoByObjId(Ph.objId),Hh=Ph.pageContext.annotations,Uh=!1,Wh=0;Wh<Hh.length&&!Uh;Wh++)switch((Ih=Hh[Wh]).type){case`link`:(Fh(Ih.options.url)||Fh(Ih.options.pageNumber))&&(Uh=!0);break;case`reference`:case`text`:case`freetext`:Uh=!0}if(Uh!=0){this.internal.write(`/Annots [`);for(var Gh=0;Gh<Hh.length;Gh++){Ih=Hh[Gh];var Kh=this.internal.pdfEscape,qh=this.internal.getEncryptor(Ph.objId);switch(Ih.type){case`reference`:this.internal.write(` `+Ih.object.objId+` 0 R `);break;case`text`:var Jh=this.internal.newAdditionalObject(),Yh=this.internal.newAdditionalObject(),Xh=this.internal.getEncryptor(Jh.objId),Zh=Ih.title||`Note`;Rh=`<</Type /Annot /Subtype /Text `+(Lh=`/Rect [`+zh(Ih.bounds.x)+` `+Bh(Ih.bounds.y+Ih.bounds.h)+` `+zh(Ih.bounds.x+Ih.bounds.w)+` `+Bh(Ih.bounds.y)+`] `)+`/Contents (`+Kh(Xh(Ih.contents))+`)`,Rh+=` /Popup `+Yh.objId+` 0 R`,Rh+=` /P `+Vh.objId+` 0 R`,Rh+=` /T (`+Kh(Xh(Zh))+`) >>`,Jh.content=Rh;var Qh=Jh.objId+` 0 R`;Rh=`<</Type /Annot /Subtype /Popup `+(Lh=`/Rect [`+zh(Ih.bounds.x+30)+` `+Bh(Ih.bounds.y+Ih.bounds.h)+` `+zh(Ih.bounds.x+Ih.bounds.w+30)+` `+Bh(Ih.bounds.y)+`] `)+` /Parent `+Qh,Ih.open&&(Rh+=` /Open true`),Rh+=` >>`,Yh.content=Rh,this.internal.write(Jh.objId,`0 R`,Yh.objId,`0 R`);break;case`freetext`:Lh=`/Rect [`+zh(Ih.bounds.x)+` `+Bh(Ih.bounds.y)+` `+zh(Ih.bounds.x+Ih.bounds.w)+` `+Bh(Ih.bounds.y+Ih.bounds.h)+`] `;var $h=`font: Helvetica,sans-serif 12.0pt; text-align:left; color:#`+(Ih.color||`#000000`);Rh=`<</Type /Annot /Subtype /FreeText `+Lh+`/Contents (`+Kh(qh(Ih.contents))+`)`,Rh+=` /DS(`+Kh(qh($h))+`)`,Rh+=` /Border [0 0 0]`,Rh+=` >>`,this.internal.write(Rh);break;case`link`:if(Ih.options.name){var eg=this.annotations._nameMap[Ih.options.name];Ih.options.pageNumber=eg.page,Ih.options.top=eg.y}else Ih.options.top||(Ih.options.top=0);if(Lh=`/Rect [`+Ih.finalBounds.x+` `+Ih.finalBounds.y+` `+Ih.finalBounds.w+` `+Ih.finalBounds.h+`] `,Rh=``,Ih.options.url)Rh=`<</Type /Annot /Subtype /Link `+Lh+`/Border [0 0 0] /A <</S /URI /URI (`+Kh(qh(Ih.options.url))+`) >>`;else if(Ih.options.pageNumber)switch(Rh=`<</Type /Annot /Subtype /Link `+Lh+`/Border [0 0 0] /Dest [`+this.internal.getPageInfo(Ih.options.pageNumber).objId+` 0 R`,Ih.options.magFactor=Ih.options.magFactor||`XYZ`,Ih.options.magFactor){case`Fit`:Rh+=` /Fit]`;break;case`FitH`:Rh+=` /FitH `+Ih.options.top+`]`;break;case`FitV`:Ih.options.left=Ih.options.left||0,Rh+=` /FitV `+Ih.options.left+`]`;break;default:var tg=Bh(Ih.options.top);Ih.options.left=Ih.options.left||0,Ih.options.zoom===void 0&&(Ih.options.zoom=0),Rh+=` /XYZ `+Ih.options.left+` `+tg+` `+Ih.options.zoom+`]`}Rh!=``&&(Rh+=` >>`,this.internal.write(Rh))}}this.internal.write(`]`)}}]),Ph.createAnnotation=function(Ph){var Fh=this.internal.getCurrentPageInfo();switch(Ph.type){case`link`:this.link(Ph.bounds.x,Ph.bounds.y,Ph.bounds.w,Ph.bounds.h,Ph);break;case`text`:case`freetext`:Fh.pageContext.annotations.push(Ph)}},Ph.link=function(Ph,Fh,Ih,Lh,Rh){var zh=this.internal.getCurrentPageInfo(),Bh=this.internal.getCoordinateString,Vh=this.internal.getVerticalCoordinateString;zh.pageContext.annotations.push({finalBounds:{x:Bh(Ph),y:Vh(Fh),w:Bh(Ph+Ih),h:Vh(Fh+Lh)},options:Rh,type:`link`})},Ph.textWithLink=function(Ph,Fh,Ih,Lh){var Rh,zh,Bh=this.getTextWidth(Ph),Vh=this.internal.getLineHeight()/this.internal.scaleFactor;if(Lh.maxWidth!==void 0){zh=Lh.maxWidth;var Hh=this.splitTextToSize(Ph,zh).length;Rh=Math.ceil(Vh*Hh)}else zh=Bh,Rh=Vh;return this.text(Ph,Fh,Ih,Lh),Ih+=.2*Vh,Lh.align===`center`&&(Fh-=Bh/2),Lh.align===`right`&&(Fh-=Bh),this.link(Fh,Ih-Vh,zh,Rh,Lh),Bh},Ph.getTextWidth=function(Ph){var Fh=this.internal.getFontSize();return this.getStringUnitWidth(Ph)*Fh/this.internal.scaleFactor}}(Z$3.API),function(Ph){var Fh={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},Ih={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},Lh={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},Rh=[1570,1571,1573,1575];Ph.__arabicParser__={};var zh=Ph.__arabicParser__.isInArabicSubstitutionA=function(Ph){return Fh[Ph.charCodeAt(0)]!==void 0},Bh=Ph.__arabicParser__.isArabicLetter=function(Ph){return typeof Ph==`string`&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(Ph)},Vh=Ph.__arabicParser__.isArabicEndLetter=function(Ph){return Bh(Ph)&&zh(Ph)&&Fh[Ph.charCodeAt(0)].length<=2},Hh=Ph.__arabicParser__.isArabicAlfLetter=function(Ph){return Bh(Ph)&&Rh.indexOf(Ph.charCodeAt(0))>=0};Ph.__arabicParser__.arabicLetterHasIsolatedForm=function(Ph){return Bh(Ph)&&zh(Ph)&&Fh[Ph.charCodeAt(0)].length>=1};var Uh=Ph.__arabicParser__.arabicLetterHasFinalForm=function(Ph){return Bh(Ph)&&zh(Ph)&&Fh[Ph.charCodeAt(0)].length>=2};Ph.__arabicParser__.arabicLetterHasInitialForm=function(Ph){return Bh(Ph)&&zh(Ph)&&Fh[Ph.charCodeAt(0)].length>=3};var Wh=Ph.__arabicParser__.arabicLetterHasMedialForm=function(Ph){return Bh(Ph)&&zh(Ph)&&Fh[Ph.charCodeAt(0)].length==4},Gh=Ph.__arabicParser__.resolveLigatures=function(Ph){var Fh=0,Lh=Ih,Rh=``,zh=0;for(Fh=0;Fh<Ph.length;Fh+=1)Lh[Ph.charCodeAt(Fh)]===void 0?(Lh=Ih,Rh+=Ph.charAt(Fh-zh),Fh-=zh,zh=0):(zh++,typeof(Lh=Lh[Ph.charCodeAt(Fh)])==`number`&&(Rh+=String.fromCharCode(Lh),Lh=Ih,zh=0),Fh===Ph.length-1&&(Lh=Ih,Rh+=Ph.charAt(Fh-(zh-1)),Fh-=zh-1,zh=0));return Rh};Ph.__arabicParser__.isArabicDiacritic=function(Ph){return Ph!==void 0&&Lh[Ph.charCodeAt(0)]!==void 0};var Kh=Ph.__arabicParser__.getCorrectForm=function(Ph,Fh,Ih){return Bh(Ph)?!1===zh(Ph)?-1:!Uh(Ph)||!Bh(Fh)&&!Bh(Ih)||!Bh(Ih)&&Vh(Fh)||Vh(Ph)&&!Bh(Fh)||Vh(Ph)&&Hh(Fh)||Vh(Ph)&&Vh(Fh)?0:Wh(Ph)&&Bh(Fh)&&!Vh(Fh)&&Bh(Ih)&&Uh(Ih)?3:Vh(Ph)||!Bh(Ih)?1:2:-1},qh=function(Ph){var Ih=0,Lh=0,Rh=0,zh=``,Vh=``,Hh=``,Uh=(Ph||=``).split(`\\s+`),Wh=[];for(Ih=0;Ih<Uh.length;Ih+=1){for(Wh.push(``),Lh=0;Lh<Uh[Ih].length;Lh+=1)zh=Uh[Ih][Lh],Vh=Uh[Ih][Lh-1],Hh=Uh[Ih][Lh+1],Bh(zh)?(Rh=Kh(zh,Vh,Hh),Wh[Ih]+=Rh===-1?zh:String.fromCharCode(Fh[zh.charCodeAt(0)][Rh])):Wh[Ih]+=zh;Wh[Ih]=Gh(Wh[Ih])}return Wh.join(` `)},Jh=Ph.__arabicParser__.processArabic=Ph.processArabic=function(){var Ph,Fh=typeof arguments[0]==`string`?arguments[0]:arguments[0].text,Ih=[];if(Array.isArray(Fh)){var Lh=0;for(Ih=[],Lh=0;Lh<Fh.length;Lh+=1)Array.isArray(Fh[Lh])?Ih.push([qh(Fh[Lh][0]),Fh[Lh][1],Fh[Lh][2]]):Ih.push([qh(Fh[Lh])]);Ph=Ih}else Ph=qh(Fh);return typeof arguments[0]==`string`?Ph:(arguments[0].text=Ph,arguments[0])};Ph.events.push([`preProcessText`,Jh])}(Z$3.API),Z$3.API.autoPrint=function(Ph){var Fh;return(Ph||={}).variant=Ph.variant||`non-conform`,Ph.variant===`javascript`?this.addJS(`print({});`):(this.internal.events.subscribe(`postPutResources`,function(){Fh=this.internal.newObject(),this.internal.out(`<<`),this.internal.out(`/S /Named`),this.internal.out(`/Type /Action`),this.internal.out(`/N /Print`),this.internal.out(`>>`),this.internal.out(`endobj`)}),this.internal.events.subscribe(`putCatalog`,function(){this.internal.out(`/OpenAction `+Fh+` 0 R`)})),this},function(Ph){var Fh=function(){var Ph=void 0;Object.defineProperty(this,`pdf`,{get:function(){return Ph},set:function(Fh){Ph=Fh}});var Fh=150;Object.defineProperty(this,`width`,{get:function(){return Fh},set:function(Ph){Fh=isNaN(Ph)||!1===Number.isInteger(Ph)||Ph<0?150:Ph,this.getContext(`2d`).pageWrapXEnabled&&(this.getContext(`2d`).pageWrapX=Fh+1)}});var Ih=300;Object.defineProperty(this,`height`,{get:function(){return Ih},set:function(Ph){Ih=isNaN(Ph)||!1===Number.isInteger(Ph)||Ph<0?300:Ph,this.getContext(`2d`).pageWrapYEnabled&&(this.getContext(`2d`).pageWrapY=Ih+1)}});var Lh=[];Object.defineProperty(this,`childNodes`,{get:function(){return Lh},set:function(Ph){Lh=Ph}});var Rh={};Object.defineProperty(this,`style`,{get:function(){return Rh},set:function(Ph){Rh=Ph}}),Object.defineProperty(this,`parentNode`,{})};Fh.prototype.getContext=function(Ph,Fh){var Ih;if((Ph||=`2d`)!==`2d`)return null;for(Ih in Fh)this.pdf.context2d.hasOwnProperty(Ih)&&(this.pdf.context2d[Ih]=Fh[Ih]);return this.pdf.context2d._canvas=this,this.pdf.context2d},Fh.prototype.toDataURL=function(){throw Error(`toDataURL is not implemented.`)},Ph.events.push([`initialized`,function(){this.canvas=new Fh,this.canvas.pdf=this}])}(Z$3.API),function(Ph){var Fh={left:0,top:0,bottom:0,right:0},Ih=!1,Lh=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},Fh),this.internal.__cell__.margins.width=this.getPageWidth(),Rh.call(this))},Rh=function(){this.internal.__cell__.lastCell=new zh,this.internal.__cell__.pages=1},zh=function(){var Ph=arguments[0];Object.defineProperty(this,`x`,{enumerable:!0,get:function(){return Ph},set:function(Fh){Ph=Fh}});var Fh=arguments[1];Object.defineProperty(this,`y`,{enumerable:!0,get:function(){return Fh},set:function(Ph){Fh=Ph}});var Ih=arguments[2];Object.defineProperty(this,`width`,{enumerable:!0,get:function(){return Ih},set:function(Ph){Ih=Ph}});var Lh=arguments[3];Object.defineProperty(this,`height`,{enumerable:!0,get:function(){return Lh},set:function(Ph){Lh=Ph}});var Rh=arguments[4];Object.defineProperty(this,`text`,{enumerable:!0,get:function(){return Rh},set:function(Ph){Rh=Ph}});var zh=arguments[5];Object.defineProperty(this,`lineNumber`,{enumerable:!0,get:function(){return zh},set:function(Ph){zh=Ph}});var Bh=arguments[6];return Object.defineProperty(this,`align`,{enumerable:!0,get:function(){return Bh},set:function(Ph){Bh=Ph}}),this};zh.prototype.clone=function(){return new zh(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},zh.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},Ph.setHeaderFunction=function(Ph){return Lh.call(this),this.internal.__cell__.headerFunction=typeof Ph==`function`?Ph:void 0,this},Ph.getTextDimensions=function(Ph,Fh){Lh.call(this);var Ih=(Fh||={}).fontSize||this.getFontSize(),Rh=Fh.font||this.getFont(),zh=Fh.scaleFactor||this.internal.scaleFactor,Bh=0,Vh=0,Hh=0,Uh=this;if(!Array.isArray(Ph)&&typeof Ph!=`string`){if(typeof Ph!=`number`)throw Error(`getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.`);Ph=String(Ph)}var Wh=Fh.maxWidth;Wh>0?typeof Ph==`string`?Ph=this.splitTextToSize(Ph,Wh):Object.prototype.toString.call(Ph)===`[object Array]`&&(Ph=Ph.reduce(function(Ph,Fh){return Ph.concat(Uh.splitTextToSize(Fh,Wh))},[])):Ph=Array.isArray(Ph)?Ph:[Ph];for(var Gh=0;Gh<Ph.length;Gh++)Bh<(Hh=this.getStringUnitWidth(Ph[Gh],{font:Rh})*Ih)&&(Bh=Hh);return Bh!==0&&(Vh=Ph.length),{w:Bh/=zh,h:Math.max((Vh*Ih*this.getLineHeightFactor()-Ih*(this.getLineHeightFactor()-1))/zh,0)}},Ph.cellAddPage=function(){Lh.call(this),this.addPage();var Ph=this.internal.__cell__.margins||Fh;return this.internal.__cell__.lastCell=new zh(Ph.left,Ph.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var Bh=Ph.cell=function(){var Ph=arguments[0]instanceof zh?arguments[0]:new zh(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]);Lh.call(this);var Rh=this.internal.__cell__.lastCell,Bh=this.internal.__cell__.padding,Vh=this.internal.__cell__.margins||Fh,Hh=this.internal.__cell__.tableHeaderRow,Uh=this.internal.__cell__.printHeaders;return Rh.lineNumber!==void 0&&(Rh.lineNumber===Ph.lineNumber?(Ph.x=(Rh.x||0)+(Rh.width||0),Ph.y=Rh.y||0):Rh.y+Rh.height+Ph.height+Vh.bottom>this.getPageHeight()?(this.cellAddPage(),Ph.y=Vh.top,Uh&&Hh&&(this.printHeaderRow(Ph.lineNumber,!0),Ph.y+=Hh[0].height)):Ph.y=Rh.y+Rh.height||Ph.y),Ph.text[0]!==void 0&&(this.rect(Ph.x,Ph.y,Ph.width,Ph.height,!0===Ih?`FD`:void 0),Ph.align===`right`?this.text(Ph.text,Ph.x+Ph.width-Bh,Ph.y+Bh,{align:`right`,baseline:`top`}):Ph.align===`center`?this.text(Ph.text,Ph.x+Ph.width/2,Ph.y+Bh,{align:`center`,baseline:`top`,maxWidth:Ph.width-Bh-Bh}):this.text(Ph.text,Ph.x+Bh,Ph.y+Bh,{align:`left`,baseline:`top`,maxWidth:Ph.width-Bh-Bh})),this.internal.__cell__.lastCell=Ph,this};Ph.table=function(Ph,Ih,Hh,Uh,Wh){if(Lh.call(this),!Hh)throw Error(`No data for PDF table.`);var Gh,Kh,qh,Jh,Yh=[],Xh=[],Zh=[],Qh={},$h={},eg=[],tg=[],ng=(Wh||={}).autoSize||!1,rg=!1!==Wh.printHeaders,ig=Wh.css&&Wh.css[`font-size`]!==void 0?16*Wh.css[`font-size`]:Wh.fontSize||12,ag=Wh.margins||Object.assign({width:this.getPageWidth()},Fh),og=typeof Wh.padding==`number`?Wh.padding:3,sg=Wh.headerBackgroundColor||`#c8c8c8`,cg=Wh.headerTextColor||`#000`;if(Rh.call(this),this.internal.__cell__.printHeaders=rg,this.internal.__cell__.margins=ag,this.internal.__cell__.table_font_size=ig,this.internal.__cell__.padding=og,this.internal.__cell__.headerBackgroundColor=sg,this.internal.__cell__.headerTextColor=cg,this.setFontSize(ig),Uh==null)Xh=Yh=Object.keys(Hh[0]),Zh=Yh.map(function(){return`left`});else if(Array.isArray(Uh)&&e$4(Uh[0])===`object`)for(Yh=Uh.map(function(Ph){return Ph.name}),Xh=Uh.map(function(Ph){return Ph.prompt||Ph.name||``}),Zh=Uh.map(function(Ph){return Ph.align||`left`}),Gh=0;Gh<Uh.length;Gh+=1)$h[Uh[Gh].name]=.7499990551181103*Uh[Gh].width;else Array.isArray(Uh)&&typeof Uh[0]==`string`&&(Xh=Yh=Uh,Zh=Yh.map(function(){return`left`}));if(ng||Array.isArray(Uh)&&typeof Uh[0]==`string`)for(Gh=0;Gh<Yh.length;Gh+=1){for(Qh[Jh=Yh[Gh]]=Hh.map(function(Ph){return Ph[Jh]}),this.setFont(void 0,`bold`),eg.push(this.getTextDimensions(Xh[Gh],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),Kh=Qh[Jh],this.setFont(void 0,`normal`),qh=0;qh<Kh.length;qh+=1)eg.push(this.getTextDimensions(Kh[qh],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);$h[Jh]=Math.max.apply(null,eg)+og+og,eg=[]}if(rg){var lg={};for(Gh=0;Gh<Yh.length;Gh+=1)lg[Yh[Gh]]={},lg[Yh[Gh]].text=Xh[Gh],lg[Yh[Gh]].align=Zh[Gh];var ug=Vh.call(this,lg,$h);tg=Yh.map(function(Fh){return new zh(Ph,Ih,$h[Fh],ug,lg[Fh].text,void 0,lg[Fh].align)}),this.setTableHeaderRow(tg),this.printHeaderRow(1,!1)}var dg=Uh.reduce(function(Ph,Fh){return Ph[Fh.name]=Fh.align,Ph},{});for(Gh=0;Gh<Hh.length;Gh+=1){`rowStart`in Wh&&Wh.rowStart instanceof Function&&Wh.rowStart({row:Gh,data:Hh[Gh]},this);var fg=Vh.call(this,Hh[Gh],$h);for(qh=0;qh<Yh.length;qh+=1){var pg=Hh[Gh][Yh[qh]];`cellStart`in Wh&&Wh.cellStart instanceof Function&&Wh.cellStart({row:Gh,col:qh,data:pg},this),Bh.call(this,new zh(Ph,Ih,$h[Yh[qh]],fg,pg,Gh+2,dg[Yh[qh]]))}}return this.internal.__cell__.table_x=Ph,this.internal.__cell__.table_y=Ih,this};var Vh=function(Ph,Fh){var Ih=this.internal.__cell__.padding,Lh=this.internal.__cell__.table_font_size,Rh=this.internal.scaleFactor;return Object.keys(Ph).map(function(Lh){var Rh=Ph[Lh];return this.splitTextToSize(Rh.hasOwnProperty(`text`)?Rh.text:Rh,Fh[Lh]-Ih-Ih)},this).map(function(Ph){return this.getLineHeightFactor()*Ph.length*Lh/Rh+Ih+Ih},this).reduce(function(Ph,Fh){return Math.max(Ph,Fh)},0)};Ph.setTableHeaderRow=function(Ph){Lh.call(this),this.internal.__cell__.tableHeaderRow=Ph},Ph.printHeaderRow=function(Ph,Fh){if(Lh.call(this),!this.internal.__cell__.tableHeaderRow)throw Error(`Property tableHeaderRow does not exist.`);var Rh;if(Ih=!0,typeof this.internal.__cell__.headerFunction==`function`){var Vh=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new zh(Vh[0],Vh[1],Vh[2],Vh[3],void 0,-1)}this.setFont(void 0,`bold`);for(var Hh=[],Uh=0;Uh<this.internal.__cell__.tableHeaderRow.length;Uh+=1){Rh=this.internal.__cell__.tableHeaderRow[Uh].clone(),Fh&&(Rh.y=this.internal.__cell__.margins.top||0,Hh.push(Rh)),Rh.lineNumber=Ph;var Wh=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),Bh.call(this,Rh),this.setTextColor(Wh)}Hh.length>0&&this.setTableHeaderRow(Hh),this.setFont(void 0,`normal`),Ih=!1}}(Z$3.API);var Ps$1={italic:[`italic`,`oblique`,`normal`],oblique:[`oblique`,`italic`,`normal`],normal:[`normal`,`oblique`,`italic`]},Fs$1=[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`],Is$1=Ns$1(Fs$1),Ls$1=[100,200,300,400,500,600,700,800,900],Rs$1=Ns$1(Ls$1);function zs$1(Ph){var Fh=Ph.family.replace(/"|'/g,``).toLowerCase(),Ih=function(Ph){return Ps$1[Ph||=`normal`]?Ph:`normal`}(Ph.style),Lh=function(Ph){return Ph?typeof Ph==`number`?Ph>=100&&Ph<=900&&Ph%100==0?Ph:400:/^\d00$/.test(Ph)?parseInt(Ph):Ph===`bold`?700:400:400}(Ph.weight),Rh=function(Ph){return typeof Is$1[Ph||=`normal`]==`number`?Ph:`normal`}(Ph.stretch);return{family:Fh,style:Ih,weight:Lh,stretch:Rh,src:Ph.src||[],ref:Ph.ref||{name:Fh,style:[Rh,Ih,Lh].join(` `)}}}function Bs$1(Ph,Fh,Ih,Lh){var Rh;for(Rh=Ih;Rh>=0&&Rh<Fh.length;Rh+=Lh)if(Ph[Fh[Rh]])return Ph[Fh[Rh]];for(Rh=Ih;Rh>=0&&Rh<Fh.length;Rh-=Lh)if(Ph[Fh[Rh]])return Ph[Fh[Rh]]}var Vs$1={"sans-serif":`helvetica`,fixed:`courier`,monospace:`courier`,terminal:`courier`,cursive:`times`,fantasy:`times`,serif:`times`},Hs$1={caption:`times`,icon:`times`,menu:`times`,"message-box":`times`,"small-caption":`times`,"status-bar":`times`};function Us$1(Ph){return[Ph.stretch,Ph.style,Ph.weight,Ph.family].join(` `)}function Ws$1(Ph){return Ph.trimLeft()}function Gs$1(Ph,Fh){for(var Ih=0;Ih<Ph.length;){if(Ph.charAt(Ih)===Fh)return[Ph.substring(0,Ih),Ph.substring(Ih+1)];Ih+=1}return null}function Ks$1(Ph){var Fh=Ph.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return Fh===null?null:[Fh[0],Ph.substring(Fh[0].length)]}var qs$1,Js$1,Ys$1,Xs$1,Zs$1,Qs$1=[`times`];function $s$1(Ph,Fh,Ih,Lh,Rh){var zh=4,Bh=nc$1;switch(Rh){case Z$3.API.image_compression.FAST:zh=1,Bh=tc$1;break;case Z$3.API.image_compression.MEDIUM:zh=6,Bh=rc$1;break;case Z$3.API.image_compression.SLOW:zh=9,Bh=ic$1}Ph=function(Ph,Fh,Ih,Lh){for(var Rh,zh=Ph.length/Fh,Bh=new Uint8Array(Ph.length+zh),Vh=[ec$1,tc$1,nc$1,rc$1,ic$1],Hh=0;Hh<zh;Hh+=1){var Uh=Hh*Fh,Wh=Ph.subarray(Uh,Uh+Fh);if(Lh)Bh.set(Lh(Wh,Ih,Rh),Uh+Hh);else{for(var Gh=Vh.length,Kh=[],qh=0;qh<Gh;qh+=1)Kh[qh]=Vh[qh](Wh,Ih,Rh);var Jh=oc$1(Kh.concat());Bh.set(Kh[Jh],Uh+Hh)}Rh=Wh}return Bh}(Ph,Fh,Math.ceil(Ih*Lh/8),Bh);var Vh=me$3(Ph,{level:zh});return Z$3.API.__addimage__.arrayBufferToBinaryString(Vh)}function ec$1(Ph){var Fh=Array.apply([],Ph);return Fh.unshift(0),Fh}function tc$1(Ph,Fh){var Ih=Ph.length,Lh=[];Lh[0]=1;for(var Rh=0;Rh<Ih;Rh+=1){var zh=Ph[Rh-Fh]||0;Lh[Rh+1]=Ph[Rh]-zh+256&255}return Lh}function nc$1(Ph,Fh,Ih){var Lh=Ph.length,Rh=[];Rh[0]=2;for(var zh=0;zh<Lh;zh+=1){var Bh=Ih&&Ih[zh]||0;Rh[zh+1]=Ph[zh]-Bh+256&255}return Rh}function rc$1(Ph,Fh,Ih){var Lh=Ph.length,Rh=[];Rh[0]=3;for(var zh=0;zh<Lh;zh+=1){var Bh=Ph[zh-Fh]||0,Vh=Ih&&Ih[zh]||0;Rh[zh+1]=Ph[zh]+256-(Bh+Vh>>>1)&255}return Rh}function ic$1(Ph,Fh,Ih){var Lh=Ph.length,Rh=[];Rh[0]=4;for(var zh=0;zh<Lh;zh+=1){var Bh=ac$1(Ph[zh-Fh]||0,Ih&&Ih[zh]||0,Ih&&Ih[zh-Fh]||0);Rh[zh+1]=Ph[zh]-Bh+256&255}return Rh}function ac$1(Ph,Fh,Ih){if(Ph===Fh&&Fh===Ih)return Ph;var Lh=Math.abs(Fh-Ih),Rh=Math.abs(Ph-Ih),zh=Math.abs(Ph+Fh-Ih-Ih);return Lh<=Rh&&Lh<=zh?Ph:Rh<=zh?Fh:Ih}function oc$1(Ph){var Fh=Ph.map(function(Ph){return Ph.reduce(function(Ph,Fh){return Ph+Math.abs(Fh)},0)});return Fh.indexOf(Math.min.apply(null,Fh))}function sc$1(Ph,Fh,Ih){var Lh=Fh*Ih,Rh=Math.floor(Lh/8),zh=16-(Lh-8*Rh+Ih),Bh=(1<<Ih)-1;return lc$1(Ph,Rh)>>zh&Bh}function cc$1(Ph,Fh,Ih,Lh){var Rh=Ih*Lh,zh=Math.floor(Rh/8),Bh=16-(Rh-8*zh+Lh),Vh=(1<<Lh)-1,Hh=(Fh&Vh)<<Bh;(function(Ph,Fh,Ih){if(Fh+1<Ph.byteLength)Ph.setUint16(Fh,Ih,!1);else{var Lh=Ih>>8&255;Ph.setUint8(Fh,Lh)}})(Ph,zh,lc$1(Ph,zh)&~(Vh<<Bh)&65535|Hh)}function lc$1(Ph,Fh){return Fh+1<Ph.byteLength?Ph.getUint16(Fh,!1):Ph.getUint8(Fh)<<8}function uc$1(Ph){var Fh=0;if(Ph[Fh++]!==71||Ph[Fh++]!==73||Ph[Fh++]!==70||Ph[Fh++]!==56||(Ph[Fh++]+1&253)!=56||Ph[Fh++]!==97)throw Error(`Invalid GIF 87a/89a header.`);var Ih=Ph[Fh++]|Ph[Fh++]<<8,Lh=Ph[Fh++]|Ph[Fh++]<<8,Rh=Ph[Fh++],zh=Rh>>7,Bh=1<<1+(7&Rh);Ph[Fh++],Ph[Fh++];var Vh=null,Hh=null;zh&&(Vh=Fh,Hh=Bh,Fh+=3*Bh);var Uh=!0,Wh=[],Gh=0,Kh=null,qh=0,Jh=null;for(this.width=Ih,this.height=Lh;Uh&&Fh<Ph.length;)switch(Ph[Fh++]){case 33:switch(Ph[Fh++]){case 255:if(Ph[Fh]!==11||Ph[Fh+1]==78&&Ph[Fh+2]==69&&Ph[Fh+3]==84&&Ph[Fh+4]==83&&Ph[Fh+5]==67&&Ph[Fh+6]==65&&Ph[Fh+7]==80&&Ph[Fh+8]==69&&Ph[Fh+9]==50&&Ph[Fh+10]==46&&Ph[Fh+11]==48&&Ph[Fh+12]==3&&Ph[Fh+13]==1&&Ph[Fh+16]==0)Fh+=14,Jh=Ph[Fh++]|Ph[Fh++]<<8,Fh++;else for(Fh+=12;;){if(!((sg=Ph[Fh++])>=0))throw Error(`Invalid block size`);if(sg===0)break;Fh+=sg}break;case 249:if(Ph[Fh++]!==4||Ph[Fh+4]!==0)throw Error(`Invalid graphics extension block.`);var Yh=Ph[Fh++];Gh=Ph[Fh++]|Ph[Fh++]<<8,Kh=Ph[Fh++],1&Yh||(Kh=null),qh=Yh>>2&7,Fh++;break;case 254:for(;;){if(!((sg=Ph[Fh++])>=0))throw Error(`Invalid block size`);if(sg===0)break;Fh+=sg}break;default:throw Error(`Unknown graphic control label: 0x`+Ph[Fh-1].toString(16))}break;case 44:var Xh=Ph[Fh++]|Ph[Fh++]<<8,Zh=Ph[Fh++]|Ph[Fh++]<<8,Qh=Ph[Fh++]|Ph[Fh++]<<8,$h=Ph[Fh++]|Ph[Fh++]<<8,eg=Ph[Fh++],tg=eg>>6&1,ng=1<<1+(7&eg),rg=Vh,ig=Hh,ag=!1;eg>>7&&(ag=!0,rg=Fh,ig=ng,Fh+=3*ng);var og=Fh;for(Fh++;;){var sg;if(!((sg=Ph[Fh++])>=0))throw Error(`Invalid block size`);if(sg===0)break;Fh+=sg}Wh.push({x:Xh,y:Zh,width:Qh,height:$h,has_local_palette:ag,palette_offset:rg,palette_size:ig,data_offset:og,data_length:Fh-og,transparent_index:Kh,interlaced:!!tg,delay:Gh,disposal:qh});break;case 59:Uh=!1;break;default:throw Error(`Unknown gif block: 0x`+Ph[Fh-1].toString(16))}this.numFrames=function(){return Wh.length},this.loopCount=function(){return Jh},this.frameInfo=function(Ph){if(Ph<0||Ph>=Wh.length)throw Error(`Frame index out of range.`);return Wh[Ph]},this.decodeAndBlitFrameBGRA=function(Fh,Lh){var Rh=this.frameInfo(Fh),zh=Rh.width*Rh.height;if(zh>536870912)throw Error(`Image dimensions exceed 512MB, which is too large.`);var Bh=new Uint8Array(zh);dc$1(Ph,Rh.data_offset,Bh,zh);var Vh=Rh.palette_offset,Hh=Rh.transparent_index;Hh===null&&(Hh=256);var Uh=Rh.width,Wh=Ih-Uh,Gh=Uh,Kh=4*(Rh.y*Ih+Rh.x),qh=4*((Rh.y+Rh.height)*Ih+Rh.x),Jh=Kh,Yh=4*Wh;!0===Rh.interlaced&&(Yh+=4*Ih*7);for(var Xh=8,Zh=0,Qh=Bh.length;Zh<Qh;++Zh){var $h=Bh[Zh];if(Gh===0&&(Gh=Uh,(Jh+=Yh)>=qh&&(Yh=4*Wh+4*Ih*(Xh-1),Jh=Kh+(Uh+Wh)*(Xh<<1),Xh>>=1)),$h===Hh)Jh+=4;else{var eg=Ph[Vh+3*$h],tg=Ph[Vh+3*$h+1],ng=Ph[Vh+3*$h+2];Lh[Jh++]=ng,Lh[Jh++]=tg,Lh[Jh++]=eg,Lh[Jh++]=255}--Gh}},this.decodeAndBlitFrameRGBA=function(Fh,Lh){var Rh=this.frameInfo(Fh),zh=Rh.width*Rh.height;if(zh>536870912)throw Error(`Image dimensions exceed 512MB, which is too large.`);var Bh=new Uint8Array(zh);dc$1(Ph,Rh.data_offset,Bh,zh);var Vh=Rh.palette_offset,Hh=Rh.transparent_index;Hh===null&&(Hh=256);var Uh=Rh.width,Wh=Ih-Uh,Gh=Uh,Kh=4*(Rh.y*Ih+Rh.x),qh=4*((Rh.y+Rh.height)*Ih+Rh.x),Jh=Kh,Yh=4*Wh;!0===Rh.interlaced&&(Yh+=4*Ih*7);for(var Xh=8,Zh=0,Qh=Bh.length;Zh<Qh;++Zh){var $h=Bh[Zh];if(Gh===0&&(Gh=Uh,(Jh+=Yh)>=qh&&(Yh=4*Wh+4*Ih*(Xh-1),Jh=Kh+(Uh+Wh)*(Xh<<1),Xh>>=1)),$h===Hh)Jh+=4;else{var eg=Ph[Vh+3*$h],tg=Ph[Vh+3*$h+1],ng=Ph[Vh+3*$h+2];Lh[Jh++]=eg,Lh[Jh++]=tg,Lh[Jh++]=ng,Lh[Jh++]=255}--Gh}}}function dc$1(Ph,Fh,Ih,Lh){for(var Rh=Ph[Fh++],zh=1<<Rh,Bh=zh+1,Vh=Bh+1,Hh=Rh+1,Uh=(1<<Hh)-1,Wh=0,Gh=0,Kh=0,qh=Ph[Fh++],Jh=new Int32Array(4096),Yh=null;;){for(;Wh<16&&qh!==0;)Gh|=Ph[Fh++]<<Wh,Wh+=8,qh===1?qh=Ph[Fh++]:--qh;if(Wh<Hh)break;var Xh=Gh&Uh;if(Gh>>=Hh,Wh-=Hh,Xh!==zh){if(Xh===Bh)break;for(var Zh=Xh<Vh?Xh:Yh,Qh=0,$h=Zh;$h>zh;)$h=Jh[$h]>>8,++Qh;var eg=$h;if(Kh+Qh+(Zh===Xh?0:1)>Lh)return void go$1.log(`Warning, gif stream longer than expected.`);Ih[Kh++]=eg;var tg=Kh+=Qh;for(Zh!==Xh&&(Ih[Kh++]=eg),$h=Zh;Qh--;)$h=Jh[$h],Ih[--tg]=255&$h,$h>>=8;Yh!==null&&Vh<4096&&(Jh[Vh++]=Yh<<8|eg,Vh>=Uh+1&&Hh<12&&(++Hh,Uh=Uh<<1|1)),Yh=Xh}else Vh=Bh+1,Uh=(1<<(Hh=Rh+1))-1,Yh=null}return Kh!==Lh&&go$1.log(`Warning, gif stream shorter than expected.`),Ih}function fc$1(Ph){var Fh,Ih,Lh,Rh,zh,Bh=Math.floor,Vh=Array(64),Hh=Array(64),Uh=Array(64),Wh=Array(64),Gh=Array(65535),Kh=Array(65535),qh=Array(64),Jh=Array(64),Yh=[],Xh=0,Zh=7,Qh=Array(64),$h=Array(64),eg=Array(64),tg=Array(256),ng=Array(2048),rg=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],ig=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],ag=[0,1,2,3,4,5,6,7,8,9,10,11],og=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],sg=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],cg=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],lg=[0,1,2,3,4,5,6,7,8,9,10,11],ug=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],dg=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function fg(Ph,Fh){for(var Ih=0,Lh=0,Rh=[],zh=1;zh<=16;zh++){for(var Bh=1;Bh<=Ph[zh];Bh++)Rh[Fh[Lh]]=[],Rh[Fh[Lh]][0]=Ih,Rh[Fh[Lh]][1]=zh,Lh++,Ih++;Ih*=2}return Rh}function pg(Ph){for(var Fh=Ph[0],Ih=Ph[1]-1;Ih>=0;)Fh&1<<Ih&&(Xh|=1<<Zh),Ih--,--Zh<0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Ph[Kh+16]=Sg+Tg,Ph[Kh+48]=Sg-Tg;var Eg=.382683433*((xg=bg+vg)-(wg=gg+mg)),Dg=.5411961*xg+Eg,Og=1.306562965*wg+Eg,kg=.707106781*(Cg=vg+gg),Ag=mg+kg,jg=mg-kg;Ph[Kh+40]=jg+Dg,Ph[Kh+24]=jg-Dg,Ph[Kh+8]=Ag+Og,Ph[Kh+56]=Ag-Og,Kh++}for(Wh=0;Wh<64;++Wh)Gh=Ph[Wh]*Fh[Wh],qh[Wh]=Gh>0?Gh+.5|0:Gh-.5|0;return qh}(Ph,Fh),Uh=0;Uh<64;++Uh)Jh[rg[Uh]]=Hh[Uh];var Wh=Jh[0]-Ih;Ih=Jh[0],Wh==0?pg(Lh[0]):(pg(Lh[Kh[zh=32767+Wh]]),pg(Gh[zh]));for(var Yh=63;Yh>0&&Jh[Yh]==0;)Yh--;if(Yh==0)return pg(Bh),Ih;for(var Xh,Zh=1;Zh<=Yh;){for(var Qh=Zh;Jh[Zh]==0&&Zh<=Yh;)++Zh;var $h=Zh-Qh;if($h>=16){Xh=$h>>4;for(var eg=1;eg<=Xh;++eg)pg(Vh);$h&=15}zh=32767+Jh[Zh],pg(Rh[($h<<4)+Kh[zh]]),pg(Gh[zh]),Zh++}return Yh!=63&&pg(Bh),Ih}function _g(Ph){Ph=Math.min(Math.max(Ph,1),100),zh!=Ph&&(function(Ph){for(var Fh=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],Ih=0;Ih<64;Ih++){var Lh=Bh((Fh[Ih]*Ph+50)/100);Lh=Math.min(Math.max(Lh,1),255),Vh[rg[Ih]]=Lh}for(var Rh=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],zh=0;zh<64;zh++){var Gh=Bh((Rh[zh]*Ph+50)/100);Gh=Math.min(Math.max(Gh,1),255),Hh[rg[zh]]=Gh}for(var Kh=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],qh=0,Jh=0;Jh<8;Jh++)for(var Yh=0;Yh<8;Yh++)Uh[qh]=1/(Vh[rg[qh]]*Kh[Jh]*Kh[Yh]*8),Wh[qh]=1/(Hh[rg[qh]]*Kh[Jh]*Kh[Yh]*8),qh++}(Math.floor(Ph<50?5e3/Ph:200-2*Ph)),zh=Ph)}this.encode=function(Ph,zh){zh&&_g(zh),Yh=[],Xh=0,Zh=7,hg(65496),hg(65504),hg(16),mg(74),mg(70),mg(73),mg(70),mg(0),mg(1),mg(1),mg(0),hg(1),hg(1),mg(0),mg(0),function(){hg(65499),hg(132),mg(0);for(var Ph=0;Ph<64;Ph++)mg(Vh[Ph]);mg(1);for(var Fh=0;Fh<64;Fh++)mg(Hh[Fh])}(),function(Ph,Fh){hg(65472),hg(17),mg(8),hg(Fh),hg(Ph),mg(3),mg(1),mg(17),mg(0),mg(2),mg(17),mg(1),mg(3),mg(17),mg(1)}(Ph.width,Ph.height),function(){hg(65476),hg(418),mg(0);for(var Ph=0;Ph<16;Ph++)mg(ig[Ph+1]);for(var Fh=0;Fh<=11;Fh++)mg(ag[Fh]);mg(16);for(var Ih=0;Ih<16;Ih++)mg(og[Ih+1]);for(var Lh=0;Lh<=161;Lh++)mg(sg[Lh]);mg(1);for(var Rh=0;Rh<16;Rh++)mg(cg[Rh+1]);for(var zh=0;zh<=11;zh++)mg(lg[zh]);mg(17);for(var Bh=0;Bh<16;Bh++)mg(ug[Bh+1]);for(var Vh=0;Vh<=161;Vh++)mg(dg[Vh])}(),hg(65498),hg(12),mg(3),mg(1),mg(0),mg(2),mg(17),mg(3),mg(17),mg(0),mg(63),mg(0);var Bh=0,Gh=0,Kh=0;Xh=0,Zh=7,this.encode.displayName=`_encode_`;for(var qh,Jh,tg,rg,fg,vg,yg,bg,xg,Sg=Ph.data,Cg=Ph.width,wg=Ph.height,Tg=4*Cg,Eg=0;Eg<wg;){for(qh=0;qh<Tg;){for(fg=Tg*Eg+qh,yg=-1,bg=0,xg=0;xg<64;xg++)vg=fg+(bg=xg>>3)*Tg+(yg=4*(7&xg)),Eg+bg>=wg&&(vg-=Tg*(Eg+1+bg-wg)),qh+yg>=Tg&&(vg-=qh+yg-Tg+4),Jh=Sg[vg++],tg=Sg[vg++],rg=Sg[vg++],Qh[xg]=(ng[Jh]+ng[tg+256|0]+ng[rg+512|0]>>16)-128,$h[xg]=(ng[Jh+768|0]+ng[tg+1024|0]+ng[rg+1280|0]>>16)-128,eg[xg]=(ng[Jh+1280|0]+ng[tg+1536|0]+ng[rg+1792|0]>>16)-128;Bh=gg(Qh,Uh,Bh,Fh,Lh),Gh=gg($h,Wh,Gh,Ih,Rh),Kh=gg(eg,Wh,Kh,Ih,Rh),qh+=32}Eg+=8}if(Zh>=0){var Dg=[];Dg[1]=Zh+1,Dg[0]=(1<<Zh+1)-1,pg(Dg)}return hg(65497),new Uint8Array(Yh)},Ph||=50,function(){for(var Ph=String.fromCharCode,Fh=0;Fh<256;Fh++)tg[Fh]=Ph(Fh)}(),Fh=fg(ig,ag),Ih=fg(cg,lg),Lh=fg(og,sg),Rh=fg(ug,dg),function(){for(var Ph=1,Fh=2,Ih=1;Ih<=15;Ih++){for(var Lh=Ph;Lh<Fh;Lh++)Kh[32767+Lh]=Ih,Gh[32767+Lh]=[],Gh[32767+Lh][1]=Ih,Gh[32767+Lh][0]=Lh;for(var Rh=-(Fh-1);Rh<=-Ph;Rh++)Kh[32767+Rh]=Ih,Gh[32767+Rh]=[],Gh[32767+Rh][1]=Ih,Gh[32767+Rh][0]=Fh-1+Rh;Ph<<=1,Fh<<=1}}(),function(){for(var Ph=0;Ph<256;Ph++)ng[Ph]=19595*Ph,ng[Ph+256|0]=38470*Ph,ng[Ph+512|0]=7471*Ph+32768,ng[Ph+768|0]=-11059*Ph,ng[Ph+1024|0]=-21709*Ph,ng[Ph+1280|0]=32768*Ph+8421375,ng[Ph+1536|0]=-27439*Ph,ng[Ph+1792|0]=-5329*Ph}(),_g(Ph)}function pc$1(Ph,Fh){if(this.pos=0,this.buffer=Ph,this.datav=new DataView(Ph.buffer),this.is_with_alpha=!!Fh,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,[`BM`,`BA`,`CI`,`CP`,`IC`,`PT`].indexOf(this.flag)===-1)throw Error(`Invalid BMP File`);this.parseHeader(),this.parseBGR()}function mc$1(Ph){function Fh(Ph){if(!Ph)throw Error(`assert :P`)}function Ih(Ph,Fh,Ih){for(var Lh=0;4>Lh;Lh++)if(Ph[Fh+Lh]!=Ih.charCodeAt(Lh))return!0;return!1}function Lh(Ph,Fh,Ih,Lh,Rh){for(var zh=0;zh<Rh;zh++)Ph[Fh+zh]=Ih[Lh+zh]}function Rh(Ph,Fh,Ih,Lh){for(var Rh=0;Rh<Lh;Rh++)Ph[Fh+Rh]=Ih}function zh(Ph){return new Int32Array(Ph)}function Bh(Ph,Fh){for(var Ih=[],Lh=0;Lh<Ph;Lh++)Ih.push(new Fh);return Ih}function Vh(Ph,Fh){var Ih=[];return function Ph(Ih,Lh,Rh){for(var zh=Rh[Lh],Bh=0;Bh<zh&&(Ih.push(Rh.length>Lh+1?[]:new Fh),!(Rh.length<Lh+1));Bh++)Ph(Ih[Bh],Lh+1,Rh)}(Ih,0,Ph),Ih}var Hh=function(){var Ph=this;function Hh(Ph,Fh){for(var Ih=1<<Fh-1>>>0;Ph&Ih;)Ih>>>=1;return Ih?(Ph&Ih-1)+Ih:Ph}function Uh(Ph,Ih,Lh,Rh,zh){Fh(!(Rh%Lh));do Ph[Ih+(Rh-=Lh)]=zh;while(0<Rh)}function Wh(Ph,Ih,Lh,Rh,Bh){if(Fh(2328>=Bh),512>=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,Vh)}function Gh(){this.value=this.g=0}function Kh(){this.value=this.g=0}function qh(){this.G=Bh(5,Gh),this.H=zh(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=Bh(_y,Kh)}function Jh(Ph,Ih,Lh,Rh){Fh(Ph!=null),Fh(Ih!=null),Fh(2147483648>Rh),Ph.Ca=254,Ph.I=0,Ph.b=-8,Ph.Ka=0,Ph.oa=Ih,Ph.pa=Lh,Ph.Jd=Ih,Ph.Yc=Lh+Rh,Ph.Zc=4<=Rh?Lh+Rh-4+1:Lh,og(Ph)}function Yh(Ph,Fh){for(var Ih=0;0<Fh--;)Ih|=cg(Ph,128)<<Fh;return Ih}function Xh(Ph,Fh){var Ih=Yh(Ph,Fh);return sg(Ph)?-Ih:Ih}function Zh(Ph,Ih,Lh,Rh){var zh,Bh=0;for(Fh(Ph!=null),Fh(Ih!=null),Fh(4294967288>Rh),Ph.Sb=Rh,Ph.Ra=0,Ph.u=0,Ph.h=0,4<Rh&&(Rh=4),zh=0;zh<Rh;++zh)Bh+=Ih[Lh+zh]<<8*zh;Ph.Ra=Bh,Ph.bb=Rh,Ph.oa=Ih,Ph.pa=Lh}function Qh(Ph){for(;8<=Ph.u&&Ph.bb<Ph.Sb;)Ph.Ra>>>=8,Ph.Ra+=Ph.oa[Ph.pa+Ph.bb]<<by-8>>>0,++Ph.bb,Ph.u-=8;rg(Ph)&&(Ph.h=1,Ph.u=0)}function $h(Ph,Ih){if(Fh(0<=Ih),!Ph.h&&Ih<=yy){var Lh=ng(Ph)&vy[Ih];return Ph.u+=Ih,Qh(Ph),Lh}return Ph.h=1,Ph.u=0}function eg(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function tg(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function ng(Ph){return Ph.Ra>>>(Ph.u&by-1)>>>0}function rg(Ph){return Fh(Ph.bb<=Ph.Sb),Ph.h||Ph.bb==Ph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h=Lh[0],Bh=Rh[0];return zh==0&&(zh=(Ph*Bh+Ih/2)/Ih),Bh==0&&(Bh=(Ih*zh+Ph/2)/Ph),0>=zh||0>=Bh?0:(Lh[0]=zh,Rh[0]=Bh,1)}function _g(Ph,Fh){return Ph+(1<<Fh)-1>>>Fh}function vg(Ph,Fh){return((4278255360&Ph)+(4278255360&Fh)>>>0&4278255360)+((16711935&Ph)+(16711935&Fh)>>>0&16711935)>>>0}function yg(Fh,Ih){Ph[Ih]=function(Ih,Lh,Rh,zh,Bh,Vh,Hh){var Uh;for(Uh=0;Uh<Bh;++Uh){var Wh=Ph[Fh](Vh[Hh+Uh-1],Rh,zh+Uh);Vh[Hh+Uh]=vg(Ih[Lh+Uh],Wh)}}}function bg(){this.ud=this.hd=this.jd=0}function xg(Ph,Fh){return((4278124286&(Ph^Fh))>>>1)+(Ph&Fh)>>>0}function Sg(Ph){return 0<=Ph&&256>Ph?Ph:0>Ph?0:255<Ph?255:void 0}function Cg(Ph,Fh){return Sg(Ph+(Ph-Fh+.5>>1))}function wg(Ph,Fh,Ih){return Math.abs(Fh-Ih)-Math.abs(Ph-Ih)}function Tg(Ph,Fh,Ih,Lh,Rh,zh,Bh){for(Lh=zh[Bh-1],Ih=0;Ih<Rh;++Ih)zh[Bh+Ih]=Lh=vg(Ph[Fh+Ih],Lh)}function Eg(Ph,Fh,Ih,Lh,Rh){var zh;for(zh=0;zh<Ih;++zh){var Bh=Ph[Fh+zh],Vh=Bh>>8&255,Hh=16711935&(Hh=(Hh=16711935&Bh)+((Vh<<16)+Vh));Lh[Rh+zh]=(4278255360&Bh)+Hh>>>0}}function Dg(Ph,Fh){Fh.jd=255&Ph,Fh.hd=Ph>>8&255,Fh.ud=Ph>>16&255}function Og(Ph,Fh,Ih,Lh,Rh,zh){var Bh;for(Bh=0;Bh<Lh;++Bh){var Vh=Fh[Ih+Bh],Hh=Vh>>>8,Uh=Vh,Wh=255&(Wh=(Wh=Vh>>>16)+((Ph.jd<<24>>24)*(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bh=Bh>>5&224|Bh>>3&31;Lh[Rh++]=zh,Lh[Rh++]=Bh}}function Pg(Ph,Fh,Ih,Lh,Rh){for(Ih=Fh+Ih;Fh<Ih;){var zh=Ph[Fh++];Lh[Rh++]=255&zh,Lh[Rh++]=zh>>8&255,Lh[Rh++]=zh>>16&255}}function Fg(Ph,Fh,Ih,Rh,zh,Bh){if(Bh==0)for(Ih=Fh+Ih;Fh<Ih;)lg(Rh,((Bh=Ph[Fh++])[0]>>24|Bh[1]>>8&65280|Bh[2]<<8&16711680|Bh[3]<<24)>>>0),zh+=32;else Lh(Rh,zh,Ph,Fh,Ih)}function Ig(Fh,Ih){Ph[Ih][0]=Ph[Fh+`0`],Ph[Ih][1]=Ph[Fh+`1`],Ph[Ih][2]=Ph[Fh+`2`],Ph[Ih][3]=Ph[Fh+`3`],Ph[Ih][4]=Ph[Fh+`4`],Ph[Ih][5]=Ph[Fh+`5`],Ph[Ih][6]=Ph[Fh+`6`],Ph[Ih][7]=Ph[Fh+`7`],Ph[Ih][8]=Ph[Fh+`8`],Ph[Ih][9]=Ph[Fh+`9`],Ph[Ih][10]=Ph[Fh+`10`],Ph[Ih][11]=Ph[Fh+`11`],Ph[Ih][12]=Ph[Fh+`12`],Ph[Ih][13]=Ph[Fh+`13`],Ph[Ih][14]=Ph[Fh+`0`],Ph[Ih][15]=Ph[Fh+`0`]}function Lg(Ph){return Ph==wb||Ph==Tb||Ph==Eb||Ph==Db}function Rg(){this.eb=[],this.size=this.A=this.fb=0}function zg(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function Bg(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new Rg,this.f.kb=new zg,this.sd=null}function Vg(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function Hg(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this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Ih[Kh]=$h.qb,eg=!0),!eg)if(ag(Wh),$h.jc){tg=Wh,og=Ih;var sg=Kh,cg=$h.pd[ng(tg)&_y-1];Fh($h.jc),256>cg.g?(ig(tg,tg.u+cg.g),og[sg]=cg.value,tg=0):(ig(tg,tg.u+cg.g-256),Fh(256<=cg.value),tg=cg.value),tg==0&&(eg=!0)}else tg=Qg($h.G[0],$h.H[0],Wh);if(Wh.h)break;if(eg||256>tg){if(!eg)if($h.nd)Ih[Kh]=($h.qb|tg<<8)>>>0;else{if(ag(Wh),eg=Qg($h.G[1],$h.H[1],Wh),ag(Wh),og=Qg($h.G[2],$h.H[2],Wh),sg=Qg($h.G[3],$h.H[3],Wh),Wh.h)break;Ih[Kh]=(sg<<24|eg<<16|tg<<8|og)>>>0}if(eg=!1,++Kh,++Uh>=Rh&&(Uh=0,++Hh,Vh!=null&&Hh<=Bh&&!(Hh%16)&&Vh(Ph,Hh),Zh!=null))for(;qh<Kh;)tg=Ih[qh++],Zh.X[(506832829*tg&4294967295)>>>Zh.Mb]=tg}else if(280>tg){if(tg=Xg(tg-256,Wh),og=Qg($h.G[4],$h.H[4],Wh),ag(Wh),og=Zg(Rh,og=Xg(og,Wh)),Wh.h)break;if(Kh-Lh<og||zh-Kh<tg)break t;for(sg=0;sg<tg;++sg)Ih[Kh+sg]=Ih[Kh+sg-og];for(Kh+=tg,Uh+=tg;Uh>=Rh;)Uh-=Rh,++Hh,Vh!=null&&Hh<=Bh&&!(Hh%16)&&Vh(Ph,Hh);if(Fh(Kh<=zh),Uh&Qh&&($h=e_(Gh,Uh,Hh)),Zh!=null)for(;qh<Kh;)tg=Ih[qh++],Zh.X[(506832829*tg&4294967295)>>>Zh.Mb]=tg}else{if(!(tg<Yh))break t;for(eg=tg-280,Fh(Zh!=null);qh<Kh;)tg=Ih[qh++],Zh.X[(506832829*tg&4294967295)>>>Zh.Mb]=tg;tg=Kh,Fh(!(eg>>>(og=Zh).Xa)),Ih[tg]=og.X[eg],eg=!0}eg||Fh(Wh.h==rg(Wh))}if(Ph.Pb&&Wh.h&&Kh<zh)Fh(Ph.m.h),Ph.a=5,Ph.m=Ph.wd,Ph.$=Ph.xd,0<Ph.s.ua&&mg(Ph.s.vb,Ph.s.Wa);else{if(Wh.h)break t;Vh?.(Ph,Hh>Bh?Bh:Hh),Ph.a=0,Ph.$=Kh-Lh}return 1}return Ph.a=3,0}function s_(Ph){Fh(Ph!=null),Ph.vc=null,Ph.yc=null,Ph.Ya=null;var Ih=Ph.Wa;Ih!=null&&(Ih.X=null),Ph.vb=null,Fh(Ph!=null)}function c_(){var Fh=new zv;return Fh==null?null:(Fh.a=0,Fh.xb=Xb,Ig(`Predictor`,`VP8LPredictors`),Ig(`Predictor`,`VP8LPredictors_C`),Ig(`PredictorAdd`,`VP8LPredictorsAdd`),Ig(`PredictorAdd`,`VP8LPredictorsAdd_C`),Ty=Eg,jy=Og,My=Ag,Ny=jg,Py=Mg,Fy=Ng,Iy=Pg,Ph.VP8LMapColor32b=Dy,Ph.VP8LMapColor8b=ky,Fh)}function l_(Ph,Ih,Lh,Vh,Hh){var Uh=1,Kh=[Ph],Jh=[Ih],Yh=Vh.m,Xh=Vh.s,Zh=null,Qh=0;t:for(;;){if(Lh)for(;Uh&&$h(Yh,1);){var eg=Kh,tg=Jh,rg=Vh,og=1,sg=rg.m,cg=rg.gc[rg.ab],lg=$h(sg,2);if(rg.Oc&1<<lg)Uh=0;else{switch(rg.Oc|=1<<lg,cg.hc=lg,cg.Ea=eg[0],cg.nc=tg[0],cg.K=[null],++rg.ab,Fh(4>=rg.ab),lg){case 0:case 1:cg.b=$h(sg,3)+2,og=l_(_g(cg.Ea,cg.b),_g(cg.nc,cg.b),0,rg,cg.K),cg.K=cg.K[0];break;case 3:var ug,dg=$h(sg,8)+1,fg=16<dg?0:4<dg?1:2<dg?2:3;if(eg[0]=_g(cg.Ea,fg),cg.b=fg,ug=og=l_(dg,1,0,rg,cg.K)){var mg,hg=dg,gg=cg,yg=1<<(8>>gg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h(c_,0,0,i_),m_){var h_=$h(p_,1)+1,g_=$h(p_,$h(p_,1)==0?1:8);c_[g_]=1,h_==2&&(c_[g_=$h(p_,8)]=1);var __=1}else{var v_=zh(19),y_=$h(p_,4)+4;if(19<y_){a_.a=3;var b_=0;break n}for(r_=0;r_<y_;++r_)v_[Mb[r_]]=$h(p_,3);var x_=void 0,S_=void 0,C_=a_,w_=v_,T_=i_,E_=c_,D_=0,O_=C_.m,k_=8,A_=Bh(128,Gh);i:for(;Wh(A_,0,7,w_,19);){if($h(O_,1)){if((x_=2+$h(O_,2+2*$h(O_,3)))>T_)break i}else x_=T_;for(S_=0;S_<T_&&x_--;){ag(O_);var j_=A_[0+(127&ng(O_))];ig(O_,O_.u+j_.g);var M_=j_.value;if(16>M_)E_[S_++]=M_,M_!=0&&(k_=M_);else{var N_=M_==16,P_=M_-16,F_=kb[P_],I_=$h(O_,Ob[P_])+F_;if(S_+I_>T_)break i;for(var L_=N_?k_:0;0<I_--;)E_[S_++]=L_}}D_=1;break i}D_||(C_.a=3),__=D_}(__&&=!p_.h)&&(f_=Wh(u_,d_,8,c_,i_)),__&&f_!=0?b_=f_:(a_.a=3,b_=0)}if(b_==0)break r;if(t_&&jb[Tg]==1&&(t_=Yg[Eg].g==0),e_+=Yg[Eg].g,Eg+=b_,3>=Tg){var R_,z_=Jg[0];for(R_=1;R_<Ug;++R_)Jg[R_]>z_&&(z_=Jg[R_]);n_+=z_}}if(Xg.nd=t_,Xg.Qb=0,t_&&(Xg.qb=(Zg[3][Qg[3]+0].value<<24|Zg[1][Qg[1]+0].value<<16|Zg[2][Qg[2]+0].value)>>>0,e_==0&&256>Zg[0][Qg[0]+0].value&&(Xg.Qb=1,Xg.qb+=Zg[0][Qg[0]+0].value<<8)),Xg.jc=!Xg.Qb&&6>n_,Xg.jc){var B_,V_=Xg;for(B_=0;B_<_y;++B_){var H_=B_,U_=V_.pd[H_],W_=V_.G[0][V_.H[0]+H_];256<=W_.value?(U_.g=W_.g+256,U_.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==Ih),Ph.C=Ph.Ma=Ih}function f_(){this.ub=this.yd=this.td=this.Rb=0}function p_(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function m_(){this.Fb=this.Bb=this.Cb=0,this.Zb=zh(4),this.Lb=zh(4)}function h_(){this.Yb=function(){var Ph=[];return function Ph(Fh,Ih,Lh){for(var Rh=Lh[Ih],zh=0;zh<Rh&&(Fh.push(Lh.length>Ih+1?[]:0),!(Lh.length<Ih+1));zh++)Ph(Fh[zh],Ih+1,Lh)}(Ph,0,[3,11]),Ph}()}function g_(){this.jb=zh(3),this.Wc=Vh([4,8],h_),this.Xc=Vh([4,17],h_)}function __(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new zh(4),this.od=new zh(4)}function v_(){this.ld=this.La=this.dd=this.tc=0}function y_(){this.Na=this.la=0}function b_(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function x_(){this.ad=zh(384),this.Za=0,this.Ob=zh(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function S_(){this.uc=this.M=this.Nb=0,this.wa=Array(new v_),this.Y=0,this.ya=Array(new x_),this.aa=0,this.l=new E_}function C_(){this.y=zh(16),this.f=zh(8),this.ea=zh(8)}function w_(){this.cb=this.a=0,this.sc=``,this.m=new eg,this.Od=new f_,this.Kc=new p_,this.ed=new __,this.Qa=new m_,this.Ic=this.$c=this.Aa=0,this.D=new S_,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=Bh(8,eg),this.ia=0,this.pb=Bh(4,b_),this.Pa=new g_,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new C_),this.Hd=0,this.rb=Array(new y_),this.sb=0,this.wa=Array(new v_),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new x_),this.L=this.aa=0,this.gd=Vh([4,2],v_),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function T_(Ph,Fh){return 0>Ph?0:Ph>Fh?Fh:Ph}function E_(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma=`void`,this.put=`VP8IoPutHook`,this.ac=`VP8IoSetupHook`,this.bc=`VP8IoTeardownHook`,this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function D_(){var Ph=new w_;return Ph!=null&&(Ph.a=0,Ph.sc=`OK`,Ph.cb=0,Ph.Xb=0,Rb||=j_),Ph}function O_(Ph,Fh,Ih){return Ph.a==0&&(Ph.a=Fh,Ph.sc=Ih,Ph.cb=0),0}function k_(Ph,Fh,Ih){return 3<=Ih&&Ph[Fh+0]==157&&Ph[Fh+1]==1&&Ph[Fh+2]==42}function A_(Ph,Ih){if(Ph==null)return 0;if(Ph.a=0,Ph.sc=`OK`,Ih==null)return O_(Ph,2,`null VP8Io passed to VP8GetHeaders()`);var Lh=Ih.data,zh=Ih.w,Bh=Ih.ha;if(4>Bh)return O_(Ph,7,`Truncated header.`);var Vh=Lh[zh+0]|Lh[zh+1]<<8|Lh[zh+2]<<16,Hh=Ph.Od;if(Hh.Rb=!(1&Vh),Hh.td=Vh>>1&7,Hh.yd=Vh>>4&1,Hh.ub=Vh>>5,3<Hh.td)return O_(Ph,3,`Incorrect keyframe parameters.`);if(!Hh.yd)return O_(Ph,4,`Frame not displayable.`);zh+=3,Bh-=3;var Uh=Ph.Kc;if(Hh.Rb){if(7>Bh)return O_(Ph,7,`cannot parse picture header`);if(!k_(Lh,zh,Bh))return O_(Ph,3,`Bad code word`);Uh.c=16383&(Lh[zh+4]<<8|Lh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.b=this.hc=0,this.K=[],this.w=0}function Rv(){this.ua=0,this.Wa=new hg,this.vb=new hg,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new qh,this.yc=new Gh}function zv(){this.xb=this.a=0,this.l=new E_,this.ca=new Bg,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new tg,this.Pb=0,this.wd=new tg,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new Rv,this.ab=0,this.gc=Bh(4,Lv),this.Oc=0}function Bv(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new E_,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function Vv(Ph,Fh,Ih,Lh,Rh,zh,Bh){for(Ph=Ph==null?0:Ph[Fh+0],Fh=0;Fh<Bh;++Fh)Rh[zh+Fh]=Ph+Ih[Lh+Fh]&255,Ph=Rh[zh+Fh]}function Hv(Ph,Fh,Ih,Lh,Rh,zh,Bh){var Vh;if(Ph==null)Vv(null,null,Ih,Lh,Rh,zh,Bh);else for(Vh=0;Vh<Bh;++Vh)Rh[zh+Vh]=Ph[Fh+Vh]+Ih[Lh+Vh]&255}function Uv(Ph,Fh,Ih,Lh,Rh,zh,Bh){if(Ph==null)Vv(null,null,Ih,Lh,Rh,zh,Bh);else{var Vh,Hh=Ph[Fh+0],Uh=Hh,Wh=Hh;for(Vh=0;Vh<Bh;++Vh)Uh=Wh+(Hh=Ph[Fh+Vh])-Uh,Wh=Ih[Lh+Vh]+(-256&Uh?0>Uh?0:255:Uh)&255,Uh=Hh,Rh[zh+Vh]=Wh}}function Wv(Ph,Ih,Rh,Bh){var Vh=Ih.width,Hh=Ih.o;if(Fh(Ph!=null&&Ih!=null),0>Rh||0>=Bh||Rh+Bh>Hh)return null;if(!Ph.Cc){if(Ph.ga==null){var Uh;if(Ph.ga=new Bv,(Uh=Ph.ga==null)||(Uh=Ih.width*Ih.o,Fh(Ph.Gb.length==0),Ph.Gb=zh(Uh),Ph.Uc=0,Ph.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.data=Ph,Yh.w=Lh,Yh.ha=Rh,Lh=[Lh],Rh=[Rh],Yh.gb=[Yh.gb];t:{var Xh=Lh,Qh=Rh,$h=Yh.gb;if(Fh(Ph!=null),Fh(Qh!=null),Fh($h!=null),$h[0]=0,12<=Qh[0]&&!Ih(Ph,Xh[0],`RIFF`)){if(Ih(Ph,Xh[0]+8,`WEBP`)){$h=3;break t}var eg=fg(Ph,Xh[0]+4);if(12>eg||4294967286<eg){$h=3;break t}if(Jh&&eg>Qh[0]-8){$h=7;break t}$h[0]=eg,Xh[0]+=12,Qh[0]-=12}$h=0}if($h!=0)return $h;for(eg=0<Yh.gb[0],Rh=Rh[0];;){t:{var ng=Ph;Qh=Lh,$h=Rh;var rg=Gh,ig=Kh,ag=Xh=[0];if((cg=qh=[qh])[0]=0,8>$h[0])$h=7;else{if(!Ih(ng,Qh[0],`VP8X`)){if(fg(ng,Qh[0]+4)!=10){$h=3;break t}if(18>$h[0]){$h=7;break t}var og=fg(ng,Qh[0]+8),sg=1+dg(ng,Qh[0]+12);if(2147483648<=sg*(ng=1+dg(ng,Qh[0]+15))){$h=3;break t}ag!=null&&(ag[0]=og),rg!=null&&(rg[0]=sg),ig!=null&&(ig[0]=ng),Qh[0]+=18,$h[0]-=18,cg[0]=1}$h=0}}if(qh=qh[0],Xh=Xh[0],$h!=0)return $h;if(Qh=!!(2&Xh),!eg&&qh)return 3;if(Vh!=null&&(Vh[0]=!!(16&Xh)),Hh!=null&&(Hh[0]=Qh),Uh!=null&&(Uh[0]=0),Hh=Gh[0],Xh=Kh[0],qh&&Qh&&Wh==null){$h=0;break}if(4>Rh){$h=7;break}if(eg&&qh||!eg&&!qh&&!Ih(Ph,Lh[0],`ALPH`)){Rh=[Rh],Yh.na=[Yh.na],Yh.P=[Yh.P],Yh.Sa=[Yh.Sa];t:{og=Ph,$h=Lh,eg=Rh;var cg=Yh.gb;rg=Yh.na,ig=Yh.P,ag=Yh.Sa,sg=22,Fh(og!=null),Fh(eg!=null),ng=$h[0];var lg=eg[0];for(Fh(rg!=null),Fh(ag!=null),rg[0]=null,ig[0]=null,ag[0]=0;;){if($h[0]=ng,eg[0]=lg,8>lg){$h=7;break t}var ug=fg(og,ng+4);if(4294967286<ug){$h=3;break t}var pg=8+ug+1&-2;if(sg+=pg,0<cg&&sg>cg){$h=3;break t}if(!Ih(og,ng,`VP8 `)||!Ih(og,ng,`VP8L`)){$h=0;break t}if(lg[0]<pg){$h=7;break t}Ih(og,ng,`ALPH`)||(rg[0]=og,ig[0]=ng+8,ag[0]=ug),ng+=pg,lg-=pg}}if(Rh=Rh[0],Yh.na=Yh.na[0],Yh.P=Yh.P[0],Yh.Sa=Yh.Sa[0],$h!=0)break}Rh=[Rh],Yh.Ja=[Yh.Ja],Yh.xa=[Yh.xa];t:if(cg=Ph,$h=Lh,eg=Rh,rg=Yh.gb[0],ig=Yh.Ja,ag=Yh.xa,og=$h[0],ng=!Ih(cg,og,`VP8 `),sg=!Ih(cg,og,`VP8L`),Fh(cg!=null),Fh(eg!=null),Fh(ig!=null),Fh(ag!=null),8>eg[0])$h=7;else{if(ng||sg){if(cg=fg(cg,og+4),12<=rg&&cg>rg-12){$h=3;break t}if(Jh&&cg>eg[0]-8){$h=7;break t}ig[0]=cg,$h[0]+=8,eg[0]-=8,ag[0]=sg}else ag[0]=5<=eg[0]&&cg[og+0]==47&&!(cg[og+4]>>5),ig[0]=eg[0];$h=0}if(Rh=Rh[0],Yh.Ja=Yh.Ja[0],Yh.xa=Yh.xa[0],Lh=Lh[0],$h!=0)break;if(4294967286<Yh.Ja)return 3;if(Uh==null||Qh||(Uh[0]=Yh.xa?2:1),Hh=[Hh],Xh=[Xh],Yh.xa){if(5>Rh){$h=7;break}Uh=Hh,Jh=Xh,Qh=Vh,Ph==null||5>Rh?Ph=0:5<=Rh&&Ph[Lh+0]==47&&!(Ph[Lh+4]>>5)?(eg=[0],cg=[0],rg=[0],Zh(ig=new tg,Ph,Lh,Rh),Yg(ig,eg,cg,rg)?(Uh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,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];yg(`Predictor0`,`PredictorAdd0`),Ph.Predictor0=function(){return 4278190080},Ph.Predictor1=function(Ph){return Ph},Ph.Predictor2=function(Ph,Fh,Ih){return Fh[Ih+0]},Ph.Predictor3=function(Ph,Fh,Ih){return Fh[Ih+1]},Ph.Predictor4=function(Ph,Fh,Ih){return Fh[Ih-1]},Ph.Predictor5=function(Ph,Fh,Ih){return xg(xg(Ph,Fh[Ih+1]),Fh[Ih+0])},Ph.Predictor6=function(Ph,Fh,Ih){return xg(Ph,Fh[Ih-1])},Ph.Predictor7=function(Ph,Fh,Ih){return xg(Ph,Fh[Ih+0])},Ph.Predictor8=function(Ph,Fh,Ih){return xg(Fh[Ih-1],Fh[Ih+0])},Ph.Predictor9=function(Ph,Fh,Ih){return xg(Fh[Ih+0],Fh[Ih+1])},Ph.Predictor10=function(Ph,Fh,Ih){return xg(xg(Ph,Fh[Ih-1]),xg(Fh[Ih+0],Fh[Ih+1]))},Ph.Predictor11=function(Ph,Fh,Ih){var Lh=Fh[Ih+0];return 0>=wg(Lh>>24&255,Ph>>24&255,(Fh=Fh[Ih-1])>>24&255)+wg(Lh>>16&255,Ph>>16&255,Fh>>16&255)+wg(Lh>>8&255,Ph>>8&255,Fh>>8&255)+wg(255&Lh,255&Ph,255&Fh)?Lh:Ph},Ph.Predictor12=function(Ph,Fh,Ih){var Lh=Fh[Ih+0];return(Sg((Ph>>24&255)+(Lh>>24&255)-((Fh=Fh[Ih-1])>>24&255))<<24|Sg((Ph>>16&255)+(Lh>>16&255)-(Fh>>16&255))<<16|Sg((Ph>>8&255)+(Lh>>8&255)-(Fh>>8&255))<<8|Sg((255&Ph)+(255&Lh)-(255&Fh)))>>>0},Ph.Predictor13=function(Ph,Fh,Ih){var Lh=Fh[Ih-1];return(Cg((Ph=xg(Ph,Fh[Ih+0]))>>24&255,Lh>>24&255)<<24|Cg(Ph>>16&255,Lh>>16&255)<<16|Cg(Ph>>8&255,Lh>>8&255)<<8|Cg(255&Ph,255&Lh))>>>0};var Cy=Ph.PredictorAdd0;Ph.PredictorAdd1=Tg,yg(`Predictor2`,`PredictorAdd2`),yg(`Predictor3`,`PredictorAdd3`),yg(`Predictor4`,`PredictorAdd4`),yg(`Predictor5`,`PredictorAdd5`),yg(`Predictor6`,`PredictorAdd6`),yg(`Predictor7`,`PredictorAdd7`),yg(`Predictor8`,`PredictorAdd8`),yg(`Predictor9`,`PredictorAdd9`),yg(`Predictor10`,`PredictorAdd10`),yg(`Predictor11`,`PredictorAdd11`),yg(`Predictor12`,`PredictorAdd12`),yg(`Predictor13`,`PredictorAdd13`);var wy=Ph.PredictorAdd2;kg(`ColorIndexInverseTransform`,`MapARGB`,`32b`,function(Ph){return Ph>>8&255},function(Ph){return Ph}),kg(`VP8LColorIndexInverseTransformAlpha`,`MapAlpha`,`8b`,function(Ph){return Ph},function(Ph){return Ph>>8&255});var Ty,Ey=Ph.ColorIndexInverseTransform,Dy=Ph.MapARGB,Oy=Ph.VP8LColorIndexInverseTransformAlpha,ky=Ph.MapAlpha,Ay=Ph.VP8LPredictorsAdd=[];Ay.length=16,(Ph.VP8LPredictors=[]).length=16,(Ph.VP8LPredictorsAdd_C=[]).length=16,(Ph.VP8LPredictors_C=[]).length=16;var jy,My,Ny,Py,Fy,Iy,Ly,Ry,zy,By,Vy,Hy,Uy,Wy,Gy,Ky,qy,Jy,Yy,Xy,Zy,Qy,$y,eb,tb,nb,ib,ab,ob=zh(511),sb=zh(2041),cb=zh(225),ub=zh(767),db=0,fb=sb,pb=cb,mb=ub,hb=ob,gb=0,vb=1,yb=2,bb=3,xb=4,Sb=5,Cb=6,wb=7,Tb=8,Eb=9,Db=10,Ob=[2,3,7],kb=[3,3,11],Ab=[280,256,256,256,40],jb=[0,1,1,1,0],Mb=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Nb=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Pb=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Fb=8,Ib=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],Lb=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],Rb=null,zb=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],Bb=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],Vb=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],Hb=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],Ub=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],Wb=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],Gb=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Kb=[],qb=[],Jb=[],Yb=1,Xb=2,Zb=[],Qb=[];Xv(`UpsampleRgbLinePair`,ny,3),Xv(`UpsampleBgrLinePair`,ry,3),Xv(`UpsampleRgbaLinePair`,cy,4),Xv(`UpsampleBgraLinePair`,sy,4),Xv(`UpsampleArgbLinePair`,oy,4),Xv(`UpsampleRgba4444LinePair`,ay,2),Xv(`UpsampleRgb565LinePair`,iy,2);var $b=Ph.UpsampleRgbLinePair,ex=Ph.UpsampleBgrLinePair,tx=Ph.UpsampleRgbaLinePair,nx=Ph.UpsampleBgraLinePair,rx=Ph.UpsampleArgbLinePair,ix=Ph.UpsampleRgba4444LinePair,ax=Ph.UpsampleRgb565LinePair,ox=16,sx=1<<ox-1,cx=-227,lx=482,ux=6,dx=(256<<ux)-1,fx=0,px=zh(256),mx=zh(256),hx=zh(256),gx=zh(256),_x=zh(lx-cx),vx=zh(lx-cx);ly(`YuvToRgbRow`,ny,3),ly(`YuvToBgrRow`,ry,3),ly(`YuvToRgbaRow`,cy,4),ly(`YuvToBgraRow`,sy,4),ly(`YuvToArgbRow`,oy,4),ly(`YuvToRgba4444Row`,ay,2),ly(`YuvToRgb565Row`,iy,2);var yx=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],bx=[0,2,8],xx=[8,7,6,4,4,2,2,2,1,1,1,1],Sx=1;this.WebPDecodeRGBA=function(Ph,Ih,Vh,Hh,Uh){var Wh=vb,Gh=new Fv,Kh=new Bg;Gh.ba=Kh,Kh.S=Wh,Kh.width=[Kh.width],Kh.height=[Kh.height];var qh=Kh.width,Jh=Kh.height,Yh=new Vg;if(Yh==null||Ph==null)var Xh=2;else Fh(Yh!=null),Xh=py(Ph,Ih,Vh,Yh.width,Yh.height,Yh.Pd,Yh.Qd,Yh.format,null);if(Xh==0?(qh!=null&&(qh[0]=Yh.width[0]),Jh!=null&&(Jh[0]=Yh.height[0]),qh=1):qh=0,qh){Kh.width=Kh.width[0],Kh.height=Kh.height[0],Hh!=null&&(Hh[0]=Kh.width),Uh!=null&&(Uh[0]=Kh.height);t:{if(Hh=new E_,(Uh=new Iv).data=Ph,Uh.w=Ih,Uh.ha=Vh,Uh.kd=1,Ih=[0],Fh(Uh!=null),((Ph=py(Uh.data,Uh.w,Uh.ha,null,null,null,Ih,null,Uh))==0||Ph==7)&&Ih[0]&&(Ph=4),(Ih=Ph)==0){if(Fh(Gh!=null),Hh.data=Uh.data,Hh.w=Uh.w+Uh.offset,Hh.ha=Uh.ha-Uh.offset,Hh.put=qg,Hh.ac=Kg,Hh.bc=Jg,Hh.ma=Gh,Uh.xa){if((Ph=c_())==null){Gh=1;break t}if(function(Ph,Ih){var Lh=[0],Rh=[0],zh=[0];e:for(;;){if(Ph==null)return 0;if(Ih==null)return Ph.a=2,0;if(Ph.l=Ih,Ph.a=0,Zh(Ph.m,Ih.data,Ih.w,Ih.ha),!Yg(Ph.m,Lh,Rh,zh)){Ph.a=3;break e}if(Ph.xb=Xb,Ih.width=Lh[0],Ih.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Vh.sa,Vh.ta-Wh,qh,Jh+16*Vh.R,Wh),Lh(Vh.qa,Vh.ra-Kh,Yh,Gh+8*Vh.B,Kh),Lh(Vh.Ha,Vh.Ia-Kh,Xh,Zh+8*Vh.B,Kh))}if(!Uh)return O_(Ph,6,`Output aborted.`)}return 1}(Ph,Ih),Ih.bc!=null&&Ih.bc(Ih),Vh&=1}return Vh?(Ph.cb=0,Vh):0})(Ph,Hh)||(Ih=Ph.a)}}else Ih=Ph.a}Ih==0&&Gh.Oa!=null&&Gh.Oa.fd&&(Ih=hy(Gh.ba))}Gh=Ih}Wh=Gh==0?11>Wh?Kh.f.RGBA.eb:Kh.f.kb.y:null}else Wh=null;return Wh};var Cx=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function Uh(Ph,Fh){for(var Ih=``,Lh=0;Lh<4;Lh++)Ih+=String.fromCharCode(Ph[Fh++]);return Ih}function Wh(Ph,Fh){return Ph[Fh+0]|Ph[Fh+1]<<8}function Gh(Ph,Fh){return(Ph[Fh+0]|Ph[Fh+1]<<8|Ph[Fh+2]<<16)>>>0}function Kh(Ph,Fh){return(Ph[Fh+0]|Ph[Fh+1]<<8|Ph[Fh+2]<<16|Ph[Fh+3]<<24)>>>0}new Hh;var qh=[0],Jh=[0],Yh=[],Xh=new Hh,Zh=Ph,Qh=function(Ph,Fh){var Ih={},Lh=0,Rh=!1,zh=0,Bh=0;if(Ih.frames=[],!function(Ph,Fh){for(var Ih=0;Ih<4;Ih++)if(Ph[Fh+Ih]!=`RIFF`.charCodeAt(Ih))return!0;return!1}(Ph,Fh)){for(Kh(Ph,Fh+=4),Fh+=8;Fh<Ph.length;){var Vh=Uh(Ph,Fh),Hh=Kh(Ph,Fh+=4);Fh+=4;var qh=Hh+(1&Hh);switch(Vh){case`VP8 `:case`VP8L`:Ih.frames[Lh]===void 0&&(Ih.frames[Lh]={}),(Xh=Ih.frames[Lh]).src_off=Rh?Bh:Fh-8,Xh.src_size=zh+Hh+8,Lh++,Rh&&(Rh=!1,zh=0,Bh=0);break;case`VP8X`:(Xh=Ih.header={}).feature_flags=Ph[Fh];var Jh=Fh+4;Xh.canvas_width=1+Gh(Ph,Jh),Jh+=3,Xh.canvas_height=1+Gh(Ph,Jh),Jh+=3;break;case`ALPH`:Rh=!0,zh=qh+8,Bh=Fh-8;break;case`ANIM`:(Xh=Ih.header).bgcolor=Kh(Ph,Fh),Jh=Fh+4,Xh.loop_count=Wh(Ph,Jh),Jh+=2;break;case`ANMF`:var Yh,Xh;(Xh=Ih.frames[Lh]={}).offset_x=2*Gh(Ph,Fh),Fh+=3,Xh.offset_y=2*Gh(Ph,Fh),Fh+=3,Xh.width=1+Gh(Ph,Fh),Fh+=3,Xh.height=1+Gh(Ph,Fh),Fh+=3,Xh.duration=Gh(Ph,Fh),Fh+=3,Yh=Ph[Fh++],Xh.dispose=1&Yh,Xh.blend=Yh>>1&1}Vh!=`ANMF`&&(Fh+=qh)}return Ih}}(Zh,0);Qh.response=Zh,Qh.rgbaoutput=!0,Qh.dataurl=!1;var $h=Qh.header?Qh.header:null,eg=Qh.frames?Qh.frames:null;if($h){$h.loop_counter=$h.loop_count,qh=[$h.canvas_height],Jh=[$h.canvas_width];for(var tg=0;tg<eg.length&&eg[tg].blend!=0;tg++);}var ng=eg[0],rg=Xh.WebPDecodeRGBA(Zh,ng.src_off,ng.src_size,Jh,qh);ng.rgba=rg,ng.imgwidth=Jh[0],ng.imgheight=qh[0];for(var ig=0;ig<Jh[0]*qh[0]*4;ig++)Yh[ig]=rg[ig];return this.width=Jh,this.height=qh,this.data=Yh,this}function hc$1(){var Ph,Fh=this.internal.__metadata__.metadata,Ih=unescape(encodeURIComponent(Fh));Ph=this.internal.__metadata__.rawXml?Ih:`<x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="`+this.internal.__metadata__.namespaceUri+`"><jspdf:metadata>`+Ih.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)+`</jspdf:metadata></rdf:Description></rdf:RDF></x:xmpmeta>`,this.internal.__metadata__.metadataObjectNumber=this.internal.newObject(),this.internal.write(`<< /Type /Metadata /Subtype /XML /Length `+Ph.length+` >>`),this.internal.write(`stream`),this.internal.write(Ph),this.internal.write(`endstream`),this.internal.write(`endobj`)}function gc$1(){this.internal.__metadata__.metadataObjectNumber&&this.internal.write(`/Metadata `+this.internal.__metadata__.metadataObjectNumber+` 0 R`)}(function(Ph){var Fh,Ih,Lh,Rh,zh,Bh,Vh,Hh,Uh,Wh=function(Ph){return Ph||={},this.isStrokeTransparent=Ph.isStrokeTransparent||!1,this.strokeOpacity=Ph.strokeOpacity||1,this.strokeStyle=Ph.strokeStyle||`#000000`,this.fillStyle=Ph.fillStyle||`#000000`,this.isFillTransparent=Ph.isFillTransparent||!1,this.fillOpacity=Ph.fillOpacity||1,this.font=Ph.font||`10px sans-serif`,this.textBaseline=Ph.textBaseline||`alphabetic`,this.textAlign=Ph.textAlign||`left`,this.lineWidth=Ph.lineWidth||1,this.lineJoin=Ph.lineJoin||`miter`,this.lineCap=Ph.lineCap||`butt`,this.path=Ph.path||[],this.transform=Ph.transform===void 0?new Hh:Ph.transform.clone(),this.globalCompositeOperation=Ph.globalCompositeOperation||`normal`,this.globalAlpha=Ph.globalAlpha||1,this.clip_path=Ph.clip_path||[],this.currentPoint=Ph.currentPoint||new Bh,this.miterLimit=Ph.miterLimit||10,this.lastPoint=Ph.lastPoint||new Bh,this.lineDashOffset=Ph.lineDashOffset||0,this.lineDash=Ph.lineDash||[],this.margin=Ph.margin||[0,0,0,0],this.prevPageLastElemOffset=Ph.prevPageLastElemOffset||0,this.ignoreClearRect=typeof Ph.ignoreClearRect!=`boolean`||Ph.ignoreClearRect,this};Ph.events.push([`initialized`,function(){this.context2d=new Gh(this),Fh=this.internal.f2,Ih=this.internal.getCoordinateString,Lh=this.internal.getVerticalCoordinateString,Rh=this.internal.getHorizontalCoordinate,zh=this.internal.getVerticalCoordinate,Bh=this.internal.Point,Vh=this.internal.Rectangle,Hh=this.internal.Matrix,Uh=new Wh}]);var Gh=function(Ph){Object.defineProperty(this,`canvas`,{get:function(){return{parentNode:!1,style:!1}}});var Fh=Ph;Object.defineProperty(this,`pdf`,{get:function(){return Fh}});var Ih=!1;Object.defineProperty(this,`pageWrapXEnabled`,{get:function(){return Ih},set:function(Ph){Ih=!!Ph}});var Lh=!1;Object.defineProperty(this,`pageWrapYEnabled`,{get:function(){return Lh},set:function(Ph){Lh=!!Ph}});var Rh=0;Object.defineProperty(this,`posX`,{get:function(){return Rh},set:function(Ph){isNaN(Ph)||(Rh=Ph)}});var zh=0;Object.defineProperty(this,`posY`,{get:function(){return zh},set:function(Ph){isNaN(Ph)||(zh=Ph)}}),Object.defineProperty(this,`margin`,{get:function(){return Uh.margin},set:function(Ph){var Fh;typeof Ph==`number`?Fh=[Ph,Ph,Ph,Ph]:((Fh=[,,,,])[0]=Ph[0],Fh[1]=Ph.length>=2?Ph[1]:Fh[0],Fh[2]=Ph.length>=3?Ph[2]:Fh[0],Fh[3]=Ph.length>=4?Ph[3]:Fh[1]),Uh.margin=Fh}});var Bh=!1;Object.defineProperty(this,`autoPaging`,{get:function(){return Bh},set:function(Ph){Bh=Ph}});var Vh=0;Object.defineProperty(this,`lastBreak`,{get:function(){return Vh},set:function(Ph){Vh=Ph}});var Hh=[];Object.defineProperty(this,`pageBreaks`,{get:function(){return Hh},set:function(Ph){Hh=Ph}}),Object.defineProperty(this,`ctx`,{get:function(){return Uh},set:function(Ph){Ph instanceof Wh&&(Uh=Ph)}}),Object.defineProperty(this,`path`,{get:function(){return Uh.path},set:function(Ph){Uh.path=Ph}});var Gh=[];Object.defineProperty(this,`ctxStack`,{get:function(){return Gh},set:function(Ph){Gh=Ph}}),Object.defineProperty(this,`fillStyle`,{get:function(){return this.ctx.fillStyle},set:function(Ph){var Fh=Kh(Ph);this.ctx.fillStyle=Fh.style,this.ctx.isFillTransparent=Fh.a===0,this.ctx.fillOpacity=Fh.a,this.pdf.setFillColor(Fh.r,Fh.g,Fh.b,{a:Fh.a}),this.pdf.setTextColor(Fh.r,Fh.g,Fh.b,{a:Fh.a})}}),Object.defineProperty(this,`strokeStyle`,{get:function(){return this.ctx.strokeStyle},set:function(Ph){var Fh=Kh(Ph);this.ctx.strokeStyle=Fh.style,this.ctx.isStrokeTransparent=Fh.a===0,this.ctx.strokeOpacity=Fh.a,Fh.a===0?this.pdf.setDrawColor(255,255,255):(Fh.a,this.pdf.setDrawColor(Fh.r,Fh.g,Fh.b))}}),Object.defineProperty(this,`lineCap`,{get:function(){return this.ctx.lineCap},set:function(Ph){[`butt`,`round`,`square`].indexOf(Ph)!==-1&&(this.ctx.lineCap=Ph,this.pdf.setLineCap(Ph))}}),Object.defineProperty(this,`lineWidth`,{get:function(){return this.ctx.lineWidth},set:function(Ph){isNaN(Ph)||(this.ctx.lineWidth=Ph,this.pdf.setLineWidth(Ph))}}),Object.defineProperty(this,`lineJoin`,{get:function(){return this.ctx.lineJoin},set:function(Ph){[`bevel`,`round`,`miter`].indexOf(Ph)!==-1&&(this.ctx.lineJoin=Ph,this.pdf.setLineJoin(Ph))}}),Object.defineProperty(this,`miterLimit`,{get:function(){return this.ctx.miterLimit},set:function(Ph){isNaN(Ph)||(this.ctx.miterLimit=Ph,this.pdf.setMiterLimit(Ph))}}),Object.defineProperty(this,`textBaseline`,{get:function(){return this.ctx.textBaseline},set:function(Ph){this.ctx.textBaseline=Ph}}),Object.defineProperty(this,`textAlign`,{get:function(){return this.ctx.textAlign},set:function(Ph){[`right`,`end`,`center`,`left`,`start`].indexOf(Ph)!==-1&&(this.ctx.textAlign=Ph)}});var qh=null,Jh=null,Yh=null;Object.defineProperty(this,`fontFaces`,{get:function(){return Yh},set:function(Ph){qh=null,Jh=null,Yh=Ph}}),Object.defineProperty(this,`font`,{get:function(){return this.ctx.font},set:function(Ph){var Fh;if(this.ctx.font=Ph,(Fh=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(Ph))!==null){var Ih=Fh[1];Fh[2];var Lh=Fh[3],Rh=Fh[4];Fh[5];var zh=Fh[6],Bh=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Rh)[2];Rh=Math.floor(Bh===`px`?parseFloat(Rh)*this.pdf.internal.scaleFactor:Bh===`em`?parseFloat(Rh)*this.pdf.getFontSize():parseFloat(Rh)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Rh);var Vh=function(Ph){var Fh,Ih,Lh=[],Rh=Ph.trim();if(Rh===``)return Qs$1;if(Rh in Hs$1)return[Hs$1[Rh]];for(;Rh!==``;){switch(Ih=null,Fh=(Rh=Ws$1(Rh)).charAt(0)){case`"`:case`'`:Ih=Gs$1(Rh.substring(1),Fh);break;default:Ih=Ks$1(Rh)}if(Ih===null||(Lh.push(Ih[0]),(Rh=Ws$1(Ih[1]))!==``&&Rh.charAt(0)!==`,`))return Qs$1;Rh=Rh.replace(/^,/,``)}return Lh}(zh);if(this.fontFaces){var Hh=function(Ph,Fh,Ih){for(var Lh=(Ih||={}).defaultFontFamily||`times`,Rh=Object.assign({},Vs$1,Ih.genericFontFamilies||{}),zh=null,Bh=null,Vh=0;Vh<Fh.length;++Vh)if(Rh[(zh=zs$1(Fh[Vh])).family]&&(zh.family=Rh[zh.family]),Ph.hasOwnProperty(zh.family)){Bh=Ph[zh.family];break}if(!(Bh||=Ph[Lh]))throw Error(`Could not find a font-family for the rule '`+Us$1(zh)+`' and default family '`+Lh+`'.`);if(Bh=function(Ph,Fh){if(Fh[Ph])return Fh[Ph];var Ih=Is$1[Ph],Lh=Bs$1(Fh,Fs$1,Ih,Ih<=Is$1.normal?-1:1);if(!Lh)throw Error(`Could not find a matching font-stretch value for `+Ph);return Lh}(zh.stretch,Bh),Bh=function(Ph,Fh){if(Fh[Ph])return Fh[Ph];for(var Ih=Ps$1[Ph],Lh=0;Lh<Ih.length;++Lh)if(Fh[Ih[Lh]])return Fh[Ih[Lh]];throw Error(`Could not find a matching font-style for `+Ph)}(zh.style,Bh),!(Bh=function(Ph,Fh){if(Fh[Ph])return Fh[Ph];if(Ph===400&&Fh[500])return Fh[500];if(Ph===500&&Fh[400])return Fh[400];var Ih=Rs$1[Ph],Lh=Bs$1(Fh,Ls$1,Ih,Ph<400?-1:1);if(!Lh)throw Error(`Could not find a matching font-weight for value `+Ph);return Lh}(zh.weight,Bh)))throw Error(`Failed to resolve a font for the rule '`+Us$1(zh)+`'.`);return Bh}(function(Ph,Fh){var Ih=Ph.getFontList(),Lh=JSON.stringify(Ih);return(qh===null||Jh!==Lh)&&(qh=function(Ph){for(var Fh={},Ih=0;Ih<Ph.length;++Ih){var Lh=zs$1(Ph[Ih]),Rh=Lh.family,zh=Lh.stretch,Bh=Lh.style,Vh=Lh.weight;Fh[Rh]=Fh[Rh]||{},Fh[Rh][zh]=Fh[Rh][zh]||{},Fh[Rh][zh][Bh]=Fh[Rh][zh][Bh]||{},Fh[Rh][zh][Bh][Vh]=Lh}return Fh}(function(Ph){var Fh=[];return Object.keys(Ph).forEach(function(Ih){Ph[Ih].forEach(function(Ph){var Lh=null;switch(Ph){case`bold`:Lh={family:Ih,weight:`bold`};break;case`italic`:Lh={family:Ih,style:`italic`};break;case`bolditalic`:Lh={family:Ih,weight:`bold`,style:`italic`};break;case``:case`normal`:Lh={family:Ih}}Lh!==null&&(Lh.ref={name:Ih,style:Ph},Fh.push(Lh))})}),Fh}(Ih).concat(Fh)),Jh=Lh),qh}(this.pdf,this.fontFaces),Vh.map(function(Ph){return{family:Ph,stretch:`normal`,weight:Lh,style:Ih}}));this.pdf.setFont(Hh.ref.name,Hh.ref.style)}else{var Uh=``;(Lh===`bold`||parseInt(Lh,10)>=700||Ih===`bold`)&&(Uh=`bold`),Ih===`italic`&&(Uh+=`italic`),Uh.length===0&&(Uh=`normal`);for(var Wh=``,Gh={arial:`Helvetica`,Arial:`Helvetica`,verdana:`Helvetica`,Verdana:`Helvetica`,helvetica:`Helvetica`,Helvetica:`Helvetica`,"sans-serif":`Helvetica`,fixed:`Courier`,monospace:`Courier`,terminal:`Courier`,cursive:`Times`,fantasy:`Times`,serif:`Times`},Kh=0;Kh<Vh.length;Kh++){if(this.pdf.internal.getFont(Vh[Kh],Uh,{noFallback:!0,disableWarning:!0})!==void 0){Wh=Vh[Kh];break}if(Uh===`bolditalic`&&this.pdf.internal.getFont(Vh[Kh],`bold`,{noFallback:!0,disableWarning:!0})!==void 0)Wh=Vh[Kh],Uh=`bold`;else if(this.pdf.internal.getFont(Vh[Kh],`normal`,{noFallback:!0,disableWarning:!0})!==void 0){Wh=Vh[Kh],Uh=`normal`;break}}if(Wh===``){for(var Yh=0;Yh<Vh.length;Yh++)if(Gh[Vh[Yh]]){Wh=Gh[Vh[Yh]];break}}Wh=Wh===``?`Times`:Wh,this.pdf.setFont(Wh,Uh)}}}}),Object.defineProperty(this,`globalCompositeOperation`,{get:function(){return this.ctx.globalCompositeOperation},set:function(Ph){this.ctx.globalCompositeOperation=Ph}}),Object.defineProperty(this,`globalAlpha`,{get:function(){return this.ctx.globalAlpha},set:function(Ph){this.ctx.globalAlpha=Ph}}),Object.defineProperty(this,`lineDashOffset`,{get:function(){return this.ctx.lineDashOffset},set:function(Ph){this.ctx.lineDashOffset=Ph,_g.call(this)}}),Object.defineProperty(this,`lineDash`,{get:function(){return this.ctx.lineDash},set:function(Ph){this.ctx.lineDash=Ph,_g.call(this)}}),Object.defineProperty(this,`ignoreClearRect`,{get:function(){return this.ctx.ignoreClearRect},set:function(Ph){this.ctx.ignoreClearRect=!!Ph}})};Gh.prototype.setLineDash=function(Ph){this.lineDash=Ph},Gh.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},Gh.prototype.fill=function(){eg.call(this,`fill`,!1)},Gh.prototype.stroke=function(){eg.call(this,`stroke`,!1)},Gh.prototype.beginPath=function(){this.path=[{type:`begin`}]},Gh.prototype.moveTo=function(Ph,Fh){if(isNaN(Ph)||isNaN(Fh))throw go$1.error(`jsPDF.context2d.moveTo: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.moveTo`);var Ih=this.ctx.transform.applyToPoint(new Bh(Ph,Fh));this.path.push({type:`mt`,x:Ih.x,y:Ih.y}),this.ctx.lastPoint=new Bh(Ph,Fh)},Gh.prototype.closePath=function(){var Ph=new Bh(0,0),Fh=0;for(Fh=this.path.length-1;Fh!==-1;Fh--)if(this.path[Fh].type===`begin`&&e$4(this.path[Fh+1])===`object`&&typeof this.path[Fh+1].x==`number`){Ph=new Bh(this.path[Fh+1].x,this.path[Fh+1].y);break}this.path.push({type:`close`}),this.ctx.lastPoint=new Bh(Ph.x,Ph.y)},Gh.prototype.lineTo=function(Ph,Fh){if(isNaN(Ph)||isNaN(Fh))throw go$1.error(`jsPDF.context2d.lineTo: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.lineTo`);var Ih=this.ctx.transform.applyToPoint(new Bh(Ph,Fh));this.path.push({type:`lt`,x:Ih.x,y:Ih.y}),this.ctx.lastPoint=new Bh(Ih.x,Ih.y)},Gh.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),eg.call(this,null,!0)},Gh.prototype.quadraticCurveTo=function(Ph,Fh,Ih,Lh){if(isNaN(Ih)||isNaN(Lh)||isNaN(Ph)||isNaN(Fh))throw go$1.error(`jsPDF.context2d.quadraticCurveTo: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.quadraticCurveTo`);var Rh=this.ctx.transform.applyToPoint(new Bh(Ih,Lh)),zh=this.ctx.transform.applyToPoint(new Bh(Ph,Fh));this.path.push({type:`qct`,x1:zh.x,y1:zh.y,x:Rh.x,y:Rh.y}),this.ctx.lastPoint=new Bh(Rh.x,Rh.y)},Gh.prototype.bezierCurveTo=function(Ph,Fh,Ih,Lh,Rh,zh){if(isNaN(Rh)||isNaN(zh)||isNaN(Ph)||isNaN(Fh)||isNaN(Ih)||isNaN(Lh))throw go$1.error(`jsPDF.context2d.bezierCurveTo: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.bezierCurveTo`);var Vh=this.ctx.transform.applyToPoint(new Bh(Rh,zh)),Hh=this.ctx.transform.applyToPoint(new Bh(Ph,Fh)),Uh=this.ctx.transform.applyToPoint(new Bh(Ih,Lh));this.path.push({type:`bct`,x1:Hh.x,y1:Hh.y,x2:Uh.x,y2:Uh.y,x:Vh.x,y:Vh.y}),this.ctx.lastPoint=new Bh(Vh.x,Vh.y)},Gh.prototype.arc=function(Ph,Fh,Ih,Lh,Rh,zh){if(isNaN(Ph)||isNaN(Fh)||isNaN(Ih)||isNaN(Lh)||isNaN(Rh))throw go$1.error(`jsPDF.context2d.arc: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.arc`);if(zh=!!zh,!this.ctx.transform.isIdentity){var Vh=this.ctx.transform.applyToPoint(new Bh(Ph,Fh));Ph=Vh.x,Fh=Vh.y;var Hh=this.ctx.transform.applyToPoint(new Bh(0,Ih)),Uh=this.ctx.transform.applyToPoint(new Bh(0,0));Ih=Math.sqrt((Hh.x-Uh.x)**2+(Hh.y-Uh.y)**2)}Math.abs(Rh-Lh)>=2*Math.PI&&(Lh=0,Rh=2*Math.PI),this.path.push({type:`arc`,x:Ph,y:Fh,radius:Ih,startAngle:Lh,endAngle:Rh,counterclockwise:zh})},Gh.prototype.arcTo=function(Ph,Fh,Ih,Lh,Rh){throw Error(`arcTo not implemented.`)},Gh.prototype.rect=function(Ph,Fh,Ih,Lh){if(isNaN(Ph)||isNaN(Fh)||isNaN(Ih)||isNaN(Lh))throw go$1.error(`jsPDF.context2d.rect: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.rect`);this.moveTo(Ph,Fh),this.lineTo(Ph+Ih,Fh),this.lineTo(Ph+Ih,Fh+Lh),this.lineTo(Ph,Fh+Lh),this.lineTo(Ph,Fh),this.lineTo(Ph+Ih,Fh),this.lineTo(Ph,Fh)},Gh.prototype.fillRect=function(Ph,Fh,Ih,Lh){if(isNaN(Ph)||isNaN(Fh)||isNaN(Ih)||isNaN(Lh))throw go$1.error(`jsPDF.context2d.fillRect: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.fillRect`);if(!qh.call(this)){var Rh={};this.lineCap!==`butt`&&(Rh.lineCap=this.lineCap,this.lineCap=`butt`),this.lineJoin!==`miter`&&(Rh.lineJoin=this.lineJoin,this.lineJoin=`miter`),this.beginPath(),this.rect(Ph,Fh,Ih,Lh),this.fill(),Rh.hasOwnProperty(`lineCap`)&&(this.lineCap=Rh.lineCap),Rh.hasOwnProperty(`lineJoin`)&&(this.lineJoin=Rh.lineJoin)}},Gh.prototype.strokeRect=function(Ph,Fh,Ih,Lh){if(isNaN(Ph)||isNaN(Fh)||isNaN(Ih)||isNaN(Lh))throw go$1.error(`jsPDF.context2d.strokeRect: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.strokeRect`);Jh.call(this)||(this.beginPath(),this.rect(Ph,Fh,Ih,Lh),this.stroke())},Gh.prototype.clearRect=function(Ph,Fh,Ih,Lh){if(isNaN(Ph)||isNaN(Fh)||isNaN(Ih)||isNaN(Lh))throw go$1.error(`jsPDF.context2d.clearRect: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.clearRect`);this.ignoreClearRect||(this.fillStyle=`#ffffff`,this.fillRect(Ph,Fh,Ih,Lh))},Gh.prototype.save=function(Ph){Ph=typeof Ph!=`boolean`||Ph;for(var Fh=this.pdf.internal.getCurrentPageInfo().pageNumber,Ih=0;Ih<this.pdf.internal.getNumberOfPages();Ih++)this.pdf.setPage(Ih+1),this.pdf.internal.out(`q`);if(this.pdf.setPage(Fh),Ph){this.ctx.fontSize=this.pdf.internal.getFontSize();var Lh=new Wh(this.ctx);this.ctxStack.push(this.ctx),this.ctx=Lh}},Gh.prototype.restore=function(Ph){Ph=typeof Ph!=`boolean`||Ph;for(var Fh=this.pdf.internal.getCurrentPageInfo().pageNumber,Ih=0;Ih<this.pdf.internal.getNumberOfPages();Ih++)this.pdf.setPage(Ih+1),this.pdf.internal.out(`Q`);this.pdf.setPage(Fh),Ph&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},Gh.prototype.toDataURL=function(){throw Error(`toDataUrl not implemented.`)};var Kh=function(Ph){var Fh,Ih,Lh,Rh;if(!0===Ph.isCanvasGradient&&(Ph=Ph.getColor()),!Ph)return{r:0,g:0,b:0,a:0,style:Ph};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(Ph))Fh=0,Ih=0,Lh=0,Rh=0;else{var zh=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(Ph);if(zh!==null)Fh=parseInt(zh[1]),Ih=parseInt(zh[2]),Lh=parseInt(zh[3]),Rh=1;else if((zh=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(Ph))!==null)Fh=parseInt(zh[1]),Ih=parseInt(zh[2]),Lh=parseInt(zh[3]),Rh=parseFloat(zh[4]);else{if(Rh=1,typeof Ph==`string`&&Ph.charAt(0)!==`#`){var Bh=new xo$1(Ph);Ph=Bh.ok?Bh.toHex():`#000000`}Ph.length===4?(Fh=Ph.substring(1,2),Fh+=Fh,Ih=Ph.substring(2,3),Ih+=Ih,Lh=Ph.substring(3,4),Lh+=Lh):(Fh=Ph.substring(1,3),Ih=Ph.substring(3,5),Lh=Ph.substring(5,7)),Fh=parseInt(Fh,16),Ih=parseInt(Ih,16),Lh=parseInt(Lh,16)}}return{r:Fh,g:Ih,b:Lh,a:Rh,style:Ph}},qh=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},Jh=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};Gh.prototype.fillText=function(Ph,Fh,Ih,Lh){if(isNaN(Fh)||isNaN(Ih)||typeof Ph!=`string`)throw go$1.error(`jsPDF.context2d.fillText: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.fillText`);if(Lh=isNaN(Lh)?void 0:Lh,!qh.call(this)){var Rh=mg(this.ctx.transform.rotation),zh=this.ctx.transform.scaleX;cg.call(this,{text:Ph,x:Fh,y:Ih,scale:zh,angle:Rh,align:this.textAlign,maxWidth:Lh})}},Gh.prototype.strokeText=function(Ph,Fh,Ih,Lh){if(isNaN(Fh)||isNaN(Ih)||typeof Ph!=`string`)throw go$1.error(`jsPDF.context2d.strokeText: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.strokeText`);if(!Jh.call(this)){Lh=isNaN(Lh)?void 0:Lh;var Rh=mg(this.ctx.transform.rotation),zh=this.ctx.transform.scaleX;cg.call(this,{text:Ph,x:Fh,y:Ih,scale:zh,renderingMode:`stroke`,angle:Rh,align:this.textAlign,maxWidth:Lh})}},Gh.prototype.measureText=function(Ph){if(typeof Ph!=`string`)throw go$1.error(`jsPDF.context2d.measureText: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.measureText`);var Fh=this.pdf,Ih=this.pdf.internal.scaleFactor,Lh=Fh.internal.getFontSize(),Rh=Fh.getStringUnitWidth(Ph)*Lh/Fh.internal.scaleFactor;return new function(Ph){var Fh=(Ph||={}).width||0;return Object.defineProperty(this,`width`,{get:function(){return Fh}}),this}({width:Rh*=Math.round(96*Ih/72*1e4)/1e4})},Gh.prototype.scale=function(Ph,Fh){if(isNaN(Ph)||isNaN(Fh))throw go$1.error(`jsPDF.context2d.scale: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.scale`);var Ih=new Hh(Ph,0,0,Fh,0,0);this.ctx.transform=this.ctx.transform.multiply(Ih)},Gh.prototype.rotate=function(Ph){if(isNaN(Ph))throw go$1.error(`jsPDF.context2d.rotate: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.rotate`);var Fh=new Hh(Math.cos(Ph),Math.sin(Ph),-Math.sin(Ph),Math.cos(Ph),0,0);this.ctx.transform=this.ctx.transform.multiply(Fh)},Gh.prototype.translate=function(Ph,Fh){if(isNaN(Ph)||isNaN(Fh))throw go$1.error(`jsPDF.context2d.translate: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.translate`);var Ih=new Hh(1,0,0,1,Ph,Fh);this.ctx.transform=this.ctx.transform.multiply(Ih)},Gh.prototype.transform=function(Ph,Fh,Ih,Lh,Rh,zh){if(isNaN(Ph)||isNaN(Fh)||isNaN(Ih)||isNaN(Lh)||isNaN(Rh)||isNaN(zh))throw go$1.error(`jsPDF.context2d.transform: Invalid arguments`,arguments),Error(`Invalid arguments passed to jsPDF.context2d.transform`);var Bh=new Hh(Ph,Fh,Ih,Lh,Rh,zh);this.ctx.transform=this.ctx.transform.multiply(Bh)},Gh.prototype.setTransform=function(Ph,Fh,Ih,Lh,Rh,zh){Ph=isNaN(Ph)?1:Ph,Fh=isNaN(Fh)?0:Fh,Ih=isNaN(Ih)?0:Ih,Lh=isNaN(Lh)?1:Lh,Rh=isNaN(Rh)?0:Rh,zh=isNaN(zh)?0:zh,this.ctx.transform=new Hh(Ph,Fh,Ih,Lh,Rh,zh)};var Yh=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};Gh.prototype.drawImage=function(Ph,Fh,Ih,Lh,Rh,zh,Bh,Uh,Wh){var Gh=this.pdf.getImageProperties(Ph),Kh=1,qh=1,Jh=1,Zh=1;Lh!==void 0&&Uh!==void 0&&(Jh=Uh/Lh,Zh=Wh/Rh,Kh=Gh.width/Lh*Uh/Lh,qh=Gh.height/Rh*Wh/Rh),zh===void 0&&(zh=Fh,Bh=Ih,Fh=0,Ih=0),Lh!==void 0&&Uh===void 0&&(Uh=Lh,Wh=Rh),Lh===void 0&&Uh===void 0&&(Uh=Gh.width,Wh=Gh.height);var eg=this.ctx.transform.decompose(),ng=mg(eg.rotate.shx),rg=new Hh,ig=(rg=(rg=(rg=rg.multiply(eg.translate)).multiply(eg.skew)).multiply(eg.scale)).applyToRectangle(new Vh(zh-Fh*Jh,Bh-Ih*Zh,Lh*Kh,Rh*qh));if(this.autoPaging){for(var ag,og=Xh.call(this,ig),sg=[],cg=0;cg<og.length;cg+=1)sg.indexOf(og[cg])===-1&&sg.push(og[cg]);$h(sg);for(var lg=sg[0],ug=sg[sg.length-1],dg=lg;dg<ug+1;dg++){this.pdf.setPage(dg);var fg=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],pg=dg===1?this.posY+this.margin[0]:this.margin[0],hg=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],gg=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],_g=dg===1?0:hg+(dg-2)*gg;if(this.ctx.clip_path.length!==0){var vg=this.path;ag=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=Qh(ag,this.posX+this.margin[3],-_g+pg+this.ctx.prevPageLastElemOffset),tg.call(this,`fill`,!0),this.path=vg}var yg=JSON.parse(JSON.stringify(ig));yg=Qh([yg],this.posX+this.margin[3],-_g+pg+this.ctx.prevPageLastElemOffset)[0];var bg=(dg>lg||dg<ug)&&Yh.call(this);bg&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],fg,gg,null).clip().discardPath()),this.pdf.addImage(Ph,`JPEG`,yg.x,yg.y,yg.w,yg.h,null,null,ng),bg&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(Ph,`JPEG`,ig.x,ig.y,ig.w,ig.h,null,null,ng)};var Xh=function(Ph,Fh,Ih){var Lh=[];Fh||=this.pdf.internal.pageSize.width,Ih||=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var Rh=this.posY+this.ctx.prevPageLastElemOffset;switch(Ph.type){default:case`mt`:case`lt`:Lh.push(Math.floor((Ph.y+Rh)/Ih)+1);break;case`arc`:Lh.push(Math.floor((Ph.y+Rh-Ph.radius)/Ih)+1),Lh.push(Math.floor((Ph.y+Rh+Ph.radius)/Ih)+1);break;case`qct`:var zh=hg(this.ctx.lastPoint.x,this.ctx.lastPoint.y,Ph.x1,Ph.y1,Ph.x,Ph.y);Lh.push(Math.floor((zh.y+Rh)/Ih)+1),Lh.push(Math.floor((zh.y+zh.h+Rh)/Ih)+1);break;case`bct`:var Bh=gg(this.ctx.lastPoint.x,this.ctx.lastPoint.y,Ph.x1,Ph.y1,Ph.x2,Ph.y2,Ph.x,Ph.y);Lh.push(Math.floor((Bh.y+Rh)/Ih)+1),Lh.push(Math.floor((Bh.y+Bh.h+Rh)/Ih)+1);break;case`rect`:Lh.push(Math.floor((Ph.y+Rh)/Ih)+1),Lh.push(Math.floor((Ph.y+Ph.h+Rh)/Ih)+1)}for(var Vh=0;Vh<Lh.length;Vh+=1)for(;this.pdf.internal.getNumberOfPages()<Lh[Vh];)Zh.call(this);return Lh},Zh=function(){var Ph=this.fillStyle,Fh=this.strokeStyle,Ih=this.font,Lh=this.lineCap,Rh=this.lineWidth,zh=this.lineJoin;this.pdf.addPage(),this.fillStyle=Ph,this.strokeStyle=Fh,this.font=Ih,this.lineCap=Lh,this.lineWidth=Rh,this.lineJoin=zh},Qh=function(Ph,Fh,Ih){for(var Lh=0;Lh<Ph.length;Lh++)switch(Ph[Lh].type){case`bct`:Ph[Lh].x2+=Fh,Ph[Lh].y2+=Ih;case`qct`:Ph[Lh].x1+=Fh,Ph[Lh].y1+=Ih;default:Ph[Lh].x+=Fh,Ph[Lh].y+=Ih}return Ph},$h=function(Ph){return Ph.sort(function(Ph,Fh){return Ph-Fh})},eg=function(Ph,Fh){var Ih=this.fillStyle,Lh=this.strokeStyle,Rh=this.lineCap,zh=this.lineWidth,Bh=Math.abs(zh*this.ctx.transform.scaleX),Vh=this.lineJoin;if(this.autoPaging){for(var Hh,Uh,Wh=JSON.parse(JSON.stringify(this.path)),Gh=JSON.parse(JSON.stringify(this.path)),Kh=[],qh=0;qh<Gh.length;qh++)if(Gh[qh].x!==void 0)for(var Jh=Xh.call(this,Gh[qh]),eg=0;eg<Jh.length;eg+=1)Kh.indexOf(Jh[eg])===-1&&Kh.push(Jh[eg]);for(var ng=0;ng<Kh.length;ng++)for(;this.pdf.internal.getNumberOfPages()<Kh[ng];)Zh.call(this);$h(Kh);for(var rg=Kh[0],ig=Kh[Kh.length-1],ag=rg;ag<ig+1;ag++){this.pdf.setPage(ag),this.fillStyle=Ih,this.strokeStyle=Lh,this.lineCap=Rh,this.lineWidth=Bh,this.lineJoin=Vh;var og=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],sg=ag===1?this.posY+this.margin[0]:this.margin[0],cg=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],lg=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],ug=ag===1?0:cg+(ag-2)*lg;if(this.ctx.clip_path.length!==0){var dg=this.path;Hh=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=Qh(Hh,this.posX+this.margin[3],-ug+sg+this.ctx.prevPageLastElemOffset),tg.call(this,Ph,!0),this.path=dg}if(Uh=JSON.parse(JSON.stringify(Wh)),this.path=Qh(Uh,this.posX+this.margin[3],-ug+sg+this.ctx.prevPageLastElemOffset),!1===Fh||ag===0){var fg=(ag>rg||ag<ig)&&Yh.call(this);fg&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],og,lg,null).clip().discardPath()),tg.call(this,Ph,Fh),fg&&this.pdf.restoreGraphicsState()}this.lineWidth=zh}this.path=Wh}else this.lineWidth=Bh,tg.call(this,Ph,Fh),this.lineWidth=zh},tg=function(Ph,Fh){if((Ph!==`stroke`||Fh||!Jh.call(this))&&(Ph===`stroke`||Fh||!qh.call(this))){for(var Ih,Lh,Rh=[],zh=this.path,Bh=0;Bh<zh.length;Bh++){var Vh=zh[Bh];switch(Vh.type){case`begin`:Rh.push({begin:!0});break;case`close`:Rh.push({close:!0});break;case`mt`:Rh.push({start:Vh,deltas:[],abs:[]});break;case`lt`:var Hh=Rh.length;if(zh[Bh-1]&&!isNaN(zh[Bh-1].x)&&(Ih=[Vh.x-zh[Bh-1].x,Vh.y-zh[Bh-1].y],Hh>0)){for(;Hh>=0;Hh--)if(!0!==Rh[Hh-1].close&&!0!==Rh[Hh-1].begin){Rh[Hh-1].deltas.push(Ih),Rh[Hh-1].abs.push(Vh);break}}break;case`bct`:Ih=[Vh.x1-zh[Bh-1].x,Vh.y1-zh[Bh-1].y,Vh.x2-zh[Bh-1].x,Vh.y2-zh[Bh-1].y,Vh.x-zh[Bh-1].x,Vh.y-zh[Bh-1].y],Rh[Rh.length-1].deltas.push(Ih);break;case`qct`:var Uh=zh[Bh-1].x+2/3*(Vh.x1-zh[Bh-1].x),Wh=zh[Bh-1].y+2/3*(Vh.y1-zh[Bh-1].y),Gh=Vh.x+2/3*(Vh.x1-Vh.x),Kh=Vh.y+2/3*(Vh.y1-Vh.y),Yh=Vh.x,Xh=Vh.y;Ih=[Uh-zh[Bh-1].x,Wh-zh[Bh-1].y,Gh-zh[Bh-1].x,Kh-zh[Bh-1].y,Yh-zh[Bh-1].x,Xh-zh[Bh-1].y],Rh[Rh.length-1].deltas.push(Ih);break;case`arc`:Rh.push({deltas:[],abs:[],arc:!0}),Array.isArray(Rh[Rh.length-1].abs)&&Rh[Rh.length-1].abs.push(Vh)}}Lh=Fh?null:Ph===`stroke`?`stroke`:`fill`;for(var Zh=!1,Qh=0;Qh<Rh.length;Qh++)if(Rh[Qh].arc)for(var $h=Rh[Qh].abs,eg=0;eg<$h.length;eg++){var tg=$h[eg];tg.type===`arc`?ig.call(this,tg.x,tg.y,tg.radius,tg.startAngle,tg.endAngle,tg.counterclockwise,void 0,Fh,!Zh):lg.call(this,tg.x,tg.y),Zh=!0}else if(!0===Rh[Qh].close)this.pdf.internal.out(`h`),Zh=!1;else if(!0!==Rh[Qh].begin){var ng=Rh[Qh].start.x,rg=Rh[Qh].start.y;ug.call(this,Rh[Qh].deltas,ng,rg),Zh=!0}Lh&&ag.call(this,Lh),Fh&&og.call(this)}},ng=function(Ph){var Fh=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,Ih=Fh*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case`bottom`:return Ph-Ih;case`top`:return Ph+Fh-Ih;case`hanging`:return Ph+Fh-2*Ih;case`middle`:return Ph+Fh/2-Ih;default:return Ph}},rg=function(Ph){return Ph+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};Gh.prototype.createLinearGradient=function(){var Ph=function(){};return Ph.colorStops=[],Ph.addColorStop=function(Ph,Fh){this.colorStops.push([Ph,Fh])},Ph.getColor=function(){return this.colorStops.length===0?`#000000`:this.colorStops[0][1]},Ph.isCanvasGradient=!0,Ph},Gh.prototype.createPattern=function(){return this.createLinearGradient()},Gh.prototype.createRadialGradient=function(){return this.createLinearGradient()};var ig=function(Ph,Fh,Ih,Lh,Rh,zh,Bh,Vh,Hh){for(var Uh=fg.call(this,Ih,Lh,Rh,zh),Wh=0;Wh<Uh.length;Wh++){var Gh=Uh[Wh];Wh===0&&(Hh?sg.call(this,Gh.x1+Ph,Gh.y1+Fh):lg.call(this,Gh.x1+Ph,Gh.y1+Fh)),dg.call(this,Ph,Fh,Gh.x2,Gh.y2,Gh.x3,Gh.y3,Gh.x4,Gh.y4)}Vh?og.call(this):ag.call(this,Bh)},ag=function(Ph){switch(Ph){case`stroke`:this.pdf.internal.out(`S`);break;case`fill`:this.pdf.internal.out(`f`)}},og=function(){this.pdf.clip(),this.pdf.discardPath()},sg=function(Ph,Fh){this.pdf.internal.out(Ih(Ph)+` `+Lh(Fh)+` m`)},cg=function(Ph){var Fh;switch(Ph.align){case`right`:case`end`:Fh=`right`;break;case`center`:Fh=`center`;break;default:Fh=`left`}var Ih,Lh,Rh,zh=this.pdf.getTextDimensions(Ph.text),Uh=ng.call(this,Ph.y),Wh=rg.call(this,Uh)-zh.h,Gh=this.ctx.transform.applyToPoint(new Bh(Ph.x,Uh));if(this.autoPaging){var Kh=this.ctx.transform.decompose(),qh=new Hh;qh=(qh=(qh=qh.multiply(Kh.translate)).multiply(Kh.skew)).multiply(Kh.scale);for(var Jh=this.ctx.transform.applyToRectangle(new Vh(Ph.x,Uh,zh.w,zh.h)),Zh=qh.applyToRectangle(new Vh(Ph.x,Wh,zh.w,zh.h)),eg=Xh.call(this,Zh),ig=[],ag=0;ag<eg.length;ag+=1)ig.indexOf(eg[ag])===-1&&ig.push(eg[ag]);$h(ig);for(var og=ig[0],sg=ig[ig.length-1],cg=og;cg<sg+1;cg++){this.pdf.setPage(cg);var lg=cg===1?this.posY+this.margin[0]:this.margin[0],ug=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],dg=this.pdf.internal.pageSize.height-this.margin[2],fg=dg-this.margin[0],pg=this.pdf.internal.pageSize.width-this.margin[1],mg=pg-this.margin[3],hg=cg===1?0:ug+(cg-2)*fg;if(this.ctx.clip_path.length!==0){var gg=this.path;Ih=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=Qh(Ih,this.posX+this.margin[3],-1*hg+lg),tg.call(this,`fill`,!0),this.path=gg}var _g=Qh([JSON.parse(JSON.stringify(Zh))],this.posX+this.margin[3],-hg+lg+this.ctx.prevPageLastElemOffset)[0];Ph.scale>=.01&&(Lh=this.pdf.internal.getFontSize(),this.pdf.setFontSize(Lh*Ph.scale),Rh=this.lineWidth,this.lineWidth=Rh*Ph.scale);var vg=this.autoPaging!==`text`;if(vg||_g.y+_g.h<=dg){if(vg||_g.y>=lg&&_g.x<=pg){var yg=vg?Ph.text:this.pdf.splitTextToSize(Ph.text,Ph.maxWidth||pg-_g.x)[0],bg=Qh([JSON.parse(JSON.stringify(Jh))],this.posX+this.margin[3],-hg+lg+this.ctx.prevPageLastElemOffset)[0],xg=vg&&(cg>og||cg<sg)&&Yh.call(this);xg&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],mg,fg,null).clip().discardPath()),this.pdf.text(yg,bg.x,bg.y,{angle:Ph.angle,align:Fh,renderingMode:Ph.renderingMode}),xg&&this.pdf.restoreGraphicsState()}}else _g.y<dg&&(this.ctx.prevPageLastElemOffset+=dg-_g.y);Ph.scale>=.01&&(this.pdf.setFontSize(Lh),this.lineWidth=Rh)}}else Ph.scale>=.01&&(Lh=this.pdf.internal.getFontSize(),this.pdf.setFontSize(Lh*Ph.scale),Rh=this.lineWidth,this.lineWidth=Rh*Ph.scale),this.pdf.text(Ph.text,Gh.x+this.posX,Gh.y+this.posY,{angle:Ph.angle,align:Fh,renderingMode:Ph.renderingMode,maxWidth:Ph.maxWidth}),Ph.scale>=.01&&(this.pdf.setFontSize(Lh),this.lineWidth=Rh)},lg=function(Ph,Fh,Rh,zh){Rh||=0,zh||=0,this.pdf.internal.out(Ih(Ph+Rh)+` `+Lh(Fh+zh)+` l`)},ug=function(Ph,Fh,Ih){return this.pdf.lines(Ph,Fh,Ih,null,null)},dg=function(Ph,Ih,Lh,Bh,Vh,Hh,Uh,Wh){this.pdf.internal.out([Fh(Rh(Lh+Ph)),Fh(zh(Bh+Ih)),Fh(Rh(Vh+Ph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h,Xh,Zh,Qh,$h,eg,tg,ng,rg=Ih-Ph,ig=Lh-Fh,ag=Rh-Ih,og=zh-Lh,sg=Bh-Rh,cg=Hh-zh;for(Wh=0;Wh<41;Wh++)Zh=(Yh=(Gh=Ph+(Uh=Wh/40)*rg)+Uh*((qh=Ih+Uh*ag)-Gh))+Uh*(qh+Uh*(Rh+Uh*sg-qh)-Yh),Qh=(Xh=(Kh=Fh+Uh*ig)+Uh*((Jh=Lh+Uh*og)-Kh))+Uh*(Jh+Uh*(zh+Uh*cg-Jh)-Xh),Wh==0?($h=Zh,eg=Qh,tg=Zh,ng=Qh):($h=Math.min($h,Zh),eg=Math.min(eg,Qh),tg=Math.max(tg,Zh),ng=Math.max(ng,Qh));return new Vh(Math.round($h),Math.round(eg),Math.round(tg-$h),Math.round(ng-eg))},_g=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var Ph,Fh,Ih=(Ph=this.ctx.lineDash,Fh=this.ctx.lineDashOffset,JSON.stringify({lineDash:Ph,lineDashOffset:Fh}));this.prevLineDash!==Ih&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=Ih)}}})(Z$3.API),function(Ph){var Fh=function(Ph){var Fh,Ih,Lh,Rh,zh,Bh,Vh,Hh,Uh,Wh;for(/[^\x00-\xFF]/.test(Ph),Ih=[],Lh=0,Rh=(Ph+=Fh=`\0\0\0\0`.slice(Ph.length%4||4)).length;Rh>Lh;Lh+=4)(zh=(Ph.charCodeAt(Lh)<<24)+(Ph.charCodeAt(Lh+1)<<16)+(Ph.charCodeAt(Lh+2)<<8)+Ph.charCodeAt(Lh+3))===0?Ih.push(122):(Bh=(zh=((zh=((zh=((zh=(zh-(Wh=zh%85))/85)-(Uh=zh%85))/85)-(Hh=zh%85))/85)-(Vh=zh%85))/85)%85,Ih.push(Bh+33,Vh+33,Hh+33,Uh+33,Wh+33));return function(Ph,Fh){for(var Ih=Fh;Ih>0;Ih--)Ph.pop()}(Ih,Fh.length),String.fromCharCode.apply(String,Ih)+`~>`},Ih=function(Ph){var Fh,Ih,Lh,Rh,zh,Bh=String,Vh=`length`,Hh=255,Uh=`charCodeAt`,Wh=`slice`,Gh=`replace`;for(Ph[Wh](-2),Ph=Ph[Wh](0,-2)[Gh](/\s/g,``)[Gh](`z`,`!!!!!`),Lh=[],Rh=0,zh=(Ph+=Fh=`uuuuu`[Wh](Ph[Vh]%5||5))[Vh];zh>Rh;Rh+=5)Ih=52200625*(Ph[Uh](Rh)-33)+614125*(Ph[Uh](Rh+1)-33)+7225*(Ph[Uh](Rh+2)-33)+85*(Ph[Uh](Rh+3)-33)+(Ph[Uh](Rh+4)-33),Lh.push(Hh&Ih>>24,Hh&Ih>>16,Hh&Ih>>8,Hh&Ih);return function(Ph,Fh){for(var Ih=Fh;Ih>0;Ih--)Ph.pop()}(Lh,Fh[Vh]),Bh.fromCharCode.apply(Bh,Lh)},Lh=function(Ph){return Ph.split(``).map(function(Ph){return(`0`+Ph.charCodeAt().toString(16)).slice(-2)}).join(``)+`>`},Rh=function(Ph){var Fh=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((Ph=Ph.replace(/\s/g,``)).indexOf(`>`)!==-1&&(Ph=Ph.substr(0,Ph.indexOf(`>`))),Ph.length%2&&(Ph+=`0`),!1===Fh.test(Ph))return``;for(var Ih=``,Lh=0;Lh<Ph.length;Lh+=2)Ih+=String.fromCharCode(`0x`+(Ph[Lh]+Ph[Lh+1]));return Ih},zh=function(Ph){for(var Fh=new Uint8Array(Ph.length),Ih=Ph.length;Ih--;)Fh[Ih]=Ph.charCodeAt(Ih);return(Fh=me$3(Fh)).reduce(function(Ph,Fh){return Ph+String.fromCharCode(Fh)},``)};Ph.processDataByFilters=function(Ph,Bh){var Vh=0,Hh=Ph||``,Uh=[];for(typeof(Bh||=[])==`string`&&(Bh=[Bh]),Vh=0;Vh<Bh.length;Vh+=1)switch(Bh[Vh]){case`ASCII85Decode`:case`/ASCII85Decode`:Hh=Ih(Hh),Uh.push(`/ASCII85Encode`);break;case`ASCII85Encode`:case`/ASCII85Encode`:Hh=Fh(Hh),Uh.push(`/ASCII85Decode`);break;case`ASCIIHexDecode`:case`/ASCIIHexDecode`:Hh=Rh(Hh),Uh.push(`/ASCIIHexEncode`);break;case`ASCIIHexEncode`:case`/ASCIIHexEncode`:Hh=Lh(Hh),Uh.push(`/ASCIIHexDecode`);break;case`FlateEncode`:case`/FlateEncode`:Hh=zh(Hh),Uh.push(`/FlateDecode`);break;default:throw Error(`The filter: "`+Bh[Vh]+`" is not implemented`)}return{data:Hh,reverseChain:Uh.reverse().join(` `)}}}(Z$3.API),function(Ph){Ph.loadFile=function(Ph,Fh,Ih){return function(Ph,Fh,Ih){Fh=!1!==Fh,Ih=typeof Ih==`function`?Ih:function(){};var Lh=void 0;try{Lh=function(Ph,Fh,Ih){var Lh=new XMLHttpRequest,Rh=0,zh=function(Ph){var Fh=Ph.length,Ih=[],Lh=String.fromCharCode;for(Rh=0;Rh<Fh;Rh+=1)Ih.push(Lh(255&Ph.charCodeAt(Rh)));return Ih.join(``)};if(Lh.open(`GET`,Ph,!Fh),Lh.overrideMimeType(`text/plain; charset=x-user-defined`),!1===Fh&&(Lh.onload=function(){Lh.status===200?Ih(zh(this.responseText)):Ih(void 0)}),Lh.send(null),Fh&&Lh.status===200)return zh(Lh.responseText)}(Ph,Fh,Ih)}catch{}return Lh}(Ph,Fh,Ih)},Ph.allowFsRead=void 0,Ph.loadImageFile=Ph.loadFile}(Z$3.API),function(Ph){function Fh(){return(X$3.html2canvas?Promise.resolve(X$3.html2canvas):__vitePreload(()=>import(`./html2canvas-Cx501zZr-Bug0qRNv.js`).then(Ph=>c$2(Ph.default)),[])).catch(function(Ph){return Promise.reject(Error(`Could not load html2canvas: `+Ph))}).then(function(Ph){return Ph.default?Ph.default:Ph})}function Ih(){return(X$3.DOMPurify?Promise.resolve(X$3.DOMPurify):__vitePreload(()=>import(`./purify.es-Fx1Nqyry-BwJECkqS.js`),[])).catch(function(Ph){return Promise.reject(Error(`Could not load dompurify: `+Ph))}).then(function(Ph){return Ph.default?Ph.default:Ph})}var Lh=function(Ph){var Fh=e$4(Ph);return Fh===`undefined`?`undefined`:Fh===`string`||Ph instanceof String?`string`:Fh===`number`||Ph instanceof Number?`number`:Fh===`function`||Ph instanceof Function?`function`:Ph&&Ph.constructor===Array?`array`:Ph&&Ph.nodeType===1?`element`:Fh===`object`?`object`:`unknown`},Rh=function(Ph,Fh){var Ih=document.createElement(Ph);for(var Lh in Fh.className&&(Ih.className=Fh.className),Fh.innerHTML&&Fh.dompurify&&(Ih.innerHTML=Fh.dompurify.sanitize(Fh.innerHTML)),Fh.style)Ih.style[Lh]=Fh.style[Lh];return Ih},zh=function Ph(Fh,Ih){for(var Lh=Fh.nodeType===3?document.createTextNode(Fh.nodeValue):Fh.cloneNode(!1),Rh=Fh.firstChild;Rh;Rh=Rh.nextSibling)!0!==Ih&&Rh.nodeType===1&&Rh.nodeName===`SCRIPT`||Lh.appendChild(Ph(Rh,Ih));return Fh.nodeType===1&&(Fh.nodeName===`CANVAS`?(Lh.width=Fh.width,Lh.height=Fh.height,Lh.getContext(`2d`).drawImage(Fh,0,0)):Fh.nodeName!==`TEXTAREA`&&Fh.nodeName!==`SELECT`||(Lh.value=Fh.value),Lh.addEventListener(`load`,function(){Lh.scrollTop=Fh.scrollTop,Lh.scrollLeft=Fh.scrollLeft},!0)),Lh},Bh=function Ph(Fh){var Ih=Object.assign(Ph.convert(Promise.resolve()),JSON.parse(JSON.stringify(Ph.template))),Lh=Ph.convert(Promise.resolve(),Ih);return(Lh=Lh.setProgress(1,Ph,1,[Ph])).set(Fh)};(Bh.prototype=Object.create(Promise.prototype)).constructor=Bh,Bh.convert=function(Ph,Fh){return Ph.__proto__=Fh||Bh.prototype,Ph},Bh.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:`file.pdf`,margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:`transparent`}},Bh.prototype.from=function(Ph,Fh){return this.then(function(){switch(Fh||=function(Ph){switch(Lh(Ph)){case`string`:return`string`;case`element`:return Ph.nodeName.toLowerCase()===`canvas`?`canvas`:`element`;default:return`unknown`}}(Ph),Fh){case`string`:return this.then(Ih).then(function(Fh){return this.set({src:Rh(`div`,{innerHTML:Ph,dompurify:Fh})})});case`element`:return this.set({src:Ph});case`canvas`:return this.set({canvas:Ph});case`img`:return this.set({img:Ph});default:return this.error(`Unknown source type.`)}})},Bh.prototype.to=function(Ph){switch(Ph){case`container`:return this.toContainer();case`canvas`:return this.toCanvas();case`img`:return this.toImg();case`pdf`:return this.toPdf();default:return this.error(`Invalid target.`)}},Bh.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error(`Cannot duplicate - no source HTML.`)},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var Ph={position:`relative`,display:`inline-block`,width:(typeof this.opt.width!=`number`||isNaN(this.opt.width)||typeof this.opt.windowWidth!=`number`||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+`px`,left:0,right:0,top:0,margin:`auto`,backgroundColor:this.opt.backgroundColor},Fh=zh(this.prop.src,this.opt.html2canvas.javascriptEnabled);Fh.tagName===`BODY`&&(Ph.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+`px`),this.prop.overlay=Rh(`div`,{className:`html2pdf__overlay`,style:{position:`fixed`,overflow:`hidden`,zIndex:1e3,left:`-100000px`,right:0,bottom:0,top:0}}),this.prop.container=Rh(`div`,{className:`html2pdf__container`,style:Ph}),this.prop.container.appendChild(Fh),this.prop.container.firstChild.appendChild(Rh(`div`,{style:{clear:`both`,border:`0 none transparent`,margin:0,padding:0,height:0}})),this.prop.container.style.float=`none`,this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position=`relative`,this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+`px`})},Bh.prototype.toCanvas=function(){return this.thenList([function(){return document.body.contains(this.prop.container)||this.toContainer()}]).then(Fh).then(function(Ph){var Fh=Object.assign({},this.opt.html2canvas);return delete Fh.onrendered,Ph(this.prop.container,Fh)}).then(function(Ph){(this.opt.html2canvas.onrendered||function(){})(Ph),this.prop.canvas=Ph,document.body.removeChild(this.prop.overlay)})},Bh.prototype.toContext2d=function(){return this.thenList([function(){return document.body.contains(this.prop.container)||this.toContainer()}]).then(Fh).then(function(Ph){var Fh=this.opt.jsPDF,Ih=this.opt.fontFaces,Lh=typeof this.opt.width!=`number`||isNaN(this.opt.width)||typeof this.opt.windowWidth!=`number`||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,Rh=Object.assign({async:!0,allowTaint:!0,scale:Lh,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:`#ffffff`,imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete Rh.onrendered,Fh.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,Fh.context2d.posX=this.opt.x,Fh.context2d.posY=this.opt.y,Fh.context2d.margin=this.opt.margin,Fh.context2d.fontFaces=Ih,Ih)for(var zh=0;zh<Ih.length;++zh){var Bh=Ih[zh],Vh=Bh.src.find(function(Ph){return Ph.format===`truetype`});Vh&&Fh.addFont(Vh.url,Bh.ref.name,Bh.ref.style)}return Rh.windowHeight=Rh.windowHeight||0,Rh.windowHeight=Rh.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):Rh.windowHeight,Fh.context2d.save(!0),Ph(this.prop.container,Rh)}).then(function(Ph){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(Ph),this.prop.canvas=Ph,document.body.removeChild(this.prop.overlay)})},Bh.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var Ph=this.prop.canvas.toDataURL(`image/`+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement(`img`),this.prop.img.src=Ph})},Bh.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},Bh.prototype.output=function(Ph,Fh,Ih){return(Ih||=`pdf`).toLowerCase()===`img`||Ih.toLowerCase()===`image`?this.outputImg(Ph,Fh):this.outputPdf(Ph,Fh)},Bh.prototype.outputPdf=function(Ph,Fh){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(Ph,Fh)})},Bh.prototype.outputImg=function(Ph){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(Ph){case void 0:case`img`:return this.prop.img;case`datauristring`:case`dataurlstring`:return this.prop.img.src;case`datauri`:case`dataurl`:return document.location.href=this.prop.img.src;default:throw`Image output type "`+Ph+`" is not supported.`}})},Bh.prototype.save=function(Ph){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(Ph?{filename:Ph}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},Bh.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},Bh.prototype.set=function(Ph){if(Lh(Ph)!==`object`)return this;var Fh=Object.keys(Ph||{}).map(function(Fh){if(Fh in Bh.template.prop)return function(){this.prop[Fh]=Ph[Fh]};switch(Fh){case`margin`:return this.setMargin.bind(this,Ph.margin);case`jsPDF`:return function(){return this.opt.jsPDF=Ph.jsPDF,this.setPageSize()};case`pageSize`:return this.setPageSize.bind(this,Ph.pageSize);default:return function(){this.opt[Fh]=Ph[Fh]}}},this);return this.then(function(){return this.thenList(Fh)})},Bh.prototype.get=function(Ph,Fh){return this.then(function(){var Ih=Ph in Bh.template.prop?this.prop[Ph]:this.opt[Ph];return Fh?Fh(Ih):Ih})},Bh.prototype.setMargin=function(Ph){return this.then(function(){switch(Lh(Ph)){case`number`:Ph=[Ph,Ph,Ph,Ph];case`array`:if(Ph.length===2&&(Ph=[Ph[0],Ph[1],Ph[0],Ph[1]]),Ph.length===4)break;default:return this.error(`Invalid margin array.`)}this.opt.margin=Ph}).then(this.setPageSize)},Bh.prototype.setPageSize=function(Ph){function Fh(Ph,Fh){return Math.floor(Ph*Fh/72*96)}return this.then(function(){(Ph||=Z$3.getPageSize(this.opt.jsPDF)).hasOwnProperty(`inner`)||(Ph.inner={width:Ph.width-this.opt.margin[1]-this.opt.margin[3],height:Ph.height-this.opt.margin[0]-this.opt.margin[2]},Ph.inner.px={width:Fh(Ph.inner.width,Ph.k),height:Fh(Ph.inner.height,Ph.k)},Ph.inner.ratio=Ph.inner.height/Ph.inner.width),this.prop.pageSize=Ph})},Bh.prototype.setProgress=function(Ph,Fh,Ih,Lh){return Ph!=null&&(this.progress.val=Ph),Fh!=null&&(this.progress.state=Fh),Ih!=null&&(this.progress.n=Ih),Lh!=null&&(this.progress.stack=Lh),this.progress.ratio=this.progress.val/this.progress.state,this},Bh.prototype.updateProgress=function(Ph,Fh,Ih,Lh){return this.setProgress(Ph?this.progress.val+Ph:null,Fh||null,Ih?this.progress.n+Ih:null,Lh?this.progress.stack.concat(Lh):null)},Bh.prototype.then=function(Ph,Fh){var Ih=this;return this.thenCore(Ph,Fh,function(Ph,Fh){return Ih.updateProgress(null,null,1,[Ph]),Promise.prototype.then.call(this,function(Fh){return Ih.updateProgress(null,Ph),Fh}).then(Ph,Fh).then(function(Ph){return Ih.updateProgress(1),Ph})})},Bh.prototype.thenCore=function(Ph,Fh,Ih){Ih||=Promise.prototype.then;var Lh=this;Ph&&=Ph.bind(Lh),Fh&&=Fh.bind(Lh);var Rh=Promise.toString().indexOf(`[native code]`)!==-1&&Promise.name===`Promise`?Lh:Bh.convert(Object.assign({},Lh),Promise.prototype),zh=Ih.call(Rh,Ph,Fh);return Bh.convert(zh,Lh.__proto__)},Bh.prototype.thenExternal=function(Ph,Fh){return Promise.prototype.then.call(this,Ph,Fh)},Bh.prototype.thenList=function(Ph){var Fh=this;return Ph.forEach(function(Ph){Fh=Fh.thenCore(Ph)}),Fh},Bh.prototype.catch=function(Ph){Ph&&=Ph.bind(this);var Fh=Promise.prototype.catch.call(this,Ph);return Bh.convert(Fh,this)},Bh.prototype.catchExternal=function(Ph){return Promise.prototype.catch.call(this,Ph)},Bh.prototype.error=function(Ph){return this.then(function(){throw Error(Ph)})},Bh.prototype.using=Bh.prototype.set,Bh.prototype.saveAs=Bh.prototype.save,Bh.prototype.export=Bh.prototype.output,Bh.prototype.run=Bh.prototype.then,Z$3.getPageSize=function(Ph,Fh,Ih){if(e$4(Ph)===`object`){var Lh=Ph;Ph=Lh.orientation,Fh=Lh.unit||Fh,Ih=Lh.format||Ih}Fh||=`mm`,Ih||=`a4`,Ph=(``+(Ph||`P`)).toLowerCase();var Rh,zh=(``+Ih).toLowerCase(),Bh={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(Fh){case`pt`:Rh=1;break;case`mm`:Rh=72/25.4;break;case`cm`:Rh=72/2.54;break;case`in`:Rh=72;break;case`px`:Rh=.75;break;case`pc`:case`em`:Rh=12;break;case`ex`:Rh=6;break;default:throw`Invalid unit: `+Fh}var Vh,Hh=0,Uh=0;if(Bh.hasOwnProperty(zh))Hh=Bh[zh][1]/Rh,Uh=Bh[zh][0]/Rh;else try{Hh=Ih[1],Uh=Ih[0]}catch{throw Error(`Invalid format: `+Ih)}if(Ph===`p`||Ph===`portrait`)Ph=`p`,Uh>Hh&&(Vh=Uh,Uh=Hh,Hh=Vh);else{if(Ph!==`l`&&Ph!==`landscape`)throw`Invalid orientation: `+Ph;Ph=`l`,Hh>Uh&&(Vh=Uh,Uh=Hh,Hh=Vh)}return{width:Uh,height:Hh,unit:Fh,k:Rh,orientation:Ph}},Ph.html=function(Ph,Fh){(Fh||={}).callback=Fh.callback||function(){},Fh.html2canvas=Fh.html2canvas||{},Fh.html2canvas.canvas=Fh.html2canvas.canvas||this.canvas,Fh.jsPDF=Fh.jsPDF||this,Fh.fontFaces=Fh.fontFaces?Fh.fontFaces.map(zs$1):null;var Ih=new Bh(Fh);return Fh.worker?Ih:Ih.from(Ph).doCallback()}}(Z$3.API),Z$3.API.addJS=function(Ph){var Fh,Ih,Lh=function(Ph){for(var Fh=``,Ih=0;Ih<Ph.length;Ih++){var Lh=Ph[Ih];if(Lh===`(`||Lh===`)`){for(var Rh=0,zh=Ih-1;zh>=0&&Ph[zh]===`\\`;zh--)Rh++;Fh+=Rh%2==0?`\\`+Lh:Lh}else Fh+=Lh}return Fh}(Ph);return this.internal.events.subscribe(`postPutResources`,function(){Fh=this.internal.newObject(),this.internal.out(`<<`),this.internal.out(`/Names [(EmbeddedJS) `+(Fh+1)+` 0 R]`),this.internal.out(`>>`),this.internal.out(`endobj`),Ih=this.internal.newObject(),this.internal.out(`<<`),this.internal.out(`/S /JavaScript`),this.internal.out(`/JS (`+Lh+`)`),this.internal.out(`>>`),this.internal.out(`endobj`)}),this.internal.events.subscribe(`putCatalog`,function(){Fh!==void 0&&Ih!==void 0&&this.internal.out(`/Names <</JavaScript `+Fh+` 0 R>>`)}),this},function(Ph){var Fh;Ph.events.push([`postPutResources`,function(){var Ph=this,Ih=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var Lh=Ph.outline.render().split(/\r\n/),Rh=0;Rh<Lh.length;Rh++){var zh=Lh[Rh],Bh=Ih.exec(zh);if(Bh!=null){var Vh=Bh[1];Ph.internal.newObjectDeferredBegin(Vh,!1)}Ph.internal.write(zh)}if(this.outline.createNamedDestinations){var Hh=this.internal.pages.length,Uh=[];for(Rh=0;Rh<Hh;Rh++){var Wh=Ph.internal.newObject();Uh.push(Wh);var Gh=Ph.internal.getPageInfo(Rh+1);Ph.internal.write(`<< /D[`+Gh.objId+` 0 R /XYZ null null null]>> endobj`)}var Kh=Ph.internal.newObject();for(Ph.internal.write(`<< /Names [ `),Rh=0;Rh<Uh.length;Rh++)Ph.internal.write(`(page_`+(Rh+1)+`)`+Uh[Rh]+` 0 R`);Ph.internal.write(` ] >>`,`endobj`),Fh=Ph.internal.newObject(),Ph.internal.write(`<< /Dests `+Kh+` 0 R`),Ph.internal.write(`>>`,`endobj`)}}]),Ph.events.push([`putCatalog`,function(){var Ph=this;Ph.outline.root.children.length>0&&(Ph.internal.write(`/Outlines`,this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&Ph.internal.write(`/Names `+Fh+` 0 R`))}]),Ph.events.push([`initialized`,function(){var Ph=this;Ph.outline={createNamedDestinations:!1,root:{children:[]}},Ph.outline.add=function(Ph,Fh,Ih){var Lh={title:Fh,options:Ih,children:[]};return Ph??=this.root,Ph.children.push(Lh),Lh},Ph.outline.render=function(){return this.ctx={},this.ctx.val=``,this.ctx.pdf=Ph,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},Ph.outline.genIds_r=function(Fh){Fh.id=Ph.internal.newObjectDeferred();for(var Ih=0;Ih<Fh.children.length;Ih++)this.genIds_r(Fh.children[Ih])},Ph.outline.renderRoot=function(Ph){this.objStart(Ph),this.line(`/Type /Outlines`),Ph.children.length>0&&(this.line(`/First `+this.makeRef(Ph.children[0])),this.line(`/Last `+this.makeRef(Ph.children[Ph.children.length-1]))),this.line(`/Count `+this.count_r({count:0},Ph)),this.objEnd()},Ph.outline.renderItems=function(Fh){for(var Ih=this.ctx.pdf.internal.getVerticalCoordinateString,Lh=0;Lh<Fh.children.length;Lh++){var Rh=Fh.children[Lh];this.objStart(Rh),this.line(`/Title `+this.makeString(Rh.title)),this.line(`/Parent `+this.makeRef(Fh)),Lh>0&&this.line(`/Prev `+this.makeRef(Fh.children[Lh-1])),Lh<Fh.children.length-1&&this.line(`/Next `+this.makeRef(Fh.children[Lh+1])),Rh.children.length>0&&(this.line(`/First `+this.makeRef(Rh.children[0])),this.line(`/Last `+this.makeRef(Rh.children[Rh.children.length-1])));var zh=this.count=this.count_r({count:0},Rh);if(zh>0&&this.line(`/Count `+zh),Rh.options&&Rh.options.pageNumber){var Bh=Ph.internal.getPageInfo(Rh.options.pageNumber);this.line(`/Dest [`+Bh.objId+` 0 R /XYZ 0 `+Ih(0)+` 0]`)}this.objEnd()}for(var Vh=0;Vh<Fh.children.length;Vh++)this.renderItems(Fh.children[Vh])},Ph.outline.line=function(Ph){this.ctx.val+=Ph+`\r
|
|
288
288
|
`},Ph.outline.makeRef=function(Ph){return Ph.id+` 0 R`},Ph.outline.makeString=function(Fh){return`(`+Ph.internal.pdfEscape(Fh)+`)`},Ph.outline.objStart=function(Ph){this.ctx.val+=`\r
|
|
289
289
|
`+Ph.id+` 0 obj\r
|
|
290
290
|
<<\r
|
|
@@ -292,7 +292,7 @@ T* `):Ph.join(` Tj
|
|
|
292
292
|
endobj\r
|
|
293
293
|
`},Ph.outline.count_r=function(Ph,Fh){for(var Ih=0;Ih<Fh.children.length;Ih++)Ph.count++,this.count_r(Ph,Fh.children[Ih]);return Ph.count}}])}(Z$3.API),function(Ph){var Fh=[192,193,194,195,196,197,198,199];Ph.processJPEG=function(Ph,Ih,Lh,Rh,zh,Bh){var Vh,Hh=this.decode.DCT_DECODE,Uh=null;if(typeof Ph==`string`||this.__addimage__.isArrayBuffer(Ph)||this.__addimage__.isArrayBufferView(Ph)){switch(Ph=zh||Ph,Ph=this.__addimage__.isArrayBuffer(Ph)?new Uint8Array(Ph):Ph,Vh=function(Ph){for(var Ih,Lh=256*Ph.charCodeAt(4)+Ph.charCodeAt(5),Rh=Ph.length,zh={width:0,height:0,numcomponents:1},Bh=4;Bh<Rh;Bh+=2){if(Bh+=Lh,Fh.indexOf(Ph.charCodeAt(Bh+1))!==-1){Ih=256*Ph.charCodeAt(Bh+5)+Ph.charCodeAt(Bh+6),zh={width:256*Ph.charCodeAt(Bh+7)+Ph.charCodeAt(Bh+8),height:Ih,numcomponents:Ph.charCodeAt(Bh+9)};break}Lh=256*Ph.charCodeAt(Bh+2)+Ph.charCodeAt(Bh+3)}return zh}(Ph=this.__addimage__.isArrayBufferView(Ph)?this.__addimage__.arrayBufferToBinaryString(Ph):Ph),Vh.numcomponents){case 1:Bh=this.color_spaces.DEVICE_GRAY;break;case 4:Bh=this.color_spaces.DEVICE_CMYK;break;case 3:Bh=this.color_spaces.DEVICE_RGB}Uh={data:Ph,width:Vh.width,height:Vh.height,colorSpace:Bh,bitsPerComponent:8,filter:Hh,index:Ih,alias:Lh}}return Uh}}(Z$3.API),Z$3.API.processPNG=function(Ph,Fh,Ih,Lh){if(this.__addimage__.isArrayBuffer(Ph)&&(Ph=new Uint8Array(Ph)),this.__addimage__.isArrayBufferView(Ph)){var Rh,zh=mo$1(Ph,{checkCrc:!0}),Bh=zh.width,Vh=zh.height,Hh=zh.channels,Uh=zh.palette,Wh=zh.depth;Rh=Uh&&Hh===1?function(Ph){for(var Fh=Ph.width,Ih=Ph.height,Lh=Ph.data,Rh=Ph.palette,zh=Ph.depth,Bh=!1,Vh=[],Hh=[],Uh=void 0,Wh=!1,Gh=0,Kh=0;Kh<Rh.length;Kh++){var qh=xe$3(Rh[Kh],4),Jh=qh[0],Yh=qh[1],Xh=qh[2],Zh=qh[3];Vh.push(Jh,Yh,Xh),Zh!=null&&(Zh===0?(Gh++,Hh.length<1&&Hh.push(Kh)):Zh<255&&(Wh=!0))}if(Wh||Gh>1){Bh=!0,Hh=void 0;var Qh=Fh*Ih;Uh=new Uint8Array(Qh);for(var $h=new DataView(Lh.buffer),eg=0;eg<Qh;eg++){var tg=xe$3(Rh[sc$1($h,eg,zh)],4)[3];Uh[eg]=tg}}else Gh===0&&(Hh=void 0);return{colorSpace:`Indexed`,colorsPerPixel:1,sMaskBitsPerComponent:Bh?8:void 0,colorBytes:Lh,alphaBytes:Uh,needSMask:Bh,palette:Vh,mask:Hh}}(zh):Hh===2||Hh===4?function(Ph){for(var Fh=Ph.data,Ih=Ph.width,Lh=Ph.height,Rh=Ph.channels,zh=Ph.depth,Bh=Rh===2?`DeviceGray`:`DeviceRGB`,Vh=Rh-1,Hh=Ih*Lh,Uh=Vh,Wh=Hh*Uh,Gh=1*Hh,Kh=Math.ceil(Wh*zh/8),qh=Math.ceil(Gh*zh/8),Jh=new Uint8Array(Kh),Yh=new Uint8Array(qh),Xh=new DataView(Fh.buffer),Zh=new DataView(Jh.buffer),Qh=new DataView(Yh.buffer),$h=!1,eg=0;eg<Hh;eg++){for(var tg=eg*Rh,ng=0;ng<Uh;ng++)cc$1(Zh,sc$1(Xh,tg+ng,zh),eg*Uh+ng,zh);var rg=sc$1(Xh,tg+Uh,zh);rg<(1<<zh)-1&&($h=!0),cc$1(Qh,rg,1*eg,zh)}return{colorSpace:Bh,colorsPerPixel:Vh,sMaskBitsPerComponent:$h?zh:void 0,colorBytes:Jh,alphaBytes:Yh,needSMask:$h}}(zh):function(Ph){var Fh=Ph.data,Ih=Ph.channels===1?`DeviceGray`:`DeviceRGB`;return{colorSpace:Ih,colorsPerPixel:Ih===`DeviceGray`?1:3,colorBytes:Fh instanceof Uint16Array?function(Ph){for(var Fh=Ph.length,Ih=new Uint8Array(2*Fh),Lh=new DataView(Ih.buffer,Ih.byteOffset,Ih.byteLength),Rh=0;Rh<Fh;Rh++)Lh.setUint16(2*Rh,Ph[Rh],!1);return Ih}(Fh):Fh,needSMask:!1}}(zh);var Gh,Kh,qh,Jh=Rh,Yh=Jh.colorSpace,Xh=Jh.colorsPerPixel,Zh=Jh.sMaskBitsPerComponent,Qh=Jh.colorBytes,$h=Jh.alphaBytes,eg=Jh.needSMask,tg=Jh.palette,ng=Jh.mask,rg=null;return Lh!==Z$3.API.image_compression.NONE&&typeof me$3==`function`?(rg=function(Ph){var Fh;switch(Ph){case Z$3.API.image_compression.FAST:Fh=11;break;case Z$3.API.image_compression.MEDIUM:Fh=13;break;case Z$3.API.image_compression.SLOW:Fh=14;break;default:Fh=12}return Fh}(Lh),Gh=this.decode.FLATE_DECODE,Kh=`/Predictor ${rg} /Colors ${Xh} /BitsPerComponent ${Wh} /Columns ${Bh}`,Ph=$s$1(Qh,Math.ceil(Bh*Xh*Wh/8),Xh,Wh,Lh),eg&&(qh=$s$1($h,Math.ceil(Bh*Zh/8),1,Zh,Lh))):(Gh=void 0,Kh=void 0,Ph=Qh,eg&&(qh=$h)),(this.__addimage__.isArrayBuffer(Ph)||this.__addimage__.isArrayBufferView(Ph))&&(Ph=this.__addimage__.arrayBufferToBinaryString(Ph)),(qh&&this.__addimage__.isArrayBuffer(qh)||this.__addimage__.isArrayBufferView(qh))&&(qh=this.__addimage__.arrayBufferToBinaryString(qh)),{alias:Ih,data:Ph,index:Fh,filter:Gh,decodeParameters:Kh,transparency:ng,palette:tg,sMask:qh,predictor:rg,width:Bh,height:Vh,bitsPerComponent:Wh,sMaskBitsPerComponent:Zh,colorSpace:Yh}}},function(Ph){Ph.processGIF89A=function(Fh,Ih,Lh,Rh){var zh=new uc$1(Fh),Bh=zh.width,Vh=zh.height,Hh=[];zh.decodeAndBlitFrameRGBA(0,Hh);var Uh={data:Hh,width:Bh,height:Vh},Wh=new fc$1(100).encode(Uh,100);return Ph.processJPEG.call(this,Wh,Ih,Lh,Rh)},Ph.processGIF87A=Ph.processGIF89A}(Z$3.API),pc$1.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var Ph=this.colors===0?1<<this.bitPP:this.colors;this.palette=Array(Ph);for(var Fh=0;Fh<Ph;Fh++){var Ih=this.datav.getUint8(this.pos++,!0),Lh=this.datav.getUint8(this.pos++,!0),Rh=this.datav.getUint8(this.pos++,!0),zh=this.datav.getUint8(this.pos++,!0);this.palette[Fh]={red:Rh,green:Lh,blue:Ih,quad:zh}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},pc$1.prototype.parseBGR=function(){this.pos=this.offset;var Ph=`bit`+this.bitPP,Fh=this.width*this.height*4;if(Fh>536870912)throw Error(`Image dimensions exceed 512MB, which is too large.`);this.data=new Uint8Array(Fh);try{this[Ph]()}catch(Ph){go$1.log(`bit decode error:`+Ph)}},pc$1.prototype.bit1=function(){var Ph,Fh=Math.ceil(this.width/8),Ih=Fh%4;for(Ph=this.height-1;Ph>=0;Ph--){for(var Lh=this.bottom_up?Ph:this.height-1-Ph,Rh=0;Rh<Fh;Rh++)for(var zh=this.datav.getUint8(this.pos++,!0),Bh=Lh*this.width*4+8*Rh*4,Vh=0;Vh<8&&8*Rh+Vh<this.width;Vh++){var Hh=this.palette[zh>>7-Vh&1];this.data[Bh+4*Vh]=Hh.blue,this.data[Bh+4*Vh+1]=Hh.green,this.data[Bh+4*Vh+2]=Hh.red,this.data[Bh+4*Vh+3]=255}Ih!==0&&(this.pos+=4-Ih)}},pc$1.prototype.bit4=function(){for(var Ph=Math.ceil(this.width/2),Fh=Ph%4,Ih=this.height-1;Ih>=0;Ih--){for(var Lh=this.bottom_up?Ih:this.height-1-Ih,Rh=0;Rh<Ph;Rh++){var zh=this.datav.getUint8(this.pos++,!0),Bh=Lh*this.width*4+2*Rh*4,Vh=zh>>4,Hh=15&zh,Uh=this.palette[Vh];if(this.data[Bh]=Uh.blue,this.data[Bh+1]=Uh.green,this.data[Bh+2]=Uh.red,this.data[Bh+3]=255,2*Rh+1>=this.width)break;Uh=this.palette[Hh],this.data[Bh+4]=Uh.blue,this.data[Bh+4+1]=Uh.green,this.data[Bh+4+2]=Uh.red,this.data[Bh+4+3]=255}Fh!==0&&(this.pos+=4-Fh)}},pc$1.prototype.bit8=function(){for(var Ph=this.width%4,Fh=this.height-1;Fh>=0;Fh--){for(var Ih=this.bottom_up?Fh:this.height-1-Fh,Lh=0;Lh<this.width;Lh++){var Rh=this.datav.getUint8(this.pos++,!0),zh=Ih*this.width*4+4*Lh;if(Rh<this.palette.length){var Bh=this.palette[Rh];this.data[zh]=Bh.red,this.data[zh+1]=Bh.green,this.data[zh+2]=Bh.blue,this.data[zh+3]=255}else this.data[zh]=255,this.data[zh+1]=255,this.data[zh+2]=255,this.data[zh+3]=255}Ph!==0&&(this.pos+=4-Ph)}},pc$1.prototype.bit15=function(){for(var Ph=this.width%3,Fh=31,Ih=this.height-1;Ih>=0;Ih--){for(var Lh=this.bottom_up?Ih:this.height-1-Ih,Rh=0;Rh<this.width;Rh++){var zh=this.datav.getUint16(this.pos,!0);this.pos+=2;var Bh=(zh&Fh)/Fh*255|0,Vh=(zh>>5&Fh)/Fh*255|0,Hh=(zh>>10&Fh)/Fh*255|0,Uh=zh>>15?255:0,Wh=Lh*this.width*4+4*Rh;this.data[Wh]=Hh,this.data[Wh+1]=Vh,this.data[Wh+2]=Bh,this.data[Wh+3]=Uh}this.pos+=Ph}},pc$1.prototype.bit16=function(){for(var Ph=this.width%3,Fh=31,Ih=63,Lh=this.height-1;Lh>=0;Lh--){for(var Rh=this.bottom_up?Lh:this.height-1-Lh,zh=0;zh<this.width;zh++){var Bh=this.datav.getUint16(this.pos,!0);this.pos+=2;var Vh=(Bh&Fh)/Fh*255|0,Hh=(Bh>>5&Ih)/Ih*255|0,Uh=(Bh>>11)/Fh*255|0,Wh=Rh*this.width*4+4*zh;this.data[Wh]=Uh,this.data[Wh+1]=Hh,this.data[Wh+2]=Vh,this.data[Wh+3]=255}this.pos+=Ph}},pc$1.prototype.bit24=function(){for(var Ph=this.height-1;Ph>=0;Ph--){for(var Fh=this.bottom_up?Ph:this.height-1-Ph,Ih=0;Ih<this.width;Ih++){var Lh=this.datav.getUint8(this.pos++,!0),Rh=this.datav.getUint8(this.pos++,!0),zh=this.datav.getUint8(this.pos++,!0),Bh=Fh*this.width*4+4*Ih;this.data[Bh]=zh,this.data[Bh+1]=Rh,this.data[Bh+2]=Lh,this.data[Bh+3]=255}this.pos+=this.width%4}},pc$1.prototype.bit32=function(){for(var Ph=this.height-1;Ph>=0;Ph--)for(var Fh=this.bottom_up?Ph:this.height-1-Ph,Ih=0;Ih<this.width;Ih++){var Lh=this.datav.getUint8(this.pos++,!0),Rh=this.datav.getUint8(this.pos++,!0),zh=this.datav.getUint8(this.pos++,!0),Bh=this.datav.getUint8(this.pos++,!0),Vh=Fh*this.width*4+4*Ih;this.data[Vh]=zh,this.data[Vh+1]=Rh,this.data[Vh+2]=Lh,this.data[Vh+3]=Bh}},pc$1.prototype.getData=function(){return this.data},function(Ph){Ph.processBMP=function(Fh,Ih,Lh,Rh){var zh=new pc$1(Fh,!1),Bh=zh.width,Vh=zh.height,Hh={data:zh.getData(),width:Bh,height:Vh},Uh=new fc$1(100).encode(Hh,100);return Ph.processJPEG.call(this,Uh,Ih,Lh,Rh)}}(Z$3.API),mc$1.prototype.getData=function(){return this.data},function(Ph){Ph.processWEBP=function(Fh,Ih,Lh,Rh){var zh=new mc$1(Fh),Bh=zh.width,Vh=zh.height,Hh={data:zh.getData(),width:Bh,height:Vh},Uh=new fc$1(100).encode(Hh,100);return Ph.processJPEG.call(this,Uh,Ih,Lh,Rh)}}(Z$3.API),Z$3.API.processRGBA=function(Ph,Fh,Ih){for(var Lh=Ph.data,Rh=Lh.length,zh=new Uint8Array(Rh/4*3),Bh=new Uint8Array(Rh/4),Vh=0,Hh=0,Uh=0;Uh<Rh;Uh+=4){var Wh=Lh[Uh],Gh=Lh[Uh+1],Kh=Lh[Uh+2],qh=Lh[Uh+3];zh[Vh++]=Wh,zh[Vh++]=Gh,zh[Vh++]=Kh,Bh[Hh++]=qh}var Jh=this.__addimage__.arrayBufferToBinaryString(zh);return{alpha:this.__addimage__.arrayBufferToBinaryString(Bh),data:Jh,index:Fh,alias:Ih,colorSpace:`DeviceRGB`,bitsPerComponent:8,width:Ph.width,height:Ph.height}},Z$3.API.setLanguage=function(Ph){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:`Afrikaans`,sq:`Albanian`,ar:`Arabic (Standard)`,"ar-DZ":`Arabic (Algeria)`,"ar-BH":`Arabic (Bahrain)`,"ar-EG":`Arabic (Egypt)`,"ar-IQ":`Arabic (Iraq)`,"ar-JO":`Arabic (Jordan)`,"ar-KW":`Arabic (Kuwait)`,"ar-LB":`Arabic (Lebanon)`,"ar-LY":`Arabic (Libya)`,"ar-MA":`Arabic (Morocco)`,"ar-OM":`Arabic (Oman)`,"ar-QA":`Arabic (Qatar)`,"ar-SA":`Arabic (Saudi Arabia)`,"ar-SY":`Arabic (Syria)`,"ar-TN":`Arabic (Tunisia)`,"ar-AE":`Arabic (U.A.E.)`,"ar-YE":`Arabic (Yemen)`,an:`Aragonese`,hy:`Armenian`,as:`Assamese`,ast:`Asturian`,az:`Azerbaijani`,eu:`Basque`,be:`Belarusian`,bn:`Bengali`,bs:`Bosnian`,br:`Breton`,bg:`Bulgarian`,my:`Burmese`,ca:`Catalan`,ch:`Chamorro`,ce:`Chechen`,zh:`Chinese`,"zh-HK":`Chinese (Hong Kong)`,"zh-CN":`Chinese (PRC)`,"zh-SG":`Chinese (Singapore)`,"zh-TW":`Chinese (Taiwan)`,cv:`Chuvash`,co:`Corsican`,cr:`Cree`,hr:`Croatian`,cs:`Czech`,da:`Danish`,nl:`Dutch (Standard)`,"nl-BE":`Dutch (Belgian)`,en:`English`,"en-AU":`English (Australia)`,"en-BZ":`English (Belize)`,"en-CA":`English (Canada)`,"en-IE":`English (Ireland)`,"en-JM":`English (Jamaica)`,"en-NZ":`English (New Zealand)`,"en-PH":`English (Philippines)`,"en-ZA":`English (South Africa)`,"en-TT":`English (Trinidad & Tobago)`,"en-GB":`English (United Kingdom)`,"en-US":`English (United States)`,"en-ZW":`English (Zimbabwe)`,eo:`Esperanto`,et:`Estonian`,fo:`Faeroese`,fj:`Fijian`,fi:`Finnish`,fr:`French (Standard)`,"fr-BE":`French (Belgium)`,"fr-CA":`French (Canada)`,"fr-FR":`French (France)`,"fr-LU":`French (Luxembourg)`,"fr-MC":`French (Monaco)`,"fr-CH":`French (Switzerland)`,fy:`Frisian`,fur:`Friulian`,gd:`Gaelic (Scots)`,"gd-IE":`Gaelic (Irish)`,gl:`Galacian`,ka:`Georgian`,de:`German (Standard)`,"de-AT":`German (Austria)`,"de-DE":`German (Germany)`,"de-LI":`German (Liechtenstein)`,"de-LU":`German (Luxembourg)`,"de-CH":`German (Switzerland)`,el:`Greek`,gu:`Gujurati`,ht:`Haitian`,he:`Hebrew`,hi:`Hindi`,hu:`Hungarian`,is:`Icelandic`,id:`Indonesian`,iu:`Inuktitut`,ga:`Irish`,it:`Italian (Standard)`,"it-CH":`Italian (Switzerland)`,ja:`Japanese`,kn:`Kannada`,ks:`Kashmiri`,kk:`Kazakh`,km:`Khmer`,ky:`Kirghiz`,tlh:`Klingon`,ko:`Korean`,"ko-KP":`Korean (North Korea)`,"ko-KR":`Korean (South Korea)`,la:`Latin`,lv:`Latvian`,lt:`Lithuanian`,lb:`Luxembourgish`,mk:`North Macedonia`,ms:`Malay`,ml:`Malayalam`,mt:`Maltese`,mi:`Maori`,mr:`Marathi`,mo:`Moldavian`,nv:`Navajo`,ng:`Ndonga`,ne:`Nepali`,no:`Norwegian`,nb:`Norwegian (Bokmal)`,nn:`Norwegian (Nynorsk)`,oc:`Occitan`,or:`Oriya`,om:`Oromo`,fa:`Persian`,"fa-IR":`Persian/Iran`,pl:`Polish`,pt:`Portuguese`,"pt-BR":`Portuguese (Brazil)`,pa:`Punjabi`,"pa-IN":`Punjabi (India)`,"pa-PK":`Punjabi (Pakistan)`,qu:`Quechua`,rm:`Rhaeto-Romanic`,ro:`Romanian`,"ro-MO":`Romanian (Moldavia)`,ru:`Russian`,"ru-MO":`Russian (Moldavia)`,sz:`Sami (Lappish)`,sg:`Sango`,sa:`Sanskrit`,sc:`Sardinian`,sd:`Sindhi`,si:`Singhalese`,sr:`Serbian`,sk:`Slovak`,sl:`Slovenian`,so:`Somani`,sb:`Sorbian`,es:`Spanish`,"es-AR":`Spanish (Argentina)`,"es-BO":`Spanish (Bolivia)`,"es-CL":`Spanish (Chile)`,"es-CO":`Spanish (Colombia)`,"es-CR":`Spanish (Costa Rica)`,"es-DO":`Spanish (Dominican Republic)`,"es-EC":`Spanish (Ecuador)`,"es-SV":`Spanish (El Salvador)`,"es-GT":`Spanish (Guatemala)`,"es-HN":`Spanish (Honduras)`,"es-MX":`Spanish (Mexico)`,"es-NI":`Spanish (Nicaragua)`,"es-PA":`Spanish (Panama)`,"es-PY":`Spanish (Paraguay)`,"es-PE":`Spanish (Peru)`,"es-PR":`Spanish (Puerto Rico)`,"es-ES":`Spanish (Spain)`,"es-UY":`Spanish (Uruguay)`,"es-VE":`Spanish (Venezuela)`,sx:`Sutu`,sw:`Swahili`,sv:`Swedish`,"sv-FI":`Swedish (Finland)`,"sv-SV":`Swedish (Sweden)`,ta:`Tamil`,tt:`Tatar`,te:`Teluga`,th:`Thai`,tig:`Tigre`,ts:`Tsonga`,tn:`Tswana`,tr:`Turkish`,tk:`Turkmen`,uk:`Ukrainian`,hsb:`Upper Sorbian`,ur:`Urdu`,ve:`Venda`,vi:`Vietnamese`,vo:`Volapuk`,wa:`Walloon`,cy:`Welsh`,xh:`Xhosa`,ji:`Yiddish`,zu:`Zulu`}[Ph]!==void 0&&(this.internal.languageSettings.languageCode=Ph,!1===this.internal.languageSettings.isSubscribed&&(this.internal.events.subscribe(`putCatalog`,function(){this.internal.write(`/Lang (`+this.internal.languageSettings.languageCode+`)`)}),this.internal.languageSettings.isSubscribed=!0)),this},qs$1=Z$3.API,Js$1=qs$1.getCharWidthsArray=function(Ph,Fh){var Ih,Lh,Rh=(Fh||={}).font||this.internal.getFont(),zh=Fh.fontSize||this.internal.getFontSize(),Bh=Fh.charSpace||this.internal.getCharSpace(),Vh=Fh.widths?Fh.widths:Rh.metadata.Unicode.widths,Hh=Vh.fof?Vh.fof:1,Uh=Fh.kerning?Fh.kerning:Rh.metadata.Unicode.kerning,Wh=Uh.fof?Uh.fof:1,Gh=!1!==Fh.doKerning,Kh=0,qh=Ph.length,Jh=0,Yh=Vh[0]||Hh,Xh=[];for(Ih=0;Ih<qh;Ih++)Lh=Ph.charCodeAt(Ih),typeof Rh.metadata.widthOfString==`function`?Xh.push((Rh.metadata.widthOfGlyph(Rh.metadata.characterToGlyph(Lh))+1e3/zh*Bh||0)/1e3):(Kh=Gh&&e$4(Uh[Lh])===`object`&&!isNaN(parseInt(Uh[Lh][Jh],10))?Uh[Lh][Jh]/Wh:0,Xh.push((Vh[Lh]||Yh)/Hh+Kh)),Jh=Lh;return Xh},Ys$1=qs$1.getStringUnitWidth=function(Ph,Fh){var Ih=(Fh||={}).fontSize||this.internal.getFontSize(),Lh=Fh.font||this.internal.getFont(),Rh=Fh.charSpace||this.internal.getCharSpace();return qs$1.processArabic&&(Ph=qs$1.processArabic(Ph)),typeof Lh.metadata.widthOfString==`function`?Lh.metadata.widthOfString(Ph,Ih,Rh)/Ih:Js$1.apply(this,arguments).reduce(function(Ph,Fh){return Ph+Fh},0)},Xs$1=function(Ph,Fh,Ih,Lh){for(var Rh=[],zh=0,Bh=Ph.length,Vh=0;zh!==Bh&&Vh+Fh[zh]<Ih;)Vh+=Fh[zh],zh++;Rh.push(Ph.slice(0,zh));var Hh=zh;for(Vh=0;zh!==Bh;)Vh+Fh[zh]>Lh&&(Rh.push(Ph.slice(Hh,zh)),Vh=0,Hh=zh),Vh+=Fh[zh],zh++;return Hh!==zh&&Rh.push(Ph.slice(Hh,zh)),Rh},Zs$1=function(Ph,Fh,Ih){Ih||={};var Lh,Rh,zh,Bh,Vh,Hh,Uh,Wh=[],Gh=[Wh],Kh=Ih.textIndent||0,qh=0,Jh=0,Yh=Ph.split(` `),Xh=Js$1.apply(this,[` `,Ih])[0];if(Hh=Ih.lineIndent===-1?Yh[0].length+2:Ih.lineIndent||0){var Zh=Array(Hh).join(` `),Qh=[];Yh.map(function(Ph){(Ph=Ph.split(/\s*\n/)).length>1?Qh=Qh.concat(Ph.map(function(Ph,Fh){return(Fh&&Ph.length?`
|
|
294
294
|
`:``)+Ph})):Qh.push(Ph[0])}),Yh=Qh,Hh=Ys$1.apply(this,[Zh,Ih])}for(zh=0,Bh=Yh.length;zh<Bh;zh++){var $h=0;if(Lh=Yh[zh],Hh&&Lh[0]==`
|
|
295
|
-
`&&(Lh=Lh.substr(1),$h=1),Kh+qh+(Jh=(Rh=Js$1.apply(this,[Lh,Ih])).reduce(function(Ph,Fh){return Ph+Fh},0))>Fh||$h){if(Jh>Fh){for(Vh=Xs$1.apply(this,[Lh,Rh,Fh-(Kh+qh),Fh]),Wh.push(Vh.shift()),Wh=[Vh.pop()];Vh.length;)Gh.push([Vh.shift()]);Jh=Rh.slice(Lh.length-(Wh[0]?Wh[0].length:0)).reduce(function(Ph,Fh){return Ph+Fh},0)}else Wh=[Lh];Gh.push(Wh),Kh=Jh+Hh,qh=Xh}else Wh.push(Lh),Kh+=qh+Jh,qh=Xh}return Uh=Hh?function(Ph,Fh){return(Fh?Zh:``)+Ph.join(` `)}:function(Ph){return Ph.join(` `)},Gh.map(Uh)},qs$1.splitTextToSize=function(Ph,Fh,Ih){var Lh,Rh=(Ih||={}).fontSize||this.internal.getFontSize(),zh=function(Ph){if(Ph.widths&&Ph.kerning)return{widths:Ph.widths,kerning:Ph.kerning};var Fh=this.internal.getFont(Ph.fontName,Ph.fontStyle),Ih=`Unicode`;return Fh.metadata[Ih]?{widths:Fh.metadata[Ih].widths||{0:1},kerning:Fh.metadata[Ih].kerning||{}}:{font:Fh.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}.call(this,Ih);Lh=Array.isArray(Ph)?Ph:String(Ph).split(/\r?\n/);var Bh=1*this.internal.scaleFactor*Fh/Rh;zh.textIndent=Ih.textIndent?1*Ih.textIndent*this.internal.scaleFactor/Rh:0,zh.lineIndent=Ih.lineIndent;var Vh,Hh,Uh=[];for(Vh=0,Hh=Lh.length;Vh<Hh;Vh++)Uh=Uh.concat(Zs$1.apply(this,[Lh[Vh],Bh,zh]));return Uh},function(Ph){Ph.__fontmetrics__=Ph.__fontmetrics__||{};for(var Fh=`0123456789abcdef`,Ih=`klmnopqrstuvwxyz`,Lh={},Rh={},zh=0;zh<16;zh++)Lh[Ih[zh]]=Fh[zh],Rh[Fh[zh]]=Ih[zh];var Bh=function(Ph){return`0x`+parseInt(Ph,10).toString(16)},Vh=Ph.__fontmetrics__.compress=function(Ph){var Fh,Ih,Lh,zh,Hh=[`{`];for(var Uh in Ph){if(Fh=Ph[Uh],isNaN(parseInt(Uh,10))?Ih=`'`+Uh+`'`:(Uh=parseInt(Uh,10),Ih=(Ih=Bh(Uh).slice(2)).slice(0,-1)+Rh[Ih.slice(-1)]),typeof Fh==`number`)Fh<0?(Lh=Bh(Fh).slice(3),zh=`-`):(Lh=Bh(Fh).slice(2),zh=``),Lh=zh+Lh.slice(0,-1)+Rh[Lh.slice(-1)];else{if(e$4(Fh)!==`object`)throw Error(`Don't know what to do with value type `+e$4(Fh)+`.`);Lh=Vh(Fh)}Hh.push(Ih+Lh)}return Hh.push(`}`),Hh.join(``)},Hh=Ph.__fontmetrics__.uncompress=function(Ph){if(typeof Ph!=`string`)throw Error(`Invalid argument passed to uncompress.`);for(var Fh,Ih,Rh,zh,Bh={},Vh=1,Hh=Bh,Uh=[],Wh=``,Gh=``,Kh=Ph.length-1,qh=1;qh<Kh;qh+=1)(zh=Ph[qh])==`'`?Fh?(Rh=Fh.join(``),Fh=void 0):Fh=[]:Fh?Fh.push(zh):zh==`{`?(Uh.push([Hh,Rh]),Hh={},Rh=void 0):zh==`}`?((Ih=Uh.pop())[0][Ih[1]]=Hh,Rh=void 0,Hh=Ih[0]):zh==`-`?Vh=-1:Rh===void 0?Lh.hasOwnProperty(zh)?(Wh+=Lh[zh],Rh=parseInt(Wh,16)*Vh,Vh=1,Wh=``):Wh+=zh:Lh.hasOwnProperty(zh)?(Gh+=Lh[zh],Hh[Rh]=parseInt(Gh,16)*Vh,Vh=1,Rh=void 0,Gh=``):Gh+=zh;return Bh},Uh={codePages:[`WinAnsiEncoding`],WinAnsiEncoding:Hh(`{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}`)},Wh={Unicode:{Courier:Uh,"Courier-Bold":Uh,"Courier-BoldOblique":Uh,"Courier-Oblique":Uh,Helvetica:Uh,"Helvetica-Bold":Uh,"Helvetica-BoldOblique":Uh,"Helvetica-Oblique":Uh,"Times-Roman":Uh,"Times-Bold":Uh,"Times-BoldItalic":Uh,"Times-Italic":Uh}},Gh={Unicode:{"Courier-Oblique":Hh(`{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}`),"Times-BoldItalic":Hh(`{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}`),"Helvetica-Bold":Hh(`{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}`),Courier:Hh(`{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}`),"Courier-BoldOblique":Hh(`{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}`),"Times-Bold":Hh(`{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}`),Symbol:Hh(`{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}`),Helvetica:Hh(`{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}`),"Helvetica-BoldOblique":Hh(`{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}`),ZapfDingbats:Hh(`{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}`),"Courier-Bold":Hh(`{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}`),"Times-Italic":Hh(`{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}`),"Times-Roman":Hh(`{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}`),"Helvetica-Oblique":Hh(`{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}`)}};Ph.events.push([`addFont`,function(Ph){var Fh=Ph.font,Ih=Gh.Unicode[Fh.postScriptName];Ih&&(Fh.metadata.Unicode={},Fh.metadata.Unicode.widths=Ih.widths,Fh.metadata.Unicode.kerning=Ih.kerning);var Lh=Wh.Unicode[Fh.postScriptName];Lh&&(Fh.metadata.Unicode.encoding=Lh,Fh.encoding=Lh.codePages[0])}])}(Z$3.API),function(Ph){var Fh=function(Ph){for(var Fh=Ph.length,Ih=new Uint8Array(Fh),Lh=0;Lh<Fh;Lh++)Ih[Lh]=Ph.charCodeAt(Lh);return Ih};Ph.API.events.push([`addFont`,function(Ih){var Lh=void 0,Rh=Ih.font,zh=Ih.instance;if(!Rh.isStandardFont){if(zh===void 0)throw Error(`Font does not exist in vFS, import fonts or remove declaration doc.addFont('`+Rh.postScriptName+`').`);if(typeof(Lh=!1===zh.existsFileInVFS(Rh.postScriptName)?zh.loadFile(Rh.postScriptName):zh.getFileFromVFS(Rh.postScriptName))!=`string`)throw Error(`Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('`+Rh.postScriptName+`').`);(function(Ih,Lh){Lh=/^\x00\x01\x00\x00/.test(Lh)?Fh(Lh):Fh(So$1(Lh)),Ih.metadata=Ph.API.TTFFont.open(Lh),Ih.metadata.Unicode=Ih.metadata.Unicode||{encoding:{},kerning:{},widths:[]},Ih.metadata.glyIdsUsed=[0]})(Rh,Lh)}}])}(Z$3),Z$3.API.addSvgAsImage=function(Ph,Fh,Ih,Lh,Rh,zh,Bh,Vh){if(isNaN(Fh)||isNaN(Ih))throw go$1.error(`jsPDF.addSvgAsImage: Invalid coordinates`,arguments),Error(`Invalid coordinates passed to jsPDF.addSvgAsImage`);if(isNaN(Lh)||isNaN(Rh))throw go$1.error(`jsPDF.addSvgAsImage: Invalid measurements`,arguments),Error(`Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage`);var Hh=document.createElement(`canvas`);Hh.width=Lh,Hh.height=Rh;var Uh=Hh.getContext(`2d`);Uh.fillStyle=`#fff`,Uh.fillRect(0,0,Hh.width,Hh.height);var Wh={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},Gh=this;return(X$3.canvg?Promise.resolve(X$3.canvg):__vitePreload(()=>import(`./index.es-D4YyL_Dg-CB_ogqQG.js`),[])).catch(function(Ph){return Promise.reject(Error(`Could not load canvg: `+Ph))}).then(function(Ph){return Ph.default?Ph.default:Ph}).then(function(Fh){return Fh.fromString(Uh,Ph,Wh)},function(){return Promise.reject(Error(`Could not load canvg.`))}).then(function(Ph){return Ph.render(Wh)}).then(function(){Gh.addImage(Hh.toDataURL(`image/jpeg`,1),Fh,Ih,Lh,Rh,Bh,Vh)})},Z$3.API.putTotalPages=function(Ph){var Fh,Ih=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(Fh=new RegExp(Ph,`g`),Ih=this.internal.getNumberOfPages()):(Fh=new RegExp(this.pdfEscape16(Ph,this.internal.getFont()),`g`),Ih=this.pdfEscape16(this.internal.getNumberOfPages()+``,this.internal.getFont()));for(var Lh=1;Lh<=this.internal.getNumberOfPages();Lh++)for(var Rh=0;Rh<this.internal.pages[Lh].length;Rh++)this.internal.pages[Lh][Rh]=this.internal.pages[Lh][Rh].replace(Fh,Ih);return this},Z$3.API.viewerPreferences=function(Ph,Fh){var Ih;Ph||={},Fh||=!1;var Lh,Rh,zh,Bh={HideToolbar:{defaultValue:!1,value:!1,type:`boolean`,explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:`boolean`,explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:`boolean`,explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:`boolean`,explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:`boolean`,explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:`boolean`,explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:`UseNone`,value:`UseNone`,type:`name`,explicitSet:!1,valueSet:[`UseNone`,`UseOutlines`,`UseThumbs`,`UseOC`],pdfVersion:1.3},Direction:{defaultValue:`L2R`,value:`L2R`,type:`name`,explicitSet:!1,valueSet:[`L2R`,`R2L`],pdfVersion:1.3},ViewArea:{defaultValue:`CropBox`,value:`CropBox`,type:`name`,explicitSet:!1,valueSet:[`MediaBox`,`CropBox`,`TrimBox`,`BleedBox`,`ArtBox`],pdfVersion:1.4},ViewClip:{defaultValue:`CropBox`,value:`CropBox`,type:`name`,explicitSet:!1,valueSet:[`MediaBox`,`CropBox`,`TrimBox`,`BleedBox`,`ArtBox`],pdfVersion:1.4},PrintArea:{defaultValue:`CropBox`,value:`CropBox`,type:`name`,explicitSet:!1,valueSet:[`MediaBox`,`CropBox`,`TrimBox`,`BleedBox`,`ArtBox`],pdfVersion:1.4},PrintClip:{defaultValue:`CropBox`,value:`CropBox`,type:`name`,explicitSet:!1,valueSet:[`MediaBox`,`CropBox`,`TrimBox`,`BleedBox`,`ArtBox`],pdfVersion:1.4},PrintScaling:{defaultValue:`AppDefault`,value:`AppDefault`,type:`name`,explicitSet:!1,valueSet:[`AppDefault`,`None`],pdfVersion:1.6},Duplex:{defaultValue:``,value:`none`,type:`name`,explicitSet:!1,valueSet:[`Simplex`,`DuplexFlipShortEdge`,`DuplexFlipLongEdge`,`none`],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:`boolean`,explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:``,value:``,type:`array`,explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:`integer`,explicitSet:!1,valueSet:null,pdfVersion:1.7}},Vh=Object.keys(Bh),Hh=[],Uh=0,Wh=0,Gh=0;function Kh(Ph,Fh){var Ih,Lh=!1;for(Ih=0;Ih<Ph.length;Ih+=1)Ph[Ih]===Fh&&(Lh=!0);return Lh}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(Bh)),this.internal.viewerpreferences.isSubscribed=!1),Ih=this.internal.viewerpreferences.configuration,Ph===`reset`||!0===Fh){var qh=Vh.length;for(Gh=0;Gh<qh;Gh+=1)Ih[Vh[Gh]].value=Ih[Vh[Gh]].defaultValue,Ih[Vh[Gh]].explicitSet=!1}if(e$4(Ph)===`object`){for(Rh in Ph)if(zh=Ph[Rh],Kh(Vh,Rh)&&zh!==void 0){if(Ih[Rh].type===`boolean`&&typeof zh==`boolean`)Ih[Rh].value=zh;else if(Ih[Rh].type===`name`&&Kh(Ih[Rh].valueSet,zh))Ih[Rh].value=zh;else if(Ih[Rh].type===`integer`&&Number.isInteger(zh))Ih[Rh].value=zh;else if(Ih[Rh].type===`array`){for(Uh=0;Uh<zh.length;Uh+=1)if(Lh=!0,zh[Uh].length===1&&typeof zh[Uh][0]==`number`)Hh.push(String(zh[Uh]-1));else if(zh[Uh].length>1){for(Wh=0;Wh<zh[Uh].length;Wh+=1)typeof zh[Uh][Wh]!=`number`&&(Lh=!1);!0===Lh&&Hh.push([zh[Uh][0]-1,zh[Uh][1]-1].join(` `))}Ih[Rh].value=`[`+Hh.join(` `)+`]`}else Ih[Rh].value=Ih[Rh].defaultValue;Ih[Rh].explicitSet=!0}}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe(`putCatalog`,function(){var Ph,Fh=[];for(Ph in Ih)!0===Ih[Ph].explicitSet&&(Ih[Ph].type===`name`?Fh.push(`/`+Ph+` /`+Ih[Ph].value):Fh.push(`/`+Ph+` `+Ih[Ph].value));Fh.length!==0&&this.internal.write(`/ViewerPreferences
|
|
295
|
+
`&&(Lh=Lh.substr(1),$h=1),Kh+qh+(Jh=(Rh=Js$1.apply(this,[Lh,Ih])).reduce(function(Ph,Fh){return Ph+Fh},0))>Fh||$h){if(Jh>Fh){for(Vh=Xs$1.apply(this,[Lh,Rh,Fh-(Kh+qh),Fh]),Wh.push(Vh.shift()),Wh=[Vh.pop()];Vh.length;)Gh.push([Vh.shift()]);Jh=Rh.slice(Lh.length-(Wh[0]?Wh[0].length:0)).reduce(function(Ph,Fh){return Ph+Fh},0)}else Wh=[Lh];Gh.push(Wh),Kh=Jh+Hh,qh=Xh}else Wh.push(Lh),Kh+=qh+Jh,qh=Xh}return Uh=Hh?function(Ph,Fh){return(Fh?Zh:``)+Ph.join(` `)}:function(Ph){return Ph.join(` `)},Gh.map(Uh)},qs$1.splitTextToSize=function(Ph,Fh,Ih){var Lh,Rh=(Ih||={}).fontSize||this.internal.getFontSize(),zh=function(Ph){if(Ph.widths&&Ph.kerning)return{widths:Ph.widths,kerning:Ph.kerning};var Fh=this.internal.getFont(Ph.fontName,Ph.fontStyle),Ih=`Unicode`;return Fh.metadata[Ih]?{widths:Fh.metadata[Ih].widths||{0:1},kerning:Fh.metadata[Ih].kerning||{}}:{font:Fh.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}.call(this,Ih);Lh=Array.isArray(Ph)?Ph:String(Ph).split(/\r?\n/);var Bh=1*this.internal.scaleFactor*Fh/Rh;zh.textIndent=Ih.textIndent?1*Ih.textIndent*this.internal.scaleFactor/Rh:0,zh.lineIndent=Ih.lineIndent;var Vh,Hh,Uh=[];for(Vh=0,Hh=Lh.length;Vh<Hh;Vh++)Uh=Uh.concat(Zs$1.apply(this,[Lh[Vh],Bh,zh]));return Uh},function(Ph){Ph.__fontmetrics__=Ph.__fontmetrics__||{};for(var Fh=`0123456789abcdef`,Ih=`klmnopqrstuvwxyz`,Lh={},Rh={},zh=0;zh<16;zh++)Lh[Ih[zh]]=Fh[zh],Rh[Fh[zh]]=Ih[zh];var Bh=function(Ph){return`0x`+parseInt(Ph,10).toString(16)},Vh=Ph.__fontmetrics__.compress=function(Ph){var Fh,Ih,Lh,zh,Hh=[`{`];for(var Uh in Ph){if(Fh=Ph[Uh],isNaN(parseInt(Uh,10))?Ih=`'`+Uh+`'`:(Uh=parseInt(Uh,10),Ih=(Ih=Bh(Uh).slice(2)).slice(0,-1)+Rh[Ih.slice(-1)]),typeof Fh==`number`)Fh<0?(Lh=Bh(Fh).slice(3),zh=`-`):(Lh=Bh(Fh).slice(2),zh=``),Lh=zh+Lh.slice(0,-1)+Rh[Lh.slice(-1)];else{if(e$4(Fh)!==`object`)throw Error(`Don't know what to do with value type `+e$4(Fh)+`.`);Lh=Vh(Fh)}Hh.push(Ih+Lh)}return Hh.push(`}`),Hh.join(``)},Hh=Ph.__fontmetrics__.uncompress=function(Ph){if(typeof Ph!=`string`)throw Error(`Invalid argument passed to uncompress.`);for(var Fh,Ih,Rh,zh,Bh={},Vh=1,Hh=Bh,Uh=[],Wh=``,Gh=``,Kh=Ph.length-1,qh=1;qh<Kh;qh+=1)(zh=Ph[qh])==`'`?Fh?(Rh=Fh.join(``),Fh=void 0):Fh=[]:Fh?Fh.push(zh):zh==`{`?(Uh.push([Hh,Rh]),Hh={},Rh=void 0):zh==`}`?((Ih=Uh.pop())[0][Ih[1]]=Hh,Rh=void 0,Hh=Ih[0]):zh==`-`?Vh=-1:Rh===void 0?Lh.hasOwnProperty(zh)?(Wh+=Lh[zh],Rh=parseInt(Wh,16)*Vh,Vh=1,Wh=``):Wh+=zh:Lh.hasOwnProperty(zh)?(Gh+=Lh[zh],Hh[Rh]=parseInt(Gh,16)*Vh,Vh=1,Rh=void 0,Gh=``):Gh+=zh;return Bh},Uh={codePages:[`WinAnsiEncoding`],WinAnsiEncoding:Hh(`{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}`)},Wh={Unicode:{Courier:Uh,"Courier-Bold":Uh,"Courier-BoldOblique":Uh,"Courier-Oblique":Uh,Helvetica:Uh,"Helvetica-Bold":Uh,"Helvetica-BoldOblique":Uh,"Helvetica-Oblique":Uh,"Times-Roman":Uh,"Times-Bold":Uh,"Times-BoldItalic":Uh,"Times-Italic":Uh}},Gh={Unicode:{"Courier-Oblique":Hh(`{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}`),"Times-BoldItalic":Hh(`{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}`),"Helvetica-Bold":Hh(`{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}`),Courier:Hh(`{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}`),"Courier-BoldOblique":Hh(`{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}`),"Times-Bold":Hh(`{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}`),Symbol:Hh(`{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}`),Helvetica:Hh(`{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}`),"Helvetica-BoldOblique":Hh(`{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}`),ZapfDingbats:Hh(`{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}`),"Courier-Bold":Hh(`{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}`),"Times-Italic":Hh(`{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l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u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}`),"Helvetica-Oblique":Hh(`{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}`)}};Ph.events.push([`addFont`,function(Ph){var Fh=Ph.font,Ih=Gh.Unicode[Fh.postScriptName];Ih&&(Fh.metadata.Unicode={},Fh.metadata.Unicode.widths=Ih.widths,Fh.metadata.Unicode.kerning=Ih.kerning);var Lh=Wh.Unicode[Fh.postScriptName];Lh&&(Fh.metadata.Unicode.encoding=Lh,Fh.encoding=Lh.codePages[0])}])}(Z$3.API),function(Ph){var Fh=function(Ph){for(var Fh=Ph.length,Ih=new Uint8Array(Fh),Lh=0;Lh<Fh;Lh++)Ih[Lh]=Ph.charCodeAt(Lh);return Ih};Ph.API.events.push([`addFont`,function(Ih){var Lh=void 0,Rh=Ih.font,zh=Ih.instance;if(!Rh.isStandardFont){if(zh===void 0)throw Error(`Font does not exist in vFS, import fonts or remove declaration doc.addFont('`+Rh.postScriptName+`').`);if(typeof(Lh=!1===zh.existsFileInVFS(Rh.postScriptName)?zh.loadFile(Rh.postScriptName):zh.getFileFromVFS(Rh.postScriptName))!=`string`)throw Error(`Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('`+Rh.postScriptName+`').`);(function(Ih,Lh){Lh=/^\x00\x01\x00\x00/.test(Lh)?Fh(Lh):Fh(So$1(Lh)),Ih.metadata=Ph.API.TTFFont.open(Lh),Ih.metadata.Unicode=Ih.metadata.Unicode||{encoding:{},kerning:{},widths:[]},Ih.metadata.glyIdsUsed=[0]})(Rh,Lh)}}])}(Z$3),Z$3.API.addSvgAsImage=function(Ph,Fh,Ih,Lh,Rh,zh,Bh,Vh){if(isNaN(Fh)||isNaN(Ih))throw go$1.error(`jsPDF.addSvgAsImage: Invalid coordinates`,arguments),Error(`Invalid coordinates passed to jsPDF.addSvgAsImage`);if(isNaN(Lh)||isNaN(Rh))throw go$1.error(`jsPDF.addSvgAsImage: Invalid measurements`,arguments),Error(`Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage`);var Hh=document.createElement(`canvas`);Hh.width=Lh,Hh.height=Rh;var Uh=Hh.getContext(`2d`);Uh.fillStyle=`#fff`,Uh.fillRect(0,0,Hh.width,Hh.height);var Wh={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},Gh=this;return(X$3.canvg?Promise.resolve(X$3.canvg):__vitePreload(()=>import(`./index.es-D4YyL_Dg-BgT6a3Nd.js`),[])).catch(function(Ph){return Promise.reject(Error(`Could not load canvg: `+Ph))}).then(function(Ph){return Ph.default?Ph.default:Ph}).then(function(Fh){return Fh.fromString(Uh,Ph,Wh)},function(){return Promise.reject(Error(`Could not load canvg.`))}).then(function(Ph){return Ph.render(Wh)}).then(function(){Gh.addImage(Hh.toDataURL(`image/jpeg`,1),Fh,Ih,Lh,Rh,Bh,Vh)})},Z$3.API.putTotalPages=function(Ph){var Fh,Ih=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(Fh=new RegExp(Ph,`g`),Ih=this.internal.getNumberOfPages()):(Fh=new RegExp(this.pdfEscape16(Ph,this.internal.getFont()),`g`),Ih=this.pdfEscape16(this.internal.getNumberOfPages()+``,this.internal.getFont()));for(var Lh=1;Lh<=this.internal.getNumberOfPages();Lh++)for(var Rh=0;Rh<this.internal.pages[Lh].length;Rh++)this.internal.pages[Lh][Rh]=this.internal.pages[Lh][Rh].replace(Fh,Ih);return this},Z$3.API.viewerPreferences=function(Ph,Fh){var Ih;Ph||={},Fh||=!1;var Lh,Rh,zh,Bh={HideToolbar:{defaultValue:!1,value:!1,type:`boolean`,explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:`boolean`,explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:`boolean`,explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:`boolean`,explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:`boolean`,explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:`boolean`,explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:`UseNone`,value:`UseNone`,type:`name`,explicitSet:!1,valueSet:[`UseNone`,`UseOutlines`,`UseThumbs`,`UseOC`],pdfVersion:1.3},Direction:{defaultValue:`L2R`,value:`L2R`,type:`name`,explicitSet:!1,valueSet:[`L2R`,`R2L`],pdfVersion:1.3},ViewArea:{defaultValue:`CropBox`,value:`CropBox`,type:`name`,explicitSet:!1,valueSet:[`MediaBox`,`CropBox`,`TrimBox`,`BleedBox`,`ArtBox`],pdfVersion:1.4},ViewClip:{defaultValue:`CropBox`,value:`CropBox`,type:`name`,explicitSet:!1,valueSet:[`MediaBox`,`CropBox`,`TrimBox`,`BleedBox`,`ArtBox`],pdfVersion:1.4},PrintArea:{defaultValue:`CropBox`,value:`CropBox`,type:`name`,explicitSet:!1,valueSet:[`MediaBox`,`CropBox`,`TrimBox`,`BleedBox`,`ArtBox`],pdfVersion:1.4},PrintClip:{defaultValue:`CropBox`,value:`CropBox`,type:`name`,explicitSet:!1,valueSet:[`MediaBox`,`CropBox`,`TrimBox`,`BleedBox`,`ArtBox`],pdfVersion:1.4},PrintScaling:{defaultValue:`AppDefault`,value:`AppDefault`,type:`name`,explicitSet:!1,valueSet:[`AppDefault`,`None`],pdfVersion:1.6},Duplex:{defaultValue:``,value:`none`,type:`name`,explicitSet:!1,valueSet:[`Simplex`,`DuplexFlipShortEdge`,`DuplexFlipLongEdge`,`none`],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:`boolean`,explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:``,value:``,type:`array`,explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:`integer`,explicitSet:!1,valueSet:null,pdfVersion:1.7}},Vh=Object.keys(Bh),Hh=[],Uh=0,Wh=0,Gh=0;function Kh(Ph,Fh){var Ih,Lh=!1;for(Ih=0;Ih<Ph.length;Ih+=1)Ph[Ih]===Fh&&(Lh=!0);return Lh}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(Bh)),this.internal.viewerpreferences.isSubscribed=!1),Ih=this.internal.viewerpreferences.configuration,Ph===`reset`||!0===Fh){var qh=Vh.length;for(Gh=0;Gh<qh;Gh+=1)Ih[Vh[Gh]].value=Ih[Vh[Gh]].defaultValue,Ih[Vh[Gh]].explicitSet=!1}if(e$4(Ph)===`object`){for(Rh in Ph)if(zh=Ph[Rh],Kh(Vh,Rh)&&zh!==void 0){if(Ih[Rh].type===`boolean`&&typeof zh==`boolean`)Ih[Rh].value=zh;else if(Ih[Rh].type===`name`&&Kh(Ih[Rh].valueSet,zh))Ih[Rh].value=zh;else if(Ih[Rh].type===`integer`&&Number.isInteger(zh))Ih[Rh].value=zh;else if(Ih[Rh].type===`array`){for(Uh=0;Uh<zh.length;Uh+=1)if(Lh=!0,zh[Uh].length===1&&typeof zh[Uh][0]==`number`)Hh.push(String(zh[Uh]-1));else if(zh[Uh].length>1){for(Wh=0;Wh<zh[Uh].length;Wh+=1)typeof zh[Uh][Wh]!=`number`&&(Lh=!1);!0===Lh&&Hh.push([zh[Uh][0]-1,zh[Uh][1]-1].join(` `))}Ih[Rh].value=`[`+Hh.join(` `)+`]`}else Ih[Rh].value=Ih[Rh].defaultValue;Ih[Rh].explicitSet=!0}}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe(`putCatalog`,function(){var Ph,Fh=[];for(Ph in Ih)!0===Ih[Ph].explicitSet&&(Ih[Ph].type===`name`?Fh.push(`/`+Ph+` /`+Ih[Ph].value):Fh.push(`/`+Ph+` `+Ih[Ph].value));Fh.length!==0&&this.internal.write(`/ViewerPreferences
|
|
296
296
|
<<
|
|
297
297
|
`+Fh.join(`
|
|
298
298
|
`)+`
|
|
@@ -4830,11 +4830,11 @@ Beat visual options (choose one per beat):
|
|
|
4830
4830
|
- "image": { "type": "html_tailwind", "html": "...", "script"?: "..." } ← PREFER for rich layouts, animations, custom visuals
|
|
4831
4831
|
|
|
4832
4832
|
IMPORTANT: "imagePrompt" and "moviePrompt" are plain string fields on the beat, NOT nested under "image".`,parameters:{type:`object`,properties:{script:{type:`object`,description:`Complete MulmoScript JSON. Must include $mulmocast, speechParams, imageParams, movieParams, and beats array. Always populate the top-level 'description' field with a concise 1–2 sentence summary of the presentation.`,additionalProperties:!0},filename:{type:`string`,description:`Optional filename without extension. Defaults to a slug of the script title.`}},required:[`script`]}},provider2TTSAgent={openai:{agentName:`ttsOpenaiAgent`,hasLimitedConcurrency:!1,defaultModel:`gpt-4o-mini-tts`,defaultVoice:`shimmer`,keyName:`OPENAI_API_KEY`,baseURLKeyName:`OPENAI_BASE_URL`},google:{agentName:`ttsGoogleAgent`,hasLimitedConcurrency:!1,keyName:`GEMINI_API_KEY`},gemini:{agentName:`ttsGeminiAgent`,hasLimitedConcurrency:!1,defaultModel:`gemini-2.5-flash-preview-tts`,defaultVoice:`Kore`,models:[`gemini-2.5-flash-preview-tts`,`gemini-2.5-pro-preview-tts`],keyName:`GEMINI_API_KEY`},elevenlabs:{agentName:`ttsElevenlabsAgent`,hasLimitedConcurrency:!0,defaultModel:`eleven_multilingual_v2`,models:[`eleven_v3`,`eleven_multilingual_v2`,`eleven_turbo_v2_5`,`eleven_turbo_v2`,`eleven_flash_v2_5`,`eleven_flash_v2`],keyName:`ELEVENLABS_API_KEY`},kotodama:{agentName:`ttsKotodamaAgent`,hasLimitedConcurrency:!0,defaultVoice:`Atla`,defaultDecoration:`neutral`,keyName:`KOTODAMA_API_KEY`},mock:{agentName:`mediaMockAgent`,hasLimitedConcurrency:!0,defaultModel:`mock-model`,models:[`mock-model`]}},gptImages=[`gpt-image-1.5`,`gpt-image-1`,`gpt-image-1-mini`],provider2ImageAgent={openai:{agentName:`imageOpenaiAgent`,defaultModel:`gpt-image-1`,models:[`dall-e-3`,...gptImages],keyName:`OPENAI_API_KEY`,baseURLKeyName:`OPENAI_BASE_URL`},google:{agentName:`imageGenAIAgent`,defaultModel:`gemini-2.5-flash-image`,models:[`imagen-4.0-generate-001`,`imagen-4.0-ultra-generate-001`,`imagen-4.0-fast-generate-001`,`gemini-2.5-flash-image`,`gemini-3.1-flash-image-preview`,`gemini-3-pro-image-preview`],keyName:`GEMINI_API_KEY`},replicate:{agentName:`imageReplicateAgent`,defaultModel:`bytedance/seedream-4`,models:[`bytedance/seedream-4`,`qwen/qwen-image`],keyName:`REPLICATE_API_TOKEN`},mock:{agentName:`mediaMockAgent`,defaultModel:`mock-model`,models:[`mock-model`],keyName:``}},AUDIO_MODE_NEVER=`never`,AUDIO_MODE_ALWAYS=`always`,AUDIO_MODE_OPTIONAL=`optional`,provider2MovieAgent={replicate:{agentName:`movieReplicateAgent`,defaultModel:`bytedance/seedance-1-lite`,keyName:`REPLICATE_API_TOKEN`,models:[`bytedance/seedance-1-lite`,`bytedance/seedance-1-pro`,`bytedance/seedance-2.0`,`bytedance/seedance-2.0-fast`,`kwaivgi/kling-v1.6-pro`,`kwaivgi/kling-v2.1`,`kwaivgi/kling-v2.1-master`,`google/veo-2`,`google/veo-3`,`google/veo-3.1`,`google/veo-3.1-fast`,`google/veo-3.1-lite`,`google/veo-3-fast`,`minimax/video-01`,`minimax/hailuo-02`,`minimax/hailuo-02-fast`,`pixverse/pixverse-v4.5`,`wan-video/wan-2.2-i2v-fast`,`wan-video/wan-2.2-t2v-fast`,`xai/grok-imagine-video`,`xai/grok-imagine-r2v`,`runwayml/gen-4.5`,`kwaivgi/kling-v3-omni-video`,`kwaivgi/kling-v3-video`],modelParams:{"bytedance/seedance-1-lite":{durations:[5,10],start_image:`image`,last_image:`last_frame_image`,audio:{mode:AUDIO_MODE_NEVER},price_per_sec:.036},"bytedance/seedance-1-pro":{durations:[5,10],start_image:`image`,last_image:`last_frame_image`,audio:{mode:AUDIO_MODE_NEVER},price_per_sec:.15},"bytedance/seedance-2.0":{durations:[4,5,6,7,8,9,10,11,12,13,14,15],start_image:`image`,last_image:`last_frame_image`,audio:{mode:AUDIO_MODE_OPTIONAL,param:`generate_audio`},price_per_sec:.29},"bytedance/seedance-2.0-fast":{durations:[4,5,6,7,8,9,10,11,12,13,14,15],start_image:`image`,last_image:`last_frame_image`,audio:{mode:AUDIO_MODE_OPTIONAL,param:`generate_audio`},price_per_sec:.22},"kwaivgi/kling-v1.6-pro":{durations:[5,10],start_image:`start_image`,audio:{mode:AUDIO_MODE_NEVER},price_per_sec:.095},"kwaivgi/kling-v2.1":{durations:[5,10],start_image:`start_image`,audio:{mode:AUDIO_MODE_NEVER},price_per_sec:.05},"kwaivgi/kling-v2.1-master":{durations:[5,10],start_image:`start_image`,audio:{mode:AUDIO_MODE_NEVER},price_per_sec:.28},"google/veo-2":{durations:[5,6,7,8],start_image:`image`,audio:{mode:AUDIO_MODE_NEVER},price_per_sec:.5},"google/veo-3":{durations:[8],start_image:`image`,audio:{mode:AUDIO_MODE_OPTIONAL,param:`generate_audio`},price_per_sec:.75},"google/veo-3.1":{durations:[4,6,8],start_image:`image`,last_image:`last_frame_image`,reference_images_param:`reference_images`,audio:{mode:AUDIO_MODE_OPTIONAL,param:`generate_audio`},price_per_sec:.75},"google/veo-3.1-fast":{durations:[4,6,8],start_image:`image`,last_image:`last_frame_image`,audio:{mode:AUDIO_MODE_OPTIONAL,param:`generate_audio`},price_per_sec:.4},"google/veo-3.1-lite":{durations:[4,6,8],start_image:`image`,last_image:`last_frame`,audio:{mode:AUDIO_MODE_NEVER},price_per_sec:.05},"google/veo-3-fast":{durations:[8],start_image:`image`,audio:{mode:AUDIO_MODE_OPTIONAL,param:`generate_audio`},price_per_sec:.4},"minimax/video-01":{durations:[6],start_image:`first_frame_image`,audio:{mode:AUDIO_MODE_NEVER},price_per_sec:.5},"minimax/hailuo-02":{durations:[6],start_image:`first_frame_image`,last_image:`end_image`,audio:{mode:AUDIO_MODE_NEVER},price_per_sec:.08},"minimax/hailuo-02-fast":{durations:[6,10],start_image:`first_frame_image`,audio:{mode:AUDIO_MODE_NEVER},price_per_sec:.0166},"pixverse/pixverse-v4.5":{durations:[5,8],start_image:`image`,last_image:`last_frame_image`,audio:{mode:AUDIO_MODE_OPTIONAL,param:`sound_effect_switch`},price_per_sec:.12},"wan-video/wan-2.2-i2v-fast":{durations:[5],start_image:`image`,audio:{mode:AUDIO_MODE_NEVER},price_per_sec:.012},"wan-video/wan-2.2-t2v-fast":{durations:[5],start_image:void 0,audio:{mode:AUDIO_MODE_NEVER},price_per_sec:.012},"xai/grok-imagine-video":{durations:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],start_image:`image`,audio:{mode:AUDIO_MODE_NEVER},price_per_sec:.08},"xai/grok-imagine-r2v":{durations:[1,2,3,4,5,6,7,8,9,10],start_image:void 0,reference_images_param:`reference_images`,audio:{mode:AUDIO_MODE_NEVER},price_per_sec:.08},"runwayml/gen-4.5":{durations:[5,10],start_image:`image`,audio:{mode:AUDIO_MODE_NEVER},price_per_sec:.25},"kwaivgi/kling-v3-omni-video":{durations:[3,4,5,6,7,8,9,10,11,12,13,14,15],start_image:`start_image`,last_image:`end_image`,reference_images_param:`reference_images`,audio:{mode:AUDIO_MODE_OPTIONAL,param:`generate_audio`},price_per_sec:.3},"kwaivgi/kling-v3-video":{durations:[3,4,5,6,7,8,9,10,11,12,13,14,15],start_image:`start_image`,last_image:`end_image`,reference_images_param:`reference_images`,audio:{mode:AUDIO_MODE_OPTIONAL,param:`generate_audio`},price_per_sec:.3}}},google:{agentName:`movieGenAIAgent`,defaultModel:`veo-2.0-generate-001`,models:[`veo-2.0-generate-001`,`veo-3.0-generate-001`,`veo-3.1-generate-preview`,`veo-3.1-lite-generate-preview`],keyName:`GEMINI_API_KEY`,modelParams:{"veo-3.1-lite-generate-preview":{durations:[4,6,8],supportsDuration:!0,supportsLastFrame:!0,supportsReferenceImages:!1,supportsPersonGeneration:!1,audio:{mode:AUDIO_MODE_ALWAYS}},"veo-3.1-generate-preview":{durations:[4,6,8],supportsDuration:!0,supportsLastFrame:!0,supportsReferenceImages:!0,supportsPersonGeneration:!1,audio:{mode:AUDIO_MODE_ALWAYS}},"veo-3.0-generate-001":{durations:[8],supportsDuration:!1,supportsLastFrame:!1,supportsReferenceImages:!1,supportsPersonGeneration:!1,audio:{mode:AUDIO_MODE_ALWAYS}},"veo-2.0-generate-001":{durations:[5,6,8],supportsDuration:!0,supportsLastFrame:!1,supportsReferenceImages:!1,supportsPersonGeneration:!0,audio:{mode:AUDIO_MODE_NEVER}}}},mock:{agentName:`mediaMockAgent`,defaultModel:`mock-model`,models:[`mock-model`],keyName:``,modelParams:{}}},provider2SoundEffectAgent={replicate:{agentName:`soundEffectReplicateAgent`,defaultModel:`zsxkib/mmaudio`,keyName:`REPLICATE_API_TOKEN`,models:[`zsxkib/mmaudio`],modelParams:{"zsxkib/mmaudio":{identifier:`zsxkib/mmaudio:62871fb59889b2d7c13777f08deb3b36bdff88f7e1d53a50ad7694548a41b484`}}}},defaultProviders={tts:`openai`,text2image:`openai`,text2movie:`replicate`,text2Html:`openai`,llm:`openai`,soundEffect:`replicate`,lipSync:`replicate`},htmlLLMProvider=[`openai`,`anthropic`,`mock`],mulmoVideoFilterMonoSchema=object({type:literal(`mono`)}),mulmoVideoFilterSepiaSchema=object({type:literal(`sepia`)}),mulmoVideoFilterBrightnessContrastSchema=object({type:literal(`brightness_contrast`),brightness:number().min(-1).max(1).optional().default(0),contrast:number().min(0).max(3).optional().default(1)}),mulmoVideoFilterHueSchema=object({type:literal(`hue`),hue:number().min(-180).max(180).optional().default(0),saturation:number().min(-10).max(10).optional().default(1),brightness:number().min(-10).max(10).optional().default(0)}),mulmoVideoFilterColorBalanceSchema=object({type:literal(`colorbalance`),rs:number().min(-1).max(1).optional().default(0),gs:number().min(-1).max(1).optional().default(0),bs:number().min(-1).max(1).optional().default(0),rm:number().min(-1).max(1).optional().default(0),gm:number().min(-1).max(1).optional().default(0),bm:number().min(-1).max(1).optional().default(0),rh:number().min(-1).max(1).optional().default(0),gh:number().min(-1).max(1).optional().default(0),bh:number().min(-1).max(1).optional().default(0)}),mulmoVideoFilterVibranceSchema=object({type:literal(`vibrance`),intensity:number().min(-2).max(2).optional().default(0)}),mulmoVideoFilterNegateSchema=object({type:literal(`negate`),negate_alpha:boolean().optional().default(!1)}),mulmoVideoFilterColorHoldSchema=object({type:literal(`colorhold`),color:string().optional().default(`red`),similarity:number().min(0).max(1).optional().default(.01),blend:number().min(0).max(1).optional().default(0)}),mulmoVideoFilterColorKeySchema=object({type:literal(`colorkey`),color:string().optional().default(`green`),similarity:number().min(0).max(1).optional().default(.01),blend:number().min(0).max(1).optional().default(0)}),mulmoVideoFilterBlurSchema=object({type:literal(`blur`),radius:number().min(1).max(50).optional().default(10),power:number().min(1).max(10).optional().default(1)}),mulmoVideoFilterGBlurSchema=object({type:literal(`gblur`),sigma:number().min(0).max(100).optional().default(30)}),mulmoVideoFilterAvgBlurSchema=object({type:literal(`avgblur`),sizeX:number().min(1).max(100).optional().default(10),sizeY:number().min(1).max(100).optional().default(10)}),mulmoVideoFilterUnsharpSchema=object({type:literal(`unsharp`),luma_msize_x:number().min(3).max(23).optional().default(5),luma_msize_y:number().min(3).max(23).optional().default(5),luma_amount:number().min(-2).max(5).optional().default(1),chroma_msize_x:number().min(3).max(23).optional().default(5),chroma_msize_y:number().min(3).max(23).optional().default(5),chroma_amount:number().min(-2).max(5).optional().default(0)}),mulmoVideoFilterEdgeDetectSchema=object({type:literal(`edgedetect`),low:number().min(0).max(1).optional().default(.2),high:number().min(0).max(1).optional().default(.4),mode:_enum([`wires`,`colormix`,`canny`]).optional().default(`wires`)}),mulmoVideoFilterSobelSchema=object({type:literal(`sobel`),planes:number().min(0).max(15).optional().default(15),scale:number().min(0).max(65535).optional().default(1),delta:number().min(-65535).max(65535).optional().default(0)}),mulmoVideoFilterEmbossSchema=object({type:literal(`emboss`)}),mulmoVideoFilterGlitchSchema=object({type:literal(`glitch`),intensity:number().min(1).max(100).optional().default(20),style:_enum([`noise`,`blend`]).optional().default(`noise`)}),mulmoVideoFilterGrainSchema=object({type:literal(`grain`),intensity:number().min(1).max(100).optional().default(10)}),mulmoVideoFilterHFlipSchema=object({type:literal(`hflip`)}),mulmoVideoFilterVFlipSchema=object({type:literal(`vflip`)}),mulmoVideoFilterRotateSchema=object({type:literal(`rotate`),angle:number().optional().default(0),fillcolor:string().optional().default(`black`)}),mulmoVideoFilterTransposeSchema=object({type:literal(`transpose`),dir:_enum([`cclock`,`clock`,`cclock_flip`,`clock_flip`]).optional().default(`clock`)}),mulmoVideoFilterVignetteSchema=object({type:literal(`vignette`),angle:number().min(0).max(Math.PI).optional().default(Math.PI/5),x0:number().min(0).max(1).optional(),y0:number().min(0).max(1).optional(),mode:_enum([`forward`,`backward`]).optional().default(`forward`)}),mulmoVideoFilterFadeSchema=object({type:literal(`fade`),mode:_enum([`in`,`out`]).optional().default(`in`),start_frame:number().min(0).optional().default(0),nb_frames:number().min(1).optional().default(25),alpha:boolean().optional().default(!1),color:string().optional().default(`black`)}),mulmoVideoFilterPixelizeSchema=object({type:literal(`pixelize`),width:number().min(1).max(1e3).optional().default(16),height:number().min(1).max(1e3).optional().default(16),mode:_enum([`avg`,`min`,`max`]).optional().default(`avg`)}),mulmoVideoFilterPseudoColorSchema=object({type:literal(`pseudocolor`),preset:_enum([`magma`,`inferno`,`plasma`,`viridis`,`turbo`,`cividis`,`range1`,`range2`,`shadows`,`highlights`,`solar`,`nominal`,`preferred`,`total`]).optional().default(`magma`)}),mulmoVideoFilterTmixSchema=object({type:literal(`tmix`),frames:number().min(1).max(1024).optional().default(3),weights:string().optional()}),mulmoVideoFilterLagfunSchema=object({type:literal(`lagfun`),decay:number().min(0).max(1).optional().default(.95),planes:number().min(0).max(15).optional().default(15)}),mulmoVideoFilterThresholdSchema=object({type:literal(`threshold`),planes:number().min(0).max(15).optional().default(15)}),mulmoVideoFilterElbgSchema=object({type:literal(`elbg`),codebook_length:number().min(1).max(256).optional().default(256)}),mulmoVideoFilterLensDistortionSchema=object({type:literal(`lensdistortion`),k1:number().min(-1).max(1).optional().default(0),k2:number().min(-1).max(1).optional().default(0)}),mulmoVideoFilterChromaShiftSchema=object({type:literal(`chromashift`),cbh:number().min(-255).max(255).optional().default(0),cbv:number().min(-255).max(255).optional().default(0),crh:number().min(-255).max(255).optional().default(0),crv:number().min(-255).max(255).optional().default(0),edge:_enum([`smear`,`wrap`]).optional().default(`smear`)}),mulmoVideoFilterDeflickerSchema=object({type:literal(`deflicker`),size:number().min(2).max(129).optional().default(5),mode:_enum([`am`,`gm`,`hm`,`qm`,`cm`,`pm`,`median`]).optional().default(`am`)}),mulmoVideoFilterDctDenoiseSchema=object({type:literal(`dctdnoiz`),sigma:number().min(0).max(999).optional().default(10)}),mulmoVideoFilterCustomSchema=object({type:literal(`custom`),filter:string()}),mulmoVideoFilterSchema=union([mulmoVideoFilterMonoSchema,mulmoVideoFilterSepiaSchema,mulmoVideoFilterBrightnessContrastSchema,mulmoVideoFilterHueSchema,mulmoVideoFilterColorBalanceSchema,mulmoVideoFilterVibranceSchema,mulmoVideoFilterNegateSchema,mulmoVideoFilterColorHoldSchema,mulmoVideoFilterColorKeySchema,mulmoVideoFilterBlurSchema,mulmoVideoFilterGBlurSchema,mulmoVideoFilterAvgBlurSchema,mulmoVideoFilterUnsharpSchema,mulmoVideoFilterEdgeDetectSchema,mulmoVideoFilterSobelSchema,mulmoVideoFilterEmbossSchema,mulmoVideoFilterGlitchSchema,mulmoVideoFilterGrainSchema,mulmoVideoFilterHFlipSchema,mulmoVideoFilterVFlipSchema,mulmoVideoFilterRotateSchema,mulmoVideoFilterTransposeSchema,mulmoVideoFilterVignetteSchema,mulmoVideoFilterFadeSchema,mulmoVideoFilterPixelizeSchema,mulmoVideoFilterPseudoColorSchema,mulmoVideoFilterTmixSchema,mulmoVideoFilterLagfunSchema,mulmoVideoFilterThresholdSchema,mulmoVideoFilterElbgSchema,mulmoVideoFilterLensDistortionSchema,mulmoVideoFilterChromaShiftSchema,mulmoVideoFilterDeflickerSchema,mulmoVideoFilterDctDenoiseSchema,mulmoVideoFilterCustomSchema]),hexColorSchema=string().regex(/^[0-9A-Fa-f]{6}$/),accentColorKeySchema=_enum([`primary`,`accent`,`success`,`warning`,`danger`,`info`,`highlight`]),slideThemeColorsSchema=object({bg:hexColorSchema,bgCard:hexColorSchema,bgCardAlt:hexColorSchema,text:hexColorSchema,textMuted:hexColorSchema,textDim:hexColorSchema,primary:hexColorSchema,accent:hexColorSchema,success:hexColorSchema,warning:hexColorSchema,danger:hexColorSchema,info:hexColorSchema,highlight:hexColorSchema}),slideThemeFontsSchema=object({title:string(),body:string(),mono:string()}),slideThemeSchema=object({colors:slideThemeColorsSchema,fonts:slideThemeFontsSchema}),textBlockSchema=object({type:literal(`text`),value:string(),align:_enum([`left`,`center`,`right`]).optional(),bold:boolean().optional(),dim:boolean().optional(),fontSize:number().optional(),color:accentColorKeySchema.optional()}),subBulletItemSchema=union([string(),object({text:string()})]),bulletItemSchema=union([string(),object({text:string(),items:array(subBulletItemSchema).optional()})]),bulletsBlockSchema=object({type:literal(`bullets`),items:array(bulletItemSchema),ordered:boolean().optional(),icon:string().optional()}),codeBlockSchema=object({type:literal(`code`),code:string(),language:string().optional()}),calloutBlockSchema=object({type:literal(`callout`),text:string(),label:string().optional(),color:accentColorKeySchema.optional(),style:_enum([`quote`,`info`,`warning`]).optional()}),metricBlockSchema=object({type:literal(`metric`),value:string(),label:string(),color:accentColorKeySchema.optional(),change:string().optional()}),dividerBlockSchema=object({type:literal(`divider`),color:accentColorKeySchema.optional()}),imageBlockSchema=object({type:literal(`image`),src:string(),alt:string().optional(),fit:_enum([`contain`,`cover`]).optional()}),imageRefBlockSchema=object({type:literal(`imageRef`),ref:string(),alt:string().optional(),fit:_enum([`contain`,`cover`]).optional()}),chartBlockSchema=object({type:literal(`chart`),chartData:record(string(),unknown()),title:string().optional()}),mermaidBlockSchema=object({type:literal(`mermaid`),code:string(),title:string().optional()}),tableCellValueSchema=union([string(),object({text:string(),color:accentColorKeySchema.optional(),bold:boolean().optional(),badge:boolean().optional()})]),tableBlockSchema=object({type:literal(`table`),title:string().optional(),headers:array(string()).optional(),rows:array(array(tableCellValueSchema)),rowHeaders:boolean().optional(),striped:boolean().optional()}),baseBlockSchemas=[textBlockSchema,bulletsBlockSchema,codeBlockSchema,calloutBlockSchema,metricBlockSchema,dividerBlockSchema,imageBlockSchema,imageRefBlockSchema,chartBlockSchema,mermaidBlockSchema,tableBlockSchema],nonSectionContentBlockSchema=discriminatedUnion(`type`,[...baseBlockSchemas]),sectionBlockSchema=object({type:literal(`section`),label:string(),color:accentColorKeySchema.optional(),content:array(nonSectionContentBlockSchema).optional(),text:string().optional(),sidebar:boolean().optional()}),contentBlockSchema=discriminatedUnion(`type`,[...baseBlockSchemas,sectionBlockSchema]),calloutBarSchema=object({text:string(),label:string().optional(),color:accentColorKeySchema.optional(),align:_enum([`left`,`center`]).optional(),leftBar:boolean().optional()}),cardSchema=object({title:string(),accentColor:accentColorKeySchema.optional(),content:array(contentBlockSchema).optional(),footer:string().optional(),label:string().optional(),num:number().optional(),icon:string().optional()}),slideStyleSchema=object({bgColor:string().optional(),decorations:boolean().optional(),bgOpacity:number().optional(),footer:string().optional()}),slideBaseFields={accentColor:accentColorKeySchema.optional(),style:slideStyleSchema.optional()},titleSlideSchema=object({layout:literal(`title`),...slideBaseFields,title:string(),subtitle:string().optional(),author:string().optional(),note:string().optional()}),columnsSlideSchema=object({layout:literal(`columns`),...slideBaseFields,title:string(),stepLabel:string().optional(),subtitle:string().optional(),columns:array(cardSchema),showArrows:boolean().optional(),callout:calloutBarSchema.optional(),bottomText:string().optional()}),comparisonPanelSchema=object({title:string(),accentColor:accentColorKeySchema.optional(),content:array(contentBlockSchema).optional(),footer:string().optional()}),comparisonSlideSchema=object({layout:literal(`comparison`),...slideBaseFields,title:string(),stepLabel:string().optional(),subtitle:string().optional(),left:comparisonPanelSchema,right:comparisonPanelSchema,callout:calloutBarSchema.optional()}),gridItemSchema=object({title:string(),description:string().optional(),accentColor:accentColorKeySchema.optional(),num:number().optional(),icon:string().optional(),content:array(contentBlockSchema).optional()}),gridSlideSchema=object({layout:literal(`grid`),...slideBaseFields,title:string(),subtitle:string().optional(),gridColumns:number().optional(),items:array(gridItemSchema),footer:string().optional()}),bigQuoteSlideSchema=object({layout:literal(`bigQuote`),...slideBaseFields,quote:string(),author:string().optional(),role:string().optional()}),statItemSchema=object({value:string(),label:string(),color:accentColorKeySchema.optional(),change:string().optional()}),statsSlideSchema=object({layout:literal(`stats`),...slideBaseFields,title:string(),stepLabel:string().optional(),subtitle:string().optional(),stats:array(statItemSchema),callout:calloutBarSchema.optional()}),timelineItemSchema=object({date:string(),title:string(),description:string().optional(),color:accentColorKeySchema.optional(),done:boolean().optional()}),timelineSlideSchema=object({layout:literal(`timeline`),...slideBaseFields,title:string(),stepLabel:string().optional(),subtitle:string().optional(),items:array(timelineItemSchema)}),splitPanelSchema=object({title:string().optional(),subtitle:string().optional(),label:string().optional(),labelBadge:boolean().optional(),accentColor:accentColorKeySchema.optional(),content:array(contentBlockSchema).optional(),dark:boolean().optional(),ratio:number().optional(),valign:_enum([`top`,`center`,`bottom`]).optional()}),splitSlideSchema=object({layout:literal(`split`),...slideBaseFields,left:splitPanelSchema.optional(),right:splitPanelSchema.optional()}),matrixCellSchema=object({label:string(),items:array(string()).optional(),content:array(contentBlockSchema).optional(),accentColor:accentColorKeySchema.optional()}),matrixSlideSchema=object({layout:literal(`matrix`),...slideBaseFields,title:string(),stepLabel:string().optional(),subtitle:string().optional(),rows:number().optional(),cols:number().optional(),xAxis:object({low:string().optional(),high:string().optional(),label:string().optional()}).optional(),yAxis:object({low:string().optional(),high:string().optional(),label:string().optional()}).optional(),cells:array(matrixCellSchema)}),tableSlideSchema=object({layout:literal(`table`),...slideBaseFields,title:string(),stepLabel:string().optional(),subtitle:string().optional(),headers:array(string()),rows:array(array(tableCellValueSchema)),rowHeaders:boolean().optional(),striped:boolean().optional(),callout:calloutBarSchema.optional()}),waterfallItemSchema=object({label:string(),value:number(),isTotal:boolean().optional(),color:accentColorKeySchema.optional()}),waterfallSlideSchema=object({layout:literal(`waterfall`),...slideBaseFields,title:string(),stepLabel:string().optional(),subtitle:string().optional(),items:array(waterfallItemSchema),unit:string().optional(),callout:calloutBarSchema.optional()}),funnelStageSchema=object({label:string(),value:string().optional(),description:string().optional(),color:accentColorKeySchema.optional()}),funnelSlideSchema=object({layout:literal(`funnel`),...slideBaseFields,title:string(),stepLabel:string().optional(),subtitle:string().optional(),stages:array(funnelStageSchema),callout:calloutBarSchema.optional()}),slideMediaSourceSchema=discriminatedUnion(`kind`,[object({kind:literal(`url`),url:url$1()}).strict(),object({kind:literal(`base64`),data:string().min(1)}).strict(),object({kind:literal(`path`),path:string().min(1)}).strict()]),slideBackgroundImageSourceSchema=object({source:slideMediaSourceSchema,size:_enum([`cover`,`contain`,`fill`,`auto`]).optional(),opacity:number().min(0).max(1).optional(),bgOpacity:number().min(0).max(1).optional()}),slideBrandingLogoSchema=object({source:slideMediaSourceSchema,position:_enum([`top-left`,`top-right`,`bottom-left`,`bottom-right`]).default(`top-right`),width:number().positive().default(120)}).strict(),slideBrandingSchema=object({logo:slideBrandingLogoSchema.optional(),backgroundImage:slideBackgroundImageSourceSchema.optional()}).strict(),slideLayoutSchema=discriminatedUnion(`layout`,[titleSlideSchema,columnsSlideSchema,comparisonSlideSchema,gridSlideSchema,bigQuoteSlideSchema,statsSlideSchema,timelineSlideSchema,splitSlideSchema,matrixSlideSchema,tableSlideSchema,funnelSlideSchema,waterfallSlideSchema]),mulmoSlideMediaSchema=object({type:literal(`slide`),theme:slideThemeSchema.optional(),slide:slideLayoutSchema,reference:string().optional(),branding:slideBrandingSchema.nullable().optional()}).strict(),langSchema=string(),URLStringSchema=url$1(),localizedTextSchema=object({text:string(),lang:langSchema,texts:array(string()).optional(),ttsTexts:array(string()).optional(),cacheKey:string(),duration:number().optional()}).strict(),multiLingualTextsSchema=record(langSchema,localizedTextSchema),speechOptionsSchema=object({speed:number().optional(),instruction:string().optional(),decoration:string().optional(),stability:number().optional(),similarity_boost:number().optional()}).strict(),speakerIdSchema=string(),defaultSpeaker=`Presenter`,text2SpeechProviderSchema=_enum(Object.keys(provider2TTSAgent)).default(defaultProviders.tts),speakerDataSchema=object({displayName:record(langSchema,string()).optional(),voiceId:string(),isDefault:boolean().optional(),speechOptions:speechOptionsSchema.optional(),provider:text2SpeechProviderSchema.optional(),model:string().optional().describe(`TTS model to use for this speaker`),baseURL:string().optional(),apiVersion:string().optional()}).strict(),speakerSchema=speakerDataSchema.extend({lang:record(langSchema,speakerDataSchema).optional()}),speakerDictionarySchema=record(speakerIdSchema,speakerSchema),mulmoSpeechParamsSchema=object({speakers:speakerDictionarySchema}).default({speakers:{[defaultSpeaker]:{provider:defaultProviders.tts,voiceId:`shimmer`,displayName:{en:defaultSpeaker}}}}),mediaSourceSchema=discriminatedUnion(`kind`,[object({kind:literal(`url`),url:URLStringSchema}).strict(),object({kind:literal(`base64`),data:string().min(1)}).strict(),object({kind:literal(`path`),path:string().min(1)}).strict()]),mediaSourceMermaidSchema=discriminatedUnion(`kind`,[object({kind:literal(`url`),url:URLStringSchema}).strict(),object({kind:literal(`base64`),data:string().min(1)}).strict(),object({kind:literal(`text`),text:string().min(1)}).strict(),object({kind:literal(`path`),path:string().min(1)}).strict()]),backgroundImageSourceSchema=object({source:mediaSourceSchema,size:_enum([`cover`,`contain`,`fill`,`auto`]).optional(),opacity:number().min(0).max(1).optional()}),backgroundImageSchema=union([string(),backgroundImageSourceSchema]).nullable().optional(),stringOrStringArray=union([string(),array(string())]),row2Schema=tuple([stringOrStringArray,stringOrStringArray]),grid2x2Schema=tuple([stringOrStringArray,stringOrStringArray,stringOrStringArray,stringOrStringArray]),layoutFrameSchema=object({header:stringOrStringArray.optional(),"sidebar-left":stringOrStringArray.optional()}),layoutMainSchema=union([object({"row-2":row2Schema}),object({"2x2":grid2x2Schema}),object({content:stringOrStringArray})]),markdownLayoutSchema=layoutFrameSchema.and(layoutMainSchema),mulmoMarkdownMediaSchema=object({type:literal(`markdown`),markdown:union([stringOrStringArray,markdownLayoutSchema]),style:string().optional(),backgroundImage:backgroundImageSchema}).strict(),mulmoWebMediaSchema=object({type:literal(`web`),url:URLStringSchema}).strict(),mulmoPdfMediaSchema=object({type:literal(`pdf`),source:mediaSourceSchema}).strict(),mulmoImageMediaSchema=object({type:literal(`image`),source:mediaSourceSchema}).strict(),mulmoSvgMediaSchema=object({type:literal(`svg`),source:mediaSourceSchema}).strict(),mulmoMovieMediaSchema=object({type:literal(`movie`),source:mediaSourceSchema}).strict(),mulmoMoviePromptMediaSchema=object({type:literal(`moviePrompt`),prompt:string().min(1),imageName:string().optional().describe(`Reference an imageRefs key to use as image-to-video input`)}).strict(),mulmoTextSlideMediaSchema=object({type:literal(`textSlide`),slide:object({title:string(),subtitle:string().optional(),bullets:array(string()).optional()}),style:string().optional(),backgroundImage:backgroundImageSchema}).strict(),captionSplitSchema=_enum([`none`,`estimate`]).default(`none`),textSplitSchema=discriminatedUnion(`type`,[object({type:literal(`none`)}),object({type:literal(`delimiters`),delimiters:array(string()).optional()})]),mulmoCaptionParamsSchema=object({lang:langSchema.optional(),styles:array(string()).optional(),captionSplit:captionSplitSchema.optional(),textSplit:textSplitSchema.optional(),bottomOffset:number().min(0).max(100).optional()}).strict(),mulmoChartMediaSchema=object({type:literal(`chart`),title:string(),chartData:record(string(),any()),style:string().optional(),backgroundImage:backgroundImageSchema}).strict(),mulmoMermaidMediaSchema=object({type:literal(`mermaid`),title:string().describe(`The title of the diagram`),code:mediaSourceMermaidSchema.describe(`The code of the mermaid diagram`),appendix:array(string()).optional().describe(`The appendix of the mermaid diagram; typically, style information.`),style:string().optional(),backgroundImage:backgroundImageSchema}).strict(),swipePositionValue=union([number(),string()]),swipeTransitionSchema=object({opacity:number().min(0).max(1).optional(),rotate:number().optional(),scale:union([number(),tuple([number(),number()])]).optional(),translate:tuple([number(),number()]).optional(),bc:string().optional(),timing:tuple([number(),number()]).default([0,1]).optional().describe(`Animation timing [start, end] as ratio 0.0-1.0 of beat duration`)}).strict(),swipeLoopSchema=object({style:_enum([`vibrate`,`blink`,`wiggle`,`spin`,`shift`,`bounce`,`pulse`]),count:number().optional().describe(`Number of loop iterations. 0 = infinite`),delta:number().optional().describe(`Distance for vibrate / angle for wiggle`),duration:number().optional().describe(`Duration of one cycle in seconds`),direction:_enum([`n`,`s`,`e`,`w`]).optional().describe(`Direction for shift animation`),clockwise:boolean().optional().describe(`Spin direction. Default: true`)}).strict(),swipeShadowSchema=object({color:string().optional().default(`black`),offset:tuple([number(),number()]).optional().default([1,1]),opacity:number().optional().default(.5),radius:number().optional().default(1)}).strict(),swipeElementSchema=lazy(()=>object({id:string().optional(),x:swipePositionValue.optional(),y:swipePositionValue.optional(),w:swipePositionValue.optional(),h:swipePositionValue.optional(),pos:tuple([swipePositionValue,swipePositionValue]).optional().describe(`Position by anchor point [x, y]`),bc:string().optional().describe(`Background color`),opacity:number().min(0).max(1).optional(),rotate:number().optional(),scale:union([number(),tuple([number(),number()])]).optional(),translate:tuple([number(),number()]).optional(),cornerRadius:number().optional(),borderWidth:number().optional(),borderColor:string().optional(),shadow:swipeShadowSchema.optional(),clip:boolean().optional(),text:string().optional(),fontSize:union([number(),string()]).optional(),fontWeight:string().optional(),textColor:string().optional(),textAlign:_enum([`center`,`left`,`right`]).optional(),lineHeight:union([number(),string()]).optional(),img:string().optional().describe(`Image URL or image:ref`),imgFit:_enum([`contain`,`cover`,`fill`]).optional().default(`contain`),to:swipeTransitionSchema.optional().describe(`Transition animation`),loop:swipeLoopSchema.optional().describe(`Loop animation`),elements:array(lazy(()=>swipeElementSchema)).optional()}).strict()),htmlTailwindAnimationSchema=union([literal(!0),object({fps:number().min(1).max(60).optional().default(30),movie:boolean().optional().describe(`Use CDP screencast for real-time recording (experimental, faster). Default: false (frame-by-frame screenshot).`)})]),mulmoHtmlTailwindMediaSchema=object({type:literal(`html_tailwind`),html:stringOrStringArray.optional(),script:stringOrStringArray.optional().describe(`JavaScript code for the beat. Injected as a <script> tag after html. Use for render() function etc.`),elements:array(swipeElementSchema).optional().describe(`Swipe-style declarative animation elements. Converted to HTML + render() automatically. Use this OR html, not both.`),animation:htmlTailwindAnimationSchema.optional().describe(`Enable frame-based animation (Remotion-style). true for defaults (30fps), or { fps: N } for custom frame rate.`)}).strict(),mulmoBeatReferenceMediaSchema=object({type:literal(`beat`),id:string().optional().describe(`Specifies the beat to reference.`)}).strict(),mulmoVoiceOverMediaSchema=object({type:literal(`voice_over`),startAt:number().optional().describe(`The time to start the voice over the video in seconds.`)}).strict(),mulmoVisionMediaSchema=object({type:literal(`vision`),style:string().min(1),data:record(string(),any())}).strict(),mulmoImageAssetSchema=union([mulmoMarkdownMediaSchema,mulmoWebMediaSchema,mulmoPdfMediaSchema,mulmoImageMediaSchema,mulmoSvgMediaSchema,mulmoMovieMediaSchema,mulmoTextSlideMediaSchema,mulmoChartMediaSchema,mulmoMermaidMediaSchema,mulmoHtmlTailwindMediaSchema,mulmoBeatReferenceMediaSchema,mulmoVoiceOverMediaSchema,mulmoVisionMediaSchema,mulmoSlideMediaSchema]),mulmoAudioMediaSchema=object({type:literal(`audio`),source:mediaSourceSchema}).strict(),mulmoMidiMediaSchema=object({type:literal(`midi`),source:string()}).strict(),mulmoAudioAssetSchema=union([mulmoAudioMediaSchema,mulmoMidiMediaSchema]),imageIdSchema=string(),mulmoImagePromptMediaSchema=object({type:literal(`imagePrompt`),prompt:string().min(1),canvasSize:object({width:number(),height:number()}).strict().optional(),referenceImageName:imageIdSchema.optional().describe(`Reference another imageRefs key as input for image generation`),referenceImage:mediaSourceSchema.optional().describe(`Direct source (path/url/base64) as reference image for generation`)}).strict(),mulmoImageParamsImagesValueSchema=union([mulmoImageMediaSchema,mulmoImagePromptMediaSchema,mulmoMovieMediaSchema,mulmoMoviePromptMediaSchema]),mulmoImageParamsImagesSchema=record(imageIdSchema,mulmoImageParamsImagesValueSchema),mulmoFillOptionSchema=object({style:_enum([`aspectFit`,`aspectFill`]).optional().default(`aspectFit`)}).describe(`How to handle aspect ratio differences between image and canvas`),text2ImageProviderSchema=_enum(Object.keys(provider2ImageAgent)).optional(),mulmoOpenAIImageModelSchema=object({provider:literal(`openai`),model:_enum(provider2ImageAgent.openai.models).optional(),quality:_enum([`low`,`medium`,`high`,`auto`]).optional()}).strict(),mulmoGoogleImageModelSchema=object({provider:literal(`google`),model:_enum(provider2ImageAgent.google.models).optional()}).strict(),mulmoBeatImageParamsSchema=object({provider:text2ImageProviderSchema,model:string().optional(),quality:string().optional(),style:string().optional(),moderation:string().optional(),baseURL:string().optional(),apiVersion:string().optional(),vertexai_project:string().optional(),vertexai_location:string().optional()}).strict(),mulmoImageParamsSchema=mulmoBeatImageParamsSchema.extend({images:mulmoImageParamsImagesSchema.optional(),backgroundImage:backgroundImageSchema,concurrency:number().int().positive().optional().describe(`Max concurrent image generation requests`)}).strict(),textSlideParamsSchema=object({cssStyles:stringOrStringArray}).strict(),mulmoSlideParamsSchema=object({theme:slideThemeSchema,branding:slideBrandingSchema.optional()}).strict(),beatAudioParamsSchema=object({padding:number().optional().describe(`Padding between beats`),movieVolume:number().min(0).max(1).optional().describe(`Audio volume of the imported or generated movie`)}).strict(),mulmoHtmlImageParamsSchema=object({model:string().optional()}).strict(),audioParamsSchema=object({padding:number().optional().default(.3).describe(`Padding between beats`),introPadding:number().optional().default(1).describe(`Padding at the beginning of the audio`),closingPadding:number().optional().default(.8).describe(`Padding before the last beat`),outroPadding:number().optional().default(1).describe(`Padding at the end of the audio`),bgm:mediaSourceSchema.optional(),bgmVolume:number().optional().default(.2).describe(`Volume of the background music`),audioVolume:number().optional().default(1).describe(`Volume of the audio`),suppressSpeech:boolean().optional().default(!1).describe(`Suppress speech generation`),movieVolume:number().min(0).max(1).optional().describe(`Default movie audio volume for all beats`),ttsVolume:number().min(0).max(2).optional().describe(`TTS narration volume before mixing with BGM/movie audio`),ducking:object({ratio:number().min(0).max(1).optional().describe(`Movie volume ratio during TTS beats (default 0.3)`)}).optional().describe(`Auto-reduce movie audio when TTS is playing`),concurrency:number().int().positive().optional().describe(`Max concurrent TTS generation requests`)}).strict(),htmlPromptParamsSchema=object({systemPrompt:string().optional().default(``),prompt:string().min(1),data:any().optional(),images:record(string(),any()).optional()}).strict(),text2MovieProviderSchema=_enum(Object.keys(provider2MovieAgent)),text2SoundEffectProviderSchema=_enum(Object.keys(provider2SoundEffectAgent)).default(defaultProviders.soundEffect),mulmoSoundEffectParamsSchema=object({provider:text2SoundEffectProviderSchema.optional(),model:string().optional()}),mulmoLipSyncParamsSchema=object({provider:string().optional(),model:string().optional()}),mulmoTransitionSchema=object({type:_enum([`fade`,`slideout_left`,`slideout_right`,`slideout_up`,`slideout_down`,`slidein_left`,`slidein_right`,`slidein_up`,`slidein_down`,`wipeleft`,`wiperight`,`wipeup`,`wipedown`,`wipetl`,`wipetr`,`wipebl`,`wipebr`]),duration:number().min(0).max(2).optional().default(.3)}),movieReferenceImageSchema=object({imageName:imageIdSchema.describe(`Reference an imageRefs key`),referenceType:_enum([`ASSET`,`STYLE`]).describe(`ASSET: scene/object/character, STYLE: aesthetics/lighting`)}),mulmoMovieParamsSchema=object({provider:text2MovieProviderSchema.optional(),model:string().optional(),fillOption:mulmoFillOptionSchema.optional(),transition:mulmoTransitionSchema.optional(),filters:array(mulmoVideoFilterSchema).optional(),vertexai_project:string().optional(),vertexai_location:string().optional(),firstFrameImageName:imageIdSchema.optional().describe(`Reference an imageRefs key for the first frame (image-to-video input)`),lastFrameImageName:imageIdSchema.optional().describe(`Reference an imageRefs key for the last frame (image-to-video interpolation)`),referenceImages:array(movieReferenceImageSchema).optional().describe(`Style/asset reference images (Veo 3.1). Mutually exclusive with imageName/lastFrameImageName`),concurrency:number().int().positive().optional().describe(`Max concurrent movie generation requests`),generateAudio:boolean().optional().describe(`Request audio generation in the video (model-dependent)`)}),mulmoBeatSchema=object({speaker:speakerIdSchema.optional(),text:string().optional().default(``).describe(`Text to be spoken. If empty, the audio is not generated.`),texts:array(string()).optional().describe(`Manually split texts for captions. Takes precedence over text for caption display.`),id:string().optional().describe(`Unique identifier for the beat.`),description:string().optional(),image:mulmoImageAssetSchema.optional(),audio:mulmoAudioAssetSchema.optional(),duration:number().optional().describe(`Duration of the beat. Used only when the text is empty`),imageParams:mulmoBeatImageParamsSchema.optional(),audioParams:beatAudioParamsSchema.optional(),movieParams:mulmoMovieParamsSchema.extend({speed:number().optional().describe(`Speed of the video. 1.0 is normal speed. 0.5 is half speed. 2.0 is double speed.`)}).optional(),soundEffectParams:mulmoSoundEffectParamsSchema.optional(),lipSyncParams:mulmoLipSyncParamsSchema.optional(),htmlImageParams:mulmoHtmlImageParamsSchema.optional(),speechOptions:speechOptionsSchema.optional(),textSlideParams:textSlideParamsSchema.optional(),captionParams:mulmoCaptionParamsSchema.optional(),images:mulmoImageParamsImagesSchema.optional().describe(`Beat-local media references. Same schema as imageParams.images. Merged with global refs (local takes precedence).`),imageNames:array(imageIdSchema).optional(),imagePrompt:string().optional(),moviePrompt:string().optional(),soundEffectPrompt:string().optional(),htmlPrompt:htmlPromptParamsSchema.optional(),enableLipSync:boolean().optional().describe(`Enable lip sync generation for this beat`),hidden:boolean().optional().describe(`Hide this beat from the presentation`)}).strict(),mulmoCanvasDimensionSchema=object({width:number(),height:number()}).default({width:1280,height:720}),mulmoCastCreditSchema=object({version:literal(`1.1`),credit:literal(`closing`).optional()}).strict(),text2HtmlImageProviderSchema=_enum(htmlLLMProvider).default(defaultProviders.text2Html),mulmoGoogleMovieModelSchema=object({provider:literal(`google`),model:_enum(provider2MovieAgent.google.models).optional()}).strict(),mulmoReplicateMovieModelSchema=object({provider:literal(`replicate`),model:_enum(provider2MovieAgent.replicate.models).optional()}).strict(),mulmoPresentationStyleSchema=object({$mulmocast:mulmoCastCreditSchema,canvasSize:mulmoCanvasDimensionSchema,speechParams:mulmoSpeechParamsSchema,imageParams:mulmoImageParamsSchema.optional().default({provider:defaultProviders.text2image,images:{}}),movieParams:mulmoMovieParamsSchema.optional().default({provider:defaultProviders.text2movie}),soundEffectParams:mulmoSoundEffectParamsSchema.optional().default({provider:defaultProviders.soundEffect}),lipSyncParams:mulmoLipSyncParamsSchema.optional(),htmlImageParams:mulmoHtmlImageParamsSchema.extend({provider:text2HtmlImageProviderSchema}).optional(),textSlideParams:textSlideParamsSchema.optional(),slideParams:mulmoSlideParamsSchema.optional(),captionParams:mulmoCaptionParamsSchema.optional(),audioParams:audioParamsSchema.default({introPadding:1,padding:.3,closingPadding:.8,outroPadding:1,bgmVolume:.2,audioVolume:1,suppressSpeech:!1})}),mulmoReferenceSchema=object({url:URLStringSchema,title:string().optional(),description:string().optional(),type:union([_enum([`article`,`paper`,`image`,`video`,`audio`]),string()]).optional().default(`article`)}),mulmoScriptSchema=mulmoPresentationStyleSchema.extend({title:string().optional(),description:string().optional(),references:array(mulmoReferenceSchema).optional(),lang:langSchema.optional().default(`en`),beats:array(mulmoBeatSchema).min(1),imagePath:string().optional(),__test_invalid__:boolean().optional()}).strict(),mulmoStudioBeatSchema=object({id:string().optional().describe(`Unique identifier for the beat.`),hash:string().optional(),duration:number().optional(),startAt:number().optional(),audioDuration:number().optional(),movieDuration:number().optional(),silenceDuration:number().optional(),hasMovieAudio:boolean().optional(),audioFile:string().optional(),imageFile:string().optional(),movieFile:string().optional(),soundEffectFile:string().optional(),lipSyncFile:string().optional(),captionFile:string().optional(),captionFiles:array(object({file:string(),startAt:number(),endAt:number()})).optional(),htmlImageFile:string().optional(),markdown:string().optional(),html:string().optional()}).strict(),mulmoStudioMultiLingualDataSchema=object({multiLingualTexts:multiLingualTextsSchema,cacheKey:string().optional()}),mulmoStudioMultiLingualArraySchema=array(mulmoStudioMultiLingualDataSchema).min(1),mulmoStudioMultiLingualSchema=record(string(),mulmoStudioMultiLingualDataSchema),mulmoStudioMultiLingualFileSchema=object({version:literal(`1.1`),multiLingual:mulmoStudioMultiLingualSchema}),mulmoSessionStateSchema=object({inSession:object({audio:boolean(),image:boolean(),video:boolean(),multiLingual:boolean(),caption:boolean(),pdf:boolean(),markdown:boolean(),html:boolean()}),inBeatSession:object({audio:record(string(),boolean()),image:record(string(),boolean()),movie:record(string(),boolean()),multiLingual:record(string(),boolean()),caption:record(string(),boolean()),html:record(string(),boolean()),imageReference:record(string(),boolean()),soundEffect:record(string(),boolean()),lipSync:record(string(),boolean())})}),mulmoStudioSchema=object({script:mulmoScriptSchema,filename:string(),beats:array(mulmoStudioBeatSchema).min(1)}).strict(),mulmoPromptTemplateSchema=object({title:string(),description:string(),systemPrompt:string(),scriptName:string().optional(),presentationStyle:mulmoPresentationStyleSchema.optional()}).strict(),mulmoPromptTemplateFileSchema=mulmoPromptTemplateSchema.extend({filename:string()}),mulmoStoryboardSceneSchema=object({description:string(),references:array(mulmoReferenceSchema).optional()}).describe(`A detailed description of the content of the scene, not the presentation style`).strict(),mulmoStoryboardSchema=object({title:string(),references:array(mulmoReferenceSchema).optional(),scenes:array(mulmoStoryboardSceneSchema)}).describe(`A storyboard for a presentation, a story, a video, etc.`).strict(),urlsSchema=array(url$1({message:`Invalid URL format`})),mulmoViewerBeatSchema=object({id:string().optional(),text:string().optional(),duration:number().optional(),startTime:number().optional(),endTime:number().optional(),importance:number().optional(),multiLinguals:record(string(),string()).optional(),audioSources:record(string(),string().optional()).optional(),imageSource:string().optional(),videoSource:string().optional(),videoWithAudioSource:string().optional(),htmlImageSource:string().optional(),soundEffectSource:string().optional()}),mulmoViewerDataSchema=object({beats:array(mulmoViewerBeatSchema),bgmSource:string().optional(),bgmFile:string().optional(),title:string().optional(),lang:string().optional()});function parseSSEEventLine(Ph){if(!Ph.startsWith(`data: `))return null;let Fh;try{Fh=JSON.parse(Ph.slice(6))}catch{return null}if(!isRecord(Fh))return null;let Ih=Fh;return Ih.type===`beat_image_done`&&typeof Ih.beatIndex==`number`?{type:`beat_image_done`,beatIndex:Ih.beatIndex}:Ih.type===`beat_audio_done`&&typeof Ih.beatIndex==`number`?{type:`beat_audio_done`,beatIndex:Ih.beatIndex}:Ih.type===`done`&&typeof Ih.moviePath==`string`?{type:`done`,moviePath:Ih.moviePath}:Ih.type===`error`&&typeof Ih.message==`string`?{type:`error`,message:Ih.message}:{type:`unknown`}}function shouldAutoRenderBeat(Ph,Fh,Ih){if(Fh)return!1;let Lh=Ph.image?.type;return typeof Lh==`string`?Ih.includes(Lh):!1}function getMissingCharacterKeys(Ph,Fh,Ih){return Ph.filter(Ph=>!Fh[Ph]&&Ih[Ph]!==`rendering`)}function validateBeatJSON(Ph,Fh){let Ih;try{Ih=JSON.parse(Ph)}catch{return!1}return Fh.safeParse(Ih).success}function extractErrorMessage(Ph){return errorMessage(Ph)}function applyMovieEvent(Ph,Fh){switch(Ph.type){case`beat_image_done`:Fh.onBeatImageDone(Ph.beatIndex);return;case`beat_audio_done`:Fh.onBeatAudioDone(Ph.beatIndex);return;case`done`:Fh.onDone(Ph.moviePath);return;case`error`:throw Error(Ph.message);case`unknown`:return}}async function streamMovieEvents(Ph,Fh){let Ih=Ph.getReader(),Lh=new TextDecoder,Rh=``;for(;;){let{done:Ph,value:zh}=await Ih.read();if(Ph)break;Rh+=Lh.decode(zh,{stream:!0});let Bh=Rh.split(`
|
|
4833
|
-
`);Rh=Bh.pop()??``;for(let Ph of Bh){let Ih=parseSSEEventLine(Ph);Ih&&applyMovieEvent(Ih,Fh)}}}var ACTIVE_SESSION_KEY=Symbol(`activeSession`);function provideActiveSession(Ph){provide(ACTIVE_SESSION_KEY,Ph)}function useActiveSession(){return inject(ACTIVE_SESSION_KEY)}var _hoisted_1$43={class:`h-full bg-white flex flex-col overflow-hidden`},_hoisted_2$43={class:`flex items-start justify-between px-6 py-4 border-b border-gray-100 shrink-0`},_hoisted_3$40={class:`min-w-0 flex-1`},_hoisted_4$34={class:`text-lg font-semibold text-gray-800 truncate`},_hoisted_5$29={key:0,class:`text-sm text-gray-500 mt-0.5 truncate`},_hoisted_6$29={class:`flex items-center gap-3 mt-1 text-xs text-gray-400`},_hoisted_7$27={key:0},_hoisted_8$25={key:1,class:`truncate`},_hoisted_9$22={class:`ml-4 shrink-0 flex gap-2`},_hoisted_10$21=[`href`],_hoisted_11$18=[`disabled`],_hoisted_12$17={key:0,class:`animate-spin w-3 h-3 shrink-0`,viewBox:`0 0 24 24`,fill:`none`},_hoisted_13$15={key:1},_hoisted_14$13={key:0,class:`border-b border-gray-100 shrink-0 px-4 py-3`},_hoisted_15$11={class:`flex items-center justify-between mb-2`},_hoisted_16$10={class:`text-xs font-semibold text-gray-500 uppercase tracking-wide`},_hoisted_17$10=[`disabled`],_hoisted_18$10={class:`flex gap-3 flex-wrap`},_hoisted_19$10=[`onDragover`,`onDragleave`,`onDrop`],_hoisted_20$6=[`src`,`alt`,`onClick`],_hoisted_21$6={key:1,class:`animate-spin w-4 h-4 text-green-400`,viewBox:`0 0 24 24`,fill:`none`},_hoisted_22$6={key:2,class:`text-xs text-red-400 text-center px-1`},_hoisted_23$5={key:3,class:`text-xs text-gray-300 text-center px-1 leading-tight`},_hoisted_24$4={key:4,class:`absolute bottom-0 inset-x-0 text-center text-xs text-gray-400 bg-white/70 py-0.5 pointer-events-none`},_hoisted_25$4={key:5,class:`absolute inset-0 flex items-center justify-center bg-blue-50/80 pointer-events-none`},_hoisted_26$4={class:`text-xs text-blue-500 font-medium`},_hoisted_27$4=[`disabled`,`onClick`],_hoisted_28$3={key:0,class:`inline-block animate-spin`},_hoisted_29$3={key:1},_hoisted_30$3=[`disabled`,`onClick`],_hoisted_31$3={key:0,class:`animate-spin w-3 h-3`,viewBox:`0 0 24 24`,fill:`none`},_hoisted_32$3={key:1},_hoisted_33$2={class:`text-xs text-gray-600 text-center truncate w-full`},_hoisted_34$1={class:`flex gap-3 items-stretch`},_hoisted_35$1=[`onDragover`,`onDragleave`,`onDrop`],_hoisted_36$1=[`src`,`alt`,`onClick`],_hoisted_37$1=[`disabled`,`onClick`],_hoisted_38$1={key:2,class:`w-full aspect-video flex flex-col items-center justify-center gap-1 p-2`},_hoisted_39$1={class:`text-xs text-green-500`},_hoisted_40$1={key:1,class:`text-xs text-red-400 text-center`},_hoisted_41$1={key:0,class:`text-xs text-gray-400 text-center italic leading-relaxed px-1`},_hoisted_42$1={key:1,class:`text-xs text-gray-300`},_hoisted_43$1={key:3,class:`absolute inset-0 flex items-center justify-center bg-blue-50/80 pointer-events-none`},_hoisted_44$1={class:`text-xs text-blue-500 font-medium`},_hoisted_45$1={key:4,class:`absolute bottom-0 inset-x-0 text-center text-xs text-gray-400 bg-white/70 py-0.5 pointer-events-none`},_hoisted_46$1=[`onClick`],_hoisted_47$1={class:`flex flex-col flex-1 min-w-0 px-2 py-1.5`},_hoisted_48$1={class:`text-sm text-gray-800 leading-relaxed`},_hoisted_49$1={class:`flex justify-between mt-auto pt-1`},_hoisted_50$1={class:`flex items-center gap-1`},_hoisted_51$1={key:0,class:`animate-spin w-3 h-3 text-green-400`,viewBox:`0 0 24 24`,fill:`none`},_hoisted_52$1=[`onClick`],_hoisted_53$1=[`title`],_hoisted_54$1=[`disabled`,`onClick`],_hoisted_55$1=[`onClick`],_hoisted_56$1=[`title`,`onClick`],_hoisted_57$1={key:0,class:`border-t border-gray-100`},_hoisted_58$1=[`onUpdate:modelValue`],_hoisted_59$1={class:`flex items-center justify-end gap-2 px-2 pb-2`},_hoisted_60$1={key:0,class:`text-xs text-red-600`,role:`alert`},_hoisted_61$1=[`disabled`,`onClick`],_hoisted_62$1={key:0,class:`flex items-center justify-center h-32 text-gray-400 text-sm`},_hoisted_63$1={class:`bottom-bar-wrapper`},_hoisted_64$1={class:`editor-actions`},_hoisted_65=[`disabled`],_hoisted_66=[`title`],_hoisted_67={class:`material-icons`},_hoisted_68=[`disabled`],_hoisted_69={class:`flex flex-col items-center gap-3`},_hoisted_70=[`src`],_hoisted_71={class:`flex items-center gap-4`},_hoisted_72={key:0,class:`max-w-[80vw] text-center text-white text-2xl leading-relaxed`},_hoisted_73=[`disabled`],View_vue_vue_type_script_setup_true_lang_default$2=defineComponent({__name:`View`,props:{selectedResult:{}},emits:[`updateResult`],setup(Ph,{emit:Fh}){let{t:Ih}=useI18n(),Lh=Ph,Rh=Fh,zh=computed(()=>Lh.selectedResult.data),Bh=computed(()=>zh.value?.script??{}),Vh=computed(()=>zh.value?.filePath??``),Hh=computed(()=>Bh.value.beats??[]),Uh=API_ROUTES.mulmoScript.downloadMovie,Wh=reactive({}),Gh=reactive({}),Kh=reactive({}),qh=reactive({}),Jh=reactive({}),Yh=reactive({}),Xh=reactive({}),Zh=reactive({}),Qh=ref(!1),$h=ref(null),eg=reactive({}),tg=reactive({}),ng=reactive({}),rg=ref(null),ig=ref(null),ag=ref(null),og=reactive({}),sg=reactive({}),cg=reactive({}),lg=reactive({}),ug=reactive({}),dg=computed(()=>Object.values(Wh).some(Ph=>Ph===`rendering`)),fg=computed(()=>{let Ph=Bh.value.imageParams?.images??{};return Object.keys(Ph).filter(Fh=>Ph[Fh]?.type===`imagePrompt`)}),pg=useActiveSession(),mg=computed(()=>pg?.value?.id),hg=computed(()=>{let Ph={},Fh=pg?.value?.pendingGenerations??{},Ih=Vh.value;if(!Ih)return Ph;for(let[Lh,Rh]of Object.entries(Fh))Rh.filePath===Ih&&(Ph[Lh]=Rh);return Ph});function gg(Ph){return Bh.value.imageParams?.images?.[Ph]?.prompt??``}function _g(Ph){rg.value&&=(rg.value.audio.pause(),null),ag.value={src:Gh[Ph],text:Fg(Ph).text,index:Ph}}let vg=computed(()=>{if(!ag.value)return!1;for(let Ph=ag.value.index-1;Ph>=0;Ph--)if(Gh[Ph])return!0;return!1}),yg=computed(()=>{if(!ag.value)return!1;for(let Ph=ag.value.index+1;Ph<Hh.value.length;Ph++)if(Gh[Ph])return!0;return!1});function bg(Ph){if(!ag.value)return;let Fh=Hh.value.length,Ih=ag.value.index+Ph;for(;Ih>=0&&Ih<Fh;){if(Gh[Ih]){_g(Ih);return}Ih+=Ph}}let xg=ref(),Sg=ref(!1),Cg=ref(``),{copied:wg,copy:Tg}=useClipboardCopy(),Eg=computed(()=>({...Bh.value,beats:Hh.value.map((Ph,Fh)=>Zh[Fh]??Ph)})),Dg=computed(()=>JSON.stringify(Eg.value,null,2)),Og=ref(``),kg=computed(()=>Cg.value!==Og.value),Ag=computed(()=>{try{let Ph=JSON.parse(Cg.value);return mulmoScriptSchema.safeParse(Ph).success}catch{return!1}});async function jg(Ph){if(Sg.value=Ph,Ph){let Ph=Dg.value;if(Vh.value){let Fh=await apiGet(API_ROUTES.files.content,{path:Vh.value});Fh.ok&&Fh.data.content&&(Ph=Fh.data.content)}Cg.value=Ph,Og.value=Ph}}function Mg(){xg.value&&(xg.value.open=!1)}async function Ng(){let Ph;try{Ph=JSON.parse(Cg.value)}catch(Ph){alert(extractErrorMessage(Ph));return}let Fh=await apiPost(API_ROUTES.mulmoScript.updateScript,{filePath:Vh.value,script:Ph});if(!Fh.ok){alert(Fh.error||`Update failed`);return}Rh(`updateResult`,{...Lh.selectedResult,data:{...Lh.selectedResult.data,script:Ph}}),xg.value&&(xg.value.open=!1),await n_()}async function Pg(){await Tg(Dg.value)}function Fg(Ph){return Zh[Ph]??Hh.value[Ph]??{}}function Ig(Ph){qh[Ph]||(Jh[Ph]=JSON.stringify(Fg(Ph),null,2),delete Yh[Ph]),qh[Ph]=!qh[Ph]}function Lg(Ph){return validateBeatJSON(Jh[Ph]??``,mulmoBeatSchema)}async function Rg(Ph){let Fh;try{Fh=JSON.parse(Jh[Ph])}catch(Fh){Yh[Ph]={kind:`invalidJson`,error:errorMessage(Fh)};return}let Ih=JSON.stringify(Fg(Ph).image);delete Yh[Ph],Xh[Ph]=!0;let Lh=await apiPost(API_ROUTES.mulmoScript.updateBeat,{filePath:Vh.value,beatIndex:Ph,beat:Fh});if(delete Xh[Ph],!Lh.ok){Yh[Ph]={kind:`saveFailed`,error:Lh.error};return}Zh[Ph]=Fh,qh[Ph]=!1,JSON.stringify(Fh.image)!==Ih&&(delete Gh[Ph],zg(Ph))}async function zg(Ph){Wh[Ph]=`rendering`;let Fh=await apiPost(API_ROUTES.mulmoScript.renderBeat,{filePath:Vh.value,beatIndex:Ph,chatSessionId:mg.value});if(!Fh.ok){Kh[Ph]=Fh.error||`Render failed`,Wh[Ph]=`error`;return}if(Fh.data.error){Kh[Ph]=Fh.data.error,Wh[Ph]=`error`;return}Gh[Ph]=Fh.data.image??``,Wh[Ph]=`done`,$g()}async function Bg(Ph){delete Gh[Ph],Wh[Ph]=`rendering`;let Fh=await apiPost(API_ROUTES.mulmoScript.renderBeat,{filePath:Vh.value,beatIndex:Ph,force:!0,chatSessionId:mg.value});if(!Fh.ok){Kh[Ph]=Fh.error||`Render failed`,Wh[Ph]=`error`;return}if(Fh.data.error){Kh[Ph]=Fh.data.error,Wh[Ph]=`error`;return}Gh[Ph]=Fh.data.image??``,Wh[Ph]=`done`}async function Vg(Ph){let Fh=await apiGet(API_ROUTES.mulmoScript.beatImage,{filePath:Vh.value,beatIndex:String(Ph)});Fh.ok&&Fh.data.image&&(Gh[Ph]=Fh.data.image,Wh[Ph]=`done`)}async function Hg(Ph){let Fh=await apiGet(API_ROUTES.mulmoScript.beatAudio,{filePath:Vh.value,beatIndex:String(Ph)});Fh.ok&&Fh.data.audio&&(eg[Ph]=Fh.data.audio,tg[Ph]=`done`)}async function Ug(Ph){tg[Ph]=`generating`,delete ng[Ph];let Fh=await apiPost(API_ROUTES.mulmoScript.generateBeatAudio,{filePath:Vh.value,beatIndex:Ph,chatSessionId:mg.value});if(!Fh.ok){ng[Ph]=Fh.error||`Audio generation failed`,tg[Ph]=`error`;return}if(Fh.data.error){ng[Ph]=Fh.data.error,tg[Ph]=`error`;return}eg[Ph]=Fh.data.audio??``,tg[Ph]=`done`}function Wg(Ph){if(rg.value){rg.value.audio.pause();let Fh=rg.value.index;if(rg.value=null,Fh===Ph)return}let Fh=eg[Ph];if(!Fh)return;let Ih=new Audio(Fh);rg.value={index:Ph,audio:Ih},Ih.addEventListener(`ended`,()=>{if(rg.value?.index===Ph&&(rg.value=null,ag.value?.index===Ph)){bg(1);let Fh=ag.value?.index;Fh!==void 0&&Fh!==Ph&&eg[Fh]&&Wg(Fh)}}),Ih.play()}function Gg(Ph,Fh){Ph.dataTransfer?.types.includes(`Files`)&&(Ph.preventDefault(),ug[Fh]=!0)}function Kg(Ph){ug[Ph]=!1}async function qg(Ph,Fh){Ph.preventDefault(),ug[Fh]=!1;let Ih=Ph.dataTransfer?.files[0];if(!Ih||!Ih.type.startsWith(`image/`))return;Wh[Fh]=`rendering`,delete Kh[Fh];let Lh;try{Lh=await new Promise((Ph,Fh)=>{let Lh=new FileReader;Lh.onload=()=>Ph(Lh.result),Lh.onerror=Fh,Lh.readAsDataURL(Ih)})}catch(Ph){Kh[Fh]=errorMessage(Ph),Wh[Fh]=`error`;return}let Rh=await apiPost(API_ROUTES.mulmoScript.uploadBeatImage,{filePath:Vh.value,beatIndex:Fh,imageData:Lh});if(!Rh.ok){Kh[Fh]=Rh.error||`Upload failed`,Wh[Fh]=`error`;return}if(Rh.data.error){Kh[Fh]=Rh.data.error,Wh[Fh]=`error`;return}Gh[Fh]=Rh.data.image??``,Wh[Fh]=`done`}function Jg(Ph,Fh){Ph.dataTransfer?.types.includes(`Files`)&&(Ph.preventDefault(),lg[Fh]=!0)}function Yg(Ph){lg[Ph]=!1}async function Xg(Ph,Fh){Ph.preventDefault(),lg[Fh]=!1;let Ih=Ph.dataTransfer?.files[0];if(!Ih||!Ih.type.startsWith(`image/`))return;og[Fh]=`rendering`,delete cg[Fh];let Lh;try{Lh=await new Promise((Ph,Fh)=>{let Lh=new FileReader;Lh.onload=()=>Ph(Lh.result),Lh.onerror=Fh,Lh.readAsDataURL(Ih)})}catch(Ph){cg[Fh]=errorMessage(Ph),og[Fh]=`error`;return}let Rh=await apiPost(API_ROUTES.mulmoScript.uploadCharacterImage,{filePath:Vh.value,key:Fh,imageData:Lh});if(!Rh.ok){cg[Fh]=Rh.error||`Upload failed`,og[Fh]=`error`;return}if(Rh.data.error){cg[Fh]=Rh.data.error,og[Fh]=`error`;return}sg[Fh]=Rh.data.image??``,og[Fh]=`done`}function Zg(Ph){rg.value&&=(rg.value.audio.pause(),null),ag.value={src:sg[Ph],text:Ph,index:-1,isCharacter:!0}}async function Qg(Ph){let Fh=await apiGet(API_ROUTES.mulmoScript.characterImage,{filePath:Vh.value,key:Ph});Fh.ok&&Fh.data.image&&(sg[Ph]=Fh.data.image,og[Ph]=`done`)}function $g(){getMissingCharacterKeys(fg.value,sg,og).forEach(Ph=>Qg(Ph))}async function e_(Ph,Fh){og[Ph]=`rendering`,delete cg[Ph];let Ih=await apiPost(API_ROUTES.mulmoScript.renderCharacter,{filePath:Vh.value,key:Ph,force:Fh,chatSessionId:mg.value});if(!Ih.ok){cg[Ph]=Ih.error||`Render failed`,og[Ph]=`error`;return}if(Ih.data.error){cg[Ph]=Ih.data.error,og[Ph]=`error`;return}sg[Ph]=Ih.data.image??``,og[Ph]=`done`}async function t_(){await Promise.all(fg.value.filter(Ph=>og[Ph]!==`rendering`).map(Ph=>e_(Ph,!1)))}async function n_(){ig.value&&(ig.value.scrollTop=0),Object.keys(Wh).forEach(Ph=>delete Wh[+Ph]),Object.keys(Gh).forEach(Ph=>delete Gh[+Ph]),Object.keys(Kh).forEach(Ph=>delete Kh[+Ph]),Object.keys(qh).forEach(Ph=>delete qh[+Ph]),Object.keys(Jh).forEach(Ph=>delete Jh[+Ph]),Object.keys(Yh).forEach(Ph=>delete Yh[+Ph]),Object.keys(Xh).forEach(Ph=>delete Xh[+Ph]),Object.keys(Zh).forEach(Ph=>delete Zh[+Ph]),Object.keys(eg).forEach(Ph=>delete eg[+Ph]),Object.keys(tg).forEach(Ph=>delete tg[+Ph]),Object.keys(ng).forEach(Ph=>delete ng[+Ph]),Object.keys(og).forEach(Ph=>delete og[Ph]),Object.keys(sg).forEach(Ph=>delete sg[Ph]),Object.keys(cg).forEach(Ph=>delete cg[Ph]),Object.keys(ug).forEach(Ph=>delete ug[+Ph]),$h.value=null,xg.value&&(xg.value.open=!1);let Ph=[`textSlide`,`markdown`,`chart`,`mermaid`,`html_tailwind`],Fh=fg.value.length>0;if(Hh.value.forEach((Ih,Lh)=>{shouldAutoRenderBeat(Ih,Fh,Ph)?zg(Lh):Ih.imagePrompt&&Vg(Lh),Ih.text&&Hg(Lh)}),fg.value.forEach(Ph=>Qg(Ph)),Vh.value){let Ph=await apiGet(API_ROUTES.mulmoScript.movieStatus,{filePath:Vh.value});Ph.ok&&Ph.data.moviePath&&($h.value=Ph.data.moviePath)}for(let Ph of Object.values(hg.value))r_(Ph)}onMounted(n_),watch(()=>Lh.selectedResult,n_),watch(hg,(Ph,Fh={})=>{for(let[Ih,Lh]of Object.entries(Ph))Ih in Fh||r_(Lh);for(let[Ih,Lh]of Object.entries(Fh))Ih in Ph||i_(Lh).catch(Ph=>{console.error(`[presentMulmoScript] reload on finish failed:`,Ph)})});function r_(Ph){if(Ph.kind===GENERATION_KINDS.beatImage){let Fh=Number(Ph.key);Gh[Fh]||(Wh[Fh]=`rendering`)}else if(Ph.kind===GENERATION_KINDS.beatAudio){let Fh=Number(Ph.key);eg[Fh]||(tg[Fh]=`generating`)}else Ph.kind===GENERATION_KINDS.characterImage?sg[Ph.key]||(og[Ph.key]=`rendering`):Ph.kind===GENERATION_KINDS.movie&&(Qh.value=!0)}async function i_(Ph){if(Ph.kind===GENERATION_KINDS.beatImage){let Fh=Number(Ph.key);await Vg(Fh),Wh[Fh]===`rendering`&&delete Wh[Fh]}else if(Ph.kind===GENERATION_KINDS.beatAudio){let Fh=Number(Ph.key);await Hg(Fh),tg[Fh]===`generating`&&delete tg[Fh]}else Ph.kind===GENERATION_KINDS.characterImage?(await Qg(Ph.key),og[Ph.key]===`rendering`&&delete og[Ph.key]):Ph.kind===GENERATION_KINDS.movie&&(Qh.value=!1,await a_())}async function a_(){if(!Vh.value)return;let Ph=await apiGet(API_ROUTES.mulmoScript.movieStatus,{filePath:Vh.value});Ph.ok&&Ph.data.moviePath&&($h.value=Ph.data.moviePath)}async function o_(){Qh.value=!0;try{let Ph=await apiFetchRaw(API_ROUTES.mulmoScript.generateMovie,{method:`POST`,body:JSON.stringify({filePath:Vh.value,chatSessionId:mg.value}),headers:{"Content-Type":`application/json`}});if(!Ph.ok||!Ph.body)throw Error(`Generation failed`);await streamMovieEvents(Ph.body,{onBeatImageDone:Ph=>{Vg(Ph),$g()},onBeatAudioDone:Ph=>Hg(Ph),onDone:Ph=>{$h.value=Ph}})}catch(Ph){alert(extractErrorMessage(Ph))}finally{Qh.value=!1}}return(Ph,Fh)=>(openBlock(),createElementBlock(`div`,_hoisted_1$43,[createBaseVNode(`div`,_hoisted_2$43,[createBaseVNode(`div`,_hoisted_3$40,[createBaseVNode(`h2`,_hoisted_4$34,toDisplayString$1(Bh.value.title||`Untitled Script`),1),Bh.value.description?(openBlock(),createElementBlock(`p`,_hoisted_5$29,toDisplayString$1(Bh.value.description),1)):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_6$29,[createBaseVNode(`span`,null,toDisplayString$1(unref(Ih)(`pluginMulmoScript.beatCount`,Hh.value.length,{named:{count:Hh.value.length}})),1),Bh.value.lang?(openBlock(),createElementBlock(`span`,_hoisted_7$27,toDisplayString$1(Bh.value.lang),1)):createCommentVNode(``,!0),Vh.value?(openBlock(),createElementBlock(`span`,_hoisted_8$25,toDisplayString$1(Vh.value),1)):createCommentVNode(``,!0)])]),createBaseVNode(`div`,_hoisted_9$22,[$h.value&&!Qh.value?(openBlock(),createElementBlock(`a`,{key:0,href:`${unref(Uh)}?moviePath=${encodeURIComponent($h.value)}`,download:``,class:`px-3 py-1 text-xs rounded-full border transition-colors border-gray-200 text-gray-500 hover:bg-gray-50 flex items-center justify-center gap-1`},[Fh[7]||=createBaseVNode(`span`,{class:`material-icons text-sm leading-none`},`download`,-1),createBaseVNode(`span`,null,toDisplayString$1(unref(Ih)(`pluginMulmoScript.movie`)),1)],8,_hoisted_10$21)):createCommentVNode(``,!0),createBaseVNode(`button`,{class:`px-3 py-1 text-xs rounded-full border transition-colors border-gray-200 text-gray-500 hover:bg-gray-50 disabled:opacity-40 flex items-center justify-center gap-1`,disabled:Qh.value,onClick:o_},[Qh.value?(openBlock(),createElementBlock(`svg`,_hoisted_12$17,[...Fh[8]||=[createBaseVNode(`circle`,{class:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,"stroke-width":`4`},null,-1),createBaseVNode(`path`,{class:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8v8H4z`},null,-1)]])):createCommentVNode(``,!0),Qh.value?(openBlock(),createElementBlock(`span`,_hoisted_13$15,toDisplayString$1(unref(Ih)(`pluginMulmoScript.generating`)),1)):(openBlock(),createElementBlock(Fragment,{key:2},[Fh[9]||=createBaseVNode(`span`,{class:`material-icons text-sm leading-none`},`refresh`,-1),createBaseVNode(`span`,null,toDisplayString$1(unref(Ih)(`pluginMulmoScript.movie`)),1)],64))],8,_hoisted_11$18)])]),fg.value.length>0?(openBlock(),createElementBlock(`div`,_hoisted_14$13,[createBaseVNode(`div`,_hoisted_15$11,[createBaseVNode(`span`,_hoisted_16$10,toDisplayString$1(unref(Ih)(`pluginMulmoScript.characters`)),1),createBaseVNode(`button`,{class:`px-2 py-0.5 text-xs rounded border border-gray-300 text-gray-500 hover:bg-gray-50 disabled:opacity-50`,disabled:Qh.value||dg.value||fg.value.every(Ph=>og[Ph]===`rendering`),onClick:t_},toDisplayString$1(unref(Ih)(`pluginMulmoScript.generateAll`)),9,_hoisted_17$10)]),createBaseVNode(`div`,_hoisted_18$10,[(openBlock(!0),createElementBlock(Fragment,null,renderList(fg.value,Ph=>(openBlock(),createElementBlock(`div`,{key:Ph,class:`flex flex-col items-center gap-1 w-36`},[createBaseVNode(`div`,{class:normalizeClass([`relative w-36 h-36 rounded-lg border overflow-hidden bg-gray-50 flex items-center justify-center transition-colors`,lg[Ph]?`border-blue-400 bg-blue-50`:`border-gray-200`]),onDragover:Fh=>Jg(Fh,Ph),onDragleave:Fh=>Yg(Ph),onDrop:Fh=>Xg(Fh,Ph)},[sg[Ph]?(openBlock(),createElementBlock(`img`,{key:0,src:sg[Ph],class:`w-full h-full object-cover cursor-zoom-in`,alt:Ph,onClick:Fh=>Zg(Ph)},null,8,_hoisted_20$6)):og[Ph]===`rendering`?(openBlock(),createElementBlock(`svg`,_hoisted_21$6,[...Fh[10]||=[createBaseVNode(`circle`,{class:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,"stroke-width":`4`},null,-1),createBaseVNode(`path`,{class:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8v8H4z`},null,-1)]])):og[Ph]===`error`?(openBlock(),createElementBlock(`span`,_hoisted_22$6,toDisplayString$1(cg[Ph]),1)):(openBlock(),createElementBlock(`span`,_hoisted_23$5,toDisplayString$1(gg(Ph)),1)),lg[Ph]?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_24$4,toDisplayString$1(unref(Ih)(`pluginMulmoScript.orDropImage`)),1)),lg[Ph]?(openBlock(),createElementBlock(`div`,_hoisted_25$4,[createBaseVNode(`span`,_hoisted_26$4,toDisplayString$1(unref(Ih)(`pluginMulmoScript.drop`)),1)])):createCommentVNode(``,!0),sg[Ph]&&og[Ph]!==`rendering`?(openBlock(),createElementBlock(`button`,{key:6,class:normalizeClass([`absolute top-0.5 right-0.5 px-1 py-0.5 text-xs rounded border bg-white`,Qh.value||dg.value?`border-yellow-400 text-yellow-500 cursor-not-allowed`:`border-gray-400 text-gray-600 hover:bg-gray-50`]),disabled:Qh.value||dg.value,onClick:withModifiers(Fh=>e_(Ph,!0),[`stop`])},[Qh.value||dg.value?(openBlock(),createElementBlock(`span`,_hoisted_28$3,`↺`)):(openBlock(),createElementBlock(`span`,_hoisted_29$3,`↺`))],10,_hoisted_27$4)):!sg[Ph]&&og[Ph]!==`rendering`?(openBlock(),createElementBlock(`button`,{key:7,class:normalizeClass([`absolute top-0.5 right-0.5 px-1 py-0.5 text-xs rounded border bg-white`,Qh.value||dg.value?`border-yellow-400 text-yellow-500 cursor-not-allowed`:`border-blue-400 text-blue-600 hover:bg-blue-50`]),disabled:Qh.value||dg.value,onClick:withModifiers(Fh=>e_(Ph,!1),[`stop`])},[Qh.value||dg.value?(openBlock(),createElementBlock(`svg`,_hoisted_31$3,[...Fh[11]||=[createBaseVNode(`circle`,{class:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,"stroke-width":`4`},null,-1),createBaseVNode(`path`,{class:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8v8H4z`},null,-1)]])):(openBlock(),createElementBlock(`span`,_hoisted_32$3,toDisplayString$1(unref(Ih)(`pluginMulmoScript.gen`)),1))],10,_hoisted_30$3)):createCommentVNode(``,!0)],42,_hoisted_19$10),createBaseVNode(`span`,_hoisted_33$2,toDisplayString$1(Ph),1)]))),128))])])):createCommentVNode(``,!0),createBaseVNode(`div`,{ref_key:`beatListEl`,ref:ig,class:`flex-1 overflow-y-auto p-2 space-y-1.5`},[(openBlock(!0),createElementBlock(Fragment,null,renderList(Hh.value,(Ph,Lh)=>(openBlock(),createElementBlock(`div`,{key:Lh,class:`rounded-lg border border-gray-200 overflow-hidden`},[createBaseVNode(`div`,_hoisted_34$1,[createBaseVNode(`div`,{class:normalizeClass([`relative shrink-0 w-[45%] overflow-hidden bg-gray-50 transition-colors`,ug[Lh]?`bg-blue-50`:``]),onDragover:Ph=>Gg(Ph,Lh),onDragleave:Ph=>Kg(Lh),onDrop:Ph=>qg(Ph,Lh)},[Gh[Lh]?(openBlock(),createElementBlock(`img`,{key:0,src:Gh[Lh],class:`w-full object-contain cursor-zoom-in`,alt:`Beat ${Lh+1}`,onClick:Ph=>_g(Lh)},null,8,_hoisted_36$1)):createCommentVNode(``,!0),Gh[Lh]&&Wh[Lh]!==`rendering`?(openBlock(),createElementBlock(`button`,{key:1,class:`absolute top-1.5 right-1.5 flex items-center gap-1 px-2 py-0.5 text-xs rounded border border-gray-400 text-gray-600 bg-white hover:bg-gray-50 disabled:opacity-60 disabled:cursor-not-allowed`,disabled:Qh.value,onClick:withModifiers(Ph=>Bg(Lh),[`stop`])},` ↺ `,8,_hoisted_37$1)):Gh[Lh]?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_38$1,[Wh[Lh]===`rendering`||Qh.value&&!Gh[Lh]&&Fg(Lh).imagePrompt?(openBlock(),createElementBlock(Fragment,{key:0},[Fh[12]||=createBaseVNode(`svg`,{class:`animate-spin w-4 h-4 text-green-400`,viewBox:`0 0 24 24`,fill:`none`},[createBaseVNode(`circle`,{class:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,"stroke-width":`4`}),createBaseVNode(`path`,{class:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8v8H4z`})],-1),createBaseVNode(`span`,_hoisted_39$1,toDisplayString$1(unref(Ih)(`pluginMulmoScript.rendering`)),1)],64)):Wh[Lh]===`error`?(openBlock(),createElementBlock(`span`,_hoisted_40$1,toDisplayString$1(Kh[Lh]),1)):(openBlock(),createElementBlock(Fragment,{key:2},[Fg(Lh).imagePrompt?(openBlock(),createElementBlock(`span`,_hoisted_41$1,toDisplayString$1(Fg(Lh).imagePrompt),1)):(openBlock(),createElementBlock(`span`,_hoisted_42$1,toDisplayString$1(Ph.image?.type??`—`),1))],64))])),ug[Lh]?(openBlock(),createElementBlock(`div`,_hoisted_43$1,[createBaseVNode(`span`,_hoisted_44$1,toDisplayString$1(unref(Ih)(`pluginMulmoScript.drop`)),1)])):!Gh[Lh]&&Wh[Lh]!==`rendering`?(openBlock(),createElementBlock(`div`,_hoisted_45$1,toDisplayString$1(unref(Ih)(`pluginMulmoScript.orDropImage`)),1)):createCommentVNode(``,!0),Fg(Lh).imagePrompt&&!Gh[Lh]&&Wh[Lh]!==`rendering`&&!Qh.value?(openBlock(),createElementBlock(`button`,{key:5,class:`absolute top-1.5 right-1.5 flex items-center gap-1 px-2 py-0.5 text-xs rounded border border-blue-400 text-blue-600 bg-white hover:bg-blue-50`,onClick:Ph=>zg(Lh)},toDisplayString$1(unref(Ih)(`pluginMulmoScript.generate`)),9,_hoisted_46$1)):createCommentVNode(``,!0)],42,_hoisted_35$1),createBaseVNode(`div`,_hoisted_47$1,[createBaseVNode(`span`,_hoisted_48$1,toDisplayString$1(Fg(Lh).text),1),createBaseVNode(`div`,_hoisted_49$1,[createBaseVNode(`div`,_hoisted_50$1,[tg[Lh]===`generating`||Qh.value&&!eg[Lh]&&Fg(Lh).text?(openBlock(),createElementBlock(`svg`,_hoisted_51$1,[...Fh[13]||=[createBaseVNode(`circle`,{class:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,"stroke-width":`4`},null,-1),createBaseVNode(`path`,{class:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8v8H4z`},null,-1)]])):eg[Lh]?(openBlock(),createElementBlock(`button`,{key:1,class:normalizeClass([`text-xs px-2 py-0.5 rounded border`,rg.value?.index===Lh?`border-red-400 text-red-600 hover:bg-red-50`:`border-green-400 text-green-600 hover:bg-green-50`]),onClick:Ph=>Wg(Lh)},toDisplayString$1(rg.value?.index===Lh?unref(Ih)(`pluginMulmoScript.stop`):unref(Ih)(`pluginMulmoScript.play`)),11,_hoisted_52$1)):ng[Lh]?(openBlock(),createElementBlock(Fragment,{key:2},[createBaseVNode(`span`,{class:`text-xs text-red-400`,title:ng[Lh]},toDisplayString$1(unref(Ih)(`pluginMulmoScript.errPrefix`)),9,_hoisted_53$1),Fg(Lh).text?(openBlock(),createElementBlock(`button`,{key:0,class:`text-xs px-2 py-0.5 rounded border border-gray-300 text-gray-500 hover:bg-gray-50 disabled:opacity-50`,disabled:Qh.value,onClick:Ph=>Ug(Lh)},` ↺ `,8,_hoisted_54$1)):createCommentVNode(``,!0)],64)):Fg(Lh).text?(openBlock(),createElementBlock(`button`,{key:3,class:`text-xs px-2 py-0.5 rounded border border-gray-300 text-gray-500 hover:bg-gray-50`,onClick:Ph=>Ug(Lh)},toDisplayString$1(unref(Ih)(`pluginMulmoScript.generateAudio`)),9,_hoisted_55$1)):createCommentVNode(``,!0)]),createBaseVNode(`button`,{class:`text-gray-400 hover:text-gray-600`,title:qh[Lh]?`Hide source`:`Show source`,onClick:Ph=>Ig(Lh)},[...Fh[14]||=[createBaseVNode(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:`w-3.5 h-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[createBaseVNode(`polyline`,{points:`16 18 22 12 16 6`}),createBaseVNode(`polyline`,{points:`8 6 2 12 8 18`})],-1)]],8,_hoisted_56$1)])])]),qh[Lh]?(openBlock(),createElementBlock(`div`,_hoisted_57$1,[withDirectives(createBaseVNode(`textarea`,{"onUpdate:modelValue":Ph=>Jh[Lh]=Ph,class:normalizeClass([`w-full text-xs text-gray-600 bg-gray-50 p-2 font-mono resize-none`,Lg(Lh)?`outline-none`:`outline outline-2 outline-red-400`]),rows:`8`,spellcheck:`false`},null,10,_hoisted_58$1),[[vModelText,Jh[Lh]]]),createBaseVNode(`div`,_hoisted_59$1,[Yh[Lh]?(openBlock(),createElementBlock(`span`,_hoisted_60$1,toDisplayString$1(unref(Ih)(Yh[Lh].kind===`invalidJson`?`pluginMulmoScript.saveErrorInvalidJson`:`pluginMulmoScript.saveErrorSaveFailed`,{error:Yh[Lh].error})),1)):createCommentVNode(``,!0),createBaseVNode(`button`,{class:normalizeClass([`px-2 py-1 text-xs rounded border`,Lg(Lh)&&!Xh[Lh]?`border-blue-400 text-blue-600 hover:bg-blue-50 cursor-pointer`:`border-gray-200 text-gray-300 cursor-not-allowed`]),disabled:!Lg(Lh)||!!Xh[Lh],onClick:Ph=>Rg(Lh)},toDisplayString$1(Xh[Lh]?unref(Ih)(`pluginMulmoScript.saving`):unref(Ih)(`pluginMulmoScript.update`)),11,_hoisted_61$1)])])):createCommentVNode(``,!0)]))),128)),Hh.value.length===0?(openBlock(),createElementBlock(`div`,_hoisted_62$1,toDisplayString$1(unref(Ih)(`pluginMulmoScript.noBeats`)),1)):createCommentVNode(``,!0)],512),createBaseVNode(`div`,_hoisted_63$1,[createBaseVNode(`details`,{ref_key:`sourceDetails`,ref:xg,class:`script-source`,onToggle:Fh[1]||=Ph=>jg(Ph.target.open)},[createBaseVNode(`summary`,null,toDisplayString$1(unref(Ih)(`pluginMulmoScript.editSource`)),1),withDirectives(createBaseVNode(`textarea`,{"onUpdate:modelValue":Fh[0]||=Ph=>Cg.value=Ph,class:normalizeClass([`script-editor`,{"script-editor-invalid":kg.value&&!Ag.value}]),spellcheck:`false`},null,2),[[vModelText,Cg.value]]),createBaseVNode(`div`,_hoisted_64$1,[createBaseVNode(`button`,{class:`apply-btn`,disabled:!kg.value||!Ag.value,onClick:Ng},toDisplayString$1(unref(Ih)(`pluginMulmoScript.applyChanges`)),9,_hoisted_65),createBaseVNode(`button`,{class:`cancel-btn`,onClick:Mg},toDisplayString$1(unref(Ih)(`common.cancel`)),1)])],544),withDirectives(createBaseVNode(`button`,{class:`copy-btn`,title:unref(wg)?`Copied!`:`Copy`,onClick:Pg},[createBaseVNode(`span`,_hoisted_67,toDisplayString$1(unref(wg)?`check`:`content_copy`),1)],8,_hoisted_66),[[vShow,!Sg.value]])]),ag.value?(openBlock(),createElementBlock(`div`,{key:1,class:`fixed inset-0 z-50 flex items-center justify-center bg-black/80`,onClick:Fh[6]||=Ph=>ag.value=null},[createBaseVNode(`div`,{class:`flex items-center gap-4`,onClick:Fh[5]||=withModifiers(()=>{},[`stop`])},[ag.value.isCharacter?createCommentVNode(``,!0):(openBlock(),createElementBlock(`button`,{key:0,class:`text-white/60 hover:text-white disabled:opacity-20 text-4xl leading-none`,disabled:!vg.value,onClick:Fh[2]||=Ph=>bg(-1)},` ‹ `,8,_hoisted_68)),createBaseVNode(`div`,_hoisted_69,[createBaseVNode(`img`,{src:ag.value.src,class:`max-w-[80vw] max-h-[80vh] object-contain rounded shadow-2xl`},null,8,_hoisted_70),createBaseVNode(`div`,_hoisted_71,[ag.value.text?(openBlock(),createElementBlock(`p`,_hoisted_72,toDisplayString$1(ag.value.text),1)):createCommentVNode(``,!0),eg[ag.value.index]?(openBlock(),createElementBlock(`button`,{key:1,class:normalizeClass([`shrink-0 text-sm px-3 py-1 rounded border`,rg.value?.index===ag.value.index?`border-red-400 text-red-400 hover:bg-red-400/20`:`border-white/60 text-white/60 hover:bg-white/20`]),onClick:Fh[3]||=Ph=>Wg(ag.value.index)},toDisplayString$1(rg.value?.index===ag.value.index?unref(Ih)(`pluginMulmoScript.stop`):unref(Ih)(`pluginMulmoScript.play`)),3)):createCommentVNode(``,!0)])]),ag.value.isCharacter?createCommentVNode(``,!0):(openBlock(),createElementBlock(`button`,{key:1,class:`text-white/60 hover:text-white disabled:opacity-20 text-4xl leading-none`,disabled:!yg.value,onClick:Fh[4]||=Ph=>bg(1)},` › `,8,_hoisted_73))])])):createCommentVNode(``,!0)]))}}),View_default$2=_plugin_vue_export_helper_default(View_vue_vue_type_script_setup_true_lang_default$2,[[`__scopeId`,`data-v-f7ad9276`]]),_hoisted_1$42={class:`p-2 text-sm`},_hoisted_2$42={class:`font-medium text-gray-700 truncate mb-1`},_hoisted_3$39={key:0,class:`text-xs text-gray-500 leading-relaxed`},Preview_vue_vue_type_script_setup_true_lang_default$2=defineComponent({__name:`Preview`,props:{result:{}},setup(Ph){let Fh=Ph,Ih=computed(()=>Fh.result.data),Lh=computed(()=>Ih.value?.script),Rh=computed(()=>Lh.value?.title||Ih.value?.filePath?.split(`/`).pop()||`MulmoScript`),zh=computed(()=>Lh.value?.description);return(Ph,Fh)=>(openBlock(),createElementBlock(`div`,_hoisted_1$42,[createBaseVNode(`div`,_hoisted_2$42,toDisplayString$1(Rh.value),1),zh.value?(openBlock(),createElementBlock(`div`,_hoisted_3$39,toDisplayString$1(zh.value),1)):createCommentVNode(``,!0)]))}}),Preview_default$2=Preview_vue_vue_type_script_setup_true_lang_default$2,presentMulmoScriptPlugin={toolDefinition:toolDefinition$2,async execute(Ph,Fh){let Ih=await apiPost(API_ROUTES.mulmoScript.save,Fh);return Ih.ok?{...Ih.data,toolName:TOOL_NAME$2,uuid:makeUuid()}:{toolName:TOOL_NAME$2,uuid:makeUuid(),message:Ih.error}},isEnabled:()=>!0,generatingMessage:`Generating MulmoScript storyboard…`,viewComponent:View_default$2,previewComponent:Preview_default$2},TOOL_NAME$1=`presentHtml`,toolDefinition$1={type:`function`,name:TOOL_NAME$1,description:`Save and present a complete, self-contained HTML page in the canvas. Claude generates the HTML and calls this tool to display it. Use for rich interactive output, dashboards, custom layouts, or any content best expressed as HTML.`,parameters:{type:`object`,properties:{html:{type:`string`,description:`Complete, self-contained HTML string. All CSS and JavaScript must be inline or loaded via CDN. Must be a full document (include <!DOCTYPE html> and <html>/<body> tags).`},title:{type:`string`,description:`Short label shown in the preview sidebar.`}},required:[`html`]}},_hoisted_1$41={class:`h-full flex flex-col overflow-hidden`},_hoisted_2$41={class:`px-4 py-2 border-b border-gray-100 shrink-0 flex items-center justify-between`},_hoisted_3$38={class:`text-sm font-medium text-gray-700 truncate`},_hoisted_4$33={class:`flex items-center gap-2`},_hoisted_5$28=[`title`],_hoisted_6$28={key:0,class:`border-b border-gray-100 shrink-0`},_hoisted_7$26=[`value`],_hoisted_8$24=[`srcdoc`],PRINT_STYLE=`<style>@media print {
|
|
4833
|
+
`);Rh=Bh.pop()??``;for(let Ph of Bh){let Ih=parseSSEEventLine(Ph);Ih&&applyMovieEvent(Ih,Fh)}}}var ACTIVE_SESSION_KEY=Symbol(`activeSession`);function provideActiveSession(Ph){provide(ACTIVE_SESSION_KEY,Ph)}function useActiveSession(){return inject(ACTIVE_SESSION_KEY)}var _hoisted_1$43={class:`h-full bg-white flex flex-col overflow-hidden`},_hoisted_2$43={class:`flex items-start justify-between px-6 py-4 border-b border-gray-100 shrink-0`},_hoisted_3$40={class:`min-w-0 flex-1`},_hoisted_4$34={class:`text-lg font-semibold text-gray-800 truncate`},_hoisted_5$29={key:0,class:`text-sm text-gray-500 mt-0.5 truncate`},_hoisted_6$29={class:`flex items-center gap-3 mt-1 text-xs text-gray-400`},_hoisted_7$27={key:0},_hoisted_8$25={key:1,class:`truncate`},_hoisted_9$22={class:`ml-4 shrink-0 flex gap-2`},_hoisted_10$21=[`href`],_hoisted_11$18=[`disabled`],_hoisted_12$17={key:0,class:`animate-spin w-3 h-3 shrink-0`,viewBox:`0 0 24 24`,fill:`none`},_hoisted_13$15={key:1},_hoisted_14$13={key:0,class:`border-b border-gray-100 shrink-0 px-4 py-3`},_hoisted_15$11={class:`flex items-center justify-between mb-2`},_hoisted_16$10={class:`text-xs font-semibold text-gray-500 uppercase tracking-wide`},_hoisted_17$10=[`disabled`],_hoisted_18$10={class:`flex gap-3 flex-wrap`},_hoisted_19$10=[`onDragover`,`onDragleave`,`onDrop`],_hoisted_20$6=[`src`,`alt`,`onClick`],_hoisted_21$6={key:1,class:`animate-spin w-4 h-4 text-green-400`,viewBox:`0 0 24 24`,fill:`none`},_hoisted_22$6={key:2,class:`text-xs text-red-400 text-center px-1`},_hoisted_23$5={key:3,class:`text-xs text-gray-300 text-center px-1 leading-tight`},_hoisted_24$4={key:4,class:`absolute bottom-0 inset-x-0 text-center text-xs text-gray-400 bg-white/70 py-0.5 pointer-events-none`},_hoisted_25$4={key:5,class:`absolute inset-0 flex items-center justify-center bg-blue-50/80 pointer-events-none`},_hoisted_26$4={class:`text-xs text-blue-500 font-medium`},_hoisted_27$4=[`disabled`,`onClick`],_hoisted_28$3={key:0,class:`inline-block animate-spin`},_hoisted_29$3={key:1},_hoisted_30$3=[`disabled`,`onClick`],_hoisted_31$3={key:0,class:`animate-spin w-3 h-3`,viewBox:`0 0 24 24`,fill:`none`},_hoisted_32$3={key:1},_hoisted_33$2={class:`text-xs text-gray-600 text-center truncate w-full`},_hoisted_34$1={class:`flex gap-3 items-stretch`},_hoisted_35$1=[`onDragover`,`onDragleave`,`onDrop`],_hoisted_36$1=[`src`,`alt`,`onClick`],_hoisted_37$1=[`disabled`,`onClick`],_hoisted_38$1={key:2,class:`w-full aspect-video flex flex-col items-center justify-center gap-1 p-2`},_hoisted_39$1={class:`text-xs text-green-500`},_hoisted_40$1={key:1,class:`text-xs text-red-400 text-center`},_hoisted_41$1={key:0,class:`text-xs text-gray-400 text-center italic leading-relaxed px-1`},_hoisted_42$1={key:1,class:`text-xs text-gray-300`},_hoisted_43$1={key:3,class:`absolute inset-0 flex items-center justify-center bg-blue-50/80 pointer-events-none`},_hoisted_44$1={class:`text-xs text-blue-500 font-medium`},_hoisted_45$1={key:4,class:`absolute bottom-0 inset-x-0 text-center text-xs text-gray-400 bg-white/70 py-0.5 pointer-events-none`},_hoisted_46$1=[`onClick`],_hoisted_47$1={class:`flex flex-col flex-1 min-w-0 px-2 py-1.5`},_hoisted_48$1={class:`text-sm text-gray-800 leading-relaxed`},_hoisted_49$1={class:`flex justify-between mt-auto pt-1`},_hoisted_50$1={class:`flex items-center gap-1`},_hoisted_51$1={key:0,class:`animate-spin w-3 h-3 text-green-400`,viewBox:`0 0 24 24`,fill:`none`},_hoisted_52$1=[`onClick`],_hoisted_53$1=[`title`],_hoisted_54$1=[`disabled`,`onClick`],_hoisted_55$1=[`onClick`],_hoisted_56$1=[`title`,`onClick`],_hoisted_57$1={key:0,class:`border-t border-gray-100`},_hoisted_58$1=[`onUpdate:modelValue`],_hoisted_59$1={class:`flex items-center justify-end gap-2 px-2 pb-2`},_hoisted_60$1={key:0,class:`text-xs text-red-600`,role:`alert`},_hoisted_61$1=[`disabled`,`onClick`],_hoisted_62$1={key:0,class:`flex items-center justify-center h-32 text-gray-400 text-sm`},_hoisted_63$1={class:`bottom-bar-wrapper`},_hoisted_64$1={class:`editor-actions`},_hoisted_65=[`disabled`],_hoisted_66=[`title`],_hoisted_67={class:`material-icons`},_hoisted_68=[`disabled`],_hoisted_69={class:`flex flex-col items-center gap-3`},_hoisted_70=[`src`],_hoisted_71={class:`flex items-center gap-4`},_hoisted_72={key:0,class:`max-w-[80vw] text-center text-white text-2xl leading-relaxed`},_hoisted_73=[`disabled`],View_vue_vue_type_script_setup_true_lang_default$2=defineComponent({__name:`View`,props:{selectedResult:{}},emits:[`updateResult`],setup(Ph,{emit:Fh}){let{t:Ih}=useI18n(),Lh=Ph,Rh=Fh,zh=computed(()=>Lh.selectedResult.data),Bh=computed(()=>zh.value?.script??{}),Vh=computed(()=>zh.value?.filePath??``),Hh=computed(()=>Bh.value.beats??[]),Uh=API_ROUTES.mulmoScript.downloadMovie,Wh=reactive({}),Gh=reactive({}),Kh=reactive({}),qh=reactive({}),Jh=reactive({}),Yh=reactive({}),Xh=reactive({}),Zh=reactive({}),Qh=ref(!1),$h=ref(null),eg=reactive({}),tg=reactive({}),ng=reactive({}),rg=ref(null),ig=ref(null),ag=ref(null),og=reactive({}),sg=reactive({}),cg=reactive({}),lg=reactive({}),ug=reactive({}),dg=computed(()=>Object.values(Wh).some(Ph=>Ph===`rendering`)),fg=computed(()=>{let Ph=Bh.value.imageParams?.images??{};return Object.keys(Ph).filter(Fh=>Ph[Fh]?.type===`imagePrompt`)}),pg=useActiveSession(),mg=computed(()=>pg?.value?.id),hg=computed(()=>{let Ph={},Fh=pg?.value?.pendingGenerations??{},Ih=Vh.value;if(!Ih)return Ph;for(let[Lh,Rh]of Object.entries(Fh))Rh.filePath===Ih&&(Ph[Lh]=Rh);return Ph});function gg(Ph){return Bh.value.imageParams?.images?.[Ph]?.prompt??``}function _g(Ph){rg.value&&=(rg.value.audio.pause(),null),ag.value={src:Gh[Ph],text:Fg(Ph).text,index:Ph}}let vg=computed(()=>{if(!ag.value)return!1;for(let Ph=ag.value.index-1;Ph>=0;Ph--)if(Gh[Ph])return!0;return!1}),yg=computed(()=>{if(!ag.value)return!1;for(let Ph=ag.value.index+1;Ph<Hh.value.length;Ph++)if(Gh[Ph])return!0;return!1});function bg(Ph){if(!ag.value)return;let Fh=Hh.value.length,Ih=ag.value.index+Ph;for(;Ih>=0&&Ih<Fh;){if(Gh[Ih]){_g(Ih);return}Ih+=Ph}}let xg=ref(),Sg=ref(!1),Cg=ref(``),{copied:wg,copy:Tg}=useClipboardCopy(),Eg=computed(()=>({...Bh.value,beats:Hh.value.map((Ph,Fh)=>Zh[Fh]??Ph)})),Dg=computed(()=>JSON.stringify(Eg.value,null,2)),Og=ref(``),kg=computed(()=>Cg.value!==Og.value),Ag=computed(()=>{try{let Ph=JSON.parse(Cg.value);return mulmoScriptSchema.safeParse(Ph).success}catch{return!1}});async function jg(Ph){if(Sg.value=Ph,Ph){let Ph=Dg.value;if(Vh.value){let Fh=await apiGet(API_ROUTES.files.content,{path:Vh.value});Fh.ok&&Fh.data.content&&(Ph=Fh.data.content)}Cg.value=Ph,Og.value=Ph}}function Mg(){xg.value&&(xg.value.open=!1)}async function Ng(){let Ph;try{Ph=JSON.parse(Cg.value)}catch(Ph){alert(extractErrorMessage(Ph));return}let Fh=await apiPost(API_ROUTES.mulmoScript.updateScript,{filePath:Vh.value,script:Ph});if(!Fh.ok){alert(Fh.error||`Update failed`);return}Rh(`updateResult`,{...Lh.selectedResult,data:{...Lh.selectedResult.data,script:Ph}}),xg.value&&(xg.value.open=!1),await n_()}async function Pg(){await Tg(Dg.value)}function Fg(Ph){return Zh[Ph]??Hh.value[Ph]??{}}function Ig(Ph){qh[Ph]||(Jh[Ph]=JSON.stringify(Fg(Ph),null,2),delete Yh[Ph]),qh[Ph]=!qh[Ph]}function Lg(Ph){return validateBeatJSON(Jh[Ph]??``,mulmoBeatSchema)}async function Rg(Ph){let Fh;try{Fh=JSON.parse(Jh[Ph])}catch(Fh){Yh[Ph]={kind:`invalidJson`,error:errorMessage(Fh)};return}let Ih=JSON.stringify(Fg(Ph).image);delete Yh[Ph],Xh[Ph]=!0;let Lh=await apiPost(API_ROUTES.mulmoScript.updateBeat,{filePath:Vh.value,beatIndex:Ph,beat:Fh});if(delete Xh[Ph],!Lh.ok){Yh[Ph]={kind:`saveFailed`,error:Lh.error};return}Zh[Ph]=Fh,qh[Ph]=!1,JSON.stringify(Fh.image)!==Ih&&(delete Gh[Ph],zg(Ph))}async function zg(Ph){Wh[Ph]=`rendering`;let Fh=await apiPost(API_ROUTES.mulmoScript.renderBeat,{filePath:Vh.value,beatIndex:Ph,chatSessionId:mg.value});if(!Fh.ok){Kh[Ph]=Fh.error||`Render failed`,Wh[Ph]=`error`;return}if(Fh.data.error){Kh[Ph]=Fh.data.error,Wh[Ph]=`error`;return}Gh[Ph]=Fh.data.image??``,Wh[Ph]=`done`,$g()}async function Bg(Ph){delete Gh[Ph],Wh[Ph]=`rendering`;let Fh=await apiPost(API_ROUTES.mulmoScript.renderBeat,{filePath:Vh.value,beatIndex:Ph,force:!0,chatSessionId:mg.value});if(!Fh.ok){Kh[Ph]=Fh.error||`Render failed`,Wh[Ph]=`error`;return}if(Fh.data.error){Kh[Ph]=Fh.data.error,Wh[Ph]=`error`;return}Gh[Ph]=Fh.data.image??``,Wh[Ph]=`done`}async function Vg(Ph){let Fh=await apiGet(API_ROUTES.mulmoScript.beatImage,{filePath:Vh.value,beatIndex:String(Ph)});Fh.ok&&Fh.data.image&&(Gh[Ph]=Fh.data.image,Wh[Ph]=`done`)}async function Hg(Ph){let Fh=await apiGet(API_ROUTES.mulmoScript.beatAudio,{filePath:Vh.value,beatIndex:String(Ph)});Fh.ok&&Fh.data.audio&&(eg[Ph]=Fh.data.audio,tg[Ph]=`done`)}async function Ug(Ph){tg[Ph]=`generating`,delete ng[Ph];let Fh=await apiPost(API_ROUTES.mulmoScript.generateBeatAudio,{filePath:Vh.value,beatIndex:Ph,chatSessionId:mg.value});if(!Fh.ok){ng[Ph]=Fh.error||`Audio generation failed`,tg[Ph]=`error`;return}if(Fh.data.error){ng[Ph]=Fh.data.error,tg[Ph]=`error`;return}eg[Ph]=Fh.data.audio??``,tg[Ph]=`done`}function Wg(Ph){if(rg.value){rg.value.audio.pause();let Fh=rg.value.index;if(rg.value=null,Fh===Ph)return}let Fh=eg[Ph];if(!Fh)return;let Ih=new Audio(Fh);rg.value={index:Ph,audio:Ih},Ih.addEventListener(`ended`,()=>{if(rg.value?.index===Ph&&(rg.value=null,ag.value?.index===Ph)){bg(1);let Fh=ag.value?.index;Fh!==void 0&&Fh!==Ph&&eg[Fh]&&Wg(Fh)}}),Ih.play()}function Gg(Ph,Fh){Ph.dataTransfer?.types.includes(`Files`)&&(Ph.preventDefault(),ug[Fh]=!0)}function Kg(Ph){ug[Ph]=!1}async function qg(Ph,Fh){Ph.preventDefault(),ug[Fh]=!1;let Ih=Ph.dataTransfer?.files[0];if(!Ih||!Ih.type.startsWith(`image/`))return;Wh[Fh]=`rendering`,delete Kh[Fh];let Lh;try{Lh=await new Promise((Ph,Fh)=>{let Lh=new FileReader;Lh.onload=()=>Ph(Lh.result),Lh.onerror=Fh,Lh.readAsDataURL(Ih)})}catch(Ph){Kh[Fh]=errorMessage(Ph),Wh[Fh]=`error`;return}let Rh=await apiPost(API_ROUTES.mulmoScript.uploadBeatImage,{filePath:Vh.value,beatIndex:Fh,imageData:Lh});if(!Rh.ok){Kh[Fh]=Rh.error||`Upload failed`,Wh[Fh]=`error`;return}if(Rh.data.error){Kh[Fh]=Rh.data.error,Wh[Fh]=`error`;return}Gh[Fh]=Rh.data.image??``,Wh[Fh]=`done`}function Jg(Ph,Fh){Ph.dataTransfer?.types.includes(`Files`)&&(Ph.preventDefault(),lg[Fh]=!0)}function Yg(Ph){lg[Ph]=!1}async function Xg(Ph,Fh){Ph.preventDefault(),lg[Fh]=!1;let Ih=Ph.dataTransfer?.files[0];if(!Ih||!Ih.type.startsWith(`image/`))return;og[Fh]=`rendering`,delete cg[Fh];let Lh;try{Lh=await new Promise((Ph,Fh)=>{let Lh=new FileReader;Lh.onload=()=>Ph(Lh.result),Lh.onerror=Fh,Lh.readAsDataURL(Ih)})}catch(Ph){cg[Fh]=errorMessage(Ph),og[Fh]=`error`;return}let Rh=await apiPost(API_ROUTES.mulmoScript.uploadCharacterImage,{filePath:Vh.value,key:Fh,imageData:Lh});if(!Rh.ok){cg[Fh]=Rh.error||`Upload failed`,og[Fh]=`error`;return}if(Rh.data.error){cg[Fh]=Rh.data.error,og[Fh]=`error`;return}sg[Fh]=Rh.data.image??``,og[Fh]=`done`}function Zg(Ph){rg.value&&=(rg.value.audio.pause(),null),ag.value={src:sg[Ph],text:Ph,index:-1,isCharacter:!0}}async function Qg(Ph){let Fh=await apiGet(API_ROUTES.mulmoScript.characterImage,{filePath:Vh.value,key:Ph});Fh.ok&&Fh.data.image&&(sg[Ph]=Fh.data.image,og[Ph]=`done`)}function $g(){getMissingCharacterKeys(fg.value,sg,og).forEach(Ph=>Qg(Ph))}async function e_(Ph,Fh){og[Ph]=`rendering`,delete cg[Ph];let Ih=await apiPost(API_ROUTES.mulmoScript.renderCharacter,{filePath:Vh.value,key:Ph,force:Fh,chatSessionId:mg.value});if(!Ih.ok){cg[Ph]=Ih.error||`Render failed`,og[Ph]=`error`;return}if(Ih.data.error){cg[Ph]=Ih.data.error,og[Ph]=`error`;return}sg[Ph]=Ih.data.image??``,og[Ph]=`done`}async function t_(){await Promise.all(fg.value.filter(Ph=>og[Ph]!==`rendering`).map(Ph=>e_(Ph,!1)))}async function n_(){ig.value&&(ig.value.scrollTop=0),Object.keys(Wh).forEach(Ph=>delete Wh[+Ph]),Object.keys(Gh).forEach(Ph=>delete Gh[+Ph]),Object.keys(Kh).forEach(Ph=>delete Kh[+Ph]),Object.keys(qh).forEach(Ph=>delete qh[+Ph]),Object.keys(Jh).forEach(Ph=>delete Jh[+Ph]),Object.keys(Yh).forEach(Ph=>delete Yh[+Ph]),Object.keys(Xh).forEach(Ph=>delete Xh[+Ph]),Object.keys(Zh).forEach(Ph=>delete Zh[+Ph]),Object.keys(eg).forEach(Ph=>delete eg[+Ph]),Object.keys(tg).forEach(Ph=>delete tg[+Ph]),Object.keys(ng).forEach(Ph=>delete ng[+Ph]),Object.keys(og).forEach(Ph=>delete og[Ph]),Object.keys(sg).forEach(Ph=>delete sg[Ph]),Object.keys(cg).forEach(Ph=>delete cg[Ph]),Object.keys(ug).forEach(Ph=>delete ug[+Ph]),$h.value=null,xg.value&&(xg.value.open=!1);let Ph=[`textSlide`,`markdown`,`chart`,`mermaid`,`html_tailwind`],Fh=fg.value.length>0;if(Hh.value.forEach((Ih,Lh)=>{shouldAutoRenderBeat(Ih,Fh,Ph)?zg(Lh):Ih.imagePrompt&&Vg(Lh),Ih.text&&Hg(Lh)}),fg.value.forEach(Ph=>Qg(Ph)),Vh.value){let Ph=await apiGet(API_ROUTES.mulmoScript.movieStatus,{filePath:Vh.value});Ph.ok&&Ph.data.moviePath&&($h.value=Ph.data.moviePath)}for(let Ph of Object.values(hg.value))r_(Ph)}onMounted(n_),watch(()=>Lh.selectedResult,n_),watch(hg,(Ph,Fh={})=>{for(let[Ih,Lh]of Object.entries(Ph))Ih in Fh||r_(Lh);for(let[Ih,Lh]of Object.entries(Fh))Ih in Ph||i_(Lh).catch(Ph=>{console.error(`[presentMulmoScript] reload on finish failed:`,Ph)})});function r_(Ph){if(Ph.kind===GENERATION_KINDS.beatImage){let Fh=Number(Ph.key);Gh[Fh]||(Wh[Fh]=`rendering`)}else if(Ph.kind===GENERATION_KINDS.beatAudio){let Fh=Number(Ph.key);eg[Fh]||(tg[Fh]=`generating`)}else Ph.kind===GENERATION_KINDS.characterImage?sg[Ph.key]||(og[Ph.key]=`rendering`):Ph.kind===GENERATION_KINDS.movie&&(Qh.value=!0)}async function i_(Ph){if(Ph.kind===GENERATION_KINDS.beatImage){let Fh=Number(Ph.key);await Vg(Fh),Wh[Fh]===`rendering`&&delete Wh[Fh]}else if(Ph.kind===GENERATION_KINDS.beatAudio){let Fh=Number(Ph.key);await Hg(Fh),tg[Fh]===`generating`&&delete tg[Fh]}else Ph.kind===GENERATION_KINDS.characterImage?(await Qg(Ph.key),og[Ph.key]===`rendering`&&delete og[Ph.key]):Ph.kind===GENERATION_KINDS.movie&&(Qh.value=!1,await a_())}async function a_(){if(!Vh.value)return;let Ph=await apiGet(API_ROUTES.mulmoScript.movieStatus,{filePath:Vh.value});Ph.ok&&Ph.data.moviePath&&($h.value=Ph.data.moviePath)}async function o_(){Qh.value=!0;try{let Ph=await apiFetchRaw(API_ROUTES.mulmoScript.generateMovie,{method:`POST`,body:JSON.stringify({filePath:Vh.value,chatSessionId:mg.value}),headers:{"Content-Type":`application/json`}});if(!Ph.ok||!Ph.body)throw Error(`Generation failed`);await streamMovieEvents(Ph.body,{onBeatImageDone:Ph=>{Vg(Ph),$g()},onBeatAudioDone:Ph=>Hg(Ph),onDone:Ph=>{$h.value=Ph}})}catch(Ph){alert(extractErrorMessage(Ph))}finally{Qh.value=!1}}return(Ph,Fh)=>(openBlock(),createElementBlock(`div`,_hoisted_1$43,[createBaseVNode(`div`,_hoisted_2$43,[createBaseVNode(`div`,_hoisted_3$40,[createBaseVNode(`h2`,_hoisted_4$34,toDisplayString$1(Bh.value.title||`Untitled Script`),1),Bh.value.description?(openBlock(),createElementBlock(`p`,_hoisted_5$29,toDisplayString$1(Bh.value.description),1)):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_6$29,[createBaseVNode(`span`,null,toDisplayString$1(unref(Ih)(`pluginMulmoScript.beatCount`,Hh.value.length,{named:{count:Hh.value.length}})),1),Bh.value.lang?(openBlock(),createElementBlock(`span`,_hoisted_7$27,toDisplayString$1(Bh.value.lang),1)):createCommentVNode(``,!0),Vh.value?(openBlock(),createElementBlock(`span`,_hoisted_8$25,toDisplayString$1(Vh.value),1)):createCommentVNode(``,!0)])]),createBaseVNode(`div`,_hoisted_9$22,[$h.value&&!Qh.value?(openBlock(),createElementBlock(`a`,{key:0,href:`${unref(Uh)}?moviePath=${encodeURIComponent($h.value)}`,download:``,class:`px-3 py-1 text-xs rounded-full border transition-colors border-gray-200 text-gray-500 hover:bg-gray-50 flex items-center justify-center gap-1`},[Fh[7]||=createBaseVNode(`span`,{class:`material-icons text-sm leading-none`},`download`,-1),createBaseVNode(`span`,null,toDisplayString$1(unref(Ih)(`pluginMulmoScript.movie`)),1)],8,_hoisted_10$21)):createCommentVNode(``,!0),createBaseVNode(`button`,{class:`px-3 py-1 text-xs rounded-full border transition-colors border-gray-200 text-gray-500 hover:bg-gray-50 disabled:opacity-40 flex items-center justify-center gap-1`,disabled:Qh.value,onClick:o_},[Qh.value?(openBlock(),createElementBlock(`svg`,_hoisted_12$17,[...Fh[8]||=[createBaseVNode(`circle`,{class:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,"stroke-width":`4`},null,-1),createBaseVNode(`path`,{class:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8v8H4z`},null,-1)]])):createCommentVNode(``,!0),Qh.value?(openBlock(),createElementBlock(`span`,_hoisted_13$15,toDisplayString$1(unref(Ih)(`pluginMulmoScript.generating`)),1)):(openBlock(),createElementBlock(Fragment,{key:2},[Fh[9]||=createBaseVNode(`span`,{class:`material-icons text-sm leading-none`},`refresh`,-1),createBaseVNode(`span`,null,toDisplayString$1(unref(Ih)(`pluginMulmoScript.movie`)),1)],64))],8,_hoisted_11$18)])]),fg.value.length>0?(openBlock(),createElementBlock(`div`,_hoisted_14$13,[createBaseVNode(`div`,_hoisted_15$11,[createBaseVNode(`span`,_hoisted_16$10,toDisplayString$1(unref(Ih)(`pluginMulmoScript.characters`)),1),createBaseVNode(`button`,{class:`px-2 py-0.5 text-xs rounded border border-gray-300 text-gray-500 hover:bg-gray-50 disabled:opacity-50`,disabled:Qh.value||dg.value||fg.value.every(Ph=>og[Ph]===`rendering`),onClick:t_},toDisplayString$1(unref(Ih)(`pluginMulmoScript.generateAll`)),9,_hoisted_17$10)]),createBaseVNode(`div`,_hoisted_18$10,[(openBlock(!0),createElementBlock(Fragment,null,renderList(fg.value,Ph=>(openBlock(),createElementBlock(`div`,{key:Ph,class:`flex flex-col items-center gap-1 w-36`},[createBaseVNode(`div`,{class:normalizeClass([`relative w-36 h-36 rounded-lg border overflow-hidden bg-gray-50 flex items-center justify-center transition-colors`,lg[Ph]?`border-blue-400 bg-blue-50`:`border-gray-200`]),onDragover:Fh=>Jg(Fh,Ph),onDragleave:Fh=>Yg(Ph),onDrop:Fh=>Xg(Fh,Ph)},[sg[Ph]?(openBlock(),createElementBlock(`img`,{key:0,src:sg[Ph],class:`w-full h-full object-cover cursor-zoom-in`,alt:Ph,onClick:Fh=>Zg(Ph)},null,8,_hoisted_20$6)):og[Ph]===`rendering`?(openBlock(),createElementBlock(`svg`,_hoisted_21$6,[...Fh[10]||=[createBaseVNode(`circle`,{class:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,"stroke-width":`4`},null,-1),createBaseVNode(`path`,{class:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8v8H4z`},null,-1)]])):og[Ph]===`error`?(openBlock(),createElementBlock(`span`,_hoisted_22$6,toDisplayString$1(cg[Ph]),1)):(openBlock(),createElementBlock(`span`,_hoisted_23$5,toDisplayString$1(gg(Ph)),1)),lg[Ph]?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_24$4,toDisplayString$1(unref(Ih)(`pluginMulmoScript.orDropImage`)),1)),lg[Ph]?(openBlock(),createElementBlock(`div`,_hoisted_25$4,[createBaseVNode(`span`,_hoisted_26$4,toDisplayString$1(unref(Ih)(`pluginMulmoScript.drop`)),1)])):createCommentVNode(``,!0),sg[Ph]&&og[Ph]!==`rendering`?(openBlock(),createElementBlock(`button`,{key:6,class:normalizeClass([`absolute top-0.5 right-0.5 px-1 py-0.5 text-xs rounded border bg-white`,Qh.value||dg.value?`border-yellow-400 text-yellow-500 cursor-not-allowed`:`border-gray-400 text-gray-600 hover:bg-gray-50`]),disabled:Qh.value||dg.value,onClick:withModifiers(Fh=>e_(Ph,!0),[`stop`])},[Qh.value||dg.value?(openBlock(),createElementBlock(`span`,_hoisted_28$3,`↺`)):(openBlock(),createElementBlock(`span`,_hoisted_29$3,`↺`))],10,_hoisted_27$4)):!sg[Ph]&&og[Ph]!==`rendering`?(openBlock(),createElementBlock(`button`,{key:7,class:normalizeClass([`absolute top-0.5 right-0.5 px-1 py-0.5 text-xs rounded border bg-white`,Qh.value||dg.value?`border-yellow-400 text-yellow-500 cursor-not-allowed`:`border-blue-400 text-blue-600 hover:bg-blue-50`]),disabled:Qh.value||dg.value,onClick:withModifiers(Fh=>e_(Ph,!1),[`stop`])},[Qh.value||dg.value?(openBlock(),createElementBlock(`svg`,_hoisted_31$3,[...Fh[11]||=[createBaseVNode(`circle`,{class:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,"stroke-width":`4`},null,-1),createBaseVNode(`path`,{class:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8v8H4z`},null,-1)]])):(openBlock(),createElementBlock(`span`,_hoisted_32$3,toDisplayString$1(unref(Ih)(`pluginMulmoScript.gen`)),1))],10,_hoisted_30$3)):createCommentVNode(``,!0)],42,_hoisted_19$10),createBaseVNode(`span`,_hoisted_33$2,toDisplayString$1(Ph),1)]))),128))])])):createCommentVNode(``,!0),createBaseVNode(`div`,{ref_key:`beatListEl`,ref:ig,class:`flex-1 overflow-y-auto p-2 space-y-1.5`},[(openBlock(!0),createElementBlock(Fragment,null,renderList(Hh.value,(Ph,Lh)=>(openBlock(),createElementBlock(`div`,{key:Lh,class:`rounded-lg border border-gray-200 overflow-hidden`},[createBaseVNode(`div`,_hoisted_34$1,[createBaseVNode(`div`,{class:normalizeClass([`relative shrink-0 w-[45%] overflow-hidden bg-gray-50 transition-colors`,ug[Lh]?`bg-blue-50`:``]),onDragover:Ph=>Gg(Ph,Lh),onDragleave:Ph=>Kg(Lh),onDrop:Ph=>qg(Ph,Lh)},[Gh[Lh]?(openBlock(),createElementBlock(`img`,{key:0,src:Gh[Lh],class:`w-full object-contain cursor-zoom-in`,alt:`Beat ${Lh+1}`,onClick:Ph=>_g(Lh)},null,8,_hoisted_36$1)):createCommentVNode(``,!0),Gh[Lh]&&Wh[Lh]!==`rendering`?(openBlock(),createElementBlock(`button`,{key:1,class:`absolute top-1.5 right-1.5 flex items-center gap-1 px-2 py-0.5 text-xs rounded border border-gray-400 text-gray-600 bg-white hover:bg-gray-50 disabled:opacity-60 disabled:cursor-not-allowed`,disabled:Qh.value,onClick:withModifiers(Ph=>Bg(Lh),[`stop`])},` ↺ `,8,_hoisted_37$1)):Gh[Lh]?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_38$1,[Wh[Lh]===`rendering`||Qh.value&&!Gh[Lh]&&Fg(Lh).imagePrompt?(openBlock(),createElementBlock(Fragment,{key:0},[Fh[12]||=createBaseVNode(`svg`,{class:`animate-spin w-4 h-4 text-green-400`,viewBox:`0 0 24 24`,fill:`none`},[createBaseVNode(`circle`,{class:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,"stroke-width":`4`}),createBaseVNode(`path`,{class:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8v8H4z`})],-1),createBaseVNode(`span`,_hoisted_39$1,toDisplayString$1(unref(Ih)(`pluginMulmoScript.rendering`)),1)],64)):Wh[Lh]===`error`?(openBlock(),createElementBlock(`span`,_hoisted_40$1,toDisplayString$1(Kh[Lh]),1)):(openBlock(),createElementBlock(Fragment,{key:2},[Fg(Lh).imagePrompt?(openBlock(),createElementBlock(`span`,_hoisted_41$1,toDisplayString$1(Fg(Lh).imagePrompt),1)):(openBlock(),createElementBlock(`span`,_hoisted_42$1,toDisplayString$1(Ph.image?.type??`—`),1))],64))])),ug[Lh]?(openBlock(),createElementBlock(`div`,_hoisted_43$1,[createBaseVNode(`span`,_hoisted_44$1,toDisplayString$1(unref(Ih)(`pluginMulmoScript.drop`)),1)])):!Gh[Lh]&&Wh[Lh]!==`rendering`?(openBlock(),createElementBlock(`div`,_hoisted_45$1,toDisplayString$1(unref(Ih)(`pluginMulmoScript.orDropImage`)),1)):createCommentVNode(``,!0),Fg(Lh).imagePrompt&&!Gh[Lh]&&Wh[Lh]!==`rendering`&&!Qh.value?(openBlock(),createElementBlock(`button`,{key:5,class:`absolute top-1.5 right-1.5 flex items-center gap-1 px-2 py-0.5 text-xs rounded border border-blue-400 text-blue-600 bg-white hover:bg-blue-50`,onClick:Ph=>zg(Lh)},toDisplayString$1(unref(Ih)(`pluginMulmoScript.generate`)),9,_hoisted_46$1)):createCommentVNode(``,!0)],42,_hoisted_35$1),createBaseVNode(`div`,_hoisted_47$1,[createBaseVNode(`span`,_hoisted_48$1,toDisplayString$1(Fg(Lh).text),1),createBaseVNode(`div`,_hoisted_49$1,[createBaseVNode(`div`,_hoisted_50$1,[tg[Lh]===`generating`||Qh.value&&!eg[Lh]&&Fg(Lh).text?(openBlock(),createElementBlock(`svg`,_hoisted_51$1,[...Fh[13]||=[createBaseVNode(`circle`,{class:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,"stroke-width":`4`},null,-1),createBaseVNode(`path`,{class:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8v8H4z`},null,-1)]])):eg[Lh]?(openBlock(),createElementBlock(`button`,{key:1,class:normalizeClass([`text-xs px-2 py-0.5 rounded border`,rg.value?.index===Lh?`border-red-400 text-red-600 hover:bg-red-50`:`border-green-400 text-green-600 hover:bg-green-50`]),onClick:Ph=>Wg(Lh)},toDisplayString$1(rg.value?.index===Lh?unref(Ih)(`pluginMulmoScript.stop`):unref(Ih)(`pluginMulmoScript.play`)),11,_hoisted_52$1)):ng[Lh]?(openBlock(),createElementBlock(Fragment,{key:2},[createBaseVNode(`span`,{class:`text-xs text-red-400`,title:ng[Lh]},toDisplayString$1(unref(Ih)(`pluginMulmoScript.errPrefix`)),9,_hoisted_53$1),Fg(Lh).text?(openBlock(),createElementBlock(`button`,{key:0,class:`text-xs px-2 py-0.5 rounded border border-gray-300 text-gray-500 hover:bg-gray-50 disabled:opacity-50`,disabled:Qh.value,onClick:Ph=>Ug(Lh)},` ↺ `,8,_hoisted_54$1)):createCommentVNode(``,!0)],64)):Fg(Lh).text?(openBlock(),createElementBlock(`button`,{key:3,class:`text-xs px-2 py-0.5 rounded border border-gray-300 text-gray-500 hover:bg-gray-50`,onClick:Ph=>Ug(Lh)},toDisplayString$1(unref(Ih)(`pluginMulmoScript.generateAudio`)),9,_hoisted_55$1)):createCommentVNode(``,!0)]),createBaseVNode(`button`,{class:`text-gray-400 hover:text-gray-600`,title:qh[Lh]?`Hide source`:`Show source`,onClick:Ph=>Ig(Lh)},[...Fh[14]||=[createBaseVNode(`svg`,{xmlns:`http://www.w3.org/2000/svg`,class:`w-3.5 h-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[createBaseVNode(`polyline`,{points:`16 18 22 12 16 6`}),createBaseVNode(`polyline`,{points:`8 6 2 12 8 18`})],-1)]],8,_hoisted_56$1)])])]),qh[Lh]?(openBlock(),createElementBlock(`div`,_hoisted_57$1,[withDirectives(createBaseVNode(`textarea`,{"onUpdate:modelValue":Ph=>Jh[Lh]=Ph,class:normalizeClass([`w-full text-xs text-gray-600 bg-gray-50 p-2 font-mono resize-none`,Lg(Lh)?`outline-none`:`outline outline-2 outline-red-400`]),rows:`8`,spellcheck:`false`},null,10,_hoisted_58$1),[[vModelText,Jh[Lh]]]),createBaseVNode(`div`,_hoisted_59$1,[Yh[Lh]?(openBlock(),createElementBlock(`span`,_hoisted_60$1,toDisplayString$1(unref(Ih)(Yh[Lh].kind===`invalidJson`?`pluginMulmoScript.saveErrorInvalidJson`:`pluginMulmoScript.saveErrorSaveFailed`,{error:Yh[Lh].error})),1)):createCommentVNode(``,!0),createBaseVNode(`button`,{class:normalizeClass([`px-2 py-1 text-xs rounded border`,Lg(Lh)&&!Xh[Lh]?`border-blue-400 text-blue-600 hover:bg-blue-50 cursor-pointer`:`border-gray-200 text-gray-300 cursor-not-allowed`]),disabled:!Lg(Lh)||!!Xh[Lh],onClick:Ph=>Rg(Lh)},toDisplayString$1(Xh[Lh]?unref(Ih)(`pluginMulmoScript.saving`):unref(Ih)(`pluginMulmoScript.update`)),11,_hoisted_61$1)])])):createCommentVNode(``,!0)]))),128)),Hh.value.length===0?(openBlock(),createElementBlock(`div`,_hoisted_62$1,toDisplayString$1(unref(Ih)(`pluginMulmoScript.noBeats`)),1)):createCommentVNode(``,!0)],512),createBaseVNode(`div`,_hoisted_63$1,[createBaseVNode(`details`,{ref_key:`sourceDetails`,ref:xg,class:`script-source`,onToggle:Fh[1]||=Ph=>jg(Ph.target.open)},[createBaseVNode(`summary`,null,toDisplayString$1(unref(Ih)(`pluginMulmoScript.editSource`)),1),withDirectives(createBaseVNode(`textarea`,{"onUpdate:modelValue":Fh[0]||=Ph=>Cg.value=Ph,class:normalizeClass([`script-editor`,{"script-editor-invalid":kg.value&&!Ag.value}]),spellcheck:`false`},null,2),[[vModelText,Cg.value]]),createBaseVNode(`div`,_hoisted_64$1,[createBaseVNode(`button`,{class:`apply-btn`,disabled:!kg.value||!Ag.value,onClick:Ng},toDisplayString$1(unref(Ih)(`pluginMulmoScript.applyChanges`)),9,_hoisted_65),createBaseVNode(`button`,{class:`cancel-btn`,onClick:Mg},toDisplayString$1(unref(Ih)(`common.cancel`)),1)])],544),withDirectives(createBaseVNode(`button`,{class:`copy-btn`,title:unref(wg)?`Copied!`:`Copy`,onClick:Pg},[createBaseVNode(`span`,_hoisted_67,toDisplayString$1(unref(wg)?`check`:`content_copy`),1)],8,_hoisted_66),[[vShow,!Sg.value]])]),ag.value?(openBlock(),createElementBlock(`div`,{key:1,class:`fixed inset-0 z-50 flex items-center justify-center bg-black/80`,onClick:Fh[6]||=Ph=>ag.value=null},[createBaseVNode(`div`,{class:`flex items-center gap-4`,onClick:Fh[5]||=withModifiers(()=>{},[`stop`])},[ag.value.isCharacter?createCommentVNode(``,!0):(openBlock(),createElementBlock(`button`,{key:0,class:`text-white/60 hover:text-white disabled:opacity-20 text-4xl leading-none`,disabled:!vg.value,onClick:Fh[2]||=Ph=>bg(-1)},` ‹ `,8,_hoisted_68)),createBaseVNode(`div`,_hoisted_69,[createBaseVNode(`img`,{src:ag.value.src,class:`max-w-[80vw] max-h-[80vh] object-contain rounded shadow-2xl`},null,8,_hoisted_70),createBaseVNode(`div`,_hoisted_71,[ag.value.text?(openBlock(),createElementBlock(`p`,_hoisted_72,toDisplayString$1(ag.value.text),1)):createCommentVNode(``,!0),eg[ag.value.index]?(openBlock(),createElementBlock(`button`,{key:1,class:normalizeClass([`shrink-0 text-sm px-3 py-1 rounded border`,rg.value?.index===ag.value.index?`border-red-400 text-red-400 hover:bg-red-400/20`:`border-white/60 text-white/60 hover:bg-white/20`]),onClick:Fh[3]||=Ph=>Wg(ag.value.index)},toDisplayString$1(rg.value?.index===ag.value.index?unref(Ih)(`pluginMulmoScript.stop`):unref(Ih)(`pluginMulmoScript.play`)),3)):createCommentVNode(``,!0)])]),ag.value.isCharacter?createCommentVNode(``,!0):(openBlock(),createElementBlock(`button`,{key:1,class:`text-white/60 hover:text-white disabled:opacity-20 text-4xl leading-none`,disabled:!yg.value,onClick:Fh[4]||=Ph=>bg(1)},` › `,8,_hoisted_73))])])):createCommentVNode(``,!0)]))}}),View_default$2=_plugin_vue_export_helper_default(View_vue_vue_type_script_setup_true_lang_default$2,[[`__scopeId`,`data-v-f7ad9276`]]),_hoisted_1$42={class:`p-2 text-sm`},_hoisted_2$42={class:`font-medium text-gray-700 truncate mb-1`},_hoisted_3$39={key:0,class:`text-xs text-gray-500 leading-relaxed`},Preview_vue_vue_type_script_setup_true_lang_default$2=defineComponent({__name:`Preview`,props:{result:{}},setup(Ph){let Fh=Ph,Ih=computed(()=>Fh.result.data),Lh=computed(()=>Ih.value?.script),Rh=computed(()=>Lh.value?.title||Ih.value?.filePath?.split(`/`).pop()||`MulmoScript`),zh=computed(()=>Lh.value?.description);return(Ph,Fh)=>(openBlock(),createElementBlock(`div`,_hoisted_1$42,[createBaseVNode(`div`,_hoisted_2$42,toDisplayString$1(Rh.value),1),zh.value?(openBlock(),createElementBlock(`div`,_hoisted_3$39,toDisplayString$1(zh.value),1)):createCommentVNode(``,!0)]))}}),Preview_default$2=Preview_vue_vue_type_script_setup_true_lang_default$2,presentMulmoScriptPlugin={toolDefinition:toolDefinition$2,async execute(Ph,Fh){let Ih=await apiPost(API_ROUTES.mulmoScript.save,Fh);return Ih.ok?{...Ih.data,toolName:TOOL_NAME$2,uuid:makeUuid()}:{toolName:TOOL_NAME$2,uuid:makeUuid(),message:Ih.error}},isEnabled:()=>!0,generatingMessage:`Generating MulmoScript storyboard…`,viewComponent:View_default$2,previewComponent:Preview_default$2},TOOL_NAME$1=`presentHtml`,toolDefinition$1={type:`function`,name:TOOL_NAME$1,description:`Save and present a complete, self-contained HTML page in the canvas. Claude generates the HTML and calls this tool to display it. Use for rich interactive output, dashboards, custom layouts, or any content best expressed as HTML.`,parameters:{type:`object`,properties:{html:{type:`string`,description:`Complete, self-contained HTML string. All CSS and JavaScript must be inline or loaded via CDN. Must be a full document (include <!DOCTYPE html> and <html>/<body> tags).`},title:{type:`string`,description:`Short label shown in the preview sidebar.`}},required:[`html`]}},IMG_SRC_RE=/(<img\s[^>]*src=")([^"]+)(")/g;function shouldSkip(Ph){return!!(Ph.startsWith(`data:`)||Ph.startsWith(`http://`)||Ph.startsWith(`https://`)||Ph.startsWith(`/api/`))}function normalizeWorkspacePath(Ph){return Ph.startsWith(`/`)?Ph.slice(1):Ph}function rewriteHtmlImageRefs(Ph){return Ph.replace(IMG_SRC_RE,(Ph,Fh,Ih,Lh)=>{if(shouldSkip(Ih))return Ph;let Rh=normalizeWorkspacePath(Ih);return Rh.length===0?Ph:`${Fh}${resolveImageSrc(Rh)}${Lh}`})}var _hoisted_1$41={class:`h-full flex flex-col overflow-hidden`},_hoisted_2$41={class:`px-4 py-2 border-b border-gray-100 shrink-0 flex items-center justify-between`},_hoisted_3$38={class:`text-sm font-medium text-gray-700 truncate`},_hoisted_4$33={class:`flex items-center gap-2`},_hoisted_5$28=[`title`],_hoisted_6$28={key:0,class:`border-b border-gray-100 shrink-0`},_hoisted_7$26=[`value`],_hoisted_8$24=[`srcdoc`],PRINT_STYLE=`<style>@media print {
|
|
4834
4834
|
* { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
|
|
4835
4835
|
body { width: 100% !important; margin: 0 !important; padding: 8px !important; }
|
|
4836
4836
|
@page { margin: 10mm; }
|
|
4837
|
-
}</style>`,View_vue_vue_type_script_setup_true_lang_default$1=defineComponent({__name:`View`,props:{selectedResult:{}},setup(Ph){let{t:Fh}=useI18n(),Ih=Ph,Lh=computed(()=>Ih.selectedResult.data),Rh=computed(()=>Lh.value?.html??``),zh=computed(()=>Rh.value.includes(`</head>`)?Rh.value.replace(`</head>`,`${PRINT_STYLE}</head>`):`${PRINT_STYLE}${Rh.value}`),Bh=computed(()=>Lh.value?.title),Vh=ref(!1),Hh=ref(null);function Uh(){Hh.value?.contentWindow?.print()}return(Ph,Ih)=>(openBlock(),createElementBlock(`div`,_hoisted_1$41,[createBaseVNode(`div`,_hoisted_2$41,[createBaseVNode(`span`,_hoisted_3$38,toDisplayString$1(Bh.value??unref(Fh)(`pluginPresentHtml.untitled`)),1),createBaseVNode(`div`,_hoisted_4$33,[createBaseVNode(`button`,{class:`px-2 py-1 text-xs rounded border border-gray-300 text-gray-500 hover:bg-gray-50 shrink-0`,title:unref(Fh)(`pluginPresentHtml.saveAsPdf`),onClick:Uh},[Ih[1]||=createBaseVNode(`span`,{class:`material-icons text-sm align-middle`},`picture_as_pdf`,-1),createTextVNode(` `+toDisplayString$1(unref(Fh)(`pluginPresentHtml.pdf`)),1)],8,_hoisted_5$28),createBaseVNode(`button`,{class:`px-2 py-1 text-xs rounded border border-gray-300 text-gray-500 hover:bg-gray-50 shrink-0`,onClick:Ih[0]||=Ph=>Vh.value=!Vh.value},toDisplayString$1(Vh.value?unref(Fh)(`pluginPresentHtml.hideSource`):unref(Fh)(`pluginPresentHtml.showSource`)),1)])]),Vh.value?(openBlock(),createElementBlock(`div`,_hoisted_6$28,[createBaseVNode(`textarea`,{value:zh.value,readonly:``,class:`w-full text-xs text-gray-600 bg-gray-50 p-3 font-mono resize-none outline-none`,rows:`16`},null,8,_hoisted_7$26)])):createCommentVNode(``,!0),createBaseVNode(`iframe`,{ref_key:`iframeRef`,ref:Hh,srcdoc:zh.value,sandbox:`allow-scripts allow-same-origin allow-modals`,class:`flex-1 w-full border-0`},null,8,_hoisted_8$24)]))}}),View_default$1=View_vue_vue_type_script_setup_true_lang_default$1;function stripHtmlToPreview(Ph,Fh){let Ih={out:[],lastWasSpace:!0},Lh=0;for(;Lh<Ph.length;){let Fh=Ph[Lh];if(Fh===`<`){let Fh=Ph.indexOf(`>`,Lh+1);if(Fh!==-1){emitSeparator(Ih),Lh=Fh+1;continue}}emitChar(Ih,Fh),Lh++}return trimTrailingSpace(Ih.out),Ih.out.join(``).slice(0,Fh)}function emitChar(Ph,Fh){if(isWhitespace$1(Fh)){emitSeparator(Ph);return}Ph.out.push(Fh),Ph.lastWasSpace=!1}function emitSeparator(Ph){Ph.lastWasSpace||=(Ph.out.push(` `),!0)}function trimTrailingSpace(Ph){Ph.length>0&&Ph[Ph.length-1]===` `&&Ph.pop()}function isWhitespace$1(Ph){return Ph===` `||Ph===` `||Ph===`
|
|
4837
|
+
}</style>`,View_vue_vue_type_script_setup_true_lang_default$1=defineComponent({__name:`View`,props:{selectedResult:{}},setup(Ph){let{t:Fh}=useI18n(),Ih=Ph,Lh=computed(()=>Ih.selectedResult.data),Rh=computed(()=>rewriteHtmlImageRefs(Lh.value?.html??``)),zh=computed(()=>Rh.value.includes(`</head>`)?Rh.value.replace(`</head>`,`${PRINT_STYLE}</head>`):`${PRINT_STYLE}${Rh.value}`),Bh=computed(()=>Lh.value?.title),Vh=ref(!1),Hh=ref(null);function Uh(){Hh.value?.contentWindow?.print()}return(Ph,Ih)=>(openBlock(),createElementBlock(`div`,_hoisted_1$41,[createBaseVNode(`div`,_hoisted_2$41,[createBaseVNode(`span`,_hoisted_3$38,toDisplayString$1(Bh.value??unref(Fh)(`pluginPresentHtml.untitled`)),1),createBaseVNode(`div`,_hoisted_4$33,[createBaseVNode(`button`,{class:`px-2 py-1 text-xs rounded border border-gray-300 text-gray-500 hover:bg-gray-50 shrink-0`,title:unref(Fh)(`pluginPresentHtml.saveAsPdf`),onClick:Uh},[Ih[1]||=createBaseVNode(`span`,{class:`material-icons text-sm align-middle`},`picture_as_pdf`,-1),createTextVNode(` `+toDisplayString$1(unref(Fh)(`pluginPresentHtml.pdf`)),1)],8,_hoisted_5$28),createBaseVNode(`button`,{class:`px-2 py-1 text-xs rounded border border-gray-300 text-gray-500 hover:bg-gray-50 shrink-0`,onClick:Ih[0]||=Ph=>Vh.value=!Vh.value},toDisplayString$1(Vh.value?unref(Fh)(`pluginPresentHtml.hideSource`):unref(Fh)(`pluginPresentHtml.showSource`)),1)])]),Vh.value?(openBlock(),createElementBlock(`div`,_hoisted_6$28,[createBaseVNode(`textarea`,{value:zh.value,readonly:``,class:`w-full text-xs text-gray-600 bg-gray-50 p-3 font-mono resize-none outline-none`,rows:`16`},null,8,_hoisted_7$26)])):createCommentVNode(``,!0),createBaseVNode(`iframe`,{ref_key:`iframeRef`,ref:Hh,srcdoc:zh.value,sandbox:`allow-scripts allow-same-origin allow-modals`,class:`flex-1 w-full border-0`},null,8,_hoisted_8$24)]))}}),View_default$1=View_vue_vue_type_script_setup_true_lang_default$1;function stripHtmlToPreview(Ph,Fh){let Ih={out:[],lastWasSpace:!0},Lh=0;for(;Lh<Ph.length;){let Fh=Ph[Lh];if(Fh===`<`){let Fh=Ph.indexOf(`>`,Lh+1);if(Fh!==-1){emitSeparator(Ih),Lh=Fh+1;continue}}emitChar(Ih,Fh),Lh++}return trimTrailingSpace(Ih.out),Ih.out.join(``).slice(0,Fh)}function emitChar(Ph,Fh){if(isWhitespace$1(Fh)){emitSeparator(Ph);return}Ph.out.push(Fh),Ph.lastWasSpace=!1}function emitSeparator(Ph){Ph.lastWasSpace||=(Ph.out.push(` `),!0)}function trimTrailingSpace(Ph){Ph.length>0&&Ph[Ph.length-1]===` `&&Ph.pop()}function isWhitespace$1(Ph){return Ph===` `||Ph===` `||Ph===`
|
|
4838
4838
|
`||Ph===`\r`||Ph===`\v`||Ph===`\f`}var _hoisted_1$40={class:`p-2 text-sm`},_hoisted_2$40={class:`font-medium text-gray-700 truncate mb-1`},_hoisted_3$37={key:0,class:`text-xs text-gray-500 leading-relaxed truncate`},HINT_MAX_LENGTH=60,Preview_vue_vue_type_script_setup_true_lang_default$1=defineComponent({__name:`Preview`,props:{result:{}},setup(Ph){let Fh=Ph,Ih=computed(()=>Fh.result.data),Lh=computed(()=>Ih.value?.title??`HTML Page`),Rh=computed(()=>stripHtmlToPreview(Ih.value?.html??``,HINT_MAX_LENGTH));return(Ph,Fh)=>(openBlock(),createElementBlock(`div`,_hoisted_1$40,[createBaseVNode(`div`,_hoisted_2$40,toDisplayString$1(Lh.value),1),Rh.value?(openBlock(),createElementBlock(`div`,_hoisted_3$37,toDisplayString$1(Rh.value),1)):createCommentVNode(``,!0)]))}}),Preview_default$1=Preview_vue_vue_type_script_setup_true_lang_default$1,presentHtmlPlugin={toolDefinition:toolDefinition$1,async execute(Ph,Fh){let Ih=await apiPost(API_ROUTES.html.present,Fh);return Ih.ok?{...Ih.data,toolName:TOOL_NAME$1,uuid:makeUuid()}:{toolName:TOOL_NAME$1,uuid:makeUuid(),message:Ih.error}},isEnabled:()=>!0,generatingMessage:`Presenting HTML page…`,viewComponent:View_default$1,previewComponent:Preview_default$1},TOOL_NAME=`presentChart`,toolDefinition={type:`function`,name:TOOL_NAME,description:"Save and present one or more Apache ECharts visualizations as a single document. Use this for line, bar, area, scatter, pie, candlestick, heatmap, sankey, or graph/network charts — anything ECharts supports. Pass ECharts option object(s) directly; the plugin calls setOption on each one. Use `charts: []` array form even for a single chart so multi-chart dashboards share the same slug.",parameters:{type:`object`,properties:{document:{type:`object`,description:`Chart document. Contains an optional title and an array of chart entries. Each entry has its own ECharts option object that the UI renders independently.`,properties:{title:{type:`string`,description:`Optional human-friendly title for the whole document. Used to derive the file slug and as the preview label.`},charts:{type:`array`,description:`List of charts to render, in order. Each charts[i].option is passed as-is to ECharts' setOption().`,items:{type:`object`,properties:{title:{type:`string`,description:`Optional short label for this specific chart (shown above it in the UI).`},type:{type:`string`,description:`Informational tag shown in the UI (e.g. 'line', 'bar', 'candlestick', 'sankey'). The actual chart type is determined by option.series[].type.`},option:{type:`object`,description:`Full ECharts option object. Include all series, axes, tooltip, legend, dataset — anything ECharts accepts. Keep data inline; large datasets are fine.`}},required:[`option`]}}},required:[`charts`]},title:{type:`string`,description:`Short label shown in the canvas preview sidebar. Defaults to document.title, or 'Chart' when both are blank.`}},required:[`document`]}},extendStatics$1=function(Ph,Fh){return extendStatics$1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Ph,Fh){Ph.__proto__=Fh}||function(Ph,Fh){for(var Ih in Fh)Object.prototype.hasOwnProperty.call(Fh,Ih)&&(Ph[Ih]=Fh[Ih])},extendStatics$1(Ph,Fh)};function __extends$1(Ph,Fh){if(typeof Fh!=`function`&&Fh!==null)throw TypeError(`Class extends value `+String(Fh)+` is not a constructor or null`);extendStatics$1(Ph,Fh);function Ih(){this.constructor=Ph}Ph.prototype=Fh===null?Object.create(Fh):(Ih.prototype=Fh.prototype,new Ih)}var Browser=function(){function Ph(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return Ph}(),env=new(function(){function Ph(){this.browser=new Browser,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<`u`}return Ph}());typeof wx==`object`&&typeof wx.getSystemInfoSync==`function`?(env.wxa=!0,env.touchEventsSupported=!0):typeof document>`u`&&typeof self<`u`?env.worker=!0:!env.hasGlobalWindow||`Deno`in window||typeof navigator<`u`&&typeof navigator.userAgent==`string`&&navigator.userAgent.indexOf(`Node.js`)>-1?(env.node=!0,env.svgSupported=!0):detect(navigator.userAgent,env);function detect(Ph,Fh){var Ih=Fh.browser,Lh=Ph.match(/Firefox\/([\d.]+)/),Rh=Ph.match(/MSIE\s([\d.]+)/)||Ph.match(/Trident\/.+?rv:(([\d.]+))/),zh=Ph.match(/Edge?\/([\d.]+)/),Bh=/micromessenger/i.test(Ph);if(Lh&&(Ih.firefox=!0,Ih.version=Lh[1]),Rh&&(Ih.ie=!0,Ih.version=Rh[1]),zh&&(Ih.edge=!0,Ih.version=zh[1],Ih.newEdge=+zh[1].split(`.`)[0]>18),Bh&&(Ih.weChat=!0),Fh.svgSupported=typeof SVGRect<`u`,Fh.touchEventsSupported=`ontouchstart`in window&&!Ih.ie&&!Ih.edge,Fh.pointerEventsSupported=`onpointerdown`in window&&(Ih.edge||Ih.ie&&+Ih.version>=11),Fh.domSupported=typeof document<`u`){var Vh=document.documentElement.style;Fh.transform3dSupported=(Ih.ie&&`transition`in Vh||Ih.edge||`WebKitCSSMatrix`in window&&`m11`in new WebKitCSSMatrix||`MozPerspective`in Vh)&&!(`OTransition`in Vh),Fh.transformSupported=Fh.transform3dSupported||Ih.ie&&+Ih.version>=9}}var DEFAULT_FONT_SIZE=12,DEFAULT_FONT_FAMILY=`sans-serif`,DEFAULT_FONT=`12px `+DEFAULT_FONT_FAMILY,OFFSET=20,SCALE=100,defaultWidthMapStr=`007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N`;function getTextWidthMap(Ph){var Fh={};if(typeof JSON>`u`)return Fh;for(var Ih=0;Ih<Ph.length;Ih++){var Lh=String.fromCharCode(Ih+32);Fh[Lh]=(Ph.charCodeAt(Ih)-OFFSET)/SCALE}return Fh}var DEFAULT_TEXT_WIDTH_MAP=getTextWidthMap(defaultWidthMapStr),platformApi={createCanvas:function(){return typeof document<`u`&&document.createElement(`canvas`)},measureText:(function(){var Ph,Fh;return function(Ih,Lh){if(!Ph){var Rh=platformApi.createCanvas();Ph=Rh&&Rh.getContext(`2d`)}if(Ph)return Fh!==Lh&&(Fh=Ph.font=Lh||`12px sans-serif`),Ph.measureText(Ih);Ih||=``,Lh||=`12px sans-serif`;var zh=/((?:\d+)?\.?\d*)px/.exec(Lh),Bh=zh&&+zh[1]||12,Vh=0;if(Lh.indexOf(`mono`)>=0)Vh=Bh*Ih.length;else for(var Hh=0;Hh<Ih.length;Hh++){var Uh=DEFAULT_TEXT_WIDTH_MAP[Ih[Hh]];Vh+=Uh==null?Bh:Uh*Bh}return{width:Vh}}})(),loadImage:function(Ph,Fh,Ih){var Lh=new Image;return Lh.onload=Fh,Lh.onerror=Ih,Lh.src=Ph,Lh}},BUILTIN_OBJECT=reduce([`Function`,`RegExp`,`Date`,`Error`,`CanvasGradient`,`CanvasPattern`,`Image`,`Canvas`],function(Ph,Fh){return Ph[`[object `+Fh+`]`]=!0,Ph},{}),TYPED_ARRAY=reduce([`Int8`,`Uint8`,`Uint8Clamped`,`Int16`,`Uint16`,`Int32`,`Uint32`,`Float32`,`Float64`],function(Ph,Fh){return Ph[`[object `+Fh+`Array]`]=!0,Ph},{}),objToString=Object.prototype.toString,arrayProto=Array.prototype,nativeForEach=arrayProto.forEach,nativeFilter=arrayProto.filter,nativeSlice=arrayProto.slice,nativeMap=arrayProto.map,ctorFunction=function(){}.constructor,protoFunction=ctorFunction?ctorFunction.prototype:null,protoKey=`__proto__`,idStart=2311;function guid(){return idStart++}function logError(){var Ph=[...arguments];typeof console<`u`&&console.error.apply(console,Ph)}function clone$5(Ph){if(typeof Ph!=`object`||!Ph)return Ph;var Fh=Ph,Ih=objToString.call(Ph);if(Ih===`[object Array]`){if(!isPrimitive(Ph)){Fh=[];for(var Lh=0,Rh=Ph.length;Lh<Rh;Lh++)Fh[Lh]=clone$5(Ph[Lh])}}else if(TYPED_ARRAY[Ih]){if(!isPrimitive(Ph)){var zh=Ph.constructor;if(zh.from)Fh=zh.from(Ph);else{Fh=new zh(Ph.length);for(var Lh=0,Rh=Ph.length;Lh<Rh;Lh++)Fh[Lh]=Ph[Lh]}}}else if(!BUILTIN_OBJECT[Ih]&&!isPrimitive(Ph)&&!isDom(Ph))for(var Bh in Fh={},Ph)Ph.hasOwnProperty(Bh)&&Bh!==protoKey&&(Fh[Bh]=clone$5(Ph[Bh]));return Fh}function merge(Ph,Fh,Ih){if(!isObject$4(Fh)||!isObject$4(Ph))return Ih?clone$5(Fh):Ph;for(var Lh in Fh)if(Fh.hasOwnProperty(Lh)&&Lh!==protoKey){var Rh=Ph[Lh],zh=Fh[Lh];isObject$4(zh)&&isObject$4(Rh)&&!isArray$1(zh)&&!isArray$1(Rh)&&!isDom(zh)&&!isDom(Rh)&&!isBuiltInObject(zh)&&!isBuiltInObject(Rh)&&!isPrimitive(zh)&&!isPrimitive(Rh)?merge(Rh,zh,Ih):(Ih||!(Lh in Ph))&&(Ph[Lh]=clone$5(Fh[Lh]))}return Ph}function mergeAll(Ph,Fh){for(var Ih=Ph[0],Lh=1,Rh=Ph.length;Lh<Rh;Lh++)Ih=merge(Ih,Ph[Lh],Fh);return Ih}function extend$1(Ph,Fh){if(Object.assign)Object.assign(Ph,Fh);else for(var Ih in Fh)Fh.hasOwnProperty(Ih)&&Ih!==protoKey&&(Ph[Ih]=Fh[Ih]);return Ph}function defaults$1(Ph,Fh,Ih){for(var Lh=keys(Fh),Rh=0,zh=Lh.length;Rh<zh;Rh++){var Bh=Lh[Rh];(Ih?Fh[Bh]!=null:Ph[Bh]==null)&&(Ph[Bh]=Fh[Bh])}return Ph}var createCanvas=platformApi.createCanvas;function indexOf(Ph,Fh){if(Ph){if(Ph.indexOf)return Ph.indexOf(Fh);for(var Ih=0,Lh=Ph.length;Ih<Lh;Ih++)if(Ph[Ih]===Fh)return Ih}return-1}function inherits(Ph,Fh){var Ih=Ph.prototype;function Lh(){}for(var Rh in Lh.prototype=Fh.prototype,Ph.prototype=new Lh,Ih)Ih.hasOwnProperty(Rh)&&(Ph.prototype[Rh]=Ih[Rh]);Ph.prototype.constructor=Ph,Ph.superClass=Fh}function mixin$1(Ph,Fh,Ih){if(Ph=`prototype`in Ph?Ph.prototype:Ph,Fh=`prototype`in Fh?Fh.prototype:Fh,Object.getOwnPropertyNames)for(var Lh=Object.getOwnPropertyNames(Fh),Rh=0;Rh<Lh.length;Rh++){var zh=Lh[Rh];zh!==`constructor`&&(Ih?Fh[zh]!=null:Ph[zh]==null)&&(Ph[zh]=Fh[zh])}else defaults$1(Ph,Fh,Ih)}function isArrayLike(Ph){return!Ph||typeof Ph==`string`?!1:typeof Ph.length==`number`}function each$15(Ph,Fh,Ih){if(Ph&&Fh)if(Ph.forEach&&Ph.forEach===nativeForEach)Ph.forEach(Fh,Ih);else if(Ph.length===+Ph.length)for(var Lh=0,Rh=Ph.length;Lh<Rh;Lh++)Fh.call(Ih,Ph[Lh],Lh,Ph);else for(var zh in Ph)Ph.hasOwnProperty(zh)&&Fh.call(Ih,Ph[zh],zh,Ph)}function map$1(Ph,Fh,Ih){if(!Ph)return[];if(!Fh)return slice(Ph);if(Ph.map&&Ph.map===nativeMap)return Ph.map(Fh,Ih);for(var Lh=[],Rh=0,zh=Ph.length;Rh<zh;Rh++)Lh.push(Fh.call(Ih,Ph[Rh],Rh,Ph));return Lh}function reduce(Ph,Fh,Ih,Lh){if(Ph&&Fh){for(var Rh=0,zh=Ph.length;Rh<zh;Rh++)Ih=Fh.call(Lh,Ih,Ph[Rh],Rh,Ph);return Ih}}function filter(Ph,Fh,Ih){if(!Ph)return[];if(!Fh)return slice(Ph);if(Ph.filter&&Ph.filter===nativeFilter)return Ph.filter(Fh,Ih);for(var Lh=[],Rh=0,zh=Ph.length;Rh<zh;Rh++)Fh.call(Ih,Ph[Rh],Rh,Ph)&&Lh.push(Ph[Rh]);return Lh}function find$1(Ph,Fh,Ih){if(Ph&&Fh){for(var Lh=0,Rh=Ph.length;Lh<Rh;Lh++)if(Fh.call(Ih,Ph[Lh],Lh,Ph))return Ph[Lh]}}function keys(Ph){if(!Ph)return[];if(Object.keys)return Object.keys(Ph);var Fh=[];for(var Ih in Ph)Ph.hasOwnProperty(Ih)&&Fh.push(Ih);return Fh}function bindPolyfill(Ph,Fh){var Ih=[...arguments].slice(2);return function(){return Ph.apply(Fh,Ih.concat(nativeSlice.call(arguments)))}}var bind$1=protoFunction&&isFunction(protoFunction.bind)?protoFunction.call.bind(protoFunction.bind):bindPolyfill;function curry$1(Ph){var Fh=[...arguments].slice(1);return function(){return Ph.apply(this,Fh.concat(nativeSlice.call(arguments)))}}function isArray$1(Ph){return Array.isArray?Array.isArray(Ph):objToString.call(Ph)===`[object Array]`}function isFunction(Ph){return typeof Ph==`function`}function isString(Ph){return typeof Ph==`string`}function isStringSafe(Ph){return objToString.call(Ph)===`[object String]`}function isNumber(Ph){return typeof Ph==`number`}function isObject$4(Ph){var Fh=typeof Ph;return Fh===`function`||!!Ph&&Fh===`object`}function isBuiltInObject(Ph){return!!BUILTIN_OBJECT[objToString.call(Ph)]}function isTypedArray(Ph){return!!TYPED_ARRAY[objToString.call(Ph)]}function isDom(Ph){return typeof Ph==`object`&&typeof Ph.nodeType==`number`&&typeof Ph.ownerDocument==`object`}function isGradientObject(Ph){return Ph.colorStops!=null}function isImagePatternObject(Ph){return Ph.image!=null}function isRegExp(Ph){return objToString.call(Ph)===`[object RegExp]`}function eqNaN(Ph){return Ph!==Ph}function retrieve(){for(var Ph=[...arguments],Fh=0,Ih=Ph.length;Fh<Ih;Fh++)if(Ph[Fh]!=null)return Ph[Fh]}function retrieve2(Ph,Fh){return Ph??Fh}function retrieve3(Ph,Fh,Ih){return Ph??Fh??Ih}function slice(Ph){var Fh=[...arguments].slice(1);return nativeSlice.apply(Ph,Fh)}function normalizeCssArray$1(Ph){if(typeof Ph==`number`)return[Ph,Ph,Ph,Ph];var Fh=Ph.length;return Fh===2?[Ph[0],Ph[1],Ph[0],Ph[1]]:Fh===3?[Ph[0],Ph[1],Ph[2],Ph[1]]:Ph}function assert$1(Ph,Fh){if(!Ph)throw Error(Fh)}function trim$1(Ph){return Ph==null?null:typeof Ph.trim==`function`?Ph.trim():Ph.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``)}var primitiveKey=`__ec_primitive__`;function setAsPrimitive(Ph){Ph[primitiveKey]=!0}function isPrimitive(Ph){return Ph[primitiveKey]}var MapPolyfill=function(){function Ph(){this.data={}}return Ph.prototype.delete=function(Ph){var Fh=this.has(Ph);return Fh&&delete this.data[Ph],Fh},Ph.prototype.has=function(Ph){return this.data.hasOwnProperty(Ph)},Ph.prototype.get=function(Ph){return this.data[Ph]},Ph.prototype.set=function(Ph,Fh){return this.data[Ph]=Fh,this},Ph.prototype.keys=function(){return keys(this.data)},Ph.prototype.forEach=function(Ph){var Fh=this.data;for(var Ih in Fh)Fh.hasOwnProperty(Ih)&&Ph(Fh[Ih],Ih)},Ph}(),isNativeMapSupported=typeof Map==`function`;function maybeNativeMap(){return isNativeMapSupported?new Map:new MapPolyfill}var HashMap=function(){function Ph(Fh){var Ih=isArray$1(Fh);this.data=maybeNativeMap();var Lh=this;Fh instanceof Ph?Fh.each(Rh):Fh&&each$15(Fh,Rh);function Rh(Ph,Fh){Ih?Lh.set(Ph,Fh):Lh.set(Fh,Ph)}}return Ph.prototype.hasKey=function(Ph){return this.data.has(Ph)},Ph.prototype.get=function(Ph){return this.data.get(Ph)},Ph.prototype.set=function(Ph,Fh){return this.data.set(Ph,Fh),Fh},Ph.prototype.each=function(Ph,Fh){this.data.forEach(function(Ih,Lh){Ph.call(Fh,Ih,Lh)})},Ph.prototype.keys=function(){var Ph=this.data.keys();return isNativeMapSupported?Array.from(Ph):Ph},Ph.prototype.removeKey=function(Ph){this.data.delete(Ph)},Ph}();function createHashMap(Ph){return new HashMap(Ph)}function concatArray(Ph,Fh){for(var Ih=new Ph.constructor(Ph.length+Fh.length),Lh=0;Lh<Ph.length;Lh++)Ih[Lh]=Ph[Lh];for(var Rh=Ph.length,Lh=0;Lh<Fh.length;Lh++)Ih[Lh+Rh]=Fh[Lh];return Ih}function createObject(Ph,Fh){var Ih;if(Object.create)Ih=Object.create(Ph);else{var Lh=function(){};Lh.prototype=Ph,Ih=new Lh}return Fh&&extend$1(Ih,Fh),Ih}function disableUserSelect(Ph){var Fh=Ph.style;Fh.webkitUserSelect=`none`,Fh.userSelect=`none`,Fh.webkitTapHighlightColor=`rgba(0,0,0,0)`,Fh[`-webkit-touch-callout`]=`none`}function hasOwn(Ph,Fh){return Ph.hasOwnProperty(Fh)}function noop(){}var RADIAN_TO_DEGREE=180/Math.PI,EPSILON$5=2**-52||2**-52,extendStatics=function(Ph,Fh){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Ph,Fh){Ph.__proto__=Fh}||function(Ph,Fh){for(var Ih in Fh)Object.prototype.hasOwnProperty.call(Fh,Ih)&&(Ph[Ih]=Fh[Ih])},extendStatics(Ph,Fh)};function __extends(Ph,Fh){if(typeof Fh!=`function`&&Fh!==null)throw TypeError(`Class extends value `+String(Fh)+` is not a constructor or null`);extendStatics(Ph,Fh);function Ih(){this.constructor=Ph}Ph.prototype=Fh===null?Object.create(Fh):(Ih.prototype=Fh.prototype,new Ih)}function create$2(Ph,Fh){return Ph??=0,Fh??=0,[Ph,Fh]}function copy$1(Ph,Fh){return Ph[0]=Fh[0],Ph[1]=Fh[1],Ph}function clone$4(Ph){return[Ph[0],Ph[1]]}function set$1(Ph,Fh,Ih){return Ph[0]=Fh,Ph[1]=Ih,Ph}function add(Ph,Fh,Ih){return Ph[0]=Fh[0]+Ih[0],Ph[1]=Fh[1]+Ih[1],Ph}function scaleAndAdd$1(Ph,Fh,Ih,Lh){return Ph[0]=Fh[0]+Ih[0]*Lh,Ph[1]=Fh[1]+Ih[1]*Lh,Ph}function sub(Ph,Fh,Ih){return Ph[0]=Fh[0]-Ih[0],Ph[1]=Fh[1]-Ih[1],Ph}function len(Ph){return Math.sqrt(lenSquare(Ph))}function lenSquare(Ph){return Ph[0]*Ph[0]+Ph[1]*Ph[1]}function scale$2(Ph,Fh,Ih){return Ph[0]=Fh[0]*Ih,Ph[1]=Fh[1]*Ih,Ph}function normalize$3(Ph,Fh){var Ih=len(Fh);return Ih===0?(Ph[0]=0,Ph[1]=0):(Ph[0]=Fh[0]/Ih,Ph[1]=Fh[1]/Ih),Ph}function distance(Ph,Fh){return Math.sqrt((Ph[0]-Fh[0])*(Ph[0]-Fh[0])+(Ph[1]-Fh[1])*(Ph[1]-Fh[1]))}var dist$1=distance;function distanceSquare(Ph,Fh){return(Ph[0]-Fh[0])*(Ph[0]-Fh[0])+(Ph[1]-Fh[1])*(Ph[1]-Fh[1])}var distSquare=distanceSquare;function lerp$1(Ph,Fh,Ih,Lh){return Ph[0]=Fh[0]+Lh*(Ih[0]-Fh[0]),Ph[1]=Fh[1]+Lh*(Ih[1]-Fh[1]),Ph}function applyTransform$1(Ph,Fh,Ih){var Lh=Fh[0],Rh=Fh[1];return Ph[0]=Ih[0]*Lh+Ih[2]*Rh+Ih[4],Ph[1]=Ih[1]*Lh+Ih[3]*Rh+Ih[5],Ph}function min$1(Ph,Fh,Ih){return Ph[0]=Math.min(Fh[0],Ih[0]),Ph[1]=Math.min(Fh[1],Ih[1]),Ph}function max$1(Ph,Fh,Ih){return Ph[0]=Math.max(Fh[0],Ih[0]),Ph[1]=Math.max(Fh[1],Ih[1]),Ph}var Param=function(){function Ph(Ph,Fh){this.target=Ph,this.topTarget=Fh&&Fh.topTarget}return Ph}(),Draggable=function(){function Ph(Ph){this.handler=Ph,Ph.on(`mousedown`,this._dragStart,this),Ph.on(`mousemove`,this._drag,this),Ph.on(`mouseup`,this._dragEnd,this)}return Ph.prototype._dragStart=function(Ph){for(var Fh=Ph.target;Fh&&!Fh.draggable;)Fh=Fh.parent||Fh.__hostTarget;Fh&&(this._draggingTarget=Fh,Fh.dragging=!0,this._x=Ph.offsetX,this._y=Ph.offsetY,this.handler.dispatchToElement(new Param(Fh,Ph),`dragstart`,Ph.event))},Ph.prototype._drag=function(Ph){var Fh=this._draggingTarget;if(Fh){var Ih=Ph.offsetX,Lh=Ph.offsetY,Rh=Ih-this._x,zh=Lh-this._y;this._x=Ih,this._y=Lh,Fh.drift(Rh,zh,Ph),this.handler.dispatchToElement(new Param(Fh,Ph),`drag`,Ph.event);var Bh=this.handler.findHover(Ih,Lh,Fh).target,Vh=this._dropTarget;this._dropTarget=Bh,Fh!==Bh&&(Vh&&Bh!==Vh&&this.handler.dispatchToElement(new Param(Vh,Ph),`dragleave`,Ph.event),Bh&&Bh!==Vh&&this.handler.dispatchToElement(new Param(Bh,Ph),`dragenter`,Ph.event))}},Ph.prototype._dragEnd=function(Ph){var Fh=this._draggingTarget;Fh&&(Fh.dragging=!1),this.handler.dispatchToElement(new Param(Fh,Ph),`dragend`,Ph.event),this._dropTarget&&this.handler.dispatchToElement(new Param(this._dropTarget,Ph),`drop`,Ph.event),this._draggingTarget=null,this._dropTarget=null},Ph}(),Eventful=function(){function Ph(Ph){Ph&&(this._$eventProcessor=Ph)}return Ph.prototype.on=function(Ph,Fh,Ih,Lh){this._$handlers||={};var Rh=this._$handlers;if(typeof Fh==`function`&&(Lh=Ih,Ih=Fh,Fh=null),!Ih||!Ph)return this;var zh=this._$eventProcessor;Fh!=null&&zh&&zh.normalizeQuery&&(Fh=zh.normalizeQuery(Fh)),Rh[Ph]||(Rh[Ph]=[]);for(var Bh=0;Bh<Rh[Ph].length;Bh++)if(Rh[Ph][Bh].h===Ih)return this;var Vh={h:Ih,query:Fh,ctx:Lh||this,callAtLast:Ih.zrEventfulCallAtLast},Hh=Rh[Ph].length-1,Uh=Rh[Ph][Hh];return Uh&&Uh.callAtLast?Rh[Ph].splice(Hh,0,Vh):Rh[Ph].push(Vh),this},Ph.prototype.isSilent=function(Ph){var Fh=this._$handlers;return!Fh||!Fh[Ph]||!Fh[Ph].length},Ph.prototype.off=function(Ph,Fh){var Ih=this._$handlers;if(!Ih)return this;if(!Ph)return this._$handlers={},this;if(Fh){if(Ih[Ph]){for(var Lh=[],Rh=0,zh=Ih[Ph].length;Rh<zh;Rh++)Ih[Ph][Rh].h!==Fh&&Lh.push(Ih[Ph][Rh]);Ih[Ph]=Lh}Ih[Ph]&&Ih[Ph].length===0&&delete Ih[Ph]}else delete Ih[Ph];return this},Ph.prototype.trigger=function(Ph){var Fh=[...arguments].slice(1);if(!this._$handlers)return this;var Ih=this._$handlers[Ph],Lh=this._$eventProcessor;if(Ih)for(var Rh=Fh.length,zh=Ih.length,Bh=0;Bh<zh;Bh++){var Vh=Ih[Bh];if(!(Lh&&Lh.filter&&Vh.query!=null&&!Lh.filter(Ph,Vh.query)))switch(Rh){case 0:Vh.h.call(Vh.ctx);break;case 1:Vh.h.call(Vh.ctx,Fh[0]);break;case 2:Vh.h.call(Vh.ctx,Fh[0],Fh[1]);break;default:Vh.h.apply(Vh.ctx,Fh);break}}return Lh&&Lh.afterTrigger&&Lh.afterTrigger(Ph),this},Ph.prototype.triggerWithContext=function(Ph){var Fh=[...arguments].slice(1);if(!this._$handlers)return this;var Ih=this._$handlers[Ph],Lh=this._$eventProcessor;if(Ih)for(var Rh=Fh.length,zh=Fh[Rh-1],Bh=Ih.length,Vh=0;Vh<Bh;Vh++){var Hh=Ih[Vh];if(!(Lh&&Lh.filter&&Hh.query!=null&&!Lh.filter(Ph,Hh.query)))switch(Rh){case 0:Hh.h.call(zh);break;case 1:Hh.h.call(zh,Fh[0]);break;case 2:Hh.h.call(zh,Fh[0],Fh[1]);break;default:Hh.h.apply(zh,Fh.slice(1,Rh-1));break}}return Lh&&Lh.afterTrigger&&Lh.afterTrigger(Ph),this},Ph}(),LN2=Math.log(2);function determinant(Ph,Fh,Ih,Lh,Rh,zh){var Bh=Lh+`-`+Rh,Vh=Ph.length;if(zh.hasOwnProperty(Bh))return zh[Bh];if(Fh===1){var Hh=Math.round(Math.log((1<<Vh)-1&~Rh)/LN2);return Ph[Ih][Hh]}for(var Uh=Lh|1<<Ih,Wh=Ih+1;Lh&1<<Wh;)Wh++;for(var Gh=0,Kh=0,qh=0;Kh<Vh;Kh++){var Jh=1<<Kh;Jh&Rh||(Gh+=(qh%2?-1:1)*Ph[Ih][Kh]*determinant(Ph,Fh-1,Wh,Uh,Rh|Jh,zh),qh++)}return zh[Bh]=Gh,Gh}function buildTransformer(Ph,Fh){var Ih=[[Ph[0],Ph[1],1,0,0,0,-Fh[0]*Ph[0],-Fh[0]*Ph[1]],[0,0,0,Ph[0],Ph[1],1,-Fh[1]*Ph[0],-Fh[1]*Ph[1]],[Ph[2],Ph[3],1,0,0,0,-Fh[2]*Ph[2],-Fh[2]*Ph[3]],[0,0,0,Ph[2],Ph[3],1,-Fh[3]*Ph[2],-Fh[3]*Ph[3]],[Ph[4],Ph[5],1,0,0,0,-Fh[4]*Ph[4],-Fh[4]*Ph[5]],[0,0,0,Ph[4],Ph[5],1,-Fh[5]*Ph[4],-Fh[5]*Ph[5]],[Ph[6],Ph[7],1,0,0,0,-Fh[6]*Ph[6],-Fh[6]*Ph[7]],[0,0,0,Ph[6],Ph[7],1,-Fh[7]*Ph[6],-Fh[7]*Ph[7]]],Lh={},Rh=determinant(Ih,8,0,0,0,Lh);if(Rh!==0){for(var zh=[],Bh=0;Bh<8;Bh++)for(var Vh=0;Vh<8;Vh++)zh[Vh]??(zh[Vh]=0),zh[Vh]+=((Bh+Vh)%2?-1:1)*determinant(Ih,7,+(Bh===0),1<<Bh,1<<Vh,Lh)/Rh*Fh[Bh];return function(Ph,Fh,Ih){var Lh=Fh*zh[6]+Ih*zh[7]+1;Ph[0]=(Fh*zh[0]+Ih*zh[1]+zh[2])/Lh,Ph[1]=(Fh*zh[3]+Ih*zh[4]+zh[5])/Lh}}}var EVENT_SAVED_PROP=`___zrEVENTSAVED`,_calcOut$1=[];function transformLocalCoord(Ph,Fh,Ih,Lh,Rh){return transformCoordWithViewport(_calcOut$1,Fh,Lh,Rh,!0)&&transformCoordWithViewport(Ph,Ih,_calcOut$1[0],_calcOut$1[1])}function transformLocalCoordClear(Ph,Fh){Ph&&Ih(Ph),Fh&&Ih(Fh);function Ih(Ph){var Fh=Ph[EVENT_SAVED_PROP];Fh&&(Fh.clearMarkers&&Fh.clearMarkers(),delete Ph[EVENT_SAVED_PROP])}}function transformCoordWithViewport(Ph,Fh,Ih,Lh,Rh){if(Fh.getBoundingClientRect&&env.domSupported&&!isCanvasEl(Fh)){var zh=Fh[EVENT_SAVED_PROP]||(Fh[EVENT_SAVED_PROP]={}),Bh=preparePointerTransformer(prepareCoordMarkers(Fh,zh),zh,Rh);if(Bh)return Bh(Ph,Ih,Lh),!0}return!1}function prepareCoordMarkers(Ph,Fh){var Ih=Fh.markers;if(Ih)return Ih;Ih=Fh.markers=[];for(var Lh=[`left`,`right`],Rh=[`top`,`bottom`],zh=0;zh<4;zh++){var Bh=document.createElement(`div`),Vh=Bh.style,Hh=zh%2,Uh=(zh>>1)%2;Vh.cssText=[`position: absolute`,`visibility: hidden`,`padding: 0`,`margin: 0`,`border-width: 0`,`user-select: none`,`width:0`,`height:0`,Lh[Hh]+`:0`,Rh[Uh]+`:0`,Lh[1-Hh]+`:auto`,Rh[1-Uh]+`:auto`,``].join(`!important;`),Ph.appendChild(Bh),Ih.push(Bh)}return Fh.clearMarkers=function(){each$15(Ih,function(Ph){Ph.parentNode&&Ph.parentNode.removeChild(Ph)})},Ih}function preparePointerTransformer(Ph,Fh,Ih){for(var Lh=Ih?`invTrans`:`trans`,Rh=Fh[Lh],zh=Fh.srcCoords,Bh=[],Vh=[],Hh=!0,Uh=0;Uh<4;Uh++){var Wh=Ph[Uh].getBoundingClientRect(),Gh=2*Uh,Kh=Wh.left,qh=Wh.top;Bh.push(Kh,qh),Hh=Hh&&zh&&Kh===zh[Gh]&&qh===zh[Gh+1],Vh.push(Ph[Uh].offsetLeft,Ph[Uh].offsetTop)}return Hh&&Rh?Rh:(Fh.srcCoords=Bh,Fh[Lh]=Ih?buildTransformer(Vh,Bh):buildTransformer(Bh,Vh))}function isCanvasEl(Ph){return Ph.nodeName.toUpperCase()===`CANVAS`}var replaceReg=/([&<>"'])/g,replaceMap={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function encodeHTML(Ph){return Ph==null?``:(Ph+``).replace(replaceReg,function(Ph,Fh){return replaceMap[Fh]})}var MOUSE_EVENT_REG=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,_calcOut=[],firefoxNotSupportOffsetXY=env.browser.firefox&&+env.browser.version.split(`.`)[0]<39;function clientToLocal(Ph,Fh,Ih,Lh){return Ih||={},Lh?calculateZrXY(Ph,Fh,Ih):firefoxNotSupportOffsetXY&&Fh.layerX!=null&&Fh.layerX!==Fh.offsetX?(Ih.zrX=Fh.layerX,Ih.zrY=Fh.layerY):Fh.offsetX==null?calculateZrXY(Ph,Fh,Ih):(Ih.zrX=Fh.offsetX,Ih.zrY=Fh.offsetY),Ih}function calculateZrXY(Ph,Fh,Ih){if(env.domSupported&&Ph.getBoundingClientRect){var Lh=Fh.clientX,Rh=Fh.clientY;if(isCanvasEl(Ph)){var zh=Ph.getBoundingClientRect();Ih.zrX=Lh-zh.left,Ih.zrY=Rh-zh.top;return}else if(transformCoordWithViewport(_calcOut,Ph,Lh,Rh)){Ih.zrX=_calcOut[0],Ih.zrY=_calcOut[1];return}}Ih.zrX=Ih.zrY=0}function getNativeEvent(Ph){return Ph||window.event}function normalizeEvent(Ph,Fh,Ih){if(Fh=getNativeEvent(Fh),Fh.zrX!=null)return Fh;var Lh=Fh.type;if(Lh&&Lh.indexOf(`touch`)>=0){var Rh=Lh===`touchend`?Fh.changedTouches[0]:Fh.targetTouches[0];Rh&&clientToLocal(Ph,Rh,Fh,Ih)}else{clientToLocal(Ph,Fh,Fh,Ih);var zh=getWheelDeltaMayPolyfill(Fh);Fh.zrDelta=zh?zh/120:-(Fh.detail||0)/3}var Bh=Fh.button;return Fh.which==null&&Bh!==void 0&&MOUSE_EVENT_REG.test(Fh.type)&&(Fh.which=Bh&1?1:Bh&2?3:Bh&4?2:0),Fh}function getWheelDeltaMayPolyfill(Ph){var Fh=Ph.wheelDelta;if(Fh)return Fh;var Ih=Ph.deltaX,Lh=Ph.deltaY;if(Ih==null||Lh==null)return Fh;var Rh=Math.abs(Lh===0?Ih:Lh),zh=Lh>0?-1:Lh<0?1:Ih>0?-1:1;return 3*Rh*zh}function addEventListener$1(Ph,Fh,Ih,Lh){Ph.addEventListener(Fh,Ih,Lh)}function removeEventListener$1(Ph,Fh,Ih,Lh){Ph.removeEventListener(Fh,Ih,Lh)}var stop=function(Ph){Ph.preventDefault(),Ph.stopPropagation(),Ph.cancelBubble=!0};function isMiddleOrRightButtonOnMouseUpDown(Ph){return Ph.which===2||Ph.which===3}var GestureMgr=function(){function Ph(){this._track=[]}return Ph.prototype.recognize=function(Ph,Fh,Ih){return this._doTrack(Ph,Fh,Ih),this._recognize(Ph)},Ph.prototype.clear=function(){return this._track.length=0,this},Ph.prototype._doTrack=function(Ph,Fh,Ih){var Lh=Ph.touches;if(Lh){for(var Rh={points:[],touches:[],target:Fh,event:Ph},zh=0,Bh=Lh.length;zh<Bh;zh++){var Vh=Lh[zh],Hh=clientToLocal(Ih,Vh,{});Rh.points.push([Hh.zrX,Hh.zrY]),Rh.touches.push(Vh)}this._track.push(Rh)}},Ph.prototype._recognize=function(Ph){for(var Fh in recognizers)if(recognizers.hasOwnProperty(Fh)){var Ih=recognizers[Fh](this._track,Ph);if(Ih)return Ih}},Ph}();function dist(Ph){var Fh=Ph[1][0]-Ph[0][0],Ih=Ph[1][1]-Ph[0][1];return Math.sqrt(Fh*Fh+Ih*Ih)}function center$1(Ph){return[(Ph[0][0]+Ph[1][0])/2,(Ph[0][1]+Ph[1][1])/2]}var recognizers={pinch:function(Ph,Fh){var Ih=Ph.length;if(Ih){var Lh=(Ph[Ih-1]||{}).points,Rh=(Ph[Ih-2]||{}).points||Lh;if(Rh&&Rh.length>1&&Lh&&Lh.length>1){var zh=dist(Lh)/dist(Rh);!isFinite(zh)&&(zh=1),Fh.pinchScale=zh;var Bh=center$1(Lh);return Fh.pinchX=Bh[0],Fh.pinchY=Bh[1],{type:`pinch`,target:Ph[0].target,event:Fh}}}}};function create$1(){return[1,0,0,1,0,0]}function identity(Ph){return Ph[0]=1,Ph[1]=0,Ph[2]=0,Ph[3]=1,Ph[4]=0,Ph[5]=0,Ph}function copy(Ph,Fh){return Ph[0]=Fh[0],Ph[1]=Fh[1],Ph[2]=Fh[2],Ph[3]=Fh[3],Ph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zh*Hh,Ph[2]=-Lh*Hh,Ph[3]=Ih*Hh,Ph[4]=(Lh*Vh-Bh*Rh)*Hh,Ph[5]=(zh*Rh-Ih*Vh)*Hh,Ph):null}function clone$3(Ph){var Fh=create$1();return copy(Fh,Ph),Fh}var Point=function(){function Ph(Ph,Fh){this.x=Ph||0,this.y=Fh||0}return Ph.prototype.copy=function(Ph){return this.x=Ph.x,this.y=Ph.y,this},Ph.prototype.clone=function(){return new Ph(this.x,this.y)},Ph.prototype.set=function(Ph,Fh){return this.x=Ph,this.y=Fh,this},Ph.prototype.equal=function(Ph){return Ph.x===this.x&&Ph.y===this.y},Ph.prototype.add=function(Ph){return this.x+=Ph.x,this.y+=Ph.y,this},Ph.prototype.scale=function(Ph){this.x*=Ph,this.y*=Ph},Ph.prototype.scaleAndAdd=function(Ph,Fh){this.x+=Ph.x*Fh,this.y+=Ph.y*Fh},Ph.prototype.sub=function(Ph){return this.x-=Ph.x,this.y-=Ph.y,this},Ph.prototype.dot=function(Ph){return this.x*Ph.x+this.y*Ph.y},Ph.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},Ph.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},Ph.prototype.normalize=function(){var Ph=this.len();return this.x/=Ph,this.y/=Ph,this},Ph.prototype.distance=function(Ph){var Fh=this.x-Ph.x,Ih=this.y-Ph.y;return Math.sqrt(Fh*Fh+Ih*Ih)},Ph.prototype.distanceSquare=function(Ph){var Fh=this.x-Ph.x,Ih=this.y-Ph.y;return Fh*Fh+Ih*Ih},Ph.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},Ph.prototype.transform=function(Ph){if(Ph){var Fh=this.x,Ih=this.y;return this.x=Ph[0]*Fh+Ph[2]*Ih+Ph[4],this.y=Ph[1]*Fh+Ph[3]*Ih+Ph[5],this}},Ph.prototype.toArray=function(Ph){return Ph[0]=this.x,Ph[1]=this.y,Ph},Ph.prototype.fromArray=function(Ph){this.x=Ph[0],this.y=Ph[1]},Ph.set=function(Ph,Fh,Ih){Ph.x=Fh,Ph.y=Ih},Ph.copy=function(Ph,Fh){Ph.x=Fh.x,Ph.y=Fh.y},Ph.len=function(Ph){return Math.sqrt(Ph.x*Ph.x+Ph.y*Ph.y)},Ph.lenSquare=function(Ph){return Ph.x*Ph.x+Ph.y*Ph.y},Ph.dot=function(Ph,Fh){return Ph.x*Fh.x+Ph.y*Fh.y},Ph.add=function(Ph,Fh,Ih){Ph.x=Fh.x+Ih.x,Ph.y=Fh.y+Ih.y},Ph.sub=function(Ph,Fh,Ih){Ph.x=Fh.x-Ih.x,Ph.y=Fh.y-Ih.y},Ph.scale=function(Ph,Fh,Ih){Ph.x=Fh.x*Ih,Ph.y=Fh.y*Ih},Ph.scaleAndAdd=function(Ph,Fh,Ih,Lh){Ph.x=Fh.x+Ih.x*Lh,Ph.y=Fh.y+Ih.y*Lh},Ph.lerp=function(Ph,Fh,Ih,Lh){var Rh=1-Lh;Ph.x=Rh*Fh.x+Lh*Ih.x,Ph.y=Rh*Fh.y+Lh*Ih.y},Ph}(),mathMin$11=Math.min,mathMax$11=Math.max,mathAbs$5=Math.abs,XY$3=[`x`,`y`],WH$3=[`width`,`height`],lt=new Point,rb=new Point,lb=new Point,rt=new Point,_intersectCtx$1=createIntersectContext(),_minTv$1=_intersectCtx$1.minTv,_maxTv$1=_intersectCtx$1.maxTv,_lenMinMax=[0,0],BoundingRect=function(){function Ph(Fh,Ih,Lh,Rh){Ph.set(this,Fh,Ih,Lh,Rh)}return Ph.set=function(Ph,Fh,Ih,Lh,Rh){return Lh<0&&(Fh+=Lh,Lh=-Lh),Rh<0&&(Ih+=Rh,Rh=-Rh),Ph.x=Fh,Ph.y=Ih,Ph.width=Lh,Ph.height=Rh,Ph},Ph.prototype.union=function(Ph){var Fh=mathMin$11(Ph.x,this.x),Ih=mathMin$11(Ph.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=mathMax$11(Ph.x+Ph.width,this.x+this.width)-Fh:this.width=Ph.width,isFinite(this.y)&&isFinite(this.height)?this.height=mathMax$11(Ph.y+Ph.height,this.y+this.height)-Ih:this.height=Ph.height,this.x=Fh,this.y=Ih},Ph.prototype.applyTransform=function(Fh){Ph.applyTransform(this,this,Fh)},Ph.prototype.calculateTransform=function(Ph){var Fh=this,Ih=Ph.width/Fh.width,Lh=Ph.height/Fh.height,Rh=create$1();return translate(Rh,Rh,[-Fh.x,-Fh.y]),scale$1(Rh,Rh,[Ih,Lh]),translate(Rh,Rh,[Ph.x,Ph.y]),Rh},Ph.prototype.intersect=function(Fh,Ih,Lh){return Ph.intersect(this,Fh,Ih,Lh)},Ph.intersect=function(Fh,Ih,Lh,Rh){Lh&&Point.set(Lh,0,0);var zh=Rh&&Rh.outIntersectRect||null,Bh=Rh&&Rh.clamp;if(zh&&(zh.x=zh.y=zh.width=zh.height=NaN),!Fh||!Ih)return!1;Fh instanceof Ph||(Fh=Ph.set(_tmpIntersectA,Fh.x,Fh.y,Fh.width,Fh.height)),Ih instanceof Ph||(Ih=Ph.set(_tmpIntersectB,Ih.x,Ih.y,Ih.width,Ih.height));var Vh=!!Lh;_intersectCtx$1.reset(Rh,Vh);var Hh=_intersectCtx$1.touchThreshold,Uh=Fh.x+Hh,Wh=Fh.x+Fh.width-Hh,Gh=Fh.y+Hh,Kh=Fh.y+Fh.height-Hh,qh=Ih.x+Hh,Jh=Ih.x+Ih.width-Hh,Yh=Ih.y+Hh,Xh=Ih.y+Ih.height-Hh;if(Uh>Wh||Gh>Kh||qh>Jh||Yh>Xh)return!1;var Zh=!(Wh<qh||Jh<Uh||Kh<Yh||Xh<Gh);return(Vh||zh)&&(_lenMinMax[0]=1/0,_lenMinMax[1]=0,intersectOneDim(Uh,Wh,qh,Jh,0,Vh,zh,Bh),intersectOneDim(Gh,Kh,Yh,Xh,1,Vh,zh,Bh),Vh&&Point.copy(Lh,Zh?_intersectCtx$1.useDir?_intersectCtx$1.dirMinTv:_minTv$1:_maxTv$1)),Zh},Ph.contain=function(Ph,Fh,Ih){return Fh>=Ph.x&&Fh<=Ph.x+Ph.width&&Ih>=Ph.y&&Ih<=Ph.y+Ph.height},Ph.prototype.contain=function(Fh,Ih){return Ph.contain(this,Fh,Ih)},Ph.prototype.clone=function(){return new Ph(this.x,this.y,this.width,this.height)},Ph.prototype.copy=function(Fh){Ph.copy(this,Fh)},Ph.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},Ph.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},Ph.prototype.isZero=function(){return this.width===0||this.height===0},Ph.create=function(Fh){return new Ph(Fh.x,Fh.y,Fh.width,Fh.height)},Ph.copy=function(Ph,Fh){return Ph.x=Fh.x,Ph.y=Fh.y,Ph.width=Fh.width,Ph.height=Fh.height,Ph},Ph.applyTransform=function(Fh,Ih,Lh){if(!Lh){Fh!==Ih&&Ph.copy(Fh,Ih);return}if(Lh[1]<1e-5&&Lh[1]>-1e-5&&Lh[2]<1e-5&&Lh[2]>-1e-5){var Rh=Lh[0],zh=Lh[3],Bh=Lh[4],Vh=Lh[5];Fh.x=Ih.x*Rh+Bh,Fh.y=Ih.y*zh+Vh,Fh.width=Ih.width*Rh,Fh.height=Ih.height*zh,Fh.width<0&&(Fh.x+=Fh.width,Fh.width=-Fh.width),Fh.height<0&&(Fh.y+=Fh.height,Fh.height=-Fh.height);return}lt.x=lb.x=Ih.x,lt.y=rt.y=Ih.y,rb.x=rt.x=Ih.x+Ih.width,rb.y=lb.y=Ih.y+Ih.height,lt.transform(Lh),rt.transform(Lh),rb.transform(Lh),lb.transform(Lh),Fh.x=mathMin$11(lt.x,rb.x,lb.x,rt.x),Fh.y=mathMin$11(lt.y,rb.y,lb.y,rt.y);var Hh=mathMax$11(lt.x,rb.x,lb.x,rt.x),Uh=mathMax$11(lt.y,rb.y,lb.y,rt.y);Fh.width=Hh-Fh.x,Fh.height=Uh-Fh.y},Ph}(),_tmpIntersectA=new BoundingRect(0,0,0,0),_tmpIntersectB=new BoundingRect(0,0,0,0);function intersectOneDim(Ph,Fh,Ih,Lh,Rh,zh,Bh,Vh){var Hh=mathAbs$5(Fh-Ih),Uh=mathAbs$5(Lh-Ph),Wh=mathMin$11(Hh,Uh),Gh=XY$3[Rh],Kh=XY$3[1-Rh],qh=WH$3[Rh];Fh<Ih||Lh<Ph?Hh<Uh?(zh&&(_maxTv$1[Gh]=-Hh),Vh&&(Bh[Gh]=Fh,Bh[qh]=0)):(zh&&(_maxTv$1[Gh]=Uh),Vh&&(Bh[Gh]=Ph,Bh[qh]=0)):(Bh&&(Bh[Gh]=mathMax$11(Ph,Ih),Bh[qh]=mathMin$11(Fh,Lh)-Bh[Gh]),zh&&(Wh<_lenMinMax[0]||_intersectCtx$1.useDir)&&(_lenMinMax[0]=mathMin$11(Wh,_lenMinMax[0]),(Hh<Uh||!_intersectCtx$1.bidirectional)&&(_minTv$1[Gh]=Hh,_minTv$1[Kh]=0,_intersectCtx$1.useDir&&_intersectCtx$1.calcDirMTV()),(Hh>=Uh||!_intersectCtx$1.bidirectional)&&(_minTv$1[Gh]=-Uh,_minTv$1[Kh]=0,_intersectCtx$1.useDir&&_intersectCtx$1.calcDirMTV())))}function createIntersectContext(){var Ph=0,Fh=new Point,Ih=new Point,Lh={minTv:new Point,maxTv:new Point,useDir:!1,dirMinTv:new Point,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(Rh,zh){Lh.touchThreshold=0,Rh&&Rh.touchThreshold!=null&&(Lh.touchThreshold=mathMax$11(0,Rh.touchThreshold)),Lh.negativeSize=!1,zh&&(Lh.minTv.set(1/0,1/0),Lh.maxTv.set(0,0),Lh.useDir=!1,Rh&&Rh.direction!=null&&(Lh.useDir=!0,Lh.dirMinTv.copy(Lh.minTv),Ih.copy(Lh.minTv),Ph=Rh.direction,Lh.bidirectional=Rh.bidirectional==null||!!Rh.bidirectional,Lh.bidirectional||Fh.set(Math.cos(Ph),Math.sin(Ph))))},calcDirMTV:function(){var zh=Lh.minTv,Bh=Lh.dirMinTv,Vh=zh.y*zh.y+zh.x*zh.x,Hh=Math.sin(Ph),Uh=Math.cos(Ph),Wh=Hh*zh.y+Uh*zh.x;if(Rh(Wh)){Rh(zh.x)&&Rh(zh.y)&&Bh.set(0,0);return}if(Ih.x=Vh*Uh/Wh,Ih.y=Vh*Hh/Wh,Rh(Ih.x)&&Rh(Ih.y)){Bh.set(0,0);return}(Lh.bidirectional||Fh.dot(Ih)>0)&&Ih.len()<Bh.len()&&Bh.copy(Ih)}};function Rh(Ph){return mathAbs$5(Ph)<1e-10}return Lh}var SILENT=`silent`;function makeEventPacket(Ph,Fh,Ih){return{type:Ph,event:Ih,target:Fh.target,topTarget:Fh.topTarget,cancelBubble:!1,offsetX:Ih.zrX,offsetY:Ih.zrY,gestureEvent:Ih.gestureEvent,pinchX:Ih.pinchX,pinchY:Ih.pinchY,pinchScale:Ih.pinchScale,wheelDelta:Ih.zrDelta,zrByTouch:Ih.zrByTouch,which:Ih.which,stop:stopEvent}}function stopEvent(){stop(this.event)}var EmptyProxy=function(Ph){__extends(Fh,Ph);function Fh(){var Fh=Ph!==null&&Ph.apply(this,arguments)||this;return Fh.handler=null,Fh}return Fh.prototype.dispose=function(){},Fh.prototype.setCursor=function(){},Fh}(Eventful),HoveredResult=function(){function Ph(Ph,Fh){this.x=Ph,this.y=Fh}return Ph}(),handlerNames=[`click`,`dblclick`,`mousewheel`,`mouseout`,`mouseup`,`mousedown`,`mousemove`,`contextmenu`],tmpRect$1=new BoundingRect(0,0,0,0),Handler=function(Ph){__extends(Fh,Ph);function Fh(Fh,Ih,Lh,Rh,zh){var Bh=Ph.call(this)||this;return Bh._hovered=new HoveredResult(0,0),Bh.storage=Fh,Bh.painter=Ih,Bh.painterRoot=Rh,Bh._pointerSize=zh,Lh||=new EmptyProxy,Bh.proxy=null,Bh.setHandlerProxy(Lh),Bh._draggingMgr=new Draggable(Bh),Bh}return Fh.prototype.setHandlerProxy=function(Ph){this.proxy&&this.proxy.dispose(),Ph&&(each$15(handlerNames,function(Fh){Ph.on&&Ph.on(Fh,this[Fh],this)},this),Ph.handler=this),this.proxy=Ph},Fh.prototype.mousemove=function(Ph){var Fh=Ph.zrX,Ih=Ph.zrY,Lh=isOutsideBoundary(this,Fh,Ih),Rh=this._hovered,zh=Rh.target;zh&&!zh.__zr&&(Rh=this.findHover(Rh.x,Rh.y),zh=Rh.target);var Bh=this._hovered=Lh?new HoveredResult(Fh,Ih):this.findHover(Fh,Ih),Vh=Bh.target,Hh=this.proxy;Hh.setCursor&&Hh.setCursor(Vh?Vh.cursor:`default`),zh&&Vh!==zh&&this.dispatchToElement(Rh,`mouseout`,Ph),this.dispatchToElement(Bh,`mousemove`,Ph),Vh&&Vh!==zh&&this.dispatchToElement(Bh,`mouseover`,Ph)},Fh.prototype.mouseout=function(Ph){var Fh=Ph.zrEventControl;Fh!==`only_globalout`&&this.dispatchToElement(this._hovered,`mouseout`,Ph),Fh!==`no_globalout`&&this.trigger(`globalout`,{type:`globalout`,event:Ph})},Fh.prototype.resize=function(){this._hovered=new HoveredResult(0,0)},Fh.prototype.dispatch=function(Ph,Fh){var Ih=this[Ph];Ih&&Ih.call(this,Fh)},Fh.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},Fh.prototype.setCursorStyle=function(Ph){var Fh=this.proxy;Fh.setCursor&&Fh.setCursor(Ph)},Fh.prototype.dispatchToElement=function(Ph,Fh,Ih){Ph||={};var Lh=Ph.target;if(!(Lh&&Lh.silent)){for(var Rh=`on`+Fh,zh=makeEventPacket(Fh,Ph,Ih);Lh&&(Lh[Rh]&&(zh.cancelBubble=!!Lh[Rh].call(Lh,zh)),Lh.trigger(Fh,zh),Lh=Lh.__hostTarget?Lh.__hostTarget:Lh.parent,!zh.cancelBubble););zh.cancelBubble||(this.trigger(Fh,zh),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(Ph){typeof Ph[Rh]==`function`&&Ph[Rh].call(Ph,zh),Ph.trigger&&Ph.trigger(Fh,zh)}))}},Fh.prototype.findHover=function(Ph,Fh,Ih){var Lh=this.storage.getDisplayList(),Rh=new HoveredResult(Ph,Fh);if(setHoverTarget(Lh,Rh,Ph,Fh,Ih),this._pointerSize&&!Rh.target){for(var zh=[],Bh=this._pointerSize,Vh=Bh/2,Hh=new BoundingRect(Ph-Vh,Fh-Vh,Bh,Bh),Uh=Lh.length-1;Uh>=0;Uh--){var Wh=Lh[Uh];Wh!==Ih&&!Wh.ignore&&!Wh.ignoreCoarsePointer&&(!Wh.parent||!Wh.parent.ignoreCoarsePointer)&&(tmpRect$1.copy(Wh.getBoundingRect()),Wh.transform&&tmpRect$1.applyTransform(Wh.transform),tmpRect$1.intersect(Hh)&&zh.push(Wh))}if(zh.length){for(var Gh=4,Kh=Math.PI/12,qh=Math.PI*2,Jh=0;Jh<Vh;Jh+=Gh)for(var Yh=0;Yh<qh;Yh+=Kh)if(setHoverTarget(zh,Rh,Ph+Jh*Math.cos(Yh),Fh+Jh*Math.sin(Yh),Ih),Rh.target)return Rh}}return Rh},Fh.prototype.processGesture=function(Ph,Fh){this._gestureMgr||=new GestureMgr;var Ih=this._gestureMgr;Fh===`start`&&Ih.clear();var Lh=Ih.recognize(Ph,this.findHover(Ph.zrX,Ph.zrY,null).target,this.proxy.dom);if(Fh===`end`&&Ih.clear(),Lh){var Rh=Lh.type;Ph.gestureEvent=Rh;var zh=new HoveredResult;zh.target=Lh.target,this.dispatchToElement(zh,Rh,Lh.event)}},Fh}(Eventful);each$15([`click`,`mousedown`,`mouseup`,`mousewheel`,`dblclick`,`contextmenu`],function(Ph){Handler.prototype[Ph]=function(Fh){var Ih=Fh.zrX,Lh=Fh.zrY,Rh=isOutsideBoundary(this,Ih,Lh),zh,Bh;if((Ph!==`mouseup`||!Rh)&&(zh=this.findHover(Ih,Lh),Bh=zh.target),Ph===`mousedown`)this._downEl=Bh,this._downPoint=[Fh.zrX,Fh.zrY],this._upEl=Bh;else if(Ph===`mouseup`)this._upEl=Bh;else if(Ph===`click`){if(this._downEl!==this._upEl||!this._downPoint||dist$1(this._downPoint,[Fh.zrX,Fh.zrY])>4)return;this._downPoint=null}this.dispatchToElement(zh,Ph,Fh)}});function isHover(Ph,Fh,Ih){if(Ph[Ph.rectHover?`rectContain`:`contain`](Fh,Ih)){for(var Lh=Ph,Rh=void 0,zh=!1;Lh;){if(Lh.ignoreClip&&(zh=!0),!zh){var Bh=Lh.getClipPath();if(Bh&&!Bh.contain(Fh,Ih))return!1}Lh.silent&&(Rh=!0);var Vh=Lh.__hostTarget;Lh=Vh?Lh.ignoreHostSilent?null:Vh:Lh.parent}return Rh?SILENT:!0}return!1}function setHoverTarget(Ph,Fh,Ih,Lh,Rh){for(var zh=Ph.length-1;zh>=0;zh--){var Bh=Ph[zh],Vh=void 0;if(Bh!==Rh&&!Bh.ignore&&(Vh=isHover(Bh,Ih,Lh))&&(!Fh.topTarget&&(Fh.topTarget=Bh),Vh!==SILENT)){Fh.target=Bh;break}}}function isOutsideBoundary(Ph,Fh,Ih){var Lh=Ph.painter;return Fh<0||Fh>Lh.getWidth()||Ih<0||Ih>Lh.getHeight()}var DEFAULT_MIN_MERGE=32,DEFAULT_MIN_GALLOPING=7;function minRunLength(Ph){for(var Fh=0;Ph>=DEFAULT_MIN_MERGE;)Fh|=Ph&1,Ph>>=1;return Ph+Fh}function makeAscendingRun(Ph,Fh,Ih,Lh){var Rh=Fh+1;if(Rh===Ih)return 1;if(Lh(Ph[Rh++],Ph[Fh])<0){for(;Rh<Ih&&Lh(Ph[Rh],Ph[Rh-1])<0;)Rh++;reverseRun(Ph,Fh,Rh)}else for(;Rh<Ih&&Lh(Ph[Rh],Ph[Rh-1])>=0;)Rh++;return Rh-Fh}function reverseRun(Ph,Fh,Ih){for(Ih--;Fh<Ih;){var Lh=Ph[Fh];Ph[Fh++]=Ph[Ih],Ph[Ih--]=Lh}}function binaryInsertionSort(Ph,Fh,Ih,Lh,Rh){for(Lh===Fh&&Lh++;Lh<Ih;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ingRun(Ph,Ih,Lh,Fh),binaryInsertionSort(Ph,Ih,Lh,Ih+zh,Fh);return}var Bh=TimSort(Ph,Fh),Vh=minRunLength(Rh);do{if(zh=makeAscendingRun(Ph,Ih,Lh,Fh),zh<Vh){var Hh=Rh;Hh>Vh&&(Hh=Vh),binaryInsertionSort(Ph,Ih,Ih+Hh,Ih+zh,Fh),zh=Hh}Bh.pushRun(Ih,zh),Bh.mergeRuns(),Rh-=zh,Ih+=zh}while(Rh!==0);Bh.forceMergeRuns()}}var invalidZErrorLogged=!1;function logInvalidZError(){invalidZErrorLogged||(invalidZErrorLogged=!0,console.warn(`z / z2 / zlevel of displayable is invalid, which may cause unexpected errors`))}function shapeCompareFunc(Ph,Fh){return Ph.zlevel===Fh.zlevel?Ph.z===Fh.z?Ph.z2-Fh.z2:Ph.z-Fh.z:Ph.zlevel-Fh.zlevel}var Storage=function(){function Ph(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=shapeCompareFunc}return Ph.prototype.traverse=function(Ph,Fh){for(var Ih=0;Ih<this._roots.length;Ih++)this._roots[Ih].traverse(Ph,Fh)},Ph.prototype.getDisplayList=function(Ph,Fh){Fh||=!1;var Ih=this._displayList;return(Ph||!Ih.length)&&this.updateDisplayList(Fh),Ih},Ph.prototype.updateDisplayList=function(Ph){this._displayListLen=0;for(var Fh=this._roots,Ih=this._displayList,Lh=0,Rh=Fh.length;Lh<Rh;Lh++)this._updateAndAddDisplayable(Fh[Lh],null,Ph);Ih.length=this._displayListLen,sort$2(Ih,shapeCompareFunc)},Ph.prototype._updateAndAddDisplayable=function(Ph,Fh,Ih){if(!(Ph.ignore&&!Ih)){Ph.beforeUpdate(),Ph.update(),Ph.afterUpdate();var Lh=Ph.getClipPath(),Rh=Fh&&Fh.length,zh=0,Bh=Ph.__clipPaths;if(!Ph.ignoreClip&&(Rh||Lh)){if(Bh||=Ph.__clipPaths=[],Rh)for(var Vh=0;Vh<Fh.length;Vh++)Bh[zh++]=Fh[Vh];for(var Hh=Lh,Uh=Ph;Hh;)Hh.parent=Uh,Hh.updateTransform(),Bh[zh++]=Hh,Uh=Hh,Hh=Hh.getClipPath()}if(Bh&&(Bh.length=zh),Ph.childrenRef){for(var Wh=Ph.childrenRef(),Gh=0;Gh<Wh.length;Gh++){var Kh=Wh[Gh];Ph.__dirty&&(Kh.__dirty|=1),this._updateAndAddDisplayable(Kh,Bh,Ih)}Ph.__dirty=0}else{var qh=Ph;isNaN(qh.z)&&(logInvalidZError(),qh.z=0),isNaN(qh.z2)&&(logInvalidZError(),qh.z2=0),isNaN(qh.zlevel)&&(logInvalidZError(),qh.zlevel=0),this._displayList[this._displayListLen++]=qh}var Jh=Ph.getDecalElement&&Ph.getDecalElement();Jh&&this._updateAndAddDisplayable(Jh,Bh,Ih);var Yh=Ph.getTextGuideLine();Yh&&this._updateAndAddDisplayable(Yh,Bh,Ih);var Xh=Ph.getTextContent();Xh&&this._updateAndAddDisplayable(Xh,Bh,Ih)}},Ph.prototype.addRoot=function(Ph){Ph.__zr&&Ph.__zr.storage===this||this._roots.push(Ph)},Ph.prototype.delRoot=function(Ph){if(Ph instanceof Array){for(var Fh=0,Ih=Ph.length;Fh<Ih;Fh++)this.delRoot(Ph[Fh]);return}var Lh=indexOf(this._roots,Ph);Lh>=0&&this._roots.splice(Lh,1)},Ph.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},Ph.prototype.getRoots=function(){return this._roots},Ph.prototype.dispose=function(){this._displayList=null,this._roots=null},Ph}(),requestAnimationFrame$1=env.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(Ph){return setTimeout(Ph,16)},easingFuncs={linear:function(Ph){return Ph},quadraticIn:function(Ph){return Ph*Ph},quadraticOut:function(Ph){return Ph*(2-Ph)},quadraticInOut:function(Ph){return(Ph*=2)<1?.5*Ph*Ph:-.5*(--Ph*(Ph-2)-1)},cubicIn:function(Ph){return Ph*Ph*Ph},cubicOut:function(Ph){return--Ph*Ph*Ph+1},cubicInOut:function(Ph){return(Ph*=2)<1?.5*Ph*Ph*Ph:.5*((Ph-=2)*Ph*Ph+2)},quarticIn:function(Ph){return Ph*Ph*Ph*Ph},quarticOut:function(Ph){return 1- --Ph*Ph*Ph*Ph},quarticInOut:function(Ph){return(Ph*=2)<1?.5*Ph*Ph*Ph*Ph:-.5*((Ph-=2)*Ph*Ph*Ph-2)},quinticIn:function(Ph){return Ph*Ph*Ph*Ph*Ph},quinticOut:function(Ph){return--Ph*Ph*Ph*Ph*Ph+1},quinticInOut:function(Ph){return(Ph*=2)<1?.5*Ph*Ph*Ph*Ph*Ph:.5*((Ph-=2)*Ph*Ph*Ph*Ph+2)},sinusoidalIn:function(Ph){return 1-Math.cos(Ph*Math.PI/2)},sinusoidalOut:function(Ph){return Math.sin(Ph*Math.PI/2)},sinusoidalInOut:function(Ph){return .5*(1-Math.cos(Math.PI*Ph))},exponentialIn:function(Ph){return Ph===0?0:1024**(Ph-1)},exponentialOut:function(Ph){return Ph===1?1:1-2**(-10*Ph)},exponentialInOut:function(Ph){return Ph===0?0:Ph===1?1:(Ph*=2)<1?.5*1024**(Ph-1):.5*(-(2**(-10*(Ph-1)))+2)},circularIn:function(Ph){return 1-Math.sqrt(1-Ph*Ph)},circularOut:function(Ph){return Math.sqrt(1- --Ph*Ph)},circularInOut:function(Ph){return(Ph*=2)<1?-.5*(Math.sqrt(1-Ph*Ph)-1):.5*(Math.sqrt(1-(Ph-=2)*Ph)+1)},elasticIn:function(Ph){var Fh,Ih=.1,Lh=.4;return Ph===0?0:Ph===1?1:(!Ih||Ih<1?(Ih=1,Fh=Lh/4):Fh=Lh*Math.asin(1/Ih)/(2*Math.PI),-(Ih*2**(10*--Ph)*Math.sin((Ph-Fh)*(2*Math.PI)/Lh)))},elasticOut:function(Ph){var Fh,Ih=.1,Lh=.4;return Ph===0?0:Ph===1?1:(!Ih||Ih<1?(Ih=1,Fh=Lh/4):Fh=Lh*Math.asin(1/Ih)/(2*Math.PI),Ih*2**(-10*Ph)*Math.sin((Ph-Fh)*(2*Math.PI)/Lh)+1)},elasticInOut:function(Ph){var Fh,Ih=.1,Lh=.4;return Ph===0?0:Ph===1?1:(!Ih||Ih<1?(Ih=1,Fh=Lh/4):Fh=Lh*Math.asin(1/Ih)/(2*Math.PI),(Ph*=2)<1?-.5*(Ih*2**(10*--Ph)*Math.sin((Ph-Fh)*(2*Math.PI)/Lh)):Ih*2**(-10*--Ph)*Math.sin((Ph-Fh)*(2*Math.PI)/Lh)*.5+1)},backIn:function(Ph){var Fh=1.70158;return Ph*Ph*((Fh+1)*Ph-Fh)},backOut:function(Ph){var Fh=1.70158;return--Ph*Ph*((Fh+1)*Ph+Fh)+1},backInOut:function(Ph){var Fh=1.70158*1.525;return(Ph*=2)<1?.5*(Ph*Ph*((Fh+1)*Ph-Fh)):.5*((Ph-=2)*Ph*((Fh+1)*Ph+Fh)+2)},bounceIn:function(Ph){return 1-easingFuncs.bounceOut(1-Ph)},bounceOut:function(Ph){return Ph<1/2.75?7.5625*Ph*Ph:Ph<2/2.75?7.5625*(Ph-=1.5/2.75)*Ph+.75:Ph<2.5/2.75?7.5625*(Ph-=2.25/2.75)*Ph+.9375:7.5625*(Ph-=2.625/2.75)*Ph+.984375},bounceInOut:function(Ph){return Ph<.5?easingFuncs.bounceIn(Ph*2)*.5:easingFuncs.bounceOut(Ph*2-1)*.5+.5}},mathPow$2=Math.pow,mathSqrt$3=Math.sqrt,EPSILON$4=1e-8,EPSILON_NUMERIC=1e-4,THREE_SQRT=mathSqrt$3(3),ONE_THIRD=1/3,_v0=create$2(),_v1=create$2(),_v2=create$2();function isAroundZero$1(Ph){return Ph>-EPSILON$4&&Ph<EPSILON$4}function isNotAroundZero$1(Ph){return Ph>EPSILON$4||Ph<-EPSILON$4}function cubicAt(Ph,Fh,Ih,Lh,Rh){var zh=1-R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$1(Fh,Lh,zh,Kh),Yh=qh-Vh,Xh=Jh-Hh;Uh+=Math.sqrt(Yh*Yh+Xh*Xh),Vh=qh,Hh=Jh}return Uh}var regexp=/cubic-bezier\(([0-9,\.e ]+)\)/;function createCubicEasingFunc(Ph){var Fh=Ph&®exp.exec(Ph);if(Fh){var Ih=Fh[1].split(`,`),Lh=+trim$1(Ih[0]),Rh=+trim$1(Ih[1]),zh=+trim$1(Ih[2]),Bh=+trim$1(Ih[3]);if(isNaN(Lh+Rh+zh+Bh))return;var Vh=[];return function(Ph){return Ph<=0?0:Ph>=1?1:cubicRootAt(0,Lh,zh,1,Ph,Vh)&&cubicAt(0,Rh,Bh,1,Vh[0])}}}var Clip=function(){function Ph(Ph){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=Ph.life||1e3,this._delay=Ph.delay||0,this.loop=Ph.loop||!1,this.onframe=Ph.onframe||noop,this.ondestroy=Ph.ondestroy||noop,this.onrestart=Ph.onrestart||noop,Ph.easing&&this.setEasing(Ph.easing)}return Ph.prototype.step=function(Ph,Fh){if(this._inited||=(this._startTime=Ph+this._delay,!0),this._paused){this._pausedTime+=Fh;return}var Ih=this._life,Lh=Ph-this._startTime-this._pausedTime,Rh=Lh/Ih;Rh<0&&(Rh=0),Rh=Math.min(Rh,1);var zh=this.easingFunc,Bh=zh?zh(Rh):Rh;if(this.onframe(Bh),Rh===1)if(this.loop){var Vh=Lh%Ih;this._startTime=Ph-Vh,this._pausedTime=0,this.onrestart()}else return!0;return!1},Ph.prototype.pause=function(){this._paused=!0},Ph.prototype.resume=function(){this._paused=!1},Ph.prototype.setEasing=function(Ph){this.easing=Ph,this.easingFunc=isFunction(Ph)?Ph:easingFuncs[Ph]||createCubicEasingFunc(Ph)},Ph}(),Entry=function(){function Ph(Ph){this.value=Ph}return Ph}(),LinkedList=function(){function Ph(){this._len=0}return Ph.prototype.insert=function(Ph){var Fh=new Entry(Ph);return this.insertEntry(Fh),Fh},Ph.prototype.insertEntry=function(Ph){this.head?(this.tail.next=Ph,Ph.prev=this.tail,Ph.next=null,this.tail=Ph):this.head=this.tail=Ph,this._len++},Ph.prototype.remove=function(Ph){var Fh=Ph.prev,Ih=Ph.next;Fh?Fh.next=Ih:this.head=Ih,Ih?Ih.prev=Fh:this.tail=Fh,Ph.next=Ph.prev=null,this._len--},Ph.prototype.len=function(){return this._len},Ph.prototype.clear=function(){this.head=this.tail=null,this._len=0},Ph}(),LRU=function(){function Ph(Ph){this._list=new LinkedList,this._maxSize=10,this._map={},this._maxSize=Ph}return Ph.prototype.put=function(Ph,Fh){var Ih=this._list,Lh=this._map,Rh=null;if(Lh[Ph]==null){var zh=Ih.len(),Bh=this._lastRemovedEntry;if(zh>=this._maxSize&&zh>0){var Vh=Ih.head;Ih.remove(Vh),delete Lh[Vh.key],Rh=Vh.value,this._lastRemovedEntry=Vh}Bh?Bh.value=Fh:Bh=new Entry(Fh),Bh.key=Ph,Ih.insertEntry(Bh),Lh[Ph]=Bh}return Rh},Ph.prototype.get=function(Ph){var Fh=this._map[Ph],Ih=this._list;if(Fh!=null)return Fh!==Ih.tail&&(Ih.remove(Fh),Ih.insertEntry(Fh)),Fh.value},Ph.prototype.clear=function(){this._list.clear(),this._map={}},Ph.prototype.len=function(){return this._list.len()},Ph}(),kCSSColorTable={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function clampCssByte(Ph){return Ph=Math.round(Ph),Ph<0?0:Ph>255?255:Ph}function clampCssAngle(Ph){return Ph=Math.round(Ph),Ph<0?0:Ph>360?360:Ph}function clampCssFloat(Ph){return Ph<0?0:Ph>1?1:Ph}function parseCssInt(Ph){var Fh=Ph;return Fh.length&&Fh.charAt(Fh.length-1)===`%`?clampCssByte(parseFloat(Fh)/100*255):clampCssByte(parseInt(Fh,10))}function parseCssFloat(Ph){var Fh=Ph;return Fh.length&&Fh.charAt(Fh.length-1)===`%`?clampCssFloat(parseFloat(Fh)/100):clampCssFloat(parseFloat(Fh))}function cssHueToRgb(Ph,Fh,Ih){return Ih<0?Ih+=1:Ih>1&&--Ih,Ih*6<1?Ph+(Fh-Ph)*Ih*6:Ih*2<1?Fh:Ih*3<2?Ph+(Fh-Ph)*(2/3-Ih)*6:Ph}function lerpNumber(Ph,Fh,Ih){return Ph+(Fh-Ph)*Ih}function setRgba(Ph,Fh,Ih,Lh,Rh){return Ph[0]=Fh,Ph[1]=Ih,Ph[2]=Lh,Ph[3]=Rh,Ph}function copyRgba(Ph,Fh){return Ph[0]=Fh[0],Ph[1]=Fh[1],Ph[2]=Fh[2],Ph[3]=Fh[3],Ph}var colorCache=new LRU(20),lastRemovedArr=null;function putToCache(Ph,Fh){lastRemovedArr&©Rgba(lastRemovedArr,Fh),lastRemovedArr=colorCache.put(Ph,lastRemovedArr||Fh.slice())}function parse$2(Ph,Fh){if(Ph){Fh||=[];var Ih=colorCache.get(Ph);if(Ih)return copyRgba(Fh,Ih);Ph+=``;var Lh=Ph.replace(/ /g,``).toLowerCase();if(Lh in kCSSColorTable)return copyRgba(Fh,kCSSColorTable[Lh]),putToCache(Ph,Fh),Fh;var Rh=Lh.length;if(Lh.charAt(0)===`#`){if(Rh===4||Rh===5){var zh=parseInt(Lh.slice(1,4),16);if(!(zh>=0&&zh<=4095)){setRgba(Fh,0,0,0,1);return}return setRgba(Fh,(zh&3840)>>4|(zh&3840)>>8,zh&240|(zh&240)>>4,zh&15|(zh&15)<<4,Rh===5?parseInt(Lh.slice(4),16)/15:1),putToCache(Ph,Fh),Fh}else if(Rh===7||Rh===9){var zh=parseInt(Lh.slice(1,7),16);if(!(zh>=0&&zh<=16777215)){setRgba(Fh,0,0,0,1);return}return setRgba(Fh,(zh&16711680)>>16,(zh&65280)>>8,zh&255,Rh===9?parseInt(Lh.slice(7),16)/255:1),putToCache(Ph,Fh),Fh}return}var Bh=Lh.indexOf(`(`),Vh=Lh.indexOf(`)`);if(Bh!==-1&&Vh+1===Rh){var Hh=Lh.substr(0,Bh),Uh=Lh.substr(Bh+1,Vh-(Bh+1)).split(`,`),Wh=1;switch(Hh){case`rgba`:if(Uh.length!==4)return Uh.length===3?setRgba(Fh,+Uh[0],+Uh[1],+Uh[2],1):setRgba(Fh,0,0,0,1);Wh=parseCssFloat(Uh.pop());case`rgb`:if(Uh.length>=3)return setRgba(Fh,parseCssInt(Uh[0]),parseCssInt(Uh[1]),parseCssInt(Uh[2]),Uh.length===3?Wh:parseCssFloat(Uh[3])),putToCache(Ph,Fh),Fh;setRgba(Fh,0,0,0,1);return;case`hsla`:if(Uh.length!==4){setRgba(Fh,0,0,0,1);return}return Uh[3]=parseCssFloat(Uh[3]),hsla2rgba(Uh,Fh),putToCache(Ph,Fh),Fh;case`hsl`:if(Uh.length!==3){setRgba(Fh,0,0,0,1);return}return hsla2rgba(Uh,Fh),putToCache(Ph,Fh),Fh;default:return}}setRgba(Fh,0,0,0,1)}}function hsla2rgba(Ph,Fh){var Ih=(parseFloat(Ph[0])%360+360)%360/360,Lh=parseCssFloat(Ph[1]),Rh=parseCssFloat(Ph[2]),zh=Rh<=.5?Rh*(Lh+1):Rh+Lh-Rh*Lh,Bh=Rh*2-zh;return Fh||=[],setRgba(Fh,clampCssByte(cssHueToRgb(Bh,zh,Ih+1/3)*255),clampCssByte(cssHueToRgb(Bh,zh,Ih)*255),clampCssByte(cssHueToRgb(Bh,zh,Ih-1/3)*255),1),Ph.length===4&&(Fh[3]=Ph[3]),Fh}function rgba2hsla(Ph){if(Ph){var Fh=Ph[0]/255,Ih=Ph[1]/255,Lh=Ph[2]/255,Rh=Math.min(Fh,Ih,Lh),zh=Math.max(Fh,Ih,Lh),Bh=zh-Rh,Vh=(zh+Rh)/2,Hh,Uh;if(Bh===0)Hh=0,Uh=0;else{Uh=Vh<.5?Bh/(zh+Rh):Bh/(2-zh-Rh);var Wh=((zh-Fh)/6+Bh/2)/Bh,Gh=((zh-Ih)/6+Bh/2)/Bh,Kh=((zh-Lh)/6+Bh/2)/Bh;Fh===zh?Hh=Kh-Gh:Ih===zh?Hh=1/3+Wh-Kh:Lh===zh&&(Hh=2/3+Gh-Wh),Hh<0&&(Hh+=1),Hh>1&&--Hh}var qh=[Hh*360,Uh,Vh];return Ph[3]!=null&&qh.push(Ph[3]),qh}}function lift(Ph,Fh){var Ih=parse$2(Ph);if(Ih){for(var Lh=0;Lh<3;Lh++)Fh<0?Ih[Lh]=Ih[Lh]*(1-Fh)|0:Ih[Lh]=(255-Ih[Lh])*Fh+Ih[Lh]|0,Ih[Lh]>255?Ih[Lh]=255:Ih[Lh]<0&&(Ih[Lh]=0);return stringify(Ih,Ih.length===4?`rgba`:`rgb`)}}function fastLerp(Ph,Fh,Ih){if(!(!(Fh&&Fh.length)||!(Ph>=0&&Ph<=1))){Ih||=[];var Lh=Ph*(Fh.length-1),Rh=Math.floor(Lh),zh=Math.ceil(Lh),Bh=Fh[Rh],Vh=Fh[zh],Hh=Lh-Rh;return Ih[0]=clampCssByte(lerpNumber(Bh[0],Vh[0],Hh)),Ih[1]=clampCssByte(lerpNumber(Bh[1],Vh[1],Hh)),Ih[2]=clampCssByte(lerpNumber(Bh[2],Vh[2],Hh)),Ih[3]=clampCssFloat(lerpNumber(Bh[3],Vh[3],Hh)),Ih}}function lerp(Ph,Fh,Ih){if(!(!(Fh&&Fh.length)||!(Ph>=0&&Ph<=1))){var Lh=Ph*(Fh.length-1),Rh=Math.floor(Lh),zh=Math.ceil(Lh),Bh=parse$2(Fh[Rh]),Vh=parse$2(Fh[zh]),Hh=Lh-Rh,Uh=stringify([clampCssByte(lerpNumber(Bh[0],Vh[0],Hh)),clampCssByte(lerpNumber(Bh[1],Vh[1],Hh)),clampCssByte(lerpNumber(Bh[2],Vh[2],Hh)),clampCssFloat(lerpNumber(Bh[3],Vh[3],Hh))],`rgba`);return Ih?{color:Uh,leftIndex:Rh,rightIndex:zh,value:Lh}:Uh}}function modifyHSL(Ph,Fh,Ih,Lh){var Rh=parse$2(Ph);if(Ph)return Rh=rgba2hsla(Rh),Fh!=null&&(Rh[0]=clampCssAngle(isFunction(Fh)?Fh(Rh[0]):Fh)),Ih!=null&&(Rh[1]=parseCssFloat(isFunction(Ih)?Ih(Rh[1]):Ih)),Lh!=null&&(Rh[2]=parseCssFloat(isFunction(Lh)?Lh(Rh[2]):Lh)),stringify(hsla2rgba(Rh),`rgba`)}function modifyAlpha(Ph,Fh){var Ih=parse$2(Ph);if(Ih&&Fh!=null)return Ih[3]=clampCssFloat(Fh),stringify(Ih,`rgba`)}function stringify(Ph,Fh){if(!(!Ph||!Ph.length)){var Ih=Ph[0]+`,`+Ph[1]+`,`+Ph[2];return(Fh===`rgba`||Fh===`hsva`||Fh===`hsla`)&&(Ih+=`,`+Ph[3]),Fh+`(`+Ih+`)`}}function lum(Ph,Fh){var Ih=parse$2(Ph);return Ih?(.299*Ih[0]+.587*Ih[1]+.114*Ih[2])*Ih[3]/255+(1-Ih[3])*Fh:0}var liftedColorCache=new LRU(100);function liftColor(Ph){if(isString(Ph)){var Fh=liftedColorCache.get(Ph);return Fh||(Fh=lift(Ph,-.1),liftedColorCache.put(Ph,Fh)),Fh}else if(isGradientObject(Ph)){var Ih=extend$1({},Ph);return Ih.colorStops=map$1(Ph.colorStops,function(Ph){return{offset:Ph.offset,color:lift(Ph.color,-.1)}}),Ih}return Ph}var mathRound$1=Math.round;function normalizeColor(Ph){var Fh;if(!Ph||Ph===`transparent`)Ph=`none`;else if(typeof Ph==`string`&&Ph.indexOf(`rgba`)>-1){var Ih=parse$2(Ph);Ih&&(Ph=`rgb(`+Ih[0]+`,`+Ih[1]+`,`+Ih[2]+`)`,Fh=Ih[3])}return{color:Ph,opacity:Fh??1}}var EPSILON$3=1e-4;function isAroundZero(Ph){return Ph<EPSILON$3&&Ph>-EPSILON$3}function round3(Ph){return mathRound$1(Ph*1e3)/1e3}function round4(Ph){return mathRound$1(Ph*1e4)/1e4}function getMatrixStr(Ph){return`matrix(`+round3(Ph[0])+`,`+round3(Ph[1])+`,`+round3(Ph[2])+`,`+round3(Ph[3])+`,`+round4(Ph[4])+`,`+round4(Ph[5])+`)`}var TEXT_ALIGN_TO_ANCHOR={left:`start`,right:`end`,center:`middle`,middle:`middle`};function adjustTextY$1(Ph,Fh,Ih){return Ih===`top`?Ph+=Fh/2:Ih===`bottom`&&(Ph-=Fh/2),Ph}function hasShadow(Ph){return Ph&&(Ph.shadowBlur||Ph.shadowOffsetX||Ph.shadowOffsetY)}function getShadowKey(Ph){var Fh=Ph.style,Ih=Ph.getGlobalScale();return[Fh.shadowColor,(Fh.shadowBlur||0).toFixed(2),(Fh.shadowOffsetX||0).toFixed(2),(Fh.shadowOffsetY||0).toFixed(2),Ih[0],Ih[1]].join(`,`)}function isImagePattern(Ph){return Ph&&!!Ph.image}function isSVGPattern(Ph){return Ph&&!!Ph.svgElement}function isPattern(Ph){return isImagePattern(Ph)||isSVGPattern(Ph)}function isLinearGradient(Ph){return Ph.type===`linear`}function isRadialGradient(Ph){return Ph.type===`radial`}function isGradient(Ph){return Ph&&(Ph.type===`linear`||Ph.type===`radial`)}function getIdURL(Ph){return`url(#`+Ph+`)`}function getPathPrecision(Ph){var Fh=Ph.getGlobalScale(),Ih=Math.max(Fh[0],Fh[1]);return Math.max(Math.ceil(Math.log(Ih)/Math.log(10)),1)}function getSRTTransformString(Ph){var Fh=Ph.x||0,Ih=Ph.y||0,Lh=(Ph.rotation||0)*RADIAN_TO_DEGREE,Rh=retrieve2(Ph.scaleX,1),zh=retrieve2(Ph.scaleY,1),Bh=Ph.skewX||0,Vh=Ph.skewY||0,Hh=[];return(Fh||Ih)&&Hh.push(`translate(`+Fh+`px,`+Ih+`px)`),Lh&&Hh.push(`rotate(`+Lh+`)`),(Rh!==1||zh!==1)&&Hh.push(`scale(`+Rh+`,`+zh+`)`),(Bh||Vh)&&Hh.push(`skew(`+mathRound$1(Bh*RADIAN_TO_DEGREE)+`deg, `+mathRound$1(Vh*RADIAN_TO_DEGREE)+`deg)`),Hh.join(` `)}var encodeBase64=(function(){return env.hasGlobalWindow&&isFunction(window.btoa)?function(Ph){return window.btoa(unescape(encodeURIComponent(Ph)))}:typeof Buffer<`u`?function(Ph){return Buffer.from(Ph).toString(`base64`)}:function(Ph){return null}})(),arraySlice=Array.prototype.slice;function interpolateNumber$1(Ph,Fh,Ih){return(Fh-Ph)*Ih+Ph}function interpolate1DArray(Ph,Fh,Ih,Lh){for(var Rh=Fh.length,zh=0;zh<Rh;zh++)Ph[zh]=interpolateNumber$1(Fh[zh],Ih[zh],Lh);return Ph}function interpolate2DArray(Ph,Fh,Ih,Lh){for(var Rh=Fh.length,zh=Rh&&Fh[0].length,Bh=0;Bh<Rh;Bh++){Ph[Bh]||(Ph[Bh]=[]);for(var Vh=0;Vh<zh;Vh++)Ph[Bh][Vh]=interpolateNumber$1(Fh[Bh][Vh],Ih[Bh][Vh],Lh)}return Ph}function add1DArray(Ph,Fh,Ih,Lh){for(var Rh=Fh.length,zh=0;zh<Rh;zh++)Ph[zh]=Fh[zh]+Ih[zh]*Lh;return Ph}function add2DArray(Ph,Fh,Ih,Lh){for(var Rh=Fh.length,zh=Rh&&Fh[0].length,Bh=0;Bh<Rh;Bh++){Ph[Bh]||(Ph[Bh]=[]);for(var Vh=0;Vh<zh;Vh++)Ph[Bh][Vh]=Fh[Bh][Vh]+Ih[Bh][Vh]*Lh}return Ph}function fillColorStops(Ph,Fh){for(var Ih=Ph.length,Lh=Fh.length,Rh=Ih>Lh?Fh:Ph,zh=Math.min(Ih,Lh),Bh=Rh[zh-1]||{color:[0,0,0,0],offset:0},Vh=zh;Vh<Math.max(Ih,Lh);Vh++)Rh.push({offset:Bh.offset,color:Bh.color.slice()})}function fillArray(Ph,Fh,Ih){var Lh=Ph,Rh=Fh;if(!(!Lh.push||!Rh.push)){var zh=Lh.length,Bh=Rh.length;if(zh!==Bh)if(zh>Bh)Lh.length=Bh;else for(var Vh=zh;Vh<Bh;Vh++)Lh.push(Ih===1?Rh[Vh]:arraySlice.call(Rh[Vh]));for(var Hh=Lh[0]&&Lh[0].length,Vh=0;Vh<Lh.length;Vh++)if(Ih===1)isNaN(Lh[Vh])&&(Lh[Vh]=Rh[Vh]);else for(var Uh=0;Uh<Hh;Uh++)isNaN(Lh[Vh][Uh])&&(Lh[Vh][Uh]=Rh[Vh][Uh])}}function cloneValue(Ph){if(isArrayLike(Ph)){var Fh=Ph.length;if(isArrayLike(Ph[0])){for(var Ih=[],Lh=0;Lh<Fh;Lh++)Ih.push(arraySlice.call(Ph[Lh]));return Ih}return arraySlice.call(Ph)}return Ph}function rgba2String(Ph){return Ph[0]=Math.floor(Ph[0])||0,Ph[1]=Math.floor(Ph[1])||0,Ph[2]=Math.floor(Ph[2])||0,Ph[3]=Ph[3]==null?1:Ph[3],`rgba(`+Ph.join(`,`)+`)`}function guessArrayDim(Ph){return isArrayLike(Ph&&Ph[0])?2:1}var VALUE_TYPE_NUMBER=0,VALUE_TYPE_1D_ARRAY=1,VALUE_TYPE_2D_ARRAY=2,VALUE_TYPE_COLOR=3,VALUE_TYPE_LINEAR_GRADIENT=4,VALUE_TYPE_RADIAL_GRADIENT=5,VALUE_TYPE_UNKOWN=6;function isGradientValueType(Ph){return Ph===VALUE_TYPE_LINEAR_GRADIENT||Ph===VALUE_TYPE_RADIAL_GRADIENT}function isArrayValueType(Ph){return Ph===VALUE_TYPE_1D_ARRAY||Ph===VALUE_TYPE_2D_ARRAY}var tmpRgba=[0,0,0,0],Track=function(){function Ph(Ph){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=Ph}return Ph.prototype.isFinished=function(){return this._finished},Ph.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},Ph.prototype.needsAnimate=function(){return this.keyframes.length>=1},Ph.prototype.getAdditiveTrack=function(){return this._additiveTrack},Ph.prototype.addKeyframe=function(Ph,Fh,Ih){this._needsSort=!0;var Lh=this.keyframes,Rh=Lh.length,zh=!1,Bh=VALUE_TYPE_UNKOWN,Vh=Fh;if(isArrayLike(Fh)){var Hh=guessArrayDim(Fh);Bh=Hh,(Hh===1&&!isNumber(Fh[0])||Hh===2&&!isNumber(Fh[0][0]))&&(zh=!0)}else if(isNumber(Fh)&&!eqNaN(Fh))Bh=VALUE_TYPE_NUMBER;else if(isString(Fh))if(!isNaN(+Fh))Bh=VALUE_TYPE_NUMBER;else{var Uh=parse$2(Fh);Uh&&(Vh=Uh,Bh=VALUE_TYPE_COLOR)}else if(isGradientObject(Fh)){var Wh=extend$1({},Vh);Wh.colorStops=map$1(Fh.colorStops,function(Ph){return{offset:Ph.offset,color:parse$2(Ph.color)}}),isLinearGradient(Fh)?Bh=VALUE_TYPE_LINEAR_GRADIENT:isRadialGradient(Fh)&&(Bh=VALUE_TYPE_RADIAL_GRADIENT),Vh=Wh}Rh===0?this.valType=Bh:(Bh!==this.valType||Bh===VALUE_TYPE_UNKOWN)&&(zh=!0),this.discrete=this.discrete||zh;var Gh={time:Ph,value:Vh,rawValue:Fh,percent:0};return Ih&&(Gh.easing=Ih,Gh.easingFunc=isFunction(Ih)?Ih:easingFuncs[Ih]||createCubicEasingFunc(Ih)),Lh.push(Gh),Gh},Ph.prototype.prepare=function(Ph,Fh){var Ih=this.keyframes;this._needsSort&&Ih.sort(function(Ph,Fh){return Ph.time-Fh.time});for(var Lh=this.valType,Rh=Ih.length,zh=Ih[Rh-1],Bh=this.discrete,Vh=isArrayValueType(Lh),Hh=isGradientValueType(Lh),Uh=0;Uh<Rh;Uh++){var Wh=Ih[Uh],Gh=Wh.value,Kh=zh.value;Wh.percent=Wh.time/Ph,Bh||(Vh&&Uh!==Rh-1?fillArray(Gh,Kh,Lh):Hh&&fillColorStops(Gh.colorStops,Kh.colorStops))}if(!Bh&&Lh!==VALUE_TYPE_RADIAL_GRADIENT&&Fh&&this.needsAnimate()&&Fh.needsAnimate()&&Lh===Fh.valType&&!Fh._finished){this._additiveTrack=Fh;for(var qh=Ih[0].value,Uh=0;Uh<Rh;Uh++)Lh===VALUE_TYPE_NUMBER?Ih[Uh].additiveValue=Ih[Uh].value-qh:Lh===VALUE_TYPE_COLOR?Ih[Uh].additiveValue=add1DArray([],Ih[Uh].value,qh,-1):isArrayValueType(Lh)&&(Ih[Uh].additiveValue=Lh===VALUE_TYPE_1D_ARRAY?add1DArray([],Ih[Uh].value,qh,-1):add2DArray([],Ih[Uh].value,qh,-1))}},Ph.prototype.step=function(Ph,Fh){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var Ih=this._additiveTrack!=null,Lh=Ih?`additiveValue`:`value`,Rh=this.valType,zh=this.keyframes,Bh=zh.length,Vh=this.propName,Hh=Rh===VALUE_TYPE_COLOR,Uh,Wh=this._lastFr,Gh=Math.min,Kh,qh;if(Bh===1)Kh=qh=zh[0];else{if(Fh<0)Uh=0;else if(Fh<this._lastFrP){for(Uh=Gh(Wh+1,Bh-1);Uh>=0&&!(zh[Uh].percent<=Fh);Uh--);Uh=Gh(Uh,Bh-2)}else{for(Uh=Wh;Uh<Bh&&!(zh[Uh].percent>Fh);Uh++);Uh=Gh(Uh-1,Bh-2)}qh=zh[Uh+1],Kh=zh[Uh]}if(Kh&&qh){this._lastFr=Uh,this._lastFrP=Fh;var Jh=qh.percent-Kh.percent,Yh=Jh===0?1:Gh((Fh-Kh.percent)/Jh,1);qh.easingFunc&&(Yh=qh.easingFunc(Yh));var Xh=Ih?this._additiveValue:Hh?tmpRgba:Ph[Vh];if((isArrayValueType(Rh)||Hh)&&!Xh&&(Xh=this._additiveValue=[]),this.discrete)Ph[Vh]=Yh<1?Kh.rawValue:qh.rawValue;else if(isArrayValueType(Rh))Rh===VALUE_TYPE_1D_ARRAY?interpolate1DArray(Xh,Kh[Lh],qh[Lh],Yh):interpolate2DArray(Xh,Kh[Lh],qh[Lh],Yh);else if(isGradientValueType(Rh)){var Zh=Kh[Lh],Qh=qh[Lh],$h=Rh===VALUE_TYPE_LINEAR_GRADIENT;Ph[Vh]={type:$h?`linear`:`radial`,x:interpolateNumber$1(Zh.x,Qh.x,Yh),y:interpolateNumber$1(Zh.y,Qh.y,Yh),colorStops:map$1(Zh.colorStops,function(Ph,Fh){var Ih=Qh.colorStops[Fh];return{offset:interpolateNumber$1(Ph.offset,Ih.offset,Yh),color:rgba2String(interpolate1DArray([],Ph.color,Ih.color,Yh))}}),global:Qh.global},$h?(Ph[Vh].x2=interpolateNumber$1(Zh.x2,Qh.x2,Yh),Ph[Vh].y2=interpolateNumber$1(Zh.y2,Qh.y2,Yh)):Ph[Vh].r=interpolateNumber$1(Zh.r,Qh.r,Yh)}else if(Hh)interpolate1DArray(Xh,Kh[Lh],qh[Lh],Yh),Ih||(Ph[Vh]=rgba2String(Xh));else{var eg=interpolateNumber$1(Kh[Lh],qh[Lh],Yh);Ih?this._additiveValue=eg:Ph[Vh]=eg}Ih&&this._addToTarget(Ph)}}},Ph.prototype._addToTarget=function(Ph){var Fh=this.valType,Ih=this.propName,Lh=this._additiveValue;Fh===VALUE_TYPE_NUMBER?Ph[Ih]=Ph[Ih]+Lh:Fh===VALUE_TYPE_COLOR?(parse$2(Ph[Ih],tmpRgba),add1DArray(tmpRgba,tmpRgba,Lh,1),Ph[Ih]=rgba2String(tmpRgba)):Fh===VALUE_TYPE_1D_ARRAY?add1DArray(Ph[Ih],Ph[Ih],Lh,1):Fh===VALUE_TYPE_2D_ARRAY&&add2DArray(Ph[Ih],Ph[Ih],Lh,1)},Ph}(),Animator=function(){function Ph(Ph,Fh,Ih,Lh){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=Ph,this._loop=Fh,Fh&&Lh){logError(`Can' use additive animation on looped animation.`);return}this._additiveAnimators=Lh,this._allowDiscrete=Ih}return Ph.prototype.getMaxTime=function(){return this._maxTime},Ph.prototype.getDelay=function(){return this._delay},Ph.prototype.getLoop=function(){return this._loop},Ph.prototype.getTarget=function(){return this._target},Ph.prototype.changeTarget=function(Ph){this._target=Ph},Ph.prototype.when=function(Ph,Fh,Ih){return this.whenWithKeys(Ph,Fh,keys(Fh),Ih)},Ph.prototype.whenWithKeys=function(Ph,Fh,Ih,Lh){for(var Rh=this._tracks,zh=0;zh<Ih.length;zh++){var Bh=Ih[zh],Vh=Rh[Bh];if(!Vh){Vh=Rh[Bh]=new Track(Bh);var Hh=void 0,Uh=this._getAdditiveTrack(Bh);if(Uh){var Wh=Uh.keyframes,Gh=Wh[Wh.length-1];Hh=Gh&&Gh.value,Uh.valType===VALUE_TYPE_COLOR&&Hh&&(Hh=rgba2String(Hh))}else Hh=this._target[Bh];if(Hh==null)continue;Ph>0&&Vh.addKeyframe(0,cloneValue(Hh),Lh),this._trackKeys.push(Bh)}Vh.addKeyframe(Ph,cloneValue(Fh[Bh]),Lh)}return this._maxTime=Math.max(this._maxTime,Ph),this},Ph.prototype.pause=function(){this._clip.pause(),this._paused=!0},Ph.prototype.resume=function(){this._clip.resume(),this._paused=!1},Ph.prototype.isPaused=function(){return!!this._paused},Ph.prototype.duration=function(Ph){return this._maxTime=Ph,this._force=!0,this},Ph.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var Ph=this._doneCbs;if(Ph)for(var Fh=Ph.length,Ih=0;Ih<Fh;Ih++)Ph[Ih].call(this)},Ph.prototype._abortedCallback=function(){this._setTracksFinished();var Ph=this.animation,Fh=this._abortedCbs;if(Ph&&Ph.removeClip(this._clip),this._clip=null,Fh)for(var Ih=0;Ih<Fh.length;Ih++)Fh[Ih].call(this)},Ph.prototype._setTracksFinished=function(){for(var Ph=this._tracks,Fh=this._trackKeys,Ih=0;Ih<Fh.length;Ih++)Ph[Fh[Ih]].setFinished()},Ph.prototype._getAdditiveTrack=function(Ph){var Fh,Ih=this._additiveAnimators;if(Ih)for(var Lh=0;Lh<Ih.length;Lh++){var Rh=Ih[Lh].getTrack(Ph);Rh&&(Fh=Rh)}return Fh},Ph.prototype.start=function(Ph){if(!(this._started>0)){this._started=1;for(var Fh=this,Ih=[],Lh=this._maxTime||0,Rh=0;Rh<this._trackKeys.length;Rh++){var zh=this._trackKeys[Rh],Bh=this._tracks[zh],Vh=this._getAdditiveTrack(zh),Hh=Bh.keyframes,Uh=Hh.length;if(Bh.prepare(Lh,Vh),Bh.needsAnimate())if(!this._allowDiscrete&&Bh.discrete){var Wh=Hh[Uh-1];Wh&&(Fh._target[Bh.propName]=Wh.rawValue),Bh.setFinished()}else Ih.push(Bh)}if(Ih.length||this._force){var Gh=new Clip({life:Lh,loop:this._loop,delay:this._delay||0,onframe:function(Ph){Fh._started=2;var Lh=Fh._additiveAnimators;if(Lh){for(var Rh=!1,zh=0;zh<Lh.length;zh++)if(Lh[zh]._clip){Rh=!0;break}Rh||(Fh._additiveAnimators=null)}for(var zh=0;zh<Ih.length;zh++)Ih[zh].step(Fh._target,Ph);var Bh=Fh._onframeCbs;if(Bh)for(var zh=0;zh<Bh.length;zh++)Bh[zh](Fh._target,Ph)},ondestroy:function(){Fh._doneCallback()}});this._clip=Gh,this.animation&&this.animation.addClip(Gh),Ph&&Gh.setEasing(Ph)}else this._doneCallback();return this}},Ph.prototype.stop=function(Ph){if(this._clip){var Fh=this._clip;Ph&&Fh.onframe(1),this._abortedCallback()}},Ph.prototype.delay=function(Ph){return this._delay=Ph,this},Ph.prototype.during=function(Ph){return Ph&&(this._onframeCbs||=[],this._onframeCbs.push(Ph)),this},Ph.prototype.done=function(Ph){return Ph&&(this._doneCbs||=[],this._doneCbs.push(Ph)),this},Ph.prototype.aborted=function(Ph){return Ph&&(this._abortedCbs||=[],this._abortedCbs.push(Ph)),this},Ph.prototype.getClip=function(){return this._clip},Ph.prototype.getTrack=function(Ph){return this._tracks[Ph]},Ph.prototype.getTracks=function(){var Ph=this;return map$1(this._trackKeys,function(Fh){return Ph._tracks[Fh]})},Ph.prototype.stopTracks=function(Ph,Fh){if(!Ph.length||!this._clip)return!0;for(var Ih=this._tracks,Lh=this._trackKeys,Rh=0;Rh<Ph.length;Rh++){var zh=Ih[Ph[Rh]];zh&&!zh.isFinished()&&(Fh?zh.step(this._target,1):this._started===1&&zh.step(this._target,0),zh.setFinished())}for(var Bh=!0,Rh=0;Rh<Lh.length;Rh++)if(!Ih[Lh[Rh]].isFinished()){Bh=!1;break}return Bh&&this._abortedCallback(),Bh},Ph.prototype.saveTo=function(Ph,Fh,Ih){if(Ph){Fh||=this._trackKeys;for(var Lh=0;Lh<Fh.length;Lh++){var Rh=Fh[Lh],zh=this._tracks[Rh];if(!(!zh||zh.isFinished())){var Bh=zh.keyframes,Vh=Bh[Ih?0:Bh.length-1];Vh&&(Ph[Rh]=cloneValue(Vh.rawValue))}}}},Ph.prototype.__changeFinalValue=function(Ph,Fh){Fh||=keys(Ph);for(var Ih=0;Ih<Fh.length;Ih++){var Lh=Fh[Ih],Rh=this._tracks[Lh];if(Rh){var zh=Rh.keyframes;if(zh.length>1){var Bh=zh.pop();Rh.addKeyframe(Bh.time,Ph[Lh]),Rh.prepare(this._maxTime,Rh.getAdditiveTrack())}}}},Ph}();function getTime(){return new Date().getTime()}var Animation=function(Ph){__extends(Fh,Ph);function Fh(Fh){var Ih=Ph.call(this)||this;return Ih._running=!1,Ih._time=0,Ih._pausedTime=0,Ih._pauseStart=0,Ih._paused=!1,Fh||={},Ih.stage=Fh.stage||{},Ih}return Fh.prototype.addClip=function(Ph){Ph.animation&&this.removeClip(Ph),this._head?(this._tail.next=Ph,Ph.prev=this._tail,Ph.next=null,this._tail=Ph):this._head=this._tail=Ph,Ph.animation=this},Fh.prototype.addAnimator=function(Ph){Ph.animation=this;var Fh=Ph.getClip();Fh&&this.addClip(Fh)},Fh.prototype.removeClip=function(Ph){if(Ph.animation){var Fh=Ph.prev,Ih=Ph.next;Fh?Fh.next=Ih:this._head=Ih,Ih?Ih.prev=Fh:this._tail=Fh,Ph.next=Ph.prev=Ph.animation=null}},Fh.prototype.removeAnimator=function(Ph){var Fh=Ph.getClip();Fh&&this.removeClip(Fh),Ph.animation=null},Fh.prototype.update=function(Ph){for(var Fh=getTime()-this._pausedTime,Ih=Fh-this._time,Lh=this._head;Lh;){var Rh=Lh.next;Lh.step(Fh,Ih)?(Lh.ondestroy(),this.removeClip(Lh),Lh=Rh):Lh=Rh}this._time=Fh,Ph||(this.trigger(`frame`,Ih),this.stage.update&&this.stage.update())},Fh.prototype._startLoop=function(){var Ph=this;this._running=!0;function Fh(){Ph._running&&(requestAnimationFrame$1(Fh),!Ph._paused&&Ph.update())}requestAnimationFrame$1(Fh)},Fh.prototype.start=function(){this._running||(this._time=getTime(),this._pausedTime=0,this._startLoop())},Fh.prototype.stop=function(){this._running=!1},Fh.prototype.pause=function(){this._paused||=(this._pauseStart=getTime(),!0)},Fh.prototype.resume=function(){this._paused&&=(this._pausedTime+=getTime()-this._pauseStart,!1)},Fh.prototype.clear=function(){for(var Ph=this._head;Ph;){var Fh=Ph.next;Ph.prev=Ph.next=Ph.animation=null,Ph=Fh}this._head=this._tail=null},Fh.prototype.isFinished=function(){return this._head==null},Fh.prototype.animate=function(Ph,Fh){Fh||={},this.start();var Ih=new Animator(Ph,Fh.loop);return this.addAnimator(Ih),Ih},Fh}(Eventful),TOUCH_CLICK_DELAY=300,globalEventSupported=env.domSupported,localNativeListenerNames=(function(){var Ph=[`click`,`dblclick`,`mousewheel`,`wheel`,`mouseout`,`mouseup`,`mousedown`,`mousemove`,`contextmenu`],Fh=[`touchstart`,`touchend`,`touchmove`],Ih={pointerdown:1,pointerup:1,pointermove:1,pointerout:1};return{mouse:Ph,touch:Fh,pointer:map$1(Ph,function(Ph){var Fh=Ph.replace(`mouse`,`pointer`);return Ih.hasOwnProperty(Fh)?Fh:Ph})}})(),globalNativeListenerNames={mouse:[`mousemove`,`mouseup`],pointer:[`pointermove`,`pointerup`]},wheelEventSupported=!1;function isPointerFromTouch(Ph){var Fh=Ph.pointerType;return Fh===`pen`||Fh===`touch`}function setTouchTimer(Ph){Ph.touching=!0,Ph.touchTimer!=null&&(clearTimeout(Ph.touchTimer),Ph.touchTimer=null),Ph.touchTimer=setTimeout(function(){Ph.touching=!1,Ph.touchTimer=null},700)}function markTouch(Ph){Ph&&(Ph.zrByTouch=!0)}function normalizeGlobalEvent(Ph,Fh){return normalizeEvent(Ph.dom,new FakeGlobalEvent(Ph,Fh),!0)}function isLocalEl(Ph,Fh){for(var Ih=Fh,Lh=!1;Ih&&Ih.nodeType!==9&&!(Lh=Ih.domBelongToZr||Ih!==Fh&&Ih===Ph.painterRoot);)Ih=Ih.parentNode;return Lh}var FakeGlobalEvent=function(){function Ph(Ph,Fh){this.stopPropagation=noop,this.stopImmediatePropagation=noop,this.preventDefault=noop,this.type=Fh.type,this.target=this.currentTarget=Ph.dom,this.pointerType=Fh.pointerType,this.clientX=Fh.clientX,this.clientY=Fh.clientY}return Ph}(),localDOMHandlers={mousedown:function(Ph){Ph=normalizeEvent(this.dom,Ph),this.__mayPointerCapture=[Ph.zrX,Ph.zrY],this.trigger(`mousedown`,Ph)},mousemove:function(Ph){Ph=normalizeEvent(this.dom,Ph);var Fh=this.__mayPointerCapture;Fh&&(Ph.zrX!==Fh[0]||Ph.zrY!==Fh[1])&&this.__togglePointerCapture(!0),this.trigger(`mousemove`,Ph)},mouseup:function(Ph){Ph=normalizeEvent(this.dom,Ph),this.__togglePointerCapture(!1),this.trigger(`mouseup`,Ph)},mouseout:function(Ph){Ph=normalizeEvent(this.dom,Ph);var Fh=Ph.toElement||Ph.relatedTarget;isLocalEl(this,Fh)||(this.__pointerCapturing&&(Ph.zrEventControl=`no_globalout`),this.trigger(`mouseout`,Ph))},wheel:function(Ph){wheelEventSupported=!0,Ph=normalizeEvent(this.dom,Ph),this.trigger(`mousewheel`,Ph)},mousewheel:function(Ph){wheelEventSupported||(Ph=normalizeEvent(this.dom,Ph),this.trigger(`mousewheel`,Ph))},touchstart:function(Ph){Ph=normalizeEvent(this.dom,Ph),markTouch(Ph),this.__lastTouchMoment=new Date,this.handler.processGesture(Ph,`start`),localDOMHandlers.mousemove.call(this,Ph),localDOMHandlers.mousedown.call(this,Ph)},touchmove:function(Ph){Ph=normalizeEvent(this.dom,Ph),markTouch(Ph),this.handler.processGesture(Ph,`change`),localDOMHandlers.mousemove.call(this,Ph)},touchend:function(Ph){Ph=normalizeEvent(this.dom,Ph),markTouch(Ph),this.handler.processGesture(Ph,`end`),localDOMHandlers.mouseup.call(this,Ph),new Date-+this.__lastTouchMoment<TOUCH_CLICK_DELAY&&localDOMHandlers.click.call(this,Ph)},pointerdown:function(Ph){localDOMHandlers.mousedown.call(this,Ph)},pointermove:function(Ph){isPointerFromTouch(Ph)||localDOMHandlers.mousemove.call(this,Ph)},pointerup:function(Ph){localDOMHandlers.mouseup.call(this,Ph)},pointerout:function(Ph){isPointerFromTouch(Ph)||localDOMHandlers.mouseout.call(this,Ph)}};each$15([`click`,`dblclick`,`contextmenu`],function(Ph){localDOMHandlers[Ph]=function(Fh){Fh=normalizeEvent(this.dom,Fh),this.trigger(Ph,Fh)}});var globalDOMHandlers={pointermove:function(Ph){isPointerFromTouch(Ph)||globalDOMHandlers.mousemove.call(this,Ph)},pointerup:function(Ph){globalDOMHandlers.mouseup.call(this,Ph)},mousemove:function(Ph){this.trigger(`mousemove`,Ph)},mouseup:function(Ph){var Fh=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger(`mouseup`,Ph),Fh&&(Ph.zrEventControl=`only_globalout`,this.trigger(`mouseout`,Ph))}};function mountLocalDOMEventListeners(Ph,Fh){var Ih=Fh.domHandlers;env.pointerEventsSupported?each$15(localNativeListenerNames.pointer,function(Lh){mountSingleDOMEventListener(Fh,Lh,function(Fh){Ih[Lh].call(Ph,Fh)})}):(env.touchEventsSupported&&each$15(localNativeListenerNames.touch,function(Lh){mountSingleDOMEventListener(Fh,Lh,function(Rh){Ih[Lh].call(Ph,Rh),setTouchTimer(Fh)})}),each$15(localNativeListenerNames.mouse,function(Lh){mountSingleDOMEventListener(Fh,Lh,function(Rh){Rh=getNativeEvent(Rh),Fh.touching||Ih[Lh].call(Ph,Rh)})}))}function mountGlobalDOMEventListeners(Ph,Fh){env.pointerEventsSupported?each$15(globalNativeListenerNames.pointer,Ih):env.touchEventsSupported||each$15(globalNativeListenerNames.mouse,Ih);function Ih(Ih){function Lh(Lh){Lh=getNativeEvent(Lh),isLocalEl(Ph,Lh.target)||(Lh=normalizeGlobalEvent(Ph,Lh),Fh.domHandlers[Ih].call(Ph,Lh))}mountSingleDOMEventListener(Fh,Ih,Lh,{capture:!0})}}function mountSingleDOMEventListener(Ph,Fh,Ih,Lh){Ph.mounted[Fh]=Ih,Ph.listenerOpts[Fh]=Lh,addEventListener$1(Ph.domTarget,Fh,Ih,Lh)}function unmountDOMEventListeners(Ph){var Fh=Ph.mounted;for(var Ih in Fh)Fh.hasOwnProperty(Ih)&&removeEventListener$1(Ph.domTarget,Ih,Fh[Ih],Ph.listenerOpts[Ih]);Ph.mounted={}}var DOMHandlerScope=function(){function Ph(Ph,Fh){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=Ph,this.domHandlers=Fh}return Ph}(),HandlerDomProxy=function(Ph){__extends(Fh,Ph);function Fh(Fh,Ih){var Lh=Ph.call(this)||this;return Lh.__pointerCapturing=!1,Lh.dom=Fh,Lh.painterRoot=Ih,Lh._localHandlerScope=new DOMHandlerScope(Fh,localDOMHandlers),globalEventSupported&&(Lh._globalHandlerScope=new DOMHandlerScope(document,globalDOMHandlers)),mountLocalDOMEventListeners(Lh,Lh._localHandlerScope),Lh}return Fh.prototype.dispose=function(){unmountDOMEventListeners(this._localHandlerScope),globalEventSupported&&unmountDOMEventListeners(this._globalHandlerScope)},Fh.prototype.setCursor=function(Ph){this.dom.style&&(this.dom.style.cursor=Ph||`default`)},Fh.prototype.__togglePointerCapture=function(Ph){if(this.__mayPointerCapture=null,globalEventSupported&&this.__pointerCapturing^+Ph){this.__pointerCapturing=Ph;var Fh=this._globalHandlerScope;Ph?mountGlobalDOMEventListeners(this,Fh):unmountDOMEventListeners(Fh)}},Fh}(Eventful),dpr=1;env.hasGlobalWindow&&(dpr=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var devicePixelRatio=dpr,DARK_MODE_THRESHOLD=.4,DARK_LABEL_COLOR=`#333`,LIGHT_LABEL_COLOR=`#ccc`,LIGHTER_LABEL_COLOR=`#eee`,mIdentity=identity,EPSILON$2=5e-5;function isNotAroundZero(Ph){return Ph>EPSILON$2||Ph<-EPSILON$2}var scaleTmp=[],tmpTransform=[],originTransform=create$1(),abs=Math.abs,Transformable=function(){function Ph(){}return Ph.prototype.getLocalTransform=function(Fh){return Ph.getLocalTransform(this,Fh)},Ph.prototype.setPosition=function(Ph){this.x=Ph[0],this.y=Ph[1]},Ph.prototype.setScale=function(Ph){this.scaleX=Ph[0],this.scaleY=Ph[1]},Ph.prototype.setSkew=function(Ph){this.skewX=Ph[0],this.skewY=Ph[1]},Ph.prototype.setOrigin=function(Ph){this.originX=Ph[0],this.originY=Ph[1]},Ph.prototype.needLocalTransform=function(){return isNotAroundZero(this.rotation)||isNotAroundZero(this.x)||isNotAroundZero(this.y)||isNotAroundZero(this.scaleX-1)||isNotAroundZero(this.scaleY-1)||isNotAroundZero(this.skewX)||isNotAroundZero(this.skewY)},Ph.prototype.updateTransform=function(){var Ph=this.parent&&this.parent.transform,Fh=this.needLocalTransform(),Ih=this.transform;if(!(Fh||Ph)){Ih&&(mIdentity(Ih),this.invTransform=null);return}Ih||=create$1(),Fh?this.getLocalTransform(Ih):mIdentity(Ih),Ph&&(Fh?mul(Ih,Ph,Ih):copy(Ih,Ph)),this.transform=Ih,this._resolveGlobalScaleRatio(Ih)},Ph.prototype._resolveGlobalScaleRatio=function(Ph){var Fh=this.globalScaleRatio;if(Fh!=null&&Fh!==1){this.getGlobalScale(scaleTmp);var Ih=scaleTmp[0]<0?-1:1,Lh=scaleTmp[1]<0?-1:1,Rh=((scaleTmp[0]-Ih)*Fh+Ih)/scaleTmp[0]||0,zh=((scaleTmp[1]-Lh)*Fh+Lh)/scaleTmp[1]||0;Ph[0]*=Rh,Ph[1]*=Rh,Ph[2]*=zh,Ph[3]*=zh}this.invTransform=this.invTransform||create$1(),invert(this.invTransform,Ph)},Ph.prototype.getComputedTransform=function(){for(var Ph=this,Fh=[];Ph;)Fh.push(Ph),Ph=Ph.parent;for(;Ph=Fh.pop();)Ph.updateTransform();return this.transform},Ph.prototype.setLocalTransform=function(Ph){if(Ph){var Fh=Ph[0]*Ph[0]+Ph[1]*Ph[1],Ih=Ph[2]*Ph[2]+Ph[3]*Ph[3],Lh=Math.atan2(Ph[1],Ph[0]),Rh=Math.PI/2+Lh-Math.atan2(Ph[3],Ph[2]);Ih=Math.sqrt(Ih)*Math.cos(Rh),Fh=Math.sqrt(Fh),this.skewX=Rh,this.skewY=0,this.rotation=-Lh,this.x=+Ph[4],this.y=+Ph[5],this.scaleX=Fh,this.scaleY=Ih,this.originX=0,this.originY=0}},Ph.prototype.decomposeTransform=function(){if(this.transform){var Ph=this.parent,Fh=this.transform;Ph&&Ph.transform&&(Ph.invTransform=Ph.invTransform||create$1(),mul(tmpTransform,Ph.invTransform,Fh),Fh=tmpTransform);var Ih=this.originX,Lh=this.originY;(Ih||Lh)&&(originTransform[4]=Ih,originTransform[5]=Lh,mul(tmpTransform,Fh,originTransform),tmpTransform[4]-=Ih,tmpTransform[5]-=Lh,Fh=tmpTransform),this.setLocalTransform(Fh)}},Ph.prototype.getGlobalScale=function(Ph){var Fh=this.transform;return Ph||=[],Fh?(Ph[0]=Math.sqrt(Fh[0]*Fh[0]+Fh[1]*Fh[1]),Ph[1]=Math.sqrt(Fh[2]*Fh[2]+Fh[3]*Fh[3]),Fh[0]<0&&(Ph[0]=-Ph[0]),Fh[3]<0&&(Ph[1]=-Ph[1]),Ph):(Ph[0]=1,Ph[1]=1,Ph)},Ph.prototype.transformCoordToLocal=function(Ph,Fh){var Ih=[Ph,Fh],Lh=this.invTransform;return Lh&&applyTransform$1(Ih,Ih,Lh),Ih},Ph.prototype.transformCoordToGlobal=function(Ph,Fh){var Ih=[Ph,Fh],Lh=this.transform;return Lh&&applyTransform$1(Ih,Ih,Lh),Ih},Ph.prototype.getLineScale=function(){var Ph=this.transform;return Ph&&abs(Ph[0]-1)>1e-10&&abs(Ph[3]-1)>1e-10?Math.sqrt(abs(Ph[0]*Ph[3]-Ph[2]*Ph[1])):1},Ph.prototype.copyTransform=function(Ph){copyTransform(this,Ph)},Ph.getLocalTransform=function(Ph,Fh){Fh||=[];var Ih=Ph.originX||0,Lh=Ph.originY||0,Rh=Ph.scaleX,zh=Ph.scaleY,Bh=Ph.anchorX,Vh=Ph.anchorY,Hh=Ph.rotation||0,Uh=Ph.x,Wh=Ph.y,Gh=Ph.skewX?Math.tan(Ph.skewX):0,Kh=Ph.skewY?Math.tan(-Ph.skewY):0;if(Ih||Lh||Bh||Vh){var qh=Ih+Bh,Jh=Lh+Vh;Fh[4]=-qh*Rh-Gh*Jh*zh,Fh[5]=-Jh*zh-Kh*qh*Rh}else Fh[4]=Fh[5]=0;return Fh[0]=Rh,Fh[3]=zh,Fh[1]=Kh*Rh,Fh[2]=Gh*zh,Hh&&rotate(Fh,Fh,Hh),Fh[4]+=Ih+Uh,Fh[5]+=Lh+Wh,Fh},Ph.initDefaultProps=(function(){var Fh=Ph.prototype;Fh.scaleX=Fh.scaleY=Fh.globalScaleRatio=1,Fh.x=Fh.y=Fh.originX=Fh.originY=Fh.skewX=Fh.skewY=Fh.rotation=Fh.anchorX=Fh.anchorY=0})(),Ph}(),TRANSFORMABLE_PROPS=[`x`,`y`,`originX`,`originY`,`anchorX`,`anchorY`,`rotation`,`scaleX`,`scaleY`,`skewX`,`skewY`];function copyTransform(Ph,Fh){for(var Ih=0;Ih<TRANSFORMABLE_PROPS.length;Ih++){var Lh=TRANSFORMABLE_PROPS[Ih];Ph[Lh]=Fh[Lh]}}function ensureFontMeasureInfo(Ph){_fontMeasureInfoCache||=new LRU(100),Ph||=`12px sans-serif`;var Fh=_fontMeasureInfoCache.get(Ph);return Fh||(Fh={font:Ph,strWidthCache:new LRU(500),asciiWidthMap:null,asciiWidthMapTried:!1,stWideCharWidth:platformApi.measureText(`国`,Ph).width,asciiCharWidth:platformApi.measureText(`a`,Ph).width},_fontMeasureInfoCache.put(Ph,Fh)),Fh}var _fontMeasureInfoCache;function tryCreateASCIIWidthMap(Ph){if(!(_getASCIIWidthMapLongCount>=GET_ASCII_WIDTH_LONG_COUNT_MAX)){Ph||=`12px sans-serif`;for(var Fh=[],Ih=+new Date,Lh=0;Lh<=127;Lh++)Fh[Lh]=platformApi.measureText(String.fromCharCode(Lh),Ph).width;var Rh=+new Date-Ih;return Rh>16?_getASCIIWidthMapLongCount=GET_ASCII_WIDTH_LONG_COUNT_MAX:Rh>2&&_getASCIIWidthMapLongCount++,Fh}}var _getASCIIWidthMapLongCount=0,GET_ASCII_WIDTH_LONG_COUNT_MAX=5;function measureCharWidth(Ph,Fh){return Ph.asciiWidthMapTried||=(Ph.asciiWidthMap=tryCreateASCIIWidthMap(Ph.font),!0),0<=Fh&&Fh<=127?Ph.asciiWidthMap==null?Ph.asciiCharWidth:Ph.asciiWidthMap[Fh]:Ph.stWideCharWidth}function measureWidth(Ph,Fh){var Ih=Ph.strWidthCache,Lh=Ih.get(Fh);return Lh??(Lh=platformApi.measureText(Fh,Ph.font).width,Ih.put(Fh,Lh)),Lh}function innerGetBoundingRect(Ph,Fh,Ih,Lh){var Rh=measureWidth(ensureFontMeasureInfo(Fh),Ph),zh=getLineHeight(Fh);return new BoundingRect(adjustTextX(0,Rh,Ih),adjustTextY(0,zh,Lh),Rh,zh)}function getBoundingRect(Ph,Fh,Ih,Lh){var Rh=((Ph||``)+``).split(`
|
|
4839
4839
|
`);if(Rh.length===1)return innerGetBoundingRect(Rh[0],Fh,Ih,Lh);for(var zh=new BoundingRect(0,0,0,0),Bh=0;Bh<Rh.length;Bh++){var Vh=innerGetBoundingRect(Rh[Bh],Fh,Ih,Lh);Bh===0?zh.copy(Vh):zh.union(Vh)}return zh}function adjustTextX(Ph,Fh,Ih,Lh){return Ih===`right`?Lh?Ph+=Fh:Ph-=Fh:Ih===`center`&&(Lh?Ph+=Fh/2:Ph-=Fh/2),Ph}function adjustTextY(Ph,Fh,Ih,Lh){return Ih===`middle`?Lh?Ph+=Fh/2:Ph-=Fh/2:Ih===`bottom`&&(Lh?Ph+=Fh:Ph-=Fh),Ph}function getLineHeight(Ph){return ensureFontMeasureInfo(Ph).stWideCharWidth}function parsePercent$1(Ph,Fh){return typeof Ph==`string`?Ph.lastIndexOf(`%`)>=0?parseFloat(Ph)/100*Fh:parseFloat(Ph):Ph}function calculateTextPosition(Ph,Fh,Ih){var Lh=Fh.position||`inside`,Rh=Fh.distance==null?5:Fh.distance,zh=Ih.height,Bh=Ih.width,Vh=zh/2,Hh=Ih.x,Uh=Ih.y,Wh=`left`,Gh=`top`;if(Lh instanceof Array)Hh+=parsePercent$1(Lh[0],Ih.width),Uh+=parsePercent$1(Lh[1],Ih.height),Wh=null,Gh=null;else switch(Lh){case`left`:Hh-=Rh,Uh+=Vh,Wh=`right`,Gh=`middle`;break;case`right`:Hh+=Rh+Bh,Uh+=Vh,Gh=`middle`;break;case`top`:Hh+=Bh/2,Uh-=Rh,Wh=`center`,Gh=`bottom`;break;case`bottom`:Hh+=Bh/2,Uh+=zh+Rh,Wh=`center`;break;case`inside`:Hh+=Bh/2,Uh+=Vh,Wh=`center`,Gh=`middle`;break;case`insideLeft`:Hh+=Rh,Uh+=Vh,Gh=`middle`;break;case`insideRight`:Hh+=Bh-Rh,Uh+=Vh,Wh=`right`,Gh=`middle`;break;case`insideTop`:Hh+=Bh/2,Uh+=Rh,Wh=`center`;break;case`insideBottom`:Hh+=Bh/2,Uh+=zh-Rh,Wh=`center`,Gh=`bottom`;break;case`insideTopLeft`:Hh+=Rh,Uh+=Rh;break;case`insideTopRight`:Hh+=Bh-Rh,Uh+=Rh,Wh=`right`;break;case`insideBottomLeft`:Hh+=Rh,Uh+=zh-Rh,Gh=`bottom`;break;case`insideBottomRight`:Hh+=Bh-Rh,Uh+=zh-Rh,Wh=`right`,Gh=`bottom`;break}return Ph||={},Ph.x=Hh,Ph.y=Uh,Ph.align=Wh,Ph.verticalAlign=Gh,Ph}var PRESERVED_NORMAL_STATE=`__zr_normal__`,PRIMARY_STATES_KEYS$1=TRANSFORMABLE_PROPS.concat([`ignore`]),DEFAULT_ANIMATABLE_MAP=reduce(TRANSFORMABLE_PROPS,function(Ph,Fh){return Ph[Fh]=!0,Ph},{ignore:!1}),tmpTextPosCalcRes={},tmpBoundingRect=new BoundingRect(0,0,0,0),tmpInnerTextTrans=[],Element$1=function(){function Ph(Ph){this.id=guid(),this.animators=[],this.currentStates=[],this.states={},this._init(Ph)}return Ph.prototype._init=function(Ph){this.attr(Ph)},Ph.prototype.drift=function(Ph,Fh,Ih){switch(this.draggable){case`horizontal`:Fh=0;break;case`vertical`:Ph=0;break}var Lh=this.transform;Lh||=this.transform=[1,0,0,1,0,0],Lh[4]+=Ph,Lh[5]+=Fh,this.decomposeTransform(),this.markRedraw()},Ph.prototype.beforeUpdate=function(){},Ph.prototype.afterUpdate=function(){},Ph.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},Ph.prototype.updateInnerText=function(Ph){var Fh=this._textContent;if(Fh&&(!Fh.ignore||Ph)){this.textConfig||={};var Ih=this.textConfig,Lh=Ih.local,Rh=Fh.innerTransformable,zh=void 0,Bh=void 0,Vh=!1;Rh.parent=Lh?this:null;var Hh=!1;Rh.copyTransform(Fh);var Uh=Ih.position!=null,Wh=Ih.autoOverflowArea,Gh=void 0;if((Wh||Uh)&&(Gh=tmpBoundingRect,Ih.layoutRect?Gh.copy(Ih.layoutRect):Gh.copy(this.getBoundingRect()),Lh||Gh.applyTransform(this.transform)),Uh){this.calculateTextPosition?this.calculateTextPosition(tmpTextPosCalcRes,Ih,Gh):calculateTextPosition(tmpTextPosCalcRes,Ih,Gh),Rh.x=tmpTextPosCalcRes.x,Rh.y=tmpTextPosCalcRes.y,zh=tmpTextPosCalcRes.align,Bh=tmpTextPosCalcRes.verticalAlign;var Kh=Ih.origin;if(Kh&&Ih.rotation!=null){var qh=void 0,Jh=void 0;Kh===`center`?(qh=Gh.width*.5,Jh=Gh.height*.5):(qh=parsePercent$1(Kh[0],Gh.width),Jh=parsePercent$1(Kh[1],Gh.height)),Hh=!0,Rh.originX=-Rh.x+qh+(Lh?0:Gh.x),Rh.originY=-Rh.y+Jh+(Lh?0:Gh.y)}}Ih.rotation!=null&&(Rh.rotation=Ih.rotation);var Yh=Ih.offset;Yh&&(Rh.x+=Yh[0],Rh.y+=Yh[1],Hh||(Rh.originX=-Yh[0],Rh.originY=-Yh[1]));var Xh=this._innerTextDefaultStyle||={};if(Wh){var Zh=Xh.overflowRect=Xh.overflowRect||new BoundingRect(0,0,0,0);Rh.getLocalTransform(tmpInnerTextTrans),invert(tmpInnerTextTrans,tmpInnerTextTrans),BoundingRect.copy(Zh,Gh),Zh.applyTransform(tmpInnerTextTrans)}else Xh.overflowRect=null;var Qh=Ih.inside==null?typeof Ih.position==`string`&&Ih.position.indexOf(`inside`)>=0:Ih.inside,$h=void 0,eg=void 0,tg=void 0;Qh&&this.canBeInsideText()?($h=Ih.insideFill,eg=Ih.insideStroke,($h==null||$h===`auto`)&&($h=this.getInsideTextFill()),(eg==null||eg===`auto`)&&(eg=this.getInsideTextStroke($h),tg=!0)):($h=Ih.outsideFill,eg=Ih.outsideStroke,($h==null||$h===`auto`)&&($h=this.getOutsideFill()),(eg==null||eg===`auto`)&&(eg=this.getOutsideStroke($h),tg=!0)),$h||=`#000`,($h!==Xh.fill||eg!==Xh.stroke||tg!==Xh.autoStroke||zh!==Xh.align||Bh!==Xh.verticalAlign)&&(Vh=!0,Xh.fill=$h,Xh.stroke=eg,Xh.autoStroke=tg,Xh.align=zh,Xh.verticalAlign=Bh,Fh.setDefaultTextStyle(Xh)),Fh.__dirty|=1,Vh&&Fh.dirtyStyle(!0)}},Ph.prototype.canBeInsideText=function(){return!0},Ph.prototype.getInsideTextFill=function(){return`#fff`},Ph.prototype.getInsideTextStroke=function(Ph){return`#000`},Ph.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?LIGHT_LABEL_COLOR:DARK_LABEL_COLOR},Ph.prototype.getOutsideStroke=function(Ph){var Fh=this.__zr&&this.__zr.getBackgroundColor(),Ih=typeof Fh==`string`&&parse$2(Fh);Ih||=[255,255,255,1];for(var Lh=Ih[3],Rh=this.__zr.isDarkMode(),zh=0;zh<3;zh++)Ih[zh]=Ih[zh]*Lh+(Rh?0:255)*(1-Lh);return Ih[3]=1,stringify(Ih,`rgba`)},Ph.prototype.traverse=function(Ph,Fh){},Ph.prototype.attrKV=function(Ph,Fh){Ph===`textConfig`?this.setTextConfig(Fh):Ph===`textContent`?this.setTextContent(Fh):Ph===`clipPath`?this.setClipPath(Fh):Ph===`extra`?(this.extra=this.extra||{},extend$1(this.extra,Fh)):this[Ph]=Fh},Ph.prototype.hide=function(){this.ignore=!0,this.markRedraw()},Ph.prototype.show=function(){this.ignore=!1,this.markRedraw()},Ph.prototype.attr=function(Ph,Fh){if(typeof Ph==`string`)this.attrKV(Ph,Fh);else if(isObject$4(Ph))for(var Ih=keys(Ph),Lh=0;Lh<Ih.length;Lh++){var Rh=Ih[Lh];this.attrKV(Rh,Ph[Rh])}return this.markRedraw(),this},Ph.prototype.saveCurrentToNormalState=function(Ph){this._innerSaveToNormal(Ph);for(var Fh=this._normalState,Ih=0;Ih<this.animators.length;Ih++){var Lh=this.animators[Ih],Rh=Lh.__fromStateTransition;if(!(Lh.getLoop()||Rh&&Rh!==`__zr_normal__`)){var zh=Lh.targetName,Bh=zh?Fh[zh]:Fh;Lh.saveTo(Bh)}}},Ph.prototype._innerSaveToNormal=function(Ph){var Fh=this._normalState;Fh||=this._normalState={},Ph.textConfig&&!Fh.textConfig&&(Fh.textConfig=this.textConfig),this._savePrimaryToNormal(Ph,Fh,PRIMARY_STATES_KEYS$1)},Ph.prototype._savePrimaryToNormal=function(Ph,Fh,Ih){for(var Lh=0;Lh<Ih.length;Lh++){var Rh=Ih[Lh];Ph[Rh]!=null&&!(Rh in Fh)&&(Fh[Rh]=this[Rh])}},Ph.prototype.hasState=function(){return this.currentStates.length>0},Ph.prototype.getState=function(Ph){return this.states[Ph]},Ph.prototype.ensureState=function(Ph){var Fh=this.states;return Fh[Ph]||(Fh[Ph]={}),Fh[Ph]},Ph.prototype.clearStates=function(Ph){this.useState(PRESERVED_NORMAL_STATE,!1,Ph)},Ph.prototype.useState=function(Ph,Fh,Ih,Lh){var Rh=Ph===PRESERVED_NORMAL_STATE;if(!(!this.hasState()&&Rh)){var zh=this.currentStates,Bh=this.stateTransition;if(!(indexOf(zh,Ph)>=0&&(Fh||zh.length===1))){var Vh;if(this.stateProxy&&!Rh&&(Vh=this.stateProxy(Ph)),Vh||=this.states&&this.states[Ph],!Vh&&!Rh){logError(`State `+Ph+` not exists.`);return}Rh||this.saveCurrentToNormalState(Vh);var Hh=!!(Vh&&Vh.hoverLayer||Lh);Hh&&this._toggleHoverLayerFlag(!0),this._applyStateObj(Ph,Vh,this._normalState,Fh,!Ih&&!this.__inHover&&Bh&&Bh.duration>0,Bh);var Uh=this._textContent,Wh=this._textGuide;return Uh&&Uh.useState(Ph,Fh,Ih,Hh),Wh&&Wh.useState(Ph,Fh,Ih,Hh),Rh?(this.currentStates=[],this._normalState={}):Fh?this.currentStates.push(Ph):this.currentStates=[Ph],this._updateAnimationTargets(),this.markRedraw(),!Hh&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),Vh}}},Ph.prototype.useStates=function(Ph,Fh,Ih){if(!Ph.length)this.clearStates();else{var Lh=[],Rh=this.currentStates,zh=Ph.length,Bh=zh===Rh.length;if(Bh){for(var Vh=0;Vh<zh;Vh++)if(Ph[Vh]!==Rh[Vh]){Bh=!1;break}}if(Bh)return;for(var Vh=0;Vh<zh;Vh++){var Hh=Ph[Vh],Uh=void 0;this.stateProxy&&(Uh=this.stateProxy(Hh,Ph)),Uh||=this.states[Hh],Uh&&Lh.push(Uh)}var Wh=Lh[zh-1],Gh=!!(Wh&&Wh.hoverLayer||Ih);Gh&&this._toggleHoverLayerFlag(!0);var Kh=this._mergeStates(Lh),qh=this.stateTransition;this.saveCurrentToNormalState(Kh),this._applyStateObj(Ph.join(`,`),Kh,this._normalState,!1,!Fh&&!this.__inHover&&qh&&qh.duration>0,qh);var Jh=this._textContent,Yh=this._textGuide;Jh&&Jh.useStates(Ph,Fh,Gh),Yh&&Yh.useStates(Ph,Fh,Gh),this._updateAnimationTargets(),this.currentStates=Ph.slice(),this.markRedraw(),!Gh&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}},Ph.prototype.isSilent=function(){for(var Ph=this;Ph;){if(Ph.silent)return!0;var Fh=Ph.__hostTarget;Ph=Fh?Ph.ignoreHostSilent?null:Fh:Ph.parent}return!1},Ph.prototype._updateAnimationTargets=function(){for(var Ph=0;Ph<this.animators.length;Ph++){var Fh=this.animators[Ph];Fh.targetName&&Fh.changeTarget(this[Fh.targetName])}},Ph.prototype.removeState=function(Ph){var Fh=indexOf(this.currentStates,Ph);if(Fh>=0){var Ih=this.currentStates.slice();Ih.splice(Fh,1),this.useStates(Ih)}},Ph.prototype.replaceState=function(Ph,Fh,Ih){var Lh=this.currentStates.slice(),Rh=indexOf(Lh,Ph),zh=indexOf(Lh,Fh)>=0;Rh>=0?zh?Lh.splice(Rh,1):Lh[Rh]=Fh:Ih&&!zh&&Lh.push(Fh),this.useStates(Lh)},Ph.prototype.toggleState=function(Ph,Fh){Fh?this.useState(Ph,!0):this.removeState(Ph)},Ph.prototype._mergeStates=function(Ph){for(var Fh={},Ih,Lh=0;Lh<Ph.length;Lh++){var Rh=Ph[Lh];extend$1(Fh,Rh),Rh.textConfig&&(Ih||={},extend$1(Ih,Rh.textConfig))}return Ih&&(Fh.textConfig=Ih),Fh},Ph.prototype._applyStateObj=function(Ph,Fh,Ih,Lh,Rh,zh){var Bh=!(Fh&&Lh);Fh&&Fh.textConfig?(this.textConfig=extend$1({},Lh?this.textConfig:Ih.textConfig),extend$1(this.textConfig,Fh.textConfig)):Bh&&Ih.textConfig&&(this.textConfig=Ih.textConfig);for(var Vh={},Hh=!1,Uh=0;Uh<PRIMARY_STATES_KEYS$1.length;Uh++){var Wh=PRIMARY_STATES_KEYS$1[Uh],Gh=Rh&&DEFAULT_ANIMATABLE_MAP[Wh];Fh&&Fh[Wh]!=null?Gh?(Hh=!0,Vh[Wh]=Fh[Wh]):this[Wh]=Fh[Wh]:Bh&&Ih[Wh]!=null&&(Gh?(Hh=!0,Vh[Wh]=Ih[Wh]):this[Wh]=Ih[Wh])}if(!Rh)for(var Uh=0;Uh<this.animators.length;Uh++){var Kh=this.animators[Uh],qh=Kh.targetName;Kh.getLoop()||Kh.__changeFinalValue(qh?(Fh||Ih)[qh]:Fh||Ih)}Hh&&this._transitionState(Ph,Vh,zh)},Ph.prototype._attachComponent=function(Ph){if(!(Ph.__zr&&!Ph.__hostTarget)&&Ph!==this){var Fh=this.__zr;Fh&&Ph.addSelfToZr(Fh),Ph.__zr=Fh,Ph.__hostTarget=this}},Ph.prototype._detachComponent=function(Ph){Ph.__zr&&Ph.removeSelfFromZr(Ph.__zr),Ph.__zr=null,Ph.__hostTarget=null},Ph.prototype.getClipPath=function(){return this._clipPath},Ph.prototype.setClipPath=function(Ph){this._clipPath&&this._clipPath!==Ph&&this.removeClipPath(),this._attachComponent(Ph),this._clipPath=Ph,this.markRedraw()},Ph.prototype.removeClipPath=function(){var Ph=this._clipPath;Ph&&(this._detachComponent(Ph),this._clipPath=null,this.markRedraw())},Ph.prototype.getTextContent=function(){return this._textContent},Ph.prototype.setTextContent=function(Ph){var Fh=this._textContent;Fh!==Ph&&(Fh&&Fh!==Ph&&this.removeTextContent(),Ph.innerTransformable=new Transformable,this._attachComponent(Ph),this._textContent=Ph,this.markRedraw())},Ph.prototype.setTextConfig=function(Ph){this.textConfig||={},extend$1(this.textConfig,Ph),this.markRedraw()},Ph.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},Ph.prototype.removeTextContent=function(){var Ph=this._textContent;Ph&&(Ph.innerTransformable=null,this._detachComponent(Ph),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},Ph.prototype.getTextGuideLine=function(){return this._textGuide},Ph.prototype.setTextGuideLine=function(Ph){this._textGuide&&this._textGuide!==Ph&&this.removeTextGuideLine(),this._attachComponent(Ph),this._textGuide=Ph,this.markRedraw()},Ph.prototype.removeTextGuideLine=function(){var Ph=this._textGuide;Ph&&(this._detachComponent(Ph),this._textGuide=null,this.markRedraw())},Ph.prototype.markRedraw=function(){this.__dirty|=1;var Ph=this.__zr;Ph&&(this.__inHover?Ph.refreshHover():Ph.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},Ph.prototype.dirty=function(){this.markRedraw()},Ph.prototype._toggleHoverLayerFlag=function(Ph){this.__inHover=Ph;var Fh=this._textContent,Ih=this._textGuide;Fh&&(Fh.__inHover=Ph),Ih&&(Ih.__inHover=Ph)},Ph.prototype.addSelfToZr=function(Ph){if(this.__zr!==Ph){this.__zr=Ph;var Fh=this.animators;if(Fh)for(var Ih=0;Ih<Fh.length;Ih++)Ph.animation.addAnimator(Fh[Ih]);this._clipPath&&this._clipPath.addSelfToZr(Ph),this._textContent&&this._textContent.addSelfToZr(Ph),this._textGuide&&this._textGuide.addSelfToZr(Ph)}},Ph.prototype.removeSelfFromZr=function(Ph){if(this.__zr){this.__zr=null;var Fh=this.animators;if(Fh)for(var Ih=0;Ih<Fh.length;Ih++)Ph.animation.removeAnimator(Fh[Ih]);this._clipPath&&this._clipPath.removeSelfFromZr(Ph),this._textContent&&this._textContent.removeSelfFromZr(Ph),this._textGuide&&this._textGuide.removeSelfFromZr(Ph)}},Ph.prototype.animate=function(Ph,Fh,Ih){var Lh=new Animator(Ph?this[Ph]:this,Fh,Ih);return Ph&&(Lh.targetName=Ph),this.addAnimator(Lh,Ph),Lh},Ph.prototype.addAnimator=function(Ph,Fh){var Ih=this.__zr,Lh=this;Ph.during(function(){Lh.updateDuringAnimation(Fh)}).done(function(){var Fh=Lh.animators,Ih=indexOf(Fh,Ph);Ih>=0&&Fh.splice(Ih,1)}),this.animators.push(Ph),Ih&&Ih.animation.addAnimator(Ph),Ih&&Ih.wakeUp()},Ph.prototype.updateDuringAnimation=function(Ph){this.markRedraw()},Ph.prototype.stopAnimation=function(Ph,Fh){for(var Ih=this.animators,Lh=Ih.length,Rh=[],zh=0;zh<Lh;zh++){var Bh=Ih[zh];!Ph||Ph===Bh.scope?Bh.stop(Fh):Rh.push(Bh)}return this.animators=Rh,this},Ph.prototype.animateTo=function(Ph,Fh,Ih){animateTo(this,Ph,Fh,Ih)},Ph.prototype.animateFrom=function(Ph,Fh,Ih){animateTo(this,Ph,Fh,Ih,!0)},Ph.prototype._transitionState=function(Ph,Fh,Ih,Lh){for(var Rh=animateTo(this,Fh,Ih,Lh),zh=0;zh<Rh.length;zh++)Rh[zh].__fromStateTransition=Ph},Ph.prototype.getBoundingRect=function(){return null},Ph.prototype.getPaintRect=function(){return null},Ph.initDefaultProps=(function(){var Fh=Ph.prototype;Fh.type=`element`,Fh.name=``,Fh.ignore=Fh.silent=Fh.ignoreHostSilent=Fh.isGroup=Fh.draggable=Fh.dragging=Fh.ignoreClip=Fh.__inHover=!1,Fh.__dirty=1;function Ih(Ph,Ih,Lh,Rh){Object.defineProperty(Fh,Ph,{get:function(){if(!this[Ih]){var Ph=this[Ih]=[];zh(this,Ph)}return this[Ih]},set:function(Ph){this[Lh]=Ph[0],this[Rh]=Ph[1],this[Ih]=Ph,zh(this,Ph)}});function zh(Ph,Fh){Object.defineProperty(Fh,0,{get:function(){return Ph[Lh]},set:function(Fh){Ph[Lh]=Fh}}),Object.defineProperty(Fh,1,{get:function(){return Ph[Rh]},set:function(Fh){Ph[Rh]=Fh}})}}Object.defineProperty&&(Ih(`position`,`_legacyPos`,`x`,`y`),Ih(`scale`,`_legacyScale`,`scaleX`,`scaleY`),Ih(`origin`,`_legacyOrigin`,`originX`,`originY`))})(),Ph}();mixin$1(Element$1,Eventful),mixin$1(Element$1,Transformable);function animateTo(Ph,Fh,Ih,Lh,Rh){Ih||={};var zh=[];animateToShallow(Ph,``,Ph,Fh,Ih,Lh,zh,Rh);var Bh=zh.length,Vh=!1,Hh=Ih.done,Uh=Ih.aborted,Wh=function(){Vh=!0,Bh--,Bh<=0&&(Vh?Hh&&Hh():Uh&&Uh())},Gh=function(){Bh--,Bh<=0&&(Vh?Hh&&Hh():Uh&&Uh())};Bh||Hh&&Hh(),zh.length>0&&Ih.during&&zh[0].during(function(Ph,Fh){Ih.during(Fh)});for(var Kh=0;Kh<zh.length;Kh++){var qh=zh[Kh];Wh&&qh.done(Wh),Gh&&qh.aborted(Gh),Ih.force&&qh.duration(Ih.duration),qh.start(Ih.easing)}return zh}function copyArrShallow(Ph,Fh,Ih){for(var Lh=0;Lh<Ih;Lh++)Ph[Lh]=Fh[Lh]}function is2DArray(Ph){return isArrayLike(Ph[0])}function copyValue(Ph,Fh,Ih){if(isArrayLike(Fh[Ih]))if(isArrayLike(Ph[Ih])||(Ph[Ih]=[]),isTypedArray(Fh[Ih])){var Lh=Fh[Ih].length;Ph[Ih].length!==Lh&&(Ph[Ih]=new Fh[Ih].constructor(Lh),copyArrShallow(Ph[Ih],Fh[Ih],Lh))}else{var Rh=Fh[Ih],zh=Ph[Ih],Bh=Rh.length;if(is2DArray(Rh))for(var Vh=Rh[0].length,Hh=0;Hh<Bh;Hh++)zh[Hh]?copyArrShallow(zh[Hh],Rh[Hh],Vh):zh[Hh]=Array.prototype.slice.call(Rh[Hh]);else copyArrShallow(zh,Rh,Bh);zh.length=Rh.length}else Ph[Ih]=Fh[Ih]}function isValueSame(Ph,Fh){return Ph===Fh||isArrayLike(Ph)&&isArrayLike(Fh)&&is1DArraySame(Ph,Fh)}function is1DArraySame(Ph,Fh){var Ih=Ph.length;if(Ih!==Fh.length)return!1;for(var Lh=0;Lh<Ih;Lh++)if(Ph[Lh]!==Fh[Lh])return!1;return!0}function animateToShallow(Ph,Fh,Ih,Lh,Rh,zh,Bh,Vh){for(var Hh=keys(Lh),Uh=Rh.duration,Wh=Rh.delay,Gh=Rh.additive,Kh=Rh.setToFinal,qh=!isObject$4(zh),Jh=Ph.animators,Yh=[],Xh=0;Xh<Hh.length;Xh++){var Zh=Hh[Xh],Qh=Lh[Zh];if(Qh!=null&&Ih[Zh]!=null&&(qh||zh[Zh]))if(isObject$4(Qh)&&!isArrayLike(Qh)&&!isGradientObject(Qh)){if(Fh){Vh||(Ih[Zh]=Qh,Ph.updateDuringAnimation(Fh));continue}animateToShallow(Ph,Zh,Ih[Zh],Qh,Rh,zh&&zh[Zh],Bh,Vh)}else Yh.push(Zh);else Vh||(Ih[Zh]=Qh,Ph.updateDuringAnimation(Fh),Yh.push(Zh))}var $h=Yh.length;if(!Gh&&$h)for(var eg=0;eg<Jh.length;eg++){var tg=Jh[eg];if(tg.targetName===Fh&&tg.stopTracks(Yh)){var ng=indexOf(Jh,tg);Jh.splice(ng,1)}}if(Rh.force||(Yh=filter(Yh,function(Ph){return!isValueSame(Lh[Ph],Ih[Ph])}),$h=Yh.length),$h>0||Rh.force&&!Bh.length){var rg=void 0,ig=void 0,ag=void 0;if(Vh){ig={},Kh&&(rg={});for(var eg=0;eg<$h;eg++){var Zh=Yh[eg];ig[Zh]=Ih[Zh],Kh?rg[Zh]=Lh[Zh]:Ih[Zh]=Lh[Zh]}}else if(Kh){ag={};for(var eg=0;eg<$h;eg++){var Zh=Yh[eg];ag[Zh]=cloneValue(Ih[Zh]),copyValue(Ih,Lh,Zh)}}var tg=new Animator(Ih,!1,!1,Gh?filter(Jh,function(Ph){return Ph.targetName===Fh}):null);tg.targetName=Fh,Rh.scope&&(tg.scope=Rh.scope),Kh&&rg&&tg.whenWithKeys(0,rg,Yh),ag&&tg.whenWithKeys(0,ag,Yh),tg.whenWithKeys(Uh??500,Vh?ig:Lh,Yh).delay(Wh||0),Ph.addAnimator(tg,Fh),Bh.push(tg)}}var Group$3=function(Ph){__extends(Fh,Ph);function Fh(Fh){var Ih=Ph.call(this)||this;return Ih.isGroup=!0,Ih._children=[],Ih.attr(Fh),Ih}return Fh.prototype.childrenRef=function(){return this._children},Fh.prototype.children=function(){return this._children.slice()},Fh.prototype.childAt=function(Ph){return this._children[Ph]},Fh.prototype.childOfName=function(Ph){for(var Fh=this._children,Ih=0;Ih<Fh.length;Ih++)if(Fh[Ih].name===Ph)return Fh[Ih]},Fh.prototype.childCount=function(){return this._children.length},Fh.prototype.add=function(Ph){return Ph&&Ph!==this&&Ph.parent!==this&&(this._children.push(Ph),this._doAdd(Ph)),this},Fh.prototype.addBefore=function(Ph,Fh){if(Ph&&Ph!==this&&Ph.parent!==this&&Fh&&Fh.parent===this){var Ih=this._children,Lh=Ih.indexOf(Fh);Lh>=0&&(Ih.splice(Lh,0,Ph),this._doAdd(Ph))}return this},Fh.prototype.replace=function(Ph,Fh){var Ih=indexOf(this._children,Ph);return Ih>=0&&this.replaceAt(Fh,Ih),this},Fh.prototype.replaceAt=function(Ph,Fh){var Ih=this._children,Lh=Ih[Fh];if(Ph&&Ph!==this&&Ph.parent!==this&&Ph!==Lh){Ih[Fh]=Ph,Lh.parent=null;var Rh=this.__zr;Rh&&Lh.removeSelfFromZr(Rh),this._doAdd(Ph)}return this},Fh.prototype._doAdd=function(Ph){Ph.parent&&Ph.parent.remove(Ph),Ph.parent=this;var Fh=this.__zr;Fh&&Fh!==Ph.__zr&&Ph.addSelfToZr(Fh),Fh&&Fh.refresh()},Fh.prototype.remove=function(Ph){var Fh=this.__zr,Ih=this._children,Lh=indexOf(Ih,Ph);return Lh<0?this:(Ih.splice(Lh,1),Ph.parent=null,Fh&&Ph.removeSelfFromZr(Fh),Fh&&Fh.refresh(),this)},Fh.prototype.removeAll=function(){for(var Ph=this._children,Fh=this.__zr,Ih=0;Ih<Ph.length;Ih++){var Lh=Ph[Ih];Fh&&Lh.removeSelfFromZr(Fh),Lh.parent=null}return Ph.length=0,this},Fh.prototype.eachChild=function(Ph,Fh){for(var Ih=this._children,Lh=0;Lh<Ih.length;Lh++){var Rh=Ih[Lh];Ph.call(Fh,Rh,Lh)}return this},Fh.prototype.traverse=function(Ph,Fh){for(var Ih=0;Ih<this._children.length;Ih++){var Lh=this._children[Ih],Rh=Ph.call(Fh,Lh);Lh.isGroup&&!Rh&&Lh.traverse(Ph,Fh)}return this},Fh.prototype.addSelfToZr=function(Fh){Ph.prototype.addSelfToZr.call(this,Fh);for(var Ih=0;Ih<this._children.length;Ih++)this._children[Ih].addSelfToZr(Fh)},Fh.prototype.removeSelfFromZr=function(Fh){Ph.prototype.removeSelfFromZr.call(this,Fh);for(var Ih=0;Ih<this._children.length;Ih++)this._children[Ih].removeSelfFromZr(Fh)},Fh.prototype.getBoundingRect=function(Ph){for(var Fh=new BoundingRect(0,0,0,0),Ih=Ph||this._children,Lh=[],Rh=null,zh=0;zh<Ih.length;zh++){var Bh=Ih[zh];if(!(Bh.ignore||Bh.invisible)){var Vh=Bh.getBoundingRect(),Hh=Bh.getLocalTransform(Lh);Hh?(BoundingRect.applyTransform(Fh,Vh,Hh),Rh||=Fh.clone(),Rh.union(Fh)):(Rh||=Vh.clone(),Rh.union(Vh))}}return Rh||Fh},Fh}(Element$1);Group$3.prototype.type=`group`;var painterCtors={},instances$1={};function delInstance(Ph){delete instances$1[Ph]}function isDarkMode(Ph){if(!Ph)return!1;if(typeof Ph==`string`)return lum(Ph,1)<DARK_MODE_THRESHOLD;if(Ph.colorStops){for(var Fh=Ph.colorStops,Ih=0,Lh=Fh.length,Rh=0;Rh<Lh;Rh++)Ih+=lum(Fh[Rh].color,1);return Ih/=Lh,Ih<DARK_MODE_THRESHOLD}return!1}var ZRender=function(){function Ph(Ph,Fh,Ih){var Lh=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,Ih||={},this.dom=Fh,this.id=Ph;var Rh=new Storage,zh=Ih.renderer||`canvas`;painterCtors[zh]||(zh=keys(painterCtors)[0]),Ih.useDirtyRect=Ih.useDirtyRect==null?!1:Ih.useDirtyRect;var Bh=new painterCtors[zh](Fh,Rh,Ih,Ph),Vh=Ih.ssr||Bh.ssrOnly;this.storage=Rh,this.painter=Bh;var Hh=!env.node&&!env.worker&&!Vh?new HandlerDomProxy(Bh.getViewportRoot(),Bh.root):null,Uh=Ih.useCoarsePointer,Wh=Uh==null||Uh===`auto`?env.touchEventsSupported:!!Uh,Gh=44,Kh;Wh&&(Kh=retrieve2(Ih.pointerSize,Gh)),this.handler=new Handler(Rh,Bh,Hh,Bh.root,Kh),this.animation=new Animation({stage:{update:Vh?null:function(){return Lh._flush(!0)}}}),Vh||this.animation.start()}return Ph.prototype.add=function(Ph){this._disposed||!Ph||(this.storage.addRoot(Ph),Ph.addSelfToZr(this),this.refresh())},Ph.prototype.remove=function(Ph){this._disposed||!Ph||(this.storage.delRoot(Ph),Ph.removeSelfFromZr(this),this.refresh())},Ph.prototype.configLayer=function(Ph,Fh){this._disposed||(this.painter.configLayer&&this.painter.configLayer(Ph,Fh),this.refresh())},Ph.prototype.setBackgroundColor=function(Ph){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(Ph),this.refresh(),this._backgroundColor=Ph,this._darkMode=isDarkMode(Ph))},Ph.prototype.getBackgroundColor=function(){return this._backgroundColor},Ph.prototype.setDarkMode=function(Ph){this._darkMode=Ph},Ph.prototype.isDarkMode=function(){return this._darkMode},Ph.prototype.refreshImmediately=function(Ph){this._disposed||(Ph||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},Ph.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},Ph.prototype.flush=function(){this._disposed||this._flush(!1)},Ph.prototype._flush=function(Ph){var Fh,Ih=getTime();this._needsRefresh&&(Fh=!0,this.refreshImmediately(Ph)),this._needsRefreshHover&&(Fh=!0,this.refreshHoverImmediately());var Lh=getTime();Fh?(this._stillFrameAccum=0,this.trigger(`rendered`,{elapsedTime:Lh-Ih})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},Ph.prototype.setSleepAfterStill=function(Ph){this._sleepAfterStill=Ph},Ph.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},Ph.prototype.refreshHover=function(){this._needsRefreshHover=!0},Ph.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()===`canvas`&&this.painter.refreshHover())},Ph.prototype.resize=function(Ph){this._disposed||(Ph||={},this.painter.resize(Ph.width,Ph.height),this.handler.resize())},Ph.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},Ph.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},Ph.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},Ph.prototype.setCursorStyle=function(Ph){this._disposed||this.handler.setCursorStyle(Ph)},Ph.prototype.findHover=function(Ph,Fh){if(!this._disposed)return this.handler.findHover(Ph,Fh)},Ph.prototype.on=function(Ph,Fh,Ih){return this._disposed||this.handler.on(Ph,Fh,Ih),this},Ph.prototype.off=function(Ph,Fh){this._disposed||this.handler.off(Ph,Fh)},Ph.prototype.trigger=function(Ph,Fh){this._disposed||this.handler.trigger(Ph,Fh)},Ph.prototype.clear=function(){if(!this._disposed){for(var Ph=this.storage.getRoots(),Fh=0;Fh<Ph.length;Fh++)Ph[Fh]instanceof Group$3&&Ph[Fh].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},Ph.prototype.dispose=function(){this._disposed||(this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,delInstance(this.id))},Ph}();function init$2(Ph,Fh){var Ih=new ZRender(guid(),Ph,Fh);return instances$1[Ih.id]=Ih,Ih}function registerPainter(Ph,Fh){painterCtors[Ph]=Fh}var ssrDataGetter;function getElementSSRData(Ph){if(typeof ssrDataGetter==`function`)return ssrDataGetter(Ph)}function registerSSRDataGetter(Ph){ssrDataGetter=Ph}var RADIAN_EPSILON=1e-4,ROUND_SUPPORTED_PRECISION_MAX=20;function _trim(Ph){return Ph.replace(/^\s+|\s+$/g,``)}var mathMin$10=Math.min,mathMax$10=Math.max,mathAbs$4=Math.abs;function linearMap$2(Ph,Fh,Ih,Lh){var Rh=Fh[0],zh=Fh[1],Bh=Ih[0],Vh=Ih[1],Hh=zh-Rh,Uh=Vh-Bh;if(Hh===0)return Uh===0?Bh:(Bh+Vh)/2;if(Lh){if(Hh>0){if(Ph<=Rh)return Bh;if(Ph>=zh)return Vh}else if(Ph>=Rh)return Bh;else if(Ph<=zh)return Vh}else{if(Ph===Rh)return Bh;if(Ph===zh)return Vh}return(Ph-Rh)/Hh*Uh+Bh}var parsePercent=parsePositionOption;function parsePositionOption(Ph,Fh,Ih){switch(Ph){case`center`:case`middle`:Ph=`50%`;break;case`left`:case`top`:Ph=`0%`;break;case`right`:case`bottom`:Ph=`100%`;break}return parsePositionSizeOption(Ph,Fh,Ih)}function parsePositionSizeOption(Ph,Fh,Ih){return isString(Ph)?_trim(Ph).match(/%$/)?parseFloat(Ph)/100*Fh+(Ih||0):parseFloat(Ph):Ph==null?NaN:+Ph}function round$4(Ph,Fh,Ih){return Fh??=10,Fh=Math.min(Math.max(0,Fh),ROUND_SUPPORTED_PRECISION_MAX),Ph=(+Ph).toFixed(Fh),Ih?Ph:+Ph}function asc$2(Ph){return Ph.sort(function(Ph,Fh){return Ph-Fh}),Ph}function getPrecision(Ph){if(Ph=+Ph,isNaN(Ph))return 0;if(Ph>1e-14){for(var Fh=1,Ih=0;Ih<15;Ih++,Fh*=10)if(Math.round(Ph*Fh)/Fh===Ph)return Ih}return getPrecisionSafe(Ph)}function getPrecisionSafe(Ph){var Fh=Ph.toString().toLowerCase(),Ih=Fh.indexOf(`e`),Lh=Ih>0?+Fh.slice(Ih+1):0,Rh=Ih>0?Ih:Fh.length,zh=Fh.indexOf(`.`),Bh=zh<0?0:Rh-1-zh;return Math.max(0,Bh-Lh)}function getPixelPrecision(Ph,Fh){var Ih=Math.log,Lh=Math.LN10,Rh=Math.floor(Ih(Ph[1]-Ph[0])/Lh),zh=Math.round(Ih(mathAbs$4(Fh[1]-Fh[0]))/Lh),Bh=Math.min(Math.max(-Rh+zh,0),20);return isFinite(Bh)?Bh:20}function getPercentSeats(Ph,Fh){var Ih=reduce(Ph,function(Ph,Fh){return Ph+(isNaN(Fh)?0:Fh)},0);if(Ih===0)return[];for(var Lh=10**Fh,Rh=map$1(Ph,function(Ph){return(isNaN(Ph)?0:Ph)/Ih*Lh*100}),zh=Lh*100,Bh=map$1(Rh,function(Ph){return Math.floor(Ph)}),Vh=reduce(Bh,function(Ph,Fh){return Ph+Fh},0),Hh=map$1(Rh,function(Ph,Fh){return Ph-Bh[Fh]});Vh<zh;){for(var Uh=-1/0,Wh=null,Gh=0,Kh=Hh.length;Gh<Kh;++Gh)Hh[Gh]>Uh&&(Uh=Hh[Gh],Wh=Gh);++Bh[Wh],Hh[Wh]=0,++Vh}return map$1(Bh,function(Ph){return Ph/Lh})}function addSafe(Ph,Fh){var Ih=Math.max(getPrecision(Ph),getPrecision(Fh)),Lh=Ph+Fh;return Ih>ROUND_SUPPORTED_PRECISION_MAX?Lh:round$4(Lh,Ih)}var MAX_SAFE_INTEGER=9007199254740991;function remRadian(Ph){var Fh=Math.PI*2;return(Ph%Fh+Fh)%Fh}function isRadianAroundZero(Ph){return Ph>-RADIAN_EPSILON&&Ph<RADIAN_EPSILON}var TIME_REG=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function parseDate(Ph){if(Ph instanceof Date)return Ph;if(isString(Ph)){var Fh=TIME_REG.exec(Ph);if(!Fh)return new Date(NaN);if(Fh[8]){var Ih=+Fh[4]||0;return Fh[8].toUpperCase()!==`Z`&&(Ih-=+Fh[8].slice(0,3)),new Date(Date.UTC(+Fh[1],(Fh[2]||1)-1,+Fh[3]||1,Ih,+(Fh[5]||0),+Fh[6]||0,Fh[7]?+Fh[7].substring(0,3):0))}else return new Date(+Fh[1],(Fh[2]||1)-1,+Fh[3]||1,+Fh[4]||0,+(Fh[5]||0),+Fh[6]||0,Fh[7]?+Fh[7].substring(0,3):0)}else if(Ph==null)return new Date(NaN);return new Date(Math.round(Ph))}function quantity(Ph){return 10**quantityExponent(Ph)}function quantityExponent(Ph){if(Ph===0)return 0;var Fh=Math.floor(Math.log(Ph)/Math.LN10);return Ph/10**Fh>=10&&Fh++,Fh}function nice(Ph,Fh){var Ih=quantityExponent(Ph),Lh=10**Ih,Rh=Ph/Lh;return Ph=(Fh?Rh<1.5?1:Rh<2.5?2:Rh<4?3:Rh<7?5:10:Rh<1?1:Rh<2?2:Rh<3?3:Rh<5?5:10)*Lh,Ih>=-20?+Ph.toFixed(Ih<0?-Ih:0):Ph}function quantile(Ph,Fh){var Ih=(Ph.length-1)*Fh+1,Lh=Math.floor(Ih),Rh=+Ph[Lh-1],zh=Ih-Lh;return zh?Rh+zh*(Ph[Lh]-Rh):Rh}function reformIntervals(Ph){Ph.sort(function(Ph,Fh){return Vh(Ph,Fh,0)?-1:1});for(var Fh=-1/0,Ih=1,Lh=0;Lh<Ph.length;){for(var Rh=Ph[Lh].interval,zh=Ph[Lh].close,Bh=0;Bh<2;Bh++)Rh[Bh]<=Fh&&(Rh[Bh]=Fh,zh[Bh]=Bh?1:1-Ih),Fh=Rh[Bh],Ih=zh[Bh];Rh[0]===Rh[1]&&zh[0]*zh[1]!==1?Ph.splice(Lh,1):Lh++}return Ph;function Vh(Ph,Fh,Ih){return Ph.interval[Ih]<Fh.interval[Ih]||Ph.interval[Ih]===Fh.interval[Ih]&&(Ph.close[Ih]-Fh.close[Ih]===(Ih?-1:1)||!Ih&&Vh(Ph,Fh,1))}}function numericToNumber(Ph){var Fh=parseFloat(Ph);return Fh==Ph&&(Fh!==0||!isString(Ph)||Ph.indexOf(`x`)<=0)?Fh:NaN}function isNumeric(Ph){return!isNaN(numericToNumber(Ph))}function getRandomIdBase(){return Math.round(Math.random()*9)}function getGreatestCommonDividor(Ph,Fh){return Fh===0?Ph:getGreatestCommonDividor(Fh,Ph%Fh)}function getLeastCommonMultiple(Ph,Fh){return Ph==null?Fh:Fh==null?Ph:Ph*Fh/getGreatestCommonDividor(Ph,Fh)}var ECHARTS_PREFIX=`[ECharts] `,storedLogs={},hasConsole=typeof console<`u`&&console.warn&&console.log;function outputLog(Ph,Fh,Ih){if(hasConsole){if(Ih){if(storedLogs[Fh])return;storedLogs[Fh]=!0}console[Ph](ECHARTS_PREFIX+Fh)}}function error(Ph,Fh){outputLog(`error`,Ph,Fh)}function deprecateLog(Ph){}function throwError(Ph){throw Error(Ph)}function interpolateNumber(Ph,Fh,Ih){return(Fh-Ph)*Ih+Ph}var DUMMY_COMPONENT_NAME_PREFIX=`series\0`,INTERNAL_COMPONENT_ID_PREFIX=`\0_ec_\0`;function normalizeToArray(Ph){return Ph instanceof Array?Ph:Ph==null?[]:[Ph]}function defaultEmphasis(Ph,Fh,Ih){if(Ph){Ph[Fh]=Ph[Fh]||{},Ph.emphasis=Ph.emphasis||{},Ph.emphasis[Fh]=Ph.emphasis[Fh]||{};for(var Lh=0,Rh=Ih.length;Lh<Rh;Lh++){var zh=Ih[Lh];!Ph.emphasis[Fh].hasOwnProperty(zh)&&Ph[Fh].hasOwnProperty(zh)&&(Ph.emphasis[Fh][zh]=Ph[Fh][zh])}}}var TEXT_STYLE_OPTIONS=`fontStyle.fontWeight.fontSize.fontFamily.rich.tag.color.textBorderColor.textBorderWidth.width.height.lineHeight.align.verticalAlign.baseline.shadowColor.shadowBlur.shadowOffsetX.shadowOffsetY.textShadowColor.textShadowBlur.textShadowOffsetX.textShadowOffsetY.backgroundColor.borderColor.borderWidth.borderRadius.padding`.split(`.`);function getDataItemValue(Ph){return isObject$4(Ph)&&!isArray$1(Ph)&&!(Ph instanceof Date)?Ph.value:Ph}function isDataItemOption(Ph){return isObject$4(Ph)&&!(Ph instanceof Array)}function mappingToExists(Ph,Fh,Ih){var Lh=Ih===`normalMerge`,Rh=Ih===`replaceMerge`,zh=Ih===`replaceAll`;Ph||=[],Fh=(Fh||[]).slice();var Bh=createHashMap();each$15(Fh,function(Ph,Ih){if(!isObject$4(Ph)){Fh[Ih]=null;return}});var Vh=prepareResult(Ph,Bh,Ih);return(Lh||Rh)&&mappingById(Vh,Ph,Bh,Fh),Lh&&mappingByName(Vh,Fh),Lh||Rh?mappingByIndex(Vh,Fh,Rh):zh&&mappingInReplaceAllMode(Vh,Fh),makeIdAndName(Vh),Vh}function prepareResult(Ph,Fh,Ih){var Lh=[];if(Ih===`replaceAll`)return Lh;for(var Rh=0;Rh<Ph.length;Rh++){var zh=Ph[Rh];zh&&zh.id!=null&&Fh.set(zh.id,Rh),Lh.push({existing:Ih===`replaceMerge`||isComponentIdInternal(zh)?null:zh,newOption:null,keyInfo:null,brandNew:null})}return Lh}function mappingById(Ph,Fh,Ih,Lh){each$15(Lh,function(Rh,zh){if(!(!Rh||Rh.id==null)){var Bh=makeComparableKey(Rh.id),Vh=Ih.get(Bh);if(Vh!=null){var Hh=Ph[Vh];assert$1(!Hh.newOption,`Duplicated option on id "`+Bh+`".`),Hh.newOption=Rh,Hh.existing=Fh[Vh],Lh[zh]=null}}})}function mappingByName(Ph,Fh){each$15(Fh,function(Ih,Lh){if(!(!Ih||Ih.name==null))for(var Rh=0;Rh<Ph.length;Rh++){var zh=Ph[Rh].existing;if(!Ph[Rh].newOption&&zh&&(zh.id==null||Ih.id==null)&&!isComponentIdInternal(Ih)&&!isComponentIdInternal(zh)&&keyExistAndEqual(`name`,zh,Ih)){Ph[Rh].newOption=Ih,Fh[Lh]=null;return}}})}function mappingByIndex(Ph,Fh,Ih){each$15(Fh,function(Fh){if(Fh){for(var Lh,Rh=0;(Lh=Ph[Rh])&&(Lh.newOption||isComponentIdInternal(Lh.existing)||Lh.existing&&Fh.id!=null&&!keyExistAndEqual(`id`,Fh,Lh.existing));)Rh++;Lh?(Lh.newOption=Fh,Lh.brandNew=Ih):Ph.push({newOption:Fh,brandNew:Ih,existing:null,keyInfo:null}),Rh++}})}function mappingInReplaceAllMode(Ph,Fh){each$15(Fh,function(Fh){Ph.push({newOption:Fh,brandNew:!0,existing:null,keyInfo:null})})}function makeIdAndName(Ph){var Fh=createHashMap();each$15(Ph,function(Ph){var Ih=Ph.existing;Ih&&Fh.set(Ih.id,Ph)}),each$15(Ph,function(Ph){var Ih=Ph.newOption;assert$1(!Ih||Ih.id==null||!Fh.get(Ih.id)||Fh.get(Ih.id)===Ph,`id duplicates: `+(Ih&&Ih.id)),Ih&&Ih.id!=null&&Fh.set(Ih.id,Ph),!Ph.keyInfo&&(Ph.keyInfo={})}),each$15(Ph,function(Ph,Ih){var Lh=Ph.existing,Rh=Ph.newOption,zh=Ph.keyInfo;if(isObject$4(Rh)){if(zh.name=Rh.name==null?Lh?Lh.name:DUMMY_COMPONENT_NAME_PREFIX+Ih:makeComparableKey(Rh.name),Lh)zh.id=makeComparableKey(Lh.id);else if(Rh.id!=null)zh.id=makeComparableKey(Rh.id);else{var Bh=0;do zh.id=`\0`+zh.name+`\0`+ Bh++;while(Fh.get(zh.id))}Fh.set(zh.id,Ph)}})}function keyExistAndEqual(Ph,Fh,Ih){var Lh=convertOptionIdName(Fh[Ph],null),Rh=convertOptionIdName(Ih[Ph],null);return Lh!=null&&Rh!=null&&Lh===Rh}function makeComparableKey(Ph){return convertOptionIdName(Ph,``)}function convertOptionIdName(Ph,Fh){return Ph==null?Fh:isString(Ph)?Ph:isNumber(Ph)||isStringSafe(Ph)?Ph+``:Fh}function isNameSpecified(Ph){var Fh=Ph.name;return!!(Fh&&Fh.indexOf(DUMMY_COMPONENT_NAME_PREFIX))}function isComponentIdInternal(Ph){return Ph&&Ph.id!=null&&makeComparableKey(Ph.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX)===0}function makeInternalComponentId(Ph){return INTERNAL_COMPONENT_ID_PREFIX+Ph}function setComponentTypeToKeyInfo(Ph,Fh,Ih){each$15(Ph,function(Ph){var Lh=Ph.newOption;isObject$4(Lh)&&(Ph.keyInfo.mainType=Fh,Ph.keyInfo.subType=determineSubType(Fh,Lh,Ph.existing,Ih))})}function determineSubType(Ph,Fh,Ih,Lh){return Fh.type?Fh.type:Ih?Ih.subType:Lh.determineSubType(Ph,Fh)}function compressBatches(Ph,Fh){var Ih={},Lh={};return Rh(Ph||[],Ih),Rh(Fh||[],Lh,Ih),[zh(Ih),zh(Lh)];function Rh(Ph,Fh,Ih){for(var Lh=0,Rh=Ph.length;Lh<Rh;Lh++){var zh=convertOptionIdName(Ph[Lh].seriesId,null);if(zh==null)return;for(var Bh=normalizeToArray(Ph[Lh].dataIndex),Vh=Ih&&Ih[zh],Hh=0,Uh=Bh.length;Hh<Uh;Hh++){var Wh=Bh[Hh];Vh&&Vh[Wh]?Vh[Wh]=null:(Fh[zh]||(Fh[zh]={}))[Wh]=1}}}function zh(Ph,Fh){var Ih=[];for(var Lh in Ph)if(Ph.hasOwnProperty(Lh)&&Ph[Lh]!=null)if(Fh)Ih.push(+Lh);else{var Rh=zh(Ph[Lh],!0);Rh.length&&Ih.push({seriesId:Lh,dataIndex:Rh})}return Ih}}function queryDataIndex(Ph,Fh){if(Fh.dataIndexInside!=null)return Fh.dataIndexInside;if(Fh.dataIndex!=null)return isArray$1(Fh.dataIndex)?map$1(Fh.dataIndex,function(Fh){return Ph.indexOfRawIndex(Fh)}):Ph.indexOfRawIndex(Fh.dataIndex);if(Fh.name!=null)return isArray$1(Fh.name)?map$1(Fh.name,function(Fh){return Ph.indexOfName(Fh)}):Ph.indexOfName(Fh.name)}function makeInner(){var Ph=`__ec_inner_`+ innerUniqueIndex++;return function(Fh){return Fh[Ph]||(Fh[Ph]={})}}var innerUniqueIndex=getRandomIdBase();function parseFinder$1(Ph,Fh,Ih){var Lh=preParseFinder(Fh,Ih),Rh=Lh.mainTypeSpecified,zh=Lh.queryOptionMap,Bh=Lh.others,Vh=Ih?Ih.defaultMainType:null;return!Rh&&Vh&&zh.set(Vh,{}),zh.each(function(Fh,Lh){var Rh=queryReferringComponents(Ph,Lh,Fh,{useDefault:Vh===Lh,enableAll:Ih&&Ih.enableAll!=null?Ih.enableAll:!0,enableNone:Ih&&Ih.enableNone!=null?Ih.enableNone:!0});Bh[Lh+`Models`]=Rh.models,Bh[Lh+`Model`]=Rh.models[0]}),Bh}function preParseFinder(Ph,Fh){var Ih;if(isString(Ph)){var Lh={};Lh[Ph+`Index`]=0,Ih=Lh}else Ih=Ph;var Rh=createHashMap(),zh={},Bh=!1;return each$15(Ih,function(Ph,Ih){if(Ih===`dataIndex`||Ih===`dataIndexInside`){zh[Ih]=Ph;return}var Lh=Ih.match(/^(\w+)(Index|Id|Name)$/)||[],Vh=Lh[1],Hh=(Lh[2]||``).toLowerCase();if(!(!Vh||!Hh||Fh&&Fh.includeMainTypes&&indexOf(Fh.includeMainTypes,Vh)<0)){Bh||=!!Vh;var Uh=Rh.get(Vh)||Rh.set(Vh,{});Uh[Hh]=Ph}}),{mainTypeSpecified:Bh,queryOptionMap:Rh,others:zh}}var SINGLE_REFERRING={useDefault:!0,enableAll:!1,enableNone:!1},MULTIPLE_REFERRING={useDefault:!1,enableAll:!0,enableNone:!0};function queryReferringComponents(Ph,Fh,Ih,Lh){Lh||=SINGLE_REFERRING;var Rh=Ih.index,zh=Ih.id,Bh=Ih.name,Vh={models:null,specified:Rh!=null||zh!=null||Bh!=null};if(!Vh.specified){var Hh=void 0;return Vh.models=Lh.useDefault&&(Hh=Ph.getComponent(Fh))?[Hh]:[],Vh}if(Rh===`none`||Rh===!1){if(Lh.enableNone)return Vh.models=[],Vh;Rh=-1}return Rh===`all`&&(Rh=Lh.enableAll?zh=Bh=null:-1),Vh.models=Ph.queryComponents({mainType:Fh,index:Rh,id:zh,name:Bh}),Vh}function setAttribute(Ph,Fh,Ih){Ph.setAttribute?Ph.setAttribute(Fh,Ih):Ph[Fh]=Ih}function getAttribute(Ph,Fh){return Ph.getAttribute?Ph.getAttribute(Fh):Ph[Fh]}function getTooltipRenderMode(Ph){return Ph===`auto`?env.domSupported?`html`:`richText`:Ph||`html`}function groupData(Ph,Fh){var Ih=createHashMap(),Lh=[];return each$15(Ph,function(Ph){var Rh=Fh(Ph);(Ih.get(Rh)||(Lh.push(Rh),Ih.set(Rh,[]))).push(Ph)}),{keys:Lh,buckets:Ih}}function interpolateRawValues(Ph,Fh,Ih,Lh,Rh){var zh=Fh==null||Fh===`auto`;if(Lh==null)return Lh;if(isNumber(Lh)){var Bh=interpolateNumber(Ih||0,Lh,Rh);return round$4(Bh,zh?Math.max(getPrecision(Ih||0),getPrecision(Lh)):Fh)}else if(isString(Lh))return Rh<1?Ih:Lh;else{for(var Vh=[],Hh=Ih,Uh=Lh,Wh=Math.max(Hh?Hh.length:0,Uh.length),Gh=0;Gh<Wh;++Gh){var Kh=Ph.getDimensionInfo(Gh);if(Kh&&Kh.type===`ordinal`)Vh[Gh]=(Rh<1&&Hh?Hh:Uh)[Gh];else{var qh=Hh&&Hh[Gh]?Hh[Gh]:0,Jh=Uh[Gh],Bh=interpolateNumber(qh,Jh,Rh);Vh[Gh]=round$4(Bh,zh?Math.max(getPrecision(qh),getPrecision(Jh)):Fh)}}return Vh}}var ListIterator=function(){function Ph(){}return Ph.prototype.reset=function(Ph,Fh,Ih,Lh){return this._list=Ph,this._step=Lh||=1,this._idx=Fh,this._end=Ih??(Lh>0?Ph.length:0),this.item=null,this.key=NaN,this},Ph.prototype.next=function(){return(this._step>0?this._idx<this._end:this._idx>=this._end)?(this.item=this._list[this._idx],this.key=this._idx+=this._step,!0):!1},Ph}();function clearTmpModel(Ph){Ph.option=Ph.parentModel=Ph.ecModel=null}var TYPE_DELIMITER=`.`,IS_CONTAINER=`___EC__COMPONENT__CONTAINER___`,IS_EXTENDED_CLASS=`___EC__EXTENDED_CLASS___`;function parseClassType(Ph){var Fh={main:``,sub:``};if(Ph){var Ih=Ph.split(TYPE_DELIMITER);Fh.main=Ih[0]||``,Fh.sub=Ih[1]||``}return Fh}function checkClassType(Ph){assert$1(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(Ph),`componentType "`+Ph+`" illegal`)}function isExtendedClass(Ph){return!!(Ph&&Ph[IS_EXTENDED_CLASS])}function enableClassExtend(Ph,Fh){Ph.$constructor=Ph,Ph.extend=function(Ph){var Fh=this,Ih;return isESClass(Fh)?Ih=function(Ph){__extends$1(Fh,Ph);function Fh(){return Ph.apply(this,arguments)||this}return Fh}(Fh):(Ih=function(){(Ph.$constructor||Fh).apply(this,arguments)},inherits(Ih,this)),extend$1(Ih.prototype,Ph),Ih[IS_EXTENDED_CLASS]=!0,Ih.extend=this.extend,Ih.superCall=superCall,Ih.superApply=superApply,Ih.superClass=Fh,Ih}}function isESClass(Ph){return isFunction(Ph)&&/^class\s/.test(Function.prototype.toString.call(Ph))}function mountExtend(Ph,Fh){Ph.extend=Fh.extend}var classBase=Math.round(Math.random()*10);function enableClassCheck(Ph){var Fh=[`__\0is_clz`,classBase++].join(`_`);Ph.prototype[Fh]=!0,Ph.isInstance=function(Ph){return!!(Ph&&Ph[Fh])}}function superCall(Ph,Fh){var Ih=[...arguments].slice(2);return this.superClass.prototype[Fh].apply(Ph,Ih)}function superApply(Ph,Fh,Ih){return this.superClass.prototype[Fh].apply(Ph,Ih)}function enableClassManagement(Ph){var Fh={};Ph.registerClass=function(Ph){var Lh=Ph.type||Ph.prototype.type;if(Lh){checkClassType(Lh),Ph.prototype.type=Lh;var Rh=parseClassType(Lh);if(!Rh.sub)Fh[Rh.main]=Ph;else if(Rh.sub!==IS_CONTAINER){var zh=Ih(Rh);zh[Rh.sub]=Ph}}return Ph},Ph.getClass=function(Ph,Ih,Lh){var Rh=Fh[Ph];if(Rh&&Rh[IS_CONTAINER]&&(Rh=Ih?Rh[Ih]:null),Lh&&!Rh)throw Error(Ih?`Component `+Ph+`.`+(Ih||``)+` is used but not imported.`:Ph+`.type should be specified.`);return Rh},Ph.getClassesByMainType=function(Ph){var Ih=parseClassType(Ph),Lh=[],Rh=Fh[Ih.main];return Rh&&Rh[IS_CONTAINER]?each$15(Rh,function(Ph,Fh){Fh!==IS_CONTAINER&&Lh.push(Ph)}):Lh.push(Rh),Lh},Ph.hasClass=function(Ph){return!!Fh[parseClassType(Ph).main]},Ph.getAllClassMainTypes=function(){var Ph=[];return each$15(Fh,function(Fh,Ih){Ph.push(Ih)}),Ph},Ph.hasSubTypes=function(Ph){var Ih=Fh[parseClassType(Ph).main];return Ih&&Ih[IS_CONTAINER]};function Ih(Ph){var Ih=Fh[Ph.main];return(!Ih||!Ih[IS_CONTAINER])&&(Ih=Fh[Ph.main]={},Ih[IS_CONTAINER]=!0),Ih}}function makeStyleMapper(Ph,Fh){for(var Ih=0;Ih<Ph.length;Ih++)Ph[Ih][1]||(Ph[Ih][1]=Ph[Ih][0]);return Fh||=!1,function(Ih,Lh,Rh){for(var zh={},Bh=0;Bh<Ph.length;Bh++){var Vh=Ph[Bh][1];if(!(Lh&&indexOf(Lh,Vh)>=0||Rh&&indexOf(Rh,Vh)<0)){var Hh=Ih.getShallow(Vh,Fh);Hh!=null&&(zh[Ph[Bh][0]]=Hh)}}return zh}}var AREA_STYLE_KEY_MAP=[[`fill`,`color`],[`shadowBlur`],[`shadowOffsetX`],[`shadowOffsetY`],[`opacity`],[`shadowColor`]],getAreaStyle=makeStyleMapper(AREA_STYLE_KEY_MAP),AreaStyleMixin=function(){function Ph(){}return Ph.prototype.getAreaStyle=function(Ph,Fh){return getAreaStyle(this,Ph,Fh)},Ph}(),globalImageCache=new LRU(50);function findExistImage(Ph){if(typeof Ph==`string`){var Fh=globalImageCache.get(Ph);return Fh&&Fh.image}else return Ph}function createOrUpdateImage(Ph,Fh,Ih,Lh,Rh){if(!Ph)return Fh;if(typeof Ph==`string`){if(Fh&&Fh.__zrImageSrc===Ph||!Ih)return Fh;var zh=globalImageCache.get(Ph),Bh={hostEl:Ih,cb:Lh,cbPayload:Rh};return zh?(Fh=zh.image,!isImageReady(Fh)&&zh.pending.push(Bh)):(Fh=platformApi.loadImage(Ph,imageOnLoad,imageOnLoad),Fh.__zrImageSrc=Ph,globalImageCache.put(Ph,Fh.__cachedImgObj={image:Fh,pending:[Bh]})),Fh}else return Ph}function imageOnLoad(){var Ph=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var Fh=0;Fh<Ph.pending.length;Fh++){var Ih=Ph.pending[Fh],Lh=Ih.cb;Lh&&Lh(this,Ih.cbPayload),Ih.hostEl.dirty()}Ph.pending.length=0}function isImageReady(Ph){return Ph&&Ph.width&&Ph.height}var STYLE_REG=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function truncateText2(Ph,Fh,Ih,Lh,Rh,zh){if(!Ih){Ph.text=``,Ph.isTruncated=!1;return}var Bh=(Fh+``).split(`
|
|
4840
4840
|
`);zh=prepareTruncateOptions(Ih,Lh,Rh,zh);for(var Vh=!1,Hh={},Uh=0,Wh=Bh.length;Uh<Wh;Uh++)truncateSingleLine(Hh,Bh[Uh],zh),Bh[Uh]=Hh.textLine,Vh||=Hh.isTruncated;Ph.text=Bh.join(`
|