@@ -1,9 +1,10 @@
( ( ) => { "use strict" ; const e = window . React , t = window . wp . element , a = window . wp . i18n ; function n ( e , t ) { const a = e && ( e . message || e . error ) || ( 401 === t ? "登录状态已失效,请刷新页面重新登录。" : "请求失败,请稍后重试。" ) , n = new Error ( String ( a ) ) ; return n . status = t , n . code = e && e . code ? String ( e . code ) : "" , n . data = e , n } async function o ( e ) { try { return await e . json ( ) } catch ( e ) { return null } } async function r ( e , t , a ) { const r = await fetch ( e , { method : "POST" , credentials : "same-origin" , headers : { "Content-Type" : "application/json" , "X-WP-Nonce" : a } , body : JSON . stringify ( t ) } ) , i = await o ( r ) ; if ( ! r . ok ) throw n ( i , r . status ) ; return i } async function i ( e , t , a , r = { } ) { const i = new FormData ; i . append ( "file" , t ) , Object . entries ( r ) . forEach ( ( [ e , t ] ) => i . append ( e , t ) ) ; const l = await fetch ( e , { method : "POST" , credentials : "same-origin" , headers : { "X-WP-Nonce" : a } , body : i } ) , c = await o ( l ) ; if ( ! l . ok ) throw n ( c , l . status ) ; return c } const l = { url : "" , attachmentId : 0 , extractCode : "" , copyKey : "" , copyVal : "" , label : "" , class : "" } ; function c ( { row : n , buttonClasses : o , onPickAttachment : r , onSubmit : i , onClose : c } ) { const [ s , d ] = ( 0 , t . useState ) ( ( ) => n ? { url : String ( n . url || "" ) , attachmentId : Number ( n . attachmentId || 0 ) , extractCode : String ( n . extractCode || "" ) , copyKey : String ( n . copyKey || "" ) , copyVal : String ( n . copyVal || "" ) , label : String ( n . label || "" ) , class : String ( n . class || "" ) } : { ... l } ) , [ u , m ] = ( 0 , t . useState ) ( "" ) , p = ( 0 , t . useRef ) ( null ) ; ( 0 , t . useEffect ) ( ( ) => { p . current ? . focus ( ) ; const e = e => { "Escape" === e . key && ( e . preventDefault ( ) , c ( ) ) } ; return document . addEventListener ( "keydown" , e ) , ( ) => document . removeEventListener ( "keydown" , e ) } , [ c ] ) ; const _ = e => d ( t => ( { ... t , ... e } ) ) ; return ( 0 , e . createElement ) ( "div" , { className : "jio-creator-dialog" , role : "dialog" , "aria-modal" : "true" , "aria-labelledby" : "jio-creator-resource-title" } , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator-dialog__backdrop" , "aria-label" : ( 0 , a . _ _ ) ( "关闭" , "jio" ) , onClick : c } ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-dialog__panel jio-creator-dialog__panel--wide" } , ( 0 , e . createElement ) ( "header" , { className : "jio-creator-dialog__head" } , ( 0 , e . createElement ) ( "h2" , { id : "jio-creator-resource-title" } , n ? ( 0 , a . _ _ ) ( "编辑资源" , "jio" ) : ( 0 , a . _ _ ) ( "添加资源" , "jio" ) ) , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator-dialog__close" , onClick : c , "aria-label" : ( 0 , a . _ _ ) ( "关闭" , "jio" ) } , ( 0 , e . createElement ) ( "i" , { className : "fa fas fa-times" , "aria-hidden" : "true" } ) ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-dialog__body" } , ( 0 , e . createElement ) ( "label" , { className : "jio-creator-dialog__field" } , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "下载地址" , "jio" ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-dialog__url" } , ( 0 , e . createElement ) ( "input" , { ref : p , type : "url" , value : s . url , placeholder : ( 0 , a . _ _ ) ( "请输入资源下载地址" , "jio" ) , onChange : e => _ ( { url : e . target . value , attachmentId : 0 } ) , onPaste : e => { const t = e . clipboardData ? . getData ( "text" ) || "" ; if ( ! t ) return ; const n = t . match ( /https?:\/\/\S+/i ) , o = t . match ( /(?:提取码|密码)\s*[:: ]\s*([A-Za-z0-9]{4,8})/ ) ; if ( ! n && ! o ) return ; e . preventDefault ( ) ; const r = { attachmentId : 0 } ; n && ( r . url = n [ 0 ] . replace ( /[)\],。]+$/u , "" ) ) , o && ( r . extractCode = ( 0 , a . sprintf ) ( /* translators: %s: extraction code */ /* translators: %s: extraction code */
( 0 , a . _ _ ) ( "提取码:%s" , "jio" ) , o [ 1 ] ) , r . copyKey = ( 0 , a . _ _ ) ( "提取码" , "jio" ) , r . copyVal = o [ 1 ] ) , _ ( r ) } } ) , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator-dialog__ghost" , onClick : ( ) => r ( ( e , t ) => _ ( { url : e , attachmentId : t } ) ) } , ( 0 , e . createElement ) ( "i" , { className : "fa fas fa-upload" , "aria-hidden" : "true" } ) , " " , ( 0 , a . _ _ ) ( "上传附件" , "jio" ) ) ) , ( 0 , e . createElement ) ( "span" , { className : "jio-creator-dialog__hint" } , ( 0 , a . _ _ ) ( "支持直接粘贴网盘分享链接,会自动识别提取码。" , "jio" ) ) ) , ( 0 , e . createElement ) ( "label" , { className : "jio-creator-dialog__field" } , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "资源备注" , "jio" ) ) , ( 0 , e . createElement ) ( "input" , { type : "text" , value : s . extractCode , placeholder : ( 0 , a . _ _ ) ( "例如提取码、解压密码等" , "jio" ) , onChange : e => _ ( { extractCode : e . target . value } ) } ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-dialog__row" } , ( 0 , e . createElement ) ( "label" , null , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "复制名称" , "jio" ) ) , ( 0 , e . createElement ) ( "input" , { type : "text" , value : s . copyKey , placeholder : ( 0 , a . _ _ ) ( "如:提取码" , "jio" ) , onChange : e => _ ( { copyKey : e . target . value } ) } ) ) , ( 0 , e . createElement ) ( "label" , null , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "复制内容" , "jio" ) ) , ( 0 , e . createElement ) ( "input" , { type : "text" , value : s . copyVal , placeholder : ( 0 , a . _ _ ) ( "如:abcd" , "jio" ) , onChange : e => _ ( { copyVal : e . target . value } ) } ) ) ) , ( 0 , e . createElement ) ( "span" , { className : "jio-creator-dialog__hint" } , ( 0 , a . _ _ ) ( "填写后读者可点击按钮复制这段内容。" , "jio" ) ) , ( 0 , e . createElement ) ( "label" , { className : "jio-creator-dialog__field" } , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "自定义按钮文案" , "jio" ) ) , ( 0 , e . createElement ) ( "input" , { type : "text" , value : s . label , placeholder : ( 0 , a . _ _ ) ( "留空则按网盘自动识别" , "jio" ) , onChange : e => _ ( { label : e . target . value } ) } ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-dialog__field" } , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "按钮样式" , "jio" ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-swatches" } , o . map ( t => ( 0 , e . createElement ) ( "button" , { key : t || "default" , type : "button" , className : ` jio-creator-swatch ${ t || "b-theme" } ${ s . class === t ? " is-active" : "" } ` , onClick : ( ) => _ ( { class : t } ) , title : t || ( 0 , a . _ _ ) ( "默认样式" , "jio" ) , "aria-label" : t || ( 0 , a . _ _ ) ( "默认样式" , "jio" ) , "aria-pressed" : s . class === t } ) ) ) ) , u && ( 0 , e . createElement ) ( "p" , { className : "jio-creator-error" } , u ) ) , ( 0 , e . createElement ) ( "footer" , { className : "jio-creator-dialog__foot" } , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator-dialog__ghost" , onClick : c } , ( 0 , a . _ _ ) ( "取消" , "jio" ) ) , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator-dialog__primary" , onClick : ( ) => { const e = function ( e ) { const t = e . trim ( ) ; if ( ! t ) return "" ; try { const e = new URL ( t , window . location . href ) ; return "http:" === e . protocol || "https:" === e . protocol ? e . href : "" } catch ( e ) { return "" } } ( s . url ) ; if ( ! e ) return void m ( ( 0 , a . _ _ ) ( "请填写有效的下载地址" , "jio" ) ) ; m ( "" ) ; const t = /pan\.baidu\.com|aliyundrive\.com|alipan\.com|pan\.quark\.cn|cloud\.189\.cn|115\.com|lanzou|weiyun|123pan/i . test ( e ) ; i ( { ... n || { } , type : t ? "net_disk" : "direct" , url : e , attachmentId : Math . max ( 0 , Number ( s . attachmentId ) || 0 ) , extractCode : s . extractCode . trim ( ) , copyKey : s . copyKey . trim ( ) , copyVal : s . copyVal . trim ( ) , label : s . label . trim ( ) , class : s . class } ) } } , ( 0 , a . _ _ ) ( "确认" , "jio" ) ) ) ) ) } const s = ( e , t = 0 ) => { const a = Number ( e ) ; return Number . isFinite ( a ) ? a : t } ; function d ( { pay : n , onChange : o , canDownload : r , privateStorage : i , privateUploads : l , bootstrap : d , onUploadPrivate : u , uploading : m , uploadError : p , onPickAttachment : _ } ) { const [ f , b ] = ( 0 , t . useState ) ( null ) , h = ( 0 , t . useRef ) ( null ) , g = e => o ( { ... n , ... e } ) , j = "points" === n . modo , y = String ( d . currencySymbol || "¥" ) , v = d . downloadClasses && d . downloadClasses . length > 0 ? d . downloadClasses : [ "" , "c-blue" , "b-blue" , "jb-blue" ] , E = n . downloads , k = e => j ? ( 0 , a . sprintf ) ( /* translators: %s: VIP level name */ /* translators: %s: VIP level name */ ( 0 , a . _ _ ) ( "%s 积分" , "jio" ) , e ) : ( 0 , a . sprintf ) ( /* translators: %s: VIP level name */ /* translators: %s: VIP level name */ ( 0 , a . _ _ ) ( "%s 价格" , "jio" ) , e ) , w = ( t , a , n , o ) => { var r ; return ( 0 , e . createElement ) ( "label" , { className : "jio-creator-input" } , ( 0 , e . createElement ) ( "span" , null , t ) , ( 0 , e . createElement ) ( "span" , { className : "jio-creator-price" } , o . prefix && ( 0 , e . createElement ) ( "em" , null , o . prefix ) , ( 0 , e . createElement ) ( "input" , { type : "number" , min : null !== ( r = o . min ) && void 0 !== r ? r : 0 , step : o . step , value : a , placeholder : o . placeholder , onChange : e => n ( e . target . value ) } ) , o . suffix && ( 0 , e . createElement ) ( "em" , null , o . suffix ) ) ) } ; return ( 0 , e . createElement ) ( e . Fragment , null , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-switch" } , ( 0 , e . createElement ) ( "div" , null , ( 0 , e . createElement ) ( "h3" , null , ( 0 , a . _ _ ) ( "付费内容" , "jio" ) ) , ( 0 , e . createElement ) ( "p" , { className : "jio-creator-muted" } , ( 0 , a . _ _ ) ( "开启后,未购买读者只能看到免费部分;添加下载资源后同时出售下载权限。" , "jio" ) ) ) , ( 0 , e . createElement ) ( "label" , { className : "jio-creator-toggle" } , ( 0 , e . createElement ) ( "input" , { type : "checkbox" , checked : n . enabled , onChange : e => g ( { enabled : e . target . checked } ) } ) , ( 0 , e . createElement ) ( "span" , { "aria-hidden" : "true" } ) ) ) , n . enabled && ( 0 Line truncated
( 0 , a . _ _ ) ( "按站点时区(%s)发布,至少需要晚于当前时间 1 分钟。" , "jio" ) , String ( j . timezone || "UTC" ) ) ) ) ) } function w ( { centerUrl : t , site : n , viewer : o } ) { const r = String ( n . name || "" ) , i = String ( o . avatar || "" ) , l = t || "/" ; return ( 0 , e . createElement ) ( "header" , { className : "jio-creator__masthead" } , ( 0 , e . createElement ) ( "div" , { className : "jio-creator__masthead-left" } , ( 0 , e . createElement ) ( "a" , { className : "jio-creator__back" , href : t || "/" , "aria-label" : ( 0 , a . _ _ ) ( "返回作者中心" , "jio" ) } , ( 0 , e . createElement ) ( "i" , { className : "fa fas fa-angle-left" , "aria-hidden" : "true" } ) ) , ( 0 , e . createElement ) ( "a" , { className : "jio-creator__brand" , href : String ( n . home || "/" ) , "aria-label" : r || ( 0 , a . _ _ ) ( "返回首页" , "jio" ) } , n . logo ? ( 0 , e . createElement ) ( "img" , { className : "jio-creator__brand-logo" , src : String ( n . logo ) , alt : r } ) : ( 0 , e . createElement ) ( "span" , { className : "jio-creator__brand-text" } , r ) ) ) , ( 0 , e . createElement ) ( "a" , { className : "jio-creator__me" , href : l , "aria-label" : ( 0 , a . _ _ ) ( "返回作者中心" , "jio" ) } , i ? ( 0 , e . createElement ) ( "img" , { className : "jio-creator__me-avatar" , src : i , alt : "" , width : 32 , height : 32 } ) : ( 0 , e . createElement ) ( "span" , { className : "jio-creator__me-avatar is-placeholder" , "aria-hidden" : "true" } , ( 0 , e . createElement ) ( "i" , { className : "fa fas fa-user" } ) ) ) ) } function N ( e ) { const t = ( e . downloads || [ ] ) . map ( e => { const t = "string" == typeof e . label ? e . label : "" , a = "string" == typeof e . assetKey ? e . assetKey : "" ; if ( a ) return { type : "protected" , asset _key : a , label : t } ; const n = "string" == typeof e . url ? e . url . trim ( ) : "" ; return n ? { type : "net_disk" === e . type ? "net_disk" : "direct" , url : n , label : t , extract _code : "string" == typeof e . extractCode ? e . extractCode : "" , copy _key : "string" == typeof e . copyKey ? e . copyKey : "" , copy _val : "string" == typeof e . copyVal ? e . copyVal : "" , class : "string" == typeof e . class ? e . class : "" , attachment _id : Math . max ( 0 , Number ( e . attachmentId ) || 0 ) } : null } ) . filter ( Boolean ) , a = "points" === e . modo ; return { enabled : ! ! e . enabled , fields : { pay _type : e . enabled ? t . length > 0 ? "download" : "reading" : "no" , pay _modo : a ? "points" : "0" , price : a ? "0.00" : String ( e . price || "0.00" ) , points _price : a ? Math . max ( 0 , Number ( e . points ) || 0 ) : 0 , vip1 _price : a ? "0.00" : String ( e . vip1Price || "0.00" ) , vip2 _price : a ? "0.00" : String ( e . vip2Price || "0.00" ) , vip1 _points : a ? Math . max ( 0 , Number ( e . vip1Points ) || 0 ) : 0 , vip2 _points : a ? Math . max ( 0 , Number ( e . vip2Points ) || 0 ) : 0 , pay _limit : Number ( e . payLimit ) || 0 , downloads : t } } } const C = e => e . replace ( /&/g , "&" ) . replace ( /"/g , """ ) . replace ( /</g , "<" ) . replace ( />/g , ">" ) ; function S ( e ) { if ( ! e || - 1 === e . indexOf ( "data-jio-" ) ) return e ; const t = document . createElement ( "div" ) ; return t . innerHTML = e , t . querySelectorAll ( "[data-jio-math-source]" ) . forEach ( e => { const t = e . getAttribute ( "data-jio-math-source" ) || "" , a = "0" !== e . getAttribute ( "data-jio-math-display" ) , n = ` [jio_math display=" ${ a ? "1" : "0" } "] ${ t } [/jio_math] ` , o = e . closest ( "p" ) ; a && o && o . textContent ? . trim ( ) === e . textContent ? . trim ( ) ? o . textContent = n : e . replaceWith ( document . createTextNode ( n ) ) } ) , t . querySelectorAll ( "[data-jio-footnote]" ) . forEach ( e => { const t = e . getAttribute ( "data-jio-footnote" ) || "" ; e . replaceWith ( document . createTextNode ( ` [jio_footnote] ${ t } [/jio_footnote] ` ) ) } ) , t . innerHTML } function x ( e ) { return e && - 1 !== e . indexOf ( "[jio_" ) ? e . replace ( /\[jio_math display="([01])"\]([\s\S]*?)\[\/jio_math\]/g , ( e , t , a ) => "0" === t ? ` <span class="jio-math" data-jio-math-source=" ${ C ( a ) } " data-jio-math-display="0" contenteditable="false"> ${ M ( a ) } </span> ` : ` <p><span class="jio-math jio-math--block" data-jio-math-source=" ${ C ( a ) } " data-jio-math-display="1" contenteditable="false"> ${ M ( a ) } </span></p> ` ) . replace ( /\[jio_footnote\]([\s\S]*?)\[\/jio_footnote\]/g , ( e , t ) => ` <sup class="jio-footnote-ref" data-jio-footnote=" ${ C ( ( e => { const t = document . createElement ( "textarea" ) ; return t . innerHTML = e , t . value } )(t))}" contenteditable="false"> ${ t } </sup> ` ) : e } const M = e => e . replace ( /&/g , "&" ) . replace ( /</g , "<" ) . replace ( />/g , ">" ) . replace ( /\^\{([^{}]*)\}|\^(\S)/gu , "<sup>$1$2</sup>" ) . replace ( /_\{([^{}]*)\}|_(\S)/gu , "<sub>$1$2</sub>" ) , $ = { ready : ( 0 , a . _ _ ) ( "尚未保存" , "jio" ) , saving : ( 0 , a . _ _ ) ( "保存中…" , "jio" ) , saved : ( 0 , a . _ _ ) ( "已保存" , "jio" ) , error : ( 0 , a . _ _ ) ( "保存失败" , "jio" ) , conflict : ( 0 , a . _ _ ) ( "内容已在别处更新" , "jio" ) , submitting : ( 0 , a . _ _ ) ( "提交中…" , "jio" ) , submitted : ( 0 , a . _ _ ) ( "已提交" , "jio" ) } ; function L ( { value : t } ) { return ( 0 , e . createElement ) ( "span" , { className : ` jio-creator__save is- ${ t . state } ` , role : "status" , "aria-live" : "polite" } , ( 0 , e . createElement ) ( "i" , { className : "fa fas fa-circle" , "aria-hidden" : "true" } ) , ( 0 , e . createElement ) ( "span" , null , $ [ t . state ] || $ . ready ) , "saved" === t . state && t . at ? ( 0 , e . createElement ) ( "time" , null , t . at ) : null ) } const q = 36e5 , P = 24 * q , I = 30 * P , R = 365 * P , D = { ready : ( 0 , a . _ _ ) ( "草稿" , "jio" ) , saving : ( 0 , a . _ _ ) ( "保存中" , "jio" ) , saved : ( 0 , a . _ _ ) ( "草稿" , "jio" ) , error : ( 0 , a . _ _ ) ( "保存失败" , "jio" ) , conflict : ( 0 , a . _ _ ) ( "冲突" , "jio" ) , submitting : ( 0 , a . _ _ ) ( "提交中" , "jio" ) , submitted : ( 0 , a . _ _ ) ( "已提交" , "jio" ) } ; function z ( { charCount : t , saveState : n , isPublishedEdit : o , saving : r , onSaveDraft : i , onPreview : l , onPublish : c } ) { const s = n . at ? function ( e , t = Date . now ( ) ) { const n = Date . parse ( e ) ; if ( ! Number . isFinite ( n ) ) return "" ; const o = Math . max ( 0 , t - n ) ; return o < 6e4 ? ( 0 , a . _ _ ) ( "刚刚" , "jio" ) : o < q Line truncated
( 0 , a . _ _ ) ( "%d分钟前" , "jio" ) , Math . floor ( o / 6e4 ) ) : o < P ? ( 0 , a . sprintf ) ( /* translators: %d: hours */ /* translators: %d: hours */
( 0 , a . _ _ ) ( "%d小时 前" , "jio" ) , Math . floor ( o / q ) ) : o < I ? ( 0 , a . sprintf ) ( /* translators: %d: day s */ /* translators: %d: day s */
( 0 , a . _ _ ) ( "%d天 前" , "jio" ) , Math . floor ( o / P ) ) : o < R ? ( 0 , a . sprintf ) ( /* translators: %d: month s */ /* translators: %d: month s */
( 0 , a . _ _ ) ( "提取码:%s" , "jio" ) , o [ 1 ] ) , r . copyKey = ( 0 , a . _ _ ) ( "提取码" , "jio" ) , r . copyVal = o [ 1 ] ) , _ ( r ) } } ) , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator-dialog__ghost" , onClick : ( ) => r ( ( e , t ) => _ ( { url : e , attachmentId : t } ) ) } , ( 0 , e . createElement ) ( "i" , { className : "fa fas fa-upload" , "aria-hidden" : "true" } ) , " " , ( 0 , a . _ _ ) ( "上传附件" , "jio" ) ) ) , ( 0 , e . createElement ) ( "span" , { className : "jio-creator-dialog__hint" } , ( 0 , a . _ _ ) ( "支持直接粘贴网盘分享链接,会自动识别提取码。" , "jio" ) ) ) , ( 0 , e . createElement ) ( "label" , { className : "jio-creator-dialog__field" } , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "资源备注" , "jio" ) ) , ( 0 , e . createElement ) ( "input" , { type : "text" , value : s . extractCode , placeholder : ( 0 , a . _ _ ) ( "例如提取码、解压密码等" , "jio" ) , onChange : e => _ ( { extractCode : e . target . value } ) } ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-dialog__row" } , ( 0 , e . createElement ) ( "label" , null , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "复制名称" , "jio" ) ) , ( 0 , e . createElement ) ( "input" , { type : "text" , value : s . copyKey , placeholder : ( 0 , a . _ _ ) ( "如:提取码" , "jio" ) , onChange : e => _ ( { copyKey : e . target . value } ) } ) ) , ( 0 , e . createElement ) ( "label" , null , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "复制内容" , "jio" ) ) , ( 0 , e . createElement ) ( "input" , { type : "text" , value : s . copyVal , placeholder : ( 0 , a . _ _ ) ( "如:abcd" , "jio" ) , onChange : e => _ ( { copyVal : e . target . value } ) } ) ) ) , ( 0 , e . createElement ) ( "span" , { className : "jio-creator-dialog__hint" } , ( 0 , a . _ _ ) ( "填写后读者可点击按钮复制这段内容。" , "jio" ) ) , ( 0 , e . createElement ) ( "label" , { className : "jio-creator-dialog__field" } , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "自定义按钮文案" , "jio" ) ) , ( 0 , e . createElement ) ( "input" , { type : "text" , value : s . label , placeholder : ( 0 , a . _ _ ) ( "留空则按网盘自动识别" , "jio" ) , onChange : e => _ ( { label : e . target . value } ) } ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-dialog__field" } , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "按钮样式" , "jio" ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-swatches" } , o . map ( t => ( 0 , e . createElement ) ( "button" , { key : t || "default" , type : "button" , className : ` jio-creator-swatch ${ t || "b-theme" } ${ s . class === t ? " is-active" : "" } ` , onClick : ( ) => _ ( { class : t } ) , title : t || ( 0 , a . _ _ ) ( "默认样式" , "jio" ) , "aria-label" : t || ( 0 , a . _ _ ) ( "默认样式" , "jio" ) , "aria-pressed" : s . class === t } ) ) ) ) , u && ( 0 , e . createElement ) ( "p" , { className : "jio-creator-error" } , u ) ) , ( 0 , e . createElement ) ( "footer" , { className : "jio-creator-dialog__foot" } , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator-dialog__ghost" , onClick : c } , ( 0 , a . _ _ ) ( "取消" , "jio" ) ) , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator-dialog__primary" , onClick : ( ) => { const e = function ( e ) { const t = e . trim ( ) ; if ( ! t ) return "" ; try { const e = new URL ( t , window . location . href ) ; return "http:" === e . protocol || "https:" === e . protocol ? e . href : "" } catch ( e ) { return "" } } ( s . url ) ; if ( ! e ) return void m ( ( 0 , a . _ _ ) ( "请填写有效的下载地址" , "jio" ) ) ; m ( "" ) ; const t = /pan\.baidu\.com|aliyundrive\.com|alipan\.com|pan\.quark\.cn|cloud\.189\.cn|115\.com|lanzou|weiyun|123pan/i . test ( e ) ; i ( { ... n || { } , type : t ? "net_disk" : "direct" , url : e , attachmentId : Math . max ( 0 , Number ( s . attachmentId ) || 0 ) , extractCode : s . extractCode . trim ( ) , copyKey : s . copyKey . trim ( ) , copyVal : s . copyVal . trim ( ) , label : s . label . trim ( ) , class : s . class } ) } } , ( 0 , a . _ _ ) ( "确认" , "jio" ) ) ) ) ) } const s = ( e , t = 0 ) => { const a = Number ( e ) ; return Number . isFinite ( a ) ? a : t } ; function d ( { pay : n , onChange : o , canDownload : r , privateStorage : i , privateUploads : l , bootstrap : d , onUploadPrivate : u , uploading : m , uploadError : p , onPickAttachment : _ } ) { const [ f , b ] = ( 0 , t . useState ) ( null ) , h = ( 0 , t . useRef ) ( null ) , g = e => o ( { ... n , ... e } ) , y = "points" === n . modo , j = String ( d . currencySymbol || "¥" ) , v = d . downloadClasses && d . downloadClasses . length > 0 ? d . downloadClasses : [ "" , "c-blue" , "b-blue" , "jb-blue" ] , E = n . downloads , k = e => y ? ( 0 , a . sprintf ) ( /* translators: %s: VIP level name */ /* translators: %s: VIP level name */ ( 0 , a . _ _ ) ( "%s 积分" , "jio" ) , e ) : ( 0 , a . sprintf ) ( /* translators: %s: VIP level name */ /* translators: %s: VIP level name */ ( 0 , a . _ _ ) ( "%s 价格" , "jio" ) , e ) , w = ( t , a , n , o ) => { var r ; return ( 0 , e . createElement ) ( "label" , { className : "jio-creator-input" } , ( 0 , e . createElement ) ( "span" , null , t ) , ( 0 , e . createElement ) ( "span" , { className : "jio-creator-price" } , o . prefix && ( 0 , e . createElement ) ( "em" , null , o . prefix ) , ( 0 , e . createElement ) ( "input" , { type : "number" , min : null !== ( r = o . min ) && void 0 !== r ? r : 0 , step : o . step , value : a , placeholder : o . placeholder , onChange : e => n ( e . target . value ) } ) , o . suffix && ( 0 , e . createElement ) ( "em" , null , o . suffix ) ) ) } ; return ( 0 , e . createElement ) ( e . Fragment , null , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-switch" } , ( 0 , e . createElement ) ( "div" , null , ( 0 , e . createElement ) ( "h3" , null , ( 0 , a . _ _ ) ( "付费内容" , "jio" ) ) , ( 0 , e . createElement ) ( "p" , { className : "jio-creator-muted" } , ( 0 , a . _ _ ) ( "开启后,未购买读者只能看到免费部分;添加下载资源后同时出售下载权限。" , "jio" ) ) ) , ( 0 , e . createElement ) ( "label" , { className : "jio-creator-toggle" } , ( 0 , e . createElement ) ( "input" , { type : "checkbox" , checked : n . enabled , onChange : e => g ( { enabled : e . target . checked } ) } ) , ( 0 , e . createElement ) ( "span" , { "aria-hidden" : "true" } ) ) ) , n . enabled && ( 0 Line truncated
( 0 , a . _ _ ) ( "已开启,含 %d 个付费下载资源。" , "jio" ) , s . downloads . length ) : ( 0 , a . _ _ ) ( "已开启,未购买读者只能看到免费部分。" , "jio" ) : ( 0 , a . _ _ ) ( "开启后可以设置价格、会员价并添加付费下载资源。" , "jio" ) ) , s . enabled && ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator__setting-link" , onClick : _ } , ( 0 , e . createElement ) ( "i" , { className : "fa fas fa-coins" , "aria-hidden" : "true" } ) , ( 0 , a . _ _ ) ( "配置价格与付费资源" , "jio" ) ) ) , ( 0 , e . createElement ) ( "label" , { className : "jio-creator-toggle" } , ( 0 , e . createElement ) ( "input" , { type : "checkbox" , checked : s . enabled , onChange : e => { const t = e . target . checked ; p ( t ) , t && _ ( ) } } ) , ( 0 , e . createElement ) ( "span" , { "aria-hidden" : "true" } ) ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator__setting-row" } , ( 0 , e . createElement ) ( "div" , { className : "jio-creator__setting-copy" } , ( 0 , e . createElement ) ( "span" , { className : "jio-creator__setting-label" } , ( 0 , a . _ _ ) ( "定时发布" , "jio" ) ) , ( 0 , e . createElement ) ( "p" , { className : "jio-creator__setting-help" } , r ? ( 0 , a . _ _ ) ( "开启后到点自动发布,发布前不会出现在文章列表。" , "jio" ) : ( 0 , a . _ _ ) ( "当前账号提交后需要审核,审核通过后才会发布。" , "jio" ) ) ) , ( 0 , e . createElement ) ( "label" , { className : "jio-creator-toggle" } , ( 0 , e . createElement ) ( "input" , { type : "checkbox" , checked : l , disabled : ! r , onChange : e => m ( e . target . checked , c || E ( new Date ( Date . now ( ) + 36e5 ) ) ) } ) , ( 0 , e . createElement ) ( "span" , { "aria-hidden" : "true" } ) ) ) , r && l && ( 0 , e . createElement ) ( "div" , { className : "jio-creator__schedule" } , ( 0 , e . createElement ) ( "label" , null , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "发布时间" , "jio" ) ) , ( 0 , e . createElement ) ( "input" , { type : "datetime-local" , value : c , min : k , onChange : e => m ( ! 0 , e . target . value ) } ) ) , ( 0 , e . createElement ) ( "p" , { className : "jio-creator-muted" } , ( 0 , a . sprintf ) ( /* translators: %s: site timezone */ /* translators: %s: site timezone */
( 0 , a . _ _ ) ( "按站点时区(%s)发布,至少需要晚于当前时间 1 分钟。" , "jio" ) , String ( y . timezone || "UTC" ) ) ) ) ) } function w ( { centerUrl : t , site : n , viewer : o } ) { const r = String ( n . name || "" ) , i = String ( o . avatar || "" ) , l = t || "/" ; return ( 0 , e . createElement ) ( "header" , { className : "jio-creator__masthead" } , ( 0 , e . createElement ) ( "div" , { className : "jio-creator__masthead-left" } , ( 0 , e . createElement ) ( "a" , { className : "jio-creator__back" , href : t || "/" , "aria-label" : ( 0 , a . _ _ ) ( "返回作者中心" , "jio" ) } , ( 0 , e . createElement ) ( "i" , { className : "fa fas fa-angle-left" , "aria-hidden" : "true" } ) ) , ( 0 , e . createElement ) ( "a" , { className : "jio-creator__brand" , href : String ( n . home || "/" ) , "aria-label" : r || ( 0 , a . _ _ ) ( "返回首页" , "jio" ) } , n . logo ? ( 0 , e . createElement ) ( "img" , { className : "jio-creator__brand-logo" , src : String ( n . logo ) , alt : r } ) : ( 0 , e . createElement ) ( "span" , { className : "jio-creator__brand-text" } , r ) ) ) , ( 0 , e . createElement ) ( "a" , { className : "jio-creator__me" , href : l , "aria-label" : ( 0 , a . _ _ ) ( "返回作者中心" , "jio" ) } , i ? ( 0 , e . createElement ) ( "img" , { className : "jio-creator__me-avatar" , src : i , alt : "" , width : 32 , height : 32 } ) : ( 0 , e . createElement ) ( "span" , { className : "jio-creator__me-avatar is-placeholder" , "aria-hidden" : "true" } , ( 0 , e . createElement ) ( "i" , { className : "fa fas fa-user" } ) ) ) ) } function N ( e ) { const t = ( e . downloads || [ ] ) . map ( e => { const t = "string" == typeof e . label ? e . label : "" , a = "string" == typeof e . assetKey ? e . assetKey : "" ; if ( a ) return { type : "protected" , asset _key : a , label : t } ; const n = "string" == typeof e . url ? e . url . trim ( ) : "" ; return n ? { type : "net_disk" === e . type ? "net_disk" : "direct" , url : n , label : t , extract _code : "string" == typeof e . extractCode ? e . extractCode : "" , copy _key : "string" == typeof e . copyKey ? e . copyKey : "" , copy _val : "string" == typeof e . copyVal ? e . copyVal : "" , class : "string" == typeof e . class ? e . class : "" , attachment _id : Math . max ( 0 , Number ( e . attachmentId ) || 0 ) } : null } ) . filter ( Boolean ) , a = "points" === e . modo ; return { enabled : ! ! e . enabled , fields : { pay _type : e . enabled ? t . length > 0 ? "download" : "reading" : "no" , pay _modo : a ? "points" : "0" , price : a ? "0.00" : String ( e . price || "0.00" ) , points _price : a ? Math . max ( 0 , Number ( e . points ) || 0 ) : 0 , vip1 _price : a ? "0.00" : String ( e . vip1Price || "0.00" ) , vip2 _price : a ? "0.00" : String ( e . vip2Price || "0.00" ) , vip1 _points : a ? Math . max ( 0 , Number ( e . vip1Points ) || 0 ) : 0 , vip2 _points : a ? Math . max ( 0 , Number ( e . vip2Points ) || 0 ) : 0 , pay _limit : Number ( e . payLimit ) || 0 , downloads : t } } } const C = e => e . replace ( /&/g , "&" ) . replace ( /"/g , """ ) . replace ( /</g , "<" ) . replace ( />/g , ">" ) ; function S ( e ) { if ( ! e || - 1 === e . indexOf ( "data-jio-" ) ) return e ; const t = document . createElement ( "div" ) ; return t . innerHTML = e , t . querySelectorAll ( "[data-jio-math-source]" ) . forEach ( e => { const t = e . getAttribute ( "data-jio-math-source" ) || "" , a = "0" !== e . getAttribute ( "data-jio-math-display" ) , n = ` [jio_math display=" ${ a ? "1" : "0" } "] ${ t } [/jio_math] ` , o = e . closest ( "p" ) ; a && o && o . textContent ? . trim ( ) === e . textContent ? . trim ( ) ? o . textContent = n : e . replaceWith ( document . createTextNode ( n ) ) } ) , t . querySelectorAll ( "[data-jio-footnote]" ) . forEach ( e => { const t = e . getAttribute ( "data-jio-footnote" ) || "" ; e . replaceWith ( document . createTextNode ( ` [jio_footnote] ${ t } [/jio_footnote] ` ) ) } ) , t . innerHTML } function x ( e ) { return e && - 1 !== e . indexOf ( "[jio_" ) ? e . replace ( /\[jio_math display="([01])"\]([\s\S]*?)\[\/jio_math\]/g , ( e , t , a ) => "0" === t ? ` <span class="jio-math" data-jio-math-source=" ${ C ( a ) } " data-jio-math-display="0" contenteditable="false"> ${ M ( a ) } </span> ` : ` <p><span class="jio-math jio-math--block" data-jio-math-source=" ${ C ( a ) } " data-jio-math-display="1" contenteditable="false"> ${ M ( a ) } </span></p> ` ) . replace ( /\[jio_footnote\]([\s\S]*?)\[\/jio_footnote\]/g , ( e , t ) => ` <sup class="jio-footnote-ref" data-jio-footnote=" ${ C ( ( e => { const t = document . createElement ( "textarea" ) ; return t . innerHTML = e , t . value } )(t))}" contenteditable="false"> ${ t } </sup> ` ) : e } const M = e => e . replace ( /&/g , "&" ) . replace ( /</g , "<" ) . replace ( />/g , ">" ) . replace ( /\^\{([^{}]*)\}|\^(\S)/gu , "<sup>$1$2</sup>" ) . replace ( /_\{([^{}]*)\}|_(\S)/gu , "<sub>$1$2</sub>" ) , $ = { ready : ( 0 , a . _ _ ) ( "尚未保存" , "jio" ) , saving : ( 0 , a . _ _ ) ( "保存中…" , "jio" ) , saved : ( 0 , a . _ _ ) ( "已保存" , "jio" ) , error : ( 0 , a . _ _ ) ( "保存失败" , "jio" ) , conflict : ( 0 , a . _ _ ) ( "内容已在别处更新" , "jio" ) , submitting : ( 0 , a . _ _ ) ( "提交中…" , "jio" ) , submitted : ( 0 , a . _ _ ) ( "已提交" , "jio" ) } ; function L ( { value : t } ) { return ( 0 , e . createElement ) ( "span" , { className : ` jio-creator__save is- ${ t . state } ` , role : "status" , "aria-live" : "polite" } , ( 0 , e . createElement ) ( "i" , { className : "fa fas fa-circle" , "aria-hidden" : "true" } ) , ( 0 , e . createElement ) ( "span" , null , $ [ t . state ] || $ . ready ) , "saved" === t . state && t . at ? ( 0 , e . createElement ) ( "time" , null , t . at ) : null ) } const P = 36e5 , q = 24 * P , I = 30 * q , R = 365 * q , D = { ready : ( 0 , a . _ _ ) ( "草稿" , "jio" ) , saving : ( 0 , a . _ _ ) ( "保存中" , "jio" ) , saved : ( 0 , a . _ _ ) ( "草稿" , "jio" ) , error : ( 0 , a . _ _ ) ( "保存失败" , "jio" ) , conflict : ( 0 , a . _ _ ) ( "冲突" , "jio" ) , submitting : ( 0 , a . _ _ ) ( "提交中" , "jio" ) , submitted : ( 0 , a . _ _ ) ( "已提交" , "jio" ) } ; function z ( { charCount : t , saveState : n , isPublishedEdit : o , saving : r , onSaveDraft : i , onPreview : l , onPublish : c } ) { const s = n . at ? function ( e , t = Date . now ( ) ) { const n = Date . parse ( e ) ; if ( ! Number . isFinite ( n ) ) return "" ; const o = Math . max ( 0 , t - n ) ; return o < 6e4 ? ( 0 , a . _ _ ) ( "刚刚" , "jio" ) : o < P Line truncated
( 0 , a . _ _ ) ( "%d分钟 前" , "jio" ) , Math . floor ( o / 6e4 ) ) : o < q ? ( 0 , a . sprintf ) ( /* translators: %d: hour s */ /* translators: %d: hour s */
( 0 , a . _ _ ) ( "%d小时 前" , "jio" ) , Math . floor ( o / P ) ) : o < I ? ( 0 , a . sprintf ) ( /* translators: %d: day s */ /* translators: %d: day s */
( 0 , a . _ _ ) ( "%d天前" , "jio" ) , Math . floor ( o / q ) ) : o < R ? ( 0 , a . sprintf ) ( /* translators: %d: months */ /* translators: %d: months */
( 0 , a . _ _ ) ( "%d个月前" , "jio" ) , Math . floor ( o / I ) ) : ( 0 , a . sprintf ) ( /* translators: %d: years */ /* translators: %d: years */
( 0 , a . _ _ ) ( "%d年前" , "jio" ) , Math . floor ( o / R ) ) } ( n . at ) : "" , d = D [ n . state ] || D . ready ; return ( 0 , e . createElement ) ( "footer" , { className : "jio-creator__status" , role : "contentinfo" } , ( 0 , e . createElement ) ( "div" , { className : "jio-creator__status-left" } , ( 0 , e . createElement ) ( "span" , { className : "jio-creator__status-count" } , ( 0 , a . _ _ ) ( "字数" , "jio" ) , ": " , t ) , ( 0 , e . createElement ) ( "span" , { className : "jio-creator__status-mode" } , ( 0 , a . _ _ ) ( "Markdown 语法输入中" , "jio" ) ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator__status-meta" } , ( 0 , e . createElement ) ( L , { value : n } ) , ( 0 , e . createElement ) ( "span" , { className : "jio-creator__status-dot" , "aria-hidden" : "true" } , "·" ) , ( 0 , e . createElement ) ( "span" , { className : "jio-creator__status-time" } , s || d ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator__status-actions" } , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator__status-ghost" , onClick : i , disabled : r } , ( 0 , a . _ _ ) ( "保存草稿" , "jio" ) ) , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator__status-ghost" , onClick : l , disabled : r } , ( 0 , a . _ _ ) ( "预览" , "jio" ) ) , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator__status-primary" , onClick : c , disabled : r } , o ? ( 0 , a . _ _ ) ( "提交改稿" , "jio" ) : ( 0 , a . _ _ ) ( "发布" , "jio" ) ) ) ) } const A = e => e . replace ( /&/g , "&" ) . replace ( /</g , "<" ) . replace ( />/g , ">" ) . replace ( /"/g , """ ) , U = /<(?:p|div|h[1-6]|ul|ol|li|blockquote|pre|table|figure|section)\b/i , V = e => { const t = e . trim ( ) ; return "" === t ? "<p></p>" : U . test ( t ) ? t : ` <p> ${ t } </p> ` } ; const B = { reply : { open : "[reply]" , close : "[/reply]" , label : ( 0 , a . _ _ ) ( "评论后可查看" , "jio" ) } , login : { open : '[jio_hide mode="login"]' , close : "[/jio_hide]" , label : ( 0 , a . _ _ ) ( "登录后可查看" , "jio" ) } , vip : { open : "[vip]" , close : "[/vip]" , label : ( 0 , a . _ _ ) ( "会员可查看" , "jio" ) } , payshow : { open : "[payshow]" , close : "[/payshow]" , label : ( 0 , a . _ _ ) ( "付费后可查看" , "jio" ) } } , K = ( e , t , a ) => Math . min ( a , Math . max ( t , Number . isFinite ( e ) ? Math . round ( e ) : t ) ) , T = { table : ( 0 , a . _ _ ) ( "插入表格" , "jio" ) , math : ( 0 , a . _ _ ) ( "插入公式" , "jio" ) , footnote : ( 0 , a . _ _ ) ( "插入注释" , "jio" ) } ; function F ( { kind : n , onSubmit : o , onClose : r } ) { const [ i , l ] = ( 0 , t . useState ) ( 3 ) , [ c , s ] = ( 0 , t . useState ) ( 3 ) , [ d , u ] = ( 0 , t . useState ) ( ! 0 ) , [ m , p ] = ( 0 , t . useState ) ( ! 1 ) , [ _ , f ] = ( 0 , t . useState ) ( "a^2 + b^2 = c^2" ) , [ b , h ] = ( 0 , t . useState ) ( ! 0 ) , [ g , j ] = ( 0 , t . useState ) ( "" ) , y = ( 0 , t . useRef ) ( null ) , v = ( 0 , t . useRef ) ( null ) , E = ( 0 , t . useRef ) ( null ) , k = ( 0 , t . useRef ) ( null ) ; ( 0 , t . useEffect ) ( ( ) => { ( v . current || E . current || k . current ) ? . focus ( ) ; const e = e => { "Escape" === e . key && ( e . preventDefault ( ) , r ( ) ) } ; return document . addEventListener ( "keydown" , e ) , ( ) => document . removeEventListener ( "keydown" , e ) } , [ r ] ) ; const w = ( 0 , t . useMemo ) ( ( ) => "footnote" === n ? "" !== g . trim ( ) : "math" !== n || "" !== _ . trim ( ) , [ n , g , _ ] ) ; return ( 0 , e . createElement ) ( "div" , { className : "jio-creator-dialog" , role : "dialog" , "aria-modal" : "true" , "aria-labelledby" : "jio-creator-dialog-title" } , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator-dialog__backdrop" , "aria-label" : ( 0 , a . _ _ ) ( "关闭" , "jio" ) , onClick : r } ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-dialog__panel" , ref : y } , ( 0 , e . createElement ) ( "header" , { className : "jio-creator-dialog__head" } , ( 0 , e . createElement ) ( "h2" , { id : "jio-creator-dialog-title" } , T [ n ] ) , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator-dialog__close" , onClick : r , "aria-label" : ( 0 , a . _ _ ) ( "关闭" , "jio" ) } , ( 0 , e . createElement ) ( "i" , { className : "fa fas fa-times" , "aria-hidden" : "true" } ) ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-dialog__body" } , "table" === n && ( 0 , e . createElement ) ( e . Fragment , null , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-dialog__row" } , ( 0 , e . createElement ) ( "label" , null , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "行数" , "jio" ) ) , ( 0 , e . createElement ) ( "input" , { ref : v , type : "number" , min : 1 , max : 20 , value : i , onChange : e => l ( Number ( e . target . value ) ) } ) ) , ( 0 , e . createElement ) ( "label" , null , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "列数" , "jio" ) ) , ( 0 , e . createElement ) ( "input" , { type : "number" , min : 1 , max : 10 , value : c , onChange : e => s ( Number ( e . target . value ) ) } ) ) ) , ( 0 , e . createElement ) ( "label" , { className : "jio-creator-dialog__check" } , ( 0 , e . createElement ) ( "input" , { type : "checkbox" , checked : d , onChange : e => u ( e . target . checked ) } ) , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "首行为表头" , "jio" ) ) ) , ( 0 , e . createElement ) ( "label" , { className : "jio-creator-dialog__check" } , ( 0 , e . createElement ) ( "input" , { type : "checkbox" , checked : m , onChange : e => p ( e . target . checked ) } ) , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "隔行变色" , "jio" ) ) ) ) , "math" === n && ( 0 , e . createElement ) ( e . Fragment , null , ( 0 , e . createElement ) ( "label" , { className : "jio-creator-dialog__field" } , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "公式" , "jio" ) ) , ( 0 , e . createElement ) ( "textarea" , { ref : E , rows : 3 , value : _ , onChange : e => f ( e . target . value ) , placeholder : "a^2 + b^2 = c^2" } ) ) , ( 0 , e . createElement ) ( "p" , { className : "jio-creator-muted" } , ( 0 , a . _ _ ) ( "支持上标 ^ 与下标 _,例如 x^2 与 a_n;暂不支持完整 LaTeX。" , "jio" ) ) , ( 0 , e . createElement ) ( "label" , { className : "jio-creator-dialog__check" } , ( 0 , e . createElement ) ( "input" , { type : "checkbox" , checked : b , onChange : e => h ( e . target . checked ) } ) , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "独占一行显示" , " Line truncated
( 0 , a . _ _ ) ( "请输入标题(最多 %d 个字)" , "jio" ) , Number ( ne . titleMax ) || 100 ) , spellCheck : ! 1 , maxLength : Number ( ne . titleMax ) || 100 } ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator__editor" , "data-editor-ready" : m ? "true" : "false" } , ( 0 , e . createElement ) ( "textarea" , { id : Q , defaultValue : n . content , onChange : e => le ( e . target . value ) , "aria-label" : ( 0 , a . _ _ ) ( "文章正文" , "jio" ) } ) ) ) , ( 0 , e . createElement ) ( k , { featured : n . featured , canEditCover : ! ! ae . canUploadImage , canSchedule : ! ! ae . canSchedule , scheduleEnabled : ! ! n . schedule . enabled , scheduleAt : n . schedule . at , onFeaturedChange : e => ie ( { featured : e } ) , onScheduleChange : ( e , t ) => ie ( { schedule : { enabled : e , at : t } } ) } ) , P && ( 0 , e . createElement ) ( F , { kind : P , onSubmit : xe , onClose : ( ) => I ( null ) } ) , ( 0 , e . createElement ) ( z , { charCount : re , saveState : M , isPublishedEdit : oe , saving : ! m || "saving" === M . state || "submitting" === M . state , onSaveDraft : ( ) => { me ( ! 1 ) } , onPreview : ( ) => { _e ( ) } , onPublish : ( ) => q ( ! 0 ) } ) , L && ( 0 , e . createElement ) ( p , { draft : n , setDraft : ie , capabilities : ae , limits : ne , taxonomy : { categories : W . categories && W . categories . items || [ ] , tags : ! ! W . tags ? . enabled , customDefs : W . customDefs || [ ] } , isPublishedEdit : oe , onClose : ( ) => q ( ! 1 ) , onSaveDraft : ( ) => { me ( ! 1 ) } , onSubmit : e => { pe ( e ) } , privateStorage : ! ! W . privateStorage , privateUploads : W . privateUploads || [ ] , captcha : ! ! W . captcha ? . enabled , saving : "saving" === M . state || "submitting" === M . state } ) ) } function ae ( ) { const a = document . getElementById ( "jio-creator-studio" ) ; a && ( a . classList . add ( "is-ready" ) , ( 0 , t . createRoot ) ( a ) . render ( ( 0 , e . createElement ) ( te , null ) ) ) } "loading" === document . readyState ? document . addEventListener ( "DOMContentLoaded" , ae ) : ae ( ) } ) ( ) ;
( 0 , a . _ _ ) ( "%d年前" , "jio" ) , Math . floor ( o / R ) ) } ( n . at ) : "" , d = D [ n . state ] || D . ready ; return ( 0 , e . createElement ) ( "footer" , { className : "jio-creator__status" , role : "contentinfo" } , ( 0 , e . createElement ) ( "div" , { className : "jio-creator__status-left" } , ( 0 , e . createElement ) ( "span" , { className : "jio-creator__status-count" } , ( 0 , a . _ _ ) ( "字数" , "jio" ) , ": " , t ) , ( 0 , e . createElement ) ( "span" , { className : "jio-creator__status-mode" } , ( 0 , a . _ _ ) ( "Markdown 语法输入中" , "jio" ) ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator__status-meta" } , ( 0 , e . createElement ) ( L , { value : n } ) , ( 0 , e . createElement ) ( "span" , { className : "jio-creator__status-dot" , "aria-hidden" : "true" } , "·" ) , ( 0 , e . createElement ) ( "span" , { className : "jio-creator__status-time" } , s || d ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator__status-actions" } , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator__status-ghost" , onClick : i , disabled : r } , ( 0 , a . _ _ ) ( "保存草稿" , "jio" ) ) , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator__status-ghost" , onClick : l , disabled : r } , ( 0 , a . _ _ ) ( "预览" , "jio" ) ) , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator__status-primary" , onClick : c , disabled : r } , o ? ( 0 , a . _ _ ) ( "提交改稿" , "jio" ) : ( 0 , a . _ _ ) ( "发布" , "jio" ) ) ) ) } const A = e => e . replace ( /&/g , "&" ) . replace ( /</g , "<" ) . replace ( />/g , ">" ) . replace ( /"/g , """ ) , U = /<(?:p|div|h[1-6]|ul|ol|li|blockquote|pre|table|figure|section)\b/i , V = e => { const t = e . trim ( ) ; return "" === t ? "<p></p>" : U . test ( t ) ? t : ` <p> ${ t } </p> ` } ; const B = { reply : { open : "[reply]" , close : "[/reply]" , label : ( 0 , a . _ _ ) ( "评论后可查看" , "jio" ) } , login : { open : '[jio_hide mode="login"]' , close : "[/jio_hide]" , label : ( 0 , a . _ _ ) ( "登录后可查看" , "jio" ) } , vip : { open : "[vip]" , close : "[/vip]" , label : ( 0 , a . _ _ ) ( "会员可查看" , "jio" ) } , payshow : { open : "[payshow]" , close : "[/payshow]" , label : ( 0 , a . _ _ ) ( "付费后可查看" , "jio" ) } } , K = ( e , t , a ) => Math . min ( a , Math . max ( t , Number . isFinite ( e ) ? Math . round ( e ) : t ) ) , T = { table : ( 0 , a . _ _ ) ( "插入表格" , "jio" ) , math : ( 0 , a . _ _ ) ( "插入公式" , "jio" ) , footnote : ( 0 , a . _ _ ) ( "插入注释" , "jio" ) } ; function F ( { kind : n , onSubmit : o , onClose : r } ) { const [ i , l ] = ( 0 , t . useState ) ( 3 ) , [ c , s ] = ( 0 , t . useState ) ( 3 ) , [ d , u ] = ( 0 , t . useState ) ( ! 0 ) , [ m , p ] = ( 0 , t . useState ) ( ! 1 ) , [ _ , f ] = ( 0 , t . useState ) ( "a^2 + b^2 = c^2" ) , [ b , h ] = ( 0 , t . useState ) ( ! 0 ) , [ g , y ] = ( 0 , t . useState ) ( "" ) , j = ( 0 , t . useRef ) ( null ) , v = ( 0 , t . useRef ) ( null ) , E = ( 0 , t . useRef ) ( null ) , k = ( 0 , t . useRef ) ( null ) ; ( 0 , t . useEffect ) ( ( ) => { ( v . current || E . current || k . current ) ? . focus ( ) ; const e = e => { "Escape" === e . key && ( e . preventDefault ( ) , r ( ) ) } ; return document . addEventListener ( "keydown" , e ) , ( ) => document . removeEventListener ( "keydown" , e ) } , [ r ] ) ; const w = ( 0 , t . useMemo ) ( ( ) => "footnote" === n ? "" !== g . trim ( ) : "math" !== n || "" !== _ . trim ( ) , [ n , g , _ ] ) ; return ( 0 , e . createElement ) ( "div" , { className : "jio-creator-dialog" , role : "dialog" , "aria-modal" : "true" , "aria-labelledby" : "jio-creator-dialog-title" } , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator-dialog__backdrop" , "aria-label" : ( 0 , a . _ _ ) ( "关闭" , "jio" ) , onClick : r } ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-dialog__panel" , ref : j } , ( 0 , e . createElement ) ( "header" , { className : "jio-creator-dialog__head" } , ( 0 , e . createElement ) ( "h2" , { id : "jio-creator-dialog-title" } , T [ n ] ) , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator-dialog__close" , onClick : r , "aria-label" : ( 0 , a . _ _ ) ( "关闭" , "jio" ) } , ( 0 , e . createElement ) ( "i" , { className : "fa fas fa-times" , "aria-hidden" : "true" } ) ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-dialog__body" } , "table" === n && ( 0 , e . createElement ) ( e . Fragment , null , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-dialog__row" } , ( 0 , e . createElement ) ( "label" , null , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "行数" , "jio" ) ) , ( 0 , e . createElement ) ( "input" , { ref : v , type : "number" , min : 1 , max : 20 , value : i , onChange : e => l ( Number ( e . target . value ) ) } ) ) , ( 0 , e . createElement ) ( "label" , null , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "列数" , "jio" ) ) , ( 0 , e . createElement ) ( "input" , { type : "number" , min : 1 , max : 10 , value : c , onChange : e => s ( Number ( e . target . value ) ) } ) ) ) , ( 0 , e . createElement ) ( "label" , { className : "jio-creator-dialog__check" } , ( 0 , e . createElement ) ( "input" , { type : "checkbox" , checked : d , onChange : e => u ( e . target . checked ) } ) , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "首行为表头" , "jio" ) ) ) , ( 0 , e . createElement ) ( "label" , { className : "jio-creator-dialog__check" } , ( 0 , e . createElement ) ( "input" , { type : "checkbox" , checked : m , onChange : e => p ( e . target . checked ) } ) , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "隔行变色" , "jio" ) ) ) ) , "math" === n && ( 0 , e . createElement ) ( e . Fragment , null , ( 0 , e . createElement ) ( "label" , { className : "jio-creator-dialog__field" } , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "公式" , "jio" ) ) , ( 0 , e . createElement ) ( "textarea" , { ref : E , rows : 3 , value : _ , onChange : e => f ( e . target . value ) , placeholder : "a^2 + b^2 = c^2" } ) ) , ( 0 , e . createElement ) ( "p" , { className : "jio-creator-muted" } , ( 0 , a . _ _ ) ( "支持上标 ^ 与下标 _,例如 x^2 与 a_n;暂不支持完整 LaTeX。" , "jio" ) ) , ( 0 , e . createElement ) ( "label" , { className : "jio-creator-dialog__check" } , ( 0 , e . createElement ) ( "input" , { type : "checkbox" , checked : b , onChange : e => h ( e . target . checked ) } ) , ( 0 , e . createElement ) ( "span" , null , ( 0 , a . _ _ ) ( "独占一行显示" , " Line truncated
( 0 , a . _ _ ) ( "请输入标题(最多 %d 个字)" , "jio" ) , Number ( re . titleMax ) || 100 ) , spellCheck : ! 1 , maxLength : Number ( re . titleMax ) || 100 } ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator__editor" , "data-editor-ready" : m ? "true" : "false" } , ( 0 , e . createElement ) ( "textarea" , { id : Q , defaultValue : n . content , onChange : e => se ( e . target . value ) , "aria-label" : ( 0 , a . _ _ ) ( "文章正文" , "jio" ) } ) ) ) , ( 0 , e . createElement ) ( k , { featured : n . featured , canEditCover : ! ! oe . canUploadImage , canSchedule : ! ! oe . canSchedule , scheduleEnabled : ! ! n . schedule . enabled , scheduleAt : n . schedule . at , pay : n . pay , canPay : ! ! oe . canPay , onFeaturedChange : e => ce ( { featured : e } ) , onScheduleChange : ( e , t ) => ce ( { schedule : { enabled : e , at : t } } ) , onPayEnabledChange : e => ce ( { pay : { ... i . current . pay , enabled : e } } ) , onOpenPaySettings : ( ) => { I ( ! 0 ) , P ( ! 0 ) } } ) , R && ( 0 , e . createElement ) ( F , { kind : R , onSubmit : $e , onClose : ( ) => D ( null ) } ) , ( 0 , e . createElement ) ( z , { charCount : le , saveState : M , isPublishedEdit : ie , saving : ! m || "saving" === M . state || "submitting" === M . state , onSaveDraft : ( ) => { _e ( ! 1 ) } , onPreview : ( ) => { be ( ) } , onPublish : ( ) => { I ( ! 1 ) , P ( ! 0 ) } } ) , L && ( 0 , e . createElement ) ( p , { draft : n , setDraft : ce , capabilities : oe , limits : re , taxonomy : { categories : W . categories && W . categories . items || [ ] , tags : ! ! W . tags ? . enabled , customDefs : W . customDefs || [ ] } , isPublishedEdit : ie , focusPay : q , onClose : ( ) => { P ( ! 1 ) , I ( ! 1 ) } , onSaveDraft : ( ) => { _e ( ! 1 ) } , onSubmit : e => { fe ( e ) } , privateStorage : ! ! W . privateStorage , privateUploads : W . privateUploads || [ ] , captcha : ! ! W . captcha ? . enabled , saving : "saving" === M . state || "submitting" === M . state } ) ) } function ae ( ) { const a = document . getElementById ( "jio-creator-studio" ) ; a && ( a . classList . add ( "is-ready" ) , ( 0 , t . createRoot ) ( a ) . render ( ( 0 , e . createElement ) ( te , null ) ) ) } "loading" === document . readyState ? document . addEventListener ( "DOMContentLoaded" , ae ) : ae ( ) } ) ( ) ;