pillardash-ui-react 0.1.112 → 0.1.114
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.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -47,5 +47,5 @@ var h={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"
|
|
|
47
47
|
*
|
|
48
48
|
* This source code is licensed under the MIT license found in the
|
|
49
49
|
* LICENSE file in the root directory of this source tree.
|
|
50
|
-
*/"production"===process.env.NODE_ENV?Ou.exports=function(){if(Mu)return Au;Mu=1;var e=t,n=ju,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Au.useSyncExternalStoreWithSelector=function(e,t,n,c,d){var h=i(null);if(null===h.current){var u={hasValue:!1,value:null};h.current=u}else u=h.current;h=a((function(){function e(e){if(!s){if(s=!0,o=e,e=c(e),void 0!==d&&u.hasValue){var t=u.value;if(d(t,e))return i=t}return i=e}if(t=i,r(o,e))return t;var n=c(e);return void 0!==d&&d(t,n)?(o=e,t):(o=e,i=n)}var o,i,s=!1,a=void 0===n?null:n;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]}),[t,n,c,d]);var p=o(e,h[0],h[1]);return s((function(){u.hasValue=!0,u.value=p}),[p]),l(p),p},Au}():Ou.exports=(Du||(Du=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=t,n=ju,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;Ru.useSyncExternalStoreWithSelector=function(e,t,n,c,d){var h=i(null);if(null===h.current){var u={hasValue:!1,value:null};h.current=u}else u=h.current;h=a((function(){function e(e){if(!s){if(s=!0,o=e,e=c(e),void 0!==d&&u.hasValue){var t=u.value;if(d(t,e))return i=t}return i=e}if(t=i,r(o,e))return t;var n=c(e);return void 0!==d&&d(t,n)?(o=e,t):(o=e,i=n)}var o,i,s=!1,a=void 0===n?null:n;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]}),[t,n,c,d]);var p=o(e,h[0],h[1]);return s((function(){u.hasValue=!0,u.value=p}),[p]),l(p),p},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Ru);var Lu=Ou.exports,zu=(...e)=>t=>{e.forEach((e=>{"function"==typeof e?e(t):e&&(e.current=t)}))},Iu=({contentComponent:t})=>{const n=ju.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return e.jsx(e.Fragment,{children:Object.values(n)})};var Pu=class extends t.Component{constructor(e){var n;super(e),this.editorContentRef=t.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:Boolean(null==(n=e.editor)?void 0:n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=function(){const e=new Set;let t={};return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),getSnapshot:()=>t,getServerSnapshot:()=>t,setRenderer(r,o){t={...t,[r]:n.createPortal(o.reactElement,o.element,r)},e.forEach((e=>e()))},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach((e=>e()))}}}(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe((()=>{this.setState((e=>e.hasContentComponentInitialized?e:{hasContentComponentInitialized:!0})),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()}))),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var e;const t=this.props.editor;if(!t)return;if(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null,!(null==(e=t.options.element)?void 0:e.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,innerRef:n,...r}=this.props;return e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:zu(n,this.editorContentRef),...r}),(null==t?void 0:t.contentComponent)&&e.jsx(Iu,{contentComponent:t.contentComponent})]})}},Bu=t.forwardRef(((e,n)=>{const r=t.useMemo((()=>Math.floor(4294967295*Math.random()).toString()),[e.editor]);return t.createElement(Pu,{key:r,innerRef:n,...e})})),$u=t.memo(Bu),Vu="undefined"!=typeof window?t.useLayoutEffect:t.useEffect,Fu=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach((e=>e()))},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}};var Hu="production"!==process.env.NODE_ENV,_u="undefined"==typeof window,qu=_u||Boolean("undefined"!=typeof window&&window.next),Wu=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach((e=>e()))}getInitialEditor(){if(void 0===this.options.current.immediatelyRender){if(_u||qu){if(Hu)throw new Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");return null}return this.createEditor()}if(this.options.current.immediatelyRender&&_u&&Hu)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBeforeCreate)?void 0:n.call(t,...e)},onBlur:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBlur)?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onCreate)?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDestroy)?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null==(n=(t=this.options.current).onFocus)?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onSelectionUpdate)?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null==(n=(t=this.options.current).onTransaction)?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onUpdate)?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null==(n=(t=this.options.current).onContentError)?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDrop)?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null==(n=(t=this.options.current).onPaste)?void 0:n.call(t,...e)},onDelete:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDelete)?void 0:n.call(t,...e)}};return new cc(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every((n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every(((e,n)=>{var r;return e===(null==(r=t.extensions)?void 0:r[n])})):e[n]===t[n])))}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps)return void(this.previousDeps=e);if(this.previousDeps.length===e.length&&this.previousDeps.every(((t,n)=>t===e[n])))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout((()=>{this.isComponentMounted&&this.instanceId===e?t&&t.setOptions(this.options.current):t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))}),1)}};function Ku(e={},n=[]){const r=t.useRef(e);r.current=e;const[o]=t.useState((()=>new Wu(r))),i=ju.useSyncExternalStore(o.subscribe,o.getEditor,o.getServerSnapshot);return t.useDebugValue(i),t.useEffect(o.onRender(n)),function(e){var n;const[r]=t.useState((()=>new Fu(e.editor))),o=Lu.useSyncExternalStoreWithSelector(r.subscribe,r.getSnapshot,r.getServerSnapshot,e.selector,null!=(n=e.equalityFn)?n:Eu);Vu((()=>r.watch(e.editor)),[e.editor,r]),t.useDebugValue(o)}({editor:i,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction||void 0===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),i}t.createContext({editor:null}).Consumer;var Ju=t.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}});t.forwardRef(((n,r)=>{const{onDragStart:o}=t.useContext(Ju),i=n.as||"div";return e.jsx(i,{...n,ref:r,"data-node-view-wrapper":"",onDragStart:o,style:{whiteSpace:"normal",...n.style}})})),t.createContext({markViewContentRef:()=>{}});var Uu=/^\s*>\s$/,Gu=pc.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return mc("blockquote",{...Ys(this.options.HTMLAttributes,e),children:mc("slot",{})})},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[uc({find:Uu,type:this.type})]}}),Yu=pc.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",Ys(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command((()=>{const{selection:e,storedMarks:o}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:s}=r.extensionManager,a=o||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{if(t&&a&&i){const t=a.filter((e=>s.includes(e.type.name)));e.ensureMarks(t)}return!0})).run()}))])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Xu=pc.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",Ys(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!function(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof gn){const e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let o=r.depth;for(;o>=0;){const e=r.index(o);if(r.node(o).contentMatchAt(e).matchType(t))return!0;o-=1}return!1}(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$to:r}=n,o=e();return Sa(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command((({tr:e,dispatch:t})=>{var n;if(t){const{$to:t}=e.selection,r=t.end();if(t.nodeAfter)t.nodeAfter.isTextblock?e.setSelection(fn.create(e.doc,t.pos+1)):t.nodeAfter.isBlock?e.setSelection(gn.create(e.doc,t.pos)):e.setSelection(fn.create(e.doc,t.pos));else{const o=null==(n=t.parent.type.contentMatch.defaultType)?void 0:n.create();o&&(e.insert(r,o),e.setSelection(fn.create(e.doc,r+1)))}e.scrollIntoView()}return!0})).run()}}},addInputRules(){return[(e={find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type},new Ta({find:e.find,handler:({state:t,range:n,match:r})=>{const o=Js(e.getAttributes,void 0,r)||{},{tr:i}=t,s=n.from;let a=n.to;const l=e.type.create(o);if(r[1]){let e=s+r[0].lastIndexOf(r[1]);e>a?e=a:a=e+r[1].length;const t=r[0][r[0].length-1];i.insertText(t,s+r[0].length-1),i.replaceWith(e,a,l)}else if(r[0]){const t=e.type.isInline?s:s-1;i.insert(t,e.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()}}))];var e}});function Qu(e={}){return new En({view:t=>new Zu(t,e)})}class Zu{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=t.width)&&void 0!==n?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map((t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))}destroy(){this.handlers.forEach((({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t)))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r=this.editorView.dom,o=r.getBoundingClientRect(),i=o.width/r.offsetWidth,s=o.height/r.offsetHeight;if(n){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(t){let o=t.getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let a=this.width/2*s;e={left:o.left,right:o.right,top:i-a,bottom:i+a}}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos),n=this.width/2*i;e={left:t.left-n,right:t.left+n,top:t.top,bottom:t.bottom}}let a,l,c=this.editorView.dom.offsetParent;if(this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!c||c==document.body&&"static"==getComputedStyle(c).position)a=-pageXOffset,l=-pageYOffset;else{let e=c.getBoundingClientRect(),t=e.width/c.offsetWidth,n=e.height/c.offsetHeight;a=e.left-c.scrollLeft*t,l=e.top-c.scrollTop*n}this.element.style.left=(e.left-a)/i+"px",this.element.style.top=(e.top-l)/s+"px",this.element.style.width=(e.right-e.left)/i+"px",this.element.style.height=(e.bottom-e.top)/s+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,t,e):r;if(t&&!o){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=Jt(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class ep extends dn{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return ep.valid(n)?new ep(n):dn.near(n)}content(){return ve.empty}eq(e){return e instanceof ep&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new ep(e.resolve(t.pos))}getBookmark(){return new tp(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&ep.valid(e))return e;let r=e.pos,o=null;for(let n=e.depth;;n--){let i=e.node(n);if(t>0?e.indexAfter(n)<i.childCount:e.index(n)>0){o=i.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(ep.valid(s))return s}for(;;){let i=t>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!gn.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*t),n=!1;continue e}break}o=i,r+=t;let s=e.doc.resolve(r);if(ep.valid(s))return s}return null}}}ep.prototype.visible=!1,ep.findFrom=ep.findGapCursorFrom,dn.jsonID("gapcursor",ep);class tp{constructor(e){this.pos=e}map(e){return new tp(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return ep.valid(t)?new ep(t):dn.near(t)}}const np=as({ArrowLeft:rp("horiz",-1),ArrowRight:rp("horiz",1),ArrowUp:rp("vert",-1),ArrowDown:rp("vert",1)});function rp(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){let i=e.selection,s=t>0?i.$to:i.$from,a=i.empty;if(i instanceof fn){if(!o.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=ep.findGapCursorFrom(s,t,a);return!!l&&(r&&r(e.tr.setSelection(new ep(l))),!0)}}function op(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!ep.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&gn.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new ep(r))),!0)}function ip(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof ep))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=pe.empty;for(let e=r.length-1;e>=0;e--)o=pe.from(r[e].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new ve(o,0,0));return i.setSelection(fn.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function sp(e){if(!(e.selection instanceof ep))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",vi.create(e.doc,[gi.widget(e.selection.head,t,{key:"gapcursor"})])}var ap=200,lp=function(){};lp.prototype.append=function(e){return e.length?(e=lp.from(e),!this.length&&e||e.length<ap&&this.leafAppend(e)||this.length<ap&&e.leafPrepend(this)||this.appendInner(e)):this},lp.prototype.prepend=function(e){return e.length?lp.from(e).append(this):this},lp.prototype.appendInner=function(e){return new dp(this,e)},lp.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?lp.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},lp.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},lp.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},lp.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},lp.from=function(e){return e instanceof lp?e:e&&e.length?new cp(e):lp.empty};var cp=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=ap)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=ap)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(lp);lp.empty=new cp([]);var dp=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var o=this.left.length;return!(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(lp);class hp{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--){if(this.items.get(o-1).selection){--o;break}}t&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=e.tr,l=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(o,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new up(e.map));let t,o=e.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new up(t,void 0,void 0,l.length+c.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(i=n?e.selection.map(n.slice(r)):e.selection,s=new hp(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(e,t,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<e.steps.length;n++){let l,c=e.steps[n].invert(e.docs[n]),d=new up(e.mapping.maps[n],c,t);(l=a&&a.merge(d))&&(d=l,n?o.pop():s=s.slice(0,s.length-1)),o.push(d),t&&(i++,t=void 0),r||(a=d)}let l=i-n.depth;return l>fp&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,l),i-=l),new hp(s.append(o),i)}remapping(e,t){let n=new St;return this.items.forEach(((t,r)=>{let o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new hp(this.items.append(e.map((e=>new up(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let l=o.maps[r];if(t.step){let i=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(o.slice(a+1,r));c&&s++,n.push(new up(l,i,c))}else n.push(new up(l))}),r);let l=[];for(let e=t;e<i;e++)l.push(new up(o.maps[e]));let c=this.items.slice(0,r).append(l).append(n),d=new hp(c,s);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],o=0;return this.items.forEach(((i,s)=>{if(s>=e)r.push(i),i.selection&&o++;else if(i.step){let e=i.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=i.selection&&i.selection.map(t.slice(n));a&&o++;let l,c=new up(s.invert(),e,a),d=r.length-1;(l=r.length&&r[d].merge(c))?r[d]=l:r.push(c)}}else i.map&&n--}),this.items.length,0),new hp(lp.from(r.reverse()),o)}}hp.empty=new hp(lp.empty,0);class up{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new up(t.getMap().invert(),t,this.selection)}}}class pp{constructor(e,t,n,r,o){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}const fp=20;function mp(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach(((e,n,r,o)=>t.push(r,o)));return t}function gp(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}let xp=!1,yp=null;function vp(e){let t=e.plugins;if(yp!=t){xp=!1,yp=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){xp=!0;break}}return xp}const bp=new Dn("history"),wp=new Dn("closeHistory");function kp(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new En({key:bp,state:{init:()=>new pp(hp.empty,hp.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let o,i=n.getMeta(bp);if(i)return i.historyState;n.getMeta(wp)&&(e=new pp(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(bp))return s.getMeta(bp).redo?new pp(e.done.addTransform(n,void 0,r,vp(t)),e.undone,mp(n.mapping.maps),e.prevTime,e.prevComposition):new pp(e.done,e.undone.addTransform(n,void 0,r,vp(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new pp(e.done.rebased(n,o),e.undone.rebased(n,o),gp(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new pp(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),gp(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let o=n.getMeta("composition"),i=0==e.prevTime||!s&&e.prevComposition!=o&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)})),n}(n,e.prevRanges)),a=s?gp(e.prevRanges,n.mapping):mp(n.mapping.maps);return new pp(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,vp(t)),hp.empty,a,n.time,null==o?e.prevComposition:o)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?Sp:"historyRedo"==n?Cp:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Np(e,t){return(n,r)=>{let o=bp.getState(n);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(r){let i=function(e,t,n){let r=vp(t),o=bp.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),o,r),l=new pp(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(bp,{redo:n,historyState:l})}(o,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}const Sp=Np(!1,!0),Cp=Np(!0,!0);Va.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter((e=>""!==e)).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){const e=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new En({key:new Dn("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const o=this.options.limit;if(null==o||0===o)return void(e=!0);const i=this.storage.characters({node:r.doc});if(i>o){const t=0,n=i-o;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const s=r.tr.deleteRange(t,n);return e=!0,s}e=!0},filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;const r=this.storage.characters({node:t.doc}),o=this.storage.characters({node:e.doc});if(o<=n)return!0;if(r>n&&o>n&&o<=r)return!0;if(r>n&&o>n&&o>r)return!1;if(!e.getMeta("paste"))return!1;const i=e.selection.$head.pos,s=i-(o-n),a=i;e.deleteRange(s,a);return!(this.storage.characters({node:e.doc})>n)}})]}});var Mp=Va.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[Qu(this.options)]}});Va.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new En({key:new Dn("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=t,i=[];if(!n||!r)return vi.create(e,[]);let s=0;"deepest"===this.options.mode&&e.descendants(((e,t)=>{if(e.isText)return;if(!(o>=t&&o<=t+e.nodeSize-1))return!1;s+=1}));let a=0;return e.descendants(((e,t)=>{if(e.isText)return!1;if(!(o>=t&&o<=t+e.nodeSize-1))return!1;a+=1;if("deepest"===this.options.mode&&s-a>0||"shallowest"===this.options.mode&&a>1)return"deepest"===this.options.mode;i.push(gi.node(t,t+e.nodeSize,{class:this.options.className}))})),vi.create(e,i)}}})]}});var jp=Va.create({name:"gapCursor",addProseMirrorPlugins:()=>[new En({props:{decorations:sp,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&ep.valid(n)?new ep(n):null,handleClick:op,handleKeyDown:np,handleDOMEvents:{beforeinput:ip}}})],extendNodeSchema(e){var t;return{allowGapCursor:null!=(t=Js(_s(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))?t:null}}});function Tp({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}Va.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new En({key:new Dn("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,o=[];if(!n)return null;const i=this.editor.isEmpty;return e.descendants(((e,t)=>{const n=r>=t&&r<=t+e.nodeSize,s=!e.isLeaf&&Na(e);if((n||!this.options.showOnlyCurrent)&&s){const r=[this.options.emptyNodeClass];i&&r.push(this.options.emptyEditorClass);const s=gi.node(t,t+e.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:t,hasAnchor:n}):this.options.placeholder});o.push(s)}return this.options.includeChildren})),vi.create(e,o)}}})]}}),Va.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new En({key:new Dn("selection"),props:{decorations:n=>n.selection.empty||e.isFocused||!e.isEditable||Sa(n.selection)||e.view.dragging?null:vi.create(n.doc,[gi.inline(n.selection.from,n.selection.to,{class:t.className})])}})]}});var Ep=Va.create({name:"trailingNode",addOptions:()=>({node:"paragraph",notAfter:[]}),addProseMirrorPlugins(){const e=new Dn(this.name),t=Object.entries(this.editor.schema.nodes).map((([,e])=>e)).filter((e=>(this.options.notAfter||[]).concat(this.options.node).includes(e.name)));return[new En({key:e,appendTransaction:(t,n,r)=>{const{doc:o,tr:i,schema:s}=r,a=e.getState(r),l=o.content.size,c=s.nodes[this.options.node];if(a)return i.insert(l,c.create())},state:{init:(e,n)=>!Tp({node:n.tr.doc.lastChild,types:t}),apply:(e,n)=>{if(!e.docChanged)return n;return!Tp({node:e.doc.lastChild,types:t})}}})]}}),Op=Va.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>Sp(e,t),redo:()=>({state:e,dispatch:t})=>Cp(e,t)}),addProseMirrorPlugins(){return[kp(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Ap=Va.create({name:"starterKit",addExtensions(){var e,t,n,r;const o=[];return!1!==this.options.bold&&o.push(bc.configure(this.options.bold)),!1!==this.options.blockquote&&o.push(Gu.configure(this.options.blockquote)),!1!==this.options.bulletList&&o.push(Cc.configure(this.options.bulletList)),!1!==this.options.code&&o.push(Jc.configure(this.options.code)),!1!==this.options.codeBlock&&o.push(Xc.configure(this.options.codeBlock)),!1!==this.options.document&&o.push(Zc.configure(this.options.document)),!1!==this.options.dropcursor&&o.push(Mp.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&o.push(jp.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&o.push(Yu.configure(this.options.hardBreak)),!1!==this.options.heading&&o.push(td.configure(this.options.heading)),!1!==this.options.undoRedo&&o.push(Op.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&o.push(Xu.configure(this.options.horizontalRule)),!1!==this.options.italic&&o.push(ad.configure(this.options.italic)),!1!==this.options.listItem&&o.push(Mc.configure(this.options.listItem)),!1!==this.options.listKeymap&&o.push(Pc.configure(null==(e=this.options)?void 0:e.listKeymap)),!1!==this.options.link&&o.push(lu.configure(null==(t=this.options)?void 0:t.link)),!1!==this.options.orderedList&&o.push(Vc.configure(this.options.orderedList)),!1!==this.options.paragraph&&o.push(uu.configure(this.options.paragraph)),!1!==this.options.strike&&o.push(gu.configure(this.options.strike)),!1!==this.options.text&&o.push(yu.configure(this.options.text)),!1!==this.options.underline&&o.push(bu.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&o.push(Ep.configure(null==(r=this.options)?void 0:r.trailingNode)),o}});var Dp=function(n){var r=n.message,o=n.description,i=n.type,s=void 0===i?"info":i,a=n.duration,l=void 0===a?5e3:a,c=n.onClose,d=t.useState(!0),h=d[0],u=d[1],p=t.useState(100),f=p[0],m=p[1],g={success:{icon:e.jsx(w,{className:"h-5 w-5"}),bgColor:"bg-green-50",borderColor:"border-green-300",textColor:"text-green-800",iconColor:"text-green-500",progressColor:"bg-green-500"},error:{icon:e.jsx(b,{className:"h-5 w-5"}),bgColor:"bg-rose-50",borderColor:"border-rose-300",textColor:"text-rose-800",iconColor:"text-rose-500",progressColor:"bg-rose-500"},info:{icon:e.jsx(z,{className:"h-5 w-5"}),bgColor:"bg-blue-50",borderColor:"border-blue-300",textColor:"text-blue-800",iconColor:"text-blue-500",progressColor:"bg-blue-500"},warning:{icon:e.jsx(J,{className:"h-5 w-5"}),bgColor:"bg-amber-50 ",borderColor:"border-amber-300 ",textColor:"text-amber-800",iconColor:"text-amber-500",progressColor:"bg-amber-500"}};t.useEffect((function(){var e=setTimeout((function(){u(!1),setTimeout((function(){null==c||c()}),300)}),l),t=setInterval((function(){m((function(e){var t=e-100/(l/100);return t<=0?0:t}))}),100);return function(){clearTimeout(e),clearInterval(t)}}),[l,c]);var x=g[s],y=x.icon,v=x.bgColor,k=x.borderColor,N=x.textColor,S=x.iconColor,C=x.progressColor;return e.jsx("div",{className:"fixed right-4 top-4 z-50 transform transition-all duration-300 ".concat(h?"translate-x-0 opacity-100":"translate-x-full opacity-0"),children:e.jsxs("div",{className:"flex w-72 rounded-lg border shadow-lg md:w-96 ".concat(k," ").concat(v," p-4"),children:[e.jsx("div",{className:"flex-shrink-0 ".concat(S),children:y}),e.jsxs("div",{className:"ml-3 w-full",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("div",{className:"text-md font-semibold ".concat(N),children:r}),e.jsx("button",{onClick:function(){u(!1),setTimeout((function(){null==c||c()}),300)},className:"text-gray-600 hover:text-gray-600 focus:outline-none",children:e.jsx(Q,{className:"h-4 w-4"})})]}),o&&e.jsx("p",{className:"mt-1 text-sm ".concat(N," opacity-80"),children:o}),e.jsx("div",{className:"mt-2 h-1 w-full rounded-full bg-gray-200",children:e.jsx("div",{className:"".concat(C," h-1 rounded-full transition-all duration-100 ease-linear"),style:{width:"".concat(f,"%")}})})]})]})})},Rp=null,Lp=t.createContext(void 0),zp={success:function(e,t){Rp?Rp.success(e,t):console.warn("AlertProvider not mounted yet")},error:function(e,t){Rp?Rp.error(e,t):console.warn("AlertProvider not mounted yet")},info:function(e,t){Rp?Rp.info(e,t):console.warn("AlertProvider not mounted yet")},warning:function(e,t){Rp?Rp.warning(e,t):console.warn("AlertProvider not mounted yet")},show:function(e){Rp?Rp.showAlert(e):console.warn("AlertProvider not mounted yet")}},Ip=function(n){var r=n.isOpen,o=n.onClose,i=n.title,s=n.children,a=n.size,l=void 0===a?"md":a,c=n.position,d=void 0===c?"right":c,h=n.showCloseButton,u=void 0===h||h,p=n.closeOnOverlayClick,f=void 0!==p&&p,m=n.closeOnEscape,g=void 0===m||m,x=n.className,y=void 0===x?"":x,v=n.overlayClassName,b=void 0===v?"":v,w=n.contentClassName,k=void 0===w?"":w,N=n.headerClassName,S=void 0===N?"":N,C=n.footer,M=n.footerClassName,j=void 0===M?"":M,T=n.maxHeight,E=void 0!==T&&T,O=t.useRef(null),A=t.useRef(null);t.useEffect((function(){var e;return r?(A.current=document.activeElement,null===(e=O.current)||void 0===e||e.focus(),document.body.style.overflow="hidden"):(document.body.style.overflow="unset",A.current&&A.current.focus()),function(){document.body.style.overflow="unset"}}),[r]),t.useEffect((function(){var e=function(e){"Escape"===e.key&&g&&o()};return r&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[r,g,o]);var D=function(e){e.target===e.currentTarget&&f&&"full"!==l&&o()};return r?e.jsxs("div",{className:"fixed inset-0 z-50 ".concat(b),role:"dialog","aria-modal":"true","aria-labelledby":i?"modal-title":void 0,children:["full"!==l&&e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm transition-opacity duration-700",onClick:D}),e.jsx("div",{className:"fixed inset-0 flex ".concat("p-0"," ").concat(function(){if("full"===l)return"items-start justify-start";return{left:"items-start justify-start",right:"items-start justify-end",center:"items-center justify-center"}[d]}()),onClick:D,children:e.jsxs("div",{ref:O,tabIndex:-1,className:"\n relative w-full ".concat({xs:"max-w-xs",sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl",full:"w-full h-full"}[l]," bg-white shadow-2xl transform transition-all duration-700 ease-out flex flex-col\n ").concat("full"===l?"h-full max-h-screen overflow-hidden":"left"===d||"right"===d?"h-full ".concat(E?"max-h-screen":""):"".concat(E?"max-h-[90vh] overflow-hidden":""),"\n ").concat("full"===l?"animate-in fade-in-0":"center"===d?"animate-in fade-in-0 zoom-in-95":"left"===d?"animate-in slide-in-from-left-full":"animate-in slide-in-from-right-full","\n ").concat(y,"\n "),onClick:function(e){return e.stopPropagation()},children:[(i||u)&&e.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-gray-200 flex-shrink-0 ".concat(S),children:[i&&e.jsx("h2",{id:"modal-title",className:"text-xl font-semibold text-gray-900 truncate pr-4",children:i}),u&&e.jsx("button",{onClick:o,className:"flex items-center justify-center w-8 h-8 rounded-full text-gray-400 hover:text-gray-600 hover:bg-gray-100 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2","aria-label":"Close modal",children:e.jsx(Q,{size:20})})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto ".concat(E||"full"===l?"overflow-y-auto":""," ").concat(k),children:E&&("left"===d||"right"===d)||"full"===l?e.jsx("div",{className:"p-6 min-h-0 flex-1",children:s}):e.jsx("div",{className:"p-6",children:s})}),C&&e.jsx("div",{className:"px-6 py-4 border-t border-gray-200 flex-shrink-0 ".concat(""," ").concat(j),children:C})]})})]}):null};function Pp(t){var n=t.currentPage,r=t.totalPages,o=t.totalItems,i=t.itemsPerPage,s=t.onPageChange,l=t.onViewChange,c=t.loading,d=void 0!==c&&c,h=function(e){e>0&&e<=r&&!d&&s&&s(e)},u=(n-1)*i,p=Math.min(u+i,o);return e.jsxs("div",{className:"flex items-center justify-between border-t border-gray-200 bg-white py-3",children:[e.jsxs("div",{className:"flex flex-1 justify-between sm:hidden",children:[e.jsx("button",{onClick:function(){return h(n-1)},disabled:1===n||d,className:"relative inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 ".concat(1===n||d?"cursor-not-allowed opacity-50":""),children:"Previous"}),e.jsx("button",{onClick:function(){return h(n+1)},disabled:n===r||d,className:"relative ml-3 inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 ".concat(n===r||d?"cursor-not-allowed opacity-50":""),children:"Next"})]}),e.jsxs("div",{className:"hidden sm:flex sm:flex-1 sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx("select",{value:i,onChange:function(e){return l&&l(e.target.value)},disabled:d,className:"appearance-none rounded-md border border-gray-300 bg-white py-2 pl-3 pr-8 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",children:[10,20,30,50].map((function(t){return e.jsx("option",{value:t,children:t},t)}))}),e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700",children:e.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),e.jsxs("p",{className:"text-sm text-gray-700",children:[e.jsxs("span",{children:[o," Entries"]}),e.jsxs("span",{className:"ml-1",children:["(Showing ",u+1,"-",p," of ",o,")"]})]})]}),e.jsx("div",{children:e.jsxs("nav",{className:"relative z-0 inline-flex gap-2 -space-x-px rounded-md shadow-sm","aria-label":"Pagination",children:[e.jsxs("button",{onClick:function(){return h(n-1)},disabled:1===n||d,className:"relative inline-flex items-center rounded-md border border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-500 hover:bg-gray-50 ".concat(1===n||d?"cursor-not-allowed opacity-50":""),children:[e.jsx("span",{className:"sr-only",children:"Previous"}),e.jsx("svg",{className:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z",clipRule:"evenodd"})})]}),function(){var e=[];if(r<=5)for(var t=1;t<=r;t++)e.push(t);else{var o=Math.max(1,n-2),i=Math.min(r,o+5-1);i-o<4&&(o=Math.max(1,i-5+1));for(t=o;t<=i;t++)e.push(t)}return e}().map((function(t){return e.jsx("button",{onClick:function(){return h(t)},disabled:d,"aria-current":n===t?"page":void 0,className:"relative inline-flex items-center rounded-md border px-4 py-2 text-sm font-semibold ".concat(n===t?"z-10 border-primary-100 bg-primary-50 text-primary":"border-gray-300 bg-white text-gray-500 hover:bg-gray-50"," ").concat(d?"cursor-not-allowed opacity-50":""),children:t},t)})),e.jsxs(a,{onClick:function(){return h(n+1)},disabled:n===r||d,type:"button",variant:"primary",size:"small",outline:!0,children:["Next Page",e.jsx("svg",{className:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})})]})]})})]})]})}function Bp(t){var n=t.columns,r=void 0===n?5:n,o=t.rows,i=void 0===o?3:o;return e.jsx(e.Fragment,{children:Array.from({length:i}).map((function(t,n){return e.jsx("tr",{children:Array.from({length:r}).map((function(t,r){return e.jsx("td",{className:"whitespace-nowrap px-6 py-4",children:e.jsx("div",{className:"h-4 animate-pulse rounded bg-gray-200"})},"skeleton-cell-".concat(n,"-").concat(r))}))},"skeleton-row-".concat(n))}))})}var $p={xs:{width:"4rem",height:"1rem"},sm:{width:"6rem",height:"1.25rem"},md:{width:"8rem",height:"1.5rem"},lg:{width:"12rem",height:"2rem"},xl:{width:"16rem",height:"2.5rem"}},Vp={text:{baseClasses:"rounded",defaultSize:{width:"100%",height:"1rem"}},rectangular:{baseClasses:"",defaultSize:{width:"100%",height:"8rem"}},circular:{baseClasses:"rounded-full aspect-square",defaultSize:{width:"3rem",height:"3rem"}},rounded:{baseClasses:"rounded-lg",defaultSize:{width:"100%",height:"6rem"}},card:{baseClasses:"rounded-lg",defaultSize:{width:"100%",height:"12rem"}},avatar:{baseClasses:"rounded-full aspect-square",defaultSize:{width:"2.5rem",height:"2.5rem"}},button:{baseClasses:"rounded-md",defaultSize:{width:"5rem",height:"2.25rem"}},image:{baseClasses:"rounded",defaultSize:{width:"100%",height:"10rem"}},line:{baseClasses:"rounded-full",defaultSize:{width:"100%",height:"0.25rem"}}},Fp=function(n){var r=n.variant,o=void 0===r?"text":r,i=n.animation,s=void 0===i?"pulse":i,a=n.size,l=n.width,c=n.height,d=n.count,h=void 0===d?1:d,u=n.className,p=void 0===u?"":u,f=n.shimmer,m=void 0!==f&&f,g=n.borderRadius,x=n.intensity,y=void 0===x?"medium":x,v=n.delay,b=void 0===v?0:v,w=t.useState(0===b),k=w[0],N=w[1];t.useEffect((function(){!function(){if("undefined"!=typeof document&&!document.getElementById("skeleton-loader-styles")){var e=document.createElement("style");e.id="skeleton-loader-styles",e.textContent="\n @keyframes wave {\n 0% { transform: translateX(-100%); }\n 50% { transform: translateX(100%); }\n 100% { transform: translateX(100%); }\n }\n\n @keyframes shimmer {\n 0% { background-position: -200% 0; }\n 100% { background-position: 200% 0; }\n }\n\n .skeleton-wave {\n animation: wave 1.6s linear infinite;\n position: relative;\n overflow: hidden;\n }\n\n .skeleton-shimmer {\n animation: shimmer 2s ease-in-out infinite;\n background-size: 200% 100%;\n }\n\n .skeleton-wave::after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: linear-gradient(\n 90deg,\n transparent,\n rgba(255, 255, 255, 0.6),\n transparent\n );\n animation: wave 1.6s linear infinite;\n }\n",document.head.appendChild(e)}}()}),[]);var S=Vp[o],C=t.useMemo((function(){return{width:void 0!==l?"number"==typeof l?"".concat(l,"px"):l:a?$p[a].width:S.defaultSize.width,height:void 0!==c?"number"==typeof c?"".concat(c,"px"):c:a?$p[a].height:S.defaultSize.height}}),[l,c,a,S]);if(t.useEffect((function(){if(b>0){var e=setTimeout((function(){return N(!0)}),b);return function(){return clearTimeout(e)}}}),[b]),!k)return null;var M=function(){var e=["block","bg-gray-200",S.baseClasses];switch("pulse"===s?e.push("animate-pulse"):"wave"===s&&e.push("animate-wave"),y){case"light":e.push("bg-gray-100");break;case"medium":e.push("bg-gray-200");break;case"dark":e.push("bg-gray-300")}return m&&e.push("bg-gradient-to-r","from-gray-200","via-gray-100","to-gray-200","bg-200%","animate-shimmer"),e.join(" ")},j=function(t){return e.jsx("div",{className:"".concat(M()," ").concat(p),style:(n={width:C.width,height:C.height},g&&(n.borderRadius=g),n),"aria-hidden":"true"},t);var n};return h>1?e.jsx("div",{className:"space-y-2",children:Array.from({length:h},(function(e,t){return j(t)}))}):j(0)},Hp=function(t){return e.jsx(Fp,ne({},t,{variant:"text"}))},_p=function(t){return e.jsx(Fp,ne({},t,{variant:"avatar"}))},qp=function(t){return e.jsx(Fp,ne({},t,{variant:"button"}))},Wp=function(t){var n=t.showBio,r=void 0===n||n;return e.jsxs("div",{className:"flex items-start space-x-4",children:[e.jsx(_p,{size:"lg"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(Hp,{width:"60%",height:"1.25rem"}),e.jsx(Hp,{width:"40%",height:"1rem",intensity:"light"}),r&&e.jsxs("div",{className:"space-y-1 pt-2",children:[e.jsx(Hp,{width:"100%"}),e.jsx(Hp,{width:"80%"}),e.jsx(Hp,{width:"90%"})]})]})]})},Kp=function(t){var n=t.itemCount,r=void 0===n?3:n,o=t.showAvatar,i=void 0===o||o,s=t.showMeta,a=void 0===s||s;return e.jsx("div",{className:"space-y-4",children:Array.from({length:r},(function(t,n){return e.jsxs("div",{className:"flex items-start space-x-3",children:[i&&e.jsx(_p,{}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(Hp,{width:"75%",height:"1.125rem"}),e.jsx(Hp,{width:"100%",height:"0.875rem",intensity:"light"}),a&&e.jsxs("div",{className:"flex space-x-4",children:[e.jsx(Hp,{width:"3rem",height:"0.75rem",intensity:"light"}),e.jsx(Hp,{width:"4rem",height:"0.75rem",intensity:"light"})]})]})]},n)}))})},Jp=function(t){var n=t.rows,r=void 0===n?5:n,o=t.columns,i=void 0===o?4:o,s=t.showHeader,a=void 0===s||s;return e.jsxs("div",{className:"space-y-3",children:[a&&e.jsx("div",{className:"flex space-x-4",children:Array.from({length:i},(function(t,n){return e.jsx(Hp,{width:"100%",height:"1rem",intensity:"dark"},n)}))}),e.jsx("div",{className:"space-y-2",children:Array.from({length:r},(function(t,n){return e.jsx("div",{className:"flex space-x-4",children:Array.from({length:i},(function(t,n){return e.jsx(Hp,{width:"100%",height:"0.875rem"},n)}))},n)}))})]})},Up=function(t){var n=t.size,r=void 0===n?"md":n,o=t.variant,i=void 0===o?"pulse":o,s=t.color,a=void 0===s?"primary":s,l=t.fullScreen,c=void 0!==l&&l,d=t.text,h=t.className,u=void 0===h?"":h,p=t.image,f=t.imageEffect,m=void 0===f?"pulse":f,g=a.startsWith("#"),x=function(e){return g?"":{text:"text-".concat(a),bg:"bg-".concat(a),border:"border-".concat(a),borderTop:"border-t-".concat(a),borderRight:"border-r-".concat(a)}[e]||""},y={sm:"w-4 h-4",md:"w-8 h-8",lg:"w-12 h-12",xl:"w-16 h-16"},v={sm:"w-8 h-8",md:"w-12 h-12",lg:"w-16 h-16",xl:"w-20 h-20"},b=function(){switch(m){case"bounce":return"animate-bounce";case"spin":return"animate-spin";case"float":return"animate-pulse hover:animate-bounce";case"heartbeat":return"animate-ping";default:return"animate-pulse"}},w=function(){return e.jsxs("div",{className:"relative flex items-center justify-center",children:[e.jsx("img",{src:p,alt:"Loading",className:"".concat(v[r]," object-contain ").concat(b()),style:{filter:"drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1))",animationDuration:"heartbeat"===m?"1.5s":"bounce"===m?"1s":"2s"}}),"float"===m&&e.jsx("div",{className:"absolute inset-0 ".concat(v[r]," rounded-full bg-gradient-to-r from-purple-400 to-blue-400 opacity-20 animate-ping"),style:{animationDuration:"2s"}})]})},k=function(){return e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"".concat(y[r]," border-4 border-gray-200 rounded-full animate-spin ").concat(g?"":x("borderTop")),style:g?{borderTopColor:a}:{}}),e.jsx("div",{className:"absolute inset-0 ".concat(y[r]," border-4 border-transparent rounded-full animate-spin ").concat(g?"":x("borderRight")),style:g?{borderRightColor:a,animationDirection:"reverse",animationDuration:"0.75s"}:{animationDirection:"reverse",animationDuration:"0.75s"}})]})},N=function(){return e.jsx("div",{className:"flex space-x-1",children:[0,1,2].map((function(t){return e.jsx("div",{className:"".concat("sm"===r?"w-2 h-2":"md"===r?"w-3 h-3":"lg"===r?"w-4 h-4":"w-5 h-5"," rounded-full animate-bounce ").concat(g?"":x("bg")),style:g?{backgroundColor:a,animationDelay:"".concat(.2*t,"s"),animationDuration:"1.4s"}:{animationDelay:"".concat(.2*t,"s"),animationDuration:"1.4s"}},t)}))})},S=function(){return e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"".concat(y[r]," rounded-full animate-pulse ").concat(g?"":x("bg")),style:g?{backgroundColor:a}:{}}),e.jsx("div",{className:"absolute inset-0 ".concat(y[r]," rounded-full animate-ping opacity-30 ").concat(g?"":x("bg")),style:g?{backgroundColor:a}:{}})]})},C=function(){return e.jsx("div",{className:"flex space-x-1 items-end",children:[0,1,2,3].map((function(t){return e.jsx("div",{className:"".concat("sm"===r?"w-1":"md"===r?"w-1.5":"lg"===r?"w-2":"w-2.5"," rounded-sm animate-pulse ").concat(g?"":x("bg")),style:g?{backgroundColor:a,height:"".concat(20+10*t,"px"),animationDelay:"".concat(.15*t,"s"),animationDuration:"1.2s"}:{height:"".concat(20+10*t,"px"),animationDelay:"".concat(.15*t,"s"),animationDuration:"1.2s"}},t)}))})},M=function(){return e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"".concat(y[r]," border-4 rounded-full animate-ping ").concat(g?"":x("border")),style:g?{borderColor:a}:{}}),e.jsx("div",{className:"absolute inset-2 border-4 rounded-full animate-ping ".concat(g?"":x("border")),style:g?{borderColor:a,animationDelay:"0.5s"}:{animationDelay:"0.5s"}})]})},j=e.jsxs("div",{className:"flex flex-col items-center justify-center space-y-3 ".concat(u),children:[function(){if("image"===i&&p)return e.jsx(w,{});switch(i){case"dots":return e.jsx(N,{});case"pulse":return e.jsx(S,{});case"bars":return e.jsx(C,{});case"ripple":return e.jsx(M,{});default:return e.jsx(k,{})}}(),d&&e.jsx("p",{className:"".concat({sm:"text-xs",md:"text-sm",lg:"text-base",xl:"text-lg"}[r]," font-medium animate-pulse ").concat(g?"":x("text")),style:g?{color:a}:{},children:d})]});return c?e.jsx("div",{className:"fixed inset-0 bg-white/80 backdrop-blur-sm flex items-center justify-center z-50",children:j}):j};exports.AlertContext=Lp,exports.AlertProvider=function(n){var r=n.children,o=t.useState([]),i=o[0],s=o[1],a=t.useCallback((function(e){s((function(t){return t.filter((function(t){return t.id!==e}))}))}),[]),l=t.useCallback((function(e){var t=Math.random().toString(36).substring(2,9),n=ne(ne({},e),{id:t,onClose:function(){return a(t)}});s((function(e){return oe(oe([],e,!0),[n],!1)}))}),[a]),c=t.useCallback((function(e){return function(t,n){l({message:t,description:n,type:e})}}),[l]),d={showAlert:l,success:c("success"),error:c("error"),info:c("info"),warning:c("warning")};return Rp=d,e.jsxs(Lp.Provider,{value:d,children:[r,e.jsx("div",{className:"fixed right-4 top-4 z-50 space-y-2 w-full max-w-xs",children:i.map((function(t,n){return e.jsx("div",{style:{transform:"translateY(".concat(10*n,"px)"),zIndex:50-n},children:e.jsx(Dp,ne({},t))},t.id)}))})]})},exports.Badge=function(t){var n=t.children,r=t.variant,o=void 0===r?"default":r,i=t.size,s=void 0===i?"md":i,a=t.className,l=void 0===a?"":a,c=t.onClick,d=["inline-flex items-center font-medium rounded-full transition-colors duration-200",{default:"bg-gray-100 text-gray-800 hover:bg-gray-200",secondary:"bg-blue-100 text-blue-800 hover:bg-blue-200",success:"bg-green-100 text-green-800 hover:bg-green-200",warning:"bg-yellow-100 text-yellow-800 hover:bg-yellow-200",error:"bg-red-100 text-red-800 hover:bg-red-200",info:"bg-cyan-100 text-cyan-800 hover:bg-cyan-200"}[o],{sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base"}[s],c?"cursor-pointer":"",l].filter(Boolean).join(" ");return e.jsx("span",{className:d,onClick:c,role:c?"button":void 0,tabIndex:c?0:void 0,onKeyDown:c?function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),c())}:void 0,children:n})},exports.Breadcrumb=function(t){var n=t.items,r=void 0===n?[]:n,o=t.onBackClick,i=t.showBackButton,s=void 0===i||i,a=t.separator,l=void 0===a?" / ":a,c=t.className,d=void 0===c?"":c;return e.jsxs("div",{className:"flex gap-2 ".concat(d),children:[s&&e.jsx("div",{onClick:o,className:"cursor-pointer",children:e.jsx(y,{className:"text-gray-500 transition-colors hover:text-gray-700"})}),e.jsx("p",{className:"text-gray-400",children:r.map((function(t,n){return e.jsxs("span",{children:[t.isActive?e.jsx("span",{className:"text-primary",children:t.label}):e.jsx("span",{className:t.onClick?"cursor-pointer transition-colors hover:text-gray-600":"",onClick:t.onClick,children:t.label}),n<r.length-1&&l]},n)}))})]})},exports.Button=a,exports.Card=ee,exports.CardStatsSkeleton=function(){return e.jsxs(ee,{children:[e.jsx("div",{className:"mb-4",children:e.jsx(Hp,{width:"180px",height:"28px"})}),e.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-4",children:[e.jsxs("div",{className:"rounded-lg bg-blue-50 p-4",children:[e.jsx(Hp,{width:"40px",height:"32px",className:"mb-1"}),e.jsx(Hp,{width:"100px",height:"16px"})]}),e.jsxs("div",{className:"rounded-lg bg-green-50 p-4",children:[e.jsx(Hp,{width:"40px",height:"32px",className:"mb-1"}),e.jsx(Hp,{width:"110px",height:"16px"})]}),e.jsxs("div",{className:"rounded-lg bg-yellow-50 p-4",children:[e.jsx(Hp,{width:"40px",height:"32px",className:"mb-1"}),e.jsx(Hp,{width:"120px",height:"16px"})]})]})]})},exports.CheckBox=ie,exports.CheckBoxDemo=function(){var n=t.useState("option1"),r=n[0],o=n[1],i=t.useState({terms:!1,newsletter:!0,notifications:!1}),s=i[0],a=i[1];return e.jsx("div",{className:"min-h-screen bg-gray-50 p-8",children:e.jsx("div",{className:"mx-auto max-w-2xl space-y-8",children:e.jsxs("div",{className:"rounded-lg bg-white p-6 shadow",children:[e.jsx("h2",{className:"mb-6 text-xl font-semibold",children:"CheckBox Component Demo"}),e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-medium",children:"Check Variant"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-6",children:[e.jsx(ie,{variant:"check",size:"sm",label:"Small"}),e.jsx(ie,{variant:"check",size:"md",checked:!0,label:"Medium"}),e.jsx(ie,{variant:"check",size:"lg",label:"Large"}),e.jsx(ie,{variant:"check",disabled:!0,label:"Disabled"}),e.jsx(ie,{variant:"check",indeterminate:!0,label:"Indeterminate"})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-medium",children:"Radio Group (Dot Variant)"}),e.jsx(se,{name:"demo-radio",value:r,onChange:o,label:"Choose an option",options:[{value:"option1",label:"Option 1"},{value:"option2",label:"Option 2"},{value:"option3",label:"Option 3"},{value:"option4",label:"Option 4 (Disabled)",disabled:!0}],helperText:"Select one option from the list"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-medium",children:"Toggle Variant"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-6",children:[e.jsx(ie,{variant:"toggle",size:"sm",label:"Small"}),e.jsx(ie,{variant:"toggle",size:"md",checked:!0,label:"Medium"}),e.jsx(ie,{variant:"toggle",size:"lg",label:"Large"}),e.jsx(ie,{variant:"toggle",disabled:!0,label:"Disabled"})]})]}),e.jsxs("div",{className:"space-y-4 border-t pt-6",children:[e.jsx("h3",{className:"font-medium",children:"Sample Form"}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(ie,{variant:"check",checked:s.terms,onChange:function(e){return a(ne(ne({},s),{terms:e}))},label:"I accept the terms and conditions",required:!0,error:s.terms?"":"Please accept terms to continue"}),e.jsx(ie,{variant:"toggle",checked:s.newsletter,onChange:function(e){return a(ne(ne({},s),{newsletter:e}))},label:"Subscribe to newsletter",helperText:"Get updates about new features and releases"}),e.jsx(ie,{variant:"check",checked:s.notifications,onChange:function(e){return a(ne(ne({},s),{notifications:e}))},label:"Enable push notifications"}),e.jsx("div",{className:"pt-4",children:e.jsx("button",{className:"rounded-md bg-primary px-4 py-2 text-white transition-colors hover:bg-primary/90 disabled:opacity-50",disabled:!s.terms,children:"Submit"})})]})]})]})]})})})},exports.ConfirmationAlert=function(n){var r=n.isOpen,o=n.onConfirm,i=n.onCancel,s=n.title,l=n.message,c=n.confirmText,d=void 0===c?"Confirm":c,h=n.cancelText,u=void 0===h?"Cancel":h,p=n.type,f=void 0===p?"default":p,m=n.showIcon,g=void 0===m||m,x=n.showCloseButton,y=void 0===x||x,v=n.closeOnOverlayClick,b=void 0===v||v,N=n.closeOnEscape,S=void 0===N||N,C=n.isLoading,M=void 0!==C&&C,j=n.className,T=void 0===j?"":j,E=n.overlayClassName,O=void 0===E?"":E,A=n.maxWidth,D=void 0===A?"sm":A,R=t.useRef(null),L=t.useRef(null),I=t.useRef(null);t.useEffect((function(){return r?(I.current=document.activeElement,setTimeout((function(){var e,t,n;"danger"===f?null===(t=null===(e=R.current)||void 0===e?void 0:e.querySelector("[data-cancel-button]"))||void 0===t||t.focus():null===(n=L.current)||void 0===n||n.focus()}),100),document.body.style.overflow="hidden"):(document.body.style.overflow="unset",I.current&&I.current.focus()),function(){document.body.style.overflow="unset"}}),[r,f]),t.useEffect((function(){var e=function(e){"Escape"===e.key&&S&&!M&&i()};return r&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[r,S,i,M]);var P=function(){M||i()},B={default:{icon:z,iconColor:"text-blue-600",iconBg:"bg-blue-100",confirmButton:"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500"},danger:{icon:k,iconColor:"text-red-600",iconBg:"bg-red-100",confirmButton:"bg-red-600 hover:bg-red-700 focus:ring-red-500"},warning:{icon:J,iconColor:"text-yellow-600",iconBg:"bg-yellow-100",confirmButton:"bg-yellow-600 hover:bg-yellow-700 focus:ring-yellow-500"},success:{icon:w,iconColor:"text-green-600",iconBg:"bg-green-100",confirmButton:"bg-green-600 hover:bg-green-700 focus:ring-green-500"},info:{icon:z,iconColor:"text-blue-600",iconBg:"bg-blue-100",confirmButton:"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500"}}[f],$=B.icon;return r?e.jsxs("div",{className:"fixed inset-0 z-50 ".concat(O),role:"dialog","aria-modal":"true","aria-labelledby":s?"confirmation-title":void 0,"aria-describedby":"confirmation-message",children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm transition-opacity duration-300",onClick:function(e){e.target===e.currentTarget&&b&&!M&&i()}}),e.jsx("div",{className:"fixed inset-0 flex items-center justify-center p-4",children:e.jsxs("div",{ref:R,className:"relative w-full ".concat({sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"}[D]," animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-4 transform rounded-2xl bg-white shadow-2xl transition-all duration-300 ease-out ").concat(T," "),onClick:function(e){return e.stopPropagation()},children:[y&&e.jsx("button",{onClick:P,disabled:M,className:"absolute right-4 top-4 flex h-8 w-8 items-center justify-center rounded-full text-gray-400 transition-colors duration-200 hover:bg-gray-100 hover:text-gray-600 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50","aria-label":"Close",children:e.jsx(Q,{size:20})}),e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4",children:[g&&e.jsx("div",{className:"h-12 w-12 flex-shrink-0 rounded-full ".concat(B.iconBg," flex items-center justify-center"),children:e.jsx($,{size:24,className:B.iconColor})}),e.jsxs("div",{className:"min-w-0 flex-1 justify-center",children:[s&&e.jsx("h3",{id:"confirmation-title",className:"mb-1 text-center text-lg font-semibold text-gray-900",children:s}),e.jsx("p",{id:"confirmation-message",className:"leading-relaxed text-gray-600",children:l})]})]}),e.jsxs("div",{className:"flex ".concat("justify-center"," mt-6 space-x-3"),children:[e.jsx(a,{variant:"neutral",outline:!0,size:"small","data-cancel-button":"",onClick:P,disabled:M,children:u}),e.jsx("button",{ref:L,onClick:function(){M||o()},disabled:M,className:"flex min-w-[80px] items-center justify-center rounded-xl px-4 py-2 text-sm font-medium text-white transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ".concat(B.confirmButton," "),children:M?e.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"}):d})]})]})]})})]}):null},exports.DateTimePicker=ce,exports.DateTimePickerDemo=function(){var n=t.useState({}),r=n[0],o=n[1],i=t.useState({}),s=i[0],a=i[1],l=t.useState({}),c=l[0],d=l[1],h=t.useState({}),u=h[0],p=h[1];return e.jsxs("div",{className:"max-w-4xl mx-auto p-6 bg-gray-50 min-h-screen",children:[e.jsx("h1",{className:"text-3xl font-bold mb-8 text-gray-900",children:"DateTime Picker Component"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsx(ce,{id:"single-date",label:"Single Date",value:r,onChange:o,placeholder:"Select a date",mode:"date",helpText:"Choose any single date",size:"md"}),e.jsx(ce,{id:"datetime",label:"Date & Time",value:s,onChange:a,placeholder:"Select date and time",mode:"datetime",helpText:"Choose date with specific time",size:"md"})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(ce,{id:"date-range",label:"Date Range",value:c,onChange:d,placeholder:"Select date range",mode:"daterange",helpText:"Choose start and end dates",size:"md"}),e.jsx(ce,{id:"datetime-range",label:"Date & Time Range",value:u,onChange:p,placeholder:"Select date and time range",mode:"datetimerange",helpText:"Choose date range with time",size:"md"})]})]}),e.jsxs("div",{className:"mt-12 grid grid-cols-1 md:grid-cols-2 gap-8",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-800",children:"Single Date:"}),e.jsx("pre",{className:"bg-white p-4 rounded-lg border text-sm overflow-x-auto",children:JSON.stringify(r,null,2)}),e.jsx("h3",{className:"text-lg font-semibold text-gray-800",children:"DateTime:"}),e.jsx("pre",{className:"bg-white p-4 rounded-lg border text-sm overflow-x-auto",children:JSON.stringify(s,null,2)})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-800",children:"Date Range:"}),e.jsx("pre",{className:"bg-white p-4 rounded-lg border text-sm overflow-x-auto",children:JSON.stringify(c,null,2)}),e.jsx("h3",{className:"text-lg font-semibold text-gray-800",children:"DateTime Range:"}),e.jsx("pre",{className:"bg-white p-4 rounded-lg border text-sm overflow-x-auto",children:JSON.stringify(u,null,2)})]})]})]})},exports.EmptyStateCard=te,exports.ExportButton=function(){var n=t.useState(!1),r=n[0],o=n[1],i=t.useRef(null),s=function(e){o(!1)};return t.useEffect((function(){var e=function(e){i.current&&!i.current.contains(e.target)&&o(!1)};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[]),e.jsxs("div",{className:"relative inline-block",ref:i,children:[e.jsxs("div",{className:"flex",children:[e.jsxs("button",{className:"flex items-center rounded-l-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none",onClick:function(){return s(Z.PDF)},children:[e.jsx(S,{className:"mr-2 h-4 w-4"}),"Export"]}),e.jsx("button",{className:"rounded-r-md border border-l-0 border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none",onClick:function(){o(!r)},children:e.jsx(x,{className:"h-4 w-4"})})]}),r&&e.jsx("div",{className:"absolute right-0 z-10 mt-1 w-48 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:e.jsxs("div",{className:"py-1",children:[e.jsxs("button",{onClick:function(){return s(Z.PDF)},className:"flex w-full items-center px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100",children:[e.jsx(O,{className:"mr-2 h-4 w-4"}),"PDF Document"]}),e.jsxs("button",{onClick:function(){return s(Z.CSV)},className:"flex w-full items-center px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100",children:[e.jsx(E,{className:"mr-2 h-4 w-4"}),"CSV Spreadsheet"]}),e.jsxs("button",{onClick:function(){return s(Z.EXCEL)},className:"flex w-full items-center px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100",children:[e.jsx(E,{className:"mr-2 h-4 w-4"}),"Excel Spreadsheet"]})]})})]})},exports.FileUpload=function(n){var r=n.label,o=n.description,i=n.helperText,s=n.error,a=n.success,l=n.disabled,c=void 0!==l&&l,d=n.required,h=void 0!==d&&d,u=n.accept,p=n.multiple,f=void 0!==p&&p,m=n.placeholder,g=n.showProgress,x=void 0===g||g,y=n.className,v=void 0===y?"":y,k=n.id,N=n.maxFileSize,S=n.onFileChange,C=n.existingFiles,M=void 0===C?[]:C,j=n.direction,T=void 0===j?"col":j,E=n.replaceMode,O=re(n,["label","description","helperText","error","success","disabled","required","accept","multiple","placeholder","showProgress","className","id","maxFileSize","onFileChange","existingFiles","direction","replaceMode"]),A=t.useState([]),D=A[0],R=A[1],L=t.useState({}),z=L[0],I=L[1],P=t.useState(!1),B=P[0],$=P[1];null!=E||!f&&M.length;var V=function(e){if(e.target.files&&e.target.files.length>0){var t=Array.from(e.target.files),n=void 0;n=f?oe(oe([],D,!0),t,!0):[t[0]],R(n),x&&t.forEach((function(e){var t="".concat(e.name,"-").concat(e.size);I((function(e){var n;return ne(ne({},e),((n={})[t]=10,n))}));var n=setInterval((function(){I((function(e){var r,o=e[t]||0;return o>=100?(clearInterval(n),e):ne(ne({},e),((r={})[t]=Math.min(o+10,100),r))}))}),300)})),S(n)}},F=function(e){e.preventDefault(),c||$(!0)},H=function(e){e.preventDefault(),$(!1)},_=function(e){if(e.preventDefault(),$(!1),!c&&e.dataTransfer.files&&e.dataTransfer.files.length>0){var t=Array.from(e.dataTransfer.files),n=void 0;n=f?oe(oe([],D,!0),t,!0):[t[0]],R(n),x&&t.forEach((function(e){var t="".concat(e.name,"-").concat(e.size);I((function(e){var n;return ne(ne({},e),((n={})[t]=10,n))}));var n=setInterval((function(){I((function(e){var r,o=e[t]||0;return o>=100?(clearInterval(n),e):ne(ne({},e),((r={})[t]=Math.min(o+10,100),r))}))}),300)})),S(n)}},q=k||"file-upload-".concat(Math.random().toString(36).substr(2,9)),W=function(){if(!f){if(D.length>0){var e=D[0];return{name:e.name,size:e.size,type:e.type,file:e,uploadProgress:z["".concat(e.name,"-").concat(e.size)]||100}}if(M.length>0)return M[0]}return null}();return e.jsxs("div",{className:"space-y-4 ".concat(v),children:[r&&e.jsxs("label",{htmlFor:q,className:"block text-sm font-medium text-gray-700",children:[r,h&&e.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),o&&e.jsx("p",{className:"text-sm text-gray-600",children:o}),!f&&W?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-700",children:D.length>0?"New File":"Current File"}),e.jsx("button",{onClick:function(){var e;null===(e=document.getElementById(q))||void 0===e||e.click()},className:"text-sm text-blue-600 hover:text-blue-800 font-medium",disabled:c,children:"Replace"})]}),e.jsx(ae,{file:W,onDelete:function(){R([]),I({}),S(null)},showUpdate:!1,showView:!0,showDelete:!0,layout:"list",className:"max-w-md"}),e.jsx("input",{id:q,type:"file",className:"hidden",onChange:V,accept:u,disabled:c,required:h})]}):f&&M.length>0?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"mb-4",children:[e.jsxs("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:["Current Files (",M.length,")"]}),M.map((function(t,n){return e.jsx("div",{className:"mb-2",children:e.jsx(ae,{file:t,showDelete:!1,showUpdate:!1,layout:"list"})},t.id||n)}))]}),e.jsxs("div",{className:"\n flex flex-".concat(T," gap-2 rounded-lg border-2 border-dashed p-8 text-center items-center\n ").concat("row"===T?"justify-center":"","\n ").concat(B?"border-blue-400 bg-blue-50":"border-gray-300","\n ").concat(s?"border-red-300 bg-red-50":"","\n ").concat(a?"border-green-300 bg-green-50":"","\n ").concat(c?"opacity-50 cursor-not-allowed bg-gray-50":"cursor-pointer hover:border-gray-400","\n "),onDragOver:F,onDragLeave:H,onDrop:_,onClick:function(){var e;return!c&&(null===(e=document.getElementById(q))||void 0===e?void 0:e.click())},children:[e.jsx(Y,{size:24,className:"text-gray-400"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium ".concat(c?"text-gray-400":"text-blue-600 hover:underline"),children:m||"Add more files"}),e.jsx("p",{className:"text-gray-500 text-sm",children:"or drag and drop"}),e.jsxs("p",{className:"text-sm text-gray-500",children:["(Max. File size: ",N||"25"," MB)"]}),e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Multiple files allowed"})]}),e.jsx("input",ne({id:q,type:"file",className:"hidden",onChange:V,accept:u,multiple:f,disabled:c,required:h},O))]}),D.length>0&&e.jsxs("div",{className:"mt-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("h4",{className:"text-sm font-medium text-gray-700",children:["New Files (",D.length,")"]}),e.jsx("button",{onClick:function(){R([]),I({}),S(null)},className:"text-xs text-red-500 hover:text-red-700",disabled:c,children:"Remove All New Files"})]}),D.map((function(t,n){return e.jsx("div",{className:"mb-2",children:e.jsx(ae,{file:{name:t.name,size:t.size,type:t.type,file:t,uploadProgress:z["".concat(t.name,"-").concat(t.size)]||100},onDelete:function(){var e=D.filter((function(e,t){return t!==n}));R(e),S(e.length>0?e:null)},showUpdate:!1,showView:!1,layout:"list"})},"".concat(t.name,"-").concat(t.size))}))]})]}):e.jsxs("div",{className:"\n flex flex-".concat(T," gap-2 rounded-lg border-2 border-dashed p-8 text-center items-center\n ").concat("row"===T?"justify-center":"","\n ").concat(B?"border-blue-400 bg-blue-50":"border-gray-300","\n ").concat(s?"border-red-300 bg-red-50":"","\n ").concat(a?"border-green-300 bg-green-50":"","\n ").concat(c?"opacity-50 cursor-not-allowed bg-gray-50":"cursor-pointer hover:border-gray-400","\n "),onDragOver:F,onDragLeave:H,onDrop:_,onClick:function(){var e;return!c&&(null===(e=document.getElementById(q))||void 0===e?void 0:e.click())},children:[e.jsx(Y,{size:24,className:"text-gray-400"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium ".concat(c?"text-gray-400":"text-blue-600 hover:underline"),children:m||(!f&&M.length>0?"Replace file":M.length>0?"Add more files":"Click to Upload")}),e.jsx("p",{className:"text-gray-500 text-sm",children:"or drag and drop"}),e.jsxs("p",{className:"text-sm text-gray-500",children:["(Max. File size: ",N||"25"," MB)"]}),f?e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Multiple files allowed"}):e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Single file only"})]}),e.jsx("input",{id:q,type:"file",className:"hidden",onChange:V,accept:u,multiple:f,disabled:c,required:h})]}),i&&!s&&!a&&e.jsx("p",{className:"text-sm text-gray-500",children:i}),s&&e.jsxs("div",{className:"flex items-center text-red-600 text-sm",children:[e.jsx(b,{size:16,className:"mr-1"}),s]}),a&&e.jsxs("div",{className:"flex items-center text-green-600 text-sm",children:[e.jsx(w,{size:16,className:"mr-1"}),a]})]})},exports.FileView=ae,exports.Input=function(t){var n=t.id,r=t.label,o=t.value,i=t.size,s=void 0===i?"md":i,a=t.onChange,l=t.placeholder,c=t.error,d=t.required,h=void 0!==d&&d,u=t.helpText,p=t.type,f=void 0===p?"text":p,m=t.className,g=void 0===m?"":m,x=t.disabled,y=void 0!==x&&x,v=t.icon,b=t.iconPosition,w=void 0===b?"left":b,k=t.rightIcon,N=t.block,S=re(t,["id","label","value","size","onChange","placeholder","error","required","helpText","type","className","disabled","icon","iconPosition","rightIcon","block"]),C={id:n,value:o,onChange:function(e){a&&a(e)},placeholder:l,disabled:y,className:"w-full rounded-[12px] border ".concat({sm:"text-xs px-3 py-1.5 text-sm min-h-[32px]",md:"text-sm px-4 py-2 text-base min-h-[40px]",lg:"text-base px-4 py-3 text-lg min-h-[48px]"}[s]," ").concat(c?"border-red-500":"border-gray-200"," ").concat(y?"bg-gray-100 text-gray-500 placeholder-gray-300":"bg-gray-100 placeholder-gray-400 text-dark"," focus:outline-none focus:ring-1 focus:ring-primary ").concat(g," ").concat(v&&"left"===w?"pl-10":""," ").concat(v&&"right"===w?"pr-10":""),"aria-invalid":!!c,"aria-describedby":c?"".concat(n,"-error"):u?"".concat(n,"-help"):void 0};return e.jsxs("div",{className:"mb-4 ".concat(N&&"w-full"),children:[r&&e.jsxs("label",{htmlFor:n,className:"mb-1 block text-sm font-medium text-gray-600",children:[r,h&&e.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),e.jsxs("div",{className:"relative",children:[v&&"left"===w&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",children:v}),"textarea"==f?e.jsx("textarea",ne({},C,{rows:4,className:"".concat(C.className," resize-none")},S)):e.jsx("input",ne({},C,{type:f},S)),v&&"right"===w&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:v}),k&&e.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer",children:k})]}),u&&!c&&e.jsx("p",{id:"".concat(n,"-help"),className:"mt-1 text-sm text-gray-500",children:u}),c&&e.jsx("p",{id:"".concat(n,"-error"),className:"mt-1 text-sm text-red-500",children:c})]})},exports.InputWithPrefix=function(t){var n=t.id,r=t.label,o=t.value,i=t.size,s=void 0===i?"md":i,a=t.onChange,l=t.placeholder,c=t.error,d=t.required,h=void 0!==d&&d,u=t.helpText,p=t.type,f=void 0===p?"text":p,m=t.className,g=void 0===m?"":m,x=t.disabled,y=void 0!==x&&x,v=t.icon,b=t.iconPosition,w=void 0===b?"left":b,k=t.rightIcon,N=t.prefixContent,S=t.prefixClassName,C=void 0===S?"":S;t.onPrefixChange;var M,j,T=re(t,["id","label","value","size","onChange","placeholder","error","required","helpText","type","className","disabled","icon","iconPosition","rightIcon","prefixContent","prefixClassName","onPrefixChange"]),E="\n flex-1 rounded-none rounded-r-[12px] border-l-0 ".concat({sm:"text-xs py-1.5 text-sm min-h-[32px]",md:"text-sm py-2 text-base min-h-[40px]",lg:"text-base py-3 text-lg min-h-[48px]"}[s]," \n ").concat(c?"border-red-500":"border-gray-200","\n ").concat(y?"bg-gray-100 text-gray-500 placeholder-gray-300":"bg-gray-100 placeholder-gray-400 text-dark","\n focus:outline-none\n ").concat((M="",j="",v&&"left"===w&&(M="pl-10"),v&&"right"===w&&(j="pr-10"),k&&(j="pr-10"),"".concat(M," ").concat(j)),"\n ").concat(g,"\n "),O="\n flex items-center rounded-l-[12px] border border-r-0 ".concat({sm:"px-1 text-xs",md:"px-2 text-sm",lg:"px-4 text-base"}[s],"\n ").concat(c?"border-red-500":"border-gray-200","\n ").concat(y?"bg-gray-50":"","\n ").concat(C,"\n "),A={id:n,value:o,onChange:function(e){a&&a(e)},placeholder:l,disabled:y,className:E,"aria-invalid":!!c,"aria-describedby":c?"".concat(n,"-error"):u?"".concat(n,"-help"):void 0};return e.jsxs("div",{className:"mb-4",children:[r&&e.jsxs("label",{htmlFor:n,className:"mb-1 block text-sm font-medium text-gray-600",children:[r,h&&e.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),e.jsx("div",{className:"relative",children:e.jsxs("div",{className:"flex",children:[N&&e.jsx("div",{className:O,children:N}),e.jsxs("div",{className:"relative ".concat(N?"flex-1":"w-full"),children:[v&&"left"===w&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 z-10",children:v}),e.jsx("input",ne({},A,{type:f,className:"".concat(A.className," ").concat(N?"w-full border px-3":"rounded-l-[12px] border-l")},T)),v&&"right"===w&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 z-10",children:v}),k&&e.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer z-10",children:k})]})]})}),u&&!c&&e.jsx("p",{id:"".concat(n,"-help"),className:"mt-1 text-sm text-gray-500",children:u}),c&&e.jsx("p",{id:"".concat(n,"-error"),className:"mt-1 text-sm text-red-500",children:c})]})},exports.Loading=Up,exports.LoadingDemo=function(){var n=t.useState("blue-500"),r=n[0],o=n[1],i=t.useState("spinner"),s=i[0],a=i[1],l=t.useState("md"),c=l[0],d=l[1],h=t.useState(!1),u=h[0],p=h[1],f=["spinner","dots","pulse","bars","ripple"];return e.jsxs("div",{className:"p-8 max-w-4xl mx-auto",children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-800 mb-8 text-center",children:"Modern Loading Component"}),e.jsxs("div",{className:"bg-white rounded-xl shadow-lg p-6 mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-700 mb-4",children:"Customization"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-600 mb-2",children:"Color"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:[{name:"Blue",value:"blue-500",hex:"#3B82F6"},{name:"Purple",value:"purple-500",hex:"#8B5CF6"},{name:"Green",value:"green-500",hex:"#10B981"},{name:"Red",value:"red-500",hex:"#EF4444"},{name:"Orange",value:"orange-500",hex:"#F59E0B"},{name:"Pink",value:"pink-500",hex:"#EC4899"},{name:"Indigo",value:"indigo-500",hex:"#6366F1"},{name:"Teal",value:"teal-500",hex:"#14B8A6"}].map((function(t){return e.jsx("button",{onClick:function(){return o(t.value)},className:"w-8 h-8 rounded-full border-2 transition-all ".concat(r===t.value?"border-gray-400 scale-110":"border-gray-200"),style:{backgroundColor:t.hex},title:"".concat(t.name," (").concat(t.value,")")},t.value)}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-600 mb-2",children:"Variant"}),e.jsx("select",{value:s,onChange:function(e){return a(e.target.value)},className:"w-full p-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:f.map((function(t){return e.jsx("option",{value:t,children:t&&(null==t?void 0:t.charAt(0).toUpperCase())+(null==t?void 0:t.slice(1))},t)}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-600 mb-2",children:"Size"}),e.jsx("select",{value:c,onChange:function(e){return d(e.target.value)},className:"w-full p-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:["sm","md","lg","xl"].map((function(t){return e.jsx("option",{value:t,children:null==t?void 0:t.toUpperCase()},t)}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-600 mb-2",children:"Full Screen"}),e.jsx("button",{onClick:function(){return p(!0)},className:"w-full p-2 bg-gray-600 text-white rounded-md hover:bg-gray-700 transition-colors",children:"Demo Full Screen"})]})]}),e.jsxs("div",{className:"bg-gray-50 rounded-lg p-8 flex flex-col items-center justify-center min-h-32",children:[e.jsx(Up,{variant:s,size:c,color:r,text:"Loading..."}),e.jsx("div",{className:"mt-4 p-3 bg-white rounded-md shadow-sm",children:e.jsxs("code",{className:"text-sm text-gray-600",children:['color="',r,'"']})})]})]}),e.jsxs("div",{className:"bg-white rounded-xl shadow-lg p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-700 mb-4",children:"All Variants"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-6",children:f.map((function(t){return e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"bg-gray-50 rounded-lg p-4 flex items-center justify-center h-24 mb-2",children:e.jsx(Up,{variant:t,color:r})}),e.jsx("p",{className:"text-sm text-gray-600 capitalize",children:t})]},t)}))}),e.jsxs("div",{className:"mt-6 p-4 bg-blue-50 rounded-lg",children:[e.jsx("h3",{className:"font-semibold text-blue-800 mb-2",children:"Usage Examples:"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"bg-white p-2 rounded border",children:[e.jsx("code",{className:"text-blue-600",children:"// Tailwind CSS class"}),e.jsx("br",{}),e.jsx("code",{children:'<Loading color="primary-500" />'})]}),e.jsxs("div",{className:"bg-white p-2 rounded border",children:[e.jsx("code",{className:"text-blue-600",children:"// Hex color"}),e.jsx("br",{}),e.jsx("code",{children:'<Loading color="#your-brand-color" />'})]}),e.jsxs("div",{className:"bg-white p-2 rounded border",children:[e.jsx("code",{className:"text-blue-600",children:"// Custom Tailwind color"}),e.jsx("br",{}),e.jsx("code",{children:'<Loading color="emerald-400" variant="dots" />'})]})]})]})]}),u&&e.jsx(Up,{variant:s,size:c,color:r,text:"Loading in full screen...",fullScreen:!0}),u&&e.jsx("button",{onClick:function(){return p(!1)},className:"fixed top-4 right-4 z-50 bg-red-500 text-white px-4 py-2 rounded-md hover:bg-red-600 transition-colors",children:"Close Full Screen"})]})},exports.Modal=Ip,exports.ModalExample=function(){var n=t.useState(!1),r=n[0],o=n[1],i=t.useState("left"),s=i[0],a=i[1],l=t.useState("md"),c=l[0],d=l[1],h=e.jsxs("div",{className:"flex justify-end space-x-3",children:[e.jsx("button",{onClick:function(){return o(!1)},className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors duration-200",children:"Cancel"}),e.jsx("button",{onClick:function(){return o(!1)},className:"px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors duration-200",children:"Save Changes"})]});return e.jsxs("div",{className:"p-8 space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap gap-4 mb-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Position"}),e.jsxs("select",{value:s,onChange:function(e){return a(e.target.value)},className:"border border-gray-300 rounded-md px-3 py-2 text-sm",disabled:"full"===c,children:[e.jsx("option",{value:"left",children:"Left"}),e.jsx("option",{value:"right",children:"Right"}),e.jsx("option",{value:"center",children:"Center"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Size"}),e.jsxs("select",{value:c,onChange:function(e){return d(e.target.value)},className:"border border-gray-300 rounded-md px-3 py-2 text-sm",children:[e.jsx("option",{value:"xs",children:"Extra Small"}),e.jsx("option",{value:"sm",children:"Small"}),e.jsx("option",{value:"md",children:"Medium"}),e.jsx("option",{value:"lg",children:"Large"}),e.jsx("option",{value:"xl",children:"Extra Large"}),e.jsx("option",{value:"2xl",children:"2X Large"}),e.jsx("option",{value:"full",children:"Full Screen"})]})]})]}),e.jsx("button",{onClick:function(){return o(!0)},className:"px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors duration-200 font-medium",children:"Open Modal"}),e.jsx(Ip,{isOpen:r,onClose:function(){return o(!1)},title:"Example Modal",size:c,position:s,footer:h,maxHeight:"center"!==s,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-gray-600",children:"This is an example of the multipurpose modal component. It supports different sizes, positions, and configurations."}),e.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[e.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Features:"}),e.jsxs("ul",{className:"text-sm text-gray-600 space-y-1 list-disc list-inside",children:[e.jsx("li",{children:"Multiple sizes (xs, sm, md, lg, xl, 2xl, full screen)"}),e.jsx("li",{children:"Three positions (left, right, center)"}),e.jsx("li",{children:"Customizable styling with className props"}),e.jsx("li",{children:"Keyboard navigation and accessibility"}),e.jsx("li",{children:"Click outside to close (disabled for full screen)"}),e.jsx("li",{children:"Smooth animations"}),e.jsx("li",{children:"Optional footer with actions"}),e.jsx("li",{children:"Full screen mode without margins or border radius"})]})]}),("left"===s||"right"===s||"full"===c)&&e.jsx("div",{className:"space-y-2",children:Array.from({length:20},(function(t,n){return e.jsxs("p",{className:"text-gray-600",children:["This is paragraph ",n+1," to demonstrate scrolling in side panels","full"===c?" and full screen mode":"","."]},n)}))})]})})]})},exports.Pagination=Pp,exports.RadioGroup=se,exports.SKELETON_LOADER_VERSION="1.0.0",exports.SKELETON_PATTERNS={userProfile:{variant:"avatar",size:"lg",animation:"pulse"},cardTitle:{variant:"text",width:"75%",height:"1.5rem"},cardDescription:{variant:"text",count:2,width:"100%",height:"1rem",intensity:"light"},button:{variant:"button",animation:"wave"},image:{variant:"image",shimmer:!0}},exports.SKELETON_PRESETS={sizes:{xs:{width:"4rem",height:"1rem"},sm:{width:"6rem",height:"1.25rem"},md:{width:"8rem",height:"1.5rem"},lg:{width:"12rem",height:"2rem"},xl:{width:"16rem",height:"2.5rem"}},variants:["text","rectangular","circular","rounded","card","avatar","button","image","line"],animations:["pulse","wave","none"],intensities:["light","medium","dark"]},exports.Search=function(n){var r=n.placeholder,o=void 0===r?"Search...":r,i=n.onSearch,s=n.className,a=void 0===s?"":s,l=t.useState(""),c=l[0],d=l[1];return e.jsxs("div",{className:"relative ".concat(a),children:[e.jsx("input",{type:"text",value:c,onChange:function(e){e.preventDefault(),d(e.target.value),i(c)},placeholder:o,className:"w-full rounded-lg border border-gray-200 bg-white py-2 pl-8 pr-4 text-sm focus:outline-none focus:ring-1 focus:ring-primary"}),e.jsxs("svg",{className:"absolute left-2 top-1/2 -translate-y-1/2 transform text-gray-400",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})]})},exports.Select=function(n){var r,o=n.options,i=n.placeholder,s=void 0===i?"Select an option":i,a=n.onChange,l=n.value,c=n.size,d=void 0===c?"md":c,h=n.className,u=void 0===h?"":h,p=n.name,f=n.id,m=n.disabled,g=void 0!==m&&m,y=n.label,v=n.required,b=n.error,w=n.helpText,k=n.fullWidth,N=void 0===k||k,S=n.searchable,C=void 0!==S&&S,M=n.multiple,j=void 0!==M&&M,T=n.maxSelected,E=n.showSelectedCount,O=void 0!==E&&E,A=n.closeOnSelect,D=n.showSelectAll,R=void 0===D||D,L=t.useState(!1),z=L[0],I=L[1],P=t.useState(""),B=P[0],$=P[1],V=t.useState("bottom"),F=V[0],H=V[1],_=void 0!==A?A:!j,q=t.useState((function(){if(!l)return[];if(j&&Array.isArray(l))return l.map((function(e){return o.find((function(t){return t.value==e}))})).filter(Boolean);if(!j){var e=o.find((function(e){return e.value==l}));return e?[e]:[]}return[]})),W=q[0],K=q[1],J=t.useRef(null),U=t.useRef(null);t.useEffect((function(){if(j&&Array.isArray(l))K(l.map((function(e){return o.find((function(t){return t.value==e}))})).filter(Boolean));else if(j)""!==l&&null!==l&&null!=l||K([]);else{var e=o.find((function(e){return e.value==l}));K(e?[e]:[])}}),[l,o,j]),t.useEffect((function(){if(z&&J.current){var e=J.current.getBoundingClientRect(),t=window.innerHeight-e.bottom,n=e.top;H(t<250&&n>250?"top":"bottom")}}),[z]);var G=C?o.filter((function(e){return(e.label||e.value).toLowerCase().includes(B.toLowerCase())})):o;t.useEffect((function(){var e=function(e){J.current&&!J.current.contains(e.target)&&(I(!1),$(""))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[]);var Y="top"===F?"bottom-full mb-1":"top-full mt-1";return e.jsxs("div",{ref:J,className:"".concat(N?"w-full":"w-fit"," mb-4"),children:[y&&e.jsxs("label",{htmlFor:f,className:"mb-1 block text-sm font-medium text-gray-700",children:[y,v&&e.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",className:"flex items-center justify-between rounded-lg border ".concat(b?"border-red-500":"border-gray-200"," bg-gray-100 shadow-sm ").concat({sm:"text-xs px-3 py-1.5 text-sm min-h-[32px]",md:"text-sm px-4 py-2 text-base min-h-[40px]",lg:"text-base px-4 py-3 text-lg min-h-[48px]"}[d]," text-gray-700 hover:border-gray-300 focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500/20 ").concat(g?"cursor-not-allowed bg-gray-50 opacity-50":""," ").concat(u," ").concat(N?"w-full":""," transition-all duration-200"),onClick:function(){return!g&&I(!z)},disabled:g,id:f,"aria-haspopup":"listbox","aria-expanded":z,children:[e.jsx("div",{className:"flex-1 flex items-center gap-1 min-w-0",children:j&&W.length>0?e.jsxs("div",{className:"flex flex-wrap gap-1 flex-1",children:[W.slice(0,3).map((function(t){return e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-primary-100 text-primary-800 text-sm rounded-md",children:[e.jsx("span",{className:"truncate max-w-[120px]",children:t.label||t.value}),e.jsx(Q,{className:"h-3 w-3 cursor-pointer hover:text-primary-900",onClick:function(e){return function(e,t){t.stopPropagation();var n=W.filter((function(t){return t.value!==e.value}));K(n);var r=j?n.map((function(e){return e.value})):"";a({target:{id:f||"",value:r}})}(t,e)}})]},t.value)})),W.length>3&&e.jsxs("span",{className:"text-sm text-gray-500 px-1",children:["+",W.length-3," more"]})]}):e.jsx("span",{className:"truncate ".concat(0===W.length?"text-gray-400":"text-gray-700"),children:function(){var e,t,n,r;return 0===W.length?s:j?O&&W.length>2?"".concat(W.length," items selected"):W.length<=2?W.map((function(e){return e.label||e.value})).join(", "):"".concat((null===(n=W[0])||void 0===n?void 0:n.label)||(null===(r=W[0])||void 0===r?void 0:r.value)," +").concat(W.length-1," more"):(null===(e=W[0])||void 0===e?void 0:e.label)||(null===(t=W[0])||void 0===t?void 0:t.value)}()})}),e.jsx(x,{className:"ml-2 h-4 w-4 text-gray-400 transition-transform flex-shrink-0 ".concat(z?"rotate-180 transform":"")})]}),z&&e.jsxs("div",{ref:U,className:"absolute z-[9999] w-full rounded-lg border border-gray-200 bg-white shadow-xl ".concat(Y),role:"listbox",style:{zIndex:9999,position:"absolute"},children:[C&&e.jsx("div",{className:"sticky top-0 border-b border-gray-100 bg-white p-3 z-[10000]",children:e.jsx("input",{type:"text",className:"w-full rounded-md border border-gray-200 px-3 py-2 text-sm focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500/20 transition-all duration-200",placeholder:"Search...",value:B,onChange:function(e){return $(e.target.value)},autoFocus:!0})}),e.jsx("div",{className:"max-h-60 overflow-auto py-1",children:G.length>0?e.jsxs(e.Fragment,{children:[j&&R&&e.jsxs("div",{className:"border-b border-gray-100",children:[e.jsxs("div",{className:"px-3 py-2 flex items-center justify-between",children:[e.jsx("button",{type:"button",onClick:function(){if(j){var e,t=G.filter((function(e){return!e.disabled}));if(t.every((function(e){return W.some((function(t){return t.value===e.value}))})))e=W.filter((function(e){return!t.some((function(t){return t.value===e.value}))}));else{var n=t.filter((function(e){return!W.some((function(t){return t.value===e.value}))}));if(void 0!==T){var r=T-W.length;e=oe(oe([],W,!0),n.slice(0,r),!0)}else e=oe(oe([],W,!0),n,!0)}K(e);var o=e.map((function(e){return e.value}));a({target:{id:f||"",value:o}})}},className:"text-sm font-medium text-primary-600 hover:text-primary-700 transition-colors",children:function(){if(!j||0===G.length)return!1;var e=G.filter((function(e){return!e.disabled}));return e.length>0&&e.every((function(e){return W.some((function(t){return t.value===e.value}))}))}()?"Deselect All":"Select All"}),W.length>0&&e.jsx("button",{type:"button",onClick:function(){j&&(K([]),a({target:{id:f||"",value:[]}}))},className:"text-sm font-medium text-gray-500 hover:text-gray-700 transition-colors",children:"Clear All"})]}),W.length>0&&e.jsxs("div",{className:"px-3 pb-2 text-xs text-gray-500",children:[W.length," selected",T&&" of ".concat(T," max")]})]}),G.map((function(t){var n=function(e){return W.some((function(t){return t.value===e.value}))}(t),r=t.disabled||void 0!==T&&!n&&W.length>=T;return e.jsxs("div",{className:"cursor-pointer px-3 py-2 flex items-center justify-between transition-colors duration-150 ".concat(n?"bg-primary-50 text-primary-700":"text-gray-700 hover:bg-gray-50"," ").concat(r?"cursor-not-allowed text-gray-400 hover:bg-white opacity-50":""),onClick:function(){return!r&&function(e){var t;if(!e.disabled){var n;if(j)if(W.some((function(t){return t.value===e.value})))n=W.filter((function(t){return t.value!==e.value}));else{if(T&&W.length>=T)return;n=oe(oe([],W,!0),[e],!1)}else n=[e];K(n);var r=j?n.map((function(e){return e.value})):(null===(t=n[0])||void 0===t?void 0:t.value)||"";a({target:{id:f||"",value:r}}),_&&(I(!1),$(""))}}(t)},role:"option","aria-selected":n,"aria-disabled":r,children:[e.jsx("span",{className:"flex-1 text-sm font-medium",children:t.label||t.value}),j&&n&&e.jsx("div",{className:"w-4 h-4 bg-primary-500 rounded-sm flex items-center justify-center",children:e.jsx("svg",{className:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]},t.value)}))]}):e.jsx("div",{className:"px-3 py-2 text-gray-500 text-center",children:"No options found"})})]})]}),b&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:b}),w&&!b&&e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:w}),p&&e.jsx(e.Fragment,{children:j?W.map((function(t,n){return e.jsx("input",{type:"hidden",name:"".concat(p,"[]"),value:t.value},"".concat(t.value,"-").concat(n))})):e.jsx("input",{type:"hidden",name:p,value:(null===(r=W[0])||void 0===r?void 0:r.value)||""})})]})},exports.SelectButton=function(n){var r=n.options,o=n.placeholder,i=void 0===o?"Select an option":o,s=n.onChange,a=n.value,l=n.size,c=void 0===l?"md":l,d=n.className,h=void 0===d?"":d,u=n.name,p=n.id,f=n.disabled,m=void 0!==f&&f,y=n.label,v=n.required,b=t.useState(!1),w=b[0],k=b[1],N=t.useState(a&&r.find((function(e){return e.value===a}))||null),S=N[0],C=N[1];return e.jsxs("div",{className:"relative inline-block",children:[y&&e.jsxs("label",{htmlFor:p,className:"mb-1 block text-sm font-medium text-gray-700",children:[y,v&&e.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between rounded-md border border-gray-200 bg-white shadow-sm ".concat({sm:"px-3 py-2 text-sm",md:"px-4 py-2.5 text-base"}[c]," text-gray-700 hover:bg-gray-50 focus:outline-none ").concat(m?"cursor-not-allowed opacity-50":""," ").concat(h),onClick:function(){return!m&&k(!w)},disabled:m,id:p,children:[e.jsx("span",{className:"truncate",children:S?(null==S?void 0:S.label)||S.value:i}),e.jsx(x,{className:"ml-2 h-4 w-4 ".concat(w?"rotate-180 transform":"")})]}),w&&e.jsx("div",{className:"absolute z-10 mt-1 max-h-60 w-full min-w-[200px] p-1 font-medium text-sm overflow-auto rounded-lg bg-white shadow-xl",children:r.map((function(t){return e.jsxs("div",{className:"cursor-pointer px-3 py-2 hover:bg-gray-100 rounded-lg flex justify-between item-center ".concat((null==S?void 0:S.value)===t.value?"bg-gray-50 text-black":"text-gray-900"),onClick:function(){return function(e){C(e),s(e.value),k(!1)}(t)},children:[e.jsx("div",{children:t.label||t.value}),(null==S?void 0:S.value)===t.value&&e.jsx("div",{children:e.jsx(g,{size:15,className:"text-primary"})})]},t.value)}))}),u&&e.jsx("input",{type:"hidden",name:u,value:(null==S?void 0:S.value)||""})]})},exports.SkeletonAvatar=_p,exports.SkeletonButton=qp,exports.SkeletonCard=function(t){return e.jsx(Fp,ne({},t,{variant:"card"}))},exports.SkeletonImage=function(t){return e.jsx(Fp,ne({},t,{variant:"image"}))},exports.SkeletonList=Kp,exports.SkeletonLoader=Fp,exports.SkeletonLoaderExample=function(){return e.jsxs("div",{className:"bg-white p-5",children:[e.jsx(Fp,{variant:"text",width:"200px"}),e.jsx(Fp,{variant:"text",count:3}),e.jsx(_p,{size:"lg"}),e.jsx(qp,{animation:"wave"}),e.jsx(Wp,{showBio:!0}),e.jsx(Kp,{itemCount:5,showAvatar:!0}),e.jsx(Jp,{rows:5,columns:4}),e.jsx(Fp,{variant:"card",shimmer:!0,intensity:"dark",borderRadius:"12px",className:"custom-skeleton"})]})},exports.SkeletonProfile=Wp,exports.SkeletonTable=Jp,exports.SkeletonText=Hp,exports.Table=function(n){var r=n.data,o=n.columns,i=n.itemsPerPage,s=void 0===i?20:i,a=n.onViewChange,l=n.totalItems,c=n.currentPage,d=void 0===c?1:c,h=n.onPageChange,u=n.loading,p=void 0!==u&&u,f=n.showPagination,m=void 0===f||f,g=n.onRowClick,y=n.useCardLayout,b=void 0!==y&&y,w=n.emptyState,k=n.expandableRows,N=void 0!==k&&k,S=n.expandedRowRender,C=n.onRowToggle,M=n.defaultExpandedRows,j=void 0===M?new Set:M,T=n.getRowKey,E=void 0===T?function(e,t){return t}:T,O=n.paginationMeta,A=t.useState(j),D=A[0],R=A[1],L=(null==O?void 0:O.total)||l||r.length,z=(null==O?void 0:O.last_page)||Math.ceil(L/s),I=(null==O?void 0:O.current_page)||d,P=(null==O?void 0:O.per_page)||s,B=r,$=function(e,t){N&&S?V(e,t):g&&g(e)},V=function(e,t){var n=E(e,t),r=new Set(D),o=D.has(n);o?r.delete(n):r.add(n),R(r),C&&C(e,!o)},F=function(e,t){var n=E(e,t);return D.has(n)},H=e.jsx(te,{title:"No Record found"}),_=function(){return e.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",children:[p&&Array.from({length:P}).map((function(t,n){return e.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-4 animate-pulse",children:e.jsx("div",{className:"space-y-3",children:o.slice(0,3).map((function(t,n){return e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/3"}),e.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/2"})]},n)}))})},n)})),B.length>0?B.map((function(t,n){var r=F(t,n);return e.jsxs("div",{className:"bg-white rounded-lg border border-gray-200",children:[e.jsx("div",{onClick:function(){return $(t,n)},className:"p-4 transition-all duration-200 hover:shadow-md hover:border-gray-300 ".concat(g||N?"cursor-pointer":""," ").concat(p?"opacity-50":""," ").concat(N?"border-b border-gray-100 last:border-b-0":""),children:e.jsxs("div",{className:"space-y-3",children:[N&&e.jsx("div",{className:"flex items-center justify-between mb-2",children:e.jsxs("div",{className:"flex items-center text-sm text-gray-500",children:[r?e.jsx(x,{size:16,className:"mr-1"}):e.jsx(v,{size:16,className:"mr-1"}),e.jsx("span",{children:r?"Hide details":"Show details"})]})}),o.map((function(n,r){return e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-500 flex-shrink-0 mr-3",children:[n.title,":"]}),e.jsx("span",{className:"text-sm text-gray-800 text-right",children:"function"==typeof n.value?n.value(t):t[n.value]})]},r)}))]})}),N&&r&&S&&e.jsx("div",{className:"p-4 bg-gray-50 border-t border-gray-100 rounded-b-lg",children:S(t)})]},n)})):!p&&e.jsx("div",{className:"col-span-full",children:w||H})]})};return e.jsxs(e.Fragment,{children:[b?_():e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block",children:e.jsx("div",{className:"relative overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[N&&e.jsx("th",{className:"bg-gray-100 px-6 py-3 text-left text-sm font-semibold tracking-wider text-gray-500 w-12 rounded-bl-xl rounded-tl-xl"}),o.map((function(t,n){return e.jsx("th",{className:"bg-gray-100 px-6 py-3 text-left text-sm font-semibold tracking-wider text-gray-500 ".concat(t.width||""," ").concat(N||0!==n?"":"rounded-bl-xl rounded-tl-xl"," ").concat(n===o.length-1?"rounded-br-xl rounded-tr-xl":""," "),children:t.title},n)}))]})}),e.jsxs("tbody",{className:"divide-y divide-gray-200 bg-white\n ".concat(p?"opacity-50":""," ").concat(g||N?"cursor-pointer":"","\n "),children:[p&&e.jsx(Bp,{columns:o.length+(N?1:0),rows:P}),B.length>0?B.map((function(t,n){var r=F(t,n);return e.jsxs(e.Fragment,{children:[e.jsxs("tr",{onClick:function(){return $(t,n)},className:"hover:bg-gray-50 transition-colors duration-150 ".concat(r?"bg-blue-50":""),children:[N&&e.jsx("td",{className:"whitespace-nowrap px-6 py-4 text-sm font-medium text-gray-800",children:e.jsx("div",{className:"flex items-center justify-center",children:r?e.jsx(x,{size:16,className:"text-gray-500"}):e.jsx(v,{size:16,className:"text-gray-500"})})}),o.map((function(n,r){return e.jsx("td",{className:"whitespace-nowrap px-6 py-4 text-sm font-medium text-gray-800",children:"function"==typeof n.value?n.value(t):t[n.value]},r)}))]},n),N&&r&&S&&e.jsx("tr",{className:"bg-gray-50",children:e.jsx("td",{colSpan:o.length+1,className:"px-6 py-4",children:e.jsx("div",{className:"animate-fade-in",children:S(t)})})},"".concat(n,"-expanded"))]})})):!p&&e.jsx("tr",{children:e.jsx("td",{colSpan:o.length+(N?1:0),className:"px-6 py-12 text-center",children:w||H})})]})]})})}),e.jsx("div",{className:"block md:hidden",children:_()})]}),m&&e.jsx(Pp,{currentPage:I,totalPages:z,totalItems:L,itemsPerPage:P,onPageChange:h,onViewChange:a,loading:p})]})},exports.TableDropdown=function(r){var o=r.actions,i=r.trigger,s=r.className,a=void 0===s?"":s,l=r.dropdownClassName,c=void 0===l?"":l,d=t.useState(!1),h=d[0],u=d[1],p=t.useState({top:0,left:0}),f=p[0],m=p[1],g=t.useRef(null),x=t.useRef(null),y=function(){u(!h)},v=function(){u(!1)};t.useEffect((function(){if(h&&x.current){var e=x.current.getBoundingClientRect(),t=window.innerHeight-e.bottom,n=e.top;m({top:t<300&&n>t?e.top-300+window.scrollY:e.bottom+window.scrollY,left:e.right-192+window.scrollX})}}),[h]),t.useEffect((function(){var e=function(e){g.current&&!g.current.contains(e.target)&&x.current&&!x.current.contains(e.target)&&v()};return h&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[h]),t.useEffect((function(){var e=function(e){"Escape"===e.key&&v()};return h&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[h]),t.useEffect((function(){var e=function(){if(h&&x.current){var e=x.current.getBoundingClientRect(),t=window.innerHeight-e.bottom,n=e.top;m({top:t<300&&n>t?e.top-300+window.scrollY:e.bottom+window.scrollY,left:e.right-192+window.scrollX})}};return h&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}}),[h]);var b=h&&e.jsx("div",{ref:g,className:"fixed z-[9999] w-48 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none ".concat(c),style:{top:"".concat(f.top,"px"),left:"".concat(f.left,"px")},children:e.jsxs("div",{className:"py-1",role:"menu","aria-orientation":"vertical",children:[o.map((function(t,n){return e.jsxs("button",{className:"flex w-full items-center px-4 py-2 text-left text-sm transition-colors duration-150 ".concat(t.disabled?"cursor-not-allowed bg-gray-50 text-gray-400":"danger"===t.variant?"text-red-700 hover:bg-red-50 hover:text-red-900":"text-gray-700 hover:bg-gray-100 hover:text-gray-900"," "),onClick:function(){return function(e){e.disabled||(e.onClick(),v())}(t)},disabled:t.disabled,role:"menuitem",children:[t.icon&&e.jsx("span",{className:"mr-3 flex-shrink-0",children:t.icon}),t.label]},n)})),0===o.length&&e.jsx("div",{className:"px-4 py-2 text-sm text-gray-500",children:"No actions available"})]})});return e.jsxs("div",{className:"relative inline-block ".concat(a),children:[e.jsx("div",{ref:x,className:"flex",children:i?e.jsx("div",{onClick:y,className:"cursor-pointer",children:i}):e.jsx("button",{className:"rounded-md border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-700 transition-colors duration-200 focus:ring-offset-2",onClick:y,"aria-expanded":h,"aria-haspopup":"true",children:e.jsx(C,{className:"h-4 w-4"})})}),"undefined"!=typeof document&&b&&n.createPortal(b,document.body)]})},exports.TableSkeleton=Bp,exports.TagInput=le,exports.TagInputDemo=function(){var n=t.useState([]),r=n[0],o=n[1],i=t.useState([]),s=i[0],a=i[1];return e.jsxs("div",{className:"max-w-2xl mx-auto p-6 bg-gray-50 min-h-screen",children:[e.jsx("h1",{className:"text-2xl font-bold mb-8 text-gray-900",children:"TagInput Component Demo"}),e.jsxs("div",{className:"space-y-8",children:[e.jsx(le,{id:"skills",label:"Skills & Technologies",value:r,onChange:o,predefinedTags:[{label:"React",value:"react"},{label:"JavaScript",value:"javascript"},{label:"TypeScript",value:"typescript"},{label:"Node.js",value:"nodejs"},{label:"Python",value:"python"},{label:"CSS",value:"css"},{label:"HTML",value:"html"},{label:"Vue.js",value:"vuejs"},{label:"Angular",value:"angular"},{label:"Next.js",value:"nextjs"}],placeholder:"Search or add skills...",helpText:"Select from predefined options or add your own custom tags",size:"md"}),e.jsx(le,{id:"custom-tags",label:"Project Categories (Custom Colors)",value:s,onChange:a,predefinedTags:[{label:"Web Development",value:"web"},{label:"Mobile App",value:"mobile"},{label:"AI/ML",value:"ai"},{label:"UI/UX Design",value:"design"}],placeholder:"Add project categories...",tagBackgroundColor:"bg-purple-500",tagTextColor:"text-white",maxTags:5,size:"lg",helpText:"Maximum 5 tags allowed with custom purple styling"}),e.jsxs("div",{className:"mt-8 p-4 bg-white rounded-lg border",children:[e.jsx("h3",{className:"font-medium mb-2",children:"Selected Skills:"}),e.jsx("pre",{className:"text-sm bg-gray-100 p-2 rounded",children:JSON.stringify(r,null,2)})]}),e.jsxs("div",{className:"p-4 bg-white rounded-lg border",children:[e.jsx("h3",{className:"font-medium mb-2",children:"Selected Categories:"}),e.jsx("pre",{className:"text-sm bg-gray-100 p-2 rounded",children:JSON.stringify(s,null,2)})]})]})]})},exports.TextEditor=function(t){var n=t.initialContent,r=void 0===n?"":n,o=t.onUpdate,i=Ku({extensions:[Ap.configure({heading:!1,codeBlock:!1}),ed,pu,vu,wc,ld,wu,xu,Uc,Qc.configure({HTMLAttributes:{class:"bg-gray-100 p-3 rounded text-sm font-mono"}}),nd.configure({levels:[1,2,3]}),qc,hu,du,cu.configure({openOnClick:!1,HTMLAttributes:{class:"text-blue-600 underline"}})],content:r,onUpdate:function(e){var t=e.editor;o(t.getHTML())},editorProps:{attributes:{class:"prose prose-sm sm:prose lg:prose-lg xl:prose-2xl mx-auto focus:outline-none min-h-[200px] p-4"}},immediatelyRender:!1});return i?e.jsxs("div",{className:"rounded-lg border border-gray-200 shadow-sm",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1 border-b bg-gray-50 p-3",children:[e.jsx("button",{onClick:function(){return i.chain().focus().undo().run()},className:"p-2 rounded hover:bg-gray-200 transition-colors ".concat(i.can().undo()?"":"opacity-50 cursor-not-allowed"),type:"button",disabled:!i.can().undo(),title:"Undo",children:e.jsx(G,{size:16})}),e.jsx("button",{onClick:function(){return i.chain().focus().redo().run()},className:"p-2 rounded hover:bg-gray-200 transition-colors ".concat(i.can().redo()?"":"opacity-50 cursor-not-allowed"),type:"button",disabled:!i.can().redo(),title:"Redo",children:e.jsx(_,{size:16})}),e.jsx("div",{className:"mx-2 h-6 w-px bg-gray-300"}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleHeading({level:1}).run()},className:"p-2 rounded transition-colors ".concat(i.isActive("heading",{level:1})?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Heading 1",children:e.jsx(D,{size:16})}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleHeading({level:2}).run()},className:"p-2 rounded transition-colors ".concat(i.isActive("heading",{level:2})?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Heading 2",children:e.jsx(R,{size:16})}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleHeading({level:3}).run()},className:"p-2 rounded transition-colors ".concat(i.isActive("heading",{level:3})?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Heading 3",children:e.jsx(L,{size:16})}),e.jsx(q,{className:"mx-2 h-6 w-px bg-gray-300"}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleBold().run()},className:"p-2 rounded transition-colors ".concat(i.isActive("bold")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Bold",children:e.jsx(m,{size:16})}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleItalic().run()},className:"p-2 rounded transition-colors ".concat(i.isActive("italic")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Italic",children:e.jsx(I,{size:16})}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleUnderline().run()},className:"p-2 rounded transition-colors ".concat(i.isActive("underline")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Underline",children:e.jsx(U,{size:16})}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleStrike().run()},className:"p-2 rounded transition-colors ".concat(i.isActive("strike")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Strikethrough",children:e.jsx(W,{size:16})}),e.jsx(q,{className:"mx-2 h-6 w-px bg-gray-300"}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleBulletList().run()},className:"p-2 rounded transition-colors ".concat(i.isActive("bulletList")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Bullet List",children:e.jsx($,{size:16})}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleOrderedList().run()},className:"p-2 rounded transition-colors ".concat(i.isActive("orderedList")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Numbered List",children:e.jsx(B,{size:16})}),e.jsx(q,{className:"mx-2 h-6 w-px bg-gray-300"}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleCode().run()},className:"p-2 rounded transition-colors ".concat(i.isActive("code")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Inline Code",children:e.jsx(N,{size:16})}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleCodeBlock().run()},className:"p-2 rounded transition-colors ".concat(i.isActive("codeBlock")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Code Block",children:e.jsx(j,{size:16})}),e.jsx(q,{className:"mx-2 h-6 w-px bg-gray-300"}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleBlockquote().run()},className:"p-2 rounded transition-colors ".concat(i.isActive("blockquote")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Quote",children:e.jsx(H,{size:16})}),e.jsx(q,{className:"mx-2 h-6 w-px bg-gray-300"}),i.isActive("link")?e.jsx("button",{onClick:function(){null==i||i.chain().focus().unsetLink().run()},className:"p-2 rounded bg-blue-200 text-blue-800 hover:bg-blue-300 transition-colors",type:"button",title:"Remove Link",children:e.jsx(P,{size:16})}):e.jsx("button",{onClick:function(){var e=window.prompt("Enter URL:");e&&(null==i||i.chain().focus().setLink({href:e}).run())},className:"p-2 rounded hover:bg-gray-200 transition-colors",type:"button",title:"Add Link",children:e.jsx(P,{size:16})})]}),e.jsx($u,{editor:i,className:"min-h-[300px] focus-within:bg-white"})]}):e.jsx("div",{className:"rounded-lg border bg-gray-50 h-48 animate-pulse"})},exports.Tooltip=function(n){var r=n.children,o=n.content,i=n.position,s=void 0===i?"top":i,a=n.variant,l=void 0===a?"light":a,c=n.size,d=void 0===c?"md":c,h=n.delay,u=void 0===h?200:h,p=n.disabled,f=void 0!==p&&p,m=n.className,g=void 0===m?"":m,x=t.useState(!1),y=x[0],v=x[1],b=t.useState(s),w=b[0],k=b[1],N=t.useRef(null),S=t.useRef(null),C=t.useRef(null);t.useEffect((function(){if(y&&S.current&&C.current){var e=S.current,t=C.current.getBoundingClientRect(),n=e.getBoundingClientRect(),r=s;"top"===s&&t.top-n.height<10?r="bottom":"bottom"===s&&t.bottom+n.height>window.innerHeight-10?r="top":"left"===s&&t.left-n.width<10?r="right":"right"===s&&t.right+n.width>window.innerWidth-10&&(r="left"),k(r)}}),[y,s]);var M=function(){f||(N.current&&clearTimeout(N.current),N.current=setTimeout((function(){v(!0)}),u))},j=function(){N.current&&clearTimeout(N.current),v(!1)};t.useEffect((function(){return function(){N.current&&clearTimeout(N.current)}}),[]);var T={dark:{tooltip:"bg-gray-900 text-white border-gray-700",arrow:{top:"border-t-gray-900",bottom:"border-b-gray-900",left:"border-l-gray-900",right:"border-r-gray-900"}},light:{tooltip:"bg-white text-gray-900 border-gray-200 shadow-lg",arrow:{top:"border-t-white",bottom:"border-b-white",left:"border-l-white",right:"border-r-white"}},accent:{tooltip:"bg-blue-600 text-white border-blue-500",arrow:{top:"border-t-blue-600",bottom:"border-b-blue-600",left:"border-l-blue-600",right:"border-r-blue-600"}}};return f||!o?e.jsx(e.Fragment,{children:r}):e.jsxs("div",{className:"relative inline-block",children:[e.jsx("div",{ref:C,onMouseEnter:M,onMouseLeave:j,onFocus:M,onBlur:j,className:"cursor-help",children:r}),y&&e.jsxs("div",{ref:S,className:"absolute z-50 ".concat({top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"}[w]," ").concat(T[l].tooltip," ").concat({sm:"px-2 py-1 text-xs",md:"px-3 py-2 text-sm",lg:"px-4 py-3 text-base"}[d]," animate-in fade-in-0 zoom-in-95 max-w-xs whitespace-nowrap break-words rounded-lg border font-medium backdrop-blur-sm duration-200 ").concat(g," "),role:"tooltip","aria-hidden":"false",children:[o,e.jsx("div",{className:"absolute h-0 w-0 border-4 ".concat({top:"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent",bottom:"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent",left:"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent",right:"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent"}[w]," ").concat(T[l].arrow[w]," ")})]})]})},exports.alert=zp,exports.useAlert=function(){var e=t.useContext(Lp);if(void 0===e)throw new Error("useAlert must be used within a AlertProvider");return e};
|
|
50
|
+
*/"production"===process.env.NODE_ENV?Ou.exports=function(){if(Mu)return Au;Mu=1;var e=t,n=ju,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Au.useSyncExternalStoreWithSelector=function(e,t,n,c,d){var h=i(null);if(null===h.current){var u={hasValue:!1,value:null};h.current=u}else u=h.current;h=a((function(){function e(e){if(!s){if(s=!0,o=e,e=c(e),void 0!==d&&u.hasValue){var t=u.value;if(d(t,e))return i=t}return i=e}if(t=i,r(o,e))return t;var n=c(e);return void 0!==d&&d(t,n)?(o=e,t):(o=e,i=n)}var o,i,s=!1,a=void 0===n?null:n;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]}),[t,n,c,d]);var p=o(e,h[0],h[1]);return s((function(){u.hasValue=!0,u.value=p}),[p]),l(p),p},Au}():Ou.exports=(Du||(Du=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=t,n=ju,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;Ru.useSyncExternalStoreWithSelector=function(e,t,n,c,d){var h=i(null);if(null===h.current){var u={hasValue:!1,value:null};h.current=u}else u=h.current;h=a((function(){function e(e){if(!s){if(s=!0,o=e,e=c(e),void 0!==d&&u.hasValue){var t=u.value;if(d(t,e))return i=t}return i=e}if(t=i,r(o,e))return t;var n=c(e);return void 0!==d&&d(t,n)?(o=e,t):(o=e,i=n)}var o,i,s=!1,a=void 0===n?null:n;return[function(){return e(t())},null===a?void 0:function(){return e(a())}]}),[t,n,c,d]);var p=o(e,h[0],h[1]);return s((function(){u.hasValue=!0,u.value=p}),[p]),l(p),p},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Ru);var Lu=Ou.exports,zu=(...e)=>t=>{e.forEach((e=>{"function"==typeof e?e(t):e&&(e.current=t)}))},Iu=({contentComponent:t})=>{const n=ju.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return e.jsx(e.Fragment,{children:Object.values(n)})};var Pu=class extends t.Component{constructor(e){var n;super(e),this.editorContentRef=t.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:Boolean(null==(n=e.editor)?void 0:n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=function(){const e=new Set;let t={};return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),getSnapshot:()=>t,getServerSnapshot:()=>t,setRenderer(r,o){t={...t,[r]:n.createPortal(o.reactElement,o.element,r)},e.forEach((e=>e()))},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach((e=>e()))}}}(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe((()=>{this.setState((e=>e.hasContentComponentInitialized?e:{hasContentComponentInitialized:!0})),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()}))),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var e;const t=this.props.editor;if(!t)return;if(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null,!(null==(e=t.options.element)?void 0:e.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,innerRef:n,...r}=this.props;return e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:zu(n,this.editorContentRef),...r}),(null==t?void 0:t.contentComponent)&&e.jsx(Iu,{contentComponent:t.contentComponent})]})}},Bu=t.forwardRef(((e,n)=>{const r=t.useMemo((()=>Math.floor(4294967295*Math.random()).toString()),[e.editor]);return t.createElement(Pu,{key:r,innerRef:n,...e})})),$u=t.memo(Bu),Vu="undefined"!=typeof window?t.useLayoutEffect:t.useEffect,Fu=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach((e=>e()))},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}};var Hu="production"!==process.env.NODE_ENV,_u="undefined"==typeof window,qu=_u||Boolean("undefined"!=typeof window&&window.next),Wu=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach((e=>e()))}getInitialEditor(){if(void 0===this.options.current.immediatelyRender){if(_u||qu){if(Hu)throw new Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");return null}return this.createEditor()}if(this.options.current.immediatelyRender&&_u&&Hu)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBeforeCreate)?void 0:n.call(t,...e)},onBlur:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBlur)?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onCreate)?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDestroy)?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null==(n=(t=this.options.current).onFocus)?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onSelectionUpdate)?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null==(n=(t=this.options.current).onTransaction)?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onUpdate)?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null==(n=(t=this.options.current).onContentError)?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDrop)?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null==(n=(t=this.options.current).onPaste)?void 0:n.call(t,...e)},onDelete:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDelete)?void 0:n.call(t,...e)}};return new cc(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every((n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every(((e,n)=>{var r;return e===(null==(r=t.extensions)?void 0:r[n])})):e[n]===t[n])))}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps)return void(this.previousDeps=e);if(this.previousDeps.length===e.length&&this.previousDeps.every(((t,n)=>t===e[n])))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout((()=>{this.isComponentMounted&&this.instanceId===e?t&&t.setOptions(this.options.current):t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))}),1)}};function Ku(e={},n=[]){const r=t.useRef(e);r.current=e;const[o]=t.useState((()=>new Wu(r))),i=ju.useSyncExternalStore(o.subscribe,o.getEditor,o.getServerSnapshot);return t.useDebugValue(i),t.useEffect(o.onRender(n)),function(e){var n;const[r]=t.useState((()=>new Fu(e.editor))),o=Lu.useSyncExternalStoreWithSelector(r.subscribe,r.getSnapshot,r.getServerSnapshot,e.selector,null!=(n=e.equalityFn)?n:Eu);Vu((()=>r.watch(e.editor)),[e.editor,r]),t.useDebugValue(o)}({editor:i,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction||void 0===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),i}t.createContext({editor:null}).Consumer;var Ju=t.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}});t.forwardRef(((n,r)=>{const{onDragStart:o}=t.useContext(Ju),i=n.as||"div";return e.jsx(i,{...n,ref:r,"data-node-view-wrapper":"",onDragStart:o,style:{whiteSpace:"normal",...n.style}})})),t.createContext({markViewContentRef:()=>{}});var Uu=/^\s*>\s$/,Gu=pc.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return mc("blockquote",{...Ys(this.options.HTMLAttributes,e),children:mc("slot",{})})},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[uc({find:Uu,type:this.type})]}}),Yu=pc.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",Ys(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command((()=>{const{selection:e,storedMarks:o}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:s}=r.extensionManager,a=o||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command((({tr:e,dispatch:t})=>{if(t&&a&&i){const t=a.filter((e=>s.includes(e.type.name)));e.ensureMarks(t)}return!0})).run()}))])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Xu=pc.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",Ys(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!function(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof gn){const e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let o=r.depth;for(;o>=0;){const e=r.index(o);if(r.node(o).contentMatchAt(e).matchType(t))return!0;o-=1}return!1}(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$to:r}=n,o=e();return Sa(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command((({tr:e,dispatch:t})=>{var n;if(t){const{$to:t}=e.selection,r=t.end();if(t.nodeAfter)t.nodeAfter.isTextblock?e.setSelection(fn.create(e.doc,t.pos+1)):t.nodeAfter.isBlock?e.setSelection(gn.create(e.doc,t.pos)):e.setSelection(fn.create(e.doc,t.pos));else{const o=null==(n=t.parent.type.contentMatch.defaultType)?void 0:n.create();o&&(e.insert(r,o),e.setSelection(fn.create(e.doc,r+1)))}e.scrollIntoView()}return!0})).run()}}},addInputRules(){return[(e={find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type},new Ta({find:e.find,handler:({state:t,range:n,match:r})=>{const o=Js(e.getAttributes,void 0,r)||{},{tr:i}=t,s=n.from;let a=n.to;const l=e.type.create(o);if(r[1]){let e=s+r[0].lastIndexOf(r[1]);e>a?e=a:a=e+r[1].length;const t=r[0][r[0].length-1];i.insertText(t,s+r[0].length-1),i.replaceWith(e,a,l)}else if(r[0]){const t=e.type.isInline?s:s-1;i.insert(t,e.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()}}))];var e}});function Qu(e={}){return new En({view:t=>new Zu(t,e)})}class Zu{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=t.width)&&void 0!==n?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map((t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))}destroy(){this.handlers.forEach((({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t)))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r=this.editorView.dom,o=r.getBoundingClientRect(),i=o.width/r.offsetWidth,s=o.height/r.offsetHeight;if(n){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(t){let o=t.getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let a=this.width/2*s;e={left:o.left,right:o.right,top:i-a,bottom:i+a}}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos),n=this.width/2*i;e={left:t.left-n,right:t.left+n,top:t.top,bottom:t.bottom}}let a,l,c=this.editorView.dom.offsetParent;if(this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!c||c==document.body&&"static"==getComputedStyle(c).position)a=-pageXOffset,l=-pageYOffset;else{let e=c.getBoundingClientRect(),t=e.width/c.offsetWidth,n=e.height/c.offsetHeight;a=e.left-c.scrollLeft*t,l=e.top-c.scrollTop*n}this.element.style.left=(e.left-a)/i+"px",this.element.style.top=(e.top-l)/s+"px",this.element.style.width=(e.right-e.left)/i+"px",this.element.style.height=(e.bottom-e.top)/s+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,t,e):r;if(t&&!o){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=Jt(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class ep extends dn{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return ep.valid(n)?new ep(n):dn.near(n)}content(){return ve.empty}eq(e){return e instanceof ep&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new ep(e.resolve(t.pos))}getBookmark(){return new tp(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&ep.valid(e))return e;let r=e.pos,o=null;for(let n=e.depth;;n--){let i=e.node(n);if(t>0?e.indexAfter(n)<i.childCount:e.index(n)>0){o=i.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(ep.valid(s))return s}for(;;){let i=t>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!gn.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*t),n=!1;continue e}break}o=i,r+=t;let s=e.doc.resolve(r);if(ep.valid(s))return s}return null}}}ep.prototype.visible=!1,ep.findFrom=ep.findGapCursorFrom,dn.jsonID("gapcursor",ep);class tp{constructor(e){this.pos=e}map(e){return new tp(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return ep.valid(t)?new ep(t):dn.near(t)}}const np=as({ArrowLeft:rp("horiz",-1),ArrowRight:rp("horiz",1),ArrowUp:rp("vert",-1),ArrowDown:rp("vert",1)});function rp(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){let i=e.selection,s=t>0?i.$to:i.$from,a=i.empty;if(i instanceof fn){if(!o.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=ep.findGapCursorFrom(s,t,a);return!!l&&(r&&r(e.tr.setSelection(new ep(l))),!0)}}function op(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!ep.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&gn.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new ep(r))),!0)}function ip(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof ep))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=pe.empty;for(let e=r.length-1;e>=0;e--)o=pe.from(r[e].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new ve(o,0,0));return i.setSelection(fn.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function sp(e){if(!(e.selection instanceof ep))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",vi.create(e.doc,[gi.widget(e.selection.head,t,{key:"gapcursor"})])}var ap=200,lp=function(){};lp.prototype.append=function(e){return e.length?(e=lp.from(e),!this.length&&e||e.length<ap&&this.leafAppend(e)||this.length<ap&&e.leafPrepend(this)||this.appendInner(e)):this},lp.prototype.prepend=function(e){return e.length?lp.from(e).append(this):this},lp.prototype.appendInner=function(e){return new dp(this,e)},lp.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?lp.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},lp.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},lp.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},lp.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},lp.from=function(e){return e instanceof lp?e:e&&e.length?new cp(e):lp.empty};var cp=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=ap)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=ap)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(lp);lp.empty=new cp([]);var dp=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var o=this.left.length;return!(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r))&&(!(n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,r))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(lp);class hp{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--){if(this.items.get(o-1).selection){--o;break}}t&&(n=this.remapping(o,this.items.length),r=n.maps.length);let i,s,a=e.tr,l=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(o,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new up(e.map));let t,o=e.step.map(n.slice(r));o&&a.maybeStep(o).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new up(t,void 0,void 0,l.length+c.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(i=n?e.selection.map(n.slice(r)):e.selection,s=new hp(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(e,t,n,r){let o=[],i=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<e.steps.length;n++){let l,c=e.steps[n].invert(e.docs[n]),d=new up(e.mapping.maps[n],c,t);(l=a&&a.merge(d))&&(d=l,n?o.pop():s=s.slice(0,s.length-1)),o.push(d),t&&(i++,t=void 0),r||(a=d)}let l=i-n.depth;return l>fp&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,l),i-=l),new hp(s.append(o),i)}remapping(e,t){let n=new St;return this.items.forEach(((t,r)=>{let o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new hp(this.items.append(e.map((e=>new up(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=o.getMirror(--a);if(null==r)return;i=Math.min(i,r);let l=o.maps[r];if(t.step){let i=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(o.slice(a+1,r));c&&s++,n.push(new up(l,i,c))}else n.push(new up(l))}),r);let l=[];for(let e=t;e<i;e++)l.push(new up(o.maps[e]));let c=this.items.slice(0,r).append(l).append(n),d=new hp(c,s);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],o=0;return this.items.forEach(((i,s)=>{if(s>=e)r.push(i),i.selection&&o++;else if(i.step){let e=i.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=i.selection&&i.selection.map(t.slice(n));a&&o++;let l,c=new up(s.invert(),e,a),d=r.length-1;(l=r.length&&r[d].merge(c))?r[d]=l:r.push(c)}}else i.map&&n--}),this.items.length,0),new hp(lp.from(r.reverse()),o)}}hp.empty=new hp(lp.empty,0);class up{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new up(t.getMap().invert(),t,this.selection)}}}class pp{constructor(e,t,n,r,o){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}const fp=20;function mp(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach(((e,n,r,o)=>t.push(r,o)));return t}function gp(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}let xp=!1,yp=null;function vp(e){let t=e.plugins;if(yp!=t){xp=!1,yp=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){xp=!0;break}}return xp}const bp=new Dn("history"),wp=new Dn("closeHistory");function kp(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new En({key:bp,state:{init:()=>new pp(hp.empty,hp.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let o,i=n.getMeta(bp);if(i)return i.historyState;n.getMeta(wp)&&(e=new pp(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(bp))return s.getMeta(bp).redo?new pp(e.done.addTransform(n,void 0,r,vp(t)),e.undone,mp(n.mapping.maps),e.prevTime,e.prevComposition):new pp(e.done,e.undone.addTransform(n,void 0,r,vp(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new pp(e.done.rebased(n,o),e.undone.rebased(n,o),gp(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new pp(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),gp(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let o=n.getMeta("composition"),i=0==e.prevTime||!s&&e.prevComposition!=o&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)})),n}(n,e.prevRanges)),a=s?gp(e.prevRanges,n.mapping):mp(n.mapping.maps);return new pp(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,vp(t)),hp.empty,a,n.time,null==o?e.prevComposition:o)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?Sp:"historyRedo"==n?Cp:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Np(e,t){return(n,r)=>{let o=bp.getState(n);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(r){let i=function(e,t,n){let r=vp(t),o=bp.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),o,r),l=new pp(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(bp,{redo:n,historyState:l})}(o,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}const Sp=Np(!1,!0),Cp=Np(!0,!0);Va.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter((e=>""!==e)).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){const e=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{const t=(null==e?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new En({key:new Dn("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const o=this.options.limit;if(null==o||0===o)return void(e=!0);const i=this.storage.characters({node:r.doc});if(i>o){const t=0,n=i-o;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const s=r.tr.deleteRange(t,n);return e=!0,s}e=!0},filterTransaction:(e,t)=>{const n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;const r=this.storage.characters({node:t.doc}),o=this.storage.characters({node:e.doc});if(o<=n)return!0;if(r>n&&o>n&&o<=r)return!0;if(r>n&&o>n&&o>r)return!1;if(!e.getMeta("paste"))return!1;const i=e.selection.$head.pos,s=i-(o-n),a=i;e.deleteRange(s,a);return!(this.storage.characters({node:e.doc})>n)}})]}});var Mp=Va.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[Qu(this.options)]}});Va.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new En({key:new Dn("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=t,i=[];if(!n||!r)return vi.create(e,[]);let s=0;"deepest"===this.options.mode&&e.descendants(((e,t)=>{if(e.isText)return;if(!(o>=t&&o<=t+e.nodeSize-1))return!1;s+=1}));let a=0;return e.descendants(((e,t)=>{if(e.isText)return!1;if(!(o>=t&&o<=t+e.nodeSize-1))return!1;a+=1;if("deepest"===this.options.mode&&s-a>0||"shallowest"===this.options.mode&&a>1)return"deepest"===this.options.mode;i.push(gi.node(t,t+e.nodeSize,{class:this.options.className}))})),vi.create(e,i)}}})]}});var jp=Va.create({name:"gapCursor",addProseMirrorPlugins:()=>[new En({props:{decorations:sp,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&ep.valid(n)?new ep(n):null,handleClick:op,handleKeyDown:np,handleDOMEvents:{beforeinput:ip}}})],extendNodeSchema(e){var t;return{allowGapCursor:null!=(t=Js(_s(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))?t:null}}});function Tp({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}Va.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new En({key:new Dn("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,o=[];if(!n)return null;const i=this.editor.isEmpty;return e.descendants(((e,t)=>{const n=r>=t&&r<=t+e.nodeSize,s=!e.isLeaf&&Na(e);if((n||!this.options.showOnlyCurrent)&&s){const r=[this.options.emptyNodeClass];i&&r.push(this.options.emptyEditorClass);const s=gi.node(t,t+e.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:t,hasAnchor:n}):this.options.placeholder});o.push(s)}return this.options.includeChildren})),vi.create(e,o)}}})]}}),Va.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new En({key:new Dn("selection"),props:{decorations:n=>n.selection.empty||e.isFocused||!e.isEditable||Sa(n.selection)||e.view.dragging?null:vi.create(n.doc,[gi.inline(n.selection.from,n.selection.to,{class:t.className})])}})]}});var Ep=Va.create({name:"trailingNode",addOptions:()=>({node:"paragraph",notAfter:[]}),addProseMirrorPlugins(){const e=new Dn(this.name),t=Object.entries(this.editor.schema.nodes).map((([,e])=>e)).filter((e=>(this.options.notAfter||[]).concat(this.options.node).includes(e.name)));return[new En({key:e,appendTransaction:(t,n,r)=>{const{doc:o,tr:i,schema:s}=r,a=e.getState(r),l=o.content.size,c=s.nodes[this.options.node];if(a)return i.insert(l,c.create())},state:{init:(e,n)=>!Tp({node:n.tr.doc.lastChild,types:t}),apply:(e,n)=>{if(!e.docChanged)return n;return!Tp({node:e.doc.lastChild,types:t})}}})]}}),Op=Va.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>Sp(e,t),redo:()=>({state:e,dispatch:t})=>Cp(e,t)}),addProseMirrorPlugins(){return[kp(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Ap=Va.create({name:"starterKit",addExtensions(){var e,t,n,r;const o=[];return!1!==this.options.bold&&o.push(bc.configure(this.options.bold)),!1!==this.options.blockquote&&o.push(Gu.configure(this.options.blockquote)),!1!==this.options.bulletList&&o.push(Cc.configure(this.options.bulletList)),!1!==this.options.code&&o.push(Jc.configure(this.options.code)),!1!==this.options.codeBlock&&o.push(Xc.configure(this.options.codeBlock)),!1!==this.options.document&&o.push(Zc.configure(this.options.document)),!1!==this.options.dropcursor&&o.push(Mp.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&o.push(jp.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&o.push(Yu.configure(this.options.hardBreak)),!1!==this.options.heading&&o.push(td.configure(this.options.heading)),!1!==this.options.undoRedo&&o.push(Op.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&o.push(Xu.configure(this.options.horizontalRule)),!1!==this.options.italic&&o.push(ad.configure(this.options.italic)),!1!==this.options.listItem&&o.push(Mc.configure(this.options.listItem)),!1!==this.options.listKeymap&&o.push(Pc.configure(null==(e=this.options)?void 0:e.listKeymap)),!1!==this.options.link&&o.push(lu.configure(null==(t=this.options)?void 0:t.link)),!1!==this.options.orderedList&&o.push(Vc.configure(this.options.orderedList)),!1!==this.options.paragraph&&o.push(uu.configure(this.options.paragraph)),!1!==this.options.strike&&o.push(gu.configure(this.options.strike)),!1!==this.options.text&&o.push(yu.configure(this.options.text)),!1!==this.options.underline&&o.push(bu.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&o.push(Ep.configure(null==(r=this.options)?void 0:r.trailingNode)),o}});var Dp=function(n){var r=n.message,o=n.description,i=n.type,s=void 0===i?"info":i,a=n.duration,l=void 0===a?5e3:a,c=n.onClose,d=t.useState(!0),h=d[0],u=d[1],p=t.useState(100),f=p[0],m=p[1],g={success:{icon:e.jsx(w,{className:"h-5 w-5"}),bgColor:"bg-green-50",borderColor:"border-green-300",textColor:"text-green-800",iconColor:"text-green-500",progressColor:"bg-green-500"},error:{icon:e.jsx(b,{className:"h-5 w-5"}),bgColor:"bg-rose-50",borderColor:"border-rose-300",textColor:"text-rose-800",iconColor:"text-rose-500",progressColor:"bg-rose-500"},info:{icon:e.jsx(z,{className:"h-5 w-5"}),bgColor:"bg-blue-50",borderColor:"border-blue-300",textColor:"text-blue-800",iconColor:"text-blue-500",progressColor:"bg-blue-500"},warning:{icon:e.jsx(J,{className:"h-5 w-5"}),bgColor:"bg-amber-50 ",borderColor:"border-amber-300 ",textColor:"text-amber-800",iconColor:"text-amber-500",progressColor:"bg-amber-500"}};t.useEffect((function(){var e=setTimeout((function(){u(!1),setTimeout((function(){null==c||c()}),300)}),l),t=setInterval((function(){m((function(e){var t=e-100/(l/100);return t<=0?0:t}))}),100);return function(){clearTimeout(e),clearInterval(t)}}),[l,c]);var x=g[s],y=x.icon,v=x.bgColor,k=x.borderColor,N=x.textColor,S=x.iconColor,C=x.progressColor;return e.jsx("div",{className:"fixed right-4 top-4 z-50 transform transition-all duration-300 ".concat(h?"translate-x-0 opacity-100":"translate-x-full opacity-0"),children:e.jsxs("div",{className:"flex w-72 rounded-lg border shadow-lg md:w-96 ".concat(k," ").concat(v," p-4"),children:[e.jsx("div",{className:"flex-shrink-0 ".concat(S),children:y}),e.jsxs("div",{className:"ml-3 w-full",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("div",{className:"text-md font-semibold ".concat(N),children:r}),e.jsx("button",{onClick:function(){u(!1),setTimeout((function(){null==c||c()}),300)},className:"text-gray-600 hover:text-gray-600 focus:outline-none",children:e.jsx(Q,{className:"h-4 w-4"})})]}),o&&e.jsx("p",{className:"mt-1 text-sm ".concat(N," opacity-80"),children:o}),e.jsx("div",{className:"mt-2 h-1 w-full rounded-full bg-gray-200",children:e.jsx("div",{className:"".concat(C," h-1 rounded-full transition-all duration-100 ease-linear"),style:{width:"".concat(f,"%")}})})]})]})})},Rp=null,Lp=t.createContext(void 0),zp={success:function(e,t){Rp?Rp.success(e,t):console.warn("AlertProvider not mounted yet")},error:function(e,t){Rp?Rp.error(e,t):console.warn("AlertProvider not mounted yet")},info:function(e,t){Rp?Rp.info(e,t):console.warn("AlertProvider not mounted yet")},warning:function(e,t){Rp?Rp.warning(e,t):console.warn("AlertProvider not mounted yet")},show:function(e){Rp?Rp.showAlert(e):console.warn("AlertProvider not mounted yet")}},Ip=function(n){var r=n.isOpen,o=n.onClose,i=n.title,s=n.children,a=n.size,l=void 0===a?"md":a,c=n.position,d=void 0===c?"right":c,h=n.showCloseButton,u=void 0===h||h,p=n.closeOnOverlayClick,f=void 0!==p&&p,m=n.closeOnEscape,g=void 0===m||m,x=n.className,y=void 0===x?"":x,v=n.overlayClassName,b=void 0===v?"":v,w=n.contentClassName,k=void 0===w?"":w,N=n.headerClassName,S=void 0===N?"":N,C=n.footer,M=n.footerClassName,j=void 0===M?"":M,T=n.maxHeight,E=void 0!==T&&T,O=t.useRef(null),A=t.useRef(null);t.useEffect((function(){var e;return r?(A.current=document.activeElement,null===(e=O.current)||void 0===e||e.focus(),document.body.style.overflow="hidden"):(document.body.style.overflow="unset",A.current&&A.current.focus()),function(){document.body.style.overflow="unset"}}),[r]),t.useEffect((function(){var e=function(e){"Escape"===e.key&&g&&o()};return r&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[r,g,o]);var D=function(e){e.target===e.currentTarget&&f&&"full"!==l&&o()};return r?e.jsxs("div",{className:"fixed inset-0 z-50 ".concat(b),role:"dialog","aria-modal":"true","aria-labelledby":i?"modal-title":void 0,children:["full"!==l&&e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm transition-opacity duration-700",onClick:D}),e.jsx("div",{className:"fixed inset-0 flex ".concat("p-0"," ").concat(function(){if("full"===l)return"items-start justify-start";return{left:"items-start justify-start",right:"items-start justify-end",center:"items-center justify-center"}[d]}()),onClick:D,children:e.jsxs("div",{ref:O,tabIndex:-1,className:"\n relative w-full ".concat({xs:"max-w-xs",sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl",full:"w-full h-full"}[l]," bg-white shadow-2xl transform transition-all duration-700 ease-out flex flex-col\n ").concat("full"===l?"h-full max-h-screen overflow-hidden":"left"===d||"right"===d?"h-full ".concat(E?"max-h-screen":""):"".concat(E?"max-h-[90vh] overflow-hidden":""),"\n ").concat("full"===l?"animate-in fade-in-0":"center"===d?"animate-in fade-in-0 zoom-in-95":"left"===d?"animate-in slide-in-from-left-full":"animate-in slide-in-from-right-full","\n ").concat(y,"\n "),onClick:function(e){return e.stopPropagation()},children:[(i||u)&&e.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-b border-gray-200 flex-shrink-0 ".concat(S),children:[i&&e.jsx("h2",{id:"modal-title",className:"text-xl font-semibold text-gray-900 truncate pr-4",children:i}),u&&e.jsx("button",{onClick:o,className:"flex items-center justify-center w-8 h-8 rounded-full text-gray-400 hover:text-gray-600 hover:bg-gray-100 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2","aria-label":"Close modal",children:e.jsx(Q,{size:20})})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto ".concat(E||"full"===l?"overflow-y-auto":""," ").concat(k),children:E&&("left"===d||"right"===d)||"full"===l?e.jsx("div",{className:"p-6 min-h-0 flex-1",children:s}):e.jsx("div",{className:"p-6",children:s})}),C&&e.jsx("div",{className:"px-6 py-4 border-t border-gray-200 flex-shrink-0 ".concat(""," ").concat(j),children:C})]})})]}):null};function Pp(t){var n=t.currentPage,r=t.totalPages,o=t.totalItems,i=t.itemsPerPage,s=t.onPageChange,l=t.onViewChange,c=t.loading,d=void 0!==c&&c,h=function(e){e>0&&e<=r&&!d&&s&&s(e)},u=(n-1)*i,p=Math.min(u+i,o);return e.jsxs("div",{className:"flex items-center justify-between border-t border-gray-200 bg-white py-3",children:[e.jsxs("div",{className:"flex flex-1 justify-between sm:hidden",children:[e.jsx("button",{onClick:function(){return h(n-1)},disabled:1===n||d,className:"relative inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 ".concat(1===n||d?"cursor-not-allowed opacity-50":""),children:"Previous"}),e.jsx("button",{onClick:function(){return h(n+1)},disabled:n===r||d,className:"relative ml-3 inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 ".concat(n===r||d?"cursor-not-allowed opacity-50":""),children:"Next"})]}),e.jsxs("div",{className:"hidden sm:flex sm:flex-1 sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx("select",{value:i,onChange:function(e){return l&&l(e.target.value)},disabled:d,className:"appearance-none rounded-md border border-gray-300 bg-white py-2 pl-3 pr-8 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",children:[10,20,30,50].map((function(t){return e.jsx("option",{value:t,children:t},t)}))}),e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700",children:e.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),e.jsxs("p",{className:"text-sm text-gray-700",children:[e.jsxs("span",{children:[o," Entries"]}),e.jsxs("span",{className:"ml-1",children:["(Showing ",u+1,"-",p," of ",o,")"]})]})]}),e.jsx("div",{children:e.jsxs("nav",{className:"relative z-0 inline-flex gap-2 -space-x-px rounded-md shadow-sm","aria-label":"Pagination",children:[e.jsxs("button",{onClick:function(){return h(n-1)},disabled:1===n||d,className:"relative inline-flex items-center rounded-md border border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-500 hover:bg-gray-50 ".concat(1===n||d?"cursor-not-allowed opacity-50":""),children:[e.jsx("span",{className:"sr-only",children:"Previous"}),e.jsx("svg",{className:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z",clipRule:"evenodd"})})]}),function(){var e=[];if(r<=5)for(var t=1;t<=r;t++)e.push(t);else{var o=Math.max(1,n-2),i=Math.min(r,o+5-1);i-o<4&&(o=Math.max(1,i-5+1));for(t=o;t<=i;t++)e.push(t)}return e}().map((function(t){return e.jsx("button",{onClick:function(){return h(t)},disabled:d,"aria-current":n===t?"page":void 0,className:"relative inline-flex items-center rounded-md border px-4 py-2 text-sm font-semibold ".concat(n===t?"z-10 border-primary-100 bg-primary-50 text-primary":"border-gray-300 bg-white text-gray-500 hover:bg-gray-50"," ").concat(d?"cursor-not-allowed opacity-50":""),children:t},t)})),e.jsxs(a,{onClick:function(){return h(n+1)},disabled:n===r||d,type:"button",variant:"primary",size:"small",outline:!0,children:["Next Page",e.jsx("svg",{className:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})})]})]})})]})]})}function Bp(t){var n=t.columns,r=void 0===n?5:n,o=t.rows,i=void 0===o?3:o;return e.jsx(e.Fragment,{children:Array.from({length:i}).map((function(t,n){return e.jsx("tr",{children:Array.from({length:r}).map((function(t,r){return e.jsx("td",{className:"whitespace-nowrap px-6 py-4",children:e.jsx("div",{className:"h-4 animate-pulse rounded bg-gray-200"})},"skeleton-cell-".concat(n,"-").concat(r))}))},"skeleton-row-".concat(n))}))})}var $p={xs:{width:"4rem",height:"1rem"},sm:{width:"6rem",height:"1.25rem"},md:{width:"8rem",height:"1.5rem"},lg:{width:"12rem",height:"2rem"},xl:{width:"16rem",height:"2.5rem"}},Vp={text:{baseClasses:"rounded",defaultSize:{width:"100%",height:"1rem"}},rectangular:{baseClasses:"",defaultSize:{width:"100%",height:"8rem"}},circular:{baseClasses:"rounded-full aspect-square",defaultSize:{width:"3rem",height:"3rem"}},rounded:{baseClasses:"rounded-lg",defaultSize:{width:"100%",height:"6rem"}},card:{baseClasses:"rounded-lg",defaultSize:{width:"100%",height:"12rem"}},avatar:{baseClasses:"rounded-full aspect-square",defaultSize:{width:"2.5rem",height:"2.5rem"}},button:{baseClasses:"rounded-md",defaultSize:{width:"5rem",height:"2.25rem"}},image:{baseClasses:"rounded",defaultSize:{width:"100%",height:"10rem"}},line:{baseClasses:"rounded-full",defaultSize:{width:"100%",height:"0.25rem"}}},Fp=function(n){var r=n.variant,o=void 0===r?"text":r,i=n.animation,s=void 0===i?"pulse":i,a=n.size,l=n.width,c=n.height,d=n.count,h=void 0===d?1:d,u=n.className,p=void 0===u?"":u,f=n.shimmer,m=void 0!==f&&f,g=n.borderRadius,x=n.intensity,y=void 0===x?"medium":x,v=n.delay,b=void 0===v?0:v,w=t.useState(0===b),k=w[0],N=w[1];t.useEffect((function(){!function(){if("undefined"!=typeof document&&!document.getElementById("skeleton-loader-styles")){var e=document.createElement("style");e.id="skeleton-loader-styles",e.textContent="\n @keyframes wave {\n 0% { transform: translateX(-100%); }\n 50% { transform: translateX(100%); }\n 100% { transform: translateX(100%); }\n }\n\n @keyframes shimmer {\n 0% { background-position: -200% 0; }\n 100% { background-position: 200% 0; }\n }\n\n .skeleton-wave {\n animation: wave 1.6s linear infinite;\n position: relative;\n overflow: hidden;\n }\n\n .skeleton-shimmer {\n animation: shimmer 2s ease-in-out infinite;\n background-size: 200% 100%;\n }\n\n .skeleton-wave::after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: linear-gradient(\n 90deg,\n transparent,\n rgba(255, 255, 255, 0.6),\n transparent\n );\n animation: wave 1.6s linear infinite;\n }\n",document.head.appendChild(e)}}()}),[]);var S=Vp[o],C=t.useMemo((function(){return{width:void 0!==l?"number"==typeof l?"".concat(l,"px"):l:a?$p[a].width:S.defaultSize.width,height:void 0!==c?"number"==typeof c?"".concat(c,"px"):c:a?$p[a].height:S.defaultSize.height}}),[l,c,a,S]);if(t.useEffect((function(){if(b>0){var e=setTimeout((function(){return N(!0)}),b);return function(){return clearTimeout(e)}}}),[b]),!k)return null;var M=function(){var e=["block","bg-gray-200",S.baseClasses];switch("pulse"===s?e.push("animate-pulse"):"wave"===s&&e.push("animate-wave"),y){case"light":e.push("bg-gray-100");break;case"medium":e.push("bg-gray-200");break;case"dark":e.push("bg-gray-300")}return m&&e.push("bg-gradient-to-r","from-gray-200","via-gray-100","to-gray-200","bg-200%","animate-shimmer"),e.join(" ")},j=function(t){return e.jsx("div",{className:"".concat(M()," ").concat(p),style:(n={width:C.width,height:C.height},g&&(n.borderRadius=g),n),"aria-hidden":"true"},t);var n};return h>1?e.jsx("div",{className:"space-y-2",children:Array.from({length:h},(function(e,t){return j(t)}))}):j(0)},Hp=function(t){return e.jsx(Fp,ne({},t,{variant:"text"}))},_p=function(t){return e.jsx(Fp,ne({},t,{variant:"avatar"}))},qp=function(t){return e.jsx(Fp,ne({},t,{variant:"button"}))},Wp=function(t){var n=t.showBio,r=void 0===n||n;return e.jsxs("div",{className:"flex items-start space-x-4",children:[e.jsx(_p,{size:"lg"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(Hp,{width:"60%",height:"1.25rem"}),e.jsx(Hp,{width:"40%",height:"1rem",intensity:"light"}),r&&e.jsxs("div",{className:"space-y-1 pt-2",children:[e.jsx(Hp,{width:"100%"}),e.jsx(Hp,{width:"80%"}),e.jsx(Hp,{width:"90%"})]})]})]})},Kp=function(t){var n=t.itemCount,r=void 0===n?3:n,o=t.showAvatar,i=void 0===o||o,s=t.showMeta,a=void 0===s||s;return e.jsx("div",{className:"space-y-4",children:Array.from({length:r},(function(t,n){return e.jsxs("div",{className:"flex items-start space-x-3",children:[i&&e.jsx(_p,{}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(Hp,{width:"75%",height:"1.125rem"}),e.jsx(Hp,{width:"100%",height:"0.875rem",intensity:"light"}),a&&e.jsxs("div",{className:"flex space-x-4",children:[e.jsx(Hp,{width:"3rem",height:"0.75rem",intensity:"light"}),e.jsx(Hp,{width:"4rem",height:"0.75rem",intensity:"light"})]})]})]},n)}))})},Jp=function(t){var n=t.rows,r=void 0===n?5:n,o=t.columns,i=void 0===o?4:o,s=t.showHeader,a=void 0===s||s;return e.jsxs("div",{className:"space-y-3",children:[a&&e.jsx("div",{className:"flex space-x-4",children:Array.from({length:i},(function(t,n){return e.jsx(Hp,{width:"100%",height:"1rem",intensity:"dark"},n)}))}),e.jsx("div",{className:"space-y-2",children:Array.from({length:r},(function(t,n){return e.jsx("div",{className:"flex space-x-4",children:Array.from({length:i},(function(t,n){return e.jsx(Hp,{width:"100%",height:"0.875rem"},n)}))},n)}))})]})},Up=function(t){var n=t.size,r=void 0===n?"md":n,o=t.variant,i=void 0===o?"pulse":o,s=t.color,a=void 0===s?"primary":s,l=t.fullScreen,c=void 0!==l&&l,d=t.text,h=t.className,u=void 0===h?"":h,p=t.image,f=t.imageEffect,m=void 0===f?"pulse":f,g=a.startsWith("#"),x=function(e){return g?"":{text:"text-".concat(a),bg:"bg-".concat(a),border:"border-".concat(a),borderTop:"border-t-".concat(a),borderRight:"border-r-".concat(a)}[e]||""},y={sm:"w-4 h-4",md:"w-8 h-8",lg:"w-12 h-12",xl:"w-16 h-16"},v={sm:"w-8 h-8",md:"w-12 h-12",lg:"w-16 h-16",xl:"w-20 h-20"},b=function(){switch(m){case"bounce":return"animate-bounce";case"spin":return"animate-spin";case"float":return"animate-pulse hover:animate-bounce";case"heartbeat":return"animate-ping";default:return"animate-pulse"}},w=function(){return e.jsxs("div",{className:"relative flex items-center justify-center",children:[e.jsx("img",{src:p,alt:"Loading",className:"".concat(v[r]," object-contain ").concat(b()),style:{filter:"drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1))",animationDuration:"heartbeat"===m?"1.5s":"bounce"===m?"1s":"2s"}}),"float"===m&&e.jsx("div",{className:"absolute inset-0 ".concat(v[r]," rounded-full bg-gradient-to-r from-purple-400 to-blue-400 opacity-20 animate-ping"),style:{animationDuration:"2s"}})]})},k=function(){return e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"".concat(y[r]," border-4 border-gray-200 rounded-full animate-spin ").concat(g?"":x("borderTop")),style:g?{borderTopColor:a}:{}}),e.jsx("div",{className:"absolute inset-0 ".concat(y[r]," border-4 border-transparent rounded-full animate-spin ").concat(g?"":x("borderRight")),style:g?{borderRightColor:a,animationDirection:"reverse",animationDuration:"0.75s"}:{animationDirection:"reverse",animationDuration:"0.75s"}})]})},N=function(){return e.jsx("div",{className:"flex space-x-1",children:[0,1,2].map((function(t){return e.jsx("div",{className:"".concat("sm"===r?"w-2 h-2":"md"===r?"w-3 h-3":"lg"===r?"w-4 h-4":"w-5 h-5"," rounded-full animate-bounce ").concat(g?"":x("bg")),style:g?{backgroundColor:a,animationDelay:"".concat(.2*t,"s"),animationDuration:"1.4s"}:{animationDelay:"".concat(.2*t,"s"),animationDuration:"1.4s"}},t)}))})},S=function(){return e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"".concat(y[r]," rounded-full animate-pulse ").concat(g?"":x("bg")),style:g?{backgroundColor:a}:{}}),e.jsx("div",{className:"absolute inset-0 ".concat(y[r]," rounded-full animate-ping opacity-30 ").concat(g?"":x("bg")),style:g?{backgroundColor:a}:{}})]})},C=function(){return e.jsx("div",{className:"flex space-x-1 items-end",children:[0,1,2,3].map((function(t){return e.jsx("div",{className:"".concat("sm"===r?"w-1":"md"===r?"w-1.5":"lg"===r?"w-2":"w-2.5"," rounded-sm animate-pulse ").concat(g?"":x("bg")),style:g?{backgroundColor:a,height:"".concat(20+10*t,"px"),animationDelay:"".concat(.15*t,"s"),animationDuration:"1.2s"}:{height:"".concat(20+10*t,"px"),animationDelay:"".concat(.15*t,"s"),animationDuration:"1.2s"}},t)}))})},M=function(){return e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"".concat(y[r]," border-4 rounded-full animate-ping ").concat(g?"":x("border")),style:g?{borderColor:a}:{}}),e.jsx("div",{className:"absolute inset-2 border-4 rounded-full animate-ping ".concat(g?"":x("border")),style:g?{borderColor:a,animationDelay:"0.5s"}:{animationDelay:"0.5s"}})]})},j=e.jsxs("div",{className:"flex flex-col items-center justify-center space-y-3 ".concat(u),children:[function(){if("image"===i&&p)return e.jsx(w,{});switch(i){case"dots":return e.jsx(N,{});case"pulse":return e.jsx(S,{});case"bars":return e.jsx(C,{});case"ripple":return e.jsx(M,{});default:return e.jsx(k,{})}}(),d&&e.jsx("p",{className:"".concat({sm:"text-xs",md:"text-sm",lg:"text-base",xl:"text-lg"}[r]," font-medium animate-pulse ").concat(g?"":x("text")),style:g?{color:a}:{},children:d})]});return c?e.jsx("div",{className:"fixed inset-0 bg-white/80 backdrop-blur-sm flex items-center justify-center z-50",children:j}):j};exports.AlertContext=Lp,exports.AlertProvider=function(n){var r=n.children,o=t.useState([]),i=o[0],s=o[1],a=t.useCallback((function(e){s((function(t){return t.filter((function(t){return t.id!==e}))}))}),[]),l=t.useCallback((function(e){var t=Math.random().toString(36).substring(2,9),n=ne(ne({},e),{id:t,onClose:function(){return a(t)}});s((function(e){return oe(oe([],e,!0),[n],!1)}))}),[a]),c=t.useCallback((function(e){return function(t,n){l({message:t,description:n,type:e})}}),[l]),d={showAlert:l,success:c("success"),error:c("error"),info:c("info"),warning:c("warning")};return Rp=d,e.jsxs(Lp.Provider,{value:d,children:[r,e.jsx("div",{className:"fixed right-4 top-4 z-50 space-y-2 w-full max-w-xs",children:i.map((function(t,n){return e.jsx("div",{style:{transform:"translateY(".concat(10*n,"px)"),zIndex:50-n},children:e.jsx(Dp,ne({},t))},t.id)}))})]})},exports.Badge=function(t){var n=t.children,r=t.variant,o=void 0===r?"default":r,i=t.size,s=void 0===i?"md":i,a=t.className,l=void 0===a?"":a,c=t.onClick,d=["inline-flex items-center font-medium rounded-full transition-colors duration-200",{default:"bg-gray-100 text-gray-800 hover:bg-gray-200",secondary:"bg-blue-100 text-blue-800 hover:bg-blue-200",success:"bg-green-100 text-green-800 hover:bg-green-200",warning:"bg-yellow-100 text-yellow-800 hover:bg-yellow-200",error:"bg-red-100 text-red-800 hover:bg-red-200",info:"bg-cyan-100 text-cyan-800 hover:bg-cyan-200"}[o],{sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-1 text-sm",lg:"px-3 py-1.5 text-base"}[s],c?"cursor-pointer":"",l].filter(Boolean).join(" ");return e.jsx("span",{className:d,onClick:c,role:c?"button":void 0,tabIndex:c?0:void 0,onKeyDown:c?function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),c())}:void 0,children:n})},exports.Breadcrumb=function(t){var n=t.items,r=void 0===n?[]:n,o=t.onBackClick,i=t.showBackButton,s=void 0===i||i,a=t.separator,l=void 0===a?" / ":a,c=t.className,d=void 0===c?"":c;return e.jsxs("div",{className:"flex gap-2 ".concat(d),children:[s&&e.jsx("div",{onClick:o,className:"cursor-pointer",children:e.jsx(y,{className:"text-gray-500 transition-colors hover:text-gray-700"})}),e.jsx("p",{className:"text-gray-400",children:r.map((function(t,n){return e.jsxs("span",{children:[t.isActive?e.jsx("span",{className:"text-primary",children:t.label}):e.jsx("span",{className:t.onClick?"cursor-pointer transition-colors hover:text-gray-600":"",onClick:t.onClick,children:t.label}),n<r.length-1&&l]},n)}))})]})},exports.Button=a,exports.Card=ee,exports.CardStatsSkeleton=function(){return e.jsxs(ee,{children:[e.jsx("div",{className:"mb-4",children:e.jsx(Hp,{width:"180px",height:"28px"})}),e.jsxs("div",{className:"mt-4 grid grid-cols-1 gap-4",children:[e.jsxs("div",{className:"rounded-lg bg-blue-50 p-4",children:[e.jsx(Hp,{width:"40px",height:"32px",className:"mb-1"}),e.jsx(Hp,{width:"100px",height:"16px"})]}),e.jsxs("div",{className:"rounded-lg bg-green-50 p-4",children:[e.jsx(Hp,{width:"40px",height:"32px",className:"mb-1"}),e.jsx(Hp,{width:"110px",height:"16px"})]}),e.jsxs("div",{className:"rounded-lg bg-yellow-50 p-4",children:[e.jsx(Hp,{width:"40px",height:"32px",className:"mb-1"}),e.jsx(Hp,{width:"120px",height:"16px"})]})]})]})},exports.CheckBox=ie,exports.CheckBoxDemo=function(){var n=t.useState("option1"),r=n[0],o=n[1],i=t.useState({terms:!1,newsletter:!0,notifications:!1}),s=i[0],a=i[1];return e.jsx("div",{className:"min-h-screen bg-gray-50 p-8",children:e.jsx("div",{className:"mx-auto max-w-2xl space-y-8",children:e.jsxs("div",{className:"rounded-lg bg-white p-6 shadow",children:[e.jsx("h2",{className:"mb-6 text-xl font-semibold",children:"CheckBox Component Demo"}),e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-medium",children:"Check Variant"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-6",children:[e.jsx(ie,{variant:"check",size:"sm",label:"Small"}),e.jsx(ie,{variant:"check",size:"md",checked:!0,label:"Medium"}),e.jsx(ie,{variant:"check",size:"lg",label:"Large"}),e.jsx(ie,{variant:"check",disabled:!0,label:"Disabled"}),e.jsx(ie,{variant:"check",indeterminate:!0,label:"Indeterminate"})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-medium",children:"Radio Group (Dot Variant)"}),e.jsx(se,{name:"demo-radio",value:r,onChange:o,label:"Choose an option",options:[{value:"option1",label:"Option 1"},{value:"option2",label:"Option 2"},{value:"option3",label:"Option 3"},{value:"option4",label:"Option 4 (Disabled)",disabled:!0}],helperText:"Select one option from the list"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-medium",children:"Toggle Variant"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-6",children:[e.jsx(ie,{variant:"toggle",size:"sm",label:"Small"}),e.jsx(ie,{variant:"toggle",size:"md",checked:!0,label:"Medium"}),e.jsx(ie,{variant:"toggle",size:"lg",label:"Large"}),e.jsx(ie,{variant:"toggle",disabled:!0,label:"Disabled"})]})]}),e.jsxs("div",{className:"space-y-4 border-t pt-6",children:[e.jsx("h3",{className:"font-medium",children:"Sample Form"}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(ie,{variant:"check",checked:s.terms,onChange:function(e){return a(ne(ne({},s),{terms:e}))},label:"I accept the terms and conditions",required:!0,error:s.terms?"":"Please accept terms to continue"}),e.jsx(ie,{variant:"toggle",checked:s.newsletter,onChange:function(e){return a(ne(ne({},s),{newsletter:e}))},label:"Subscribe to newsletter",helperText:"Get updates about new features and releases"}),e.jsx(ie,{variant:"check",checked:s.notifications,onChange:function(e){return a(ne(ne({},s),{notifications:e}))},label:"Enable push notifications"}),e.jsx("div",{className:"pt-4",children:e.jsx("button",{className:"rounded-md bg-primary px-4 py-2 text-white transition-colors hover:bg-primary/90 disabled:opacity-50",disabled:!s.terms,children:"Submit"})})]})]})]})]})})})},exports.ConfirmationAlert=function(n){var r=n.isOpen,o=n.onConfirm,i=n.onCancel,s=n.title,l=n.message,c=n.confirmText,d=void 0===c?"Confirm":c,h=n.cancelText,u=void 0===h?"Cancel":h,p=n.type,f=void 0===p?"default":p,m=n.showIcon,g=void 0===m||m,x=n.showCloseButton,y=void 0===x||x,v=n.closeOnOverlayClick,b=void 0===v||v,N=n.closeOnEscape,S=void 0===N||N,C=n.isLoading,M=void 0!==C&&C,j=n.className,T=void 0===j?"":j,E=n.overlayClassName,O=void 0===E?"":E,A=n.maxWidth,D=void 0===A?"sm":A,R=t.useRef(null),L=t.useRef(null),I=t.useRef(null);t.useEffect((function(){return r?(I.current=document.activeElement,setTimeout((function(){var e,t,n;"danger"===f?null===(t=null===(e=R.current)||void 0===e?void 0:e.querySelector("[data-cancel-button]"))||void 0===t||t.focus():null===(n=L.current)||void 0===n||n.focus()}),100),document.body.style.overflow="hidden"):(document.body.style.overflow="unset",I.current&&I.current.focus()),function(){document.body.style.overflow="unset"}}),[r,f]),t.useEffect((function(){var e=function(e){"Escape"===e.key&&S&&!M&&i()};return r&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[r,S,i,M]);var P=function(){M||i()},B={default:{icon:z,iconColor:"text-blue-600",iconBg:"bg-blue-100",confirmButton:"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500"},danger:{icon:k,iconColor:"text-red-600",iconBg:"bg-red-100",confirmButton:"bg-red-600 hover:bg-red-700 focus:ring-red-500"},warning:{icon:J,iconColor:"text-yellow-600",iconBg:"bg-yellow-100",confirmButton:"bg-yellow-600 hover:bg-yellow-700 focus:ring-yellow-500"},success:{icon:w,iconColor:"text-green-600",iconBg:"bg-green-100",confirmButton:"bg-green-600 hover:bg-green-700 focus:ring-green-500"},info:{icon:z,iconColor:"text-blue-600",iconBg:"bg-blue-100",confirmButton:"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500"}}[f],$=B.icon;return r?e.jsxs("div",{className:"fixed inset-0 z-50 ".concat(O),role:"dialog","aria-modal":"true","aria-labelledby":s?"confirmation-title":void 0,"aria-describedby":"confirmation-message",children:[e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm transition-opacity duration-300",onClick:function(e){e.target===e.currentTarget&&b&&!M&&i()}}),e.jsx("div",{className:"fixed inset-0 flex items-center justify-center p-4",children:e.jsxs("div",{ref:R,className:"relative w-full ".concat({sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"}[D]," animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-4 transform rounded-2xl bg-white shadow-2xl transition-all duration-300 ease-out ").concat(T," "),onClick:function(e){return e.stopPropagation()},children:[y&&e.jsx("button",{onClick:P,disabled:M,className:"absolute right-4 top-4 flex h-8 w-8 items-center justify-center rounded-full text-gray-400 transition-colors duration-200 hover:bg-gray-100 hover:text-gray-600 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50","aria-label":"Close",children:e.jsx(Q,{size:20})}),e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4",children:[g&&e.jsx("div",{className:"h-12 w-12 flex-shrink-0 rounded-full ".concat(B.iconBg," flex items-center justify-center"),children:e.jsx($,{size:24,className:B.iconColor})}),e.jsxs("div",{className:"min-w-0 flex-1 justify-center",children:[s&&e.jsx("h3",{id:"confirmation-title",className:"mb-1 text-center text-lg font-semibold text-gray-900",children:s}),e.jsx("p",{id:"confirmation-message",className:"leading-relaxed text-gray-600",children:l})]})]}),e.jsxs("div",{className:"flex ".concat("justify-center"," mt-6 space-x-3"),children:[e.jsx(a,{variant:"neutral",outline:!0,size:"small","data-cancel-button":"",onClick:P,disabled:M,children:u}),e.jsx("button",{ref:L,onClick:function(){M||o()},disabled:M,className:"flex min-w-[80px] items-center justify-center rounded-xl px-4 py-2 text-sm font-medium text-white transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ".concat(B.confirmButton," "),children:M?e.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent"}):d})]})]})]})})]}):null},exports.DateTimePicker=ce,exports.DateTimePickerDemo=function(){var n=t.useState({}),r=n[0],o=n[1],i=t.useState({}),s=i[0],a=i[1],l=t.useState({}),c=l[0],d=l[1],h=t.useState({}),u=h[0],p=h[1];return e.jsxs("div",{className:"max-w-4xl mx-auto p-6 bg-gray-50 min-h-screen",children:[e.jsx("h1",{className:"text-3xl font-bold mb-8 text-gray-900",children:"DateTime Picker Component"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsx(ce,{id:"single-date",label:"Single Date",value:r,onChange:o,placeholder:"Select a date",mode:"date",helpText:"Choose any single date",size:"md"}),e.jsx(ce,{id:"datetime",label:"Date & Time",value:s,onChange:a,placeholder:"Select date and time",mode:"datetime",helpText:"Choose date with specific time",size:"md"})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(ce,{id:"date-range",label:"Date Range",value:c,onChange:d,placeholder:"Select date range",mode:"daterange",helpText:"Choose start and end dates",size:"md"}),e.jsx(ce,{id:"datetime-range",label:"Date & Time Range",value:u,onChange:p,placeholder:"Select date and time range",mode:"datetimerange",helpText:"Choose date range with time",size:"md"})]})]}),e.jsxs("div",{className:"mt-12 grid grid-cols-1 md:grid-cols-2 gap-8",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-800",children:"Single Date:"}),e.jsx("pre",{className:"bg-white p-4 rounded-lg border text-sm overflow-x-auto",children:JSON.stringify(r,null,2)}),e.jsx("h3",{className:"text-lg font-semibold text-gray-800",children:"DateTime:"}),e.jsx("pre",{className:"bg-white p-4 rounded-lg border text-sm overflow-x-auto",children:JSON.stringify(s,null,2)})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-800",children:"Date Range:"}),e.jsx("pre",{className:"bg-white p-4 rounded-lg border text-sm overflow-x-auto",children:JSON.stringify(c,null,2)}),e.jsx("h3",{className:"text-lg font-semibold text-gray-800",children:"DateTime Range:"}),e.jsx("pre",{className:"bg-white p-4 rounded-lg border text-sm overflow-x-auto",children:JSON.stringify(u,null,2)})]})]})]})},exports.EmptyStateCard=te,exports.ExportButton=function(){var n=t.useState(!1),r=n[0],o=n[1],i=t.useRef(null),s=function(e){o(!1)};return t.useEffect((function(){var e=function(e){i.current&&!i.current.contains(e.target)&&o(!1)};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[]),e.jsxs("div",{className:"relative inline-block",ref:i,children:[e.jsxs("div",{className:"flex",children:[e.jsxs("button",{className:"flex items-center rounded-l-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none",onClick:function(){return s(Z.PDF)},children:[e.jsx(S,{className:"mr-2 h-4 w-4"}),"Export"]}),e.jsx("button",{className:"rounded-r-md border border-l-0 border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none",onClick:function(){o(!r)},children:e.jsx(x,{className:"h-4 w-4"})})]}),r&&e.jsx("div",{className:"absolute right-0 z-10 mt-1 w-48 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:e.jsxs("div",{className:"py-1",children:[e.jsxs("button",{onClick:function(){return s(Z.PDF)},className:"flex w-full items-center px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100",children:[e.jsx(O,{className:"mr-2 h-4 w-4"}),"PDF Document"]}),e.jsxs("button",{onClick:function(){return s(Z.CSV)},className:"flex w-full items-center px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100",children:[e.jsx(E,{className:"mr-2 h-4 w-4"}),"CSV Spreadsheet"]}),e.jsxs("button",{onClick:function(){return s(Z.EXCEL)},className:"flex w-full items-center px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-100",children:[e.jsx(E,{className:"mr-2 h-4 w-4"}),"Excel Spreadsheet"]})]})})]})},exports.FileUpload=function(n){var r=n.label,o=n.description,i=n.helperText,s=n.error,a=n.success,l=n.disabled,c=void 0!==l&&l,d=n.required,h=void 0!==d&&d,u=n.accept,p=n.multiple,f=void 0!==p&&p,m=n.placeholder,g=n.showProgress,x=void 0===g||g,y=n.className,v=void 0===y?"":y,k=n.id,N=n.maxFileSize,S=n.onFileChange,C=n.existingFiles,M=void 0===C?[]:C,j=n.direction,T=void 0===j?"col":j,E=n.replaceMode,O=re(n,["label","description","helperText","error","success","disabled","required","accept","multiple","placeholder","showProgress","className","id","maxFileSize","onFileChange","existingFiles","direction","replaceMode"]),A=t.useState([]),D=A[0],R=A[1],L=t.useState({}),z=L[0],I=L[1],P=t.useState(!1),B=P[0],$=P[1];null!=E||!f&&M.length;var V=function(e){if(e.target.files&&e.target.files.length>0){var t=Array.from(e.target.files),n=void 0;n=f?oe(oe([],D,!0),t,!0):[t[0]],R(n),x&&t.forEach((function(e){var t="".concat(e.name,"-").concat(e.size);I((function(e){var n;return ne(ne({},e),((n={})[t]=10,n))}));var n=setInterval((function(){I((function(e){var r,o=e[t]||0;return o>=100?(clearInterval(n),e):ne(ne({},e),((r={})[t]=Math.min(o+10,100),r))}))}),300)})),S(n)}},F=function(e){e.preventDefault(),c||$(!0)},H=function(e){e.preventDefault(),$(!1)},_=function(e){if(e.preventDefault(),$(!1),!c&&e.dataTransfer.files&&e.dataTransfer.files.length>0){var t=Array.from(e.dataTransfer.files),n=void 0;n=f?oe(oe([],D,!0),t,!0):[t[0]],R(n),x&&t.forEach((function(e){var t="".concat(e.name,"-").concat(e.size);I((function(e){var n;return ne(ne({},e),((n={})[t]=10,n))}));var n=setInterval((function(){I((function(e){var r,o=e[t]||0;return o>=100?(clearInterval(n),e):ne(ne({},e),((r={})[t]=Math.min(o+10,100),r))}))}),300)})),S(n)}},q=k||"file-upload-".concat(Math.random().toString(36).substr(2,9)),W=function(){if(!f){if(D.length>0){var e=D[0];return{name:e.name,size:e.size,type:e.type,file:e,uploadProgress:z["".concat(e.name,"-").concat(e.size)]||100}}if(M.length>0)return M[0]}return null}();return e.jsxs("div",{className:"space-y-4 ".concat(v),children:[r&&e.jsxs("label",{htmlFor:q,className:"block text-sm font-medium text-gray-700",children:[r,h&&e.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),o&&e.jsx("p",{className:"text-sm text-gray-600",children:o}),!f&&W?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-700",children:D.length>0?"New File":"Current File"}),e.jsx("button",{onClick:function(){var e;null===(e=document.getElementById(q))||void 0===e||e.click()},className:"text-sm text-blue-600 hover:text-blue-800 font-medium",disabled:c,children:"Replace"})]}),e.jsx(ae,{file:W,onDelete:function(){R([]),I({}),S(null)},showUpdate:!1,showView:!0,showDelete:!0,layout:"list",className:"max-w-md"}),e.jsx("input",{id:q,type:"file",className:"hidden",onChange:V,accept:u,disabled:c,required:h})]}):f&&M.length>0?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"mb-4",children:[e.jsxs("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:["Current Files (",M.length,")"]}),M.map((function(t,n){return e.jsx("div",{className:"mb-2",children:e.jsx(ae,{file:t,showDelete:!1,showUpdate:!1,layout:"list"})},t.id||n)}))]}),e.jsxs("div",{className:"\n flex flex-".concat(T," gap-2 rounded-lg border-2 border-dashed p-8 text-center items-center\n ").concat("row"===T?"justify-center":"","\n ").concat(B?"border-blue-400 bg-blue-50":"border-gray-300","\n ").concat(s?"border-red-300 bg-red-50":"","\n ").concat(a?"border-green-300 bg-green-50":"","\n ").concat(c?"opacity-50 cursor-not-allowed bg-gray-50":"cursor-pointer hover:border-gray-400","\n "),onDragOver:F,onDragLeave:H,onDrop:_,onClick:function(){var e;return!c&&(null===(e=document.getElementById(q))||void 0===e?void 0:e.click())},children:[e.jsx(Y,{size:24,className:"text-gray-400"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium ".concat(c?"text-gray-400":"text-blue-600 hover:underline"),children:m||"Add more files"}),e.jsx("p",{className:"text-gray-500 text-sm",children:"or drag and drop"}),e.jsxs("p",{className:"text-sm text-gray-500",children:["(Max. File size: ",N||"25"," MB)"]}),e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Multiple files allowed"})]}),e.jsx("input",ne({id:q,type:"file",className:"hidden",onChange:V,accept:u,multiple:f,disabled:c,required:h},O))]}),D.length>0&&e.jsxs("div",{className:"mt-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("h4",{className:"text-sm font-medium text-gray-700",children:["New Files (",D.length,")"]}),e.jsx("button",{onClick:function(){R([]),I({}),S(null)},className:"text-xs text-red-500 hover:text-red-700",disabled:c,children:"Remove All New Files"})]}),D.map((function(t,n){return e.jsx("div",{className:"mb-2",children:e.jsx(ae,{file:{name:t.name,size:t.size,type:t.type,file:t,uploadProgress:z["".concat(t.name,"-").concat(t.size)]||100},onDelete:function(){var e=D.filter((function(e,t){return t!==n}));R(e),S(e.length>0?e:null)},showUpdate:!1,showView:!1,layout:"list"})},"".concat(t.name,"-").concat(t.size))}))]})]}):e.jsxs("div",{className:"\n flex flex-".concat(T," gap-2 rounded-lg border-2 border-dashed p-8 text-center items-center\n ").concat("row"===T?"justify-center":"","\n ").concat(B?"border-blue-400 bg-blue-50":"border-gray-300","\n ").concat(s?"border-red-300 bg-red-50":"","\n ").concat(a?"border-green-300 bg-green-50":"","\n ").concat(c?"opacity-50 cursor-not-allowed bg-gray-50":"cursor-pointer hover:border-gray-400","\n "),onDragOver:F,onDragLeave:H,onDrop:_,onClick:function(){var e;return!c&&(null===(e=document.getElementById(q))||void 0===e?void 0:e.click())},children:[e.jsx(Y,{size:24,className:"text-gray-400"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium ".concat(c?"text-gray-400":"text-blue-600 hover:underline"),children:m||(!f&&M.length>0?"Replace file":M.length>0?"Add more files":"Click to Upload")}),e.jsx("p",{className:"text-gray-500 text-sm",children:"or drag and drop"}),e.jsxs("p",{className:"text-sm text-gray-500",children:["(Max. File size: ",N||"25"," MB)"]}),f?e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Multiple files allowed"}):e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Single file only"})]}),e.jsx("input",{id:q,type:"file",className:"hidden",onChange:V,accept:u,multiple:f,disabled:c,required:h})]}),i&&!s&&!a&&e.jsx("p",{className:"text-sm text-gray-500",children:i}),s&&e.jsxs("div",{className:"flex items-center text-red-600 text-sm",children:[e.jsx(b,{size:16,className:"mr-1"}),s]}),a&&e.jsxs("div",{className:"flex items-center text-green-600 text-sm",children:[e.jsx(w,{size:16,className:"mr-1"}),a]})]})},exports.FileView=ae,exports.Input=function(t){var n=t.id,r=t.label,o=t.value,i=t.size,s=void 0===i?"md":i,a=t.onChange,l=t.placeholder,c=t.error,d=t.required,h=void 0!==d&&d,u=t.helpText,p=t.type,f=void 0===p?"text":p,m=t.className,g=void 0===m?"":m,x=t.disabled,y=void 0!==x&&x,v=t.icon,b=t.iconPosition,w=void 0===b?"left":b,k=t.rightIcon,N=t.block,S=re(t,["id","label","value","size","onChange","placeholder","error","required","helpText","type","className","disabled","icon","iconPosition","rightIcon","block"]),C={id:n,value:o,onChange:function(e){a&&a(e)},placeholder:l,disabled:y,className:"w-full rounded-[12px] border ".concat({sm:"text-xs px-3 py-1.5 text-sm min-h-[32px]",md:"text-sm px-4 py-2 text-base min-h-[40px]",lg:"text-base px-4 py-3 text-lg min-h-[48px]"}[s]," ").concat(c?"border-red-500":"border-gray-200"," ").concat(y?"bg-gray-100 text-gray-500 placeholder-gray-300":"bg-gray-100 placeholder-gray-400 text-dark"," focus:outline-none focus:ring-1 focus:ring-primary ").concat(g," ").concat(v&&"left"===w?"pl-10":""," ").concat(v&&"right"===w?"pr-10":""),"aria-invalid":!!c,"aria-describedby":c?"".concat(n,"-error"):u?"".concat(n,"-help"):void 0};return e.jsxs("div",{className:"mb-4 ".concat(N&&"w-full"),children:[r&&e.jsxs("label",{htmlFor:n,className:"mb-1 block text-sm font-medium text-gray-600",children:[r,h&&e.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),e.jsxs("div",{className:"relative",children:[v&&"left"===w&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",children:v}),"textarea"==f?e.jsx("textarea",ne({},C,{rows:4,className:"".concat(C.className," resize-none")},S)):e.jsx("input",ne({},C,{type:f},S)),v&&"right"===w&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:v}),k&&e.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer",children:k})]}),u&&!c&&e.jsx("p",{id:"".concat(n,"-help"),className:"mt-1 text-sm text-gray-500",children:u}),c&&e.jsx("p",{id:"".concat(n,"-error"),className:"mt-1 text-sm text-red-500",children:c})]})},exports.InputWithPrefix=function(t){var n=t.id,r=t.label,o=t.value,i=t.size,s=void 0===i?"md":i,a=t.onChange,l=t.placeholder,c=t.error,d=t.required,h=void 0!==d&&d,u=t.helpText,p=t.type,f=void 0===p?"text":p,m=t.className,g=void 0===m?"":m,x=t.disabled,y=void 0!==x&&x,v=t.icon,b=t.iconPosition,w=void 0===b?"left":b,k=t.rightIcon,N=t.prefixContent,S=t.prefixClassName,C=void 0===S?"":S;t.onPrefixChange;var M,j,T=re(t,["id","label","value","size","onChange","placeholder","error","required","helpText","type","className","disabled","icon","iconPosition","rightIcon","prefixContent","prefixClassName","onPrefixChange"]),E="\n flex-1 rounded-none rounded-r-[12px] border-l-0 ".concat({sm:"text-xs py-1.5 text-sm min-h-[32px]",md:"text-sm py-2 text-base min-h-[40px]",lg:"text-base py-3 text-lg min-h-[48px]"}[s]," \n ").concat(c?"border-red-500":"border-gray-200","\n ").concat(y?"bg-gray-100 text-gray-500 placeholder-gray-300":"bg-gray-100 placeholder-gray-400 text-dark","\n focus:outline-none\n ").concat((M="",j="",v&&"left"===w&&(M="pl-10"),v&&"right"===w&&(j="pr-10"),k&&(j="pr-10"),"".concat(M," ").concat(j)),"\n ").concat(g,"\n "),O="\n flex items-center rounded-l-[12px] border border-r-0 ".concat({sm:"px-1 text-xs",md:"px-2 text-sm",lg:"px-4 text-base"}[s],"\n ").concat(c?"border-red-500":"border-gray-200","\n ").concat(y?"bg-gray-50":"","\n ").concat(C,"\n "),A={id:n,value:o,onChange:function(e){a&&a(e)},placeholder:l,disabled:y,className:E,"aria-invalid":!!c,"aria-describedby":c?"".concat(n,"-error"):u?"".concat(n,"-help"):void 0};return e.jsxs("div",{className:"mb-4",children:[r&&e.jsxs("label",{htmlFor:n,className:"mb-1 block text-sm font-medium text-gray-600",children:[r,h&&e.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),e.jsx("div",{className:"relative",children:e.jsxs("div",{className:"flex",children:[N&&e.jsx("div",{className:O,children:N}),e.jsxs("div",{className:"relative ".concat(N?"flex-1":"w-full"),children:[v&&"left"===w&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 z-10",children:v}),e.jsx("input",ne({},A,{type:f,className:"".concat(A.className," ").concat(N?"w-full border px-3":"rounded-l-[12px] border-l")},T)),v&&"right"===w&&e.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 z-10",children:v}),k&&e.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer z-10",children:k})]})]})}),u&&!c&&e.jsx("p",{id:"".concat(n,"-help"),className:"mt-1 text-sm text-gray-500",children:u}),c&&e.jsx("p",{id:"".concat(n,"-error"),className:"mt-1 text-sm text-red-500",children:c})]})},exports.Loading=Up,exports.LoadingDemo=function(){var n=t.useState("blue-500"),r=n[0],o=n[1],i=t.useState("spinner"),s=i[0],a=i[1],l=t.useState("md"),c=l[0],d=l[1],h=t.useState(!1),u=h[0],p=h[1],f=["spinner","dots","pulse","bars","ripple"];return e.jsxs("div",{className:"p-8 max-w-4xl mx-auto",children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-800 mb-8 text-center",children:"Modern Loading Component"}),e.jsxs("div",{className:"bg-white rounded-xl shadow-lg p-6 mb-8",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-700 mb-4",children:"Customization"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-600 mb-2",children:"Color"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:[{name:"Blue",value:"blue-500",hex:"#3B82F6"},{name:"Purple",value:"purple-500",hex:"#8B5CF6"},{name:"Green",value:"green-500",hex:"#10B981"},{name:"Red",value:"red-500",hex:"#EF4444"},{name:"Orange",value:"orange-500",hex:"#F59E0B"},{name:"Pink",value:"pink-500",hex:"#EC4899"},{name:"Indigo",value:"indigo-500",hex:"#6366F1"},{name:"Teal",value:"teal-500",hex:"#14B8A6"}].map((function(t){return e.jsx("button",{onClick:function(){return o(t.value)},className:"w-8 h-8 rounded-full border-2 transition-all ".concat(r===t.value?"border-gray-400 scale-110":"border-gray-200"),style:{backgroundColor:t.hex},title:"".concat(t.name," (").concat(t.value,")")},t.value)}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-600 mb-2",children:"Variant"}),e.jsx("select",{value:s,onChange:function(e){return a(e.target.value)},className:"w-full p-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:f.map((function(t){return e.jsx("option",{value:t,children:t&&(null==t?void 0:t.charAt(0).toUpperCase())+(null==t?void 0:t.slice(1))},t)}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-600 mb-2",children:"Size"}),e.jsx("select",{value:c,onChange:function(e){return d(e.target.value)},className:"w-full p-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:["sm","md","lg","xl"].map((function(t){return e.jsx("option",{value:t,children:null==t?void 0:t.toUpperCase()},t)}))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-600 mb-2",children:"Full Screen"}),e.jsx("button",{onClick:function(){return p(!0)},className:"w-full p-2 bg-gray-600 text-white rounded-md hover:bg-gray-700 transition-colors",children:"Demo Full Screen"})]})]}),e.jsxs("div",{className:"bg-gray-50 rounded-lg p-8 flex flex-col items-center justify-center min-h-32",children:[e.jsx(Up,{variant:s,size:c,color:r,text:"Loading..."}),e.jsx("div",{className:"mt-4 p-3 bg-white rounded-md shadow-sm",children:e.jsxs("code",{className:"text-sm text-gray-600",children:['color="',r,'"']})})]})]}),e.jsxs("div",{className:"bg-white rounded-xl shadow-lg p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-700 mb-4",children:"All Variants"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-6",children:f.map((function(t){return e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"bg-gray-50 rounded-lg p-4 flex items-center justify-center h-24 mb-2",children:e.jsx(Up,{variant:t,color:r})}),e.jsx("p",{className:"text-sm text-gray-600 capitalize",children:t})]},t)}))}),e.jsxs("div",{className:"mt-6 p-4 bg-blue-50 rounded-lg",children:[e.jsx("h3",{className:"font-semibold text-blue-800 mb-2",children:"Usage Examples:"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{className:"bg-white p-2 rounded border",children:[e.jsx("code",{className:"text-blue-600",children:"// Tailwind CSS class"}),e.jsx("br",{}),e.jsx("code",{children:'<Loading color="primary-500" />'})]}),e.jsxs("div",{className:"bg-white p-2 rounded border",children:[e.jsx("code",{className:"text-blue-600",children:"// Hex color"}),e.jsx("br",{}),e.jsx("code",{children:'<Loading color="#your-brand-color" />'})]}),e.jsxs("div",{className:"bg-white p-2 rounded border",children:[e.jsx("code",{className:"text-blue-600",children:"// Custom Tailwind color"}),e.jsx("br",{}),e.jsx("code",{children:'<Loading color="emerald-400" variant="dots" />'})]})]})]})]}),u&&e.jsx(Up,{variant:s,size:c,color:r,text:"Loading in full screen...",fullScreen:!0}),u&&e.jsx("button",{onClick:function(){return p(!1)},className:"fixed top-4 right-4 z-50 bg-red-500 text-white px-4 py-2 rounded-md hover:bg-red-600 transition-colors",children:"Close Full Screen"})]})},exports.Modal=Ip,exports.ModalExample=function(){var n=t.useState(!1),r=n[0],o=n[1],i=t.useState("left"),s=i[0],a=i[1],l=t.useState("md"),c=l[0],d=l[1],h=e.jsxs("div",{className:"flex justify-end space-x-3",children:[e.jsx("button",{onClick:function(){return o(!1)},className:"px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors duration-200",children:"Cancel"}),e.jsx("button",{onClick:function(){return o(!1)},className:"px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors duration-200",children:"Save Changes"})]});return e.jsxs("div",{className:"p-8 space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap gap-4 mb-6",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Position"}),e.jsxs("select",{value:s,onChange:function(e){return a(e.target.value)},className:"border border-gray-300 rounded-md px-3 py-2 text-sm",disabled:"full"===c,children:[e.jsx("option",{value:"left",children:"Left"}),e.jsx("option",{value:"right",children:"Right"}),e.jsx("option",{value:"center",children:"Center"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Size"}),e.jsxs("select",{value:c,onChange:function(e){return d(e.target.value)},className:"border border-gray-300 rounded-md px-3 py-2 text-sm",children:[e.jsx("option",{value:"xs",children:"Extra Small"}),e.jsx("option",{value:"sm",children:"Small"}),e.jsx("option",{value:"md",children:"Medium"}),e.jsx("option",{value:"lg",children:"Large"}),e.jsx("option",{value:"xl",children:"Extra Large"}),e.jsx("option",{value:"2xl",children:"2X Large"}),e.jsx("option",{value:"full",children:"Full Screen"})]})]})]}),e.jsx("button",{onClick:function(){return o(!0)},className:"px-6 py-3 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors duration-200 font-medium",children:"Open Modal"}),e.jsx(Ip,{isOpen:r,onClose:function(){return o(!1)},title:"Example Modal",size:c,position:s,footer:h,maxHeight:"center"!==s,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-gray-600",children:"This is an example of the multipurpose modal component. It supports different sizes, positions, and configurations."}),e.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[e.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Features:"}),e.jsxs("ul",{className:"text-sm text-gray-600 space-y-1 list-disc list-inside",children:[e.jsx("li",{children:"Multiple sizes (xs, sm, md, lg, xl, 2xl, full screen)"}),e.jsx("li",{children:"Three positions (left, right, center)"}),e.jsx("li",{children:"Customizable styling with className props"}),e.jsx("li",{children:"Keyboard navigation and accessibility"}),e.jsx("li",{children:"Click outside to close (disabled for full screen)"}),e.jsx("li",{children:"Smooth animations"}),e.jsx("li",{children:"Optional footer with actions"}),e.jsx("li",{children:"Full screen mode without margins or border radius"})]})]}),("left"===s||"right"===s||"full"===c)&&e.jsx("div",{className:"space-y-2",children:Array.from({length:20},(function(t,n){return e.jsxs("p",{className:"text-gray-600",children:["This is paragraph ",n+1," to demonstrate scrolling in side panels","full"===c?" and full screen mode":"","."]},n)}))})]})})]})},exports.Pagination=Pp,exports.RadioGroup=se,exports.SKELETON_LOADER_VERSION="1.0.0",exports.SKELETON_PATTERNS={userProfile:{variant:"avatar",size:"lg",animation:"pulse"},cardTitle:{variant:"text",width:"75%",height:"1.5rem"},cardDescription:{variant:"text",count:2,width:"100%",height:"1rem",intensity:"light"},button:{variant:"button",animation:"wave"},image:{variant:"image",shimmer:!0}},exports.SKELETON_PRESETS={sizes:{xs:{width:"4rem",height:"1rem"},sm:{width:"6rem",height:"1.25rem"},md:{width:"8rem",height:"1.5rem"},lg:{width:"12rem",height:"2rem"},xl:{width:"16rem",height:"2.5rem"}},variants:["text","rectangular","circular","rounded","card","avatar","button","image","line"],animations:["pulse","wave","none"],intensities:["light","medium","dark"]},exports.Search=function(n){var r=n.placeholder,o=void 0===r?"Search...":r,i=n.onSearch,s=n.className,a=void 0===s?"":s,l=t.useState(""),c=l[0],d=l[1];return e.jsxs("div",{className:"relative ".concat(a),children:[e.jsx("input",{type:"text",value:c,onChange:function(e){e.preventDefault(),d(e.target.value),i(c)},placeholder:o,className:"w-full rounded-lg border border-gray-200 bg-white py-2 pl-8 pr-4 text-sm focus:outline-none focus:ring-1 focus:ring-primary"}),e.jsxs("svg",{className:"absolute left-2 top-1/2 -translate-y-1/2 transform text-gray-400",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})]})},exports.Select=function(n){var r,o=n.options,i=n.placeholder,s=void 0===i?"Select an option":i,a=n.onChange,l=n.value,c=n.size,d=void 0===c?"md":c,h=n.className,u=void 0===h?"":h,p=n.name,f=n.id,m=n.disabled,g=void 0!==m&&m,y=n.label,v=n.required,b=n.error,w=n.helpText,k=n.fullWidth,N=void 0===k||k,S=n.searchable,C=void 0!==S&&S,M=n.multiple,j=void 0!==M&&M,T=n.maxSelected,E=n.showSelectedCount,O=void 0!==E&&E,A=n.closeOnSelect,D=n.showSelectAll,R=void 0===D||D,L=t.useState(!1),z=L[0],I=L[1],P=t.useState(""),B=P[0],$=P[1],V=t.useState("bottom"),F=V[0],H=V[1],_=void 0!==A?A:!j,q=t.useState((function(){if(!l)return[];if(j&&Array.isArray(l))return l.map((function(e){return o.find((function(t){return t.value==e}))})).filter(Boolean);if(!j){var e=o.find((function(e){return e.value==l}));return e?[e]:[]}return[]})),W=q[0],K=q[1],J=t.useRef(null),U=t.useRef(null);t.useEffect((function(){if(j&&Array.isArray(l))K(l.map((function(e){return o.find((function(t){return t.value==e}))})).filter(Boolean));else if(j)""!==l&&null!==l&&null!=l||K([]);else{var e=o.find((function(e){return e.value==l}));K(e?[e]:[])}}),[l,o,j]),t.useEffect((function(){if(z&&J.current){var e=J.current.getBoundingClientRect(),t=window.innerHeight-e.bottom,n=e.top;H(t<250&&n>250?"top":"bottom")}}),[z]);var G=C?o.filter((function(e){return(e.label||e.value).toLowerCase().includes(B.toLowerCase())})):o;t.useEffect((function(){var e=function(e){J.current&&!J.current.contains(e.target)&&(I(!1),$(""))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[]);var Y="top"===F?"bottom-full mb-1":"top-full mt-1";return e.jsxs("div",{ref:J,className:"".concat(N?"w-full":"w-fit"," mb-4"),children:[y&&e.jsxs("label",{htmlFor:f,className:"mb-1 block text-sm font-medium text-gray-700",children:[y,v&&e.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",className:"flex items-center justify-between rounded-lg border ".concat(b?"border-red-500":"border-gray-200"," bg-gray-100 shadow-sm ").concat({sm:"text-xs px-3 py-1.5 text-sm min-h-[32px]",md:"text-sm px-4 py-2 text-base min-h-[40px]",lg:"text-base px-4 py-3 text-lg min-h-[48px]"}[d]," text-gray-700 hover:border-gray-300 focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500/20 ").concat(g?"cursor-not-allowed bg-gray-50 opacity-50":""," ").concat(u," ").concat(N?"w-full":""," transition-all duration-200"),onClick:function(){return!g&&I(!z)},disabled:g,id:f,"aria-haspopup":"listbox","aria-expanded":z,children:[e.jsx("div",{className:"flex-1 flex items-center gap-1 min-w-0",children:j&&W.length>0?e.jsxs("div",{className:"flex flex-wrap gap-1 flex-1",children:[W.slice(0,3).map((function(t){return e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-primary-100 text-primary-800 text-sm rounded-md",children:[e.jsx("span",{className:"truncate max-w-[120px]",children:t.label||t.value}),e.jsx(Q,{className:"h-3 w-3 cursor-pointer hover:text-primary-900",onClick:function(e){return function(e,t){t.stopPropagation();var n=W.filter((function(t){return t.value!==e.value}));K(n);var r=j?n.map((function(e){return e.value})):"";a({target:{id:f||"",value:r}})}(t,e)}})]},t.value)})),W.length>3&&e.jsxs("span",{className:"text-sm text-gray-500 px-1",children:["+",W.length-3," more"]})]}):e.jsx("span",{className:"truncate ".concat(0===W.length?"text-gray-400":"text-gray-700"),children:function(){var e,t,n,r;return 0===W.length?s:j?O&&W.length>2?"".concat(W.length," items selected"):W.length<=2?W.map((function(e){return e.label||e.value})).join(", "):"".concat((null===(n=W[0])||void 0===n?void 0:n.label)||(null===(r=W[0])||void 0===r?void 0:r.value)," +").concat(W.length-1," more"):(null===(e=W[0])||void 0===e?void 0:e.label)||(null===(t=W[0])||void 0===t?void 0:t.value)}()})}),e.jsx(x,{className:"ml-2 h-4 w-4 text-gray-400 transition-transform flex-shrink-0 ".concat(z?"rotate-180 transform":"")})]}),z&&e.jsxs("div",{ref:U,className:"absolute z-[9999] w-full rounded-lg border border-gray-200 bg-white shadow-xl ".concat(Y),role:"listbox",style:{zIndex:9999,position:"absolute"},children:[C&&e.jsx("div",{className:"sticky top-0 border-b border-gray-100 bg-white p-3 z-[10000]",children:e.jsx("input",{type:"text",className:"w-full rounded-md border border-gray-200 px-3 py-2 text-sm focus:border-primary-500 focus:outline-none focus:ring-2 focus:ring-primary-500/20 transition-all duration-200",placeholder:"Search...",value:B,onChange:function(e){return $(e.target.value)},autoFocus:!0})}),e.jsx("div",{className:"max-h-60 overflow-auto py-1",children:G.length>0?e.jsxs(e.Fragment,{children:[j&&R&&e.jsxs("div",{className:"border-b border-gray-100",children:[e.jsxs("div",{className:"px-3 py-2 flex items-center justify-between",children:[e.jsx("button",{type:"button",onClick:function(){if(j){var e,t=G.filter((function(e){return!e.disabled}));if(t.every((function(e){return W.some((function(t){return t.value===e.value}))})))e=W.filter((function(e){return!t.some((function(t){return t.value===e.value}))}));else{var n=t.filter((function(e){return!W.some((function(t){return t.value===e.value}))}));if(void 0!==T){var r=T-W.length;e=oe(oe([],W,!0),n.slice(0,r),!0)}else e=oe(oe([],W,!0),n,!0)}K(e);var o=e.map((function(e){return e.value}));a({target:{id:f||"",value:o}})}},className:"text-sm font-medium text-primary-600 hover:text-primary-700 transition-colors",children:function(){if(!j||0===G.length)return!1;var e=G.filter((function(e){return!e.disabled}));return e.length>0&&e.every((function(e){return W.some((function(t){return t.value===e.value}))}))}()?"Deselect All":"Select All"}),W.length>0&&e.jsx("button",{type:"button",onClick:function(){j&&(K([]),a({target:{id:f||"",value:[]}}))},className:"text-sm font-medium text-gray-500 hover:text-gray-700 transition-colors",children:"Clear All"})]}),W.length>0&&e.jsxs("div",{className:"px-3 pb-2 text-xs text-gray-500",children:[W.length," selected",T&&" of ".concat(T," max")]})]}),G.map((function(t){var n=function(e){return W.some((function(t){return t.value===e.value}))}(t),r=t.disabled||void 0!==T&&!n&&W.length>=T;return e.jsxs("div",{className:"cursor-pointer px-3 py-2 flex items-center justify-between transition-colors duration-150 ".concat(n?"bg-primary-50 text-primary-700":"text-gray-700 hover:bg-gray-50"," ").concat(r?"cursor-not-allowed text-gray-400 hover:bg-white opacity-50":""),onClick:function(){return!r&&function(e){var t;if(!e.disabled){var n;if(j)if(W.some((function(t){return t.value===e.value})))n=W.filter((function(t){return t.value!==e.value}));else{if(T&&W.length>=T)return;n=oe(oe([],W,!0),[e],!1)}else n=[e];K(n);var r=j?n.map((function(e){return e.value})):(null===(t=n[0])||void 0===t?void 0:t.value)||"";a({target:{id:f||"",value:r}}),_&&(I(!1),$(""))}}(t)},role:"option","aria-selected":n,"aria-disabled":r,children:[e.jsx("span",{className:"flex-1 text-sm font-medium",children:t.label||t.value}),j&&n&&e.jsx("div",{className:"w-4 h-4 bg-primary-500 rounded-sm flex items-center justify-center",children:e.jsx("svg",{className:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20",children:e.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})]},t.value)}))]}):e.jsx("div",{className:"px-3 py-2 text-gray-500 text-center",children:"No options found"})})]})]}),b&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:b}),w&&!b&&e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:w}),p&&e.jsx(e.Fragment,{children:j?W.map((function(t,n){return e.jsx("input",{type:"hidden",name:"".concat(p,"[]"),value:t.value},"".concat(t.value,"-").concat(n))})):e.jsx("input",{type:"hidden",name:p,value:(null===(r=W[0])||void 0===r?void 0:r.value)||""})})]})},exports.SelectButton=function(n){var r=n.options,o=n.placeholder,i=void 0===o?"Select an option":o,s=n.onChange,a=n.value,l=n.size,c=void 0===l?"md":l,d=n.className,h=void 0===d?"":d,u=n.name,p=n.id,f=n.disabled,m=void 0!==f&&f,y=n.label,v=n.required,b=t.useState(!1),w=b[0],k=b[1],N=t.useState(a&&r.find((function(e){return e.value===a}))||null),S=N[0],C=N[1];return e.jsxs("div",{className:"relative ".concat(h),children:[y&&e.jsxs("label",{htmlFor:p,className:"mb-1 block text-sm font-medium text-gray-700",children:[y,v&&e.jsx("span",{className:"ml-1 text-red-500",children:"*"})]}),e.jsxs("button",{type:"button",className:"flex w-full items-center justify-between rounded-md border border-gray-200 bg-white shadow-sm ".concat({sm:"px-3 py-2 text-sm",md:"px-4 py-2.5 text-base"}[c]," text-gray-700 hover:bg-gray-50 focus:outline-none ").concat(m?"cursor-not-allowed opacity-50":""),onClick:function(){return!m&&k(!w)},disabled:m,id:p,children:[e.jsx("span",{className:"truncate",children:S?(null==S?void 0:S.label)||S.value:i}),e.jsx(x,{className:"ml-2 h-4 w-4 ".concat(w?"rotate-180 transform":"")})]}),w&&e.jsx("div",{className:"absolute z-10 mt-1 max-h-60 w-full min-w-[200px] p-1 font-medium text-sm overflow-auto rounded-lg bg-white shadow-xl",children:r.map((function(t){return e.jsxs("div",{className:"cursor-pointer px-3 py-2 hover:bg-gray-100 rounded-lg flex justify-between item-center ".concat((null==S?void 0:S.value)===t.value?"bg-gray-50 text-black":"text-gray-900"),onClick:function(){return function(e){C(e),s(e.value),k(!1)}(t)},children:[e.jsx("div",{children:t.label||t.value}),(null==S?void 0:S.value)===t.value&&e.jsx("div",{children:e.jsx(g,{size:15,className:"text-blue-600"})})]},t.value)}))}),u&&e.jsx("input",{type:"hidden",name:u,value:(null==S?void 0:S.value)||""})]})},exports.SkeletonAvatar=_p,exports.SkeletonButton=qp,exports.SkeletonCard=function(t){return e.jsx(Fp,ne({},t,{variant:"card"}))},exports.SkeletonImage=function(t){return e.jsx(Fp,ne({},t,{variant:"image"}))},exports.SkeletonList=Kp,exports.SkeletonLoader=Fp,exports.SkeletonLoaderExample=function(){return e.jsxs("div",{className:"bg-white p-5",children:[e.jsx(Fp,{variant:"text",width:"200px"}),e.jsx(Fp,{variant:"text",count:3}),e.jsx(_p,{size:"lg"}),e.jsx(qp,{animation:"wave"}),e.jsx(Wp,{showBio:!0}),e.jsx(Kp,{itemCount:5,showAvatar:!0}),e.jsx(Jp,{rows:5,columns:4}),e.jsx(Fp,{variant:"card",shimmer:!0,intensity:"dark",borderRadius:"12px",className:"custom-skeleton"})]})},exports.SkeletonProfile=Wp,exports.SkeletonTable=Jp,exports.SkeletonText=Hp,exports.Table=function(n){var r=n.data,o=n.columns,i=n.itemsPerPage,s=void 0===i?20:i,a=n.onViewChange,l=n.totalItems,c=n.currentPage,d=void 0===c?1:c,h=n.onPageChange,u=n.loading,p=void 0!==u&&u,f=n.showPagination,m=void 0===f||f,g=n.onRowClick,y=n.useCardLayout,b=void 0!==y&&y,w=n.emptyState,k=n.expandableRows,N=void 0!==k&&k,S=n.expandedRowRender,C=n.onRowToggle,M=n.defaultExpandedRows,j=void 0===M?new Set:M,T=n.getRowKey,E=void 0===T?function(e,t){return t}:T,O=n.paginationMeta,A=t.useState(j),D=A[0],R=A[1],L=(null==O?void 0:O.total)||l||r.length,z=(null==O?void 0:O.last_page)||Math.ceil(L/s),I=(null==O?void 0:O.current_page)||d,P=(null==O?void 0:O.per_page)||s,B=r,$=function(e,t){N&&S?V(e,t):g&&g(e)},V=function(e,t){var n=E(e,t),r=new Set(D),o=D.has(n);o?r.delete(n):r.add(n),R(r),C&&C(e,!o)},F=function(e,t){var n=E(e,t);return D.has(n)},H=e.jsx(te,{title:"No Record found"}),_=function(){return e.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",children:[p&&Array.from({length:P}).map((function(t,n){return e.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-4 animate-pulse",children:e.jsx("div",{className:"space-y-3",children:o.slice(0,3).map((function(t,n){return e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/3"}),e.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/2"})]},n)}))})},n)})),B.length>0?B.map((function(t,n){var r=F(t,n);return e.jsxs("div",{className:"bg-white rounded-lg border border-gray-200",children:[e.jsx("div",{onClick:function(){return $(t,n)},className:"p-4 transition-all duration-200 hover:shadow-md hover:border-gray-300 ".concat(g||N?"cursor-pointer":""," ").concat(p?"opacity-50":""," ").concat(N?"border-b border-gray-100 last:border-b-0":""),children:e.jsxs("div",{className:"space-y-3",children:[N&&e.jsx("div",{className:"flex items-center justify-between mb-2",children:e.jsxs("div",{className:"flex items-center text-sm text-gray-500",children:[r?e.jsx(x,{size:16,className:"mr-1"}):e.jsx(v,{size:16,className:"mr-1"}),e.jsx("span",{children:r?"Hide details":"Show details"})]})}),o.map((function(n,r){return e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-500 flex-shrink-0 mr-3",children:[n.title,":"]}),e.jsx("span",{className:"text-sm text-gray-800 text-right",children:"function"==typeof n.value?n.value(t):t[n.value]})]},r)}))]})}),N&&r&&S&&e.jsx("div",{className:"p-4 bg-gray-50 border-t border-gray-100 rounded-b-lg",children:S(t)})]},n)})):!p&&e.jsx("div",{className:"col-span-full",children:w||H})]})};return e.jsxs(e.Fragment,{children:[b?_():e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block",children:e.jsx("div",{className:"relative overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[N&&e.jsx("th",{className:"bg-gray-100 px-6 py-3 text-left text-sm font-semibold tracking-wider text-gray-500 w-12 rounded-bl-xl rounded-tl-xl"}),o.map((function(t,n){return e.jsx("th",{className:"bg-gray-100 px-6 py-3 text-left text-sm font-semibold tracking-wider text-gray-500 ".concat(t.width||""," ").concat(N||0!==n?"":"rounded-bl-xl rounded-tl-xl"," ").concat(n===o.length-1?"rounded-br-xl rounded-tr-xl":""," "),children:t.title},n)}))]})}),e.jsxs("tbody",{className:"divide-y divide-gray-200 bg-white\n ".concat(p?"opacity-50":""," ").concat(g||N?"cursor-pointer":"","\n "),children:[p&&e.jsx(Bp,{columns:o.length+(N?1:0),rows:P}),B.length>0?B.map((function(t,n){var r=F(t,n);return e.jsxs(e.Fragment,{children:[e.jsxs("tr",{onClick:function(){return $(t,n)},className:"hover:bg-gray-50 transition-colors duration-150 ".concat(r?"bg-blue-50":""),children:[N&&e.jsx("td",{className:"whitespace-nowrap px-6 py-4 text-sm font-medium text-gray-800",children:e.jsx("div",{className:"flex items-center justify-center",children:r?e.jsx(x,{size:16,className:"text-gray-500"}):e.jsx(v,{size:16,className:"text-gray-500"})})}),o.map((function(n,r){return e.jsx("td",{className:"whitespace-nowrap px-6 py-4 text-sm font-medium text-gray-800",children:"function"==typeof n.value?n.value(t):t[n.value]},r)}))]},n),N&&r&&S&&e.jsx("tr",{className:"bg-gray-50",children:e.jsx("td",{colSpan:o.length+1,className:"px-6 py-4",children:e.jsx("div",{className:"animate-fade-in",children:S(t)})})},"".concat(n,"-expanded"))]})})):!p&&e.jsx("tr",{children:e.jsx("td",{colSpan:o.length+(N?1:0),className:"px-6 py-12 text-center",children:w||H})})]})]})})}),e.jsx("div",{className:"block md:hidden",children:_()})]}),m&&e.jsx(Pp,{currentPage:I,totalPages:z,totalItems:L,itemsPerPage:P,onPageChange:h,onViewChange:a,loading:p})]})},exports.TableDropdown=function(r){var o=r.actions,i=r.trigger,s=r.className,a=void 0===s?"":s,l=r.dropdownClassName,c=void 0===l?"":l,d=t.useState(!1),h=d[0],u=d[1],p=t.useState({top:0,left:0}),f=p[0],m=p[1],g=t.useRef(null),x=t.useRef(null),y=function(){u(!h)},v=function(){u(!1)};t.useEffect((function(){if(h&&x.current){var e=x.current.getBoundingClientRect(),t=window.innerHeight-e.bottom,n=e.top;m({top:t<300&&n>t?e.top-300+window.scrollY:e.bottom+window.scrollY,left:e.right-192+window.scrollX})}}),[h]),t.useEffect((function(){var e=function(e){g.current&&!g.current.contains(e.target)&&x.current&&!x.current.contains(e.target)&&v()};return h&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[h]),t.useEffect((function(){var e=function(e){"Escape"===e.key&&v()};return h&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[h]),t.useEffect((function(){var e=function(){if(h&&x.current){var e=x.current.getBoundingClientRect(),t=window.innerHeight-e.bottom,n=e.top;m({top:t<300&&n>t?e.top-300+window.scrollY:e.bottom+window.scrollY,left:e.right-192+window.scrollX})}};return h&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}}),[h]);var b=h&&e.jsx("div",{ref:g,className:"fixed z-[9999] w-48 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none ".concat(c),style:{top:"".concat(f.top,"px"),left:"".concat(f.left,"px")},children:e.jsxs("div",{className:"py-1",role:"menu","aria-orientation":"vertical",children:[o.map((function(t,n){return e.jsxs("button",{className:"flex w-full items-center px-4 py-2 text-left text-sm transition-colors duration-150 ".concat(t.disabled?"cursor-not-allowed bg-gray-50 text-gray-400":"danger"===t.variant?"text-red-700 hover:bg-red-50 hover:text-red-900":"text-gray-700 hover:bg-gray-100 hover:text-gray-900"," "),onClick:function(){return function(e){e.disabled||(e.onClick(),v())}(t)},disabled:t.disabled,role:"menuitem",children:[t.icon&&e.jsx("span",{className:"mr-3 flex-shrink-0",children:t.icon}),t.label]},n)})),0===o.length&&e.jsx("div",{className:"px-4 py-2 text-sm text-gray-500",children:"No actions available"})]})});return e.jsxs("div",{className:"relative inline-block ".concat(a),children:[e.jsx("div",{ref:x,className:"flex",children:i?e.jsx("div",{onClick:y,className:"cursor-pointer",children:i}):e.jsx("button",{className:"rounded-md border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-700 transition-colors duration-200 focus:ring-offset-2",onClick:y,"aria-expanded":h,"aria-haspopup":"true",children:e.jsx(C,{className:"h-4 w-4"})})}),"undefined"!=typeof document&&b&&n.createPortal(b,document.body)]})},exports.TableSkeleton=Bp,exports.TagInput=le,exports.TagInputDemo=function(){var n=t.useState([]),r=n[0],o=n[1],i=t.useState([]),s=i[0],a=i[1];return e.jsxs("div",{className:"max-w-2xl mx-auto p-6 bg-gray-50 min-h-screen",children:[e.jsx("h1",{className:"text-2xl font-bold mb-8 text-gray-900",children:"TagInput Component Demo"}),e.jsxs("div",{className:"space-y-8",children:[e.jsx(le,{id:"skills",label:"Skills & Technologies",value:r,onChange:o,predefinedTags:[{label:"React",value:"react"},{label:"JavaScript",value:"javascript"},{label:"TypeScript",value:"typescript"},{label:"Node.js",value:"nodejs"},{label:"Python",value:"python"},{label:"CSS",value:"css"},{label:"HTML",value:"html"},{label:"Vue.js",value:"vuejs"},{label:"Angular",value:"angular"},{label:"Next.js",value:"nextjs"}],placeholder:"Search or add skills...",helpText:"Select from predefined options or add your own custom tags",size:"md"}),e.jsx(le,{id:"custom-tags",label:"Project Categories (Custom Colors)",value:s,onChange:a,predefinedTags:[{label:"Web Development",value:"web"},{label:"Mobile App",value:"mobile"},{label:"AI/ML",value:"ai"},{label:"UI/UX Design",value:"design"}],placeholder:"Add project categories...",tagBackgroundColor:"bg-purple-500",tagTextColor:"text-white",maxTags:5,size:"lg",helpText:"Maximum 5 tags allowed with custom purple styling"}),e.jsxs("div",{className:"mt-8 p-4 bg-white rounded-lg border",children:[e.jsx("h3",{className:"font-medium mb-2",children:"Selected Skills:"}),e.jsx("pre",{className:"text-sm bg-gray-100 p-2 rounded",children:JSON.stringify(r,null,2)})]}),e.jsxs("div",{className:"p-4 bg-white rounded-lg border",children:[e.jsx("h3",{className:"font-medium mb-2",children:"Selected Categories:"}),e.jsx("pre",{className:"text-sm bg-gray-100 p-2 rounded",children:JSON.stringify(s,null,2)})]})]})]})},exports.TextEditor=function(t){var n=t.initialContent,r=void 0===n?"":n,o=t.onUpdate,i=Ku({extensions:[Ap.configure({heading:!1,codeBlock:!1}),ed,pu,vu,wc,ld,wu,xu,Uc,Qc.configure({HTMLAttributes:{class:"bg-gray-100 p-3 rounded text-sm font-mono"}}),nd.configure({levels:[1,2,3]}),qc,hu,du,cu.configure({openOnClick:!1,HTMLAttributes:{class:"text-blue-600 underline"}})],content:r,onUpdate:function(e){var t=e.editor;o(t.getHTML())},editorProps:{attributes:{class:"prose prose-sm sm:prose lg:prose-lg xl:prose-2xl mx-auto focus:outline-none min-h-[200px] p-4"}},immediatelyRender:!1});return i?e.jsxs("div",{className:"rounded-lg border border-gray-200 shadow-sm",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1 border-b bg-gray-50 p-3",children:[e.jsx("button",{onClick:function(){return i.chain().focus().undo().run()},className:"p-2 rounded hover:bg-gray-200 transition-colors ".concat(i.can().undo()?"":"opacity-50 cursor-not-allowed"),type:"button",disabled:!i.can().undo(),title:"Undo",children:e.jsx(G,{size:16})}),e.jsx("button",{onClick:function(){return i.chain().focus().redo().run()},className:"p-2 rounded hover:bg-gray-200 transition-colors ".concat(i.can().redo()?"":"opacity-50 cursor-not-allowed"),type:"button",disabled:!i.can().redo(),title:"Redo",children:e.jsx(_,{size:16})}),e.jsx("div",{className:"mx-2 h-6 w-px bg-gray-300"}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleHeading({level:1}).run()},className:"p-2 rounded transition-colors ".concat(i.isActive("heading",{level:1})?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Heading 1",children:e.jsx(D,{size:16})}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleHeading({level:2}).run()},className:"p-2 rounded transition-colors ".concat(i.isActive("heading",{level:2})?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Heading 2",children:e.jsx(R,{size:16})}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleHeading({level:3}).run()},className:"p-2 rounded transition-colors ".concat(i.isActive("heading",{level:3})?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Heading 3",children:e.jsx(L,{size:16})}),e.jsx(q,{className:"mx-2 h-6 w-px bg-gray-300"}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleBold().run()},className:"p-2 rounded transition-colors ".concat(i.isActive("bold")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Bold",children:e.jsx(m,{size:16})}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleItalic().run()},className:"p-2 rounded transition-colors ".concat(i.isActive("italic")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Italic",children:e.jsx(I,{size:16})}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleUnderline().run()},className:"p-2 rounded transition-colors ".concat(i.isActive("underline")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Underline",children:e.jsx(U,{size:16})}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleStrike().run()},className:"p-2 rounded transition-colors ".concat(i.isActive("strike")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Strikethrough",children:e.jsx(W,{size:16})}),e.jsx(q,{className:"mx-2 h-6 w-px bg-gray-300"}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleBulletList().run()},className:"p-2 rounded transition-colors ".concat(i.isActive("bulletList")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Bullet List",children:e.jsx($,{size:16})}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleOrderedList().run()},className:"p-2 rounded transition-colors ".concat(i.isActive("orderedList")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Numbered List",children:e.jsx(B,{size:16})}),e.jsx(q,{className:"mx-2 h-6 w-px bg-gray-300"}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleCode().run()},className:"p-2 rounded transition-colors ".concat(i.isActive("code")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Inline Code",children:e.jsx(N,{size:16})}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleCodeBlock().run()},className:"p-2 rounded transition-colors ".concat(i.isActive("codeBlock")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Code Block",children:e.jsx(j,{size:16})}),e.jsx(q,{className:"mx-2 h-6 w-px bg-gray-300"}),e.jsx("button",{onClick:function(){return i.chain().focus().toggleBlockquote().run()},className:"p-2 rounded transition-colors ".concat(i.isActive("blockquote")?"bg-blue-200 text-blue-800":"hover:bg-gray-200"),type:"button",title:"Quote",children:e.jsx(H,{size:16})}),e.jsx(q,{className:"mx-2 h-6 w-px bg-gray-300"}),i.isActive("link")?e.jsx("button",{onClick:function(){null==i||i.chain().focus().unsetLink().run()},className:"p-2 rounded bg-blue-200 text-blue-800 hover:bg-blue-300 transition-colors",type:"button",title:"Remove Link",children:e.jsx(P,{size:16})}):e.jsx("button",{onClick:function(){var e=window.prompt("Enter URL:");e&&(null==i||i.chain().focus().setLink({href:e}).run())},className:"p-2 rounded hover:bg-gray-200 transition-colors",type:"button",title:"Add Link",children:e.jsx(P,{size:16})})]}),e.jsx($u,{editor:i,className:"min-h-[300px] focus-within:bg-white"})]}):e.jsx("div",{className:"rounded-lg border bg-gray-50 h-48 animate-pulse"})},exports.Tooltip=function(n){var r=n.children,o=n.content,i=n.position,s=void 0===i?"top":i,a=n.variant,l=void 0===a?"light":a,c=n.size,d=void 0===c?"md":c,h=n.delay,u=void 0===h?200:h,p=n.disabled,f=void 0!==p&&p,m=n.className,g=void 0===m?"":m,x=t.useState(!1),y=x[0],v=x[1],b=t.useState(s),w=b[0],k=b[1],N=t.useRef(null),S=t.useRef(null),C=t.useRef(null);t.useEffect((function(){if(y&&S.current&&C.current){var e=S.current,t=C.current.getBoundingClientRect(),n=e.getBoundingClientRect(),r=s;"top"===s&&t.top-n.height<10?r="bottom":"bottom"===s&&t.bottom+n.height>window.innerHeight-10?r="top":"left"===s&&t.left-n.width<10?r="right":"right"===s&&t.right+n.width>window.innerWidth-10&&(r="left"),k(r)}}),[y,s]);var M=function(){f||(N.current&&clearTimeout(N.current),N.current=setTimeout((function(){v(!0)}),u))},j=function(){N.current&&clearTimeout(N.current),v(!1)};t.useEffect((function(){return function(){N.current&&clearTimeout(N.current)}}),[]);var T={dark:{tooltip:"bg-gray-900 text-white border-gray-700",arrow:{top:"border-t-gray-900",bottom:"border-b-gray-900",left:"border-l-gray-900",right:"border-r-gray-900"}},light:{tooltip:"bg-white text-gray-900 border-gray-200 shadow-lg",arrow:{top:"border-t-white",bottom:"border-b-white",left:"border-l-white",right:"border-r-white"}},accent:{tooltip:"bg-blue-600 text-white border-blue-500",arrow:{top:"border-t-blue-600",bottom:"border-b-blue-600",left:"border-l-blue-600",right:"border-r-blue-600"}}};return f||!o?e.jsx(e.Fragment,{children:r}):e.jsxs("div",{className:"relative inline-block",children:[e.jsx("div",{ref:C,onMouseEnter:M,onMouseLeave:j,onFocus:M,onBlur:j,className:"cursor-help",children:r}),y&&e.jsxs("div",{ref:S,className:"absolute z-50 ".concat({top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"}[w]," ").concat(T[l].tooltip," ").concat({sm:"px-2 py-1 text-xs",md:"px-3 py-2 text-sm",lg:"px-4 py-3 text-base"}[d]," animate-in fade-in-0 zoom-in-95 max-w-xs whitespace-nowrap break-words rounded-lg border font-medium backdrop-blur-sm duration-200 ").concat(g," "),role:"tooltip","aria-hidden":"false",children:[o,e.jsx("div",{className:"absolute h-0 w-0 border-4 ".concat({top:"top-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-b-transparent",bottom:"bottom-full left-1/2 -translate-x-1/2 border-l-transparent border-r-transparent border-t-transparent",left:"left-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent",right:"right-full top-1/2 -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent"}[w]," ").concat(T[l].arrow[w]," ")})]})]})},exports.alert=zp,exports.useAlert=function(){var e=t.useContext(Lp);if(void 0===e)throw new Error("useAlert must be used within a AlertProvider");return e};
|
|
51
51
|
//# sourceMappingURL=index.js.map
|