@pretextbook/import 0.7.0 → 0.8.0

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.
@@ -1 +1 @@
1
- "use strict";const n=require("./upload-CGxfSSDN.cjs");function f(e){if(e.type!=="result"||"pretextError"in e.result)return[];const t=e.result,o=new Set,s=r=>{const c=r?.buffer;c instanceof ArrayBuffer&&o.add(c)};return Object.values(t.assets??{}).forEach(s),Object.values(t.outputAssets??{}).forEach(s),t.project?.assets?.forEach(r=>s(r.data)),t.nativeProject?.assets?.forEach(r=>s(r.data)),[...o]}function u(e){self.postMessage(e,f(e))}self.onmessage=e=>{const t=e.data;if(t?.type!=="convert")return;const{requestId:o,files:s,assets:r,options:c}=t;try{const a=n.importProjectFromFiles(s,{...c,assets:r});u({type:"result",requestId:o,result:a})}catch(a){u({type:"error",requestId:o,message:a instanceof Error?a.message:"An unexpected error occurred."})}};
1
+ "use strict";const n=require("./upload-BtS22hIH.cjs");function f(e){if(e.type!=="result"||"pretextError"in e.result)return[];const t=e.result,o=new Set,s=r=>{const c=r?.buffer;c instanceof ArrayBuffer&&o.add(c)};return Object.values(t.assets??{}).forEach(s),Object.values(t.outputAssets??{}).forEach(s),t.project?.assets?.forEach(r=>s(r.data)),t.nativeProject?.assets?.forEach(r=>s(r.data)),[...o]}function u(e){self.postMessage(e,f(e))}self.onmessage=e=>{const t=e.data;if(t?.type!=="convert")return;const{requestId:o,files:s,assets:r,options:c}=t;try{const a=n.importProjectFromFiles(s,{...c,assets:r});u({type:"result",requestId:o,result:a})}catch(a){u({type:"error",requestId:o,message:a instanceof Error?a.message:"An unexpected error occurred."})}};
@@ -1,4 +1,4 @@
1
- import { T as n } from "./upload-BBHV4rXJ.js";
1
+ import { T as n } from "./upload-BmErkg8I.js";
2
2
  function u(e) {
3
3
  if (e.type !== "result" || "pretextError" in e.result)
4
4
  return [];
@@ -1,4 +1,4 @@
1
- import { X as p, a4 as h } from "./upload-BBHV4rXJ.js";
1
+ import { X as p, a4 as h } from "./upload-BmErkg8I.js";
2
2
  function u(e, i) {
3
3
  const n = e.length === 0 ? [] : e.split(`
4
4
  `), o = i.length === 0 ? [] : i.split(`
@@ -1,3 +1,3 @@
1
- "use strict";const p=require("./upload-CGxfSSDN.cjs");function h(e,i){const o=e.length===0?[]:e.split(`
1
+ "use strict";const p=require("./upload-BtS22hIH.cjs");function h(e,i){const o=e.length===0?[]:e.split(`
2
2
  `),n=i.length===0?[]:i.split(`
3
3
  `);if(o.length+n.length>m)return[...o.map((s,f)=>({op:"remove",text:s,beforeLine:f+1})),...n.map((s,f)=>({op:"add",text:s,afterLine:f+1}))];const c=Array.from({length:o.length+1},()=>new Array(n.length+1).fill(0));for(let s=o.length-1;s>=0;s--)for(let f=n.length-1;f>=0;f--)c[s][f]=o[s]===n[f]?c[s+1][f+1]+1:Math.max(c[s+1][f],c[s][f+1]);const a=[];let t=0,r=0;for(;t<o.length&&r<n.length;)o[t]===n[r]?(a.push({op:"keep",text:o[t],beforeLine:t+1,afterLine:r+1}),t++,r++):c[t+1][r]>=c[t][r+1]?(a.push({op:"remove",text:o[t],beforeLine:t+1}),t++):(a.push({op:"add",text:n[r],afterLine:r+1}),r++);for(;t<o.length;)a.push({op:"remove",text:o[t],beforeLine:++t});for(;r<n.length;)a.push({op:"add",text:n[r],afterLine:++r});return a}const m=2e4;function u(e){let i=0,o=0;for(const n of e)n.op==="add"?i++:n.op==="remove"&&o++;return{added:i,removed:o}}function d(e,i=2){const o=e.map((t,r)=>t.op==="keep"?-1:r).filter(t=>t>=0);if(o.length===0)return[];const n=[];let c=Math.max(0,o[0]-i),a=Math.min(e.length-1,o[0]+i);for(const t of o.slice(1)){if(t-i<=a+1){a=Math.min(e.length-1,t+i);continue}n.push({lines:e.slice(c,a+1)}),c=Math.max(0,t-i),a=Math.min(e.length-1,t+i)}return n.push({lines:e.slice(c,a+1)}),n}function g(e,i=e.splitLevel){if(e.cleanChunks.length===0)return[];const o=p.mergeChunksAtLevel(e.cleanChunks,i),n=L(o),{pathByRef:c}=p.serializeProjectToFiles(e.project,{mainSourcePath:e.projectLayout.mainSourcePath,publicationPath:e.projectLayout.publicationPath,projectFilePath:e.projectLayout.projectFilePath,includeScaffold:!e.projectLayout.preserved}),a=[];for(const t of e.project.divisions){const r=c[t.xmlId];if(!r)continue;const s=t.isRoot?o.find(l=>l.kind==="preamble"||l.kind==="lead"):n.get(t.title);if(!s)continue;const f=h(s.before,s.after);a.push({path:r,title:t.title,before:s.before,after:s.after,stats:u(f),hunks:d(f),fixCount:s.fixes.length})}return a.sort((t,r)=>t.path.localeCompare(r.path))}function L(e){const i=new Map;for(const n of e)n.kind!=="division"||!n.title||i.set(n.title,i.has(n.title)?null:n);const o=new Map;for(const[n,c]of i)c&&o.set(n,c);return o}function v(e,i){return i==="native"?e.nativeProject??e.project:e.project}function j(e,i){return i==="converted"?e.outputFiles:e.nativeOutputFiles??e.files}function k(e,i){return i==="converted"?e.outputAssets:e.assets}function F(e){const i=e.action==="replace"||e.action==="rewrite"?`replaced with \`${e.replacement}\``:e.message??e.action,o=e.occurrences>1?` (x${e.occurrences})`:"";return`[${e.severity}] ${e.macro}: ${i}${o}`}exports.assetsForImportMode=k;exports.diffHunks=d;exports.diffLines=h;exports.diffStats=u;exports.fileChangesForImport=g;exports.filesForImportMode=j;exports.formatWarningLine=F;exports.projectForImportMode=v;
package/dist/index.cjs CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./upload-CGxfSSDN.cjs"),g=require("./import-mode-YW6Lr4SU.cjs"),I={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",pdf:"application/pdf",eps:"application/postscript",ps:"application/postscript",bmp:"image/bmp",tiff:"image/tiff",tif:"image/tiff",webp:"image/webp",ico:"image/vnd.microsoft.icon"};function b(t){const o=t.split(".").pop()?.toLowerCase()??"";return I[o]??"application/octet-stream"}const h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function A(t){const o=t.length,s=[];for(let n=0;n<o;n+=3){const r=t[n],l=n+1<o,a=n+2<o,u=l?t[n+1]:0,c=a?t[n+2]:0;s.push(h[r>>2]),s.push(h[(r&3)<<4|u>>4]),s.push(l?h[(u&15)<<2|c>>6]:"="),s.push(a?h[c&63]:"=")}return s.join("")}function M(t){return{ref:t.ref,kind:"file",title:t.fileName,short_description:t.fileName,file:{filename:t.fileName,content_type:b(t.fileName),data:A(t.data)}}}function _(t){return{title:t.title,docinfo:t.docinfo,document_type:t.documentKind,divisions_attributes:t.divisions.map(o=>({ref:o.xmlId,source:o.content,source_format:o.sourceFormat,is_root:o.isRoot})),assets_attributes:t.assets.map(M)}}const v={mainSourcePath:"source/main.ptx",publicationPath:"publication/publication.ptx",projectFilePath:"project.ptx",docinfoPath:"source/docinfo.ptx"};function T(t){return e.findAnyElement(t,"pretext")?t:`<pretext>
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./upload-BtS22hIH.cjs"),g=require("./import-mode-D1gOJw3N.cjs"),I={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",pdf:"application/pdf",eps:"application/postscript",ps:"application/postscript",bmp:"image/bmp",tiff:"image/tiff",tif:"image/tiff",webp:"image/webp",ico:"image/vnd.microsoft.icon"};function b(t){const o=t.split(".").pop()?.toLowerCase()??"";return I[o]??"application/octet-stream"}const h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function A(t){const o=t.length,s=[];for(let n=0;n<o;n+=3){const r=t[n],l=n+1<o,a=n+2<o,u=l?t[n+1]:0,c=a?t[n+2]:0;s.push(h[r>>2]),s.push(h[(r&3)<<4|u>>4]),s.push(l?h[(u&15)<<2|c>>6]:"="),s.push(a?h[c&63]:"=")}return s.join("")}function M(t){return{ref:t.ref,kind:"file",title:t.fileName,short_description:t.fileName,file:{filename:t.fileName,content_type:b(t.fileName),data:A(t.data)}}}function _(t){return{title:t.title,docinfo:t.docinfo,document_type:t.documentKind,divisions_attributes:t.divisions.map(o=>({ref:o.xmlId,source:o.content,source_format:o.sourceFormat,is_root:o.isRoot})),assets_attributes:t.assets.map(M)}}const v={mainSourcePath:"source/main.ptx",publicationPath:"publication/publication.ptx",projectFilePath:"project.ptx",docinfoPath:"source/docinfo.ptx"};function T(t){return e.findAnyElement(t,"pretext")?t:`<pretext>
2
2
  ${t}
3
3
  </pretext>`}function L(t,o,s){const n=new Map,r=[],l=`${o}-`;return t.forEach((a,u)=>{const c=a.attributes["xml:id"];let p;if(c){const m=e.slugify(c);p=m.startsWith(l)?m:`${l}${m}`}else p=`${l}${e.padIndex(u+1,t.length)}`,s.push({action:"anomaly",severity:"info",kind:"structure",category:"missing_xml_id",macro:a.name,occurrences:1,message:`<${a.name}> at position ${u+1} has no xml:id; using \`${p}\` as filename.`});const d=n.get(p)??0;n.set(p,d+1);const i=d===0?p:`${p}-${d+1}`;r.push({span:a,slug:i,filename:`${i}.ptx`})}),r}function C(t,o,s,n){const r=e.findTopLevelElements(t,"section");if(r.length===0)return t;const a=L(r,"sec",n).map(u=>{const c=`source/${o}/${u.filename}`;return s[c]=e.withProlog(u.span.outer),{start:u.span.start,end:u.span.end,replacement:`<xi:include href="${o}/${u.filename}"/>`}});return e.spliceReplacements(t,a)}function R(t,o,s){const n=e.findAnyElement(t,"book");if(!n)return s.push({action:"anomaly",severity:"warning",kind:"structure",category:"missing_root",macro:"book",occurrences:1,message:"Document was treated as a book but no <book> element found; emitting as a single file."}),S(t,o);const r={},l=e.findTopLevelElements(n.inner,"chapter");let a=n.inner;if(o.splitChapters&&l.length>0){const d=L(l,"ch",s).map(i=>{let m=i.span.outer;if(o.splitSections){const f=i.span.inner,P=C(f,i.slug,r,s);m=i.span.outer.slice(0,i.span.startTagEnd-i.span.start)+P+i.span.outer.slice(i.span.contentEnd-i.span.start)}const x=`source/${i.filename}`;return r[x]=e.withProlog(m),{start:i.span.start,end:i.span.end,replacement:`<xi:include href="${i.filename}"/>`}});a=e.spliceReplacements(n.inner,d)}const u=t.slice(n.start,n.startTagEnd)+a+t.slice(n.contentEnd,n.end),c=t.slice(0,n.start)+u+t.slice(n.end);return r[o.mainSourcePath]=e.withProlog(e.ensureXIncludeNamespace(T(c.trim()))),r}function S(t,o,s){const n={};return n[o.mainSourcePath]=e.withProlog(T(t.trim())),n}function y(t,o={}){const s=[],n=o.documentKind??e.detectDocumentKind(t),r={splitChapters:o.splitChapters??n==="book",splitSections:o.splitSections??!1,mainSourcePath:o.mainSourcePath??v.mainSourcePath,publicationPath:o.publicationPath??v.publicationPath,projectFilePath:o.projectFilePath??v.projectFilePath,docinfoPath:o.docinfoPath??v.docinfoPath},l=n==="book"?R(t,r,s):S(t,r);return l[r.projectFilePath]=e.renderProjectPtx({mainSource:r.mainSourcePath,publication:r.publicationPath}),l[r.publicationPath]=e.renderPublicationPtx(),{files:l,documentKind:n,warnings:s}}class E extends Error{constructor(){super("Import cancelled."),this.name="ConversionCancelledError"}}let j=0;function F(t,o,s={}){const n=`convert-${j++}`,r=t(),{assets:l={},...a}=s;let u;const c=new Promise((d,i)=>{let m=!1;const x=f=>{m||(m=!0,r.terminate(),f())};u=()=>x(()=>i(new E)),r.addEventListener("message",f=>{const P=f.data;if(!(!P||P.requestId!==n)){if(P.type==="result"){x(()=>d(P.result));return}x(()=>i(new Error(P.message)))}}),r.addEventListener("error",f=>{const P=typeof f=="object"&&f&&"message"in f?String(f.message):"The import worker failed to start.";x(()=>i(new Error(P)))})}),p=[...new Set(Object.values(l).map(d=>d.buffer).filter(d=>d instanceof ArrayBuffer))];return r.postMessage({type:"convert",requestId:n,files:o,assets:l,options:a},p),{result:c,cancel:()=>u?.()}}function k(t){const{createWorker:o,id:s="worker",label:n="Built-in converter",description:r="Create a new project starting with LaTeX, Markdown, or PreTeXt files.",acceptExtensions:l}=t;let a=null;const u=async(c,p)=>{a?.cancel(),a=F(o,c,p);try{return await a.result}finally{a=null}};return{id:s,label:n,description:r,acceptExtensions:l,prepare:async c=>{const{files:p,assets:d}=await e.extractUpload(c);return{fileName:c.name,files:p,assets:d,analysis:e.analyzeImportSources(p)}},convertPrepared:(c,p)=>u(c.files,{...p,assets:c.assets}),convertFile:async(c,p)=>{const{files:d,assets:i}=await e.extractUpload(c);return u(d,{...p,assets:i})},cancel:()=>{a?.cancel(),a=null}}}exports.CLEAN_RULES=e.CLEAN_RULES;exports.LATEX_DIVISION_COMMANDS=e.LATEX_DIVISION_COMMANDS;exports.LATEX_FORMAT_MARKERS=e.LATEX_FORMAT_MARKERS;exports.MARKDOWN_FORMAT_MARKERS=e.MARKDOWN_FORMAT_MARKERS;exports.MAX_SUGGESTED_SPLIT_LEVEL=e.MAX_SUGGESTED_SPLIT_LEVEL;exports.PRETEXT_DIVISION_TAGS=e.PRETEXT_DIVISION_TAGS;exports.PRETEXT_ROOT_TAGS=e.PRETEXT_ROOT_TAGS;exports.analyzeImportSources=e.analyzeImportSources;exports.applyLatexFixes=e.applyLatexFixes;exports.attachLatexRoots=e.attachLatexRoots;exports.attachMarkdownRoots=e.attachMarkdownRoots;exports.buildDivisionPool=e.buildDivisionPool;exports.buildNativeDivisionPool=e.buildNativeDivisionPool;exports.carryOverProjectFiles=e.carryOverProjectFiles;exports.cleanLatex=e.cleanLatex;exports.cleanLatexInChunks=e.cleanLatexInChunks;exports.cleanLatexText=e.cleanLatexText;exports.convertLatexToPretext=e.convertLatexToPretext;exports.convertMarkdownToPretext=e.convertMarkdownToPretext;exports.convertSourceToPretext=e.convertSourceToPretext;exports.defaultAttachLevel=e.defaultAttachLevel;exports.defaultManifestTarget=e.defaultManifestTarget;exports.detectDocumentKind=e.detectDocumentKind;exports.detectSourceFormat=e.detectSourceFormat;exports.divisionChildRefs=e.divisionChildRefs;exports.divisionsAtLevel=e.divisionsAtLevel;exports.expandPretextIncludes=e.expandPretextIncludes;exports.extractUpload=e.extractUpload;exports.filePrefixForDivision=e.filePrefixForDivision;exports.findLatexFixes=e.findLatexFixes;exports.findLatexHeaders=e.findLatexHeaders;exports.findProjectManifest=e.findProjectManifest;exports.fixesToWarnings=e.fixesToWarnings;exports.getConversionErrorMessage=e.getConversionErrorMessage;exports.getLatexCleanDiagnostics=e.getLatexCleanDiagnostics;exports.handleImportUploadFile=e.handleImportUploadFile;exports.importProjectFromFiles=e.importProjectFromFiles;exports.isDivisionTag=e.isDivisionTag;exports.latexDivisionHierarchy=e.latexDivisionHierarchy;exports.latexFixesToCodeActions=e.latexFixesToCodeActions;exports.mergeChunksAtLevel=e.mergeChunksAtLevel;exports.normalizePretextSource=e.normalizePretextSource;exports.parseLatexDivisions=e.parseLatexDivisions;exports.parseProjectManifest=e.parseProjectManifest;exports.relayoutImport=e.relayoutImport;exports.renderProjectPtx=e.renderProjectPtx;exports.renderProjectPtxFromManifest=e.renderProjectPtxFromManifest;exports.renderPublicationPtx=e.renderPublicationPtx;exports.resolveImportSplitLevel=e.resolveImportSplitLevel;exports.resolveSplitLevel=e.resolveSplitLevel;exports.sanitizeRef=e.sanitizeRef;exports.serializeProjectToFiles=e.serializeProjectToFiles;exports.suggestSplitLevel=e.suggestSplitLevel;exports.assetsForImportMode=g.assetsForImportMode;exports.diffHunks=g.diffHunks;exports.diffLines=g.diffLines;exports.diffStats=g.diffStats;exports.fileChangesForImport=g.fileChangesForImport;exports.filesForImportMode=g.filesForImportMode;exports.formatWarningLine=g.formatWarningLine;exports.projectForImportMode=g.projectForImportMode;exports.ConversionCancelledError=E;exports.buildPretextProjectFiles=y;exports.createWorkerEngine=k;exports.runConversionInWorker=F;exports.serializeProjectToPlusPayload=_;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { d as w, r as I, a as _, f as E, b as T, w as x, s as v, e as C, c as k, p as y, g as b, h as A } from "./upload-BBHV4rXJ.js";
