/*!
 * Nutrient Web SDK 1.12.0 (https://www.nutrient.io/sdk/web)
 *
 * Copyright (c) 2016-2026 PSPDFKit GmbH. All rights reserved.
 *
 * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
 * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
 * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
 * This notice may not be removed from this file.
 *
 * PSPDFKit uses several open source third-party components: https://www.nutrient.io/legal/acknowledgements/web-acknowledgements/
 */
"use strict";(globalThis.webpackChunkNutrientViewer=globalThis.webpackChunkNutrientViewer||[]).push([[11],{7222:(t,e,n)=>{n.d(e,{default:()=>o});var r=n(14610),i=n.n(r);function o(){return i()('/*!\n * Nutrient Web SDK 1.12.0 (https://www.nutrient.io/sdk/web)\n *\n * Copyright (c) 2016-2026 PSPDFKit GmbH. All rights reserved.\n *\n * THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW\n * AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.\n * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.\n * This notice may not be removed from this file.\n *\n * PSPDFKit uses several open source third-party components: https://www.nutrient.io/legal/acknowledgements/web-acknowledgements/\n */(()=>{"use strict";var t,e={},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.m=e,r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.f={},r.e=t=>Promise.all(Object.keys(r.f).reduce((e,n)=>(r.f[n](t,e),e),[])),r.u=t=>"nutrient-viewer-lib/chunk-"+t+"-454a131091fa8e08.worker.js",r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.tt=()=>(void 0===t&&(t={createScriptURL:t=>t},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(t=trustedTypes.createPolicy("nutrient-web-sdk#webpack",t))),t),r.tu=t=>r.tt().createScriptURL(t),r.p="",(()=>{var t={224:1};r.f.i=(e,n)=>{t[e]||importScripts(r.tu(r.p+r.u(e)))};var e=self.webpackChunkNutrientViewer=self.webpackChunkNutrientViewer||[],n=e.push.bind(e);e.push=e=>{var[i,o,a]=e;for(var s in o)r.o(o,s)&&(r.m[s]=o[s]);for(a&&a(r);i.length;)t[i.pop()]=1;n(e)}})();const i=function t(e){let n;return n=e instanceof Error?e:new Error(e),Object.setPrototypeOf(n,t.prototype),n};i.prototype=Object.create(Error.prototype,{name:{value:"PSPDFKitError",enumerable:!1}});const o=i;function a(t,e){if(!t)throw new o(`Assertion failed: ${e||"Condition not met"}\\n\\nFor further assistance, please go to: https://www.nutrient.io/support/request`)}["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[contenteditable]",\'[tabindex]:not([tabindex^="-"])\'].join(",");function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function u(t){var e=function(t,e){if("object"!=s(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==s(e)?e:e+""}function c(t,e,n){return(e=u(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}new WeakMap;async function l(t){const e=(await async function(t){try{const e=await fetch(t).catch(e=>{throw new o(`Error fetching dynamic fonts file ${t}. ${e}`)});if(200!==e.status)throw new o(`Error fetching dynamic fonts file ${t}. Status code: ${e.status}`);return e}catch(t){throw t}}(t)).json().catch(e=>{throw new o(`Error parsing dynamic fonts file ${t}. ${e}`)});return e}let f=function(t){return t[t.pdf_a_1a=0]="pdf_a_1a",t[t.pdf_a_1b=1]="pdf_a_1b",t[t.pdf_a_2a=2]="pdf_a_2a",t[t.pdf_a_2u=3]="pdf_a_2u",t[t.pdf_a_2b=4]="pdf_a_2b",t[t.pdf_a_3a=5]="pdf_a_3a",t[t.pdf_a_3u=6]="pdf_a_3u",t[t.pdf_a_3b=7]="pdf_a_3b",t[t.pdf_a_4=8]="pdf_a_4",t[t.pdf_a_4e=9]="pdf_a_4e",t[t.pdf_a_4f=10]="pdf_a_4f",t}({});const d=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;const p=function(t){return"string"==typeof t&&d.test(t)};const h=function(t){if(!p(t))throw TypeError("Invalid UUID");let e;return Uint8Array.of((e=parseInt(t.slice(0,8),16))>>>24,e>>>16&255,e>>>8&255,255&e,(e=parseInt(t.slice(9,13),16))>>>8,255&e,(e=parseInt(t.slice(14,18),16))>>>8,255&e,(e=parseInt(t.slice(19,23),16))>>>8,255&e,(e=parseInt(t.slice(24,36),16))/1099511627776&255,e/4294967296&255,e>>>24&255,e>>>16&255,e>>>8&255,255&e)},m=[];for(let t=0;t<256;++t)m.push((t+256).toString(16).slice(1));function y(t,e=0){return(m[t[e+0]]+m[t[e+1]]+m[t[e+2]]+m[t[e+3]]+"-"+m[t[e+4]]+m[t[e+5]]+"-"+m[t[e+6]]+m[t[e+7]]+"-"+m[t[e+8]]+m[t[e+9]]+"-"+m[t[e+10]]+m[t[e+11]]+m[t[e+12]]+m[t[e+13]]+m[t[e+14]]+m[t[e+15]]).toLowerCase()}let g;const w=new Uint8Array(16);function b(t){return 14+(t+64>>>9<<4)+1}function v(t,e){const n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function S(t,e,n,r,i,o){return v((a=v(v(e,t),v(r,o)))<<(s=i)|a>>>32-s,n);var a,s}function _(t,e,n,r,i,o,a){return S(e&n|~e&r,t,e,i,o,a)}function E(t,e,n,r,i,o,a){return S(e&r|n&~r,t,e,i,o,a)}function F(t,e,n,r,i,o,a){return S(e^n^r,t,e,i,o,a)}function A(t,e,n,r,i,o,a){return S(n^(e|~r),t,e,i,o,a)}const I=function(t){return function(t){const e=new Uint8Array(4*t.length);for(let n=0;n<4*t.length;n++)e[n]=t[n>>2]>>>n%4*8&255;return e}(function(t,e){const n=new Uint32Array(b(e)).fill(0);n.set(t),n[e>>5]|=128<<e%32,n[n.length-1]=e,t=n;let r=1732584193,i=-271733879,o=-1732584194,a=271733878;for(let e=0;e<t.length;e+=16){const n=r,s=i,u=o,c=a;r=_(r,i,o,a,t[e],7,-680876936),a=_(a,r,i,o,t[e+1],12,-389564586),o=_(o,a,r,i,t[e+2],17,606105819),i=_(i,o,a,r,t[e+3],22,-1044525330),r=_(r,i,o,a,t[e+4],7,-176418897),a=_(a,r,i,o,t[e+5],12,1200080426),o=_(o,a,r,i,t[e+6],17,-1473231341),i=_(i,o,a,r,t[e+7],22,-45705983),r=_(r,i,o,a,t[e+8],7,1770035416),a=_(a,r,i,o,t[e+9],12,-1958414417),o=_(o,a,r,i,t[e+10],17,-42063),i=_(i,o,a,r,t[e+11],22,-1990404162),r=_(r,i,o,a,t[e+12],7,1804603682),a=_(a,r,i,o,t[e+13],12,-40341101),o=_(o,a,r,i,t[e+14],17,-1502002290),i=_(i,o,a,r,t[e+15],22,1236535329),r=E(r,i,o,a,t[e+1],5,-165796510),a=E(a,r,i,o,t[e+6],9,-1069501632),o=E(o,a,r,i,t[e+11],14,643717713),i=E(i,o,a,r,t[e],20,-373897302),r=E(r,i,o,a,t[e+5],5,-701558691),a=E(a,r,i,o,t[e+10],9,38016083),o=E(o,a,r,i,t[e+15],14,-660478335),i=E(i,o,a,r,t[e+4],20,-405537848),r=E(r,i,o,a,t[e+9],5,568446438),a=E(a,r,i,o,t[e+14],9,-1019803690),o=E(o,a,r,i,t[e+3],14,-187363961),i=E(i,o,a,r,t[e+8],20,1163531501),r=E(r,i,o,a,t[e+13],5,-1444681467),a=E(a,r,i,o,t[e+2],9,-51403784),o=E(o,a,r,i,t[e+7],14,1735328473),i=E(i,o,a,r,t[e+12],20,-1926607734),r=F(r,i,o,a,t[e+5],4,-378558),a=F(a,r,i,o,t[e+8],11,-2022574463),o=F(o,a,r,i,t[e+11],16,1839030562),i=F(i,o,a,r,t[e+14],23,-35309556),r=F(r,i,o,a,t[e+1],4,-1530992060),a=F(a,r,i,o,t[e+4],11,1272893353),o=F(o,a,r,i,t[e+7],16,-155497632),i=F(i,o,a,r,t[e+10],23,-1094730640),r=F(r,i,o,a,t[e+13],4,681279174),a=F(a,r,i,o,t[e],11,-358537222),o=F(o,a,r,i,t[e+3],16,-722521979),i=F(i,o,a,r,t[e+6],23,76029189),r=F(r,i,o,a,t[e+9],4,-640364487),a=F(a,r,i,o,t[e+12],11,-421815835),o=F(o,a,r,i,t[e+15],16,530742520),i=F(i,o,a,r,t[e+2],23,-995338651),r=A(r,i,o,a,t[e],6,-198630844),a=A(a,r,i,o,t[e+7],10,1126891415),o=A(o,a,r,i,t[e+14],15,-1416354905),i=A(i,o,a,r,t[e+5],21,-57434055),r=A(r,i,o,a,t[e+12],6,1700485571),a=A(a,r,i,o,t[e+3],10,-1894986606),o=A(o,a,r,i,t[e+10],15,-1051523),i=A(i,o,a,r,t[e+1],21,-2054922799),r=A(r,i,o,a,t[e+8],6,1873313359),a=A(a,r,i,o,t[e+15],10,-30611744),o=A(o,a,r,i,t[e+6],15,-1560198380),i=A(i,o,a,r,t[e+13],21,1309151649),r=A(r,i,o,a,t[e+4],6,-145523070),a=A(a,r,i,o,t[e+11],10,-1120210379),o=A(o,a,r,i,t[e+2],15,718787259),i=A(i,o,a,r,t[e+9],21,-343485551),r=v(r,n),i=v(i,s),o=v(o,u),a=v(a,c)}return Uint32Array.of(r,i,o,a)}(function(t){if(0===t.length)return new Uint32Array;const e=new Uint32Array(b(8*t.length)).fill(0);for(let n=0;n<t.length;n++)e[n>>2]|=(255&t[n])<<n%4*8;return e}(t),8*t.length))};const U="6ba7b810-9dad-11d1-80b4-00c04fd430c8",k="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function M(t,e,n,r,i,o){const a="string"==typeof n?function(t){t=unescape(encodeURIComponent(t));const e=new Uint8Array(t.length);for(let n=0;n<t.length;++n)e[n]=t.charCodeAt(n);return e}(n):n,s="string"==typeof r?h(r):r;if("string"==typeof r&&(r=h(r)),16!==r?.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+a.length);if(u.set(s),u.set(a,s.length),u=e(u),u[6]=15&u[6]|t,u[8]=63&u[8]|128,i){o=o||0;for(let t=0;t<16;++t)i[o+t]=u[t];return i}return y(u)}function x(t,e,n,r){return M(48,I,t,e,n,r)}x.DNS=U,x.URL=k;const $={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};const j=function(t,e,n){if($.randomUUID&&!e&&!t)return $.randomUUID();const r=(t=t||{}).random??t.rng?.()??function(){if(!g){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");g=crypto.getRandomValues.bind(crypto)}return g(w)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){if((n=n||0)<0||n+16>e.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[n+t]=r[t];return e}return y(r)};function P(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:case 3:return e^n^r;case 2:return e&n^e&r^n&r}}function T(t,e){return t<<e|t>>>32-e}const C=function(t){const e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520],r=new Uint8Array(t.length+1);r.set(t),r[t.length]=128;const i=(t=r).length/4+2,o=Math.ceil(i/16),a=new Array(o);for(let e=0;e<o;++e){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=t[64*e+4*r]<<24|t[64*e+4*r+1]<<16|t[64*e+4*r+2]<<8|t[64*e+4*r+3];a[e]=n}a[o-1][14]=8*(t.length-1)/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=8*(t.length-1)&4294967295;for(let t=0;t<o;++t){const r=new Uint32Array(80);for(let e=0;e<16;++e)r[e]=a[t][e];for(let t=16;t<80;++t)r[t]=T(r[t-3]^r[t-8]^r[t-14]^r[t-16],1);let i=n[0],o=n[1],s=n[2],u=n[3],c=n[4];for(let t=0;t<80;++t){const n=Math.floor(t/20),a=T(i,5)+P(n,o,s,u)+c+e[n]+r[t]>>>0;c=u,u=s,s=T(o,30)>>>0,o=i,i=a}n[0]=n[0]+i>>>0,n[1]=n[1]+o>>>0,n[2]=n[2]+s>>>0,n[3]=n[3]+u>>>0,n[4]=n[4]+c>>>0}return Uint8Array.of(n[0]>>24,n[0]>>16,n[0]>>8,n[0],n[1]>>24,n[1]>>16,n[1]>>8,n[1],n[2]>>24,n[2]>>16,n[2]>>8,n[2],n[3]>>24,n[3]>>16,n[3]>>8,n[3],n[4]>>24,n[4]>>16,n[4]>>8,n[4])};function O(t,e,n,r){return M(80,C,t,e,n,r)}O.DNS=U,O.URL=k;function D(){const t="nutrient-analytics-user-id";if(!window||!window.localStorage)return null;try{if(window.localStorage.getItem(t))return window.localStorage.getItem(t);const e=j();return window.localStorage.setItem(t,e),e}catch{return null}}class q{constructor(){c(this,"maxQueueSize",1e3),c(this,"flushTimer",null),c(this,"visibilityChangeHandler",null),c(this,"isFlushing",!1),c(this,"queue",[]),c(this,"allEvents",[])}static getInstance(){return q.instance||(q.instance=new q),q.instance}emit(t){this.collect(t)}configure(t){const{hmacSecret:e,endpoint:n,flushInterval:r,maxQueueSize:i,clientInfo:o}=t;this.clientInfo=o,this.hmacSecret=this.hexStringToHmacSecret(e),this.endpoint=n,void 0!==i&&(this.maxQueueSize=i),this.isE2E()||(this.flushTimer=setInterval(()=>this.flush(),r||3e3),this.visibilityChangeHandler=()=>{"hidden"===document.visibilityState&&this.queue.length>0&&this.flush()},document.addEventListener("visibilitychange",this.visibilityChangeHandler))}cleanup(){null!==this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),null!==this.visibilityChangeHandler&&(document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.visibilityChangeHandler=null)}static cleanup(){q.instance&&(q.instance.cleanup(),q.instance=void 0)}shouldBeIgnored(t){switch(t.name){case"content|editor|save":return!!this.allEvents.find(e=>e.name===t.name&&Math.abs(e.timestamp-t.timestamp)<1e3);case"form|creator|field|add":return!this.allEvents.find(t=>"form|creator|enter"===t.name);case"annotation|edit":return!!this.allEvents.find(e=>e.name===t.name&&Math.abs(e.timestamp-t.timestamp)<100);default:return!1}}collect(t){if(this.isE2E()){const e=window;if(e.__PSPDFKIT_ANALYTICS_EVENTS__??=[],this.shouldBeIgnored(t))return;return this.allEvents.push(t),void e.__PSPDFKIT_ANALYTICS_EVENTS__.push(t)}this.shouldBeIgnored(t)||(this.allEvents.push(t),this.queue.length>=this.maxQueueSize&&this.queue.shift(),this.queue.push(t))}async flush(){if(this.isFlushing||this.isE2E()||0===this.queue.length)return;this.isFlushing=!0;const t=this.queue.splice(0,this.queue.length);try{const{prepareUpload:e}=await r.e(212).then(r.bind(r,212)),n=t.map(t=>({type:"counter",name:t.name,attributes:Object.fromEntries(Object.entries(t.attributes).map(t=>{let[e,n]=t;return[e,String(n)]})),timestamp:t.timestamp})),i=await e({clientInfo:{...this.clientInfo,tag:D()??void 0},hmacSecret:this.hmacSecret},n);if(!i)return void this.requeue(t);const o=`${this.endpoint}/proto/metrics`,a=await fetch(o,{method:"POST",headers:i.headers,body:i.body,keepalive:!0});if(!a.ok)throw new Error(`Analytics request failed with status ${a.status}`)}catch(e){this.requeue(t)}finally{this.isFlushing=!1}}requeue(t){const e=this.maxQueueSize-this.queue.length;if(e<=0)return;const n=t.slice(0,e);this.queue.unshift(...n)}isE2E(){return"undefined"!=typeof window&&Boolean(window.__E2E_TEST__)}hexStringToHmacSecret(t){if(128!==t.length)throw new Error(`Invalid hex string length: expected 128 characters, got ${t.length}`);return new Uint8Array(Array.from(t,t=>t.charCodeAt(0)))}}function L(t){var e,n;e="convert|from|office",n={feature:"office_conversion",mimeType:t},q.getInstance().emit({name:e,attributes:n??{},timestamp:Date.now()})}c(q,"instance",void 0);const N="/create.pdf",R="/save.pdf",H="/create.docx",W="/save.docx",B="/templateData.json",z="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope;let V=null,K=null;function G(t){let e;a(K,"GdPicture WebAssembly is not loaded.");for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(const t of r)e=Object.assign(r[0],t);const o=JSON.stringify({type:t,...e}),s=JSON.parse(K.CommandHandler(o));if(!s.success)throw new Error(s.errorReason+": "+s.errorMessage+"\\n"+s.error);return s}const Q={allMarkup:0,simpleMarkup:1,noMarkup:2,original:3},J=Q.noMarkup,Y={documentMarkupMode:J};function X(t){if(!t)return Y;if(!t.documentMarkupMode)return{...t,documentMarkupMode:J};if(!(t.documentMarkupMode in Q))throw new Error(`Invalid documentMarkupMode value: ${t.documentMarkupMode}. Allowed values are: ${Object.keys(Q).join(", ")}`);return{...t,documentMarkupMode:Q[t.documentMarkupMode]}}const Z={"application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","text/plain":"txt"},tt=new class{_mountCustomFonts(t,e){a(V,"WebAssembly module not loaded."),V.FS.mkdir(e);{const n=z?V.FS.filesystems.WORKERFS:V.FS.filesystems.MEMFS;V.FS.mount(n,{blobs:t},e)}}async loadModule(t,e,n,r,i,o,a){const{Assemblies:s,Module:u}=await async function(t,e){if("string"==typeof t){const n="nutrient-viewer-lib/",r=`${n}gdpicture-935f5ee6/jit`,i=`${n}gdpicture-935f5ee6/aot`;let o,a;e?(o=`${t}${i}/initDotnet.js`,a=`${t}${i}`):(o=`${t}${r}/initDotnet.js`,a=`${t}${r}`);const{initDotnet:s}=await import(o);return s(a,(t,e,n,r,i)=>"blazor.boot.json"===e?fetch(n,{credentials:"same-origin"}):null)}throw new Error("GdPicture WASM loader not implemented")}(t,e);K=s.GdPictureWasm.API,V=u,G("gdpicture/setLicense",{origin:n},{licenseKey:r||"DEMO_PSPDFKIT_WEB"});const c=i?"/fonts":"";if(i&&!V.FS.analyzePath(c).exists&&(this._mountCustomFonts(i,c),G("gdpicture/setFonts",{fontPaths:[c]})),o){const t=await l(o);G("gdpicture/setDynamicFontLoading",{baseUrl:o.split("/").slice(0,-1).join("/"),allowedFonts:t.availableFonts,v:1})}a&&G("gdpicture/setFontSubstitutions",{fontSubstitutions:a})}toPdf(t,e,n,r,i){let o=N;if(i&&"pdf"!==i&&Object.values(Z).includes(i)){L(Object.keys(Z).find(t=>Z[t].toLowerCase()===i.toLowerCase()).toLowerCase()),o+=`.${i}`}else if(r&&"application/pdf"!==r){const t=r.toLowerCase();L(t);const e=Z.hasOwnProperty(t)&&Z[t];e&&(o+=`.${e}`)}V.FS.writeFile(o,new Uint8Array(t));const a={file:R,format:"pdf",conformance:e&&e in f?e:void 0,officeConversionSettings:X(n)};try{return G("gdpicture/process",{input:{file:o},output:a}),V.FS.readFile(R).buffer}finally{try{V.FS.unlink(R),V.FS.unlink(o)}catch(t){}}}toOffice(t,e){V.FS.writeFile(N,new Uint8Array(t));const n=`/save.${e}`;try{return G("gdpicture/process",{input:{file:N},output:{file:n,format:e}}),V.FS.readFile(n).buffer}finally{try{V.FS.unlink(n),V.FS.unlink(N)}catch(t){console.log(t.message)}}}async populateDocumentTemplate(t,e){let n;V.FS.writeFile(H,new Uint8Array(t));try{n=JSON.stringify(e,null,2)}catch(t){throw new Error("Invalid config data")}V.FS.writeFile(B,n);try{return G("gdpicture/process-office-template",{inputFile:H,modelAndConfigFile:B,outputFile:W}),V.FS.readFile(W).buffer}finally{try{V.FS.unlink(W),V.FS.unlink(B),V.FS.unlink(H)}catch(t){console.log(t.message)}}}},et=self;et.global=et,et.module={},et.onmessage=async t=>{let e,n,{data:r}=t;try{const t=await tt[r.action](...r.args);if(e={id:r.id,result:t},Array.isArray(t)){const e=t.filter(t=>t instanceof ArrayBuffer);e.length>0&&(n=e)}t instanceof ArrayBuffer&&(n=[t])}catch(t){const i=[...r.args].filter(t=>t instanceof ArrayBuffer);i.length>0&&(n=i),e={id:r.id,error:t.message||t.toString(),callArgs:r.args}}et.postMessage(e,n)}})();',"Worker",void 0,void 0)}},14610:t=>{function e(t){var e=function(){var t=self||window;if(void 0===t.trustedTypes)return null;try{return t.trustedTypes.createPolicy("nutrient-web-sdk#webpack-worker",{createScriptURL:function(t){return t}})}catch(e){return t.trustedTypes.defaultPolicy||null}}();return e?e.createScriptURL(t):t}t.exports=function(t,n,r,i){var o=self||window;try{try{var a,s="\n        // Trusted Types policy for worker context - use Webpack's policy naming\n        if (typeof trustedTypes !== 'undefined') {\n          try {\n            var workerPolicy = trustedTypes.createPolicy('nutrient-web-sdk#webpack-worker', {\n              createScriptURL: function(s) { return s; }\n            });\n            // Wrap importScripts to use Trusted Types\n            var originalImportScripts = importScripts;\n            importScripts = function() {\n              var args = Array.prototype.slice.call(arguments);\n              var trustedArgs = args.map(function(url) {\n                return workerPolicy.createScriptURL(url);\n              });\n              return originalImportScripts.apply(this, trustedArgs);\n            };\n          } catch (e) {\n            // Policy creation failed, continue without Trusted Types\n          }\n        }\n      "+t;try{a=new o.Blob([s])}catch(t){(a=new(o.BlobBuilder||o.WebKitBlobBuilder||o.MozBlobBuilder||o.MSBlobBuilder)).append(s),a=a.getBlob()}var u=o.URL||o.webkitURL,c=u.createObjectURL(a),l=e(c),f=new o[n](l,r);return u.revokeObjectURL(c),f}catch(i){var d=e("data:application/javascript,".concat(encodeURIComponent(t)));return new o[n](d,r)}}catch(t){if(!i)throw Error("Inline worker is not supported");var p=e(i);return new o[n](p,r)}}}}]);