@lax-wp/design-system 0.4.3 → 0.4.4
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.es.js +2 -2
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -36085,7 +36085,7 @@ const MdInput = ({
|
|
|
36085
36085
|
value: t = "",
|
|
36086
36086
|
onChange: n,
|
|
36087
36087
|
placeholder: a = "Enter markdown content...",
|
|
36088
|
-
rows: s =
|
|
36088
|
+
rows: s = 1,
|
|
36089
36089
|
disabled: o = !1,
|
|
36090
36090
|
className: V,
|
|
36091
36091
|
textareaClassName: W,
|
|
@@ -36202,7 +36202,7 @@ const MdInput = ({
|
|
|
36202
36202
|
"overflow-y-auto text-sm",
|
|
36203
36203
|
G
|
|
36204
36204
|
),
|
|
36205
|
-
style: { "--rows": xe - 3 },
|
|
36205
|
+
style: { "--rows": xe > 3 ? xe - 3 : xe },
|
|
36206
36206
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "markdown-preview text-gray-900 dark:text-gray-100 [&_h1]:text-2xl [&_h1]:font-bold [&_h1]:mb-4 [&_h1]:mt-2 [&_h2]:text-xl [&_h2]:font-bold [&_h2]:mb-3 [&_h2]:mt-2 [&_h3]:text-lg [&_h3]:font-semibold [&_h3]:mb-2 [&_h3]:mt-2 [&_p]:mb-2 [&_p]:leading-relaxed [&_ul]:list-disc [&_ul]:ml-6 [&_ul]:mb-2 [&_ol]:list-decimal [&_ol]:ml-6 [&_ol]:mb-2 [&_li]:mb-1 [&_code]:bg-gray-100 [&_code]:dark:bg-gray-800 [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-sm [&_code]:font-mono [&_pre]:bg-gray-100 [&_pre]:dark:bg-gray-800 [&_pre]:p-3 [&_pre]:rounded [&_pre]:overflow-x-auto [&_pre]:mb-2 [&_blockquote]:border-l-4 [&_blockquote]:border-gray-300 [&_blockquote]:dark:border-gray-600 [&_blockquote]:pl-4 [&_blockquote]:italic [&_blockquote]:mb-2 [&_a]:text-blue-600 [&_a]:dark:text-blue-400 [&_a]:underline [&_strong]:font-bold [&_em]:italic [&_table]:w-full [&_table]:border-collapse [&_table]:mb-2 [&_th]:border [&_th]:border-gray-300 [&_th]:dark:border-gray-600 [&_th]:px-2 [&_th]:py-1 [&_th]:bg-gray-50 [&_th]:dark:bg-gray-700 [&_th]:font-semibold [&_td]:border [&_td]:border-gray-300 [&_td]:dark:border-gray-600 [&_td]:px-2 [&_td]:py-1 [&_hr]:my-4 [&_hr]:border-gray-300 [&_hr]:dark:border-gray-600", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Markdown, { remarkPlugins: [remarkGfm], children: t || "*No content to preview*" }) })
|
|
36207
36207
|
}
|
|
36208
36208
|
),
|
package/dist/index.umd.js
CHANGED
|
@@ -172,7 +172,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
172
172
|
`))+1))}const V="#".repeat(s),W=n.enter("headingAtx"),G=n.enter("phrasing");o.move(V+" ");let U=n.containerPhrasing(e,{before:"# ",after:`
|
|
173
173
|
`,...o.current()});return/^[\t ]/.test(U)&&(U=encodeCharacterReference(U.charCodeAt(0))+U.slice(1)),U=U?V+" "+U:V,n.options.closeAtx&&(U+=" "+V),G(),W(),U}html.peek=htmlPeek;function html(e){return e.value||""}function htmlPeek(){return"<"}image.peek=imagePeek;function image(e,t,n,a){const s=checkQuote(n),o=s==='"'?"Quote":"Apostrophe",V=n.enter("image");let W=n.enter("label");const G=n.createTracker(a);let U=G.move("![");return U+=G.move(n.safe(e.alt,{before:U,after:"]",...G.current()})),U+=G.move("]("),W(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(W=n.enter("destinationLiteral"),U+=G.move("<"),U+=G.move(n.safe(e.url,{before:U,after:">",...G.current()})),U+=G.move(">")):(W=n.enter("destinationRaw"),U+=G.move(n.safe(e.url,{before:U,after:e.title?" ":")",...G.current()}))),W(),e.title&&(W=n.enter(`title${o}`),U+=G.move(" "+s),U+=G.move(n.safe(e.title,{before:U,after:s,...G.current()})),U+=G.move(s),W()),U+=G.move(")"),V(),U}function imagePeek(){return"!"}imageReference.peek=imageReferencePeek;function imageReference(e,t,n,a){const s=e.referenceType,o=n.enter("imageReference");let V=n.enter("label");const W=n.createTracker(a);let G=W.move("![");const U=n.safe(e.alt,{before:G,after:"]",...W.current()});G+=W.move(U+"]["),V();const J=n.stack;n.stack=[],V=n.enter("reference");const K=n.safe(n.associationId(e),{before:G,after:"]",...W.current()});return V(),n.stack=J,o(),s==="full"||!U||U!==K?G+=W.move(K+"]"):s==="shortcut"?G=G.slice(0,-1):G+=W.move("]"),G}function imageReferencePeek(){return"!"}inlineCode.peek=inlineCodePeek;function inlineCode(e,t,n){let a=e.value||"",s="`",o=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(a);)s+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++o<n.unsafe.length;){const V=n.unsafe[o],W=n.compilePattern(V);let G;if(V.atBreak)for(;G=W.exec(a);){let U=G.index;a.charCodeAt(U)===10&&a.charCodeAt(U-1)===13&&U--,a=a.slice(0,U)+" "+a.slice(G.index+1)}}return s+a+s}function inlineCodePeek(){return"`"}function formatLinkAsAutolink(e,t){const n=toString$1(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}link.peek=linkPeek;function link(e,t,n,a){const s=checkQuote(n),o=s==='"'?"Quote":"Apostrophe",V=n.createTracker(a);let W,G;if(formatLinkAsAutolink(e,n)){const J=n.stack;n.stack=[],W=n.enter("autolink");let K=V.move("<");return K+=V.move(n.containerPhrasing(e,{before:K,after:">",...V.current()})),K+=V.move(">"),W(),n.stack=J,K}W=n.enter("link"),G=n.enter("label");let U=V.move("[");return U+=V.move(n.containerPhrasing(e,{before:U,after:"](",...V.current()})),U+=V.move("]("),G(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(G=n.enter("destinationLiteral"),U+=V.move("<"),U+=V.move(n.safe(e.url,{before:U,after:">",...V.current()})),U+=V.move(">")):(G=n.enter("destinationRaw"),U+=V.move(n.safe(e.url,{before:U,after:e.title?" ":")",...V.current()}))),G(),e.title&&(G=n.enter(`title${o}`),U+=V.move(" "+s),U+=V.move(n.safe(e.title,{before:U,after:s,...V.current()})),U+=V.move(s),G()),U+=V.move(")"),W(),U}function linkPeek(e,t,n){return formatLinkAsAutolink(e,n)?"<":"["}linkReference.peek=linkReferencePeek;function linkReference(e,t,n,a){const s=e.referenceType,o=n.enter("linkReference");let V=n.enter("label");const W=n.createTracker(a);let G=W.move("[");const U=n.containerPhrasing(e,{before:G,after:"]",...W.current()});G+=W.move(U+"]["),V();const J=n.stack;n.stack=[],V=n.enter("reference");const K=n.safe(n.associationId(e),{before:G,after:"]",...W.current()});return V(),n.stack=J,o(),s==="full"||!U||U!==K?G+=W.move(K+"]"):s==="shortcut"?G=G.slice(0,-1):G+=W.move("]"),G}function linkReferencePeek(){return"["}function checkBullet(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function checkBulletOther(e){const t=checkBullet(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function checkBulletOrdered(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function checkRule(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function list(e,t,n,a){const s=n.enter("list"),o=n.bulletCurrent;let V=e.ordered?checkBulletOrdered(n):checkBullet(n);const W=e.ordered?V==="."?")":".":checkBulletOther(n);let G=t&&n.bulletLastUsed?V===n.bulletLastUsed:!1;if(!e.ordered){const J=e.children?e.children[0]:void 0;if((V==="*"||V==="-")&&J&&(!J.children||!J.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(G=!0),checkRule(n)===V&&J){let K=-1;for(;++K<e.children.length;){const ne=e.children[K];if(ne&&ne.type==="listItem"&&ne.children&&ne.children[0]&&ne.children[0].type==="thematicBreak"){G=!0;break}}}}G&&(V=W),n.bulletCurrent=V;const U=n.containerFlow(e,a);return n.bulletLastUsed=V,n.bulletCurrent=o,s(),U}function checkListItemIndent(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function listItem(e,t,n,a){const s=checkListItemIndent(n);let o=n.bulletCurrent||checkBullet(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let V=o.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(V=Math.ceil(V/4)*4);const W=n.createTracker(a);W.move(o+" ".repeat(V-o.length)),W.shift(V);const G=n.enter("listItem"),U=n.indentLines(n.containerFlow(e,W.current()),J);return G(),U;function J(K,ne,ce){return ne?(ce?"":" ".repeat(V))+K:(ce?o:o+" ".repeat(V-o.length))+K}}function paragraph(e,t,n,a){const s=n.enter("paragraph"),o=n.enter("phrasing"),V=n.containerPhrasing(e,a);return o(),s(),V}const phrasing=convert(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function root(e,t,n,a){return(e.children.some(function(V){return phrasing(V)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function checkStrong(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}strong.peek=strongPeek;function strong(e,t,n,a){const s=checkStrong(n),o=n.enter("strong"),V=n.createTracker(a),W=V.move(s+s);let G=V.move(n.containerPhrasing(e,{after:s,before:W,...V.current()}));const U=G.charCodeAt(0),J=encodeInfo(a.before.charCodeAt(a.before.length-1),U,s);J.inside&&(G=encodeCharacterReference(U)+G.slice(1));const K=G.charCodeAt(G.length-1),ne=encodeInfo(a.after.charCodeAt(0),K,s);ne.inside&&(G=G.slice(0,-1)+encodeCharacterReference(K));const ce=V.move(s+s);return o(),n.attentionEncodeSurroundingInfo={after:ne.outside,before:J.outside},W+G+ce}function strongPeek(e,t,n){return n.options.strong||"*"}function text$1(e,t,n,a){return n.safe(e.value,a)}function checkRuleRepetition(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function thematicBreak(e,t,n){const a=(checkRule(n)+(n.options.ruleSpaces?" ":"")).repeat(checkRuleRepetition(n));return n.options.ruleSpaces?a.slice(0,-1):a}const handle={blockquote,break:hardBreak,code:code$1,definition,emphasis,hardBreak,heading,html,image,imageReference,inlineCode,link,linkReference,list,listItem,paragraph,root,strong,text:text$1,thematicBreak};function gfmTableFromMarkdown(){return{enter:{table:enterTable,tableData:enterCell,tableHeader:enterCell,tableRow:enterRow},exit:{codeText:exitCodeText,table:exitTable,tableData:exit,tableHeader:exit,tableRow:exit}}}function enterTable(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function exitTable(e){this.exit(e),this.data.inTable=void 0}function enterRow(e){this.enter({type:"tableRow",children:[]},e)}function exit(e){this.exit(e)}function enterCell(e){this.enter({type:"tableCell",children:[]},e)}function exitCodeText(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,replace));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function replace(e,t){return t==="|"?t:e}function gfmTableToMarkdown(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,s=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
174
174
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:ne,table:V,tableCell:G,tableRow:W}};function V(ce,me,ue,ve){return U(J(ce,ue,ve),ce.align)}function W(ce,me,ue,ve){const pe=K(ce,ue,ve),xe=U([pe]);return xe.slice(0,xe.indexOf(`
|
|
175
|
-
`))}function G(ce,me,ue,ve){const pe=ue.enter("tableCell"),xe=ue.enter("phrasing"),ge=ue.containerPhrasing(ce,{...ve,before:o,after:o});return xe(),pe(),ge}function U(ce,me){return markdownTable(ce,{align:me,alignDelimiters:a,padding:n,stringLength:s})}function J(ce,me,ue){const ve=ce.children;let pe=-1;const xe=[],ge=me.enter("table");for(;++pe<ve.length;)xe[pe]=K(ve[pe],me,ue);return ge(),xe}function K(ce,me,ue){const ve=ce.children;let pe=-1;const xe=[],ge=me.enter("tableRow");for(;++pe<ve.length;)xe[pe]=G(ve[pe],ce,me,ue);return ge(),xe}function ne(ce,me,ue){let ve=handle.inlineCode(ce,me,ue);return ue.stack.includes("tableCell")&&(ve=ve.replace(/\|/g,"\\$&")),ve}}function gfmTaskListItemFromMarkdown(){return{exit:{taskListCheckValueChecked:exitCheck,taskListCheckValueUnchecked:exitCheck,paragraph:exitParagraphWithTaskListItem}}}function gfmTaskListItemToMarkdown(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:listItemWithTaskListItem}}}function exitCheck(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function exitParagraphWithTaskListItem(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const s=t.children;let o=-1,V;for(;++o<s.length;){const W=s[o];if(W.type==="paragraph"){V=W;break}}V===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function listItemWithTaskListItem(e,t,n,a){const s=e.children[0],o=typeof e.checked=="boolean"&&s&&s.type==="paragraph",V="["+(e.checked?"x":" ")+"] ",W=n.createTracker(a);o&&W.move(V);let G=handle.listItem(e,t,n,{...a,...W.current()});return o&&(G=G.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,U)),G;function U(J){return J+V}}function gfmFromMarkdown(){return[gfmAutolinkLiteralFromMarkdown(),gfmFootnoteFromMarkdown(),gfmStrikethroughFromMarkdown(),gfmTableFromMarkdown(),gfmTaskListItemFromMarkdown()]}function gfmToMarkdown(e){return{extensions:[gfmAutolinkLiteralToMarkdown(),gfmFootnoteToMarkdown(e),gfmStrikethroughToMarkdown(),gfmTableToMarkdown(e),gfmTaskListItemToMarkdown()]}}const wwwPrefix={tokenize:tokenizeWwwPrefix,partial:!0},domain={tokenize:tokenizeDomain,partial:!0},path={tokenize:tokenizePath,partial:!0},trail={tokenize:tokenizeTrail,partial:!0},emailDomainDotTrail={tokenize:tokenizeEmailDomainDotTrail,partial:!0},wwwAutolink={name:"wwwAutolink",tokenize:tokenizeWwwAutolink,previous:previousWww},protocolAutolink={name:"protocolAutolink",tokenize:tokenizeProtocolAutolink,previous:previousProtocol},emailAutolink={name:"emailAutolink",tokenize:tokenizeEmailAutolink,previous:previousEmail},text={};function gfmAutolinkLiteral(){return{text}}let code=48;for(;code<123;)text[code]=emailAutolink,code++,code===58?code=65:code===91&&(code=97);text[43]=emailAutolink,text[45]=emailAutolink,text[46]=emailAutolink,text[95]=emailAutolink,text[72]=[emailAutolink,protocolAutolink],text[104]=[emailAutolink,protocolAutolink],text[87]=[emailAutolink,wwwAutolink],text[119]=[emailAutolink,wwwAutolink];function tokenizeEmailAutolink(e,t,n){const a=this;let s,o;return V;function V(K){return!gfmAtext(K)||!previousEmail.call(a,a.previous)||previousUnbalanced(a.events)?n(K):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),W(K))}function W(K){return gfmAtext(K)?(e.consume(K),W):K===64?(e.consume(K),G):n(K)}function G(K){return K===46?e.check(emailDomainDotTrail,J,U)(K):K===45||K===95||asciiAlphanumeric(K)?(o=!0,e.consume(K),G):J(K)}function U(K){return e.consume(K),s=!0,G}function J(K){return o&&s&&asciiAlpha(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(K)):n(K)}}function tokenizeWwwAutolink(e,t,n){const a=this;return s;function s(V){return V!==87&&V!==119||!previousWww.call(a,a.previous)||previousUnbalanced(a.events)?n(V):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(wwwPrefix,e.attempt(domain,e.attempt(path,o),n),n)(V))}function o(V){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(V)}}function tokenizeProtocolAutolink(e,t,n){const a=this;let s="",o=!1;return V;function V(K){return(K===72||K===104)&&previousProtocol.call(a,a.previous)&&!previousUnbalanced(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(K),e.consume(K),W):n(K)}function W(K){if(asciiAlpha(K)&&s.length<5)return s+=String.fromCodePoint(K),e.consume(K),W;if(K===58){const ne=s.toLowerCase();if(ne==="http"||ne==="https")return e.consume(K),G}return n(K)}function G(K){return K===47?(e.consume(K),o?U:(o=!0,G)):n(K)}function U(K){return K===null||asciiControl(K)||markdownLineEndingOrSpace(K)||unicodeWhitespace(K)||unicodePunctuation(K)?n(K):e.attempt(domain,e.attempt(path,J),n)(K)}function J(K){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(K)}}function tokenizeWwwPrefix(e,t,n){let a=0;return s;function s(V){return(V===87||V===119)&&a<3?(a++,e.consume(V),s):V===46&&a===3?(e.consume(V),o):n(V)}function o(V){return V===null?n(V):t(V)}}function tokenizeDomain(e,t,n){let a,s,o;return V;function V(U){return U===46||U===95?e.check(trail,G,W)(U):U===null||markdownLineEndingOrSpace(U)||unicodeWhitespace(U)||U!==45&&unicodePunctuation(U)?G(U):(o=!0,e.consume(U),V)}function W(U){return U===95?a=!0:(s=a,a=void 0),e.consume(U),V}function G(U){return s||a||!o?n(U):t(U)}}function tokenizePath(e,t){let n=0,a=0;return s;function s(V){return V===40?(n++,e.consume(V),s):V===41&&a<n?o(V):V===33||V===34||V===38||V===39||V===41||V===42||V===44||V===46||V===58||V===59||V===60||V===63||V===93||V===95||V===126?e.check(trail,t,o)(V):V===null||markdownLineEndingOrSpace(V)||unicodeWhitespace(V)?t(V):(e.consume(V),s)}function o(V){return V===41&&a++,e.consume(V),s}}function tokenizeTrail(e,t,n){return a;function a(W){return W===33||W===34||W===39||W===41||W===42||W===44||W===46||W===58||W===59||W===63||W===95||W===126?(e.consume(W),a):W===38?(e.consume(W),o):W===93?(e.consume(W),s):W===60||W===null||markdownLineEndingOrSpace(W)||unicodeWhitespace(W)?t(W):n(W)}function s(W){return W===null||W===40||W===91||markdownLineEndingOrSpace(W)||unicodeWhitespace(W)?t(W):a(W)}function o(W){return asciiAlpha(W)?V(W):n(W)}function V(W){return W===59?(e.consume(W),a):asciiAlpha(W)?(e.consume(W),V):n(W)}}function tokenizeEmailDomainDotTrail(e,t,n){return a;function a(o){return e.consume(o),s}function s(o){return asciiAlphanumeric(o)?n(o):t(o)}}function previousWww(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||markdownLineEndingOrSpace(e)}function previousProtocol(e){return!asciiAlpha(e)}function previousEmail(e){return!(e===47||gfmAtext(e))}function gfmAtext(e){return e===43||e===45||e===46||e===95||asciiAlphanumeric(e)}function previousUnbalanced(e){let t=e.length,n=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){n=!0;break}if(a._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const indent={tokenize:tokenizeIndent,partial:!0};function gfmFootnote(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:tokenizeDefinitionStart,continuation:{tokenize:tokenizeDefinitionContinuation},exit:gfmFootnoteDefinitionEnd}},text:{91:{name:"gfmFootnoteCall",tokenize:tokenizeGfmFootnoteCall},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:tokenizePotentialGfmFootnoteCall,resolveTo:resolveToPotentialGfmFootnoteCall}}}}function tokenizePotentialGfmFootnoteCall(e,t,n){const a=this;let s=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let V;for(;s--;){const G=a.events[s][1];if(G.type==="labelImage"){V=G;break}if(G.type==="gfmFootnoteCall"||G.type==="labelLink"||G.type==="label"||G.type==="image"||G.type==="link")break}return W;function W(G){if(!V||!V._balanced)return n(G);const U=normalizeIdentifier(a.sliceSerialize({start:V.end,end:a.now()}));return U.codePointAt(0)!==94||!o.includes(U.slice(1))?n(G):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(G),e.exit("gfmFootnoteCallLabelMarker"),t(G))}}function resolveToPotentialGfmFootnoteCall(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},V={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},W=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",o,t],["enter",V,t],["exit",V,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...W),e}function tokenizeGfmFootnoteCall(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,V;return W;function W(K){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(K),e.exit("gfmFootnoteCallLabelMarker"),G}function G(K){return K!==94?n(K):(e.enter("gfmFootnoteCallMarker"),e.consume(K),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",U)}function U(K){if(o>999||K===93&&!V||K===null||K===91||markdownLineEndingOrSpace(K))return n(K);if(K===93){e.exit("chunkString");const ne=e.exit("gfmFootnoteCallString");return s.includes(normalizeIdentifier(a.sliceSerialize(ne)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(K),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(K)}return markdownLineEndingOrSpace(K)||(V=!0),o++,e.consume(K),K===92?J:U}function J(K){return K===91||K===92||K===93?(e.consume(K),o++,U):U(K)}}function tokenizeDefinitionStart(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,V=0,W;return G;function G(me){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(me),e.exit("gfmFootnoteDefinitionLabelMarker"),U}function U(me){return me===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(me),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",J):n(me)}function J(me){if(V>999||me===93&&!W||me===null||me===91||markdownLineEndingOrSpace(me))return n(me);if(me===93){e.exit("chunkString");const ue=e.exit("gfmFootnoteDefinitionLabelString");return o=normalizeIdentifier(a.sliceSerialize(ue)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(me),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),ne}return markdownLineEndingOrSpace(me)||(W=!0),V++,e.consume(me),me===92?K:J}function K(me){return me===91||me===92||me===93?(e.consume(me),V++,J):J(me)}function ne(me){return me===58?(e.enter("definitionMarker"),e.consume(me),e.exit("definitionMarker"),s.includes(o)||s.push(o),factorySpace(e,ce,"gfmFootnoteDefinitionWhitespace")):n(me)}function ce(me){return t(me)}}function tokenizeDefinitionContinuation(e,t,n){return e.check(blankLine,t,e.attempt(indent,t,n))}function gfmFootnoteDefinitionEnd(e){e.exit("gfmFootnoteDefinition")}function tokenizeIndent(e,t,n){const a=this;return factorySpace(e,s,"gfmFootnoteDefinitionIndent",5);function s(o){const V=a.events[a.events.length-1];return V&&V[1].type==="gfmFootnoteDefinitionIndent"&&V[2].sliceSerialize(V[1],!0).length===4?t(o):n(o)}}function gfmStrikethrough(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:s};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function s(V,W){let G=-1;for(;++G<V.length;)if(V[G][0]==="enter"&&V[G][1].type==="strikethroughSequenceTemporary"&&V[G][1]._close){let U=G;for(;U--;)if(V[U][0]==="exit"&&V[U][1].type==="strikethroughSequenceTemporary"&&V[U][1]._open&&V[G][1].end.offset-V[G][1].start.offset===V[U][1].end.offset-V[U][1].start.offset){V[G][1].type="strikethroughSequence",V[U][1].type="strikethroughSequence";const J={type:"strikethrough",start:Object.assign({},V[U][1].start),end:Object.assign({},V[G][1].end)},K={type:"strikethroughText",start:Object.assign({},V[U][1].end),end:Object.assign({},V[G][1].start)},ne=[["enter",J,W],["enter",V[U][1],W],["exit",V[U][1],W],["enter",K,W]],ce=W.parser.constructs.insideSpan.null;ce&&splice(ne,ne.length,0,resolveAll(ce,V.slice(U+1,G),W)),splice(ne,ne.length,0,[["exit",K,W],["enter",V[G][1],W],["exit",V[G][1],W],["exit",J,W]]),splice(V,U-1,G-U+3,ne),G=U+ne.length-2;break}}for(G=-1;++G<V.length;)V[G][1].type==="strikethroughSequenceTemporary"&&(V[G][1].type="data");return V}function o(V,W,G){const U=this.previous,J=this.events;let K=0;return ne;function ne(me){return U===126&&J[J.length-1][1].type!=="characterEscape"?G(me):(V.enter("strikethroughSequenceTemporary"),ce(me))}function ce(me){const ue=classifyCharacter(U);if(me===126)return K>1?G(me):(V.consume(me),K++,ce);if(K<2&&!n)return G(me);const ve=V.exit("strikethroughSequenceTemporary"),pe=classifyCharacter(me);return ve._open=!pe||pe===2&&!!ue,ve._close=!ue||ue===2&&!!pe,W(me)}}}class EditMap{constructor(){this.map=[]}add(t,n,a){addImplementation(this,t,n,a)}consume(t){if(this.map.sort(function(o,V){return o[0]-V[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let s=a.pop();for(;s;){for(const o of s)t.push(o);s=a.pop()}this.map.length=0}}function addImplementation(e,t,n,a){let s=0;if(!(n===0&&a.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...a);return}s+=1}e.map.push([t,n,a])}}function gfmTableAlign(e,t){let n=!1;const a=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function gfmTable(){return{flow:{null:{name:"table",tokenize:tokenizeTable,resolveAll:resolveTable}}}}function tokenizeTable(e,t,n){const a=this;let s=0,o=0,V;return W;function W($e){let We=a.events.length-1;for(;We>-1;){const Be=a.events[We][1].type;if(Be==="lineEnding"||Be==="linePrefix")We--;else break}const ke=We>-1?a.events[We][1].type:null,Ge=ke==="tableHead"||ke==="tableRow"?Se:G;return Ge===Se&&a.parser.lazy[a.now().line]?n($e):Ge($e)}function G($e){return e.enter("tableHead"),e.enter("tableRow"),U($e)}function U($e){return $e===124||(V=!0,o+=1),J($e)}function J($e){return $e===null?n($e):markdownLineEnding($e)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume($e),e.exit("lineEnding"),ce):n($e):markdownSpace($e)?factorySpace(e,J,"whitespace")($e):(o+=1,V&&(V=!1,s+=1),$e===124?(e.enter("tableCellDivider"),e.consume($e),e.exit("tableCellDivider"),V=!0,J):(e.enter("data"),K($e)))}function K($e){return $e===null||$e===124||markdownLineEndingOrSpace($e)?(e.exit("data"),J($e)):(e.consume($e),$e===92?ne:K)}function ne($e){return $e===92||$e===124?(e.consume($e),K):K($e)}function ce($e){return a.interrupt=!1,a.parser.lazy[a.now().line]?n($e):(e.enter("tableDelimiterRow"),V=!1,markdownSpace($e)?factorySpace(e,me,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($e):me($e))}function me($e){return $e===45||$e===58?ve($e):$e===124?(V=!0,e.enter("tableCellDivider"),e.consume($e),e.exit("tableCellDivider"),ue):Re($e)}function ue($e){return markdownSpace($e)?factorySpace(e,ve,"whitespace")($e):ve($e)}function ve($e){return $e===58?(o+=1,V=!0,e.enter("tableDelimiterMarker"),e.consume($e),e.exit("tableDelimiterMarker"),pe):$e===45?(o+=1,pe($e)):$e===null||markdownLineEnding($e)?ye($e):Re($e)}function pe($e){return $e===45?(e.enter("tableDelimiterFiller"),xe($e)):Re($e)}function xe($e){return $e===45?(e.consume($e),xe):$e===58?(V=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume($e),e.exit("tableDelimiterMarker"),ge):(e.exit("tableDelimiterFiller"),ge($e))}function ge($e){return markdownSpace($e)?factorySpace(e,ye,"whitespace")($e):ye($e)}function ye($e){return $e===124?me($e):$e===null||markdownLineEnding($e)?!V||s!==o?Re($e):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t($e)):Re($e)}function Re($e){return n($e)}function Se($e){return e.enter("tableRow"),Ae($e)}function Ae($e){return $e===124?(e.enter("tableCellDivider"),e.consume($e),e.exit("tableCellDivider"),Ae):$e===null||markdownLineEnding($e)?(e.exit("tableRow"),t($e)):markdownSpace($e)?factorySpace(e,Ae,"whitespace")($e):(e.enter("data"),Te($e))}function Te($e){return $e===null||$e===124||markdownLineEndingOrSpace($e)?(e.exit("data"),Ae($e)):(e.consume($e),$e===92?Le:Te)}function Le($e){return $e===92||$e===124?(e.consume($e),Te):Te($e)}}function resolveTable(e,t){let n=-1,a=!0,s=0,o=[0,0,0,0],V=[0,0,0,0],W=!1,G=0,U,J,K;const ne=new EditMap;for(;++n<e.length;){const ce=e[n],me=ce[1];ce[0]==="enter"?me.type==="tableHead"?(W=!1,G!==0&&(flushTableEnd(ne,t,G,U,J),J=void 0,G=0),U={type:"table",start:Object.assign({},me.start),end:Object.assign({},me.end)},ne.add(n,0,[["enter",U,t]])):me.type==="tableRow"||me.type==="tableDelimiterRow"?(a=!0,K=void 0,o=[0,0,0,0],V=[0,n+1,0,0],W&&(W=!1,J={type:"tableBody",start:Object.assign({},me.start),end:Object.assign({},me.end)},ne.add(n,0,[["enter",J,t]])),s=me.type==="tableDelimiterRow"?2:J?3:1):s&&(me.type==="data"||me.type==="tableDelimiterMarker"||me.type==="tableDelimiterFiller")?(a=!1,V[2]===0&&(o[1]!==0&&(V[0]=V[1],K=flushCell(ne,t,o,s,void 0,K),o=[0,0,0,0]),V[2]=n)):me.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(V[0]=V[1],K=flushCell(ne,t,o,s,void 0,K)),o=V,V=[o[1],n,0,0])):me.type==="tableHead"?(W=!0,G=n):me.type==="tableRow"||me.type==="tableDelimiterRow"?(G=n,o[1]!==0?(V[0]=V[1],K=flushCell(ne,t,o,s,n,K)):V[1]!==0&&(K=flushCell(ne,t,V,s,n,K)),s=0):s&&(me.type==="data"||me.type==="tableDelimiterMarker"||me.type==="tableDelimiterFiller")&&(V[3]=n)}for(G!==0&&flushTableEnd(ne,t,G,U,J),ne.consume(t.events),n=-1;++n<t.events.length;){const ce=t.events[n];ce[0]==="enter"&&ce[1].type==="table"&&(ce[1]._align=gfmTableAlign(t.events,n))}return e}function flushCell(e,t,n,a,s,o){const V=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",W="tableContent";n[0]!==0&&(o.end=Object.assign({},getPoint(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const G=getPoint(t.events,n[1]);if(o={type:V,start:Object.assign({},G),end:Object.assign({},G)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const U=getPoint(t.events,n[2]),J=getPoint(t.events,n[3]),K={type:W,start:Object.assign({},U),end:Object.assign({},J)};if(e.add(n[2],0,[["enter",K,t]]),a!==2){const ne=t.events[n[2]],ce=t.events[n[3]];if(ne[1].end=Object.assign({},ce[1].end),ne[1].type="chunkText",ne[1].contentType="text",n[3]>n[2]+1){const me=n[2]+1,ue=n[3]-n[2]-1;e.add(me,ue,[])}}e.add(n[3]+1,0,[["exit",K,t]])}return s!==void 0&&(o.end=Object.assign({},getPoint(t.events,s)),e.add(s,0,[["exit",o,t]]),o=void 0),o}function flushTableEnd(e,t,n,a,s){const o=[],V=getPoint(t.events,n);s&&(s.end=Object.assign({},V),o.push(["exit",s,t])),a.end=Object.assign({},V),o.push(["exit",a,t]),e.add(n+1,0,o)}function getPoint(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const tasklistCheck={name:"tasklistCheck",tokenize:tokenizeTasklistCheck};function gfmTaskListItem(){return{text:{91:tasklistCheck}}}function tokenizeTasklistCheck(e,t,n){const a=this;return s;function s(G){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(G):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(G),e.exit("taskListCheckMarker"),o)}function o(G){return markdownLineEndingOrSpace(G)?(e.enter("taskListCheckValueUnchecked"),e.consume(G),e.exit("taskListCheckValueUnchecked"),V):G===88||G===120?(e.enter("taskListCheckValueChecked"),e.consume(G),e.exit("taskListCheckValueChecked"),V):n(G)}function V(G){return G===93?(e.enter("taskListCheckMarker"),e.consume(G),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),W):n(G)}function W(G){return markdownLineEnding(G)?t(G):markdownSpace(G)?e.check({tokenize:spaceThenNonSpace},t,n)(G):n(G)}}function spaceThenNonSpace(e,t,n){return factorySpace(e,a,"whitespace");function a(s){return s===null?n(s):t(s)}}function gfm(e){return combineExtensions([gfmAutolinkLiteral(),gfmFootnote(),gfmStrikethrough(e),gfmTable(),gfmTaskListItem()])}const emptyOptions={};function remarkGfm(e){const t=this,n=e||emptyOptions,a=t.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),V=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(gfm(n)),o.push(gfmFromMarkdown()),V.push(gfmToMarkdown(n))}const MdInput=({id:e,value:t="",onChange:n,placeholder:a="Enter markdown content...",rows:s=8,disabled:o=!1,className:V,textareaClassName:W,previewClassName:G,defaultMode:U="markdown",mode:J,label:K,required:ne=!1})=>{const[ce,me]=React.useState(U),[ue,ve]=React.useState(!1),pe=e||`md-input-${Math.random().toString(36).slice(2,11)}`,xe=React.useMemo(()=>{if(!t)return s;const Re=(t.match(/\n/g)||[]).length+1;return Math.min(18,Re)},[t,s]),ge=J??ce,ye=J!==void 0;return jsxRuntimeExports.jsxs("div",{className:cn$1("flex flex-col gap-2",V),children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-3",children:[!ye&&jsxRuntimeExports.jsx("div",{className:"flex items-center gap-2",children:jsxRuntimeExports.jsxs("div",{className:"inline-flex grow-0 p-1 rounded-lg bg-neutral-100 dark:bg-black-700 w-auto",children:[jsxRuntimeExports.jsx("button",{className:cn$1("rounded-md p-1 flex items-center justify-center",ge==="markdown"?"bg-white dark:bg-black-700 !text-neutral-900 dark:!text-neutral-100":""),onClick:()=>me("markdown"),disabled:o,children:jsxRuntimeExports.jsx(Typography,{variant:"semibold",size:"extra-small",appearance:"subtitle",className:cn$1(ge==="markdown"?"!text-neutral-900 dark:!text-neutral-100":""),children:"Markdown"})}),jsxRuntimeExports.jsx("button",{className:cn$1("rounded-md p-1 flex items-center justify-center",ge==="preview"?"bg-white dark:bg-black-700 !text-neutral-900 dark:!text-neutral-100":""),onClick:()=>me("preview"),disabled:o,children:jsxRuntimeExports.jsx(Typography,{variant:"semibold",size:"extra-small",appearance:"subtitle",className:cn$1(ge==="preview"?"!text-neutral-900 dark:!text-neutral-100":""),children:"Preview"})})]})}),K&&jsxRuntimeExports.jsxs("label",{htmlFor:pe,className:"text-xs font-medium text-gray-600 dark:text-gray-300",children:[K,ne&&jsxRuntimeExports.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})]}),jsxRuntimeExports.jsx("div",{className:"relative",children:ge==="markdown"?jsxRuntimeExports.jsx("textarea",{id:pe,value:t,onChange:Re=>n(Re.target.value),placeholder:a,rows:xe,disabled:o,required:ne,className:cn$1("w-full border rounded-lg bg-white dark:bg-black-600","py-2.5 px-3 font-inter font-medium text-sm","text-gray-900 dark:text-gray-100","placeholder:text-gray-400 dark:placeholder:text-gray-500","transition-colors duration-200","focus:ring-2 focus:outline-none resize-vertical","border-gray-300 dark:border-gray-600","focus:border-blue-500 focus:ring-blue-200 dark:focus:ring-blue-400/20",{"bg-gray-50 dark:bg-gray-700 text-gray-400 dark:text-gray-500 cursor-not-allowed":o},W),onClick:Re=>Re.stopPropagation()}):jsxRuntimeExports.jsxs("div",{className:"relative",children:[jsxRuntimeExports.jsx("div",{className:cn$1("w-full rounded-lg","py-2.5 px-3 min-h-[calc(2.5rem*var(--rows,8))] max-h-[calc(1rem*var(--rows,8))]","overflow-y-auto text-sm",G),style:{"--rows":xe-3},children:jsxRuntimeExports.jsx("div",{className:"markdown-preview text-gray-900 dark:text-gray-100 [&_h1]:text-2xl [&_h1]:font-bold [&_h1]:mb-4 [&_h1]:mt-2 [&_h2]:text-xl [&_h2]:font-bold [&_h2]:mb-3 [&_h2]:mt-2 [&_h3]:text-lg [&_h3]:font-semibold [&_h3]:mb-2 [&_h3]:mt-2 [&_p]:mb-2 [&_p]:leading-relaxed [&_ul]:list-disc [&_ul]:ml-6 [&_ul]:mb-2 [&_ol]:list-decimal [&_ol]:ml-6 [&_ol]:mb-2 [&_li]:mb-1 [&_code]:bg-gray-100 [&_code]:dark:bg-gray-800 [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-sm [&_code]:font-mono [&_pre]:bg-gray-100 [&_pre]:dark:bg-gray-800 [&_pre]:p-3 [&_pre]:rounded [&_pre]:overflow-x-auto [&_pre]:mb-2 [&_blockquote]:border-l-4 [&_blockquote]:border-gray-300 [&_blockquote]:dark:border-gray-600 [&_blockquote]:pl-4 [&_blockquote]:italic [&_blockquote]:mb-2 [&_a]:text-blue-600 [&_a]:dark:text-blue-400 [&_a]:underline [&_strong]:font-bold [&_em]:italic [&_table]:w-full [&_table]:border-collapse [&_table]:mb-2 [&_th]:border [&_th]:border-gray-300 [&_th]:dark:border-gray-600 [&_th]:px-2 [&_th]:py-1 [&_th]:bg-gray-50 [&_th]:dark:bg-gray-700 [&_th]:font-semibold [&_td]:border [&_td]:border-gray-300 [&_td]:dark:border-gray-600 [&_td]:px-2 [&_td]:py-1 [&_hr]:my-4 [&_hr]:border-gray-300 [&_hr]:dark:border-gray-600",children:jsxRuntimeExports.jsx(Markdown,{remarkPlugins:[remarkGfm],children:t||"*No content to preview*"})})}),jsxRuntimeExports.jsx("button",{onClick:()=>ve(!0),className:"absolute bottom-2 right-2 p-1 rounded-md bg-neutral-100 dark:bg-black-600 hover:bg-gray-200 dark:hover:bg-black-500 transition-colors shadow-sm flex items-center justify-center",title:"Expand preview",type:"button",children:jsxRuntimeExports.jsx(AllIcons.OpenInFull,{sx:{fontSize:"16px"},className:"text-neutral-600 dark:text-neutral-400"})})]})}),jsxRuntimeExports.jsx(Modal,{open:ue,onCancel:()=>ve(!1),title:"Markdown Preview",width:800,footer:null,children:jsxRuntimeExports.jsx("div",{className:"markdown-preview max-h-[70vh] overflow-y-auto text-gray-900 dark:text-gray-100 [&_h1]:text-2xl [&_h1]:font-bold [&_h1]:mb-4 [&_h1]:mt-2 [&_h2]:text-xl [&_h2]:font-bold [&_h2]:mb-3 [&_h2]:mt-2 [&_h3]:text-lg [&_h3]:font-semibold [&_h3]:mb-2 [&_h3]:mt-2 [&_p]:mb-2 [&_p]:leading-relaxed [&_ul]:list-disc [&_ul]:ml-6 [&_ul]:mb-2 [&_ol]:list-decimal [&_ol]:ml-6 [&_ol]:mb-2 [&_li]:mb-1 [&_code]:bg-gray-100 [&_code]:dark:bg-gray-800 [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-sm [&_code]:font-mono [&_pre]:bg-gray-100 [&_pre]:dark:bg-gray-800 [&_pre]:p-3 [&_pre]:rounded [&_pre]:overflow-x-auto [&_pre]:mb-2 [&_blockquote]:border-l-4 [&_blockquote]:border-gray-300 [&_blockquote]:dark:border-gray-600 [&_blockquote]:pl-4 [&_blockquote]:italic [&_blockquote]:mb-2 [&_a]:text-blue-600 [&_a]:dark:text-blue-400 [&_a]:underline [&_strong]:font-bold [&_em]:italic [&_table]:w-full [&_table]:border-collapse [&_table]:mb-2 [&_th]:border [&_th]:border-gray-300 [&_th]:dark:border-gray-600 [&_th]:px-2 [&_th]:py-1 [&_th]:bg-gray-50 [&_th]:dark:bg-gray-700 [&_th]:font-semibold [&_td]:border [&_td]:border-gray-300 [&_td]:dark:border-gray-600 [&_td]:px-2 [&_td]:py-1 [&_hr]:my-4 [&_hr]:border-gray-300 [&_hr]:dark:border-gray-600",children:jsxRuntimeExports.jsx(Markdown,{remarkPlugins:[remarkGfm],children:t||"*No content to preview*"})})})]})};function FiDownload(e){return GenIcon({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},child:[]},{tag:"polyline",attr:{points:"7 10 12 15 17 10"},child:[]},{tag:"line",attr:{x1:"12",y1:"15",x2:"12",y2:"3"},child:[]}]})(e)}function FiTrash2(e){return GenIcon({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"3 6 5 6 21 6"},child:[]},{tag:"path",attr:{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"},child:[]},{tag:"line",attr:{x1:"10",y1:"11",x2:"10",y2:"17"},child:[]},{tag:"line",attr:{x1:"14",y1:"11",x2:"14",y2:"17"},child:[]}]})(e)}const{Dragger:Dragger$1}=antd.Upload,defaultFormatFileSize=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(2)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(2)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`,shortenFileName=(e,t=20)=>e?e.length<=t?e:e.slice(0,t-7)+"...."+e.slice(-7):"",MultiFileUpload=React.forwardRef(({id:e,onFileChange:t,description:n,errorMessage:a,disabled:s=!1,defaultFile:o=null,acceptedFiles:V="*",isLoading:W=!1,asBase64:G=!1,toFileServer:U=!1,setFileUploading:J,fileUploading:K=!1,multiple:ne=!1,getRealFileName:ce=!1,maxSize:me=50*1024*1024,onUpload:ue,onDelete:ve,wrapperClassName:pe,uploadClassName:xe,showFileSize:ge=!0,formatFileSize:ye=defaultFormatFileSize},Re)=>{const[Se,Ae]=React.useState(null),[Te,Le]=React.useState([]),[$e,We]=React.useState("#d9d9d9"),[ke,Ge]=React.useState(!1),[Be,Pe]=React.useState(null),je=React.useCallback(async()=>{if(ue)try{const Ie=await ue(Te),Fe=ne?Ie?.map(Je=>Je?.fileUrl):Ie?.[0]?.fileUrl,Ue=ce?Se?.name:Ie?.[0]?.fileName;t(Fe,Ue),J?.(null)}catch(Ie){console.error("Upload failed:",Ie),J?.(null)}},[ue,Te,ne,Se,ce,t,J]),Ne={accept:V,multiple:ne,showUploadList:!1,disabled:s,onRemove:()=>{Le([])},beforeUpload:(Ie,Fe)=>{if(Ie.size>me){const Ue=(me/1048576).toFixed(0);return console.error(`File size exceeds ${Ue}MB limit`),!1}return Ae(Ie),U?(J?.(e||"field-file-upload"),Le(Fe)):(G?Promise.all((ne?Fe:[Ie]).map(Ue=>new Promise(Je=>{const Ze=new FileReader;Ze.onload=Ke=>{Je({filename:Ue.name,content:Ke?.target?.result?.split(",")[1]})},Ze.readAsDataURL(Ue)}))).then(Ue=>{t(ne?Ue:Ue[0])}):t(Ie),Ae(Ie)),!1}},_e=async()=>{if(U&&Be&&ve)try{await ve(Be),Pe(null)}catch(Ie){console.error("Delete failed:",Ie)}Ae(null),Le([]),t(null)};return React.useEffect(()=>{We(a?"#EF4444":"#d9d9d9")},[a]),React.useEffect(()=>{Te.length&&U&&je()},[Te,U,je]),React.useEffect(()=>{o?.name&&Ae(o)},[o]),jsxRuntimeExports.jsxs("div",{ref:Re,className:cn$1("w-full",pe),children:[jsxRuntimeExports.jsx("div",{className:"h-32",onMouseEnter:()=>Ge(!0),onMouseLeave:()=>Ge(!1),children:jsxRuntimeExports.jsx(Dragger$1,{...Ne,className:xe,style:{borderColor:ke&&!a?"#1890ff":$e},disabled:s||K,children:Se?jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between mx-5",title:Se?.name||o?.name||"",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center gap-4",children:[Se?.type==="application/pdf"?jsxRuntimeExports.jsx("div",{className:"p-3 bg-[#E6F1FC] rounded-lg",children:jsxRuntimeExports.jsx(BsFiletypePdf,{size:20,fill:"#006CCF"})}):jsxRuntimeExports.jsx("div",{className:"p-3 bg-[#E6F1FC] rounded-lg",children:jsxRuntimeExports.jsx(AllIcons.DescriptionRounded,{sx:{height:"20px",width:"20px",color:"#006CCF"}})}),jsxRuntimeExports.jsxs("div",{className:"text-left",children:[jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",className:"font-inter text-md font-medium text-base",children:shortenFileName(Se?.name||o?.name||"")}),K?jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",appearance:"subtitle",children:"Uploading..."}):ge&&Se?.size>0?jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",appearance:"subtitle",children:ye(Se.size)}):null]})]}),W?jsxRuntimeExports.jsx(CgSpinner,{size:40,className:"spinner text-primary-600"}):jsxRuntimeExports.jsx("button",{id:`btn-file-upload-${e}`,className:"ml-4",onClick:Ie=>{Ie.stopPropagation(),_e()},disabled:s,type:"button","aria-label":"Delete file",children:jsxRuntimeExports.jsx(FiTrash2,{size:20,className:"text-gray-400"})})]}):jsxRuntimeExports.jsx("div",{className:"flex items-center justify-center",children:jsxRuntimeExports.jsxs("div",{className:"flex-col",children:[jsxRuntimeExports.jsx("div",{className:"mb-4 flex justify-center",children:jsxRuntimeExports.jsx(FiDownload,{size:24,className:"text-gray-400"})}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center",children:[jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",className:"text-primary-600 dark:text-primary-300",appearance:"custom",children:"Click to upload"}),jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",className:"ml-1",appearance:"subtitle",children:"or drag and drop"})]}),n?jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",appearance:"subtitle",children:n}):null]})]})})})}),a&&jsxRuntimeExports.jsx(Typography,{className:"text-red-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:a})]})});MultiFileUpload.displayName="MultiFileUpload";const roundedIconNames=Object.keys(AllIcons__namespace).filter(e=>e?.endsWith("Rounded")),mergedIconNames=[...roundedIconNames||[],...(COUNTRY_CODES||[]).map(e=>`flag-${e}`)],formatIconName=e=>{if(e?.startsWith("flag-")){const t=e?.replace("flag-","");return countryNameFromCode(t||"")||t}return e.replaceAll(/([A-Z])/g," $1").trim()},IconPickerContent=({onChange:e,selectedIcon:t,setOpen:n})=>{const[a,s]=React.useState(""),o=(mergedIconNames||[]).filter(W=>{if(W?.startsWith("flag-")){const G=W?.replace("flag-","");return G?.toLowerCase()?.includes(a?.trim()?.toLowerCase()||"")||countryNameFromCode(G||"")?.toLowerCase()?.includes(a?.trim()?.toLowerCase()||"")}return W?.trim()?.toLowerCase()?.includes(a?.trim()?.toLowerCase()||"")}),V=(W,G)=>{if(G.stopPropagation(),t===W){e?.(null);return}e?.(W),n?.(!1)};return jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-3",children:[jsxRuntimeExports.jsx(InputField,{id:"input-field-icon-picker",placeholder:"Search icons...",onChange:W=>s(W||""),fieldSuffix:jsxRuntimeExports.jsx(AllIcons__namespace.Search,{sx:{width:16,height:16,color:"rgb(152 162 179)"}})}),jsxRuntimeExports.jsx(reactWindow.FixedSizeGrid,{columnCount:5,rowCount:Math.ceil((o?.length||0)/5),columnWidth:40,rowHeight:40,width:220,height:240,children:({columnIndex:W,rowIndex:G,style:U})=>{const J=G*5+W,K=o?.[J];return K?jsxRuntimeExports.jsx("div",{style:{...U,padding:"4px"},children:jsxRuntimeExports.jsx(antd.Tooltip,{title:formatIconName(K),children:jsxRuntimeExports.jsx(material.IconButton,{className:cn$1("flex items-center justify-center !rounded-md hover:bg-neutral-200 dark:hover:bg-black-700",{"!bg-primary-50 dark:!bg-black-800":t===K}),onClick:ne=>V(K,ne),children:jsxRuntimeExports.jsx(IconRenderer,{iconName:K,sx:{width:20,height:20},className:"text-neutral-900 dark:text-white"})})})}):null}})]})},IconRenderer=({iconName:e,sx:t,className:n,isHovering:a})=>{if(e?.startsWith?.("flag-")){const o=e?.replace("flag-","");return getFlagComponent?.(o||"",a||!1)||jsxRuntimeExports.jsx("div",{children:"-"})}const s=AllIcons__namespace?.[e];return s?jsxRuntimeExports.jsx(s,{sx:t,className:n,isHovering:a}):jsxRuntimeExports.jsx("div",{children:"-"})},IconPickerBase=({selectedIcon:e,onChange:t,label:n,required:a=!1,allowClear:s=!0,disabled:o=!1,errorMessage:V})=>{const[W,G]=React.useState(!1),U=J=>{J.stopPropagation(),t?.("")};return jsxRuntimeExports.jsx(antd.Popover,{arrow:!1,placement:"bottom",trigger:"click",getPopupContainer:J=>J?.parentElement||document.body,open:W,onOpenChange:G,content:jsxRuntimeExports.jsx(IconPickerContent,{onChange:t,selectedIcon:e,setOpen:G}),children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1",children:[n?jsxRuntimeExports.jsxs(Typography,{size:"extra-small",variant:"medium",appearance:"body",children:[n,a&&jsxRuntimeExports.jsx("span",{className:"text-red-500",children:"*"})]}):null,jsxRuntimeExports.jsxs("button",{id:`btn-icon-picker-icon-${e?"selected":"unselected"}`,className:`min-w-[83px] py-1.5 px-3 rounded-md border ${o?"cursor-not-allowed opacity-60 bg-neutral-50 dark:bg-black-800":"bg-white dark:bg-black-800"} ${V?"border-red-500":"focus:border-primary-200 "} flex items-center justify-between gap-2`,disabled:o,onClick:J=>{o&&(J.preventDefault(),J.stopPropagation())},children:[e?jsxRuntimeExports.jsx(IconRenderer,{iconName:e,sx:{width:20,height:20},className:"text-neutral-900 dark:text-white"}):jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",appearance:"subtitle",children:"Select Icon"}),e&&s&&!o?jsxRuntimeExports.jsx(AllIcons__namespace.CloseRounded,{sx:{width:20,height:20},className:"hover:bg-neutral-100 dark:hover:bg-black-800 rounded-full transition-colors cursor-pointer text-neutral-400 dark:text-neutral-500",onClick:U}):null]}),V&&jsxRuntimeExports.jsx(Typography,{size:"extra-small",className:"text-red-500 font-medium",children:V})]})})},IconPicker=React.lazy(()=>Promise.resolve({default:e=>jsxRuntimeExports.jsx(React.Suspense,{fallback:jsxRuntimeExports.jsx("div",{className:"min-w-[83px] h-[30px] animate-pulse bg-neutral-100 dark:bg-black-800 rounded-md"}),children:jsxRuntimeExports.jsx(IconPickerBase,{...e})})})),StatusColorMapping=React.forwardRef(({status:e,children:t,className:n,size:a="medium","aria-label":s},o)=>{const V=()=>{switch(a){case"small":return"text-xs px-1.5 py-0.5";case"large":return"text-base px-3 py-1.5";default:return"text-md px-1.5 py-1"}},W=()=>{switch(e?.toLowerCase()){case"purple":return"bg-purple-50 text-purple-500 border border-purple-100 dark:bg-purple-950 dark:text-purple-400 dark:border-purple-800";case"blue":return"bg-blue-50 text-blue-500 border border-blue-100 dark:bg-blue-950 dark:text-blue-400 dark:border-blue-800";case"teal":return"bg-teal-50 text-teal-500 border border-teal-100 dark:bg-teal-950 dark:text-teal-400 dark:border-teal-800";case"green":return"bg-green-50 text-green-500 border border-green-100 dark:bg-green-950 dark:text-green-400 dark:border-green-800";case"yellow":return"bg-yellow-50 text-yellow-600 border border-yellow-100 dark:bg-yellow-950 dark:text-yellow-400 dark:border-yellow-800";case"orange":return"bg-orange-50 text-orange-500 border border-orange-100 dark:bg-orange-950 dark:text-orange-400 dark:border-orange-800";case"peach":return"bg-orange-50 text-orange-400 border border-orange-100 dark:bg-orange-950 dark:text-orange-300 dark:border-orange-800";case"red":return"bg-red-50 text-red-500 border border-red-100 dark:bg-red-950 dark:text-red-400 dark:border-red-800";case"navy":return"bg-slate-50 text-slate-700 border border-slate-100 dark:bg-slate-950 dark:text-slate-400 dark:border-slate-800";case"grey":return"bg-neutral-50 text-neutral-500 border border-neutral-100 dark:bg-neutral-950 dark:text-neutral-400 dark:border-neutral-800";default:return"bg-blue-50 text-blue-600 border border-blue-200 dark:bg-blue-950 dark:text-blue-400 dark:border-blue-800"}};return jsxRuntimeExports.jsx("span",{ref:o,className:cn$1("inline-flex items-center justify-center font-medium rounded-md transition-colors",V(),W(),n),"aria-label":s||`Status: ${e||"default"}`,role:"status",children:t})});StatusColorMapping.displayName="StatusColorMapping";const Badge=React.forwardRef(({status:e="default",children:t,appearance:n="outline",size:a="md",className:s,isRounded:o=!1,capitalize:V=!0,"aria-label":W},G)=>{const U=me=>!me||!V?me:me.replace(/\w\S*/g,ue=>ue.charAt(0).toUpperCase()+ue.substr(1).toLowerCase()),J=()=>{switch(a){case"sm":return"text-xs px-1.5 py-0.5";case"lg":return"text-sm px-3 py-1.5";default:return"text-xs px-2 py-1"}},K=()=>{switch(e){case"primary":case"default":return"bg-blue-50 dark:bg-blue-950 text-blue-600 dark:text-blue-300 border border-blue-300 dark:border-blue-700";case"warning":return"bg-yellow-50 dark:bg-yellow-950 text-yellow-600 dark:text-yellow-300 border border-yellow-300 dark:border-yellow-700";case"error":return"bg-red-50 dark:bg-red-950 text-red-600 dark:text-red-300 border border-red-300 dark:border-red-700";case"neutral":return"bg-neutral-50 dark:bg-neutral-950 text-neutral-600 dark:text-neutral-300 border border-neutral-300 dark:border-neutral-700";case"success":return"bg-green-50 dark:bg-green-950 text-green-600 dark:text-green-300 border border-green-300 dark:border-green-700";case"info":return"bg-blue-50 dark:bg-blue-950 text-blue-600 dark:text-blue-300 border border-blue-300 dark:border-blue-700";default:return"bg-blue-50 dark:bg-blue-950 text-blue-600 dark:text-blue-300 border border-blue-300 dark:border-blue-700"}},ne=()=>{switch(e){case"primary":case"default":return"bg-blue-600 dark:bg-blue-700 text-white";case"warning":return"bg-yellow-600 dark:bg-yellow-700 text-white";case"success":return"bg-green-600 dark:bg-green-700 text-white";case"error":return"bg-red-600 dark:bg-red-700 text-white";case"neutral":return"bg-neutral-600 dark:bg-neutral-700 text-white";case"info":return"bg-blue-600 dark:bg-blue-700 text-white";default:return"bg-blue-600 dark:bg-blue-700 text-white"}},ce=()=>n==="filled"?ne():K();return jsxRuntimeExports.jsx("span",{ref:G,className:cn$1("inline-flex items-center justify-center font-medium transition-colors",o?"rounded-full":"rounded",J(),ce(),s),"aria-label":W||`Badge: ${e}`,role:"status",children:U(t)})});Badge.displayName="Badge";const HelmetTitle=({title:e,children:t})=>e?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:t}):null;HelmetTitle.displayName="HelmetTitle";const Card=({children:e,className:t="",title:n,style:a,id:s})=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(HelmetTitle,{title:n}),jsxRuntimeExports.jsx("div",{className:`bg-white dark:bg-black-800 border border-neutral-200 dark:border-black-600 rounded-lg shadow-100 w-full flex flex-col ${t}`,style:a,id:s,children:e})]});Card.displayName="Card";const Drawer=({id:e,children:t,onClose:n,open:a,title:s,parentContainer:o="full-screen-container",resizable:V,width:W=400,placement:G="right",closable:U=!1,mask:J,classNames:K,styles:ne,getContainer:ce,zIndex:me,footer:ue,...ve})=>{const pe=React.useRef(!1),[xe,ge]=React.useState(W);React.useEffect(()=>{ge(W)},[a,W]);const ye=React.useCallback(Ae=>{if(pe.current)if(G==="right"){const Te=document.body.offsetWidth-(Ae.clientX-document.body.offsetLeft);Te>256&&ge(Te)}else Ae.clientX>256&&ge(Ae.clientX)},[G,ge]),Re=React.useCallback(()=>{pe.current&&(pe.current=!1)},[]);React.useEffect(()=>(document.addEventListener("mousemove",ye),document.addEventListener("mouseup",Re),()=>{document.removeEventListener("mousemove",ye),document.removeEventListener("mouseup",Re)}),[ye,Re]);const Se=typeof window<"u"?document.getElementById(o)||document.body:null;return Se?ReactDOM.createPortal(jsxRuntimeExports.jsxs(antd.Drawer,{id:e||"",closable:U,title:s,onClose:n,open:a,width:xe,getContainer:ce!==void 0?ce:!1,placement:G,mask:J,classNames:K,styles:ne,zIndex:me,footer:ue,...ve,children:[V&&jsxRuntimeExports.jsx("div",{className:"cursor-ew-resize w-1 pl-[2px] absolute top-0 bottom-0 z-[2100] bg-transparent dark:bg-black-600 hover:bg-neutral-200 dark:hover:bg-black-700",onMouseDown:()=>{pe.current=!0},style:G==="right"?{left:0}:{right:0}}),t]}),Se):null};Drawer.displayName="Drawer";const FloatingElementWrapper=({children:e,showAsModal:t,...n})=>t?jsxRuntimeExports.jsx(Modal,{onCancel:n.onClose,...n,children:e}):jsxRuntimeExports.jsx(Drawer,{...n,children:e}),formatBooleanValue=e=>e===1||e==="1"||typeof e=="string"&&e.toLowerCase()==="yes"||typeof e=="string"&&e.toLowerCase()==="true"?"Yes":e===0||e==="0"||typeof e=="string"&&e.toLowerCase()==="no"||typeof e=="string"&&e.toLowerCase()==="false"?"No":e?.toString()||"-",formatCurrency=(e,t="USD")=>{try{if(e==null)return"";const n=Number(e);if(isNaN(n))return e?.toString()||"";const a=n.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2});return`${{USD:"$",EUR:"€",GBP:"£",JPY:"¥",CAD:"C$",AUD:"A$",CHF:"CHF",CNY:"¥",SEK:"kr",NOK:"kr",DKK:"kr",PLN:"zł",CZK:"Kč",HUF:"Ft",RUB:"₽",BRL:"R$",INR:"₹",KRW:"₩",SGD:"S$",HKD:"HK$",NZD:"NZ$",MXN:"$",ZAR:"R",TRY:"₺",ILS:"₪",AED:"د.إ",SAR:"﷼",QAR:"﷼",KWD:"د.ك",BHD:"د.ب",OMR:"﷼",JOD:"د.ا",LBP:"ل.ل",EGP:"£",MAD:"د.م.",TND:"د.ت",DZD:"د.ج",LYD:"ل.د",SDG:"ج.س.",ETB:"Br",KES:"KSh",UGX:"USh",TZS:"TSh",ZMW:"ZK",BWP:"P",ZWL:"Z$",AOA:"Kz",MZN:"MT",GHS:"₵",NGN:"₦",XAF:"FCFA",XOF:"CFA",CDF:"FC",RWF:"RF",BIF:"FBu",KMF:"CF",DJF:"Fdj",SOS:"S",ERN:"Nfk"}[t]||"$"}${a}`}catch{return"-"}},formatDate=(e,t={})=>{const{format:n,relative:a=!1,withTime:s=!0,fallback:o="-",skipTimezone:V=!1,onlyTime:W=!1}=t||{};if(!e)return o;try{const G=new Date(e);if(isNaN(G.getTime()))return o;if(a){const ce=Math.floor((new Date().getTime()-G.getTime())/1e3);return ce<60?"just now":ce<3600?`${Math.floor(ce/60)} minutes ago`:ce<86400?`${Math.floor(ce/3600)} hours ago`:ce<2592e3?`${Math.floor(ce/86400)} days ago`:ce<31536e3?`${Math.floor(ce/2592e3)} months ago`:`${Math.floor(ce/31536e3)} years ago`}const U="MM/dd/yyyy",J="hh:mm a",K=s&&!W;return G.toLocaleDateString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:s?"2-digit":void 0,minute:s?"2-digit":void 0,hour12:!0})}catch{return o}},isISODateString=e=>typeof e=="string"&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(e),LabelValue=React.forwardRef(({id:e,label:t,value:n,className:a,type:s="string",tags:o,tooltip:V,items:W,isModified:G=!1,isChanged:U=!1,size:J="medium",isHighlighted:K=!1,deletedValue:ne,highlightColor:ce="warning",isSearchActive:me=!1,originalValue:ue=!1,showDiff:ve=!1,isLiveField:pe=!1,deltaChange:xe,theme:ge="light",onUpload:ye,acceptsUpload:Re=!1,MasterDataModal:Se,riskDetails:Ae,isRiskAnalysisOpen:Te=!1,RiskDetailsCard:Le,"aria-label":$e},We)=>{const[ke,Ge]=React.useState(!0),[Be,Pe]=React.useState(!1),[je,Ne]=React.useState(null),[_e,Ie]=React.useState(!1),Fe=()=>{Ge(!ke)},Ue=Qe=>{Pe(!0),Ne({...Qe,value:n})},Je=()=>{Pe(!1),Ne(null)},Ze=Qe=>{const lt=Qe.target.files?.[0];lt&&ye&&ye(lt),Qe.target.value=""},Ke=()=>{const Qe=typeof n=="string"&&isISODateString(n);if(me&&typeof n=="object")return n;if(n||s==="boolean"&&n===0||s==="currency"&&Number(n)>=0){if((n===!0||n==="True")&&!ue)return"Yes";if((n===!1||n==="False")&&!ue)return"No";if(s==="url")return jsxRuntimeExports.jsx("a",{href:n,className:"text-primary-600 truncate",children:n});if(s==="boolean")return formatBooleanValue(n);if(s==="currency")return formatCurrency(n,W?.currency_code)||"-";if(s==="datetime"){const lt=typeof n=="string"&&n.includes("Z")?n.replace(/\.000Z$/,"Z"):n;return formatDate(lt,{skipTimezone:!1,withTime:!0})}else if(s==="date"||Qe){const lt=typeof n=="string"&&n.includes("Z")?n.replace(/\.000Z$/,"Z"):n;return formatDate(lt,{skipTimezone:!0,withTime:!1})}else return s==="percentage"?`${n}%`:typeof n=="string"&&n.length>100?jsxRuntimeExports.jsxs("p",{children:[n.slice(0,ke?100:n.length),ke?"... ":" ",jsxRuntimeExports.jsx("button",{id:`btn-label-value-${ke?"Show more":"Show less"}`,className:"text-primary-400 text-sm hover:text-primary-500 cursor-pointer whitespace-nowrap",onClick:Fe,onKeyDown:lt=>{(lt.key==="Enter"||lt.key===" ")&&(lt.preventDefault(),Fe())},"aria-label":ke?"Show more content":"Show less content",type:"button",children:ke?"Show more":"Show less"})]}):n}return"-"},rt=()=>{switch(J){case"small":return"extra-small";case"large":return"large";default:return"small"}},et=()=>{switch(ce){case"success":return"bg-success-100";case"warning":return"bg-warning-100";case"error":return"bg-error-100";case"info":return"bg-info-100";default:return"bg-warning-100"}};return jsxRuntimeExports.jsxs("div",{id:e||"",ref:We,className:cn$1("font-medium relative",a),onMouseEnter:()=>Ie(!0),onMouseLeave:()=>Ie(!1),"aria-label":$e||`Label: ${t}, Value: ${n}`,children:[jsxRuntimeExports.jsxs(Typography,{variant:"medium",size:rt(),className:"flex gap-1 flex-wrap",appearance:"subtitle",children:[t," ",jsxRuntimeExports.jsx(Label,{labels:o?.map(Qe=>({...Qe,color:Qe.color||"primary"}))}),pe&&jsxRuntimeExports.jsx(AllIcons.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),o&&o.length>0&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:o.map(Qe=>jsxRuntimeExports.jsx(Tag,{label:Qe.label,color:Qe.color,size:"xs",theme:ge},`${Qe.label}-${Qe.value||Qe.color}`))}),V&&jsxRuntimeExports.jsx(antd.Tooltip,{placement:"top",title:V,children:jsxRuntimeExports.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onKeyDown:Qe=>{(Qe.key==="Enter"||Qe.key===" ")&&Qe.preventDefault()},children:jsxRuntimeExports.jsx(HelpIcon,{size:14})})})]}),jsxRuntimeExports.jsxs(Typography,{variant:"medium",size:rt(),className:cn$1("text-- whitespace-normal break-all flex gap-1 pt-0.5",G&&"bg-neutral-50 dark:bg-black-700 p-1 rounded",Te&&Ae?.color&&`bg-${Ae.color}-50 border-${Ae.color}-300 px-0.5 rounded-lg`),appearance:"body",children:[ve&&ne&&n?jsxRuntimeExports.jsxs("div",{className:"flex gap-2",children:[jsxRuntimeExports.jsx("span",{className:"line-through",children:ne}),jsxRuntimeExports.jsx("span",{children:Ke()})]}):U||K?jsxRuntimeExports.jsx("mark",{className:cn$1("rounded-md py-0.5 px-1",et()),children:Ke()}):Ke(),s==="currency"&&xe!==0&&xe!==void 0&&xe!==null&&jsxRuntimeExports.jsxs(framerMotion.motion.span,{initial:{opacity:0,y:2},animate:{opacity:1,y:0},transition:{duration:.25},className:cn$1("inline-flex items-center gap-1 ml-1.5 text-xs font-medium",xe>0?"text-emerald-600 dark:text-emerald-400":"text-red-600 dark:text-red-400"),children:[jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center w-4 h-4",children:xe>0?jsxRuntimeExports.jsx(AllIcons.ArrowUpwardRounded,{sx:{fontSize:16},className:"text-emerald-600 dark:text-emerald-400"}):jsxRuntimeExports.jsx(AllIcons.ArrowDownwardRounded,{sx:{fontSize:16},className:"text-red-600 dark:text-red-400"})}),jsxRuntimeExports.jsx("span",{children:formatCurrency(Math.abs(xe),W?.currency_code||"USD")})]}),W?.is_master_data&&W?.reference&&n&&jsxRuntimeExports.jsx("button",{onClick:()=>Ue(W),onKeyDown:Qe=>{(Qe.key==="Enter"||Qe.key===" ")&&(Qe.preventDefault(),Ue(W))},"aria-label":`Search master data for ${t}`,type:"button",className:"cursor-pointer",children:jsxRuntimeExports.jsx(SearchIcon$1,{width:20,height:20})}),Re&&jsxRuntimeExports.jsx("input",{type:"file",onChange:Ze,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer","aria-label":`Upload file for ${t}`})]}),ne&&!ve&&jsxRuntimeExports.jsx(Typography,{variant:"medium",size:"extra-small",className:"pt-0.5",appearance:"body",children:jsxRuntimeExports.jsx("mark",{className:"rounded-md py-0.5 px-1 bg-error-100",children:jsxRuntimeExports.jsx("del",{children:ne||s==="boolean"&&ne==="0"?ne==="True"?"Yes":ne==="False"?"No":s==="boolean"?formatBooleanValue(ne):s==="currency"?formatCurrency(ne,W?.currency_code):s==="date"?formatDate(ne,{skipTimezone:!0,withTime:!1}):s==="datetime"?formatDate(ne,{skipTimezone:!0,withTime:!0}):s==="percentage"?`${ne}%`:ne.length>100?jsxRuntimeExports.jsxs("p",{children:[ne.slice(0,ke?100:ne.length),ke?"... ":" ",jsxRuntimeExports.jsx("button",{id:`btn-label-value-${ke?"Show more":"Show less"}`,className:"text-primary-400 text-sm hover:text-primary-500 cursor-pointer whitespace-nowrap",onClick:Fe,children:ke?"Show more":"Show less"})]}):ne:"-"})})}),Se&&jsxRuntimeExports.jsx(Se,{isVisible:Be,onClose:Je,masterdataInfo:je}),_e&&Ae&&Te&&jsxRuntimeExports.jsx("div",{className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:Qe=>Qe.stopPropagation(),onMouseDown:Qe=>Qe.preventDefault(),onKeyDown:Qe=>{Qe.key==="Escape"&&Ie(!1)},role:"tooltip","aria-label":"Risk analysis details",tabIndex:0,children:Le?jsxRuntimeExports.jsx(Le,{riskDetails:Ae}):jsxRuntimeExports.jsx("div",{className:"shadow-lg p-4",children:jsxRuntimeExports.jsxs("div",{className:"text-sm",children:[jsxRuntimeExports.jsx("h4",{className:"font-semibold mb-2",children:"Risk Details"}),jsxRuntimeExports.jsx("p",{className:"text-neutral-600 dark:text-neutral-300",children:Ae.description||"Risk analysis information"})]})})})]})});LabelValue.displayName="LabelValue";const defaultGenerator=e=>e,createClassNameGenerator=()=>{let e=defaultGenerator;return{configure(t){e=t},generate(t){return e(t)},reset(){e=defaultGenerator}}},ClassNameGenerator=createClassNameGenerator();function formatMuiErrorMessage(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(a=>n.searchParams.append("args[]",a)),`Minified MUI error #${e}; visit ${n} for the full message.`}function capitalize(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":formatMuiErrorMessage(7));return e.charAt(0).toUpperCase()+e.slice(1)}var propTypes={exports:{}},reactIs$1={exports:{}},reactIs_production_min={};/** @license React v16.13.1
|
|
175
|
+
`))}function G(ce,me,ue,ve){const pe=ue.enter("tableCell"),xe=ue.enter("phrasing"),ge=ue.containerPhrasing(ce,{...ve,before:o,after:o});return xe(),pe(),ge}function U(ce,me){return markdownTable(ce,{align:me,alignDelimiters:a,padding:n,stringLength:s})}function J(ce,me,ue){const ve=ce.children;let pe=-1;const xe=[],ge=me.enter("table");for(;++pe<ve.length;)xe[pe]=K(ve[pe],me,ue);return ge(),xe}function K(ce,me,ue){const ve=ce.children;let pe=-1;const xe=[],ge=me.enter("tableRow");for(;++pe<ve.length;)xe[pe]=G(ve[pe],ce,me,ue);return ge(),xe}function ne(ce,me,ue){let ve=handle.inlineCode(ce,me,ue);return ue.stack.includes("tableCell")&&(ve=ve.replace(/\|/g,"\\$&")),ve}}function gfmTaskListItemFromMarkdown(){return{exit:{taskListCheckValueChecked:exitCheck,taskListCheckValueUnchecked:exitCheck,paragraph:exitParagraphWithTaskListItem}}}function gfmTaskListItemToMarkdown(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:listItemWithTaskListItem}}}function exitCheck(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function exitParagraphWithTaskListItem(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const s=t.children;let o=-1,V;for(;++o<s.length;){const W=s[o];if(W.type==="paragraph"){V=W;break}}V===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function listItemWithTaskListItem(e,t,n,a){const s=e.children[0],o=typeof e.checked=="boolean"&&s&&s.type==="paragraph",V="["+(e.checked?"x":" ")+"] ",W=n.createTracker(a);o&&W.move(V);let G=handle.listItem(e,t,n,{...a,...W.current()});return o&&(G=G.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,U)),G;function U(J){return J+V}}function gfmFromMarkdown(){return[gfmAutolinkLiteralFromMarkdown(),gfmFootnoteFromMarkdown(),gfmStrikethroughFromMarkdown(),gfmTableFromMarkdown(),gfmTaskListItemFromMarkdown()]}function gfmToMarkdown(e){return{extensions:[gfmAutolinkLiteralToMarkdown(),gfmFootnoteToMarkdown(e),gfmStrikethroughToMarkdown(),gfmTableToMarkdown(e),gfmTaskListItemToMarkdown()]}}const wwwPrefix={tokenize:tokenizeWwwPrefix,partial:!0},domain={tokenize:tokenizeDomain,partial:!0},path={tokenize:tokenizePath,partial:!0},trail={tokenize:tokenizeTrail,partial:!0},emailDomainDotTrail={tokenize:tokenizeEmailDomainDotTrail,partial:!0},wwwAutolink={name:"wwwAutolink",tokenize:tokenizeWwwAutolink,previous:previousWww},protocolAutolink={name:"protocolAutolink",tokenize:tokenizeProtocolAutolink,previous:previousProtocol},emailAutolink={name:"emailAutolink",tokenize:tokenizeEmailAutolink,previous:previousEmail},text={};function gfmAutolinkLiteral(){return{text}}let code=48;for(;code<123;)text[code]=emailAutolink,code++,code===58?code=65:code===91&&(code=97);text[43]=emailAutolink,text[45]=emailAutolink,text[46]=emailAutolink,text[95]=emailAutolink,text[72]=[emailAutolink,protocolAutolink],text[104]=[emailAutolink,protocolAutolink],text[87]=[emailAutolink,wwwAutolink],text[119]=[emailAutolink,wwwAutolink];function tokenizeEmailAutolink(e,t,n){const a=this;let s,o;return V;function V(K){return!gfmAtext(K)||!previousEmail.call(a,a.previous)||previousUnbalanced(a.events)?n(K):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),W(K))}function W(K){return gfmAtext(K)?(e.consume(K),W):K===64?(e.consume(K),G):n(K)}function G(K){return K===46?e.check(emailDomainDotTrail,J,U)(K):K===45||K===95||asciiAlphanumeric(K)?(o=!0,e.consume(K),G):J(K)}function U(K){return e.consume(K),s=!0,G}function J(K){return o&&s&&asciiAlpha(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(K)):n(K)}}function tokenizeWwwAutolink(e,t,n){const a=this;return s;function s(V){return V!==87&&V!==119||!previousWww.call(a,a.previous)||previousUnbalanced(a.events)?n(V):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(wwwPrefix,e.attempt(domain,e.attempt(path,o),n),n)(V))}function o(V){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(V)}}function tokenizeProtocolAutolink(e,t,n){const a=this;let s="",o=!1;return V;function V(K){return(K===72||K===104)&&previousProtocol.call(a,a.previous)&&!previousUnbalanced(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(K),e.consume(K),W):n(K)}function W(K){if(asciiAlpha(K)&&s.length<5)return s+=String.fromCodePoint(K),e.consume(K),W;if(K===58){const ne=s.toLowerCase();if(ne==="http"||ne==="https")return e.consume(K),G}return n(K)}function G(K){return K===47?(e.consume(K),o?U:(o=!0,G)):n(K)}function U(K){return K===null||asciiControl(K)||markdownLineEndingOrSpace(K)||unicodeWhitespace(K)||unicodePunctuation(K)?n(K):e.attempt(domain,e.attempt(path,J),n)(K)}function J(K){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(K)}}function tokenizeWwwPrefix(e,t,n){let a=0;return s;function s(V){return(V===87||V===119)&&a<3?(a++,e.consume(V),s):V===46&&a===3?(e.consume(V),o):n(V)}function o(V){return V===null?n(V):t(V)}}function tokenizeDomain(e,t,n){let a,s,o;return V;function V(U){return U===46||U===95?e.check(trail,G,W)(U):U===null||markdownLineEndingOrSpace(U)||unicodeWhitespace(U)||U!==45&&unicodePunctuation(U)?G(U):(o=!0,e.consume(U),V)}function W(U){return U===95?a=!0:(s=a,a=void 0),e.consume(U),V}function G(U){return s||a||!o?n(U):t(U)}}function tokenizePath(e,t){let n=0,a=0;return s;function s(V){return V===40?(n++,e.consume(V),s):V===41&&a<n?o(V):V===33||V===34||V===38||V===39||V===41||V===42||V===44||V===46||V===58||V===59||V===60||V===63||V===93||V===95||V===126?e.check(trail,t,o)(V):V===null||markdownLineEndingOrSpace(V)||unicodeWhitespace(V)?t(V):(e.consume(V),s)}function o(V){return V===41&&a++,e.consume(V),s}}function tokenizeTrail(e,t,n){return a;function a(W){return W===33||W===34||W===39||W===41||W===42||W===44||W===46||W===58||W===59||W===63||W===95||W===126?(e.consume(W),a):W===38?(e.consume(W),o):W===93?(e.consume(W),s):W===60||W===null||markdownLineEndingOrSpace(W)||unicodeWhitespace(W)?t(W):n(W)}function s(W){return W===null||W===40||W===91||markdownLineEndingOrSpace(W)||unicodeWhitespace(W)?t(W):a(W)}function o(W){return asciiAlpha(W)?V(W):n(W)}function V(W){return W===59?(e.consume(W),a):asciiAlpha(W)?(e.consume(W),V):n(W)}}function tokenizeEmailDomainDotTrail(e,t,n){return a;function a(o){return e.consume(o),s}function s(o){return asciiAlphanumeric(o)?n(o):t(o)}}function previousWww(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||markdownLineEndingOrSpace(e)}function previousProtocol(e){return!asciiAlpha(e)}function previousEmail(e){return!(e===47||gfmAtext(e))}function gfmAtext(e){return e===43||e===45||e===46||e===95||asciiAlphanumeric(e)}function previousUnbalanced(e){let t=e.length,n=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){n=!0;break}if(a._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const indent={tokenize:tokenizeIndent,partial:!0};function gfmFootnote(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:tokenizeDefinitionStart,continuation:{tokenize:tokenizeDefinitionContinuation},exit:gfmFootnoteDefinitionEnd}},text:{91:{name:"gfmFootnoteCall",tokenize:tokenizeGfmFootnoteCall},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:tokenizePotentialGfmFootnoteCall,resolveTo:resolveToPotentialGfmFootnoteCall}}}}function tokenizePotentialGfmFootnoteCall(e,t,n){const a=this;let s=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let V;for(;s--;){const G=a.events[s][1];if(G.type==="labelImage"){V=G;break}if(G.type==="gfmFootnoteCall"||G.type==="labelLink"||G.type==="label"||G.type==="image"||G.type==="link")break}return W;function W(G){if(!V||!V._balanced)return n(G);const U=normalizeIdentifier(a.sliceSerialize({start:V.end,end:a.now()}));return U.codePointAt(0)!==94||!o.includes(U.slice(1))?n(G):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(G),e.exit("gfmFootnoteCallLabelMarker"),t(G))}}function resolveToPotentialGfmFootnoteCall(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},V={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},W=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",o,t],["enter",V,t],["exit",V,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...W),e}function tokenizeGfmFootnoteCall(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,V;return W;function W(K){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(K),e.exit("gfmFootnoteCallLabelMarker"),G}function G(K){return K!==94?n(K):(e.enter("gfmFootnoteCallMarker"),e.consume(K),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",U)}function U(K){if(o>999||K===93&&!V||K===null||K===91||markdownLineEndingOrSpace(K))return n(K);if(K===93){e.exit("chunkString");const ne=e.exit("gfmFootnoteCallString");return s.includes(normalizeIdentifier(a.sliceSerialize(ne)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(K),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(K)}return markdownLineEndingOrSpace(K)||(V=!0),o++,e.consume(K),K===92?J:U}function J(K){return K===91||K===92||K===93?(e.consume(K),o++,U):U(K)}}function tokenizeDefinitionStart(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,V=0,W;return G;function G(me){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(me),e.exit("gfmFootnoteDefinitionLabelMarker"),U}function U(me){return me===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(me),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",J):n(me)}function J(me){if(V>999||me===93&&!W||me===null||me===91||markdownLineEndingOrSpace(me))return n(me);if(me===93){e.exit("chunkString");const ue=e.exit("gfmFootnoteDefinitionLabelString");return o=normalizeIdentifier(a.sliceSerialize(ue)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(me),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),ne}return markdownLineEndingOrSpace(me)||(W=!0),V++,e.consume(me),me===92?K:J}function K(me){return me===91||me===92||me===93?(e.consume(me),V++,J):J(me)}function ne(me){return me===58?(e.enter("definitionMarker"),e.consume(me),e.exit("definitionMarker"),s.includes(o)||s.push(o),factorySpace(e,ce,"gfmFootnoteDefinitionWhitespace")):n(me)}function ce(me){return t(me)}}function tokenizeDefinitionContinuation(e,t,n){return e.check(blankLine,t,e.attempt(indent,t,n))}function gfmFootnoteDefinitionEnd(e){e.exit("gfmFootnoteDefinition")}function tokenizeIndent(e,t,n){const a=this;return factorySpace(e,s,"gfmFootnoteDefinitionIndent",5);function s(o){const V=a.events[a.events.length-1];return V&&V[1].type==="gfmFootnoteDefinitionIndent"&&V[2].sliceSerialize(V[1],!0).length===4?t(o):n(o)}}function gfmStrikethrough(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:s};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function s(V,W){let G=-1;for(;++G<V.length;)if(V[G][0]==="enter"&&V[G][1].type==="strikethroughSequenceTemporary"&&V[G][1]._close){let U=G;for(;U--;)if(V[U][0]==="exit"&&V[U][1].type==="strikethroughSequenceTemporary"&&V[U][1]._open&&V[G][1].end.offset-V[G][1].start.offset===V[U][1].end.offset-V[U][1].start.offset){V[G][1].type="strikethroughSequence",V[U][1].type="strikethroughSequence";const J={type:"strikethrough",start:Object.assign({},V[U][1].start),end:Object.assign({},V[G][1].end)},K={type:"strikethroughText",start:Object.assign({},V[U][1].end),end:Object.assign({},V[G][1].start)},ne=[["enter",J,W],["enter",V[U][1],W],["exit",V[U][1],W],["enter",K,W]],ce=W.parser.constructs.insideSpan.null;ce&&splice(ne,ne.length,0,resolveAll(ce,V.slice(U+1,G),W)),splice(ne,ne.length,0,[["exit",K,W],["enter",V[G][1],W],["exit",V[G][1],W],["exit",J,W]]),splice(V,U-1,G-U+3,ne),G=U+ne.length-2;break}}for(G=-1;++G<V.length;)V[G][1].type==="strikethroughSequenceTemporary"&&(V[G][1].type="data");return V}function o(V,W,G){const U=this.previous,J=this.events;let K=0;return ne;function ne(me){return U===126&&J[J.length-1][1].type!=="characterEscape"?G(me):(V.enter("strikethroughSequenceTemporary"),ce(me))}function ce(me){const ue=classifyCharacter(U);if(me===126)return K>1?G(me):(V.consume(me),K++,ce);if(K<2&&!n)return G(me);const ve=V.exit("strikethroughSequenceTemporary"),pe=classifyCharacter(me);return ve._open=!pe||pe===2&&!!ue,ve._close=!ue||ue===2&&!!pe,W(me)}}}class EditMap{constructor(){this.map=[]}add(t,n,a){addImplementation(this,t,n,a)}consume(t){if(this.map.sort(function(o,V){return o[0]-V[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let s=a.pop();for(;s;){for(const o of s)t.push(o);s=a.pop()}this.map.length=0}}function addImplementation(e,t,n,a){let s=0;if(!(n===0&&a.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...a);return}s+=1}e.map.push([t,n,a])}}function gfmTableAlign(e,t){let n=!1;const a=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function gfmTable(){return{flow:{null:{name:"table",tokenize:tokenizeTable,resolveAll:resolveTable}}}}function tokenizeTable(e,t,n){const a=this;let s=0,o=0,V;return W;function W($e){let We=a.events.length-1;for(;We>-1;){const Be=a.events[We][1].type;if(Be==="lineEnding"||Be==="linePrefix")We--;else break}const ke=We>-1?a.events[We][1].type:null,Ge=ke==="tableHead"||ke==="tableRow"?Se:G;return Ge===Se&&a.parser.lazy[a.now().line]?n($e):Ge($e)}function G($e){return e.enter("tableHead"),e.enter("tableRow"),U($e)}function U($e){return $e===124||(V=!0,o+=1),J($e)}function J($e){return $e===null?n($e):markdownLineEnding($e)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume($e),e.exit("lineEnding"),ce):n($e):markdownSpace($e)?factorySpace(e,J,"whitespace")($e):(o+=1,V&&(V=!1,s+=1),$e===124?(e.enter("tableCellDivider"),e.consume($e),e.exit("tableCellDivider"),V=!0,J):(e.enter("data"),K($e)))}function K($e){return $e===null||$e===124||markdownLineEndingOrSpace($e)?(e.exit("data"),J($e)):(e.consume($e),$e===92?ne:K)}function ne($e){return $e===92||$e===124?(e.consume($e),K):K($e)}function ce($e){return a.interrupt=!1,a.parser.lazy[a.now().line]?n($e):(e.enter("tableDelimiterRow"),V=!1,markdownSpace($e)?factorySpace(e,me,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($e):me($e))}function me($e){return $e===45||$e===58?ve($e):$e===124?(V=!0,e.enter("tableCellDivider"),e.consume($e),e.exit("tableCellDivider"),ue):Re($e)}function ue($e){return markdownSpace($e)?factorySpace(e,ve,"whitespace")($e):ve($e)}function ve($e){return $e===58?(o+=1,V=!0,e.enter("tableDelimiterMarker"),e.consume($e),e.exit("tableDelimiterMarker"),pe):$e===45?(o+=1,pe($e)):$e===null||markdownLineEnding($e)?ye($e):Re($e)}function pe($e){return $e===45?(e.enter("tableDelimiterFiller"),xe($e)):Re($e)}function xe($e){return $e===45?(e.consume($e),xe):$e===58?(V=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume($e),e.exit("tableDelimiterMarker"),ge):(e.exit("tableDelimiterFiller"),ge($e))}function ge($e){return markdownSpace($e)?factorySpace(e,ye,"whitespace")($e):ye($e)}function ye($e){return $e===124?me($e):$e===null||markdownLineEnding($e)?!V||s!==o?Re($e):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t($e)):Re($e)}function Re($e){return n($e)}function Se($e){return e.enter("tableRow"),Ae($e)}function Ae($e){return $e===124?(e.enter("tableCellDivider"),e.consume($e),e.exit("tableCellDivider"),Ae):$e===null||markdownLineEnding($e)?(e.exit("tableRow"),t($e)):markdownSpace($e)?factorySpace(e,Ae,"whitespace")($e):(e.enter("data"),Te($e))}function Te($e){return $e===null||$e===124||markdownLineEndingOrSpace($e)?(e.exit("data"),Ae($e)):(e.consume($e),$e===92?Le:Te)}function Le($e){return $e===92||$e===124?(e.consume($e),Te):Te($e)}}function resolveTable(e,t){let n=-1,a=!0,s=0,o=[0,0,0,0],V=[0,0,0,0],W=!1,G=0,U,J,K;const ne=new EditMap;for(;++n<e.length;){const ce=e[n],me=ce[1];ce[0]==="enter"?me.type==="tableHead"?(W=!1,G!==0&&(flushTableEnd(ne,t,G,U,J),J=void 0,G=0),U={type:"table",start:Object.assign({},me.start),end:Object.assign({},me.end)},ne.add(n,0,[["enter",U,t]])):me.type==="tableRow"||me.type==="tableDelimiterRow"?(a=!0,K=void 0,o=[0,0,0,0],V=[0,n+1,0,0],W&&(W=!1,J={type:"tableBody",start:Object.assign({},me.start),end:Object.assign({},me.end)},ne.add(n,0,[["enter",J,t]])),s=me.type==="tableDelimiterRow"?2:J?3:1):s&&(me.type==="data"||me.type==="tableDelimiterMarker"||me.type==="tableDelimiterFiller")?(a=!1,V[2]===0&&(o[1]!==0&&(V[0]=V[1],K=flushCell(ne,t,o,s,void 0,K),o=[0,0,0,0]),V[2]=n)):me.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(V[0]=V[1],K=flushCell(ne,t,o,s,void 0,K)),o=V,V=[o[1],n,0,0])):me.type==="tableHead"?(W=!0,G=n):me.type==="tableRow"||me.type==="tableDelimiterRow"?(G=n,o[1]!==0?(V[0]=V[1],K=flushCell(ne,t,o,s,n,K)):V[1]!==0&&(K=flushCell(ne,t,V,s,n,K)),s=0):s&&(me.type==="data"||me.type==="tableDelimiterMarker"||me.type==="tableDelimiterFiller")&&(V[3]=n)}for(G!==0&&flushTableEnd(ne,t,G,U,J),ne.consume(t.events),n=-1;++n<t.events.length;){const ce=t.events[n];ce[0]==="enter"&&ce[1].type==="table"&&(ce[1]._align=gfmTableAlign(t.events,n))}return e}function flushCell(e,t,n,a,s,o){const V=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",W="tableContent";n[0]!==0&&(o.end=Object.assign({},getPoint(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const G=getPoint(t.events,n[1]);if(o={type:V,start:Object.assign({},G),end:Object.assign({},G)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const U=getPoint(t.events,n[2]),J=getPoint(t.events,n[3]),K={type:W,start:Object.assign({},U),end:Object.assign({},J)};if(e.add(n[2],0,[["enter",K,t]]),a!==2){const ne=t.events[n[2]],ce=t.events[n[3]];if(ne[1].end=Object.assign({},ce[1].end),ne[1].type="chunkText",ne[1].contentType="text",n[3]>n[2]+1){const me=n[2]+1,ue=n[3]-n[2]-1;e.add(me,ue,[])}}e.add(n[3]+1,0,[["exit",K,t]])}return s!==void 0&&(o.end=Object.assign({},getPoint(t.events,s)),e.add(s,0,[["exit",o,t]]),o=void 0),o}function flushTableEnd(e,t,n,a,s){const o=[],V=getPoint(t.events,n);s&&(s.end=Object.assign({},V),o.push(["exit",s,t])),a.end=Object.assign({},V),o.push(["exit",a,t]),e.add(n+1,0,o)}function getPoint(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const tasklistCheck={name:"tasklistCheck",tokenize:tokenizeTasklistCheck};function gfmTaskListItem(){return{text:{91:tasklistCheck}}}function tokenizeTasklistCheck(e,t,n){const a=this;return s;function s(G){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(G):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(G),e.exit("taskListCheckMarker"),o)}function o(G){return markdownLineEndingOrSpace(G)?(e.enter("taskListCheckValueUnchecked"),e.consume(G),e.exit("taskListCheckValueUnchecked"),V):G===88||G===120?(e.enter("taskListCheckValueChecked"),e.consume(G),e.exit("taskListCheckValueChecked"),V):n(G)}function V(G){return G===93?(e.enter("taskListCheckMarker"),e.consume(G),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),W):n(G)}function W(G){return markdownLineEnding(G)?t(G):markdownSpace(G)?e.check({tokenize:spaceThenNonSpace},t,n)(G):n(G)}}function spaceThenNonSpace(e,t,n){return factorySpace(e,a,"whitespace");function a(s){return s===null?n(s):t(s)}}function gfm(e){return combineExtensions([gfmAutolinkLiteral(),gfmFootnote(),gfmStrikethrough(e),gfmTable(),gfmTaskListItem()])}const emptyOptions={};function remarkGfm(e){const t=this,n=e||emptyOptions,a=t.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),V=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(gfm(n)),o.push(gfmFromMarkdown()),V.push(gfmToMarkdown(n))}const MdInput=({id:e,value:t="",onChange:n,placeholder:a="Enter markdown content...",rows:s=1,disabled:o=!1,className:V,textareaClassName:W,previewClassName:G,defaultMode:U="markdown",mode:J,label:K,required:ne=!1})=>{const[ce,me]=React.useState(U),[ue,ve]=React.useState(!1),pe=e||`md-input-${Math.random().toString(36).slice(2,11)}`,xe=React.useMemo(()=>{if(!t)return s;const Re=(t.match(/\n/g)||[]).length+1;return Math.min(18,Re)},[t,s]),ge=J??ce,ye=J!==void 0;return jsxRuntimeExports.jsxs("div",{className:cn$1("flex flex-col gap-2",V),children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-3",children:[!ye&&jsxRuntimeExports.jsx("div",{className:"flex items-center gap-2",children:jsxRuntimeExports.jsxs("div",{className:"inline-flex grow-0 p-1 rounded-lg bg-neutral-100 dark:bg-black-700 w-auto",children:[jsxRuntimeExports.jsx("button",{className:cn$1("rounded-md p-1 flex items-center justify-center",ge==="markdown"?"bg-white dark:bg-black-700 !text-neutral-900 dark:!text-neutral-100":""),onClick:()=>me("markdown"),disabled:o,children:jsxRuntimeExports.jsx(Typography,{variant:"semibold",size:"extra-small",appearance:"subtitle",className:cn$1(ge==="markdown"?"!text-neutral-900 dark:!text-neutral-100":""),children:"Markdown"})}),jsxRuntimeExports.jsx("button",{className:cn$1("rounded-md p-1 flex items-center justify-center",ge==="preview"?"bg-white dark:bg-black-700 !text-neutral-900 dark:!text-neutral-100":""),onClick:()=>me("preview"),disabled:o,children:jsxRuntimeExports.jsx(Typography,{variant:"semibold",size:"extra-small",appearance:"subtitle",className:cn$1(ge==="preview"?"!text-neutral-900 dark:!text-neutral-100":""),children:"Preview"})})]})}),K&&jsxRuntimeExports.jsxs("label",{htmlFor:pe,className:"text-xs font-medium text-gray-600 dark:text-gray-300",children:[K,ne&&jsxRuntimeExports.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})]}),jsxRuntimeExports.jsx("div",{className:"relative",children:ge==="markdown"?jsxRuntimeExports.jsx("textarea",{id:pe,value:t,onChange:Re=>n(Re.target.value),placeholder:a,rows:xe,disabled:o,required:ne,className:cn$1("w-full border rounded-lg bg-white dark:bg-black-600","py-2.5 px-3 font-inter font-medium text-sm","text-gray-900 dark:text-gray-100","placeholder:text-gray-400 dark:placeholder:text-gray-500","transition-colors duration-200","focus:ring-2 focus:outline-none resize-vertical","border-gray-300 dark:border-gray-600","focus:border-blue-500 focus:ring-blue-200 dark:focus:ring-blue-400/20",{"bg-gray-50 dark:bg-gray-700 text-gray-400 dark:text-gray-500 cursor-not-allowed":o},W),onClick:Re=>Re.stopPropagation()}):jsxRuntimeExports.jsxs("div",{className:"relative",children:[jsxRuntimeExports.jsx("div",{className:cn$1("w-full rounded-lg","py-2.5 px-3 min-h-[calc(2.5rem*var(--rows,8))] max-h-[calc(1rem*var(--rows,8))]","overflow-y-auto text-sm",G),style:{"--rows":xe>3?xe-3:xe},children:jsxRuntimeExports.jsx("div",{className:"markdown-preview text-gray-900 dark:text-gray-100 [&_h1]:text-2xl [&_h1]:font-bold [&_h1]:mb-4 [&_h1]:mt-2 [&_h2]:text-xl [&_h2]:font-bold [&_h2]:mb-3 [&_h2]:mt-2 [&_h3]:text-lg [&_h3]:font-semibold [&_h3]:mb-2 [&_h3]:mt-2 [&_p]:mb-2 [&_p]:leading-relaxed [&_ul]:list-disc [&_ul]:ml-6 [&_ul]:mb-2 [&_ol]:list-decimal [&_ol]:ml-6 [&_ol]:mb-2 [&_li]:mb-1 [&_code]:bg-gray-100 [&_code]:dark:bg-gray-800 [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-sm [&_code]:font-mono [&_pre]:bg-gray-100 [&_pre]:dark:bg-gray-800 [&_pre]:p-3 [&_pre]:rounded [&_pre]:overflow-x-auto [&_pre]:mb-2 [&_blockquote]:border-l-4 [&_blockquote]:border-gray-300 [&_blockquote]:dark:border-gray-600 [&_blockquote]:pl-4 [&_blockquote]:italic [&_blockquote]:mb-2 [&_a]:text-blue-600 [&_a]:dark:text-blue-400 [&_a]:underline [&_strong]:font-bold [&_em]:italic [&_table]:w-full [&_table]:border-collapse [&_table]:mb-2 [&_th]:border [&_th]:border-gray-300 [&_th]:dark:border-gray-600 [&_th]:px-2 [&_th]:py-1 [&_th]:bg-gray-50 [&_th]:dark:bg-gray-700 [&_th]:font-semibold [&_td]:border [&_td]:border-gray-300 [&_td]:dark:border-gray-600 [&_td]:px-2 [&_td]:py-1 [&_hr]:my-4 [&_hr]:border-gray-300 [&_hr]:dark:border-gray-600",children:jsxRuntimeExports.jsx(Markdown,{remarkPlugins:[remarkGfm],children:t||"*No content to preview*"})})}),jsxRuntimeExports.jsx("button",{onClick:()=>ve(!0),className:"absolute bottom-2 right-2 p-1 rounded-md bg-neutral-100 dark:bg-black-600 hover:bg-gray-200 dark:hover:bg-black-500 transition-colors shadow-sm flex items-center justify-center",title:"Expand preview",type:"button",children:jsxRuntimeExports.jsx(AllIcons.OpenInFull,{sx:{fontSize:"16px"},className:"text-neutral-600 dark:text-neutral-400"})})]})}),jsxRuntimeExports.jsx(Modal,{open:ue,onCancel:()=>ve(!1),title:"Markdown Preview",width:800,footer:null,children:jsxRuntimeExports.jsx("div",{className:"markdown-preview max-h-[70vh] overflow-y-auto text-gray-900 dark:text-gray-100 [&_h1]:text-2xl [&_h1]:font-bold [&_h1]:mb-4 [&_h1]:mt-2 [&_h2]:text-xl [&_h2]:font-bold [&_h2]:mb-3 [&_h2]:mt-2 [&_h3]:text-lg [&_h3]:font-semibold [&_h3]:mb-2 [&_h3]:mt-2 [&_p]:mb-2 [&_p]:leading-relaxed [&_ul]:list-disc [&_ul]:ml-6 [&_ul]:mb-2 [&_ol]:list-decimal [&_ol]:ml-6 [&_ol]:mb-2 [&_li]:mb-1 [&_code]:bg-gray-100 [&_code]:dark:bg-gray-800 [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_code]:text-sm [&_code]:font-mono [&_pre]:bg-gray-100 [&_pre]:dark:bg-gray-800 [&_pre]:p-3 [&_pre]:rounded [&_pre]:overflow-x-auto [&_pre]:mb-2 [&_blockquote]:border-l-4 [&_blockquote]:border-gray-300 [&_blockquote]:dark:border-gray-600 [&_blockquote]:pl-4 [&_blockquote]:italic [&_blockquote]:mb-2 [&_a]:text-blue-600 [&_a]:dark:text-blue-400 [&_a]:underline [&_strong]:font-bold [&_em]:italic [&_table]:w-full [&_table]:border-collapse [&_table]:mb-2 [&_th]:border [&_th]:border-gray-300 [&_th]:dark:border-gray-600 [&_th]:px-2 [&_th]:py-1 [&_th]:bg-gray-50 [&_th]:dark:bg-gray-700 [&_th]:font-semibold [&_td]:border [&_td]:border-gray-300 [&_td]:dark:border-gray-600 [&_td]:px-2 [&_td]:py-1 [&_hr]:my-4 [&_hr]:border-gray-300 [&_hr]:dark:border-gray-600",children:jsxRuntimeExports.jsx(Markdown,{remarkPlugins:[remarkGfm],children:t||"*No content to preview*"})})})]})};function FiDownload(e){return GenIcon({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},child:[]},{tag:"polyline",attr:{points:"7 10 12 15 17 10"},child:[]},{tag:"line",attr:{x1:"12",y1:"15",x2:"12",y2:"3"},child:[]}]})(e)}function FiTrash2(e){return GenIcon({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"3 6 5 6 21 6"},child:[]},{tag:"path",attr:{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"},child:[]},{tag:"line",attr:{x1:"10",y1:"11",x2:"10",y2:"17"},child:[]},{tag:"line",attr:{x1:"14",y1:"11",x2:"14",y2:"17"},child:[]}]})(e)}const{Dragger:Dragger$1}=antd.Upload,defaultFormatFileSize=e=>e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(2)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(2)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`,shortenFileName=(e,t=20)=>e?e.length<=t?e:e.slice(0,t-7)+"...."+e.slice(-7):"",MultiFileUpload=React.forwardRef(({id:e,onFileChange:t,description:n,errorMessage:a,disabled:s=!1,defaultFile:o=null,acceptedFiles:V="*",isLoading:W=!1,asBase64:G=!1,toFileServer:U=!1,setFileUploading:J,fileUploading:K=!1,multiple:ne=!1,getRealFileName:ce=!1,maxSize:me=50*1024*1024,onUpload:ue,onDelete:ve,wrapperClassName:pe,uploadClassName:xe,showFileSize:ge=!0,formatFileSize:ye=defaultFormatFileSize},Re)=>{const[Se,Ae]=React.useState(null),[Te,Le]=React.useState([]),[$e,We]=React.useState("#d9d9d9"),[ke,Ge]=React.useState(!1),[Be,Pe]=React.useState(null),je=React.useCallback(async()=>{if(ue)try{const Ie=await ue(Te),Fe=ne?Ie?.map(Je=>Je?.fileUrl):Ie?.[0]?.fileUrl,Ue=ce?Se?.name:Ie?.[0]?.fileName;t(Fe,Ue),J?.(null)}catch(Ie){console.error("Upload failed:",Ie),J?.(null)}},[ue,Te,ne,Se,ce,t,J]),Ne={accept:V,multiple:ne,showUploadList:!1,disabled:s,onRemove:()=>{Le([])},beforeUpload:(Ie,Fe)=>{if(Ie.size>me){const Ue=(me/1048576).toFixed(0);return console.error(`File size exceeds ${Ue}MB limit`),!1}return Ae(Ie),U?(J?.(e||"field-file-upload"),Le(Fe)):(G?Promise.all((ne?Fe:[Ie]).map(Ue=>new Promise(Je=>{const Ze=new FileReader;Ze.onload=Ke=>{Je({filename:Ue.name,content:Ke?.target?.result?.split(",")[1]})},Ze.readAsDataURL(Ue)}))).then(Ue=>{t(ne?Ue:Ue[0])}):t(Ie),Ae(Ie)),!1}},_e=async()=>{if(U&&Be&&ve)try{await ve(Be),Pe(null)}catch(Ie){console.error("Delete failed:",Ie)}Ae(null),Le([]),t(null)};return React.useEffect(()=>{We(a?"#EF4444":"#d9d9d9")},[a]),React.useEffect(()=>{Te.length&&U&&je()},[Te,U,je]),React.useEffect(()=>{o?.name&&Ae(o)},[o]),jsxRuntimeExports.jsxs("div",{ref:Re,className:cn$1("w-full",pe),children:[jsxRuntimeExports.jsx("div",{className:"h-32",onMouseEnter:()=>Ge(!0),onMouseLeave:()=>Ge(!1),children:jsxRuntimeExports.jsx(Dragger$1,{...Ne,className:xe,style:{borderColor:ke&&!a?"#1890ff":$e},disabled:s||K,children:Se?jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between mx-5",title:Se?.name||o?.name||"",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center gap-4",children:[Se?.type==="application/pdf"?jsxRuntimeExports.jsx("div",{className:"p-3 bg-[#E6F1FC] rounded-lg",children:jsxRuntimeExports.jsx(BsFiletypePdf,{size:20,fill:"#006CCF"})}):jsxRuntimeExports.jsx("div",{className:"p-3 bg-[#E6F1FC] rounded-lg",children:jsxRuntimeExports.jsx(AllIcons.DescriptionRounded,{sx:{height:"20px",width:"20px",color:"#006CCF"}})}),jsxRuntimeExports.jsxs("div",{className:"text-left",children:[jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",className:"font-inter text-md font-medium text-base",children:shortenFileName(Se?.name||o?.name||"")}),K?jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",appearance:"subtitle",children:"Uploading..."}):ge&&Se?.size>0?jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",appearance:"subtitle",children:ye(Se.size)}):null]})]}),W?jsxRuntimeExports.jsx(CgSpinner,{size:40,className:"spinner text-primary-600"}):jsxRuntimeExports.jsx("button",{id:`btn-file-upload-${e}`,className:"ml-4",onClick:Ie=>{Ie.stopPropagation(),_e()},disabled:s,type:"button","aria-label":"Delete file",children:jsxRuntimeExports.jsx(FiTrash2,{size:20,className:"text-gray-400"})})]}):jsxRuntimeExports.jsx("div",{className:"flex items-center justify-center",children:jsxRuntimeExports.jsxs("div",{className:"flex-col",children:[jsxRuntimeExports.jsx("div",{className:"mb-4 flex justify-center",children:jsxRuntimeExports.jsx(FiDownload,{size:24,className:"text-gray-400"})}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-center",children:[jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",className:"text-primary-600 dark:text-primary-300",appearance:"custom",children:"Click to upload"}),jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",className:"ml-1",appearance:"subtitle",children:"or drag and drop"})]}),n?jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",appearance:"subtitle",children:n}):null]})]})})})}),a&&jsxRuntimeExports.jsx(Typography,{className:"text-red-500 mt-1",appearance:"custom",size:"extra-small",variant:"medium",children:a})]})});MultiFileUpload.displayName="MultiFileUpload";const roundedIconNames=Object.keys(AllIcons__namespace).filter(e=>e?.endsWith("Rounded")),mergedIconNames=[...roundedIconNames||[],...(COUNTRY_CODES||[]).map(e=>`flag-${e}`)],formatIconName=e=>{if(e?.startsWith("flag-")){const t=e?.replace("flag-","");return countryNameFromCode(t||"")||t}return e.replaceAll(/([A-Z])/g," $1").trim()},IconPickerContent=({onChange:e,selectedIcon:t,setOpen:n})=>{const[a,s]=React.useState(""),o=(mergedIconNames||[]).filter(W=>{if(W?.startsWith("flag-")){const G=W?.replace("flag-","");return G?.toLowerCase()?.includes(a?.trim()?.toLowerCase()||"")||countryNameFromCode(G||"")?.toLowerCase()?.includes(a?.trim()?.toLowerCase()||"")}return W?.trim()?.toLowerCase()?.includes(a?.trim()?.toLowerCase()||"")}),V=(W,G)=>{if(G.stopPropagation(),t===W){e?.(null);return}e?.(W),n?.(!1)};return jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-3",children:[jsxRuntimeExports.jsx(InputField,{id:"input-field-icon-picker",placeholder:"Search icons...",onChange:W=>s(W||""),fieldSuffix:jsxRuntimeExports.jsx(AllIcons__namespace.Search,{sx:{width:16,height:16,color:"rgb(152 162 179)"}})}),jsxRuntimeExports.jsx(reactWindow.FixedSizeGrid,{columnCount:5,rowCount:Math.ceil((o?.length||0)/5),columnWidth:40,rowHeight:40,width:220,height:240,children:({columnIndex:W,rowIndex:G,style:U})=>{const J=G*5+W,K=o?.[J];return K?jsxRuntimeExports.jsx("div",{style:{...U,padding:"4px"},children:jsxRuntimeExports.jsx(antd.Tooltip,{title:formatIconName(K),children:jsxRuntimeExports.jsx(material.IconButton,{className:cn$1("flex items-center justify-center !rounded-md hover:bg-neutral-200 dark:hover:bg-black-700",{"!bg-primary-50 dark:!bg-black-800":t===K}),onClick:ne=>V(K,ne),children:jsxRuntimeExports.jsx(IconRenderer,{iconName:K,sx:{width:20,height:20},className:"text-neutral-900 dark:text-white"})})})}):null}})]})},IconRenderer=({iconName:e,sx:t,className:n,isHovering:a})=>{if(e?.startsWith?.("flag-")){const o=e?.replace("flag-","");return getFlagComponent?.(o||"",a||!1)||jsxRuntimeExports.jsx("div",{children:"-"})}const s=AllIcons__namespace?.[e];return s?jsxRuntimeExports.jsx(s,{sx:t,className:n,isHovering:a}):jsxRuntimeExports.jsx("div",{children:"-"})},IconPickerBase=({selectedIcon:e,onChange:t,label:n,required:a=!1,allowClear:s=!0,disabled:o=!1,errorMessage:V})=>{const[W,G]=React.useState(!1),U=J=>{J.stopPropagation(),t?.("")};return jsxRuntimeExports.jsx(antd.Popover,{arrow:!1,placement:"bottom",trigger:"click",getPopupContainer:J=>J?.parentElement||document.body,open:W,onOpenChange:G,content:jsxRuntimeExports.jsx(IconPickerContent,{onChange:t,selectedIcon:e,setOpen:G}),children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1",children:[n?jsxRuntimeExports.jsxs(Typography,{size:"extra-small",variant:"medium",appearance:"body",children:[n,a&&jsxRuntimeExports.jsx("span",{className:"text-red-500",children:"*"})]}):null,jsxRuntimeExports.jsxs("button",{id:`btn-icon-picker-icon-${e?"selected":"unselected"}`,className:`min-w-[83px] py-1.5 px-3 rounded-md border ${o?"cursor-not-allowed opacity-60 bg-neutral-50 dark:bg-black-800":"bg-white dark:bg-black-800"} ${V?"border-red-500":"focus:border-primary-200 "} flex items-center justify-between gap-2`,disabled:o,onClick:J=>{o&&(J.preventDefault(),J.stopPropagation())},children:[e?jsxRuntimeExports.jsx(IconRenderer,{iconName:e,sx:{width:20,height:20},className:"text-neutral-900 dark:text-white"}):jsxRuntimeExports.jsx(Typography,{size:"small",variant:"medium",appearance:"subtitle",children:"Select Icon"}),e&&s&&!o?jsxRuntimeExports.jsx(AllIcons__namespace.CloseRounded,{sx:{width:20,height:20},className:"hover:bg-neutral-100 dark:hover:bg-black-800 rounded-full transition-colors cursor-pointer text-neutral-400 dark:text-neutral-500",onClick:U}):null]}),V&&jsxRuntimeExports.jsx(Typography,{size:"extra-small",className:"text-red-500 font-medium",children:V})]})})},IconPicker=React.lazy(()=>Promise.resolve({default:e=>jsxRuntimeExports.jsx(React.Suspense,{fallback:jsxRuntimeExports.jsx("div",{className:"min-w-[83px] h-[30px] animate-pulse bg-neutral-100 dark:bg-black-800 rounded-md"}),children:jsxRuntimeExports.jsx(IconPickerBase,{...e})})})),StatusColorMapping=React.forwardRef(({status:e,children:t,className:n,size:a="medium","aria-label":s},o)=>{const V=()=>{switch(a){case"small":return"text-xs px-1.5 py-0.5";case"large":return"text-base px-3 py-1.5";default:return"text-md px-1.5 py-1"}},W=()=>{switch(e?.toLowerCase()){case"purple":return"bg-purple-50 text-purple-500 border border-purple-100 dark:bg-purple-950 dark:text-purple-400 dark:border-purple-800";case"blue":return"bg-blue-50 text-blue-500 border border-blue-100 dark:bg-blue-950 dark:text-blue-400 dark:border-blue-800";case"teal":return"bg-teal-50 text-teal-500 border border-teal-100 dark:bg-teal-950 dark:text-teal-400 dark:border-teal-800";case"green":return"bg-green-50 text-green-500 border border-green-100 dark:bg-green-950 dark:text-green-400 dark:border-green-800";case"yellow":return"bg-yellow-50 text-yellow-600 border border-yellow-100 dark:bg-yellow-950 dark:text-yellow-400 dark:border-yellow-800";case"orange":return"bg-orange-50 text-orange-500 border border-orange-100 dark:bg-orange-950 dark:text-orange-400 dark:border-orange-800";case"peach":return"bg-orange-50 text-orange-400 border border-orange-100 dark:bg-orange-950 dark:text-orange-300 dark:border-orange-800";case"red":return"bg-red-50 text-red-500 border border-red-100 dark:bg-red-950 dark:text-red-400 dark:border-red-800";case"navy":return"bg-slate-50 text-slate-700 border border-slate-100 dark:bg-slate-950 dark:text-slate-400 dark:border-slate-800";case"grey":return"bg-neutral-50 text-neutral-500 border border-neutral-100 dark:bg-neutral-950 dark:text-neutral-400 dark:border-neutral-800";default:return"bg-blue-50 text-blue-600 border border-blue-200 dark:bg-blue-950 dark:text-blue-400 dark:border-blue-800"}};return jsxRuntimeExports.jsx("span",{ref:o,className:cn$1("inline-flex items-center justify-center font-medium rounded-md transition-colors",V(),W(),n),"aria-label":s||`Status: ${e||"default"}`,role:"status",children:t})});StatusColorMapping.displayName="StatusColorMapping";const Badge=React.forwardRef(({status:e="default",children:t,appearance:n="outline",size:a="md",className:s,isRounded:o=!1,capitalize:V=!0,"aria-label":W},G)=>{const U=me=>!me||!V?me:me.replace(/\w\S*/g,ue=>ue.charAt(0).toUpperCase()+ue.substr(1).toLowerCase()),J=()=>{switch(a){case"sm":return"text-xs px-1.5 py-0.5";case"lg":return"text-sm px-3 py-1.5";default:return"text-xs px-2 py-1"}},K=()=>{switch(e){case"primary":case"default":return"bg-blue-50 dark:bg-blue-950 text-blue-600 dark:text-blue-300 border border-blue-300 dark:border-blue-700";case"warning":return"bg-yellow-50 dark:bg-yellow-950 text-yellow-600 dark:text-yellow-300 border border-yellow-300 dark:border-yellow-700";case"error":return"bg-red-50 dark:bg-red-950 text-red-600 dark:text-red-300 border border-red-300 dark:border-red-700";case"neutral":return"bg-neutral-50 dark:bg-neutral-950 text-neutral-600 dark:text-neutral-300 border border-neutral-300 dark:border-neutral-700";case"success":return"bg-green-50 dark:bg-green-950 text-green-600 dark:text-green-300 border border-green-300 dark:border-green-700";case"info":return"bg-blue-50 dark:bg-blue-950 text-blue-600 dark:text-blue-300 border border-blue-300 dark:border-blue-700";default:return"bg-blue-50 dark:bg-blue-950 text-blue-600 dark:text-blue-300 border border-blue-300 dark:border-blue-700"}},ne=()=>{switch(e){case"primary":case"default":return"bg-blue-600 dark:bg-blue-700 text-white";case"warning":return"bg-yellow-600 dark:bg-yellow-700 text-white";case"success":return"bg-green-600 dark:bg-green-700 text-white";case"error":return"bg-red-600 dark:bg-red-700 text-white";case"neutral":return"bg-neutral-600 dark:bg-neutral-700 text-white";case"info":return"bg-blue-600 dark:bg-blue-700 text-white";default:return"bg-blue-600 dark:bg-blue-700 text-white"}},ce=()=>n==="filled"?ne():K();return jsxRuntimeExports.jsx("span",{ref:G,className:cn$1("inline-flex items-center justify-center font-medium transition-colors",o?"rounded-full":"rounded",J(),ce(),s),"aria-label":W||`Badge: ${e}`,role:"status",children:U(t)})});Badge.displayName="Badge";const HelmetTitle=({title:e,children:t})=>e?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:t}):null;HelmetTitle.displayName="HelmetTitle";const Card=({children:e,className:t="",title:n,style:a,id:s})=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(HelmetTitle,{title:n}),jsxRuntimeExports.jsx("div",{className:`bg-white dark:bg-black-800 border border-neutral-200 dark:border-black-600 rounded-lg shadow-100 w-full flex flex-col ${t}`,style:a,id:s,children:e})]});Card.displayName="Card";const Drawer=({id:e,children:t,onClose:n,open:a,title:s,parentContainer:o="full-screen-container",resizable:V,width:W=400,placement:G="right",closable:U=!1,mask:J,classNames:K,styles:ne,getContainer:ce,zIndex:me,footer:ue,...ve})=>{const pe=React.useRef(!1),[xe,ge]=React.useState(W);React.useEffect(()=>{ge(W)},[a,W]);const ye=React.useCallback(Ae=>{if(pe.current)if(G==="right"){const Te=document.body.offsetWidth-(Ae.clientX-document.body.offsetLeft);Te>256&&ge(Te)}else Ae.clientX>256&&ge(Ae.clientX)},[G,ge]),Re=React.useCallback(()=>{pe.current&&(pe.current=!1)},[]);React.useEffect(()=>(document.addEventListener("mousemove",ye),document.addEventListener("mouseup",Re),()=>{document.removeEventListener("mousemove",ye),document.removeEventListener("mouseup",Re)}),[ye,Re]);const Se=typeof window<"u"?document.getElementById(o)||document.body:null;return Se?ReactDOM.createPortal(jsxRuntimeExports.jsxs(antd.Drawer,{id:e||"",closable:U,title:s,onClose:n,open:a,width:xe,getContainer:ce!==void 0?ce:!1,placement:G,mask:J,classNames:K,styles:ne,zIndex:me,footer:ue,...ve,children:[V&&jsxRuntimeExports.jsx("div",{className:"cursor-ew-resize w-1 pl-[2px] absolute top-0 bottom-0 z-[2100] bg-transparent dark:bg-black-600 hover:bg-neutral-200 dark:hover:bg-black-700",onMouseDown:()=>{pe.current=!0},style:G==="right"?{left:0}:{right:0}}),t]}),Se):null};Drawer.displayName="Drawer";const FloatingElementWrapper=({children:e,showAsModal:t,...n})=>t?jsxRuntimeExports.jsx(Modal,{onCancel:n.onClose,...n,children:e}):jsxRuntimeExports.jsx(Drawer,{...n,children:e}),formatBooleanValue=e=>e===1||e==="1"||typeof e=="string"&&e.toLowerCase()==="yes"||typeof e=="string"&&e.toLowerCase()==="true"?"Yes":e===0||e==="0"||typeof e=="string"&&e.toLowerCase()==="no"||typeof e=="string"&&e.toLowerCase()==="false"?"No":e?.toString()||"-",formatCurrency=(e,t="USD")=>{try{if(e==null)return"";const n=Number(e);if(isNaN(n))return e?.toString()||"";const a=n.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2});return`${{USD:"$",EUR:"€",GBP:"£",JPY:"¥",CAD:"C$",AUD:"A$",CHF:"CHF",CNY:"¥",SEK:"kr",NOK:"kr",DKK:"kr",PLN:"zł",CZK:"Kč",HUF:"Ft",RUB:"₽",BRL:"R$",INR:"₹",KRW:"₩",SGD:"S$",HKD:"HK$",NZD:"NZ$",MXN:"$",ZAR:"R",TRY:"₺",ILS:"₪",AED:"د.إ",SAR:"﷼",QAR:"﷼",KWD:"د.ك",BHD:"د.ب",OMR:"﷼",JOD:"د.ا",LBP:"ل.ل",EGP:"£",MAD:"د.م.",TND:"د.ت",DZD:"د.ج",LYD:"ل.د",SDG:"ج.س.",ETB:"Br",KES:"KSh",UGX:"USh",TZS:"TSh",ZMW:"ZK",BWP:"P",ZWL:"Z$",AOA:"Kz",MZN:"MT",GHS:"₵",NGN:"₦",XAF:"FCFA",XOF:"CFA",CDF:"FC",RWF:"RF",BIF:"FBu",KMF:"CF",DJF:"Fdj",SOS:"S",ERN:"Nfk"}[t]||"$"}${a}`}catch{return"-"}},formatDate=(e,t={})=>{const{format:n,relative:a=!1,withTime:s=!0,fallback:o="-",skipTimezone:V=!1,onlyTime:W=!1}=t||{};if(!e)return o;try{const G=new Date(e);if(isNaN(G.getTime()))return o;if(a){const ce=Math.floor((new Date().getTime()-G.getTime())/1e3);return ce<60?"just now":ce<3600?`${Math.floor(ce/60)} minutes ago`:ce<86400?`${Math.floor(ce/3600)} hours ago`:ce<2592e3?`${Math.floor(ce/86400)} days ago`:ce<31536e3?`${Math.floor(ce/2592e3)} months ago`:`${Math.floor(ce/31536e3)} years ago`}const U="MM/dd/yyyy",J="hh:mm a",K=s&&!W;return G.toLocaleDateString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:s?"2-digit":void 0,minute:s?"2-digit":void 0,hour12:!0})}catch{return o}},isISODateString=e=>typeof e=="string"&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(e),LabelValue=React.forwardRef(({id:e,label:t,value:n,className:a,type:s="string",tags:o,tooltip:V,items:W,isModified:G=!1,isChanged:U=!1,size:J="medium",isHighlighted:K=!1,deletedValue:ne,highlightColor:ce="warning",isSearchActive:me=!1,originalValue:ue=!1,showDiff:ve=!1,isLiveField:pe=!1,deltaChange:xe,theme:ge="light",onUpload:ye,acceptsUpload:Re=!1,MasterDataModal:Se,riskDetails:Ae,isRiskAnalysisOpen:Te=!1,RiskDetailsCard:Le,"aria-label":$e},We)=>{const[ke,Ge]=React.useState(!0),[Be,Pe]=React.useState(!1),[je,Ne]=React.useState(null),[_e,Ie]=React.useState(!1),Fe=()=>{Ge(!ke)},Ue=Qe=>{Pe(!0),Ne({...Qe,value:n})},Je=()=>{Pe(!1),Ne(null)},Ze=Qe=>{const lt=Qe.target.files?.[0];lt&&ye&&ye(lt),Qe.target.value=""},Ke=()=>{const Qe=typeof n=="string"&&isISODateString(n);if(me&&typeof n=="object")return n;if(n||s==="boolean"&&n===0||s==="currency"&&Number(n)>=0){if((n===!0||n==="True")&&!ue)return"Yes";if((n===!1||n==="False")&&!ue)return"No";if(s==="url")return jsxRuntimeExports.jsx("a",{href:n,className:"text-primary-600 truncate",children:n});if(s==="boolean")return formatBooleanValue(n);if(s==="currency")return formatCurrency(n,W?.currency_code)||"-";if(s==="datetime"){const lt=typeof n=="string"&&n.includes("Z")?n.replace(/\.000Z$/,"Z"):n;return formatDate(lt,{skipTimezone:!1,withTime:!0})}else if(s==="date"||Qe){const lt=typeof n=="string"&&n.includes("Z")?n.replace(/\.000Z$/,"Z"):n;return formatDate(lt,{skipTimezone:!0,withTime:!1})}else return s==="percentage"?`${n}%`:typeof n=="string"&&n.length>100?jsxRuntimeExports.jsxs("p",{children:[n.slice(0,ke?100:n.length),ke?"... ":" ",jsxRuntimeExports.jsx("button",{id:`btn-label-value-${ke?"Show more":"Show less"}`,className:"text-primary-400 text-sm hover:text-primary-500 cursor-pointer whitespace-nowrap",onClick:Fe,onKeyDown:lt=>{(lt.key==="Enter"||lt.key===" ")&&(lt.preventDefault(),Fe())},"aria-label":ke?"Show more content":"Show less content",type:"button",children:ke?"Show more":"Show less"})]}):n}return"-"},rt=()=>{switch(J){case"small":return"extra-small";case"large":return"large";default:return"small"}},et=()=>{switch(ce){case"success":return"bg-success-100";case"warning":return"bg-warning-100";case"error":return"bg-error-100";case"info":return"bg-info-100";default:return"bg-warning-100"}};return jsxRuntimeExports.jsxs("div",{id:e||"",ref:We,className:cn$1("font-medium relative",a),onMouseEnter:()=>Ie(!0),onMouseLeave:()=>Ie(!1),"aria-label":$e||`Label: ${t}, Value: ${n}`,children:[jsxRuntimeExports.jsxs(Typography,{variant:"medium",size:rt(),className:"flex gap-1 flex-wrap",appearance:"subtitle",children:[t," ",jsxRuntimeExports.jsx(Label,{labels:o?.map(Qe=>({...Qe,color:Qe.color||"primary"}))}),pe&&jsxRuntimeExports.jsx(AllIcons.BoltOutlined,{sx:{fontSize:16,color:"var(--color-primary-600)",rotate:"15deg"}}),o&&o.length>0&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:o.map(Qe=>jsxRuntimeExports.jsx(Tag,{label:Qe.label,color:Qe.color,size:"xs",theme:ge},`${Qe.label}-${Qe.value||Qe.color}`))}),V&&jsxRuntimeExports.jsx(antd.Tooltip,{placement:"top",title:V,children:jsxRuntimeExports.jsx("div",{className:"cursor-pointer",role:"button",tabIndex:0,onKeyDown:Qe=>{(Qe.key==="Enter"||Qe.key===" ")&&Qe.preventDefault()},children:jsxRuntimeExports.jsx(HelpIcon,{size:14})})})]}),jsxRuntimeExports.jsxs(Typography,{variant:"medium",size:rt(),className:cn$1("text-- whitespace-normal break-all flex gap-1 pt-0.5",G&&"bg-neutral-50 dark:bg-black-700 p-1 rounded",Te&&Ae?.color&&`bg-${Ae.color}-50 border-${Ae.color}-300 px-0.5 rounded-lg`),appearance:"body",children:[ve&&ne&&n?jsxRuntimeExports.jsxs("div",{className:"flex gap-2",children:[jsxRuntimeExports.jsx("span",{className:"line-through",children:ne}),jsxRuntimeExports.jsx("span",{children:Ke()})]}):U||K?jsxRuntimeExports.jsx("mark",{className:cn$1("rounded-md py-0.5 px-1",et()),children:Ke()}):Ke(),s==="currency"&&xe!==0&&xe!==void 0&&xe!==null&&jsxRuntimeExports.jsxs(framerMotion.motion.span,{initial:{opacity:0,y:2},animate:{opacity:1,y:0},transition:{duration:.25},className:cn$1("inline-flex items-center gap-1 ml-1.5 text-xs font-medium",xe>0?"text-emerald-600 dark:text-emerald-400":"text-red-600 dark:text-red-400"),children:[jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center w-4 h-4",children:xe>0?jsxRuntimeExports.jsx(AllIcons.ArrowUpwardRounded,{sx:{fontSize:16},className:"text-emerald-600 dark:text-emerald-400"}):jsxRuntimeExports.jsx(AllIcons.ArrowDownwardRounded,{sx:{fontSize:16},className:"text-red-600 dark:text-red-400"})}),jsxRuntimeExports.jsx("span",{children:formatCurrency(Math.abs(xe),W?.currency_code||"USD")})]}),W?.is_master_data&&W?.reference&&n&&jsxRuntimeExports.jsx("button",{onClick:()=>Ue(W),onKeyDown:Qe=>{(Qe.key==="Enter"||Qe.key===" ")&&(Qe.preventDefault(),Ue(W))},"aria-label":`Search master data for ${t}`,type:"button",className:"cursor-pointer",children:jsxRuntimeExports.jsx(SearchIcon$1,{width:20,height:20})}),Re&&jsxRuntimeExports.jsx("input",{type:"file",onChange:Ze,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer","aria-label":`Upload file for ${t}`})]}),ne&&!ve&&jsxRuntimeExports.jsx(Typography,{variant:"medium",size:"extra-small",className:"pt-0.5",appearance:"body",children:jsxRuntimeExports.jsx("mark",{className:"rounded-md py-0.5 px-1 bg-error-100",children:jsxRuntimeExports.jsx("del",{children:ne||s==="boolean"&&ne==="0"?ne==="True"?"Yes":ne==="False"?"No":s==="boolean"?formatBooleanValue(ne):s==="currency"?formatCurrency(ne,W?.currency_code):s==="date"?formatDate(ne,{skipTimezone:!0,withTime:!1}):s==="datetime"?formatDate(ne,{skipTimezone:!0,withTime:!0}):s==="percentage"?`${ne}%`:ne.length>100?jsxRuntimeExports.jsxs("p",{children:[ne.slice(0,ke?100:ne.length),ke?"... ":" ",jsxRuntimeExports.jsx("button",{id:`btn-label-value-${ke?"Show more":"Show less"}`,className:"text-primary-400 text-sm hover:text-primary-500 cursor-pointer whitespace-nowrap",onClick:Fe,children:ke?"Show more":"Show less"})]}):ne:"-"})})}),Se&&jsxRuntimeExports.jsx(Se,{isVisible:Be,onClose:Je,masterdataInfo:je}),_e&&Ae&&Te&&jsxRuntimeExports.jsx("div",{className:"absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",onClick:Qe=>Qe.stopPropagation(),onMouseDown:Qe=>Qe.preventDefault(),onKeyDown:Qe=>{Qe.key==="Escape"&&Ie(!1)},role:"tooltip","aria-label":"Risk analysis details",tabIndex:0,children:Le?jsxRuntimeExports.jsx(Le,{riskDetails:Ae}):jsxRuntimeExports.jsx("div",{className:"shadow-lg p-4",children:jsxRuntimeExports.jsxs("div",{className:"text-sm",children:[jsxRuntimeExports.jsx("h4",{className:"font-semibold mb-2",children:"Risk Details"}),jsxRuntimeExports.jsx("p",{className:"text-neutral-600 dark:text-neutral-300",children:Ae.description||"Risk analysis information"})]})})})]})});LabelValue.displayName="LabelValue";const defaultGenerator=e=>e,createClassNameGenerator=()=>{let e=defaultGenerator;return{configure(t){e=t},generate(t){return e(t)},reset(){e=defaultGenerator}}},ClassNameGenerator=createClassNameGenerator();function formatMuiErrorMessage(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(a=>n.searchParams.append("args[]",a)),`Minified MUI error #${e}; visit ${n} for the full message.`}function capitalize(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":formatMuiErrorMessage(7));return e.charAt(0).toUpperCase()+e.slice(1)}var propTypes={exports:{}},reactIs$1={exports:{}},reactIs_production_min={};/** @license React v16.13.1
|
|
176
176
|
* react-is.production.min.js
|
|
177
177
|
*
|
|
178
178
|
* Copyright (c) Facebook, Inc. and its affiliates.
|