@@ -1,3 +1,3 @@
( ( ) => { "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 r ( e ) { try { return await e . json ( ) } catch ( e ) { return null } } async function o ( e , t , a ) { const o = await fetch ( e , { method : "POST" , credentials : "same-origin" , headers : { "Content-Type" : "application/json" , "X-WP-Nonce" : a } , body : JSON . stringify ( t ) } ) , l = await r ( o ) ; if ( ! o . ok ) throw n ( l , o . status ) ; return l } async function l ( e , t , a , o = { } ) { const l = new FormData ; l . append ( "file" , t ) , Object . entries ( o ) . forEach ( ( [ e , t ] ) => l . append ( e , t ) ) ; const i = await fetch ( e , { method : "POST" , credentials : "same-origin" , headers : { "X-WP-Nonce" : a } , body : l } ) , c = await r ( i ) ; if ( ! i . ok ) throw n ( c , i . status ) ; return c } const i = window . jioCreatorStudio || { } , c = i . nonce || "" ; function s ( n ) { const { draft : r , setDraft : o , capabilities : s , limits : u , taxonomy : d , isPublishedEdit : m , onClose : p , onSaveDraft : _ , onSubmit : b , privateStorage : f , privateUploads : g , saving : h , captcha : j } = n , [ E , y ] = ( 0 , t . useState ) ( "" ) , [ v , k ] = ( 0 , t . useState ) ( "" ) , [ N , w ] = ( 0 , t . useState ) ( ! 1 ) , C = ( 0 , t . useRef ) ( null ) , S = ( 0 , t . useRef ) ( null ) ; ( 0 , t . useEffect ) ( ( ) => { const e = S . current , t = document . getElementById ( "jio-creator-captcha" ) ; if ( ! e || ! t ) return ; const a = t . parentElement ; return e . appendChild ( t ) , t . removeAttribute ( "hidden" ) , ( ) => { a && ( a . appendChild ( t ) , t . setAttribute ( "hidden" , "" ) ) } } , [ ] ) ; const x = ( 0 , t . useMemo ) ( ( ) => ( r . title || "" ) . trim ( ) . length , [ r . title ] ) >= Number ( u . titleMin || 1 ) , M = ( ) => { const e = E . trim ( ) ; if ( ! e ) return ; const t = e . split ( /[,, \n]+/u ) . map ( e => e . trim ( ) ) . filter ( Boolean ) ; o ( { tags : Array . from ( new Set ( [ ... r . tags , ... t ] ) ) } ) , y ( "" ) } ; return ( 0 , e . createElement ) ( "div" , { className : "jio-creator-drawer" , role : "dialog" , "aria-modal" : "true" , "aria-labelledby" : "jio-creator-publish-title" } , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator-drawer__backdrop" , "aria-label" : ( 0 , a . _ _ ) ( "关闭" , "jio" ) , onClick : p } ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-drawer__panel" } , ( 0 , e . createElement ) ( "header" , { className : "jio-creator-drawer__head" } , ( 0 , e . createElement ) ( "h2" , { id : "jio-creator-publish-title" } , m ? ( 0 , a . _ _ ) ( "提交改稿" , "jio" ) : ( 0 , a . _ _ ) ( "发布文章" , "jio" ) ) , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator-drawer__close" , onClick : p , "aria-label" : ( 0 , a . _ _ ) ( "关闭" , "jio" ) } , ( 0 , e . createElement ) ( "i" , { className : "fa fas fa-times" , "aria-hidden" : "true" } ) ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-drawer__body" } , m && ( 0 , e . createElement ) ( "p" , { className : "jio-creator-drawer__note" } , ( 0 , a . _ _ ) ( "审核通过前,读者看到的仍然是当前线上版本。" , "jio" ) ) , ( 0 , e . createElement ) ( "section" , { className : "jio-creator-field" } , ( 0 , e . createElement ) ( "h3" , null , ( 0 , a . _ _ ) ( "分类" , "jio" ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-chips" } , 0 === d . categories . length && ( 0 , e . createElement ) ( "span" , { className : "jio-creator-muted" } , ( 0 , a . _ _ ) ( "暂无可选分类" , "jio" ) ) , d . categories . map ( t => ( 0 , e . createElement ) ( "label" , { key : t . id , className : "jio-creator-chip" + ( r . categories . includes ( t . id ) ? " is-active" : "" ) } , ( 0 , e . createElement ) ( "input" , { type : "checkbox" , checked : r . categories . includes ( t . id ) , onChange : ( ) => ( e => { const t = r . categories . includes ( e ) ; o ( { categories : t ? r . categories . filter ( t => t !== e ) : [ ... r . categories , e ] } ) } ) ( t . id ) } ) , ( 0 , e . createElement ) ( "span" , null , t . name ) ) ) ) ) , d . tags && ( 0 , e . createElement ) ( "section" , { className : "jio-creator-field" } , ( 0 , e . createElement ) ( "h3" , null , ( 0 , a . _ _ ) ( "标签" , "jio" ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-chips" } , r . tags . map ( t => ( 0 , e . createElement ) ( "span" , { key : t , className : "jio-creator-chip is-active" } , ( 0 , e . createElement ) ( "span" , null , t ) , ( 0 , e . createElement ) ( "button" , { type : "button" , onClick : ( ) => o ( { tags : r . tags . filter ( e => e !== t ) } ) , "aria-label" : ( 0 , a . sprintf ) ( ( 0 , a . _ _ ) ( "移除标签 %s" , "jio" ) , t ) } , ( 0 , e . createElement ) ( "i" , { className : "fa fas fa-times" , "aria-hidden" : "true" } ) ) ) ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-inline" } , ( 0 , e . createElement ) ( "input" , { type : "text" , value : E , placeholder : ( 0 , a . _ _ ) ( "输入标签,逗号分隔" , "jio" ) , onChange : e => y ( e . target . value ) , onKeyDown : e => { "Enter" === e . key && ( e . preventDefault ( ) , M ( ) ) } } ) , ( 0 , e . createElement ) ( "button" , { type : "button" , onClick : M } , ( 0 , a . _ _ ) ( "添加" , "jio" ) ) ) ) , d . customDefs . map ( t => ( 0 , e . createElement ) ( "section" , { className : "jio-creator-field" , key : t . key } , ( 0 , e . createElement ) ( "h3" , null , t . name ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-chips" } , t . values . map ( a => { const n = r . custom [ t . key ] || [ ] , l = n . includes ( a . key ) ; return ( 0 , e . createElement ) ( "label" , { key : a . key , className : "jio-creator-chip" + ( l ? " is-active" : "" ) } , ( 0 , e . createElement ) ( "input" , { type : "checkbox" , checked : l , onChange : ( ) => o ( { custom : { ... r . custom , [ t . key ] : l ? n . filter ( e => e !== a . key ) : [ ... n , a . key ] } } ) } ) , ( 0 , e . createElement ) ( "span" , null , a . name ) ) } ) ) ) ) , s . canPay && ( 0 , e . createElement ) ( "section" , { className : "jio-creator-field" } , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-switch" } , ( 0 , e . createElement ) ( "div" , null , ( 0 , e . createElement ) ( "h3" , null , ( 0 , a . _ _ ) ( "付费内容" , "jio" ) ) , ( 0 , e . Line truncated
( 0 , a . _ _ ) ( "按站点时区(%s)发布,至少需要晚于当前时间 1 分钟。" , "jio" ) , String ( m . timezone || "UTC" ) ) ) ) ) } const g = { 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 h ( { 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 , g [ t . state ] || g . ready ) , "saved" === t . state && t . at ? ( 0 , e . createElement ) ( "time" , null , t . at ) : null ) } function j ( e ) { const t = ( e . downloads || [ ] ) . map ( e => { const t = "string" == typeof e . assetKey ? e . assetKey : "" ; if ( t ) return { type : "protected" , asset _key : t , label : "string" == typeof e . label ? e . label : "" } ; const a = "string" == typeof e . url ? e . url . trim ( ) : "" ; return a ? { type : "direct" , url : a , label : "string" == typeof e . label ? e . label : "" , extract _code : "string" == typeof e . extractCode ? e . extractCode : "" } : null } ) . filter ( Boolean ) ; return { enabled : ! ! e . enabled , fields : { pay _type : e . enabled ? t . length > 0 ? "download" : "reading" : "no" , pay _modo : "points" === e . modo ? "points" : "0" , price : "points" === e . modo ? "0.00" : String ( e . price || "0.00" ) , points _price : "points" === e . modo ? Math . max ( 0 , Number ( e . points ) || 0 ) : 0 , vip1 _price : "points" === e . modo ? "0.00" : String ( e . vip1Price || "0.00" ) , vip2 _price : "points" === e . modo ? "0.00" : String ( e . vip2Price || "0.00" ) , pay _limit : Number ( e . payLimit ) || 0 , downloads : t } } } const E = e => e . replace ( /&/g , "&" ) . replace ( /</g , "<" ) . replace ( />/g , ">" ) . replace ( /"/g , """ ) , y = [ { value : "generic" , label : ( 0 , a . _ _ ) ( "通用" , "jio" ) } , { value : "javascript" , label : "JavaScript" } , { value : "typescript" , label : "TypeScript" } , { value : "php" , label : "PHP" } , { value : "python" , label : "Python" } , { value : "java" , label : "Java" } , { value : "go" , label : "Go" } , { value : "rust" , label : "Rust" } , { value : "csharp" , label : "C#" } , { value : "cpp" , label : "C++" } , { value : "sql" , label : "SQL" } , { value : "json" , label : "JSON" } , { value : "bash" , label : "Shell" } , { value : "css" , label : "CSS" } , { value : "html" , label : "HTML" } , { value : "markdown" , label : "Markdown" } ] ; function v ( e = "generic" , t = "" ) { const n = E ( "" !== t ? t : ( 0 , a . _ _ ) ( "在此输入代码" , "jio" ) ) ; return ` <pre class="enlighter-pre" data-enlighter-language=" ${ E ( e ) } "><code class="gl" data-enlighter-language=" ${ E ( e ) } "> ` + n + "</code></pre><p></p>" } const k = ( e , t , a ) => Math . min ( a , Math . max ( t , Number . isFinite ( e ) ? Math . round ( e ) : t ) ) , N = { table : ( 0 , a . _ _ ) ( "插入表格" , "jio" ) , math : ( 0 , a . _ _ ) ( "插入公式" , "jio" ) , footnote : ( 0 , a . _ _ ) ( "插入注释" , "jio" ) , code : ( 0 , a . _ _ ) ( "插入代码块" , "jio" ) } ; function w ( { kind : n , initialLanguage : r = "generic" , initialCode : o = "" , onSubmit : l , onClose : i } ) { const [ c , s ] = ( 0 , t . useState ) ( 3 ) , [ u , d ] = ( 0 , t . useState ) ( 3 ) , [ m , p ] = ( 0 , t . useState ) ( ! 0 ) , [ _ , b ] = ( 0 , t . useState ) ( ! 1 ) , [ f , g ] = ( 0 , t . useState ) ( "a^2 + b^2 = c^2" ) , [ h , j ] = ( 0 , t . useState ) ( ! 0 ) , [ E , v ] = ( 0 , t . useState ) ( "" ) , [ w , C ] = ( 0 , t . useState ) ( r ) , [ S , x ] = ( 0 , t . useState ) ( o ) , M = ( 0 , t . useRef ) ( null ) , q = ( 0 , t . useRef ) ( null ) , L = ( 0 , t . useRef ) ( null ) , $ = ( 0 , t . useRef ) ( null ) ; ( 0 , t . useEffect ) ( ( ) => { ( q . current || L . current || $ . current ) ? . focus ( ) ; const e = e => { "Escape" === e . key && ( e . preventDefault ( ) , i ( ) ) } ; return document . addEventListener ( "keydown" , e ) , ( ) => document . removeEventListener ( "keydown" , e ) } , [ i ] ) ; const I = ( 0 , t . useMemo ) ( ( ) => "footnote" === n ? "" !== E . trim ( ) : "math" !== n || "" !== f . trim ( ) , [ n , E , f ] ) ; 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 : i } ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-dialog__panel" , ref : M } , ( 0 , e . createElement ) ( "header" , { className : "jio-creator-dialog__head" } , ( 0 , e . createElement ) ( "h2" , { id : "jio-creator-dialog-title" } , N [ n ] ) , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator-dialog__close" , onClick : i , "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 : q , type : "number" , min : 1 , max : 20 , value : c , onChange : e => s ( 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 : u , onChange : e => d ( Number ( e . target . value ) ) } ) ) ) , ( 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" ) ) ) , ( 0 , e . createElement ) ( "label" , { className : "jio-creator-dialog__check" } , ( 0 , e . createElement ) ( "input" , { type : "checkbox" , checked : _ , onChange : e => b ( e . target . checked ) } ) , ( 0 , e . create Line truncated
( 0 , a . _ _ ) ( "请输入标题(最多 %d 个字)" , "jio" ) , Number ( Q . titleMax ) || 100 ) , spellCheck : ! 1 , maxLength : Number ( Q . titleMax ) || 100 } ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator__editor" , "data-editor-ready" : _ ? "true" : "false" } , ( 0 , e . createElement ) ( "textarea" , { id : M , defaultValue : n . content , onChange : e => G ( e . target . value ) , "aria-label" : ( 0 , a . _ _ ) ( "文章正文" , "jio" ) } ) ) ) , ( 0 , e . createElement ) ( f , { featured : n . featured , canEditCover : ! ! X . canUploadImage , canSchedule : ! ! X . canSchedule , scheduleEnabled : ! ! n . schedule . enabled , scheduleAt : n . schedule . at , onFeaturedChange : e => W ( { featured : e } ) , onScheduleChange : ( e , t ) => W ( { schedule : { enabled : e , at : t } } ) } ) , U && ( 0 , e . createElement ) ( w , { kind : U , onSubmit : fe , onClose : ( ) => z ( null ) } ) , F && ( 0 , e . createElement ) ( w , { kind : "code" , initialLanguage : F . language , initialCode : F . code , onSubmit : e => { if ( T ( null ) , "code" !== e . kind ) return ; const t = A . current ; if ( A . current = null , pe ( v ( e . language , e . code ) ) , t ) { const e = i . current ; e && ! e . removed && ( e . dom . remove ( t ) , G ( e . getContent ( ) ) ) } } , onClose : ( ) => { T ( null ) , A . current = null } } ) , D && ( 0 , e . createElement ) ( s , { draft : n , setDraft : W , capabilities : X , limits : Q , taxonomy : { categories : C . categories && C . categories . items || [ ] , tags : ! ! C . tags ? . enabled , customDefs : C . customDefs || [ ] } , isPublishedEdit : Y , onClose : ( ) => P ( ! 1 ) , onSaveDraft : ( ) => { ae ( ! 1 ) } , onSubmit : e => { ne ( e ) } , privateStorage : ! ! C . privateStorage , privateUploads : C . privateUploads || [ ] , captcha : ! ! C . captcha ? . enabled , saving : "saving" === I . state || "submitting" === I . state } ) ) } function R ( ) { const a = document . getElementById ( "jio-creator-studio" ) ; a && ( a . classList . add ( "is-ready" ) , ( 0 , t . createRoot ) ( a ) . render ( ( 0 , e . createElement ) ( I , null ) ) ) } "loading" === document . readyState ? document . addEventListener ( "DOMContentLoaded" , R ) : R ( ) } ) ( ) ;
( ( ) => { "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 ) } ) , l = await o ( r ) ; if ( ! r . ok ) throw n ( l , r . status ) ; return l } async function l ( e , t , a , r = { } ) { const l = new FormData ; l . append ( "file" , t ) , Object . entries ( r ) . forEach ( ( [ e , t ] ) => l . append ( e , t ) ) ; const i = await fetch ( e , { method : "POST" , credentials : "same-origin" , headers : { "X-WP-Nonce" : a } , body : l } ) , c = await o ( i ) ; if ( ! i . ok ) throw n ( c , i . status ) ; return c } const i = window . jioCreatorStudio || { } , c = i . nonce || "" ; function s ( n ) { const { draft : o , setDraft : r , capabilities : s , limits : u , taxonomy : d , isPublishedEdit : m , onClose : p , onSaveDraft : _ , onSubmit : f , privateStorage : b , privateUploads : g , saving : h , captcha : j } = n , [ y , E ] = ( 0 , t . useState ) ( "" ) , [ v , k ] = ( 0 , t . useState ) ( "" ) , [ N , w ] = ( 0 , t . useState ) ( ! 1 ) , C = ( 0 , t . useRef ) ( null ) , S = ( 0 , t . useRef ) ( null ) ; ( 0 , t . useEffect ) ( ( ) => { const e = S . current , t = document . getElementById ( "jio-creator-captcha" ) ; if ( ! e || ! t ) return ; const a = t . parentElement ; return e . appendChild ( t ) , t . removeAttribute ( "hidden" ) , ( ) => { a && ( a . appendChild ( t ) , t . setAttribute ( "hidden" , "" ) ) } } , [ ] ) ; const x = ( 0 , t . useMemo ) ( ( ) => ( o . title || "" ) . trim ( ) . length , [ o . title ] ) >= Number ( u . titleMin || 1 ) , q = ( ) => { const e = y . trim ( ) ; if ( ! e ) return ; const t = e . split ( /[,, \n]+/u ) . map ( e => e . trim ( ) ) . filter ( Boolean ) ; r ( { tags : Array . from ( new Set ( [ ... o . tags , ... t ] ) ) } ) , E ( "" ) } ; return ( 0 , e . createElement ) ( "div" , { className : "jio-creator-drawer" , role : "dialog" , "aria-modal" : "true" , "aria-labelledby" : "jio-creator-publish-title" } , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator-drawer__backdrop" , "aria-label" : ( 0 , a . _ _ ) ( "关闭" , "jio" ) , onClick : p } ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-drawer__panel" } , ( 0 , e . createElement ) ( "header" , { className : "jio-creator-drawer__head" } , ( 0 , e . createElement ) ( "h2" , { id : "jio-creator-publish-title" } , m ? ( 0 , a . _ _ ) ( "提交改稿" , "jio" ) : ( 0 , a . _ _ ) ( "发布文章" , "jio" ) ) , ( 0 , e . createElement ) ( "button" , { type : "button" , className : "jio-creator-drawer__close" , onClick : p , "aria-label" : ( 0 , a . _ _ ) ( "关闭" , "jio" ) } , ( 0 , e . createElement ) ( "i" , { className : "fa fas fa-times" , "aria-hidden" : "true" } ) ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-drawer__body" } , m && ( 0 , e . createElement ) ( "p" , { className : "jio-creator-drawer__note" } , ( 0 , a . _ _ ) ( "审核通过前,读者看到的仍然是当前线上版本。" , "jio" ) ) , ( 0 , e . createElement ) ( "section" , { className : "jio-creator-field" } , ( 0 , e . createElement ) ( "h3" , null , ( 0 , a . _ _ ) ( "分类" , "jio" ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-chips" } , 0 === d . categories . length && ( 0 , e . createElement ) ( "span" , { className : "jio-creator-muted" } , ( 0 , a . _ _ ) ( "暂无可选分类" , "jio" ) ) , d . categories . map ( t => ( 0 , e . createElement ) ( "label" , { key : t . id , className : "jio-creator-chip" + ( o . categories . includes ( t . id ) ? " is-active" : "" ) } , ( 0 , e . createElement ) ( "input" , { type : "checkbox" , checked : o . categories . includes ( t . id ) , onChange : ( ) => ( e => { const t = o . categories . includes ( e ) ; r ( { categories : t ? o . categories . filter ( t => t !== e ) : [ ... o . categories , e ] } ) } ) ( t . id ) } ) , ( 0 , e . createElement ) ( "span" , null , t . name ) ) ) ) ) , d . tags && ( 0 , e . createElement ) ( "section" , { className : "jio-creator-field" } , ( 0 , e . createElement ) ( "h3" , null , ( 0 , a . _ _ ) ( "标签" , "jio" ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-chips" } , o . tags . map ( t => ( 0 , e . createElement ) ( "span" , { key : t , className : "jio-creator-chip is-active" } , ( 0 , e . createElement ) ( "span" , null , t ) , ( 0 , e . createElement ) ( "button" , { type : "button" , onClick : ( ) => r ( { tags : o . tags . filter ( e => e !== t ) } ) , "aria-label" : ( 0 , a . sprintf ) ( ( 0 , a . _ _ ) ( "移除标签 %s" , "jio" ) , t ) } , ( 0 , e . createElement ) ( "i" , { className : "fa fas fa-times" , "aria-hidden" : "true" } ) ) ) ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-inline" } , ( 0 , e . createElement ) ( "input" , { type : "text" , value : y , placeholder : ( 0 , a . _ _ ) ( "输入标签,逗号分隔" , "jio" ) , onChange : e => E ( e . target . value ) , onKeyDown : e => { "Enter" === e . key && ( e . preventDefault ( ) , q ( ) ) } } ) , ( 0 , e . createElement ) ( "button" , { type : "button" , onClick : q } , ( 0 , a . _ _ ) ( "添加" , "jio" ) ) ) ) , d . customDefs . map ( t => ( 0 , e . createElement ) ( "section" , { className : "jio-creator-field" , key : t . key } , ( 0 , e . createElement ) ( "h3" , null , t . name ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-chips" } , t . values . map ( a => { const n = o . custom [ t . key ] || [ ] , l = n . includes ( a . key ) ; return ( 0 , e . createElement ) ( "label" , { key : a . key , className : "jio-creator-chip" + ( l ? " is-active" : "" ) } , ( 0 , e . createElement ) ( "input" , { type : "checkbox" , checked : l , onChange : ( ) => r ( { custom : { ... o . custom , [ t . key ] : l ? n . filter ( e => e !== a . key ) : [ ... n , a . key ] } } ) } ) , ( 0 , e . createElement ) ( "span" , null , a . name ) ) } ) ) ) ) , s . canPay && ( 0 , e . createElement ) ( "section" , { className : "jio-creator-field" } , ( 0 , e . createElement ) ( "div" , { className : "jio-creator-switch" } , ( 0 , e . createElement ) ( "div" , null , ( 0 , e . createElement ) ( "h3" , null , ( 0 , a . _ _ ) ( "付费内容" , "jio" ) ) , ( 0 , e . Line truncated
( 0 , a . _ _ ) ( "按站点时区(%s)发布,至少需要晚于当前时间 1 分钟。" , "jio" ) , String ( m . timezone || "UTC" ) ) ) ) ) } const g = { 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 h ( { 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 , g [ t . state ] || g . ready ) , "saved" === t . state && t . at ? ( 0 , e . createElement ) ( "time" , null , t . at ) : null ) } function j ( e ) { const t = ( e . downloads || [ ] ) . map ( e => { const t = "string" == typeof e . assetKey ? e . assetKey : "" ; if ( t ) return { type : "protected" , asset _key : t , label : "string" == typeof e . label ? e . label : "" } ; const a = "string" == typeof e . url ? e . url . trim ( ) : "" ; return a ? { type : "direct" , url : a , label : "string" == typeof e . label ? e . label : "" , extract _code : "string" == typeof e . extractCode ? e . extractCode : "" } : null } ) . filter ( Boolean ) ; return { enabled : ! ! e . enabled , fields : { pay _type : e . enabled ? t . length > 0 ? "download" : "reading" : "no" , pay _modo : "points" === e . modo ? "points" : "0" , price : "points" === e . modo ? "0.00" : String ( e . price || "0.00" ) , points _price : "points" === e . modo ? Math . max ( 0 , Number ( e . points ) || 0 ) : 0 , vip1 _price : "points" === e . modo ? "0.00" : String ( e . vip1Price || "0.00" ) , vip2 _price : "points" === e . modo ? "0.00" : String ( e . vip2Price || "0.00" ) , pay _limit : Number ( e . payLimit ) || 0 , downloads : t } } } const y = e => e . replace ( /&/g , "&" ) . replace ( /</g , "<" ) . replace ( />/g , ">" ) . replace ( /"/g , """ ) , E = [ { value : "generic" , label : ( 0 , a . _ _ ) ( "通用" , "jio" ) } , { value : "javascript" , label : "JavaScript" } , { value : "typescript" , label : "TypeScript" } , { value : "php" , label : "PHP" } , { value : "python" , label : "Python" } , { value : "java" , label : "Java" } , { value : "go" , label : "Go" } , { value : "rust" , label : "Rust" } , { value : "csharp" , label : "C#" } , { value : "cpp" , label : "C++" } , { value : "sql" , label : "SQL" } , { value : "json" , label : "JSON" } , { value : "bash" , label : "Shell" } , { value : "css" , label : "CSS" } , { value : "html" , label : "HTML" } , { value : "markdown" , label : "Markdown" } ] ; const v = ( e , t , a ) => Math . min ( a , Math . max ( t , Number . isFinite ( e ) ? Math . round ( e ) : t ) ) , k = { table : ( 0 , a . _ _ ) ( "插入表格" , "jio" ) , math : ( 0 , a . _ _ ) ( "插入公式" , "jio" ) , footnote : ( 0 , a . _ _ ) ( "插入注释" , "jio" ) } ; function N ( { kind : n , onSubmit : o , onClose : r } ) { const [ l , i ] = ( 0 , t . useState ) ( 3 ) , [ c , s ] = ( 0 , t . useState ) ( 3 ) , [ u , d ] = ( 0 , t . useState ) ( ! 0 ) , [ m , p ] = ( 0 , t . useState ) ( ! 1 ) , [ _ , f ] = ( 0 , t . useState ) ( "a^2 + b^2 = c^2" ) , [ b , g ] = ( 0 , t . useState ) ( ! 0 ) , [ h , j ] = ( 0 , t . useState ) ( "" ) , y = ( 0 , t . useRef ) ( null ) , E = ( 0 , t . useRef ) ( null ) , N = ( 0 , t . useRef ) ( null ) , w = ( 0 , t . useRef ) ( null ) ; ( 0 , t . useEffect ) ( ( ) => { ( E . current || N . current || w . current ) ? . focus ( ) ; const e = e => { "Escape" === e . key && ( e . preventDefault ( ) , r ( ) ) } ; return document . addEventListener ( "keydown" , e ) , ( ) => document . removeEventListener ( "keydown" , e ) } , [ r ] ) ; const C = ( 0 , t . useMemo ) ( ( ) => "footnote" === n ? "" !== h . trim ( ) : "math" !== n || "" !== _ . trim ( ) , [ n , h , _ ] ) ; 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" } , k [ 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 : E , type : "number" , min : 1 , max : 20 , value : l , onChange : e => i ( 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 : u , onChange : e => d ( 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 : N , rows : 3 , value : _ , onChange : e => f ( e . target . value ) , placeholder : "a^2 + b^2 = c^2" } ) ) , ( 0 , e . createElement ) Line truncated
( 0 , a . _ _ ) ( "请输入标题(最多 %d 个字)" , "jio" ) , Number ( H . titleMax ) || 100 ) , spellCheck : ! 1 , maxLength : Number ( H . titleMax ) || 100 } ) ) , ( 0 , e . createElement ) ( "div" , { className : "jio-creator__editor" , "data-editor-ready" : _ ? "true" : "false" } , ( 0 , e . createElement ) ( "textarea" , { id : x , defaultValue : n . content , onChange : e => X ( e . target . value ) , "aria-label" : ( 0 , a . _ _ ) ( "文章正文" , "jio" ) } ) ) ) , ( 0 , e . createElement ) ( b , { featured : n . featured , canEditCover : ! ! J . canUploadImage , canSchedule : ! ! J . canSchedule , scheduleEnabled : ! ! n . schedule . enabled , scheduleAt : n . schedule . at , onFeaturedChange : e => Q ( { featured : e } ) , onScheduleChange : ( e , t ) => Q ( { schedule : { enabled : e , at : t } } ) } ) , z && ( 0 , e . createElement ) ( N , { kind : z , onSubmit : pe , onClose : ( ) => U ( null ) } ) , D && ( 0 , e . createElement ) ( s , { draft : n , setDraft : Q , capabilities : J , limits : H , taxonomy : { categories : w . categories && w . categories . items || [ ] , tags : ! ! w . tags ? . enabled , customDefs : w . customDefs || [ ] } , isPublishedEdit : V , onClose : ( ) => P ( ! 1 ) , onSaveDraft : ( ) => { Z ( ! 1 ) } , onSubmit : e => { ee ( e ) } , privateStorage : ! ! w . privateStorage , privateUploads : w . privateUploads || [ ] , captcha : ! ! w . captcha ? . enabled , saving : "saving" === I . state || "submitting" === I . state } ) ) } function I ( ) { const a = document . getElementById ( "jio-creator-studio" ) ; a && ( a . classList . add ( "is-ready" ) , ( 0 , t . createRoot ) ( a ) . render ( ( 0 , e . createElement ) ( $ , null ) ) ) } "loading" === document . readyState ? document . addEventListener ( "DOMContentLoaded" , I ) : I ( ) } ) ( ) ;