nnews-react 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -168,7 +168,7 @@ ${ho(this.code(t,n))}
|
|
|
168
168
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[sf]=this[sf]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=ci(o);r[a]||(pL(i,o),r[a]=!0)}return I.isArray(t)?t.forEach(s):s(t),this}};pt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);I.reduceDescriptors(pt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});I.freezeMethods(pt);function Fa(e,t){const n=this||Hi,r=t||n,i=pt.from(r.headers);let s=r.data;return I.forEach(e,function(a){s=a.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function Yg(e){return!!(e&&e.__CANCEL__)}function Hr(e,t,n){ce.call(this,e??"canceled",ce.ERR_CANCELED,t,n),this.name="CanceledError"}I.inherits(Hr,ce,{__CANCEL__:!0});function Zg(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ce("Request failed with status code "+n.status,[ce.ERR_BAD_REQUEST,ce.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function gL(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function mL(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,s=0,o;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=r[s];o||(o=c),n[i]=l,r[i]=c;let d=s,h=0;for(;d!==i;)h+=n[d++],d=d%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function bL(e,t){let n=0,r=1e3/t,i,s;const o=(c,u=Date.now())=>{n=u,i=null,s&&(clearTimeout(s),s=null),e(...c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=r?o(c,u):(i=c,s||(s=setTimeout(()=>{s=null,o(i)},r-d)))},()=>i&&o(i)]}const Hs=(e,t,n=3)=>{let r=0;const i=mL(50,250);return bL(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,l=o-r,c=i(l),u=o<=a;r=o;const d={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-o)/c:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},of=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},af=e=>(...t)=>I.asap(()=>e(...t)),yL=Ye.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ye.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ye.origin),Ye.navigator&&/(msie|trident)/i.test(Ye.navigator.userAgent)):()=>!0,EL=Ye.hasStandardBrowserEnv?{write(e,t,n,r,i,s,o){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];I.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),I.isString(r)&&a.push(`path=${r}`),I.isString(i)&&a.push(`domain=${i}`),s===!0&&a.push("secure"),I.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function xL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function wL(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Xg(e,t,n){let r=!xL(t);return e&&(r||n==!1)?wL(e,t):t}const lf=e=>e instanceof pt?{...e}:e;function Jn(e,t){t=t||{};const n={};function r(c,u,d,h){return I.isPlainObject(c)&&I.isPlainObject(u)?I.merge.call({caseless:h},c,u):I.isPlainObject(u)?I.merge({},u):I.isArray(u)?u.slice():u}function i(c,u,d,h){if(I.isUndefined(u)){if(!I.isUndefined(c))return r(void 0,c,d,h)}else return r(c,u,d,h)}function s(c,u){if(!I.isUndefined(u))return r(void 0,u)}function o(c,u){if(I.isUndefined(u)){if(!I.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,d){if(d in t)return r(c,u);if(d in e)return r(void 0,c)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,u,d)=>i(lf(c),lf(u),d,!0)};return I.forEach(Object.keys({...e,...t}),function(u){const d=l[u]||i,h=d(e[u],t[u],u);I.isUndefined(h)&&d!==a||(n[u]=h)}),n}const Qg=e=>{const t=Jn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=t;if(t.headers=o=pt.from(o),t.url=Kg(Xg(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),I.isFormData(n)){if(Ye.hasStandardBrowserEnv||Ye.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(I.isFunction(n.getHeaders)){const l=n.getHeaders(),c=["content-type","content-length"];Object.entries(l).forEach(([u,d])=>{c.includes(u.toLowerCase())&&o.set(u,d)})}}if(Ye.hasStandardBrowserEnv&&(r&&I.isFunction(r)&&(r=r(t)),r||r!==!1&&yL(t.url))){const l=i&&s&&EL.read(s);l&&o.set(i,l)}return t},_L=typeof XMLHttpRequest<"u",vL=_L&&function(e){return new Promise(function(n,r){const i=Qg(e);let s=i.data;const o=pt.from(i.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=i,u,d,h,f,p;function m(){f&&f(),p&&p(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let b=new XMLHttpRequest;b.open(i.method.toUpperCase(),i.url,!0),b.timeout=i.timeout;function y(){if(!b)return;const v=pt.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),C={data:!a||a==="text"||a==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:v,config:e,request:b};Zg(function(F){n(F),m()},function(F){r(F),m()},C),b=null}"onloadend"in b?b.onloadend=y:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(y)},b.onabort=function(){b&&(r(new ce("Request aborted",ce.ECONNABORTED,e,b)),b=null)},b.onerror=function(T){const C=T&&T.message?T.message:"Network Error",A=new ce(C,ce.ERR_NETWORK,e,b);A.event=T||null,r(A),b=null},b.ontimeout=function(){let T=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const C=i.transitional||Vg;i.timeoutErrorMessage&&(T=i.timeoutErrorMessage),r(new ce(T,C.clarifyTimeoutError?ce.ETIMEDOUT:ce.ECONNABORTED,e,b)),b=null},s===void 0&&o.setContentType(null),"setRequestHeader"in b&&I.forEach(o.toJSON(),function(T,C){b.setRequestHeader(C,T)}),I.isUndefined(i.withCredentials)||(b.withCredentials=!!i.withCredentials),a&&a!=="json"&&(b.responseType=i.responseType),c&&([h,p]=Hs(c,!0),b.addEventListener("progress",h)),l&&b.upload&&([d,f]=Hs(l),b.upload.addEventListener("progress",d),b.upload.addEventListener("loadend",f)),(i.cancelToken||i.signal)&&(u=v=>{b&&(r(!v||v.type?new Hr(null,e,b):v),b.abort(),b=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const w=gL(i.url);if(w&&Ye.protocols.indexOf(w)===-1){r(new ce("Unsupported protocol "+w+":",ce.ERR_BAD_REQUEST,e));return}b.send(s||null)})},kL=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const s=function(c){if(!i){i=!0,a();const u=c instanceof Error?c:this.reason;r.abort(u instanceof ce?u:new Hr(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,s(new ce(`timeout ${t} of ms exceeded`,ce.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:l}=r;return l.unsubscribe=()=>I.asap(a),l}},NL=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},AL=async function*(e,t){for await(const n of SL(e))yield*NL(n,t)},SL=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},cf=(e,t,n,r)=>{const i=AL(e,t);let s=0,o,a=l=>{o||(o=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await i.next();if(c){a(),l.close();return}let d=u.byteLength;if(n){let h=s+=d;n(h)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},uf=64*1024,{isFunction:ws}=I,TL=(({Request:e,Response:t})=>({Request:e,Response:t}))(I.global),{ReadableStream:df,TextEncoder:ff}=I.global,hf=(e,...t)=>{try{return!!e(...t)}catch{return!1}},CL=e=>{e=I.merge.call({skipUndefined:!0},TL,e);const{fetch:t,Request:n,Response:r}=e,i=t?ws(t):typeof fetch=="function",s=ws(n),o=ws(r);if(!i)return!1;const a=i&&ws(df),l=i&&(typeof ff=="function"?(p=>m=>p.encode(m))(new ff):async p=>new Uint8Array(await new n(p).arrayBuffer())),c=s&&a&&hf(()=>{let p=!1;const m=new n(Ye.origin,{body:new df,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!m}),u=o&&a&&hf(()=>I.isReadableStream(new r("").body)),d={stream:u&&(p=>p.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(m,b)=>{let y=m&&m[p];if(y)return y.call(m);throw new ce(`Response type '${p}' is not supported`,ce.ERR_NOT_SUPPORT,b)})});const h=async p=>{if(p==null)return 0;if(I.isBlob(p))return p.size;if(I.isSpecCompliantForm(p))return(await new n(Ye.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(I.isArrayBufferView(p)||I.isArrayBuffer(p))return p.byteLength;if(I.isURLSearchParams(p)&&(p=p+""),I.isString(p))return(await l(p)).byteLength},f=async(p,m)=>{const b=I.toFiniteNumber(p.getContentLength());return b??h(m)};return async p=>{let{url:m,method:b,data:y,signal:w,cancelToken:v,timeout:T,onDownloadProgress:C,onUploadProgress:A,responseType:F,headers:U,withCredentials:K="same-origin",fetchOptions:O}=Qg(p),q=t||fetch;F=F?(F+"").toLowerCase():"text";let B=kL([w,v&&v.toAbortSignal()],T),re=null;const Q=B&&B.unsubscribe&&(()=>{B.unsubscribe()});let Z;try{if(A&&c&&b!=="get"&&b!=="head"&&(Z=await f(U,y))!==0){let Y=new n(m,{method:"POST",body:y,duplex:"half"}),ae;if(I.isFormData(y)&&(ae=Y.headers.get("content-type"))&&U.setContentType(ae),Y.body){const[k,he]=of(Z,Hs(af(A)));y=cf(Y.body,uf,k,he)}}I.isString(K)||(K=K?"include":"omit");const L=s&&"credentials"in n.prototype,$={...O,signal:B,method:b.toUpperCase(),headers:U.normalize().toJSON(),body:y,duplex:"half",credentials:L?K:void 0};re=s&&new n(m,$);let M=await(s?q(re,O):q(m,$));const H=u&&(F==="stream"||F==="response");if(u&&(C||H&&Q)){const Y={};["status","statusText","headers"].forEach(se=>{Y[se]=M[se]});const ae=I.toFiniteNumber(M.headers.get("content-length")),[k,he]=C&&of(ae,Hs(af(C),!0))||[];M=new r(cf(M.body,uf,k,()=>{he&&he(),Q&&Q()}),Y)}F=F||"text";let x=await d[I.findKey(d,F)||"text"](M,p);return!H&&Q&&Q(),await new Promise((Y,ae)=>{Zg(Y,ae,{data:x,headers:pt.from(M.headers),status:M.status,statusText:M.statusText,config:p,request:re})})}catch(L){throw Q&&Q(),L&&L.name==="TypeError"&&/Load failed|fetch/i.test(L.message)?Object.assign(new ce("Network Error",ce.ERR_NETWORK,p,re),{cause:L.cause||L}):ce.from(L,L&&L.code,p,re)}}},OL=new Map,Jg=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,s=[r,i,n];let o=s.length,a=o,l,c,u=OL;for(;a--;)l=s[a],c=u.get(l),c===void 0&&u.set(l,c=a?new Map:CL(t)),u=c;return c};Jg();const Cc={http:VI,xhr:vL,fetch:{get:Jg}};I.forEach(Cc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const pf=e=>`- ${e}`,RL=e=>I.isFunction(e)||e===null||e===!1;function IL(e,t){e=I.isArray(e)?e:[e];const{length:n}=e;let r,i;const s={};for(let o=0;o<n;o++){r=e[o];let a;if(i=r,!RL(r)&&(i=Cc[(a=String(r)).toLowerCase()],i===void 0))throw new ce(`Unknown adapter '${a}'`);if(i&&(I.isFunction(i)||(i=i.get(t))))break;s[a||"#"+o]=i}if(!i){const o=Object.entries(s).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=n?o.length>1?`since :
|
|
169
169
|
`+o.map(pf).join(`
|
|
170
170
|
`):" "+pf(o[0]):"as no adapter specified";throw new ce("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return i}const em={getAdapter:IL,adapters:Cc};function qa(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Hr(null,e)}function gf(e){return qa(e),e.headers=pt.from(e.headers),e.data=Fa.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),em.getAdapter(e.adapter||Hi.adapter,e)(e).then(function(r){return qa(e),r.data=Fa.call(e,e.transformResponse,r),r.headers=pt.from(r.headers),r},function(r){return Yg(r)||(qa(e),r&&r.response&&(r.response.data=Fa.call(e,e.transformResponse,r.response),r.response.headers=pt.from(r.response.headers))),Promise.reject(r)})}const tm="1.13.2",wo={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{wo[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const mf={};wo.transitional=function(t,n,r){function i(s,o){return"[Axios v"+tm+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(t===!1)throw new ce(i(o," has been removed"+(n?" in "+n:"")),ce.ERR_DEPRECATED);return n&&!mf[o]&&(mf[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,o,a):!0}};wo.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function LL(e,t,n){if(typeof e!="object")throw new ce("options must be an object",ce.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],o=t[s];if(o){const a=e[s],l=a===void 0||o(a,s,e);if(l!==!0)throw new ce("option "+s+" must be "+l,ce.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ce("Unknown option "+s,ce.ERR_BAD_OPTION)}}const Os={assertOptions:LL,validators:wo},en=Os.validators;let Wn=class{constructor(t){this.defaults=t||{},this.interceptors={request:new rf,response:new rf}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
171
|
-
`+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Jn(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&Os.assertOptions(r,{silentJSONParsing:en.transitional(en.boolean),forcedJSONParsing:en.transitional(en.boolean),clarifyTimeoutError:en.transitional(en.boolean)},!1),i!=null&&(I.isFunction(i)?n.paramsSerializer={serialize:i}:Os.assertOptions(i,{encode:en.function,serialize:en.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Os.assertOptions(n,{baseUrl:en.spelling("baseURL"),withXsrfToken:en.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&I.merge(s.common,s[n.method]);s&&I.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),n.headers=pt.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,h;if(!l){const p=[gf.bind(this),void 0];for(p.unshift(...a),p.push(...c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=n;for(;d<h;){const p=a[d++],m=a[d++];try{f=p(f)}catch(b){m.call(this,b);break}}try{u=gf.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=Jn(this.defaults,t);const n=Xg(t.baseURL,t.url,t.allowAbsoluteUrls);return Kg(n,t.params,t.paramsSerializer)}};I.forEach(["delete","get","head","options"],function(t){Wn.prototype[t]=function(n,r){return this.request(Jn(r||{},{method:t,url:n,data:(r||{}).data}))}});I.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,a){return this.request(Jn(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}Wn.prototype[t]=n(),Wn.prototype[t+"Form"]=n(!0)});let ML=class nm{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},t(function(s,o,a){r.reason||(r.reason=new Hr(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new nm(function(i){t=i}),cancel:t}}};function DL(e){return function(n){return e.apply(null,n)}}function PL(e){return I.isObject(e)&&e.isAxiosError===!0}const Ol={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ol).forEach(([e,t])=>{Ol[t]=e});function rm(e){const t=new Wn(e),n=Mg(Wn.prototype.request,t);return I.extend(n,Wn.prototype,t,{allOwnKeys:!0}),I.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return rm(Jn(e,i))},n}const Re=rm(Hi);Re.Axios=Wn;Re.CanceledError=Hr;Re.CancelToken=ML;Re.isCancel=Yg;Re.VERSION=tm;Re.toFormData=xo;Re.AxiosError=ce;Re.Cancel=Re.CanceledError;Re.all=function(t){return Promise.all(t)};Re.spread=DL;Re.isAxiosError=PL;Re.mergeConfig=Jn;Re.AxiosHeaders=pt;Re.formToJSON=e=>Wg(I.isHTMLForm(e)?new FormData(e):e);Re.getAdapter=em.getAdapter;Re.HttpStatusCode=Ol;Re.default=Re;const{Axios:x2,AxiosError:w2,CanceledError:_2,isCancel:v2,CancelToken:k2,VERSION:N2,all:A2,Cancel:S2,isAxiosError:T2,spread:C2,toFormData:O2,AxiosHeaders:R2,HttpStatusCode:I2,formToJSON:L2,getAdapter:M2,mergeConfig:D2}=Re,qt={ARTICLES:"/api/article",ARTICLES_FILTER:"/api/article/filter",ARTICLE_BY_ID:e=>`/api/article/${e}`,IMAGE_UPLOAD:"/api/Image/uploadImage"};class im{constructor(t){this.client=t}async uploadImage(t){const n=new FormData;n.append("file",t),console.log("[ArticleAPI] uploadImage - Request:",{fileName:t.name,fileSize:t.size});const r=await this.client.post(qt.IMAGE_UPLOAD,n,{headers:{"Content-Type":"multipart/form-data"}});return console.log("[ArticleAPI] uploadImage - Response:",r.data),r.data}async listArticles(t,n=1,r=10){const i={page:n,pageSize:r};t&&(i.categoryId=t),console.log("[ArticleAPI] listArticles - Request:",{url:qt.ARTICLES,params:i});const s=await this.client.get(qt.ARTICLES,{params:i});return console.log("[ArticleAPI] listArticles - Response:",s.data),this.transformArticleDates(s.data)}async filterArticles(t,n,r=1,i=10){const s={page:r,pageSize:i};t&&t.length>0&&(s.roles=t.join(",")),n!==void 0&&(s.parentId=n);const o=await this.client.get(qt.ARTICLES_FILTER,{params:s});return this.transformArticleDates(o.data)}async getArticleById(t){const n=await this.client.get(qt.ARTICLE_BY_ID(t));return this.transformArticleDate(n.data)}async createArticle(t){console.log("[ArticleAPI] createArticle - Request:",{url:qt.ARTICLES,data:t});const n=await this.client.post(qt.ARTICLES,t);return console.log("[ArticleAPI] createArticle - Response:",n.data),this.transformArticleDate(n.data)}async updateArticle(t){console.log("[ArticleAPI] updateArticle - Request:",{url:qt.ARTICLES,data:t});const n=await this.client.put(qt.ARTICLES,t);return console.log("[ArticleAPI] updateArticle - Response:",n.data),this.transformArticleDate(n.data)}async deleteArticle(t){console.log("[ArticleAPI] deleteArticle - Request:",{id:t,url:qt.ARTICLE_BY_ID(t)}),await this.client.delete(qt.ARTICLE_BY_ID(t)),console.log("[ArticleAPI] deleteArticle - Success")}transformArticleDate(t){return{...t,dateAt:t.dateAt?new Date(t.dateAt):void 0,createdAt:t.createdAt?new Date(t.createdAt):void 0,updatedAt:t.updatedAt?new Date(t.updatedAt):void 0,category:t.category?{...t.category,createdAt:t.category.createdAt?new Date(t.category.createdAt):void 0,updatedAt:t.category.updatedAt?new Date(t.category.updatedAt):void 0}:void 0}}transformArticleDates(t){return{...t,items:t.items.map(n=>this.transformArticleDate(n))}}}const tn={CATEGORIES:"/api/category",CATEGORIES_FILTER:"/api/category/filter",CATEGORY_BY_ID:e=>`/api/category/${e}`};class sm{constructor(t){this.client=t}async listCategories(){console.log("[CategoryAPI] listCategories - Request:",{url:tn.CATEGORIES});const t=await this.client.get(tn.CATEGORIES);return console.log("[CategoryAPI] listCategories - Response:",t.data),this.transformCategoryDates(t.data)}async filterCategories(t,n){const r={};t&&t.length>0&&(r.roles=t.join(",")),n!==void 0&&(r.parentId=n);const i=await this.client.get(tn.CATEGORIES_FILTER,{params:r});return this.transformCategoryDates(i.data)}async getCategoryById(t){const n=await this.client.get(tn.CATEGORY_BY_ID(t));return this.transformCategoryDate(n.data)}async createCategory(t){console.log("[CategoryAPI] createCategory - Request:",{url:tn.CATEGORIES,data:t});const n=await this.client.post(tn.CATEGORIES,t);return console.log("[CategoryAPI] createCategory - Response:",n.data),this.transformCategoryDate(n.data)}async updateCategory(t){console.log("[CategoryAPI] updateCategory - Request:",{url:tn.CATEGORIES,data:t});const n=await this.client.put(tn.CATEGORIES,t);return console.log("[CategoryAPI] updateCategory - Response:",n.data),this.transformCategoryDate(n.data)}async deleteCategory(t){console.log("[CategoryAPI] deleteCategory - Request:",{id:t,url:tn.CATEGORY_BY_ID(t)}),await this.client.delete(tn.CATEGORY_BY_ID(t)),console.log("[CategoryAPI] deleteCategory - Success")}transformCategoryDate(t){return{...t,createdAt:t.createdAt?new Date(t.createdAt):void 0,updatedAt:t.updatedAt?new Date(t.updatedAt):void 0}}transformCategoryDates(t){return t.map(n=>this.transformCategoryDate(n))}}const Ut={TAGS:"/api/tag",TAG_BY_ID:e=>`/api/tag/${e}`,TAG_MERGE:(e,t)=>`/api/Tag/merge/${e}/${t}`};class om{constructor(t){this.client=t}async listTags(){console.log("[TagAPI] listTags - Request:",{url:Ut.TAGS});const t=await this.client.get(Ut.TAGS);return console.log("[TagAPI] listTags - Response:",t.data),t.data}async getTagById(t){console.log("[TagAPI] getTagById - Request:",{id:t,url:Ut.TAG_BY_ID(t)});const n=await this.client.get(Ut.TAG_BY_ID(t));return console.log("[TagAPI] getTagById - Response:",n.data),n.data}async createTag(t){console.log("[TagAPI] createTag - Request:",{url:Ut.TAGS,data:t});const n=await this.client.post(Ut.TAGS,t);return console.log("[TagAPI] createTag - Response:",n.data),n.data}async updateTag(t){console.log("[TagAPI] updateTag - Request:",{url:Ut.TAGS,data:t});const n=await this.client.put(Ut.TAGS,t);return console.log("[TagAPI] updateTag - Response:",n.data),n.data}async deleteTag(t){console.log("[TagAPI] deleteTag - Request:",{id:t,url:Ut.TAG_BY_ID(t)}),await this.client.delete(Ut.TAG_BY_ID(t)),console.log("[TagAPI] deleteTag - Success")}async mergeTags(t,n){const r=Ut.TAG_MERGE(t,n);console.log("[TagAPI] mergeTags - Request:",{url:r,sourceTagId:t,targetTagId:n}),await this.client.post(r),console.log("[TagAPI] mergeTags - Success")}}const am=G.createContext(void 0);function BL({config:e,children:t}){const n=G.useMemo(()=>{const r=e.apiClient||Re.create({baseURL:e.apiUrl,headers:{"Content-Type":"application/json"}}),i=new im(r),s=new sm(r),o=new om(r);return{config:e,apiClient:r,articleApi:i,categoryApi:s,tagApi:o}},[e]);return _.jsx(am.Provider,{value:n,children:t})}function Gi(){const e=G.useContext(am);if(!e)throw new Error("useNNews must be used within a NNewsProvider");return e}function FL({article:e,categories:t=[],tags:n=[],onSave:r,onCancel:i,loading:s=!1}){const{articleApi:o}=Gi(),[a,l]=G.useState(""),[c,u]=G.useState(""),[d,h]=G.useState(""),[f,p]=G.useState(""),[m,b]=G.useState(!1),[y,w]=G.useState(Fe.Draft),[v,T]=G.useState(null),[C,A]=G.useState(""),[F,U]=G.useState([]),[K,O]=G.useState(""),[q,B]=G.useState({});G.useEffect(()=>{var M,H;e&&(l(e.title),u(e.content),h(e.imageName||""),console.log("imageName:",e.imageName),e.imageName&&p(e.imageName),w(e.status),T(e.categoryId||null),A(e.dateAt?new Date(e.dateAt).toISOString().slice(0,16):""),U(((M=e.tags)==null?void 0:M.map(x=>x.tagId).filter(x=>x!==void 0))||[]),O(((H=e.roles)==null?void 0:H.map(x=>x.slug).join(", "))||""))},[e]);const re=()=>{const M={};return a.trim()||(M.title="Title is required"),c.trim()||(M.content="Content is required"),B(M),Object.keys(M).length===0},Q=async M=>{if(M.preventDefault(),!re())return;const H=K.split(",").map(Y=>Y.trim()).filter(Y=>Y.length>0),x={title:a.trim(),content:c.trim(),imageName:d||void 0,status:y,categoryId:v||void 0,dateAt:C||void 0,tagIds:F.length>0?F:void 0,roleIds:H.length>0?H:void 0};e?await r({articleId:e.articleId,...x}):await r(x)},Z=async M=>{var Y;const H=(Y=M.target.files)==null?void 0:Y[0];if(!H)return;if(!H.type.startsWith("image/")){B({...q,image:"Please select an image file"});return}if(H.size>5*1024*1024){B({...q,image:"Image size must be less than 5MB"});return}B({...q,image:""});const x=new FileReader;x.onloadend=()=>{p(x.result)},x.readAsDataURL(H);try{b(!0);const ae=await o.uploadImage(H);h(ae),B({...q,image:""})}catch(ae){console.error("Error uploading image:",ae),B({...q,image:"Failed to upload image. Please try again."})}finally{b(!1)}},L=()=>{p(""),h("")},$=M=>{U(H=>H.includes(M)?H.filter(x=>x!==M):[...H,M])};return _.jsxs("form",{onSubmit:Q,className:"space-y-6",children:[_.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[_.jsxs("div",{className:"col-span-2 p-4",children:[_.jsxs("div",{className:"space-y-2",children:[_.jsx("label",{htmlFor:"title",className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"Title *"}),_.jsx("input",{id:"title",type:"text",value:a,onChange:M=>l(M.target.value),className:`w-full rounded-md border ${q.title?"border-red-300 dark:border-red-600":"border-gray-300 dark:border-gray-600"} px-4 py-2 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500`,placeholder:"Enter article title"}),q.title&&_.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:q.title})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsx("label",{htmlFor:"dateAt",className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"Publication Date"}),_.jsx("input",{id:"dateAt",type:"datetime-local",value:C,onChange:M=>A(M.target.value),className:"w-full rounded-md border border-gray-300 dark:border-gray-600 px-4 py-2 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500"})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsx("label",{htmlFor:"category",className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"Category"}),_.jsxs("select",{id:"category",value:v||"",onChange:M=>T(M.target.value?Number(M.target.value):null),className:"w-full rounded-md border border-gray-300 dark:border-gray-600 px-4 py-2 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500",children:[_.jsx("option",{value:"",children:"No Category"}),t.map(M=>_.jsx("option",{value:M.categoryId,children:M.title},M.categoryId))]})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsx("label",{htmlFor:"status",className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"Status"}),_.jsxs("select",{id:"status",value:y,onChange:M=>w(Number(M.target.value)),className:"w-full rounded-md border border-gray-300 dark:border-gray-600 px-4 py-2 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500",children:[_.jsx("option",{value:Fe.Draft,children:"Draft"}),_.jsx("option",{value:Fe.Published,children:"Published"}),_.jsx("option",{value:Fe.Archived,children:"Archived"}),_.jsx("option",{value:Fe.Scheduled,children:"Scheduled"}),_.jsx("option",{value:Fe.Review,children:"Review"})]})]})]}),_.jsx("div",{className:"col-span-1",children:_.jsxs("div",{className:"space-y-2",children:[_.jsx("label",{htmlFor:"image",className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"Featured Image"}),f?_.jsxs("div",{className:"relative overflow-hidden",children:[_.jsx("img",{src:f,alt:"Preview",className:"w-full h-[250px] object-cover rounded-md border border-gray-300 dark:border-gray-600",style:{height:"250px"}}),_.jsx("button",{type:"button",onClick:L,className:"absolute top-2 right-2 rounded-full bg-red-600 p-2 text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500",disabled:m,children:_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:_.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})}),m&&_.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black bg-opacity-50 rounded-md",children:_.jsx("span",{className:"text-white text-sm",children:"Uploading..."})})]}):_.jsx("div",{className:"flex items-center",children:_.jsx("input",{id:"image",type:"file",accept:"image/*",onChange:Z,disabled:m,className:"block w-full text-sm text-gray-900 dark:text-gray-100 border border-gray-300 dark:border-gray-600 rounded-md cursor-pointer bg-white dark:bg-gray-900 focus:outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500"})}),q.image&&_.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:q.image}),_.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"JPG, PNG, GIF. Max 5MB"})]})})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"Content *"}),_.jsx(Lg,{value:c,onChange:u,placeholder:"Write your article content...",error:q.content}),q.content&&_.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:q.content})]}),n.length>0&&_.jsxs("div",{className:"space-y-2",children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"Tags"}),_.jsx("div",{className:"flex flex-wrap gap-2",children:n.map(M=>_.jsxs("button",{type:"button",onClick:()=>$(M.tagId||0),className:`rounded-md px-3 py-1 text-sm font-medium transition-colors ${F.includes(M.tagId||0)?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"}`,children:["#",M.title]},M.tagId))})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsx("label",{htmlFor:"roles",className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"Roles"}),_.jsx("input",{id:"roles",type:"text",value:K,onChange:M=>O(M.target.value),className:"w-full rounded-md border border-gray-300 dark:border-gray-600 px-4 py-2 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500",placeholder:"Enter role slugs separated by commas (e.g., admin, editor)"}),_.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Comma-separated list of role slugs."})]}),_.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[_.jsx("button",{type:"button",onClick:i,disabled:s,className:"rounded-md border border-gray-300 dark:border-gray-600 px-6 py-2 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-50",children:"Cancel"}),_.jsx("button",{type:"submit",disabled:s,className:"rounded-md bg-blue-600 px-6 py-2 text-white hover:bg-blue-700 disabled:opacity-50",children:s?"Saving...":e?"Update Article":"Create Article"})]})]})}function qL({value:e,onChange:t,placeholder:n="Write your content in Markdown...",label:r,error:i,minHeight:s="400px"}){const[o,a]=G.useState("edit");return _.jsxs("div",{className:"space-y-2",children:[r&&_.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:r}),_.jsxs("div",{className:"overflow-hidden rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-900",children:[_.jsxs("div",{className:"flex border-b border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800",children:[_.jsx("button",{type:"button",onClick:()=>a("edit"),className:`flex-1 px-4 py-2 text-sm font-medium ${o==="edit"?"border-b-2 border-blue-600 bg-white dark:bg-gray-900 text-blue-600 dark:text-blue-400":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100"}`,children:"Edit"}),_.jsx("button",{type:"button",onClick:()=>a("preview"),className:`flex-1 px-4 py-2 text-sm font-medium ${o==="preview"?"border-b-2 border-blue-600 bg-white dark:bg-gray-900 text-blue-600 dark:text-blue-400":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100"}`,children:"Preview"})]}),_.jsx("div",{style:{minHeight:s},children:o==="edit"?_.jsx("textarea",{value:e,onChange:l=>t(l.target.value),placeholder:n,className:"h-full w-full resize-none border-0 p-4 font-mono text-sm bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-0",style:{minHeight:s}}):_.jsx("div",{className:"prose dark:prose-invert max-w-none p-4 text-gray-900 dark:text-gray-100",children:e?_.jsx(ch,{remarkPlugins:[qh],rehypePlugins:[_p],children:e}):_.jsx("div",{className:"text-gray-400 dark:text-gray-500",children:"Nothing to preview"})})})]}),i&&_.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:i}),_.jsxs("div",{className:"rounded-md bg-gray-50 dark:bg-gray-800 p-3 text-xs text-gray-600 dark:text-gray-400",children:[_.jsx("p",{className:"font-medium",children:"Markdown Syntax Help:"}),_.jsxs("div",{className:"mt-1 grid grid-cols-2 gap-2",children:[_.jsxs("div",{children:[_.jsx("strong",{children:"# Heading 1"})," - Main heading"]}),_.jsxs("div",{children:[_.jsx("strong",{children:"## Heading 2"})," - Subheading"]}),_.jsxs("div",{children:[_.jsx("strong",{children:"**bold text**"})," - Bold"]}),_.jsxs("div",{children:[_.jsx("strong",{children:"*italic text*"})," - Italic"]}),_.jsxs("div",{children:[_.jsx("strong",{children:"[link](url)"})," - Link"]}),_.jsxs("div",{children:[_.jsx("strong",{children:""})," - Image"]}),_.jsxs("div",{children:[_.jsx("strong",{children:"- item"})," - Bullet list"]}),_.jsxs("div",{children:[_.jsx("strong",{children:"1. item"})," - Numbered list"]}),_.jsxs("div",{children:[_.jsx("strong",{children:"`code`"})," - Inline code"]}),_.jsxs("div",{children:[_.jsx("strong",{children:"```language```"})," - Code block"]})]})]})]})}/**
|
|
171
|
+
`+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Jn(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&Os.assertOptions(r,{silentJSONParsing:en.transitional(en.boolean),forcedJSONParsing:en.transitional(en.boolean),clarifyTimeoutError:en.transitional(en.boolean)},!1),i!=null&&(I.isFunction(i)?n.paramsSerializer={serialize:i}:Os.assertOptions(i,{encode:en.function,serialize:en.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Os.assertOptions(n,{baseUrl:en.spelling("baseURL"),withXsrfToken:en.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&I.merge(s.common,s[n.method]);s&&I.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),n.headers=pt.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,h;if(!l){const p=[gf.bind(this),void 0];for(p.unshift(...a),p.push(...c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=n;for(;d<h;){const p=a[d++],m=a[d++];try{f=p(f)}catch(b){m.call(this,b);break}}try{u=gf.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=Jn(this.defaults,t);const n=Xg(t.baseURL,t.url,t.allowAbsoluteUrls);return Kg(n,t.params,t.paramsSerializer)}};I.forEach(["delete","get","head","options"],function(t){Wn.prototype[t]=function(n,r){return this.request(Jn(r||{},{method:t,url:n,data:(r||{}).data}))}});I.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,a){return this.request(Jn(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}Wn.prototype[t]=n(),Wn.prototype[t+"Form"]=n(!0)});let ML=class nm{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},t(function(s,o,a){r.reason||(r.reason=new Hr(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new nm(function(i){t=i}),cancel:t}}};function DL(e){return function(n){return e.apply(null,n)}}function PL(e){return I.isObject(e)&&e.isAxiosError===!0}const Ol={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ol).forEach(([e,t])=>{Ol[t]=e});function rm(e){const t=new Wn(e),n=Mg(Wn.prototype.request,t);return I.extend(n,Wn.prototype,t,{allOwnKeys:!0}),I.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return rm(Jn(e,i))},n}const Re=rm(Hi);Re.Axios=Wn;Re.CanceledError=Hr;Re.CancelToken=ML;Re.isCancel=Yg;Re.VERSION=tm;Re.toFormData=xo;Re.AxiosError=ce;Re.Cancel=Re.CanceledError;Re.all=function(t){return Promise.all(t)};Re.spread=DL;Re.isAxiosError=PL;Re.mergeConfig=Jn;Re.AxiosHeaders=pt;Re.formToJSON=e=>Wg(I.isHTMLForm(e)?new FormData(e):e);Re.getAdapter=em.getAdapter;Re.HttpStatusCode=Ol;Re.default=Re;const{Axios:x2,AxiosError:w2,CanceledError:_2,isCancel:v2,CancelToken:k2,VERSION:N2,all:A2,Cancel:S2,isAxiosError:T2,spread:C2,toFormData:O2,AxiosHeaders:R2,HttpStatusCode:I2,formToJSON:L2,getAdapter:M2,mergeConfig:D2}=Re,qt={ARTICLES:"/api/article",ARTICLES_FILTER:"/api/article/filter",ARTICLE_BY_ID:e=>`/api/article/${e}`,IMAGE_UPLOAD:"/api/Image/uploadImage"};class im{constructor(t){this.client=t}async uploadImage(t){const n=new FormData;n.append("file",t),console.log("[ArticleAPI] uploadImage - Request:",{fileName:t.name,fileSize:t.size});const r=await this.client.post(qt.IMAGE_UPLOAD,n,{headers:{"Content-Type":"multipart/form-data"}});return console.log("[ArticleAPI] uploadImage - Response:",r.data),r.data}async listArticles(t,n=1,r=10){const i={page:n,pageSize:r};t&&(i.categoryId=t),console.log("[ArticleAPI] listArticles - Request:",{url:qt.ARTICLES,params:i});const s=await this.client.get(qt.ARTICLES,{params:i});return console.log("[ArticleAPI] listArticles - Response:",s.data),this.transformArticleDates(s.data)}async filterArticles(t,n,r=1,i=10){const s={page:r,pageSize:i};t&&t.length>0&&(s.roles=t.join(",")),n!==void 0&&(s.parentId=n);const o=await this.client.get(qt.ARTICLES_FILTER,{params:s});return this.transformArticleDates(o.data)}async getArticleById(t){const n=await this.client.get(qt.ARTICLE_BY_ID(t));return this.transformArticleDate(n.data)}async createArticle(t){console.log("[ArticleAPI] createArticle - Request:",{url:qt.ARTICLES,data:t});const n=await this.client.post(qt.ARTICLES,t);return console.log("[ArticleAPI] createArticle - Response:",n.data),this.transformArticleDate(n.data)}async updateArticle(t){console.log("[ArticleAPI] updateArticle - Request:",{url:qt.ARTICLES,data:t});const n=await this.client.put(qt.ARTICLES,t);return console.log("[ArticleAPI] updateArticle - Response:",n.data),this.transformArticleDate(n.data)}async deleteArticle(t){console.log("[ArticleAPI] deleteArticle - Request:",{id:t,url:qt.ARTICLE_BY_ID(t)}),await this.client.delete(qt.ARTICLE_BY_ID(t)),console.log("[ArticleAPI] deleteArticle - Success")}transformArticleDate(t){return{...t,dateAt:t.dateAt?new Date(t.dateAt):void 0,createdAt:t.createdAt?new Date(t.createdAt):void 0,updatedAt:t.updatedAt?new Date(t.updatedAt):void 0,category:t.category?{...t.category,createdAt:t.category.createdAt?new Date(t.category.createdAt):void 0,updatedAt:t.category.updatedAt?new Date(t.category.updatedAt):void 0}:void 0}}transformArticleDates(t){return{...t,items:t.items.map(n=>this.transformArticleDate(n))}}}const tn={CATEGORIES:"/api/category",CATEGORIES_FILTER:"/api/category/filter",CATEGORY_BY_ID:e=>`/api/category/${e}`};class sm{constructor(t){this.client=t}async listCategories(){console.log("[CategoryAPI] listCategories - Request:",{url:tn.CATEGORIES});const t=await this.client.get(tn.CATEGORIES);return console.log("[CategoryAPI] listCategories - Response:",t.data),this.transformCategoryDates(t.data)}async filterCategories(t,n){const r={};t&&t.length>0&&(r.roles=t.join(",")),n!==void 0&&(r.parentId=n);const i=await this.client.get(tn.CATEGORIES_FILTER,{params:r});return this.transformCategoryDates(i.data)}async getCategoryById(t){const n=await this.client.get(tn.CATEGORY_BY_ID(t));return this.transformCategoryDate(n.data)}async createCategory(t){console.log("[CategoryAPI] createCategory - Request:",{url:tn.CATEGORIES,data:t});const n=await this.client.post(tn.CATEGORIES,t);return console.log("[CategoryAPI] createCategory - Response:",n.data),this.transformCategoryDate(n.data)}async updateCategory(t){console.log("[CategoryAPI] updateCategory - Request:",{url:tn.CATEGORIES,data:t});const n=await this.client.put(tn.CATEGORIES,t);return console.log("[CategoryAPI] updateCategory - Response:",n.data),this.transformCategoryDate(n.data)}async deleteCategory(t){console.log("[CategoryAPI] deleteCategory - Request:",{id:t,url:tn.CATEGORY_BY_ID(t)}),await this.client.delete(tn.CATEGORY_BY_ID(t)),console.log("[CategoryAPI] deleteCategory - Success")}transformCategoryDate(t){return{...t,createdAt:t.createdAt?new Date(t.createdAt):void 0,updatedAt:t.updatedAt?new Date(t.updatedAt):void 0}}transformCategoryDates(t){return t.map(n=>this.transformCategoryDate(n))}}const Ut={TAGS:"/api/tag",TAG_BY_ID:e=>`/api/tag/${e}`,TAG_MERGE:(e,t)=>`/api/Tag/merge/${e}/${t}`};class om{constructor(t){this.client=t}async listTags(){console.log("[TagAPI] listTags - Request:",{url:Ut.TAGS});const t=await this.client.get(Ut.TAGS);return console.log("[TagAPI] listTags - Response:",t.data),t.data}async getTagById(t){console.log("[TagAPI] getTagById - Request:",{id:t,url:Ut.TAG_BY_ID(t)});const n=await this.client.get(Ut.TAG_BY_ID(t));return console.log("[TagAPI] getTagById - Response:",n.data),n.data}async createTag(t){console.log("[TagAPI] createTag - Request:",{url:Ut.TAGS,data:t});const n=await this.client.post(Ut.TAGS,t);return console.log("[TagAPI] createTag - Response:",n.data),n.data}async updateTag(t){console.log("[TagAPI] updateTag - Request:",{url:Ut.TAGS,data:t});const n=await this.client.put(Ut.TAGS,t);return console.log("[TagAPI] updateTag - Response:",n.data),n.data}async deleteTag(t){console.log("[TagAPI] deleteTag - Request:",{id:t,url:Ut.TAG_BY_ID(t)}),await this.client.delete(Ut.TAG_BY_ID(t)),console.log("[TagAPI] deleteTag - Success")}async mergeTags(t,n){const r=Ut.TAG_MERGE(t,n);console.log("[TagAPI] mergeTags - Request:",{url:r,sourceTagId:t,targetTagId:n}),await this.client.post(r),console.log("[TagAPI] mergeTags - Success")}}const am=G.createContext(void 0);function BL({config:e,children:t}){const n=G.useMemo(()=>{const r=e.apiClient||Re.create({baseURL:e.apiUrl,headers:{"Content-Type":"application/json"}}),i=new im(r),s=new sm(r),o=new om(r);return{config:e,apiClient:r,articleApi:i,categoryApi:s,tagApi:o}},[e]);return _.jsx(am.Provider,{value:n,children:t})}function Gi(){const e=G.useContext(am);if(!e)throw new Error("useNNews must be used within a NNewsProvider");return e}function FL({article:e,categories:t=[],tags:n=[],onSave:r,onCancel:i,loading:s=!1}){const{articleApi:o}=Gi(),[a,l]=G.useState(""),[c,u]=G.useState(""),[d,h]=G.useState(""),[f,p]=G.useState(""),[m,b]=G.useState(!1),[y,w]=G.useState(Fe.Draft),[v,T]=G.useState(null),[C,A]=G.useState(""),[F,U]=G.useState([]),[K,O]=G.useState(""),[q,B]=G.useState({});G.useEffect(()=>{var M,H;e&&(l(e.title),u(e.content),h(e.imageName||""),console.log("imageName:",e.imageName),e.imageName&&p(e.imageName),w(e.status),T(e.categoryId||null),A(e.dateAt?new Date(e.dateAt).toISOString().slice(0,16):""),U(((M=e.tags)==null?void 0:M.map(x=>x.tagId).filter(x=>x!==void 0))||[]),O(((H=e.roles)==null?void 0:H.map(x=>x.slug).join(", "))||""))},[e]);const re=()=>{const M={};return a.trim()||(M.title="Title is required"),c.trim()||(M.content="Content is required"),B(M),Object.keys(M).length===0},Q=async M=>{if(M.preventDefault(),!re())return;const H=K.split(",").map(Y=>Y.trim()).filter(Y=>Y.length>0),x={title:a.trim(),content:c.trim(),imageName:d||void 0,status:y,categoryId:v||void 0,dateAt:C||void 0,tagIds:F.length>0?F:void 0,roleIds:H.length>0?H:void 0};e?await r({articleId:e.articleId,...x}):await r(x)},Z=async M=>{var Y;const H=(Y=M.target.files)==null?void 0:Y[0];if(!H)return;if(!H.type.startsWith("image/")){B({...q,image:"Please select an image file"});return}if(H.size>5*1024*1024){B({...q,image:"Image size must be less than 5MB"});return}B({...q,image:""});const x=new FileReader;x.onloadend=()=>{p(x.result)},x.readAsDataURL(H);try{b(!0);const ae=await o.uploadImage(H);h(ae),B({...q,image:""})}catch(ae){console.error("Error uploading image:",ae),B({...q,image:"Failed to upload image. Please try again."})}finally{b(!1)}},L=()=>{p(""),h("")},$=M=>{U(H=>H.includes(M)?H.filter(x=>x!==M):[...H,M])};return _.jsxs("form",{onSubmit:Q,className:"space-y-6",children:[_.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[_.jsxs("div",{className:"col-span-2 p-4",children:[_.jsxs("div",{className:"space-y-2",children:[_.jsx("label",{htmlFor:"title",className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"Title *"}),_.jsx("input",{id:"title",type:"text",value:a,onChange:M=>l(M.target.value),className:`w-full rounded-md border ${q.title?"border-red-300 dark:border-red-600":"border-gray-300 dark:border-gray-600"} px-4 py-2 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500`,placeholder:"Enter article title"}),q.title&&_.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:q.title})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsx("label",{htmlFor:"dateAt",className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"Publication Date"}),_.jsx("input",{id:"dateAt",type:"datetime-local",value:C,onChange:M=>A(M.target.value),className:"w-full rounded-md border border-gray-300 dark:border-gray-600 px-4 py-2 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500"})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsx("label",{htmlFor:"category",className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"Category"}),_.jsxs("select",{id:"category",value:v||"",onChange:M=>T(M.target.value?Number(M.target.value):null),className:"w-full rounded-md border border-gray-300 dark:border-gray-600 px-4 py-2 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500",children:[_.jsx("option",{value:"",children:"No Category"}),t.map(M=>_.jsx("option",{value:M.categoryId,children:M.title},M.categoryId))]})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsx("label",{htmlFor:"status",className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"Status"}),_.jsxs("select",{id:"status",value:y,onChange:M=>w(Number(M.target.value)),className:"w-full rounded-md border border-gray-300 dark:border-gray-600 px-4 py-2 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500",children:[_.jsx("option",{value:Fe.Draft,children:"Draft"}),_.jsx("option",{value:Fe.Published,children:"Published"}),_.jsx("option",{value:Fe.Archived,children:"Archived"}),_.jsx("option",{value:Fe.Scheduled,children:"Scheduled"}),_.jsx("option",{value:Fe.Review,children:"Review"})]})]})]}),_.jsx("div",{className:"col-span-1",children:_.jsxs("div",{className:"space-y-2",children:[_.jsx("label",{htmlFor:"image",className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"Featured Image"}),f?_.jsxs("div",{className:"relative",children:[_.jsx("img",{src:f,alt:"Preview",className:"w-full h-[250px] object-cover rounded-md border border-gray-300 dark:border-gray-600",style:{height:"250px"}}),_.jsx("button",{type:"button",onClick:L,className:"absolute top-2 right-2 rounded-full bg-red-600 p-2 text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500",disabled:m,style:{top:"2px",right:"2px"},children:_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:_.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})}),m&&_.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black bg-opacity-50 rounded-md",children:_.jsx("span",{className:"text-white text-sm",children:"Uploading..."})})]}):_.jsx("div",{className:"flex items-center",children:_.jsx("input",{id:"image",type:"file",accept:"image/*",onChange:Z,disabled:m,className:"block w-full text-sm text-gray-900 dark:text-gray-100 border border-gray-300 dark:border-gray-600 rounded-md cursor-pointer bg-white dark:bg-gray-900 focus:outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500"})}),q.image&&_.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:q.image}),_.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"JPG, PNG, GIF. Max 5MB"})]})})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"Content *"}),_.jsx(Lg,{value:c,onChange:u,placeholder:"Write your article content...",error:q.content}),q.content&&_.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:q.content})]}),n.length>0&&_.jsxs("div",{className:"space-y-2",children:[_.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"Tags"}),_.jsx("div",{className:"flex flex-wrap gap-2",children:n.map(M=>_.jsxs("button",{type:"button",onClick:()=>$(M.tagId||0),className:`rounded-md px-3 py-1 text-sm font-medium transition-colors ${F.includes(M.tagId||0)?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"}`,children:["#",M.title]},M.tagId))})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsx("label",{htmlFor:"roles",className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:"Roles"}),_.jsx("input",{id:"roles",type:"text",value:K,onChange:M=>O(M.target.value),className:"w-full rounded-md border border-gray-300 dark:border-gray-600 px-4 py-2 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500",placeholder:"Enter role slugs separated by commas (e.g., admin, editor)"}),_.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Comma-separated list of role slugs."})]}),_.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[_.jsx("button",{type:"button",onClick:i,disabled:s,className:"rounded-md border border-gray-300 dark:border-gray-600 px-6 py-2 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-50",children:"Cancel"}),_.jsx("button",{type:"submit",disabled:s,className:"rounded-md bg-blue-600 px-6 py-2 text-white hover:bg-blue-700 disabled:opacity-50",children:s?"Saving...":e?"Update Article":"Create Article"})]})]})}function qL({value:e,onChange:t,placeholder:n="Write your content in Markdown...",label:r,error:i,minHeight:s="400px"}){const[o,a]=G.useState("edit");return _.jsxs("div",{className:"space-y-2",children:[r&&_.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:r}),_.jsxs("div",{className:"overflow-hidden rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-900",children:[_.jsxs("div",{className:"flex border-b border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800",children:[_.jsx("button",{type:"button",onClick:()=>a("edit"),className:`flex-1 px-4 py-2 text-sm font-medium ${o==="edit"?"border-b-2 border-blue-600 bg-white dark:bg-gray-900 text-blue-600 dark:text-blue-400":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100"}`,children:"Edit"}),_.jsx("button",{type:"button",onClick:()=>a("preview"),className:`flex-1 px-4 py-2 text-sm font-medium ${o==="preview"?"border-b-2 border-blue-600 bg-white dark:bg-gray-900 text-blue-600 dark:text-blue-400":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100"}`,children:"Preview"})]}),_.jsx("div",{style:{minHeight:s},children:o==="edit"?_.jsx("textarea",{value:e,onChange:l=>t(l.target.value),placeholder:n,className:"h-full w-full resize-none border-0 p-4 font-mono text-sm bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-0",style:{minHeight:s}}):_.jsx("div",{className:"prose dark:prose-invert max-w-none p-4 text-gray-900 dark:text-gray-100",children:e?_.jsx(ch,{remarkPlugins:[qh],rehypePlugins:[_p],children:e}):_.jsx("div",{className:"text-gray-400 dark:text-gray-500",children:"Nothing to preview"})})})]}),i&&_.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:i}),_.jsxs("div",{className:"rounded-md bg-gray-50 dark:bg-gray-800 p-3 text-xs text-gray-600 dark:text-gray-400",children:[_.jsx("p",{className:"font-medium",children:"Markdown Syntax Help:"}),_.jsxs("div",{className:"mt-1 grid grid-cols-2 gap-2",children:[_.jsxs("div",{children:[_.jsx("strong",{children:"# Heading 1"})," - Main heading"]}),_.jsxs("div",{children:[_.jsx("strong",{children:"## Heading 2"})," - Subheading"]}),_.jsxs("div",{children:[_.jsx("strong",{children:"**bold text**"})," - Bold"]}),_.jsxs("div",{children:[_.jsx("strong",{children:"*italic text*"})," - Italic"]}),_.jsxs("div",{children:[_.jsx("strong",{children:"[link](url)"})," - Link"]}),_.jsxs("div",{children:[_.jsx("strong",{children:""})," - Image"]}),_.jsxs("div",{children:[_.jsx("strong",{children:"- item"})," - Bullet list"]}),_.jsxs("div",{children:[_.jsx("strong",{children:"1. item"})," - Numbered list"]}),_.jsxs("div",{children:[_.jsx("strong",{children:"`code`"})," - Inline code"]}),_.jsxs("div",{children:[_.jsx("strong",{children:"```language```"})," - Code block"]})]})]})]})}/**
|
|
172
172
|
* @license lucide-react v0.462.0 - ISC
|
|
173
173
|
*
|
|
174
174
|
* This source code is licensed under the ISC license.
|