2024-10-05 01:01:51 -05:00
"use strict" ; var dl = e => { throw TypeError ( e ) } ; var bl = ( e , l , t ) => l . has ( e ) || dl ( "Cannot " + t ) ; var gl = ( e , l , t ) => ( bl ( e , l , "read from private field" ) , t ? t . call ( e ) : l . get ( e ) ) , Zl = ( e , l , t ) => l . has ( e ) ? dl ( "Cannot add the same private member more than once" ) : l instanceof WeakSet ? l . add ( e ) : l . set ( e , t ) , ml = ( e , l , t , n ) => ( bl ( e , l , "write to private field" ) , n ? n . call ( e , t ) : l . set ( e , t ) , t ) ; / * !
2024-06-28 02:13:12 -05:00
THIS IS A GENERATED / BUNDLED FILE BY ESBUILD
if you want to view the source , please visit the github repository https : //github.com/mokeyish/obsidian-enhancing-export .
2024-10-05 01:01:51 -05:00
* / O b j e c t . d e f i n e P r o p e r t i e s ( e x p o r t s , { _ _ e s M o d u l e : { v a l u e : ! 0 } , [ S y m b o l . t o S t r i n g T a g ] : { v a l u e : " M o d u l e " } } ) ; c o n s t I e = r e q u i r e ( " o b s i d i a n " ) , w n = r e q u i r e ( " c h i l d _ p r o c e s s " ) , p t = r e q u i r e ( " p r o c e s s " ) , P l = r e q u i r e ( " e l e c t r o n " ) , D l = r e q u i r e ( " f s " ) , a e = r e q u i r e ( " p a t h " ) , S n = r e q u i r e ( " u t i l " ) ; f u n c t i o n D t ( e ) { c o n s t l = O b j e c t . c r e a t e ( n u l l , { [ S y m b o l . t o S t r i n g T a g ] : { v a l u e : " M o d u l e " } } ) ; i f ( e ) { f o r ( c o n s t t i n e ) i f ( t ! = = " d e f a u l t " ) { c o n s t n = O b j e c t . g e t O w n P r o p e r t y D e s c r i p t o r ( e , t ) ; O b j e c t . d e f i n e P r o p e r t y ( l , t , n . g e t ? n : { e n u m e r a b l e : ! 0 , g e t : ( ) = > e [ t ] } ) } } r e t u r n l . d e f a u l t = e , O b j e c t . f r e e z e ( l ) } c o n s t E n = D t ( I e ) , y e = D t ( P l ) , x t = D t ( D l ) , d t = { M a r k d o w n : { n a m e : " M a r k d o w n " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - - l u a - f i l t e r = " $ { l u a D i r } / m a r k d o w n . l u a " - s - o " $ { o u t p u t P a t h } " - t c o m m o n m a r k _ x - a t t r i b u t e s ' , e x t e n s i o n : " . m d " } , " M a r k d o w n ( H u g o ) " : { n a m e : " M a r k d o w n ( H u g o ) " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - - l u a - f i l t e r = " $ { l u a D i r } / m a r k d o w n + h u g o . l u a " - s - o " $ { o u t p u t P a t h } " - t c o m m o n m a r k _ x - a t t r i b u t e s ' , e x t e n s i o n : " . m d " } , H t m l : { n a m e : " H t m l " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - - l u a - f i l t e r = " $ { l u a D i r } / m a t h _ b l o c k . l u a " - - e m b e d - r e s o u r c e s - - s t a n d a l o n e - - m e t a d a t a t i t l e = " $ { c u r r e n t F i l e N a m e } " - s - o " $ { o u t p u t P a t h } " - t h t m l ' , c u s t o m A r g u m e n t s : ' - - m a t h j a x = " h t t p s : / / c d n . j s d e l i v r . n e t / n p m / m a t h j a x @ 3 / e s 5 / t e x - s v g - f u l l . j s " ' , e x t e n s i o n : " . h t m l " } , T e x t B u n d l e : { n a m e : " T e x t B u n d l e " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - - l u a - f i l t e r = " $ { l u a D i r } / m a r k d o w n . l u a " - V m e d i a _ d i r = " $ { o u t p u t D i r } / $ { o u t p u t F i l e N a m e } . t e x t b u n d l e / a s s e t s " - s - o " $ { o u t p u t D i r } / $ { o u t p u t F i l e N a m e } . t e x t b u n d l e / t e x t . m d " - t c o m m o n m a r k _ x - a t t r i b u t e s ' , e x t e n s i o n : " . m d " } , T y p s t : { n a m e : " T y p s t " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - - l u a - f i l t e r = " $ { l u a D i r } / m a r k d o w n . l u a " - s - o " $ { o u t p u t P a t h } " - t t y p s t ' , e x t e n s i o n : " . t y p " } , P D F : { n a m e : " P D F " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - - l u a - f i l t e r = " $ { l u a D i r } / p d f . l u a " $ { o p t i o n s . t e x t e m p l a t e ? ` - - r e s o u r c e - p a t h = " $ { p l u g i n D i r } / t e x t e m p l a t e " - - t e m p l a t e = " $ { o p t i o n s . t e x t e m p l a t e } " ` : ` ` } - o " $ { o u t p u t P a t h } " - t p d f ' , c u s t o m A r g u m e n t s : " - - p d f - e n g i n e = p d f l a t e x " , o p t i o n s M e t a : { t e x t e m p l a t e : " p r e s e t : t e x t e m p l a t e " } , e x t e n s i o n : " . p d f " } , " W o r d ( . d o c x ) " : { n a m e : " W o r d ( . d o c x ) " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - o " $ { o u t p u t P a t h } " - t d o c x ' , e x t e n s i o n : " . d o c x " } , O p e n O f f i c e : { n a m e : " O p e n O f f i c e " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - o " $ { o u t p u t P a t h } " - t o d t ' , e x t e n s i o n : " . o d t " } , R T F : { n a m e : " R T F " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - s - o " $ { o u t p u t P a t h } " - t r t f ' , e x t e n s i o n : " . r t f " } , E p u b : { n a m e : " E p u b " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - o " $ { o u t p u t P a t h } " - t e p u b ' , e x t e n s i o n : " . e p u b " } , L a t e x : { n a m e : " L a t e x " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " $ { o p t i o n s . t e x t e m p l a t e ? ` - - r e s o u r c e - p a t h = " $ { p l u g i n D i r } / t e x t e m p l a t e " - - t e m p l a t e = " $ { o p t i o n s . t e x t e m p l a t e } " ` : ` ` } - - e x t r a c t - m e d i a = " $ { o u t p u t D i r } " - s - o " $ { o u t p u t P a t h } " - t l a t e x ' , o p t i o n s M e t a : { t e x t e m p l a t e : " p r e s e t : t e x t e m p l a t e " } , e x t e n s i o n : " . t e x " } , " M e d i a W i k i " : { n a m e : " M e d i a W i k i " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - s - o " $ { o u t p u t P a t h } " - t m e d i a w i k i ' , e x t e n s i o n : " . m e d i a w i k i " } , r e S t r u c t u r e d T e x t : { n a m e : " r e S t r u c t u r e d T e x t " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - s - o " $ { o u t p u t P a t h } " - t r s t ' , e x t e n s i o n : " . r s t " } , T e x t i l e : { n a m e : " T e x t i l e " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f $ { f r o m F o r m a t } - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u
2024-06-28 02:13:12 -05:00
* @ license
* Copyright ( c ) 2016 , Contributors
* SPDX - License - Identifier : ISC
2024-09-16 17:29:06 -05:00
* /function Te(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf("-")===-1&&e.indexOf("_")===-1)return e;{let t="",n=!1;const c=e.match(/ ^ - + /);for(let i=c?c[0].length:0;i<e.length;i++){let o=e.charAt(i);n&&(n=!1,o=o.toUpperCase()),i!==0&&(o==="-"||o==="_")?n=!0:o!=="-"&&o!=="_"&&(t+=o)}return t}}function Zn(e,l){const t=e.toLowerCase();l=l||"-";let n="";for(let c=0;c<e.length;c++){const i=t.charAt(c),o=e.charAt(c);i!==o&&c>0?n+=`${l}${t.charAt(c)}`:n+=o}return n}function mn(e){return e==null?!1:typeof e=="number"||/ ^ 0 x [ 0 - 9 a - f ] + $ / i . test ( e ) ? ! 0 : /^0[^.]/ . test ( e ) ? ! 1 : /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/ . test ( e ) } / * *
2024-06-28 02:13:12 -05:00
* @ license
* Copyright ( c ) 2016 , Contributors
* SPDX - License - Identifier : ISC
2024-09-16 17:29:06 -05:00
* /function Xc(e){if(Array.isArray(e))return e.map(o=>typeof o!="string"?o+"":o);e=e.trim();let l=0,t=null,n=null,c=null;const i=[];for(let o=0;o<e.length;o++){if(t=n,n=e.charAt(o),n===" "&&!c){t!==" "&&l++;continue}n===c?c=null:(n==="'"||n==='"')&&!c&&(c=n),i[l]||(i[l]=""),i[l]+=n}return i}/ * *
2024-06-28 02:13:12 -05:00
* @ license
* Copyright ( c ) 2016 , Contributors
* SPDX - License - Identifier : ISC
2024-09-16 17:29:06 -05:00
* /var ue;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})(ue||(ue={}));/ * *
2024-06-28 02:13:12 -05:00
* @ license
* Copyright ( c ) 2016 , Contributors
* SPDX - License - Identifier : ISC
2024-10-05 01:01:51 -05:00
* /let Re;class fc{constructor(l){Re=l}parse(l,t){const n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},t),c=Xc(l),i=typeof l=="string",o=Rc(Object.assign(Object.create(null),n.alias)),s=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),a=Object.assign(Object.create(null),n.default),g=n.configObjects||[],u=n.envPrefix,Z=s["populate--"],N=Z?"--":"_",p=Object.create(null),Y=Object.create(null),L=n.__||Re.format,m={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},K=/ ^ - ( [ 0 - 9 ] + ( \ . [ 0 - 9 ] + ) ? | \ . [ 0 - 9 ] + ) $ / , S = new RegExp ( "^--" + s [ "negation-prefix" ] + "(.+)" ) ; [ ] . concat ( n . array || [ ] ) . filter ( Boolean ) . forEach ( function ( r ) { const b = typeof r == "object" ? r . key : r , h = Object . keys ( r ) . map ( function ( G ) { return { boolean : "bools" , string : "strings" , number : "numbers" } [ G ] } ) . filter ( Boolean ) . pop ( ) ; h && ( m [ h ] [ b ] = ! 0 ) , m . arrays [ b ] = ! 0 , m . keys . push ( b ) } ) , [ ] . concat ( n . boolean || [ ] ) . filter ( Boolean ) . forEach ( function ( r ) { m . bools [ r ] = ! 0 , m . keys . push ( r ) } ) , [ ] . concat ( n . string || [ ] ) . filter ( Boolean ) . forEach ( function ( r ) { m . strings [ r ] = ! 0 , m . keys . push ( r ) } ) , [ ] . concat ( n . number || [ ] ) . filter ( Boolean ) . forEach ( function ( r ) { m . numbers [ r ] = ! 0 , m . keys . push ( r ) } ) , [ ] . concat ( n . count || [ ] ) . filter ( Boolean ) . forEach ( function ( r ) { m . counts [ r ] = ! 0 , m . keys . push ( r ) } ) , [ ] . concat ( n . normalize || [ ] ) . filter ( Boolean ) . forEach ( function ( r ) { m . normalize [ r ] = ! 0 , m . keys . push ( r ) } ) , typeof n . narg == "object" && Object . entries ( n . narg ) . forEach ( ( [ r , b ] ) => { typeof b == "number" && ( m . nargs [ r ] = b , m . keys . push ( r ) ) } ) , typeof n . coerce == "object" && Object . entries ( n . coerce ) . forEach ( ( [ r , b ] ) => { typeof b == "function" && ( m . coercions [ r ] = b , m . keys . push ( r ) ) } ) , typeof n . config < "u" && ( Array . isArray ( n . config ) || typeof n . config == "string" ? [ ] . concat ( n . config ) . filter ( Boolean ) . forEach ( function ( r ) { m . configs [ r ] = ! 0 } ) : typeof n . config == "object" && Object . entries ( n . config ) . forEach ( ( [ r , b ] ) => { ( typeof b == "boolean" || typeof b == "function" ) && ( m . configs [ r ] = b ) } ) ) , q ( n . key , o , n . default , m . arrays ) , Object . keys ( a ) . forEach ( function ( r ) { ( m . aliases [ r ] || [ ] ) . forEach ( function ( b ) { a [ b ] = a [ r ] } ) } ) ; let E = null ; kn ( ) ; let T = [ ] ; const Q = Object . assign ( Object . create ( null ) , { _ : [ ] } ) , be = { } ; for ( let r = 0 ; r < c . length ; r ++ ) { const b = c [ r ] , h = b . replace ( /^-{3,}/ , "---" ) ; let G , d , B , A , x , _ ; if ( b !== "--" && /^-/ . test ( b ) && He ( b ) ) ge ( b ) ; else if ( h . match ( /^---+(=|$)/ ) ) { ge ( b ) ; continue } else if ( b . match ( /^--.+=/ ) || ! s [ "short-option-groups" ] && b . match ( /^-.+=/ ) ) A = b . match ( /^--?([^=]+)=([\s\S]*)$/ ) , A !== null && Array . isArray ( A ) && A . length >= 3 && ( V ( A [ 1 ] , m . arrays ) ? r = f ( r , A [ 1 ] , c , A [ 2 ] ) : V ( A [ 1 ] , m . nargs ) !== ! 1 ? r = X ( r , A [ 1 ] , c , A [ 2 ] ) : R ( A [ 1 ] , A [ 2 ] , ! 0 ) ) ; else if ( b . match ( S ) && s [ "boolean-negation" ] ) A = b . match ( S ) , A !== null && Array . isArray ( A ) && A . length >= 2 && ( d = A [ 1 ] , R ( d , V ( d , m . arrays ) ? [ ! 1 ] : ! 1 ) ) ; else if ( b . match ( /^--.+/ ) || ! s [ "short-option-groups" ] && b . match ( /^-[^-]+/ ) ) A = b . match ( /^--?(.+)/ ) , A !== null && Array . isArray ( A ) && A . length >= 2 && ( d = A [ 1 ] , V ( d , m . arrays ) ? r = f ( r , d , c ) : V ( d , m . nargs ) !== ! 1 ? r = X ( r , d , c ) : ( x = c [ r + 1 ] , x !== void 0 && ( ! x . match ( /^-/ ) || x . match ( K ) ) && ! V ( d , m . bools ) && ! V ( d , m . counts ) || /^(true|false)$/ . test ( x ) ? ( R ( d , x ) , r ++ ) : R ( d , Ne ( d ) ) ) ) ; else if ( b . match ( /^-.\..+=/ ) ) A = b . match ( /^-([^=]+)=([\s\S]*)$/ ) , A !== null && Array . isArray ( A ) && A . length >= 3 && R ( A [ 1 ] , A [ 2 ] ) ; else if ( b . match ( /^-.\..+/ ) && ! b . match ( K ) ) x = c [ r + 1 ] , A = b . match ( /^-(.\..+)/ ) , A !== null && Array . isArray ( A ) && A . length >= 2 && ( d = A [ 1 ] , x !== void 0 && ! x . match ( /^-/ ) && ! V ( d , m . bools ) && ! V ( d , m . counts ) ? ( R ( d , x ) , r ++ ) : R ( d , Ne ( d ) ) ) ; else if ( b . match ( /^-[^-]+/ ) && ! b . match ( K ) ) { B = b . slice ( 1 ,
2024-06-28 02:13:12 -05:00
* @ fileoverview Main entrypoint for libraries using yargs - parser in Node . js
* CJS and ESM environments .
*
* @ license
* Copyright ( c ) 2016 , Contributors
* SPDX - License - Identifier : ISC
2024-10-05 01:01:51 -05:00
* /var Ht,Nt,vt;const fl=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,Rl=(Nt=(Ht=process==null?void 0:process.versions)===null||Ht===void 0?void 0:Ht.node)!==null&&Nt!==void 0?Nt:(vt=process==null?void 0:process.version)===null||vt===void 0?void 0:vt.slice(1);if(Rl&&Number(Rl.match(/ ^ ( [ ^ . ] + ) / ) [ 1 ] ) < fl ) throw Error ( ` yargs parser supports a minimum Node.js version of ${ fl } . Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions ` ) ; const Ac = process ? process . env : { } , un = new fc ( { cwd : process . cwd , env : ( ) => Ac , format : Sn . format , normalize : ae . normalize , resolve : ae . resolve , require : e => { if ( typeof require < "u" ) return require ( e ) ; if ( e . match ( /\.json$/ ) ) return JSON . parse ( Dl . readFileSync ( e , "utf8" ) ) ; throw Error ( "only .json config files are supported in ESM" ) } } ) , lt = function ( l , t ) { return un . parse ( l . slice ( ) , t ) . argv } ; lt . detailed = function ( e , l ) { return un . parse ( e . slice ( ) , l ) } ; lt . camelCase = Te ; lt . decamelize = Zn ; lt . looksLikeNumber = mn ; const Yc = { exportToOo : "导出为......" , exportWithPrevious : "使用上一次设置导出" , exportSuccessNotice : $ ` 导出文件 ${ 0 } 成功! ` , exportCommandOutputMessage : $ ` 命令: ${ 0 } ` , exportErrorOutputMessage : $ ` 命令 ${ 0 } ,错误: ${ 1 } ` , pleaseOpenFile : "请打开一个文件先。" , preparing : $ ` 正在生成 " ${ 0 } " ...... ` , exportDialog : { fileName : "文件名" , type : "类型" , exportTo : "导出到" , title : $ ` 导出为 ${ 0 } ` , export : "导出" , selectExportFolder : "请选择导出文件夹" , overwriteConfirmation : "覆盖提示" } , messageBox : { yes : "是" , no : "否" , ok : "确认" , cancel : "取消" } , overwriteConfirmationDialog : { replace : "替换" , title : $ ` " ${ 0 } " 已经存在。您要替换它吗? ` , message : $ ` " ${ 0 } " 文件夹中已有相同的文件或文件夹,若替换,则会覆盖其当前内容。 ` } , settingTab : { title : "导出设置" , general : "通用" , name : "名称" , customLocation : "自定义" , pandocVersion : $ ` 版本: ${ 0 } ` , pandocVersionWithWarning : $ ` Version: ${ 0 } , 请升级版本到 ${ 1 } ` , pandocNotFound : "找不到 Pandoc, 请填写 Pandoc 文件路径,或者将其添加到系统环境变量中。" , pandocPath : "Pandoc 路径" , defaultFolderForExportedFile : "默认的导出文件夹" , openExportedFileLocation : "打开导出文件所在目录" , sameFolderWithCurrentFile : "与原文件同一目录下" , openExportedFile : "打开导出文件" , pandocPathPlaceholder : "(自动检测)" , editCommandTemplate : "编辑命令模板" , chooseCommandTemplate : "选择模板" , afterExport : "导出后" , command : "命令" , arguments : "参数" , auto : "自动" , reset : "重置" , add : "添加" , remove : "移除" , rename : "重命名" , targetFileExtensions : "目标文件扩展名" , targetFileExtensionsTip : "(用空格分开)" , showCommandOutput : "显示命令行输出" , runCommand : "运行自定义命令" , extraArguments : "自定义参数" , save : "保存" , new : "新建" , template : "模板" , advanced : "高级" , environmentVariables : "环境变量" , environmentVariablesDesc : "定义导出的环境变量." , ShowExportProgressBar : "显示导出进度条" } } , Jc = { exportToOo : "Export to..." , exportSuccessNotice : $ ` Export file ${ 0 } success! ` , exportCommandOutputMessage : $ ` Command: ${ 0 } ` , exportErrorOutputMessage : $ ` Command: ${ 0 } , Error:${ 1 } ` , exportWithPrevious : "Export with Previous" , pleaseOpenFile : "Please open a file first." , preparing : $ ` generating " ${ 0 } "... ` , exportDialog : { exportTo : "Export to" , fileName : "File Name" , title : $ ` Export to ${ 0 } ` , export : "Export" , selectExportFolder : "Please select an export folder." , overwriteConfirmation : "Overwrite confirmation" , type : "Type" } , messageBox : { yes : "Yes" , no : "No" , ok : "Ok" , cancel : "Cancel" } , overwriteConfirmationDialog : { replace : "Replace" , title : $ ` " ${ 0 } " already exists. Do you want to replace it? ` , message : $ ` A file or folder with the same name already exists in the folder " ${ 0 } ". Replacing it will overwrite its current contents. ` } , settingTab : { general : "General" , name : "Name" , title : "Export Settings" , pandocVersion : $ ` Version: ${ 0 } ` , pandocVersionWithWarning : $ ` Version: ${ 0 } , please upgrade version to ${ 1 } ` , pandocNotFound : "Pandoc not found, please fill in the Pandoc file path, or add it to the system environment variables." , defaultFold
` )).replace("pandoc.exe","").replace("pandoc","").trim();let n=[...t].filter(c=>c===".").length;if(n===1)t= ` $ { t } . 0 ` ;else for(;n>2;)t=t.substring(0,t.lastIndexOf(".")),n-=1;return Bo.parse(t,!0)}const yo="3.1.7",Zt={normalizePath:Rn,getVersion:xo,requiredVersion:yo};async function Vn(e,l,t,n,c,i,o,s,a,g){const{settings:u,lang:Z,manifest:N,app:{vault:{adapter:p,config:Y},metadataCache:L}}=e;if(!n){const ce=_l(c);n= ` $ { l . basename } $ { ce } ` }i==null&&(i=u.showOverwriteConfirmation);const m=u.showExportProgressBar,K=p.getBasePath(),S= ` $ { K } / $ { N . dir } ` ,E= ` $ { S } / lua ` ,T=t,Q= ` $ { T } / $ { n } ` ,be=n.substring(0,n.lastIndexOf(".")),ge=n,X=p.getFullPath(l.path),f=ae.dirname(X),R=l.basename,v=l.name;let D=Y.attachmentFolderPath??"/";D==="/"?D=K:D.startsWith(".")?D=ae.join(f,D.substring(1)):D=ae.join(K,D);let W=null;try{W=L.getCache(l.path).frontmatter}catch(ce){console.error(ce)}const C={pluginDir:S,luaDir:E,outputDir:T,outputPath:Q,outputFileName:be,outputFileFullName:ge,currentDir:f,currentPath:X,currentFileName:R,currentFileFullName:v,attachmentFolderPath:D,vaultDir:K,metadata:W,options:o,fromFormat:app.vault.config.useMarkdownLinks?"markdown":"markdown+wikilinks_title_after_pipe"},H=c.type==="custom"&&c.showCommandOutput,y=c.openExportedFileLocation??u.openExportedFileLocation,F=c.openExportedFile??u.openExportedFile;if(i&&xt.existsSync(Q)){const ce=await ye.remote.dialog.showSaveDialog({title:Z.overwriteConfirmationDialog.title(ge),defaultPath:Q,properties:["showOverwriteConfirmation","createDirectory"]});if(ce.canceled)return;C.outputPath=ce.filePath,C.outputDir=ae.dirname(C.outputPath),C.outputFileFullName=ae.basename(C.outputPath),C.outputFileName=ae.basename(C.outputFileFullName,ae.extname(C.outputFileFullName))}let J;m&&(J=Hc.show(Z.preparing(C.outputFileFullName)));const k=C.env=ql(de(u.env)??{},C);let z=Zt.normalizePath(de(u.pandocPath));if(pt.platform==="win32"){z=z.replaceAll(" \\ ","/");const ce=["pluginDir","luaDir","outputDir","outputPath","currentDir","currentPath","attachmentFolderPath","vaultDir"];for(const Xe of ce){const He=C[Xe];C[Xe]=He.replaceAll(" \\ ","/")}}const w=c.type==="pandoc"? ` $ { z } "\${currentPath}" $ { c . arguments ? ? "" } $ { c . customArguments ? ? "" } ` :c.command,U=Ut(w,C),q=lt(U.match(/(?:[^ \s "]+|"[^"]*")+/g),{alias:{output:["o"]}}),V=ae.normalize(Kn(q.output)),me=ae.dirname(V);xt.existsSync(me)||xt.mkdirSync(me);try{console.log( ` [ $ { e . manifest . name } ] : export command and options : ` ,{cmd:U,options:{cwd:C.currentDir,env:k}}),await zt(U,{cwd:C.currentDir,env:k}),J==null||J();const ce=async()=>{if(y&&setTimeout(()=>{ye.remote.shell.showItemInFolder(V)},1e3),F&&await ye.remote.shell.openPath(V),c.type==="pandoc"&&c.runCommand===!0&&c.command){const Xe=Ut(c.command,C);await zt(Xe,{cwd:C.currentDir,env:k})}s&&s()};if(H){const Xe=new Vl(app,Z.exportCommandOutputMessage(U));Xe.onClose=ce,Xe.open()}else new Ie.Notice(Z.exportSuccessNotice(C.outputFileFullName),1500),await ce()}catch(ce){J==null||J(),new Vl(app,Z.exportErrorOutputMessage(U,ce)).open(),a&&a()}}const Ot=e=>{const l=new Ie.Modal(e.app);let t=[],n=!1;return Ye(()=>{ne(l.titleEl,()=>e.title)}),Ye(()=>{ne(l.contentEl,()=>e.children)}),Ye(()=>{const c=Object.entries(e.classList??{}).filter(([,i])=>i).map(([i])=>i);t.length>0&&l.containerEl.removeClasses(t),c.length>0&&l.containerEl.addClasses(c),t=c}),Ye(()=>{l.containerEl.style.display=e.hidden?"None":""}),l.onClose=()=>{n||(n=!0,e.onClose())},ln(()=>l.open()),ze(()=>{n||l.close()}),document.createTextNode("")};var Fo=Ze("<button>");const Pt=e=>(()=>{var l=Fo();return el(l,"click",e.onClick,!0),ne(l,()=>e.children),te(()=>l.classList.toggle("mod-cta",!!e.cta)),l})();qt(["click"]);var Ho=Ze("<div><div class=setting-item-info><div class=setting-item-name></div><div class=setting-item-description></div></div><div class=setting-item-control>"),No=Ze("<div class=checkbox-container><input type=checkbox>"),vo=Ze("<div class=setting-editor-extra-setting-button>"),ko=Ze("<input type=text>"),wo=Ze("<textarea>"),So=Ze("<select class=dropdown>"),Eo=Ze("<option>");const An= $ n(),Ko=()=>Tn(An),j=e=>{const l={settingEl:null};return I(An.Provide
` )),a=(...X)=>{c(...X),l.saveSettings()},g=X=>{try{const f={};for(let R of X.split( `
` )){R=R.trim();const v=R.indexOf("=");if(v>0){const D=R.substring(0,v);let W=R.substring(v+1).trim();W.startsWith('"')&&W.endsWith('"')&&(W=W.substring(1,W.length-1)),f[D]=W}}a("env",Ae(n.env??{},f))}catch(f){alert(f)}},u=ee(()=>n.items.find(X=>X.name===n.lastEditName)??n.items.first()),Z=X=>{const f=u();return X===void 0||X===f.type?f:void 0},N=ee(()=>de(n.customDefaultExportDirectory)),p=X=>{const f=n.items.findIndex(R=>R.name===n.lastEditName);a("items",f===-1?0:f,qo(R=>(X(R),R)))},Y=ee(()=>{const X=i();return X?app.vault.config.useMarkdownLinks&&X.compare(Zt.requiredVersion)===-1?t.settingTab.pandocVersionWithWarning(Zt.requiredVersion):t.settingTab.pandocVersion(X):t.settingTab.pandocNotFound}),[L,m]=oe(),K=()=>{const[X,f]=oe(Object.keys(dt)[0]),[R,v]=oe(),D=()=>{const W=JSON.parse(JSON.stringify(dt[X()]));W.name=R(),bt(()=>{a("items",C=>[...C,W]),a("lastEditName",W.name)}),m(void 0)};return I(Ot,{app,get title(){return t.settingTab.new},onClose:()=>m(void 0),get children(){return[I(j,{get name(){return t.settingTab.template},get children(){return I(Pe,{get options(){return Object.entries(dt).map(([W,C])=>({name:C.name,value:W}))},get selected(){return R()??X()},onChange:W=>f(W)})}}),I(j,{get name(){return t.settingTab.name},get children(){return I(re,{get value(){return R()??""},onChange:W=>v(W)})}}),(()=>{var W=Tl();return ne(W,I(Pt,{cta:!0,onClick:D,get children(){return t.settingTab.save}})),W})()]}})},S=()=>{const[X,f]=oe(Z().name),R=()=>{bt(()=>{p(v=>v.name=X()),a("lastEditName",X())}),m(void 0)};return I(Ot,{app,get title(){return t.settingTab.rename},onClose:()=>m(void 0),get children(){return[I(j,{get name(){return t.settingTab.name},get children(){return I(re,{get value(){return X()??""},onChange:v=>f(v)})}}),(()=>{var v=Tl();return ne(v,I(Pt,{cta:!0,onClick:R,get children(){return t.settingTab.add}})),v})()]}})},E=()=>{const X=()=>Z("pandoc"),f=R=>{p(v=>v.type==="pandoc"?R(v):void 0)};return[I(j,{get name(){return t.settingTab.arguments},get children(){return I(re,{style:"width: 100%",get value(){return X().arguments??""},onChange:R=>f(v=>v.arguments=R)})}}),I(j,{get name(){return t.settingTab.extraArguments},get children(){return I(re,{style:"width: 100%",get value(){return X().customArguments??""},get title(){return X().customArguments},onChange:R=>f(v=>v.customArguments=R)})}}),I(j,{get name(){return t.settingTab.afterExport},heading:!0}),I(j,{get name(){return t.settingTab.openExportedFileLocation},get children(){return I(Ge,{get checked(){return X().openExportedFileLocation??!1},onChange:R=>f(v=>v.openExportedFileLocation=R)})}}),I(j,{get name(){return t.settingTab.openExportedFile},get children(){return I(Ge,{get checked(){return X().openExportedFile??!1},onChange:R=>f(v=>v.openExportedFile=R)})}}),I(j,{get name(){return t.settingTab.runCommand},get children(){return I(Ge,{get checked(){return X().runCommand},onChange:R=>f(v=>v.runCommand=R)})}}),I(gt,{get when(){return X().runCommand},get children(){return I(j,{get children(){return I(re,{style:"width: 100%",get value(){return X().command??""},onChange:R=>f(v=>v.command=R)})}})}})]},T=()=>{const X=()=>Z("custom"),f=R=>{p(v=>v.type==="custom"?R(v):void 0)};return[I(j,{get name(){return t.settingTab.command},get children(){return I(re,{style:"width: 100%",get value(){return X().command},onChange:R=>f(v=>v.command=R)})}}),I(j,{get name(){return t.settingTab.targetFileExtensions},get children(){return I(re,{get value(){return X().targetFileExtensions??""},onChange:R=>f(v=>v.targetFileExtensions=R)})}}),I(j,{get name(){return t.settingTab.afterExport},heading:!0}),I(j,{get name(){return t.settingTab.showCommandOutput},get children(){return I(Ge,{get checked(){return X().showCommandOutput??!1},onChange:R=>f(v=>v.showCommandOutput=R)})}}),I(j,{get name(){return t.settingTab.openExportedFileLocation},get children(){return I(Ge,{get checked(){return X().openExportedFileLocation??!1},onChange:R=>f(v=>v.openExportedFileLocation=R)})}}),I(j,{get name(){return t.settingTab.openExportedFile},get children(){return I(Ge,{get checked(){return X().openExportedFile?