alle new
This commit is contained in:
erik committed 2026-10-01 06:46:51 +02:00
1 parent da64472251
commit 5b20adee48
1605 files changed
+396517 -1674

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
/**
* @licstart The following is the entire license notice for the
* JavaScript code in this page
*
* Copyright 2024 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @licend The above is the entire license notice for the
* JavaScript code in this page
*/
/**
* pdfjsVersion = 6.3.289
* pdfjsBuild = 1c8020a7d
*/
"object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&process.type,new Float32Array([1/0,1/0,-1/0,-1/0]);const e={ERRORS:0,WARNINGS:1,INFOS:5};let t=e.WARNINGS;function setVerbosityLevel(e){Number.isInteger(e)&&(t=e)}function getVerbosityLevel(){return t}function info(r){t>=e.INFOS&&console.info(`Info: ${r}`)}function warn(r){t>=e.WARNINGS&&console.warn(`Warning: ${r}`)}function unreachable(e){throw new Error(e)}function shadow(e,t,r,n=!1){Object.defineProperty(e,t,{value:r,enumerable:!n,configurable:!0,writable:!1});return r}const r=function BaseExceptionClosure(){function BaseException(e,t){this.message=e;this.name=t}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();class FormatError extends r{constructor(e){super(e,"FormatError")}}function bytesToString(e){"object"==typeof e&&void 0!==e?.length||unreachable("Invalid argument for bytesToString");const t=e.length,r=8192;if(t<r)return String.fromCharCode.apply(null,e);const n=[];for(let s=0;s<t;s+=r){const a=Math.min(s+r,t),i=e.subarray(s,a);n.push(String.fromCharCode.apply(null,i))}return n.join("")}class FeatureTest{static get isLittleEndian(){const e=new Uint8Array(4);e[0]=1;return shadow(this,"isLittleEndian",1===new Uint32Array(e.buffer,0,1)[0])}static get isOffscreenCanvasSupported(){return shadow(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get isImageDecoderSupported(){return shadow(this,"isImageDecoderSupported","undefined"!=typeof ImageDecoder)}static get isFloat16ArraySupported(){return shadow(this,"isFloat16ArraySupported","undefined"!=typeof Float16Array)}static get isSanitizerSupported(){return shadow(this,"isSanitizerSupported","undefined"!=typeof Sanitizer)}static get platform(){const{platform:e,userAgent:t}=navigator;return shadow(this,"platform",{isAndroid:t.includes("Android"),isLinux:e.includes("Linux"),isMac:e.includes("Mac"),isWindows:e.includes("Win"),isFirefox:t.includes("Firefox")})}static get isCanvasFilterSupported(){let e;this.isOffscreenCanvasSupported?e=new OffscreenCanvas(1,1).getContext("2d"):"undefined"!=typeof document&&(e=document.createElement("canvas").getContext("2d"));return shadow(this,"isCanvasFilterSupported",void 0!==e?.filter)}static get isAlphaColorInputSupported(){if("undefined"==typeof document)return shadow(this,"isAlphaColorInputSupported",!1);const e=document.createElement("input");e.type="color";e.setAttribute("alpha","");e.value="#ff000080";return shadow(this,"isAlphaColorInputSupported","#ff0000"!==e.value)}static get isBackdropFilterSupported(){return shadow(this,"isBackdropFilterSupported","undefined"!=typeof CSS&&CSS.supports("backdrop-filter","blur(1px)"))}}class Util{static get hexNums(){return shadow(this,"hexNums",Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")))}static makeHexColor(e,t,r){return`#${this.hexNums[e]}${this.hexNums[t]}${this.hexNums[r]}`}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static multiplyByDOMMatrix(e,t){return[e[0]*t.a+e[2]*t.b,e[1]*t.a+e[3]*t.b,e[0]*t.c+e[2]*t.d,e[1]*t.c+e[3]*t.d,e[0]*t.e+e[2]*t.f+e[4],e[1]*t.e+e[3]*t.f+e[5]]}static applyTransform(e,t,r=0){const n=e[r],s=e[r+1];e[r]=n*t[0]+s*t[2]+t[4];e[r+1]=n*t[1]+s*t[3]+t[5]}static applyTransformToBezier(e,t,r=0){const n=t[0],s=t[1],a=t[2],i=t[3],o=t[4],c=t[5];for(let t=0;t<6;t+=2){const l=e[r+t],u=e[r+t+1];e[r+t]=l*n+u*a+o;e[r+t+1]=l*s+u*i+c}}static applyInverseTransform(e,t){const r=e[0],n=e[1],s=t[0]*t[3]-t[1]*t[2];e[0]=(r*t[3]-n*t[2]+t[2]*t[5]-t[4]*t[3])/s;e[1]=(-r*t[1]+n*t[0]+t[4]*t[1]-t[5]*t[0])/s}static axialAlignedBoundingBox(e,t,r){const n=t[0],s=t[1],a=t[2],i=t[3],o=t[4],c=t[5],l=e[0],u=e[1],f=e[2],h=e[3];let m=n*l+o,g=m,d=n*f+o,p=d,b=i*u+c,y=b,w=i*h+c,C=w;if(0!==s||0!==a){const e=s*l,t=s*f,r=a*u,n=a*h;m+=r;p+=r;d+=n;g+=n;b+=e;C+=e;w+=t;y+=t}r[0]=Math.min(r[0],m,d,g,p);r[1]=Math.min(r[1],b,w,y,C);r[2]=Math.max(r[2],m,d,g,p);r[3]=Math.max(r[3],b,w,y,C)}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e,t){const r=e[0],n=e[1],s=e[2],a=e[3],i=r**2+n**2,o=r*s+n*a,c=s**2+a**2,l=(i+c)/2,u=Math.sqrt(l**2-(i*c-o**2));t[0]=Math.sqrt(l+u||1);t[1]=Math.sqrt(l-u||1)}static normalizeRect(e){const t=e.slice(0);if(e[0]>e[2]){t[0]=e[2];t[2]=e[0]}if(e[1]>e[3]){t[1]=e[3];t[3]=e[1]}return t}static intersect(e,t){const r=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),n=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(r>n)return null;const s=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),a=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return s>a?null:[r,s,n,a]}static pointBoundingBox(e,t,r){r[0]=Math.min(r[0],e);r[1]=Math.min(r[1],t);r[2]=Math.max(r[2],e);r[3]=Math.max(r[3],t)}static rectBoundingBox(e,t,r,n,s){s[0]=MathLine truncated
/*webpackIgnore: true*/
/*@vite-ignore*/
`${WasmImage.#l}${this._noWasmFilename}`)).default()}catch(e){warn(`#getJsModule: ${e}`)}e(t)}async#m(e,t,r){try{this.#u||(WasmImage.#c?this.#u=await async function fetchBinaryData(e){const t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch file "${e}" with "${t.statusText}".`);return t.bytes()}(`${WasmImage.#l}${this._filename}`):this.#u=await WasmImage.#a.sendWithPromise("FetchBinaryData",{kind:"wasmUrl",filename:this._filename}));return r((await WebAssembly.instantiate(this.#u,t)).instance)}catch(t){warn(`#instantiateWasm: ${t}`);this.#h(e);return null}}_getModule(e){if(!this.#f){const{promise:t,resolve:r}=Promise.withResolvers(),n=[t];WasmImage.#o?n.push(e({warn,instantiateWasm:this.#m.bind(this,r)})):this.#h(r);this.#f=Promise.race(n)}return this.#f}async decode(e,t){unreachable("Abstract method `decode` called")}}class Jbig2Error extends r{constructor(e){super(e,"Jbig2Error")}}class JBig2CCITTFaxImage extends WasmImage{_filename="jbig2.wasm";_noWasmFilename="jbig2_nowasm_fallback.js";static get instance(){return shadow(this,"instance",new JBig2CCITTFaxImage(!0))}async decode(e,t,r,s,a){const i=await this._getModule(n);if(!i)throw new Jbig2Error("JBig2 failed to initialize");let o,c;try{const n=e.length;o=i._malloc(n);i.writeArrayToMemory(e,o);if(a)i._ccitt_decode(o,n,t,r,a.K,a.EndOfLine?1:0,a.EncodedByteAlign?1:0,a.BlackIs1?1:0,a.Columns,a.Rows);else{const e=s?s.length:0;if(e>0){c=i._malloc(e);i.writeArrayToMemory(s,c)}i._jbig2_decode(o,n,t,r,c,e)}if(!i.imageData)throw new Jbig2Error("Unknown error");const{imageData:l}=i;i.imageData=null;return l}finally{o&&i._free(o);c&&i._free(c)}}}function MathClamp(e,t,r){return Math.min(Math.max(e,t),r)}function isDefaultDecodeHelper(e,t){if(!Array.isArray(e))return!0;const r=e.length;if(r<t){warn("Decode map length is too short.");return!0}if(r>t){info("Truncating too long decode map.");e.length=t}return!1}class ColorSpace{static#g=new Uint8ClampedArray(3);constructor(e,t){this.name=e;this.numComps=t}getRgb(e,t,r=new Uint8ClampedArray(3)){this.getRgbItem(e,t,r,0);return r}getRgbHex(e,t){const r=this.getRgb(e,t,ColorSpace.#g);return Util.makeHexColor(r[0],r[1],r[2])}getRgbItem(e,t,r,n){unreachable("Should not call ColorSpace.getRgbItem")}getRgbBuffer(e,t,r,n,s,a,i){unreachable("Should not call ColorSpace.getRgbBuffer")}getRgbItems(e,t,r,n,s){const{numComps:a}=this;for(let i=0,o=0;i<t;i++,o+=a){this.getRgbItem(e,o,r,n);n+=3+s}}isPassthrough(e){return!1}isDefaultDecode(e,t){return ColorSpace.isDefaultDecode(e,this.numComps)}fillRgb(e,t,r,n,s,a,i,o,c){const l=t*r;let u=null;const f=1<<i,h=r!==s||t!==n;if(this.isPassthrough(i))u=o;else if(1===this.numComps&&l>f&&"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){const t=i<=8?new Uint8Array(f):new Uint16Array(f);for(let e=0;e<f;e++)t[e]=e;const r=new Uint8ClampedArray(3*f);this.getRgbBuffer(t,0,f,r,0,i,0);if(h){u=new Uint8Array(3*l);let e=0;for(let t=0;t<l;++t){const n=3*o[t];u[e++]=r[n];u[e++]=r[n+1];u[e++]=r[n+2]}}else{let t=0;for(let n=0;n<l;++n){const s=3*o[n];e[t++]=r[s];e[t++]=r[s+1];e[t++]=r[s+2];t+=c}}}else if(h){u=new Uint8ClampedArray(3*l);this.getRgbBuffer(o,0,l,u,0,i,0)}else this.getRgbBuffer(o,0,n*a,e,0,i,c);if(u)if(h)!function resizeRgbImage(e,t,r,n,s,a,i){i=1!==i?0:i;const o=r/s,c=n/a;let l,u=0;const f=new Uint16Array(s),h=3*r;for(let e=0;e<s;e++)f[e]=3*Math.floor(e*o);for(let r=0;r<a;r++){const n=Math.floor(r*c)*h;for(let r=0;r<s;r++){l=n+f[r];t[u++]=e[l++];t[u++]=e[l++];t[u++]=e[l++];u+=i}}}(u,e,t,r,n,s,c);else{let t=0,r=0;for(let s=0,i=n*a;s<i;s++){e[t++]=u[r++];e[t++]=u[r++];e[t++]=u[r++];t+=c}}}get usesZeroToOneRange(){return shadow(this,"usesZeroToOneRange",!0)}static isDefaultDecode(e,t){if(isDefaultDecodeHelper(e,2*t))return!0;for(let t=0,r=e.length;t<r;t+=2)if(0!==e[t]||1!==e[t+1])return!1;return!0}}class AlternateCS extends ColorSpace{constructor(e,t,r){super("Alternate",e);this.base=t;this.tintFn=r;this.tmpBuf=new Float32Array(t.numComps)}getRgbItem(e,t,r,n){const s=this.tmpBuf;this.tintFn(e,t,s,0);this.base.getRgbItem(s,0,r,n)}getRgbItems(e,t,r,n,s){const{base:a,numComps:i,tintFn:o}=this,c=a.numComps,l=new Float32Array(t*c);for(let r=0,n=0,s=0;r<t;r++){o(e,n,l,s);n+=i;s+=c}a.getRgbItems(l,t,r,n,s)}getRgbBuffer(e,t,r,n,s,a,i){const o=this.tintFn,c=this.base,l=1/((1<<a)-1),u=c.numComps,f=c.usesZeroToOneRange,h=(c.isPassthrough(8)||!f)&&0===i;let m=h?s:0;const g=h?n:new Uint8ClampedArray(u*r),d=this.numComps,p=new Float32Array(d),b=new Float32Array(u);let y,w;for(y=0;y<r;y++){for(w=0;w<d;w++)p[w]=e[t++]*l;o(p,0,b,0);if(f)for(w=0;w<u;w++)g[m++]=255*b[w];else{c.getRgbItem(b,0,g,m);m+=u}}h||c.getRgbBuffer(g,0,r,n,s,8,i)}}class PatternCS extends ColorSpace{constructor(e){super("Pattern",null);this.base=e}isDefaultDecode(e,t){unreachable("Should not call PatternCS.isDefaultDecode")}}class IndexedCS extends ColorSpace{#d;constructor(e,t,r){super("Indexed",1);this.highVal=t;const n=t+1,s=e.numComps*n,a=new Uint8Array(s);if(r instanceof BaseStream)a.set(r.getBytes(s));else{if("string"!=typeof Line truncated