diff --git a/.gitea/workflows/apk.yml b/.gitea/workflows/apk.yml deleted file mode 100644 index 19e7429..0000000 --- a/.gitea/workflows/apk.yml +++ /dev/null @@ -1,53 +0,0 @@ -# Construye la APK y la deja publicada como borrador en las releases. -# -# NO se dispara sola con cada commit: la APK son mas de 100 MB y el backend tarda -# en empaquetarse. Se lanza a mano desde la interfaz de gitea, o al crear un tag. -# -# El runner necesita: JDK 17 con compilador, el SDK de Android (plataforma 35 y -# build-tools), node, zip y unzip. Un runner pelado NO vale. -# -# Secretos que hay que dar de alta en el repositorio: -# OASIS_KEYSTORE_B64 el almacen de claves en base64 -# OASIS_KEYSTORE_PASS su contraseña -# OASIS_KEY_ALIAS el alias (por defecto "oasis") -# -# El token para publicar lo pone gitea solo en GITEA_TOKEN. - -name: APK - -on: - workflow_dispatch: - push: - tags: - - 'v*' - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # release.sh cuenta commits para el versionCode - - - name: Restaurar el almacen de claves - run: | - echo "${{ secrets.OASIS_KEYSTORE_B64 }}" | base64 -d > /tmp/oasis.jks - chmod 600 /tmp/oasis.jks - - - name: Construir, verificar y publicar - env: - JAVA_HOME: /usr/lib/jvm/temurin-17-jdk-amd64 - ANDROID_HOME: /opt/android-sdk - OASIS_KEYSTORE: /tmp/oasis.jks - OASIS_KEYSTORE_PASS: ${{ secrets.OASIS_KEYSTORE_PASS }} - OASIS_KEY_ALIAS: ${{ secrets.OASIS_KEY_ALIAS }} - OASIS_GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} - OASIS_GITEA_URL: ${{ github.server_url }} - OASIS_GITEA_REPO: ${{ github.repository }} - run: | - cd android - ./scripts/release.sh --release --publish - - - name: Borrar el almacen de claves - if: always() - run: rm -f /tmp/oasis.jks diff --git a/README.md b/README.md index 42adab0..d0a4f31 100644 --- a/README.md +++ b/README.md @@ -1,184 +1,336 @@ -# OASIS_MOBILE — rama de desarrollo experimental +# Oasis Mobile 0.9.1 -> ## ⚠ ESTO NO ES OASIS OFICIAL -> -> Esta es una **rama de desarrollo experimental** mantenida por el hacklab, **no -> afiliada** al proyecto original. -> -> ### El repositorio oficial de Oasis es el de epsylon: https://github.com/epsylon/oasis -> -> Si quieres **usar Oasis de verdad, instala el oficial**. Lo que hay aquí puede -> romperse, cambiar de forma incompatible o desaparecer sin aviso. No está auditado y -> no tiene garantía de ninguna clase. -> -> **Los fallos de esta rama se reportan aquí, nunca a epsylon.** - -Versión base: **Oasis 0.9.5** · Rama: `PRUEBAS` · -[Documentación completa](https://gitea.laenre.net/hacklab/OASIS_MOBILE/wiki) · -[Versión de escritorio](https://gitea.laenre.net/hacklab/OASIS_LINUX) - - +Mejoras de **navegación móvil** para Android (WebView + nodejs-mobile) sobre Oasis 0.9.0: +**topbar** (logo→inicio, avatar→perfil), **navegación por hexágonos** y **barra inferior** +personalizable. Debajo, el README original de Oasis. --- -## Lo que añade +# Oasis -| | Oasis oficial | Esta rama | -|---|---|---| -| **Salas efímeras** | — | Karvan: mensajes que solo viven en memoria y se autodestruyen | -| **Videollamadas** | — | Audio y vídeo por WebRTC, sin servidores de terceros | -| **Interfaz de móvil** | El menú de escritorio en una pantalla pequeña | Panal de hexágonos, filtros y barra de accesos rápidos | -| **Varias identidades** | Una por instalación | Varias en el mismo móvil, con aviso si dos comparten clave | -| **Respuesta citada** | — | Responder a un mensaje concreto dentro de un chat | -| **Envoltorio Android** | APK sin permisos de cámara ni micrófono | Proyecto Gradle propio: permisos, subida de ficheros, servicio que sobrevive | -| **Metadatos de las fotos** | Se quitan solo si está `sharp`; en Android **nunca** | Se quitan siempre: GPS, marca, modelo, número de serie | -| **Servidor STUN** | Uno de Google, por defecto | Ninguno. TURN propio si lo configuras | +Oasis is a **libre, open-source, encrypted, peer-to-peer, distributed (not decentralized!) & federated**... project networking application +that helps you follow interesting content and discover new ones. -Los nombres de las categorías, los módulos y el resto de la aplicación son los de -epsylon, sin tocar. +  ---- +Oasis redefines what it means to be connected in the modern world, giving people +the ability to control their online presence and interactions without the need for centralized institutions. -## Qué es Oasis, en cuatro dibujos +---------- -Una red social **sin servidor**: publicas en tu propio equipo y los demás se traen una -copia. No hay cuenta, no hay contraseña y nadie puede borrarte. +## Frontend: - +Main features of the Oasis interface are: -Los mensajes viajan **de vecino en vecino**, así que llegan a gente con la que nunca te -has conectado. Por eso funciona incluso sin internet, entre dos móviles en la misma wifi. + + Data manipulation is not permitted due to the use of BLOCKCHAIN technology. + + No browser JavaScript. Just pure HTML+CSS. A really secure frontend!. + + Use your favorite web browser to read and write messages to the people you care about. + + Strong cryptography in every single point of the network. + + You are the center of your own distributed network. Online or offline, it works anywhere that you are. + + Initial identities are randomnly generated (no username or password required). + + No personal profile generated (no questions about gender, age, location, etc …). + + Automatic exif stripping (such as GPS coordinates) on images for better privacy. + + No email or associated mobile phone required. + + Automatic updates with new functionalities. + +  + +But it has others features that are also really interesting, for example: - + + Support for multiple languages. + +  -Un **pub** es solo un nodo que no se apaga nunca. No es un servidor con tus datos: no -guarda tu identidad, no decide qué ves y no puede borrarte. + + Modularity to set your own environment. + +  + + + Support for multiple themes (including Mobile Theme). + +  +  +  + +And some other nice modules, like for example: + + + A complex Reddit-styled forum system. + +  + + + Or a collaborative -offline- maps system. + +  + +And much more, that we invite you to discover by yourself ;-) - +  + +---------- -Todo lo que publicas se encadena y va **firmado con tu clave**. Nadie puede colar un -mensaje en tu nombre ni cambiar lo que dijiste. +## Modules: - +Oasis is TRULY MODULAR. Here's a list of what comes deployed with the "core". -> La explicación completa —los saltos, las tribus, el LARP, los módulos— está en -> **[Entender Oasis en diez minutos](https://gitea.laenre.net/hacklab/OASIS_MOBILE/wiki/Entender)**. + + Agenda: Module to manage all your assigned items. + + AI: Module to talk with a LLM called '42'. + + AINav: Module for natural-language queries about the network's content. + + Audios: Module to discover and manage audios. + + Banking: Module to determine the real value of ECOIN and distribute a UBI using the common treasury. + + BlockExplorer: Module to navigate the blockchain. + + Bookmarks: Module to discover and manage bookmarks. + + Calendars: Module to discover and manage calendars. + + Chats: Module to discover and manage encrypted chats. + + Cipher: Module to encrypt and decrypt your text symmetrically (using a shared password). + + Courts: Module to resolve conflicts and emit veredicts. + + Documents: Module to discover and manage documents. + + Events: Module to discover and manage events. + + Favorites: Module to manage your favorite content. + + Fediverse: Manage your other fediverse accounts, including sending and receiving content. + + Feed: Module to discover and share short-texts (feeds). + + Forums: Module to discover and manage forums. + + Games: Module to play and share your scores in various mini-games. + + Governance: Module to discover and manage votes. + + Graphos: Module to explore the network as an interactive map of peers. + + Images: Module to discover and manage images. + + Invites: Module to manage and apply invite codes. + + Jobs: Module to discover and manage jobs. + + Legacy: Module to manage your secret (private key) quickly and securely. + + Latest: Module to receive the most recent posts and discussions. + + L.A.R.P.: Module for a live-action role-playing layer with 9 houses. + + Logs: Module to record (via AI assistant) your experiences. + + Maps: Module to manage and share offline maps. + + Market: Module to exchange goods or services. + + Melody: Module to generate and share the "sound" of your blockchain. + + Multiverse: Module to receive content from other federated peers. + + Opinions: Module to discover and vote on opinions. + + Pads: Module to manage collaborative encrypted text editors. + + Parliament: Module to elect governments and vote on laws. + + Pixelia: Module to draw on a collaborative grid. + + Projects: Module to explore, crowd-funding and manage projects. + + Popular: Module to receive posts that are trending, most viewed, or most commented on. + + Reports: Module to manage and track reports related to issues, bugs, abuses, and content warnings. + + Shops: Module to manage and discover shops. + + Summaries: Module to receive summaries of long discussions or posts. + + Tags: Module to discover and explore taxonomy patterns (tags). + + Tasks: Module to discover and manage tasks. + + Threads: Module to receive conversations grouped by topic or question. + + Topics: Module to receive discussion categories based on shared interests. + + Torrents: Module to explore and manage torrents. + + Transfers: Module to discover and manage smart-contracts (transfers). + + Trending: Module to explore the most popular content. + + Tribes: Module to explore or create tribes (groups). + + Videos: Module to discover and manage videos. + + Wallet: Module to manage your digital assets (ECOin). ---- +Both the codebase and the inhabitants can generate new modules. -## Karvan: salas que se borran solas +---------- - +## C-AI (collective artificial intelligence) -Lo que se dice dentro **no toca el disco**, no entra en tu registro y no se replica a -nadie. Dos relojes corren a la vez —inactividad y tiempo absoluto— y la sala muere con -el que llegue antes. +Oasis contains its own AI model called "42". -
-
-
-
-
-
-
-
-
-
-
Preparando la aplicación…
El primer arranque descomprime el
- servidor y puede tardar un minuto. No hace falta hacer nada.
${s}s
Map invite code: ${code}
{e?.updateEditSignatureButton(t)}))}getSignaturePreview(){const{newCurves:t,areContours:e,thickness:i,width:s,height:n}=this.#so,a=Math.max(s,n);return{areContours:e,outline:SignatureExtractor.processDrawnLines({lines:{curves:t.map((t=>({points:t}))),thickness:i,width:s,height:n},pageWidth:a,pageHeight:a,rotation:0,innerMargin:0,mustSmooth:!1,areContours:e}).outline}}async addEditToolbar(){const t=await super.addEditToolbar();if(!t)return null;if(this._uiManager.signatureManager&&null!==this.#io){await t.addEditSignatureButton(this._uiManager.signatureManager,this.#no,this.#io);t.show()}return t}addSignature(t,e,i,s){const{x:n,y:a}=this,{outline:r}=this.#so=t;this.#eo=r instanceof ContourDrawOutline;this.#io=i;this.div.setAttribute("data-l10n-args",JSON.stringify({description:i}));let o;if(this.#eo)o=SignatureEditor.getDefaultDrawingOptions();else{o=SignatureEditor._defaultDrawnSignatureOptions.clone();o.updateProperties({"stroke-width":r.thickness})}this._addOutlines({drawOutlines:r,drawingOptions:o});const[l,h]=this.parentDimensions,[,d]=this.pageDimensions;let c=e/d;c=c>=1?.5:c;this.width*=c/this.height;if(this.width>=1){c*=.9/this.width;this.width=.9}this.height=c;this.setDims(l*this.width,h*this.height);this.x=n;this.y=a;this.center();this._onResized();this.onScaleChanging();this.rotate();this._uiManager.addToAnnotationStorage(this);this.setUuid(s);this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!s,hasDescription:!!i}});this.div.hidden=!1}getFromImage(t){const{rawDims:{pageWidth:e,pageHeight:i},rotation:s}=this.parent.viewport;return SignatureExtractor.process(t,e,i,s,SignatureEditor._INNER_MARGIN)}getFromText(t,e){const{rawDims:{pageWidth:i,pageHeight:s},rotation:n}=this.parent.viewport;return SignatureExtractor.extractContoursFromText(t,e,i,s,n,SignatureEditor._INNER_MARGIN)}getDrawnSignature(t){const{rawDims:{pageWidth:e,pageHeight:i},rotation:s}=this.parent.viewport;return SignatureExtractor.processDrawnLines({lines:t,pageWidth:e,pageHeight:i,rotation:s,innerMargin:SignatureEditor._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:e}){if(t)this._drawingOptions=SignatureEditor.getDefaultDrawingOptions();else{this._drawingOptions=SignatureEditor._defaultDrawnSignatureOptions.clone();this._drawingOptions.updateProperties({"stroke-width":e})}}serialize(t=!1){if(this.isEmpty())return null;const{lines:e,points:i,rect:s}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":n}}=this,a={annotationType:u.SIGNATURE,isSignature:!0,areContours:this.#eo,color:[0,0,0],thickness:this.#eo?0:n,pageIndex:this.pageIndex,rect:s,rotation:this.rotation,structTreeParentId:this._structTreeParentId};if(t){a.paths={lines:e,points:i};a.uuid=this.#no;a.isCopy=!0}else a.lines=e;this.#io&&(a.accessibilityData={type:"Figure",alt:this.#io});return a}static deserializeDraw(t,e,i,s,n,a){return a.areContours?ContourDrawOutline.deserialize(t,e,i,s,n,a):InkDrawOutline.deserialize(t,e,i,s,n,a)}static async deserialize(t,e,i){const s=await super.deserialize(t,e,i);s.#eo=t.areContours;s.#io=t.accessibilityData?.alt||"";s.#no=t.uuid;return s}}class StampEditor extends AnnotationEditor{#ao=null;#ro=null;#oo=null;#lo=null;#ho=null;#do="";#co=null;#uo=!1;#po=null;#go=!1;#fo=!1;static _type="stamp";static _editorType=u.STAMP;constructor(t){super({...t,name:"stampEditor"});this.#lo=t.bitmapUrl;this.#ho=t.bitmapFile;this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,e){AnnotationEditor.initialize(t,e)}static isHandlingMimeForPasting(t){return G.includes(t)}static paste(t,e){e.pasteEditor(u.STAMP,{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1);super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(t){const e=t.get("hasAltText");return{hasAltText:e.get(!0)??0,hasNoAltText:e.get(!1)??0}}#mo(t,e=!1){if(t){this.#ao=t.bitmap;if(!e){this.#ro=t.id;this.#go=t.isSvg}t.file&&(this.#do=t.file.name);this.#bo()}else this.remove()}#Ao(){this.#oo=null;this._uiManager.enableWaiting(!1);if(this.#co)if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#ao){this._editToolbar.hide();this._uiManager.editAltText(this,!0)}else{if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#ao){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}async mlGuessAltText(t=null,e=!0){if(this.hasAltTextData())return null;const{mlManager:i}=this._uiManager;if(!i)throw new Error("No ML.");if(!await i.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:s,width:n,height:a}=t||this.copyCanvas(null,null,!0).imageData,r=await i.guess({name:"altText",request:{data:s,width:n,height:a,channels:s.length/(n*a)}});if(!r)throw new Error("No response from the AI service.");if(r.error)throw new Error("Error from the AI service.");if(r.cancel)return null;if(!r.output)throw new Error("No valid response from the AI service.");const o=r.output;await this.setGuessedAltText(o);e&&!this.hasAltTextData()&&(this.altTextData={alt:o,decorative:!1});return o}#wo(){if(this.#ro){this._uiManager.enableWaiting(!0);this._uiManager.imageManager.getFromId(this.#ro).then((t=>this.#mo(t,!0))).finally((()=>this.#Ao()));return}if(this.#lo){const t=this.#lo;this.#lo=null;this._uiManager.enableWaiting(!0);this.#oo=this._uiManager.imageManager.getFromUrl(t).then((t=>this.#mo(t))).finally((()=>this.#Ao()));return}if(this.#ho){const t=this.#ho;this.#ho=null;this._uiManager.enableWaiting(!0);this.#oo=this._uiManager.imageManager.getFromFile(t).then((t=>this.#mo(t))).finally((()=>this.#Ao()));return}const t=document.createElement("input");t.type="file";t.accept=G.join(",");const e=this._uiManager._signal;this.#oo=new Promise((i=>{t.addEventListener("change",(async()=>{if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);const e=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}});this.#mo(e)}else this.remove();i()}),{signal:e});t.addEventListener("cancel",(()=>{this.remove();i()}),{signal:e})})).finally((()=>this.#Ao()));t.click()}remove(){if(this.#ro){this.#ao=null;this._uiManager.imageManager.deleteId(this.#ro);this.#co?.remove();this.#co=null;if(this.#po){clearTimeout(this.#po);this.#po=null}}super.remove()}rebuild(){if(this.parent){super.rebuild();if(null!==this.div){this.#ro&&null===this.#co&&this.#wo();this.isAttachedToDOM||this.parent.add(this)}}else this.#ro&&this.#wo()}onceAdded(t){this._isDraggable=!0;t&&this.div.focus()}isEmpty(){return!(this.#oo||this.#ao||this.#lo||this.#ho||this.#ro||this.#uo)}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;if(this._isCopy){t=this.x;e=this.y}super.render();this.div.hidden=!0;this.addAltTextButton();this.#uo||(this.#ao?this.#bo():this.#wo());this._isCopy&&this._moveAfterPaste(t,e);this._uiManager.addShouldRescale(this);return this.div}setCanvas(t,e){const{id:i,bitmap:s}=this._uiManager.imageManager.getFromCanvas(t,e);e.remove();if(i&&this._uiManager.imageManager.isValidId(i)){this.#ro=i;s&&(this.#ao=s);this.#uo=!1;this.#bo()}}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;null!==this.#po&&clearTimeout(this.#po);this.#po=setTimeout((()=>{this.#po=null;this.#yo()}),200)}#bo(){const{div:t}=this;let{width:e,height:i}=this.#ao;const[s,n]=this.pageDimensions,a=.75;if(this.width){e=this.width*s;i=this.height*n}else if(e>a*s||i>a*n){const t=Math.min(a*s/e,a*n/i);e*=t;i*=t}const[r,o]=this.parentDimensions;this.setDims(e*r/s,i*o/n);this._uiManager.enableWaiting(!1);const l=this.#co=document.createElement("canvas");l.setAttribute("role","img");this.addContainer(l);this.width=e/s;this.height=i/n;this._initialOptions?.isCentered?this.center():this.fixAndSetPosition();this._initialOptions=null;this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&!this.annotationElementId||(t.hidden=!1);this.#yo();if(!this.#fo){this.parent.addUndoableEditor(this);this.#fo=!0}this._reportTelemetry({action:"inserted_image"});this.#do&&this.div.setAttribute("aria-description",this.#do)}copyCanvas(t,e,i=!1){t||(t=224);const{width:s,height:n}=this.#ao,a=new OutputScale;let r=this.#ao,o=s,l=n,h=null;if(e){if(s>e||n>e){const t=Math.min(e/s,e/n);o=Math.floor(s*t);l=Math.floor(n*t)}h=document.createElement("canvas");const t=h.width=Math.ceil(o*a.sx),i=h.height=Math.ceil(l*a.sy);this.#go||(r=this.#vo(t,i));const d=h.getContext("2d");d.filter=this._uiManager.hcmFilter;let c="white",u="#cfcfd8";if("none"!==this._uiManager.hcmFilter)u="black";else if(window.matchMedia?.("(prefers-color-scheme: dark)").matches){c="#8f8f9d";u="#42414d"}const p=15,g=p*a.sx,f=p*a.sy,m=new OffscreenCanvas(2*g,2*f),b=m.getContext("2d");b.fillStyle=c;b.fillRect(0,0,2*g,2*f);b.fillStyle=u;b.fillRect(0,0,g,f);b.fillRect(g,f,g,f);d.fillStyle=d.createPattern(m,"repeat");d.fillRect(0,0,t,i);d.drawImage(r,0,0,r.width,r.height,0,0,t,i)}let d=null;if(i){let e,i;if(a.symmetric&&r.width =w||c<0||c>=y?l<<=1:l=l<<1|r[o][c]}const g=k.readBit(C,l);t[s]=g}}return x}function decodeTextRegion(e,t,a,r,i,n,s,o,c,l,h,u,d,f,g,p,m,b,y){if(e&&t)throw new Jbig2Error("refinement with Huffman is not supported");const w=[];let S,x;for(S=0;Su&&"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){const t=s<=8?new Uint8Array(u):new Uint16Array(u);for(let e=0;e=.99554525?1:MathClamp(1.055*e**(1/2.4)-.055,0,1)}#p(e){return e<0?-this.#p(-e):e>8?((e+16)/116)**3:e*CalRGBCS.#h}#m(e,t,a){if(0===e[0]&&0===e[1]&&0===e[2]){a[0]=t[0];a[1]=t[1];a[2]=t[2];return}const r=this.#p(0),i=(1-r)/(1-this.#p(e[0])),n=1-i,s=(1-r)/(1-this.#p(e[1])),o=1-s,c=(1-r)/(1-this.#p(e[2])),l=1-c;a[0]=t[0]*i+n;a[1]=t[1]*s+o;a[2]=t[2]*c+l}#b(e,t,a){if(1===e[0]&&1===e[2]){a[0]=t[0];a[1]=t[1];a[2]=t[2];return}const r=a;this.#u(CalRGBCS.#r,t,r);const i=CalRGBCS.#o;this.#d(e,r,i);this.#u(CalRGBCS.#i,i,a)}#y(e,t,a){const r=a;this.#u(CalRGBCS.#r,t,r);const i=CalRGBCS.#o;this.#f(e,r,i);this.#u(CalRGBCS.#i,i,a)}#a(e,t,a,r,i){const n=MathClamp(e[t]*i,0,1),s=MathClamp(e[t+1]*i,0,1),o=MathClamp(e[t+2]*i,0,1),c=1===n?1:n**this.GR,l=1===s?1:s**this.GG,h=1===o?1:o**this.GB,u=this.MXA*c+this.MXB*l+this.MXC*h,d=this.MYA*c+this.MYB*l+this.MYC*h,f=this.MZA*c+this.MZB*l+this.MZC*h,g=CalRGBCS.#c;g[0]=u;g[1]=d;g[2]=f;const p=CalRGBCS.#l;this.#b(this.whitePoint,g,p);const m=CalRGBCS.#c;this.#m(this.blackPoint,p,m);const b=CalRGBCS.#l;this.#y(CalRGBCS.#s,m,b);const y=CalRGBCS.#c;this.#u(CalRGBCS.#n,b,y);a[r]=255*this.#g(y[0]);a[r+1]=255*this.#g(y[1]);a[r+2]=255*this.#g(y[2])}getRgbItem(e,t,a,r){this.#a(e,t,a,r,1)}getRgbBuffer(e,t,a,r,i,n,s){const o=1/((1<=0&&_=0;t--){d[t]=o[a];a=l[a]}}else d[f++]=d[0]}if(i){l[s]=u;c[s]=c[u]+1;o[s]=d[0];s++;h=s+n&s+n-1?h:0|Math.min(Math.log(s+n)/.6931471805599453+1,12)}u=e;g+=f;if(r127))){n=0;break}}if(2!==n)continue;if(!t){warn("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.");continue}const o=new Lexer(new Stream(e.peekBytes(75)),t);o._hexStringWarn=()=>{};let c=0;for(;;){const e=o.getObj();if(e===wa){n=0;break}if(e instanceof Cmd){const a=t[e.cmd];if(!a){n=0;break}if(a.variableArgs?c<=a.numArgs:c===a.numArgs)break;c=0}else c++}if(2===n)break}else n=0;if(-1===r){warn("findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker");if(i){warn('... trying to recover by using the last "EI" occurrence.');e.skip(-(e.pos-i))}}let s=4;e.skip(-s);r=e.peekByte();e.skip(s);isWhiteSpace(r)||s--;return e.pos-s-a}findDCTDecodeInlineStreamEnd(e){const t=e.pos;let a,r,i=!1;for(;-1!==(a=e.getByte());)if(255===a){switch(e.getByte()){case 0:break;case 255:e.skip(-1);break;case 217:i=!0;break;case 192:case 193:case 194:case 195:case 197:case 198:case 199:case 201:case 202:case 203:case 205:case 206:case 207:case 196:case 204:case 218:case 219:case 220:case 221:case 222:case 223:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:r=e.getUint16();r>2?e.skip(r-2):e.skip(-2)}if(i)break}const n=e.pos-t;if(-1===a){warn("Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead.");e.skip(-n);return this.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);return n}findASCII85DecodeInlineStreamEnd(e){const t=e.pos;let a;for(;-1!==(a=e.getByte());)if(126===a){const t=e.pos;a=e.peekByte();for(;isWhiteSpace(a);){e.skip();a=e.peekByte()}if(62===a){e.skip();break}if(e.pos>t){const t=e.peekBytes(2);if(69===t[0]&&73===t[1])break}}const r=e.pos-t;if(-1===a){warn("Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead.");e.skip(-r);return this.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);return r}findASCIIHexDecodeInlineStreamEnd(e){const t=e.pos;let a;for(;-1!==(a=e.getByte())&&62!==a;);const r=e.pos-t;if(-1===a){warn("Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead.");e.skip(-r);return this.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);return r}inlineStreamSkipEI(e){let t,a=0;for(;-1!==(t=e.getByte());)if(0===a)a=69===t?1:0;else if(1===a)a=73===t?2:0;else if(2===a)break}makeInlineImage(e){const t=this.lexer,a=t.stream,r=Object.create(null);let i;for(;!isCmd(this.buf1,"ID")&&this.buf1!==wa;){if(!(this.buf1 instanceof Name))throw new FormatError("Dictionary key must be a name object");const t=this.buf1.name;this.shift();if(this.buf1===wa)break;r[t]=this.getObj(e)}-1!==t.beginInlineImagePos&&(i=a.pos-t.beginInlineImagePos);const n=this.xref.fetchIfRef(r.F||r.Filter);let s;if(n instanceof Name)s=n.name;else if(Array.isArray(n)){const e=this.xref.fetchIfRef(n[0]);e instanceof Name&&(s=e.name)}const o=a.pos;let c,l;switch(s){case"DCT":case"DCTDecode":c=this.findDCTDecodeInlineStreamEnd(a);break;case"A85":case"ASCII85Decode":c=this.findASCII85DecodeInlineStreamEnd(a);break;case"AHx":case"ASCIIHexDecode":c=this.findASCIIHexDecodeInlineStreamEnd(a);break;default:c=this.findDefaultInlineStreamEnd(a)}if(c<1e3&&i>0){const e=a.pos;a.pos=t.beginInlineImagePos;l=function getInlineImageCacheKey(e){const t=[],a=e.length;let r=0;for(;r=4){i-=4;if(this.seacAnalysisEnabled){e.seac=n.slice(i,i+4);return!1}}l=Gr[c]}else if(c>=32&&c<=246){n[i]=c-139;i++}else if(c>=247&&c<=254){n[i]=c<251?(c-247<<8)+t[o]+108:-(c-251<<8)-t[o]-108;o++;i++}else if(255===c){n[i]=(t[o]<<24|t[o+1]<<16|t[o+2]<<8|t[o+3])/65536;o+=4;i++}else if(19===c||20===c){e.hints+=i>>1;if(0===e.hints){t.copyWithin(o-1,o,-1);o-=1;s-=1;continue}o+=e.hints+7>>3;i%=2;l=Gr[c]}else{if(10===c||29===c){const t=10===c?a:r;if(!t){l=Gr[c];warn("Missing subrsIndex for "+l.id);return!1}let s=32768;t.count<1240?s=107:t.count<33900&&(s=1131);const o=n[--i]+s;if(o<0||o>=t.count||isNaN(o)){l=Gr[c];warn("Out of bounds subrIndex for "+l.id);return!1}e.stackSize=i;e.callDepth++;if(!this.parseCharString(e,t.get(o),a,r))return!1;e.callDepth--;i=e.stackSize;continue}if(11===c){e.stackSize=i;return!0}if(0===c&&o===t.length){t[o-1]=14;l=Gr[14]}else{if(9===c){t.copyWithin(o-1,o,-1);o-=1;s-=1;continue}l=Gr[c]}}if(l){if(l.stem){e.hints+=i>>1;if(3===c||23===c)e.hasVStems=!0;else if(e.hasVStems&&(1===c||18===c)){warn("CFF stem hints are in wrong order");t[o-1]=1===c?3:23}}if("min"in l&&!e.undefStack&&i0){w+="ÿÿ";y+="ÿÿ";S+="\0";x+="\0\0"}const v="\0\0"+string16(2*d)+string16(f.range)+string16(f.entry)+string16(f.rangeShift)+w+"\0\0"+y+S+x+k;let F="",O="";if(i>1){l+="\0\0\n"+string32(4+8*i+4+v.length);F="";for(n=0,s=r.length;ne||!o)&&(o=e);c