2
- import { C as q, L as V, i as Y, M as J, j as Q, P as Z, k as ee, l as te, m as se, n as ne, o as ae, q as oe, t as re, u as ie, v as ce, x as le, y as ue, z as pe, A as fe, B as me, D as de, E as ge, F as Pe, G as he, H as xe, I as be, J as Ee, K as Te, N as ve, O as Se, Q as Le, R as Fe, S as we, T as Ie, U as _e, V as Ce, W as ke, X as ye, Y as Ae, Z as Me, _ as je, $ as Re, a0 as $e, a1 as De, a2 as Ne, a3 as Oe, a4 as Be, a5 as We } from "./upload-BBHV4rXJ.js";
3
- import { a as Ke, d as ze, b as Ue, c as Ge, f as He, e as qe, g as Ve, p as Ye } from "./import-mode-GqdypBfV.js";
1
+ import { d as w, r as I, a as _, f as E, b as T, w as x, s as v, e as C, c as k, p as y, g as b, h as A } from "./upload-BmErkg8I.js";
2
+ import { C as q, L as V, i as Y, M as J, j as Q, P as Z, k as ee, l as te, m as se, n as ne, o as ae, q as oe, t as re, u as ie, v as ce, x as le, y as ue, z as pe, A as fe, B as me, D as de, E as ge, F as Pe, G as he, H as xe, I as be, J as Ee, K as Te, N as ve, O as Se, Q as Le, R as Fe, S as we, T as Ie, U as _e, V as Ce, W as ke, X as ye, Y as Ae, Z as Me, _ as je, $ as Re, a0 as $e, a1 as De, a2 as Ne, a3 as Oe, a4 as Be, a5 as We } from "./upload-BmErkg8I.js";
3
+ import { a as Ke, d as ze, b as Ue, c as Ge, f as He, e as qe, g as Ve, p as Ye } from "./import-mode-BCGuSwkM.js";
4
4
  const M = {
5
5
  png: "image/png",
6
6
  jpg: "image/jpeg",
@@ -1,3 +1,4 @@
1
+ import { CleaningWarning } from './warnings';
1
2
  export interface PreambleInfo {
2
3
  /** Argument of \documentclass{...}, e.g. "book" or "article". Defaults to "article". */
3
4
  documentClass: string;
@@ -5,7 +6,7 @@ export interface PreambleInfo {
5
6
  title: string;
6
7
  /** Inner content of \author{...}, or empty string. */
7
8
  author: string;
8
- /** Collected \newcommand / \renewcommand / \DeclareMathOperator definitions. */
9
+ /** Collected \newcommand / \renewcommand / \DeclareMathOperator / \def definitions. */
9
10
  macros: string;
10
11
  }
11
12
  export declare function splitLatexAtDocument(source: string): {
@@ -18,10 +19,26 @@ export declare function splitLatexAtDocument(source: string): {
18
19
  * Returns the inner content (without surrounding braces), or "".
19
20
  */
20
21
  export declare function extractLatexField(source: string, cmdName: string): string;
22
+ export interface ExtractMacrosResult {
23
+ /** Collected macro definitions, joined with newlines. */
24
+ macros: string;
25
+ /** One warning summarizing any `\def` blocks found (empty if none). */
26
+ warnings: CleaningWarning[];
27
+ }
21
28
  /**
22
29
  * Collects LaTeX macro definition lines from `preamble`, including multi-line
23
30
  * definitions (tracks brace depth to know when a definition is complete).
24
- * Returns the collected definitions joined with newlines.
31
+ *
32
+ * `\def` is kept verbatim alongside `\newcommand` et al. — rewriting its
33
+ * syntax isn't safe in general (delimited parameter text, `\global`/`\edef`
34
+ * semantics, and no way to tell here whether it's redefining an existing
35
+ * command, which would make a mechanical `\newcommand` rewrite fail to
36
+ * build) — but it's reported as a warning, since PreTeXt tooling downstream
37
+ * (e.g. WeBWorK/PG macro extraction) only recognises `\newcommand`.
25
38
  */
26
- export declare function extractMacros(preamble: string): string;
27
- export declare function extractPreambleInfo(preamble: string): PreambleInfo;
39
+ export declare function extractMacros(preamble: string): ExtractMacrosResult;
40
+ export interface ExtractPreambleInfoResult {
41
+ info: PreambleInfo;
42
+ warnings: CleaningWarning[];
43
+ }
44
+ export declare function extractPreambleInfo(preamble: string): ExtractPreambleInfoResult;
package/dist/react.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),F=require("./upload-CGxfSSDN.cjs"),me=require("./import-mode-YW6Lr4SU.cjs");var de={exports:{}},re={};var he;function Se(){if(he)return re;he=1;var r=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function p(b,g,i){var v=null;if(i!==void 0&&(v=""+i),g.key!==void 0&&(v=""+g.key),"key"in g){i={};for(var N in g)N!=="key"&&(i[N]=g[N])}else i=g;return g=i.ref,{$$typeof:r,type:b,key:v,ref:g!==void 0?g:null,props:i}}return re.Fragment=u,re.jsx=p,re.jsxs=p,re}var ae={};var be;function we(){return be||(be=1,process.env.NODE_ENV!=="production"&&(function(){function r(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Y?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case I:return"Fragment";case W:return"Profiler";case P:return"StrictMode";case ne:return"Suspense";case ue:return"SuspenseList";case le:return"Activity"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case A:return"Portal";case E:return t.displayName||"Context";case f:return(t._context.displayName||"Context")+".Consumer";case O:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Z:return a=t.displayName||null,a!==null?a:r(t.type)||"Memo";case U:a=t._payload,t=t._init;try{return r(t(a))}catch{}}return null}function u(t){return""+t}function p(t){try{u(t);var a=!1}catch{a=!0}if(a){a=console;var x=a.error,m=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return x.call(a,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",m),u(t)}}function b(t){if(t===I)return"<>";if(typeof t=="object"&&t!==null&&t.$$typeof===U)return"<...>";try{var a=r(t);return a?"<"+a+">":"<...>"}catch{return"<...>"}}function g(){var t=K.A;return t===null?null:t.getOwner()}function i(){return Error("react-stack-top-frame")}function v(t){if(Q.call(t,"key")){var a=Object.getOwnPropertyDescriptor(t,"key").get;if(a&&a.isReactWarning)return!1}return t.key!==void 0}function N(t,a){function x(){D||(D=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",a))}x.isReactWarning=!0,Object.defineProperty(t,"key",{get:x,configurable:!0})}function h(){var t=r(this.type);return V[t]||(V[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),t=this.props.ref,t!==void 0?t:null}function _(t,a,x,m,$,G){var j=x.ref;return t={$$typeof:k,type:t,key:a,props:x,_owner:m},(j!==void 0?j:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:h}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(t,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:$}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:G}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function S(t,a,x,m,$,G){var j=a.children;if(j!==void 0)if(m)if(ee(j)){for(m=0;m<j.length;m++)C(j[m]);Object.freeze&&Object.freeze(j)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else C(j);if(Q.call(a,"key")){j=r(t);var X=Object.keys(a).filter(function(se){return se!=="key"});m=0<X.length?"{key: someKey, "+X.join(": ..., ")+": ...}":"{key: someKey}",R[j+m]||(X=0<X.length?"{"+X.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),F=require("./upload-BtS22hIH.cjs"),me=require("./import-mode-D1gOJw3N.cjs");var de={exports:{}},re={};var he;function Se(){if(he)return re;he=1;var r=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function p(b,g,i){var v=null;if(i!==void 0&&(v=""+i),g.key!==void 0&&(v=""+g.key),"key"in g){i={};for(var N in g)N!=="key"&&(i[N]=g[N])}else i=g;return g=i.ref,{$$typeof:r,type:b,key:v,ref:g!==void 0?g:null,props:i}}return re.Fragment=u,re.jsx=p,re.jsxs=p,re}var ae={};var be;function we(){return be||(be=1,process.env.NODE_ENV!=="production"&&(function(){function r(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Y?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case I:return"Fragment";case W:return"Profiler";case P:return"StrictMode";case ne:return"Suspense";case ue:return"SuspenseList";case le:return"Activity"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case A:return"Portal";case E:return t.displayName||"Context";case f:return(t._context.displayName||"Context")+".Consumer";case O:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Z:return a=t.displayName||null,a!==null?a:r(t.type)||"Memo";case U:a=t._payload,t=t._init;try{return r(t(a))}catch{}}return null}function u(t){return""+t}function p(t){try{u(t);var a=!1}catch{a=!0}if(a){a=console;var x=a.error,m=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return x.call(a,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",m),u(t)}}function b(t){if(t===I)return"<>";if(typeof t=="object"&&t!==null&&t.$$typeof===U)return"<...>";try{var a=r(t);return a?"<"+a+">":"<...>"}catch{return"<...>"}}function g(){var t=K.A;return t===null?null:t.getOwner()}function i(){return Error("react-stack-top-frame")}function v(t){if(Q.call(t,"key")){var a=Object.getOwnPropertyDescriptor(t,"key").get;if(a&&a.isReactWarning)return!1}return t.key!==void 0}function N(t,a){function x(){D||(D=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",a))}x.isReactWarning=!0,Object.defineProperty(t,"key",{get:x,configurable:!0})}function h(){var t=r(this.type);return V[t]||(V[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),t=this.props.ref,t!==void 0?t:null}function _(t,a,x,m,$,G){var j=x.ref;return t={$$typeof:k,type:t,key:a,props:x,_owner:m},(j!==void 0?j:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:h}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(t,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:$}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:G}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function S(t,a,x,m,$,G){var j=a.children;if(j!==void 0)if(m)if(ee(j)){for(m=0;m<j.length;m++)C(j[m]);Object.freeze&&Object.freeze(j)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else C(j);if(Q.call(a,"key")){j=r(t);var X=Object.keys(a).filter(function(se){return se!=="key"});m=0<X.length?"{key: someKey, "+X.join(": ..., ")+": ...}":"{key: someKey}",R[j+m]||(X=0<X.length?"{"+X.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
package/dist/react.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import Te, { useState as h, useRef as ue, useEffect as ke, useMemo as ae } from "react";
2
- import { S as Ne, $ as Se, j as Pe, T as Ce, g as Re, h as ye, E as _e, A as Ae } from "./upload-BBHV4rXJ.js";
3
- import { f as Fe, e as he } from "./import-mode-GqdypBfV.js";
2
+ import { S as Ne, $ as Se, j as Pe, T as Ce, g as Re, h as ye, E as _e, A as Ae } from "./upload-BmErkg8I.js";
3
+ import { f as Fe, e as he } from "./import-mode-BCGuSwkM.js";
4
4
  var de = { exports: {} }, re = {};
5
5
  var be;
6
6
  function Oe() {