@nice2dev/ui-presentations 1.0.5 → 1.0.8
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/NiceSavedQueryPanel-CUAsdOjJ-CluPYvkx.cjs +596 -0
- package/dist/NiceSavedQueryPanel-CUAsdOjJ-DoBn1dP8.js +6078 -0
- package/dist/NiceSavedQueryPanel-DUw8plYP-9P_gnuUz.js +5568 -0
- package/dist/NiceSavedQueryPanel-DUw8plYP-DtmUEWvh.cjs +596 -0
- package/dist/NiceStockChart-Cpmv9_Cc-DBqGppkm.cjs +287 -0
- package/dist/NiceStockChart-Cpmv9_Cc-DbDw3MKe.js +2246 -0
- package/dist/index-BQJzPBop.js +34168 -0
- package/dist/index-BaBBRokT.cjs +863 -0
- package/dist/index-CIl98Vbm-D5_blXJt.js +46639 -0
- package/dist/index-CIl98Vbm-DPDdqp0C.cjs +4993 -0
- package/dist/index-CNwVELPJ-CJET50oR.js +37303 -0
- package/dist/index-CNwVELPJ-CNlww_AU.cjs +5243 -0
- package/dist/index-DJMo5hmg.js +40303 -0
- package/dist/index-DrkeMHRo.cjs +1401 -0
- package/dist/index.cjs +1 -6986
- package/dist/index.mjs +165 -78128
- package/package.json +1 -1
|
@@ -0,0 +1,863 @@
|
|
|
1
|
+
"use strict";const a=require("react/jsx-runtime"),o=require("react");class Gt{constructor(t){this.undoStack=[],this.redoStack=[],this.listeners=new Set,this.maxHistory=100,this.doc=t??Gt.createEmpty()}static createEmpty(t="Untitled Presentation"){const n=new Date().toISOString(),i={id:tt(),title:"Title Slide",layout:"titleSlide",background:{type:"solid",color:"#ffffff"},elements:[{id:tt(),type:"text",position:{x:10,y:30,width:80,height:20},content:{kind:"text",text:t,fontSize:48,fontWeight:"bold",textAlign:"center"}},{id:tt(),type:"text",position:{x:20,y:55,width:60,height:10},content:{kind:"text",text:"Subtitle",fontSize:24,textAlign:"center",fontColor:"#666666"}}]};return{version:"1.0",id:tt(),title:t,slideSize:{width:1920,height:1080},slides:[i],theme:{name:"NiceToDev",backgroundColor:"#f8f9fa",primaryColor:"#6366f1",secondaryColor:"#8b5cf6",accentColor:"#06b6d4",textColor:"#334155",headingColor:"#1e293b",fontFamily:"Inter, sans-serif",headingFontFamily:'"Plus Jakarta Sans", Inter, sans-serif',codeFontFamily:'"Fira Code", monospace'},metadata:{createdAt:n,updatedAt:n}}}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(){this.doc.metadata.updatedAt=new Date().toISOString(),this.listeners.forEach(t=>t())}pushUndo(t){this.undoStack.push({label:t,snapshot:JSON.stringify(this.doc)}),this.undoStack.length>this.maxHistory&&this.undoStack.shift(),this.redoStack.length=0}undo(){const t=this.undoStack.pop();t&&(this.redoStack.push({label:"redo",snapshot:JSON.stringify(this.doc)}),this.doc=JSON.parse(t.snapshot),this.notify())}redo(){const t=this.redoStack.pop();t&&(this.undoStack.push({label:"undo",snapshot:JSON.stringify(this.doc)}),this.doc=JSON.parse(t.snapshot),this.notify())}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}getDocument(){return this.doc}getSlides(){return this.doc.slides}getSlide(t){return this.doc.slides.find(n=>n.id===t)}getTheme(){return this.doc.theme}loadDocument(t){this.pushUndo("loadDocument"),this.doc=JSON.parse(JSON.stringify(t)),this.notify()}addSlide(t,n="titleContent"){this.pushUndo("addSlide");const i={id:tt(),title:`Slide ${this.doc.slides.length+1}`,layout:n,background:{type:"solid",color:this.doc.theme.backgroundColor},elements:[]},r=t!==void 0?t+1:this.doc.slides.length;return this.doc.slides.splice(r,0,i),this.notify(),i}removeSlide(t){this.pushUndo("removeSlide"),this.doc.slides=this.doc.slides.filter(n=>n.id!==t),this.notify()}moveSlide(t,n){const i=this.doc.slides.findIndex(s=>s.id===t);if(i===-1||i===n)return;this.pushUndo("moveSlide");const[r]=this.doc.slides.splice(i,1);this.doc.slides.splice(n,0,r),this.notify()}duplicateSlide(t){const n=this.getSlide(t);if(!n)return null;this.pushUndo("duplicateSlide");const i=JSON.parse(JSON.stringify(n));i.id=tt(),i.title=`${n.title} (copy)`,i.elements.forEach(s=>{s.id=tt()});const r=this.doc.slides.findIndex(s=>s.id===t);return this.doc.slides.splice(r+1,0,i),this.notify(),i}updateSlide(t,n){const i=this.doc.slides.find(r=>r.id===t);i&&(this.pushUndo("updateSlide"),Object.assign(i,n),this.notify())}addElement(t,n){const i=this.doc.slides.find(s=>s.id===t);if(!i)return null;this.pushUndo("addElement");const r={...n,id:tt()};return i.elements.push(r),this.notify(),r}updateElement(t,n,i){const r=this.doc.slides.find(l=>l.id===t);if(!r)return;const s=r.elements.find(l=>l.id===n);s&&(this.pushUndo("updateElement"),Object.assign(s,i),this.notify())}removeElement(t,n){const i=this.doc.slides.find(r=>r.id===t);i&&(this.pushUndo("removeElement"),i.elements=i.elements.filter(r=>r.id!==n),this.notify())}moveElement(t,n,i){this.updateElement(t,n,{position:i})}setTheme(t){this.pushUndo("setTheme"),this.doc.theme={...t},this.notify()}}function tt(){return`ndp_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}function Aa(e){const t=o.useRef(null);t.current||(t.current=new Gt(e));const n=t.current,[,i]=o.useState(0),r=o.useCallback(()=>i(d=>d+1),[]),[s,l]=o.useState(0);o.useEffect(()=>n.subscribe(r),[n,r]);const c=n.getDocument();return o.useMemo(()=>({document:c,slides:c.slides,theme:c.theme,currentSlideIndex:s,currentSlide:c.slides[s],setCurrentSlideIndex:l,addSlide:(d,u)=>n.addSlide(d,u),removeSlide:d=>n.removeSlide(d),moveSlide:(d,u)=>n.moveSlide(d,u),duplicateSlide:d=>n.duplicateSlide(d),updateSlide:(d,u)=>n.updateSlide(d,u),addElement:(d,u)=>n.addElement(d,u),updateElement:(d,u,y)=>n.updateElement(d,u,y),removeElement:(d,u)=>n.removeElement(d,u),moveElement:(d,u,y)=>n.moveElement(d,u,y),setTheme:d=>n.setTheme(d),undo:()=>n.undo(),redo:()=>n.redo(),canUndo:n.canUndo(),canRedo:n.canRedo(),loadDocument:d=>n.loadDocument(d),model:n}),[c,n,s])}function gn(e){return e.series&&e.series.length>0?e.series:e.datasets&&e.datasets.length>0?e.datasets.map(t=>({name:t.label??"",values:t.data,color:t.color??t.backgroundColor})):[]}function Fa(e,t,n){const i=e.data,r=e.options??{},s=r.colors??["#6366f1","#06b6d4","#10b981","#f59e0b","#ef4444","#8b5cf6"];switch(e.chartType){case"bar":return na(i,t,n,s,r);case"line":return Ar(i,t,n,s);case"pie":case"doughnut":return Fr(i,t,n,s,e.chartType==="doughnut");default:return na(i,t,n,s,r)}}function na(e,t,n,i,r){const s={top:20,right:20,bottom:40,left:50},l=t-s.left-s.right,c=n-s.top-s.bottom,d=gn(e),u=d.flatMap(v=>v.values),y=Math.max(...u,1),f=e.labels.length,p=d.length,m=l/f,w=m*.7/p,k=m*.15,z=[],$=[];for(let v=0;v<f;v++){const N=s.left+v*m;$.push(`<text x="${N+m/2}" y="${n-10}" text-anchor="middle" font-size="11" fill="#666">${yn(e.labels[v])}</text>`);for(let j=0;j<p;j++){const D=(d[j].values[v]??0)/y*c,b=N+k+j*w,T=s.top+c-D,R=d[j].color??i[j%i.length];z.push(`<rect x="${b}" y="${T}" width="${w}" height="${D}" fill="${R}" rx="2" />`)}}const g=[];for(let v=0;v<=4;v++){const N=Math.round(y/4*v),j=s.top+c-v/4*c;g.push(`<text x="${s.left-8}" y="${j+4}" text-anchor="end" font-size="10" fill="#999">${N}</text>`),r.showGrid!==!1&&g.push(`<line x1="${s.left}" y1="${j}" x2="${s.left+l}" y2="${j}" stroke="#eee" />`)}return`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${n}">
|
|
2
|
+
${g.join(`
|
|
3
|
+
`)}
|
|
4
|
+
${z.join(`
|
|
5
|
+
`)}
|
|
6
|
+
${$.join(`
|
|
7
|
+
`)}
|
|
8
|
+
</svg>`}function Ar(e,t,n,i,r){const s={top:20,right:20,bottom:40,left:50},l=t-s.left-s.right,c=n-s.top-s.bottom,d=gn(e),u=d.flatMap(k=>k.values),y=Math.max(...u,1),f=e.labels.length,p=l/Math.max(f-1,1),m=[];for(let k=0;k<d.length;k++){const z=d[k].color??i[k%i.length],$=d[k].values.map((g,v)=>{const N=s.left+v*p,j=s.top+c-g/y*c;return`${N},${j}`});m.push(`<polyline points="${$.join(" ")}" fill="none" stroke="${z}" stroke-width="2" />`),d[k].values.forEach((g,v)=>{const N=s.left+v*p,j=s.top+c-g/y*c;m.push(`<circle cx="${N}" cy="${j}" r="3" fill="${z}" />`)})}const w=e.labels.map((k,z)=>`<text x="${s.left+z*p}" y="${n-10}" text-anchor="middle" font-size="11" fill="#666">${yn(k)}</text>`);return`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${n}">
|
|
9
|
+
${m.join(`
|
|
10
|
+
`)}
|
|
11
|
+
${w.join(`
|
|
12
|
+
`)}
|
|
13
|
+
</svg>`}function Fr(e,t,n,i,r){const s=gn(e);if(s.length===0)return`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${n}" />`;const l=s[0].values,c=l.reduce((w,k)=>w+k,0)||1,d=t/2,u=n/2,y=Math.min(t,n)*.38,f=r?y*.55:0,p=[];let m=-Math.PI/2;return l.forEach((w,k)=>{const z=w/c*Math.PI*2,$=m+z,g=z>Math.PI?1:0,v=i[k%i.length],N=d+y*Math.cos(m),j=u+y*Math.sin(m),I=d+y*Math.cos($),D=u+y*Math.sin($);if(r){const M=d+f*Math.cos(m),S=u+f*Math.sin(m),x=d+f*Math.cos($),P=u+f*Math.sin($);p.push(`<path d="M ${N} ${j} A ${y} ${y} 0 ${g} 1 ${I} ${D} L ${x} ${P} A ${f} ${f} 0 ${g} 0 ${M} ${S} Z" fill="${v}" />`)}else p.push(`<path d="M ${d} ${u} L ${N} ${j} A ${y} ${y} 0 ${g} 1 ${I} ${D} Z" fill="${v}" />`);const b=m+z/2,T=y*1.15,R=d+T*Math.cos(b),L=u+T*Math.sin(b);e.labels[k]&&p.push(`<text x="${R}" y="${L}" text-anchor="middle" font-size="11" fill="#444">${yn(e.labels[k])}</text>`),m=$}),`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${n}">
|
|
14
|
+
${p.join(`
|
|
15
|
+
`)}
|
|
16
|
+
</svg>`}function yn(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}const mt=({slide:e,slideSize:t,theme:n,scale:i=1,selectedElementId:r,onSelectElement:s,onElementDrag:l,onElementResize:c,onElementRotate:d,interactive:u=!1,showGrid:y=!1,gridSnap:f=0,className:p})=>{const[m,w]=o.useState(null),[k,z]=o.useState(null),$=b=>f>0?Math.round(b/f)*f:b,g=o.useMemo(()=>{const b=e.background;if(b.type==="gradient"&&b.gradientStops){const T=b.gradientStops.map(R=>`${R.color} ${R.position*100}%`).join(", ");return{background:`linear-gradient(${b.gradientDirection??180}deg, ${T})`}}return b.type==="image"&&b.imageUrl?{backgroundImage:`url(${b.imageUrl})`,backgroundSize:b.imageFit??"cover",backgroundPosition:"center",backgroundColor:b.color??n.backgroundColor}:{backgroundColor:b.color??n.backgroundColor}},[e.background,n.backgroundColor]),v=o.useCallback((b,T)=>{!u||T.locked||(b.stopPropagation(),s==null||s(T.id),w({id:T.id,startX:b.clientX,startY:b.clientY,elStartX:T.position.x,elStartY:T.position.y}))},[u,s]),N=o.useCallback(b=>{if(m&&l){const T=(b.clientX-m.startX)/i,R=(b.clientY-m.startY)/i,L=$(m.elStartX+T/t.width*100),M=$(m.elStartY+R/t.height*100);l(m.id,L,M)}if(k&&c){const T=(b.clientX-k.startX)/i/t.width*100,R=(b.clientY-k.startY)/i/t.height*100,L=k.elPos;let{x:M,y:S,width:x,height:P}=L;const A=k.handle;A.includes("e")&&(x=$(Math.max(2,L.width+T))),A.includes("w")&&(x=$(Math.max(2,L.width-T)),M=$(L.x+(L.width-x))),A.includes("s")&&(P=$(Math.max(2,L.height+R))),A.includes("n")&&(P=$(Math.max(2,L.height-R)),S=$(L.y+(L.height-P))),c(k.id,x,P,M,S)}},[m,k,l,c,i,t,$]),j=o.useCallback(()=>{w(null),z(null)},[]),I=o.useCallback((b,T,R)=>{u&&(b.stopPropagation(),b.preventDefault(),z({id:T.id,handle:R,startX:b.clientX,startY:b.clientY,elPos:{...T.position}}))},[u]),D=o.useCallback(b=>{b.target.classList.contains("nice-slide-canvas__surface")&&(s==null||s(null))},[s]);return a.jsxs("div",{className:`nice-slide-canvas ${p??""}`,style:{width:t.width*i,height:t.height*i,position:"relative",overflow:"hidden",boxShadow:"0 2px 12px rgba(0,0,0,0.15)",borderRadius:4,...g,color:n.textColor,fontFamily:n.fontFamily},onMouseMove:N,onMouseUp:j,onMouseLeave:j,onClick:D,children:[a.jsx("div",{className:"nice-slide-canvas__surface",style:{width:"100%",height:"100%",position:"absolute"}}),y&&a.jsx("svg",{style:{position:"absolute",inset:0,width:"100%",height:"100%",pointerEvents:"none",opacity:.15},children:Array.from({length:9},(b,T)=>{const R=(T+1)*10;return a.jsxs(o.Fragment,{children:[a.jsx("line",{x1:`${R}%`,y1:"0",x2:`${R}%`,y2:"100%",stroke:"#666",strokeWidth:"0.5"}),a.jsx("line",{x1:"0",y1:`${R}%`,x2:"100%",y2:`${R}%`,stroke:"#666",strokeWidth:"0.5"})]},T)})}),[...e.elements].sort((b,T)=>(b.zIndex??0)-(T.zIndex??0)).map(b=>a.jsx(Rr,{element:b,slideSize:t,scale:i,theme:n,isSelected:r===b.id,onMouseDown:T=>v(T,b),onResizeStart:(T,R)=>I(T,b,R),interactive:u},b.id))]})},Ir=["nw","n","ne","e","se","s","sw","w"],Dr={nw:"nwse-resize",n:"ns-resize",ne:"nesw-resize",e:"ew-resize",se:"nwse-resize",s:"ns-resize",sw:"nesw-resize",w:"ew-resize"},Tr={nw:{top:-4,left:-4},n:{top:-4,left:"50%",marginLeft:-4},ne:{top:-4,right:-4},e:{top:"50%",right:-4,marginTop:-4},se:{bottom:-4,right:-4},s:{bottom:-4,left:"50%",marginLeft:-4},sw:{bottom:-4,left:-4},w:{top:"50%",left:-4,marginTop:-4}},Rr=({element:e,slideSize:t,scale:n,theme:i,isSelected:r,onMouseDown:s,onResizeStart:l,interactive:c})=>{const{position:d,content:u,rotation:y,opacity:f}=e,p=d.x/100*t.width*n,m=d.y/100*t.height*n,w=d.width/100*t.width*n,k=d.height/100*t.height*n,z={position:"absolute",left:p,top:m,width:w,height:k,opacity:f??1,transform:y?`rotate(${y}deg)`:void 0,cursor:c&&!e.locked?"move":"default",outline:r?"2px solid #2196f3":void 0,outlineOffset:r?2:void 0,zIndex:e.zIndex??0};return a.jsxs("div",{style:z,onMouseDown:s,children:[Pr(u,w,k,n,i),r&&c&&!e.locked&&Ir.map($=>a.jsx("div",{style:{position:"absolute",width:8,height:8,background:"#2196f3",border:"1px solid #fff",borderRadius:2,cursor:Dr[$],zIndex:10,...Tr[$]},onMouseDown:g=>l(g,$)},$))]})};function Pr(e,t,n,i,r){switch(e.kind){case"text":{const s=e;return a.jsx("div",{style:{width:"100%",height:"100%",fontSize:(s.fontSize??16)*i,fontFamily:s.fontFamily??r.fontFamily,fontWeight:s.fontWeight??"normal",color:s.fontColor??r.textColor,textAlign:s.textAlign??"left",lineHeight:s.lineHeight??1.4,whiteSpace:"pre-wrap",wordBreak:"break-word",overflow:"hidden"},children:s.text})}case"image":{const s=e;return a.jsx("img",{src:s.src,alt:s.alt??"",style:{width:"100%",height:"100%",objectFit:s.objectFit??"contain",borderRadius:s.borderRadius??0,boxShadow:s.shadow?"0 4px 16px rgba(0,0,0,0.2)":void 0}})}case"shape":{const s=e;return a.jsx("div",{style:{width:"100%",height:"100%",backgroundColor:s.fill??"#ccc",border:s.strokeWidth?`${s.strokeWidth}px solid ${s.stroke??"#333"}`:void 0,borderRadius:s.shapeType==="ellipse"?"50%":0}})}case"code":{const s=e;return a.jsx("pre",{style:{width:"100%",height:"100%",margin:0,padding:12*i,fontSize:(s.fontSize??14)*i,fontFamily:r.codeFontFamily??"monospace",backgroundColor:s.theme==="light"?"#f5f5f5":"#1e1e1e",color:s.theme==="light"?"#333":"#d4d4d4",borderRadius:8,overflow:"auto",whiteSpace:"pre"},children:a.jsx("code",{children:s.code})})}case"chart":{const l=Fa(e,t,n);return a.jsx("div",{style:{width:"100%",height:"100%"},dangerouslySetInnerHTML:{__html:l}})}case"table":{const s=e;return a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14*i},children:[a.jsx("thead",{children:a.jsx("tr",{children:s.headers.map((l,c)=>a.jsx("th",{style:{padding:`${6*i}px ${8*i}px`,backgroundColor:s.headerBg??r.primaryColor,color:s.headerColor??"#fff",textAlign:"left",borderBottom:`2px solid ${s.borderColor??"#ddd"}`},children:l},c))})}),a.jsx("tbody",{children:s.rows.map((l,c)=>a.jsx("tr",{style:{backgroundColor:s.stripedRows&&c%2===1?"rgba(0,0,0,0.03)":void 0},children:l.map((d,u)=>a.jsx("td",{style:{padding:`${4*i}px ${8*i}px`,borderBottom:`1px solid ${s.borderColor??"#eee"}`},children:d},u))},c))})]})}default:return a.jsx("div",{style:{width:"100%",height:"100%",background:"#f0f0f0",borderRadius:4}})}}mt.displayName="SlideCanvas";const aa={en:{"toolbar.addSlide":"Add Slide","toolbar.deleteSlide":"Delete Slide","toolbar.duplicateSlide":"Duplicate","toolbar.undo":"Undo","toolbar.redo":"Redo","toolbar.present":"Present","toolbar.export":"Export","toolbar.theme":"Theme","element.text":"Text","element.image":"Image","element.shape":"Shape","element.chart":"Chart","element.table":"Table","element.code":"Code","element.diagram":"Diagram","element.video":"Video","element.icon":"Icon","element.addElement":"Add Element","panel.slideProperties":"Slide Properties","panel.elementProperties":"Element Properties","panel.noSelection":"Select a slide or element","panel.layout":"Layout","panel.background":"Background","panel.transition":"Transition","panel.notes":"Speaker Notes","player.play":"Play","player.pause":"Pause","player.fullscreen":"Fullscreen","player.exit":"Exit","player.slideOf":"of","layout.blank":"Blank","layout.titleSlide":"Title Slide","layout.titleContent":"Title + Content","layout.twoColumn":"Two Column","layout.titleOnly":"Title Only","layout.sectionHeader":"Section Header","layout.comparison":"Comparison","layout.custom":"Custom","export.html":"HTML Presentation","export.ndp":".ndp.json"},pl:{"toolbar.addSlide":"Dodaj slajd","toolbar.deleteSlide":"Usuń slajd","toolbar.duplicateSlide":"Duplikuj","toolbar.undo":"Cofnij","toolbar.redo":"Powtórz","toolbar.present":"Prezentuj","toolbar.export":"Eksport","toolbar.theme":"Motyw","element.text":"Tekst","element.image":"Obraz","element.shape":"Kształt","element.chart":"Wykres","element.table":"Tabela","element.code":"Kod","element.diagram":"Diagram","element.video":"Wideo","element.icon":"Ikona","element.addElement":"Dodaj element","panel.slideProperties":"Właściwości slajdu","panel.elementProperties":"Właściwości elementu","panel.noSelection":"Wybierz slajd lub element","panel.layout":"Układ","panel.background":"Tło","panel.transition":"Przejście","panel.notes":"Notatki prelegenta","player.play":"Odtwórz","player.pause":"Pauza","player.fullscreen":"Pełny ekran","player.exit":"Wyjdź","player.slideOf":"z","layout.blank":"Puste","layout.titleSlide":"Slajd tytułowy","layout.titleContent":"Tytuł + treść","layout.twoColumn":"Dwie kolumny","layout.titleOnly":"Tylko tytuł","layout.sectionHeader":"Nagłówek sekcji","layout.comparison":"Porównanie","layout.custom":"Niestandardowy","export.html":"Prezentacja HTML","export.ndp":".ndp.json"},de:{"toolbar.addSlide":"Folie hinzufügen","toolbar.deleteSlide":"Folie löschen","toolbar.duplicateSlide":"Duplizieren","toolbar.undo":"Rückgängig","toolbar.redo":"Wiederholen","toolbar.present":"Präsentieren","toolbar.export":"Exportieren","toolbar.theme":"Design","element.text":"Text","element.image":"Bild","element.shape":"Form","element.chart":"Diagramm","element.table":"Tabelle","element.code":"Code","element.diagram":"Diagramm","element.video":"Video","element.icon":"Symbol","element.addElement":"Element hinzufügen","panel.slideProperties":"Folieneigenschaften","panel.elementProperties":"Elementeigenschaften","panel.noSelection":"Wählen Sie eine Folie oder ein Element","panel.layout":"Layout","panel.background":"Hintergrund","panel.transition":"Übergang","panel.notes":"Sprechernotizen","player.play":"Abspielen","player.pause":"Pause","player.fullscreen":"Vollbild","player.exit":"Beenden","player.slideOf":"von","layout.blank":"Leer","layout.titleSlide":"Titelfolie","layout.titleContent":"Titel + Inhalt","layout.twoColumn":"Zwei Spalten","layout.titleOnly":"Nur Titel","layout.sectionHeader":"Abschnittskopf","layout.comparison":"Vergleich","layout.custom":"Benutzerdefiniert","export.html":"HTML-Präsentation","export.ndp":".ndp.json"},fr:{"toolbar.addSlide":"Ajouter une diapositive","toolbar.deleteSlide":"Supprimer la diapositive","toolbar.duplicateSlide":"Dupliquer","toolbar.undo":"Annuler","toolbar.redo":"Rétablir","toolbar.present":"Présenter","toolbar.export":"Exporter","toolbar.theme":"Thème","element.text":"Texte","element.image":"Image","element.shape":"Forme","element.chart":"Graphique","element.table":"Tableau","element.code":"Code","element.diagram":"Diagramme","element.video":"Vidéo","element.icon":"Icône","element.addElement":"Ajouter un élément","panel.slideProperties":"Propriétés de la diapositive","panel.elementProperties":"Propriétés de l'élément","panel.noSelection":"Sélectionnez une diapositive ou un élément","panel.layout":"Disposition","panel.background":"Arrière-plan","panel.transition":"Transition","panel.notes":"Notes du présentateur","player.play":"Lire","player.pause":"Pause","player.fullscreen":"Plein écran","player.exit":"Quitter","player.slideOf":"sur","layout.blank":"Vide","layout.titleSlide":"Diapositive de titre","layout.titleContent":"Titre + contenu","layout.twoColumn":"Deux colonnes","layout.titleOnly":"Titre seul","layout.sectionHeader":"En-tête de section","layout.comparison":"Comparaison","layout.custom":"Personnalisé","export.html":"Présentation HTML","export.ndp":".ndp.json"},es:{"toolbar.addSlide":"Añadir diapositiva","toolbar.deleteSlide":"Eliminar diapositiva","toolbar.duplicateSlide":"Duplicar","toolbar.undo":"Deshacer","toolbar.redo":"Rehacer","toolbar.present":"Presentar","toolbar.export":"Exportar","toolbar.theme":"Tema","element.text":"Texto","element.image":"Imagen","element.shape":"Forma","element.chart":"Gráfico","element.table":"Tabla","element.code":"Código","element.diagram":"Diagrama","element.video":"Vídeo","element.icon":"Icono","element.addElement":"Añadir elemento","panel.slideProperties":"Propiedades de la diapositiva","panel.elementProperties":"Propiedades del elemento","panel.noSelection":"Seleccione una diapositiva o un elemento","panel.layout":"Diseño","panel.background":"Fondo","panel.transition":"Transición","panel.notes":"Notas del presentador","player.play":"Reproducir","player.pause":"Pausa","player.fullscreen":"Pantalla completa","player.exit":"Salir","player.slideOf":"de","layout.blank":"En blanco","layout.titleSlide":"Diapositiva de título","layout.titleContent":"Título + contenido","layout.twoColumn":"Dos columnas","layout.titleOnly":"Solo título","layout.sectionHeader":"Encabezado de sección","layout.comparison":"Comparación","layout.custom":"Personalizado","export.html":"Presentación HTML","export.ndp":".ndp.json"}},Ia=o.createContext(e=>e),Da=({lang:e="en",children:t})=>{const n=aa[e]??aa.en,i=r=>n[r]??r;return a.jsx(Ia.Provider,{value:i,children:t})};function Qt(){return o.useContext(Ia)}function we(e){const t=o.useId();return e||t}function at(e,t){o.useEffect(()=>{const n=i=>{!e.current||e.current.contains(i.target)||t()};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[e,t])}function Or(e,t){o.useEffect(()=>{if(!t||!e.current)return;const n=e.current,i=document.activeElement,r=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),s=r[0],l=r[r.length-1],c=d=>{d.key==="Tab"&&(d.shiftKey?document.activeElement===s&&(d.preventDefault(),l==null||l.focus()):document.activeElement===l&&(d.preventDefault(),s==null||s.focus()))};return s==null||s.focus(),n.addEventListener("keydown",c),()=>{var d;n.removeEventListener("keydown",c),(d=i==null?void 0:i.focus)==null||d.call(i)}},[e,t])}const Lr={ok:"OK",cancel:"Cancel",save:"Save",close:"Close",delete:"Delete",edit:"Edit",add:"Add",remove:"Remove",search:"Search",filter:"Filter",refresh:"Refresh",loading:"Loading…",noData:"No data",error:"Error",success:"Success",warning:"Warning",info:"Information",yes:"Yes",no:"No",confirm:"Confirm",back:"Back",next:"Next",previous:"Previous",finish:"Finish",submit:"Submit",reset:"Reset",apply:"Apply",undo:"Undo",redo:"Redo",copy:"Copy",cut:"Cut",paste:"Paste",selectAll:"Select all",clear:"Clear",upload:"Upload",download:"Download",print:"Print",export:"Export",import:"Import",settings:"Settings",help:"Help",about:"About",more:"More",less:"Less",show:"Show",hide:"Hide",expand:"Expand",collapse:"Collapse",enabled:"Enabled",disabled:"Disabled",required:"Required",optional:"Optional",actions:"Actions",details:"Details",overview:"Overview",all:"All",none:"None",selected:"Selected",total:"Total",of:"of",items:"items",page:"Page",rows:"Rows","app.name":"Application","app.version":"Version","app.about":"About","nav.home":"Home","nav.back":"Back","nav.forward":"Forward","nav.menu":"Menu","nav.sidebar":"Sidebar","nav.search":"Search","nav.favorites":"Favorites","nav.recent":"Recent","nav.notifications":"Notifications","nav.profile":"Profile","nav.logout":"Log out","carousel.prev":"Previous slide","carousel.next":"Next slide","carousel.slide":"Slide","carousel.of":"of","carousel.autoplay":"Auto-play","carousel.pause":"Pause","confirm.yes":"Yes","confirm.no":"No","confirm.ok":"OK","confirm.cancel":"Cancel","confirm.title":"Confirmation","confirm.deleteMessage":"Are you sure you want to delete this?","confirm.unsavedChanges":"You have unsaved changes. Discard?","console.shell":"Shell","console.terminal":"Terminal","console.prompt":"Enter command…","console.clear":"Clear console","console.run":"Run","console.output":"Output","console.newSession":"New session","console.closeSession":"Close session","controls.save":"Save","controls.cancel":"Cancel","controls.delete":"Delete","controls.edit":"Edit","controls.add":"Add","controls.remove":"Remove","controls.close":"Close","controls.open":"Open","controls.refresh":"Refresh","controls.new":"New","controls.duplicate":"Duplicate","controls.sort":"Sort","controls.group":"Group","controls.pin":"Pin","controls.unpin":"Unpin","controls.lock":"Lock","controls.unlock":"Unlock","controls.share":"Share","controls.archive":"Archive","cookie.title":"Cookie consent","cookie.message":"This site uses cookies to improve your experience.","cookie.accept":"Accept all","cookie.reject":"Reject all","cookie.settings":"Cookie settings","cookie.necessary":"Necessary","cookie.analytics":"Analytics","cookie.marketing":"Marketing","dashboard.title":"Dashboard","dashboard.addWidget":"Add widget","dashboard.removeWidget":"Remove widget","dashboard.layout":"Layout","dashboard.settings":"Settings","dashboard.customize":"Customize","dashboard.resetLayout":"Reset layout","datetime.today":"Today","datetime.yesterday":"Yesterday","datetime.tomorrow":"Tomorrow","datetime.selectDate":"Select date","datetime.selectTime":"Select time","datetime.startDate":"Start date","datetime.endDate":"End date","datetime.startTime":"Start time","datetime.endTime":"End time","datetime.am":"AM","datetime.pm":"PM","desktop.start":"Start","desktop.taskbar":"Taskbar","desktop.systemTray":"System tray","desktop.wallpaper":"Wallpaper","desktop.icons":"Desktop icons","desktop.arrangeIcons":"Arrange icons","dock.pin":"Pin to dock","dock.unpin":"Unpin from dock","dock.close":"Close","dock.minimize":"Minimize","dock.maximize":"Maximize","dock.restore":"Restore","docEditor.paragraph":"Paragraph","docEditor.heading":"Heading","docEditor.heading1":"Heading 1","docEditor.heading2":"Heading 2","docEditor.heading3":"Heading 3","docEditor.bulletList":"Bullet list","docEditor.numberedList":"Numbered list","docEditor.quote":"Quote","docEditor.code":"Code block","docEditor.divider":"Divider","docEditor.image":"Image","docEditor.table":"Table","docEditor.callout":"Callout","docEditor.placeholder":"Start typing…","docEditor.slashCommand":"Type / for commands","files.upload":"Upload file","files.download":"Download","files.delete":"Delete file","files.rename":"Rename","files.newFolder":"New folder","files.selectFile":"Select file","files.dropzone":"Drop files here","files.dragDrop":"Drag & drop files here or click to browse","files.maxSize":"Maximum file size","files.fileType":"File type","forms.required":"This field is required","forms.optional":"Optional","forms.submit":"Submit","forms.reset":"Reset","forms.validate":"Validate","forms.invalid":"Invalid value","forms.minLength":"Minimum length: {0}","forms.maxLength":"Maximum length: {0}","forms.email":"Enter a valid email","forms.phone":"Enter a valid phone number","imageEditor.crop":"Crop","imageEditor.rotate":"Rotate","imageEditor.flip":"Flip","imageEditor.resize":"Resize","imageEditor.filter":"Filter","imageEditor.draw":"Draw","imageEditor.text":"Text","imageEditor.undo":"Undo","imageEditor.redo":"Redo","imageEditor.save":"Save","imageEditor.brightness":"Brightness","imageEditor.contrast":"Contrast","imageEditor.saturation":"Saturation","inbox.compose":"Compose","inbox.reply":"Reply","inbox.replyAll":"Reply all","inbox.forward":"Forward","inbox.delete":"Delete","inbox.archive":"Archive","inbox.markRead":"Mark as read","inbox.markUnread":"Mark as unread","inbox.folders":"Folders","inbox.inbox":"Inbox","inbox.sent":"Sent","inbox.drafts":"Drafts","inbox.trash":"Trash","inbox.spam":"Spam","inbox.starred":"Starred","inbox.to":"To","inbox.cc":"Cc","inbox.bcc":"Bcc","inbox.subject":"Subject","inbox.send":"Send","inbox.discard":"Discard","inbox.attachFile":"Attach file","kanban.addCard":"Add card","kanban.addColumn":"Add column","kanban.moveCard":"Move card","kanban.editCard":"Edit card","kanban.deleteCard":"Delete card","kanban.editColumn":"Edit column","kanban.deleteColumn":"Delete column","lang.en":"English","lang.pl":"Polish","lang.de":"German","lang.fr":"French","lang.es":"Spanish","lang.it":"Italian","lang.pt":"Portuguese","lang.nl":"Dutch","lang.sv":"Swedish","lang.no":"Norwegian","lang.da":"Danish","lang.fi":"Finnish","lang.cs":"Czech","lang.sk":"Slovak","lang.hu":"Hungarian","lang.ro":"Romanian","lang.bg":"Bulgarian","lang.uk":"Ukrainian","lang.ja":"Japanese","lang.ko":"Korean","lang.zh":"Chinese","lang.ar":"Arabic","login.username":"Username","login.password":"Password","login.signIn":"Sign in","login.signOut":"Sign out","login.forgotPassword":"Forgot password?","login.register":"Register","login.rememberMe":"Remember me","login.newPassword":"New password","login.confirmPassword":"Confirm password","login.twoFactor":"Two-factor authentication","password.strength":"Password strength","password.weak":"Weak","password.medium":"Medium","password.strong":"Strong","password.requirements":"Password requirements","pdfviewer.page":"Page","pdfviewer.of":"of","pdfviewer.zoom":"Zoom","pdfviewer.fitPage":"Fit page","pdfviewer.fitWidth":"Fit width","pdfviewer.download":"Download","pdfviewer.print":"Print","pdfviewer.search":"Search in document","pdfviewer.bookmark":"Bookmarks","pdfviewer.thumbnail":"Thumbnails","picklist.available":"Available","picklist.selected":"Selected","picklist.addAll":"Add all","picklist.removeAll":"Remove all","picklist.filter":"Filter items","scheduling.calendar":"Calendar","scheduling.event":"Event","scheduling.allDay":"All day","scheduling.today":"Today","scheduling.week":"Week","scheduling.month":"Month","scheduling.year":"Year","scheduling.day":"Day","scheduling.agenda":"Agenda","scheduling.addEvent":"Add event","scheduling.editEvent":"Edit event","scheduling.deleteEvent":"Delete event","scheduling.noEvents":"No events","shortcuts.title":"Keyboard shortcuts","shortcuts.description":"Available shortcuts","shortcuts.key":"Key","shortcuts.command":"Command","shortcuts.search":"Search shortcuts","signature.clear":"Clear","signature.save":"Save","signature.sign":"Sign here","signature.draw":"Draw your signature","spreadsheet.cell":"Cell","spreadsheet.row":"Row","spreadsheet.column":"Column","spreadsheet.formula":"Formula","spreadsheet.insert":"Insert","spreadsheet.delete":"Delete","spreadsheet.sort":"Sort","spreadsheet.sortAsc":"Sort ascending","spreadsheet.sortDesc":"Sort descending","spreadsheet.filter":"Filter","spreadsheet.export":"Export","spreadsheet.import":"Import","spreadsheet.addRow":"Add row","spreadsheet.addColumn":"Add column","spreadsheet.deleteRow":"Delete row","spreadsheet.deleteColumn":"Delete column","spreadsheet.freezeRow":"Freeze row","spreadsheet.freezeColumn":"Freeze column","spreadsheet.merge":"Merge cells","spreadsheet.unmerge":"Unmerge cells","terminal.run":"Run","terminal.clear":"Clear","terminal.copy":"Copy","terminal.paste":"Paste","terminal.newSession":"New session","terminal.closeSession":"Close session","terminal.selectAll":"Select all","theme.light":"Light","theme.dark":"Dark","theme.system":"System","theme.custom":"Custom","theme.colors":"Colors","theme.fonts":"Fonts","theme.apply":"Apply theme","theme.preview":"Preview","theme.reset":"Reset to default","theme.gallery":"Theme gallery","users.profile":"Profile","users.settings":"Settings","users.permissions":"Permissions","users.role":"Role","users.active":"Active","users.inactive":"Inactive","users.online":"Online","users.offline":"Offline","users.lastSeen":"Last seen","wm.close":"Close","wm.minimize":"Minimize","wm.maximize":"Maximize","wm.restore":"Restore","wm.tile":"Tile windows","wm.cascade":"Cascade windows","wm.closeAll":"Close all","wm.minimizeAll":"Minimize all","wm.newWindow":"New window","wm.moveToFront":"Move to front"},Br={ok:"OK",cancel:"Anuluj",save:"Zapisz",close:"Zamknij",delete:"Usuń",edit:"Edytuj",add:"Dodaj",remove:"Usuń",search:"Szukaj",filter:"Filtruj",refresh:"Odśwież",loading:"Ładowanie…",noData:"Brak danych",error:"Błąd",success:"Sukces",warning:"Ostrzeżenie",info:"Informacja",yes:"Tak",no:"Nie",confirm:"Potwierdź",back:"Wstecz",next:"Dalej",previous:"Poprzedni",finish:"Zakończ",submit:"Wyślij",reset:"Resetuj",apply:"Zastosuj",undo:"Cofnij",redo:"Ponów",copy:"Kopiuj",cut:"Wytnij",paste:"Wklej",selectAll:"Zaznacz wszystko",clear:"Wyczyść",upload:"Prześlij",download:"Pobierz",print:"Drukuj",export:"Eksportuj",import:"Importuj",settings:"Ustawienia",help:"Pomoc",about:"O programie",more:"Więcej",less:"Mniej",show:"Pokaż",hide:"Ukryj",expand:"Rozwiń",collapse:"Zwiń",enabled:"Włączony",disabled:"Wyłączony",required:"Wymagane",optional:"Opcjonalne",actions:"Akcje",details:"Szczegóły",overview:"Przegląd",all:"Wszystkie",none:"Żaden",selected:"Zaznaczono",total:"Razem",of:"z",items:"elementów",page:"Strona",rows:"Wiersze","app.name":"Aplikacja","app.version":"Wersja","app.about":"O programie","nav.home":"Strona główna","nav.back":"Wstecz","nav.forward":"Dalej","nav.menu":"Menu","nav.sidebar":"Panel boczny","nav.search":"Szukaj","nav.favorites":"Ulubione","nav.recent":"Ostatnie","nav.notifications":"Powiadomienia","nav.profile":"Profil","nav.logout":"Wyloguj się","carousel.prev":"Poprzedni slajd","carousel.next":"Następny slajd","carousel.slide":"Slajd","carousel.of":"z","carousel.autoplay":"Autoodtwarzanie","carousel.pause":"Pauza","confirm.yes":"Tak","confirm.no":"Nie","confirm.ok":"OK","confirm.cancel":"Anuluj","confirm.title":"Potwierdzenie","confirm.deleteMessage":"Czy na pewno chcesz to usunąć?","confirm.unsavedChanges":"Masz niezapisane zmiany. Odrzucić?","console.shell":"Powłoka","console.terminal":"Terminal","console.prompt":"Wpisz polecenie…","console.clear":"Wyczyść konsolę","console.run":"Uruchom","console.output":"Wyjście","console.newSession":"Nowa sesja","console.closeSession":"Zamknij sesję","controls.save":"Zapisz","controls.cancel":"Anuluj","controls.delete":"Usuń","controls.edit":"Edytuj","controls.add":"Dodaj","controls.remove":"Usuń","controls.close":"Zamknij","controls.open":"Otwórz","controls.refresh":"Odśwież","controls.new":"Nowy","controls.duplicate":"Duplikuj","controls.sort":"Sortuj","controls.group":"Grupuj","controls.pin":"Przypnij","controls.unpin":"Odepnij","controls.lock":"Zablokuj","controls.unlock":"Odblokuj","controls.share":"Udostępnij","controls.archive":"Archiwizuj","cookie.title":"Zgoda na pliki cookie","cookie.message":"Ta strona używa plików cookie.","cookie.accept":"Zaakceptuj wszystkie","cookie.reject":"Odrzuć wszystkie","cookie.settings":"Ustawienia cookie","cookie.necessary":"Niezbędne","cookie.analytics":"Analityczne","cookie.marketing":"Marketingowe","dashboard.title":"Pulpit","dashboard.addWidget":"Dodaj widżet","dashboard.removeWidget":"Usuń widżet","dashboard.layout":"Układ","dashboard.settings":"Ustawienia","dashboard.customize":"Dostosuj","dashboard.resetLayout":"Resetuj układ","datetime.today":"Dzisiaj","datetime.yesterday":"Wczoraj","datetime.tomorrow":"Jutro","datetime.selectDate":"Wybierz datę","datetime.selectTime":"Wybierz godzinę","datetime.startDate":"Data początkowa","datetime.endDate":"Data końcowa","datetime.startTime":"Godzina rozpoczęcia","datetime.endTime":"Godzina zakończenia","datetime.am":"AM","datetime.pm":"PM","desktop.start":"Start","desktop.taskbar":"Pasek zadań","desktop.systemTray":"Zasobnik systemowy","desktop.wallpaper":"Tapeta","desktop.icons":"Ikony pulpitu","desktop.arrangeIcons":"Ułóż ikony","dock.pin":"Przypnij do doku","dock.unpin":"Odepnij z doku","dock.close":"Zamknij","dock.minimize":"Minimalizuj","dock.maximize":"Maksymalizuj","dock.restore":"Przywróć","docEditor.paragraph":"Akapit","docEditor.heading":"Nagłówek","docEditor.heading1":"Nagłówek 1","docEditor.heading2":"Nagłówek 2","docEditor.heading3":"Nagłówek 3","docEditor.bulletList":"Lista punktowana","docEditor.numberedList":"Lista numerowana","docEditor.quote":"Cytat","docEditor.code":"Blok kodu","docEditor.divider":"Separator","docEditor.image":"Obraz","docEditor.table":"Tabela","docEditor.callout":"Wyróżnienie","docEditor.placeholder":"Zacznij pisać…","docEditor.slashCommand":"Wpisz / aby zobaczyć komendy","files.upload":"Prześlij plik","files.download":"Pobierz","files.delete":"Usuń plik","files.rename":"Zmień nazwę","files.newFolder":"Nowy folder","files.selectFile":"Wybierz plik","files.dropzone":"Upuść pliki tutaj","files.dragDrop":"Przeciągnij i upuść pliki lub kliknij aby wybrać","files.maxSize":"Maksymalny rozmiar pliku","files.fileType":"Typ pliku","forms.required":"To pole jest wymagane","forms.optional":"Opcjonalne","forms.submit":"Wyślij","forms.reset":"Resetuj","forms.validate":"Zweryfikuj","forms.invalid":"Nieprawidłowa wartość","forms.minLength":"Minimalna długość: {0}","forms.maxLength":"Maksymalna długość: {0}","forms.email":"Podaj prawidłowy adres e-mail","forms.phone":"Podaj prawidłowy numer telefonu","imageEditor.crop":"Przytnij","imageEditor.rotate":"Obróć","imageEditor.flip":"Odbij","imageEditor.resize":"Zmień rozmiar","imageEditor.filter":"Filtr","imageEditor.draw":"Rysuj","imageEditor.text":"Tekst","imageEditor.undo":"Cofnij","imageEditor.redo":"Ponów","imageEditor.save":"Zapisz","imageEditor.brightness":"Jasność","imageEditor.contrast":"Kontrast","imageEditor.saturation":"Nasycenie","inbox.compose":"Nowa wiadomość","inbox.reply":"Odpowiedz","inbox.replyAll":"Odpowiedz wszystkim","inbox.forward":"Przekaż","inbox.delete":"Usuń","inbox.archive":"Archiwizuj","inbox.markRead":"Oznacz jako przeczytane","inbox.markUnread":"Oznacz jako nieprzeczytane","inbox.folders":"Foldery","inbox.inbox":"Odebrane","inbox.sent":"Wysłane","inbox.drafts":"Wersje robocze","inbox.trash":"Kosz","inbox.spam":"Spam","inbox.starred":"Oznaczone gwiazdką","inbox.to":"Do","inbox.cc":"DW","inbox.bcc":"UDW","inbox.subject":"Temat","inbox.send":"Wyślij","inbox.discard":"Odrzuć","inbox.attachFile":"Załącz plik","kanban.addCard":"Dodaj kartę","kanban.addColumn":"Dodaj kolumnę","kanban.moveCard":"Przenieś kartę","kanban.editCard":"Edytuj kartę","kanban.deleteCard":"Usuń kartę","kanban.editColumn":"Edytuj kolumnę","kanban.deleteColumn":"Usuń kolumnę","lang.en":"Angielski","lang.pl":"Polski","lang.de":"Niemiecki","lang.fr":"Francuski","lang.es":"Hiszpański","lang.it":"Włoski","lang.pt":"Portugalski","lang.nl":"Holenderski","lang.sv":"Szwedzki","lang.no":"Norweski","lang.da":"Duński","lang.fi":"Fiński","lang.cs":"Czeski","lang.sk":"Słowacki","lang.hu":"Węgierski","lang.ro":"Rumuński","lang.bg":"Bułgarski","lang.uk":"Ukraiński","lang.ja":"Japoński","lang.ko":"Koreański","lang.zh":"Chiński","lang.ar":"Arabski","login.username":"Nazwa użytkownika","login.password":"Hasło","login.signIn":"Zaloguj się","login.signOut":"Wyloguj się","login.forgotPassword":"Zapomniałeś hasła?","login.register":"Zarejestruj się","login.rememberMe":"Zapamiętaj mnie","login.newPassword":"Nowe hasło","login.confirmPassword":"Potwierdź hasło","login.twoFactor":"Uwierzytelnianie dwuskładnikowe","password.strength":"Siła hasła","password.weak":"Słabe","password.medium":"Średnie","password.strong":"Silne","password.requirements":"Wymagania dotyczące hasła","pdfviewer.page":"Strona","pdfviewer.of":"z","pdfviewer.zoom":"Powiększenie","pdfviewer.fitPage":"Dopasuj stronę","pdfviewer.fitWidth":"Dopasuj szerokość","pdfviewer.download":"Pobierz","pdfviewer.print":"Drukuj","pdfviewer.search":"Szukaj w dokumencie","pdfviewer.bookmark":"Zakładki","pdfviewer.thumbnail":"Miniatury","picklist.available":"Dostępne","picklist.selected":"Wybrane","picklist.addAll":"Dodaj wszystkie","picklist.removeAll":"Usuń wszystkie","picklist.filter":"Filtruj elementy","scheduling.calendar":"Kalendarz","scheduling.event":"Wydarzenie","scheduling.allDay":"Cały dzień","scheduling.today":"Dzisiaj","scheduling.week":"Tydzień","scheduling.month":"Miesiąc","scheduling.year":"Rok","scheduling.day":"Dzień","scheduling.agenda":"Agenda","scheduling.addEvent":"Dodaj wydarzenie","scheduling.editEvent":"Edytuj wydarzenie","scheduling.deleteEvent":"Usuń wydarzenie","scheduling.noEvents":"Brak wydarzeń","shortcuts.title":"Skróty klawiszowe","shortcuts.description":"Dostępne skróty","shortcuts.key":"Klawisz","shortcuts.command":"Polecenie","shortcuts.search":"Szukaj skrótów","signature.clear":"Wyczyść","signature.save":"Zapisz","signature.sign":"Podpisz tutaj","signature.draw":"Narysuj swój podpis","spreadsheet.cell":"Komórka","spreadsheet.row":"Wiersz","spreadsheet.column":"Kolumna","spreadsheet.formula":"Formuła","spreadsheet.insert":"Wstaw","spreadsheet.delete":"Usuń","spreadsheet.sort":"Sortuj","spreadsheet.sortAsc":"Sortuj rosnąco","spreadsheet.sortDesc":"Sortuj malejąco","spreadsheet.filter":"Filtruj","spreadsheet.export":"Eksportuj","spreadsheet.import":"Importuj","spreadsheet.addRow":"Dodaj wiersz","spreadsheet.addColumn":"Dodaj kolumnę","spreadsheet.deleteRow":"Usuń wiersz","spreadsheet.deleteColumn":"Usuń kolumnę","spreadsheet.freezeRow":"Zamroź wiersz","spreadsheet.freezeColumn":"Zamroź kolumnę","spreadsheet.merge":"Scal komórki","spreadsheet.unmerge":"Rozdziel komórki","terminal.run":"Uruchom","terminal.clear":"Wyczyść","terminal.copy":"Kopiuj","terminal.paste":"Wklej","terminal.newSession":"Nowa sesja","terminal.closeSession":"Zamknij sesję","terminal.selectAll":"Zaznacz wszystko","theme.light":"Jasny","theme.dark":"Ciemny","theme.system":"Systemowy","theme.custom":"Własny","theme.colors":"Kolory","theme.fonts":"Czcionki","theme.apply":"Zastosuj motyw","theme.preview":"Podgląd","theme.reset":"Przywróć domyślne","theme.gallery":"Galeria motywów","users.profile":"Profil","users.settings":"Ustawienia","users.permissions":"Uprawnienia","users.role":"Rola","users.active":"Aktywny","users.inactive":"Nieaktywny","users.online":"Online","users.offline":"Offline","users.lastSeen":"Ostatnio widziano","wm.close":"Zamknij","wm.minimize":"Minimalizuj","wm.maximize":"Maksymalizuj","wm.restore":"Przywróć","wm.tile":"Ułóż kafelkowo","wm.cascade":"Ułóż kaskadowo","wm.closeAll":"Zamknij wszystkie","wm.minimizeAll":"Minimalizuj wszystkie","wm.newWindow":"Nowe okno","wm.moveToFront":"Na wierzch"},Hr={ok:"OK",cancel:"Abbrechen",save:"Speichern",close:"Schließen",delete:"Löschen",edit:"Bearbeiten",add:"Hinzufügen",remove:"Entfernen",search:"Suchen",filter:"Filtern",refresh:"Aktualisieren",loading:"Laden…",noData:"Keine Daten",error:"Fehler",success:"Erfolg",warning:"Warnung",info:"Information",yes:"Ja",no:"Nein",confirm:"Bestätigen",back:"Zurück",next:"Weiter",previous:"Vorherige",finish:"Fertig",submit:"Absenden",reset:"Zurücksetzen",apply:"Anwenden",undo:"Rückgängig",redo:"Wiederholen",copy:"Kopieren",cut:"Ausschneiden",paste:"Einfügen",selectAll:"Alle auswählen",clear:"Löschen",upload:"Hochladen",download:"Herunterladen",print:"Drucken",export:"Exportieren",import:"Importieren",settings:"Einstellungen",help:"Hilfe",about:"Über",more:"Mehr",less:"Weniger",show:"Anzeigen",hide:"Ausblenden",expand:"Erweitern",collapse:"Einklappen",enabled:"Aktiviert",disabled:"Deaktiviert",required:"Erforderlich",optional:"Optional",actions:"Aktionen",details:"Details",overview:"Übersicht",all:"Alle",none:"Keine",selected:"Ausgewählt",total:"Gesamt",of:"von",items:"Einträge",page:"Seite",rows:"Zeilen","app.name":"Anwendung","app.version":"Version","app.about":"Über","nav.home":"Startseite","nav.back":"Zurück","nav.forward":"Vorwärts","nav.menu":"Menü","nav.sidebar":"Seitenleiste","nav.search":"Suchen","nav.favorites":"Favoriten","nav.recent":"Zuletzt","nav.notifications":"Benachrichtigungen","nav.profile":"Profil","nav.logout":"Abmelden","carousel.prev":"Vorherige Folie","carousel.next":"Nächste Folie","carousel.slide":"Folie","carousel.of":"von","carousel.autoplay":"Automatisch abspielen","carousel.pause":"Pause","confirm.yes":"Ja","confirm.no":"Nein","confirm.ok":"OK","confirm.cancel":"Abbrechen","confirm.title":"Bestätigung","confirm.deleteMessage":"Möchten Sie dies wirklich löschen?","confirm.unsavedChanges":"Ungespeicherte Änderungen. Verwerfen?","console.shell":"Shell","console.terminal":"Terminal","console.prompt":"Befehl eingeben…","console.clear":"Konsole leeren","console.run":"Ausführen","console.output":"Ausgabe","console.newSession":"Neue Sitzung","console.closeSession":"Sitzung schließen","controls.save":"Speichern","controls.cancel":"Abbrechen","controls.delete":"Löschen","controls.edit":"Bearbeiten","controls.add":"Hinzufügen","controls.remove":"Entfernen","controls.close":"Schließen","controls.open":"Öffnen","controls.refresh":"Aktualisieren","controls.new":"Neu","controls.duplicate":"Duplizieren","controls.sort":"Sortieren","controls.group":"Gruppieren","controls.pin":"Anheften","controls.unpin":"Lösen","controls.lock":"Sperren","controls.unlock":"Entsperren","controls.share":"Teilen","controls.archive":"Archivieren","cookie.title":"Cookie-Einwilligung","cookie.message":"Diese Website verwendet Cookies.","cookie.accept":"Alle akzeptieren","cookie.reject":"Alle ablehnen","cookie.settings":"Cookie-Einstellungen","cookie.necessary":"Erforderlich","cookie.analytics":"Analyse","cookie.marketing":"Marketing","dashboard.title":"Dashboard","dashboard.addWidget":"Widget hinzufügen","dashboard.removeWidget":"Widget entfernen","dashboard.layout":"Layout","dashboard.settings":"Einstellungen","dashboard.customize":"Anpassen","dashboard.resetLayout":"Layout zurücksetzen","datetime.today":"Heute","datetime.yesterday":"Gestern","datetime.tomorrow":"Morgen","datetime.selectDate":"Datum auswählen","datetime.selectTime":"Uhrzeit auswählen","datetime.startDate":"Startdatum","datetime.endDate":"Enddatum","datetime.startTime":"Startzeit","datetime.endTime":"Endzeit","datetime.am":"AM","datetime.pm":"PM","desktop.start":"Start","desktop.taskbar":"Taskleiste","desktop.systemTray":"Systemleiste","desktop.wallpaper":"Hintergrundbild","desktop.icons":"Desktop-Symbole","desktop.arrangeIcons":"Symbole anordnen","dock.pin":"An Dock anheften","dock.unpin":"Vom Dock lösen","dock.close":"Schließen","dock.minimize":"Minimieren","dock.maximize":"Maximieren","dock.restore":"Wiederherstellen","docEditor.paragraph":"Absatz","docEditor.heading":"Überschrift","docEditor.heading1":"Überschrift 1","docEditor.heading2":"Überschrift 2","docEditor.heading3":"Überschrift 3","docEditor.bulletList":"Aufzählungsliste","docEditor.numberedList":"Nummerierte Liste","docEditor.quote":"Zitat","docEditor.code":"Codeblock","docEditor.divider":"Trennlinie","docEditor.image":"Bild","docEditor.table":"Tabelle","docEditor.callout":"Hervorhebung","docEditor.placeholder":"Schreiben Sie los…","docEditor.slashCommand":"Tippen Sie / für Befehle","files.upload":"Datei hochladen","files.download":"Herunterladen","files.delete":"Datei löschen","files.rename":"Umbenennen","files.newFolder":"Neuer Ordner","files.selectFile":"Datei auswählen","files.dropzone":"Dateien hier ablegen","files.dragDrop":"Dateien hierher ziehen oder klicken","files.maxSize":"Maximale Dateigröße","files.fileType":"Dateityp","forms.required":"Dieses Feld ist erforderlich","forms.optional":"Optional","forms.submit":"Absenden","forms.reset":"Zurücksetzen","forms.validate":"Validieren","forms.invalid":"Ungültiger Wert","forms.minLength":"Mindestlänge: {0}","forms.maxLength":"Maximallänge: {0}","forms.email":"Gültige E-Mail eingeben","forms.phone":"Gültige Telefonnummer eingeben","imageEditor.crop":"Zuschneiden","imageEditor.rotate":"Drehen","imageEditor.flip":"Spiegeln","imageEditor.resize":"Größe ändern","imageEditor.filter":"Filter","imageEditor.draw":"Zeichnen","imageEditor.text":"Text","imageEditor.undo":"Rückgängig","imageEditor.redo":"Wiederholen","imageEditor.save":"Speichern","imageEditor.brightness":"Helligkeit","imageEditor.contrast":"Kontrast","imageEditor.saturation":"Sättigung","inbox.compose":"Verfassen","inbox.reply":"Antworten","inbox.replyAll":"Allen antworten","inbox.forward":"Weiterleiten","inbox.delete":"Löschen","inbox.archive":"Archivieren","inbox.markRead":"Als gelesen markieren","inbox.markUnread":"Als ungelesen markieren","inbox.folders":"Ordner","inbox.inbox":"Posteingang","inbox.sent":"Gesendet","inbox.drafts":"Entwürfe","inbox.trash":"Papierkorb","inbox.spam":"Spam","inbox.starred":"Markiert","inbox.to":"An","inbox.cc":"Cc","inbox.bcc":"Bcc","inbox.subject":"Betreff","inbox.send":"Senden","inbox.discard":"Verwerfen","inbox.attachFile":"Datei anhängen","kanban.addCard":"Karte hinzufügen","kanban.addColumn":"Spalte hinzufügen","kanban.moveCard":"Karte verschieben","kanban.editCard":"Karte bearbeiten","kanban.deleteCard":"Karte löschen","kanban.editColumn":"Spalte bearbeiten","kanban.deleteColumn":"Spalte löschen","lang.en":"Englisch","lang.pl":"Polnisch","lang.de":"Deutsch","lang.fr":"Französisch","lang.es":"Spanisch","lang.it":"Italienisch","lang.pt":"Portugiesisch","lang.nl":"Niederländisch","lang.sv":"Schwedisch","lang.no":"Norwegisch","lang.da":"Dänisch","lang.fi":"Finnisch","lang.cs":"Tschechisch","lang.sk":"Slowakisch","lang.hu":"Ungarisch","lang.ro":"Rumänisch","lang.bg":"Bulgarisch","lang.uk":"Ukrainisch","lang.ja":"Japanisch","lang.ko":"Koreanisch","lang.zh":"Chinesisch","lang.ar":"Arabisch","login.username":"Benutzername","login.password":"Passwort","login.signIn":"Anmelden","login.signOut":"Abmelden","login.forgotPassword":"Passwort vergessen?","login.register":"Registrieren","login.rememberMe":"Angemeldet bleiben","login.newPassword":"Neues Passwort","login.confirmPassword":"Passwort bestätigen","login.twoFactor":"Zwei-Faktor-Authentifizierung","password.strength":"Passwortstärke","password.weak":"Schwach","password.medium":"Mittel","password.strong":"Stark","password.requirements":"Passwortanforderungen","pdfviewer.page":"Seite","pdfviewer.of":"von","pdfviewer.zoom":"Zoom","pdfviewer.fitPage":"Seite einpassen","pdfviewer.fitWidth":"Breite einpassen","pdfviewer.download":"Herunterladen","pdfviewer.print":"Drucken","pdfviewer.search":"Im Dokument suchen","pdfviewer.bookmark":"Lesezeichen","pdfviewer.thumbnail":"Miniaturansichten","picklist.available":"Verfügbar","picklist.selected":"Ausgewählt","picklist.addAll":"Alle hinzufügen","picklist.removeAll":"Alle entfernen","picklist.filter":"Einträge filtern","scheduling.calendar":"Kalender","scheduling.event":"Termin","scheduling.allDay":"Ganztägig","scheduling.today":"Heute","scheduling.week":"Woche","scheduling.month":"Monat","scheduling.year":"Jahr","scheduling.day":"Tag","scheduling.agenda":"Agenda","scheduling.addEvent":"Termin hinzufügen","scheduling.editEvent":"Termin bearbeiten","scheduling.deleteEvent":"Termin löschen","scheduling.noEvents":"Keine Termine","shortcuts.title":"Tastenkombinationen","shortcuts.description":"Verfügbare Tastenkombinationen","shortcuts.key":"Taste","shortcuts.command":"Befehl","shortcuts.search":"Tastenkombinationen suchen","signature.clear":"Löschen","signature.save":"Speichern","signature.sign":"Hier unterschreiben","signature.draw":"Unterschrift zeichnen","spreadsheet.cell":"Zelle","spreadsheet.row":"Zeile","spreadsheet.column":"Spalte","spreadsheet.formula":"Formel","spreadsheet.insert":"Einfügen","spreadsheet.delete":"Löschen","spreadsheet.sort":"Sortieren","spreadsheet.sortAsc":"Aufsteigend sortieren","spreadsheet.sortDesc":"Absteigend sortieren","spreadsheet.filter":"Filtern","spreadsheet.export":"Exportieren","spreadsheet.import":"Importieren","spreadsheet.addRow":"Zeile hinzufügen","spreadsheet.addColumn":"Spalte hinzufügen","spreadsheet.deleteRow":"Zeile löschen","spreadsheet.deleteColumn":"Spalte löschen","spreadsheet.freezeRow":"Zeile einfrieren","spreadsheet.freezeColumn":"Spalte einfrieren","spreadsheet.merge":"Zellen zusammenführen","spreadsheet.unmerge":"Zellen trennen","terminal.run":"Ausführen","terminal.clear":"Leeren","terminal.copy":"Kopieren","terminal.paste":"Einfügen","terminal.newSession":"Neue Sitzung","terminal.closeSession":"Sitzung schließen","terminal.selectAll":"Alles auswählen","theme.light":"Hell","theme.dark":"Dunkel","theme.system":"System","theme.custom":"Benutzerdefiniert","theme.colors":"Farben","theme.fonts":"Schriftarten","theme.apply":"Design anwenden","theme.preview":"Vorschau","theme.reset":"Standard wiederherstellen","theme.gallery":"Design-Galerie","users.profile":"Profil","users.settings":"Einstellungen","users.permissions":"Berechtigungen","users.role":"Rolle","users.active":"Aktiv","users.inactive":"Inaktiv","users.online":"Online","users.offline":"Offline","users.lastSeen":"Zuletzt gesehen","wm.close":"Schließen","wm.minimize":"Minimieren","wm.maximize":"Maximieren","wm.restore":"Wiederherstellen","wm.tile":"Fenster kacheln","wm.cascade":"Fenster kaskadieren","wm.closeAll":"Alle schließen","wm.minimizeAll":"Alle minimieren","wm.newWindow":"Neues Fenster","wm.moveToFront":"In den Vordergrund"},qr={ok:"OK",cancel:"Annuler",save:"Enregistrer",close:"Fermer",delete:"Supprimer",edit:"Modifier",add:"Ajouter",remove:"Retirer",search:"Rechercher",filter:"Filtrer",refresh:"Actualiser",loading:"Chargement…",noData:"Aucune donnée",error:"Erreur",success:"Succès",warning:"Avertissement",info:"Information",yes:"Oui",no:"Non",confirm:"Confirmer",back:"Retour",next:"Suivant",previous:"Précédent",finish:"Terminer",submit:"Soumettre",reset:"Réinitialiser",apply:"Appliquer",undo:"Annuler",redo:"Rétablir",copy:"Copier",cut:"Couper",paste:"Coller",selectAll:"Tout sélectionner",clear:"Effacer",upload:"Télécharger",download:"Télécharger",print:"Imprimer",export:"Exporter",import:"Importer",settings:"Paramètres",help:"Aide",about:"À propos",more:"Plus",less:"Moins",show:"Afficher",hide:"Masquer",expand:"Développer",collapse:"Réduire",enabled:"Activé",disabled:"Désactivé",required:"Obligatoire",optional:"Facultatif",actions:"Actions",details:"Détails",overview:"Aperçu",all:"Tous",none:"Aucun",selected:"Sélectionné",total:"Total",of:"de",items:"éléments",page:"Page",rows:"Lignes","app.name":"Application","app.version":"Version","app.about":"À propos","nav.home":"Accueil","nav.back":"Retour","nav.forward":"Suivant","nav.menu":"Menu","nav.sidebar":"Barre latérale","nav.search":"Rechercher","nav.favorites":"Favoris","nav.recent":"Récent","nav.notifications":"Notifications","nav.profile":"Profil","nav.logout":"Déconnexion","carousel.prev":"Diapo précédente","carousel.next":"Diapo suivante","carousel.slide":"Diapo","carousel.of":"de","carousel.autoplay":"Lecture auto","carousel.pause":"Pause","confirm.yes":"Oui","confirm.no":"Non","confirm.ok":"OK","confirm.cancel":"Annuler","confirm.title":"Confirmation","confirm.deleteMessage":"Voulez-vous vraiment supprimer ceci ?","confirm.unsavedChanges":"Modifications non enregistrées. Abandonner ?","console.shell":"Shell","console.terminal":"Terminal","console.prompt":"Entrez une commande…","console.clear":"Effacer la console","console.run":"Exécuter","console.output":"Sortie","console.newSession":"Nouvelle session","console.closeSession":"Fermer la session","controls.save":"Enregistrer","controls.cancel":"Annuler","controls.delete":"Supprimer","controls.edit":"Modifier","controls.add":"Ajouter","controls.remove":"Retirer","controls.close":"Fermer","controls.open":"Ouvrir","controls.refresh":"Actualiser","controls.new":"Nouveau","controls.duplicate":"Dupliquer","controls.sort":"Trier","controls.group":"Grouper","controls.pin":"Épingler","controls.unpin":"Désépingler","controls.lock":"Verrouiller","controls.unlock":"Déverrouiller","controls.share":"Partager","controls.archive":"Archiver","cookie.title":"Consentement aux cookies","cookie.message":"Ce site utilise des cookies.","cookie.accept":"Tout accepter","cookie.reject":"Tout refuser","cookie.settings":"Paramètres des cookies","cookie.necessary":"Nécessaires","cookie.analytics":"Analytiques","cookie.marketing":"Marketing","dashboard.title":"Tableau de bord","dashboard.addWidget":"Ajouter un widget","dashboard.removeWidget":"Supprimer le widget","dashboard.layout":"Disposition","dashboard.settings":"Paramètres","dashboard.customize":"Personnaliser","dashboard.resetLayout":"Réinitialiser la disposition","datetime.today":"Aujourd'hui","datetime.yesterday":"Hier","datetime.tomorrow":"Demain","datetime.selectDate":"Sélectionner une date","datetime.selectTime":"Sélectionner une heure","datetime.startDate":"Date de début","datetime.endDate":"Date de fin","datetime.startTime":"Heure de début","datetime.endTime":"Heure de fin","datetime.am":"AM","datetime.pm":"PM","desktop.start":"Démarrer","desktop.taskbar":"Barre des tâches","desktop.systemTray":"Zone de notification","desktop.wallpaper":"Fond d'écran","desktop.icons":"Icônes du bureau","desktop.arrangeIcons":"Organiser les icônes","dock.pin":"Épingler au dock","dock.unpin":"Désépingler du dock","dock.close":"Fermer","dock.minimize":"Réduire","dock.maximize":"Agrandir","dock.restore":"Restaurer","docEditor.paragraph":"Paragraphe","docEditor.heading":"Titre","docEditor.heading1":"Titre 1","docEditor.heading2":"Titre 2","docEditor.heading3":"Titre 3","docEditor.bulletList":"Liste à puces","docEditor.numberedList":"Liste numérotée","docEditor.quote":"Citation","docEditor.code":"Bloc de code","docEditor.divider":"Séparateur","docEditor.image":"Image","docEditor.table":"Tableau","docEditor.callout":"Encadré","docEditor.placeholder":"Commencez à écrire…","docEditor.slashCommand":"Tapez / pour les commandes","files.upload":"Envoyer un fichier","files.download":"Télécharger","files.delete":"Supprimer le fichier","files.rename":"Renommer","files.newFolder":"Nouveau dossier","files.selectFile":"Sélectionner un fichier","files.dropzone":"Déposez les fichiers ici","files.dragDrop":"Glissez-déposez les fichiers ou cliquez","files.maxSize":"Taille maximale du fichier","files.fileType":"Type de fichier","forms.required":"Ce champ est obligatoire","forms.optional":"Facultatif","forms.submit":"Soumettre","forms.reset":"Réinitialiser","forms.validate":"Valider","forms.invalid":"Valeur invalide","forms.minLength":"Longueur minimale : {0}","forms.maxLength":"Longueur maximale : {0}","forms.email":"Saisissez un e-mail valide","forms.phone":"Saisissez un numéro valide","imageEditor.crop":"Recadrer","imageEditor.rotate":"Pivoter","imageEditor.flip":"Retourner","imageEditor.resize":"Redimensionner","imageEditor.filter":"Filtre","imageEditor.draw":"Dessiner","imageEditor.text":"Texte","imageEditor.undo":"Annuler","imageEditor.redo":"Rétablir","imageEditor.save":"Enregistrer","imageEditor.brightness":"Luminosité","imageEditor.contrast":"Contraste","imageEditor.saturation":"Saturation","inbox.compose":"Rédiger","inbox.reply":"Répondre","inbox.replyAll":"Répondre à tous","inbox.forward":"Transférer","inbox.delete":"Supprimer","inbox.archive":"Archiver","inbox.markRead":"Marquer comme lu","inbox.markUnread":"Marquer comme non lu","inbox.folders":"Dossiers","inbox.inbox":"Boîte de réception","inbox.sent":"Envoyés","inbox.drafts":"Brouillons","inbox.trash":"Corbeille","inbox.spam":"Spam","inbox.starred":"Favoris","inbox.to":"À","inbox.cc":"Cc","inbox.bcc":"Cci","inbox.subject":"Objet","inbox.send":"Envoyer","inbox.discard":"Annuler","inbox.attachFile":"Joindre un fichier","kanban.addCard":"Ajouter une carte","kanban.addColumn":"Ajouter une colonne","kanban.moveCard":"Déplacer la carte","kanban.editCard":"Modifier la carte","kanban.deleteCard":"Supprimer la carte","kanban.editColumn":"Modifier la colonne","kanban.deleteColumn":"Supprimer la colonne","lang.en":"Anglais","lang.pl":"Polonais","lang.de":"Allemand","lang.fr":"Français","lang.es":"Espagnol","lang.it":"Italien","lang.pt":"Portugais","lang.nl":"Néerlandais","lang.sv":"Suédois","lang.no":"Norvégien","lang.da":"Danois","lang.fi":"Finnois","lang.cs":"Tchèque","lang.sk":"Slovaque","lang.hu":"Hongrois","lang.ro":"Roumain","lang.bg":"Bulgare","lang.uk":"Ukrainien","lang.ja":"Japonais","lang.ko":"Coréen","lang.zh":"Chinois","lang.ar":"Arabe","login.username":"Nom d'utilisateur","login.password":"Mot de passe","login.signIn":"Se connecter","login.signOut":"Se déconnecter","login.forgotPassword":"Mot de passe oublié ?","login.register":"S'inscrire","login.rememberMe":"Se souvenir de moi","login.newPassword":"Nouveau mot de passe","login.confirmPassword":"Confirmer le mot de passe","login.twoFactor":"Authentification à deux facteurs","password.strength":"Force du mot de passe","password.weak":"Faible","password.medium":"Moyen","password.strong":"Fort","password.requirements":"Exigences du mot de passe","pdfviewer.page":"Page","pdfviewer.of":"de","pdfviewer.zoom":"Zoom","pdfviewer.fitPage":"Ajuster à la page","pdfviewer.fitWidth":"Ajuster à la largeur","pdfviewer.download":"Télécharger","pdfviewer.print":"Imprimer","pdfviewer.search":"Rechercher dans le document","pdfviewer.bookmark":"Signets","pdfviewer.thumbnail":"Miniatures","picklist.available":"Disponible","picklist.selected":"Sélectionné","picklist.addAll":"Tout ajouter","picklist.removeAll":"Tout retirer","picklist.filter":"Filtrer les éléments","scheduling.calendar":"Calendrier","scheduling.event":"Événement","scheduling.allDay":"Toute la journée","scheduling.today":"Aujourd'hui","scheduling.week":"Semaine","scheduling.month":"Mois","scheduling.year":"Année","scheduling.day":"Jour","scheduling.agenda":"Agenda","scheduling.addEvent":"Ajouter un événement","scheduling.editEvent":"Modifier l'événement","scheduling.deleteEvent":"Supprimer l'événement","scheduling.noEvents":"Aucun événement","shortcuts.title":"Raccourcis clavier","shortcuts.description":"Raccourcis disponibles","shortcuts.key":"Touche","shortcuts.command":"Commande","shortcuts.search":"Rechercher des raccourcis","signature.clear":"Effacer","signature.save":"Enregistrer","signature.sign":"Signez ici","signature.draw":"Dessinez votre signature","spreadsheet.cell":"Cellule","spreadsheet.row":"Ligne","spreadsheet.column":"Colonne","spreadsheet.formula":"Formule","spreadsheet.insert":"Insérer","spreadsheet.delete":"Supprimer","spreadsheet.sort":"Trier","spreadsheet.sortAsc":"Tri croissant","spreadsheet.sortDesc":"Tri décroissant","spreadsheet.filter":"Filtrer","spreadsheet.export":"Exporter","spreadsheet.import":"Importer","spreadsheet.addRow":"Ajouter une ligne","spreadsheet.addColumn":"Ajouter une colonne","spreadsheet.deleteRow":"Supprimer la ligne","spreadsheet.deleteColumn":"Supprimer la colonne","spreadsheet.freezeRow":"Figer la ligne","spreadsheet.freezeColumn":"Figer la colonne","spreadsheet.merge":"Fusionner les cellules","spreadsheet.unmerge":"Scinder les cellules","terminal.run":"Exécuter","terminal.clear":"Effacer","terminal.copy":"Copier","terminal.paste":"Coller","terminal.newSession":"Nouvelle session","terminal.closeSession":"Fermer la session","terminal.selectAll":"Tout sélectionner","theme.light":"Clair","theme.dark":"Sombre","theme.system":"Système","theme.custom":"Personnalisé","theme.colors":"Couleurs","theme.fonts":"Polices","theme.apply":"Appliquer le thème","theme.preview":"Aperçu","theme.reset":"Réinitialiser","theme.gallery":"Galerie de thèmes","users.profile":"Profil","users.settings":"Paramètres","users.permissions":"Autorisations","users.role":"Rôle","users.active":"Actif","users.inactive":"Inactif","users.online":"En ligne","users.offline":"Hors ligne","users.lastSeen":"Dernière connexion","wm.close":"Fermer","wm.minimize":"Réduire","wm.maximize":"Agrandir","wm.restore":"Restaurer","wm.tile":"Fenêtres en mosaïque","wm.cascade":"Fenêtres en cascade","wm.closeAll":"Tout fermer","wm.minimizeAll":"Tout réduire","wm.newWindow":"Nouvelle fenêtre","wm.moveToFront":"Au premier plan"},Wr={ok:"OK",cancel:"Cancelar",save:"Guardar",close:"Cerrar",delete:"Eliminar",edit:"Editar",add:"Agregar",remove:"Quitar",search:"Buscar",filter:"Filtrar",refresh:"Actualizar",loading:"Cargando…",noData:"Sin datos",error:"Error",success:"Éxito",warning:"Advertencia",info:"Información",yes:"Sí",no:"No",confirm:"Confirmar",back:"Atrás",next:"Siguiente",previous:"Anterior",finish:"Finalizar",submit:"Enviar",reset:"Restablecer",apply:"Aplicar",undo:"Deshacer",redo:"Rehacer",copy:"Copiar",cut:"Cortar",paste:"Pegar",selectAll:"Seleccionar todo",clear:"Borrar",upload:"Subir",download:"Descargar",print:"Imprimir",export:"Exportar",import:"Importar",settings:"Configuración",help:"Ayuda",about:"Acerca de",more:"Más",less:"Menos",show:"Mostrar",hide:"Ocultar",expand:"Expandir",collapse:"Contraer",enabled:"Habilitado",disabled:"Deshabilitado",required:"Obligatorio",optional:"Opcional",actions:"Acciones",details:"Detalles",overview:"Vista general",all:"Todos",none:"Ninguno",selected:"Seleccionado",total:"Total",of:"de",items:"elementos",page:"Página",rows:"Filas","app.name":"Aplicación","app.version":"Versión","app.about":"Acerca de","nav.home":"Inicio","nav.back":"Atrás","nav.forward":"Adelante","nav.menu":"Menú","nav.sidebar":"Barra lateral","nav.search":"Buscar","nav.favorites":"Favoritos","nav.recent":"Reciente","nav.notifications":"Notificaciones","nav.profile":"Perfil","nav.logout":"Cerrar sesión","carousel.prev":"Diapositiva anterior","carousel.next":"Diapositiva siguiente","carousel.slide":"Diapositiva","carousel.of":"de","carousel.autoplay":"Reproducción automática","carousel.pause":"Pausa","confirm.yes":"Sí","confirm.no":"No","confirm.ok":"OK","confirm.cancel":"Cancelar","confirm.title":"Confirmación","confirm.deleteMessage":"¿Seguro que desea eliminar esto?","confirm.unsavedChanges":"Hay cambios sin guardar. ¿Descartar?","console.shell":"Shell","console.terminal":"Terminal","console.prompt":"Ingrese un comando…","console.clear":"Limpiar consola","console.run":"Ejecutar","console.output":"Salida","console.newSession":"Nueva sesión","console.closeSession":"Cerrar sesión","controls.save":"Guardar","controls.cancel":"Cancelar","controls.delete":"Eliminar","controls.edit":"Editar","controls.add":"Agregar","controls.remove":"Quitar","controls.close":"Cerrar","controls.open":"Abrir","controls.refresh":"Actualizar","controls.new":"Nuevo","controls.duplicate":"Duplicar","controls.sort":"Ordenar","controls.group":"Agrupar","controls.pin":"Fijar","controls.unpin":"Desfijar","controls.lock":"Bloquear","controls.unlock":"Desbloquear","controls.share":"Compartir","controls.archive":"Archivar","cookie.title":"Consentimiento de cookies","cookie.message":"Este sitio utiliza cookies.","cookie.accept":"Aceptar todas","cookie.reject":"Rechazar todas","cookie.settings":"Configuración de cookies","cookie.necessary":"Necesarias","cookie.analytics":"Analíticas","cookie.marketing":"Marketing","dashboard.title":"Panel","dashboard.addWidget":"Agregar widget","dashboard.removeWidget":"Quitar widget","dashboard.layout":"Diseño","dashboard.settings":"Configuración","dashboard.customize":"Personalizar","dashboard.resetLayout":"Restablecer diseño","datetime.today":"Hoy","datetime.yesterday":"Ayer","datetime.tomorrow":"Mañana","datetime.selectDate":"Seleccionar fecha","datetime.selectTime":"Seleccionar hora","datetime.startDate":"Fecha de inicio","datetime.endDate":"Fecha de fin","datetime.startTime":"Hora de inicio","datetime.endTime":"Hora de fin","datetime.am":"AM","datetime.pm":"PM","desktop.start":"Inicio","desktop.taskbar":"Barra de tareas","desktop.systemTray":"Bandeja del sistema","desktop.wallpaper":"Fondo de pantalla","desktop.icons":"Iconos del escritorio","desktop.arrangeIcons":"Organizar iconos","dock.pin":"Fijar al dock","dock.unpin":"Desfijar del dock","dock.close":"Cerrar","dock.minimize":"Minimizar","dock.maximize":"Maximizar","dock.restore":"Restaurar","docEditor.paragraph":"Párrafo","docEditor.heading":"Encabezado","docEditor.heading1":"Encabezado 1","docEditor.heading2":"Encabezado 2","docEditor.heading3":"Encabezado 3","docEditor.bulletList":"Lista con viñetas","docEditor.numberedList":"Lista numerada","docEditor.quote":"Cita","docEditor.code":"Bloque de código","docEditor.divider":"Separador","docEditor.image":"Imagen","docEditor.table":"Tabla","docEditor.callout":"Destacado","docEditor.placeholder":"Empiece a escribir…","docEditor.slashCommand":"Escriba / para comandos","files.upload":"Subir archivo","files.download":"Descargar","files.delete":"Eliminar archivo","files.rename":"Renombrar","files.newFolder":"Nueva carpeta","files.selectFile":"Seleccionar archivo","files.dropzone":"Suelte archivos aquí","files.dragDrop":"Arrastre y suelte archivos o haga clic","files.maxSize":"Tamaño máximo del archivo","files.fileType":"Tipo de archivo","forms.required":"Este campo es obligatorio","forms.optional":"Opcional","forms.submit":"Enviar","forms.reset":"Restablecer","forms.validate":"Validar","forms.invalid":"Valor inválido","forms.minLength":"Longitud mínima: {0}","forms.maxLength":"Longitud máxima: {0}","forms.email":"Ingrese un correo válido","forms.phone":"Ingrese un teléfono válido","imageEditor.crop":"Recortar","imageEditor.rotate":"Rotar","imageEditor.flip":"Voltear","imageEditor.resize":"Redimensionar","imageEditor.filter":"Filtro","imageEditor.draw":"Dibujar","imageEditor.text":"Texto","imageEditor.undo":"Deshacer","imageEditor.redo":"Rehacer","imageEditor.save":"Guardar","imageEditor.brightness":"Brillo","imageEditor.contrast":"Contraste","imageEditor.saturation":"Saturación","inbox.compose":"Redactar","inbox.reply":"Responder","inbox.replyAll":"Responder a todos","inbox.forward":"Reenviar","inbox.delete":"Eliminar","inbox.archive":"Archivar","inbox.markRead":"Marcar como leído","inbox.markUnread":"Marcar como no leído","inbox.folders":"Carpetas","inbox.inbox":"Bandeja de entrada","inbox.sent":"Enviados","inbox.drafts":"Borradores","inbox.trash":"Papelera","inbox.spam":"Spam","inbox.starred":"Destacados","inbox.to":"Para","inbox.cc":"CC","inbox.bcc":"CCO","inbox.subject":"Asunto","inbox.send":"Enviar","inbox.discard":"Descartar","inbox.attachFile":"Adjuntar archivo","kanban.addCard":"Agregar tarjeta","kanban.addColumn":"Agregar columna","kanban.moveCard":"Mover tarjeta","kanban.editCard":"Editar tarjeta","kanban.deleteCard":"Eliminar tarjeta","kanban.editColumn":"Editar columna","kanban.deleteColumn":"Eliminar columna","lang.en":"Inglés","lang.pl":"Polaco","lang.de":"Alemán","lang.fr":"Francés","lang.es":"Español","lang.it":"Italiano","lang.pt":"Portugués","lang.nl":"Neerlandés","lang.sv":"Sueco","lang.no":"Noruego","lang.da":"Danés","lang.fi":"Finlandés","lang.cs":"Checo","lang.sk":"Eslovaco","lang.hu":"Húngaro","lang.ro":"Rumano","lang.bg":"Búlgaro","lang.uk":"Ucraniano","lang.ja":"Japonés","lang.ko":"Coreano","lang.zh":"Chino","lang.ar":"Árabe","login.username":"Nombre de usuario","login.password":"Contraseña","login.signIn":"Iniciar sesión","login.signOut":"Cerrar sesión","login.forgotPassword":"¿Olvidó su contraseña?","login.register":"Registrarse","login.rememberMe":"Recordarme","login.newPassword":"Nueva contraseña","login.confirmPassword":"Confirmar contraseña","login.twoFactor":"Autenticación de dos factores","password.strength":"Fuerza de la contraseña","password.weak":"Débil","password.medium":"Media","password.strong":"Fuerte","password.requirements":"Requisitos de contraseña","pdfviewer.page":"Página","pdfviewer.of":"de","pdfviewer.zoom":"Zoom","pdfviewer.fitPage":"Ajustar a página","pdfviewer.fitWidth":"Ajustar a ancho","pdfviewer.download":"Descargar","pdfviewer.print":"Imprimir","pdfviewer.search":"Buscar en el documento","pdfviewer.bookmark":"Marcadores","pdfviewer.thumbnail":"Miniaturas","picklist.available":"Disponibles","picklist.selected":"Seleccionados","picklist.addAll":"Agregar todos","picklist.removeAll":"Quitar todos","picklist.filter":"Filtrar elementos","scheduling.calendar":"Calendario","scheduling.event":"Evento","scheduling.allDay":"Todo el día","scheduling.today":"Hoy","scheduling.week":"Semana","scheduling.month":"Mes","scheduling.year":"Año","scheduling.day":"Día","scheduling.agenda":"Agenda","scheduling.addEvent":"Agregar evento","scheduling.editEvent":"Editar evento","scheduling.deleteEvent":"Eliminar evento","scheduling.noEvents":"Sin eventos","shortcuts.title":"Atajos de teclado","shortcuts.description":"Atajos disponibles","shortcuts.key":"Tecla","shortcuts.command":"Comando","shortcuts.search":"Buscar atajos","signature.clear":"Borrar","signature.save":"Guardar","signature.sign":"Firme aquí","signature.draw":"Dibuje su firma","spreadsheet.cell":"Celda","spreadsheet.row":"Fila","spreadsheet.column":"Columna","spreadsheet.formula":"Fórmula","spreadsheet.insert":"Insertar","spreadsheet.delete":"Eliminar","spreadsheet.sort":"Ordenar","spreadsheet.sortAsc":"Orden ascendente","spreadsheet.sortDesc":"Orden descendente","spreadsheet.filter":"Filtrar","spreadsheet.export":"Exportar","spreadsheet.import":"Importar","spreadsheet.addRow":"Agregar fila","spreadsheet.addColumn":"Agregar columna","spreadsheet.deleteRow":"Eliminar fila","spreadsheet.deleteColumn":"Eliminar columna","spreadsheet.freezeRow":"Inmovilizar fila","spreadsheet.freezeColumn":"Inmovilizar columna","spreadsheet.merge":"Combinar celdas","spreadsheet.unmerge":"Separar celdas","terminal.run":"Ejecutar","terminal.clear":"Limpiar","terminal.copy":"Copiar","terminal.paste":"Pegar","terminal.newSession":"Nueva sesión","terminal.closeSession":"Cerrar sesión","terminal.selectAll":"Seleccionar todo","theme.light":"Claro","theme.dark":"Oscuro","theme.system":"Sistema","theme.custom":"Personalizado","theme.colors":"Colores","theme.fonts":"Fuentes","theme.apply":"Aplicar tema","theme.preview":"Vista previa","theme.reset":"Restablecer","theme.gallery":"Galería de temas","users.profile":"Perfil","users.settings":"Configuración","users.permissions":"Permisos","users.role":"Rol","users.active":"Activo","users.inactive":"Inactivo","users.online":"En línea","users.offline":"Desconectado","users.lastSeen":"Última vez visto","wm.close":"Cerrar","wm.minimize":"Minimizar","wm.maximize":"Maximizar","wm.restore":"Restaurar","wm.tile":"Mosaico de ventanas","wm.cascade":"Cascada de ventanas","wm.closeAll":"Cerrar todo","wm.minimizeAll":"Minimizar todo","wm.newWindow":"Nueva ventana","wm.moveToFront":"Al frente"},Vr={ok:"OK",cancel:"Annulla",save:"Salva",close:"Chiudi",delete:"Elimina",edit:"Modifica",add:"Aggiungi",remove:"Rimuovi",search:"Cerca",filter:"Filtra",refresh:"Aggiorna",loading:"Caricamento…",noData:"Nessun dato",error:"Errore",success:"Successo",warning:"Avviso",info:"Informazione",yes:"Sì",no:"No",confirm:"Conferma",back:"Indietro",next:"Avanti",previous:"Precedente",finish:"Fine",submit:"Invia",reset:"Ripristina",apply:"Applica",undo:"Annulla",redo:"Ripeti",copy:"Copia",cut:"Taglia",paste:"Incolla",selectAll:"Seleziona tutto",clear:"Cancella",upload:"Carica",download:"Scarica",print:"Stampa",export:"Esporta",import:"Importa",settings:"Impostazioni",help:"Aiuto",about:"Info",more:"Altro",less:"Meno",show:"Mostra",hide:"Nascondi",expand:"Espandi",collapse:"Comprimi",enabled:"Abilitato",disabled:"Disabilitato",required:"Obbligatorio",optional:"Facoltativo",actions:"Azioni",details:"Dettagli",overview:"Panoramica",all:"Tutti",none:"Nessuno",selected:"Selezionato",total:"Totale",of:"di",items:"elementi",page:"Pagina",rows:"Righe","nav.home":"Home","nav.back":"Indietro","nav.forward":"Avanti","nav.menu":"Menu","nav.sidebar":"Barra laterale","nav.search":"Cerca","nav.favorites":"Preferiti","nav.recent":"Recenti","nav.notifications":"Notifiche","nav.profile":"Profilo","nav.logout":"Esci","confirm.title":"Conferma","confirm.deleteMessage":"Sei sicuro di voler eliminare?","confirm.unsavedChanges":"Modifiche non salvate. Annullare?","login.username":"Nome utente","login.password":"Password","login.signIn":"Accedi","login.signOut":"Esci","login.forgotPassword":"Password dimenticata?","login.register":"Registrati","login.rememberMe":"Ricordami","theme.light":"Chiaro","theme.dark":"Scuro","theme.system":"Sistema","wm.close":"Chiudi","wm.minimize":"Riduci","wm.maximize":"Ingrandisci","wm.restore":"Ripristina","lang.en":"Inglese","lang.pl":"Polacco","lang.de":"Tedesco","lang.fr":"Francese","lang.es":"Spagnolo","lang.it":"Italiano","lang.pt":"Portoghese","lang.nl":"Olandese","lang.sv":"Svedese","lang.no":"Norvegese","lang.da":"Danese","lang.fi":"Finlandese","lang.cs":"Ceco","lang.sk":"Slovacco","lang.hu":"Ungherese","lang.ro":"Rumeno","lang.bg":"Bulgaro","lang.uk":"Ucraino","lang.ja":"Giapponese","lang.ko":"Coreano","lang.zh":"Cinese","lang.ar":"Arabo"},Kr={ok:"OK",cancel:"Cancelar",save:"Salvar",close:"Fechar",delete:"Excluir",edit:"Editar",add:"Adicionar",remove:"Remover",search:"Pesquisar",filter:"Filtrar",refresh:"Atualizar",loading:"Carregando…",noData:"Sem dados",error:"Erro",success:"Sucesso",warning:"Aviso",info:"Informação",yes:"Sim",no:"Não",confirm:"Confirmar",back:"Voltar",next:"Próximo",previous:"Anterior",finish:"Concluir",submit:"Enviar",reset:"Redefinir",apply:"Aplicar",undo:"Desfazer",redo:"Refazer",copy:"Copiar",cut:"Recortar",paste:"Colar",selectAll:"Selecionar tudo",clear:"Limpar",upload:"Enviar",download:"Baixar",print:"Imprimir",export:"Exportar",import:"Importar",settings:"Configurações",help:"Ajuda",about:"Sobre",more:"Mais",less:"Menos",show:"Mostrar",hide:"Ocultar",expand:"Expandir",collapse:"Recolher",enabled:"Ativado",disabled:"Desativado",required:"Obrigatório",optional:"Opcional",actions:"Ações",details:"Detalhes",overview:"Visão geral",all:"Todos",none:"Nenhum",selected:"Selecionado",total:"Total",of:"de",items:"itens",page:"Página",rows:"Linhas","app.name":"Aplicação","app.version":"Versão","app.about":"Sobre","nav.home":"Início","nav.back":"Voltar","nav.forward":"Avançar","nav.menu":"Menu","nav.sidebar":"Barra lateral","nav.search":"Pesquisar","nav.favorites":"Favoritos","nav.recent":"Recentes","nav.notifications":"Notificações","nav.profile":"Perfil","nav.logout":"Sair","carousel.prev":"Slide anterior","carousel.next":"Próximo slide","carousel.slide":"Slide","carousel.of":"de","carousel.autoplay":"Reprodução automática","carousel.pause":"Pausar","confirm.yes":"Sim","confirm.no":"Não","confirm.ok":"OK","confirm.cancel":"Cancelar","confirm.title":"Confirmação","confirm.deleteMessage":"Tem certeza de que deseja excluir?","confirm.unsavedChanges":"Alterações não salvas. Descartar?","console.shell":"Shell","console.terminal":"Terminal","console.prompt":"Digite o comando…","console.clear":"Limpar console","console.run":"Executar","console.output":"Saída","console.newSession":"Nova sessão","console.closeSession":"Fechar sessão","controls.save":"Salvar","controls.cancel":"Cancelar","controls.delete":"Excluir","controls.edit":"Editar","controls.add":"Adicionar","controls.remove":"Remover","controls.close":"Fechar","controls.open":"Abrir","controls.refresh":"Atualizar","controls.new":"Novo","controls.duplicate":"Duplicar","controls.sort":"Ordenar","controls.group":"Agrupar","controls.pin":"Fixar","controls.unpin":"Desfixar","controls.lock":"Bloquear","controls.unlock":"Desbloquear","controls.share":"Compartilhar","controls.archive":"Arquivar","cookie.title":"Consentimento de cookies","cookie.message":"Este site usa cookies para melhorar sua experiência.","cookie.accept":"Aceitar todos","cookie.reject":"Rejeitar todos","cookie.settings":"Configurações de cookies","cookie.necessary":"Necessários","cookie.analytics":"Analíticos","cookie.marketing":"Marketing","dashboard.title":"Painel","dashboard.addWidget":"Adicionar widget","dashboard.removeWidget":"Remover widget","dashboard.layout":"Layout","dashboard.settings":"Configurações","dashboard.customize":"Personalizar","dashboard.resetLayout":"Redefinir layout","datetime.today":"Hoje","datetime.yesterday":"Ontem","datetime.tomorrow":"Amanhã","datetime.selectDate":"Selecionar data","datetime.selectTime":"Selecionar hora","datetime.startDate":"Data de início","datetime.endDate":"Data de término","datetime.startTime":"Hora de início","datetime.endTime":"Hora de término","datetime.am":"AM","datetime.pm":"PM","desktop.start":"Iniciar","desktop.taskbar":"Barra de tarefas","desktop.systemTray":"Bandeja do sistema","desktop.wallpaper":"Papel de parede","desktop.icons":"Ícones da área de trabalho","desktop.arrangeIcons":"Organizar ícones","dock.pin":"Fixar no dock","dock.unpin":"Desfixar do dock","dock.close":"Fechar","dock.minimize":"Minimizar","dock.maximize":"Maximizar","dock.restore":"Restaurar","docEditor.paragraph":"Parágrafo","docEditor.heading":"Título","docEditor.heading1":"Título 1","docEditor.heading2":"Título 2","docEditor.heading3":"Título 3","docEditor.bulletList":"Lista com marcadores","docEditor.numberedList":"Lista numerada","docEditor.quote":"Citação","docEditor.code":"Bloco de código","docEditor.divider":"Divisor","docEditor.image":"Imagem","docEditor.table":"Tabela","docEditor.callout":"Destaque","docEditor.placeholder":"Comece a digitar…","docEditor.slashCommand":"Digite / para comandos","files.upload":"Enviar arquivo","files.download":"Baixar","files.delete":"Excluir arquivo","files.rename":"Renomear","files.newFolder":"Nova pasta","files.selectFile":"Selecionar arquivo","files.dropzone":"Arraste arquivos aqui","files.dragDrop":"Arraste e solte arquivos ou clique para selecionar","files.maxSize":"Tamanho máximo do arquivo","files.fileType":"Tipo de arquivo","forms.required":"Este campo é obrigatório","forms.optional":"Opcional","forms.submit":"Enviar","forms.reset":"Redefinir","forms.validate":"Validar","forms.invalid":"Valor inválido","forms.minLength":"Comprimento mínimo: {0}","forms.maxLength":"Comprimento máximo: {0}","forms.email":"Insira um e-mail válido","forms.phone":"Insira um telefone válido","imageEditor.crop":"Cortar","imageEditor.rotate":"Girar","imageEditor.flip":"Espelhar","imageEditor.resize":"Redimensionar","imageEditor.filter":"Filtro","imageEditor.draw":"Desenhar","imageEditor.text":"Texto","imageEditor.undo":"Desfazer","imageEditor.redo":"Refazer","imageEditor.save":"Salvar","imageEditor.brightness":"Brilho","imageEditor.contrast":"Contraste","imageEditor.saturation":"Saturação","inbox.compose":"Escrever","inbox.reply":"Responder","inbox.replyAll":"Responder a todos","inbox.forward":"Encaminhar","inbox.delete":"Excluir","inbox.archive":"Arquivar","inbox.markRead":"Marcar como lido","inbox.markUnread":"Marcar como não lido","inbox.folders":"Pastas","inbox.inbox":"Caixa de entrada","inbox.sent":"Enviados","inbox.drafts":"Rascunhos","inbox.trash":"Lixeira","inbox.spam":"Spam","inbox.starred":"Com estrela","inbox.to":"Para","inbox.cc":"Cc","inbox.bcc":"Cco","inbox.subject":"Assunto","inbox.send":"Enviar","inbox.discard":"Descartar","inbox.attachFile":"Anexar arquivo","kanban.addCard":"Adicionar cartão","kanban.addColumn":"Adicionar coluna","kanban.moveCard":"Mover cartão","kanban.editCard":"Editar cartão","kanban.deleteCard":"Excluir cartão","kanban.editColumn":"Editar coluna","kanban.deleteColumn":"Excluir coluna","lang.en":"Inglês","lang.pl":"Polonês","lang.de":"Alemão","lang.fr":"Francês","lang.es":"Espanhol","lang.it":"Italiano","lang.pt":"Português","lang.nl":"Holandês","lang.sv":"Sueco","lang.no":"Norueguês","lang.da":"Dinamarquês","lang.fi":"Finlandês","lang.cs":"Tcheco","lang.sk":"Eslovaco","lang.hu":"Húngaro","lang.ro":"Romeno","lang.bg":"Búlgaro","lang.uk":"Ucraniano","lang.ja":"Japonês","lang.ko":"Coreano","lang.zh":"Chinês","lang.ar":"Árabe","login.username":"Nome de usuário","login.password":"Senha","login.signIn":"Entrar","login.signOut":"Sair","login.forgotPassword":"Esqueceu a senha?","login.register":"Registrar","login.rememberMe":"Lembrar-me","login.newPassword":"Nova senha","login.confirmPassword":"Confirmar senha","login.twoFactor":"Autenticação de dois fatores","password.strength":"Força da senha","password.weak":"Fraca","password.medium":"Média","password.strong":"Forte","password.requirements":"Requisitos de senha","pdfviewer.page":"Página","pdfviewer.of":"de","pdfviewer.zoom":"Zoom","pdfviewer.fitPage":"Ajustar à página","pdfviewer.fitWidth":"Ajustar à largura","pdfviewer.download":"Baixar","pdfviewer.print":"Imprimir","pdfviewer.search":"Pesquisar no documento","pdfviewer.bookmark":"Marcadores","pdfviewer.thumbnail":"Miniaturas","picklist.available":"Disponíveis","picklist.selected":"Selecionados","picklist.addAll":"Adicionar todos","picklist.removeAll":"Remover todos","picklist.filter":"Filtrar itens","scheduling.calendar":"Calendário","scheduling.event":"Evento","scheduling.allDay":"Dia inteiro","scheduling.today":"Hoje","scheduling.week":"Semana","scheduling.month":"Mês","scheduling.year":"Ano","scheduling.day":"Dia","scheduling.agenda":"Agenda","scheduling.addEvent":"Adicionar evento","scheduling.editEvent":"Editar evento","scheduling.deleteEvent":"Excluir evento","scheduling.noEvents":"Sem eventos","shortcuts.title":"Atalhos de teclado","shortcuts.description":"Atalhos disponíveis","shortcuts.key":"Tecla","shortcuts.command":"Comando","shortcuts.search":"Pesquisar atalhos","signature.clear":"Limpar","signature.save":"Salvar","signature.sign":"Assine aqui","signature.draw":"Desenhe sua assinatura","spreadsheet.cell":"Célula","spreadsheet.row":"Linha","spreadsheet.column":"Coluna","spreadsheet.formula":"Fórmula","spreadsheet.insert":"Inserir","spreadsheet.delete":"Excluir","spreadsheet.sort":"Ordenar","spreadsheet.sortAsc":"Ordem crescente","spreadsheet.sortDesc":"Ordem decrescente","spreadsheet.filter":"Filtrar","spreadsheet.export":"Exportar","spreadsheet.import":"Importar","spreadsheet.addRow":"Adicionar linha","spreadsheet.addColumn":"Adicionar coluna","spreadsheet.deleteRow":"Excluir linha","spreadsheet.deleteColumn":"Excluir coluna","spreadsheet.freezeRow":"Congelar linha","spreadsheet.freezeColumn":"Congelar coluna","spreadsheet.merge":"Mesclar células","spreadsheet.unmerge":"Desfazer mesclagem","terminal.run":"Executar","terminal.clear":"Limpar","terminal.copy":"Copiar","terminal.paste":"Colar","terminal.newSession":"Nova sessão","terminal.closeSession":"Fechar sessão","terminal.selectAll":"Selecionar tudo","theme.light":"Claro","theme.dark":"Escuro","theme.system":"Sistema","theme.custom":"Personalizado","theme.colors":"Cores","theme.fonts":"Fontes","theme.apply":"Aplicar tema","theme.preview":"Visualizar","theme.reset":"Restaurar padrão","theme.gallery":"Galeria de temas","users.profile":"Perfil","users.settings":"Configurações","users.permissions":"Permissões","users.role":"Papel","users.active":"Ativo","users.inactive":"Inativo","users.online":"Online","users.offline":"Offline","users.lastSeen":"Último acesso","wm.close":"Fechar","wm.minimize":"Minimizar","wm.maximize":"Maximizar","wm.restore":"Restaurar","wm.tile":"Organizar janelas","wm.cascade":"Cascata","wm.closeAll":"Fechar todos","wm.minimizeAll":"Minimizar todos","wm.newWindow":"Nova janela","wm.moveToFront":"Trazer para frente"},Ur={ok:"OK",cancel:"Annuleren",save:"Opslaan",close:"Sluiten",delete:"Verwijderen",edit:"Bewerken",add:"Toevoegen",remove:"Verwijderen",search:"Zoeken",filter:"Filteren",refresh:"Vernieuwen",loading:"Laden…",noData:"Geen gegevens",error:"Fout",success:"Gelukt",warning:"Waarschuwing",info:"Informatie",yes:"Ja",no:"Nee",confirm:"Bevestigen",back:"Terug",next:"Volgende",previous:"Vorige",finish:"Voltooien",submit:"Indienen",reset:"Herstellen",apply:"Toepassen",undo:"Ongedaan maken",redo:"Opnieuw",copy:"Kopiëren",cut:"Knippen",paste:"Plakken",selectAll:"Alles selecteren",clear:"Wissen",upload:"Uploaden",download:"Downloaden",print:"Afdrukken",export:"Exporteren",import:"Importeren",settings:"Instellingen",help:"Help",required:"Verplicht",optional:"Optioneel","nav.home":"Startpagina","nav.back":"Terug","nav.favorites":"Favorieten","nav.notifications":"Meldingen","nav.profile":"Profiel","nav.logout":"Uitloggen","login.username":"Gebruikersnaam","login.password":"Wachtwoord","login.signIn":"Inloggen","login.signOut":"Uitloggen","login.forgotPassword":"Wachtwoord vergeten?","login.register":"Registreren","theme.light":"Licht","theme.dark":"Donker","theme.system":"Systeem","wm.close":"Sluiten","wm.minimize":"Minimaliseren","wm.maximize":"Maximaliseren","wm.restore":"Herstellen","lang.en":"Engels","lang.pl":"Pools","lang.de":"Duits","lang.fr":"Frans","lang.es":"Spaans","lang.it":"Italiaans","lang.pt":"Portugees","lang.nl":"Nederlands","lang.sv":"Zweeds","lang.no":"Noors","lang.da":"Deens","lang.fi":"Fins","lang.cs":"Tsjechisch","lang.sk":"Slowaaks","lang.hu":"Hongaars","lang.ro":"Roemeens","lang.bg":"Bulgaars","lang.uk":"Oekraïens","lang.ja":"Japans","lang.ko":"Koreaans","lang.zh":"Chinees","lang.ar":"Arabisch"},Yr={ok:"OK",cancel:"Avbryt",save:"Spara",close:"Stäng",delete:"Ta bort",edit:"Redigera",add:"Lägg till",remove:"Ta bort",search:"Sök",filter:"Filtrera",refresh:"Uppdatera",loading:"Laddar…",noData:"Ingen data",error:"Fel",success:"Lyckades",warning:"Varning",info:"Information",yes:"Ja",no:"Nej",confirm:"Bekräfta",back:"Tillbaka",next:"Nästa",undo:"Ångra",redo:"Gör om",copy:"Kopiera",cut:"Klipp",paste:"Klistra in",settings:"Inställningar",help:"Hjälp",required:"Obligatoriskt","nav.home":"Hem","nav.favorites":"Favoriter","nav.notifications":"Aviseringar","nav.logout":"Logga ut","login.username":"Användarnamn","login.password":"Lösenord","login.signIn":"Logga in","login.signOut":"Logga ut","login.forgotPassword":"Glömt lösenordet?","login.register":"Registrera","theme.light":"Ljust","theme.dark":"Mörkt","theme.system":"System","wm.close":"Stäng","wm.minimize":"Minimera","wm.maximize":"Maximera","wm.restore":"Återställ","lang.en":"Engelska","lang.pl":"Polska","lang.de":"Tyska","lang.fr":"Franska","lang.es":"Spanska","lang.it":"Italienska","lang.pt":"Portugisiska","lang.nl":"Nederländska","lang.sv":"Svenska","lang.no":"Norska","lang.da":"Danska","lang.fi":"Finska","lang.cs":"Tjeckiska","lang.sk":"Slovakiska","lang.hu":"Ungerska","lang.ro":"Rumänska","lang.bg":"Bulgariska","lang.uk":"Ukrainska","lang.ja":"Japanska","lang.ko":"Koreanska","lang.zh":"Kinesiska","lang.ar":"Arabiska"},Zr={ok:"OK",cancel:"Avbryt",save:"Lagre",close:"Lukk",delete:"Slett",edit:"Rediger",add:"Legg til",remove:"Fjern",search:"Søk",filter:"Filtrer",refresh:"Oppdater",loading:"Laster…",noData:"Ingen data",error:"Feil",success:"Vellykket",warning:"Advarsel",yes:"Ja",no:"Nei",confirm:"Bekreft",back:"Tilbake",next:"Neste",undo:"Angre",redo:"Gjør om",copy:"Kopier",paste:"Lim inn",settings:"Innstillinger",help:"Hjelp","nav.home":"Hjem","nav.favorites":"Favoritter","nav.logout":"Logg ut","login.username":"Brukernavn","login.password":"Passord","login.signIn":"Logg inn","theme.light":"Lys","theme.dark":"Mørk","theme.system":"System","wm.close":"Lukk","wm.minimize":"Minimer","wm.maximize":"Maksimer","wm.restore":"Gjenopprett","lang.en":"Engelsk","lang.pl":"Polsk","lang.de":"Tysk","lang.fr":"Fransk","lang.es":"Spansk","lang.it":"Italiensk","lang.pt":"Portugisisk","lang.nl":"Nederlandsk","lang.sv":"Svensk","lang.no":"Norsk","lang.da":"Dansk","lang.fi":"Finsk","lang.cs":"Tsjekkisk","lang.sk":"Slovakisk","lang.hu":"Ungarsk","lang.ro":"Rumensk","lang.bg":"Bulgarsk","lang.uk":"Ukrainsk","lang.ja":"Japansk","lang.ko":"Koreansk","lang.zh":"Kinesisk","lang.ar":"Arabisk"},Gr={ok:"OK",cancel:"Annuller",save:"Gem",close:"Luk",delete:"Slet",edit:"Rediger",add:"Tilføj",remove:"Fjern",search:"Søg",filter:"Filtrer",refresh:"Opdater",loading:"Indlæser…",noData:"Ingen data",error:"Fejl",success:"Succes",warning:"Advarsel",yes:"Ja",no:"Nej",confirm:"Bekræft",back:"Tilbage",next:"Næste",undo:"Fortryd",redo:"Gentag",copy:"Kopiér",paste:"Indsæt",settings:"Indstillinger",help:"Hjælp","nav.home":"Hjem","nav.favorites":"Favoritter","nav.logout":"Log ud","login.username":"Brugernavn","login.password":"Adgangskode","login.signIn":"Log ind","theme.light":"Lys","theme.dark":"Mørk","theme.system":"System","wm.close":"Luk","wm.minimize":"Minimer","wm.maximize":"Maksimer","wm.restore":"Gendan","lang.en":"Engelsk","lang.pl":"Polsk","lang.de":"Tysk","lang.fr":"Fransk","lang.es":"Spansk","lang.it":"Italiensk","lang.pt":"Portugisisk","lang.nl":"Nederlandsk","lang.sv":"Svensk","lang.no":"Norsk","lang.da":"Dansk","lang.fi":"Finsk","lang.cs":"Tjekkisk","lang.sk":"Slovakisk","lang.hu":"Ungarsk","lang.ro":"Rumænsk","lang.bg":"Bulgarsk","lang.uk":"Ukrainsk","lang.ja":"Japansk","lang.ko":"Koreansk","lang.zh":"Kinesisk","lang.ar":"Arabisk"},Qr={ok:"OK",cancel:"Peruuta",save:"Tallenna",close:"Sulje",delete:"Poista",edit:"Muokkaa",add:"Lisää",remove:"Poista",search:"Hae",filter:"Suodata",refresh:"Päivitä",loading:"Lataa…",noData:"Ei tietoja",error:"Virhe",success:"Onnistui",warning:"Varoitus",yes:"Kyllä",no:"Ei",confirm:"Vahvista",back:"Takaisin",next:"Seuraava",undo:"Kumoa",redo:"Tee uudelleen",copy:"Kopioi",paste:"Liitä",settings:"Asetukset",help:"Ohje","nav.home":"Etusivu","nav.favorites":"Suosikit","nav.logout":"Kirjaudu ulos","login.username":"Käyttäjänimi","login.password":"Salasana","login.signIn":"Kirjaudu sisään","theme.light":"Vaalea","theme.dark":"Tumma","theme.system":"Järjestelmä","wm.close":"Sulje","wm.minimize":"Pienennä","wm.maximize":"Suurenna","wm.restore":"Palauta","lang.en":"Englanti","lang.pl":"Puola","lang.de":"Saksa","lang.fr":"Ranska","lang.es":"Espanja","lang.it":"Italia","lang.pt":"Portugali","lang.nl":"Hollanti","lang.sv":"Ruotsi","lang.no":"Norja","lang.da":"Tanska","lang.fi":"Suomi","lang.cs":"Tšekki","lang.sk":"Slovakia","lang.hu":"Unkari","lang.ro":"Romania","lang.bg":"Bulgaria","lang.uk":"Ukraina","lang.ja":"Japani","lang.ko":"Korea","lang.zh":"Kiina","lang.ar":"Arabia"},Xr={ok:"OK",cancel:"Zrušit",save:"Uložit",close:"Zavřít",delete:"Smazat",edit:"Upravit",add:"Přidat",remove:"Odebrat",search:"Hledat",filter:"Filtrovat",refresh:"Obnovit",loading:"Načítání…",noData:"Žádná data",error:"Chyba",success:"Úspěch",warning:"Upozornění",info:"Informace",yes:"Ano",no:"Ne",confirm:"Potvrdit",back:"Zpět",next:"Další",previous:"Předchozí",finish:"Dokončit",submit:"Odeslat",reset:"Obnovit",apply:"Použít",undo:"Zpět",redo:"Znovu",copy:"Kopírovat",cut:"Vyjmout",paste:"Vložit",selectAll:"Vybrat vše",clear:"Vymazat",upload:"Nahrát",download:"Stáhnout",print:"Tisk",export:"Exportovat",import:"Importovat",settings:"Nastavení",help:"Nápověda",about:"O aplikaci",more:"Více",less:"Méně",show:"Zobrazit",hide:"Skrýt",expand:"Rozbalit",collapse:"Sbalit",enabled:"Povoleno",disabled:"Zakázáno",required:"Povinné",optional:"Volitelné",actions:"Akce",details:"Podrobnosti",overview:"Přehled",all:"Vše",none:"Žádné",selected:"Vybráno",total:"Celkem",of:"z",items:"položek",page:"Stránka",rows:"Řádky","app.name":"Aplikace","app.version":"Verze","app.about":"O aplikaci","nav.home":"Domů","nav.back":"Zpět","nav.forward":"Vpřed","nav.menu":"Menu","nav.sidebar":"Postranní panel","nav.search":"Hledat","nav.favorites":"Oblíbené","nav.recent":"Nedávné","nav.notifications":"Oznámení","nav.profile":"Profil","nav.logout":"Odhlásit se","carousel.prev":"Předchozí snímek","carousel.next":"Další snímek","carousel.slide":"Snímek","carousel.of":"z","carousel.autoplay":"Automatické přehrávání","carousel.pause":"Pozastavit","confirm.yes":"Ano","confirm.no":"Ne","confirm.ok":"OK","confirm.cancel":"Zrušit","confirm.title":"Potvrzení","confirm.deleteMessage":"Opravdu chcete smazat?","confirm.unsavedChanges":"Máte neuložené změny. Zahodit?","console.shell":"Příkazový řádek","console.terminal":"Terminál","console.prompt":"Zadejte příkaz…","console.clear":"Vymazat konzoli","console.run":"Spustit","console.output":"Výstup","console.newSession":"Nová relace","console.closeSession":"Zavřít relaci","controls.save":"Uložit","controls.cancel":"Zrušit","controls.delete":"Smazat","controls.edit":"Upravit","controls.add":"Přidat","controls.remove":"Odebrat","controls.close":"Zavřít","controls.open":"Otevřít","controls.refresh":"Obnovit","controls.new":"Nový","controls.duplicate":"Duplikovat","controls.sort":"Řadit","controls.group":"Seskupit","controls.pin":"Připnout","controls.unpin":"Odepnout","controls.lock":"Zamknout","controls.unlock":"Odemknout","controls.share":"Sdílet","controls.archive":"Archivovat","cookie.title":"Souhlas s cookies","cookie.message":"Tento web používá cookies pro zlepšení vašeho zážitku.","cookie.accept":"Přijmout vše","cookie.reject":"Odmítnout vše","cookie.settings":"Nastavení cookies","cookie.necessary":"Nezbytné","cookie.analytics":"Analytické","cookie.marketing":"Marketingové","dashboard.title":"Nástěnka","dashboard.addWidget":"Přidat widget","dashboard.removeWidget":"Odebrat widget","dashboard.layout":"Rozložení","dashboard.settings":"Nastavení","dashboard.customize":"Přizpůsobit","dashboard.resetLayout":"Obnovit rozložení","datetime.today":"Dnes","datetime.yesterday":"Včera","datetime.tomorrow":"Zítra","datetime.selectDate":"Vybrat datum","datetime.selectTime":"Vybrat čas","datetime.startDate":"Datum zahájení","datetime.endDate":"Datum ukončení","datetime.startTime":"Čas zahájení","datetime.endTime":"Čas ukončení","datetime.am":"dop.","datetime.pm":"odp.","desktop.start":"Start","desktop.taskbar":"Hlavní panel","desktop.systemTray":"Systémová lišta","desktop.wallpaper":"Tapeta","desktop.icons":"Ikony plochy","desktop.arrangeIcons":"Uspořádat ikony","dock.pin":"Připnout na dock","dock.unpin":"Odepnout z docku","dock.close":"Zavřít","dock.minimize":"Minimalizovat","dock.maximize":"Maximalizovat","dock.restore":"Obnovit","docEditor.paragraph":"Odstavec","docEditor.heading":"Nadpis","docEditor.heading1":"Nadpis 1","docEditor.heading2":"Nadpis 2","docEditor.heading3":"Nadpis 3","docEditor.bulletList":"Odrážkový seznam","docEditor.numberedList":"Číslovaný seznam","docEditor.quote":"Citace","docEditor.code":"Blok kódu","docEditor.divider":"Oddělovač","docEditor.image":"Obrázek","docEditor.table":"Tabulka","docEditor.callout":"Upozornění","docEditor.placeholder":"Začněte psát…","docEditor.slashCommand":"Napište / pro příkazy","files.upload":"Nahrát soubor","files.download":"Stáhnout","files.delete":"Smazat soubor","files.rename":"Přejmenovat","files.newFolder":"Nová složka","files.selectFile":"Vybrat soubor","files.dropzone":"Přetáhněte soubory sem","files.dragDrop":"Přetáhněte soubory sem nebo klikněte","files.maxSize":"Maximální velikost souboru","files.fileType":"Typ souboru","forms.required":"Toto pole je povinné","forms.optional":"Volitelné","forms.submit":"Odeslat","forms.reset":"Obnovit","forms.validate":"Ověřit","forms.invalid":"Neplatná hodnota","forms.minLength":"Minimální délka: {0}","forms.maxLength":"Maximální délka: {0}","forms.email":"Zadejte platný e-mail","forms.phone":"Zadejte platné telefonní číslo","imageEditor.crop":"Oříznout","imageEditor.rotate":"Otočit","imageEditor.flip":"Překlopit","imageEditor.resize":"Změnit velikost","imageEditor.filter":"Filtr","imageEditor.draw":"Kreslit","imageEditor.text":"Text","imageEditor.undo":"Zpět","imageEditor.redo":"Znovu","imageEditor.save":"Uložit","imageEditor.brightness":"Jas","imageEditor.contrast":"Kontrast","imageEditor.saturation":"Sytost","inbox.compose":"Napsat","inbox.reply":"Odpovědět","inbox.replyAll":"Odpovědět všem","inbox.forward":"Přeposlat","inbox.delete":"Smazat","inbox.archive":"Archivovat","inbox.markRead":"Označit jako přečtené","inbox.markUnread":"Označit jako nepřečtené","inbox.folders":"Složky","inbox.inbox":"Doručená pošta","inbox.sent":"Odeslaná pošta","inbox.drafts":"Koncepty","inbox.trash":"Koš","inbox.spam":"Spam","inbox.starred":"S hvězdičkou","inbox.to":"Komu","inbox.cc":"Kopie","inbox.bcc":"Skrytá kopie","inbox.subject":"Předmět","inbox.send":"Odeslat","inbox.discard":"Zahodit","inbox.attachFile":"Připojit soubor","kanban.addCard":"Přidat kartu","kanban.addColumn":"Přidat sloupec","kanban.moveCard":"Přesunout kartu","kanban.editCard":"Upravit kartu","kanban.deleteCard":"Smazat kartu","kanban.editColumn":"Upravit sloupec","kanban.deleteColumn":"Smazat sloupec","lang.en":"Angličtina","lang.pl":"Polština","lang.de":"Němčina","lang.fr":"Francouzština","lang.es":"Španělština","lang.it":"Italština","lang.pt":"Portugalština","lang.nl":"Nizozemština","lang.sv":"Švédština","lang.no":"Norština","lang.da":"Dánština","lang.fi":"Finština","lang.cs":"Čeština","lang.sk":"Slovenčina","lang.hu":"Maďarština","lang.ro":"Rumunština","lang.bg":"Bulharština","lang.uk":"Ukrajinčina","lang.ja":"Japonština","lang.ko":"Korejština","lang.zh":"Čínština","lang.ar":"Arabština","login.username":"Uživatelské jméno","login.password":"Heslo","login.signIn":"Přihlásit se","login.signOut":"Odhlásit se","login.forgotPassword":"Zapomenuté heslo?","login.register":"Registrovat se","login.rememberMe":"Zapamatovat si mě","login.newPassword":"Nové heslo","login.confirmPassword":"Potvrdit heslo","login.twoFactor":"Dvoufaktorové ověření","password.strength":"Síla hesla","password.weak":"Slabé","password.medium":"Střední","password.strong":"Silné","password.requirements":"Požadavky na heslo","pdfviewer.page":"Stránka","pdfviewer.of":"z","pdfviewer.zoom":"Přiblížení","pdfviewer.fitPage":"Přizpůsobit stránce","pdfviewer.fitWidth":"Přizpůsobit šířce","pdfviewer.download":"Stáhnout","pdfviewer.print":"Tisk","pdfviewer.search":"Hledat v dokumentu","pdfviewer.bookmark":"Záložky","pdfviewer.thumbnail":"Miniatury","picklist.available":"Dostupné","picklist.selected":"Vybrané","picklist.addAll":"Přidat vše","picklist.removeAll":"Odebrat vše","picklist.filter":"Filtrovat položky","scheduling.calendar":"Kalendář","scheduling.event":"Událost","scheduling.allDay":"Celý den","scheduling.today":"Dnes","scheduling.week":"Týden","scheduling.month":"Měsíc","scheduling.year":"Rok","scheduling.day":"Den","scheduling.agenda":"Program","scheduling.addEvent":"Přidat událost","scheduling.editEvent":"Upravit událost","scheduling.deleteEvent":"Smazat událost","scheduling.noEvents":"Žádné události","shortcuts.title":"Klávesové zkratky","shortcuts.description":"Dostupné zkratky","shortcuts.key":"Klávesa","shortcuts.command":"Příkaz","shortcuts.search":"Hledat zkratky","signature.clear":"Vymazat","signature.save":"Uložit","signature.sign":"Podepište zde","signature.draw":"Nakreslete svůj podpis","spreadsheet.cell":"Buňka","spreadsheet.row":"Řádek","spreadsheet.column":"Sloupec","spreadsheet.formula":"Vzorec","spreadsheet.insert":"Vložit","spreadsheet.delete":"Smazat","spreadsheet.sort":"Řadit","spreadsheet.sortAsc":"Řadit vzestupně","spreadsheet.sortDesc":"Řadit sestupně","spreadsheet.filter":"Filtrovat","spreadsheet.export":"Exportovat","spreadsheet.import":"Importovat","spreadsheet.addRow":"Přidat řádek","spreadsheet.addColumn":"Přidat sloupec","spreadsheet.deleteRow":"Smazat řádek","spreadsheet.deleteColumn":"Smazat sloupec","spreadsheet.freezeRow":"Ukotvit řádek","spreadsheet.freezeColumn":"Ukotvit sloupec","spreadsheet.merge":"Sloučit buňky","spreadsheet.unmerge":"Rozdělit buňky","terminal.run":"Spustit","terminal.clear":"Vymazat","terminal.copy":"Kopírovat","terminal.paste":"Vložit","terminal.newSession":"Nová relace","terminal.closeSession":"Zavřít relaci","terminal.selectAll":"Vybrat vše","theme.light":"Světlý","theme.dark":"Tmavý","theme.system":"Systém","theme.custom":"Vlastní","theme.colors":"Barvy","theme.fonts":"Písma","theme.apply":"Použít motiv","theme.preview":"Náhled","theme.reset":"Obnovit výchozí","theme.gallery":"Galerie motivů","users.profile":"Profil","users.settings":"Nastavení","users.permissions":"Oprávnění","users.role":"Role","users.active":"Aktivní","users.inactive":"Neaktivní","users.online":"Online","users.offline":"Offline","users.lastSeen":"Naposledy viděn","wm.close":"Zavřít","wm.minimize":"Minimalizovat","wm.maximize":"Maximalizovat","wm.restore":"Obnovit","wm.tile":"Dlaždice oken","wm.cascade":"Kaskáda oken","wm.closeAll":"Zavřít vše","wm.minimizeAll":"Minimalizovat vše","wm.newWindow":"Nové okno","wm.moveToFront":"Přenést dopředu"},Jr={ok:"OK",cancel:"Zrušiť",save:"Uložiť",close:"Zavrieť",delete:"Odstrániť",edit:"Upraviť",add:"Pridať",remove:"Odobrať",search:"Hľadať",filter:"Filtrovať",refresh:"Obnoviť",loading:"Načítava sa…",noData:"Žiadne dáta",error:"Chyba",success:"Úspech",warning:"Upozornenie",yes:"Áno",no:"Nie",confirm:"Potvrdiť",back:"Späť",next:"Ďalej",undo:"Späť",redo:"Znova",copy:"Kopírovať",paste:"Vložiť",settings:"Nastavenia",help:"Pomoc","nav.home":"Domov","nav.favorites":"Obľúbené","nav.logout":"Odhlásiť sa","login.username":"Používateľské meno","login.password":"Heslo","login.signIn":"Prihlásiť sa","theme.light":"Svetlý","theme.dark":"Tmavý","theme.system":"Systém","wm.close":"Zavrieť","wm.minimize":"Minimalizovať","wm.maximize":"Maximalizovať","wm.restore":"Obnoviť","lang.en":"Angličtina","lang.pl":"Poľština","lang.de":"Nemčina","lang.fr":"Francúzština","lang.es":"Španielčina","lang.it":"Taliančina","lang.pt":"Portugalčina","lang.nl":"Holandčina","lang.sv":"Švédčina","lang.no":"Nórčina","lang.da":"Dánčina","lang.fi":"Fínčina","lang.cs":"Čeština","lang.sk":"Slovenčina","lang.hu":"Maďarčina","lang.ro":"Rumunčina","lang.bg":"Bulharčina","lang.uk":"Ukrajinčina","lang.ja":"Japončina","lang.ko":"Kórejčina","lang.zh":"Čínština","lang.ar":"Arabčina"},eo={ok:"OK",cancel:"Mégse",save:"Mentés",close:"Bezárás",delete:"Törlés",edit:"Szerkesztés",add:"Hozzáadás",remove:"Eltávolítás",search:"Keresés",filter:"Szűrés",refresh:"Frissítés",loading:"Betöltés…",noData:"Nincs adat",error:"Hiba",success:"Sikeres",warning:"Figyelmeztetés",yes:"Igen",no:"Nem",confirm:"Megerősítés",back:"Vissza",next:"Következő",undo:"Visszavonás",redo:"Újra",copy:"Másolás",paste:"Beillesztés",settings:"Beállítások",help:"Segítség","nav.home":"Főoldal","nav.favorites":"Kedvencek","nav.logout":"Kijelentkezés","login.username":"Felhasználónév","login.password":"Jelszó","login.signIn":"Bejelentkezés","theme.light":"Világos","theme.dark":"Sötét","theme.system":"Rendszer","wm.close":"Bezárás","wm.minimize":"Kis méret","wm.maximize":"Teljes méret","wm.restore":"Visszaállítás","lang.en":"Angol","lang.pl":"Lengyel","lang.de":"Német","lang.fr":"Francia","lang.es":"Spanyol","lang.it":"Olasz","lang.pt":"Portugál","lang.nl":"Holland","lang.sv":"Svéd","lang.no":"Norvég","lang.da":"Dán","lang.fi":"Finn","lang.cs":"Cseh","lang.sk":"Szlovák","lang.hu":"Magyar","lang.ro":"Román","lang.bg":"Bolgár","lang.uk":"Ukrán","lang.ja":"Japán","lang.ko":"Koreai","lang.zh":"Kínai","lang.ar":"Arab"},to={ok:"OK",cancel:"Anulare",save:"Salvare",close:"Închide",delete:"Șterge",edit:"Editare",add:"Adaugă",remove:"Elimină",search:"Căutare",filter:"Filtrare",refresh:"Actualizare",loading:"Se încarcă…",noData:"Fără date",error:"Eroare",success:"Succes",warning:"Avertisment",yes:"Da",no:"Nu",confirm:"Confirmă",back:"Înapoi",next:"Următor",settings:"Setări",help:"Ajutor","nav.home":"Acasă","nav.favorites":"Favorite","nav.logout":"Deconectare","login.username":"Utilizator","login.password":"Parolă","login.signIn":"Autentificare","theme.light":"Luminos","theme.dark":"Întunecat","theme.system":"Sistem","lang.en":"Engleză","lang.pl":"Poloneză","lang.de":"Germană","lang.fr":"Franceză","lang.es":"Spaniolă","lang.it":"Italiană","lang.pt":"Portugheză","lang.nl":"Olandeză","lang.sv":"Suedeză","lang.no":"Norvegiană","lang.da":"Daneză","lang.fi":"Finlandeză","lang.cs":"Cehă","lang.sk":"Slovacă","lang.hu":"Maghiară","lang.ro":"Română","lang.bg":"Bulgară","lang.uk":"Ucraineană","lang.ja":"Japoneză","lang.ko":"Coreeană","lang.zh":"Chineză","lang.ar":"Arabă"},no={ok:"OK",cancel:"Отказ",save:"Запис",close:"Затвори",delete:"Изтрий",edit:"Редактирай",add:"Добави",remove:"Премахни",search:"Търси",filter:"Филтрирай",refresh:"Обнови",loading:"Зареждане…",noData:"Няма данни",error:"Грешка",success:"Успех",warning:"Предупреждение",yes:"Да",no:"Не",confirm:"Потвърди",back:"Назад",next:"Напред",settings:"Настройки",help:"Помощ","nav.home":"Начало","nav.favorites":"Любими","nav.logout":"Изход","login.username":"Потребителско име","login.password":"Парола","login.signIn":"Вход","theme.light":"Светла","theme.dark":"Тъмна","theme.system":"Системна","lang.en":"Английски","lang.pl":"Полски","lang.de":"Немски","lang.fr":"Френски","lang.es":"Испански","lang.it":"Италиански","lang.pt":"Португалски","lang.nl":"Нидерландски","lang.sv":"Шведски","lang.no":"Норвежки","lang.da":"Датски","lang.fi":"Фински","lang.cs":"Чешки","lang.sk":"Словашки","lang.hu":"Унгарски","lang.ro":"Румънски","lang.bg":"Български","lang.uk":"Украински","lang.ja":"Японски","lang.ko":"Корейски","lang.zh":"Китайски","lang.ar":"Арабски"},ao={ok:"OK",cancel:"Скасувати",save:"Зберегти",close:"Закрити",delete:"Видалити",edit:"Редагувати",add:"Додати",remove:"Прибрати",search:"Пошук",filter:"Фільтрувати",refresh:"Оновити",loading:"Завантаження…",noData:"Немає даних",error:"Помилка",success:"Успіх",warning:"Попередження",info:"Інформація",yes:"Так",no:"Ні",confirm:"Підтвердити",back:"Назад",next:"Далі",previous:"Попередній",finish:"Завершити",submit:"Надіслати",reset:"Скинути",apply:"Застосувати",undo:"Скасувати",redo:"Повторити",copy:"Копіювати",cut:"Вирізати",paste:"Вставити",selectAll:"Вибрати все",clear:"Очистити",upload:"Завантажити",download:"Завантажити",print:"Друкувати",export:"Експортувати",import:"Імпортувати",settings:"Налаштування",help:"Допомога",about:"Про програму",more:"Більше",less:"Менше",show:"Показати",hide:"Приховати",expand:"Розгорнути",collapse:"Згорнути",enabled:"Увімкнено",disabled:"Вимкнено",required:"Обов'язково",optional:"Необов'язково",actions:"Дії",details:"Деталі",overview:"Огляд",all:"Всі",none:"Немає",selected:"Обрано",total:"Всього",of:"з",items:"елементів",page:"Сторінка",rows:"Рядки","app.name":"Додаток","app.version":"Версія","app.about":"Про програму","nav.home":"Головна","nav.back":"Назад","nav.forward":"Вперед","nav.menu":"Меню","nav.sidebar":"Бічна панель","nav.search":"Пошук","nav.favorites":"Обране","nav.recent":"Нещодавнє","nav.notifications":"Сповіщення","nav.profile":"Профіль","nav.logout":"Вийти","carousel.prev":"Попередній слайд","carousel.next":"Наступний слайд","carousel.slide":"Слайд","carousel.of":"з","carousel.autoplay":"Автопрогравання","carousel.pause":"Пауза","confirm.yes":"Так","confirm.no":"Ні","confirm.ok":"OK","confirm.cancel":"Скасувати","confirm.title":"Підтвердження","confirm.deleteMessage":"Ви впевнені, що хочете видалити?","confirm.unsavedChanges":"Незбережені зміни. Відхилити?","console.shell":"Оболонка","console.terminal":"Термінал","console.prompt":"Введіть команду…","console.clear":"Очистити консоль","console.run":"Виконати","console.output":"Вивід","console.newSession":"Нова сесія","console.closeSession":"Закрити сесію","controls.save":"Зберегти","controls.cancel":"Скасувати","controls.delete":"Видалити","controls.edit":"Редагувати","controls.add":"Додати","controls.remove":"Видалити","controls.close":"Закрити","controls.open":"Відкрити","controls.refresh":"Оновити","controls.new":"Новий","controls.duplicate":"Дублювати","controls.sort":"Сортувати","controls.group":"Групувати","controls.pin":"Закріпити","controls.unpin":"Відкріпити","controls.lock":"Заблокувати","controls.unlock":"Розблокувати","controls.share":"Поділитися","controls.archive":"Архівувати","cookie.title":"Згода на cookies","cookie.message":"Цей сайт використовує cookies.","cookie.accept":"Прийняти всі","cookie.reject":"Відхилити всі","cookie.settings":"Налаштування cookies","cookie.necessary":"Необхідні","cookie.analytics":"Аналітичні","cookie.marketing":"Маркетингові","dashboard.title":"Панель керування","dashboard.addWidget":"Додати віджет","dashboard.removeWidget":"Видалити віджет","dashboard.layout":"Макет","dashboard.settings":"Налаштування","dashboard.customize":"Налаштувати","dashboard.resetLayout":"Скинути макет","datetime.today":"Сьогодні","datetime.yesterday":"Вчора","datetime.tomorrow":"Завтра","datetime.selectDate":"Вибрати дату","datetime.selectTime":"Вибрати час","datetime.startDate":"Дата початку","datetime.endDate":"Дата закінчення","datetime.startTime":"Час початку","datetime.endTime":"Час закінчення","datetime.am":"ДП","datetime.pm":"ПП","desktop.start":"Пуск","desktop.taskbar":"Панель завдань","desktop.systemTray":"Системний лоток","desktop.wallpaper":"Шпалери","desktop.icons":"Значки робочого столу","desktop.arrangeIcons":"Упорядкувати значки","dock.pin":"Закріпити на док-панелі","dock.unpin":"Відкріпити від док-панелі","dock.close":"Закрити","dock.minimize":"Згорнути","dock.maximize":"Розгорнути","dock.restore":"Відновити","docEditor.paragraph":"Абзац","docEditor.heading":"Заголовок","docEditor.heading1":"Заголовок 1","docEditor.heading2":"Заголовок 2","docEditor.heading3":"Заголовок 3","docEditor.bulletList":"Маркований список","docEditor.numberedList":"Нумерований список","docEditor.quote":"Цитата","docEditor.code":"Блок коду","docEditor.divider":"Роздільник","docEditor.image":"Зображення","docEditor.table":"Таблиця","docEditor.callout":"Виноска","docEditor.placeholder":"Почніть писати…","docEditor.slashCommand":"Введіть / для команд","files.upload":"Завантажити файл","files.download":"Завантажити","files.delete":"Видалити файл","files.rename":"Перейменувати","files.newFolder":"Нова папка","files.selectFile":"Вибрати файл","files.dropzone":"Перетягніть файли сюди","files.dragDrop":"Перетягніть файли або натисніть","files.maxSize":"Максимальний розмір файлу","files.fileType":"Тип файлу","forms.required":"Це поле обов'язкове","forms.optional":"Необов'язково","forms.submit":"Надіслати","forms.reset":"Скинути","forms.validate":"Перевірити","forms.invalid":"Недійсне значення","forms.minLength":"Мінімальна довжина: {0}","forms.maxLength":"Максимальна довжина: {0}","forms.email":"Введіть дійсну електронну пошту","forms.phone":"Введіть дійсний номер телефону","imageEditor.crop":"Обрізати","imageEditor.rotate":"Повернути","imageEditor.flip":"Відобразити","imageEditor.resize":"Змінити розмір","imageEditor.filter":"Фільтр","imageEditor.draw":"Малювати","imageEditor.text":"Текст","imageEditor.undo":"Скасувати","imageEditor.redo":"Повторити","imageEditor.save":"Зберегти","imageEditor.brightness":"Яскравість","imageEditor.contrast":"Контрастність","imageEditor.saturation":"Насиченість","inbox.compose":"Написати","inbox.reply":"Відповісти","inbox.replyAll":"Відповісти всім","inbox.forward":"Переслати","inbox.delete":"Видалити","inbox.archive":"Архівувати","inbox.markRead":"Позначити як прочитане","inbox.markUnread":"Позначити як непрочитане","inbox.folders":"Папки","inbox.inbox":"Вхідні","inbox.sent":"Надіслані","inbox.drafts":"Чернетки","inbox.trash":"Кошик","inbox.spam":"Спам","inbox.starred":"Позначені","inbox.to":"Кому","inbox.cc":"Копія","inbox.bcc":"Прихована копія","inbox.subject":"Тема","inbox.send":"Надіслати","inbox.discard":"Скасувати","inbox.attachFile":"Прикріпити файл","kanban.addCard":"Додати картку","kanban.addColumn":"Додати колонку","kanban.moveCard":"Перемістити картку","kanban.editCard":"Редагувати картку","kanban.deleteCard":"Видалити картку","kanban.editColumn":"Редагувати колонку","kanban.deleteColumn":"Видалити колонку","lang.en":"Англійська","lang.pl":"Польська","lang.de":"Німецька","lang.fr":"Французька","lang.es":"Іспанська","lang.it":"Італійська","lang.pt":"Португальська","lang.nl":"Нідерландська","lang.sv":"Шведська","lang.no":"Норвезька","lang.da":"Данська","lang.fi":"Фінська","lang.cs":"Чеська","lang.sk":"Словацька","lang.hu":"Угорська","lang.ro":"Румунська","lang.bg":"Болгарська","lang.uk":"Українська","lang.ja":"Японська","lang.ko":"Корейська","lang.zh":"Китайська","lang.ar":"Арабська","login.username":"Ім'я користувача","login.password":"Пароль","login.signIn":"Увійти","login.signOut":"Вийти","login.forgotPassword":"Забули пароль?","login.register":"Зареєструватися","login.rememberMe":"Запам'ятати мене","login.newPassword":"Новий пароль","login.confirmPassword":"Підтвердити пароль","login.twoFactor":"Двофакторна автентифікація","password.strength":"Надійність пароля","password.weak":"Слабкий","password.medium":"Середній","password.strong":"Сильний","password.requirements":"Вимоги до пароля","pdfviewer.page":"Сторінка","pdfviewer.of":"з","pdfviewer.zoom":"Масштаб","pdfviewer.fitPage":"За розміром сторінки","pdfviewer.fitWidth":"За шириною","pdfviewer.download":"Завантажити","pdfviewer.print":"Друкувати","pdfviewer.search":"Пошук у документі","pdfviewer.bookmark":"Закладки","pdfviewer.thumbnail":"Мініатюри","picklist.available":"Доступні","picklist.selected":"Обрані","picklist.addAll":"Додати всі","picklist.removeAll":"Видалити всі","picklist.filter":"Фільтрувати елементи","scheduling.calendar":"Календар","scheduling.event":"Подія","scheduling.allDay":"Весь день","scheduling.today":"Сьогодні","scheduling.week":"Тиждень","scheduling.month":"Місяць","scheduling.year":"Рік","scheduling.day":"День","scheduling.agenda":"Порядок денний","scheduling.addEvent":"Додати подію","scheduling.editEvent":"Редагувати подію","scheduling.deleteEvent":"Видалити подію","scheduling.noEvents":"Немає подій","shortcuts.title":"Гарячі клавіші","shortcuts.description":"Доступні гарячі клавіші","shortcuts.key":"Клавіша","shortcuts.command":"Команда","shortcuts.search":"Пошук гарячих клавіш","signature.clear":"Очистити","signature.save":"Зберегти","signature.sign":"Підпишіть тут","signature.draw":"Намалюйте підпис","spreadsheet.cell":"Клітинка","spreadsheet.row":"Рядок","spreadsheet.column":"Колонка","spreadsheet.formula":"Формула","spreadsheet.insert":"Вставити","spreadsheet.delete":"Видалити","spreadsheet.sort":"Сортувати","spreadsheet.sortAsc":"За зростанням","spreadsheet.sortDesc":"За спаданням","spreadsheet.filter":"Фільтрувати","spreadsheet.export":"Експортувати","spreadsheet.import":"Імпортувати","spreadsheet.addRow":"Додати рядок","spreadsheet.addColumn":"Додати колонку","spreadsheet.deleteRow":"Видалити рядок","spreadsheet.deleteColumn":"Видалити колонку","spreadsheet.freezeRow":"Закріпити рядок","spreadsheet.freezeColumn":"Закріпити колонку","spreadsheet.merge":"Об'єднати клітинки","spreadsheet.unmerge":"Роз'єднати клітинки","terminal.run":"Виконати","terminal.clear":"Очистити","terminal.copy":"Копіювати","terminal.paste":"Вставити","terminal.newSession":"Нова сесія","terminal.closeSession":"Закрити сесію","terminal.selectAll":"Вибрати все","theme.light":"Світла","theme.dark":"Темна","theme.system":"Системна","theme.custom":"Власна","theme.colors":"Кольори","theme.fonts":"Шрифти","theme.apply":"Застосувати тему","theme.preview":"Попередній перегляд","theme.reset":"Скинути","theme.gallery":"Галерея тем","users.profile":"Профіль","users.settings":"Налаштування","users.permissions":"Дозволи","users.role":"Роль","users.active":"Активний","users.inactive":"Неактивний","users.online":"Онлайн","users.offline":"Офлайн","users.lastSeen":"Востаннє бачено","wm.close":"Закрити","wm.minimize":"Згорнути","wm.maximize":"Розгорнути","wm.restore":"Відновити","wm.tile":"Вікна плиткою","wm.cascade":"Вікна каскадом","wm.closeAll":"Закрити всі","wm.minimizeAll":"Згорнути всі","wm.newWindow":"Нове вікно","wm.moveToFront":"На передній план"},io={ok:"OK",cancel:"キャンセル",save:"保存",close:"閉じる",delete:"削除",edit:"編集",add:"追加",remove:"削除",search:"検索",filter:"フィルター",refresh:"更新",loading:"読み込み中…",noData:"データなし",error:"エラー",success:"成功",warning:"警告",info:"情報",yes:"はい",no:"いいえ",confirm:"確認",back:"戻る",next:"次へ",previous:"前へ",finish:"完了",submit:"送信",reset:"リセット",apply:"適用",undo:"元に戻す",redo:"やり直す",copy:"コピー",cut:"切り取り",paste:"貼り付け",selectAll:"すべて選択",clear:"クリア",upload:"アップロード",download:"ダウンロード",print:"印刷",export:"エクスポート",import:"インポート",settings:"設定",help:"ヘルプ",about:"バージョン情報",more:"もっと見る",less:"閉じる",show:"表示",hide:"非表示",expand:"展開",collapse:"折りたたむ",enabled:"有効",disabled:"無効",required:"必須",optional:"任意",actions:"アクション",details:"詳細",overview:"概要",all:"すべて",none:"なし",selected:"選択済み",total:"合計",of:"/",items:"件",page:"ページ",rows:"行","app.name":"アプリケーション","app.version":"バージョン","app.about":"バージョン情報","nav.home":"ホーム","nav.back":"戻る","nav.forward":"進む","nav.menu":"メニュー","nav.sidebar":"サイドバー","nav.search":"検索","nav.favorites":"お気に入り","nav.recent":"最近","nav.notifications":"通知","nav.profile":"プロフィール","nav.logout":"ログアウト","carousel.prev":"前のスライド","carousel.next":"次のスライド","carousel.slide":"スライド","carousel.of":"/","carousel.autoplay":"自動再生","carousel.pause":"一時停止","confirm.yes":"はい","confirm.no":"いいえ","confirm.ok":"OK","confirm.cancel":"キャンセル","confirm.title":"確認","confirm.deleteMessage":"本当に削除しますか?","confirm.unsavedChanges":"未保存の変更があります。破棄しますか?","console.shell":"シェル","console.terminal":"ターミナル","console.prompt":"コマンドを入力…","console.clear":"コンソールをクリア","console.run":"実行","console.output":"出力","console.newSession":"新しいセッション","console.closeSession":"セッションを閉じる","controls.save":"保存","controls.cancel":"キャンセル","controls.delete":"削除","controls.edit":"編集","controls.add":"追加","controls.remove":"削除","controls.close":"閉じる","controls.open":"開く","controls.refresh":"更新","controls.new":"新規","controls.duplicate":"複製","controls.sort":"並べ替え","controls.group":"グループ化","controls.pin":"ピン留め","controls.unpin":"ピン留め解除","controls.lock":"ロック","controls.unlock":"ロック解除","controls.share":"共有","controls.archive":"アーカイブ","cookie.title":"Cookieの同意","cookie.message":"このサイトではCookieを使用しています。","cookie.accept":"すべて許可","cookie.reject":"すべて拒否","cookie.settings":"Cookie設定","cookie.necessary":"必須","cookie.analytics":"分析","cookie.marketing":"マーケティング","dashboard.title":"ダッシュボード","dashboard.addWidget":"ウィジェットを追加","dashboard.removeWidget":"ウィジェットを削除","dashboard.layout":"レイアウト","dashboard.settings":"設定","dashboard.customize":"カスタマイズ","dashboard.resetLayout":"レイアウトをリセット","datetime.today":"今日","datetime.yesterday":"昨日","datetime.tomorrow":"明日","datetime.selectDate":"日付を選択","datetime.selectTime":"時刻を選択","datetime.startDate":"開始日","datetime.endDate":"終了日","datetime.startTime":"開始時刻","datetime.endTime":"終了時刻","datetime.am":"午前","datetime.pm":"午後","desktop.start":"スタート","desktop.taskbar":"タスクバー","desktop.systemTray":"システムトレイ","desktop.wallpaper":"壁紙","desktop.icons":"デスクトップアイコン","desktop.arrangeIcons":"アイコンの整列","dock.pin":"ドックに固定","dock.unpin":"ドックから外す","dock.close":"閉じる","dock.minimize":"最小化","dock.maximize":"最大化","dock.restore":"復元","docEditor.paragraph":"段落","docEditor.heading":"見出し","docEditor.heading1":"見出し1","docEditor.heading2":"見出し2","docEditor.heading3":"見出し3","docEditor.bulletList":"箇条書き","docEditor.numberedList":"番号付きリスト","docEditor.quote":"引用","docEditor.code":"コードブロック","docEditor.divider":"区切り線","docEditor.image":"画像","docEditor.table":"テーブル","docEditor.callout":"注意書き","docEditor.placeholder":"入力を開始…","docEditor.slashCommand":"/でコマンド入力","files.upload":"ファイルをアップロード","files.download":"ダウンロード","files.delete":"ファイルを削除","files.rename":"名前を変更","files.newFolder":"新しいフォルダー","files.selectFile":"ファイルを選択","files.dropzone":"ここにファイルをドロップ","files.dragDrop":"ファイルをドラッグ&ドロップまたはクリック","files.maxSize":"最大ファイルサイズ","files.fileType":"ファイルの種類","forms.required":"この項目は必須です","forms.optional":"任意","forms.submit":"送信","forms.reset":"リセット","forms.validate":"検証","forms.invalid":"無効な値","forms.minLength":"最小文字数: {0}","forms.maxLength":"最大文字数: {0}","forms.email":"有効なメールアドレスを入力してください","forms.phone":"有効な電話番号を入力してください","imageEditor.crop":"トリミング","imageEditor.rotate":"回転","imageEditor.flip":"反転","imageEditor.resize":"サイズ変更","imageEditor.filter":"フィルター","imageEditor.draw":"描画","imageEditor.text":"テキスト","imageEditor.undo":"元に戻す","imageEditor.redo":"やり直す","imageEditor.save":"保存","imageEditor.brightness":"明るさ","imageEditor.contrast":"コントラスト","imageEditor.saturation":"彩度","inbox.compose":"作成","inbox.reply":"返信","inbox.replyAll":"全員に返信","inbox.forward":"転送","inbox.delete":"削除","inbox.archive":"アーカイブ","inbox.markRead":"既読にする","inbox.markUnread":"未読にする","inbox.folders":"フォルダー","inbox.inbox":"受信トレイ","inbox.sent":"送信済み","inbox.drafts":"下書き","inbox.trash":"ゴミ箱","inbox.spam":"スパム","inbox.starred":"スター付き","inbox.to":"宛先","inbox.cc":"CC","inbox.bcc":"BCC","inbox.subject":"件名","inbox.send":"送信","inbox.discard":"破棄","inbox.attachFile":"ファイルを添付","kanban.addCard":"カードを追加","kanban.addColumn":"列を追加","kanban.moveCard":"カードを移動","kanban.editCard":"カードを編集","kanban.deleteCard":"カードを削除","kanban.editColumn":"列を編集","kanban.deleteColumn":"列を削除","lang.en":"英語","lang.pl":"ポーランド語","lang.de":"ドイツ語","lang.fr":"フランス語","lang.es":"スペイン語","lang.it":"イタリア語","lang.pt":"ポルトガル語","lang.nl":"オランダ語","lang.sv":"スウェーデン語","lang.no":"ノルウェー語","lang.da":"デンマーク語","lang.fi":"フィンランド語","lang.cs":"チェコ語","lang.sk":"スロバキア語","lang.hu":"ハンガリー語","lang.ro":"ルーマニア語","lang.bg":"ブルガリア語","lang.uk":"ウクライナ語","lang.ja":"日本語","lang.ko":"韓国語","lang.zh":"中国語","lang.ar":"アラビア語","login.username":"ユーザー名","login.password":"パスワード","login.signIn":"サインイン","login.signOut":"サインアウト","login.forgotPassword":"パスワードをお忘れですか?","login.register":"新規登録","login.rememberMe":"ログイン状態を保持","login.newPassword":"新しいパスワード","login.confirmPassword":"パスワードの確認","login.twoFactor":"二要素認証","password.strength":"パスワード強度","password.weak":"弱い","password.medium":"普通","password.strong":"強い","password.requirements":"パスワード要件","pdfviewer.page":"ページ","pdfviewer.of":"/","pdfviewer.zoom":"ズーム","pdfviewer.fitPage":"ページに合わせる","pdfviewer.fitWidth":"幅に合わせる","pdfviewer.download":"ダウンロード","pdfviewer.print":"印刷","pdfviewer.search":"ドキュメント内を検索","pdfviewer.bookmark":"ブックマーク","pdfviewer.thumbnail":"サムネイル","picklist.available":"利用可能","picklist.selected":"選択済み","picklist.addAll":"すべて追加","picklist.removeAll":"すべて削除","picklist.filter":"項目をフィルター","scheduling.calendar":"カレンダー","scheduling.event":"イベント","scheduling.allDay":"終日","scheduling.today":"今日","scheduling.week":"週","scheduling.month":"月","scheduling.year":"年","scheduling.day":"日","scheduling.agenda":"アジェンダ","scheduling.addEvent":"イベントを追加","scheduling.editEvent":"イベントを編集","scheduling.deleteEvent":"イベントを削除","scheduling.noEvents":"イベントなし","shortcuts.title":"キーボードショートカット","shortcuts.description":"利用可能なショートカット","shortcuts.key":"キー","shortcuts.command":"コマンド","shortcuts.search":"ショートカットを検索","signature.clear":"クリア","signature.save":"保存","signature.sign":"ここに署名","signature.draw":"署名を描いてください","spreadsheet.cell":"セル","spreadsheet.row":"行","spreadsheet.column":"列","spreadsheet.formula":"数式","spreadsheet.insert":"挿入","spreadsheet.delete":"削除","spreadsheet.sort":"並べ替え","spreadsheet.sortAsc":"昇順","spreadsheet.sortDesc":"降順","spreadsheet.filter":"フィルター","spreadsheet.export":"エクスポート","spreadsheet.import":"インポート","spreadsheet.addRow":"行を追加","spreadsheet.addColumn":"列を追加","spreadsheet.deleteRow":"行を削除","spreadsheet.deleteColumn":"列を削除","spreadsheet.freezeRow":"行を固定","spreadsheet.freezeColumn":"列を固定","spreadsheet.merge":"セルを結合","spreadsheet.unmerge":"セルの結合を解除","terminal.run":"実行","terminal.clear":"クリア","terminal.copy":"コピー","terminal.paste":"貼り付け","terminal.newSession":"新しいセッション","terminal.closeSession":"セッションを閉じる","terminal.selectAll":"すべて選択","theme.light":"ライト","theme.dark":"ダーク","theme.system":"システム","theme.custom":"カスタム","theme.colors":"色","theme.fonts":"フォント","theme.apply":"テーマを適用","theme.preview":"プレビュー","theme.reset":"デフォルトに戻す","theme.gallery":"テーマギャラリー","users.profile":"プロフィール","users.settings":"設定","users.permissions":"権限","users.role":"ロール","users.active":"アクティブ","users.inactive":"非アクティブ","users.online":"オンライン","users.offline":"オフライン","users.lastSeen":"最終ログイン","wm.close":"閉じる","wm.minimize":"最小化","wm.maximize":"最大化","wm.restore":"復元","wm.tile":"ウィンドウの並替","wm.cascade":"カスケード","wm.closeAll":"すべて閉じる","wm.minimizeAll":"すべて最小化","wm.newWindow":"新しいウィンドウ","wm.moveToFront":"最前面に移動"},ro={ok:"확인",cancel:"취소",save:"저장",close:"닫기",delete:"삭제",edit:"편집",add:"추가",remove:"제거",search:"검색",filter:"필터",refresh:"새로고침",loading:"로딩 중…",noData:"데이터 없음",error:"오류",success:"성공",warning:"경고",info:"정보",yes:"예",no:"아니오",confirm:"확인",back:"뒤로",next:"다음",previous:"이전",finish:"완료",submit:"제출",reset:"초기화",apply:"적용",undo:"실행취소",redo:"다시실행",copy:"복사",cut:"잘라내기",paste:"붙여넣기",selectAll:"전체선택",clear:"지우기",upload:"업로드",download:"다운로드",print:"인쇄",export:"내보내기",import:"가져오기",settings:"설정",help:"도움말",about:"정보",more:"더보기",less:"줄이기",show:"표시",hide:"숨기기",expand:"펼치기",collapse:"접기",enabled:"활성",disabled:"비활성",required:"필수",optional:"선택사항",actions:"작업",details:"상세",overview:"개요",all:"전체",none:"없음",selected:"선택됨",total:"합계",of:"/",items:"개",page:"페이지",rows:"행","app.name":"애플리케이션","app.version":"버전","app.about":"정보","nav.home":"홈","nav.back":"뒤로","nav.forward":"앞으로","nav.menu":"메뉴","nav.sidebar":"사이드바","nav.search":"검색","nav.favorites":"즐겨찾기","nav.recent":"최근","nav.notifications":"알림","nav.profile":"프로필","nav.logout":"로그아웃","carousel.prev":"이전 슬라이드","carousel.next":"다음 슬라이드","carousel.slide":"슬라이드","carousel.of":"/","carousel.autoplay":"자동재생","carousel.pause":"일시정지","confirm.yes":"예","confirm.no":"아니오","confirm.ok":"확인","confirm.cancel":"취소","confirm.title":"확인","confirm.deleteMessage":"정말 삭제하시겠습니까?","confirm.unsavedChanges":"저장되지 않은 변경사항이 있습니다. 취소하시겠습니까?","console.shell":"셸","console.terminal":"터미널","console.prompt":"명령어 입력…","console.clear":"콘솔 지우기","console.run":"실행","console.output":"출력","console.newSession":"새 세션","console.closeSession":"세션 닫기","controls.save":"저장","controls.cancel":"취소","controls.delete":"삭제","controls.edit":"편집","controls.add":"추가","controls.remove":"제거","controls.close":"닫기","controls.open":"열기","controls.refresh":"새로고침","controls.new":"새로 만들기","controls.duplicate":"복제","controls.sort":"정렬","controls.group":"그룹화","controls.pin":"고정","controls.unpin":"고정 해제","controls.lock":"잠금","controls.unlock":"잠금 해제","controls.share":"공유","controls.archive":"보관","cookie.title":"쿠키 동의","cookie.message":"이 사이트는 쿠키를 사용합니다.","cookie.accept":"모두 허용","cookie.reject":"모두 거부","cookie.settings":"쿠키 설정","cookie.necessary":"필수","cookie.analytics":"분석","cookie.marketing":"마케팅","dashboard.title":"대시보드","dashboard.addWidget":"위젯 추가","dashboard.removeWidget":"위젯 제거","dashboard.layout":"레이아웃","dashboard.settings":"설정","dashboard.customize":"사용자 정의","dashboard.resetLayout":"레이아웃 초기화","datetime.today":"오늘","datetime.yesterday":"어제","datetime.tomorrow":"내일","datetime.selectDate":"날짜 선택","datetime.selectTime":"시간 선택","datetime.startDate":"시작일","datetime.endDate":"종료일","datetime.startTime":"시작 시간","datetime.endTime":"종료 시간","datetime.am":"오전","datetime.pm":"오후","desktop.start":"시작","desktop.taskbar":"작업 표시줄","desktop.systemTray":"시스템 트레이","desktop.wallpaper":"배경화면","desktop.icons":"바탕화면 아이콘","desktop.arrangeIcons":"아이콘 정렬","dock.pin":"독에 고정","dock.unpin":"독에서 해제","dock.close":"닫기","dock.minimize":"최소화","dock.maximize":"최대화","dock.restore":"복원","docEditor.paragraph":"단락","docEditor.heading":"제목","docEditor.heading1":"제목 1","docEditor.heading2":"제목 2","docEditor.heading3":"제목 3","docEditor.bulletList":"글머리 기호 목록","docEditor.numberedList":"번호 매기기 목록","docEditor.quote":"인용","docEditor.code":"코드 블록","docEditor.divider":"구분선","docEditor.image":"이미지","docEditor.table":"표","docEditor.callout":"설명","docEditor.placeholder":"입력 시작…","docEditor.slashCommand":"/로 명령 입력","files.upload":"파일 업로드","files.download":"다운로드","files.delete":"파일 삭제","files.rename":"이름 변경","files.newFolder":"새 폴더","files.selectFile":"파일 선택","files.dropzone":"여기에 파일을 드롭하세요","files.dragDrop":"파일을 드래그 앤 드롭하거나 클릭","files.maxSize":"최대 파일 크기","files.fileType":"파일 유형","forms.required":"이 항목은 필수입니다","forms.optional":"선택사항","forms.submit":"제출","forms.reset":"초기화","forms.validate":"검증","forms.invalid":"잘못된 값","forms.minLength":"최소 길이: {0}","forms.maxLength":"최대 길이: {0}","forms.email":"유효한 이메일을 입력하세요","forms.phone":"유효한 전화번호를 입력하세요","imageEditor.crop":"자르기","imageEditor.rotate":"회전","imageEditor.flip":"뒤집기","imageEditor.resize":"크기 조정","imageEditor.filter":"필터","imageEditor.draw":"그리기","imageEditor.text":"텍스트","imageEditor.undo":"실행취소","imageEditor.redo":"다시실행","imageEditor.save":"저장","imageEditor.brightness":"밝기","imageEditor.contrast":"대비","imageEditor.saturation":"채도","inbox.compose":"작성","inbox.reply":"답장","inbox.replyAll":"전체 답장","inbox.forward":"전달","inbox.delete":"삭제","inbox.archive":"보관","inbox.markRead":"읽음으로 표시","inbox.markUnread":"읽지 않음으로 표시","inbox.folders":"폴더","inbox.inbox":"받은편지함","inbox.sent":"보낸편지함","inbox.drafts":"임시보관함","inbox.trash":"휴지통","inbox.spam":"스팸","inbox.starred":"별표","inbox.to":"받는 사람","inbox.cc":"참조","inbox.bcc":"숨은 참조","inbox.subject":"제목","inbox.send":"보내기","inbox.discard":"취소","inbox.attachFile":"파일 첨부","kanban.addCard":"카드 추가","kanban.addColumn":"열 추가","kanban.moveCard":"카드 이동","kanban.editCard":"카드 편집","kanban.deleteCard":"카드 삭제","kanban.editColumn":"열 편집","kanban.deleteColumn":"열 삭제","lang.en":"영어","lang.pl":"폴란드어","lang.de":"독일어","lang.fr":"프랑스어","lang.es":"스페인어","lang.it":"이탈리아어","lang.pt":"포르투갈어","lang.nl":"네덜란드어","lang.sv":"스웨덴어","lang.no":"노르웨이어","lang.da":"덴마크어","lang.fi":"핀란드어","lang.cs":"체코어","lang.sk":"슬로바키아어","lang.hu":"헝가리어","lang.ro":"루마니아어","lang.bg":"불가리아어","lang.uk":"우크라이나어","lang.ja":"일본어","lang.ko":"한국어","lang.zh":"중국어","lang.ar":"아랍어","login.username":"사용자 이름","login.password":"비밀번호","login.signIn":"로그인","login.signOut":"로그아웃","login.forgotPassword":"비밀번호를 잊으셨나요?","login.register":"회원가입","login.rememberMe":"로그인 상태 유지","login.newPassword":"새 비밀번호","login.confirmPassword":"비밀번호 확인","login.twoFactor":"이중 인증","password.strength":"비밀번호 강도","password.weak":"약함","password.medium":"보통","password.strong":"강함","password.requirements":"비밀번호 요구사항","pdfviewer.page":"페이지","pdfviewer.of":"/","pdfviewer.zoom":"확대/축소","pdfviewer.fitPage":"페이지에 맞추기","pdfviewer.fitWidth":"너비에 맞추기","pdfviewer.download":"다운로드","pdfviewer.print":"인쇄","pdfviewer.search":"문서 내 검색","pdfviewer.bookmark":"북마크","pdfviewer.thumbnail":"썸네일","picklist.available":"사용 가능","picklist.selected":"선택됨","picklist.addAll":"전체 추가","picklist.removeAll":"전체 제거","picklist.filter":"항목 필터","scheduling.calendar":"캘린더","scheduling.event":"이벤트","scheduling.allDay":"종일","scheduling.today":"오늘","scheduling.week":"주","scheduling.month":"월","scheduling.year":"년","scheduling.day":"일","scheduling.agenda":"일정","scheduling.addEvent":"이벤트 추가","scheduling.editEvent":"이벤트 편집","scheduling.deleteEvent":"이벤트 삭제","scheduling.noEvents":"이벤트 없음","shortcuts.title":"키보드 단축키","shortcuts.description":"사용 가능한 단축키","shortcuts.key":"키","shortcuts.command":"명령","shortcuts.search":"단축키 검색","signature.clear":"지우기","signature.save":"저장","signature.sign":"여기에 서명","signature.draw":"서명을 그려주세요","spreadsheet.cell":"셀","spreadsheet.row":"행","spreadsheet.column":"열","spreadsheet.formula":"수식","spreadsheet.insert":"삽입","spreadsheet.delete":"삭제","spreadsheet.sort":"정렬","spreadsheet.sortAsc":"오름차순","spreadsheet.sortDesc":"내림차순","spreadsheet.filter":"필터","spreadsheet.export":"내보내기","spreadsheet.import":"가져오기","spreadsheet.addRow":"행 추가","spreadsheet.addColumn":"열 추가","spreadsheet.deleteRow":"행 삭제","spreadsheet.deleteColumn":"열 삭제","spreadsheet.freezeRow":"행 고정","spreadsheet.freezeColumn":"열 고정","spreadsheet.merge":"셀 병합","spreadsheet.unmerge":"셀 병합 해제","terminal.run":"실행","terminal.clear":"지우기","terminal.copy":"복사","terminal.paste":"붙여넣기","terminal.newSession":"새 세션","terminal.closeSession":"세션 닫기","terminal.selectAll":"전체선택","theme.light":"라이트","theme.dark":"다크","theme.system":"시스템","theme.custom":"사용자 정의","theme.colors":"색상","theme.fonts":"글꼴","theme.apply":"테마 적용","theme.preview":"미리보기","theme.reset":"기본값으로 복원","theme.gallery":"테마 갤러리","users.profile":"프로필","users.settings":"설정","users.permissions":"권한","users.role":"역할","users.active":"활성","users.inactive":"비활성","users.online":"온라인","users.offline":"오프라인","users.lastSeen":"마지막 접속","wm.close":"닫기","wm.minimize":"최소화","wm.maximize":"최대화","wm.restore":"복원","wm.tile":"창 정렬","wm.cascade":"계단식 배열","wm.closeAll":"모두 닫기","wm.minimizeAll":"모두 최소화","wm.newWindow":"새 창","wm.moveToFront":"맨 앞으로"},oo={ok:"确定",cancel:"取消",save:"保存",close:"关闭",delete:"删除",edit:"编辑",add:"添加",remove:"移除",search:"搜索",filter:"筛选",refresh:"刷新",loading:"加载中…",noData:"暂无数据",error:"错误",success:"成功",warning:"警告",info:"信息",yes:"是",no:"否",confirm:"确认",back:"返回",next:"下一步",previous:"上一步",finish:"完成",submit:"提交",reset:"重置",apply:"应用",undo:"撤销",redo:"重做",copy:"复制",cut:"剪切",paste:"粘贴",selectAll:"全选",clear:"清除",upload:"上传",download:"下载",print:"打印",export:"导出",import:"导入",settings:"设置",help:"帮助",about:"关于",more:"更多",less:"收起",show:"显示",hide:"隐藏",expand:"展开",collapse:"折叠",enabled:"已启用",disabled:"已禁用",required:"必填",optional:"选填",actions:"操作",details:"详情",overview:"概览",all:"全部",none:"无",selected:"已选择",total:"合计",of:"/",items:"项",page:"页",rows:"行","app.name":"应用程序","app.version":"版本","app.about":"关于","nav.home":"首页","nav.back":"返回","nav.forward":"前进","nav.menu":"菜单","nav.sidebar":"侧边栏","nav.search":"搜索","nav.favorites":"收藏","nav.recent":"最近","nav.notifications":"通知","nav.profile":"个人资料","nav.logout":"退出登录","carousel.prev":"上一张","carousel.next":"下一张","carousel.slide":"幻灯片","carousel.of":"/","carousel.autoplay":"自动播放","carousel.pause":"暂停","confirm.yes":"是","confirm.no":"否","confirm.ok":"确定","confirm.cancel":"取消","confirm.title":"确认","confirm.deleteMessage":"确定要删除吗?","confirm.unsavedChanges":"有未保存的更改。要放弃吗?","console.shell":"命令行","console.terminal":"终端","console.prompt":"输入命令…","console.clear":"清空控制台","console.run":"运行","console.output":"输出","console.newSession":"新建会话","console.closeSession":"关闭会话","controls.save":"保存","controls.cancel":"取消","controls.delete":"删除","controls.edit":"编辑","controls.add":"添加","controls.remove":"移除","controls.close":"关闭","controls.open":"打开","controls.refresh":"刷新","controls.new":"新建","controls.duplicate":"复制","controls.sort":"排序","controls.group":"分组","controls.pin":"固定","controls.unpin":"取消固定","controls.lock":"锁定","controls.unlock":"解锁","controls.share":"分享","controls.archive":"归档","cookie.title":"Cookie 同意","cookie.message":"本网站使用 Cookie 以改善您的体验。","cookie.accept":"全部接受","cookie.reject":"全部拒绝","cookie.settings":"Cookie 设置","cookie.necessary":"必要","cookie.analytics":"分析","cookie.marketing":"营销","dashboard.title":"仪表盘","dashboard.addWidget":"添加小部件","dashboard.removeWidget":"移除小部件","dashboard.layout":"布局","dashboard.settings":"设置","dashboard.customize":"自定义","dashboard.resetLayout":"重置布局","datetime.today":"今天","datetime.yesterday":"昨天","datetime.tomorrow":"明天","datetime.selectDate":"选择日期","datetime.selectTime":"选择时间","datetime.startDate":"开始日期","datetime.endDate":"结束日期","datetime.startTime":"开始时间","datetime.endTime":"结束时间","datetime.am":"上午","datetime.pm":"下午","desktop.start":"开始","desktop.taskbar":"任务栏","desktop.systemTray":"系统托盘","desktop.wallpaper":"壁纸","desktop.icons":"桌面图标","desktop.arrangeIcons":"排列图标","dock.pin":"固定到 Dock","dock.unpin":"从 Dock 取消固定","dock.close":"关闭","dock.minimize":"最小化","dock.maximize":"最大化","dock.restore":"还原","docEditor.paragraph":"段落","docEditor.heading":"标题","docEditor.heading1":"标题 1","docEditor.heading2":"标题 2","docEditor.heading3":"标题 3","docEditor.bulletList":"无序列表","docEditor.numberedList":"有序列表","docEditor.quote":"引用","docEditor.code":"代码块","docEditor.divider":"分割线","docEditor.image":"图片","docEditor.table":"表格","docEditor.callout":"提示框","docEditor.placeholder":"开始输入…","docEditor.slashCommand":"输入 / 查看命令","files.upload":"上传文件","files.download":"下载","files.delete":"删除文件","files.rename":"重命名","files.newFolder":"新建文件夹","files.selectFile":"选择文件","files.dropzone":"将文件拖放到此处","files.dragDrop":"拖放文件或点击浏览","files.maxSize":"最大文件大小","files.fileType":"文件类型","forms.required":"此字段为必填项","forms.optional":"选填","forms.submit":"提交","forms.reset":"重置","forms.validate":"验证","forms.invalid":"无效值","forms.minLength":"最小长度:{0}","forms.maxLength":"最大长度:{0}","forms.email":"请输入有效的电子邮件","forms.phone":"请输入有效的电话号码","imageEditor.crop":"裁剪","imageEditor.rotate":"旋转","imageEditor.flip":"翻转","imageEditor.resize":"调整大小","imageEditor.filter":"滤镜","imageEditor.draw":"绘制","imageEditor.text":"文字","imageEditor.undo":"撤销","imageEditor.redo":"重做","imageEditor.save":"保存","imageEditor.brightness":"亮度","imageEditor.contrast":"对比度","imageEditor.saturation":"饱和度","inbox.compose":"撰写","inbox.reply":"回复","inbox.replyAll":"全部回复","inbox.forward":"转发","inbox.delete":"删除","inbox.archive":"归档","inbox.markRead":"标为已读","inbox.markUnread":"标为未读","inbox.folders":"文件夹","inbox.inbox":"收件箱","inbox.sent":"已发送","inbox.drafts":"草稿箱","inbox.trash":"回收站","inbox.spam":"垃圾邮件","inbox.starred":"星标邮件","inbox.to":"收件人","inbox.cc":"抄送","inbox.bcc":"密送","inbox.subject":"主题","inbox.send":"发送","inbox.discard":"放弃","inbox.attachFile":"添加附件","kanban.addCard":"添加卡片","kanban.addColumn":"添加列","kanban.moveCard":"移动卡片","kanban.editCard":"编辑卡片","kanban.deleteCard":"删除卡片","kanban.editColumn":"编辑列","kanban.deleteColumn":"删除列","lang.en":"英语","lang.pl":"波兰语","lang.de":"德语","lang.fr":"法语","lang.es":"西班牙语","lang.it":"意大利语","lang.pt":"葡萄牙语","lang.nl":"荷兰语","lang.sv":"瑞典语","lang.no":"挪威语","lang.da":"丹麦语","lang.fi":"芬兰语","lang.cs":"捷克语","lang.sk":"斯洛伐克语","lang.hu":"匈牙利语","lang.ro":"罗马尼亚语","lang.bg":"保加利亚语","lang.uk":"乌克兰语","lang.ja":"日语","lang.ko":"韩语","lang.zh":"中文","lang.ar":"阿拉伯语","login.username":"用户名","login.password":"密码","login.signIn":"登录","login.signOut":"退出","login.forgotPassword":"忘记密码?","login.register":"注册","login.rememberMe":"记住我","login.newPassword":"新密码","login.confirmPassword":"确认密码","login.twoFactor":"两步验证","password.strength":"密码强度","password.weak":"弱","password.medium":"中","password.strong":"强","password.requirements":"密码要求","pdfviewer.page":"页","pdfviewer.of":"/","pdfviewer.zoom":"缩放","pdfviewer.fitPage":"适合页面","pdfviewer.fitWidth":"适合宽度","pdfviewer.download":"下载","pdfviewer.print":"打印","pdfviewer.search":"在文档中搜索","pdfviewer.bookmark":"书签","pdfviewer.thumbnail":"缩略图","picklist.available":"可用","picklist.selected":"已选择","picklist.addAll":"全部添加","picklist.removeAll":"全部移除","picklist.filter":"筛选项目","scheduling.calendar":"日历","scheduling.event":"事件","scheduling.allDay":"全天","scheduling.today":"今天","scheduling.week":"周","scheduling.month":"月","scheduling.year":"年","scheduling.day":"日","scheduling.agenda":"日程","scheduling.addEvent":"添加事件","scheduling.editEvent":"编辑事件","scheduling.deleteEvent":"删除事件","scheduling.noEvents":"暂无事件","shortcuts.title":"键盘快捷键","shortcuts.description":"可用快捷键","shortcuts.key":"按键","shortcuts.command":"命令","shortcuts.search":"搜索快捷键","signature.clear":"清除","signature.save":"保存","signature.sign":"在此签名","signature.draw":"请绘制您的签名","spreadsheet.cell":"单元格","spreadsheet.row":"行","spreadsheet.column":"列","spreadsheet.formula":"公式","spreadsheet.insert":"插入","spreadsheet.delete":"删除","spreadsheet.sort":"排序","spreadsheet.sortAsc":"升序","spreadsheet.sortDesc":"降序","spreadsheet.filter":"筛选","spreadsheet.export":"导出","spreadsheet.import":"导入","spreadsheet.addRow":"添加行","spreadsheet.addColumn":"添加列","spreadsheet.deleteRow":"删除行","spreadsheet.deleteColumn":"删除列","spreadsheet.freezeRow":"冻结行","spreadsheet.freezeColumn":"冻结列","spreadsheet.merge":"合并单元格","spreadsheet.unmerge":"取消合并","terminal.run":"运行","terminal.clear":"清除","terminal.copy":"复制","terminal.paste":"粘贴","terminal.newSession":"新建会话","terminal.closeSession":"关闭会话","terminal.selectAll":"全选","theme.light":"浅色","theme.dark":"深色","theme.system":"跟随系统","theme.custom":"自定义","theme.colors":"颜色","theme.fonts":"字体","theme.apply":"应用主题","theme.preview":"预览","theme.reset":"恢复默认","theme.gallery":"主题库","users.profile":"个人资料","users.settings":"设置","users.permissions":"权限","users.role":"角色","users.active":"活跃","users.inactive":"不活跃","users.online":"在线","users.offline":"离线","users.lastSeen":"最后在线","wm.close":"关闭","wm.minimize":"最小化","wm.maximize":"最大化","wm.restore":"还原","wm.tile":"平铺窗口","wm.cascade":"层叠窗口","wm.closeAll":"关闭全部","wm.minimizeAll":"最小化全部","wm.newWindow":"新建窗口","wm.moveToFront":"置于最前"},so={ok:"حسناً",cancel:"إلغاء",save:"حفظ",close:"إغلاق",delete:"حذف",edit:"تعديل",add:"إضافة",remove:"إزالة",search:"بحث",filter:"تصفية",refresh:"تحديث",loading:"جاري التحميل…",noData:"لا توجد بيانات",error:"خطأ",success:"نجاح",warning:"تحذير",info:"معلومات",yes:"نعم",no:"لا",confirm:"تأكيد",back:"رجوع",next:"التالي",previous:"السابق",finish:"إنهاء",submit:"إرسال",reset:"إعادة تعيين",apply:"تطبيق",undo:"تراجع",redo:"إعادة",copy:"نسخ",cut:"قص",paste:"لصق",selectAll:"تحديد الكل",clear:"مسح",upload:"رفع",download:"تنزيل",print:"طباعة",export:"تصدير",import:"استيراد",settings:"إعدادات",help:"مساعدة",about:"حول",more:"المزيد",less:"أقل",show:"إظهار",hide:"إخفاء",expand:"توسيع",collapse:"طي",enabled:"مُفعّل",disabled:"مُعطّل",required:"مطلوب",optional:"اختياري",actions:"إجراءات",details:"تفاصيل",overview:"نظرة عامة",all:"الكل",none:"لا شيء",selected:"محدد",total:"المجموع",of:"من",items:"عناصر",page:"صفحة",rows:"صفوف","app.name":"التطبيق","app.version":"الإصدار","app.about":"حول","nav.home":"الرئيسية","nav.back":"رجوع","nav.forward":"تقدم","nav.menu":"القائمة","nav.sidebar":"الشريط الجانبي","nav.search":"بحث","nav.favorites":"المفضلة","nav.recent":"الأخيرة","nav.notifications":"الإشعارات","nav.profile":"الملف الشخصي","nav.logout":"تسجيل خروج","carousel.prev":"الشريحة السابقة","carousel.next":"الشريحة التالية","carousel.slide":"شريحة","carousel.of":"من","carousel.autoplay":"تشغيل تلقائي","carousel.pause":"إيقاف مؤقت","confirm.yes":"نعم","confirm.no":"لا","confirm.ok":"حسناً","confirm.cancel":"إلغاء","confirm.title":"تأكيد","confirm.deleteMessage":"هل أنت متأكد أنك تريد الحذف؟","confirm.unsavedChanges":"لديك تغييرات غير محفوظة. هل تريد التجاهل؟","console.shell":"سطر أوامر","console.terminal":"طرفية","console.prompt":"أدخل أمراً…","console.clear":"مسح وحدة التحكم","console.run":"تشغيل","console.output":"المخرجات","console.newSession":"جلسة جديدة","console.closeSession":"إغلاق الجلسة","controls.save":"حفظ","controls.cancel":"إلغاء","controls.delete":"حذف","controls.edit":"تعديل","controls.add":"إضافة","controls.remove":"إزالة","controls.close":"إغلاق","controls.open":"فتح","controls.refresh":"تحديث","controls.new":"جديد","controls.duplicate":"تكرار","controls.sort":"ترتيب","controls.group":"تجميع","controls.pin":"تثبيت","controls.unpin":"إلغاء التثبيت","controls.lock":"قفل","controls.unlock":"فتح القفل","controls.share":"مشاركة","controls.archive":"أرشفة","cookie.title":"موافقة ملفات تعريف الارتباط","cookie.message":"يستخدم هذا الموقع ملفات تعريف الارتباط لتحسين تجربتك.","cookie.accept":"قبول الكل","cookie.reject":"رفض الكل","cookie.settings":"إعدادات ملفات تعريف الارتباط","cookie.necessary":"ضرورية","cookie.analytics":"تحليلية","cookie.marketing":"تسويقية","dashboard.title":"لوحة المعلومات","dashboard.addWidget":"إضافة عنصر","dashboard.removeWidget":"إزالة عنصر","dashboard.layout":"التخطيط","dashboard.settings":"الإعدادات","dashboard.customize":"تخصيص","dashboard.resetLayout":"إعادة تعيين التخطيط","datetime.today":"اليوم","datetime.yesterday":"أمس","datetime.tomorrow":"غداً","datetime.selectDate":"اختر تاريخاً","datetime.selectTime":"اختر وقتاً","datetime.startDate":"تاريخ البداية","datetime.endDate":"تاريخ النهاية","datetime.startTime":"وقت البداية","datetime.endTime":"وقت النهاية","datetime.am":"ص","datetime.pm":"م","desktop.start":"ابدأ","desktop.taskbar":"شريط المهام","desktop.systemTray":"علبة النظام","desktop.wallpaper":"خلفية","desktop.icons":"أيقونات سطح المكتب","desktop.arrangeIcons":"ترتيب الأيقونات","dock.pin":"تثبيت في الشريط","dock.unpin":"إلغاء التثبيت من الشريط","dock.close":"إغلاق","dock.minimize":"تصغير","dock.maximize":"تكبير","dock.restore":"استعادة","docEditor.paragraph":"فقرة","docEditor.heading":"عنوان","docEditor.heading1":"عنوان 1","docEditor.heading2":"عنوان 2","docEditor.heading3":"عنوان 3","docEditor.bulletList":"قائمة نقطية","docEditor.numberedList":"قائمة مرقمة","docEditor.quote":"اقتباس","docEditor.code":"كتلة برمجية","docEditor.divider":"فاصل","docEditor.image":"صورة","docEditor.table":"جدول","docEditor.callout":"تنبيه","docEditor.placeholder":"ابدأ بالكتابة…","docEditor.slashCommand":"اكتب / للأوامر","files.upload":"رفع ملف","files.download":"تنزيل","files.delete":"حذف ملف","files.rename":"إعادة تسمية","files.newFolder":"مجلد جديد","files.selectFile":"اختر ملفاً","files.dropzone":"اسحب الملفات هنا","files.dragDrop":"اسحب وأفلت الملفات أو انقر للتصفح","files.maxSize":"الحجم الأقصى للملف","files.fileType":"نوع الملف","forms.required":"هذا الحقل مطلوب","forms.optional":"اختياري","forms.submit":"إرسال","forms.reset":"إعادة تعيين","forms.validate":"تحقق","forms.invalid":"قيمة غير صالحة","forms.minLength":"الحد الأدنى للطول: {0}","forms.maxLength":"الحد الأقصى للطول: {0}","forms.email":"أدخل بريداً إلكترونياً صالحاً","forms.phone":"أدخل رقم هاتف صالحاً","imageEditor.crop":"اقتصاص","imageEditor.rotate":"تدوير","imageEditor.flip":"قلب","imageEditor.resize":"تغيير الحجم","imageEditor.filter":"مرشح","imageEditor.draw":"رسم","imageEditor.text":"نص","imageEditor.undo":"تراجع","imageEditor.redo":"إعادة","imageEditor.save":"حفظ","imageEditor.brightness":"السطوع","imageEditor.contrast":"التباين","imageEditor.saturation":"التشبع","inbox.compose":"إنشاء","inbox.reply":"رد","inbox.replyAll":"الرد على الكل","inbox.forward":"إعادة توجيه","inbox.delete":"حذف","inbox.archive":"أرشفة","inbox.markRead":"تحديد كمقروء","inbox.markUnread":"تحديد كغير مقروء","inbox.folders":"المجلدات","inbox.inbox":"البريد الوارد","inbox.sent":"المرسل","inbox.drafts":"المسودات","inbox.trash":"المحذوفات","inbox.spam":"البريد العشوائي","inbox.starred":"المميز بنجمة","inbox.to":"إلى","inbox.cc":"نسخة","inbox.bcc":"نسخة مخفية","inbox.subject":"الموضوع","inbox.send":"إرسال","inbox.discard":"تجاهل","inbox.attachFile":"إرفاق ملف","kanban.addCard":"إضافة بطاقة","kanban.addColumn":"إضافة عمود","kanban.moveCard":"نقل بطاقة","kanban.editCard":"تعديل بطاقة","kanban.deleteCard":"حذف بطاقة","kanban.editColumn":"تعديل عمود","kanban.deleteColumn":"حذف عمود","lang.en":"الإنجليزية","lang.pl":"البولندية","lang.de":"الألمانية","lang.fr":"الفرنسية","lang.es":"الإسبانية","lang.it":"الإيطالية","lang.pt":"البرتغالية","lang.nl":"الهولندية","lang.sv":"السويدية","lang.no":"النرويجية","lang.da":"الدانماركية","lang.fi":"الفنلندية","lang.cs":"التشيكية","lang.sk":"السلوفاكية","lang.hu":"المجرية","lang.ro":"الرومانية","lang.bg":"البلغارية","lang.uk":"الأوكرانية","lang.ja":"اليابانية","lang.ko":"الكورية","lang.zh":"الصينية","lang.ar":"العربية","login.username":"اسم المستخدم","login.password":"كلمة المرور","login.signIn":"تسجيل الدخول","login.signOut":"تسجيل الخروج","login.forgotPassword":"نسيت كلمة المرور؟","login.register":"إنشاء حساب","login.rememberMe":"تذكرني","login.newPassword":"كلمة مرور جديدة","login.confirmPassword":"تأكيد كلمة المرور","login.twoFactor":"المصادقة الثنائية","password.strength":"قوة كلمة المرور","password.weak":"ضعيفة","password.medium":"متوسطة","password.strong":"قوية","password.requirements":"متطلبات كلمة المرور","pdfviewer.page":"صفحة","pdfviewer.of":"من","pdfviewer.zoom":"تكبير","pdfviewer.fitPage":"ملاءمة الصفحة","pdfviewer.fitWidth":"ملاءمة العرض","pdfviewer.download":"تنزيل","pdfviewer.print":"طباعة","pdfviewer.search":"البحث في المستند","pdfviewer.bookmark":"إشارات مرجعية","pdfviewer.thumbnail":"صور مصغرة","picklist.available":"متاح","picklist.selected":"محدد","picklist.addAll":"إضافة الكل","picklist.removeAll":"إزالة الكل","picklist.filter":"تصفية العناصر","scheduling.calendar":"التقويم","scheduling.event":"حدث","scheduling.allDay":"طوال اليوم","scheduling.today":"اليوم","scheduling.week":"أسبوع","scheduling.month":"شهر","scheduling.year":"سنة","scheduling.day":"يوم","scheduling.agenda":"جدول أعمال","scheduling.addEvent":"إضافة حدث","scheduling.editEvent":"تعديل حدث","scheduling.deleteEvent":"حذف حدث","scheduling.noEvents":"لا توجد أحداث","shortcuts.title":"اختصارات لوحة المفاتيح","shortcuts.description":"الاختصارات المتاحة","shortcuts.key":"مفتاح","shortcuts.command":"أمر","shortcuts.search":"البحث عن اختصارات","signature.clear":"مسح","signature.save":"حفظ","signature.sign":"وقّع هنا","signature.draw":"ارسم توقيعك","spreadsheet.cell":"خلية","spreadsheet.row":"صف","spreadsheet.column":"عمود","spreadsheet.formula":"صيغة","spreadsheet.insert":"إدراج","spreadsheet.delete":"حذف","spreadsheet.sort":"ترتيب","spreadsheet.sortAsc":"ترتيب تصاعدي","spreadsheet.sortDesc":"ترتيب تنازلي","spreadsheet.filter":"تصفية","spreadsheet.export":"تصدير","spreadsheet.import":"استيراد","spreadsheet.addRow":"إضافة صف","spreadsheet.addColumn":"إضافة عمود","spreadsheet.deleteRow":"حذف صف","spreadsheet.deleteColumn":"حذف عمود","spreadsheet.freezeRow":"تجميد صف","spreadsheet.freezeColumn":"تجميد عمود","spreadsheet.merge":"دمج خلايا","spreadsheet.unmerge":"إلغاء دمج خلايا","terminal.run":"تشغيل","terminal.clear":"مسح","terminal.copy":"نسخ","terminal.paste":"لصق","terminal.newSession":"جلسة جديدة","terminal.closeSession":"إغلاق الجلسة","terminal.selectAll":"تحديد الكل","theme.light":"فاتح","theme.dark":"داكن","theme.system":"النظام","theme.custom":"مخصص","theme.colors":"الألوان","theme.fonts":"الخطوط","theme.apply":"تطبيق السمة","theme.preview":"معاينة","theme.reset":"استعادة الافتراضي","theme.gallery":"معرض السمات","users.profile":"الملف الشخصي","users.settings":"الإعدادات","users.permissions":"الصلاحيات","users.role":"الدور","users.active":"نشط","users.inactive":"غير نشط","users.online":"متصل","users.offline":"غير متصل","users.lastSeen":"آخر ظهور","wm.close":"إغلاق","wm.minimize":"تصغير","wm.maximize":"تكبير","wm.restore":"استعادة","wm.tile":"ترتيب النوافذ","wm.cascade":"تتالي النوافذ","wm.closeAll":"إغلاق الكل","wm.minimizeAll":"تصغير الكل","wm.newWindow":"نافذة جديدة","wm.moveToFront":"نقل إلى الأمام"},ia={en:Lr,pl:Br,de:Hr,fr:qr,es:Wr,it:Vr,pt:Kr,nl:Ur,sv:Yr,no:Zr,da:Gr,fi:Qr,cs:Xr,sk:Jr,hu:eo,ro:to,bg:no,uk:ao,ja:io,ko:ro,zh:oo,ar:so},lo=(e,t)=>t,Ta=o.createContext(lo),co=({t:e,lang:t="en",overrides:n,children:i})=>{const r=o.useMemo(()=>{if(e)return e;const s=ia[t]??ia.en,l=n?{...s,...n}:s;return(c,d)=>l[c]??d},[e,t,n]);return a.jsx(Ta.Provider,{value:r,children:i})};function ke(){return{t:o.useContext(Ta)}}const Ra={"chevron-down":"M6 9l6 6 6-6","chevron-up":"M18 15l-6-6-6 6","chevron-left":"M15 18l-6-6 6-6","chevron-right":"M9 6l6 6-6 6","arrow-left":"M19 12H5m0 0l7 7m-7-7l7-7","arrow-right":"M5 12h14m0 0l-7-7m7 7l-7 7","arrow-up":"M12 19V5m0 0l-7 7m7-7l7 7","arrow-down":"M12 5v14m0 0l7-7m-7 7l-7-7",close:"M18 6L6 18M6 6l12 12",plus:"M12 5v14m-7-7h14",minus:"M5 12h14",check:"M5 13l4 4L19 7",edit:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7M18.5 2.5a2.121 2.121 0 113 3L12 15l-4 1 1-4 9.5-9.5z",trash:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",copy:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z",download:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4",upload:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12",refresh:"M4 4v5h5M20 20v-5h-5M20.49 9A9 9 0 005.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 013.51 15",search:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",filter:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z","sort-asc":"M3 4h13M3 8h9m-9 4h6m4 0l4-4m0 0l4 4m-4-4v12","sort-desc":"M3 4h13M3 8h9m-9 4h9m5-4v12m0 0l-4-4m4 4l4-4",menu:"M4 6h16M4 12h16M4 18h16","more-vertical":"M12 5v.01M12 12v.01M12 19v.01","more-horizontal":"M5 12h.01M12 12h.01M19 12h.01",settings:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z",eye:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z M15 12a3 3 0 11-6 0 3 3 0 016 0z","eye-off":"M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24 M1 1l22 22",lock:"M19 11H5a2 2 0 00-2 2v7a2 2 0 002 2h14a2 2 0 002-2v-7a2 2 0 00-2-2zm-3-4a4 4 0 10-8 0v4h8V7z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",warning:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",error:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",success:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",help:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",calendar:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",clock:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",file:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z",folder:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",image:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",link:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1",mail:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",phone:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",user:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z",users:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z",home:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6",star:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",heart:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z",bell:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",grip:"M4 6h2m4 0h2m4 0h2M4 12h2m4 0h2m4 0h2M4 18h2m4 0h2m4 0h2",play:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z M21 12a9 9 0 11-18 0 9 9 0 0118 0z",pause:"M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z",stop:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z",expand:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4",collapse:"M9 9V5m0 4H5m4 0L4 4m11 5h4m-4 0V5m0 4l5-5M9 15v4m0-4H5m4 0l-5 5m15-5h-4m4 0v4m0-4l-5 5","external-link":"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"},uo={xs:12,sm:16,md:20,lg:24,xl:32},po=o.createContext({});function mo({path:e,size:t,className:n,style:i,color:r,title:s,onClick:l}){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:r||"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:`nice-icon ${n||""}`,style:i,role:s?"img":"presentation","aria-label":s,"aria-hidden":!s,onClick:l,children:[s&&a.jsx("title",{children:s}),a.jsx("path",{d:e})]})}const ho=({name:e,size:t="md",className:n,style:i,color:r,title:s,onClick:l})=>{const{resolver:c}=o.useContext(po),d=typeof t=="number"?t:uo[t];if(c){const y=c(e,d);if(y)return a.jsx("span",{className:`nice-icon-wrap ${n||""}`,style:i,onClick:l,children:y})}const u=Ra[e];return u?a.jsx(mo,{path:u,size:d,className:n,style:i,color:r,title:s,onClick:l}):null},fo=Object.keys(Ra);o.createContext(null);const $e={submit:{key:"Enter",description:"Submit / Confirm",descriptionKey:"shortcuts.submit"},cancel:{key:"Escape",description:"Cancel / Close",descriptionKey:"shortcuts.cancel"},moveUp:{key:"ArrowUp",description:"Move up",descriptionKey:"shortcuts.moveUp"},moveDown:{key:"ArrowDown",description:"Move down",descriptionKey:"shortcuts.moveDown"},moveLeft:{key:"ArrowLeft",description:"Move left",descriptionKey:"shortcuts.moveLeft"},moveRight:{key:"ArrowRight",description:"Move right",descriptionKey:"shortcuts.moveRight"},first:{key:"Home",description:"Go to first",descriptionKey:"shortcuts.first"},last:{key:"End",description:"Go to last",descriptionKey:"shortcuts.last"},pageUp:{key:"PageUp",description:"Page up",descriptionKey:"shortcuts.pageUp"},pageDown:{key:"PageDown",description:"Page down",descriptionKey:"shortcuts.pageDown"},increment:{key:"ArrowUp",description:"Increase value",descriptionKey:"shortcuts.increment"},decrement:{key:"ArrowDown",description:"Decrease value",descriptionKey:"shortcuts.decrement"},incrementBig:{key:"PageUp",description:"Increase by 10",descriptionKey:"shortcuts.incrementBig"},decrementBig:{key:"PageDown",description:"Decrease by 10",descriptionKey:"shortcuts.decrementBig"}};function go(e){var n,i,r,s;const t=[];return(n=e.modifiers)!=null&&n.includes("ctrl")&&t.push("Ctrl"),(i=e.modifiers)!=null&&i.includes("alt")&&t.push("Alt"),(r=e.modifiers)!=null&&r.includes("shift")&&t.push("Shift"),(s=e.modifiers)!=null&&s.includes("meta")&&t.push("⌘"),t.push(e.key),t.join("+")}function yo(e,t){if(!(e.key===t.key||e.key.toLowerCase()===t.key.toLowerCase()))return!1;const n=t.modifiers??[];return!(n.includes("ctrl")!==(e.ctrlKey||e.metaKey)||n.includes("alt")!==e.altKey||n.includes("shift")!==e.shiftKey)}const Oe=({shortcuts:e,position:t="top",icon:n,size:i="sm",className:r})=>{const[s,l]=o.useState(!1),c=o.useRef(null),[d,u]=o.useState({top:0,left:0}),y=o.useCallback(()=>{if(!c.current)return;const m=c.current.getBoundingClientRect(),w=8;let k=0,z=0;switch(t){case"top":k=m.top-w,z=m.left+m.width/2;break;case"bottom":k=m.bottom+w,z=m.left+m.width/2;break;case"left":k=m.top+m.height/2,z=m.left-w;break;case"right":k=m.top+m.height/2,z=m.right+w;break}u({top:k,left:z})},[t]),f=o.useCallback(()=>{y(),l(!0)},[y]),p=o.useCallback(()=>{y(),l(!0)},[y]);return e.length===0?null:a.jsxs(a.Fragment,{children:[a.jsx("button",{ref:c,type:"button",className:`nice-keyboard-hint nice-keyboard-hint--${i} ${r||""}`,onMouseEnter:f,onMouseLeave:()=>l(!1),onFocus:p,onBlur:()=>l(!1),"aria-label":"Keyboard shortcuts",tabIndex:-1,children:n||"?"}),s&&a.jsxs("div",{className:`nice-keyboard-hint__tooltip nice-keyboard-hint__tooltip--${t}`,style:{position:"fixed",top:d.top,left:d.left,transform:t==="top"?"translate(-50%, -100%)":t==="bottom"?"translate(-50%, 0)":t==="left"?"translate(-100%, -50%)":"translate(0, -50%)"},role:"tooltip",children:[a.jsx("div",{className:"nice-keyboard-hint__title",children:"Keyboard Shortcuts"}),a.jsx("ul",{className:"nice-keyboard-hint__list",children:e.map((m,w)=>a.jsxs("li",{className:"nice-keyboard-hint__item",children:[a.jsx("kbd",{className:"nice-keyboard-hint__key",children:go(m)}),a.jsx("span",{className:"nice-keyboard-hint__desc",children:m.description})]},w))})]})]})};Oe.displayName="NiceKeyboardHint";function bn(e={}){const{enabled:t=!1,onSubmit:n,preventDefault:i=!0,requireCtrl:r=!1,skipTextarea:s=!0}=e;return o.useCallback(l=>{!t||!n||l.key==="Enter"&&(r&&!l.ctrlKey&&!l.metaKey||s&&l.target.tagName==="TEXTAREA"||(i&&l.preventDefault(),n()))},[t,n,i,r,s])}o.createContext(null);o.createContext({direction:"ltr",isRTL:!1,flip:e=>e,flipStyle:(e,t)=>({[e]:t})});const bo=o.createContext({permissions:{},getAccessMode:()=>"full"});function Ee(e,t,n){const i=o.useContext(bo);return e||i.getAccessMode(t,n)}const xo=o.createContext(null);function it(){const e=o.useContext(xo);if(!e)throw new Error("useNiceAI must be used within a NiceAIProvider");return e}function vo(e={}){const t=it(),[n,i]=o.useState(""),[r,s]=o.useState(!1),l=o.useCallback(async(y,f="")=>{s(!0),i("");try{const p=(await t.complete([{role:"user",content:`Complete the following ${e.language||""} code. Return ONLY the completion text, no explanation.
|
|
17
|
+
|
|
18
|
+
Code before cursor:
|
|
19
|
+
\`\`\`
|
|
20
|
+
${y}
|
|
21
|
+
\`\`\`
|
|
22
|
+
|
|
23
|
+
Code after cursor:
|
|
24
|
+
\`\`\`
|
|
25
|
+
${f}
|
|
26
|
+
\`\`\`
|
|
27
|
+
|
|
28
|
+
Completion:`}],{model:e.model,temperature:.2,maxTokens:200})).content.trim();return i(p),p}catch{return""}finally{s(!1)}},[t,e]),c=o.useCallback(async y=>{s(!0);try{return(await t.complete([{role:"user",content:`Explain the following ${e.language||""} code concisely:
|
|
29
|
+
|
|
30
|
+
\`\`\`
|
|
31
|
+
${y}
|
|
32
|
+
\`\`\``}],{model:e.model,temperature:.3})).content}finally{s(!1)}},[t,e]),d=o.useCallback(async(y,f)=>{s(!0);try{const p=await t.complete([{role:"user",content:`Refactor the following ${e.language||""} code according to the instruction. Return ONLY the refactored code.
|
|
33
|
+
|
|
34
|
+
Code:
|
|
35
|
+
\`\`\`
|
|
36
|
+
${y}
|
|
37
|
+
\`\`\`
|
|
38
|
+
|
|
39
|
+
Instruction: ${f}
|
|
40
|
+
|
|
41
|
+
Refactored code:`}],{model:e.model,temperature:.2}),m=p.content.match(/```[\w]*\n?([\s\S]*?)```/);return m?m[1].trim():p.content.trim()}finally{s(!1)}},[t,e]),u=o.useCallback(async y=>{s(!0);try{const f=await t.complete([{role:"user",content:`Generate ${e.language||""} code from this comment/description. Return ONLY the code.
|
|
42
|
+
|
|
43
|
+
Description: ${y}
|
|
44
|
+
|
|
45
|
+
Code:`}],{model:e.model,temperature:.3}),p=f.content.match(/```[\w]*\n?([\s\S]*?)```/);return p?p[1].trim():f.content.trim()}finally{s(!1)}},[t,e]);return{suggestion:n,isLoading:r,complete:l,explain:c,refactor:d,generateFromComment:u}}function wo(){const e=it(),[t,n]=o.useState(!1);return{parseFilter:o.useCallback(async(i,r)=>{n(!0);try{const s=await e.complete([{role:"user",content:`Convert this natural language query to filter conditions. Available columns: ${JSON.stringify(r)}
|
|
46
|
+
|
|
47
|
+
Query: "${i}"
|
|
48
|
+
|
|
49
|
+
Return a JSON array of filter objects with: field, operator (eq, ne, gt, gte, lt, lte, contains, startsWith, endsWith), value.
|
|
50
|
+
Only return the JSON array, no explanation.`}],{temperature:.1,maxTokens:500});try{const l=JSON.parse(s.content);return Array.isArray(l)?l:[]}catch{return[]}}finally{n(!1)}},[e]),isLoading:t}}function ko(){const e=it(),[t,n]=o.useState(!1),i=o.useCallback(async(s,l)=>{n(!0);try{const c=s.slice(0,5),d=await e.complete([{role:"user",content:`Analyze this data and suggest the best chart type. Data sample: ${JSON.stringify(c)}
|
|
51
|
+
${l?`Context: ${l}`:""}
|
|
52
|
+
|
|
53
|
+
Return JSON with: type (line, bar, pie, scatter, area, donut), reason (brief explanation), config (suggested chart configuration like xField, yField, etc.)
|
|
54
|
+
Only return JSON.`}],{temperature:.2,maxTokens:500});try{return JSON.parse(d.content)}catch{return{type:"bar",reason:"Default chart type",config:{}}}}finally{n(!1)}},[e]),r=o.useCallback(async(s,l)=>{n(!0);try{const c=await e.complete([{role:"user",content:`Analyze this ${l} chart data and provide 3-5 key insights. Data: ${JSON.stringify(s.slice(0,20))}
|
|
55
|
+
|
|
56
|
+
Return a JSON array of insight strings.`}],{temperature:.3,maxTokens:500});try{return JSON.parse(c.content)}catch{return[]}}finally{n(!1)}},[e]);return{suggestChartType:i,generateInsights:r,isLoading:t}}function So(){const e=it(),[t,n]=o.useState(!1);return{generateForm:o.useCallback(async i=>{n(!0);try{const r=await e.complete([{role:"user",content:`Generate a form definition from this description: "${i}"
|
|
57
|
+
|
|
58
|
+
Return a JSON array of field objects with: label, field (camelCase), type (text, number, email, date, select, checkbox, textarea), required (boolean), options (for select type).
|
|
59
|
+
Only return JSON.`}],{temperature:.3,maxTokens:1e3});try{return JSON.parse(r.content)}catch{return[]}}finally{n(!1)}},[e]),isLoading:t}}function Co(){const e=it(),[t,n]=o.useState(!1),i=o.useCallback(async(l,c)=>{n(!0);try{return(await e.complete([{role:"user",content:`Improve this text to be more ${c||"professional"}. Keep the same meaning. Return only the improved text.
|
|
60
|
+
|
|
61
|
+
Text: ${l}
|
|
62
|
+
|
|
63
|
+
Improved:`}],{temperature:.4})).content.trim()}finally{n(!1)}},[e]),r=o.useCallback(async(l,c)=>{n(!0);try{return(await e.complete([{role:"user",content:`Translate this text to ${c}. Return only the translation.
|
|
64
|
+
|
|
65
|
+
Text: ${l}
|
|
66
|
+
|
|
67
|
+
Translation:`}],{temperature:.2})).content.trim()}finally{n(!1)}},[e]),s=o.useCallback(async l=>{n(!0);try{const c=await e.complete([{role:"user",content:`Generate clean semantic HTML from this prompt. Use proper tags (h1-h6, p, ul, ol, table, etc.). Return only HTML.
|
|
68
|
+
|
|
69
|
+
Prompt: ${l}
|
|
70
|
+
|
|
71
|
+
HTML:`}],{temperature:.3}),d=c.content.match(/```html?\n?([\s\S]*?)```/);return d?d[1].trim():c.content.trim()}finally{n(!1)}},[e]);return{improveText:i,translate:r,generateHtml:s,isLoading:t}}function _o(e,t){const n=(t==null?void 0:t.autoLoad)??!0,i=(t==null?void 0:t.defaultPageSize)??20,[r,s]=o.useState([]),[l,c]=o.useState(0),[d,u]=o.useState(!1),[y,f]=o.useState(null),[p,m]=o.useState(1),[w,k]=o.useState(i),[z,$]=o.useState((t==null?void 0:t.defaultSort)??[]),[g,v]=o.useState(t==null?void 0:t.defaultFilter),[N,j]=o.useState((t==null?void 0:t.defaultSearch)??""),I=o.useRef(0),D=t==null?void 0:t.loadOptions,b=o.useCallback(async()=>{if(!e)return;const A=++I.current;u(!0),f(null);try{const E=await e.load({skip:(p-1)*w,take:w,sort:z.length?z:void 0,filter:g,search:N||void 0,...D});if(A!==I.current)return;s(E.data),c(E.totalCount)}catch(E){if(A!==I.current)return;f(E instanceof Error?E.message:String(E))}finally{A===I.current&&u(!1)}},[e,p,w,z,g,N,D]);o.useEffect(()=>{n&&b()},[b,n]),o.useEffect(()=>{if(e)return e.on("changed",()=>{b()})},[e,b]);const T=o.useCallback((A,E)=>{$([{field:A,direction:E}]),m(1)},[]),R=o.useCallback(A=>{v(A),m(1)},[]),L=o.useCallback(A=>{j(A),m(1)},[]),M=o.useCallback(A=>{k(A),m(1)},[]),S=o.useCallback(async A=>{if(!(e!=null&&e.insert))throw new Error("DataSource is not writable");await e.insert(A)},[e]),x=o.useCallback(async(A,E)=>{if(!(e!=null&&e.update))throw new Error("DataSource is not writable");await e.update(A,E)},[e]),P=o.useCallback(async A=>{if(!(e!=null&&e.remove))throw new Error("DataSource is not writable");await e.remove(A)},[e]);return{data:r,totalCount:l,loading:d,error:y,page:p,pageSize:w,sort:z,filter:g,search:N,setPage:m,setPageSize:M,setSort:$,setSortField:T,setFilter:R,setSearch:L,reload:b,insert:S,update:x,remove:P}}function jo(e,t){const[n,i]=o.useState(void 0),[r,s]=o.useState({}),[l,c]=o.useState(!1),[d,u]=o.useState(null),y=o.useRef(0),f=o.useCallback(async()=>{if(!e||t==null){i(void 0);return}const g=++y.current;c(!0),u(null);try{const v=await e.byKey(t);if(g!==y.current)return;i(v),s({})}catch(v){if(g!==y.current)return;u(v instanceof Error?v.message:String(v))}finally{g===y.current&&c(!1)}},[e,t]);o.useEffect(()=>{f()},[f]),o.useEffect(()=>{if(e)return e.on("changed",()=>{f()})},[e,f]);const p=o.useMemo(()=>({...n??{},...r}),[n,r]),m=Object.keys(r).length>0,w=o.useCallback((g,v)=>{s(N=>({...N,[g]:v}))},[]),k=o.useCallback(g=>{s(v=>({...v,...g}))},[]),z=o.useCallback(async()=>{if(!(e!=null&&e.update))throw new Error("DataSource is not writable");m&&await e.update(t,r)},[e,t,r,m]),$=o.useCallback(()=>{s({})},[]);return{data:n,editData:p,loading:l,error:d,changes:r,isDirty:m,set:w,setMany:k,save:z,reload:f,reset:$}}function No(e,t,n,i){const[l,c]=o.useState([]),[d,u]=o.useState(!1),[y,f]=o.useState(null),p=o.useRef(0),m=o.useCallback(async z=>{if(!e)return;const $=++p.current;u(!0),f(null);try{const g=await e.load({take:200,search:z||void 0,searchFields:i==null?void 0:i.searchFields});if($!==p.current)return;c(g.data)}catch(g){if($!==p.current)return;f(g instanceof Error?g.message:String(g))}finally{$===p.current&&u(!1)}},[e,200,i==null?void 0:i.searchFields]);o.useEffect(()=>{m()},[m,!0]);const w=o.useMemo(()=>l.map(z=>{const $=z;return{value:String($[t]??""),label:String($[n]??"")}}),[l,t,n,i==null?void 0:i.iconField,i==null?void 0:i.descriptionField,i==null?void 0:i.groupField]),k=o.useCallback(z=>{m(z)},[m]);return{options:w,loading:d,error:y,search:k,reload:()=>m()}}const kt={cookiesAllowed:!1,localStorageAllowed:!1,sessionStorageAllowed:!1,strictAuthCookieOnly:!1,effectiveMode:"traceless",source:"default",requiresConsentBanner:!1,resolvedAt:Date.now(),version:"1.0.0"},Eo=new Map;let Mo=class{constructor(t,n="nice2dev",i="local"){this.policy=t,this.namespace=n,this.defaultBackend=i}getBackend(t){const n=t||this.defaultBackend;if(n==="local"&&this.policy.localStorageAllowed)try{if(typeof localStorage<"u")return localStorage}catch{}if((n==="session"||n==="local")&&this.policy.sessionStorageAllowed)try{if(typeof sessionStorage<"u")return sessionStorage}catch{}return Eo}getKey(t){return`${this.namespace}:${t}`}get(t,n){const i=this.getBackend(n),r=this.getKey(t);try{const s=i instanceof Map?i.get(r):i.getItem(r);if(s==null)return null;try{return JSON.parse(s)}catch{return s}}catch{return null}}set(t,n,i){const r=this.getBackend(i),s=this.getKey(t);try{const l=typeof n=="string"?n:JSON.stringify(n);return r instanceof Map?r.set(s,l):r.setItem(s,l),!0}catch{return!1}}remove(t,n){const i=this.getBackend(n),r=this.getKey(t);try{return i instanceof Map?i.delete(r):(i.removeItem(r),!0)}catch{return!1}}clear(t){const n=this.getBackend(t),i=`${this.namespace}:`;try{if(n instanceof Map)for(const r of n.keys())r.startsWith(i)&&n.delete(r);else{const r=[];for(let s=0;s<n.length;s++){const l=n.key(s);l&&l.startsWith(i)&&r.push(l)}r.forEach(s=>n.removeItem(s))}}catch{}}keys(t){const n=this.getBackend(t),i=`${this.namespace}:`,r=[];try{if(n instanceof Map)for(const s of n.keys())s.startsWith(i)&&r.push(s.slice(i.length));else for(let s=0;s<n.length;s++){const l=n.key(s);l&&l.startsWith(i)&&r.push(l.slice(i.length))}}catch{}return r}has(t,n){return this.get(t,n)!==null}getCapabilities(){return{canUseCookies:this.policy.cookiesAllowed,canUseLocalStorage:this.policy.localStorageAllowed,canUseSessionStorage:this.policy.sessionStorageAllowed,canPersist:this.policy.localStorageAllowed,effectiveMode:this.policy.effectiveMode,actualBackend:this.getActualBackendType()}}getActualBackendType(){const t=this.getBackend();return t instanceof Map?"memory":t===sessionStorage?"session":"local"}updatePolicy(t){this.policy=t}};function zo(e,t,n){return{generatedAt:new Date().toISOString(),instanceId:t,tenantId:n,effectiveMode:e.effectiveMode,cookies:{count:0,allowed:e.cookiesAllowed,strictAuthOnly:e.strictAuthCookieOnly,thirdParty:!1,tracking:!1},localStorage:{bytesUsed:0,allowed:e.localStorageAllowed,keysCount:0},sessionStorage:{bytesUsed:0,allowed:e.sessionStorageAllowed,keysCount:0},consentBanner:{required:e.requiresConsentBanner,shown:e.requiresConsentBanner},compliance:{ePrivacyCompliant:!e.cookiesAllowed||e.requiresConsentBanner,gdprCompliant:!0,pecrCompliant:!e.cookiesAllowed||e.requiresConsentBanner},statement:$o(e)}}function $o(e){return e.effectiveMode==="traceless"?"This OmniVerk instance operates in Traceless™ mode. No cookies are set (0), no data is saved to localStorage (0), and no sessionStorage is used (0). No cookie consent banner is required under ePrivacy Directive Art. 5(3) as no similar technologies are employed.":e.effectiveMode==="ephemeral"?"This OmniVerk instance operates in Ephemeral mode. No cookies are set, no localStorage is used. sessionStorage is used for session-only data that is automatically cleared when the browser tab is closed. No cookie consent banner is required.":e.effectiveMode==="private"?"This OmniVerk instance operates in Private mode. One strictly necessary httpOnly authentication cookie may be set. sessionStorage is used for session preferences. No consent banner is required as only strictly necessary technologies are used.":e.effectiveMode==="balanced"?"This OmniVerk instance operates in Balanced mode. localStorage is used for user preferences. sessionStorage is used for session data. No cookies are set. Depending on jurisdiction, a consent banner may be shown.":"This OmniVerk instance operates in Full mode. Cookies, localStorage, and sessionStorage are enabled. A consent banner is displayed to users before any non-essential storage is used."}function Ao(e){const{effectiveMode:t}=e;switch(t){case"traceless":return{mode:"traceless",icon:"🟢",color:"#10b981",label:"Traceless™",tooltip:"Your data is not stored on this device. Zero cookies, zero localStorage, zero traces.",cssClass:"nice-traceless-badge--traceless"};case"ephemeral":return{mode:"ephemeral",icon:"🔵",color:"#3b82f6",label:"Ephemeral",tooltip:"Session-only storage. Data is cleared when you close this tab.",cssClass:"nice-traceless-badge--ephemeral"};case"private":return{mode:"private",icon:"🟡",color:"#eab308",label:"Private",tooltip:"Minimal storage with one secure authentication cookie.",cssClass:"nice-traceless-badge--private"};case"balanced":return{mode:"balanced",icon:"🟠",color:"#f97316",label:"Balanced",tooltip:"Preferences are saved locally. No tracking cookies.",cssClass:"nice-traceless-badge--balanced"};case"full":return{mode:"full",icon:"🔴",color:"#ef4444",label:"Full",tooltip:"All storage enabled including analytics. You control what is stored via consent.",cssClass:"nice-traceless-badge--full"};case"custom":default:return{mode:"custom",icon:"⚪",color:"#6b7280",label:"Custom",tooltip:"Custom storage configuration.",cssClass:"nice-traceless-badge--custom"}}}function Fo(e){const t=[];if(!e.cookiesAllowed&&typeof document<"u"){const n=document.cookie;n&&n.length>0&&t.push({type:"cookie",severity:"high",message:`Cookies found but not allowed: ${n.split(";").length} cookie(s)`,data:n})}if(!e.localStorageAllowed)try{typeof localStorage<"u"&&localStorage.length>0&&t.push({type:"localStorage",severity:"high",message:`localStorage has ${localStorage.length} item(s) but not allowed`})}catch{}if(!e.sessionStorageAllowed)try{typeof sessionStorage<"u"&&sessionStorage.length>0&&t.push({type:"sessionStorage",severity:"medium",message:`sessionStorage has ${sessionStorage.length} item(s) but not allowed`})}catch{}return{compliant:t.length===0,violations:t,auditedAt:Date.now(),policy:e.effectiveMode}}const Io=o.createContext(null);function Do(){const e=o.useContext(Io);if(e)return e;const t=new Mo(kt);return{policy:kt,canUseCookies:!1,canUseLocalStorage:!1,canUseSessionStorage:!1,canPersist:!1,mode:"traceless",requiresConsentBanner:!1,badgeInfo:Ao(kt),setUserPreference:()=>{},generateReport:()=>zo(kt,"default"),runAudit:()=>Fo(kt),refreshPolicy:async()=>{},getStorageAdapter:()=>t,isLoading:!1,error:null}}function Pa(e="nice2dev"){const{getStorageAdapter:t}=Do();return o.useMemo(()=>t(e),[t,e])}const Oa={"colors.primary":"--color-primary","colors.primaryHover":"--color-primary-hover","colors.success":"--color-success","colors.warning":"--color-warning","colors.error":"--color-error","colors.info":"--color-info","colors.accent":"--color-accent","colors.accentHover":"--color-accent-hover","colors.link":"--color-link","colors.linkHover":"--color-link-hover","colors.focus":"--color-focus","colors.overlay":"--color-overlay","colors.surface":"--color-surface","colors.surfaceHover":"--color-surface-hover","colors.disabled":"--color-disabled","colors.disabledText":"--color-disabled-text","backgrounds.primary":"--bg-primary","backgrounds.secondary":"--bg-secondary","backgrounds.tertiary":"--bg-tertiary","backgrounds.hover":"--hover-bg","backgrounds.elevated":"--bg-elevated","backgrounds.inset":"--bg-inset","backgrounds.canvas":"--bg-canvas","text.primary":"--text-primary","text.secondary":"--text-secondary","text.muted":"--text-muted","text.inverse":"--text-inverse","text.onPrimary":"--text-on-primary","text.onAccent":"--text-on-accent","borders.color":"--border-color","borders.radiusSm":"--nice-radius-sm","borders.radiusMd":"--nice-radius-md","borders.radiusLg":"--nice-radius-lg","borders.radiusXl":"--nice-radius-xl","borders.radiusFull":"--nice-radius-full","borders.width":"--border-width","borders.focusColor":"--border-focus-color","borders.divider":"--border-divider","shadows.sm":"--shadow-sm","shadows.md":"--shadow-md","shadows.lg":"--shadow-lg","shadows.xl":"--shadow-xl","shadows.inner":"--shadow-inner","shadows.glow":"--shadow-glow","spacing.space1":"--nice-space-1","spacing.space2":"--nice-space-2","spacing.space3":"--nice-space-3","spacing.space4":"--nice-space-4","spacing.space5":"--nice-space-5","spacing.space6":"--nice-space-6","spacing.space8":"--nice-space-8","spacing.space10":"--nice-space-10","spacing.space12":"--nice-space-12","spacing.space16":"--nice-space-16","typography.fontFamily":"--nice-font-family","typography.fontSizeXs":"--nice-font-size-xs","typography.fontSizeSm":"--nice-font-size-sm","typography.fontSizeMd":"--nice-font-size-md","typography.fontSizeLg":"--nice-font-size-lg","typography.fontSizeXl":"--nice-font-size-xl","typography.fontSize2xl":"--nice-font-size-2xl","typography.fontSize3xl":"--nice-font-size-3xl","typography.fontWeightNormal":"--nice-font-weight-normal","typography.fontWeightMedium":"--nice-font-weight-medium","typography.fontWeightSemibold":"--nice-font-weight-semibold","typography.fontWeightBold":"--nice-font-weight-bold","typography.lineHeight":"--nice-line-height","typography.headingFontFamily":"--nice-heading-font-family","typography.monoFontFamily":"--nice-mono-font-family","typography.letterSpacing":"--nice-letter-spacing","typography.headingLetterSpacing":"--nice-heading-letter-spacing","transitions.fast":"--nice-transition-fast","transitions.normal":"--nice-transition","transitions.slow":"--nice-transition-slow"};function To(e,t){return t.split(".").reduce((n,i)=>{if(n&&typeof n=="object")return n[i]},e)}function xn(e){const t={};for(const[n,i]of Object.entries(Oa)){const r=To(e,n);r!==void 0&&(t[i]=String(r))}return t}function Ro(e,t){const n=document.documentElement,i=xn(e);for(const[r,s]of Object.entries(i))n.style.setProperty(r,s);Oo(e.backgroundImage,n),e.darkMode&&(n.dataset.ntdColorScheme=e.darkMode)}const Po={dots:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="1" fill="currentColor" opacity="0.15"/></svg>',grid:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><path d="M20 0H0v20" fill="none" stroke="currentColor" stroke-opacity="0.08"/></svg>',diagonal:'<svg width="10" height="10" xmlns="http://www.w3.org/2000/svg"><path d="M0 10L10 0" stroke="currentColor" stroke-opacity="0.08"/></svg>',"cross-hatch":'<svg width="10" height="10" xmlns="http://www.w3.org/2000/svg"><path d="M0 10L10 0M-1 1L1 -1M9 11L11 9" stroke="currentColor" stroke-opacity="0.06"/></svg>',waves:'<svg width="40" height="12" xmlns="http://www.w3.org/2000/svg"><path d="M0 6c5 0 5-6 10-6s5 6 10 6 5-6 10-6 5 6 10 6" fill="none" stroke="currentColor" stroke-opacity="0.08"/></svg>',hexagons:'<svg width="28" height="49" xmlns="http://www.w3.org/2000/svg"><path d="M14 0l14 8.5v16L14 33 0 24.5v-16z" fill="none" stroke="currentColor" stroke-opacity="0.06"/></svg>',triangles:'<svg width="20" height="17" xmlns="http://www.w3.org/2000/svg"><path d="M0 17L10 0l10 17z" fill="none" stroke="currentColor" stroke-opacity="0.06"/></svg>',circles:'<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="6" fill="none" stroke="currentColor" stroke-opacity="0.06"/></svg>',zigzag:'<svg width="20" height="12" xmlns="http://www.w3.org/2000/svg"><path d="M0 6l5-6 5 6 5-6 5 6" fill="none" stroke="currentColor" stroke-opacity="0.08"/></svg>',noise:'<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency=".9" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(#n)"/></svg>'};function Oo(e,t){if(t.style.removeProperty("--ntd-bg-image"),t.style.removeProperty("--ntd-bg-image-size"),t.style.removeProperty("--ntd-bg-image-position"),t.style.removeProperty("--ntd-bg-image-attachment"),t.style.removeProperty("--ntd-bg-image-repeat"),t.style.removeProperty("--ntd-bg-image-opacity"),t.style.removeProperty("--ntd-bg-image-blend"),!(!e||e.type==="none")){if(e.type==="gradient"&&e.gradient)t.style.setProperty("--ntd-bg-image",e.gradient);else if(e.type==="image"&&e.imageUrl)t.style.setProperty("--ntd-bg-image",`url("${e.imageUrl}")`),e.imageSize&&t.style.setProperty("--ntd-bg-image-size",e.imageSize),e.imagePosition&&t.style.setProperty("--ntd-bg-image-position",e.imagePosition),e.imageAttachment&&t.style.setProperty("--ntd-bg-image-attachment",e.imageAttachment),e.imageRepeat&&t.style.setProperty("--ntd-bg-image-repeat",e.imageRepeat);else if(e.type==="pattern"&&e.pattern){const n=Po[e.pattern];if(n){const i=`url("data:image/svg+xml,${encodeURIComponent(n)}")`;t.style.setProperty("--ntd-bg-image",i),t.style.setProperty("--ntd-bg-image-repeat","repeat")}}e.opacity!==void 0&&t.style.setProperty("--ntd-bg-image-opacity",String(e.opacity)),e.blendMode&&t.style.setProperty("--ntd-bg-image-blend",e.blendMode)}}function Lo(e){const t=e??document.documentElement;for(const n of Object.values(Oa))t.style.removeProperty(n);for(const n of["--ntd-bg-image","--ntd-bg-image-size","--ntd-bg-image-position","--ntd-bg-image-attachment","--ntd-bg-image-repeat","--ntd-bg-image-opacity","--ntd-bg-image-blend"])t.style.removeProperty(n);delete t.dataset.ntdColorScheme}function Bo(e){return JSON.stringify(e,null,2)}function Ho(e){const t=JSON.parse(e);if(!t||typeof t!="object"||!t.name||!t.colors||!t.backgrounds)throw new Error("Invalid theme format: missing required fields (name, colors, backgrounds)");return t}const qo=o.createContext(null);/**
|
|
72
|
+
* @file themeVariants.ts
|
|
73
|
+
* @description Extended theme variants - radius, shadows, fills, gradients, effects
|
|
74
|
+
*
|
|
75
|
+
* Allows fine-grained customization of theme appearance
|
|
76
|
+
*
|
|
77
|
+
* @version 1.0.0
|
|
78
|
+
* @since 2026-03
|
|
79
|
+
* @license MIT
|
|
80
|
+
*/const Wo={none:{xs:"0",sm:"0",md:"0",lg:"0",xl:"0",full:"0"},sm:{xs:"2px",sm:"3px",md:"4px",lg:"6px",xl:"8px",full:"9999px"},md:{xs:"4px",sm:"6px",md:"8px",lg:"12px",xl:"16px",full:"9999px"},lg:{xs:"6px",sm:"10px",md:"14px",lg:"20px",xl:"28px",full:"9999px"},xl:{xs:"10px",sm:"16px",md:"24px",lg:"32px",xl:"48px",full:"9999px"},"2xl":{xs:"16px",sm:"24px",md:"32px",lg:"48px",xl:"64px",full:"9999px"},full:{xs:"9999px",sm:"9999px",md:"9999px",lg:"9999px",xl:"9999px",full:"9999px"}},Vo={none:"none",subtle:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)",inner:"inset 0 2px 4px 0 rgba(0, 0, 0, 0.05)",colored:"0 4px 14px 0 var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.4))",glow:"0 0 20px var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.5))"},Ko={none:"none",subtle:"0 1px 2px 0 rgba(0, 0, 0, 0.2)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4)",inner:"inset 0 2px 4px 0 rgba(0, 0, 0, 0.3)",colored:"0 4px 14px 0 var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.5))",glow:"0 0 30px var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.6))"},Uo={compact:{paddingX:"8px",paddingY:"4px",gap:"4px",fontSize:"13px",lineHeight:"1.3",inputHeight:"28px",buttonHeight:"28px"},normal:{paddingX:"12px",paddingY:"8px",gap:"8px",fontSize:"14px",lineHeight:"1.5",inputHeight:"36px",buttonHeight:"36px"},comfortable:{paddingX:"16px",paddingY:"12px",gap:"12px",fontSize:"15px",lineHeight:"1.6",inputHeight:"44px",buttonHeight:"44px"},spacious:{paddingX:"24px",paddingY:"16px",gap:"16px",fontSize:"16px",lineHeight:"1.7",inputHeight:"52px",buttonHeight:"52px"}},Yo={none:{duration:"0ms",easing:"linear",hoverScale:"1",clickScale:"1",enterAnimation:"none",exitAnimation:"none"},subtle:{duration:"150ms",easing:"cubic-bezier(0.4, 0, 0.2, 1)",hoverScale:"1.01",clickScale:"0.99",enterAnimation:"ntd-fade-in 150ms ease-out",exitAnimation:"ntd-fade-out 100ms ease-in"},normal:{duration:"200ms",easing:"cubic-bezier(0.4, 0, 0.2, 1)",hoverScale:"1.02",clickScale:"0.98",enterAnimation:"ntd-slide-up 200ms ease-out",exitAnimation:"ntd-slide-down 150ms ease-in"},playful:{duration:"300ms",easing:"cubic-bezier(0.34, 1.56, 0.64, 1)",hoverScale:"1.05",clickScale:"0.95",enterAnimation:"ntd-bounce-in 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",exitAnimation:"ntd-bounce-out 200ms ease-in"},dramatic:{duration:"400ms",easing:"cubic-bezier(0.68, -0.55, 0.265, 1.55)",hoverScale:"1.08",clickScale:"0.92",enterAnimation:"ntd-zoom-in 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55)",exitAnimation:"ntd-zoom-out 250ms ease-in"}};function Zo(e,t){const n={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(e){case"flat":return{...n,background:t,boxShadow:"none",border:"none"};case"raised":return{...n,background:t,boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",border:"none"};case"outlined":return{...n,background:"transparent",border:`2px solid ${t}`,color:t};case"ghost":return{...n,background:"transparent",border:"none",color:t};case"soft":return{...n,background:`${t}20`,border:"none",color:t};case"gradient":return{...n,background:`linear-gradient(135deg, ${t} 0%, ${cn(t,-20)} 100%)`,border:"none",boxShadow:`0 4px 14px ${t}40`};case"3d":return{...n,background:t,border:"none",boxShadow:`0 4px 0 ${cn(t,-30)}, 0 6px 10px rgba(0, 0, 0, 0.2)`,transform:"translateY(-2px)"};case"neumorphic":return{...n,background:"var(--ntd-bg-surface)",border:"none",boxShadow:"5px 5px 10px rgba(0, 0, 0, 0.1), -5px -5px 10px rgba(255, 255, 255, 0.8)",color:t};case"pill":return{...n,background:t,border:"none",borderRadius:"9999px",paddingLeft:"24px",paddingRight:"24px"};case"link":return{...n,background:"transparent",border:"none",color:t,textDecoration:"underline",padding:"0"};case"brutal":return{...n,background:t,border:"3px solid #000",boxShadow:"4px 4px 0 #000",borderRadius:"0"};default:return n}}function Go(e){const t={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(e){case"bordered":return{...t,background:"var(--ntd-bg-input, #fff)",border:"1px solid var(--ntd-border-color, #e5e7eb)",borderRadius:"var(--ntd-radius-md, 8px)"};case"filled":return{...t,background:"var(--ntd-bg-input-filled, #f3f4f6)",border:"2px solid transparent",borderRadius:"var(--ntd-radius-md, 8px)"};case"underlined":return{...t,background:"transparent",border:"none",borderBottom:"2px solid var(--ntd-border-color, #e5e7eb)",borderRadius:"0",paddingLeft:"0",paddingRight:"0"};case"floating":return{...t,background:"var(--ntd-bg-input, #fff)",border:"1px solid var(--ntd-border-color, #e5e7eb)",borderRadius:"var(--ntd-radius-md, 8px)",paddingTop:"20px"};case"soft":return{...t,background:"var(--ntd-color-primary-alpha, rgba(99, 102, 241, 0.1))",border:"none",borderRadius:"var(--ntd-radius-md, 8px)"};case"neumorphic":return{...t,background:"var(--ntd-bg-surface)",border:"none",borderRadius:"var(--ntd-radius-md, 8px)",boxShadow:"inset 3px 3px 6px rgba(0, 0, 0, 0.1), inset -3px -3px 6px rgba(255, 255, 255, 0.8)"};case"pill":return{...t,background:"var(--ntd-bg-input, #fff)",border:"1px solid var(--ntd-border-color, #e5e7eb)",borderRadius:"9999px",paddingLeft:"20px",paddingRight:"20px"};case"flush":return{...t,background:"transparent",border:"none",borderRadius:"0",padding:"0",outline:"none"};default:return t}}function Qo(e){const t={transition:"all var(--ntd-transition-duration, 200ms) var(--ntd-transition-easing, ease)"};switch(e){case"flat":return{...t,background:"var(--ntd-bg-surface, #fff)",border:"none",boxShadow:"none"};case"elevated":return{...t,background:"var(--ntd-bg-surface, #fff)",border:"none",boxShadow:"var(--ntd-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1))"};case"bordered":return{...t,background:"var(--ntd-bg-surface, #fff)",border:"1px solid var(--ntd-border-color, #e5e7eb)",boxShadow:"none"};case"glass":return{...t,background:"rgba(255, 255, 255, 0.1)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",border:"1px solid rgba(255, 255, 255, 0.2)",boxShadow:"0 8px 32px rgba(0, 0, 0, 0.1)"};case"gradient":return{...t,background:"linear-gradient(135deg, var(--ntd-bg-surface) 0%, var(--ntd-bg-elevated) 100%)",border:"none",boxShadow:"var(--ntd-shadow-md)"};case"neumorphic":return{...t,background:"var(--ntd-bg-surface)",border:"none",boxShadow:"8px 8px 16px rgba(0, 0, 0, 0.1), -8px -8px 16px rgba(255, 255, 255, 0.8)"};case"outlined":return{...t,background:"transparent",border:"2px solid var(--ntd-border-color, #e5e7eb)",boxShadow:"none"};case"paper":return{...t,background:"#fffef9",border:"none",boxShadow:"2px 3px 8px rgba(0,0,0,0.06)",borderRadius:"2px"};default:return t}}function Xo(e,t){const n={display:"inline-flex",alignItems:"center",fontSize:"0.75rem",fontWeight:"600",lineHeight:"1"};switch(e){case"solid":return{...n,background:t,color:"#fff",padding:"2px 8px",borderRadius:"4px"};case"soft":return{...n,background:`${t}20`,color:t,padding:"2px 8px",borderRadius:"4px"};case"outlined":return{...n,background:"transparent",border:`1px solid ${t}`,color:t,padding:"2px 8px",borderRadius:"4px"};case"dot":return{...n,background:t,width:"8px",height:"8px",borderRadius:"50%",padding:"0"};case"pill":return{...n,background:t,color:"#fff",padding:"2px 12px",borderRadius:"9999px"};case"gradient":return{...n,background:`linear-gradient(135deg, ${t}, ${cn(t,-20)})`,color:"#fff",padding:"2px 8px",borderRadius:"4px"};default:return n}}function Jo(e,t){switch(e){case"underline":return{borderBottom:`2px solid ${t}`,background:"transparent",color:t};case"pills":return{background:t,color:"#fff",borderRadius:"9999px",padding:"6px 16px"};case"enclosed":return{background:"var(--ntd-bg-surface,#fff)",border:"1px solid var(--ntd-border-color,#e5e7eb)",borderBottom:"none",borderRadius:"8px 8px 0 0"};case"soft":return{background:`${t}15`,color:t,borderRadius:"6px",padding:"6px 16px"};case"lifted":return{background:"var(--ntd-bg-surface,#fff)",boxShadow:"0 -2px 8px rgba(0,0,0,0.06)",borderRadius:"8px 8px 0 0",transform:"translateY(-2px)"};case"bordered":return{border:`2px solid ${t}`,borderBottom:"none",background:"transparent",borderRadius:"8px 8px 0 0"};default:return{}}}function es(e){switch(e){case"default":return{borderRadius:"12px",width:"44px",height:"24px"};case"ios":return{borderRadius:"16px",width:"51px",height:"31px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.1)"};case"flat":return{borderRadius:"4px",width:"40px",height:"22px"};case"pill":return{borderRadius:"9999px",width:"48px",height:"24px"};case"square":return{borderRadius:"0",width:"40px",height:"22px"};default:return{}}}function ts(e){switch(e){case"dark":return{background:"#1f2937",color:"#f9fafb",borderRadius:"6px",padding:"6px 12px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)"};case"light":return{background:"#fff",color:"#374151",borderRadius:"6px",padding:"6px 12px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",border:"1px solid #e5e7eb"};case"primary":return{background:"var(--color-primary,#6366f1)",color:"#fff",borderRadius:"6px",padding:"6px 12px"};case"glass":return{background:"rgba(255,255,255,0.15)",backdropFilter:"blur(12px)",color:"#fff",borderRadius:"8px",padding:"8px 14px"};case"bordered":return{background:"#fff",color:"#374151",borderRadius:"6px",padding:"6px 12px",border:"2px solid var(--color-primary,#6366f1)"};default:return{}}}function ns(e){switch(e){case"default":return{borderCollapse:"collapse"};case"striped":return{borderCollapse:"collapse"};case"bordered":return{border:"1px solid var(--ntd-border-color,#e5e7eb)",borderCollapse:"collapse"};case"compact":return{borderCollapse:"collapse",fontSize:"0.8125rem"};case"hoverable":return{borderCollapse:"collapse"};case"minimal":return{borderCollapse:"collapse",borderBottom:"1px solid var(--ntd-border-color,#e5e7eb)"};default:return{}}}const Ut={radius:"md",shadow:"md",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",modalStyle:"default",tableStyle:"default",menuStyle:"default",animation:"normal",density:"normal"},as={minimal:{radius:"sm",shadow:"subtle",fill:"solid",buttonStyle:"flat",inputStyle:"underlined",cardStyle:"flat",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},rounded:{radius:"xl",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"comfortable"},sharp:{radius:"none",shadow:"lg",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"square",tooltipStyle:"dark",tableStyle:"bordered",animation:"subtle",density:"compact"},glass:{radius:"lg",shadow:"none",fill:"glass",buttonStyle:"ghost",inputStyle:"soft",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"minimal",animation:"normal",density:"normal"},neumorphic:{radius:"lg",shadow:"none",fill:"solid",buttonStyle:"neumorphic",inputStyle:"neumorphic",cardStyle:"neumorphic",badgeStyle:"soft",tabStyle:"lifted",toggleStyle:"ios",tooltipStyle:"light",tableStyle:"default",animation:"subtle",density:"comfortable"},playful:{radius:"2xl",shadow:"colored",fill:"gradient-linear",buttonStyle:"gradient",inputStyle:"filled",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"comfortable"},enterprise:{radius:"sm",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"outlined",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"subtle",density:"compact"},modern3d:{radius:"lg",shadow:"xl",fill:"gradient-linear",buttonStyle:"3d",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"gradient",tabStyle:"lifted",toggleStyle:"ios",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},brutalist:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},luxe:{radius:"sm",shadow:"lg",fill:"gradient-linear",buttonStyle:"gradient",inputStyle:"floating",cardStyle:"elevated",badgeStyle:"gradient",tabStyle:"underline",toggleStyle:"ios",tooltipStyle:"dark",tableStyle:"hoverable",animation:"normal",density:"comfortable"},pill:{radius:"full",shadow:"md",fill:"solid",buttonStyle:"pill",inputStyle:"pill",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},flat:{radius:"md",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"filled",cardStyle:"flat",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},editorial:{radius:"none",shadow:"subtle",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"comfortable"},dashboard:{radius:"md",shadow:"md",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"subtle",density:"compact"},softCloud:{radius:"xl",shadow:"subtle",fill:"frosted",buttonStyle:"soft",inputStyle:"soft",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"normal",density:"comfortable"},cosmic:{radius:"lg",shadow:"glow",fill:"mesh",buttonStyle:"gradient",inputStyle:"soft",cardStyle:"glass",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"dramatic",density:"comfortable"},corporate:{radius:"sm",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"outlined",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"none",density:"compact"},bank:{radius:"none",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"dark",tableStyle:"bordered",animation:"none",density:"compact"},government:{radius:"sm",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"flat",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"none",density:"normal"},military:{radius:"none",shadow:"lg",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"dark",tableStyle:"bordered",animation:"none",density:"compact"},legal:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"none",density:"comfortable"},medical:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"soft",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"enclosed",toggleStyle:"ios",tooltipStyle:"light",tableStyle:"striped",animation:"subtle",density:"normal"},swiss:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"underlined",cardStyle:"flat",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},scandinavian:{radius:"lg",shadow:"subtle",fill:"solid",buttonStyle:"soft",inputStyle:"filled",cardStyle:"flat",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"spacious"},bauhaus:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"flat",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},notebook:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"comfortable"},terminal:{radius:"none",shadow:"glow",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"compact"},hacker:{radius:"none",shadow:"glow",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"outlined",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"subtle",density:"compact"},retro8bit:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},vapor:{radius:"lg",shadow:"glow",fill:"gradient-linear",buttonStyle:"gradient",inputStyle:"soft",cardStyle:"glass",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"glass",tableStyle:"hoverable",animation:"playful",density:"comfortable"},synthwave:{radius:"md",shadow:"glow",fill:"gradient-linear",buttonStyle:"3d",inputStyle:"filled",cardStyle:"glass",badgeStyle:"gradient",tabStyle:"lifted",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"dramatic",density:"normal"},cyberpunk:{radius:"none",shadow:"glow",fill:"gradient-linear",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"dramatic",density:"compact"},steampunk:{radius:"sm",shadow:"inner",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"bordered",tableStyle:"bordered",animation:"subtle",density:"normal"},origami:{radius:"none",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"lifted",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"default",animation:"normal",density:"normal"},watercolor:{radius:"2xl",shadow:"subtle",fill:"frosted",buttonStyle:"soft",inputStyle:"soft",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"pill",tooltipStyle:"glass",tableStyle:"minimal",animation:"normal",density:"comfortable"},neon:{radius:"md",shadow:"glow",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"outlined",tabStyle:"bordered",toggleStyle:"default",tooltipStyle:"bordered",tableStyle:"bordered",animation:"dramatic",density:"normal"},candy:{radius:"2xl",shadow:"colored",fill:"gradient-linear",buttonStyle:"pill",inputStyle:"pill",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"comfortable"},bubblegum:{radius:"full",shadow:"colored",fill:"gradient-radial",buttonStyle:"pill",inputStyle:"pill",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"spacious"},cartoon:{radius:"xl",shadow:"colored",fill:"solid",buttonStyle:"brutal",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"pill",tooltipStyle:"bordered",tableStyle:"bordered",animation:"playful",density:"comfortable"},kawaii:{radius:"full",shadow:"colored",fill:"gradient-linear",buttonStyle:"pill",inputStyle:"pill",cardStyle:"gradient",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"dramatic",density:"spacious"},circus:{radius:"full",shadow:"colored",fill:"gradient-conic",buttonStyle:"gradient",inputStyle:"filled",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"striped",animation:"dramatic",density:"spacious"},paper:{radius:"sm",shadow:"md",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"paper",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"comfortable"},zen:{radius:"md",shadow:"none",fill:"solid",buttonStyle:"ghost",inputStyle:"underlined",cardStyle:"flat",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"spacious"},monochrome:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"outlined",badgeStyle:"outlined",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"normal"},windows95:{radius:"none",shadow:"none",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"solid",tabStyle:"enclosed",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"none",density:"compact"},material:{radius:"md",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},fluent:{radius:"md",shadow:"subtle",fill:"frosted",buttonStyle:"soft",inputStyle:"filled",cardStyle:"glass",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"hoverable",animation:"subtle",density:"normal"},cupertino:{radius:"xl",shadow:"md",fill:"frosted",buttonStyle:"soft",inputStyle:"filled",cardStyle:"glass",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"ios",tooltipStyle:"glass",tableStyle:"minimal",animation:"normal",density:"comfortable"},ant:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"solid",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"default",animation:"subtle",density:"normal"},bootstrap:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"pill",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"striped",animation:"subtle",density:"normal"},chakra:{radius:"md",shadow:"md",fill:"solid",buttonStyle:"raised",inputStyle:"bordered",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"enclosed",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"default",animation:"normal",density:"normal"},notion:{radius:"sm",shadow:"none",fill:"solid",buttonStyle:"ghost",inputStyle:"flush",cardStyle:"flat",badgeStyle:"soft",tabStyle:"underline",toggleStyle:"flat",tooltipStyle:"light",tableStyle:"minimal",animation:"subtle",density:"normal"},linear:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"soft",inputStyle:"filled",cardStyle:"elevated",badgeStyle:"soft",tabStyle:"soft",toggleStyle:"ios",tooltipStyle:"dark",tableStyle:"hoverable",animation:"subtle",density:"compact"},vercel:{radius:"md",shadow:"subtle",fill:"solid",buttonStyle:"outlined",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"outlined",tabStyle:"underline",toggleStyle:"default",tooltipStyle:"dark",tableStyle:"minimal",animation:"subtle",density:"normal"},gaming:{radius:"none",shadow:"glow",fill:"gradient-linear",buttonStyle:"3d",inputStyle:"bordered",cardStyle:"bordered",badgeStyle:"gradient",tabStyle:"bordered",toggleStyle:"square",tooltipStyle:"bordered",tableStyle:"bordered",animation:"dramatic",density:"normal"},kiddo:{radius:"2xl",shadow:"colored",fill:"gradient-radial",buttonStyle:"pill",inputStyle:"pill",cardStyle:"gradient",badgeStyle:"pill",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"hoverable",animation:"playful",density:"spacious"},disco:{radius:"full",shadow:"glow",fill:"gradient-conic",buttonStyle:"gradient",inputStyle:"filled",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"glass",tableStyle:"hoverable",animation:"dramatic",density:"comfortable"},clown:{radius:"full",shadow:"colored",fill:"gradient-conic",buttonStyle:"brutal",inputStyle:"pill",cardStyle:"gradient",badgeStyle:"gradient",tabStyle:"pills",toggleStyle:"pill",tooltipStyle:"primary",tableStyle:"striped",animation:"dramatic",density:"spacious"}};function is(e){const t=Wo[e.radius],n=e.shadow,i=Uo[e.density],r=Yo[e.animation],s=[":root {"];for(const[l,c]of Object.entries(t))s.push(` --ntd-radius-${l}: ${c};`);s.push(` --ntd-shadow: ${Vo[n]};`),s.push(` --ntd-shadow-dark: ${Ko[n]};`);for(const[l,c]of Object.entries(i)){const d=l.replace(/([A-Z])/g,"-$1").toLowerCase();s.push(` --ntd-${d}: ${c};`)}for(const[l,c]of Object.entries(r)){const d=l.replace(/([A-Z])/g,"-$1").toLowerCase();s.push(` --ntd-animation-${d}: ${c};`)}return e.backgroundImage&&s.push(` --ntd-bg-image: url('${e.backgroundImage}');`),e.backgroundOverlay&&s.push(` --ntd-bg-overlay: ${e.backgroundOverlay};`),s.push("}"),s.join(`
|
|
81
|
+
`)}function rs(e,t=document.documentElement){const n=is(e);let i=document.getElementById("ntd-variant-styles");i||(i=document.createElement("style"),i.id="ntd-variant-styles",document.head.appendChild(i)),i.textContent=n,t.dataset.ntdRadius=e.radius,t.dataset.ntdShadow=e.shadow,t.dataset.ntdFill=e.fill,t.dataset.ntdButton=e.buttonStyle,t.dataset.ntdInput=e.inputStyle,t.dataset.ntdCard=e.cardStyle,t.dataset.ntdAnimation=e.animation,t.dataset.ntdDensity=e.density,e.badgeStyle&&(t.dataset.ntdBadge=e.badgeStyle),e.tabStyle&&(t.dataset.ntdTab=e.tabStyle),e.toggleStyle&&(t.dataset.ntdToggle=e.toggleStyle),e.tooltipStyle&&(t.dataset.ntdTooltip=e.tooltipStyle),e.modalStyle&&(t.dataset.ntdModal=e.modalStyle),e.tableStyle&&(t.dataset.ntdTable=e.tableStyle),e.menuStyle&&(t.dataset.ntdMenu=e.menuStyle)}function cn(e,t){if(e.startsWith("#")){const n=e.slice(1),i=parseInt(n,16),r=Math.max(0,Math.min(255,(i>>16&255)+t)),s=Math.max(0,Math.min(255,(i>>8&255)+t)),l=Math.max(0,Math.min(255,(i&255)+t));return`#${(r<<16|s<<8|l).toString(16).padStart(6,"0")}`}return e}function Yt(e){return e==="default"?Ut:as[e]??Ut}const La=o.createContext({displayStyle:"default",variantConfig:Ut,setDisplayStyle:()=>{}});function Ba(e){const t=o.useContext(La),n=e??t.displayStyle??"default",i=Yt(n);return{style:n,config:i}}function Ye(e,t,n="var(--color-primary, #6366f1)"){const{config:i}=Ba(t);return os(e,i,n)}function Be(e,t){const{config:n}=Ba(t);switch(e){case"button":return n.buttonStyle;case"input":return n.inputStyle;case"card":return n.cardStyle;case"badge":return n.badgeStyle??"solid";case"tab":return n.tabStyle??"underline";case"toggle":return n.toggleStyle??"default";case"tooltip":return n.tooltipStyle??"dark";case"modal":return n.modalStyle??"default";case"table":return n.tableStyle??"default";case"menu":return n.menuStyle??"default";default:return"default"}}function os(e,t,n="#6366f1"){switch(e){case"button":return Zo(t.buttonStyle,n);case"input":return Go(t.inputStyle);case"card":return Qo(t.cardStyle);case"badge":return Xo(t.badgeStyle??"solid",n);case"tab":return Jo(t.tabStyle??"underline",n);case"toggle":return es(t.toggleStyle??"default");case"tooltip":return ts(t.tooltipStyle??"dark");case"table":return ns(t.tableStyle??"default");case"menu":return{};case"modal":return{};default:return{}}}function ss(e){const t=Yt(e);return{"data-ntd-display-style":e,"data-ntd-density":t.density,"data-ntd-animation":t.animation,"data-ntd-radius":t.radius,"data-ntd-button":t.buttonStyle,"data-ntd-input":t.inputStyle,"data-ntd-card":t.cardStyle}}function Zt(e){if(!e)return"";let t=e;return t=t.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""),t=t.replace(/\s+on\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,""),t=t.replace(/(href|src|action)\s*=\s*(?:"javascript:[^"]*"|'javascript:[^']*')/gi,'$1=""'),t=t.replace(/(href|src|action)\s*=\s*(?:"vbscript:[^"]*"|'vbscript:[^']*')/gi,'$1=""'),t=t.replace(/<\/?(iframe|object|embed|form)\b[^>]*>/gi,""),t}const At={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},Ft={fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.125rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},It={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},vn=e=>({color:e,radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"}),Ha={sm:"0 1px 2px rgba(0,0,0,0.05)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"},ls={sm:"0 1px 2px rgba(0,0,0,0.3)",md:"0 4px 6px -1px rgba(0,0,0,0.4)",lg:"0 10px 15px -3px rgba(0,0,0,0.4)",xl:"0 20px 25px -5px rgba(0,0,0,0.4)"};function ue(e,t,n,i,r){return{name:e,colors:t,backgrounds:n,text:i,borders:vn(r),shadows:Ha,spacing:At,typography:Ft,transitions:It}}function Fe(e,t,n,i,r){return{name:e,colors:t,backgrounds:n,text:i,borders:vn(r),shadows:ls,spacing:At,typography:Ft,transitions:It}}const cs=ue("Slate",{primary:"#64748b",primaryHover:"#475569",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#1e293b",secondary:"#475569",muted:"#94a3b8"},"#cbd5e1"),ds=ue("Zinc",{primary:"#71717a",primaryHover:"#52525b",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fafafa",secondary:"#f4f4f5",tertiary:"#e4e4e7",hover:"#e4e4e7"},{primary:"#18181b",secondary:"#3f3f46",muted:"#a1a1aa"},"#d4d4d8"),us=ue("Stone",{primary:"#78716c",primaryHover:"#57534e",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#fafaf9",secondary:"#f5f5f4",tertiary:"#e7e5e4",hover:"#e7e5e4"},{primary:"#1c1917",secondary:"#44403c",muted:"#a8a29e"},"#d6d3d1"),ps=ue("Cool Gray",{primary:"#6b7280",primaryHover:"#4b5563",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6"},{primary:"#f9fafb",secondary:"#f3f4f6",tertiary:"#e5e7eb",hover:"#e5e7eb"},{primary:"#111827",secondary:"#374151",muted:"#9ca3af"},"#d1d5db"),ms=ue("Warm Gray",{primary:"#7c7568",primaryHover:"#5c564c",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf9f7",secondary:"#f5f4f0",tertiary:"#e8e6e1",hover:"#e8e6e1"},{primary:"#1f1d19",secondary:"#4a463d",muted:"#a09888"},"#d4d0c8"),hs=ue("Silver",{primary:"#94a3b8",primaryHover:"#64748b",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#38bdf8"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#334155",secondary:"#64748b",muted:"#94a3b8"},"#cbd5e1"),fs=ue("Charcoal",{primary:"#374151",primaryHover:"#1f2937",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f9fafb",secondary:"#f3f4f6",tertiary:"#e5e7eb",hover:"#e5e7eb"},{primary:"#111827",secondary:"#374151",muted:"#6b7280"},"#d1d5db"),gs=ue("Ivory",{primary:"#92876d",primaryHover:"#7a6f55",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fffef7",secondary:"#faf6eb",tertiary:"#f0ead6",hover:"#f0ead6"},{primary:"#2b2517",secondary:"#5c5340",muted:"#9c9280"},"#ddd8c4"),ys=ue("Rose",{primary:"#e11d48",primaryHover:"#be123c",success:"#16a34a",warning:"#ea580c",error:"#dc2626",info:"#0891b2"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#f43f5e"},"#fda4af"),bs=ue("Emerald",{primary:"#059669",primaryHover:"#047857",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#34d399"},"#6ee7b7"),xs=ue("Amber",{primary:"#d97706",primaryHover:"#b45309",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0284c7"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#78350f",muted:"#f59e0b"},"#fcd34d"),vs=ue("Violet",{primary:"#7c3aed",primaryHover:"#6d28d9",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f5f3ff",secondary:"#ede9fe",tertiary:"#ddd6fe",hover:"#ede9fe"},{primary:"#2e1065",secondary:"#4c1d95",muted:"#a78bfa"},"#c4b5fd"),ws=ue("Teal",{primary:"#0d9488",primaryHover:"#0f766e",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0fdfa",secondary:"#ccfbf1",tertiary:"#99f6e4",hover:"#ccfbf1"},{primary:"#134e4a",secondary:"#115e59",muted:"#2dd4bf"},"#5eead4"),ks=ue("Indigo",{primary:"#4f46e5",primaryHover:"#4338ca",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#eef2ff",secondary:"#e0e7ff",tertiary:"#c7d2fe",hover:"#e0e7ff"},{primary:"#1e1b4b",secondary:"#312e81",muted:"#818cf8"},"#a5b4fc"),Ss=ue("Cyan",{primary:"#0891b2",primaryHover:"#0e7490",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#0284c7"},{primary:"#ecfeff",secondary:"#cffafe",tertiary:"#a5f3fc",hover:"#cffafe"},{primary:"#164e63",secondary:"#155e75",muted:"#22d3ee"},"#67e8f9"),Cs=ue("Lime",{primary:"#65a30d",primaryHover:"#4d7c0f",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#f7fee7",secondary:"#ecfccb",tertiary:"#d9f99d",hover:"#ecfccb"},{primary:"#1a2e05",secondary:"#365314",muted:"#84cc16"},"#bef264"),_s=ue("Pink",{primary:"#db2777",primaryHover:"#be185d",success:"#10b981",warning:"#f59e0b",error:"#dc2626",info:"#06b6d4"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#500724",secondary:"#831843",muted:"#f472b6"},"#f9a8d4"),js=ue("Orange",{primary:"#ea580c",primaryHover:"#c2410c",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#7c2d12",muted:"#fb923c"},"#fdba74"),Ns=ue("Fuchsia",{primary:"#c026d3",primaryHover:"#a21caf",success:"#10b981",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fdf4ff",secondary:"#fae8ff",tertiary:"#f5d0fe",hover:"#fae8ff"},{primary:"#4a044e",secondary:"#701a75",muted:"#d946ef"},"#e879f9"),Es=ue("Sky",{primary:"#0284c7",primaryHover:"#0369a1",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#075985",muted:"#38bdf8"},"#7dd3fc"),Ms=ue("Ruby",{primary:"#be123c",primaryHover:"#9f1239",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#fb7185"},"#fda4af"),zs=ue("Coral",{primary:"#f97316",primaryHover:"#ea580c",success:"#10b981",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#9a3412",muted:"#fb923c"},"#fdba74"),$s=Fe("Midnight",{primary:"#818cf8",primaryHover:"#6366f1",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#020617",secondary:"#0f172a",tertiary:"#1e293b",hover:"#1e293b"},{primary:"#f1f5f9",secondary:"#94a3b8",muted:"#475569"},"#1e293b"),As=Fe("Obsidian",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#facc15",error:"#fb7185",info:"#38bdf8"},{primary:"#09090b",secondary:"#18181b",tertiary:"#27272a",hover:"#27272a"},{primary:"#fafafa",secondary:"#a1a1aa",muted:"#52525b"},"#3f3f46"),Fs=Fe("Eclipse",{primary:"#c084fc",primaryHover:"#a855f7",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#67e8f9"},{primary:"#0c0a1d",secondary:"#1a1533",tertiary:"#2a2248",hover:"#2a2248"},{primary:"#f5f3ff",secondary:"#a78bfa",muted:"#6d5eac"},"#3b3266"),Is=Fe("Onyx",{primary:"#60a5fa",primaryHover:"#3b82f6",success:"#4ade80",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#000000",secondary:"#0a0a0a",tertiary:"#171717",hover:"#171717"},{primary:"#ffffff",secondary:"#a3a3a3",muted:"#525252"},"#262626"),Ds=Fe("Carbon",{primary:"#38bdf8",primaryHover:"#0ea5e9",success:"#4ade80",warning:"#facc15",error:"#f87171",info:"#67e8f9"},{primary:"#161616",secondary:"#262626",tertiary:"#393939",hover:"#393939"},{primary:"#f4f4f4",secondary:"#c6c6c6",muted:"#6f6f6f"},"#525252"),Ts=Fe("Cosmos",{primary:"#6366f1",primaryHover:"#4f46e5",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#030712",secondary:"#111827",tertiary:"#1f2937",hover:"#1f2937"},{primary:"#e5e7eb",secondary:"#9ca3af",muted:"#4b5563"},"#374151"),Rs=Fe("Nebula",{primary:"#e879f9",primaryHover:"#d946ef",success:"#4ade80",warning:"#fbbf24",error:"#fb7185",info:"#67e8f9"},{primary:"#0d0117",secondary:"#1a0533",tertiary:"#2d0a52",hover:"#2d0a52"},{primary:"#fae8ff",secondary:"#d8b4fe",muted:"#7c3aed"},"#581c87"),Ps=Fe("Abyss",{primary:"#22d3ee",primaryHover:"#06b6d4",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#38bdf8"},{primary:"#001219",secondary:"#002a3a",tertiary:"#003e54",hover:"#003e54"},{primary:"#e0f2fe",secondary:"#7dd3fc",muted:"#0369a1"},"#075985"),Os=Fe("Shadow",{primary:"#a3a3a3",primaryHover:"#737373",success:"#4ade80",warning:"#facc15",error:"#f87171",info:"#38bdf8"},{primary:"#171717",secondary:"#1f1f1f",tertiary:"#2a2a2a",hover:"#2a2a2a"},{primary:"#e5e5e5",secondary:"#a3a3a3",muted:"#525252"},"#404040"),Ls=Fe("Emerald Dark",{primary:"#34d399",primaryHover:"#10b981",success:"#4ade80",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},{primary:"#022c22",secondary:"#064e3b",tertiary:"#065f46",hover:"#065f46"},{primary:"#ecfdf5",secondary:"#6ee7b7",muted:"#047857"},"#047857"),Bs=ue("Forest",{primary:"#166534",primaryHover:"#14532d",success:"#22c55e",warning:"#ca8a04",error:"#dc2626",info:"#0891b2"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#052e16",secondary:"#166534",muted:"#4ade80"},"#86efac"),Hs=ue("Ocean",{primary:"#0369a1",primaryHover:"#075985",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#38bdf8"},"#7dd3fc"),qs=ue("Desert",{primary:"#b45309",primaryHover:"#92400e",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fefce8",secondary:"#fef9c3",tertiary:"#fef08a",hover:"#fef9c3"},{primary:"#422006",secondary:"#713f12",muted:"#ca8a04"},"#fde047"),Ws=ue("Sunset",{primary:"#ea580c",primaryHover:"#c2410c",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#431407",secondary:"#9a3412",muted:"#f97316"},"#fdba74"),Vs=ue("Aurora",{primary:"#0d9488",primaryHover:"#0f766e",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#f0fdfa",secondary:"#ccfbf1",tertiary:"#99f6e4",hover:"#ccfbf1"},{primary:"#134e4a",secondary:"#115e59",muted:"#2dd4bf"},"#5eead4"),Ks=ue("Lavender",{primary:"#7e22ce",primaryHover:"#6b21a8",success:"#16a34a",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#faf5ff",secondary:"#f3e8ff",tertiary:"#e9d5ff",hover:"#f3e8ff"},{primary:"#3b0764",secondary:"#581c87",muted:"#a855f7"},"#d8b4fe"),Us=ue("Autumn",{primary:"#c2410c",primaryHover:"#9a3412",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fef2f2",secondary:"#fee2e2",tertiary:"#fecaca",hover:"#fee2e2"},{primary:"#450a0a",secondary:"#7f1d1d",muted:"#f87171"},"#fca5a5"),Ys=ue("Spring",{primary:"#16a34a",primaryHover:"#15803d",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#14532d",secondary:"#166534",muted:"#4ade80"},"#86efac"),Zs=ue("Arctic",{primary:"#0ea5e9",primaryHover:"#0284c7",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#7dd3fc"},"#bae6fd"),Gs=ue("Tropical",{primary:"#0d9488",primaryHover:"#0f766e",success:"#16a34a",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#6ee7b7"},"#a7f3d0"),Qs=ue("Pastel Rose",{primary:"#f472b6",primaryHover:"#ec4899",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#831843",secondary:"#9d174d",muted:"#f9a8d4"},"#f9a8d4"),Xs=ue("Pastel Sky",{primary:"#38bdf8",primaryHover:"#0ea5e9",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#075985",secondary:"#0369a1",muted:"#7dd3fc"},"#bae6fd"),Js=ue("Pastel Mint",{primary:"#34d399",primaryHover:"#10b981",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#ecfdf5",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#065f46",secondary:"#047857",muted:"#6ee7b7"},"#a7f3d0"),el=ue("Pastel Peach",{primary:"#fb923c",primaryHover:"#f97316",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fff7ed",secondary:"#ffedd5",tertiary:"#fed7aa",hover:"#ffedd5"},{primary:"#7c2d12",secondary:"#9a3412",muted:"#fdba74"},"#fed7aa"),tl=ue("Pastel Lavender",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f5f3ff",secondary:"#ede9fe",tertiary:"#ddd6fe",hover:"#ede9fe"},{primary:"#4c1d95",secondary:"#5b21b6",muted:"#c4b5fd"},"#ddd6fe"),nl=ue("Pastel Lemon",{primary:"#facc15",primaryHover:"#eab308",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fefce8",secondary:"#fef9c3",tertiary:"#fef08a",hover:"#fef9c3"},{primary:"#713f12",secondary:"#854d0e",muted:"#fde047"},"#fef08a"),al=ue("Pastel Sage",{primary:"#86efac",primaryHover:"#4ade80",success:"#22c55e",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#166534",secondary:"#15803d",muted:"#86efac"},"#bbf7d0"),il=ue("Pastel Coral",{primary:"#fb7185",primaryHover:"#f43f5e",success:"#4ade80",warning:"#fcd34d",error:"#ef4444",info:"#67e8f9"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#881337",secondary:"#9f1239",muted:"#fda4af"},"#fecdd3"),rl=ue("Banking",{primary:"#1e3a5f",primaryHover:"#152c4a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#0f172a",secondary:"#334155",muted:"#94a3b8"},"#cbd5e1"),ol=ue("Healthcare",{primary:"#0891b2",primaryHover:"#0e7490",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#f0fdfa",secondary:"#e0f7fa",tertiary:"#b2ebf2",hover:"#e0f7fa"},{primary:"#134e4a",secondary:"#1a6b6a",muted:"#80cbc4"},"#b2dfdb"),sl=ue("Legal",{primary:"#1e293b",primaryHover:"#0f172a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0284c7"},{primary:"#fafaf9",secondary:"#f5f5f4",tertiary:"#e7e5e4",hover:"#e7e5e4"},{primary:"#0f172a",secondary:"#44403c",muted:"#a8a29e"},"#d6d3d1"),ll=ue("Tech Startup",{primary:"#7c3aed",primaryHover:"#6d28d9",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#faf5ff",secondary:"#f3e8ff",tertiary:"#e9d5ff",hover:"#f3e8ff"},{primary:"#1e1b4b",secondary:"#4c1d95",muted:"#a78bfa"},"#c4b5fd"),cl=ue("Enterprise",{primary:"#1e40af",primaryHover:"#1e3a8a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe"},{primary:"#1e3a5f",secondary:"#1e40af",muted:"#60a5fa"},"#93c5fd"),dl=ue("Government",{primary:"#1d4ed8",primaryHover:"#1e40af",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#f8fafc",secondary:"#f1f5f9",tertiary:"#e2e8f0",hover:"#e2e8f0"},{primary:"#0f172a",secondary:"#1e293b",muted:"#64748b"},"#cbd5e1"),ul=ue("Education",{primary:"#059669",primaryHover:"#047857",success:"#16a34a",warning:"#f59e0b",error:"#ef4444",info:"#0891b2"},{primary:"#f0fdf9",secondary:"#d1fae5",tertiary:"#a7f3d0",hover:"#d1fae5"},{primary:"#064e3b",secondary:"#065f46",muted:"#6ee7b7"},"#a7f3d0"),pl=ue("Real Estate",{primary:"#92400e",primaryHover:"#78350f",success:"#059669",warning:"#b45309",error:"#dc2626",info:"#0891b2"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#422006",secondary:"#713f12",muted:"#d97706"},"#fcd34d"),ml=ue("Nord",{primary:"#5e81ac",primaryHover:"#4c6b90",success:"#a3be8c",warning:"#ebcb8b",error:"#bf616a",info:"#88c0d0"},{primary:"#eceff4",secondary:"#e5e9f0",tertiary:"#d8dee9",hover:"#d8dee9"},{primary:"#2e3440",secondary:"#3b4252",muted:"#4c566a"},"#d8dee9"),hl=Fe("Dracula",{primary:"#bd93f9",primaryHover:"#9d79d9",success:"#50fa7b",warning:"#f1fa8c",error:"#ff5555",info:"#8be9fd"},{primary:"#282a36",secondary:"#343746",tertiary:"#44475a",hover:"#44475a"},{primary:"#f8f8f2",secondary:"#c0c0c0",muted:"#6272a4"},"#44475a"),fl=ue("Solarized Light",{primary:"#268bd2",primaryHover:"#1a6da0",success:"#859900",warning:"#b58900",error:"#dc322f",info:"#2aa198"},{primary:"#fdf6e3",secondary:"#eee8d5",tertiary:"#e0dbc7",hover:"#eee8d5"},{primary:"#073642",secondary:"#586e75",muted:"#93a1a1"},"#eee8d5"),gl=Fe("Solarized Dark",{primary:"#268bd2",primaryHover:"#3d98db",success:"#859900",warning:"#b58900",error:"#dc322f",info:"#2aa198"},{primary:"#002b36",secondary:"#073642",tertiary:"#0a4858",hover:"#073642"},{primary:"#eee8d5",secondary:"#93a1a1",muted:"#586e75"},"#073642"),yl=Fe("Monokai",{primary:"#66d9ef",primaryHover:"#45c0d6",success:"#a6e22e",warning:"#e6db74",error:"#f92672",info:"#66d9ef"},{primary:"#272822",secondary:"#34352e",tertiary:"#3e3d32",hover:"#3e3d32"},{primary:"#f8f8f2",secondary:"#cfcfc2",muted:"#75715e"},"#3e3d32"),bl=Fe("One Dark",{primary:"#61afef",primaryHover:"#4b9ee0",success:"#98c379",warning:"#e5c07b",error:"#e06c75",info:"#56b6c2"},{primary:"#282c34",secondary:"#2c313a",tertiary:"#353b45",hover:"#353b45"},{primary:"#abb2bf",secondary:"#828997",muted:"#545862"},"#3e4452"),xl=Fe("Synthwave",{primary:"#ff7edb",primaryHover:"#e660c2",success:"#72f1b8",warning:"#fede5d",error:"#fe4450",info:"#36f9f6"},{primary:"#241b2f",secondary:"#2d2140",tertiary:"#362a50",hover:"#362a50"},{primary:"#f0e4fc",secondary:"#b4a0cc",muted:"#6c5c84"},"#4a3866"),vl=ue("Vaporwave",{primary:"#ff71ce",primaryHover:"#e655b5",success:"#78dcca",warning:"#ffb86c",error:"#ff5555",info:"#76e8fc"},{primary:"#fce4f7",secondary:"#e8d0f4",tertiary:"#d4bcf0",hover:"#e8d0f4"},{primary:"#4a1a4e",secondary:"#7b3f7d",muted:"#c080c0"},"#d8a8e8"),wl=Fe("Terminal Green",{primary:"#00ff41",primaryHover:"#00cc34",success:"#00ff41",warning:"#ffff00",error:"#ff0000",info:"#00ffff"},{primary:"#0a0a0a",secondary:"#0d1a0d",tertiary:"#1a2e1a",hover:"#1a2e1a"},{primary:"#00ff41",secondary:"#00cc33",muted:"#008822"},"#003300"),kl=ue("Sepia",{primary:"#8b6914",primaryHover:"#704f10",success:"#6b8e23",warning:"#cd853f",error:"#b22222",info:"#5f9ea0"},{primary:"#faf0e6",secondary:"#f5e6d3",tertiary:"#eddcc7",hover:"#f5e6d3"},{primary:"#3e2723",secondary:"#5d4037",muted:"#a1887f"},"#d7ccc8"),Sl=ue("Vintage",{primary:"#8d6e63",primaryHover:"#6d4c41",success:"#66bb6a",warning:"#ffb300",error:"#e53935",info:"#29b6f6"},{primary:"#efebe9",secondary:"#d7ccc8",tertiary:"#bcaaa4",hover:"#d7ccc8"},{primary:"#3e2723",secondary:"#5d4037",muted:"#a1887f"},"#bcaaa4"),Cl=Fe("Cyberpunk",{primary:"#00f0ff",primaryHover:"#00c8d4",success:"#39ff14",warning:"#ffff00",error:"#ff003c",info:"#bf00ff"},{primary:"#0a0e17",secondary:"#131824",tertiary:"#1c2333",hover:"#1c2333"},{primary:"#e0fbfc",secondary:"#80d4dd",muted:"#3a6b72"},"#1c3a44"),_l=Fe("Neon",{primary:"#ff00ff",primaryHover:"#cc00cc",success:"#00ff00",warning:"#ffff00",error:"#ff0000",info:"#00ffff"},{primary:"#0d0d0d",secondary:"#1a1a1a",tertiary:"#262626",hover:"#262626"},{primary:"#ffffff",secondary:"#cccccc",muted:"#666666"},"#333333"),jl=Fe("Retrowave",{primary:"#f77fbe",primaryHover:"#e462a3",success:"#72f1b8",warning:"#ffe261",error:"#ff4444",info:"#79e8fb"},{primary:"#1b0a2e",secondary:"#261440",tertiary:"#321e52",hover:"#321e52"},{primary:"#ffe6f7",secondary:"#c9a0c9",muted:"#6b4c7a"},"#4a2d66"),Nl=ue("Christmas",{primary:"#c41e3a",primaryHover:"#a01830",success:"#228b22",warning:"#ffd700",error:"#dc2626",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fde8e8",tertiary:"#f8d0d0",hover:"#fde8e8"},{primary:"#3b0a0a",secondary:"#7f1d1d",muted:"#dc6868"},"#e8a0a0"),El=Fe("Halloween",{primary:"#ff6600",primaryHover:"#e05500",success:"#4ade80",warning:"#fbbf24",error:"#ff0000",info:"#9333ea"},{primary:"#1a0a00",secondary:"#2d1500",tertiary:"#402000",hover:"#402000"},{primary:"#ffedd5",secondary:"#fdba74",muted:"#9a5c28"},"#5c3400"),Ml=ue("Valentine",{primary:"#e11d48",primaryHover:"#be123c",success:"#10b981",warning:"#f59e0b",error:"#dc2626",info:"#ec4899"},{primary:"#fff1f2",secondary:"#ffe4e6",tertiary:"#fecdd3",hover:"#ffe4e6"},{primary:"#4c0519",secondary:"#881337",muted:"#f9a8d4"},"#fda4af"),zl=ue("Easter",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#4ade80",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#fef9ff",secondary:"#f3e8ff",tertiary:"#e8d5ff",hover:"#f3e8ff"},{primary:"#581c87",secondary:"#6d28d9",muted:"#c4b5fd"},"#ddd6fe"),$l=ue("Summer Beach",{primary:"#0ea5e9",primaryHover:"#0284c7",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#0c4a6e",secondary:"#0369a1",muted:"#7dd3fc"},"#fcd34d"),Al=ue("Winter Frost",{primary:"#3b82f6",primaryHover:"#2563eb",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#f0f9ff",secondary:"#e0f2fe",tertiary:"#bae6fd",hover:"#e0f2fe"},{primary:"#1e3a5f",secondary:"#1e40af",muted:"#93c5fd"},"#bfdbfe"),Fl=ue("Cherry Blossom",{primary:"#ec4899",primaryHover:"#db2777",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},{primary:"#fdf2f8",secondary:"#fce7f3",tertiary:"#fbcfe8",hover:"#fce7f3"},{primary:"#831843",secondary:"#9d174d",muted:"#f9a8d4"},"#fbcfe8"),Il=ue("Harvest",{primary:"#b45309",primaryHover:"#92400e",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#78350f",muted:"#d97706"},"#fcd34d"),Dl=ue("Japanese Zen",{primary:"#6b7280",primaryHover:"#4b5563",success:"#6b8e23",warning:"#d4a017",error:"#c0392b",info:"#5f9ea0"},{primary:"#faf9f6",secondary:"#f0ece3",tertiary:"#e6e0d4",hover:"#f0ece3"},{primary:"#2c2c2c",secondary:"#5c5c5c",muted:"#a0998a"},"#d5cec0"),Tl=ue("Moroccan",{primary:"#c2410c",primaryHover:"#9a3412",success:"#15803d",warning:"#ca8a04",error:"#b91c1c",info:"#0e7490"},{primary:"#fffbf0",secondary:"#fef3e0",tertiary:"#fde6c4",hover:"#fef3e0"},{primary:"#3a1a00",secondary:"#7c2d12",muted:"#d97706"},"#f5d0a0"),Rl=ue("Scandinavian",{primary:"#4b5563",primaryHover:"#374151",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#ffffff",secondary:"#f9fafb",tertiary:"#f3f4f6",hover:"#f3f4f6"},{primary:"#111827",secondary:"#374151",muted:"#9ca3af"},"#e5e7eb"),Pl=ue("Mediterranean",{primary:"#1e40af",primaryHover:"#1e3a8a",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe"},{primary:"#1e3a5f",secondary:"#2563eb",muted:"#93c5fd"},"#bfdbfe"),Ol=ue("Chinese New Year",{primary:"#dc2626",primaryHover:"#b91c1c",success:"#16a34a",warning:"#d4a017",error:"#ef4444",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fee2e2",tertiary:"#fecaca",hover:"#fee2e2"},{primary:"#450a0a",secondary:"#991b1b",muted:"#f87171"},"#fca5a5"),Ll=ue("Indian Festive",{primary:"#d97706",primaryHover:"#b45309",success:"#16a34a",warning:"#ca8a04",error:"#dc2626",info:"#7c3aed"},{primary:"#fffbeb",secondary:"#fef3c7",tertiary:"#fde68a",hover:"#fef3c7"},{primary:"#451a03",secondary:"#92400e",muted:"#f59e0b"},"#fcd34d"),Bl=ue("Brazilian Carnival",{primary:"#16a34a",primaryHover:"#15803d",success:"#22c55e",warning:"#facc15",error:"#ef4444",info:"#0ea5e9"},{primary:"#f0fdf4",secondary:"#dcfce7",tertiary:"#bbf7d0",hover:"#dcfce7"},{primary:"#052e16",secondary:"#166534",muted:"#4ade80"},"#86efac"),Hl=ue("African Earth",{primary:"#92400e",primaryHover:"#78350f",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf5f0",secondary:"#f0e6d6",tertiary:"#e6d5bb",hover:"#f0e6d6"},{primary:"#2b1a0e",secondary:"#5c3d1e",muted:"#a08060"},"#d4b896"),ql=Fe("High Contrast Dark",{primary:"#ffff00",primaryHover:"#cccc00",success:"#00ff00",warning:"#ff8c00",error:"#ff0000",info:"#00ffff"},{primary:"#000000",secondary:"#1a1a1a",tertiary:"#333333",hover:"#333333"},{primary:"#ffffff",secondary:"#ffffff",muted:"#cccccc"},"#ffffff"),Wl=ue("Monochrome",{primary:"#404040",primaryHover:"#262626",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#fafafa",secondary:"#f0f0f0",tertiary:"#e0e0e0",hover:"#e0e0e0"},{primary:"#1a1a1a",secondary:"#404040",muted:"#808080"},"#c0c0c0"),Vl=ue("Enhanced Contrast",{primary:"#0050b3",primaryHover:"#003d8c",success:"#006400",warning:"#cc7000",error:"#cc0000",info:"#006680"},{primary:"#ffffff",secondary:"#f5f5f5",tertiary:"#ebebeb",hover:"#ebebeb"},{primary:"#000000",secondary:"#1a1a1a",muted:"#595959"},"#8c8c8c"),Kl={name:"Large Text",colors:{primary:"#2563eb",primaryHover:"#1d4ed8",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},backgrounds:{primary:"#ffffff",secondary:"#f8fafc",tertiary:"#f1f5f9",hover:"#f1f5f9"},text:{primary:"#0f172a",secondary:"#475569",muted:"#94a3b8"},borders:vn("#e2e8f0"),shadows:Ha,spacing:{space1:"6px",space2:"12px",space3:"16px",space4:"20px",space5:"24px",space6:"32px",space8:"40px"},typography:{fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.875rem",fontSizeSm:"1rem",fontSizeMd:"1.125rem",fontSizeLg:"1.25rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.6},transitions:It},Ul={name:"Glassmorphism",colors:{primary:"#6366f1",primaryHover:"#4f46e5",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},backgrounds:{primary:"rgba(255,255,255,0.7)",secondary:"rgba(255,255,255,0.5)",tertiary:"rgba(255,255,255,0.3)",hover:"rgba(255,255,255,0.5)"},text:{primary:"#1e293b",secondary:"#475569",muted:"#94a3b8"},borders:{color:"rgba(255,255,255,0.3)",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"24px",radiusFull:"9999px"},shadows:{sm:"0 2px 8px rgba(0,0,0,0.04)",md:"0 4px 16px rgba(0,0,0,0.08)",lg:"0 8px 32px rgba(0,0,0,0.12)",xl:"0 16px 48px rgba(0,0,0,0.16)"},spacing:At,typography:Ft,transitions:{fast:"150ms ease",normal:"250ms ease",slow:"350ms ease"}},Yl={name:"Neumorphism Light",colors:{primary:"#6366f1",primaryHover:"#4f46e5",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4"},backgrounds:{primary:"#e0e5ec",secondary:"#d5dae2",tertiary:"#ccd1d9",hover:"#d5dae2"},text:{primary:"#2d3748",secondary:"#4a5568",muted:"#718096"},borders:{color:"#d0d5dd",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"20px",radiusFull:"9999px"},shadows:{sm:"3px 3px 6px #b8bec7, -3px -3px 6px #ffffff",md:"5px 5px 10px #b8bec7, -5px -5px 10px #ffffff",lg:"8px 8px 16px #b8bec7, -8px -8px 16px #ffffff",xl:"12px 12px 24px #b8bec7, -12px -12px 24px #ffffff"},spacing:At,typography:Ft,transitions:It},Zl={name:"Neumorphism Dark",colors:{primary:"#818cf8",primaryHover:"#6366f1",success:"#34d399",warning:"#fbbf24",error:"#f87171",info:"#22d3ee"},backgrounds:{primary:"#2d3748",secondary:"#283141",tertiary:"#232b3a",hover:"#283141"},text:{primary:"#e2e8f0",secondary:"#a0aec0",muted:"#718096"},borders:{color:"#3a4556",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"20px",radiusFull:"9999px"},shadows:{sm:"3px 3px 6px #1a202c, -3px -3px 6px #404d64",md:"5px 5px 10px #1a202c, -5px -5px 10px #404d64",lg:"8px 8px 16px #1a202c, -8px -8px 16px #404d64",xl:"12px 12px 24px #1a202c, -12px -12px 24px #404d64"},spacing:At,typography:Ft,transitions:It},Gl=ue("Minimalist",{primary:"#18181b",primaryHover:"#27272a",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#3b82f6"},{primary:"#ffffff",secondary:"#fafafa",tertiary:"#f5f5f5",hover:"#f5f5f5"},{primary:"#0a0a0a",secondary:"#404040",muted:"#a3a3a3"},"#e5e5e5"),Ql=Fe("Warm Dark",{primary:"#f59e0b",primaryHover:"#d97706",success:"#10b981",warning:"#fbbf24",error:"#f87171",info:"#38bdf8"},{primary:"#1c1917",secondary:"#292524",tertiary:"#44403c",hover:"#44403c"},{primary:"#fafaf9",secondary:"#d6d3d1",muted:"#78716c"},"#57534e"),Xl=Fe("Soft Dark",{primary:"#a78bfa",primaryHover:"#8b5cf6",success:"#34d399",warning:"#fcd34d",error:"#fb7185",info:"#67e8f9"},{primary:"#1e1e2e",secondary:"#262637",tertiary:"#313147",hover:"#313147"},{primary:"#e8e8f0",secondary:"#a0a0b8",muted:"#5c5c74"},"#3e3e58"),Jl=ue("Coffee",{primary:"#6f4e37",primaryHover:"#5c3d28",success:"#4d7c0f",warning:"#a16207",error:"#b91c1c",info:"#0e7490"},{primary:"#faf6f1",secondary:"#f0e8dc",tertiary:"#e6d8c6",hover:"#f0e8dc"},{primary:"#2c1a0e",secondary:"#5c3d28",muted:"#a08868"},"#d4c4a8"),ec=ue("Wine",{primary:"#7f1d1d",primaryHover:"#641717",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2"},{primary:"#fef2f2",secondary:"#fde8e8",tertiary:"#f8d0d0",hover:"#fde8e8"},{primary:"#3b0a0a",secondary:"#7f1d1d",muted:"#dc6868"},"#e8a0a0"),tc=[cs,ds,us,ps,ms,hs,fs,gs,ys,bs,xs,vs,ws,ks,Ss,Cs,_s,js,Ns,Es,Ms,zs,$s,As,Fs,Is,Ds,Ts,Rs,Ps,Os,Ls,Bs,Hs,qs,Ws,Vs,Ks,Us,Ys,Zs,Gs,Qs,Xs,Js,el,tl,nl,al,il,rl,ol,sl,ll,cl,dl,ul,pl,ml,hl,fl,gl,yl,bl,xl,vl,wl,kl,Sl,Cl,_l,jl,Nl,El,Ml,zl,$l,Al,Fl,Il,Dl,Tl,Rl,Pl,Ol,Ll,Bl,Hl,ql,Wl,Vl,Kl,Ul,Yl,Zl,Gl,Ql,Xl,Jl,ec],yt={space1:"4px",space2:"8px",space3:"12px",space4:"16px",space5:"20px",space6:"24px",space8:"32px"},Xt={fontFamily:"'Inter', system-ui, -apple-system, sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.8125rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.125rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},Dt={color:"#e2e8f0",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},Tt={fast:"120ms ease",normal:"200ms ease",slow:"300ms ease"},qa={name:"Light",colors:{primary:"#3b82f6",primaryHover:"#2563eb",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#06b6d4",surface:"#ffffff",surfaceHover:"#f8fafc"},backgrounds:{primary:"#ffffff",secondary:"#f8fafc",tertiary:"#f1f5f9",hover:"#f1f5f9",elevated:"#ffffff",inset:"#f1f5f9",canvas:"#f8fafc"},text:{primary:"#0f172a",secondary:"#475569",muted:"#94a3b8",inverse:"#ffffff"},borders:Dt,shadows:{sm:"0 1px 2px rgba(0,0,0,0.05)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)"},spacing:yt,typography:Xt,transitions:Tt},nc={name:"Dark",colors:{primary:"#3b82f6",primaryHover:"#60a5fa",success:"#22c55e",warning:"#eab308",error:"#ef4444",info:"#06b6d4",surface:"#141414",surfaceHover:"#1e1e1e"},backgrounds:{primary:"#0a0a0a",secondary:"#141414",tertiary:"#1e1e1e",hover:"#1a1a1a",elevated:"#141414",inset:"#0a0a0a",canvas:"#0a0a0a"},text:{primary:"#ffffff",secondary:"#a1a1a1",muted:"#6b6b6b",inverse:"#0f172a"},borders:{...Dt,color:"#2a2a2a"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.5)",md:"0 4px 6px -1px rgba(0,0,0,0.6)",lg:"0 10px 15px -3px rgba(0,0,0,0.6)",xl:"0 20px 25px -5px rgba(0,0,0,0.6)"},spacing:yt,typography:Xt,transitions:Tt},ac={name:"Blue",colors:{primary:"#1d4ed8",primaryHover:"#1e40af",success:"#059669",warning:"#d97706",error:"#dc2626",info:"#0891b2",surface:"#eff6ff",surfaceHover:"#dbeafe"},backgrounds:{primary:"#eff6ff",secondary:"#dbeafe",tertiary:"#bfdbfe",hover:"#dbeafe",elevated:"#ffffff",inset:"#dbeafe",canvas:"#eff6ff"},text:{primary:"#1e3a5f",secondary:"#3b628a",muted:"#7da0c4",inverse:"#ffffff"},borders:{...Dt,color:"#93c5fd"},shadows:{sm:"0 1px 2px rgba(29,78,216,0.08)",md:"0 4px 6px -1px rgba(29,78,216,0.12)",lg:"0 10px 15px -3px rgba(29,78,216,0.15)",xl:"0 20px 25px -5px rgba(29,78,216,0.18)"},spacing:yt,typography:Xt,transitions:Tt},ic={name:"High Contrast",colors:{primary:"#0000ff",primaryHover:"#0000cc",success:"#008000",warning:"#ff8c00",error:"#ff0000",info:"#008b8b",surface:"#ffffff",surfaceHover:"#f0f0f0"},backgrounds:{primary:"#ffffff",secondary:"#f0f0f0",tertiary:"#e0e0e0",hover:"#e0e0e0",elevated:"#ffffff",inset:"#e0e0e0",canvas:"#ffffff"},text:{primary:"#000000",secondary:"#1a1a1a",muted:"#4d4d4d",inverse:"#ffffff"},borders:{...Dt,color:"#000000"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.15)",md:"0 4px 6px rgba(0,0,0,0.2)",lg:"0 10px 15px rgba(0,0,0,0.25)",xl:"0 20px 25px rgba(0,0,0,0.3)"},spacing:yt,typography:Xt,transitions:Tt},rc={name:"Material",colors:{primary:"#6750a4",primaryHover:"#4f378b",success:"#386a20",warning:"#7c5800",error:"#ba1a1a",info:"#00629e",surface:"#fffbfe",surfaceHover:"#f6edff"},backgrounds:{primary:"#fffbfe",secondary:"#f6edff",tertiary:"#ece6f0",hover:"#eaddff",elevated:"#ffffff",inset:"#ece6f0",canvas:"#fffbfe"},text:{primary:"#1c1b1f",secondary:"#49454f",muted:"#79747e",inverse:"#ffffff"},borders:{...Dt,color:"#cac4d0",radiusSm:"8px",radiusMd:"12px",radiusLg:"16px",radiusXl:"28px",radiusFull:"9999px"},shadows:{sm:"0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.15)",md:"0 1px 2px rgba(0,0,0,0.3), 0 2px 6px 2px rgba(0,0,0,0.15)",lg:"0 4px 8px 3px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.3)",xl:"0 6px 10px 4px rgba(0,0,0,0.15), 0 2px 3px rgba(0,0,0,0.3)"},spacing:yt,typography:{fontFamily:"'Roboto', 'Noto Sans', system-ui, sans-serif",fontSizeXs:"0.6875rem",fontSizeSm:"0.75rem",fontSizeMd:"0.875rem",fontSizeLg:"1rem",fontSizeXl:"1.375rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},transitions:{fast:"100ms cubic-bezier(0.2,0,0,1)",normal:"200ms cubic-bezier(0.2,0,0,1)",slow:"300ms cubic-bezier(0.2,0,0,1)"}},oc={name:"Bootstrap",colors:{primary:"#0d6efd",primaryHover:"#0b5ed7",success:"#198754",warning:"#ffc107",error:"#dc3545",info:"#0dcaf0",surface:"#ffffff",surfaceHover:"#f8f9fa"},backgrounds:{primary:"#ffffff",secondary:"#f8f9fa",tertiary:"#e9ecef",hover:"#e9ecef",elevated:"#ffffff",inset:"#e9ecef",canvas:"#f8f9fa"},text:{primary:"#212529",secondary:"#6c757d",muted:"#adb5bd",inverse:"#ffffff"},borders:{color:"#dee2e6",radiusSm:"4px",radiusMd:"6px",radiusLg:"8px",radiusXl:"16px",radiusFull:"50rem"},shadows:{sm:"0 0.125rem 0.25rem rgba(0,0,0,0.075)",md:"0 0.5rem 1rem rgba(0,0,0,0.15)",lg:"0 1rem 3rem rgba(0,0,0,0.175)",xl:"0 1rem 3rem rgba(0,0,0,0.25)"},spacing:yt,typography:{fontFamily:"system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', sans-serif",fontSizeXs:"0.75rem",fontSizeSm:"0.875rem",fontSizeMd:"1rem",fontSizeLg:"1.25rem",fontSizeXl:"1.5rem",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.5},transitions:Tt},sc={name:"Fluent",colors:{primary:"#0078d4",primaryHover:"#106ebe",success:"#107c10",warning:"#fce100",error:"#d13438",info:"#00b7c3",surface:"#ffffff",surfaceHover:"#faf9f8"},backgrounds:{primary:"#ffffff",secondary:"#faf9f8",tertiary:"#f3f2f1",hover:"#edebe9",elevated:"#ffffff",inset:"#f3f2f1",canvas:"#faf9f8"},text:{primary:"#323130",secondary:"#605e5c",muted:"#a19f9d",inverse:"#ffffff"},borders:{color:"#e1dfdd",radiusSm:"2px",radiusMd:"4px",radiusLg:"8px",radiusXl:"12px",radiusFull:"9999px"},shadows:{sm:"0 1.6px 3.6px 0 rgba(0,0,0,0.132), 0 0.3px 0.9px 0 rgba(0,0,0,0.108)",md:"0 3.2px 7.2px 0 rgba(0,0,0,0.132), 0 0.6px 1.8px 0 rgba(0,0,0,0.108)",lg:"0 6.4px 14.4px 0 rgba(0,0,0,0.132), 0 1.2px 3.6px 0 rgba(0,0,0,0.108)",xl:"0 25.6px 57.6px 0 rgba(0,0,0,0.22), 0 4.8px 14.4px 0 rgba(0,0,0,0.18)"},spacing:yt,typography:{fontFamily:"'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, sans-serif",fontSizeXs:"10px",fontSizeSm:"12px",fontSizeMd:"14px",fontSizeLg:"16px",fontSizeXl:"20px",fontWeightNormal:400,fontWeightMedium:500,fontWeightSemibold:600,fontWeightBold:700,lineHeight:1.42857},transitions:{fast:"100ms cubic-bezier(0.1,0.9,0.2,1)",normal:"200ms cubic-bezier(0.1,0.9,0.2,1)",slow:"300ms cubic-bezier(0.1,0.9,0.2,1)"}},lc=[qa,nc,ac,ic,rc,oc,sc,...tc],Wa=({theme:e,darkTheme:t,variantConfig:n,darkMode:i,displayStyle:r,animateTransitions:s=!0,children:l})=>{const c=o.useRef(null),[d,u]=o.useState(e),[y,f]=o.useState(!1),[p,m]=o.useState(r??"default");o.useEffect(()=>{r!==void 0&&m(r)},[r]),o.useEffect(()=>{const v=window.matchMedia("(prefers-color-scheme: dark)");f(v.matches);const N=j=>f(j.matches);return v.addEventListener("change",N),()=>v.removeEventListener("change",N)},[]);const w=i??e.darkMode??"light",k=w==="dark"||w==="auto"&&y;o.useEffect(()=>{u(k&&t?t:e)},[e,t,k]),o.useEffect(()=>{const v=c.current;if(!v)return;s&&(v.style.transition="background-color 300ms ease, color 300ms ease");const N=xn(d);for(const[I,D]of Object.entries(N))v.style.setProperty(I,D);v.style.colorScheme=k?"dark":"light",v.dataset.ntdColorScheme=k?"dark":"light";const j=d.backgroundImage;return j&&j.type!=="none"&&j.type==="gradient"&&j.gradient&&v.style.setProperty("--ntd-bg-image",j.gradient),()=>{v&&Lo(v)}},[d,k,s]),o.useEffect(()=>{const v=c.current;if(!v)return;const N=n?{...Ut,...n}:Yt(p);rs(N,v);const j=ss(p);for(const[I,D]of Object.entries(j))v.setAttribute(I,D)},[n,p]);const z=o.useCallback(v=>{u(v)},[]),$=o.useMemo(()=>({theme:d,setTheme:z}),[d,z]),g=o.useMemo(()=>({displayStyle:p,variantConfig:Yt(p),setDisplayStyle:m}),[p]);return a.jsx(qo.Provider,{value:$,children:a.jsx(La.Provider,{value:g,children:a.jsx("div",{ref:c,className:"nice-theme-scope",style:{display:"contents"},children:l})})})};Wa.displayName="NiceThemeProvider";const ft=({height:e=200})=>a.jsx("div",{className:"ntd-lazy-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",height:e,background:"var(--ntd-color-surface, #f5f5f5)",borderRadius:"var(--ntd-radius, 8px)",animation:"ntd-pulse 1.5s ease-in-out infinite"},children:a.jsx("div",{className:"ntd-lazy-loading-spinner",style:{width:24,height:24,border:"2px solid var(--ntd-color-border, #ddd)",borderTopColor:"var(--ntd-color-primary, #6366f1)",borderRadius:"50%",animation:"ntd-spin 0.8s linear infinite"}})}),cc=(e,t)=>a.jsxs("div",{className:"ntd-lazy-error",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:24,background:"var(--ntd-color-error-bg, #fee2e2)",borderRadius:"var(--ntd-radius, 8px)",color:"var(--ntd-color-error, #dc2626)"},children:[a.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),a.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),a.jsx("p",{style:{margin:"12px 0 8px",fontWeight:500},children:"Failed to load component"}),a.jsx("p",{style:{margin:0,fontSize:"0.875em",opacity:.8},children:e.message}),a.jsx("button",{onClick:t,style:{marginTop:16,padding:"8px 16px",border:"none",borderRadius:"var(--ntd-radius, 8px)",background:"var(--ntd-color-error, #dc2626)",color:"#fff",cursor:"pointer",fontSize:"0.875em"},children:"Retry"})]});class dc extends o.Component{constructor(){super(...arguments),this.state={error:null},this.handleRetry=()=>{this.setState({error:null})}}static getDerivedStateFromError(t){return{error:t}}render(){return this.state.error?this.props.fallback(this.state.error,this.handleRetry):this.props.children}}function Ve(e,t={}){const{fallback:n=a.jsx(ft,{}),preloadOnMount:i=!1,preloadOnHover:r=!1,preloadAfterIdle:s,minLoadingTime:l=0,ssrFallback:c,errorFallback:d=cc,displayName:u}=t;let y=null,f=!1;const p=async()=>{if(y)return y;const $=Date.now();y=e();const g=await y;if(l>0){const v=Date.now()-$;v<l&&await new Promise(N=>setTimeout(N,l-v))}return f=!0,g},m=o.lazy(p),w=$=>{const g=o.useRef(null);return o.useEffect(()=>{i&&!f&&p()},[]),o.useEffect(()=>{if(s&&!f){const v="requestIdleCallback"in window?window.requestIdleCallback(()=>p(),{timeout:s}):setTimeout(()=>p(),s);return()=>{"cancelIdleCallback"in window?window.cancelIdleCallback(v):clearTimeout(v)}}},[]),o.useEffect(()=>{if(!r||f)return;const v=g.current;if(!v)return;const N=()=>{f||p()};return v.addEventListener("mouseenter",N,{once:!0}),()=>v.removeEventListener("mouseenter",N)},[]),typeof window>"u"&&c?a.jsx(a.Fragment,{children:c}):a.jsx("div",{ref:g,className:"ntd-lazy-wrapper",children:a.jsx(dc,{fallback:d,children:a.jsx(o.Suspense,{fallback:n,children:a.jsx(m,{...$})})})})},k=async()=>{f||await p()},z=w;return z.preload=k,z.displayName=u||"LazyComponent",z}const ra=()=>a.jsx(ft,{height:400}),oa=()=>a.jsx(ft,{height:300}),sa=()=>a.jsx(ft,{height:500}),la=()=>a.jsx(ft,{height:600}),Ke=e=>e;Ve(Ke(()=>Promise.resolve().then(()=>Na).then(e=>e.ar).then(e=>({default:e.NiceCodeEditor}))),{fallback:a.jsx(ra,{}),preloadOnHover:!0,displayName:"LazyCodeEditor"}),Ve(Ke(()=>Promise.resolve().then(()=>Na).then(e=>e.aq).then(e=>({default:e.NiceHtmlEditor}))),{fallback:a.jsx(ra,{}),preloadOnHover:!0,displayName:"LazyHtmlEditor"}),Ve(Ke(()=>Promise.resolve().then(()=>require("./index-CNwVELPJ-CNlww_AU.cjs")).then(e=>e.fy).then(e=>({default:e.NiceDocumentViewer}))),{fallback:a.jsx(ft,{height:600}),displayName:"LazyDocumentViewer"}),Ve(Ke(()=>Promise.resolve().then(()=>require("./NiceStockChart-Cpmv9_Cc-DBqGppkm.cjs")).then(e=>e.v).then(e=>({default:e.NiceChart}))),{fallback:a.jsx(oa,{}),preloadAfterIdle:3e3,displayName:"LazyChart"}),Ve(Ke(()=>Promise.resolve().then(()=>require("./NiceStockChart-Cpmv9_Cc-DBqGppkm.cjs")).then(e=>e.x).then(e=>({default:e.NiceVectorMap}))),{fallback:a.jsx(ft,{height:400}),displayName:"LazyVectorMap"}),Ve(Ke(()=>Promise.resolve().then(()=>require("./NiceStockChart-Cpmv9_Cc-DBqGppkm.cjs")).then(e=>e.w).then(e=>({default:e.NiceSankey}))),{fallback:a.jsx(oa,{}),displayName:"LazySankey"}),Ve(Ke(()=>Promise.resolve().then(()=>require("./index-CNwVELPJ-CNlww_AU.cjs")).then(e=>e.fw).then(e=>({default:e.NiceScheduler}))),{fallback:a.jsx(la,{}),displayName:"LazyScheduler"}),Ve(Ke(()=>Promise.resolve().then(()=>require("./index-CNwVELPJ-CNlww_AU.cjs")).then(e=>e.fx).then(e=>({default:e.NiceGantt}))),{fallback:a.jsx(la,{}),displayName:"LazyGantt"}),Ve(Ke(()=>Promise.resolve().then(()=>require("./NiceSavedQueryPanel-DUw8plYP-DtmUEWvh.cjs")).then(e=>e.s).then(e=>({default:e.NicePivotGrid}))),{fallback:a.jsx(sa,{}),displayName:"LazyPivotGrid"}),Ve(Ke(()=>Promise.resolve().then(()=>require("./NiceSavedQueryPanel-DUw8plYP-DtmUEWvh.cjs")).then(e=>e.r).then(e=>({default:e.NiceDataGrid}))),{fallback:a.jsx(sa,{}),preloadAfterIdle:2e3,displayName:"LazyDataGrid"});process.env.NODE_ENV;const uc=process.env.NODE_ENV==="development";let Va={enabled:uc,slowRenderThreshold:16};const Ka=[],wn=new Map,Ua=new Map;function pc(){Ka.length=0,wn.clear(),Ua.clear()}function mc(e){const t=Va.slowRenderThreshold;return Ka.filter(n=>n.actualDuration>t)}function ct(e){return e<1?`${(e*1e3).toFixed(0)}μs`:e<1e3?`${e.toFixed(2)}ms`:`${(e/1e3).toFixed(2)}s`}function hc(){const e=Array.from(wn.values()),t=mc(),n=e.reduce((s,l)=>s+l.renderCount,0),i=e.length>0?e.reduce((s,l)=>s+l.avgRenderTime,0)/e.length:0,r=Array.from(Ua.values());return{stats:e,slowRenders:t,totalRenders:n,avgRenderTime:i,marks:r}}function fc(){const e=hc();console.group("%c[Nice2Dev Performance Report]","color: #6366f1; font-weight: bold; font-size: 14px"),console.log(`Total renders: ${e.totalRenders}`),console.log(`Average render time: ${ct(e.avgRenderTime)}`),console.log(`Slow renders: ${e.slowRenders.length}`),console.group("Component Stats"),console.table(e.stats.sort((t,n)=>n.totalRenderTime-t.totalRenderTime).map(t=>({Name:t.componentName,Renders:t.renderCount,"Avg Time":ct(t.avgRenderTime),"Max Time":ct(t.maxRenderTime),"Total Time":ct(t.totalRenderTime),"Slow Renders":t.slowRenderCount}))),console.groupEnd(),e.slowRenders.length>0&&(console.group("Slow Renders (last 10)"),console.table(e.slowRenders.slice(-10).map(t=>({Component:t.componentName,Phase:t.phase,Duration:ct(t.actualDuration),Time:new Date(t.timestamp).toLocaleTimeString()}))),console.groupEnd()),e.marks.length>0&&(console.group("Custom Marks"),console.table(e.marks.filter(t=>t.duration).map(t=>({Name:t.name,Duration:ct(t.duration)}))),console.groupEnd()),console.groupEnd()}const gc=o.memo(({position:e="bottom-right",defaultCollapsed:t=!0})=>{const[n,i]=o.useState(t),[r,s]=o.useState([]),[l,c]=o.useState({used:0,total:0});if(o.useEffect(()=>{const u=()=>{const f=Array.from(wn.values());s(f.sort((m,w)=>w.totalRenderTime-m.totalRenderTime).slice(0,10));const p=window.performance;p.memory&&c({used:p.memory.usedJSHeapSize/1024/1024,total:p.memory.totalJSHeapSize/1024/1024})};u();const y=setInterval(u,2e3);return()=>clearInterval(y)},[]),!Va.enabled)return null;const d={position:"fixed",zIndex:99999,...e.includes("top")?{top:8}:{bottom:8},...e.includes("left")?{left:8}:{right:8}};return a.jsxs("div",{style:{...d,background:"rgba(0, 0, 0, 0.85)",color:"#fff",borderRadius:8,fontSize:11,fontFamily:"Monaco, Consolas, monospace",padding:n?"4px 8px":8,maxWidth:n?"auto":300,maxHeight:n?"auto":400,overflow:"auto"},children:[a.jsxs("div",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:8},onClick:()=>i(u=>!u),children:[a.jsx("span",{style:{color:"#22c55e"},children:"●"}),a.jsx("span",{children:"Profiler"}),l.used>0&&a.jsxs("span",{style:{color:l.used>100?"#f59e0b":"#64748b"},children:[l.used.toFixed(0),"MB"]}),a.jsx("span",{style:{marginLeft:"auto",opacity:.5},children:n?"▼":"▲"})]}),!n&&a.jsxs("div",{style:{marginTop:8},children:[a.jsx("div",{style:{borderBottom:"1px solid #333",paddingBottom:4,marginBottom:8},children:a.jsx("strong",{children:"Top Components"})}),r.map(u=>a.jsxs("div",{style:{marginBottom:4,display:"flex",gap:8},children:[a.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:u.componentName}),a.jsx("span",{style:{color:u.avgRenderTime>16?"#f59e0b":"#22c55e"},children:ct(u.avgRenderTime)}),a.jsxs("span",{style:{color:"#64748b",minWidth:30,textAlign:"right"},children:["x",u.renderCount]})]},u.componentName)),a.jsxs("div",{style:{marginTop:8,display:"flex",gap:8},children:[a.jsx("button",{onClick:fc,style:{flex:1,padding:"4px 8px",background:"#333",border:"none",borderRadius:4,color:"#fff",cursor:"pointer",fontSize:10},children:"Print Report"}),a.jsx("button",{onClick:pc,style:{flex:1,padding:"4px 8px",background:"#333",border:"none",borderRadius:4,color:"#fff",cursor:"pointer",fontSize:10},children:"Clear"})]})]})]})});gc.displayName="ProfilerOverlay";o.createContext(null);o.createContext(null);const pt=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:y,accessMode:f,displayStyle:p,value:m,defaultValue:w,onChange:k,onBlur:z,onKeyDown:$,placeholder:g,type:v="text",maxLength:N,prefix:j,suffix:I,clearable:D,autoFocus:b,submitOnEnter:T,onSubmit:R,showKeyboardHints:L,...M},S)=>{const x=Ee(f,d);if(x==="hidden")return null;x==="disabled"&&(r=!0),x==="readOnly"&&(s=!0);const{t:P}=ke(),A=we(d),E=Ye("input",p),h=Be("input",p),C=o.useCallback(()=>k==null?void 0:k(""),[k]),_=bn({enabled:T,onSubmit:R}),F=o.useCallback(H=>{_(H),$==null||$(H)},[_,$]),O=o.useMemo(()=>{const H=[];return T&&H.push({key:"Enter",description:P("shortcuts.submit","Submit")}),D&&H.push({key:"Escape",description:P("shortcuts.clear","Clear")}),H},[T,D,P]);return a.jsxs("div",{className:`nice-field ${u||""}`,style:y,children:[e&&a.jsxs("label",{htmlFor:A,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[e,L&&O.length>0&&a.jsx(Oe,{shortcuts:O,size:"sm"})]}),a.jsxs("div",{className:`nice-input nice-input--${l} nice-input--ds-${h} ${n?"nice-input--error":""} ${r?"nice-input--disabled":""} ${s?"nice-input--readonly":""}`,style:E,children:[j&&a.jsx("span",{className:"nice-input__icon",children:j}),a.jsx("input",{ref:S,id:A,className:"nice-input__native",type:v,name:c,value:m,defaultValue:w,placeholder:g,disabled:r,readOnly:s,maxLength:N,autoFocus:b,"aria-invalid":!!n,"aria-describedby":n?`${A}-error`:t?`${A}-helper`:void 0,onChange:H=>k==null?void 0:k(H.target.value),onBlur:z,onKeyDown:F,...M}),D&&m&&a.jsx("button",{type:"button",className:"nice-input__clear",onClick:C,"aria-label":P("controls.clear","Clear"),children:"✕"}),I&&a.jsx("span",{className:"nice-input__icon",children:I})]}),n&&a.jsx("div",{id:`${A}-error`,className:"nice-field__error",role:"alert",children:n}),!n&&t&&a.jsx("div",{id:`${A}-helper`,className:"nice-field__helper",children:t})]})});pt.displayName="NiceTextInput";const ht=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,size:s="md",name:l,id:c,className:d,style:u,accessMode:y,displayStyle:f,options:p,value:m,onChange:w,placeholder:k,multiple:z=!1,searchable:$=!1,clearable:g=!1,emptyText:v,maxHeight:N=240,optionsSource:j,valueField:I,labelField:D,virtualScroll:b,optionHeight:T=36,onSearch:R,loading:L,renderOption:M,showKeyboardHints:S},x)=>{const P=Ee(y,c);if(P==="hidden")return null;(P==="disabled"||P==="readOnly")&&(r=!0);const{t:A}=ke(),E=Ye("input",f),h=Be("input",f),C=we(c),[_,F]=o.useState(!1),[O,H]=o.useState(""),[V,U]=o.useState(-1),[B,W]=o.useState(0),Q=o.useRef(null),Z=No(j??null,I??(j==null?void 0:j.keyField)??"id",D??"name"),X=j?Z.options:p??[];at(Q,()=>{F(!1),H("")});const oe=o.useMemo(()=>m?Array.isArray(m)?m:[m]:[],[m]),re=o.useMemo(()=>{if(!O&&!R||R)return X;const K=O.toLowerCase();return X.filter(Y=>Y.label.toLowerCase().includes(K)||String(Y.value).toLowerCase().includes(K))},[X,O,R]),he=o.useMemo(()=>{const K=new Map;for(const Y of re){const G=Y.group||"";K.has(G)||K.set(G,[]),K.get(G).push(Y)}return K},[re]),J=o.useCallback(K=>{if(z){const Y=oe.includes(K)?oe.filter(G=>G!==K):[...oe,K];w==null||w(Y)}else w==null||w(K),F(!1),H("")},[z,oe,w]),le=o.useCallback(K=>{if(K.key==="Escape"){F(!1),H("");return}if(K.key==="Enter"||K.key===" "){if(!_){F(!0),K.preventDefault();return}V>=0&&re[V]&&(J(re[V].value),K.preventDefault());return}K.key==="ArrowDown"&&(K.preventDefault(),U(Y=>Math.min(Y+1,re.length-1))),K.key==="ArrowUp"&&(K.preventDefault(),U(Y=>Math.max(Y-1,0)))},[_,V,re,J]),pe=o.useMemo(()=>{var K;return oe.length===0?null:z?oe.map(Y=>{var G;return((G=X.find(ee=>ee.value===Y))==null?void 0:G.label)||Y}).join(", "):((K=X.find(Y=>Y.value===oe[0]))==null?void 0:K.label)||oe[0]},[oe,X,z]),me=o.useCallback(K=>{K.stopPropagation(),w==null||w(z?[]:"")},[w,z]),ve=o.useMemo(()=>[{key:"Enter",description:A("shortcuts.select","Select")},{key:"Space",description:A("shortcuts.openDropdown","Open dropdown")},$e.moveUp,$e.moveDown,$e.cancel],[A]);return a.jsxs("div",{className:`nice-field ${d||""}`,style:u,children:[e&&a.jsxs("label",{htmlFor:C,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[e,S&&a.jsx(Oe,{shortcuts:ve,size:"sm"})]}),a.jsxs("div",{className:"nice-select",ref:Q,children:[a.jsxs("button",{ref:x,type:"button",id:C,role:"combobox","aria-expanded":_,"aria-haspopup":"listbox","aria-invalid":!!n,className:`nice-select__trigger nice-select__trigger--${s} nice-select--ds-${h} ${_?"nice-select__trigger--open":""} ${n?"nice-select__trigger--error":""} ${r?"nice-select__trigger--disabled":""}`,style:E,disabled:r,onClick:()=>F(!_),onKeyDown:le,children:[pe?a.jsx("span",{children:pe}):a.jsx("span",{className:"nice-select__placeholder",children:k||A("controls.select","Select...")}),a.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[g&&oe.length>0&&a.jsx("span",{className:"nice-input__clear",onClick:me,role:"button","aria-label":A("controls.clear","Clear"),children:"✕"}),a.jsx("svg",{className:`nice-select__chevron ${_?"nice-select__chevron--open":""}`,viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})]})]}),_&&a.jsxs("div",{className:"nice-select__dropdown",role:"listbox",style:{maxHeight:N},onScroll:b?K=>W(K.currentTarget.scrollTop):void 0,children:[($||R)&&a.jsx("div",{className:"nice-select__search",children:a.jsx("input",{type:"text",value:O,onChange:K=>{H(K.target.value),U(0),R==null||R(K.target.value)},placeholder:A("controls.search","Search..."),autoFocus:!0})}),L&&a.jsx("div",{className:"nice-select__loading",children:a.jsx("div",{className:"nice-spinner nice-spinner--sm",style:{margin:"8px auto"}})}),!L&&re.length===0?a.jsx("div",{className:"nice-select__empty",children:v||A("controls.noResults","No results found")}):b&&!Array.from(he.keys()).some(K=>K!=="")?(()=>{const K=re.length*T,Y=Math.max(0,Math.floor(B/T)-3),G=Math.min(re.length,Math.ceil((B+N)/T)+3),ee=re.slice(Y,G);return a.jsx("div",{style:{height:K,position:"relative"},children:ee.map((ce,ge)=>{const de=Y+ge,ie=oe.includes(ce.value);return a.jsx("div",{role:"option","aria-selected":ie,className:`nice-select__option ${ie?"nice-select__option--selected":""} ${de===V?"nice-select__option--highlighted":""} ${ce.disabled?"nice-select__option--disabled":""}`,style:{position:"absolute",top:de*T,left:0,right:0,height:T,display:"flex",alignItems:"center",padding:"0 12px"},onClick:()=>!ce.disabled&&J(String(ce.value)),onMouseEnter:()=>U(de),children:M?M(ce,ie):a.jsxs(a.Fragment,{children:[ce.icon&&a.jsx("span",{children:ce.icon}),a.jsxs("div",{style:{flex:1},children:[a.jsx("div",{children:ce.label}),ce.description&&a.jsx("div",{className:"nice-select__option-desc",children:ce.description})]}),ie&&a.jsx("svg",{className:"nice-select__option-check",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})]})},ce.value)})})})():Array.from(he.entries()).map(([K,Y])=>a.jsxs(o.Fragment,{children:[K&&a.jsx("div",{className:"nice-select__group-label",children:K}),Y.map(G=>{const ee=oe.includes(G.value),ce=re.indexOf(G);return a.jsx("div",{role:"option","aria-selected":ee,className:`nice-select__option ${ee?"nice-select__option--selected":""} ${ce===V?"nice-select__option--highlighted":""} ${G.disabled?"nice-select__option--disabled":""}`,onClick:()=>!G.disabled&&J(String(G.value)),onMouseEnter:()=>U(ce),children:M?M(G,ee):a.jsxs(a.Fragment,{children:[G.icon&&a.jsx("span",{children:G.icon}),a.jsxs("div",{style:{flex:1},children:[a.jsx("div",{children:G.label}),G.description&&a.jsx("div",{className:"nice-select__option-desc",children:G.description})]}),ee&&a.jsx("svg",{className:"nice-select__option-check",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})]})},G.value)})]},K))]})]}),n&&a.jsx("div",{className:"nice-field__error",role:"alert",children:n}),!n&&t&&a.jsx("div",{className:"nice-field__helper",children:t})]})});ht.displayName="NiceSelect";const yc=["#ef4444","#f97316","#f59e0b","#84cc16","#10b981","#06b6d4","#3b82f6","#6366f1","#8b5cf6","#ec4899","#64748b","#1e293b"];function bc(){return"#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}const gt=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,id:s,className:l,style:c,accessMode:d,displayStyle:u,value:y="#3b82f6",onChange:f,presets:p=yc,showInput:m=!0,showRandom:w=!0,showKeyboardHints:k},z)=>{const $=Ee(d,s);if($==="hidden")return null;($==="disabled"||$==="readOnly")&&(r=!0);const{t:g}=ke(),v=we(s);Be("input",u);const N=o.useRef(null),j=o.useCallback(()=>{r||(f==null||f(bc()))},[r,f]),I=o.useMemo(()=>[{key:"Enter",description:g("shortcuts.openPicker","Open color picker")},{key:"Arrow keys",description:g("shortcuts.navigatePresets","Navigate presets")}],[g]);return a.jsxs("div",{className:`nice-field ${l||""}`,style:c,children:[e&&a.jsxs("label",{htmlFor:v,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[e,k&&a.jsx(Oe,{shortcuts:I,size:"sm"})]}),a.jsxs("div",{className:"nice-color-picker",children:[a.jsxs("div",{className:"nice-color-picker__preview-row",children:[a.jsx("div",{className:"nice-color-picker__swatch",style:{background:y},onClick:()=>{var D;return(D=N.current)==null?void 0:D.click()},role:"button",tabIndex:0,"aria-label":"Pick color",children:a.jsx("input",{ref:D=>{N.current=D,typeof z=="function"?z(D):z&&(z.current=D)},type:"color",className:"nice-color-picker__native",id:v,value:y,disabled:r,onChange:D=>f==null?void 0:f(D.target.value)})}),m&&a.jsx("div",{className:"nice-input nice-input--sm",style:{width:100},children:a.jsx("input",{className:"nice-input__native",type:"text",value:y,disabled:r,onChange:D=>f==null?void 0:f(D.target.value),maxLength:7})}),w&&a.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm nice-color-picker__random",onClick:j,disabled:r,title:"Random color","aria-label":"Random color",children:"🎲"})]}),p.length>0&&a.jsx("div",{className:"nice-color-picker__presets",children:p.map(D=>a.jsx("div",{className:`nice-color-picker__preset ${y===D?"nice-color-picker__preset--active":""}`,style:{background:D},onClick:()=>f==null?void 0:f(D),role:"button",tabIndex:0,"aria-label":D},D))})]}),n&&a.jsx("div",{className:"nice-field__error",role:"alert",children:n}),!n&&t&&a.jsx("div",{className:"nice-field__helper",children:t})]})});gt.displayName="NiceColorPicker";const xe=o.forwardRef(({children:e,variant:t="primary",size:n="md",type:i="button",disabled:r,loading:s,fullWidth:l,onClick:c,leftIcon:d,rightIcon:u,className:y,style:f,id:p,accessMode:m,displayStyle:w,...k},z)=>{const $=Ee(m,p);if($==="hidden")return null;($==="disabled"||$==="readOnly")&&(r=!0);const g=Ye("button",w),v=Be("button",w);return a.jsxs("button",{ref:z,type:i,id:p,className:`nice-btn nice-btn--${t} nice-btn--${n} nice-btn--ds-${v} ${l?"nice-btn--full-width":""} ${s?"nice-btn--loading":""} ${y||""}`,style:{...g,...f},disabled:r||s,"aria-busy":s||void 0,"aria-disabled":r||s||void 0,onClick:c,...k,children:[s&&a.jsx("svg",{className:"nice-btn__spinner",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3","aria-hidden":"true",children:a.jsx("circle",{cx:"12",cy:"12",r:"10",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})}),!s&&d&&a.jsx("span",{"aria-hidden":"true",children:d}),a.jsx("span",{children:e}),!s&&u&&a.jsx("span",{"aria-hidden":"true",children:u})]})});xe.displayName="NiceButton";const xc=(e,t)=>t,vc=o.createContext(xc);function kn(){return{t:o.useContext(vc)}}o.createContext({dir:"ltr",isRTL:!1,flip:e=>e,value:e=>e.ltr});o.createContext(null);o.createContext(null);const Sn=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:y,accessMode:f,displayStyle:p,value:m,defaultValue:w,onChange:k,onBlur:z,onKeyDown:$,placeholder:g,rows:v=3,maxLength:N,resize:j="vertical",autoFocus:I,showCount:D,submitOnEnter:b,onSubmit:T,showKeyboardHints:R},L)=>{const M=Ee(f,d);if(M==="hidden")return null;M==="disabled"&&(r=!0),M==="readOnly"&&(s=!0);const{t:S}=ke(),x=we(d),P=Ye("input",p),A=Be("input",p),E=(m==null?void 0:m.length)??0,h=N?E>N:!1,C={key:"Enter",ctrl:!0,description:S("shortcuts.submit","Submit")},_=o.useCallback(O=>{b&&yo(O,C)&&(O.preventDefault(),T==null||T()),$==null||$(O)},[b,T,$,C]),F=o.useMemo(()=>{const O=[];return b&&O.push(C),O.push({key:"Tab",description:S("shortcuts.indent","Indent (when supported)")}),O},[b,S,C]);return a.jsxs("div",{className:`nice-field ${u||""}`,style:y,children:[e&&a.jsxs("label",{htmlFor:x,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[e,R&&F.length>0&&a.jsx(Oe,{shortcuts:F,size:"sm"})]}),a.jsx("textarea",{ref:L,id:x,className:`nice-textarea nice-input--${l} nice-textarea--ds-${A} ${n?"nice-textarea--error":""} ${r?"nice-textarea--disabled":""}`,style:{...P,resize:j},name:c,value:m,defaultValue:w,placeholder:g,rows:v,maxLength:N,disabled:r,readOnly:s,autoFocus:I,"aria-invalid":!!n,"aria-describedby":n?`${x}-error`:t?`${x}-helper`:void 0,onChange:O=>k==null?void 0:k(O.target.value),onBlur:z,onKeyDown:_}),(D||N)&&a.jsxs("div",{className:`nice-textarea__counter ${h?"nice-textarea__counter--over":""}`,children:[E,N?` / ${N}`:""]}),n&&a.jsx("div",{id:`${x}-error`,className:"nice-field__error",role:"alert",children:n}),!n&&t&&a.jsx("div",{id:`${x}-helper`,className:"nice-field__helper",children:t})]})});Sn.displayName="NiceTextArea";const Cn=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:y,accessMode:f,value:p,onChange:m,onBlur:w,onKeyDown:k,min:z,max:$,type:g="date",submitOnEnter:v,onSubmit:N,showKeyboardHints:j,displayStyle:I},D)=>{Ye("input",I),Be("input",I);const b=Ee(f,d);if(b==="hidden")return null;b==="disabled"&&(r=!0),b==="readOnly"&&(s=!0);const{t:T}=ke(),R=we(d),L=bn({enabled:v,onSubmit:N}),M=o.useCallback(x=>{L(x),k==null||k(x)},[L,k]),S=o.useMemo(()=>{const x=[];return v&&x.push($e.submit),x.push({key:"ArrowUp",description:T("shortcuts.increaseDate","Increase value")}),x.push({key:"ArrowDown",description:T("shortcuts.decreaseDate","Decrease value")}),x},[v,T]);return a.jsxs("div",{className:`nice-field ${u||""}`,style:y,children:[e&&a.jsxs("label",{htmlFor:R,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[e,j&&S.length>0&&a.jsx(Oe,{shortcuts:S,size:"sm"})]}),a.jsx("div",{className:`nice-input nice-input--${l} ${n?"nice-input--error":""} ${r?"nice-input--disabled":""} ${s?"nice-input--readonly":""}`,children:a.jsx("input",{ref:D,id:R,className:"nice-input__native",type:g,name:c,value:p??"",min:z,max:$,disabled:r,readOnly:s,"aria-invalid":!!n,onChange:x=>m==null?void 0:m(x.target.value),onBlur:w,onKeyDown:M})}),n&&a.jsx("div",{className:"nice-field__error",role:"alert",children:n}),!n&&t&&a.jsx("div",{className:"nice-field__helper",children:t})]})});Cn.displayName="NiceDatePicker";const Ya=({label:e,helperText:t,error:n,required:i,disabled:r,size:s="md",name:l,id:c,className:d,style:u,accessMode:y,options:f,value:p,onChange:m,direction:w="horizontal",showKeyboardHints:k,displayStyle:z})=>{Be("toggle",z);const $=Ee(y,c);if($==="hidden")return null;($==="disabled"||$==="readOnly")&&(r=!0);const{t:g}=ke(),v=we(c),N=l||v,j=o.useMemo(()=>[{key:"ArrowUp",description:g("shortcuts.previousOption","Previous option")},{key:"ArrowDown",description:g("shortcuts.nextOption","Next option")},{key:"Space",description:g("shortcuts.select","Select")}],[g]);return a.jsxs("div",{className:`nice-field ${d||""}`,style:u,role:"radiogroup","aria-labelledby":`${v}-label`,children:[e&&a.jsxs("span",{id:`${v}-label`,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[e,k&&a.jsx(Oe,{shortcuts:j,size:"sm"})]}),a.jsx("div",{className:`nice-radio-group ${w==="vertical"?"nice-radio-group--vertical":""}`,children:f.map(I=>a.jsxs("label",{className:`nice-radio ${r||I.disabled?"nice-radio--disabled":""}`,children:[a.jsx("input",{type:"radio",className:"nice-radio__input",name:N,value:I.value,checked:p===I.value,disabled:r||I.disabled,onChange:()=>m==null?void 0:m(I.value)}),a.jsx("span",{className:"nice-radio__circle",children:a.jsx("span",{className:"nice-radio__dot"})}),a.jsx("span",{children:I.label})]},I.value))}),n&&a.jsx("div",{className:"nice-field__error",role:"alert",children:n}),!n&&t&&a.jsx("div",{className:"nice-field__helper",children:t})]})},Jt=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,id:s,className:l,style:c,accessMode:d,value:u=0,onChange:y,min:f=0,max:p=100,step:m=1,showValue:w=!0,showMinMax:k=!1,formatValue:z,showKeyboardHints:$,displayStyle:g},v)=>{Be("input",g);const N=Ee(d,s);if(N==="hidden")return null;(N==="disabled"||N==="readOnly")&&(r=!0),ke();const j=we(s),I=o.useMemo(()=>(u-f)/(p-f)*100,[u,f,p]),D=z?z(u):u.toString(),b=o.useMemo(()=>[$e.increment,$e.decrement,$e.first,$e.last,$e.incrementBig,$e.decrementBig],[]);return a.jsxs("div",{className:`nice-field ${l||""}`,style:c,children:[(e||w||$)&&a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e&&a.jsxs("label",{htmlFor:j,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[e,$&&a.jsx(Oe,{shortcuts:b,size:"sm"})]}),w&&a.jsx("span",{className:"nice-slider__value",children:D})]}),a.jsxs("div",{className:`nice-slider ${r?"nice-slider--disabled":""}`,children:[a.jsxs("div",{className:"nice-slider__track-wrapper",children:[a.jsx("div",{className:"nice-slider__track",children:a.jsx("div",{className:"nice-slider__fill",style:{width:`${I}%`}})}),a.jsx("input",{ref:v,id:j,type:"range",className:"nice-slider__native",min:f,max:p,step:m,value:u,disabled:r,"aria-valuenow":u,"aria-valuemin":f,"aria-valuemax":p,onChange:T=>y==null?void 0:y(parseFloat(T.target.value))}),a.jsx("div",{className:"nice-slider__thumb-visual",style:{left:`${I}%`}})]}),k&&a.jsxs("div",{className:"nice-slider__labels",children:[a.jsx("span",{children:z?z(f):f}),a.jsx("span",{children:z?z(p):p})]})]}),n&&a.jsx("div",{className:"nice-field__error",role:"alert",children:n}),!n&&t&&a.jsx("div",{className:"nice-field__helper",children:t})]})});Jt.displayName="NiceSlider";function ca(e,t,n){return Math.max(t,Math.min(n,e))}function Za({h:e,s:t,v:n}){e=(e%360+360)%360;const i=n*t,r=i*(1-Math.abs(e/60%2-1)),s=n-i;let l=0,c=0,d=0;return e<60?(l=i,c=r):e<120?(l=r,c=i):e<180?(c=i,d=r):e<240?(c=r,d=i):e<300?(l=r,d=i):(l=i,d=r),{r:Math.round((l+s)*255),g:Math.round((c+s)*255),b:Math.round((d+s)*255)}}function _n({r:e,g:t,b:n}){e/=255,t/=255,n/=255;const i=Math.max(e,t,n),r=Math.min(e,t,n),s=i-r;let l=0;return s!==0&&(i===e?l=(t-n)/s%6:i===t?l=(n-e)/s+2:l=(e-t)/s+4,l=(l*60+360)%360),{h:l,s:i===0?0:s/i,v:i}}function Ga({r:e,g:t,b:n}){e/=255,t/=255,n/=255;const i=Math.max(e,t,n),r=Math.min(e,t,n),s=(i+r)/2;if(i===r)return{h:0,s:0,l:s};const l=i-r,c=s>.5?l/(2-i-r):l/(i+r);let d=0;return i===e?d=((t-n)/l+(t<n?6:0))/6:i===t?d=((n-e)/l+2)/6:d=((e-t)/l+4)/6,{h:d*360,s:c,l:s}}function zt(e){const t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,i=parseInt(n,16);return{r:i>>16&255,g:i>>8&255,b:i&255}}function Qa({r:e,g:t,b:n}){return"#"+[e,t,n].map(i=>i.toString(16).padStart(2,"0")).join("")}function Ue(e){return Qa(Za(e))}function _t(e){return _n(zt(e))}function Xa(e,t){const n=[];for(let i=0;i<t;i++){const r=t<=1?.5:i/(t-1),s=ca(e.s*(.3+r*.7),0,1),l=ca(e.v*(1.2-r*.7),0,1);n.push(Ue({h:e.h,s,v:l}))}return n}function jn(e,t){const n=t??30;switch(e){case"monochromatic":return[0];case"complementary":return[0,180];case"split-complementary":return[0,180-n,180+n];case"analogous":return[0,-n,n];case"triadic":return[0,120,240];case"tetradic":return[0,60,180,240];case"square":return[0,90,180,270]}}function Et(e,t,n){return jn(t,n).map(i=>((e+i)%360+360)%360)}function da({r:e,g:t,b:n}){const[i,r,s]=[e,t,n].map(l=>{const c=l/255;return c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4)});return .2126*i+.7152*r+.0722*s}function Wt(e,t){const n=da(zt(e)),i=da(zt(t)),r=Math.max(n,i),s=Math.min(n,i);return(r+.05)/(s+.05)}function Vt(e){return e>=7?"AAA":e>=4.5?"AA":e>=3?"AA-lg":"Fail"}const Ja={"lightest-pastel":{sRange:[.1,.25],vRange:[.92,1]},"bright-pastel":{sRange:[.25,.45],vRange:[.9,1]},shiny:{sRange:[.7,.95],vRange:[.9,1]},pastel:{sRange:[.3,.55],vRange:[.75,.92]},full:{sRange:[.75,1],vRange:[.75,1]},dark:{sRange:[.6,.9],vRange:[.3,.55]},deep:{sRange:[.85,1],vRange:[.45,.65]},muted:{sRange:[.15,.35],vRange:[.5,.7]},earth:{sRange:[.3,.6],vRange:[.4,.65]}};function Kt(e,t){const n=Ja[t];return e.map(i=>{const r=(n.sRange[0]+n.sRange[1])/2,s=(n.vRange[0]+n.vRange[1])/2;return Ue({h:i,s:r,v:s})})}function wc(){return Math.floor(Math.random()*360)}function ei(e,t,n){const i=wc(),r=Et(i,e,n),s=[];for(let l=0;l<t;l++){const c=r[l%r.length],d=.55+Math.random()*.4,u=.5+Math.random()*.45;s.push(Ue({h:c+(Math.random()-.5)*8,s:d,v:u}))}return s}const kc=({hues:e,baseHue:t,onBaseHueChange:n,mode:i,distance:r,disabled:s})=>{const l=o.useCallback(f=>{if(s)return;const p=f.currentTarget.getBoundingClientRect(),m=f.clientX-p.left-120,w=f.clientY-p.top-120,k=(Math.atan2(w,m)*180/Math.PI+360)%360;n(Math.round(k))},[120,120,s,n]),c=[];for(let f=0;f<360;f+=2){const p=(f-1)*Math.PI/180,m=(f+1)*Math.PI/180,w=Ue({h:f,s:1,v:1});c.push(a.jsx("path",{d:`M${120+55*Math.cos(p)},${120+55*Math.sin(p)} L${120+110*Math.cos(p)},${120+110*Math.sin(p)} A110,110 0 0,1 ${120+110*Math.cos(m)},${120+110*Math.sin(m)} L${120+55*Math.cos(m)},${120+55*Math.sin(m)} A55,55 0 0,0 ${120+55*Math.cos(p)},${120+55*Math.sin(p)} Z`,fill:w},f))}const d=`wheel-center-${i}`,u=e.map((f,p)=>{const m=f*Math.PI/180;return a.jsx("circle",{cx:120+82.5*Math.cos(m),cy:120+82.5*Math.sin(m),r:p===0?8:6,fill:Ue({h:f,s:.85,v:.9}),stroke:p===0?"#fff":"#ccc",strokeWidth:p===0?3:2},p)});let y=null;if(i==="analogous"||i==="split-complementary"){const f=jn(i,r).slice(1).map((p,m)=>{const w=(t+p)*Math.PI/180;return a.jsx("line",{x1:120,y1:120,x2:120+82.5*Math.cos(w),y2:120+82.5*Math.sin(w),stroke:"rgba(255,255,255,0.3)",strokeWidth:1,strokeDasharray:"3,3"},`dline-${m}`)});y=a.jsx(a.Fragment,{children:f})}return a.jsxs("svg",{className:"nice-palette__wheel",viewBox:"0 0 240 240",width:240,height:240,onClick:l,style:{cursor:s?"default":"crosshair"},children:[a.jsx("defs",{children:a.jsxs("radialGradient",{id:d,children:[a.jsx("stop",{offset:"0%",stopColor:"#fff"}),a.jsx("stop",{offset:"100%",stopColor:"transparent"})]})}),c,a.jsx("circle",{cx:120,cy:120,r:53,fill:Ue({h:t,s:.6,v:.85})}),a.jsx("circle",{cx:120,cy:120,r:53,fill:`url(#${d})`,opacity:.4}),y,u]})},Sc=({colors:e})=>{if(e.length<2)return null;const t=[];for(let n=0;n<e.length;n++){const i=Wt(e[n],"#ffffff"),r=Wt(e[n],"#000000");t.push({a:e[n],b:"#ffffff",ratio:i,level:Vt(i)}),t.push({a:e[n],b:"#000000",ratio:r,level:Vt(r)});for(let s=n+1;s<e.length;s++){const l=Wt(e[n],e[s]);t.push({a:e[n],b:e[s],ratio:l,level:Vt(l)})}}return a.jsxs("div",{className:"nice-palette__contrast",children:[a.jsx("div",{className:"nice-palette__section-title",children:"Contrast Analysis (WCAG 2.1)"}),a.jsx("div",{className:"nice-palette__contrast-grid",children:t.map((n,i)=>a.jsxs("div",{className:"nice-palette__contrast-pair",children:[a.jsxs("div",{className:"nice-palette__contrast-swatches",children:[a.jsx("span",{className:"nice-palette__contrast-dot",style:{background:n.a}}),a.jsx("span",{className:"nice-palette__contrast-vs",children:"vs"}),a.jsx("span",{className:"nice-palette__contrast-dot",style:{background:n.b}})]}),a.jsxs("span",{className:"nice-palette__contrast-ratio",children:[n.ratio.toFixed(1),":1"]}),a.jsx("span",{className:`nice-palette__contrast-level nice-palette__contrast-level--${n.level.toLowerCase().replace("-","")}`,children:n.level})]},i))})]})},Cc=({hex:e})=>{const t=zt(e),n=Ga(t),i=_n(t);return a.jsxs("div",{className:"nice-palette__color-info",children:[a.jsxs("div",{children:[a.jsx("strong",{children:"HEX"})," ",e.toUpperCase()]}),a.jsxs("div",{children:[a.jsx("strong",{children:"RGB"})," ",t.r,", ",t.g,", ",t.b]}),a.jsxs("div",{children:[a.jsx("strong",{children:"HSL"})," ",Math.round(n.h),"°, ",Math.round(n.s*100),"%, ",Math.round(n.l*100),"%"]}),a.jsxs("div",{children:[a.jsx("strong",{children:"HSV"})," ",Math.round(i.h),"°, ",Math.round(i.s*100),"%, ",Math.round(i.v*100),"%"]})]})},ua={monochromatic:"Monochromatic",complementary:"Complementary","split-complementary":"Split-Complementary",analogous:"Analogous",triadic:"Triadic",tetradic:"Tetradic (Rectangle)",square:"Square"},_c={"lightest-pastel":"Lightest Pastel","bright-pastel":"Bright Pastel",shiny:"Shiny",pastel:"Pastel",full:"Full Colors",dark:"Dark",deep:"Deep Colors",muted:"Muted",earth:"Earth Tones"},jc=["monochromatic","complementary","split-complementary","analogous","triadic","tetradic","square"],Nc=["lightest-pastel","bright-pastel","shiny","pastel","full","dark","deep","muted","earth"],Nn=o.forwardRef(({id:e,className:t,style:n,accessMode:i,value:r,onChange:s,minColors:l=1,maxColors:c=8,harmonyMode:d,onHarmonyModeChange:u,distance:y,onDistanceChange:f,preset:p,onPresetChange:m,showWheel:w=!0,showContrast:k=!0,showInfo:z=!0,showPresets:$=!0,showVariations:g=!0,showRandom:v=!0,variationCount:N=5,label:j,disabled:I},D)=>{const b=Ee(i,e);if(b==="hidden")return null;(b==="disabled"||b==="readOnly")&&(I=!0);const T=we(e),[R,L]=o.useState("analogous"),[M,S]=o.useState(30),[x,P]=o.useState(""),[A,E]=o.useState(0),h=d??R,C=y??M,_=p??x,F=o.useCallback(G=>{L(G),u==null||u(G)},[u]),O=o.useCallback(G=>{S(G),f==null||f(G)},[f]),H=o.useCallback(G=>{P(G),G&&(m==null||m(G))},[m]),V=o.useMemo(()=>["#3b82f6","#ef4444","#22c55e"],[]),U=r&&r.length>0?r:V,B=U[0],W=o.useMemo(()=>_t(B),[B]),Q=o.useMemo(()=>Et(W.h,h,C),[W.h,h,C]),Z=o.useCallback((G,ee,ce,ge)=>{const de=Et(G,ee,ce);let ie;for(ge&&Ja[ge]?ie=Kt(de,ge):ie=de.map(be=>Ue({h:be,s:W.s||.7,v:W.v||.85}));ie.length<l;)ie.push(ie[ie.length-1]||"#888888");ie.length>c&&(ie=ie.slice(0,c)),s==null||s(ie)},[W.s,W.v,l,c,s]),X=o.useCallback(G=>{I||Z(G,h,C,_)},[I,h,C,_,Z]),oe=o.useCallback(G=>{I||(F(G),Z(W.h,G,C,_))},[I,W.h,C,_,F,Z]),re=o.useCallback(G=>{I||(O(G),Z(W.h,h,G,_))},[I,W.h,h,_,O,Z]),he=o.useCallback(G=>{if(I)return;H(G);const ee=Et(W.h,h,C),ce=Kt(ee,G);s==null||s(ce.slice(0,c))},[I,W.h,h,C,c,H,s]),J=o.useCallback((G,ee)=>{if(I)return;const ce=[...U];ce[G]=ee,s==null||s(ce)},[I,U,s]),le=o.useCallback(()=>{if(I||U.length>=c)return;const G=_t(U[U.length-1]),ee=Ue({h:(G.h+30)%360,s:G.s,v:G.v});s==null||s([...U,ee])},[I,U,c,s]),pe=o.useCallback(G=>{if(I||U.length<=l)return;const ee=U.filter((ce,ge)=>ge!==G);s==null||s(ee),A>=ee.length&&E(Math.max(0,ee.length-1))},[I,U,l,s,A]),me=o.useCallback(()=>{if(I)return;const G=Math.max(l,Math.min(c,jn(h).length)),ee=ei(h,G,C);s==null||s(ee)},[I,l,c,h,C,s]),ve=o.useMemo(()=>{if(!g)return[];const G=U[A]||U[0];return Xa(_t(G),N)},[g,U,A,N]),K=U[A]||U[0],Y=o.useMemo(()=>{const G=_t(K);return Ue({h:(G.h+180)%360,s:G.s,v:G.v})},[K]);return a.jsxs("div",{ref:D,id:T,className:`nice-palette ${I?"nice-palette--disabled":""} ${t||""}`,style:n,children:[j&&a.jsx("div",{className:"nice-palette__label",children:j}),a.jsx("div",{className:"nice-palette__modes",children:jc.map(G=>a.jsx("button",{type:"button",className:`nice-palette__mode-btn ${h===G?"nice-palette__mode-btn--active":""}`,onClick:()=>oe(G),disabled:I,title:ua[G],children:ua[G]},G))}),a.jsxs("div",{className:"nice-palette__main",children:[w&&a.jsxs("div",{className:"nice-palette__wheel-container",children:[a.jsx(kc,{hues:Q,baseHue:W.h,onBaseHueChange:X,mode:h,distance:C,disabled:I}),(h==="analogous"||h==="split-complementary")&&a.jsxs("div",{className:"nice-palette__distance",children:[a.jsxs("label",{children:["Distance: ",C,"°"]}),a.jsx("input",{type:"range",min:10,max:90,value:C,onChange:G=>re(Number(G.target.value)),disabled:I,className:"nice-palette__distance-slider"})]})]}),a.jsxs("div",{className:"nice-palette__strips",children:[a.jsxs("div",{className:"nice-palette__swatches",children:[U.map((G,ee)=>a.jsxs("div",{className:`nice-palette__swatch-wrapper ${A===ee?"nice-palette__swatch-wrapper--selected":""}`,onClick:()=>E(ee),children:[a.jsx("div",{className:"nice-palette__swatch",style:{background:G},children:U.length>l&&a.jsx("button",{type:"button",className:"nice-palette__swatch-remove",onClick:ce=>{ce.stopPropagation(),pe(ee)},disabled:I,"aria-label":"Remove color",children:"×"})}),a.jsx("input",{type:"text",className:"nice-palette__hex-input",value:G.toUpperCase(),maxLength:7,disabled:I,onChange:ce=>J(ee,ce.target.value)})]},ee)),U.length<c&&a.jsx("button",{type:"button",className:"nice-palette__add-btn",onClick:le,disabled:I,title:"Add color",children:"+"})]}),a.jsxs("div",{className:"nice-palette__complementary",children:[a.jsx("span",{className:"nice-palette__section-tag",children:"Complementary"}),a.jsx("div",{className:"nice-palette__swatch nice-palette__swatch--sm",style:{background:Y},title:Y.toUpperCase()}),a.jsx("span",{className:"nice-palette__hex-label",children:Y.toUpperCase()})]}),g&&ve.length>0&&a.jsxs("div",{className:"nice-palette__variations",children:[a.jsx("span",{className:"nice-palette__section-tag",children:"Tints & Shades"}),a.jsx("div",{className:"nice-palette__variation-strip",children:ve.map((G,ee)=>a.jsx("div",{className:"nice-palette__variation-chip",style:{background:G},title:G.toUpperCase(),onClick:()=>{I||J(A,G)},role:"button",tabIndex:0},ee))})]}),v&&a.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm nice-palette__random-btn",onClick:me,disabled:I,title:"Random palette","aria-label":"Random palette",children:"🎲 Random Palette"})]})]}),$&&a.jsxs("div",{className:"nice-palette__presets",children:[a.jsx("div",{className:"nice-palette__section-title",children:"Style Presets"}),a.jsx("div",{className:"nice-palette__preset-grid",children:Nc.map(G=>{const ee=Kt(Q,G);return a.jsxs("button",{type:"button",className:`nice-palette__preset-card ${_===G?"nice-palette__preset-card--active":""}`,onClick:()=>he(G),disabled:I,children:[a.jsx("div",{className:"nice-palette__preset-strip",children:ee.map((ce,ge)=>a.jsx("span",{className:"nice-palette__preset-dot",style:{background:ce}},ge))}),a.jsx("span",{className:"nice-palette__preset-label",children:_c[G]})]},G)})})]}),z&&a.jsxs("div",{className:"nice-palette__info-panel",children:[a.jsx("div",{className:"nice-palette__section-title",children:"Selected Color Info"}),a.jsx(Cc,{hex:K})]}),k&&a.jsx(Sc,{colors:U})]})});Nn.displayName="NiceColorPalette";function dn(){return{type:"linear",angle:90,stops:[{color:"#3b82f6",position:0},{color:"#8b5cf6",position:100}]}}function un(e){const t=e.stops.slice().sort((i,r)=>i.position-r.position).map(i=>`${i.color} ${i.position}%`).join(", "),n=e.repeating?"repeating-":"";switch(e.type){case"linear":return`${n}linear-gradient(${e.angle}deg, ${t})`;case"radial":{const i=e.shape||"ellipse",r=e.size||"farthest-corner",s=e.positionX??50,l=e.positionY??50;return`${n}radial-gradient(${i} ${r} at ${s}% ${l}%, ${t})`}case"conic":{const i=e.angle??0,r=e.positionX??50,s=e.positionY??50;return`${n}conic-gradient(from ${i}deg at ${r}% ${s}%, ${t})`}}}function ti(e){var i,r,s;const t=e.trim(),n=t.startsWith("repeating-");if(t.includes("linear-gradient")){const l=(i=t.match(/linear-gradient\((.+)\)/))==null?void 0:i[1];if(!l)return null;const c=l.split(",").map(p=>p.trim());let d=90,u=0;const y=c[0].match(/^(\d+)deg$/);y&&(d=parseInt(y[1]),u=1);const f=nn(c.slice(u));return{type:"linear",angle:d,repeating:n,stops:f}}if(t.includes("radial-gradient")){const l=(r=t.match(/radial-gradient\((.+)\)/))==null?void 0:r[1];if(!l)return null;const c=l.split(",").map(u=>u.trim()),d=nn(c.filter(u=>u.includes("#")||u.includes("rgb")));return{type:"radial",angle:0,repeating:n,stops:d.length>=2?d:dn().stops}}if(t.includes("conic-gradient")){const l=(s=t.match(/conic-gradient\((.+)\)/))==null?void 0:s[1];if(!l)return null;const c=l.split(",").map(u=>u.trim()),d=nn(c.filter(u=>u.includes("#")||u.includes("rgb")));return{type:"conic",angle:0,repeating:n,stops:d.length>=2?d:dn().stops}}return null}function nn(e){return e.map((t,n,i)=>{const r=t.match(/^(#[0-9a-fA-F]{3,8}|rgba?\([^)]+\))\s*(\d+%?)?$/);if(r){const s=r[2]?parseFloat(r[2]):n/Math.max(1,i.length-1)*100;return{color:r[1],position:s}}return{color:t,position:n/Math.max(1,i.length-1)*100}})}function Ec(){return"#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}function Mc(e=2){const t=["linear","radial","conic"],n=t[Math.floor(Math.random()*t.length)],i=[];for(let r=0;r<e;r++)i.push({color:Ec(),position:Math.round(r/(e-1)*100)});return{type:n,angle:Math.floor(Math.random()*360),stops:i,shape:n==="radial"?Math.random()>.5?"circle":"ellipse":void 0,positionX:n!=="linear"?Math.round(Math.random()*100):void 0,positionY:n!=="linear"?Math.round(Math.random()*100):void 0}}const ni=[{name:"Sunset",value:{type:"linear",angle:135,stops:[{color:"#ff6b6b",position:0},{color:"#feca57",position:100}]}},{name:"Ocean",value:{type:"linear",angle:180,stops:[{color:"#667eea",position:0},{color:"#764ba2",position:100}]}},{name:"Forest",value:{type:"linear",angle:120,stops:[{color:"#11998e",position:0},{color:"#38ef7d",position:100}]}},{name:"Fire",value:{type:"linear",angle:90,stops:[{color:"#f12711",position:0},{color:"#f5af19",position:100}]}},{name:"Aurora",value:{type:"linear",angle:135,stops:[{color:"#a18cd1",position:0},{color:"#fbc2eb",position:50},{color:"#a6c1ee",position:100}]}},{name:"Midnight",value:{type:"linear",angle:180,stops:[{color:"#0f0c29",position:0},{color:"#302b63",position:50},{color:"#24243e",position:100}]}},{name:"Candy",value:{type:"linear",angle:45,stops:[{color:"#fc5c7d",position:0},{color:"#6a82fb",position:100}]}},{name:"Radial Glow",value:{type:"radial",angle:0,shape:"circle",stops:[{color:"#ffecd2",position:0},{color:"#fcb69f",position:100}],positionX:50,positionY:50}},{name:"Rainbow",value:{type:"conic",angle:0,stops:[{color:"#ff0000",position:0},{color:"#ff8800",position:17},{color:"#ffff00",position:33},{color:"#00ff00",position:50},{color:"#0088ff",position:67},{color:"#8800ff",position:83},{color:"#ff0000",position:100}],positionX:50,positionY:50}}],En=o.forwardRef(({id:e,className:t,style:n,accessMode:i,value:r,onChange:s,showCssOutput:l=!0,showPresets:c=!0,showRandom:d=!0,maxStops:u=10,label:y,disabled:f},p)=>{const m=Ee(i,e);if(m==="hidden")return null;(m==="disabled"||m==="readOnly")&&(f=!0);const w=we(e),k=r??dn(),z=o.useMemo(()=>un(k),[k]),[$,g]=o.useState(0),[v,N]=o.useState(""),j=o.useRef(null),I=o.useCallback(h=>{s==null||s(h)},[s]),D=o.useCallback(h=>{f||I({...k,type:h})},[f,k,I]),b=o.useCallback(h=>{f||I({...k,angle:h})},[f,k,I]),T=o.useCallback(h=>{f||I({...k,repeating:h})},[f,k,I]),R=o.useCallback(h=>{f||I({...k,shape:h})},[f,k,I]),L=o.useCallback((h,C)=>{if(f)return;const _=k.stops.map((F,O)=>O===h?{...F,...C}:F);I({...k,stops:_})},[f,k,I]),M=o.useCallback(()=>{if(f||k.stops.length>=u)return;const h=k.stops.slice().sort((H,V)=>H.position-V.position);let C=0,_=h[0];for(let H=0;H<h.length-1;H++){const V=h[H+1].position-h[H].position;V>C&&(C=V,_=h[H])}const F=Math.round(_.position+C/2),O="#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0");I({...k,stops:[...k.stops,{color:O,position:F}]})},[f,k,u,I]),S=o.useCallback(h=>{if(f||k.stops.length<=2)return;const C=k.stops.filter((_,F)=>F!==h);I({...k,stops:C}),$>=C.length&&g(C.length-1)},[f,k,$,I]),x=o.useCallback(()=>{if(f)return;const h=2+Math.floor(Math.random()*3);I(Mc(h))},[f,I]),P=o.useCallback(()=>{if(f||!v.trim())return;const h=ti(v);h&&I(h)},[f,v,I]),A=o.useCallback(h=>{if(f||!j.current||k.stops.length>=u)return;const C=j.current.getBoundingClientRect(),_=Math.round((h.clientX-C.left)/C.width*100),F="#"+Math.floor(Math.random()*16777215).toString(16).padStart(6,"0"),O=[...k.stops,{color:F,position:_}];I({...k,stops:O}),g(O.length-1)},[f,k,u,I]),E=o.useMemo(()=>k.stops.slice().sort((h,C)=>h.position-C.position),[k.stops]);return a.jsxs("div",{ref:p,id:w,className:`nice-gradient ${f?"nice-gradient--disabled":""} ${t||""}`,style:n,children:[y&&a.jsx("div",{className:"nice-gradient__label",children:y}),a.jsx("div",{className:"nice-gradient__preview",style:{background:z}}),a.jsxs("div",{className:"nice-gradient__type-row",children:[["linear","radial","conic"].map(h=>a.jsx("button",{type:"button",className:`nice-gradient__type-btn ${k.type===h?"nice-gradient__type-btn--active":""}`,onClick:()=>D(h),disabled:f,children:h.charAt(0).toUpperCase()+h.slice(1)},h)),a.jsxs("label",{className:"nice-gradient__repeat-label",children:[a.jsx("input",{type:"checkbox",checked:k.repeating??!1,onChange:h=>T(h.target.checked),disabled:f}),"Repeating"]})]}),a.jsxs("div",{className:"nice-gradient__controls",children:[k.type==="linear"&&a.jsxs("div",{className:"nice-gradient__control-group",children:[a.jsxs("label",{children:["Angle: ",k.angle,"°"]}),a.jsx("input",{type:"range",min:0,max:360,value:k.angle,onChange:h=>b(Number(h.target.value)),disabled:f,className:"nice-gradient__slider"}),a.jsx("div",{className:"nice-gradient__angle-presets",children:[0,45,90,135,180,225,270,315].map(h=>a.jsx("button",{type:"button",className:`nice-gradient__angle-btn ${k.angle===h?"nice-gradient__angle-btn--active":""}`,onClick:()=>b(h),disabled:f,title:`${h}°`,children:a.jsx("span",{style:{transform:`rotate(${h}deg)`,display:"inline-block"},children:"→"})},h))})]}),k.type==="radial"&&a.jsxs("div",{className:"nice-gradient__control-group",children:[a.jsx("label",{children:"Shape:"}),a.jsx("div",{className:"nice-gradient__shape-btns",children:["circle","ellipse"].map(h=>a.jsx("button",{type:"button",className:`nice-gradient__shape-btn ${(k.shape||"ellipse")===h?"nice-gradient__shape-btn--active":""}`,onClick:()=>R(h),disabled:f,children:h},h))})]}),(k.type==="radial"||k.type==="conic")&&a.jsxs("div",{className:"nice-gradient__control-group",children:[a.jsxs("label",{children:["Center: ",k.positionX??50,"%, ",k.positionY??50,"%"]}),a.jsxs("div",{className:"nice-gradient__center-inputs",children:[a.jsx("input",{type:"range",min:0,max:100,value:k.positionX??50,onChange:h=>I({...k,positionX:Number(h.target.value)}),disabled:f,className:"nice-gradient__slider"}),a.jsx("input",{type:"range",min:0,max:100,value:k.positionY??50,onChange:h=>I({...k,positionY:Number(h.target.value)}),disabled:f,className:"nice-gradient__slider"})]})]}),k.type==="conic"&&a.jsxs("div",{className:"nice-gradient__control-group",children:[a.jsxs("label",{children:["Start angle: ",k.angle,"°"]}),a.jsx("input",{type:"range",min:0,max:360,value:k.angle,onChange:h=>b(Number(h.target.value)),disabled:f,className:"nice-gradient__slider"})]})]}),a.jsxs("div",{className:"nice-gradient__bar-container",children:[a.jsx("div",{ref:j,className:"nice-gradient__bar",style:{background:z},onClick:A,children:k.stops.map((h,C)=>a.jsx("div",{className:`nice-gradient__stop-marker ${$===C?"nice-gradient__stop-marker--active":""}`,style:{left:`${h.position}%`},onClick:_=>{_.stopPropagation(),g(C)},title:`${h.color} @ ${h.position}%`,children:a.jsx("div",{className:"nice-gradient__stop-dot",style:{background:h.color}})},C))}),a.jsx("button",{type:"button",className:"nice-gradient__add-stop",onClick:M,disabled:f||k.stops.length>=u,title:"Add stop",children:"+"})]}),a.jsx("div",{className:"nice-gradient__stop-editor",children:a.jsx("div",{className:"nice-gradient__stop-list",children:E.map((h,C)=>{const _=k.stops.indexOf(h);return a.jsxs("div",{className:`nice-gradient__stop-row ${$===_?"nice-gradient__stop-row--active":""}`,onClick:()=>g(_),children:[a.jsx("input",{type:"color",value:h.color,onChange:F=>L(_,{color:F.target.value}),disabled:f,className:"nice-gradient__stop-color"}),a.jsx("input",{type:"text",value:h.color.toUpperCase(),maxLength:7,onChange:F=>L(_,{color:F.target.value}),disabled:f,className:"nice-gradient__stop-hex"}),a.jsx("input",{type:"number",min:0,max:100,value:h.position,onChange:F=>L(_,{position:Number(F.target.value)}),disabled:f,className:"nice-gradient__stop-pos"}),a.jsx("span",{className:"nice-gradient__stop-pct",children:"%"}),k.stops.length>2&&a.jsx("button",{type:"button",className:"nice-gradient__stop-del",onClick:()=>S(_),disabled:f,"aria-label":"Remove stop",children:"×"})]},_)})})}),d&&a.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm nice-gradient__random-btn",onClick:x,disabled:f,title:"Random gradient","aria-label":"Random gradient",children:"🎲 Random Gradient"}),c&&a.jsxs("div",{className:"nice-gradient__presets",children:[a.jsx("div",{className:"nice-gradient__section-title",children:"Presets"}),a.jsx("div",{className:"nice-gradient__preset-grid",children:ni.map((h,C)=>a.jsxs("button",{type:"button",className:"nice-gradient__preset-card",onClick:()=>{f||I(h.value)},disabled:f,title:h.name,children:[a.jsx("div",{className:"nice-gradient__preset-preview",style:{background:un(h.value)}}),a.jsx("span",{className:"nice-gradient__preset-name",children:h.name})]},C))})]}),l&&a.jsxs("div",{className:"nice-gradient__css",children:[a.jsx("div",{className:"nice-gradient__section-title",children:"CSS Output"}),a.jsxs("div",{className:"nice-gradient__css-output",children:[a.jsx("code",{children:`background: ${z};`}),a.jsx("button",{type:"button",className:"nice-gradient__copy-btn",onClick:()=>{var h;return(h=navigator.clipboard)==null?void 0:h.writeText(`background: ${z};`)},title:"Copy CSS",children:"📋"})]}),a.jsxs("div",{className:"nice-gradient__css-import",children:[a.jsx("input",{type:"text",className:"nice-gradient__css-input",placeholder:"Paste CSS gradient to import...",value:v,onChange:h=>N(h.target.value),disabled:f}),a.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm",onClick:P,disabled:f,children:"Import"})]})]})]})});En.displayName="NiceGradientPicker";function zc({text:e,query:t}){if(!t)return a.jsx(a.Fragment,{children:e});const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?a.jsx(a.Fragment,{children:e}):a.jsxs(a.Fragment,{children:[e.slice(0,n),a.jsx("strong",{children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}const ai=({options:e,value:t,onChange:n,minSearchLength:i=1,maxResults:r=10,onSearch:s,clearable:l,loading:c,multiple:d,renderOption:u,highlightMatch:y=!0,label:f,error:p,helperText:m,required:w,disabled:k,size:z="md",id:$,className:g,style:v,accessMode:N,showKeyboardHints:j,displayStyle:I})=>{Ye("input",I),Be("input",I);const D=Ee(N,$);if(D==="hidden")return null;(D==="disabled"||D==="readOnly")&&(k=!0);const b=we($),{t:T}=ke(),R=o.useMemo(()=>d?Array.isArray(t)?t:t?[t]:[]:[],[t,d]),[L,M]=o.useState(d||Array.isArray(t)?"":t),[S,x]=o.useState(!1),[P,A]=o.useState(-1),E=o.useRef(null),h=o.useRef(null);at(E,()=>x(!1));const C=o.useMemo(()=>{const B=[$e.moveDown,$e.moveUp,$e.submit,$e.cancel];return d&&B.push({key:"Backspace",description:T("shortcuts.removeLastTag","Remove last tag")}),B},[d,T]);o.useEffect(()=>{d||M(Array.isArray(t)?"":t)},[t,d]);const _=o.useMemo(()=>{if(L.length<i)return[];if(s)return e.slice(0,r);const B=L.toLowerCase();return e.filter(W=>W.label.toLowerCase().includes(B)).slice(0,r)},[e,L,i,r,s]),F=o.useMemo(()=>{const B=new Map;for(const W of _){const Q=W.group||"";B.has(Q)||B.set(Q,[]),B.get(Q).push(W)}return B},[_]),O=o.useCallback(B=>{M(B),x(B.length>=i),A(-1),s==null||s(B)},[i,s]),H=o.useCallback(B=>{if(d){const W=String(B.value),Q=R.includes(W)?R.filter(Z=>Z!==W):[...R,W];n==null||n(Q),M("")}else M(B.label),n==null||n(String(B.value)),x(!1)},[n,d,R]),V=B=>{if(d&&B.key==="Backspace"&&!L&&R.length>0){n==null||n(R.slice(0,-1));return}S&&(B.key==="ArrowDown"?(B.preventDefault(),A(W=>Math.min(W+1,_.length-1))):B.key==="ArrowUp"?(B.preventDefault(),A(W=>Math.max(W-1,0))):B.key==="Enter"&&P>=0?(B.preventDefault(),H(_[P])):B.key==="Escape"&&x(!1))},U=o.useCallback(B=>{n==null||n(R.filter(W=>W!==B))},[R,n]);return a.jsxs("div",{className:`nice-field nice-field--${z} ${p?"nice-field--error":""} ${g||""}`,style:v,ref:E,children:[f&&a.jsxs("label",{className:"nice-field__label",htmlFor:b,children:[f,w&&a.jsx("span",{className:"nice-field__required",children:"*"}),j&&a.jsx(Oe,{shortcuts:C,size:"sm"})]}),a.jsxs("div",{className:"nice-field__input-wrap",style:d?{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center"}:void 0,children:[d&&R.map(B=>{const W=e.find(Q=>String(Q.value)===B);return a.jsxs("span",{className:"nice-autocomplete__tag",children:[(W==null?void 0:W.label)||B,a.jsx("button",{type:"button",className:"nice-autocomplete__tag-remove",onClick:()=>U(B),children:"✕"})]},B)}),a.jsx("input",{ref:h,id:b,type:"text",className:"nice-input",value:L,onChange:B=>O(B.target.value),onFocus:()=>L.length>=i&&x(!0),onKeyDown:V,disabled:k,required:w,role:"combobox","aria-expanded":S,"aria-autocomplete":"list",autoComplete:"off",style:d?{flex:1,minWidth:60,border:"none",outline:"none"}:void 0}),l&&!d&&L&&!k&&a.jsx("button",{type:"button",className:"nice-field__clear",onClick:()=>{M(""),n==null||n("")},"aria-label":T("controls.clear","Clear"),children:"✕"}),c&&a.jsx("div",{className:"nice-spinner nice-spinner--sm",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)"}})]}),S&&_.length>0&&a.jsx("ul",{className:"nice-dropdown__list",role:"listbox",children:Array.from(F.entries()).map(([B,W])=>a.jsxs(o.Fragment,{children:[B&&a.jsx("li",{className:"nice-dropdown__group-label",children:B}),W.map(Q=>{const Z=_.indexOf(Q)===P,X=d&&R.includes(String(Q.value));return a.jsx("li",{role:"option",className:`nice-dropdown__option ${Z?"nice-dropdown__option--active":""} ${X?"nice-dropdown__option--selected":""}`,onMouseDown:oe=>{oe.preventDefault(),H(Q)},"aria-selected":Z,children:u?u(Q,L):y?a.jsx(zc,{text:Q.label,query:L}):Q.label},String(Q.value))})]},B))}),p&&a.jsx("div",{className:"nice-field__error",children:p}),m&&!p&&a.jsx("div",{className:"nice-field__hint",children:m})]})},ii=({options:e,value:t,onChange:n,searchable:i=!0,clearable:r,loading:s,placeholder:l,label:c,error:d,helperText:u,required:y,disabled:f,size:p="md",id:m,className:w,style:k})=>{const z=we(m),{t:$}=ke(),[g,v]=o.useState(!1),[N,j]=o.useState(""),I=o.useRef(null);at(I,()=>v(!1));const D=e.find(T=>String(T.value)===t),b=o.useMemo(()=>{if(!N)return e;const T=N.toLowerCase();return e.filter(R=>R.label.toLowerCase().includes(T))},[e,N]);return a.jsxs("div",{className:`nice-field nice-field--${p} ${d?"nice-field--error":""} ${w||""}`,style:k,ref:I,children:[c&&a.jsxs("label",{className:"nice-field__label",htmlFor:z,children:[c,y&&a.jsx("span",{className:"nice-field__required",children:"*"})]}),a.jsxs("div",{className:"nice-field__input-wrap",children:[a.jsxs("button",{type:"button",id:z,className:"nice-select__trigger",onClick:()=>!f&&v(!g),disabled:f,children:[a.jsx("span",{children:(D==null?void 0:D.label)||l||$("controls.select","Select...")}),a.jsx("span",{className:"nice-select__arrow",children:"▾"})]}),r&&t&&!f&&a.jsx("button",{type:"button",className:"nice-field__clear",onClick:()=>n(""),"aria-label":$("controls.clear","Clear"),children:"✕"})]}),g&&a.jsxs("div",{className:"nice-dropdown",children:[i&&a.jsx("div",{className:"nice-dropdown__search",children:a.jsx("input",{type:"text",value:N,onChange:T=>j(T.target.value),placeholder:$("controls.search","Search..."),autoFocus:!0})}),a.jsx("ul",{className:"nice-dropdown__list",role:"listbox",children:b.length===0?a.jsx("li",{className:"nice-dropdown__empty",children:$("controls.noResults","No results")}):b.map(T=>a.jsx("li",{role:"option",className:`nice-dropdown__option ${String(T.value)===t?"nice-dropdown__option--selected":""}`,onClick:()=>{n(String(T.value)),v(!1),j("")},"aria-selected":String(T.value)===t,children:T.label},String(T.value)))})]}),d&&a.jsx("div",{className:"nice-field__error",children:d}),u&&!d&&a.jsx("div",{className:"nice-field__hint",children:u})]})},$c=["Su","Mo","Tu","We","Th","Fr","Sa"];function Ac(e,t){return new Date(e,t+1,0).getDate()}function Fc(e,t){return new Date(e,t,1).getDay()}function pa(e,t,n){return`${e}-${String(t+1).padStart(2,"0")}-${String(n).padStart(2,"0")}`}function Ic(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()));t.setUTCDate(t.getUTCDate()+4-(t.getUTCDay()||7));const n=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t.getTime()-n.getTime())/864e5+1)/7)}const ma=["January","February","March","April","May","June","July","August","September","October","November","December"],en=({value:e,onChange:t,min:n,max:i,disabledDates:r=[],firstDayOfWeek:s=1,size:l="md",showWeekNumbers:c,onMonthChange:d,className:u,style:y,accessMode:f,id:p,multiple:m,selectedDates:w=[],onSelectedDatesChange:k,renderDay:z,showKeyboardHints:$,persistPreferences:g=!1,cookies:v=!1,localStorage:N=!0,sessionStorage:j=!1,storageMode:I,storageKey:D})=>{const b=Ee(f,p);if(b==="hidden")return null;const T=b==="disabled"||b==="readOnly",{t:R}=ke(),L=new Date,M=e?new Date(e):L,S=Pa(D??"nice-calendar"),x=o.useMemo(()=>g?S.get("prefs")??{}:{},[g,S]),P=x.firstDayOfWeek??s,[A,E]=o.useState(x.lastViewYear??M.getFullYear()),[h,C]=o.useState(x.lastViewMonth??M.getMonth()),[_,F]=o.useState(x.preferredView??"days"),O=o.useCallback(ee=>{if(!g)return;const ce=S.get("prefs")??{};S.set("prefs",{...ce,...ee})},[g,S]),H=o.useCallback(ee=>{F(ee),O({preferredView:ee})},[O]),V=o.useCallback((ee,ce)=>{O({lastViewYear:ee,lastViewMonth:ce})},[O]),U=o.useMemo(()=>[$e.moveUp,$e.moveDown,$e.moveLeft,$e.moveRight,{key:"Enter",description:R("shortcuts.selectDate","Select date")},$e.pageUp,$e.pageDown],[R]),B=o.useMemo(()=>Ac(A,h),[A,h]),W=o.useMemo(()=>(Fc(A,h)-P+7)%7,[A,h,P]),Q=o.useMemo(()=>{const ee=[...$c];for(let ce=0;ce<P;ce++)ee.push(ee.shift());return ee},[P]),Z=o.useCallback(ee=>n&&ee<n||i&&ee>i?!0:r.includes(ee),[n,i,r]),X=o.useCallback(ee=>{if(_==="years"){E(de=>de+ee*10);return}if(_==="months"){E(de=>de+ee);return}let ce=h+ee,ge=A;ce<0&&(ce=11,ge--),ce>11&&(ce=0,ge++),C(ce),E(ge),V(ge,ce),d==null||d(ge,ce)},[h,A,d,_,V]),oe=pa(L.getFullYear(),L.getMonth(),L.getDate()),re=o.useCallback(ee=>m?w.includes(ee):ee===e,[m,w,e]),he=o.useCallback(ee=>{if(!T){if(m){const ce=w.includes(ee)?w.filter(ge=>ge!==ee):[...w,ee];k==null||k(ce)}t==null||t(ee)}},[m,w,t,k]),J=o.useCallback(()=>{_==="days"?H("months"):_==="months"&&H("years")},[_,H]),le=o.useCallback(ee=>{C(ee),H("days"),V(A,ee),d==null||d(A,ee)},[A,d,H,V]),pe=o.useCallback(ee=>{E(ee),H("months")},[H]),me=_==="years"?`${A-A%10} – ${A-A%10+9}`:_==="months"?`${A}`:`${ma[h]} ${A}`,ve=_==="years"?"decade":_==="months"?"year":"month",K=[];for(let ee=0;ee<W;ee++)K.push(null);for(let ee=1;ee<=B;ee++)K.push(ee);for(;K.length%7!==0;)K.push(null);const Y=[];for(let ee=0;ee<K.length;ee+=7)Y.push(K.slice(ee,ee+7));const G=A-A%10;return a.jsxs("div",{className:`nice-calendar nice-calendar--${l} ${u||""}`,style:y,children:[a.jsxs("div",{className:"nice-calendar__header",children:[a.jsx("button",{type:"button",className:"nice-calendar__nav",onClick:()=>X(-1),"aria-label":`Previous ${ve}`,children:"‹"}),a.jsx("button",{type:"button",className:"nice-calendar__title",onClick:J,"aria-label":_==="days"?"Show month picker":_==="months"?"Show year picker":void 0,disabled:_==="years",children:me}),a.jsx("button",{type:"button",className:"nice-calendar__nav",onClick:()=>X(1),"aria-label":`Next ${ve}`,children:"›"}),$&&a.jsx(Oe,{shortcuts:U,size:"sm"})]}),_==="days"&&a.jsxs("table",{className:"nice-calendar__grid",role:"grid",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[c&&a.jsx("th",{className:"nice-calendar__wk",children:"W"}),Q.map(ee=>a.jsx("th",{children:ee},ee))]})}),a.jsx("tbody",{children:Y.map((ee,ce)=>a.jsxs("tr",{children:[c&&a.jsx("td",{className:"nice-calendar__wk",children:ee.find(ge=>ge!=null)?Ic(new Date(A,h,ee.find(ge=>ge!=null))):""}),ee.map((ge,de)=>{if(ge==null)return a.jsx("td",{className:"nice-calendar__empty-cell"},de);const ie=pa(A,h,ge),be=Z(ie),ye=re(ie);return a.jsx("td",{className:`nice-calendar__day${ye?" nice-calendar__day--selected":""}${ie===oe?" nice-calendar__day--today":""}${be?" nice-calendar__day--disabled":""}`,onClick:()=>!be&&he(ie),role:"gridcell","aria-selected":ye,"aria-disabled":be,children:z?z(ie,ge):ge},de)})]},ce))})]}),_==="months"&&a.jsx("div",{className:"nice-calendar__picker-grid",children:ma.map((ee,ce)=>a.jsx("button",{type:"button",className:`nice-calendar__picker-cell${ce===h&&A===M.getFullYear()?" nice-calendar__picker-cell--selected":""}`,onClick:()=>le(ce),children:ee.slice(0,3)},ce))}),_==="years"&&a.jsx("div",{className:"nice-calendar__picker-grid",children:Array.from({length:12},(ee,ce)=>G-1+ce).map(ee=>a.jsx("button",{type:"button",className:`nice-calendar__picker-cell${ee===A?" nice-calendar__picker-cell--selected":""}${ee<G||ee>G+9?" nice-calendar__picker-cell--other":""}`,onClick:()=>pe(ee),children:ee},ee))})]})};en.displayName="NiceCalendar";const ri=({startDate:e,endDate:t,onStartChange:n,onEndChange:i,min:r,max:s,clearable:l,placeholder:c,startPlaceholder:d,endPlaceholder:u,label:y,error:f,helperText:p,required:m,disabled:w,size:k="md",id:z,className:$,style:g,accessMode:v,showKeyboardHints:N})=>{const j=Ee(v,z);if(j==="hidden")return null;(j==="disabled"||j==="readOnly")&&(w=!0);const I=we(z),{t:D}=ke(),[b,T]=o.useState(null),R=o.useRef(null);at(R,()=>T(null));const L=o.useMemo(()=>[{key:"Tab",description:D("shortcuts.switchField","Switch between start/end")},$e.cancel],[D]),M=o.useCallback(x=>{n(x),(!t||x>t)&&i(x),T("end")},[n,i,t]),S=o.useCallback(x=>{i(x),T(null)},[i]);return a.jsxs("div",{className:`nice-field nice-field--${k} ${f?"nice-field--error":""} ${$||""}`,style:g,ref:R,children:[y&&a.jsxs("label",{className:"nice-field__label",htmlFor:I,children:[y,m&&a.jsx("span",{className:"nice-field__required",children:"*"}),N&&a.jsx(Oe,{shortcuts:L,size:"sm"})]}),a.jsxs("div",{className:"nice-daterange",children:[a.jsx("input",{id:I,type:"text",className:"nice-input nice-daterange__start",value:e,readOnly:!0,placeholder:d||D("controls.startDate","Start date"),onClick:()=>!w&&T("start"),disabled:w}),a.jsx("span",{className:"nice-daterange__separator",children:"–"}),a.jsx("input",{type:"text",className:"nice-input nice-daterange__end",value:t,readOnly:!0,placeholder:u||D("controls.endDate","End date"),onClick:()=>!w&&T("end"),disabled:w}),l&&(e||t)&&!w&&a.jsx("button",{type:"button",className:"nice-field__clear",onClick:()=>{n(""),i("")},"aria-label":D("controls.clear","Clear"),children:"✕"})]}),b&&a.jsx("div",{className:"nice-daterange__popup",children:a.jsx(en,{value:b==="start"?e:t,onChange:b==="start"?M:S,min:b==="end"&&e?e:r,max:s,size:k})}),f&&a.jsx("div",{className:"nice-field__error",children:f}),p&&!f&&a.jsx("div",{className:"nice-field__hint",children:p})]})},oi=({options:e,value:t,onChange:n,searchable:i=!0,clearable:r,maxTags:s,allowCustom:l,placeholder:c,label:d,error:u,helperText:y,required:f,disabled:p,size:m="md",id:w,className:k,style:z,accessMode:$,showKeyboardHints:g})=>{const v=Ee($,w);if(v==="hidden")return null;(v==="disabled"||v==="readOnly")&&(p=!0);const N=we(w),{t:j}=ke(),[I,D]=o.useState(!1),[b,T]=o.useState(""),R=o.useRef(null),L=o.useRef(null);at(R,()=>D(!1));const M=o.useMemo(()=>[$e.submit,$e.cancel,{key:"Backspace",description:j("shortcuts.removeLastTag","Remove last tag")}],[j]),S=o.useMemo(()=>{let h=e.filter(C=>!t.includes(String(C.value)));if(b){const C=b.toLowerCase();h=h.filter(_=>_.label.toLowerCase().includes(C))}return h},[e,t,b]),x=o.useCallback(h=>{s&&t.length>=s||(t.includes(h)||n([...t,h]),T(""))},[t,n,s]),P=o.useCallback(h=>{n(t.filter(C=>C!==h))},[t,n]),A=h=>{h.key==="Backspace"&&!b&&t.length>0?P(t[t.length-1]):h.key==="Enter"&&b?(h.preventDefault(),S.length>0?x(String(S[0].value)):l&&x(b)):h.key==="Escape"&&D(!1)},E=h=>{var C;return((C=e.find(_=>String(_.value)===h))==null?void 0:C.label)??h};return a.jsxs("div",{className:`nice-field nice-field--${m} ${u?"nice-field--error":""} ${k||""}`,style:z,ref:R,children:[d&&a.jsxs("label",{className:"nice-field__label",htmlFor:N,children:[d,f&&a.jsx("span",{className:"nice-field__required",children:"*"}),g&&a.jsx(Oe,{shortcuts:M,size:"sm"})]}),a.jsxs("div",{className:"nice-tagbox",onClick:()=>{var h;p||(D(!0),(h=L.current)==null||h.focus())},children:[a.jsxs("div",{className:"nice-tagbox__tags",children:[t.map(h=>a.jsxs("span",{className:"nice-tag nice-tagbox__tag",children:[E(h),!p&&a.jsx("button",{type:"button",className:"nice-tag__remove",onClick:C=>{C.stopPropagation(),P(h)},children:"✕"})]},h)),i&&a.jsx("input",{ref:L,id:N,type:"text",className:"nice-tagbox__input",value:b,onChange:h=>{T(h.target.value),D(!0)},onFocus:()=>D(!0),onKeyDown:A,placeholder:t.length===0?c||j("controls.select","Select..."):"",disabled:p,autoComplete:"off"})]}),r&&t.length>0&&!p&&a.jsx("button",{type:"button",className:"nice-field__clear",onClick:h=>{h.stopPropagation(),n([])},"aria-label":j("controls.clear","Clear"),children:"✕"})]}),I&&S.length>0&&a.jsx("ul",{className:"nice-dropdown__list",role:"listbox",children:S.map(h=>a.jsx("li",{role:"option",className:"nice-dropdown__option",onMouseDown:C=>{C.preventDefault(),x(String(h.value))},children:h.label},String(h.value)))}),u&&a.jsx("div",{className:"nice-field__error",children:u}),y&&!u&&a.jsx("div",{className:"nice-field__hint",children:y})]})},si=({min:e=0,max:t=100,step:n=1,startValue:i,endValue:r,onChange:s,showLabels:l=!0,formatLabel:c,label:d,error:u,helperText:y,required:f,disabled:p,size:m="md",id:w,className:k,style:z,accessMode:$,showKeyboardHints:g})=>{const v=Ee($,w);if(v==="hidden")return null;(v==="disabled"||v==="readOnly")&&(p=!0);const{t:N}=ke(),j=we(w),I=o.useRef(null),D=o.useMemo(()=>[$e.increment,$e.decrement,$e.first,$e.last,{key:"Tab",description:N("shortcuts.switchThumb","Switch thumb")}],[N]),b=M=>(M-e)/(t-e)*100,T=M=>c?c(M):String(M),R=M=>{const S=Math.round(M/n)*n;return Math.max(e,Math.min(t,S))},L=o.useCallback((M,S)=>{M.preventDefault();const x=I.current;if(!x||p)return;const P=E=>{const h=x.getBoundingClientRect(),C=Math.max(0,Math.min(1,(E.clientX-h.left)/h.width)),_=R(e+C*(t-e));S==="start"?s(Math.min(_,r),r):s(i,Math.max(_,i))},A=()=>{document.removeEventListener("pointermove",P),document.removeEventListener("pointerup",A)};document.addEventListener("pointermove",P),document.addEventListener("pointerup",A)},[e,t,n,i,r,s,p]);return a.jsxs("div",{className:`nice-field nice-field--${m} ${u?"nice-field--error":""} ${k||""}`,style:z,children:[d&&a.jsxs("label",{className:"nice-field__label",htmlFor:j,children:[d,f&&a.jsx("span",{className:"nice-field__required",children:"*"}),g&&a.jsx(Oe,{shortcuts:D,size:"sm"})]}),a.jsxs("div",{className:"nice-range-slider",ref:I,children:[a.jsx("div",{className:"nice-range-slider__track",children:a.jsx("div",{className:"nice-range-slider__fill",style:{left:`${b(i)}%`,width:`${b(r)-b(i)}%`}})}),a.jsx("div",{className:"nice-range-slider__thumb",style:{left:`${b(i)}%`},onPointerDown:M=>L(M,"start"),role:"slider","aria-valuemin":e,"aria-valuemax":r,"aria-valuenow":i,tabIndex:p?-1:0,id:j}),a.jsx("div",{className:"nice-range-slider__thumb",style:{left:`${b(r)}%`},onPointerDown:M=>L(M,"end"),role:"slider","aria-valuemin":i,"aria-valuemax":t,"aria-valuenow":r,tabIndex:p?-1:0}),l&&a.jsxs("div",{className:"nice-range-slider__labels",children:[a.jsx("span",{style:{left:`${b(i)}%`},children:T(i)}),a.jsx("span",{style:{left:`${b(r)}%`},children:T(r)})]})]}),u&&a.jsx("div",{className:"nice-field__error",children:u}),y&&!u&&a.jsx("div",{className:"nice-field__hint",children:y})]})},li=({displayValue:e,placeholder:t,clearable:n,children:i,onClear:r,open:s,onOpenChange:l,dropdownWidth:c,label:d,error:u,helperText:y,required:f,disabled:p,size:m="md",id:w,className:k,style:z,accessMode:$,showKeyboardHints:g,displayStyle:v})=>{Ye("input",v),Be("input",v);const N=Ee($,w);if(N==="hidden")return null;(N==="disabled"||N==="readOnly")&&(p=!0);const j=we(w),{t:I}=ke(),[D,b]=o.useState(!1),T=o.useRef(null),R=s??D,L=o.useMemo(()=>[{key:"Enter",description:I("shortcuts.openDropdown","Open dropdown")},$e.cancel],[I]),M=S=>{l?l(S):b(S)};return at(T,()=>M(!1)),a.jsxs("div",{className:`nice-field nice-field--${m} ${u?"nice-field--error":""} ${k||""}`,style:z,ref:T,children:[d&&a.jsxs("label",{className:"nice-field__label",htmlFor:j,children:[d,f&&a.jsx("span",{className:"nice-field__required",children:"*"}),g&&a.jsx(Oe,{shortcuts:L,size:"sm"})]}),a.jsxs("div",{className:"nice-field__input-wrap",children:[a.jsxs("button",{type:"button",id:j,className:"nice-select__trigger",onClick:()=>!p&&M(!R),disabled:p,children:[a.jsx("span",{children:e||t||I("controls.select","Select...")}),a.jsx("span",{className:"nice-select__arrow",children:"▾"})]}),n&&e&&!p&&a.jsx("button",{type:"button",className:"nice-field__clear",onClick:()=>r==null?void 0:r(),"aria-label":I("controls.clear","Clear"),children:"✕"})]}),R&&a.jsx("div",{className:"nice-dropdown",style:{width:c},children:i}),u&&a.jsx("div",{className:"nice-field__error",children:u}),y&&!u&&a.jsx("div",{className:"nice-field__hint",children:y})]})},Mn=({items:e,data:t,onFieldChange:n,onSubmit:i,dataSource:r,recordKey:s,columns:l=1,responsiveColumns:c,gap:d=16,labelPosition:u="top",size:y="md",readOnly:f,disabled:p,className:m,style:w,accessMode:k,id:z,autoSaveDelay:$,onDirtyChange:g})=>{const v=Ee(k,z);if(v==="hidden")return null;v==="disabled"&&(p=!0),v==="readOnly"&&(f=!0);const N=jo(r??null,s),j=!!r&&s!=null,I=j?N.editData:t??{},[D]=o.useState(()=>({...I})),[b,T]=o.useState([]),R=o.useMemo(()=>Object.keys(I).some(V=>I[V]!==D[V]),[I,D]),L=o.useRef(!1);o.useEffect(()=>{R!==L.current&&(L.current=R,g==null||g(R))},[R,g]);const M=o.useRef(null),S=o.useCallback(()=>{$&&(M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{j?N.save():i==null||i(I)},$))},[$,j,N,i,I]),x=o.useCallback((V,U)=>{f||p||(T(B=>[...B,{field:V,prev:I[V]}]),j?N.set(V,U):n==null||n(V,U),S())},[j,N,n,f,p,I,S]);o.useCallback(()=>{if(b.length===0)return;const V=b[b.length-1];T(U=>U.slice(0,-1)),j?N.set(V.field,V.prev):n==null||n(V.field,V.prev)},[b,j,N,n]);const P=o.useCallback(V=>{V.preventDefault(),M.current&&clearTimeout(M.current),j?N.save():i==null||i(I)},[I,i,j,N]),A=o.useRef(null),[E,h]=o.useState(l);o.useEffect(()=>{if(!c||!A.current){h(l);return}const V=A.current,U=new ResizeObserver(B=>{var Z;const W=((Z=B[0])==null?void 0:Z.contentRect.width)??0,Q=Object.keys(c).map(Number).sort((X,oe)=>oe-X);for(const X of Q)if(W>=X){h(c[X]);return}h(l)});return U.observe(V),()=>U.disconnect()},[c,l]);const C=o.useMemo(()=>e.filter(V=>!(V.visible===!1||V.visibleWhen&&!V.visibleWhen(I))),[e,I]),_=o.useMemo(()=>{const V=[];let U=null;for(const B of C)!U||U.name!==B.group?(U={name:B.group,items:[B]},V.push(U)):U.items.push(B);return V},[C]),F=V=>{var U;return a.jsxs("div",{className:"nice-form__item",style:{gridColumn:V.colSpan?`span ${V.colSpan}`:void 0},children:[V.label&&a.jsxs("label",{className:"nice-form__label",children:[V.label,V.required&&a.jsx("span",{className:"nice-field__required",children:"*"})]}),a.jsx("div",{className:"nice-form__control",children:(U=V.render)==null?void 0:U.call(V,I[V.field],B=>x(V.field,B))}),V.hint&&a.jsx("div",{className:"nice-form__hint",children:V.hint})]},V.field)},O={display:"grid",gridTemplateColumns:`repeat(${E}, 1fr)`,gap:d},H=_.some(V=>V.name!=null);return a.jsx("form",{ref:A,className:`nice-form nice-form--label-${u}${R?" nice-form--dirty":""} ${m||""}`,style:H?{...w}:{...O,...w},onSubmit:P,noValidate:!0,children:H?_.map((V,U)=>a.jsxs("fieldset",{className:V.name?"nice-form__group":"nice-form__group nice-form__group--no-title",children:[V.name&&a.jsx("legend",{className:"nice-form__group-title",children:V.name}),a.jsx("div",{style:O,children:V.items.map(F)})]},U)):C.map(F)})};Mn.displayName="NiceForm";function ha(e){const t=e.trim().toLowerCase();return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")||t.startsWith("./")||t.startsWith("../")?!0:!(t.startsWith("javascript:")||t.startsWith("vbscript:")||t.startsWith("data:text"))}const Dc=["bold","italic","underline","strikethrough","h1","h2","h3","ul","ol","blockquote","hr","link","unlink","image","table","code","alignLeft","alignCenter","alignRight","fontSize","fontColor","undo","redo","clear","findReplace","emoji","source","fullscreen","markdown"],Tc={bold:"B",italic:"I",underline:"U",strikethrough:"S",h1:"H1",h2:"H2",h3:"H3",ul:"⊞",ol:"⊟",link:"🔗",unlink:"⛓️💥",undo:"↩",redo:"↪",clear:"⌧",table:"⊞T",image:"🖼",code:"</>",markdown:"MD",blockquote:"❝",hr:"─",subscript:"x₂",superscript:"x²",indent:"→⊞",outdent:"←⊞",alignLeft:"⬅",alignCenter:"⬌",alignRight:"➡",alignJustify:"⬌⬌",fullscreen:"⛶",removeFormat:"⌧F",print:"🖨",source:"🗏",emoji:"😀",findReplace:"🔍"},Rc=[{value:"1",label:"8pt"},{value:"2",label:"10pt"},{value:"3",label:"12pt"},{value:"4",label:"14pt"},{value:"5",label:"18pt"},{value:"6",label:"24pt"},{value:"7",label:"36pt"}],Pc=[{label:"Faces",emojis:["😀","😂","😊","😍","🤔","😢","😎","🥳","😤","🤯","🥰","😴"]},{label:"Hands",emojis:["👍","👎","👏","🤝","✌️","🤞","💪","🙌","👋","🤙"]},{label:"Symbols",emojis:["❤️","⭐","🔥","✅","❌","⚡","💡","📌","🎯","🏆","🎉","💬"]},{label:"Arrows",emojis:["➡️","⬅️","⬆️","⬇️","↩️","🔄","▶️","⏸️","⏹️","⏩"]}];function Oc(e){let t=e;return t=t.replace(/<h1[^>]*>(.*?)<\/h1>/gi,`# $1
|
|
82
|
+
`),t=t.replace(/<h2[^>]*>(.*?)<\/h2>/gi,`## $1
|
|
83
|
+
`),t=t.replace(/<h3[^>]*>(.*?)<\/h3>/gi,`### $1
|
|
84
|
+
`),t=t.replace(/<strong[^>]*>(.*?)<\/strong>/gi,"**$1**"),t=t.replace(/<b[^>]*>(.*?)<\/b>/gi,"**$1**"),t=t.replace(/<em[^>]*>(.*?)<\/em>/gi,"*$1*"),t=t.replace(/<i[^>]*>(.*?)<\/i>/gi,"*$1*"),t=t.replace(/<code[^>]*>(.*?)<\/code>/gi,"`$1`"),t=t.replace(/<pre[^>]*>(.*?)<\/pre>/gis,"```\n$1\n```\n"),t=t.replace(/<br\s*\/?>/gi,`
|
|
85
|
+
`),t=t.replace(/<li[^>]*>(.*?)<\/li>/gi,`- $1
|
|
86
|
+
`),t=t.replace(/<\/?(?:ul|ol|p|div)[^>]*>/gi,`
|
|
87
|
+
`),t=t.replace(/<[^>]+>/g,""),t=t.replace(/\n{3,}/g,`
|
|
88
|
+
|
|
89
|
+
`),t.trim()}function Lc(e){let t=e;return t=t.replace(/^### (.+)$/gm,"<h3>$1</h3>"),t=t.replace(/^## (.+)$/gm,"<h2>$1</h2>"),t=t.replace(/^# (.+)$/gm,"<h1>$1</h1>"),t=t.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),t=t.replace(/\*(.+?)\*/g,"<em>$1</em>"),t=t.replace(/`([^`]+)`/g,"<code>$1</code>"),t=t.replace(/```\n?([\s\S]*?)\n?```/g,"<pre>$1</pre>"),t=t.replace(/^- (.+)$/gm,"<li>$1</li>"),t=t.replace(/(<li>.*<\/li>)/gs,"<ul>$1</ul>"),t=t.replace(/\n/g,"<br>"),t}const tn=({value:e,onChange:t,placeholder:n,height:i=200,toolbar:r=Dc,readOnly:s,onImageUpload:l,mentionTrigger:c,mentionSuggestions:d,onMentionSearch:u,onFileDrop:y,pasteCleanup:f=!0,maxLength:p=0,showWordCount:m=!1,templates:w,label:k,error:z,helperText:$,required:g,disabled:v,size:N="md",id:j,className:I,style:D,accessMode:b})=>{const T=Ee(b,j);if(T==="hidden")return null;T==="disabled"&&(v=!0),T==="readOnly"&&(s=!0);const R=we(j),L=o.useRef(null),M=o.useRef(null),S=o.useRef(null),[x,P]=o.useState(!1),[A,E]=o.useState(""),[h,C]=o.useState(!1),[_,F]=o.useState(""),[O,H]=o.useState(!1),[V,U]=o.useState(""),[B,W]=o.useState(0),[Q,Z]=o.useState(!1),[X,oe]=o.useState("#000000"),[re,he]=o.useState("#ffff00"),[J,le]=o.useState(0),[pe,me]=o.useState(0),[ve,K]=o.useState(!1),[Y,G]=o.useState(""),[ee,ce]=o.useState(""),[ge,de]=o.useState(!1),[ie,be]=o.useState(!1),ye=o.useCallback((te,fe)=>{var Ae,Me,Re;if(s||v)return;const Se=L.current;if(Se){if(te==="markdown"){if(!x)E(Oc(e)),P(!0),C(!1);else{const ze=Lc(A);t(ze),P(!1)}return}if(te==="source"){h?(t(_),C(!1)):(F(e),C(!0),P(!1));return}if(te==="fullscreen"){Z(ze=>!ze);return}if(te==="emoji"){de(ze=>!ze);return}if(te==="findReplace"){K(ze=>!ze);return}if(te==="image"){if(l)(Ae=M.current)==null||Ae.click();else{const ze=prompt("Image URL:");ze&&ha(ze)&&(Se.focus(),document.execCommand("insertImage",!1,ze),t(Zt(Se.innerHTML)))}return}switch(Se.focus(),te){case"bold":document.execCommand("bold");break;case"italic":document.execCommand("italic");break;case"underline":document.execCommand("underline");break;case"strikethrough":document.execCommand("strikeThrough");break;case"h1":document.execCommand("formatBlock",!1,"h1");break;case"h2":document.execCommand("formatBlock",!1,"h2");break;case"h3":document.execCommand("formatBlock",!1,"h3");break;case"ul":document.execCommand("insertUnorderedList");break;case"ol":document.execCommand("insertOrderedList");break;case"blockquote":document.execCommand("formatBlock",!1,"blockquote");break;case"hr":document.execCommand("insertHorizontalRule");break;case"subscript":document.execCommand("subscript");break;case"superscript":document.execCommand("superscript");break;case"indent":document.execCommand("indent");break;case"outdent":document.execCommand("outdent");break;case"alignLeft":document.execCommand("justifyLeft");break;case"alignCenter":document.execCommand("justifyCenter");break;case"alignRight":document.execCommand("justifyRight");break;case"alignJustify":document.execCommand("justifyFull");break;case"removeFormat":document.execCommand("removeFormat");break;case"print":window.print();return;case"link":{const ze=prompt("URL:");ze&&ha(ze)&&document.execCommand("createLink",!1,ze);break}case"unlink":document.execCommand("unlink");break;case"undo":document.execCommand("undo");break;case"redo":document.execCommand("redo");break;case"clear":document.execCommand("removeFormat");break;case"fontSize":{fe&&document.execCommand("fontSize",!1,fe);break}case"fontColor":{fe&&document.execCommand("foreColor",!1,fe);break}case"bgColor":{fe&&document.execCommand("hiliteColor",!1,fe);break}case"table":{document.execCommand("insertHTML",!1,'<table class="nice-htmleditor__table"><thead><tr><th>Header 1</th><th>Header 2</th><th>Header 3</th></tr></thead><tbody><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td> </td></tr></tbody></table><p> </p>');break}case"code":{const ze=((Me=window.getSelection())==null?void 0:Me.toString())||"";ze.includes(`
|
|
90
|
+
`)||ze.length>60?document.execCommand("insertHTML",!1,`<pre class="nice-htmleditor__code-block">${ze||"// code"}</pre>`):document.execCommand("insertHTML",!1,`<code>${ze||"code"}</code>`);break}}t(Zt(Se.innerHTML)),le(((Re=Se.textContent)==null?void 0:Re.length)??0)}},[t,s,v,x,A,e,l,h,_]),_e=o.useCallback(async te=>{var Me;const fe=(Me=te.target.files)==null?void 0:Me[0];if(!fe||!l)return;const Se=await l(fe),Ae=L.current;Ae&&Se&&(Ae.focus(),document.execCommand("insertImage",!1,Se),t(Ae.innerHTML)),te.target.value=""},[l,t]),je=o.useCallback(()=>{var Se;const te=L.current;if(!te)return;const fe=((Se=te.textContent)==null?void 0:Se.length)??0;if(p>0&&fe>p&&(te.textContent=(te.textContent??"").slice(0,p)),le(fe),me((te.textContent??"").trim().split(/\s+/).filter(Boolean).length),t(te.innerHTML),c){const Ae=window.getSelection();if(Ae&&Ae.rangeCount>0){const Me=Ae.getRangeAt(0),Re=Me.startContainer;if(Re.nodeType===Node.TEXT_NODE){const ze=Re.textContent||"",lt=Me.startOffset,Ze=ze.slice(0,lt),Ge=Ze.lastIndexOf(c);if(Ge>=0&&(Ge===0||/\s/.test(Ze[Ge-1]))){const Je=Ze.slice(Ge+c.length);if(!/\s/.test(Je)){H(!0),U(Je),W(0),u==null||u(Je);return}}}}H(!1)}},[t,c,u]),Ce=(d==null?void 0:d.filter(te=>te.label.toLowerCase().includes(V.toLowerCase())).slice(0,8))??[],De=o.useCallback(te=>{var Re;const fe=L.current;if(!fe)return;const Se=window.getSelection();if(!Se||Se.rangeCount===0)return;const Ae=Se.getRangeAt(0),Me=Ae.startContainer;if(Me.nodeType===Node.TEXT_NODE&&c){const ze=Me.textContent||"",lt=Ae.startOffset,Ze=ze.slice(0,lt).lastIndexOf(c);if(Ze>=0){const Ge=ze.slice(0,Ze),Je=ze.slice(lt),Rt=`<span class="nice-htmleditor__mention" data-mention="${te.key}" contenteditable="false">${c}${te.label}</span> `;Me.textContent=Ge;const bt=document.createRange();bt.setStartAfter(Me),bt.collapse(!0);const Pt=bt.createContextualFragment(Rt+Je);(Re=Me.parentNode)==null||Re.insertBefore(Pt,Me.nextSibling),Se.collapseToEnd(),t(fe.innerHTML)}}H(!1)},[c,t]),Te=o.useCallback(te=>{if(O&&Ce.length>0){te.key==="ArrowDown"?(te.preventDefault(),W(fe=>Math.min(fe+1,Ce.length-1))):te.key==="ArrowUp"?(te.preventDefault(),W(fe=>Math.max(fe-1,0))):te.key==="Enter"?(te.preventDefault(),De(Ce[B])):te.key==="Escape"&&H(!1);return}(te.ctrlKey||te.metaKey)&&te.key==="b"?(te.preventDefault(),ye("bold")):(te.ctrlKey||te.metaKey)&&te.key==="i"?(te.preventDefault(),ye("italic")):(te.ctrlKey||te.metaKey)&&te.key==="u"?(te.preventDefault(),ye("underline")):(te.ctrlKey||te.metaKey)&&te.key==="f"?(te.preventDefault(),K(fe=>!fe)):(te.ctrlKey||te.metaKey)&&te.key==="z"&&!te.shiftKey?(te.preventDefault(),ye("undo")):(te.ctrlKey||te.metaKey)&&(te.key==="y"||te.key==="z"&&te.shiftKey)&&(te.preventDefault(),ye("redo"))},[O,Ce,B,De,ye]),qe=o.useCallback(te=>{var Me;if(!f)return;te.preventDefault();const fe=te.clipboardData.getData("text/html"),Se=te.clipboardData.getData("text/plain");if(fe){const Re=fe.replace(/<style[\s\S]*?<\/style>/gi,"").replace(/<script[\s\S]*?<\/script>/gi,"").replace(/class="[^"]*"/gi,"").replace(/style="[^"]*"/gi,"").replace(/<o:[^>]*>[\s\S]*?<\/o:[^>]*>/gi,"").replace(/<!--[\s\S]*?-->/g,"").replace(/<\/?(?:xml|meta|link|font|span)[^>]*>/gi,"");document.execCommand("insertHTML",!1,Re)}else Se&&document.execCommand("insertText",!1,Se);const Ae=L.current;Ae&&(t(Ae.innerHTML),le(((Me=Ae.textContent)==null?void 0:Me.length)??0))},[f,t]),wt=o.useCallback(async te=>{if(!y)return;te.preventDefault();const fe=Array.from(te.dataTransfer.files);if(fe.length===0)return;const Se=await y(fe),Ae=L.current;if(Ae){Ae.focus();for(const Me of Se)if(/\.(png|jpe?g|gif|webp|svg|bmp|ico)$/i.test(Me)||Me.startsWith("data:image/"))document.execCommand("insertImage",!1,Me);else{const Re=`<a href="${Me}">${Me.split("/").pop()??Me}</a>`;document.execCommand("insertHTML",!1,Re)}t(Ae.innerHTML)}},[y,t]),rt=o.useCallback(te=>{y&&te.preventDefault()},[y]),We=o.useCallback(te=>{var Re;const fe=L.current;if(!fe||!Y)return;const Se=fe.textContent??"",Ae=Y.toLowerCase(),Me=Se.toLowerCase();(te===1?Me.indexOf(Ae):Me.lastIndexOf(Ae))!==-1&&(fe.focus(),(Re=window.find)==null||Re.call(window,Y))},[Y]),ot=o.useCallback(()=>{const te=L.current;!te||!Y||(te.innerHTML=te.innerHTML.split(Y).join(ee),t(te.innerHTML))},[Y,ee,t]),st=o.useCallback(()=>{if(!Y)return;const te=e.split(Y).join(ee);t(te);const fe=L.current;fe&&(fe.innerHTML=te)},[Y,ee,e,t]),Xe=o.useCallback(te=>{const fe=L.current;fe&&(fe.focus(),document.execCommand("insertText",!1,te),t(fe.innerHTML),de(!1))},[t]),Pe=o.useCallback(te=>{const fe=L.current;fe&&(fe.focus(),document.execCommand("insertHTML",!1,te),t(fe.innerHTML),be(!1))},[t]),Le=o.useCallback(te=>{const fe=v||s;return te==="fontSize"?a.jsx(ht,{size:"sm",value:"",onChange:Se=>ye("fontSize",String(Se)),disabled:fe,placeholder:"Size",options:Rc.map(Se=>({value:Se.value,label:Se.label})),style:{minWidth:70,maxWidth:80}},te):te==="fontColor"?a.jsx(gt,{value:X,onChange:Se=>{oe(Se),ye("fontColor",Se)},disabled:fe,size:"sm",label:"",title:"Text color"},te):te==="bgColor"?a.jsx(gt,{value:re,onChange:Se=>{he(Se),ye("bgColor",Se)},disabled:fe,size:"sm",label:"",title:"Highlight color"},te):a.jsx(xe,{size:"sm",variant:te==="markdown"&&x||te==="fullscreen"&&Q||te==="source"&&h||te==="findReplace"&&ve||te==="emoji"&&ge?"primary":"ghost",onClick:()=>ye(te),title:te,disabled:fe,children:Tc[te]||te},te)},[v,s,ye,x,Q,X,re,h,ve,ge]);return a.jsxs("div",{className:`nice-field nice-field--${N} ${z?"nice-field--error":""} ${I||""}`,style:D,children:[k&&a.jsxs("label",{className:"nice-field__label",htmlFor:R,children:[k,g&&a.jsx("span",{className:"nice-field__required",children:"*"})]}),a.jsxs("div",{ref:S,className:`nice-htmleditor${Q?" nice-htmleditor--fullscreen":""}`,children:[a.jsxs("div",{className:"nice-htmleditor__toolbar",style:{display:"flex",flexWrap:"wrap",gap:2,alignItems:"center"},children:[r.map(Le),w&&w.length>0&&a.jsxs("div",{style:{position:"relative"},children:[a.jsx(xe,{size:"sm",variant:ie?"primary":"ghost",onClick:()=>be(te=>!te),title:"Insert template",children:"📋"}),ie&&a.jsx("ul",{style:{position:"absolute",top:"100%",right:0,zIndex:200,background:"#fff",border:"1px solid #ddd",borderRadius:6,boxShadow:"0 4px 16px rgba(0,0,0,.12)",listStyle:"none",margin:0,padding:4,minWidth:160,maxHeight:200,overflow:"auto"},children:w.map((te,fe)=>a.jsx("li",{style:{padding:"6px 10px",cursor:"pointer",borderRadius:4},onMouseDown:Se=>{Se.preventDefault(),Pe(te.html)},children:te.label},fe))})]})]}),ve&&a.jsxs("div",{className:"nice-htmleditor__find-bar",style:{display:"flex",gap:4,alignItems:"center",padding:"4px 8px",background:"#f8f9fa",borderBottom:"1px solid #ddd",fontSize:"0.875em"},children:[a.jsx("input",{type:"text",placeholder:"Find...",value:Y,onChange:te=>G(te.target.value),style:{flex:1,maxWidth:180,padding:"2px 6px",border:"1px solid #ccc",borderRadius:4}}),a.jsx("input",{type:"text",placeholder:"Replace...",value:ee,onChange:te=>ce(te.target.value),style:{flex:1,maxWidth:180,padding:"2px 6px",border:"1px solid #ccc",borderRadius:4}}),a.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>We(1),title:"Find next",children:"▶"}),a.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>We(-1),title:"Find previous",children:"◀"}),a.jsx(xe,{size:"sm",variant:"ghost",onClick:ot,disabled:v||s,children:"Replace"}),a.jsx(xe,{size:"sm",variant:"ghost",onClick:st,disabled:v||s,children:"All"}),a.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>K(!1),children:"✕"})]}),ge&&a.jsx("div",{className:"nice-htmleditor__emoji-picker",style:{padding:8,background:"#fff",borderBottom:"1px solid #ddd",maxHeight:180,overflowY:"auto"},children:Pc.map(te=>a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"0.7em",fontWeight:600,color:"#999",padding:"4px 0"},children:te.label}),a.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:2},children:te.emojis.map(fe=>a.jsx("span",{style:{cursor:"pointer",fontSize:"1.2em",padding:2,borderRadius:4},onClick:()=>Xe(fe),title:fe,children:fe},fe))})]},te.label))}),a.jsx("input",{ref:M,type:"file",accept:"image/*",style:{display:"none"},onChange:_e}),h?a.jsx("textarea",{className:"nice-htmleditor__source",value:_,onChange:te=>F(te.target.value),style:{minHeight:i,width:"100%",fontFamily:"monospace",resize:"vertical",whiteSpace:"pre",fontSize:"0.85em"},disabled:v||s}):x?a.jsx("textarea",{className:"nice-htmleditor__markdown",value:A,onChange:te=>E(te.target.value),style:{minHeight:i,width:"100%",fontFamily:"monospace",resize:"vertical"},disabled:v||s}):a.jsxs("div",{style:{position:"relative"},children:[a.jsx("div",{ref:L,id:R,className:"nice-htmleditor__content",contentEditable:!v&&!s,dangerouslySetInnerHTML:{__html:e},onInput:je,onKeyDown:Te,onPaste:qe,onDrop:wt,onDragOver:rt,style:{minHeight:i},"data-placeholder":n,role:"textbox","aria-multiline":"true",suppressContentEditableWarning:!0}),O&&Ce.length>0&&a.jsx("ul",{className:"nice-htmleditor__mention-list",children:Ce.map((te,fe)=>a.jsx("li",{className:`nice-htmleditor__mention-item ${fe===B?"nice-htmleditor__mention-item--active":""}`,onMouseDown:Se=>{Se.preventDefault(),De(te)},children:te.label},te.key))})]}),a.jsxs("div",{className:"nice-htmleditor__statusbar",style:{display:"flex",gap:12,padding:"2px 8px",fontSize:"0.75em",color:"#666",borderTop:"1px solid #eee"},children:[p>0&&a.jsxs("span",{children:[J," / ",p]}),m&&a.jsxs("span",{children:[pe," words"]}),m&&a.jsxs("span",{children:[J," chars"]}),h&&a.jsx("span",{style:{fontWeight:600},children:"HTML Source"}),x&&a.jsx("span",{style:{fontWeight:600},children:"Markdown"})]})]}),z&&a.jsx("div",{className:"nice-field__error",children:z}),$&&!z&&a.jsx("div",{className:"nice-field__hint",children:$})]})},Bc=Object.freeze(Object.defineProperty({__proto__:null,NiceHtmlEditor:tn},Symbol.toStringTag,{value:"Module"})),Hc=[{code:"en",label:"English"},{code:"es",label:"Spanish"},{code:"fr",label:"French"},{code:"de",label:"German"},{code:"it",label:"Italian"},{code:"pt",label:"Portuguese"},{code:"pl",label:"Polish"},{code:"ru",label:"Russian"},{code:"zh",label:"Chinese"},{code:"ja",label:"Japanese"},{code:"ko",label:"Korean"},{code:"ar",label:"Arabic"}],qc=[{style:"professional",label:"Professional"},{style:"casual",label:"Casual"},{style:"formal",label:"Formal"},{style:"concise",label:"Concise"}];o.forwardRef(function(e,t){var me,ve;const{enableAI:n=!0,aiModel:i,enableImprove:r=!0,enableTranslate:s=!0,enableGenerate:l=!0,toolbar:c,languages:d=Hc,textStyles:u=qc,onImprove:y,onTranslate:f,onGenerate:p,showAIToolbar:m=!0,value:w,onChange:k,...z}=e,$=o.useRef(null),[g,v]=o.useState(!1),[N,j]=o.useState(!1),[I,D]=o.useState(!1),[b,T]=o.useState(""),[R,L]=o.useState(""),[M,S]=o.useState("professional"),[x,P]=o.useState(""),[A,E]=o.useState(((me=d[0])==null?void 0:me.code)||"en"),[h,C]=o.useState(""),[_,F]=o.useState(""),{t:O}=kn(),H=it(),{improveText:V,translate:U,generateHtml:B,isLoading:W}=Co(),Q=n&&H.isConfigured,Z=o.useCallback(()=>{const K=window.getSelection();return K&&K.toString().trim()?K.toString():""},[]),X=o.useCallback(K=>{const Y=window.getSelection();if(Y&&Y.rangeCount>0){const G=Y.getRangeAt(0);G.deleteContents();const ee=document.createElement("div");ee.innerHTML=K;const ce=document.createDocumentFragment();for(;ee.firstChild;)ce.appendChild(ee.firstChild);if(G.insertNode(ce),$.current){const ge=$.current.innerHTML;k(ge)}}},[k]),oe=o.useCallback(async(K="professional")=>{if(!Q||!r)return"";const Y=Z();if(!Y)return"";T(Y),S(K),v(!0),L("");try{const G=await V(Y,K);return L(G),y==null||y(Y,G,K),G}catch{return L(O("htmlEditorAI.improveFailed","Failed to improve text")),""}},[Q,r,Z,V,y,O]),re=o.useCallback(async K=>{var G;if(!Q||!s)return"";const Y=Z();if(!Y)return"";T(Y),E(K),j(!0),P("");try{const ee=((G=d.find(ge=>ge.code===K))==null?void 0:G.label)||K,ce=await U(Y,ee);return P(ce),f==null||f(Y,ce,K),ce}catch{return P(O("htmlEditorAI.translateFailed","Failed to translate text")),""}},[Q,s,Z,U,d,f,O]),he=o.useCallback(async K=>{if(!Q||!l||!K.trim())return"";C(K),F("");try{const Y=await B(K);return F(Y),p==null||p(K,Y),Y}catch{return F(O("htmlEditorAI.generateFailed","Failed to generate HTML")),""}},[Q,l,B,p,O]),J=o.useCallback(()=>{R&&X(R),v(!1),L("")},[R,X]),le=o.useCallback(()=>{x&&X(x),j(!1),P("")},[x,X]),pe=o.useCallback(()=>{if(_&&$.current){document.execCommand("insertHTML",!1,_);const K=$.current.innerHTML;k(K)}D(!1),F(""),C("")},[_,k]);return o.useImperativeHandle(t,()=>({getEditor:()=>$.current,focus:()=>{var K;return(K=$.current)==null?void 0:K.focus()},getValue:()=>{var K;return((K=$.current)==null?void 0:K.innerHTML)||""},setValue:K=>{$.current&&($.current.innerHTML=K,k(K))},getSelection:Z,insertHtml:K=>{document.execCommand("insertHTML",!1,K),$.current&&k($.current.innerHTML)},improveSelection:oe,translateSelection:re,generateHtml:he})),o.useCallback(K=>{$.current=K},[]),a.jsxs("div",{className:"nice-html-editor-ai","data-testid":e["data-testid"],children:[m&&Q&&a.jsxs("div",{className:"nice-html-editor-ai__toolbar",children:[a.jsxs("div",{className:"nice-html-editor-ai__toolbar-left",children:[a.jsx("span",{className:"nice-html-editor-ai__badge",children:"AI"}),W&&a.jsx("span",{className:"nice-html-editor-ai__loading",children:O("htmlEditorAI.processing","Processing...")})]}),a.jsxs("div",{className:"nice-html-editor-ai__toolbar-right",children:[r&&a.jsxs("div",{className:"nice-html-editor-ai__dropdown",children:[a.jsxs("button",{type:"button",className:"nice-html-editor-ai__btn",onClick:()=>oe(),disabled:W,title:O("htmlEditorAI.improveText","Improve selected text"),children:["✨ ",O("htmlEditorAI.improve","Improve")]}),a.jsx("div",{className:"nice-html-editor-ai__dropdown-menu",children:u.map(({style:K,label:Y})=>a.jsx("button",{type:"button",className:"nice-html-editor-ai__dropdown-item",onClick:()=>oe(K),children:Y},K))})]}),s&&a.jsxs("div",{className:"nice-html-editor-ai__dropdown",children:[a.jsxs("button",{type:"button",className:"nice-html-editor-ai__btn",disabled:W,title:O("htmlEditorAI.translateText","Translate selected text"),children:["🌐 ",O("htmlEditorAI.translate","Translate")]}),a.jsx("div",{className:"nice-html-editor-ai__dropdown-menu nice-html-editor-ai__dropdown-menu--languages",children:d.map(({code:K,label:Y})=>a.jsx("button",{type:"button",className:"nice-html-editor-ai__dropdown-item",onClick:()=>re(K),children:Y},K))})]}),l&&a.jsxs("button",{type:"button",className:"nice-html-editor-ai__btn",onClick:()=>D(!0),disabled:W,title:O("htmlEditorAI.generateHtml","Generate HTML from description"),children:["⚡ ",O("htmlEditorAI.generate","Generate")]})]})]}),a.jsx("div",{className:"nice-html-editor-ai__editor-wrapper",children:a.jsx(tn,{value:w,onChange:k,toolbar:c,...z})}),g&&a.jsxs("div",{className:"nice-html-editor-ai__panel",children:[a.jsxs("div",{className:"nice-html-editor-ai__panel-header",children:[a.jsxs("h4",{children:["✨ ",O("htmlEditorAI.improveText","Improve Text")]}),a.jsx("div",{className:"nice-html-editor-ai__style-selector",children:u.map(({style:K,label:Y})=>a.jsx("button",{type:"button",className:`nice-html-editor-ai__style-btn ${M===K?"nice-html-editor-ai__style-btn--active":""}`,onClick:()=>{S(K),oe(K)},children:Y},K))}),a.jsx("button",{type:"button",className:"nice-html-editor-ai__close",onClick:()=>v(!1),children:"✕"})]}),a.jsx("div",{className:"nice-html-editor-ai__panel-body",children:W?a.jsx("div",{className:"nice-html-editor-ai__loading-panel",children:O("htmlEditorAI.improving","Improving text...")}):a.jsxs("div",{className:"nice-html-editor-ai__comparison",children:[a.jsxs("div",{className:"nice-html-editor-ai__text-block",children:[a.jsx("h5",{children:O("htmlEditorAI.original","Original")}),a.jsx("div",{className:"nice-html-editor-ai__text-content",children:b})]}),a.jsxs("div",{className:"nice-html-editor-ai__text-block nice-html-editor-ai__text-block--improved",children:[a.jsx("h5",{children:O("htmlEditorAI.improved","Improved")}),a.jsx("div",{className:"nice-html-editor-ai__text-content",children:R})]})]})}),a.jsxs("div",{className:"nice-html-editor-ai__panel-footer",children:[a.jsxs("button",{type:"button",className:"nice-html-editor-ai__apply",onClick:J,disabled:!R||W,children:["✓ ",O("htmlEditorAI.apply","Apply")]}),a.jsx("button",{type:"button",className:"nice-html-editor-ai__cancel",onClick:()=>{v(!1),L("")},children:O("htmlEditorAI.cancel","Cancel")})]})]}),N&&a.jsxs("div",{className:"nice-html-editor-ai__panel",children:[a.jsxs("div",{className:"nice-html-editor-ai__panel-header",children:[a.jsxs("h4",{children:["🌐 ",O("htmlEditorAI.translateText","Translate Text")]}),a.jsx("div",{className:"nice-html-editor-ai__language-selector",children:a.jsx("select",{value:A,onChange:K=>{E(K.target.value),re(K.target.value)},className:"nice-html-editor-ai__language-select",children:d.map(({code:K,label:Y})=>a.jsx("option",{value:K,children:Y},K))})}),a.jsx("button",{type:"button",className:"nice-html-editor-ai__close",onClick:()=>j(!1),children:"✕"})]}),a.jsx("div",{className:"nice-html-editor-ai__panel-body",children:W?a.jsx("div",{className:"nice-html-editor-ai__loading-panel",children:O("htmlEditorAI.translating","Translating...")}):a.jsxs("div",{className:"nice-html-editor-ai__comparison",children:[a.jsxs("div",{className:"nice-html-editor-ai__text-block",children:[a.jsx("h5",{children:O("htmlEditorAI.original","Original")}),a.jsx("div",{className:"nice-html-editor-ai__text-content",children:b})]}),a.jsxs("div",{className:"nice-html-editor-ai__text-block nice-html-editor-ai__text-block--translated",children:[a.jsx("h5",{children:((ve=d.find(K=>K.code===A))==null?void 0:ve.label)||A}),a.jsx("div",{className:"nice-html-editor-ai__text-content",children:x})]})]})}),a.jsxs("div",{className:"nice-html-editor-ai__panel-footer",children:[a.jsxs("button",{type:"button",className:"nice-html-editor-ai__apply",onClick:le,disabled:!x||W,children:["✓ ",O("htmlEditorAI.apply","Apply")]}),a.jsx("button",{type:"button",className:"nice-html-editor-ai__cancel",onClick:()=>{j(!1),P("")},children:O("htmlEditorAI.cancel","Cancel")})]})]}),I&&a.jsxs("div",{className:"nice-html-editor-ai__panel nice-html-editor-ai__panel--generate",children:[a.jsxs("div",{className:"nice-html-editor-ai__panel-header",children:[a.jsxs("h4",{children:["⚡ ",O("htmlEditorAI.generateHtml","Generate HTML")]}),a.jsx("button",{type:"button",className:"nice-html-editor-ai__close",onClick:()=>{D(!1),F(""),C("")},children:"✕"})]}),a.jsxs("div",{className:"nice-html-editor-ai__panel-body",children:[a.jsxs("div",{className:"nice-html-editor-ai__generate-input",children:[a.jsx("textarea",{placeholder:O("htmlEditorAI.generatePlaceholder",'Describe what you want to create (e.g., "A pricing table with 3 tiers", "A contact form with name, email, and message")'),value:h,onChange:K=>C(K.target.value),className:"nice-html-editor-ai__generate-textarea",rows:3}),a.jsx("button",{type:"button",className:"nice-html-editor-ai__generate-btn",onClick:()=>he(h),disabled:W||!h.trim(),children:W?O("htmlEditorAI.generating","Generating..."):O("htmlEditorAI.generate","Generate")})]}),_&&a.jsxs("div",{className:"nice-html-editor-ai__generate-result",children:[a.jsx("h5",{children:O("htmlEditorAI.preview","Preview")}),a.jsx("div",{className:"nice-html-editor-ai__preview",dangerouslySetInnerHTML:{__html:_}}),a.jsx("h5",{children:O("htmlEditorAI.htmlCode","HTML Code")}),a.jsx("pre",{className:"nice-html-editor-ai__code",children:_})]})]}),a.jsxs("div",{className:"nice-html-editor-ai__panel-footer",children:[a.jsxs("button",{type:"button",className:"nice-html-editor-ai__apply",onClick:pe,disabled:!_||W,children:["✓ ",O("htmlEditorAI.insert","Insert")]}),a.jsx("button",{type:"button",className:"nice-html-editor-ai__cancel",onClick:()=>{D(!1),F(""),C("")},children:O("htmlEditorAI.cancel","Cancel")})]})]})]})});function Qe(e){return e.toString().padStart(2,"0")}function Wc(e){if(!e)return{date:"",hours:0,minutes:0,seconds:0};const t=new Date(e);if(isNaN(t.getTime()))return{date:"",hours:0,minutes:0,seconds:0};const n=t.getFullYear(),i=Qe(t.getMonth()+1),r=Qe(t.getDate());return{date:`${n}-${i}-${r}`,hours:t.getHours(),minutes:t.getMinutes(),seconds:t.getSeconds()}}function Vc(e,t,n,i){return e?`${e}T${Qe(t)}:${Qe(n)}:${Qe(i)}`:""}const zn=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:y,value:f,onChange:p,onBlur:m,min:w,max:k,hourFormat:z="24",minuteStep:$=1,showSeconds:g=!1,showNow:v=!1,clearable:N=!1,...j},I)=>{const{t:D}=ke(),b=we(d),T=o.useRef(null),R=o.useMemo(()=>Wc(f),[f]),L=o.useCallback((H,V,U,B)=>{p==null||p(Vc(H,V,U,B))},[p]),M=o.useCallback(H=>{L(H.target.value,R.hours,R.minutes,R.seconds)},[L,R]),S=o.useCallback(H=>{const V=Math.max(0,Math.min(23,parseInt(H.target.value,10)||0));L(R.date,V,R.minutes,R.seconds)},[L,R]),x=o.useCallback(H=>{const V=Math.max(0,Math.min(59,parseInt(H.target.value,10)||0));L(R.date,R.hours,V,R.seconds)},[L,R]),P=o.useCallback(H=>{const V=Math.max(0,Math.min(59,parseInt(H.target.value,10)||0));L(R.date,R.hours,R.minutes,V)},[L,R]),A=o.useCallback(()=>{const H=R.hours>=12?R.hours-12:R.hours+12;L(R.date,H,R.minutes,R.seconds)},[L,R]),E=o.useCallback(()=>{const H=new Date,V=`${H.getFullYear()}-${Qe(H.getMonth()+1)}-${Qe(H.getDate())}`;L(V,H.getHours(),H.getMinutes(),H.getSeconds())},[L]),h=o.useCallback(()=>{p==null||p("")},[p]),C=z==="12"?R.hours===0?12:R.hours>12?R.hours-12:R.hours:R.hours,_=R.hours>=12?"PM":"AM",F=w?w.split("T")[0]:void 0,O=k?k.split("T")[0]:void 0;return a.jsxs("div",{ref:I,className:`nice-field ${u||""}`,style:y,...j,children:[e&&a.jsx("label",{htmlFor:b,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:e}),a.jsxs("div",{className:`nice-datetime nice-datetime--${l} ${n?"nice-datetime--error":""} ${r?"nice-datetime--disabled":""} ${s?"nice-datetime--readonly":""}`,children:[a.jsx("input",{ref:T,id:b,type:"date",className:"nice-datetime__date",name:c?`${c}_date`:void 0,value:R.date,min:F,max:O,disabled:r,readOnly:s,"aria-invalid":!!n,"aria-describedby":n?`${b}-error`:t?`${b}-helper`:void 0,onChange:M,onBlur:m}),a.jsx("span",{className:"nice-datetime__separator",children:a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{d:"M10 2a8 8 0 100 16 8 8 0 000-16zm.75 4a.75.75 0 00-1.5 0v4c0 .2.08.39.22.53l2 2a.75.75 0 101.06-1.06L10.75 9.69V6z"})})}),a.jsx("input",{type:"number",className:"nice-datetime__time-part",value:C,min:z==="12"?1:0,max:z==="12"?12:23,disabled:r,readOnly:s,"aria-label":D("datetime.hours","Hours"),onChange:S}),a.jsx("span",{className:"nice-datetime__colon",children:":"}),a.jsx("input",{type:"number",className:"nice-datetime__time-part",value:Qe(R.minutes),min:0,max:59,step:$,disabled:r,readOnly:s,"aria-label":D("datetime.minutes","Minutes"),onChange:x}),g&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"nice-datetime__colon",children:":"}),a.jsx("input",{type:"number",className:"nice-datetime__time-part",value:Qe(R.seconds),min:0,max:59,disabled:r,readOnly:s,"aria-label":D("datetime.seconds","Seconds"),onChange:P})]}),z==="12"&&a.jsx("button",{type:"button",className:"nice-datetime__ampm",disabled:r||s,onClick:A,"aria-label":D("datetime.toggleAmPm","Toggle AM/PM"),children:_}),v&&a.jsx("button",{type:"button",className:"nice-datetime__now",disabled:r||s,onClick:E,"aria-label":D("datetime.now","Now"),children:D("datetime.now","Now")}),N&&f&&a.jsx("button",{type:"button",className:"nice-input__clear",disabled:r||s,onClick:h,"aria-label":D("controls.clear","Clear"),children:"✕"})]}),n&&a.jsx("div",{id:`${b}-error`,className:"nice-field__error",role:"alert",children:n}),!n&&t&&a.jsx("div",{id:`${b}-helper`,className:"nice-field__helper",children:t})]})});zn.displayName="NiceDateTimePicker";function dt(e){return e.toString().padStart(2,"0")}function an(e){if(!e)return{hours:0,minutes:0,seconds:0};const t=e.split(":").map(Number);return{hours:Math.max(0,Math.min(23,t[0]||0)),minutes:Math.max(0,Math.min(59,t[1]||0)),seconds:Math.max(0,Math.min(59,t[2]||0))}}function Kc(e,t,n,i){return i?`${dt(e)}:${dt(t)}:${dt(n)}`:`${dt(e)}:${dt(t)}`}const $n=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:y,value:f,onChange:p,onBlur:m,hourFormat:w="24",minuteStep:k=1,showSeconds:z=!1,min:$,max:g,clearable:v=!1,...N},j)=>{const{t:I}=ke(),D=we(d),b=o.useMemo(()=>an(f),[f]),T=o.useCallback((C,_,F)=>{p==null||p(Kc(C,_,F,z))},[p,z]),R=o.useCallback((C,_,F)=>{if($){const O=an($),H=O.hours*3600+O.minutes*60+O.seconds;if(C*3600+_*60+F<H)return[O.hours,O.minutes,O.seconds]}if(g){const O=an(g),H=O.hours*3600+O.minutes*60+O.seconds;if(C*3600+_*60+F>H)return[O.hours,O.minutes,O.seconds]}return[C,_,F]},[$,g]),L=o.useCallback(C=>{let _=parseInt(C.target.value,10)||0;if(w==="12"){const V=b.hours<12;_=Math.max(1,Math.min(12,_)),_===12?_=V?0:12:_=V?_:_+12}else _=Math.max(0,Math.min(23,_));const[F,O,H]=R(_,b.minutes,b.seconds);T(F,O,H)},[T,b,w,R]),M=o.useCallback(C=>{const _=Math.max(0,Math.min(59,parseInt(C.target.value,10)||0)),[F,O,H]=R(b.hours,_,b.seconds);T(F,O,H)},[T,b,R]),S=o.useCallback(C=>{const _=Math.max(0,Math.min(59,parseInt(C.target.value,10)||0)),[F,O,H]=R(b.hours,b.minutes,_);T(F,O,H)},[T,b,R]),x=o.useCallback(()=>{const C=b.hours>=12?b.hours-12:b.hours+12,[_,F,O]=R(C,b.minutes,b.seconds);T(_,F,O)},[T,b,R]),P=o.useCallback(()=>{p==null||p("")},[p]),A=o.useCallback((C,_)=>{if(s||r)return;const F=C==="m"?k:1;if(_.key==="ArrowUp"||_.key==="ArrowDown"){_.preventDefault();const O=_.key==="ArrowUp"?F:-F;let H=b.hours,V=b.minutes,U=b.seconds;C==="h"?H=((H+O)%24+24)%24:C==="m"?V=((V+O)%60+60)%60:U=((U+O)%60+60)%60;const[B,W,Q]=R(H,V,U);T(B,W,Q)}},[b,k,T,R,s,r]),E=w==="12"?b.hours===0?12:b.hours>12?b.hours-12:b.hours:b.hours,h=b.hours>=12?"PM":"AM";return a.jsxs("div",{ref:j,className:`nice-field ${u||""}`,style:y,...N,children:[e&&a.jsx("label",{htmlFor:D,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:e}),a.jsxs("div",{className:`nice-timepicker nice-timepicker--${l} ${n?"nice-timepicker--error":""} ${r?"nice-timepicker--disabled":""} ${s?"nice-timepicker--readonly":""}`,children:[a.jsx("svg",{className:"nice-timepicker__icon",width:"16",height:"16",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{d:"M10 2a8 8 0 100 16 8 8 0 000-16zm.75 4a.75.75 0 00-1.5 0v4c0 .2.08.39.22.53l2 2a.75.75 0 101.06-1.06L10.75 9.69V6z"})}),a.jsx("input",{id:D,type:"number",className:"nice-timepicker__part",value:E,min:w==="12"?1:0,max:w==="12"?12:23,disabled:r,readOnly:s,name:c,"aria-invalid":!!n,"aria-describedby":n?`${D}-error`:t?`${D}-helper`:void 0,"aria-label":I("datetime.hours","Hours"),onChange:L,onKeyDown:C=>A("h",C),onBlur:m}),a.jsx("span",{className:"nice-timepicker__colon",children:":"}),a.jsx("input",{type:"number",className:"nice-timepicker__part",value:dt(b.minutes),min:0,max:59,step:k,disabled:r,readOnly:s,"aria-label":I("datetime.minutes","Minutes"),onChange:M,onKeyDown:C=>A("m",C)}),z&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"nice-timepicker__colon",children:":"}),a.jsx("input",{type:"number",className:"nice-timepicker__part",value:dt(b.seconds),min:0,max:59,disabled:r,readOnly:s,"aria-label":I("datetime.seconds","Seconds"),onChange:S,onKeyDown:C=>A("s",C)})]}),w==="12"&&a.jsx("button",{type:"button",className:"nice-timepicker__ampm",disabled:r||s,onClick:x,"aria-label":I("datetime.toggleAmPm","Toggle AM/PM"),children:h}),v&&f&&a.jsx("button",{type:"button",className:"nice-input__clear",disabled:r||s,onClick:P,"aria-label":I("controls.clear","Clear"),children:"✕"})]}),n&&a.jsx("div",{id:`${D}-error`,className:"nice-field__error",role:"alert",children:n}),!n&&t&&a.jsx("div",{id:`${D}-helper`,className:"nice-field__helper",children:t})]})});$n.displayName="NiceTimePicker";function Uc(e){return[...e].map(t=>t==="9"?{type:"digit"}:t==="a"?{type:"letter"}:t==="*"?{type:"alphanum"}:{type:"literal",literal:t})}function Yc(e,t){return t.type==="digit"?/\d/.test(e):t.type==="letter"?/[a-zA-Z]/.test(e):t.type==="alphanum"?/[a-zA-Z0-9]/.test(e):!1}function fa(e,t,n){let i=0,r="";for(const s of t)s.type==="literal"?r+=s.literal:i<e.length?(r+=e[i],i++):r+=n;return r}function Zc(e,t){return e.map(n=>n.type==="literal"?n.literal:t).join("")}function Gc(e,t){for(let n=t;n<e.length;n++)if(e[n].type!=="literal")return n;return e.length}const An=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:y,value:f="",onChange:p,onBlur:m,onKeyDown:w,mask:k,maskChar:z="_",placeholder:$,showMaskAsPlaceholder:g=!0,clearable:v=!1,autoFocus:N,...j},I)=>{const{t:D}=ke(),b=we(d),T=o.useRef(null),[R,L]=o.useState(!1),M=o.useMemo(()=>Uc(k),[k]),S=o.useMemo(()=>fa(f,M,z),[f,M,z]),x=R||f?S:"",P=$??(g?Zc(M,z):void 0),A=o.useCallback(H=>{T.current=H,typeof I=="function"?I(H):I&&(I.current=H)},[I]),E=o.useCallback(H=>{const V=fa(H,M,z);p==null||p(H,V)},[p,M,z]),h=o.useCallback(H=>{const V=H.currentTarget,U=V.value;let B="",W=0;for(let Q=0;Q<U.length&&W<M.length;Q++){const Z=U[Q];for(;W<M.length&&M[W].type==="literal";)W++;if(W>=M.length)break;Yc(Z,M[W])&&(B+=Z,W++)}E(B),requestAnimationFrame(()=>{Gc(M,0);let Q=0,Z=0;for(let X=0;X<M.length;X++)if(M[X].type==="literal")Q=X+1;else if(Z<B.length)Z++,Q=X+1;else{Q=X;break}Z>=B.length&&B.length>0&&(Q=Math.min(Q,M.length)),V.setSelectionRange(Q,Q)})},[M,E]),C=o.useCallback(H=>{if(H.key==="Backspace"&&f.length>0){H.preventDefault();const V=f.slice(0,-1);E(V)}w==null||w(H)},[f,E,w]),_=o.useCallback(()=>L(!0),[]),F=o.useCallback(H=>{L(!1),m==null||m(H)},[m]),O=o.useCallback(()=>{var H;E(""),(H=T.current)==null||H.focus()},[E]);return a.jsxs("div",{className:`nice-field ${u||""}`,style:y,children:[e&&a.jsx("label",{htmlFor:b,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:e}),a.jsxs("div",{className:`nice-input nice-input--${l} ${n?"nice-input--error":""} ${r?"nice-input--disabled":""} ${s?"nice-input--readonly":""}`,children:[a.jsx("input",{ref:A,id:b,className:"nice-input__native nice-masked-input",type:"text",name:c,value:x,placeholder:P,disabled:r,readOnly:s,autoFocus:N,"aria-invalid":!!n,"aria-describedby":n?`${b}-error`:t?`${b}-helper`:void 0,onInput:h,onChange:()=>{},onKeyDown:C,onFocus:_,onBlur:F,...j}),v&&f&&a.jsx("button",{type:"button",className:"nice-input__clear",disabled:r||s,onClick:O,"aria-label":D("controls.clear","Clear"),children:"✕"})]}),n&&a.jsx("div",{id:`${b}-error`,className:"nice-field__error",role:"alert",children:n}),!n&&t&&a.jsx("div",{id:`${b}-helper`,className:"nice-field__helper",children:t})]})});An.displayName="NiceMaskedInput";const Qc=({filled:e,size:t})=>a.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e==="half"&&a.jsx("defs",{children:a.jsxs("linearGradient",{id:"halfGrad",children:[a.jsx("stop",{offset:"50%",stopColor:"currentColor"}),a.jsx("stop",{offset:"50%",stopColor:"transparent"})]})}),a.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.27 5.82 22 7 14.14l-5-4.87 6.91-1.01L12 2z",fill:e==="full"?"currentColor":e==="half"?"url(#halfGrad)":"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})]}),Xc={xxs:10,xs:14,sm:18,md:22,lg:28,xl:34,xxl:42},Fn=o.forwardRef(({value:e=0,onChange:t,count:n=5,half:i=!1,readOnly:r=!1,disabled:s=!1,size:l="md",label:c,icon:d,name:u,error:y,id:f,className:p,style:m,...w},k)=>{const{t:z}=ke(),$=we(f),[g,v]=o.useState(null),N=Xc[l],j=!r&&!s,I=g??e,D=M=>I>=M+1?"full":i&&I>=M+.5?"half":"empty",b=o.useCallback((M,S)=>{if(!j)return;const x=S&&i?M+.5:M+1;t==null||t(x===e?0:x)},[j,i,t,e]),T=o.useCallback((M,S)=>{if(j)if(i){const x=S.currentTarget.getBoundingClientRect(),P=S.clientX-x.left<x.width/2;v(P?M+.5:M+1)}else v(M+1)},[j,i]),R=o.useCallback(()=>{j&&v(null)},[j]),L=o.useCallback(M=>{if(!j)return;const S=i?.5:1;if(M.key==="ArrowRight"||M.key==="ArrowUp"){M.preventDefault();const x=Math.min(n,e+S);t==null||t(x)}else if(M.key==="ArrowLeft"||M.key==="ArrowDown"){M.preventDefault();const x=Math.max(0,e-S);t==null||t(x)}},[j,i,n,e,t]);return a.jsxs("div",{className:`nice-field ${p||""}`,style:m,...w,children:[c&&a.jsx("label",{htmlFor:$,className:"nice-field__label",children:c}),a.jsxs("div",{ref:k,id:$,className:`nice-rating nice-rating--${l} ${s?"nice-rating--disabled":""} ${r?"nice-rating--readonly":""}`,role:"slider","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":n,"aria-label":c||z("controls.rating","Rating"),"aria-invalid":!!y,tabIndex:j?0:-1,onMouseLeave:R,onKeyDown:L,children:[u&&a.jsx("input",{type:"hidden",name:u,value:e}),Array.from({length:n},(M,S)=>{const x=D(S);return a.jsx("span",{className:`nice-rating__star nice-rating__star--${x}`,onClick:P=>{if(!j)return;const A=P.currentTarget.getBoundingClientRect(),E=i&&P.clientX-A.left<A.width/2;b(S,E)},onMouseMove:P=>T(S,P),"aria-label":`${S+1} ${z("controls.star","star")}`,children:d?d(x):a.jsx(Qc,{filled:x,size:N})},S)})]}),y&&a.jsx("div",{className:"nice-field__error",role:"alert",children:y})]})});Fn.displayName="NiceRating";const Jc=[{id:"length",label:"At least 8 characters",test:e=>e.length>=8},{id:"uppercase",label:"At least one uppercase letter",test:e=>/[A-Z]/.test(e)},{id:"lowercase",label:"At least one lowercase letter",test:e=>/[a-z]/.test(e)},{id:"digit",label:"At least one digit",test:e=>/\d/.test(e)},{id:"special",label:"At least one special character",test:e=>/[^a-zA-Z0-9]/.test(e)}];function ed(e,t){if(!e)return{level:"none",passed:[],ratio:0};const n=t.filter(s=>s.test(e)).map(s=>s.id),i=n.length/t.length;let r="weak";return i>=1?r="strong":i>=.75?r="good":i>=.5&&(r="fair"),{level:r,passed:n,ratio:i}}const In=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:y,value:f="",onChange:p,onBlur:m,onKeyDown:w,placeholder:k,maxLength:z,showToggle:$=!0,showStrength:g=!1,strengthRules:v,autoFocus:N,autoComplete:j,...I},D)=>{const{t:b}=ke(),T=we(d),[R,L]=o.useState(!1),M=v??Jc,S=o.useMemo(()=>g?ed(f,M):null,[g,f,M]),x=o.useCallback(()=>L(P=>!P),[]);return a.jsxs("div",{className:`nice-field ${u||""}`,style:y,children:[e&&a.jsx("label",{htmlFor:T,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:e}),a.jsxs("div",{className:`nice-input nice-input--${l} ${n?"nice-input--error":""} ${r?"nice-input--disabled":""} ${s?"nice-input--readonly":""}`,children:[a.jsx("input",{ref:D,id:T,className:"nice-input__native",type:R?"text":"password",name:c,value:f,placeholder:k,disabled:r,readOnly:s,maxLength:z,autoFocus:N,autoComplete:j,"aria-invalid":!!n,"aria-describedby":n?`${T}-error`:t?`${T}-helper`:void 0,onChange:P=>p==null?void 0:p(P.target.value),onBlur:m,onKeyDown:w,...I}),$&&a.jsx("button",{type:"button",className:"nice-password__toggle",onClick:x,disabled:r,tabIndex:-1,"aria-label":R?b("password.hide","Hide password"):b("password.show","Show password"),children:R?a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24"}),a.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),a.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]}),g&&S&&f&&a.jsxs("div",{className:"nice-password__strength",children:[a.jsx("div",{className:"nice-password__meter",children:a.jsx("div",{className:`nice-password__meter-fill nice-password__meter-fill--${S.level}`,style:{width:`${S.ratio*100}%`}})}),a.jsx("span",{className:`nice-password__strength-label nice-password__strength-label--${S.level}`,children:b(`password.strength.${S.level}`,S.level.charAt(0).toUpperCase()+S.level.slice(1))}),a.jsx("ul",{className:"nice-password__rules",children:M.map(P=>{const A=S.passed.includes(P.id);return a.jsxs("li",{className:`nice-password__rule ${A?"nice-password__rule--passed":""}`,children:[a.jsx("span",{className:"nice-password__rule-icon",children:A?"✓":"✗"}),P.label]},P.id)})})]}),n&&a.jsx("div",{id:`${T}-error`,className:"nice-field__error",role:"alert",children:n}),!n&&t&&a.jsx("div",{id:`${T}-helper`,className:"nice-field__helper",children:t})]})});In.displayName="NicePasswordInput";const Dn=o.forwardRef(({length:e=6,value:t="",onChange:n,masked:i=!1,onComplete:r,label:s,helperText:l,error:c,required:d,disabled:u,readOnly:y,size:f="md",name:p,id:m,className:w,style:k,autoFocus:z,...$},g)=>{const v=we(m),N=o.useRef([]),j=t.padEnd(e,"").slice(0,e).split(""),I=o.useCallback(L=>{var S;const M=Math.max(0,Math.min(e-1,L));(S=N.current[M])==null||S.focus()},[e]),D=o.useCallback(L=>{const M=L.join("");n==null||n(M),M.length===e&&M.indexOf("")===-1&&/^\d+$/.test(M)&&(r==null||r(M))},[n,r,e]),b=o.useCallback((L,M)=>{const S=M.target.value.replace(/\D/g,"").slice(-1);if(!S)return;const x=[...j];x[L]=S,D(x),I(L+1)},[j,D,I]),T=o.useCallback((L,M)=>{if(M.key==="Backspace"){M.preventDefault();const S=[...j];j[L]?(S[L]="",D(S)):L>0&&(S[L-1]="",D(S),I(L-1))}else M.key==="ArrowLeft"?(M.preventDefault(),I(L-1)):M.key==="ArrowRight"&&(M.preventDefault(),I(L+1))},[j,D,I]),R=o.useCallback(L=>{L.preventDefault();const M=L.clipboardData.getData("text").replace(/\D/g,"").slice(0,e);if(!M)return;const S=M.padEnd(e,"").slice(0,e).split("");for(let x=M.length;x<e;x++)S[x]=j[x]||"";D(S),I(Math.min(M.length,e-1))},[e,j,D,I]);return a.jsxs("div",{className:`nice-field ${w||""}`,style:k,...$,children:[s&&a.jsx("label",{htmlFor:`${v}-0`,className:`nice-field__label ${d?"nice-field__label--required":""}`,children:s}),a.jsxs("div",{ref:g,className:`nice-otp nice-otp--${f} ${c?"nice-otp--error":""} ${u?"nice-otp--disabled":""}`,onPaste:R,children:[Array.from({length:e},(L,M)=>a.jsx("input",{ref:S=>{N.current[M]=S},id:M===0?`${v}-0`:void 0,className:"nice-otp__digit",type:i?"password":"text",inputMode:"numeric",maxLength:2,value:j[M]||"",disabled:u,readOnly:y,autoFocus:z&&M===0,"aria-invalid":!!c,"aria-label":`${M+1}`,onChange:S=>b(M,S),onKeyDown:S=>T(M,S),onFocus:S=>S.target.select()},M)),p&&a.jsx("input",{type:"hidden",name:p,value:t})]}),c&&a.jsx("div",{id:`${v}-error`,className:"nice-field__error",role:"alert",children:c}),!c&&l&&a.jsx("div",{id:`${v}-helper`,className:"nice-field__helper",children:l})]})});Dn.displayName="NiceInputOtp";const td={xxs:36,xs:48,sm:64,md:80,lg:100,xl:128,xxl:160},Ot=6,He=135,jt=405,rn=jt-He;function pn(e,t,n,i){const r=(i-90)*(Math.PI/180);return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function ga(e,t,n,i,r){const s=pn(e,t,n,i),l=pn(e,t,n,r),c=r-i>180?1:0;return`M ${s.x} ${s.y} A ${n} ${n} 0 ${c} 1 ${l.x} ${l.y}`}const Tn=o.forwardRef(({value:e=0,onChange:t,min:n=0,max:i=100,step:r=1,showValue:s=!0,valueTemplate:l="{value}",label:c,helperText:d,error:u,required:y,disabled:f,readOnly:p,size:m="md",name:w,id:k,className:z,style:$,...g},v)=>{const N=we(k),j=o.useRef(!1),I=o.useRef(null),D=typeof m=="number"?m:td[m],b=D/2,T=D/2,R=(D-Ot*2)/2,L=i>n?(e-n)/(i-n):0,M=He+L*rn,S=o.useCallback(h=>{let C=h<0?h+360:h;C=C+90,C>360&&(C-=360),C<He&&(C=He),C>jt-360&&C<He&&(C=He);let _=C;_<He&&(_+=360);let F=(_-He)/rn;F=Math.max(0,Math.min(1,F));const O=n+F*(i-n);return Math.round(O/r)*r},[n,i,r]),x=o.useCallback(h=>{if(f||p)return;const C=I.current;if(!C)return;const _=C.getBoundingClientRect(),F=h.clientX-_.left-_.width/2,O=h.clientY-_.top-_.height/2,H=Math.atan2(O,F)*(180/Math.PI)+90;let V=H<0?H+360:H;V<He-360+rn&&V>jt-360&&(V=V<180?jt-360:He);const U=S(V-90),B=Math.max(n,Math.min(i,U));t==null||t(B)},[S,f,p,n,i,t]);o.useEffect(()=>{const h=_=>{j.current&&x(_)},C=()=>{j.current=!1};return window.addEventListener("pointermove",h),window.addEventListener("pointerup",C),()=>{window.removeEventListener("pointermove",h),window.removeEventListener("pointerup",C)}},[x]);const P=o.useCallback(h=>{if(f||p)return;let C=e;h.key==="ArrowUp"||h.key==="ArrowRight"?(h.preventDefault(),C=Math.min(i,e+r)):(h.key==="ArrowDown"||h.key==="ArrowLeft")&&(h.preventDefault(),C=Math.max(n,e-r)),C!==e&&(t==null||t(C))},[e,t,n,i,r,f,p]),A=l.replace("{value}",String(e)),E=pn(b,T,R,M);return a.jsxs("div",{className:`nice-field ${z||""}`,style:$,...g,children:[c&&a.jsx("label",{htmlFor:N,className:`nice-field__label ${y?"nice-field__label--required":""}`,children:c}),a.jsxs("div",{ref:h=>{I.current=h,typeof v=="function"?v(h):v&&(v.current=h)},className:`nice-knob nice-knob--${m} ${f?"nice-knob--disabled":""} ${u?"nice-knob--error":""}`,role:"slider",id:N,tabIndex:f?-1:0,"aria-valuenow":e,"aria-valuemin":n,"aria-valuemax":i,"aria-disabled":f,"aria-invalid":!!u,onPointerDown:h=>{f||p||(j.current=!0,x(h))},onKeyDown:P,children:[a.jsxs("svg",{width:D,height:D,viewBox:`0 0 ${D} ${D}`,children:[a.jsx("path",{d:ga(b,T,R,He,jt),fill:"none",stroke:"var(--nice-border-color, #d1d5db)",strokeWidth:Ot,strokeLinecap:"round"}),L>0&&a.jsx("path",{d:ga(b,T,R,He,M),fill:"none",stroke:"var(--nice-primary, #3b82f6)",strokeWidth:Ot,strokeLinecap:"round"}),a.jsx("circle",{cx:E.x,cy:E.y,r:Ot,fill:"var(--nice-primary, #3b82f6)"})]}),s&&a.jsx("span",{className:"nice-knob__value",children:A}),w&&a.jsx("input",{type:"hidden",name:w,value:e})]}),u&&a.jsx("div",{className:"nice-field__error",role:"alert",children:u}),!u&&d&&a.jsx("div",{className:"nice-field__helper",children:d})]})});Tn.displayName="NiceKnob";const Rn=o.forwardRef(({value:e="",onChange:t,suggestions:n=[],onSearch:i,trigger:r="@",renderSuggestion:s,placeholder:l,rows:c=3,label:d,helperText:u,error:y,required:f,disabled:p,readOnly:m,size:w="md",name:k,id:z,className:$,style:g,...v},N)=>{const j=we(z),[I,D]=o.useState(!1),[b,T]=o.useState(""),[R,L]=o.useState(0),[M,S]=o.useState({top:0,left:0}),x=o.useRef(null),P=o.useRef(-1),A=n.map(F=>typeof F=="string"?{key:F,label:F}:F).filter(F=>F.label.toLowerCase().includes(b.toLowerCase())),E=o.useCallback(()=>{D(!1),T(""),L(0),P.current=-1},[]),h=o.useCallback(F=>{const O=x.current;if(!O||P.current<0)return;const H=e.slice(0,P.current),V=e.slice(O.selectionStart),U=`${r}${F.label} `,B=H+U+V;t==null||t(B),E(),requestAnimationFrame(()=>{const W=H.length+U.length;O.setSelectionRange(W,W),O.focus()})},[e,t,r,E]),C=o.useCallback(F=>{const O=F.target.value;t==null||t(O);const H=F.target.selectionStart,V=O.slice(0,H),U=V.lastIndexOf(r);if(U>=0){const B=U>0?V[U-1]:" ",W=V.slice(U+r.length);if(/\s/.test(B)&&!/\s/.test(W)){P.current=U;const Q=W;T(Q),D(!0),L(0),i==null||i(Q);const Z=F.target,X=Z.getBoundingClientRect(),oe=parseInt(getComputedStyle(Z).lineHeight)||20,re=V.split(`
|
|
91
|
+
`);S({top:X.top+re.length*oe+4-Z.scrollTop,left:X.left+8});return}}E()},[t,r,i,E]),_=o.useCallback(F=>{!I||A.length===0||(F.key==="ArrowDown"?(F.preventDefault(),L(O=>(O+1)%A.length)):F.key==="ArrowUp"?(F.preventDefault(),L(O=>(O-1+A.length)%A.length)):F.key==="Enter"?(F.preventDefault(),A[R]&&h(A[R])):F.key==="Escape"&&E())},[I,A,R,h,E]);return o.useEffect(()=>{if(!I)return;const F=O=>{const H=x.current;H&&!H.contains(O.target)&&E()};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[I,E]),a.jsxs("div",{className:`nice-field ${$||""}`,style:g,...v,children:[d&&a.jsx("label",{htmlFor:j,className:`nice-field__label ${f?"nice-field__label--required":""}`,children:d}),a.jsxs("div",{className:`nice-mention nice-mention--${w} ${y?"nice-mention--error":""} ${p?"nice-mention--disabled":""}`,children:[a.jsx("textarea",{ref:F=>{x.current=F,typeof N=="function"?N(F):N&&(N.current=F)},id:j,name:k,className:"nice-mention__input",value:e,onChange:C,onKeyDown:_,placeholder:l,rows:c,disabled:p,readOnly:m,"aria-invalid":!!y,"aria-describedby":y?`${j}-error`:u?`${j}-helper`:void 0,"aria-autocomplete":"list","aria-expanded":I}),I&&A.length>0&&a.jsx("ul",{className:"nice-mention__suggestions",role:"listbox",style:{position:"fixed",top:M.top,left:M.left},children:A.map((F,O)=>a.jsx("li",{role:"option","aria-selected":O===R,className:`nice-mention__suggestion ${O===R?"nice-mention__suggestion--active":""}`,onMouseDown:H=>{H.preventDefault(),h(F)},onMouseEnter:()=>L(O),children:s?s(F):a.jsxs(a.Fragment,{children:[F.icon&&a.jsx("span",{className:"nice-mention__suggestion-icon",children:F.icon}),a.jsx("span",{children:F.label})]})},F.key))})]}),y&&a.jsx("div",{id:`${j}-error`,className:"nice-field__error",role:"alert",children:y}),!y&&u&&a.jsx("div",{id:`${j}-helper`,className:"nice-field__helper",children:u})]})});Rn.displayName="NiceMention";function nd(e){const t=[],n=i=>{for(const r of i)t.push(r),r.children&&n(r.children)};return n(e),t}function ci(e,t){const n=t.toLowerCase();return e.reduce((i,r)=>{const s=r.children?ci(r.children,t):[];return(r.label.toLowerCase().includes(n)||s.length>0)&&i.push({...r,children:s.length>0?s:r.children}),i},[])}const di=({node:e,level:t,selectedKeys:n,expandedKeys:i,onToggleExpand:r,onSelect:s,selectableLeafsOnly:l})=>{const c=e.children&&e.children.length>0,d=i.has(e.key),u=n.has(e.key),y=!c,f=!e.disabled&&(!l||y);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:`nice-tree-select__node ${u?"nice-tree-select__node--selected":""} ${e.disabled?"nice-tree-select__node--disabled":""}`,style:{paddingLeft:t*16+8},onClick:()=>f&&s(e.key),role:"treeitem","aria-selected":u,"aria-expanded":c?d:void 0,"aria-disabled":e.disabled,children:[c?a.jsx("button",{type:"button",className:"nice-tree-select__toggle",onClick:p=>{p.stopPropagation(),r(e.key)},"aria-label":"Toggle",children:a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"currentColor",style:{transform:d?"rotate(90deg)":"none",transition:"transform 0.15s"},children:a.jsx("path",{d:"M4.5 2l4 4-4 4"})})}):a.jsx("span",{style:{width:12,display:"inline-block"}}),e.icon&&a.jsx("span",{className:"nice-tree-select__node-icon",children:e.icon}),a.jsx("span",{className:"nice-tree-select__node-label",children:e.label})]}),c&&d&&e.children.map(p=>a.jsx(di,{node:p,level:t+1,selectedKeys:n,expandedKeys:i,onToggleExpand:r,onSelect:s,selectableLeafsOnly:l},p.key))]})},Pn=o.forwardRef(({nodes:e,value:t,onChange:n,multiple:i=!1,searchable:r=!1,placeholder:s,selectableLeafsOnly:l=!1,clearable:c=!1,label:d,helperText:u,error:y,required:f,disabled:p,readOnly:m,size:w="md",name:k,id:z,className:$,style:g,...v},N)=>{const{t:j}=ke(),I=we(z),[D,b]=o.useState(!1),[T,R]=o.useState(""),[L,M]=o.useState(new Set),S=o.useRef(null);at(S,()=>b(!1));const x=o.useMemo(()=>t==null?new Set:new Set(Array.isArray(t)?t:[t]),[t]),P=o.useMemo(()=>T?ci(e,T):e,[e,T]),A=o.useMemo(()=>{const _=nd(e);return Array.from(x).map(F=>{var O;return(O=_.find(H=>H.key===F))==null?void 0:O.label}).filter(Boolean)},[x,e]),E=o.useCallback(_=>{M(F=>{const O=new Set(F);return O.has(_)?O.delete(_):O.add(_),O})},[]),h=o.useCallback(_=>{if(i){const F=new Set(x);F.has(_)?F.delete(_):F.add(_),n==null||n(Array.from(F))}else n==null||n(_),b(!1)},[i,x,n]),C=o.useCallback(_=>{_.stopPropagation(),n==null||n(i?[]:"")},[n,i]);return a.jsxs("div",{className:`nice-field ${$||""}`,style:g,...v,children:[d&&a.jsx("label",{htmlFor:I,className:`nice-field__label ${f?"nice-field__label--required":""}`,children:d}),a.jsxs("div",{ref:S,className:"nice-tree-select",style:{position:"relative"},children:[a.jsxs("div",{ref:N,id:I,className:`nice-input nice-input--${w} ${y?"nice-input--error":""} ${p?"nice-input--disabled":""} ${m?"nice-input--readonly":""}`,role:"combobox","aria-expanded":D,"aria-haspopup":"tree","aria-invalid":!!y,tabIndex:p?-1:0,onClick:()=>!p&&!m&&b(!D),onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),!p&&!m&&b(!D))},children:[a.jsx("span",{className:"nice-tree-select__display",children:A.length>0?A.join(", "):a.jsx("span",{className:"nice-tree-select__placeholder",children:s??j("controls.select","Select...")})}),c&&x.size>0&&a.jsx("button",{type:"button",className:"nice-input__clear",onClick:C,"aria-label":j("controls.clear","Clear"),children:"✕"}),a.jsx("svg",{className:"nice-tree-select__arrow",width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",style:{transform:D?"rotate(180deg)":"none",transition:"transform 0.15s"},children:a.jsx("path",{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"})})]}),D&&a.jsxs("div",{className:"nice-tree-select__dropdown",role:"tree",children:[r&&a.jsx("div",{className:"nice-tree-select__search",children:a.jsx("input",{className:"nice-input__native",type:"text",placeholder:j("controls.search","Search..."),value:T,onChange:_=>R(_.target.value),autoFocus:!0,onClick:_=>_.stopPropagation()})}),a.jsx("div",{className:"nice-tree-select__list",children:P.length===0?a.jsx("div",{className:"nice-tree-select__empty",children:j("controls.noResults","No results")}):P.map(_=>a.jsx(di,{node:_,level:0,selectedKeys:x,expandedKeys:L,onToggleExpand:E,onSelect:h,selectableLeafsOnly:l},_.key))})]})]}),k&&a.jsx("input",{type:"hidden",name:k,value:Array.isArray(t)?t.join(","):t??""}),y&&a.jsx("div",{id:`${I}-error`,className:"nice-field__error",role:"alert",children:y}),!y&&u&&a.jsx("div",{id:`${I}-helper`,className:"nice-field__helper",children:u})]})});Pn.displayName="NiceTreeSelect";function St(e,t){return String(e[t])}const On=o.forwardRef(({source:e,target:t,onChange:n,keyField:i="id",labelField:r="label",renderItem:s,filterable:l=!1,sourceHeader:c,targetHeader:d,disabled:u=!1,size:y="md",className:f,style:p,id:m,...w},k)=>{const{t:z}=ke(),[$,g]=o.useState(new Set),[v,N]=o.useState(new Set),[j,I]=o.useState(""),[D,b]=o.useState(""),T=o.useCallback((A,E,h)=>{E(C=>{const _=new Set(C);return _.has(h)?_.delete(h):_.add(h),_})},[]),R=o.useCallback(()=>{const A=e.filter(h=>$.has(St(h,i))),E=e.filter(h=>!$.has(St(h,i)));n(E,[...t,...A]),g(new Set)},[e,t,$,i,n]),L=o.useCallback(()=>{const A=t.filter(h=>v.has(St(h,i))),E=t.filter(h=>!v.has(St(h,i)));n([...e,...A],E),N(new Set)},[e,t,v,i,n]),M=o.useCallback(()=>{n([],[...t,...e]),g(new Set)},[e,t,n]),S=o.useCallback(()=>{n([...e,...t],[]),N(new Set)},[e,t,n]),x=(A,E)=>{if(!E)return A;const h=E.toLowerCase();return A.filter(C=>String(C[r]).toLowerCase().includes(h))},P=(A,E,h,C,_,F)=>{const O=x(A,C);return a.jsxs("div",{className:"nice-picklist__panel",children:[F&&a.jsx("div",{className:"nice-picklist__header",children:F}),l&&a.jsx("div",{className:"nice-picklist__filter",children:a.jsx("input",{className:"nice-input__native",type:"text",placeholder:z("controls.search","Search..."),value:C,onChange:H=>_(H.target.value)})}),a.jsxs("div",{className:"nice-picklist__list",role:"listbox","aria-multiselectable":"true",children:[O.map(H=>{const V=St(H,i),U=E.has(V);return a.jsx("div",{className:`nice-picklist__item ${U?"nice-picklist__item--selected":""}`,role:"option","aria-selected":U,onClick:()=>!u&&T(E,h,V),children:s?s(H):String(H[r])},V)}),O.length===0&&a.jsx("div",{className:"nice-picklist__empty",children:z("controls.noItems","No items")})]})]})};return a.jsxs("div",{ref:k,id:m,className:`nice-picklist nice-picklist--${y} ${u?"nice-picklist--disabled":""} ${f||""}`,style:p,...w,children:[P(e,$,g,j,I,c??z("picklist.source","Available")),a.jsxs("div",{className:"nice-picklist__controls",children:[a.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm",disabled:u||$.size===0,onClick:R,"aria-label":z("picklist.moveRight","Move right"),children:a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{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"})})}),a.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm",disabled:u||e.length===0,onClick:M,"aria-label":z("picklist.moveAllRight","Move all right"),children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:[a.jsx("path",{d:"M4.293 14.707a1 1 0 010-1.414L7.586 10 4.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"}),a.jsx("path",{d:"M10.293 14.707a1 1 0 010-1.414L13.586 10 10.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"})]})}),a.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm",disabled:u||v.size===0,onClick:L,"aria-label":z("picklist.moveLeft","Move left"),children:a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{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"})})}),a.jsx("button",{type:"button",className:"nice-btn nice-btn--outline nice-btn--sm",disabled:u||t.length===0,onClick:S,"aria-label":z("picklist.moveAllLeft","Move all left"),children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 20 20",fill:"currentColor",children:[a.jsx("path",{d:"M15.707 5.293a1 1 0 010 1.414L12.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"}),a.jsx("path",{d:"M9.707 5.293a1 1 0 010 1.414L6.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"})]})})]}),P(t,v,N,D,b,d??z("picklist.target","Selected"))]})});On.displayName="NicePickList";let on=null,Ct=null;const ya="https://cdn.jsdelivr.net/npm/monaco-editor@0.45.0/min/vs";function ui(){return Ct?Promise.resolve(Ct):on||(on=new Promise((e,t)=>{if(window.monaco){Ct=window.monaco,e(Ct);return}const n=document.createElement("script");n.src=`${ya}/loader.min.js`,n.async=!0,n.onload=()=>{const i=window.require;i.config({paths:{vs:ya}}),i(["vs/editor/editor.main"],r=>{Ct=r,e(r)})},n.onerror=()=>{t(new Error("Failed to load Monaco Editor"))},document.head.appendChild(n)}),on)}const Ln=o.forwardRef(function(e,t){const{value:n,onChange:i,language:r="plaintext",theme:s="vs",options:l={},height:c=400,width:d="100%",markers:u=[],decorations:y=[],completionProvider:f,onMount:p,onCursorPositionChange:m,onSelectionChange:w,onSave:k,loading:z,disabled:$=!1,showToolbar:g=!1,showStatusBar:v=!1,editorSize:N="standard",className:j,"data-testid":I}=e,D=o.useRef(null),b=o.useRef(null),T=o.useRef(null),R=o.useRef([]),L=o.useRef(null),[M,S]=o.useState(!0),[x,P]=o.useState(null),[A,E]=o.useState({lineNumber:1,column:1}),[h,C]=o.useState(""),[_,F]=o.useState(l.wordWrap==="on"),O=o.useMemo(()=>({automaticLayout:!0,readOnly:$||l.readOnly,minimap:{enabled:l.minimap??!0},lineNumbers:l.lineNumbers??"on",wordWrap:l.wordWrap??"off",tabSize:l.tabSize??2,insertSpaces:l.insertSpaces??!0,fontSize:l.fontSize??14,fontFamily:l.fontFamily??"'Fira Code', 'Consolas', 'Monaco', monospace",fontLigatures:l.fontLigatures??!0,cursorStyle:l.cursorStyle??"line",cursorBlinking:l.cursorBlinking??"blink",autoClosingBrackets:l.autoClosingBrackets??"languageDefined",autoClosingQuotes:l.autoClosingQuotes??"languageDefined",formatOnPaste:l.formatOnPaste??!1,formatOnType:l.formatOnType??!1,renderWhitespace:l.renderWhitespace??"selection",renderControlCharacters:l.renderControlCharacters??!1,scrollBeyondLastLine:l.scrollBeyondLastLine??!0,smoothScrolling:l.smoothScrolling??!0,folding:l.folding??!0,showFoldingControls:l.showFoldingControls??"mouseover","bracketPairColorization.enabled":l.bracketPairColorization??!0,guides:l.guides??{bracketPairs:!0,indentation:!0,highlightActiveIndentation:!0},stickyScroll:{enabled:l.stickyScroll??!1},quickSuggestions:l.quickSuggestions??!0,suggestOnTriggerCharacters:l.suggestOnTriggerCharacters??!0,acceptSuggestionOnEnter:l.acceptSuggestionOnEnter??"on",inlayHints:{enabled:l.inlayHints?"on":"off"}}),[l,$]);o.useEffect(()=>{if(!D.current)return;let B=!0;return ui().then(W=>{if(!B||!D.current)return;T.current=W;const Q=W.editor.create(D.current,{value:n,language:r,theme:s,...O});b.current=Q,S(!1),Q.onDidChangeModelContent(()=>{const Z=Q.getValue();i==null||i(Z)}),Q.onDidChangeCursorPosition(Z=>{E({lineNumber:Z.position.lineNumber,column:Z.position.column}),m==null||m({lineNumber:Z.position.lineNumber,column:Z.position.column})}),Q.onDidChangeCursorSelection(Z=>{var re;const X=Z.selection,oe=((re=Q.getModel())==null?void 0:re.getValueInRange(X))??"";C(oe),w==null||w({startLineNumber:X.startLineNumber,startColumn:X.startColumn,endLineNumber:X.endLineNumber,endColumn:X.endColumn})}),Q.addCommand(W.KeyMod.CtrlCmd|W.KeyCode.KeyS,()=>{k==null||k(Q.getValue())}),p==null||p(Q,W)}).catch(W=>{B&&(P(W.message??"Failed to load editor"),S(!1))}),()=>{var W,Q;B=!1,(W=b.current)==null||W.dispose(),(Q=L.current)==null||Q.dispose()}},[]),o.useEffect(()=>{const B=b.current;if(B&&n!==B.getValue()){const W=B.getPosition();B.setValue(n),W&&B.setPosition(W)}},[n]),o.useEffect(()=>{const B=b.current,W=T.current;if(B&&W){const Q=B.getModel();Q&&W.editor.setModelLanguage(Q,r)}},[r]),o.useEffect(()=>{const B=T.current;B&&B.editor.setTheme(s)},[s]),o.useEffect(()=>{const B=b.current;B&&B.updateOptions(O)},[O]),o.useEffect(()=>{const B=b.current,W=T.current;if(B&&W){const Q=B.getModel();if(Q){const Z=u.map(X=>({startLineNumber:X.startLineNumber,startColumn:X.startColumn,endLineNumber:X.endLineNumber,endColumn:X.endColumn,message:X.message,severity:X.severity}));W.editor.setModelMarkers(Q,"owner",Z)}}},[u]),o.useEffect(()=>{const B=b.current;if(B&&y.length>0){const W=y.map(Q=>({range:{startLineNumber:Q.range.startLineNumber,startColumn:Q.range.startColumn,endLineNumber:Q.range.endLineNumber,endColumn:Q.range.endColumn},options:{className:Q.className,glyphMarginClassName:Q.glyphMarginClassName,hoverMessage:Q.hoverMessage?{value:Q.hoverMessage}:void 0,isWholeLine:Q.isWholeLine}}));R.current=B.deltaDecorations(R.current,W)}},[y]),o.useEffect(()=>{var Q;const B=T.current;if(!B||!f)return;(Q=L.current)==null||Q.dispose();const W={text:0,method:1,function:2,constructor:3,field:4,variable:5,class:6,interface:7,module:8,property:9,keyword:13,snippet:14,color:15,file:16,reference:17,folder:18};return L.current=B.languages.registerCompletionItemProvider(r,{provideCompletionItems:async(Z,X)=>({suggestions:(await f(Z,X)).map(oe=>({label:oe.label,kind:W[oe.kind]??0,insertText:oe.insertText,insertTextRules:oe.insertTextRules==="insertAsSnippet"?4:void 0,documentation:oe.documentation,detail:oe.detail,range:{startLineNumber:X.lineNumber,startColumn:X.column,endLineNumber:X.lineNumber,endColumn:X.column}}))})}),()=>{var Z;(Z=L.current)==null||Z.dispose()}},[r,f]),o.useImperativeHandle(t,()=>({getEditor:()=>b.current,getMonaco:()=>T.current,focus:()=>{var B;return(B=b.current)==null?void 0:B.focus()},getValue:()=>{var B;return((B=b.current)==null?void 0:B.getValue())??""},setValue:B=>{var W;return(W=b.current)==null?void 0:W.setValue(B)},getSelection:()=>{var Q;const B=b.current;if(!B)return"";const W=B.getSelection();return W?((Q=B.getModel())==null?void 0:Q.getValueInRange(W))??"":""},insertText:B=>{const W=b.current;if(!W)return;const Q=W.getSelection();Q&&W.executeEdits("",[{range:Q,text:B}])},formatDocument:()=>{var B,W;(W=(B=b.current)==null?void 0:B.getAction("editor.action.formatDocument"))==null||W.run()},goToLine:(B,W=1)=>{const Q=b.current;Q&&(Q.setPosition({lineNumber:B,column:W}),Q.revealLineInCenter(B),Q.focus())},findReplace:()=>{var B,W;(W=(B=b.current)==null?void 0:B.getAction("editor.action.startFindReplaceAction"))==null||W.run()},undo:()=>{var B;(B=b.current)==null||B.trigger("keyboard","undo",null)},redo:()=>{var B;(B=b.current)==null||B.trigger("keyboard","redo",null)},getCursorPosition:()=>{var W;const B=(W=b.current)==null?void 0:W.getPosition();return{lineNumber:(B==null?void 0:B.lineNumber)??1,column:(B==null?void 0:B.column)??1}},setMarkers:B=>{const W=b.current,Q=T.current;if(W&&Q){const Z=W.getModel();if(Z){const X=B.map(oe=>({startLineNumber:oe.startLineNumber,startColumn:oe.startColumn,endLineNumber:oe.endLineNumber,endColumn:oe.endColumn,message:oe.message,severity:oe.severity}));Q.editor.setModelMarkers(Z,"owner",X)}}}}),[]);const H=o.useMemo(()=>({format:()=>{var B,W;return(W=(B=b.current)==null?void 0:B.getAction("editor.action.formatDocument"))==null?void 0:W.run()},undo:()=>{var B;return(B=b.current)==null?void 0:B.trigger("keyboard","undo",null)},redo:()=>{var B;return(B=b.current)==null?void 0:B.trigger("keyboard","redo",null)},find:()=>{var B,W;return(W=(B=b.current)==null?void 0:B.getAction("editor.action.startFindReplaceAction"))==null?void 0:W.run()},toggleWordWrap:()=>{var W;const B=!_;F(B),(W=b.current)==null||W.updateOptions({wordWrap:B?"on":"off"})},toggleMinimap:()=>{var W,Q,Z,X,oe,re;const B=(oe=(W=b.current)==null?void 0:W.getOption)==null?void 0:oe.call(W,(X=(Z=(Q=T.current)==null?void 0:Q.editor)==null?void 0:Z.EditorOption)==null?void 0:X.minimap);(re=b.current)==null||re.updateOptions({minimap:{enabled:!(B!=null&&B.enabled)}})},foldAll:()=>{var B,W;return(W=(B=b.current)==null?void 0:B.getAction("editor.foldAll"))==null?void 0:W.run()},unfoldAll:()=>{var B,W;return(W=(B=b.current)==null?void 0:B.getAction("editor.unfoldAll"))==null?void 0:W.run()}}),[_]),V=n.split(`
|
|
92
|
+
`).length,U=n.length;return M?a.jsx("div",{className:`nice-code-editor nice-code-editor--loading ${j??""}`,style:{height:c,width:d},"data-testid":I,children:z??a.jsx("div",{className:"nice-code-editor__loader",children:"Loading editor..."})}):x?a.jsx("div",{className:`nice-code-editor nice-code-editor--error ${j??""}`,style:{height:c,width:d},"data-testid":I,children:a.jsxs("div",{className:"nice-code-editor__error",children:[a.jsxs("span",{children:["⚠️ ",x]}),a.jsx("textarea",{value:n,onChange:B=>i==null?void 0:i(B.target.value),readOnly:$||l.readOnly,style:{width:"100%",height:"100%",fontFamily:"monospace"}})]})}):a.jsxs("div",{className:`nice-code-editor-wrap nice-editor--${N} ${j??""}`,style:{height:c,width:d,display:"flex",flexDirection:"column"},"data-testid":I,children:[g&&a.jsxs("div",{className:"nice-code-editor__toolbar",children:[a.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:H.undo,title:"Undo (Ctrl+Z)",children:"↶"}),a.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:H.redo,title:"Redo (Ctrl+Y)",children:"↷"}),a.jsx("span",{className:"nice-code-editor__toolbar-sep"}),a.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:H.format,title:"Format (Shift+Alt+F)",children:"⎘"}),a.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:H.find,title:"Find & Replace (Ctrl+H)",children:"🔍"}),a.jsx("span",{className:"nice-code-editor__toolbar-sep"}),a.jsx("button",{className:`nice-code-editor__toolbar-btn${_?" nice-code-editor__toolbar-btn--active":""}`,onClick:H.toggleWordWrap,title:"Toggle Word Wrap",children:"↩"}),a.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:H.toggleMinimap,title:"Toggle Minimap",children:"▥"}),a.jsx("span",{className:"nice-code-editor__toolbar-sep"}),a.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:H.foldAll,title:"Fold All",children:"⊟"}),a.jsx("button",{className:"nice-code-editor__toolbar-btn",onClick:H.unfoldAll,title:"Unfold All",children:"⊞"})]}),a.jsx("div",{ref:D,className:"nice-code-editor",style:{flex:1,minHeight:0}}),v&&a.jsxs("div",{className:"nice-code-editor__statusbar",children:[a.jsxs("span",{children:["Ln ",A.lineNumber,", Col ",A.column]}),h.length>0&&a.jsxs("span",{children:["(",h.length," selected)"]}),a.jsx("span",{className:"nice-code-editor__statusbar-spacer"}),a.jsxs("span",{children:[V," lines · ",U," chars"]}),a.jsx("span",{className:"nice-code-editor__statusbar-lang",children:r}),u.length>0&&a.jsxs("span",{className:"nice-code-editor__statusbar-markers",children:["⚠ ",u.length]})]})]})});function pi(e){const{original:t,modified:n,language:i="plaintext",theme:r="vs",height:s=400,width:l="100%",inline:c=!1,renderSideBySide:d=!0,originalEditable:u=!1,modifiedEditable:y=!1,onOriginalChange:f,onModifiedChange:p,loading:m,className:w,"data-testid":k}=e,z=o.useRef(null),$=o.useRef(null),[g,v]=o.useState(!0);return o.useEffect(()=>{if(!z.current)return;let N=!0;return ui().then(j=>{if(!N||!z.current)return;const I=j.editor.createModel(t,i),D=j.editor.createModel(n,i),b=j.editor.createDiffEditor(z.current,{automaticLayout:!0,theme:r,renderSideBySide:!c&&d,originalEditable:u,readOnly:!y});b.setModel({original:I,modified:D}),$.current=b,v(!1),u&&I.onDidChangeContent(()=>{f==null||f(I.getValue())}),y&&D.onDidChangeContent(()=>{p==null||p(D.getValue())})}),()=>{var j;N=!1,(j=$.current)==null||j.dispose()}},[]),o.useEffect(()=>{const N=$.current;if(!N)return;const j=N.getModel();j&&(j.original.getValue()!==t&&j.original.setValue(t),j.modified.getValue()!==n&&j.modified.setValue(n))},[t,n]),g?a.jsx("div",{className:`nice-code-diff-editor nice-code-diff-editor--loading ${w??""}`,style:{height:s,width:l},"data-testid":k,children:m??a.jsx("div",{className:"nice-code-editor__loader",children:"Loading diff editor..."})}):a.jsx("div",{ref:z,className:`nice-code-diff-editor ${w??""}`,style:{height:s,width:l},"data-testid":k})}function mi(e){const{value:t,onChange:n,language:i="plaintext",height:r=300,width:s="100%",readOnly:l=!1,tabSize:c=2,lineNumbers:d=!0,placeholder:u,className:y,"data-testid":f}=e,p=o.useRef(null),m=o.useCallback(k=>{var z;if(k.key==="Tab"){k.preventDefault();const $=k.currentTarget,g=$.selectionStart,v=$.selectionEnd,N=" ".repeat(c);if(k.shiftKey){const j=t.substring(0,g).lastIndexOf(`
|
|
93
|
+
`)+1;if((((z=t.substring(j,g).match(/^(\s*)/))==null?void 0:z[1])??"").length>=c){const I=t.substring(0,j)+t.substring(j+c);n==null||n(I),setTimeout(()=>{$.selectionStart=$.selectionEnd=g-c},0)}}else{const j=t.substring(0,g)+N+t.substring(v);n==null||n(j),setTimeout(()=>{$.selectionStart=$.selectionEnd=g+c},0)}}},[t,n,c]),w=t.split(`
|
|
94
|
+
`).length;return a.jsxs("div",{className:`nice-simple-code-editor ${y??""}`,style:{height:r,width:s},"data-testid":f,"data-language":i,children:[d&&a.jsx("div",{className:"nice-simple-code-editor__line-numbers",children:Array.from({length:w},(k,z)=>a.jsx("div",{className:"nice-simple-code-editor__line-number",children:z+1},z))}),a.jsx("textarea",{ref:p,className:"nice-simple-code-editor__textarea",value:t,onChange:k=>n==null?void 0:n(k.target.value),onKeyDown:m,readOnly:l,placeholder:u,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off"})]})}const ba="nice-code-editor-styles";if(typeof document<"u"&&!document.getElementById(ba)){const e=document.createElement("style");e.id=ba,e.textContent=`
|
|
95
|
+
.nice-code-editor,
|
|
96
|
+
.nice-code-diff-editor {
|
|
97
|
+
border: 1px solid var(--nice-border, #e0e0e0);
|
|
98
|
+
border-radius: 4px;
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.nice-code-editor--loading,
|
|
103
|
+
.nice-code-editor--error,
|
|
104
|
+
.nice-code-diff-editor--loading {
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
justify-content: center;
|
|
108
|
+
background: var(--nice-bg-muted, #f5f5f5);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.nice-code-editor__loader {
|
|
112
|
+
color: var(--nice-text-secondary, #666);
|
|
113
|
+
font-size: 14px;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.nice-code-editor__error {
|
|
117
|
+
display: flex;
|
|
118
|
+
flex-direction: column;
|
|
119
|
+
width: 100%;
|
|
120
|
+
height: 100%;
|
|
121
|
+
padding: 8px;
|
|
122
|
+
gap: 8px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.nice-code-editor__error span {
|
|
126
|
+
color: var(--nice-error, #d32f2f);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* Simple code editor */
|
|
130
|
+
.nice-simple-code-editor {
|
|
131
|
+
display: flex;
|
|
132
|
+
border: 1px solid var(--nice-border, #e0e0e0);
|
|
133
|
+
border-radius: 4px;
|
|
134
|
+
overflow: hidden;
|
|
135
|
+
font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
|
|
136
|
+
font-size: 14px;
|
|
137
|
+
line-height: 1.5;
|
|
138
|
+
background: var(--nice-bg-surface, #fff);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.nice-simple-code-editor__line-numbers {
|
|
142
|
+
padding: 8px 0;
|
|
143
|
+
background: var(--nice-bg-muted, #f5f5f5);
|
|
144
|
+
border-right: 1px solid var(--nice-border, #e0e0e0);
|
|
145
|
+
user-select: none;
|
|
146
|
+
text-align: right;
|
|
147
|
+
color: var(--nice-text-secondary, #999);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.nice-simple-code-editor__line-number {
|
|
151
|
+
padding: 0 12px;
|
|
152
|
+
min-width: 40px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.nice-simple-code-editor__textarea {
|
|
156
|
+
flex: 1;
|
|
157
|
+
padding: 8px 12px;
|
|
158
|
+
border: none;
|
|
159
|
+
outline: none;
|
|
160
|
+
resize: none;
|
|
161
|
+
font: inherit;
|
|
162
|
+
background: transparent;
|
|
163
|
+
color: var(--nice-text-primary, #333);
|
|
164
|
+
white-space: pre;
|
|
165
|
+
overflow-wrap: normal;
|
|
166
|
+
overflow-x: auto;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.nice-simple-code-editor__textarea::placeholder {
|
|
170
|
+
color: var(--nice-text-secondary, #999);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* Toolbar */
|
|
174
|
+
.nice-code-editor-wrap {
|
|
175
|
+
border: 1px solid var(--nice-border, #e0e0e0);
|
|
176
|
+
border-radius: 4px;
|
|
177
|
+
overflow: hidden;
|
|
178
|
+
}
|
|
179
|
+
.nice-code-editor-wrap .nice-code-editor {
|
|
180
|
+
border: none;
|
|
181
|
+
border-radius: 0;
|
|
182
|
+
}
|
|
183
|
+
.nice-code-editor__toolbar {
|
|
184
|
+
display: flex;
|
|
185
|
+
align-items: center;
|
|
186
|
+
gap: 2px;
|
|
187
|
+
padding: 3px 6px;
|
|
188
|
+
background: var(--nice-bg-muted, #f5f5f5);
|
|
189
|
+
border-bottom: 1px solid var(--nice-border, #e0e0e0);
|
|
190
|
+
}
|
|
191
|
+
.nice-code-editor__toolbar-btn {
|
|
192
|
+
display: inline-flex;
|
|
193
|
+
align-items: center;
|
|
194
|
+
justify-content: center;
|
|
195
|
+
width: 26px;
|
|
196
|
+
height: 26px;
|
|
197
|
+
border: none;
|
|
198
|
+
border-radius: 3px;
|
|
199
|
+
background: transparent;
|
|
200
|
+
color: var(--nice-text-secondary, #666);
|
|
201
|
+
cursor: pointer;
|
|
202
|
+
font-size: 14px;
|
|
203
|
+
transition: background 0.15s, color 0.15s;
|
|
204
|
+
}
|
|
205
|
+
.nice-code-editor__toolbar-btn:hover {
|
|
206
|
+
background: var(--nice-hover, #e0e0e0);
|
|
207
|
+
color: var(--nice-text-primary, #333);
|
|
208
|
+
}
|
|
209
|
+
.nice-code-editor__toolbar-btn--active {
|
|
210
|
+
background: var(--nice-accent, #1976d2);
|
|
211
|
+
color: #fff;
|
|
212
|
+
}
|
|
213
|
+
.nice-code-editor__toolbar-sep {
|
|
214
|
+
width: 1px;
|
|
215
|
+
height: 18px;
|
|
216
|
+
background: var(--nice-border, #e0e0e0);
|
|
217
|
+
margin: 0 4px;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/* Status bar */
|
|
221
|
+
.nice-code-editor__statusbar {
|
|
222
|
+
display: flex;
|
|
223
|
+
align-items: center;
|
|
224
|
+
gap: 12px;
|
|
225
|
+
padding: 2px 10px;
|
|
226
|
+
background: var(--nice-bg-muted, #f5f5f5);
|
|
227
|
+
border-top: 1px solid var(--nice-border, #e0e0e0);
|
|
228
|
+
font-size: 12px;
|
|
229
|
+
color: var(--nice-text-secondary, #666);
|
|
230
|
+
user-select: none;
|
|
231
|
+
}
|
|
232
|
+
.nice-code-editor__statusbar-spacer { flex: 1; }
|
|
233
|
+
.nice-code-editor__statusbar-lang {
|
|
234
|
+
text-transform: uppercase;
|
|
235
|
+
font-weight: 600;
|
|
236
|
+
font-size: 11px;
|
|
237
|
+
}
|
|
238
|
+
.nice-code-editor__statusbar-markers {
|
|
239
|
+
color: var(--nice-warning, #f39c12);
|
|
240
|
+
font-weight: 600;
|
|
241
|
+
}
|
|
242
|
+
`,document.head.appendChild(e)}const ad=Object.freeze(Object.defineProperty({__proto__:null,NiceCodeDiffEditor:pi,NiceCodeEditor:Ln,NiceSimpleCodeEditor:mi},Symbol.toStringTag,{value:"Module"}));o.forwardRef(function(e,t){const{enableAI:n=!0,aiModel:i,enableInlineCompletion:r=!0,completionDelay:s=500,enableExplain:l=!0,enableRefactor:c=!0,enableGenerate:d=!0,systemPrompt:u,onExplain:y,onRefactor:f,showAIToolbar:p=!0,aiShortcutKey:m="Ctrl",language:w="plaintext",value:k,onChange:z,...$}=e,g=o.useRef(null),[v,N]=o.useState(null),[j,I]=o.useState(!1),[D,b]=o.useState(""),[T,R]=o.useState(!1),[L,M]=o.useState(""),[S,x]=o.useState(""),[P,A]=o.useState(""),E=o.useRef(),{t:h}=kn(),C=it(),{complete:_,explain:F,refactor:O,generateFromComment:H,isLoading:V}=vo({language:w,model:i}),U=n&&C.isConfigured,B=o.useCallback(async()=>{if(!U||!r||!g.current||!g.current.getEditor())return;const J=g.current.getCursorPosition(),le=g.current.getValue().split(`
|
|
243
|
+
`),pe=le.slice(0,J.lineNumber-1),me=le[J.lineNumber-1]||"",ve=[...pe,me.slice(0,J.column-1)].join(`
|
|
244
|
+
`),K=[me.slice(J.column-1),...le.slice(J.lineNumber)].join(`
|
|
245
|
+
`);try{const Y=await _(ve,K);Y&&N({lineNumber:J.lineNumber,column:J.column,text:Y})}catch{}},[U,r,_]),W=o.useCallback(async()=>{if(!U||!l||!g.current)return"";const J=g.current.getSelection();if(!J)return"";A(J),I(!0),b("");try{const le=await F(J);return b(le),y==null||y(J,le),le}catch{return b(h("codeEditorAI.explanationFailed","Failed to explain code")),""}},[U,l,F,y,h]),Q=o.useCallback(async J=>{if(!U||!c||!g.current)return"";const le=g.current.getSelection();if(!le)return"";try{const pe=await O(le,J);return x(pe),f==null||f(le,pe),pe}catch{return""}},[U,c,O,f]),Z=o.useCallback(async()=>{var me;if(!U||!d||!g.current)return;const J=g.current.getCursorPosition(),le=g.current.getValue().split(`
|
|
246
|
+
`);let pe="";for(let ve=J.lineNumber-1;ve>=0&&ve>=J.lineNumber-3;ve--){const K=((me=le[ve])==null?void 0:me.trim())||"";if(K.startsWith("//")||K.startsWith("#")||K.startsWith("/*")||K.startsWith("*")){pe=K.replace(/^\/\/\s*|^#\s*|^\/\*\s*|\*\/\s*$|^\*\s*/g,"").trim();break}}if(pe)try{const ve=await H(pe);ve&&g.current&&g.current.insertText(`
|
|
247
|
+
`+ve)}catch{}},[U,d,H]),X=o.useCallback(()=>{!v||!g.current||(g.current.insertText(v.text),N(null))},[v]),oe=o.useCallback(()=>{N(null)},[]),re=o.useCallback(J=>{var le;(le=e.onCursorPositionChange)==null||le.call(e,J),!(!U||!r)&&(E.current&&clearTimeout(E.current),N(null),E.current=setTimeout(()=>{B()},s))},[e.onCursorPositionChange,U,r,s,B]);o.useEffect(()=>{var le;if(!((le=g.current)!=null&&le.getEditor())||!U)return;const J=pe=>{var me;if(m==="Ctrl"&&pe.ctrlKey||m==="Alt"&&pe.altKey||m==="Meta"&&pe.metaKey){if(pe.key===" "&&r&&(pe.preventDefault(),B()),pe.key==="e"&&l&&(pe.preventDefault(),W()),pe.key==="r"&&c){pe.preventDefault();const ve=(me=g.current)==null?void 0:me.getSelection();ve&&(A(ve),R(!0))}pe.key==="g"&&d&&(pe.preventDefault(),Z())}pe.key==="Tab"&&v&&(pe.preventDefault(),X()),pe.key==="Escape"&&v&&oe()};return window.addEventListener("keydown",J),()=>window.removeEventListener("keydown",J)},[U,m,r,l,c,d,B,W,Z,v,X,oe]),o.useEffect(()=>()=>{E.current&&clearTimeout(E.current)},[]);const he=o.useCallback(()=>{if(!S||!g.current)return;const J=g.current.getEditor();if(J!=null&&J.executeEdits&&(J!=null&&J.getSelection)){const le=J.getSelection();J.executeEdits("ai-refactor",[{range:le,text:S}])}R(!1),x(""),M("")},[S]);return o.useImperativeHandle(t,()=>({...g.current,getEditor:()=>{var J;return(J=g.current)==null?void 0:J.getEditor()},getMonaco:()=>{var J;return(J=g.current)==null?void 0:J.getMonaco()},focus:()=>{var J;return(J=g.current)==null?void 0:J.focus()},getValue:()=>{var J;return((J=g.current)==null?void 0:J.getValue())||""},setValue:J=>{var le;return(le=g.current)==null?void 0:le.setValue(J)},getSelection:()=>{var J;return((J=g.current)==null?void 0:J.getSelection())||""},insertText:J=>{var le;return(le=g.current)==null?void 0:le.insertText(J)},formatDocument:()=>{var J;return(J=g.current)==null?void 0:J.formatDocument()},goToLine:(J,le)=>{var pe;return(pe=g.current)==null?void 0:pe.goToLine(J,le)},findReplace:()=>{var J;return(J=g.current)==null?void 0:J.findReplace()},undo:()=>{var J;return(J=g.current)==null?void 0:J.undo()},redo:()=>{var J;return(J=g.current)==null?void 0:J.redo()},getCursorPosition:()=>{var J;return((J=g.current)==null?void 0:J.getCursorPosition())||{lineNumber:1,column:1}},setMarkers:J=>{var le;return(le=g.current)==null?void 0:le.setMarkers(J)},triggerCompletion:B,explainSelection:W,refactorSelection:Q,generateFromComment:Z,acceptCompletion:X,dismissCompletion:oe})),a.jsxs("div",{className:"nice-code-editor-ai","data-testid":e["data-testid"],children:[p&&U&&a.jsxs("div",{className:"nice-code-editor-ai__toolbar",children:[a.jsxs("div",{className:"nice-code-editor-ai__toolbar-left",children:[a.jsx("span",{className:"nice-code-editor-ai__toolbar-badge",children:"AI"}),V&&a.jsx("span",{className:"nice-code-editor-ai__loading",children:h("codeEditorAI.loading","Thinking...")})]}),a.jsxs("div",{className:"nice-code-editor-ai__toolbar-right",children:[r&&a.jsxs("button",{type:"button",className:"nice-code-editor-ai__toolbar-btn",onClick:()=>B(),disabled:V,title:`${h("codeEditorAI.complete","Complete")} (${m}+Space)`,children:["💡 ",h("codeEditorAI.complete","Complete")]}),l&&a.jsxs("button",{type:"button",className:"nice-code-editor-ai__toolbar-btn",onClick:()=>W(),disabled:V,title:`${h("codeEditorAI.explain","Explain")} (${m}+E)`,children:["📖 ",h("codeEditorAI.explain","Explain")]}),c&&a.jsxs("button",{type:"button",className:"nice-code-editor-ai__toolbar-btn",onClick:()=>{var le;const J=(le=g.current)==null?void 0:le.getSelection();J&&(A(J),R(!0))},disabled:V,title:`${h("codeEditorAI.refactor","Refactor")} (${m}+R)`,children:["🔧 ",h("codeEditorAI.refactor","Refactor")]}),d&&a.jsxs("button",{type:"button",className:"nice-code-editor-ai__toolbar-btn",onClick:()=>Z(),disabled:V,title:`${h("codeEditorAI.generate","Generate")} (${m}+G)`,children:["⚡ ",h("codeEditorAI.generate","Generate")]})]})]}),a.jsxs("div",{className:"nice-code-editor-ai__editor-wrapper",children:[a.jsx(Ln,{ref:g,value:k,onChange:z,language:w,onCursorPositionChange:re,...$}),v&&a.jsxs("div",{className:"nice-code-editor-ai__ghost-text",style:{top:`calc(${(v.lineNumber-1)*19}px + 4px)`,left:`calc(${(v.column-1)*7.8}px + 60px)`},children:[a.jsx("span",{className:"nice-code-editor-ai__ghost-text-content",children:v.text}),a.jsxs("span",{className:"nice-code-editor-ai__ghost-text-hint",children:["Tab ",h("codeEditorAI.toAccept","to accept")]})]})]}),j&&a.jsxs("div",{className:"nice-code-editor-ai__panel nice-code-editor-ai__panel--explain",children:[a.jsxs("div",{className:"nice-code-editor-ai__panel-header",children:[a.jsxs("h4",{children:["📖 ",h("codeEditorAI.explanation","Explanation")]}),a.jsx("button",{type:"button",className:"nice-code-editor-ai__panel-close",onClick:()=>I(!1),children:"✕"})]}),a.jsx("div",{className:"nice-code-editor-ai__panel-body",children:V?a.jsx("div",{className:"nice-code-editor-ai__panel-loading",children:h("codeEditorAI.analyzing","Analyzing code...")}):a.jsxs("div",{className:"nice-code-editor-ai__explanation",children:[a.jsx("pre",{className:"nice-code-editor-ai__code-preview",children:P}),a.jsx("div",{className:"nice-code-editor-ai__explanation-text",children:D||h("codeEditorAI.noExplanation","Select code and click Explain")})]})})]}),T&&a.jsxs("div",{className:"nice-code-editor-ai__panel nice-code-editor-ai__panel--refactor",children:[a.jsxs("div",{className:"nice-code-editor-ai__panel-header",children:[a.jsxs("h4",{children:["🔧 ",h("codeEditorAI.refactorCode","Refactor Code")]}),a.jsx("button",{type:"button",className:"nice-code-editor-ai__panel-close",onClick:()=>{R(!1),x(""),M("")},children:"✕"})]}),a.jsxs("div",{className:"nice-code-editor-ai__panel-body",children:[a.jsx("pre",{className:"nice-code-editor-ai__code-preview",children:P}),a.jsxs("div",{className:"nice-code-editor-ai__refactor-input",children:[a.jsx("input",{type:"text",placeholder:h("codeEditorAI.refactorInstruction",'Describe how to refactor (e.g., "extract function", "add error handling")'),value:L,onChange:J=>M(J.target.value),onKeyDown:J=>{J.key==="Enter"&&L&&Q(L)}}),a.jsx("button",{type:"button",className:"nice-code-editor-ai__refactor-btn",onClick:()=>Q(L),disabled:V||!L,children:V?h("codeEditorAI.refactoring","Refactoring..."):h("codeEditorAI.refactor","Refactor")})]}),S&&a.jsxs("div",{className:"nice-code-editor-ai__refactor-result",children:[a.jsx("h5",{children:h("codeEditorAI.refactoredCode","Refactored Code")}),a.jsx("pre",{className:"nice-code-editor-ai__code-preview nice-code-editor-ai__code-preview--result",children:S}),a.jsxs("div",{className:"nice-code-editor-ai__refactor-actions",children:[a.jsxs("button",{type:"button",className:"nice-code-editor-ai__refactor-apply",onClick:he,children:["✓ ",h("codeEditorAI.apply","Apply")]}),a.jsxs("button",{type:"button",className:"nice-code-editor-ai__refactor-discard",onClick:()=>{x(""),M("")},children:["✕ ",h("codeEditorAI.discard","Discard")]})]})]})]})]})]})});function xa(e,t){const n=t.getBoundingClientRect();let i,r,s;if("touches"in e){const d=e.touches[0];i=d.clientX-n.left,r=d.clientY-n.top,s=d.force}else"pressure"in e?(i=e.clientX-n.left,r=e.clientY-n.top,s=e.pressure):(i=e.clientX-n.left,r=e.clientY-n.top);const l=t.width/n.width,c=t.height/n.height;return{x:i*l,y:r*c,time:Date.now(),pressure:s!==void 0?s:.5}}function va(e,t,n,i,r){if(!t)return(n+i)/2;const s=Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))/Math.max(1,e.time-t.time),l=Math.min(s/5,1),c=i-l*(i-n),d=e.pressure??.5,u=n+d*(i-n);return c*.7+u*.3}function wa(e,t,n,i){e.beginPath(),e.moveTo(t.x,t.y),e.lineTo(n.x,n.y),e.lineWidth=i,e.lineCap="round",e.lineJoin="round",e.stroke()}o.forwardRef(function(e,t){const{value:n,onChange:i,width:r="100%",height:s=200,penColor:l="#000000",penWidth:c=2,minWidth:d=.5,maxWidth:u=4,backgroundColor:y="#ffffff",placeholder:f="Sign here",showClearButton:p=!0,showUndoButton:m=!0,showColorPicker:w=!1,showSizeSlider:k=!1,velocityFilterWeight:z=.7,throttle:$=16,disabled:g=!1,readOnly:v=!1,onBegin:N,onEnd:j,className:I,"data-testid":D}=e,b=o.useRef(null),[T,R]=o.useState((n==null?void 0:n.strokes)??[]),[L,M]=o.useState([]),[S,x]=o.useState(!1),[P,A]=o.useState(l),[E,h]=o.useState(c),C=o.useRef(null),_=o.useRef(0),F=T.length===0&&L.length===0;o.useEffect(()=>{const re=b.current;if(!re)return;const he=re.getContext("2d");if(!he)return;const J=re.getBoundingClientRect(),le=window.devicePixelRatio||1;re.width=J.width*le,re.height=J.height*le,he.scale(le,le),O()},[r,s]);const O=o.useCallback(()=>{const re=b.current;if(!re)return;const he=re.getContext("2d");if(!he)return;const J=re.getBoundingClientRect();he.fillStyle=y,he.fillRect(0,0,J.width,J.height),T.forEach(le=>{if(he.strokeStyle=le.color,!(le.points.length<2))for(let pe=1;pe<le.points.length;pe++){const me=le.points[pe-1],ve=le.points[pe],K=va(ve,me,d,u);wa(he,me,ve,K)}})},[T,y,d,u,z]);o.useEffect(()=>{O()},[O]),o.useEffect(()=>{n!=null&&n.strokes&&R(n.strokes)},[n]),o.useEffect(()=>{const re=b.current;if(re)if(T.length===0)i==null||i(null);else{const he=re.getBoundingClientRect();i==null||i({strokes:T,width:he.width,height:he.height,timestamp:Date.now()})}},[T,i]);const H=o.useCallback(re=>{if(g||v)return;const he=b.current;if(!he)return;he.setPointerCapture(re.pointerId);const J=xa(re.nativeEvent,he);x(!0),M([J]),C.current=J,_.current=J.time,N==null||N()},[g,v,N]),V=o.useCallback(re=>{if(!S||g||v)return;const he=b.current;if(!he)return;const J=he.getContext("2d");if(!J)return;const le=Date.now();if(le-_.current<$)return;const pe=xa(re.nativeEvent,he),me=C.current;if(me){J.strokeStyle=P;const ve=va(pe,me,d,u);wa(J,me,pe,ve)}M(ve=>[...ve,pe]),C.current=pe,_.current=le},[S,g,v,P,d,u,z,$]),U=o.useCallback(re=>{if(!S)return;const he=b.current;if(he&&he.releasePointerCapture(re.pointerId),L.length>0){const J={points:L,color:P,width:E};R(le=>[...le,J])}x(!1),M([]),C.current=null,j==null||j()},[S,L,P,E,j]),B=o.useCallback(()=>{R([]),M([]),O()},[O]),W=o.useCallback(()=>{R(re=>re.slice(0,-1))},[]),Q=o.useCallback((re="png",he=.92)=>{const J=b.current;if(!J)return"";const le=re==="jpeg"?"image/jpeg":"image/png";return J.toDataURL(le,he)},[]),Z=o.useCallback(async(re="png",he=.92)=>{const J=b.current;return J?new Promise(le=>{const pe=re==="jpeg"?"image/jpeg":"image/png";J.toBlob(me=>le(me),pe,he)}):null},[]),X=o.useCallback(()=>{const re=b.current;if(!re)return"";const he=re.getBoundingClientRect(),J=T.map(le=>le.points.length<2?"":`<path d="${le.points.reduce((pe,me,ve)=>ve===0?`M ${me.x} ${me.y}`:`${pe} L ${me.x} ${me.y}`,"")}" stroke="${le.color}" stroke-width="${le.width}" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`).join(`
|
|
248
|
+
`);return`<svg xmlns="http://www.w3.org/2000/svg" width="${he.width}" height="${he.height}" viewBox="0 0 ${re.width} ${re.height}">
|
|
249
|
+
<rect width="100%" height="100%" fill="${y}"/>
|
|
250
|
+
${J}
|
|
251
|
+
</svg>`},[T,y]);o.useImperativeHandle(t,()=>({clear:B,undo:W,isEmpty:()=>T.length===0,getData:()=>{const re=b.current;if(!re||T.length===0)return null;const he=re.getBoundingClientRect();return{strokes:T,width:he.width,height:he.height,timestamp:Date.now()}},setData:re=>{R(re.strokes)},toDataURL:Q,toBlob:Z,toSVG:X,getCanvas:()=>b.current}),[T,B,W,Q,Z,X]),o.useEffect(()=>{const re=b.current;if(!re)return;const he=J=>{S&&J.preventDefault()};return re.addEventListener("touchmove",he,{passive:!1}),()=>re.removeEventListener("touchmove",he)},[S]);const oe=p||m||w||k;return a.jsxs("div",{className:`nice-signature ${g?"nice-signature--disabled":""} ${v?"nice-signature--readonly":""} ${I??""}`,style:{width:r},"data-testid":D,children:[oe&&a.jsxs("div",{className:"nice-signature__toolbar",children:[w&&a.jsx("div",{className:"nice-signature__color-picker",children:a.jsx("input",{type:"color",value:P,onChange:re=>A(re.target.value),disabled:g||v,title:"Pen color"})}),k&&a.jsx("div",{className:"nice-signature__size-slider",children:a.jsx("input",{type:"range",min:d,max:u,step:.5,value:E,onChange:re=>h(parseFloat(re.target.value)),disabled:g||v,title:"Pen size"})}),a.jsxs("div",{className:"nice-signature__actions",children:[m&&a.jsx("button",{type:"button",onClick:W,disabled:g||v||T.length===0,className:"nice-signature__btn",title:"Undo",children:"↩️"}),p&&a.jsx("button",{type:"button",onClick:B,disabled:g||v||F,className:"nice-signature__btn",title:"Clear",children:"🗑️"})]})]}),a.jsxs("div",{className:"nice-signature__canvas-wrapper",style:{height:s},children:[a.jsx("canvas",{ref:b,className:"nice-signature__canvas",style:{width:"100%",height:"100%",cursor:g||v?"not-allowed":"crosshair",touchAction:"none"},onPointerDown:H,onPointerMove:V,onPointerUp:U,onPointerLeave:U}),F&&!S&&f&&a.jsx("div",{className:"nice-signature__placeholder",children:f}),a.jsx("div",{className:"nice-signature__line"})]})]})});const ka="nice-signature-styles";if(typeof document<"u"&&!document.getElementById(ka)){const e=document.createElement("style");e.id=ka,e.textContent=`
|
|
252
|
+
.nice-signature {
|
|
253
|
+
display: flex;
|
|
254
|
+
flex-direction: column;
|
|
255
|
+
border: 1px solid var(--nice-border, #e0e0e0);
|
|
256
|
+
border-radius: 4px;
|
|
257
|
+
overflow: hidden;
|
|
258
|
+
background: var(--nice-bg-surface, #fff);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.nice-signature--disabled {
|
|
262
|
+
opacity: 0.6;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.nice-signature__toolbar {
|
|
266
|
+
display: flex;
|
|
267
|
+
align-items: center;
|
|
268
|
+
gap: 8px;
|
|
269
|
+
padding: 8px;
|
|
270
|
+
background: var(--nice-bg-muted, #f5f5f5);
|
|
271
|
+
border-bottom: 1px solid var(--nice-border, #e0e0e0);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.nice-signature__color-picker input {
|
|
275
|
+
width: 32px;
|
|
276
|
+
height: 32px;
|
|
277
|
+
padding: 2px;
|
|
278
|
+
border: 1px solid var(--nice-border, #e0e0e0);
|
|
279
|
+
border-radius: 4px;
|
|
280
|
+
cursor: pointer;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.nice-signature__size-slider {
|
|
284
|
+
flex: 1;
|
|
285
|
+
max-width: 120px;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.nice-signature__size-slider input {
|
|
289
|
+
width: 100%;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.nice-signature__actions {
|
|
293
|
+
display: flex;
|
|
294
|
+
gap: 4px;
|
|
295
|
+
margin-left: auto;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.nice-signature__btn {
|
|
299
|
+
padding: 6px 10px;
|
|
300
|
+
border: 1px solid var(--nice-border, #e0e0e0);
|
|
301
|
+
border-radius: 4px;
|
|
302
|
+
background: var(--nice-bg-surface, #fff);
|
|
303
|
+
cursor: pointer;
|
|
304
|
+
font-size: 14px;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.nice-signature__btn:hover:not(:disabled) {
|
|
308
|
+
background: var(--nice-bg-hover, #f0f0f0);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.nice-signature__btn:disabled {
|
|
312
|
+
opacity: 0.4;
|
|
313
|
+
cursor: not-allowed;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.nice-signature__canvas-wrapper {
|
|
317
|
+
position: relative;
|
|
318
|
+
background: #fff;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.nice-signature__canvas {
|
|
322
|
+
display: block;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.nice-signature__placeholder {
|
|
326
|
+
position: absolute;
|
|
327
|
+
top: 50%;
|
|
328
|
+
left: 50%;
|
|
329
|
+
transform: translate(-50%, -50%);
|
|
330
|
+
color: var(--nice-text-secondary, #999);
|
|
331
|
+
font-size: 14px;
|
|
332
|
+
pointer-events: none;
|
|
333
|
+
user-select: none;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.nice-signature__line {
|
|
337
|
+
position: absolute;
|
|
338
|
+
bottom: 30px;
|
|
339
|
+
left: 20px;
|
|
340
|
+
right: 20px;
|
|
341
|
+
height: 1px;
|
|
342
|
+
background: var(--nice-border, #ccc);
|
|
343
|
+
pointer-events: none;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/* Display component */
|
|
347
|
+
.nice-signature-display {
|
|
348
|
+
border: 1px solid var(--nice-border, #e0e0e0);
|
|
349
|
+
border-radius: 4px;
|
|
350
|
+
overflow: hidden;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.nice-signature-display__canvas-wrapper {
|
|
354
|
+
position: relative;
|
|
355
|
+
background: #fff;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.nice-signature-display__canvas {
|
|
359
|
+
display: block;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.nice-signature-display__placeholder {
|
|
363
|
+
position: absolute;
|
|
364
|
+
top: 50%;
|
|
365
|
+
left: 50%;
|
|
366
|
+
transform: translate(-50%, -50%);
|
|
367
|
+
color: var(--nice-text-secondary, #999);
|
|
368
|
+
font-size: 14px;
|
|
369
|
+
}
|
|
370
|
+
`,document.head.appendChild(e)}const hi=o.forwardRef(({label:e,helperText:t,error:n,success:i=!1,startIcon:r,endIcon:s,showCounter:l=!1,variant:c="outlined",size:d="md",fullWidth:u=!1,className:y="",disabled:f=!1,required:p=!1,maxLength:m,value:w,defaultValue:k,onFocus:z,onBlur:$,onChange:g,"data-testid":v="nice-floating-input",...N},j)=>{ke();const I=o.useId(),[D,b]=o.useState(!1),[T,R]=o.useState(k??""),L=w!==void 0?w:T,M=String(L).length>0,S=D||M,x=o.useCallback(h=>{b(!0),z==null||z(h)},[z]),P=o.useCallback(h=>{b(!1),$==null||$(h)},[$]),A=o.useCallback(h=>{w===void 0&&R(h.target.value),g==null||g(h)},[w,g]),E=["nice-floating-input",`nice-floating-input--${c}`,`nice-floating-input--${d}`,D&&"nice-floating-input--focused",M&&"nice-floating-input--has-value",f&&"nice-floating-input--disabled",n&&"nice-floating-input--error",i&&"nice-floating-input--success",r&&"nice-floating-input--has-start-icon",s&&"nice-floating-input--has-end-icon",u&&"nice-floating-input--full-width",y].filter(Boolean).join(" ");return a.jsxs("div",{className:E,"data-testid":v,children:[a.jsxs("div",{className:"nice-floating-input__container",children:[r&&a.jsx("span",{className:"nice-floating-input__icon nice-floating-input__icon--start",children:r}),a.jsxs("div",{className:"nice-floating-input__field",children:[a.jsx("input",{ref:j,id:I,className:"nice-floating-input__input",value:L,onChange:A,onFocus:x,onBlur:P,disabled:f,required:p,maxLength:m,"aria-invalid":!!n,"aria-describedby":n?`${I}-error`:t?`${I}-helper`:void 0,"data-testid":`${v}-input`,...N}),a.jsxs("label",{htmlFor:I,className:`nice-floating-input__label ${S?"nice-floating-input__label--floating":""}`,children:[e,p&&a.jsx("span",{className:"nice-floating-input__required",children:"*"})]}),c==="outlined"&&a.jsx("fieldset",{className:"nice-floating-input__fieldset","aria-hidden":"true",children:a.jsx("legend",{className:`nice-floating-input__legend ${S?"nice-floating-input__legend--floating":""}`,children:a.jsxs("span",{children:[e,p&&" *"]})})})]}),s&&a.jsx("span",{className:"nice-floating-input__icon nice-floating-input__icon--end",children:s})]}),a.jsxs("div",{className:"nice-floating-input__footer",children:[n?a.jsx("span",{id:`${I}-error`,className:"nice-floating-input__error",role:"alert",children:n}):t?a.jsx("span",{id:`${I}-helper`,className:"nice-floating-input__helper",children:t}):a.jsx("span",{}),l&&m!==void 0&&a.jsxs("span",{className:"nice-floating-input__counter",children:[String(L).length,"/",m]})]})]})});hi.displayName="NiceFloatingLabelInput";const fi=o.forwardRef(({label:e,helperText:t,error:n,success:i=!1,showCounter:r=!1,variant:s="outlined",size:l="md",fullWidth:c=!1,autoResize:d=!1,minRows:u=3,maxRows:y=10,className:f="",disabled:p=!1,required:m=!1,maxLength:w,value:k,defaultValue:z,onFocus:$,onBlur:g,onChange:v,"data-testid":N="nice-floating-textarea",...j},I)=>{ke();const D=o.useId(),b=o.useRef(null),[T,R]=o.useState(!1),[L,M]=o.useState(z??""),S=k!==void 0?k:L,x=String(S).length>0,P=T||x;o.useEffect(()=>{if(!d||!b.current)return;const F=b.current,O=parseInt(getComputedStyle(F).lineHeight)||20,H=u*O,V=y*O;F.style.height="auto";const U=F.scrollHeight;F.style.height=`${Math.min(Math.max(U,H),V)}px`},[S,d,u,y]);const A=o.useCallback(F=>{b.current=F,typeof I=="function"?I(F):I&&(I.current=F)},[I]),E=o.useCallback(F=>{R(!0),$==null||$(F)},[$]),h=o.useCallback(F=>{R(!1),g==null||g(F)},[g]),C=o.useCallback(F=>{k===void 0&&M(F.target.value),v==null||v(F)},[k,v]),_=["nice-floating-input","nice-floating-input--textarea",`nice-floating-input--${s}`,`nice-floating-input--${l}`,T&&"nice-floating-input--focused",x&&"nice-floating-input--has-value",p&&"nice-floating-input--disabled",n&&"nice-floating-input--error",i&&"nice-floating-input--success",c&&"nice-floating-input--full-width",f].filter(Boolean).join(" ");return a.jsxs("div",{className:_,"data-testid":N,children:[a.jsx("div",{className:"nice-floating-input__container",children:a.jsxs("div",{className:"nice-floating-input__field",children:[a.jsx("textarea",{ref:A,id:D,className:"nice-floating-input__input nice-floating-input__input--textarea",value:S,onChange:C,onFocus:E,onBlur:h,disabled:p,required:m,maxLength:w,rows:u,"aria-invalid":!!n,"aria-describedby":n?`${D}-error`:t?`${D}-helper`:void 0,"data-testid":`${N}-textarea`,...j}),a.jsxs("label",{htmlFor:D,className:`nice-floating-input__label ${P?"nice-floating-input__label--floating":""}`,children:[e,m&&a.jsx("span",{className:"nice-floating-input__required",children:"*"})]}),s==="outlined"&&a.jsx("fieldset",{className:"nice-floating-input__fieldset","aria-hidden":"true",children:a.jsx("legend",{className:`nice-floating-input__legend ${P?"nice-floating-input__legend--floating":""}`,children:a.jsxs("span",{children:[e,m&&" *"]})})})]})}),a.jsxs("div",{className:"nice-floating-input__footer",children:[n?a.jsx("span",{id:`${D}-error`,className:"nice-floating-input__error",role:"alert",children:n}):t?a.jsx("span",{id:`${D}-helper`,className:"nice-floating-input__helper",children:t}):a.jsx("span",{}),r&&w!==void 0&&a.jsxs("span",{className:"nice-floating-input__counter",children:[String(S).length,"/",w]})]})]})});fi.displayName="NiceFloatingLabelTextarea";const id={strokeColor:"#ff3333",fillColor:"transparent",strokeWidth:2,opacity:1,fontSize:16,fontFamily:"sans-serif"};function rd(e,t){switch(t.type){case"SET_TOOL":return{...e,activeTool:t.tool,selectedId:null};case"SET_STYLE":return{...e,style:{...e.style,...t.style}};case"ADD_ANNOTATION":return{...e,annotations:[...e.annotations,t.annotation],past:[...e.past,e.annotations],future:[]};case"UPDATE_ANNOTATION":return{...e,annotations:e.annotations.map(n=>n.id===t.id?{...n,...t.updates}:n),past:[...e.past,e.annotations],future:[]};case"DELETE_ANNOTATION":return{...e,annotations:e.annotations.filter(n=>n.id!==t.id),selectedId:e.selectedId===t.id?null:e.selectedId,past:[...e.past,e.annotations],future:[]};case"SELECT":return{...e,selectedId:t.id};case"SET_ANNOTATIONS":return{...e,annotations:t.annotations,past:[],future:[]};case"SET_ZOOM":return{...e,zoom:t.zoom};case"SET_PAN":return{...e,panX:t.panX,panY:t.panY};case"UNDO":{if(e.past.length===0)return e;const n=e.past[e.past.length-1];return{...e,annotations:n,past:e.past.slice(0,-1),future:[e.annotations,...e.future]}}case"REDO":{if(e.future.length===0)return e;const n=e.future[0];return{...e,annotations:n,past:[...e.past,e.annotations],future:e.future.slice(1)}}case"CLEAR":return{...e,annotations:[],selectedId:null,past:[...e.past,e.annotations],future:[]};default:return e}}let od=0;function sd(){return`ann-${Date.now()}-${od++}`}function ld(e){const{style:t}=e,n=`stroke="${t.strokeColor}" stroke-width="${t.strokeWidth}" fill="${t.fillColor}" opacity="${t.opacity}"`;switch(e.tool){case"rectangle":return`<rect x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" ${n} />`;case"ellipse":{const i=e.x+e.width/2,r=e.y+e.height/2;return`<ellipse cx="${i}" cy="${r}" rx="${e.width/2}" ry="${e.height/2}" ${n} />`}case"arrow":{const i=e,r=Math.atan2(i.endY-i.y,i.endX-i.x),s=12,l=i.endX-s*Math.cos(r-Math.PI/6),c=i.endY-s*Math.sin(r-Math.PI/6),d=i.endX-s*Math.cos(r+Math.PI/6),u=i.endY-s*Math.sin(r+Math.PI/6);return`<line x1="${i.x}" y1="${i.y}" x2="${i.endX}" y2="${i.endY}" ${n} />
|
|
371
|
+
<polygon points="${i.endX},${i.endY} ${l},${c} ${d},${u}" fill="${t.strokeColor}" opacity="${t.opacity}" />`}case"line":{const i=e;return`<line x1="${i.x}" y1="${i.y}" x2="${i.endX}" y2="${i.endY}" ${n} />`}case"text":{const i=e;return`<text x="${i.x}" y="${i.y+(i.style.fontSize??16)}" fill="${t.strokeColor}" font-size="${t.fontSize}" font-family="${t.fontFamily}" opacity="${t.opacity}">${cd(i.text)}</text>`}case"freehand":{const i=e;return i.points.length<2?"":`<path d="${i.points.map((r,s)=>`${s===0?"M":"L"}${r.x},${r.y}`).join(" ")}" ${n} fill="none" />`}case"blur":{const i=e,r=`blur-${i.id}`;return`<defs><filter id="${r}"><feGaussianBlur stdDeviation="${i.intensity??5}" /></filter></defs>
|
|
372
|
+
<rect x="${i.x}" y="${i.y}" width="${i.width}" height="${i.height}" fill="transparent" stroke="none" filter="url(#${r})" />`}default:return""}}function cd(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const gi=o.forwardRef(({src:e,alt:t="Annotatable image",annotations:n,activeTool:i,defaultStyle:r,onAnnotationsChange:s,className:l,readOnly:c=!1,minZoom:d=.1,maxZoom:u=5},y)=>{const f=o.useRef(null),p=o.useRef(null),m=o.useRef(null),[w,k]=o.useState(!1),[z,$]=o.useState({width:0,height:0}),[g,v]=o.useReducer(rd,{annotations:n??[],selectedId:null,activeTool:i??"select",style:{...id,...r},zoom:1,panX:0,panY:0,past:[],future:[]});o.useEffect(()=>{i&&v({type:"SET_TOOL",tool:i})},[i]),o.useEffect(()=>{s==null||s(g.annotations)},[g.annotations,s]),o.useEffect(()=>{const S=new Image;S.crossOrigin="anonymous",S.onload=()=>{m.current=S,$({width:S.naturalWidth,height:S.naturalHeight}),k(!0)},S.src=e},[e]);const N=o.useRef({isDrawing:!1,startX:0,startY:0,currentAnnotation:null,freehandPoints:[]}),j=o.useCallback((S,x)=>{const P=f.current;if(!P)return{x:0,y:0};const A=P.getBoundingClientRect();return{x:(S-A.left-g.panX)/g.zoom,y:(x-A.top-g.panY)/g.zoom}},[g.zoom,g.panX,g.panY]),I=o.useCallback(()=>{var E,h;const S=f.current,x=S==null?void 0:S.getContext("2d"),P=m.current;if(!S||!x||!P||!w)return;S.width=((E=p.current)==null?void 0:E.clientWidth)??P.naturalWidth,S.height=((h=p.current)==null?void 0:h.clientHeight)??P.naturalHeight,x.clearRect(0,0,S.width,S.height),x.save(),x.translate(g.panX,g.panY),x.scale(g.zoom,g.zoom),x.drawImage(P,0,0);for(const C of g.annotations){switch(x.save(),x.globalAlpha=C.style.opacity,x.strokeStyle=C.style.strokeColor,x.fillStyle=C.style.fillColor,x.lineWidth=C.style.strokeWidth,C.tool){case"rectangle":x.strokeRect(C.x,C.y,C.width,C.height),C.style.fillColor!=="transparent"&&x.fillRect(C.x,C.y,C.width,C.height);break;case"ellipse":{x.beginPath(),x.ellipse(C.x+C.width/2,C.y+C.height/2,Math.abs(C.width/2),Math.abs(C.height/2),0,0,Math.PI*2),x.stroke(),C.style.fillColor!=="transparent"&&x.fill();break}case"arrow":{const _=C;x.beginPath(),x.moveTo(_.x,_.y),x.lineTo(_.endX,_.endY),x.stroke();const F=Math.atan2(_.endY-_.y,_.endX-_.x),O=12;x.beginPath(),x.moveTo(_.endX,_.endY),x.lineTo(_.endX-O*Math.cos(F-Math.PI/6),_.endY-O*Math.sin(F-Math.PI/6)),x.lineTo(_.endX-O*Math.cos(F+Math.PI/6),_.endY-O*Math.sin(F+Math.PI/6)),x.closePath(),x.fillStyle=C.style.strokeColor,x.fill();break}case"line":{const _=C;x.beginPath(),x.moveTo(_.x,_.y),x.lineTo(_.endX,_.endY),x.stroke();break}case"text":{const _=C;x.font=`${_.style.fontSize??16}px ${_.style.fontFamily??"sans-serif"}`,x.fillStyle=_.style.strokeColor,x.fillText(_.text,_.x,_.y+(_.style.fontSize??16));break}case"freehand":{const _=C;if(_.points.length<2)break;x.beginPath(),x.moveTo(_.points[0].x,_.points[0].y);for(let F=1;F<_.points.length;F++)x.lineTo(_.points[F].x,_.points[F].y);x.stroke();break}case"blur":{const _=C;x.filter=`blur(${_.intensity??5}px)`,x.drawImage(P,_.x,_.y,_.width,_.height,_.x,_.y,_.width,_.height),x.filter="none";break}}C.id===g.selectedId&&(x.strokeStyle="#4488ff",x.lineWidth=1,x.setLineDash([4,4]),x.strokeRect(C.x-2,C.y-2,C.width+4,C.height+4),x.setLineDash([])),x.restore()}const A=N.current;if(A.isDrawing&&A.currentAnnotation){x.save();const C=A.currentAnnotation;if(x.globalAlpha=C.style.opacity,x.strokeStyle=C.style.strokeColor,x.lineWidth=C.style.strokeWidth,x.setLineDash([6,3]),C.tool==="freehand"){const _=C;if(_.points.length>=2){x.beginPath(),x.moveTo(_.points[0].x,_.points[0].y);for(let F=1;F<_.points.length;F++)x.lineTo(_.points[F].x,_.points[F].y);x.stroke()}}else if(C.tool==="rectangle")x.strokeRect(C.x,C.y,C.width,C.height);else if(C.tool==="ellipse")x.beginPath(),x.ellipse(C.x+C.width/2,C.y+C.height/2,Math.abs(C.width/2),Math.abs(C.height/2),0,0,Math.PI*2),x.stroke();else if(C.tool==="arrow"||C.tool==="line"){const _=C;x.beginPath(),x.moveTo(_.x,_.y),x.lineTo(_.endX,_.endY),x.stroke()}x.restore()}x.restore()},[g,w]);o.useEffect(()=>{I()},[I]);const D=o.useCallback(S=>{if(c)return;const x=j(S.clientX,S.clientY),P=g.activeTool;if(P==="select"){const h=[...g.annotations].reverse().find(C=>C.tool==="freehand"?!1:x.x>=C.x&&x.x<=C.x+C.width&&x.y>=C.y&&x.y<=C.y+C.height);v({type:"SELECT",id:(h==null?void 0:h.id)??null});return}const A=N.current;A.isDrawing=!0,A.startX=x.x,A.startY=x.y;const E={id:sd(),style:{...g.style},x:x.x,y:x.y,width:0,height:0};switch(P){case"rectangle":A.currentAnnotation={...E,tool:"rectangle"};break;case"ellipse":A.currentAnnotation={...E,tool:"ellipse"};break;case"arrow":A.currentAnnotation={...E,tool:"arrow",endX:x.x,endY:x.y};break;case"line":A.currentAnnotation={...E,tool:"line",endX:x.x,endY:x.y};break;case"text":A.currentAnnotation={...E,tool:"text",text:"Text",width:100,height:g.style.fontSize??16};break;case"freehand":A.freehandPoints=[x],A.currentAnnotation={...E,tool:"freehand",points:[x]};break;case"blur":A.currentAnnotation={...E,tool:"blur",intensity:5};break}},[c,j,g.activeTool,g.style,g.annotations]),b=o.useCallback(S=>{const x=N.current;if(!x.isDrawing||!x.currentAnnotation)return;const P=j(S.clientX,S.clientY),A=x.currentAnnotation;if(A.tool==="freehand"){x.freehandPoints.push(P),A.points=[...x.freehandPoints];const E=x.freehandPoints.map(C=>C.x),h=x.freehandPoints.map(C=>C.y);A.x=Math.min(...E),A.y=Math.min(...h),A.width=Math.max(...E)-A.x,A.height=Math.max(...h)-A.y}else if(A.tool==="arrow"||A.tool==="line")A.endX=P.x,A.endY=P.y,A.width=Math.abs(P.x-x.startX),A.height=Math.abs(P.y-x.startY);else{const E=Math.min(x.startX,P.x),h=Math.min(x.startY,P.y);A.x=E,A.y=h,A.width=Math.abs(P.x-x.startX),A.height=Math.abs(P.y-x.startY)}I()},[j,I]),T=o.useCallback(()=>{const S=N.current;if(!S.isDrawing||!S.currentAnnotation)return;const x=S.currentAnnotation;(x.tool==="text"||x.tool==="freehand"||Math.abs(x.width)>2||Math.abs(x.height)>2)&&v({type:"ADD_ANNOTATION",annotation:x}),S.isDrawing=!1,S.currentAnnotation=null,S.freehandPoints=[]},[]),R=o.useCallback(S=>{S.preventDefault();const x=S.deltaY>0?.9:1.1,P=Math.max(d,Math.min(u,g.zoom*x));v({type:"SET_ZOOM",zoom:P})},[g.zoom,d,u]);o.useEffect(()=>{if(c)return;const S=x=>{(x.metaKey||x.ctrlKey)&&x.key==="z"&&!x.shiftKey?(x.preventDefault(),v({type:"UNDO"})):(x.metaKey||x.ctrlKey)&&(x.key==="y"||x.key==="z"&&x.shiftKey)?(x.preventDefault(),v({type:"REDO"})):(x.key==="Delete"||x.key==="Backspace")&&g.selectedId&&v({type:"DELETE_ANNOTATION",id:g.selectedId})};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[c,g.selectedId]),o.useImperativeHandle(y,()=>({exportAsDataURL:async(S="png",x=.92)=>{const P=document.createElement("canvas"),A=m.current;if(!A)return"";P.width=A.naturalWidth,P.height=A.naturalHeight;const E=P.getContext("2d");E.drawImage(A,0,0);for(const h of g.annotations){if(E.save(),E.globalAlpha=h.style.opacity,E.strokeStyle=h.style.strokeColor,E.fillStyle=h.style.fillColor,E.lineWidth=h.style.strokeWidth,h.tool==="rectangle")E.strokeRect(h.x,h.y,h.width,h.height);else if(h.tool==="ellipse")E.beginPath(),E.ellipse(h.x+h.width/2,h.y+h.height/2,Math.abs(h.width/2),Math.abs(h.height/2),0,0,Math.PI*2),E.stroke();else if(h.tool==="freehand"){const C=h;if(C.points.length>=2){E.beginPath(),E.moveTo(C.points[0].x,C.points[0].y);for(let _=1;_<C.points.length;_++)E.lineTo(C.points[_].x,C.points[_].y);E.stroke()}}else if(h.tool==="text"){const C=h;E.font=`${C.style.fontSize??16}px ${C.style.fontFamily??"sans-serif"}`,E.fillStyle=C.style.strokeColor,E.fillText(C.text,C.x,C.y+(C.style.fontSize??16))}E.restore()}return P.toDataURL(`image/${S}`,x)},exportAnnotations:()=>[...g.annotations],importAnnotations:S=>{v({type:"SET_ANNOTATIONS",annotations:S})},exportAsSVG:()=>{const{width:S,height:x}=z,P=g.annotations.map(ld);return`<svg xmlns="http://www.w3.org/2000/svg" width="${S}" height="${x}" viewBox="0 0 ${S} ${x}">
|
|
373
|
+
${P.join(`
|
|
374
|
+
`)}
|
|
375
|
+
</svg>`},undo:()=>v({type:"UNDO"}),redo:()=>v({type:"REDO"}),setZoom:S=>{v({type:"SET_ZOOM",zoom:Math.max(d,Math.min(u,S))})},fitToScreen:()=>{const S=p.current,x=m.current;if(!S||!x)return;const P=S.clientWidth/x.naturalWidth,A=S.clientHeight/x.naturalHeight,E=Math.min(P,A,1);v({type:"SET_ZOOM",zoom:E}),v({type:"SET_PAN",panX:0,panY:0})},clear:()=>v({type:"CLEAR"})}),[g.annotations,z,d,u]);const L=o.useCallback(S=>{if(S.touches.length!==1)return;const x=S.touches[0];D({clientX:x.clientX,clientY:x.clientY,preventDefault:()=>{}})},[D]),M=o.useCallback(S=>{if(S.touches.length!==1)return;const x=S.touches[0];b({clientX:x.clientX,clientY:x.clientY})},[b]);return a.jsx("div",{ref:p,className:`nice-image-annotator ${l??""}`,style:{position:"relative",overflow:"hidden",width:"100%",height:"100%"},children:a.jsx("canvas",{ref:f,className:"nice-image-annotator__canvas",style:{cursor:g.activeTool==="select"?"default":"crosshair"},onMouseDown:D,onMouseMove:b,onMouseUp:T,onMouseLeave:T,onWheel:R,onTouchStart:L,onTouchMove:M,onTouchEnd:T,role:"img","aria-label":t})})});gi.displayName="NiceImageAnnotator";const Bn=o.forwardRef(({options:e,value:t=[],onChange:n,placeholder:i,disabled:r,size:s="md",className:l,style:c,id:d},u)=>{const y=we(d),{t:f}=ke(),[p,m]=o.useState(!1),w=o.useMemo(()=>{const $=[e];let g=e;for(const v of t){const N=g.find(j=>j.value===v);if(N!=null&&N.children)$.push(N.children),g=N.children;else break}return $},[e,t]),k=o.useCallback(($,g)=>{var j;const v=[...t.slice(0,$),g],N=(j=w[$])==null?void 0:j.find(I=>I.value===g);(!(N!=null&&N.children)||N.children.length===0)&&m(!1),n==null||n(v)},[t,w,n]),z=t.length>0?t.map(($,g)=>{var v,N;return((N=(v=w[g])==null?void 0:v.find(j=>j.value===$))==null?void 0:N.label)??$}).join(" › "):i??f("controls.select","Select...");return a.jsxs("div",{ref:u,id:y,className:`nice-cascade-select nice-cascade-select--${s}${r?" nice-cascade-select--disabled":""} ${l||""}`,style:c,children:[a.jsxs("button",{type:"button",className:"nice-cascade-select__trigger",onClick:()=>!r&&m($=>!$),"aria-haspopup":"listbox","aria-expanded":p,disabled:r,children:[a.jsx("span",{className:`nice-cascade-select__display${t.length===0?" nice-cascade-select__display--placeholder":""}`,children:z}),a.jsx("span",{className:"nice-cascade-select__arrow",children:"▾"})]}),p&&a.jsx("div",{className:"nice-cascade-select__dropdown",children:w.map(($,g)=>a.jsx("div",{className:"nice-cascade-select__column",role:"listbox",children:$.map(v=>a.jsxs("div",{className:`nice-cascade-select__option${t[g]===v.value?" nice-cascade-select__option--selected":""}`,role:"option","aria-selected":t[g]===v.value,onClick:()=>k(g,v.value),children:[a.jsx("span",{children:v.label}),v.children&&v.children.length>0&&a.jsx("span",{className:"nice-cascade-select__chevron",children:"›"})]},v.value))},g))})]})});Bn.displayName="NiceCascadeSelect";const Hn=o.forwardRef(({columns:e,data:t,value:n,onChange:i,displayExpr:r="label",valueExpr:s="id",placeholder:l,disabled:c,size:d="md",filterable:u=!0,className:y,style:f,id:p},m)=>{const w=we(p),{t:k}=ke(),[z,$]=o.useState(!1),[g,v]=o.useState(""),N=o.useRef(null);o.useEffect(()=>{if(!z)return;const T=R=>{N.current&&!N.current.contains(R.target)&&$(!1)};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[z]);const j=o.useMemo(()=>{if(!u||!g)return t;const T=g.toLowerCase();return t.filter(R=>e.some(L=>String(R[L.field]??"").toLowerCase().includes(T)))},[t,g,e,u]),I=t.find(T=>String(T[s])===n),D=I?String(I[r]):"",b=o.useCallback(T=>{i==null||i(String(T[s])),$(!1),v("")},[i,s]);return a.jsx("div",{ref:m,id:w,className:`nice-mc-combo nice-mc-combo--${d}${c?" nice-mc-combo--disabled":""} ${y||""}`,style:f,children:a.jsxs("div",{ref:N,className:"nice-mc-combo__wrap",children:[a.jsx("input",{className:"nice-mc-combo__input",type:"text",value:z?g:D,placeholder:l??k("controls.select","Select..."),disabled:c,onFocus:()=>{$(!0),v("")},onChange:T=>v(T.target.value),"aria-autocomplete":"list","aria-expanded":z}),a.jsx("button",{type:"button",className:"nice-mc-combo__toggle",onClick:()=>!c&&$(T=>!T),tabIndex:-1,"aria-label":"Toggle",children:"▾"}),z&&a.jsx("div",{className:"nice-mc-combo__dropdown",children:a.jsxs("table",{className:"nice-mc-combo__table",children:[a.jsx("thead",{children:a.jsx("tr",{children:e.map(T=>a.jsx("th",{style:{width:T.width},children:T.header},T.field))})}),a.jsxs("tbody",{children:[j.map((T,R)=>a.jsx("tr",{className:`nice-mc-combo__row${String(T[s])===n?" nice-mc-combo__row--selected":""}`,onClick:()=>b(T),children:e.map(L=>a.jsx("td",{children:String(T[L.field]??"")},L.field))},R)),j.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:e.length,className:"nice-mc-combo__empty",children:k("controls.noData","No data")})})]})]})})]})})});Hn.displayName="NiceMultiColumnComboBox";const qn=o.forwardRef(({value:e,onChange:t,type:n="text",options:i=[],submitOnBlur:r=!0,placeholder:s,disabled:l,size:c="md",className:d,style:u,id:y},f)=>{var D;const p=we(y),[m,w]=o.useState(!1),[k,z]=o.useState(e),$=o.useRef(null);o.useEffect(()=>{z(e)},[e]),o.useEffect(()=>{m&&$.current&&$.current.focus()},[m]);const g=o.useCallback(()=>{l||(z(e),w(!0))},[l,e]),v=o.useCallback(()=>{w(!1),k!==e&&t(k)},[k,e,t]),N=o.useCallback(()=>{w(!1),z(e)},[e]),j=o.useCallback(b=>{b.key==="Enter"&&n!=="textarea"&&v(),b.key==="Escape"&&N()},[v,N,n]),I=n==="select"&&((D=i.find(b=>b.value===e))==null?void 0:D.label)||e;return a.jsx("div",{ref:f,id:p,className:`nice-inplace nice-inplace--${c}${l?" nice-inplace--disabled":""} ${d||""}`,style:u,children:m?a.jsxs("span",{className:"nice-inplace__editor",children:[n==="textarea"?a.jsx("textarea",{ref:$,className:"nice-inplace__input",value:k,onChange:b=>z(b.target.value),onBlur:r?v:void 0,onKeyDown:b=>b.key==="Escape"&&N(),rows:3}):n==="select"?a.jsx("select",{ref:$,className:"nice-inplace__input",value:k,onChange:b=>{z(b.target.value)},onBlur:r?v:void 0,onKeyDown:j,children:i.map(b=>a.jsx("option",{value:b.value,children:b.label},b.value))}):a.jsx("input",{ref:$,className:"nice-inplace__input",type:n==="number"?"number":n==="date"?"date":"text",value:k,onChange:b=>z(b.target.value),onBlur:r?v:void 0,onKeyDown:j}),a.jsx("button",{type:"button",className:"nice-inplace__save",onClick:v,"aria-label":"Save",children:"✓"}),a.jsx("button",{type:"button",className:"nice-inplace__cancel",onClick:N,"aria-label":"Cancel",children:"✕"})]}):a.jsxs("span",{className:"nice-inplace__display",onClick:g,role:"button",tabIndex:0,onKeyDown:b=>b.key==="Enter"&&g(),children:[I||a.jsx("span",{className:"nice-inplace__placeholder",children:s||"Click to edit"}),!l&&a.jsx("span",{className:"nice-inplace__icon",children:"✎"})]})})});qn.displayName="NiceInPlaceEditor";function dd(e){let t=e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");return t=t.replace(/```(\w*)\n([\s\S]*?)```/g,(n,i,r)=>`<pre><code class="language-${i}">${r.trim()}</code></pre>`),t=t.replace(/^(\|.+\|)\n(\|[-| :]+\|)\n((?:\|.+\|\n?)+)/gm,(n,i,r,s)=>{const l=i.split("|").filter(d=>d.trim()).map(d=>`<th>${d.trim()}</th>`).join(""),c=s.trim().split(`
|
|
376
|
+
`).map(d=>`<tr>${d.split("|").filter(u=>u.trim()).map(u=>`<td>${u.trim()}</td>`).join("")}</tr>`).join("");return`<table><thead><tr>${l}</tr></thead><tbody>${c}</tbody></table>`}),t=t.replace(/^#### (.+)$/gm,"<h4>$1</h4>"),t=t.replace(/^### (.+)$/gm,"<h3>$1</h3>"),t=t.replace(/^## (.+)$/gm,"<h2>$1</h2>"),t=t.replace(/^# (.+)$/gm,"<h1>$1</h1>"),t=t.replace(/^> (.+)$/gm,"<blockquote>$1</blockquote>"),t=t.replace(/^---$/gm,"<hr/>"),t=t.replace(/^- \[x\] (.+)$/gm,'<li class="task done">☑ $1</li>'),t=t.replace(/^- \[ \] (.+)$/gm,'<li class="task">☐ $1</li>'),t=t.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),t=t.replace(/\*(.+?)\*/g,"<em>$1</em>"),t=t.replace(/~~(.+?)~~/g,"<del>$1</del>"),t=t.replace(/`(.+?)`/g,"<code>$1</code>"),t=t.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,'<img src="$2" alt="$1" style="max-width:100%"/>'),t=t.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2">$1</a>'),t=t.replace(/^\- (.+)$/gm,"<li>$1</li>"),t=t.replace(/^\d+\. (.+)$/gm,"<li>$1</li>"),t=t.replace(/\n/g,"<br/>"),t}const ud=[{key:"bold",label:"B",md:"**",tip:"Bold",shortcut:"Ctrl+B",group:"format"},{key:"italic",label:"I",md:"*",tip:"Italic",shortcut:"Ctrl+I",group:"format"},{key:"strike",label:"S̶",md:"~~",tip:"Strikethrough",group:"format"},{key:"code",label:"< >",md:"`",tip:"Inline code",group:"format"},{key:"h1",label:"H1",md:"# ",tip:"Heading 1",group:"heading"},{key:"h2",label:"H2",md:"## ",tip:"Heading 2",group:"heading"},{key:"h3",label:"H3",md:"### ",tip:"Heading 3",group:"heading"},{key:"ul",label:"•",md:"- ",tip:"Unordered list",group:"list"},{key:"ol",label:"1.",md:"1. ",tip:"Ordered list",group:"list"},{key:"task",label:"☑",md:"- [ ] ",tip:"Task list",group:"list"},{key:"quote",label:"❝",md:"> ",tip:"Blockquote",group:"block"},{key:"hr",label:"—",md:`---
|
|
377
|
+
`,tip:"Horizontal rule",group:"block"},{key:"link",label:"🔗",md:"[](url)",tip:"Link",shortcut:"Ctrl+K",group:"insert"},{key:"image",label:"🖼",md:"",tip:"Image",group:"insert"},{key:"table",label:"⊞",md:`| H1 | H2 | H3 |
|
|
378
|
+
| --- | --- | --- |
|
|
379
|
+
| c1 | c2 | c3 |
|
|
380
|
+
`,tip:"Table",group:"insert"},{key:"codeblock",label:"```",md:"```\n",tip:"Code block",group:"insert"}],pd=["format","heading","list","block","insert"],Wn=o.forwardRef(({value:e="",onChange:t,preview:n="side",placeholder:i,disabled:r,readOnly:s,size:l="md",editorSize:c="standard",toolbar:d=!0,minHeight:u=200,showWordCount:y=!1,showLineNumbers:f=!1,onExportHtml:p,onImageUpload:m,className:w,style:k,id:z},$)=>{const g=we(z),[v,N]=o.useState("edit"),[j,I]=o.useState(!1),D=o.useRef(null),b=o.useMemo(()=>dd(e),[e]),T=o.useMemo(()=>{const A=e.trim()?e.trim().split(/\s+/).length:0,E=e.length,h=e.split(`
|
|
381
|
+
`).length;return{words:A,chars:E,lines:h}},[e]),R=o.useCallback(A=>{const E=D.current;if(!E)return;const h=E.selectionStart,C=E.selectionEnd,_=e.slice(h,C);let F,O;A==="[](url)"?(F=e.slice(0,h)+`[${_||"text"}](url)`+e.slice(C),O=h+1+(_||"text").length+2):A===""?(F=e.slice(0,h)+``+e.slice(C),O=h+2+(_||"alt").length+2):A.endsWith(`
|
|
382
|
+
`)||A.endsWith(" ")?(F=e.slice(0,h)+A+_+e.slice(C),O=h+A.length+_.length):(F=e.slice(0,h)+A+_+A+e.slice(C),O=h+A.length+_.length+A.length),t==null||t(F),requestAnimationFrame(()=>{E.focus(),E.setSelectionRange(O,O)})},[e,t]),L=o.useCallback(A=>{if((A.ctrlKey||A.metaKey)&&(A.key==="b"?(A.preventDefault(),R("**")):A.key==="i"?(A.preventDefault(),R("*")):A.key==="k"&&(A.preventDefault(),R("[](url)"))),A.key==="Tab"){A.preventDefault();const E=A.currentTarget,h=E.selectionStart,C=E.selectionEnd,_=" ";if(A.shiftKey){const F=e.slice(0,h).lastIndexOf(`
|
|
383
|
+
`)+1;if(e.slice(F,F+_.length)===_){const O=e.slice(0,F)+e.slice(F+_.length);t==null||t(O),requestAnimationFrame(()=>{E.selectionStart=E.selectionEnd=h-_.length})}}else{const F=e.slice(0,h)+_+e.slice(C);t==null||t(F),requestAnimationFrame(()=>{E.selectionStart=E.selectionEnd=h+_.length})}}},[e,t,R]),M=o.useCallback(async A=>{if(!m)return;const E=Array.from(A.dataTransfer.files).filter(h=>h.type.startsWith("image/"));if(E.length!==0){A.preventDefault();for(const h of E){const C=await m(h),_=D.current;if(!_)continue;const F=_.selectionStart,O=`
|
|
384
|
+
`,H=e.slice(0,F)+O+e.slice(F);t==null||t(H)}}},[e,t,m]),S=n!=="tab"||v==="edit",x=n==="side"||n==="tab"&&v==="preview"||n===!0,P=`nice-md-editor nice-md-editor--${l} nice-editor--${c} nice-md-editor--preview-${n}${j?" nice-md-editor--fullscreen":""} ${w||""}`;return a.jsxs("div",{ref:$,id:g,className:P,style:k,children:[d&&a.jsxs("div",{className:"nice-md-editor__toolbar",children:[pd.map((A,E)=>a.jsxs(o.Fragment,{children:[E>0&&a.jsx("span",{className:"nice-md-editor__sep"}),ud.filter(h=>h.group===A).map(h=>a.jsx("button",{type:"button",className:"nice-md-editor__btn",title:h.shortcut?`${h.tip} (${h.shortcut})`:h.tip,disabled:r||s,onClick:()=>R(h.md),children:h.label},h.key))]},A)),a.jsx("span",{className:"nice-md-editor__sep"}),a.jsx("button",{type:"button",className:"nice-md-editor__btn",title:"Fullscreen",onClick:()=>I(!j),children:j?"⊙":"⛶"}),p&&a.jsx("button",{type:"button",className:"nice-md-editor__btn",title:"Export HTML",onClick:()=>p(b),children:"↗"}),n==="tab"&&a.jsxs("span",{className:"nice-md-editor__tabs",children:[a.jsx("button",{type:"button",className:`nice-md-editor__tab${v==="edit"?" nice-md-editor__tab--active":""}`,onClick:()=>N("edit"),children:"Edit"}),a.jsx("button",{type:"button",className:`nice-md-editor__tab${v==="preview"?" nice-md-editor__tab--active":""}`,onClick:()=>N("preview"),children:"Preview"})]})]}),a.jsxs("div",{className:"nice-md-editor__body",style:{minHeight:u},children:[S&&a.jsxs("div",{className:"nice-md-editor__editor-wrap",children:[f&&a.jsx("div",{className:"nice-md-editor__line-numbers",children:Array.from({length:T.lines},(A,E)=>a.jsx("div",{className:"nice-md-editor__line-no",children:E+1},E))}),a.jsx("textarea",{ref:D,className:"nice-md-editor__textarea",value:e,onChange:A=>t==null?void 0:t(A.target.value),onKeyDown:L,onDrop:M,placeholder:i,disabled:r,readOnly:s,style:{minHeight:u}})]}),x&&a.jsx("div",{className:"nice-md-editor__preview",dangerouslySetInnerHTML:{__html:Zt(b)},style:{minHeight:u}})]}),y&&a.jsxs("div",{className:"nice-md-editor__statusbar",children:[a.jsxs("span",{children:[T.words," words"]}),a.jsxs("span",{children:[T.chars," chars"]}),a.jsxs("span",{children:[T.lines," lines"]})]})]})});Wn.displayName="NiceMarkdownEditor";const Sa={rotation:0,flipH:!1,flipV:!1,brightness:100,contrast:100,saturate:100,blur:0,crop:null,annotations:[]},md=["crop","rotate","flip","brightness","contrast","saturate","blur","annotate"],Vn=o.forwardRef(({src:e,size:t="md",editorSize:n="standard",tools:i=md,showToolbar:r=!0,showZoom:s=!0,maxUndo:l=30,onSave:c,onCancel:d,onChange:u,width:y="100%",height:f=500,className:p,style:m,id:w,...k},z)=>{const $=we(w),{t:g}=ke(),v=o.useRef(null),N=o.useRef(null),[j,I]=o.useState({...Sa}),[D,b]=o.useState(null),[T,R]=o.useState(!1),[L,M]=o.useState(1),[S,x]=o.useState("rect"),[P,A]=o.useState("#ff0000"),[E,h]=o.useState({w:0,h:0}),[C,_]=o.useState([]),[F,O]=o.useState([]),[H,V]=o.useState(null),[U,B]=o.useState(null),[W,Q]=o.useState(null),Z=o.useCallback(K=>{_(Y=>[...Y.slice(-(l-1)),K]),O([])},[l]),X=o.useCallback(K=>{I(Y=>{Z(Y);const G={...Y,...K};return u==null||u(G),G})},[u,Z]),oe=o.useCallback(()=>{if(C.length===0)return;const K=C[C.length-1];_(Y=>Y.slice(0,-1)),O(Y=>[...Y,j]),I(K),u==null||u(K)},[C,j,u]),re=o.useCallback(()=>{if(F.length===0)return;const K=F[F.length-1];O(Y=>Y.slice(0,-1)),_(Y=>[...Y,j]),I(K),u==null||u(K)},[F,j,u]);o.useEffect(()=>{const K=new Image;K.crossOrigin="anonymous",K.onload=()=>{N.current=K,h({w:K.width,h:K.height}),R(!0)},K.src=e},[e]),o.useEffect(()=>{if(!T||!v.current||!N.current)return;const K=v.current,Y=K.getContext("2d");if(!Y)return;const G=N.current,ee=j.rotation%180!==0,ce=ee?G.height:G.width,ge=ee?G.width:G.height;K.width=ce,K.height=ge,Y.clearRect(0,0,ce,ge),Y.save(),Y.filter=`brightness(${j.brightness}%) contrast(${j.contrast}%) saturate(${j.saturate}%) blur(${j.blur}px)`,Y.translate(ce/2,ge/2),Y.rotate(j.rotation*Math.PI/180),Y.scale(j.flipH?-1:1,j.flipV?-1:1),Y.drawImage(G,-G.width/2,-G.height/2),Y.restore(),j.annotations.forEach(de=>{switch(Y.save(),Y.strokeStyle=de.color??"red",Y.fillStyle=de.color??"red",Y.lineWidth=de.strokeWidth??2,Y.font=`${de.fontSize??16}px sans-serif`,de.type){case"text":Y.fillText(de.text??"",de.x,de.y);break;case"rect":Y.strokeRect(de.x,de.y,de.width??100,de.height??50);break;case"circle":{const ie=(de.width??50)/2,be=(de.height??50)/2;Y.beginPath(),Y.ellipse(de.x+ie,de.y+be,ie,be,0,0,Math.PI*2),Y.stroke();break}case"line":Y.beginPath(),Y.moveTo(de.x,de.y),Y.lineTo(de.x+(de.width??100),de.y+(de.height??0)),Y.stroke();break;case"arrow":{const ie=de.x+(de.width??100),be=de.y+(de.height??0);Y.beginPath(),Y.moveTo(de.x,de.y),Y.lineTo(ie,be),Y.stroke();const ye=Math.atan2(be-de.y,ie-de.x),_e=10;Y.beginPath(),Y.moveTo(ie,be),Y.lineTo(ie-_e*Math.cos(ye-.4),be-_e*Math.sin(ye-.4)),Y.lineTo(ie-_e*Math.cos(ye+.4),be-_e*Math.sin(ye+.4)),Y.closePath(),Y.fill();break}}Y.restore()}),U&&(Y.save(),Y.fillStyle="rgba(0,0,0,0.5)",Y.fillRect(0,0,ce,ge),Y.clearRect(U.x,U.y,U.w,U.h),Y.strokeStyle="#fff",Y.lineWidth=2,Y.setLineDash([5,5]),Y.strokeRect(U.x,U.y,U.w,U.h),Y.restore())},[T,j,U]);const he=o.useCallback(K=>{if(!v.current)return;const Y=v.current.getBoundingClientRect(),G=v.current.width/Y.width,ee=v.current.height/Y.height,ce=(K.clientX-Y.left)*G,ge=(K.clientY-Y.top)*ee;D==="crop"?V({startX:ce,startY:ge}):D==="annotate"&&Q({startX:ce,startY:ge})},[D]),J=o.useCallback(K=>{if(!v.current)return;const Y=v.current.getBoundingClientRect(),G=v.current.width/Y.width,ee=v.current.height/Y.height,ce=(K.clientX-Y.left)*G,ge=(K.clientY-Y.top)*ee;H&&B({x:Math.min(H.startX,ce),y:Math.min(H.startY,ge),w:Math.abs(ce-H.startX),h:Math.abs(ge-H.startY)})},[H]),le=o.useCallback(K=>{if(H&&U&&U.w>5&&U.h>5&&X({crop:{x:U.x,y:U.y,width:U.w,height:U.h}}),V(null),W&&v.current){const Y=v.current.getBoundingClientRect(),G=v.current.width/Y.width,ee=v.current.height/Y.height,ce=(K.clientX-Y.left)*G,ge=(K.clientY-Y.top)*ee,de=ce-W.startX,ie=ge-W.startY;if(Math.abs(de)>3||Math.abs(ie)>3||S==="text"){const be={type:S,x:W.startX,y:W.startY,width:Math.abs(de)||100,height:Math.abs(ie)||50,color:P,strokeWidth:2,text:S==="text"?prompt(g("imageEditor.annotationText","Text:"))??"":void 0};X({annotations:[...j.annotations,be]})}Q(null)}},[H,U,W,S,P,j.annotations,X,g]),pe=o.useCallback(()=>{if(!j.crop||!v.current)return;const K=v.current,Y=K.getContext("2d");if(!Y)return;const{x:G,y:ee,width:ce,height:ge}=j.crop,de=Y.getImageData(G,ee,ce,ge);K.width=ce,K.height=ge,Y.putImageData(de,0,0),B(null),b(null)},[j.crop]),me=o.useCallback(()=>{if(!v.current)return;const K=v.current.toDataURL("image/png");c==null||c(K,j)},[c,j]),ve=o.useCallback(()=>{I({...Sa}),B(null),b(null)},[]);return o.useMemo(()=>`brightness(${j.brightness}%) contrast(${j.contrast}%) saturate(${j.saturate}%) blur(${j.blur}px)`,[j.brightness,j.contrast,j.saturate,j.blur]),a.jsxs("div",{ref:z,id:$,className:`nice-image-editor nice-image-editor--${t} nice-editor--${n} ${p??""}`,style:{...m,width:y,height:f},role:"application","aria-label":g("imageEditor.label","Image Editor"),...k,children:[r&&a.jsxs("div",{className:"nice-image-editor__toolbar",role:"toolbar",children:[a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:oe,disabled:C.length===0,title:g("imageEditor.undo","Undo"),children:"↶"}),a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:re,disabled:F.length===0,title:g("imageEditor.redo","Redo"),children:"↷"}),a.jsx("span",{className:"nice-image-editor__sep"}),i.includes("rotate")&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>X({rotation:(j.rotation-90+360)%360}),title:g("imageEditor.rotateLeft","Rotate left"),children:"↺"}),a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>X({rotation:(j.rotation+90)%360}),title:g("imageEditor.rotateRight","Rotate right"),children:"↻"})]}),i.includes("flip")&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>X({flipH:!j.flipH}),title:g("imageEditor.flipH","Flip horizontal"),children:"⇔"}),a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>X({flipV:!j.flipV}),title:g("imageEditor.flipV","Flip vertical"),children:"⇕"})]}),i.includes("crop")&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:`nice-image-editor__btn ${D==="crop"?"nice-image-editor__btn--active":""}`,onClick:()=>b(D==="crop"?null:"crop"),title:g("imageEditor.crop","Crop"),children:"⊡"}),D==="crop"&&j.crop&&a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:pe,title:g("imageEditor.applyCrop","Apply crop"),children:"✓"})]}),i.includes("brightness")&&a.jsxs("label",{className:"nice-image-editor__slider-label",children:[g("imageEditor.brightness","☀"),a.jsx("input",{type:"range",min:0,max:200,value:j.brightness,onChange:K=>X({brightness:Number(K.target.value)}),className:"nice-image-editor__slider",title:g("imageEditor.brightness","Brightness")})]}),i.includes("contrast")&&a.jsxs("label",{className:"nice-image-editor__slider-label",children:[g("imageEditor.contrast","◑"),a.jsx("input",{type:"range",min:0,max:200,value:j.contrast,onChange:K=>X({contrast:Number(K.target.value)}),className:"nice-image-editor__slider",title:g("imageEditor.contrast","Contrast")})]}),i.includes("saturate")&&a.jsxs("label",{className:"nice-image-editor__slider-label",children:[g("imageEditor.saturate","🎨"),a.jsx("input",{type:"range",min:0,max:200,value:j.saturate,onChange:K=>X({saturate:Number(K.target.value)}),className:"nice-image-editor__slider",title:g("imageEditor.saturate","Saturation")})]}),i.includes("blur")&&a.jsxs("label",{className:"nice-image-editor__slider-label",children:[g("imageEditor.blur","⊘"),a.jsx("input",{type:"range",min:0,max:20,step:.5,value:j.blur,onChange:K=>X({blur:Number(K.target.value)}),className:"nice-image-editor__slider",title:g("imageEditor.blur","Blur")})]}),i.includes("annotate")&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"nice-image-editor__sep"}),a.jsx("button",{type:"button",className:`nice-image-editor__btn ${D==="annotate"?"nice-image-editor__btn--active":""}`,onClick:()=>b(D==="annotate"?null:"annotate"),title:g("imageEditor.annotate","Annotate"),children:"✎"}),D==="annotate"&&a.jsxs(a.Fragment,{children:[a.jsxs("select",{className:"nice-image-editor__select",value:S,onChange:K=>x(K.target.value),children:[a.jsx("option",{value:"rect",children:"□ Rect"}),a.jsx("option",{value:"circle",children:"○ Circle"}),a.jsx("option",{value:"line",children:"╱ Line"}),a.jsx("option",{value:"arrow",children:"→ Arrow"}),a.jsx("option",{value:"text",children:"T Text"})]}),a.jsx("input",{type:"color",value:P,onChange:K=>A(K.target.value),className:"nice-image-editor__color",title:g("imageEditor.color","Color")}),j.annotations.length>0&&a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>X({annotations:j.annotations.slice(0,-1)}),title:g("imageEditor.removeLastAnnotation","Remove last"),children:"⌫"})]})]}),a.jsx("span",{className:"nice-image-editor__sep"}),a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:ve,title:g("imageEditor.reset","Reset"),children:"⟲"}),c&&a.jsx("button",{type:"button",className:"nice-image-editor__btn nice-image-editor__btn--save",onClick:me,children:g("imageEditor.save","Save")}),d&&a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:d,children:g("imageEditor.cancel","Cancel")})]}),a.jsx("div",{className:"nice-image-editor__canvas-wrap",children:a.jsx("canvas",{ref:v,className:"nice-image-editor__canvas",onMouseDown:he,onMouseMove:J,onMouseUp:le,style:{cursor:D==="crop"||D==="annotate"?"crosshair":"default",transform:`scale(${L})`,transformOrigin:"center center"}})}),s&&a.jsxs("div",{className:"nice-image-editor__footer",children:[a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>M(K=>Math.max(.1,K-.1)),title:"Zoom out",children:"−"}),a.jsxs("span",{style:{fontSize:"0.85em",minWidth:40,textAlign:"center"},children:[Math.round(L*100),"%"]}),a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>M(K=>Math.min(5,K+.1)),title:"Zoom in",children:"+"}),a.jsx("button",{type:"button",className:"nice-image-editor__btn",onClick:()=>M(1),title:"Reset zoom",children:"1:1"}),a.jsx("span",{style:{flex:1}}),a.jsxs("span",{style:{fontSize:"0.8em",color:"var(--nice-text-secondary, #666)"},children:[E.w,"×",E.h,"px · ",j.rotation,"°"]})]})]})});Vn.displayName="NiceImageEditor";const Kn=o.forwardRef(({value:e,onChange:t,penColor:n="#000",penWidth:i=2,backgroundColor:r="#fff",width:s=400,height:l=200,size:c="md",disabled:d=!1,readOnly:u=!1,showClear:y=!0,showUndo:f=!0,label:p,exportFormat:m="image/png",className:w,style:k,id:z,...$},g)=>{const v=we(z),{t:N}=ke(),j=o.useRef(null),[I,D]=o.useState(!1),b=o.useRef([]),T=o.useRef([]),[R,L]=o.useState(!0),M=o.useCallback(()=>{const C=j.current;if(!C)return;const _=C.getContext("2d");if(_){_.fillStyle=r,_.fillRect(0,0,C.width,C.height),_.strokeStyle=n,_.lineWidth=i,_.lineCap="round",_.lineJoin="round";for(const F of b.current)if(!(F.length<2)){_.beginPath(),_.moveTo(F[0].x,F[0].y);for(let O=1;O<F.length;O++)_.lineTo(F[O].x,F[O].y);_.stroke()}}},[r,n,i]);o.useEffect(()=>{if(e&&j.current){const C=new Image;C.onload=()=>{var F;const _=(F=j.current)==null?void 0:F.getContext("2d");!_||!j.current||(_.fillStyle=r,_.fillRect(0,0,j.current.width,j.current.height),_.drawImage(C,0,0),L(!1))},C.src=e}else e||(b.current=[],L(!0),M())},[e,r,M]),o.useEffect(()=>{const C=j.current;C&&(C.width=s,C.height=l,M())},[s,l,M]);const S=o.useCallback(C=>{const _=j.current,F=_.getBoundingClientRect(),O=_.width/F.width,H=_.height/F.height;if("touches"in C){const V=C.touches[0];return{x:(V.clientX-F.left)*O,y:(V.clientY-F.top)*H}}return{x:(C.clientX-F.left)*O,y:(C.clientY-F.top)*H}},[]),x=o.useCallback(C=>{if(d||u)return;C.preventDefault();const _=S(C);T.current=[_],D(!0)},[d,u,S]),P=o.useCallback(C=>{if(!I)return;C.preventDefault();const _=S(C);T.current.push(_);const F=j.current,O=F==null?void 0:F.getContext("2d");if(!O||!F)return;const H=T.current;H.length>=2&&(O.strokeStyle=n,O.lineWidth=i,O.lineCap="round",O.beginPath(),O.moveTo(H[H.length-2].x,H[H.length-2].y),O.lineTo(_.x,_.y),O.stroke())},[I,S,n,i]),A=o.useCallback(()=>{if(I&&(D(!1),T.current.length>0&&(b.current.push([...T.current]),T.current=[],L(!1),j.current))){const C=j.current.toDataURL(m);t==null||t(C)}},[I,m,t]),E=o.useCallback(()=>{b.current=[],T.current=[],L(!0),M(),t==null||t(null)},[M,t]),h=o.useCallback(()=>{if(b.current.length!==0&&(b.current.pop(),L(b.current.length===0),M(),j.current)){const C=b.current.length>0?j.current.toDataURL(m):null;t==null||t(C)}},[M,m,t]);return a.jsxs("div",{ref:g,id:v,className:`nice-signature nice-signature--${c} ${d?"nice-signature--disabled":""} ${u?"nice-signature--readonly":""} ${w??""}`,style:k,...$,children:[p&&a.jsx("label",{className:"nice-signature__label",children:p}),a.jsx("div",{className:"nice-signature__canvas-wrap",style:{width:s,height:l},children:a.jsx("canvas",{ref:j,className:"nice-signature__canvas",onMouseDown:x,onMouseMove:P,onMouseUp:A,onMouseLeave:A,onTouchStart:x,onTouchMove:P,onTouchEnd:A,style:{touchAction:"none",cursor:d||u?"default":"crosshair"},"aria-label":p??N("signature.label","Signature pad"),role:"img"})}),(y||f)&&!u&&!d&&a.jsxs("div",{className:"nice-signature__actions",children:[f&&a.jsx("button",{type:"button",className:"nice-signature__btn",onClick:h,disabled:R,children:N("signature.undo","Undo")}),y&&a.jsx("button",{type:"button",className:"nice-signature__btn",onClick:E,disabled:R,children:N("signature.clear","Clear")})]})]})});Kn.displayName="NiceSignaturePad";const yi=o.createContext(null),bi=()=>{const e=o.useContext(yi);if(!e)throw new Error("useUploadContext must be used within NiceFileUpload");return e},hd=()=>`file-${Date.now()}-${Math.random().toString(36).slice(2,11)}`,Mt=e=>{if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB","TB"],i=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,i)).toFixed(2))+" "+n[i]},xi=e=>e.startsWith("image/")?"🖼️":e.startsWith("video/")?"🎬":e.startsWith("audio/")?"🎵":e.includes("pdf")?"📄":e.includes("word")||e.includes("document")?"📝":e.includes("excel")||e.includes("spreadsheet")?"📊":e.includes("powerpoint")||e.includes("presentation")?"📽️":e.includes("zip")||e.includes("rar")||e.includes("7z")?"📦":e.includes("text/")||e.includes("json")||e.includes("xml")?"📃":"📁",vi=e=>e.startsWith("image/"),wi=e=>e.startsWith("video/"),fd=e=>e.startsWith("audio/"),gd=e=>{if(vi(e.type)||wi(e.type)||fd(e.type))return URL.createObjectURL(e)},yd=(e,t)=>async n=>{const i=new FormData;n.chunk?(i.append("chunk",n.chunk),i.append("chunkIndex",String(n.chunkIndex)),i.append("totalChunks",String(n.totalChunks)),i.append("fileName",n.file.name),i.append("fileId",n.fileId||"")):i.append("file",n.file);const r=new XMLHttpRequest;return new Promise((s,l)=>{r.upload.addEventListener("progress",c=>{c.lengthComputable&&n.onProgress&&n.onProgress(c.loaded/c.total*100)}),r.addEventListener("load",()=>{if(r.status>=200&&r.status<300)try{const c=JSON.parse(r.responseText);s({success:!0,url:c.url,fileId:c.fileId||c.id,metadata:c})}catch{s({success:!0,url:r.responseText})}else s({success:!1,error:`Upload failed: ${r.status} ${r.statusText}`})}),r.addEventListener("error",()=>{s({success:!1,error:"Network error"})}),r.addEventListener("abort",()=>{s({success:!1,error:"Upload cancelled"})}),n.signal&&n.signal.addEventListener("abort",()=>r.abort()),r.open("POST",e),t&&Object.entries(t).forEach(([c,d])=>{r.setRequestHeader(c,d)}),r.send(i)})},sn=({progress:e,status:t})=>{const n=()=>{switch(t){case"success":return"#22c55e";case"error":return"#ef4444";case"cancelled":return"#6b7280";default:return"#3b82f6"}};return a.jsxs("div",{className:"nice-upload-progress",children:[a.jsx("div",{className:"nice-upload-progress-bar",style:{width:`${e}%`,backgroundColor:n()}}),a.jsxs("span",{className:"nice-upload-progress-text",children:[Math.round(e),"%"]})]})},Ca=({file:e,size:t="md",customRender:n})=>{if(n)return a.jsx(a.Fragment,{children:n(e)});const i={xxs:24,xs:32,sm:48,md:80,lg:120,xl:160,xxl:200}[t]??80;return e.previewUrl&&vi(e.type)?a.jsx("div",{className:"nice-upload-preview",style:{width:i,height:i},children:a.jsx("img",{src:e.previewUrl,alt:e.name,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:4}})}):e.previewUrl&&wi(e.type)?a.jsxs("div",{className:"nice-upload-preview",style:{width:i,height:i},children:[a.jsx("video",{src:e.previewUrl,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:4},muted:!0}),a.jsx("span",{className:"nice-upload-preview-overlay",children:"▶️"})]}):a.jsx("div",{className:"nice-upload-preview nice-upload-preview-icon",style:{width:i,height:i,fontSize:i*.5},children:xi(e.type)})},bd=({file:e,actions:t,showPreview:n=!0,previewSize:i="md",customRenderPreview:r,customRender:s,mode:l="list"})=>{const{disabled:c,readOnly:d}=bi();if(s)return a.jsx(a.Fragment,{children:s(e,t)});const u=()=>{switch(e.status){case"pending":return a.jsx("span",{className:"nice-upload-badge pending",children:"Oczekuje"});case"uploading":return a.jsx("span",{className:"nice-upload-badge uploading",children:"Wysyłanie..."});case"success":return a.jsx("span",{className:"nice-upload-badge success",children:"✓ Przesłano"});case"error":return a.jsx("span",{className:"nice-upload-badge error",children:"✗ Błąd"});case"cancelled":return a.jsx("span",{className:"nice-upload-badge cancelled",children:"Anulowano"})}};return l==="compact"?a.jsxs("div",{className:`nice-upload-item compact ${e.status}`,children:[a.jsx("span",{className:"nice-upload-item-icon",children:xi(e.type)}),a.jsx("span",{className:"nice-upload-item-name",title:e.name,children:e.name}),a.jsx("span",{className:"nice-upload-item-size",children:Mt(e.size)}),e.status==="uploading"&&a.jsx(sn,{progress:e.progress,status:e.status}),u(),!d&&!c&&e.status!=="uploading"&&a.jsx("button",{className:"nice-upload-item-remove",onClick:t.remove,title:"Usuń",children:"✕"})]}):l==="grid"?a.jsxs("div",{className:`nice-upload-item grid ${e.status}`,children:[n&&a.jsx(Ca,{file:e,size:"lg",customRender:r}),a.jsxs("div",{className:"nice-upload-item-info",children:[a.jsx("span",{className:"nice-upload-item-name",title:e.name,children:e.name}),a.jsx("span",{className:"nice-upload-item-size",children:Mt(e.size)})]}),e.status==="uploading"&&a.jsx(sn,{progress:e.progress,status:e.status}),u(),e.error&&a.jsx("span",{className:"nice-upload-item-error",children:e.error}),!d&&!c&&a.jsxs("div",{className:"nice-upload-item-actions",children:[e.status==="pending"&&a.jsx("button",{onClick:t.upload,className:"nice-upload-btn upload",children:"Wyślij"}),e.status==="uploading"&&a.jsx("button",{onClick:t.cancel,className:"nice-upload-btn cancel",children:"Anuluj"}),e.status==="error"&&a.jsx("button",{onClick:t.retry,className:"nice-upload-btn retry",children:"Ponów"}),e.status!=="uploading"&&a.jsx("button",{onClick:t.remove,className:"nice-upload-btn remove",children:"Usuń"})]})]}):a.jsxs("div",{className:`nice-upload-item list ${e.status}`,children:[n&&a.jsx(Ca,{file:e,size:i,customRender:r}),a.jsxs("div",{className:"nice-upload-item-content",children:[a.jsxs("div",{className:"nice-upload-item-header",children:[a.jsx("span",{className:"nice-upload-item-name",title:e.name,children:e.name}),u()]}),a.jsx("span",{className:"nice-upload-item-size",children:Mt(e.size)}),e.status==="uploading"&&a.jsx(sn,{progress:e.progress,status:e.status}),e.error&&a.jsx("span",{className:"nice-upload-item-error",children:e.error}),e.uploadedUrl&&a.jsx("a",{href:e.uploadedUrl,target:"_blank",rel:"noopener noreferrer",className:"nice-upload-item-link",children:"Otwórz plik"})]}),!d&&!c&&a.jsxs("div",{className:"nice-upload-item-actions",children:[e.status==="pending"&&a.jsx("button",{onClick:t.upload,className:"nice-upload-btn upload",title:"Wyślij",children:"⬆️"}),e.status==="uploading"&&a.jsx("button",{onClick:t.cancel,className:"nice-upload-btn cancel",title:"Anuluj",children:"⏹️"}),e.status==="error"&&a.jsx("button",{onClick:t.retry,className:"nice-upload-btn retry",title:"Ponów",children:"🔄"}),e.status!=="uploading"&&a.jsx("button",{onClick:t.remove,className:"nice-upload-btn remove",title:"Usuń",children:"🗑️"})]})]})},xd=({files:e,mode:t="list",showPreview:n=!0,previewSize:i,renderPreview:r,renderFileItem:s})=>{const l=bi();return e.length===0?null:a.jsx("div",{className:`nice-upload-list ${t}`,children:e.map(c=>a.jsx(bd,{file:c,actions:{upload:()=>l.uploadFile(c.id),cancel:()=>l.cancelFile(c.id),retry:()=>l.retryFile(c.id),remove:()=>l.removeFile(c.id)},mode:t,showPreview:n,previewSize:i,customRenderPreview:r,customRender:s},c.id))})},vd=({onFiles:e,accept:t,multiple:n=!0,disabled:i,readOnly:r,dropzoneText:s="Przeciągnij pliki tutaj lub",browseText:l="wybierz z dysku",dragActiveText:c="Upuść pliki tutaj",className:d,inputRef:u})=>{const[y,f]=o.useState(!1),p=o.useRef(0),m=o.useCallback(v=>{v.preventDefault(),v.stopPropagation(),p.current++,v.dataTransfer.items&&v.dataTransfer.items.length>0&&f(!0)},[]),w=o.useCallback(v=>{v.preventDefault(),v.stopPropagation(),p.current--,p.current===0&&f(!1)},[]),k=o.useCallback(v=>{v.preventDefault(),v.stopPropagation()},[]),z=o.useCallback(v=>{if(v.preventDefault(),v.stopPropagation(),f(!1),p.current=0,i||r)return;const N=Array.from(v.dataTransfer.files);N.length>0&&e(n?N:[N[0]])},[i,r,n,e]),$=o.useCallback(()=>{!i&&!r&&u.current&&u.current.click()},[i,r,u]),g=o.useCallback(v=>{const N=v.target.files?Array.from(v.target.files):[];N.length>0&&e(N),u.current&&(u.current.value="")},[e,u]);return a.jsxs("div",{className:`nice-upload-dropzone ${y?"drag-active":""} ${i?"disabled":""} ${r?"readonly":""} ${d||""}`,onDragEnter:m,onDragLeave:w,onDragOver:k,onDrop:z,onClick:$,children:[a.jsx("input",{ref:u,type:"file",accept:t,multiple:n,onChange:g,style:{display:"none"},disabled:i||r}),a.jsxs("div",{className:"nice-upload-dropzone-content",children:[a.jsx("span",{className:"nice-upload-dropzone-icon",children:"📁"}),y?a.jsx("span",{className:"nice-upload-dropzone-text active",children:c}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"nice-upload-dropzone-text",children:s}),a.jsx("button",{type:"button",className:"nice-upload-browse-btn",disabled:i||r,children:l})]})]})]})},ki=o.forwardRef((e,t)=>{const{accept:n,multiple:i=!0,maxFileSize:r,maxFiles:s,minFileSize:l,chunkSize:c=5*1024*1024,chunkThreshold:d=10*1024*1024,autoUpload:u=!1,uploadHandler:y,uploadUrl:f,uploadHeaders:p,onFilesAdded:m,onUploadComplete:w,onUploadError:k,onProgress:z,onFileRemoved:$,onChange:g,renderPreview:v,renderFileItem:N,showPreview:j=!0,showFileList:I=!0,listMode:D="list",previewSize:b="md",dropzoneText:T,browseText:R,dragActiveText:L,disabled:M,readOnly:S,dropzoneClassName:x,maxRetries:P=3,concurrentUploads:A=3,validateFile:E,keepFilesAfterUpload:h=!0,initialFiles:C=[],className:_,style:F,...O}=e,[H,V]=o.useState(C),U=o.useRef(null),B=o.useRef(new Map),W=o.useRef([]),Q=o.useRef(new Set);o.useEffect(()=>()=>{H.forEach(ie=>{ie.previewUrl&&URL.revokeObjectURL(ie.previewUrl)})},[]),o.useEffect(()=>{g==null||g(H)},[H,g]);const Z=o.useCallback(()=>y||(f?yd(f,p):null),[y,f,p]),X=o.useCallback(ie=>{var be;if(E){const ye=E(ie);if(ye)return ye}if(r&&ie.size>r)return`Plik jest za duży. Maksymalny rozmiar: ${Mt(r)}`;if(l&&ie.size<l)return`Plik jest za mały. Minimalny rozmiar: ${Mt(l)}`;if(n){const ye=n.split(",").map(Ce=>Ce.trim().toLowerCase()),_e=ie.type.toLowerCase(),je="."+((be=ie.name.split(".").pop())==null?void 0:be.toLowerCase());if(!ye.some(Ce=>Ce.startsWith(".")?je===Ce:Ce.endsWith("/*")?_e.startsWith(Ce.replace("/*","/")):_e===Ce))return`Niedozwolony typ pliku. Akceptowane typy: ${n}`}return null},[E,r,l,n]),oe=o.useCallback(ie=>{if(M||S)return;const be=H.length;let ye=ie;s&&be+ye.length>s&&(ye=ye.slice(0,s-be));const _e=ye.map(je=>{const Ce=X(je);return{id:hd(),file:je,name:je.name,size:je.size,type:je.type,status:Ce?"error":"pending",progress:0,error:Ce||void 0,previewUrl:gd(je)}});V(je=>[...je,..._e]),m==null||m(_e),u&&(_e.filter(je=>je.status==="pending").forEach(je=>{W.current.push(je.id)}),re())},[M,S,H.length,s,X,u,m]),re=o.useCallback(()=>{const ie=Z();if(ie)for(;W.current.length>0&&Q.current.size<A;){const be=W.current.shift();be&&he(be,ie)}},[A,Z]),he=o.useCallback(async(ie,be)=>{const ye=H.find(je=>je.id===ie);if(!ye||ye.status==="uploading"||ye.status==="success")return;const _e=new AbortController;B.current.set(ie,_e),Q.current.add(ie),V(je=>je.map(Ce=>Ce.id===ie?{...Ce,status:"uploading",progress:0,error:void 0}:Ce));try{const je=ye.file;let Ce;if(je.size>d?Ce=await J(ye,be,_e.signal):Ce=await be({file:je,onProgress:De=>{V(Te=>Te.map(qe=>qe.id===ie?{...qe,progress:De}:qe)),z==null||z(ye,De)},signal:_e.signal}),Ce.success)V(De=>De.map(Te=>Te.id===ie?{...Te,status:"success",progress:100,uploadedUrl:Ce.url,uploadedAt:new Date}:Te)),w==null||w({...ye,status:"success",uploadedUrl:Ce.url});else throw new Error(Ce.error||"Upload failed")}catch(je){if(je.name==="AbortError"||je.message==="Upload cancelled")V(Ce=>Ce.map(De=>De.id===ie?{...De,status:"cancelled",error:"Anulowano"}:De));else{const Ce=je.message||"Błąd uploadu";V(De=>De.map(Te=>Te.id===ie?{...Te,status:"error",error:Ce}:Te)),k==null||k(ye,Ce)}}finally{B.current.delete(ie),Q.current.delete(ie),re()}},[H,d,z,w,k,re]),J=async(ie,be,ye)=>{const _e=ie.file,je=Math.ceil(_e.size/c);let Ce=0,De={success:!1};for(let Te=0;Te<je;Te++){if(ye.aborted)throw new Error("Upload cancelled");const qe=Te*c,wt=Math.min(qe+c,_e.size),rt=_e.slice(qe,wt);let We=0,ot=!1;for(;!ot&&We<P;)try{De=await be({file:_e,chunk:rt,chunkIndex:Te,totalChunks:je,fileId:ie.id,onProgress:st=>{const Xe=(Ce+rt.size*st/100)/_e.size*100;V(Pe=>Pe.map(Le=>Le.id===ie.id?{...Le,progress:Xe}:Le))},signal:ye}),De.success?(ot=!0,Ce+=rt.size):We++}catch(st){if(We++,We>=P)throw st}if(!ot)throw new Error(`Failed to upload chunk ${Te+1}/${je}`)}return De},le=o.useCallback(ie=>{const be=Z();if(!be){console.error("No upload handler configured");return}he(ie,be)},[Z,he]),pe=o.useCallback(ie=>{const be=B.current.get(ie);be&&be.abort(),V(ye=>ye.map(_e=>_e.id===ie&&_e.status==="uploading"?{..._e,status:"cancelled",error:"Anulowano"}:_e))},[]),me=o.useCallback(ie=>{V(be=>be.map(ye=>ye.id===ie?{...ye,status:"pending",progress:0,error:void 0}:ye)),le(ie)},[le]),ve=o.useCallback(ie=>{const be=H.find(ye=>ye.id===ie);if(be){const ye=B.current.get(ie);ye&&ye.abort(),be.previewUrl&&URL.revokeObjectURL(be.previewUrl),V(_e=>_e.filter(je=>je.id!==ie)),$==null||$(be)}},[H,$]),K=o.useCallback(()=>{H.filter(ie=>ie.status==="pending").forEach(ie=>{W.current.push(ie.id)}),re()},[H,re]),Y=o.useCallback(()=>{B.current.forEach(ie=>ie.abort()),V(ie=>ie.map(be=>be.status==="uploading"?{...be,status:"cancelled",error:"Anulowano"}:be))},[]),G=o.useCallback(()=>{Y(),H.forEach(ie=>{ie.previewUrl&&URL.revokeObjectURL(ie.previewUrl)}),V([])},[Y,H]),ee=o.useCallback(()=>{H.filter(ie=>ie.status==="error").forEach(ie=>me(ie.id))},[H,me]),ce=o.useCallback(()=>{var ie;(ie=U.current)==null||ie.click()},[]);o.useImperativeHandle(t,()=>({addFiles:oe,uploadAll:K,cancelAll:Y,clearAll:G,getFiles:()=>H,getFile:ie=>H.find(be=>be.id===ie),retryFailed:ee,openFileBrowser:ce}),[oe,K,Y,G,H,ee,ce]);const ge=o.useMemo(()=>({files:H,uploadFile:le,cancelFile:pe,retryFile:me,removeFile:ve,disabled:M,readOnly:S}),[H,le,pe,me,ve,M,S]),de=o.useMemo(()=>({total:H.length,pending:H.filter(ie=>ie.status==="pending").length,uploading:H.filter(ie=>ie.status==="uploading").length,success:H.filter(ie=>ie.status==="success").length,error:H.filter(ie=>ie.status==="error").length}),[H]);return a.jsx(yi.Provider,{value:ge,children:a.jsxs("div",{className:`nice-file-upload ${M?"disabled":""} ${S?"readonly":""} ${_||""}`,style:F,...O,children:[!S&&a.jsx(vd,{onFiles:oe,accept:n,multiple:i,disabled:M,readOnly:S,dropzoneText:T,browseText:R,dragActiveText:L,className:x,inputRef:U}),I&&H.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"nice-upload-stats",children:[a.jsxs("span",{children:[de.total," ",de.total===1?"plik":"plików"]}),de.pending>0&&a.jsxs("span",{className:"pending",children:[de.pending," oczekuje"]}),de.uploading>0&&a.jsxs("span",{className:"uploading",children:[de.uploading," wysyłanie"]}),de.success>0&&a.jsxs("span",{className:"success",children:[de.success," przesłano"]}),de.error>0&&a.jsxs("span",{className:"error",children:[de.error," błędów"]})]}),!S&&!M&&de.pending>0&&a.jsxs("div",{className:"nice-upload-actions",children:[a.jsxs("button",{onClick:K,className:"nice-upload-btn primary",children:["Wyślij wszystkie (",de.pending,")"]}),de.error>0&&a.jsxs("button",{onClick:ee,className:"nice-upload-btn secondary",children:["Ponów nieudane (",de.error,")"]}),a.jsx("button",{onClick:G,className:"nice-upload-btn danger",children:"Wyczyść"})]}),a.jsx(xd,{files:H,mode:D,showPreview:j,previewSize:b,renderPreview:v,renderFileItem:N})]}),a.jsx("style",{children:`
|
|
385
|
+
.nice-file-upload {
|
|
386
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.nice-file-upload.disabled {
|
|
390
|
+
opacity: 0.5;
|
|
391
|
+
pointer-events: none;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.nice-upload-dropzone {
|
|
395
|
+
border: 2px dashed #d1d5db;
|
|
396
|
+
border-radius: 12px;
|
|
397
|
+
padding: 40px 24px;
|
|
398
|
+
text-align: center;
|
|
399
|
+
cursor: pointer;
|
|
400
|
+
transition: all 0.2s ease;
|
|
401
|
+
background: #fafafa;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.nice-upload-dropzone:hover:not(.disabled):not(.readonly) {
|
|
405
|
+
border-color: #3b82f6;
|
|
406
|
+
background: #eff6ff;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.nice-upload-dropzone.drag-active {
|
|
410
|
+
border-color: #3b82f6;
|
|
411
|
+
background: #dbeafe;
|
|
412
|
+
transform: scale(1.01);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
.nice-upload-dropzone.disabled,
|
|
416
|
+
.nice-upload-dropzone.readonly {
|
|
417
|
+
cursor: default;
|
|
418
|
+
background: #f3f4f6;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.nice-upload-dropzone-content {
|
|
422
|
+
display: flex;
|
|
423
|
+
flex-direction: column;
|
|
424
|
+
align-items: center;
|
|
425
|
+
gap: 12px;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.nice-upload-dropzone-icon {
|
|
429
|
+
font-size: 48px;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
.nice-upload-dropzone-text {
|
|
433
|
+
font-size: 14px;
|
|
434
|
+
color: #6b7280;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.nice-upload-dropzone-text.active {
|
|
438
|
+
font-size: 16px;
|
|
439
|
+
color: #3b82f6;
|
|
440
|
+
font-weight: 500;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.nice-upload-browse-btn {
|
|
444
|
+
background: #3b82f6;
|
|
445
|
+
color: white;
|
|
446
|
+
border: none;
|
|
447
|
+
padding: 8px 20px;
|
|
448
|
+
border-radius: 6px;
|
|
449
|
+
font-size: 14px;
|
|
450
|
+
cursor: pointer;
|
|
451
|
+
transition: background 0.2s;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.nice-upload-browse-btn:hover:not(:disabled) {
|
|
455
|
+
background: #2563eb;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.nice-upload-browse-btn:disabled {
|
|
459
|
+
background: #9ca3af;
|
|
460
|
+
cursor: not-allowed;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.nice-upload-stats {
|
|
464
|
+
display: flex;
|
|
465
|
+
gap: 16px;
|
|
466
|
+
padding: 12px 0;
|
|
467
|
+
font-size: 13px;
|
|
468
|
+
color: #6b7280;
|
|
469
|
+
border-bottom: 1px solid #e5e7eb;
|
|
470
|
+
margin-top: 16px;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.nice-upload-stats .pending { color: #f59e0b; }
|
|
474
|
+
.nice-upload-stats .uploading { color: #3b82f6; }
|
|
475
|
+
.nice-upload-stats .success { color: #22c55e; }
|
|
476
|
+
.nice-upload-stats .error { color: #ef4444; }
|
|
477
|
+
|
|
478
|
+
.nice-upload-actions {
|
|
479
|
+
display: flex;
|
|
480
|
+
gap: 8px;
|
|
481
|
+
padding: 12px 0;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.nice-upload-btn {
|
|
485
|
+
padding: 6px 14px;
|
|
486
|
+
border-radius: 6px;
|
|
487
|
+
font-size: 13px;
|
|
488
|
+
cursor: pointer;
|
|
489
|
+
border: 1px solid transparent;
|
|
490
|
+
transition: all 0.2s;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.nice-upload-btn.primary {
|
|
494
|
+
background: #3b82f6;
|
|
495
|
+
color: white;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
.nice-upload-btn.primary:hover {
|
|
499
|
+
background: #2563eb;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.nice-upload-btn.secondary {
|
|
503
|
+
background: white;
|
|
504
|
+
border-color: #d1d5db;
|
|
505
|
+
color: #374151;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
.nice-upload-btn.secondary:hover {
|
|
509
|
+
background: #f3f4f6;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
.nice-upload-btn.danger {
|
|
513
|
+
background: white;
|
|
514
|
+
border-color: #fca5a5;
|
|
515
|
+
color: #dc2626;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
.nice-upload-btn.danger:hover {
|
|
519
|
+
background: #fef2f2;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
.nice-upload-btn.upload { background: #22c55e; color: white; border: none; }
|
|
523
|
+
.nice-upload-btn.cancel { background: #f59e0b; color: white; border: none; }
|
|
524
|
+
.nice-upload-btn.retry { background: #3b82f6; color: white; border: none; }
|
|
525
|
+
.nice-upload-btn.remove { background: #ef4444; color: white; border: none; }
|
|
526
|
+
|
|
527
|
+
.nice-upload-list {
|
|
528
|
+
margin-top: 12px;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
.nice-upload-list.grid {
|
|
532
|
+
display: grid;
|
|
533
|
+
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
|
|
534
|
+
gap: 16px;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
.nice-upload-item {
|
|
538
|
+
display: flex;
|
|
539
|
+
align-items: center;
|
|
540
|
+
gap: 12px;
|
|
541
|
+
padding: 12px;
|
|
542
|
+
background: #f9fafb;
|
|
543
|
+
border-radius: 8px;
|
|
544
|
+
border: 1px solid #e5e7eb;
|
|
545
|
+
margin-bottom: 8px;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
.nice-upload-item.error {
|
|
549
|
+
border-color: #fca5a5;
|
|
550
|
+
background: #fef2f2;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
.nice-upload-item.success {
|
|
554
|
+
border-color: #86efac;
|
|
555
|
+
background: #f0fdf4;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
.nice-upload-item.grid {
|
|
559
|
+
flex-direction: column;
|
|
560
|
+
text-align: center;
|
|
561
|
+
padding: 16px;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
.nice-upload-item.compact {
|
|
565
|
+
padding: 8px 12px;
|
|
566
|
+
font-size: 13px;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
.nice-upload-preview {
|
|
570
|
+
flex-shrink: 0;
|
|
571
|
+
display: flex;
|
|
572
|
+
align-items: center;
|
|
573
|
+
justify-content: center;
|
|
574
|
+
background: #e5e7eb;
|
|
575
|
+
border-radius: 6px;
|
|
576
|
+
overflow: hidden;
|
|
577
|
+
position: relative;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
.nice-upload-preview-icon {
|
|
581
|
+
background: #f3f4f6;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
.nice-upload-preview-overlay {
|
|
585
|
+
position: absolute;
|
|
586
|
+
font-size: 24px;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
.nice-upload-item-content {
|
|
590
|
+
flex: 1;
|
|
591
|
+
min-width: 0;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
.nice-upload-item-header {
|
|
595
|
+
display: flex;
|
|
596
|
+
align-items: center;
|
|
597
|
+
gap: 8px;
|
|
598
|
+
margin-bottom: 4px;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.nice-upload-item-name {
|
|
602
|
+
font-weight: 500;
|
|
603
|
+
font-size: 14px;
|
|
604
|
+
color: #111827;
|
|
605
|
+
overflow: hidden;
|
|
606
|
+
text-overflow: ellipsis;
|
|
607
|
+
white-space: nowrap;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
.nice-upload-item-size {
|
|
611
|
+
font-size: 12px;
|
|
612
|
+
color: #6b7280;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
.nice-upload-item-error {
|
|
616
|
+
font-size: 12px;
|
|
617
|
+
color: #dc2626;
|
|
618
|
+
margin-top: 4px;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
.nice-upload-item-link {
|
|
622
|
+
font-size: 12px;
|
|
623
|
+
color: #3b82f6;
|
|
624
|
+
text-decoration: none;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
.nice-upload-item-link:hover {
|
|
628
|
+
text-decoration: underline;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
.nice-upload-item-actions {
|
|
632
|
+
display: flex;
|
|
633
|
+
gap: 4px;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
.nice-upload-item-actions button {
|
|
637
|
+
padding: 4px 8px;
|
|
638
|
+
font-size: 12px;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
.nice-upload-item-remove {
|
|
642
|
+
background: none;
|
|
643
|
+
border: none;
|
|
644
|
+
color: #9ca3af;
|
|
645
|
+
cursor: pointer;
|
|
646
|
+
padding: 4px;
|
|
647
|
+
font-size: 14px;
|
|
648
|
+
line-height: 1;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
.nice-upload-item-remove:hover {
|
|
652
|
+
color: #ef4444;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
.nice-upload-badge {
|
|
656
|
+
font-size: 11px;
|
|
657
|
+
padding: 2px 8px;
|
|
658
|
+
border-radius: 10px;
|
|
659
|
+
font-weight: 500;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
.nice-upload-badge.pending { background: #fef3c7; color: #92400e; }
|
|
663
|
+
.nice-upload-badge.uploading { background: #dbeafe; color: #1e40af; }
|
|
664
|
+
.nice-upload-badge.success { background: #dcfce7; color: #166534; }
|
|
665
|
+
.nice-upload-badge.error { background: #fee2e2; color: #991b1b; }
|
|
666
|
+
.nice-upload-badge.cancelled { background: #f3f4f6; color: #4b5563; }
|
|
667
|
+
|
|
668
|
+
.nice-upload-progress {
|
|
669
|
+
height: 6px;
|
|
670
|
+
background: #e5e7eb;
|
|
671
|
+
border-radius: 3px;
|
|
672
|
+
overflow: hidden;
|
|
673
|
+
margin-top: 6px;
|
|
674
|
+
position: relative;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
.nice-upload-progress-bar {
|
|
678
|
+
height: 100%;
|
|
679
|
+
transition: width 0.2s ease;
|
|
680
|
+
border-radius: 3px;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
.nice-upload-progress-text {
|
|
684
|
+
position: absolute;
|
|
685
|
+
right: 0;
|
|
686
|
+
top: -18px;
|
|
687
|
+
font-size: 11px;
|
|
688
|
+
color: #6b7280;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
.nice-upload-item.compact .nice-upload-progress {
|
|
692
|
+
flex: 1;
|
|
693
|
+
margin: 0 8px;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
.nice-upload-item.compact .nice-upload-progress-text {
|
|
697
|
+
position: static;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
.nice-upload-item-info {
|
|
701
|
+
margin-top: 8px;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
.nice-upload-item.grid .nice-upload-item-name {
|
|
705
|
+
font-size: 13px;
|
|
706
|
+
max-width: 100%;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
@media (max-width: 640px) {
|
|
710
|
+
.nice-upload-dropzone {
|
|
711
|
+
padding: 24px 16px;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
.nice-upload-actions {
|
|
715
|
+
flex-wrap: wrap;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
.nice-upload-list.grid {
|
|
719
|
+
grid-template-columns: repeat(2, 1fr);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
`})]})})});ki.displayName="NiceFileUpload";let wd=0;function Un(){return`blk-${++wd}-${Date.now().toString(36)}`}function _a(e=""){return{id:Un(),type:"paragraph",content:e}}function kd(e,t=""){const n={id:Un(),type:e,content:t};return e==="heading"&&(n.level=2),e==="list"&&(n.listType="unordered"),e==="callout"&&(n.icon="ℹ️"),e==="toggle"&&(n.open=!0),n}const Sd=[{type:"paragraph",label:"Text",icon:"¶",keywords:"paragraph text"},{type:"heading",label:"Heading",icon:"H",keywords:"heading title"},{type:"list",label:"Bulleted list",icon:"•",keywords:"bullet unordered list"},{type:"list",label:"Numbered list",icon:"1.",keywords:"numbered ordered list"},{type:"list",label:"Checklist",icon:"☑",keywords:"check todo list"},{type:"quote",label:"Quote",icon:"❝",keywords:"quote blockquote"},{type:"callout",label:"Callout",icon:"ℹ️",keywords:"callout info alert"},{type:"toggle",label:"Toggle",icon:"▶",keywords:"toggle collapse expand"},{type:"code",label:"Code",icon:"</>",keywords:"code snippet"},{type:"image",label:"Image",icon:"🖼",keywords:"image photo picture"},{type:"video",label:"Video",icon:"🎬",keywords:"video embed"},{type:"table",label:"Table",icon:"⊞",keywords:"table grid"},{type:"divider",label:"Divider",icon:"─",keywords:"divider line separator"},{type:"pageBreak",label:"Page Break",icon:"⤓",keywords:"page break"}];function Cd(e){const t=[e.align?`text-align:${e.align}`:"",e.color?`color:${e.color}`:"",e.bgColor?`background-color:${e.bgColor}`:"",e.indent?`margin-left:${e.indent*24}px`:""].filter(Boolean).join(";"),n=t?` style="${t}"`:"",i=(r,s)=>{let l=s;return e.bold&&(l=`<strong>${l}</strong>`),e.italic&&(l=`<em>${l}</em>`),e.underline&&(l=`<u>${l}</u>`),e.strikethrough&&(l=`<s>${l}</s>`),`<${r}${n}>${l}</${r}>`};switch(e.type){case"heading":return i(`h${e.level??2}`,e.content);case"paragraph":return i("p",e.content||" ");case"list":{const r=e.listType==="ordered"?"ol":"ul",s=e.content.split(`
|
|
723
|
+
`).map((l,c)=>{var d;return e.listType==="checklist"?`<li><input type="checkbox" ${((d=e.checked)==null?void 0:d[c])??!1?"checked":""} disabled />${l}</li>`:`<li>${l}</li>`}).join("");return`<${r}${n}>${s}</${r}>`}case"image":return`<figure${n}><img src="${e.src??""}" alt="${e.alt??""}" /></figure>`;case"video":return`<figure${n}><video src="${e.src??""}" controls></video></figure>`;case"divider":return"<hr />";case"pageBreak":return'<div style="page-break-after:always"></div>';case"code":return`<pre><code class="language-${e.language??""}">${e.content}</code></pre>`;case"quote":return i("blockquote",e.content);case"callout":return`<div class="nice-doc-callout"${n}><span>${e.icon??"ℹ️"}</span><div>${e.content}</div></div>`;case"toggle":return`<details${n}><summary>${e.content.split(`
|
|
724
|
+
`)[0]}</summary>${e.content.split(`
|
|
725
|
+
`).slice(1).join("<br>")}</details>`;case"table":return`<table${n}>${e.content}</table>`;case"embed":return`<iframe src="${e.src??""}" style="width:100%;border:none;min-height:300px"></iframe>`;default:return i("p",e.content)}}function _d(e){let t=0,n=0;for(const i of e){const r=i.content??"";t+=r.length;const s=r.trim().split(/\s+/).filter(Boolean);n+=s.length}return{words:n,chars:t,readingTime:Math.max(1,Math.ceil(n/200))}}const Yn=o.forwardRef(({blocks:e,onChange:t,readOnly:n=!1,showToolbar:i=!0,size:r="md",editorSize:s="standard",placeholder:l,onExport:c,onImageUpload:d,maxUndo:u=50,slashCommands:y=!0,showWordCount:f=!1,showToc:p=!1,showFindReplace:m=!0,className:w,style:k,id:z,...$},g)=>{var fe,Se,Ae,Me,Re,ze,lt,Ze,Ge,Je,Rt,bt,Pt,Jn,ea,ta;const v=we(z),{t:N}=ke(),[j,I]=o.useState(()=>e??[_a()]),D=e??j,[b,T]=o.useState(0),R=o.useRef(new Map),L=o.useRef(null),[M,S]=o.useState(!1),[x,P]=o.useState(""),[A,E]=o.useState(""),[h,C]=o.useState([]),[_,F]=o.useState(0),[O,H]=o.useState(!1),V=o.useRef([]),U=o.useRef([]),B=o.useCallback(q=>{V.current.push(q.map(ne=>({...ne,checked:ne.checked?[...ne.checked]:void 0}))),V.current.length>u&&V.current.shift(),U.current=[]},[u]),W=o.useCallback(()=>{if(V.current.length===0)return;const q=V.current.pop();U.current.push(D.map(ne=>({...ne}))),e||I(q),t==null||t(q)},[D,e,t]),Q=o.useCallback(()=>{if(U.current.length===0)return;const q=U.current.pop();V.current.push(D.map(ne=>({...ne}))),e||I(q),t==null||t(q)},[D,e,t]),[Z,X]=o.useState(!1),[oe,re]=o.useState(""),[he,J]=o.useState(0),le=o.useMemo(()=>{if(!Z||!y)return[];const q=oe.toLowerCase();return Sd.filter(ne=>ne.label.toLowerCase().includes(q)||ne.keywords.includes(q))},[Z,oe,y]),[pe,me]=o.useState(null),[ve,K]=o.useState(null),Y=o.useCallback(q=>{B(D);const ne=q(D);e||I(ne),t==null||t(ne)},[D,e,t,B]),G=o.useCallback((q,ne)=>{Y(ae=>ae.map((Ne,Ie)=>Ie===q?{...Ne,...ne}:Ne))},[Y]),ee=o.useCallback((q,ne)=>{const ae=ne??_a();Y(Ne=>{const Ie=[...Ne];return Ie.splice(q+1,0,ae),Ie}),T(q+1)},[Y]),ce=o.useCallback(q=>{const ne={...D[q],id:Un()};ee(q,ne)},[D,ee]),ge=o.useCallback(q=>{D.length<=1||(Y(ne=>ne.filter((ae,Ne)=>Ne!==q)),T(Math.max(0,q-1)))},[D.length,Y]),de=o.useCallback((q,ne)=>{const ae=q+ne;ae<0||ae>=D.length||(Y(Ne=>{const Ie=[...Ne];return[Ie[q],Ie[ae]]=[Ie[ae],Ie[q]],Ie}),T(ae))},[D.length,Y]),ie=o.useCallback((q,ne)=>{const ae={type:ne};ne==="heading"&&(ae.level=2),ne==="list"&&(ae.listType="unordered"),ne==="callout"&&(ae.icon="ℹ️"),ne==="toggle"&&(ae.open=!0),G(q,ae)},[G]),be=o.useCallback(q=>{var ae,Ne;const ne=kd(q.type);q.type==="list"&&q.label.includes("Numbered")&&(ne.listType="ordered"),q.type==="list"&&q.label.includes("Checklist")&&(ne.listType="checklist",ne.checked=[]),((ae=D[b])==null?void 0:ae.content)===""||((Ne=D[b])==null?void 0:Ne.content)==="/"?Y(Ie=>Ie.map((et,xt)=>xt===b?{...ne,id:et.id}:et)):ee(b,ne),X(!1),re("")},[D,b,Y,ee]),ye=o.useCallback((q,ne)=>{if(n)return;const ae=D[ne];if(!(ae!=null&&ae.locked)){if((q.ctrlKey||q.metaKey)&&q.key==="z"&&!q.shiftKey){q.preventDefault(),W();return}if((q.ctrlKey||q.metaKey)&&(q.key==="y"||q.key==="z"&&q.shiftKey)){q.preventDefault(),Q();return}if((q.ctrlKey||q.metaKey)&&q.key==="d"){q.preventDefault(),ce(ne);return}if((q.ctrlKey||q.metaKey)&&q.key==="b"){q.preventDefault(),G(ne,{bold:!(ae!=null&&ae.bold)});return}if((q.ctrlKey||q.metaKey)&&q.key==="i"){q.preventDefault(),G(ne,{italic:!(ae!=null&&ae.italic)});return}if((q.ctrlKey||q.metaKey)&&q.key==="u"){q.preventDefault(),G(ne,{underline:!(ae!=null&&ae.underline)});return}if((q.ctrlKey||q.metaKey)&&q.key==="e"){q.preventDefault(),G(ne,{strikethrough:!(ae!=null&&ae.strikethrough)});return}if(q.key==="Tab"&&!q.shiftKey){q.preventDefault(),G(ne,{indent:Math.min(((ae==null?void 0:ae.indent)??0)+1,4)});return}if(q.key==="Tab"&&q.shiftKey){q.preventDefault(),G(ne,{indent:Math.max(((ae==null?void 0:ae.indent)??0)-1,0)});return}if((q.ctrlKey||q.metaKey)&&q.key==="f"&&m){q.preventDefault(),S(Ne=>!Ne);return}if(Z&&le.length>0){if(q.key==="ArrowDown"){q.preventDefault(),J(Ne=>Math.min(Ne+1,le.length-1));return}if(q.key==="ArrowUp"){q.preventDefault(),J(Ne=>Math.max(Ne-1,0));return}if(q.key==="Enter"){q.preventDefault(),be(le[he]);return}if(q.key==="Escape"){X(!1);return}}q.key==="Enter"&&!q.shiftKey?(q.preventDefault(),ee(ne)):q.key==="Backspace"&&D[ne].content===""&&D.length>1?(q.preventDefault(),ge(ne)):q.key==="ArrowUp"&&q.altKey?(q.preventDefault(),de(ne,-1)):q.key==="ArrowDown"&&q.altKey&&(q.preventDefault(),de(ne,1))}},[n,D,ee,ge,de,W,Q,ce,G,Z,le,he,be,m]),_e=o.useCallback((q,ne)=>{const ae=q.target.textContent??"";y&&ae.startsWith("/")?(X(!0),re(ae.slice(1)),J(0)):Z&&X(!1),B(D);const Ne=D.map((Ie,et)=>et===ne?{...Ie,content:ae}:Ie);e||I(Ne),t==null||t(Ne)},[D,e,t,B,y,Z]),je=o.useCallback((q,ne)=>{me(ne),q.dataTransfer.effectAllowed="move"},[]),Ce=o.useCallback((q,ne)=>{q.preventDefault(),q.dataTransfer.dropEffect="move",K(ne)},[]),De=o.useCallback((q,ne)=>{if(q.preventDefault(),pe===null||pe===ne){me(null),K(null);return}Y(ae=>{const Ne=[...ae],[Ie]=Ne.splice(pe,1);return Ne.splice(ne>pe?ne-1:ne,0,Ie),Ne}),T(ne>pe?ne-1:ne),me(null),K(null)},[pe,Y]);o.useEffect(()=>{if(!M||!x){C([]);return}const q=x.toLowerCase(),ne=[];D.forEach((ae,Ne)=>{const Ie=(ae.content??"").toLowerCase();let et=0;for(;et<Ie.length;){const xt=Ie.indexOf(q,et);if(xt===-1)break;ne.push({blockIdx:Ne,start:xt,end:xt+q.length}),et=xt+1}}),C(ne),F(0)},[x,M,D]);const Te=o.useCallback(()=>{if(h.length===0)return;const q=(_+1)%h.length;F(q),T(h[q].blockIdx)},[h,_]),qe=o.useCallback(()=>{if(h.length===0)return;const q=(_-1+h.length)%h.length;F(q),T(h[q].blockIdx)},[h,_]),wt=o.useCallback(()=>{if(h.length===0||!x)return;const q=h[_],ne=D[q.blockIdx],ae=ne.content.slice(0,q.start),Ne=ne.content.slice(q.end);G(q.blockIdx,{content:ae+A+Ne})},[h,_,x,A,D,G]),rt=o.useCallback(()=>{if(!x)return;const q=x;Y(ne=>ne.map(ae=>({...ae,content:ae.content.split(q).join(A)})))},[x,A,Y]),We=o.useMemo(()=>p?D.map((q,ne)=>q.type==="heading"?{idx:ne,level:q.level??2,text:q.content}:null).filter(Boolean):[],[D,p]),ot=o.useCallback(async q=>{var ae;const ne=(ae=q.target.files)==null?void 0:ae[0];if(ne){if(d){const Ne=await d(ne);G(b,{src:Ne})}q.target.value=""}},[d,b,G]);o.useEffect(()=>{const q=D[b];if(q){const ne=R.current.get(q.id);ne&&ne.focus()}},[b,D]);const st=o.useCallback(()=>{const q=D.map(Cd).join(`
|
|
726
|
+
`);c==null||c(q)},[D,c]),Xe=o.useMemo(()=>f?_d(D):null,[D,f]),[Pe,Le]=o.useState(null),te=o.useCallback((q,ne)=>{n||(q.preventDefault(),Le({x:q.clientX,y:q.clientY,idx:ne}))},[n]);return o.useEffect(()=>{if(!Pe)return;const q=()=>Le(null);return window.addEventListener("click",q),()=>window.removeEventListener("click",q)},[Pe]),a.jsxs("div",{ref:g,id:v,className:`nice-doc-editor nice-doc-editor--${r} nice-editor--${s} ${n?"nice-doc-editor--readonly":""} ${w??""}`,style:k,role:"application","aria-label":N("docEditor.label","Document Editor"),...$,children:[i&&!n&&a.jsxs("div",{className:"nice-doc-editor__toolbar",role:"toolbar",style:{display:"flex",flexWrap:"wrap",gap:4,alignItems:"center",padding:"4px 8px"},children:[a.jsx(xe,{size:"sm",variant:"ghost",onClick:W,title:N("docEditor.undo","Undo (Ctrl+Z)"),children:"↩"}),a.jsx(xe,{size:"sm",variant:"ghost",onClick:Q,title:N("docEditor.redo","Redo (Ctrl+Y)"),children:"↪"}),a.jsx("span",{className:"nice-doc-editor__sep"}),a.jsx(ht,{size:"sm",value:((fe=D[b])==null?void 0:fe.type)??"paragraph",onChange:q=>ie(b,q),label:"",options:[{value:"paragraph",label:N("docEditor.paragraph","Paragraph")},{value:"heading",label:N("docEditor.heading","Heading")},{value:"list",label:N("docEditor.list","List")},{value:"code",label:N("docEditor.code","Code")},{value:"quote",label:N("docEditor.quote","Quote")},{value:"callout",label:N("docEditor.callout","Callout")},{value:"toggle",label:N("docEditor.toggle","Toggle")},{value:"divider",label:N("docEditor.divider","Divider")},{value:"image",label:N("docEditor.image","Image")},{value:"video",label:N("docEditor.video","Video")},{value:"pageBreak",label:N("docEditor.pageBreak","Page Break")}],style:{minWidth:100}}),((Se=D[b])==null?void 0:Se.type)==="heading"&&a.jsx(ht,{size:"sm",value:String(((Ae=D[b])==null?void 0:Ae.level)??2),onChange:q=>G(b,{level:Number(q)}),label:"",options:[{value:"1",label:"H1"},{value:"2",label:"H2"},{value:"3",label:"H3"},{value:"4",label:"H4"},{value:"5",label:"H5"},{value:"6",label:"H6"}],style:{minWidth:55}}),((Me=D[b])==null?void 0:Me.type)==="list"&&a.jsx(ht,{size:"sm",value:((Re=D[b])==null?void 0:Re.listType)??"unordered",onChange:q=>G(b,{listType:q}),label:"",options:[{value:"unordered",label:"• Bullets"},{value:"ordered",label:"1. Numbers"},{value:"checklist",label:"☑ Checklist"}],style:{minWidth:90}}),a.jsx("span",{className:"nice-doc-editor__sep"}),a.jsx(xe,{size:"sm",variant:(ze=D[b])!=null&&ze.bold?"primary":"ghost",onClick:()=>{var q;return G(b,{bold:!((q=D[b])!=null&&q.bold)})},title:N("docEditor.bold","Bold (Ctrl+B)"),children:a.jsx("strong",{children:"B"})}),a.jsx(xe,{size:"sm",variant:(lt=D[b])!=null&<.italic?"primary":"ghost",onClick:()=>{var q;return G(b,{italic:!((q=D[b])!=null&&q.italic)})},title:N("docEditor.italic","Italic (Ctrl+I)"),children:a.jsx("em",{children:"I"})}),a.jsx(xe,{size:"sm",variant:(Ze=D[b])!=null&&Ze.underline?"primary":"ghost",onClick:()=>{var q;return G(b,{underline:!((q=D[b])!=null&&q.underline)})},title:N("docEditor.underline","Underline (Ctrl+U)"),children:a.jsx("u",{children:"U"})}),a.jsx(xe,{size:"sm",variant:(Ge=D[b])!=null&&Ge.strikethrough?"primary":"ghost",onClick:()=>{var q;return G(b,{strikethrough:!((q=D[b])!=null&&q.strikethrough)})},title:N("docEditor.strikethrough","Strikethrough (Ctrl+E)"),children:a.jsx("s",{children:"S"})}),a.jsx("span",{className:"nice-doc-editor__sep"}),a.jsx(xe,{size:"sm",variant:((Je=D[b])==null?void 0:Je.align)==="left"?"primary":"ghost",onClick:()=>G(b,{align:"left"}),title:N("docEditor.alignLeft","Left"),children:"⬅"}),a.jsx(xe,{size:"sm",variant:((Rt=D[b])==null?void 0:Rt.align)==="center"?"primary":"ghost",onClick:()=>G(b,{align:"center"}),title:N("docEditor.alignCenter","Center"),children:"⬌"}),a.jsx(xe,{size:"sm",variant:((bt=D[b])==null?void 0:bt.align)==="right"?"primary":"ghost",onClick:()=>G(b,{align:"right"}),title:N("docEditor.alignRight","Right"),children:"➡"}),a.jsx("span",{className:"nice-doc-editor__sep"}),a.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>{var q;return G(b,{indent:Math.min((((q=D[b])==null?void 0:q.indent)??0)+1,4)})},title:N("docEditor.indent","Indent (Tab)"),children:"→⊞"}),a.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>{var q;return G(b,{indent:Math.max((((q=D[b])==null?void 0:q.indent)??0)-1,0)})},title:N("docEditor.outdent","Outdent (Shift+Tab)"),children:"←⊞"}),a.jsx("span",{className:"nice-doc-editor__sep"}),a.jsx(gt,{size:"sm",label:"",value:((Pt=D[b])==null?void 0:Pt.color)??"#000000",onChange:q=>G(b,{color:q}),title:"Text color"}),a.jsx(gt,{size:"sm",label:"",value:((Jn=D[b])==null?void 0:Jn.bgColor)??"#ffffff",onChange:q=>G(b,{bgColor:q}),title:"Block background"}),a.jsx("span",{className:"nice-doc-editor__sep"}),a.jsx(xe,{size:"sm",variant:(ea=D[b])!=null&&ea.locked?"primary":"ghost",onClick:()=>{var q;return G(b,{locked:!((q=D[b])!=null&&q.locked)})},title:N("docEditor.lock","Lock/Unlock block"),children:"🔒"}),a.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>ce(b),title:N("docEditor.duplicate","Duplicate (Ctrl+D)"),children:"⧉"}),a.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>ge(b),title:N("docEditor.delete","Delete block"),children:"🗑"}),a.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>ee(b),title:N("docEditor.addBlock","Add block"),children:"+"}),m&&a.jsx(xe,{size:"sm",variant:M?"primary":"ghost",onClick:()=>S(q=>!q),title:N("docEditor.find","Find & Replace (Ctrl+F)"),children:"🔍"}),a.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>H(q=>!q),title:N("docEditor.shortcuts","Keyboard shortcuts"),children:"⌨"}),c&&a.jsx(xe,{size:"sm",variant:"ghost",onClick:st,children:N("docEditor.export","Export HTML")})]}),a.jsx("input",{ref:L,type:"file",accept:"image/*,video/*",style:{display:"none"},onChange:ot}),M&&a.jsxs("div",{className:"nice-doc-editor__find-bar",style:{display:"flex",gap:4,alignItems:"center",padding:"4px 8px",background:"var(--nice-doc-find-bg, #f8f9fa)",borderBottom:"1px solid #ddd"},children:[a.jsx(pt,{size:"sm",placeholder:N("docEditor.findPlaceholder","Find..."),value:x,onChange:P,style:{flex:1,maxWidth:200}}),a.jsx(pt,{size:"sm",placeholder:N("docEditor.replacePlaceholder","Replace..."),value:A,onChange:E,style:{flex:1,maxWidth:200}}),a.jsx(xe,{size:"sm",variant:"ghost",onClick:qe,title:N("docEditor.findPrev","Previous"),children:"◀"}),a.jsx(xe,{size:"sm",variant:"ghost",onClick:Te,title:N("docEditor.findNext","Next"),children:"▶"}),a.jsx(xe,{size:"sm",variant:"ghost",onClick:wt,title:N("docEditor.replaceOne","Replace"),disabled:n,children:N("docEditor.replace","Replace")}),a.jsx(xe,{size:"sm",variant:"ghost",onClick:rt,title:N("docEditor.replaceAll","Replace all"),disabled:n,children:N("docEditor.replaceAllBtn","All")}),a.jsx("span",{style:{fontSize:"0.75em",color:"#666"},children:h.length>0?`${_+1}/${h.length}`:"0/0"}),a.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>S(!1),children:"✕"})]}),O&&a.jsx("div",{className:"nice-doc-editor__shortcuts-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,.4)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>H(!1),children:a.jsxs("div",{style:{background:"#fff",borderRadius:8,padding:24,maxWidth:420,width:"90%",boxShadow:"0 8px 32px rgba(0,0,0,.2)"},onClick:q=>q.stopPropagation(),children:[a.jsx("h3",{style:{margin:"0 0 12px"},children:N("docEditor.shortcutsTitle","Keyboard Shortcuts")}),a.jsx("table",{style:{width:"100%",fontSize:"0.875em",borderCollapse:"collapse"},children:a.jsx("tbody",{children:[["Ctrl+B",N("docEditor.bold","Bold")],["Ctrl+I",N("docEditor.italic","Italic")],["Ctrl+U",N("docEditor.underline","Underline")],["Ctrl+E",N("docEditor.strikethrough","Strikethrough")],["Ctrl+D",N("docEditor.duplicate","Duplicate block")],["Ctrl+Z",N("docEditor.undo","Undo")],["Ctrl+Y",N("docEditor.redo","Redo")],["Ctrl+F",N("docEditor.find","Find & Replace")],["Enter",N("docEditor.newBlock","New block")],["Backspace",N("docEditor.deleteEmpty","Delete empty block")],["Alt+↑",N("docEditor.moveUp","Move block up")],["Alt+↓",N("docEditor.moveDown","Move block down")],["Tab",N("docEditor.indent","Indent")],["Shift+Tab",N("docEditor.outdent","Outdent")],["/",N("docEditor.slashCmd","Slash commands")]].map(([q,ne])=>a.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[a.jsx("td",{style:{padding:"4px 8px",fontFamily:"monospace",fontWeight:600},children:q}),a.jsx("td",{style:{padding:"4px 8px"},children:ne})]},q))})}),a.jsx("div",{style:{textAlign:"right",marginTop:12},children:a.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>H(!1),children:N("docEditor.close","Close")})})]})}),a.jsxs("div",{style:{display:"flex",gap:0},children:[p&&We.length>0&&a.jsxs("nav",{className:"nice-doc-editor__toc",style:{width:200,minWidth:160,borderRight:"1px solid #eee",padding:"8px 4px",fontSize:"0.8em",overflowY:"auto",maxHeight:500},children:[a.jsx("div",{style:{fontWeight:600,padding:"4px 8px",fontSize:"0.75em",textTransform:"uppercase",color:"#999"},children:N("docEditor.toc","Contents")}),We.map(q=>a.jsx("div",{style:{padding:"3px 8px",paddingLeft:8+(q.level-1)*12,cursor:"pointer",borderRadius:4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",background:q.idx===b?"#e8f0fe":void 0},onClick:()=>T(q.idx),title:q.text,children:q.text||N("docEditor.untitled","Untitled")},q.idx))]}),a.jsx("div",{className:"nice-doc-editor__body",style:{flex:1},children:D.map((q,ne)=>a.jsxs("div",{className:`nice-doc-editor__block nice-doc-editor__block--${q.type} ${ne===b?"nice-doc-editor__block--focused":""} ${ve===ne?"nice-doc-editor__block--drop-target":""} ${q.locked?"nice-doc-editor__block--locked":""}`,onClick:()=>T(ne),onContextMenu:ae=>te(ae,ne),draggable:!n&&!q.locked,onDragStart:ae=>je(ae,ne),onDragOver:ae=>Ce(ae,ne),onDrop:ae=>De(ae,ne),onDragEnd:()=>{me(null),K(null)},style:{opacity:pe===ne?.4:1,marginLeft:(q.indent??0)*24},children:[!n&&!q.locked&&a.jsx("div",{className:"nice-doc-editor__block-handle",title:N("docEditor.drag","Drag to reorder"),children:"⠿"}),q.locked&&a.jsx("span",{className:"nice-doc-editor__lock-icon",style:{position:"absolute",top:2,right:4,fontSize:"0.7em",opacity:.5},children:"🔒"}),q.type==="divider"?a.jsx("hr",{className:"nice-doc-editor__divider"}):q.type==="pageBreak"?a.jsxs("div",{className:"nice-doc-editor__page-break",style:{borderTop:"2px dashed #ccc",textAlign:"center",padding:4,fontSize:"0.75em",color:"#999"},children:["— ",N("docEditor.pageBreak","Page Break")," —"]}):q.type==="image"||q.type==="video"?a.jsx("div",{className:"nice-doc-editor__media-block",children:q.src?q.type==="image"?a.jsx("img",{src:q.src,alt:q.alt??"",className:"nice-doc-editor__image",style:{maxWidth:"100%"}}):a.jsx("video",{src:q.src,controls:!0,className:"nice-doc-editor__video",style:{maxWidth:"100%"}}):!n&&a.jsxs("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[a.jsx(pt,{size:"sm",placeholder:N("docEditor.mediaUrl",q.type==="image"?"Image URL":"Video URL"),value:q.src??"",onChange:ae=>G(ne,{src:ae})}),d&&a.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>{var ae;T(ne),(ae=L.current)==null||ae.click()},children:"📎"})]})}):q.type==="callout"?a.jsxs("div",{className:"nice-doc-editor__callout",style:{display:"flex",gap:8,padding:"8px 12px",background:q.bgColor??"#f0f7ff",borderRadius:4,color:q.color},children:[a.jsx("span",{style:{fontSize:"1.2em"},children:q.icon??"ℹ️"}),a.jsx("div",{ref:ae=>{ae&&R.current.set(q.id,ae)},className:"nice-doc-editor__content",contentEditable:!n&&!q.locked,suppressContentEditableWarning:!0,onInput:ae=>_e(ae,ne),onFocus:()=>T(ne),onKeyDown:ae=>ye(ae,ne),"data-placeholder":N("docEditor.calloutPlaceholder","Callout text..."),role:"textbox","aria-multiline":"true",style:{flex:1,outline:"none"},children:q.content})]}):q.type==="toggle"?a.jsxs("details",{open:q.open,className:"nice-doc-editor__toggle",onToggle:ae=>G(ne,{open:ae.target.open}),children:[a.jsx("summary",{style:{cursor:"pointer",fontWeight:500},children:q.content.split(`
|
|
727
|
+
`)[0]||N("docEditor.toggleTitle","Toggle")}),a.jsx("div",{ref:ae=>{ae&&R.current.set(q.id,ae)},className:"nice-doc-editor__content",contentEditable:!n&&!q.locked,suppressContentEditableWarning:!0,onInput:ae=>_e(ae,ne),onFocus:()=>T(ne),onKeyDown:ae=>ye(ae,ne),role:"textbox","aria-multiline":"true",style:{padding:"4px 0"},children:q.content.split(`
|
|
728
|
+
`).slice(1).join(`
|
|
729
|
+
`)})]}):q.type==="code"?a.jsxs("div",{className:"nice-doc-editor__code-block",style:{position:"relative"},children:[!n&&a.jsx(pt,{size:"sm",value:q.language??"",onChange:ae=>G(ne,{language:ae}),placeholder:"Language",style:{position:"absolute",top:4,right:4,width:80,opacity:.7}}),a.jsx("pre",{ref:ae=>{ae&&R.current.set(q.id,ae)},className:"nice-doc-editor__content",contentEditable:!n&&!q.locked,suppressContentEditableWarning:!0,onInput:ae=>_e(ae,ne),onFocus:()=>T(ne),onKeyDown:ae=>ye(ae,ne),role:"textbox","aria-multiline":"true",style:{fontFamily:"monospace",background:"#1e1e1e",color:"#d4d4d4",padding:12,borderRadius:4,overflow:"auto"},children:q.content})]}):a.jsxs("div",{style:{position:"relative"},children:[a.jsx("div",{ref:ae=>{ae&&R.current.set(q.id,ae)},className:"nice-doc-editor__content",contentEditable:!n&&!q.locked,suppressContentEditableWarning:!0,style:{textAlign:q.align,fontWeight:q.bold?"bold":void 0,fontStyle:q.italic?"italic":void 0,textDecoration:[q.underline?"underline":"",q.strikethrough?"line-through":""].filter(Boolean).join(" ")||void 0,color:q.color,backgroundColor:q.bgColor},onInput:ae=>_e(ae,ne),onFocus:()=>T(ne),onKeyDown:ae=>ye(ae,ne),"data-placeholder":!q.content&&l?l:void 0,role:"textbox","aria-multiline":"true",children:q.content}),Z&&ne===b&&le.length>0&&a.jsx("ul",{className:"nice-doc-editor__slash-menu",style:{position:"absolute",left:0,top:"100%",zIndex:100,background:"#fff",border:"1px solid #ddd",borderRadius:6,boxShadow:"0 4px 16px rgba(0,0,0,.12)",listStyle:"none",margin:0,padding:4,minWidth:180,maxHeight:240,overflow:"auto"},children:le.map((ae,Ne)=>a.jsxs("li",{className:Ne===he?"nice-doc-editor__slash-item--active":"",style:{padding:"6px 10px",cursor:"pointer",borderRadius:4,display:"flex",gap:8,alignItems:"center",background:Ne===he?"#e8f0fe":void 0},onMouseDown:Ie=>{Ie.preventDefault(),be(ae)},onMouseEnter:()=>J(Ne),children:[a.jsx("span",{style:{width:24,textAlign:"center"},children:ae.icon}),a.jsx("span",{children:ae.label})]},`${ae.type}-${ae.label}`))})]})]},q.id))})]}),Pe&&a.jsxs("div",{className:"nice-doc-editor__ctx-menu",style:{position:"fixed",left:Pe.x,top:Pe.y,zIndex:1e3,background:"#fff",border:"1px solid #ddd",borderRadius:6,boxShadow:"0 4px 16px rgba(0,0,0,.12)",padding:4,minWidth:160},children:[a.jsx("div",{style:{padding:"6px 12px",cursor:"pointer"},onClick:()=>{ce(Pe.idx),Le(null)},children:"⧉ Duplicate"}),a.jsx("div",{style:{padding:"6px 12px",cursor:"pointer"},onClick:()=>{ee(Pe.idx),Le(null)},children:"+ Insert below"}),a.jsx("div",{style:{padding:"6px 12px",cursor:"pointer"},onClick:()=>{de(Pe.idx,-1),Le(null)},children:"↑ Move up"}),a.jsx("div",{style:{padding:"6px 12px",cursor:"pointer"},onClick:()=>{de(Pe.idx,1),Le(null)},children:"↓ Move down"}),a.jsx("div",{style:{padding:"6px 12px",cursor:"pointer"},onClick:()=>{var q;G(Pe.idx,{locked:!((q=D[Pe.idx])!=null&&q.locked)}),Le(null)},children:(ta=D[Pe.idx])!=null&&ta.locked?"🔓 Unlock":"🔒 Lock"}),a.jsx("hr",{style:{margin:"2px 0",border:"none",borderTop:"1px solid #eee"}}),a.jsx("div",{style:{padding:"6px 12px",cursor:"pointer",color:"#d32f2f"},onClick:()=>{ge(Pe.idx),Le(null)},children:"🗑 Delete"})]}),f&&Xe&&a.jsxs("div",{className:"nice-doc-editor__footer",style:{padding:"4px 12px",fontSize:"0.75em",color:"#666",borderTop:"1px solid #eee",display:"flex",gap:16},children:[a.jsxs("span",{children:[Xe.words," ",N("docEditor.words","words")]}),a.jsxs("span",{children:[Xe.chars," ",N("docEditor.chars","characters")]}),a.jsxs("span",{children:[D.length," ",N("docEditor.blocks","blocks")]}),a.jsxs("span",{children:["~",Xe.readingTime," ",N("docEditor.readingTime","min read")]})]})]})});Yn.displayName="NiceDocumentEditor";const jd=["street","streetNumber","apartment","city","postalCode","state","country"],Lt={street:"Street",streetNumber:"Number",apartment:"Apt/Suite",city:"City",postalCode:"Postal Code",state:"State/Province",country:"Country"},Si=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:y,accessMode:f,value:p={},onChange:m,fields:w=jd,placeholders:k={},countries:z,layout:$="vertical",countryFirst:g=!1,validatePostalCode:v},N)=>{const j=Ee(f,d);if(j==="hidden")return null;j==="disabled"&&(r=!0),j==="readOnly"&&(s=!0);const{t:I}=ke(),D=we(d),b=o.useCallback((M,S)=>{m==null||m({...p,[M]:S})},[p,m]),T=o.useMemo(()=>{if(v&&p.postalCode)return v(p.postalCode,p.country)},[v,p.postalCode,p.country]),R=o.useMemo(()=>g&&w.includes("country")?["country",...w.filter(M=>M!=="country")]:w,[w,g]),L=`nice-address nice-address--${$} nice-size-${l}`;return a.jsxs("div",{ref:N,id:D,className:`${L}${u?` ${u}`:""}${n?" nice-error":""}${r?" nice-disabled":""}`,style:y,role:"group","aria-label":e??I("address","Address"),children:[e&&a.jsxs("label",{className:"nice-address__label",children:[e,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),a.jsx("div",{className:"nice-address__fields",children:R.map(M=>M==="country"&&z?a.jsxs("div",{className:`nice-address__field nice-address__field--${M}`,children:[a.jsx("label",{className:"nice-address__field-label",children:I(M,Lt[M])}),a.jsxs("select",{className:"nice-input nice-select",value:p.country??"",onChange:S=>b("country",S.target.value),disabled:r,"aria-label":I(M,Lt[M]),children:[a.jsx("option",{value:"",children:k.country??I("selectCountry","— Select country —")}),z.map(S=>a.jsx("option",{value:S.code,children:S.name},S.code))]})]},M):a.jsxs("div",{className:`nice-address__field nice-address__field--${M}`,children:[a.jsx("label",{className:"nice-address__field-label",children:I(M,Lt[M])}),a.jsx("input",{className:`nice-input${M==="postalCode"&&T?" nice-input--error":""}`,type:"text",name:c?`${c}.${M}`:M,value:p[M]??"",onChange:S=>b(M,S.target.value),placeholder:k[M]??"",disabled:r,readOnly:s,"aria-label":I(M,Lt[M])}),M==="postalCode"&&T&&a.jsx("span",{className:"nice-error-text",children:T})]},M))}),t&&a.jsx("span",{className:"nice-helper-text",children:t}),n&&typeof n=="string"&&a.jsx("span",{className:"nice-error-text",children:n})]})});Si.displayName="NiceAddressInput";const Nd=[{code:"PL",dialCode:"+48",name:"Poland",mask:"### ### ###"},{code:"US",dialCode:"+1",name:"United States",mask:"(###) ###-####"},{code:"GB",dialCode:"+44",name:"United Kingdom",mask:"#### ######"},{code:"DE",dialCode:"+49",name:"Germany",mask:"### ########"},{code:"FR",dialCode:"+33",name:"France",mask:"# ## ## ## ##"},{code:"CZ",dialCode:"+420",name:"Czech Republic",mask:"### ### ###"},{code:"SK",dialCode:"+421",name:"Slovakia",mask:"### ### ###"}],ja=127397;function Ed(e){return String.fromCodePoint(e.charCodeAt(0)+ja,e.charCodeAt(1)+ja)}function Md(e,t){if(!t)return e;const n=e.replace(/\D/g,"");let i="",r=0;for(let s=0;s<t.length&&r<n.length;s++)t[s]==="#"?i+=n[r++]:i+=t[s];return i}function ln(e,t){return`${e}${t.replace(/\D/g,"")}`}const Ci=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:y,accessMode:f,value:p={},onChange:m,onBlur:w,countryCodes:k=Nd,defaultCountry:z="PL",placeholder:$,showFlag:g=!0,validateE164:v=!1},N)=>{var A;const j=Ee(f,d);if(j==="hidden")return null;j==="disabled"&&(r=!0),j==="readOnly"&&(s=!0);const{t:I}=ke(),D=we(d),b=o.useMemo(()=>{const E=p.countryCode??z;return k.find(h=>h.code===E)??k[0]},[p.countryCode,z,k]),[T,R]=o.useState(),L=o.useMemo(()=>Md(p.number??"",b==null?void 0:b.mask),[p.number,b]),M=o.useCallback(E=>{const h=k.find(_=>_.code===E);if(!h)return;const C=p.number??"";m==null||m({countryCode:h.code,dialCode:h.dialCode,number:C,e164:ln(h.dialCode,C)})},[k,p.number,m]),S=o.useCallback(E=>{const h=E.replace(/\D/g,""),C=b;m==null||m({countryCode:C==null?void 0:C.code,dialCode:C==null?void 0:C.dialCode,number:h,e164:C?ln(C.dialCode,h):h}),R(void 0)},[b,m]),x=o.useCallback(E=>{if(v&&p.number){const h=ln((b==null?void 0:b.dialCode)??"",p.number);/^\+\d{7,15}$/.test(h)||R(I("invalidPhone","Invalid phone number"))}w==null||w(E)},[v,p.number,b,w,I]),P=n||T;return a.jsxs("div",{ref:N,id:D,className:`nice-phone nice-size-${l}${u?` ${u}`:""}${P?" nice-error":""}${r?" nice-disabled":""}`,style:y,children:[e&&a.jsxs("label",{className:"nice-phone__label",children:[e,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),a.jsxs("div",{className:"nice-phone__row",children:[a.jsx("select",{className:"nice-phone__country nice-select",value:b==null?void 0:b.code,onChange:E=>M(E.target.value),disabled:r,"aria-label":I("countryCode","Country code"),children:k.map(E=>a.jsxs("option",{value:E.code,children:[g?`${Ed(E.code)} `:"",E.dialCode," ",E.name]},E.code))}),a.jsx("input",{className:"nice-input nice-phone__number",type:"tel",name:c,value:L,onChange:E=>S(E.target.value),onBlur:x,placeholder:$??((A=b==null?void 0:b.mask)==null?void 0:A.replace(/#/g,"_"))??"",disabled:r,readOnly:s,"aria-label":I("phoneNumber","Phone number")})]}),t&&a.jsx("span",{className:"nice-helper-text",children:t}),P&&typeof P=="string"&&a.jsx("span",{className:"nice-error-text",children:P})]})});Ci.displayName="NicePhoneInput";const zd=[{code:"PLN",symbol:"zł",name:"Polish Zloty"},{code:"EUR",symbol:"€",name:"Euro"},{code:"USD",symbol:"$",name:"US Dollar"},{code:"GBP",symbol:"£",name:"British Pound"},{code:"CZK",symbol:"Kč",name:"Czech Koruna"},{code:"CHF",symbol:"Fr",name:"Swiss Franc"}],_i=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:y,accessMode:f,value:p,onChange:m,onBlur:w,currency:k="PLN",onCurrencyChange:z,currencies:$=zd,useMinorUnit:g=!1,min:v,max:N,locale:j,placeholder:I,showCurrencySelector:D},b)=>{const T=Ee(f,d);if(T==="hidden")return null;T==="disabled"&&(r=!0),T==="readOnly"&&(s=!0);const{t:R}=ke(),L=we(d),M=o.useMemo(()=>$.find(h=>h.code===k)??$[0],[k,$]),S=(M==null?void 0:M.decimals)??2,x=o.useMemo(()=>p==null?"":(g?p/Math.pow(10,S):p).toFixed(S),[p,g,S]),P=o.useCallback(h=>{const C=h.replace(/[^\d.,\-]/g,"").replace(",",".");if(C===""||C==="-"){m==null||m(null);return}const _=parseFloat(C);if(isNaN(_))return;const F=g?Math.round(_*Math.pow(10,S)):_;v!=null&&F<v||N!=null&&F>N||(m==null||m(F))},[m,g,S,v,N]),A=D??$.length>1,E=o.useMemo(()=>{if(p==null)return"";const h=g?p/Math.pow(10,S):p;try{return new Intl.NumberFormat(j,{style:"currency",currency:(M==null?void 0:M.code)??"USD",minimumFractionDigits:S}).format(h)}catch{return`${h.toFixed(S)} ${M==null?void 0:M.code}`}},[p,g,S,j,M]);return a.jsxs("div",{ref:b,id:L,className:`nice-currency nice-size-${l}${u?` ${u}`:""}${n?" nice-error":""}${r?" nice-disabled":""}`,style:y,children:[e&&a.jsxs("label",{className:"nice-currency__label",children:[e,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),a.jsxs("div",{className:"nice-currency__row",children:[A&&a.jsx("select",{className:"nice-currency__select nice-select",value:k,onChange:h=>z==null?void 0:z(h.target.value),disabled:r,"aria-label":R("currency","Currency"),children:$.map(h=>a.jsxs("option",{value:h.code,children:[h.symbol," ",h.code]},h.code))}),!A&&a.jsx("span",{className:"nice-currency__symbol",children:M==null?void 0:M.symbol}),a.jsx("input",{className:"nice-input nice-currency__amount",type:"text",inputMode:"decimal",name:c,value:x,onChange:h=>P(h.target.value),onBlur:w,placeholder:I??`0.${"0".repeat(S)}`,disabled:r,readOnly:s,"aria-label":R("amount","Amount")})]}),E&&p!=null&&a.jsx("span",{className:"nice-currency__formatted",children:E}),t&&a.jsx("span",{className:"nice-helper-text",children:t}),n&&typeof n=="string"&&a.jsx("span",{className:"nice-error-text",children:n})]})});_i.displayName="NiceCurrencyInput";let $d=1;function Ad(e){return{id:`new-${$d++}`,description:"",quantity:1,unitPrice:0,vatRate:e,discount:0,unit:"szt."}}function ji(e){const t=e.quantity*e.unitPrice*(1-(e.discount??0)/100),n=Math.round(t*100)/100,i=Math.round(n*(e.vatRate??0)/100*100)/100;return{...e,netAmount:n,grossAmount:n+i}}function Fd(e){const t=e.map(ji),n=t.reduce((c,d)=>c+(d.netAmount??0),0),i=t.reduce((c,d)=>c+(d.grossAmount??0),0),r=i-n,s=new Map;for(const c of t){const d=c.vatRate??0,u=s.get(d)??{base:0,amount:0};u.base+=c.netAmount??0,u.amount+=(c.grossAmount??0)-(c.netAmount??0),s.set(d,u)}const l=Array.from(s.entries()).map(([c,d])=>({rate:c,base:Math.round(d.base*100)/100,amount:Math.round(d.amount*100)/100}));return{totalNet:Math.round(n*100)/100,totalVat:Math.round(r*100)/100,totalGross:Math.round(i*100)/100,vatBreakdown:l}}const Ni=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:y,accessMode:f,value:p=[],onChange:m,onTotalsChange:w,currencySymbol:k="zł",defaultVatRate:z=23,vatRates:$=[0,5,8,23],units:g=["szt.","h","kg","m","usł."],showDiscount:v=!0,showUnit:N=!0,showTotals:j=!0,editable:I=!0,maxLines:D},b)=>{const T=Ee(f,d);if(T==="hidden")return null;T==="disabled"&&(r=!0),T==="readOnly"&&(s=!0);const{t:R}=ke(),L=we(d),M=o.useMemo(()=>p.map(ji),[p]),S=o.useMemo(()=>Fd(p),[p]);o.useEffect(()=>{w==null||w(S)},[S,w]);const x=o.useCallback((h,C,_)=>{const F=[...p];F[h]={...F[h],[C]:_},m==null||m(F)},[p,m]),P=o.useCallback(()=>{D&&p.length>=D||(m==null||m([...p,Ad(z)]))},[p,m,z,D]),A=o.useCallback(h=>{m==null||m(p.filter((C,_)=>_!==h))},[p,m]),E=h=>`${h.toFixed(2)} ${k}`;return a.jsxs("div",{ref:b,id:L,className:`nice-invoice-lines nice-size-${l}${u?` ${u}`:""}${n?" nice-error":""}${r?" nice-disabled":""}`,style:y,children:[e&&a.jsxs("label",{className:"nice-invoice-lines__label",children:[e,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),a.jsxs("table",{className:"nice-invoice-lines__table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{className:"nice-il__th-num",children:"#"}),a.jsx("th",{className:"nice-il__th-desc",children:R("description","Description")}),a.jsx("th",{className:"nice-il__th-qty",children:R("qty","Qty")}),N&&a.jsx("th",{className:"nice-il__th-unit",children:R("unit","Unit")}),a.jsx("th",{className:"nice-il__th-price",children:R("unitPrice","Unit Price")}),v&&a.jsx("th",{className:"nice-il__th-disc",children:R("discount","Disc %")}),a.jsx("th",{className:"nice-il__th-vat",children:R("vat","VAT %")}),a.jsx("th",{className:"nice-il__th-net",children:R("net","Net")}),a.jsx("th",{className:"nice-il__th-gross",children:R("gross","Gross")}),I&&!s&&a.jsx("th",{className:"nice-il__th-actions"})]})}),a.jsx("tbody",{children:M.map((h,C)=>a.jsxs("tr",{children:[a.jsx("td",{className:"nice-il__cell-num",children:C+1}),a.jsx("td",{className:"nice-il__cell-desc",children:a.jsx("input",{className:"nice-input",type:"text",value:h.description,onChange:_=>x(C,"description",_.target.value),disabled:r,readOnly:s,placeholder:R("itemDescription","Item description")})}),a.jsx("td",{className:"nice-il__cell-qty",children:a.jsx("input",{className:"nice-input",type:"number",value:h.quantity,onChange:_=>x(C,"quantity",parseFloat(_.target.value)||0),disabled:r,readOnly:s,min:0,step:"any"})}),N&&a.jsx("td",{className:"nice-il__cell-unit",children:a.jsx("select",{className:"nice-select",value:h.unit??"",onChange:_=>x(C,"unit",_.target.value),disabled:r,children:g.map(_=>a.jsx("option",{value:_,children:_},_))})}),a.jsx("td",{className:"nice-il__cell-price",children:a.jsx("input",{className:"nice-input",type:"number",value:h.unitPrice,onChange:_=>x(C,"unitPrice",parseFloat(_.target.value)||0),disabled:r,readOnly:s,min:0,step:"0.01"})}),v&&a.jsx("td",{className:"nice-il__cell-disc",children:a.jsx("input",{className:"nice-input",type:"number",value:h.discount??0,onChange:_=>x(C,"discount",parseFloat(_.target.value)||0),disabled:r,readOnly:s,min:0,max:100})}),a.jsx("td",{className:"nice-il__cell-vat",children:a.jsx("select",{className:"nice-select",value:h.vatRate??0,onChange:_=>x(C,"vatRate",parseInt(_.target.value,10)),disabled:r,children:$.map(_=>a.jsxs("option",{value:_,children:[_,"%"]},_))})}),a.jsx("td",{className:"nice-il__cell-net",children:E(h.netAmount??0)}),a.jsx("td",{className:"nice-il__cell-gross",children:E(h.grossAmount??0)}),I&&!s&&a.jsx("td",{className:"nice-il__cell-actions",children:a.jsx("button",{type:"button",className:"nice-btn nice-btn--icon nice-btn--sm",onClick:()=>A(C),disabled:r,title:R("remove","Remove"),children:"✕"})})]},h.id))})]}),I&&!s&&a.jsxs("button",{type:"button",className:"nice-btn nice-btn--outlined nice-btn--sm nice-invoice-lines__add",onClick:P,disabled:r||D!=null&&p.length>=D,children:["+ ",R("addLine","Add line")]}),j&&a.jsxs("div",{className:"nice-invoice-lines__totals",children:[a.jsxs("div",{className:"nice-il__total-row",children:[a.jsxs("span",{children:[R("totalNet","Net total"),":"]}),a.jsx("span",{className:"nice-il__total-value",children:E(S.totalNet)})]}),S.vatBreakdown.map(h=>a.jsxs("div",{className:"nice-il__total-row nice-il__total-row--vat",children:[a.jsxs("span",{children:["VAT ",h.rate,"%:"]}),a.jsx("span",{className:"nice-il__total-value",children:E(h.amount)})]},h.rate)),a.jsxs("div",{className:"nice-il__total-row nice-il__total-row--gross",children:[a.jsxs("span",{children:[R("totalGross","Gross total"),":"]}),a.jsx("span",{className:"nice-il__total-value nice-il__total-value--gross",children:E(S.totalGross)})]})]}),t&&a.jsx("span",{className:"nice-helper-text",children:t}),n&&typeof n=="string"&&a.jsx("span",{className:"nice-error-text",children:n})]})});Ni.displayName="NiceInvoiceLineEditor";const Ei=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:y,accessMode:f,value:p=[],onChange:m,contacts:w=[],onSearch:k,searchDelay:z=300,multiple:$=!1,placeholder:g,onContactClick:v,maxSelections:N},j)=>{const I=Ee(f,d);if(I==="hidden")return null;I==="disabled"&&(r=!0),I==="readOnly"&&(s=!0);const{t:D}=ke(),b=we(d),[T,R]=o.useState(""),[L,M]=o.useState([]),[S,x]=o.useState(!1),[P,A]=o.useState(!1),E=o.useMemo(()=>{const F=[...w,...L],O=new Map(F.map(H=>[H.id,H]));return p.map(H=>O.get(H)).filter(Boolean)},[p,w,L]),h=o.useCallback(F=>{if(R(F),F.length<1){M([]),x(!1);return}if(k){A(!0);const V=setTimeout(async()=>{const U=await k(F);M(U),x(!0),A(!1)},z);return()=>clearTimeout(V)}const O=F.toLowerCase(),H=w.filter(V=>{var U,B;return V.name.toLowerCase().includes(O)||((U=V.email)==null?void 0:U.toLowerCase().includes(O))||((B=V.phone)==null?void 0:B.includes(F))});M(H),x(!0)},[k,w,z]),C=o.useCallback(F=>{if($)if(p.includes(F.id))m==null||m(p.filter(O=>O!==F.id));else{if(N&&p.length>=N)return;m==null||m([...p,F.id])}else m==null||m([F.id]),x(!1),R("")},[p,m,$,N]),_=o.useCallback(F=>{m==null||m(p.filter(O=>O!==F))},[p,m]);return a.jsxs("div",{ref:j,id:b,className:`nice-contact-picker nice-size-${l}${u?` ${u}`:""}${n?" nice-error":""}${r?" nice-disabled":""}`,style:y,children:[e&&a.jsxs("label",{className:"nice-contact-picker__label",children:[e,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),E.length>0&&a.jsx("div",{className:"nice-contact-picker__chips",children:E.map(F=>a.jsxs("span",{className:"nice-contact-picker__chip",onClick:()=>v==null?void 0:v(F),children:[F.avatarUrl&&a.jsx("img",{src:F.avatarUrl,alt:"",className:"nice-contact-picker__chip-avatar"}),a.jsx("span",{children:F.name}),!s&&a.jsx("button",{type:"button",className:"nice-contact-picker__chip-remove",onClick:O=>{O.stopPropagation(),_(F.id)},disabled:r,children:"×"})]},F.id))}),!s&&a.jsxs("div",{className:"nice-contact-picker__search",children:[a.jsx("input",{className:"nice-input",type:"text",value:T,onChange:F=>h(F.target.value),onFocus:()=>T.length>0&&x(!0),onBlur:()=>setTimeout(()=>x(!1),200),placeholder:g??D("searchContacts","Search contacts…"),disabled:r,"aria-label":D("searchContacts","Search contacts")}),P&&a.jsx("span",{className:"nice-contact-picker__spinner",children:"⏳"})]}),S&&L.length>0&&a.jsx("div",{className:"nice-contact-picker__dropdown",role:"listbox",children:L.map(F=>a.jsxs("div",{className:`nice-contact-picker__option${p.includes(F.id)?" nice-contact-picker__option--selected":""}`,role:"option","aria-selected":p.includes(F.id),onClick:()=>C(F),children:[F.avatarUrl&&a.jsx("img",{src:F.avatarUrl,alt:"",className:"nice-contact-picker__option-avatar"}),a.jsxs("div",{className:"nice-contact-picker__option-info",children:[a.jsx("span",{className:"nice-contact-picker__option-name",children:F.name}),F.subtitle&&a.jsx("span",{className:"nice-contact-picker__option-subtitle",children:F.subtitle}),F.email&&a.jsx("span",{className:"nice-contact-picker__option-email",children:F.email})]}),F.type&&a.jsx("span",{className:"nice-contact-picker__option-type",children:F.type==="person"?"👤":"🏢"})]},F.id))}),t&&a.jsx("span",{className:"nice-helper-text",children:t}),n&&typeof n=="string"&&a.jsx("span",{className:"nice-error-text",children:n})]})});Ei.displayName="NiceContactPicker";const Id=["highlight","underline","strikethrough","freehand","text","rect","arrow"],Dd={highlight:"🖍️",underline:"⎁",strikethrough:"S̶",freehand:"✏️",text:"T",rect:"▭",arrow:"→",stamp:"🔏"},Mi=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,readOnly:s,size:l="md",id:c,className:d,style:u,accessMode:y,src:f,annotations:p=[],onAnnotationsChange:m,activeTool:w,onToolChange:k,currentPage:z=1,onPageChange:$,totalPages:g=1,defaultColor:v="#FFFF00",tools:N=Id,author:j,zoom:I=1,onZoomChange:D,onAnnotationClick:b,onAnnotationDelete:T},R)=>{const L=Ee(y,c);if(L==="hidden")return null;L==="disabled"&&(r=!0),L==="readOnly"&&(s=!0);const{t:M}=ke(),S=we(c),x=p.filter(E=>E.page===z),P=o.useCallback(E=>{k==null||k(w===E?null:E)},[w,k]),A=o.useCallback(E=>{if(s||!w||w==="freehand")return;const h=E.currentTarget.getBoundingClientRect(),C=(E.clientX-h.left)/h.width,_=(E.clientY-h.top)/h.height,F={id:`ann-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,tool:w,page:z,x:C,y:_,color:v,author:j,createdAt:new Date().toISOString(),text:w==="text"?"":void 0};m==null||m([...p,F])},[s,w,z,v,j,p,m]);return a.jsxs("div",{ref:R,id:S,className:`nice-pdf-annotation nice-size-${l}${d?` ${d}`:""}${n?" nice-error":""}${r?" nice-disabled":""}`,style:u,children:[e&&a.jsxs("div",{className:"nice-pdf-annotation__label",children:[e,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),!s&&a.jsxs("div",{className:"nice-pdf-annotation__toolbar",children:[N.map(E=>a.jsx("button",{type:"button",className:`nice-pdf-annotation__tool-btn${w===E?" nice-pdf-annotation__tool-btn--active":""}`,onClick:()=>P(E),disabled:r,title:M(`pdfTool_${E}`,E),children:Dd[E]},E)),a.jsx("span",{className:"nice-pdf-annotation__toolbar-sep"}),a.jsx("button",{type:"button",disabled:r,onClick:()=>D==null?void 0:D(Math.max(.25,I-.25)),title:M("zoomOut","Zoom out"),children:"−"}),a.jsxs("span",{className:"nice-pdf-annotation__zoom",children:[Math.round(I*100),"%"]}),a.jsx("button",{type:"button",disabled:r,onClick:()=>D==null?void 0:D(Math.min(4,I+.25)),title:M("zoomIn","Zoom in"),children:"+"})]}),a.jsxs("div",{className:"nice-pdf-annotation__viewport",style:{transform:`scale(${I})`,transformOrigin:"top left"},children:[a.jsx("iframe",{src:f,className:"nice-pdf-annotation__frame",title:M("pdfViewer","PDF Viewer")}),a.jsx("div",{className:"nice-pdf-annotation__layer",onClick:A,children:x.map(E=>a.jsxs("div",{className:`nice-pdf-annotation__mark nice-pdf-annotation__mark--${E.tool}`,style:{left:`${E.x*100}%`,top:`${E.y*100}%`,backgroundColor:E.color},onClick:h=>{h.stopPropagation(),b==null||b(E)},title:E.text??E.tool,children:[E.text&&a.jsx("span",{children:E.text}),!s&&a.jsx("button",{type:"button",className:"nice-pdf-annotation__mark-delete",onClick:h=>{h.stopPropagation(),T==null||T(E.id)},children:"×"})]},E.id))})]}),a.jsxs("div",{className:"nice-pdf-annotation__pager",children:[a.jsx("button",{type:"button",disabled:r||z<=1,onClick:()=>$==null?void 0:$(z-1),children:"◀"}),a.jsx("span",{children:M("pageOf","{page} / {total}").replace("{page}",String(z)).replace("{total}",String(g))}),a.jsx("button",{type:"button",disabled:r||z>=g,onClick:()=>$==null?void 0:$(z+1),children:"▶"})]}),t&&a.jsx("span",{className:"nice-helper-text",children:t}),n&&typeof n=="string"&&a.jsx("span",{className:"nice-error-text",children:n})]})});Mi.displayName="NicePDFAnnotationEditor";const zi=o.forwardRef(({label:e,helperText:t,error:n,disabled:i,readOnly:r,size:s="md",id:l,className:c,style:d,accessMode:u,pages:y,selectedPageId:f,content:p="",contentFormat:m="html",editing:w=!1,onPageSelect:k,onContentChange:z,onSave:$,onCreatePage:g,onDeletePage:v,onEditToggle:N,onVersionHistory:j,sidebarWidth:I=260,sidebarCollapsed:D=!1,onSidebarToggle:b,searchable:T=!0,onSearch:R},L)=>{const M=Ee(u,l);if(M==="hidden")return null;M==="disabled"&&(i=!0),M==="readOnly"&&(r=!0);const{t:S}=ke(),x=we(l),[P,A]=o.useState(""),[E,h]=o.useState(""),[C,_]=o.useState(!1),F=o.useMemo(()=>{const U=B=>{for(const W of B){if(W.id===f)return W;if(W.children){const Q=U(W.children);if(Q)return Q}}};return U(y)},[y,f]),O=o.useCallback(U=>{A(U),R==null||R(U)},[R]),H=o.useCallback(()=>{E.trim()&&(g==null||g(f??null,E.trim()),h(""),_(!1))},[E,f,g]),V=(U,B=0)=>a.jsx("ul",{className:"nice-wiki__tree",style:{paddingLeft:B>0?16:0},children:U.map(W=>{var Q;return a.jsxs("li",{className:"nice-wiki__tree-item",children:[a.jsxs("div",{className:`nice-wiki__tree-node${W.id===f?" nice-wiki__tree-node--active":""}${W.isDraft?" nice-wiki__tree-node--draft":""}`,onClick:()=>k==null?void 0:k(W),role:"treeitem","aria-selected":W.id===f,children:[a.jsx("span",{className:"nice-wiki__tree-icon",children:(Q=W.children)!=null&&Q.length?"📁":"📄"}),a.jsx("span",{className:"nice-wiki__tree-title",children:W.title}),W.isDraft&&a.jsx("span",{className:"nice-wiki__tree-draft",children:S("draft","Draft")})]}),W.children&&W.children.length>0&&V(W.children,B+1)]},W.id)})});return a.jsxs("div",{ref:L,id:x,className:`nice-wiki nice-size-${s}${c?` ${c}`:""}${i?" nice-disabled":""}`,style:d,children:[!D&&a.jsxs("aside",{className:"nice-wiki__sidebar",style:{width:I},children:[a.jsxs("div",{className:"nice-wiki__sidebar-header",children:[a.jsx("span",{className:"nice-wiki__sidebar-title",children:e??S("wiki","Wiki")}),b&&a.jsx("button",{type:"button",className:"nice-wiki__sidebar-toggle",onClick:()=>b(!0),children:"«"})]}),T&&a.jsx("input",{type:"text",className:"nice-input nice-wiki__search",value:P,onChange:U=>O(U.target.value),placeholder:S("searchPages","Search pages…"),disabled:i}),a.jsx("div",{className:"nice-wiki__page-tree",role:"tree",children:V(y)}),g&&!r&&a.jsx("div",{className:"nice-wiki__sidebar-footer",children:C?a.jsxs("div",{className:"nice-wiki__create-form",children:[a.jsx("input",{type:"text",className:"nice-input",value:E,onChange:U=>h(U.target.value),placeholder:S("pageTitle","Page title"),onKeyDown:U=>U.key==="Enter"&&H(),disabled:i}),a.jsx("button",{type:"button",disabled:i||!E.trim(),onClick:H,children:"✓"}),a.jsx("button",{type:"button",onClick:()=>_(!1),children:"✕"})]}):a.jsxs("button",{type:"button",className:"nice-wiki__add-page",onClick:()=>_(!0),disabled:i,children:["+ ",S("newPage","New page")]})})]}),D&&b&&a.jsx("button",{type:"button",className:"nice-wiki__sidebar-expand",onClick:()=>b(!1),children:"»"}),a.jsx("main",{className:"nice-wiki__content",children:F?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"nice-wiki__content-header",children:[a.jsx("h1",{className:"nice-wiki__page-title",children:F.title}),a.jsxs("div",{className:"nice-wiki__content-actions",children:[N&&!r&&a.jsx("button",{type:"button",disabled:i,onClick:()=>N(!w),children:w?S("preview","Preview"):S("edit","Edit")}),j&&a.jsx("button",{type:"button",disabled:i,onClick:()=>j(F.id),children:S("history","History")}),v&&!r&&a.jsx("button",{type:"button",className:"nice-btn--danger",disabled:i,onClick:()=>v(F.id),children:S("delete","Delete")})]})]}),F.updatedAt&&a.jsxs("div",{className:"nice-wiki__page-meta",children:[F.updatedBy&&a.jsxs("span",{children:[S("lastEditedBy","Last edited by")," ",F.updatedBy]}),a.jsx("span",{children:new Date(F.updatedAt).toLocaleDateString()})]}),w?a.jsxs("div",{className:"nice-wiki__editor",children:[a.jsx("textarea",{className:"nice-wiki__editor-textarea",value:p,onChange:U=>z==null?void 0:z(U.target.value),disabled:i}),$&&a.jsx("button",{type:"button",className:"nice-btn nice-btn--primary",disabled:i,onClick:()=>$(F.id,p),children:S("save","Save")})]}):a.jsx("div",{className:"nice-wiki__viewer",children:m==="html"?a.jsx("div",{className:"nice-wiki__html",dangerouslySetInnerHTML:{__html:Zt(p)}}):a.jsx("pre",{className:"nice-wiki__markdown",children:p})})]}):a.jsx("div",{className:"nice-wiki__empty",children:a.jsx("p",{children:S("selectPage","Select a page from the sidebar or create a new one.")})})}),t&&a.jsx("span",{className:"nice-helper-text",children:t}),n&&typeof n=="string"&&a.jsx("span",{className:"nice-error-text",children:n})]})});zi.displayName="NiceWiki";const Td=[{code:"PL",label:"Polska",prefix:"PL",pattern:/^\d{10}$/,placeholder:"1234567890"},{code:"DE",label:"Deutschland",prefix:"DE",pattern:/^\d{9}$/,placeholder:"123456789"},{code:"GB",label:"United Kingdom",prefix:"GB",pattern:/^\d{9}(\d{3})?$/,placeholder:"123456789"},{code:"FR",label:"France",prefix:"FR",pattern:/^[A-Z0-9]{2}\d{9}$/,placeholder:"XX123456789"},{code:"CZ",label:"Česko",prefix:"CZ",pattern:/^\d{8,10}$/,placeholder:"12345678"},{code:"SK",label:"Slovensko",prefix:"SK",pattern:/^\d{10}$/,placeholder:"1234567890"},{code:"IT",label:"Italia",prefix:"IT",pattern:/^\d{11}$/,placeholder:"12345678901"},{code:"ES",label:"España",prefix:"ES",pattern:/^[A-Z0-9]\d{7}[A-Z0-9]$/,placeholder:"X1234567X"}],$i=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:y,accessMode:f,value:p="",onChange:m,countryCode:w="PL",onCountryChange:k,countries:z=Td,showCountrySelector:$=!0,autoPrefixVat:g=!0,validationResult:v,onValidateRequest:N,placeholder:j},I)=>{const D=Ee(f,d);if(D==="hidden")return null;D==="disabled"&&(r=!0),D==="readOnly"&&(s=!0);const{t:b}=ke(),T=we(d),R=o.useMemo(()=>z.find(P=>P.code===w)??z[0],[z,w]),L=o.useCallback(P=>{let A=P.toUpperCase();return R&&A.startsWith(R.prefix)&&(A=A.slice(R.prefix.length)),R?R.pattern.test(A):A.length>0},[R]),M=o.useCallback(P=>{let A=P.target.value.replace(/\s/g,"");m==null||m(A,L(A))},[m,L]),S=g&&p&&R&&!p.toUpperCase().startsWith(R.prefix)?`${R.prefix}${p}`:p,x=L(p);return a.jsxs("div",{ref:I,id:T,className:`nice-vat-input nice-size-${l}${u?` ${u}`:""}${n||!x&&p.length>0?" nice-error":""}${r?" nice-disabled":""}`,style:y,children:[e&&a.jsxs("label",{className:"nice-vat-input__label",htmlFor:`${T}-input`,children:[e,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),a.jsxs("div",{className:"nice-vat-input__row",children:[$&&a.jsx("select",{className:"nice-vat-input__country",value:w,onChange:P=>k==null?void 0:k(P.target.value),disabled:r||s,children:z.map(P=>a.jsx("option",{value:P.code,children:P.prefix},P.code))}),a.jsx("input",{id:`${T}-input`,className:"nice-input nice-vat-input__field",type:"text",name:c,value:p,onChange:M,readOnly:s,disabled:r,placeholder:j??(R==null?void 0:R.placeholder),required:i,"aria-invalid":!x&&p.length>0}),N&&p.length>0&&a.jsx("button",{type:"button",className:"nice-vat-input__verify",disabled:r||!x,onClick:()=>N(g?S:p,w),title:b("verifyVat","Verify VAT number"),children:"🔍"})]}),v&&a.jsxs("div",{className:`nice-vat-input__result nice-vat-input__result--${v.valid?"valid":"invalid"}`,children:[v.valid?"✅":"❌"," ",v.companyName??v.error??(v.valid?b("vatValid","VAT number valid"):b("vatInvalid","VAT number invalid"))]}),t&&a.jsx("span",{className:"nice-helper-text",children:t}),n&&typeof n=="string"&&a.jsx("span",{className:"nice-error-text",children:n})]})});$i.displayName="NiceVatInput";const Rd=[{id:"pl-23",label:"23%",rate:.23,countryCode:"PL",category:"standard",isDefault:!0},{id:"pl-8",label:"8%",rate:.08,countryCode:"PL",category:"reduced"},{id:"pl-5",label:"5%",rate:.05,countryCode:"PL",category:"reduced"},{id:"pl-0",label:"0%",rate:0,countryCode:"PL",category:"zero"},{id:"pl-zw",label:"zw.",rate:0,countryCode:"PL",category:"exempt"},{id:"pl-np",label:"n.p.",rate:0,countryCode:"PL",category:"exempt"}],Ai=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:y,accessMode:f,value:p,onChange:m,rates:w,countryCode:k,placeholder:z,showPercentage:$=!0},g)=>{const v=Ee(f,d);if(v==="hidden")return null;v==="disabled"&&(r=!0),v==="readOnly"&&(s=!0);const{t:N}=ke(),j=we(d),I=o.useMemo(()=>{const b=w??Rd;return k?b.filter(T=>!T.countryCode||T.countryCode===k):b},[w,k]),D=o.useCallback(b=>{const T=b.target.value,R=I.find(L=>L.id===T);R&&(m==null||m(T,R))},[m,I]);return a.jsxs("div",{ref:g,id:j,className:`nice-tax-rate nice-size-${l}${u?` ${u}`:""}${n?" nice-error":""}${r?" nice-disabled":""}`,style:y,children:[e&&a.jsxs("label",{className:"nice-tax-rate__label",htmlFor:`${j}-select`,children:[e,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),a.jsxs("select",{id:`${j}-select`,className:"nice-select nice-tax-rate__select",name:c,value:p??"",onChange:D,disabled:r||s,required:i,children:[a.jsx("option",{value:"",disabled:!0,children:z??N("selectRate","Select rate…")}),I.map(b=>a.jsxs("option",{value:b.id,children:[b.label,$&&b.category!=="exempt"?` (${(b.rate*100).toFixed(0)}%)`:""]},b.id))]}),t&&a.jsx("span",{className:"nice-helper-text",children:t}),n&&typeof n=="string"&&a.jsx("span",{className:"nice-error-text",children:n})]})});Ai.displayName="NiceTaxRatePicker";const Pd={asset:"var(--nice-color-info, #5bc0de)",liability:"var(--nice-color-warning, #f0ad4e)",equity:"var(--nice-color-success, #5cb85c)",revenue:"var(--nice-color-primary, #337ab7)",expense:"var(--nice-color-error, #d9534f)"},Fi=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:y,accessMode:f,value:p,onChange:m,accounts:w,treeView:k=!1,placeholder:z,searchable:$=!0,showType:g=!0,onSearch:v},N)=>{const j=Ee(f,d);if(j==="hidden")return null;j==="disabled"&&(r=!0),j==="readOnly"&&(s=!0);const{t:I}=ke(),D=we(d),[b,T]=o.useState(""),[R,L]=o.useState(!1),M=o.useMemo(()=>{const E=h=>{for(const C of h){if(C.code===p)return C;if(C.children){const _=E(C.children);if(_)return _}}};return E(w)},[w,p]),S=o.useMemo(()=>{const E=[],h=C=>{for(const _ of C)E.push(_),_.children&&h(_.children)};return h(w),E},[w]),x=o.useMemo(()=>{if(!b)return S;const E=b.toLowerCase();return S.filter(h=>h.code.toLowerCase().includes(E)||h.name.toLowerCase().includes(E))},[S,b]),P=o.useCallback(E=>{T(E),v==null||v(E),L(!0)},[v]),A=o.useCallback(E=>{m==null||m(E.code,E),L(!1),T("")},[m]);return a.jsxs("div",{ref:N,id:D,className:`nice-account-picker nice-size-${l}${u?` ${u}`:""}${n?" nice-error":""}${r?" nice-disabled":""}`,style:y,children:[e&&a.jsxs("label",{className:"nice-account-picker__label",htmlFor:`${D}-input`,children:[e,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),a.jsx("div",{className:"nice-account-picker__control",children:$&&!s?a.jsx("input",{id:`${D}-input`,className:"nice-input",type:"text",value:R?b:M?`${M.code} — ${M.name}`:"",onChange:E=>P(E.target.value),onFocus:()=>{T(""),L(!0)},onBlur:()=>setTimeout(()=>L(!1),200),placeholder:z??I("searchAccount","Search account…"),disabled:r,required:i}):a.jsx("div",{className:"nice-account-picker__display",children:M?`${M.code} — ${M.name}`:z??I("selectAccount","Select account…")})}),R&&x.length>0&&a.jsx("div",{className:"nice-account-picker__dropdown",role:"listbox",children:x.map(E=>a.jsxs("div",{className:`nice-account-picker__option${E.code===p?" nice-account-picker__option--selected":""}${E.isActive===!1?" nice-account-picker__option--inactive":""}`,role:"option","aria-selected":E.code===p,onClick:()=>A(E),children:[g&&E.type&&a.jsx("span",{className:"nice-account-picker__type",style:{color:Pd[E.type]},title:E.type,children:"●"}),a.jsx("span",{className:"nice-account-picker__code",children:E.code}),a.jsx("span",{className:"nice-account-picker__name",children:E.name})]},E.code))}),t&&a.jsx("span",{className:"nice-helper-text",children:t}),n&&typeof n=="string"&&a.jsx("span",{className:"nice-error-text",children:n})]})});Fi.displayName="NiceAccountPicker";const Ii=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,readOnly:s,size:l="md",id:c,className:d,style:u,accessMode:y,mode:f="manual",onScan:p,onModeChange:m,beepOnScan:w=!0,beepFrequency:k=1800,beepDuration:z=150,placeholder:$,scanHistory:g=[],showHistory:v=!0,maxHistory:N=10,autoFocus:j=!0,onCameraFrame:I},D)=>{const b=Ee(y,c);if(b==="hidden")return null;b==="disabled"&&(r=!0),b==="readOnly"&&(s=!0);const{t:T}=ke(),R=we(c),[L,M]=o.useState(""),S=o.useRef(null),x=o.useRef(null),P=o.useCallback(()=>{if(w)try{x.current||(x.current=new AudioContext);const h=x.current,C=h.createOscillator(),_=h.createGain();C.connect(_),_.connect(h.destination),C.frequency.value=k,C.type="square",_.gain.value=.3,C.start(),C.stop(h.currentTime+z/1e3)}catch{}},[w,k,z]),A=o.useCallback(()=>{var h;L.trim()&&(P(),p==null||p({value:L.trim(),format:"manual",scannedAt:new Date}),M(""),(h=S.current)==null||h.focus())},[L,p,P]),E=g.slice(0,N);return a.jsxs("div",{ref:D,id:R,className:`nice-scanner nice-size-${l}${d?` ${d}`:""}${n?" nice-error":""}${r?" nice-disabled":""}`,style:u,children:[e&&a.jsxs("div",{className:"nice-scanner__label",children:[e,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),a.jsxs("div",{className:"nice-scanner__modes",children:[a.jsxs("button",{type:"button",className:`nice-scanner__mode-btn${f==="camera"?" nice-scanner__mode-btn--active":""}`,onClick:()=>m==null?void 0:m("camera"),disabled:r,children:["📷 ",T("camera","Camera")]}),a.jsxs("button",{type:"button",className:`nice-scanner__mode-btn${f==="manual"?" nice-scanner__mode-btn--active":""}`,onClick:()=>m==null?void 0:m("manual"),disabled:r,children:["⌨️ ",T("manual","Manual")]})]}),f==="camera"&&a.jsx("div",{className:"nice-scanner__camera",children:a.jsx("div",{className:"nice-scanner__viewfinder",children:a.jsxs("div",{className:"nice-scanner__viewfinder-overlay",children:[a.jsx("span",{children:"📷"}),a.jsx("p",{children:T("cameraPlaceholder","Camera preview — connect scanner adapter")})]})})}),f==="manual"&&!s&&a.jsxs("div",{className:"nice-scanner__manual",children:[a.jsx("input",{ref:S,className:"nice-input nice-scanner__input",type:"text",value:L,onChange:h=>M(h.target.value),onKeyDown:h=>h.key==="Enter"&&A(),placeholder:$??T("enterCode","Enter or scan code…"),disabled:r,autoFocus:j}),a.jsx("button",{type:"button",className:"nice-scanner__submit",onClick:A,disabled:r||!L.trim(),children:"✓"})]}),v&&E.length>0&&a.jsxs("div",{className:"nice-scanner__history",children:[a.jsx("div",{className:"nice-scanner__history-label",children:T("recentScans","Recent scans")}),E.map((h,C)=>a.jsxs("div",{className:"nice-scanner__history-item",children:[a.jsx("span",{className:"nice-scanner__history-value",children:h.value}),h.format&&a.jsx("span",{className:"nice-scanner__history-format",children:h.format}),a.jsx("span",{className:"nice-scanner__history-time",children:h.scannedAt.toLocaleTimeString()})]},C))]}),t&&a.jsx("span",{className:"nice-helper-text",children:t}),n&&typeof n=="string"&&a.jsx("span",{className:"nice-error-text",children:n})]})});Ii.displayName="NiceScannerControl";const Di=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,readOnly:s,size:l="md",id:c,className:d,style:u,accessMode:y,value:f="",onChange:p,onComplete:m,length:w=4,masked:k=!0,showKeypad:z=!1,autoSubmit:$=!0,shake:g=!1,placeholderChar:v="·"},N)=>{const j=Ee(y,c);if(j==="hidden")return null;j==="disabled"&&(r=!0),j==="readOnly"&&(s=!0);const{t:I}=ke(),D=we(c),b=o.useRef([]),[T,R]=o.useState(!1);o.useEffect(()=>{if(g){R(!0);const P=setTimeout(()=>R(!1),500);return()=>clearTimeout(P)}},[g]);const L=f.split("").slice(0,w);for(;L.length<w;)L.push("");const M=o.useCallback((P,A)=>{var C;const E=[...L];E[P]=A;const h=E.join("");p==null||p(h),A&&P<w-1&&((C=b.current[P+1])==null||C.focus()),$&&h.length===w&&h.indexOf("")===-1&&(m==null||m(h))},[L,w,p,m,$]),S=o.useCallback((P,A)=>{var E,h,C;P.key==="Backspace"&&!L[A]&&A>0&&((E=b.current[A-1])==null||E.focus(),M(A-1,"")),P.key==="ArrowLeft"&&A>0&&((h=b.current[A-1])==null||h.focus()),P.key==="ArrowRight"&&A<w-1&&((C=b.current[A+1])==null||C.focus())},[L,w,M]),x=o.useCallback(P=>{var A,E,h;if(P==="clear"){p==null||p(""),(A=b.current[0])==null||A.focus();return}if(P==="backspace"){const C=f.slice(0,-1);p==null||p(C);const _=Math.max(0,C.length-1);(E=b.current[_])==null||E.focus();return}if(f.length<w){const C=f+P;p==null||p(C),C.length<w&&((h=b.current[C.length])==null||h.focus()),$&&C.length===w&&(m==null||m(C))}},[f,w,p,m,$]);return a.jsxs("div",{ref:N,id:D,className:`nice-pin nice-size-${l}${T?" nice-pin--shake":""}${d?` ${d}`:""}${n?" nice-error":""}${r?" nice-disabled":""}`,style:u,children:[e&&a.jsxs("label",{className:"nice-pin__label",children:[e,i&&a.jsx("span",{className:"nice-required",children:"*"})]}),a.jsx("div",{className:"nice-pin__boxes",children:L.map((P,A)=>a.jsx("input",{ref:E=>{b.current[A]=E},className:"nice-pin__box",type:k?"password":"text",inputMode:"numeric",maxLength:1,value:P,onChange:E=>{const h=E.target.value.replace(/\D/g,"");h.length<=1&&M(A,h)},onKeyDown:E=>S(E,A),disabled:r,readOnly:s,placeholder:v,"aria-label":`${I("digit","Digit")} ${A+1}`},A))}),z&&!s&&a.jsx("div",{className:"nice-pin__keypad",children:["1","2","3","4","5","6","7","8","9","clear","0","backspace"].map(P=>a.jsx("button",{type:"button",className:`nice-pin__key${P==="clear"||P==="backspace"?" nice-pin__key--action":""}`,onClick:()=>x(P),disabled:r,children:P==="clear"?"C":P==="backspace"?"⌫":P},P))}),t&&a.jsx("span",{className:"nice-helper-text",children:t}),n&&typeof n=="string"&&a.jsx("span",{className:"nice-error-text",children:n})]})});Di.displayName="NicePinCodeInput";const Na=Object.freeze(Object.defineProperty({__proto__:null,$:$i,A:Dn,B:Ni,C:Tn,D:ii,E:Wn,F:An,G:Rn,H:Hn,I:Mi,J:In,K:Ci,L:On,M:Di,N:Fi,O:Ya,P:si,Q:Fn,R:Ii,T:Kn,U:Jt,V:oi,W:Ai,X:Sn,Y:$n,_:Pn,a:Si,a0:zi,a4:ni,a5:pi,a8:fi,aa:mi,ab:Kt,ac:Wt,ad:ti,ae:Et,af:Xa,ag:un,ah:_t,ai:zt,aj:Ue,ak:Za,al:ei,am:Qa,an:Ga,ao:_n,ap:Vt,aq:Bc,ar:ad,b:ai,c:en,d:Bn,e:Ln,g:Nn,h:Ei,k:_i,l:Cn,m:ri,n:zn,o:Yn,p:li,r:ki,s:hi,t:Mn,u:En,v:tn,x:gi,y:Vn,z:qn},Symbol.toStringTag,{value:"Module"})),ut=o.forwardRef(({label:e,helperText:t,error:n,required:i,disabled:r,readOnly:s,size:l="md",name:c,id:d,className:u,style:y,accessMode:f,displayStyle:p,value:m,onChange:w,onBlur:k,onKeyDown:z,placeholder:$,min:g,max:v,step:N=1,precision:j,prefix:I,suffix:D,showStepper:b=!0,submitOnEnter:T,onSubmit:R,showKeyboardHints:L},M)=>{const S=Ee(f,d);if(S==="hidden")return null;S==="disabled"&&(r=!0),S==="readOnly"&&(s=!0);const{t:x}=ke(),P=we(d),A=Ye("input",p),E=Be("input",p),h=o.useCallback(U=>{let B=U;return g!==void 0&&(B=Math.max(g,B)),v!==void 0&&(B=Math.min(v,B)),j!==void 0&&(B=parseFloat(B.toFixed(j))),B},[g,v,j]),C=o.useCallback(U=>{const B=U.target.value;if(B===""){w==null||w(null);return}const W=parseFloat(B);isNaN(W)||(w==null||w(h(W)))},[w,h]),_=o.useCallback(()=>{w==null||w(h((m??0)+N))},[m,N,w,h]),F=o.useCallback(()=>{w==null||w(h((m??0)-N))},[m,N,w,h]),O=bn({enabled:T,onSubmit:R}),H=o.useCallback(U=>{O(U),z==null||z(U)},[O,z]),V=o.useMemo(()=>{const U=[];return T&&U.push($e.submit),b&&(U.push({key:"ArrowUp",description:x("shortcuts.increment","Increase value")}),U.push({key:"ArrowDown",description:x("shortcuts.decrement","Decrease value")})),U},[T,b,x]);return a.jsxs("div",{className:`nice-field ${u||""}`,style:y,children:[e&&a.jsxs("label",{htmlFor:P,className:`nice-field__label ${i?"nice-field__label--required":""}`,children:[e,L&&V.length>0&&a.jsx(Oe,{shortcuts:V,size:"sm"})]}),a.jsxs("div",{className:`nice-input nice-input--${l} nice-input--ds-${E} ${n?"nice-input--error":""} ${r?"nice-input--disabled":""} ${s?"nice-input--readonly":""}`,style:A,children:[I&&a.jsx("span",{className:"nice-input__icon",children:I}),b&&!s&&a.jsx("button",{type:"button",className:"nice-input__clear",onClick:F,disabled:r,"aria-label":x("controls.decrement","Decrement"),children:"−"}),a.jsx("input",{ref:M,id:P,className:"nice-input__native",type:"number",name:c,value:m??"",placeholder:$,min:g,max:v,step:N,disabled:r,readOnly:s,"aria-invalid":!!n,onChange:C,onBlur:k,onKeyDown:H}),b&&!s&&a.jsx("button",{type:"button",className:"nice-input__clear",onClick:_,disabled:r,"aria-label":x("controls.increment","Increment"),children:"+"}),D&&a.jsx("span",{className:"nice-input__icon",children:D})]}),n&&a.jsx("div",{className:"nice-field__error",role:"alert",children:n}),!n&&t&&a.jsx("div",{className:"nice-field__helper",children:t})]})});ut.displayName="NiceNumberInput";const Ti=o.forwardRef(({label:e,checked:t=!1,indeterminate:n=!1,onChange:i,disabled:r,size:s="md",name:l,id:c,className:d,style:u,error:y,accessMode:f,displayStyle:p,showKeyboardHints:m},w)=>{const k=Ee(f,c);if(k==="hidden")return null;(k==="disabled"||k==="readOnly")&&(r=!0);const{t:z}=ke(),$=we(c);Be("toggle",p);const g=o.useMemo(()=>[{key:"Space",description:z("shortcuts.toggle","Toggle")}],[z]),v=o.useCallback(N=>{N&&(N.indeterminate=n),typeof w=="function"?w(N):w&&(w.current=N)},[n,w]);return a.jsxs("div",{className:d,style:u,children:[a.jsxs("label",{className:`nice-checkbox ${s!=="md"?`nice-checkbox--${s}`:""} ${r?"nice-checkbox--disabled":""}`,htmlFor:$,children:[a.jsx("input",{ref:v,id:$,type:"checkbox",className:"nice-checkbox__input",name:l,checked:t,disabled:r,"aria-invalid":!!y,onChange:N=>i==null?void 0:i(N.target.checked)}),a.jsx("span",{className:"nice-checkbox__box",children:a.jsx("svg",{viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n?a.jsx("line",{x1:"2",y1:"6",x2:"10",y2:"6"}):a.jsx("polyline",{points:"2 6 5 9 10 3"})})}),e&&a.jsx("span",{children:e}),m&&a.jsx(Oe,{shortcuts:g,size:"sm"})]}),y&&a.jsx("div",{className:"nice-field__error",role:"alert",children:y})]})});Ti.displayName="NiceCheckbox";const Ri=o.forwardRef(({label:e,checked:t=!1,onChange:n,disabled:i,size:r="md",name:s,id:l,className:c,style:d,accessMode:u,displayStyle:y,showKeyboardHints:f},p)=>{const m=Ee(u,l);if(m==="hidden")return null;(m==="disabled"||m==="readOnly")&&(i=!0);const{t:w}=ke(),k=we(l),z=Ye("toggle",y),$=Be("toggle",y),g=o.useMemo(()=>[{key:"Space",description:w("shortcuts.toggle","Toggle on/off")}],[w]);return a.jsxs("label",{className:`nice-toggle nice-toggle--ds-${$} ${r!=="md"?`nice-toggle--${r}`:""} ${i?"nice-toggle--disabled":""} ${c||""}`,htmlFor:k,style:{...z,...d},children:[a.jsx("input",{ref:p,id:k,type:"checkbox",className:"nice-toggle__input",name:s,checked:t,disabled:i,role:"switch","aria-checked":t,onChange:v=>n==null?void 0:n(v.target.checked)}),a.jsx("span",{className:"nice-toggle__track",children:a.jsx("span",{className:"nice-toggle__thumb"})}),e&&a.jsx("span",{children:e}),f&&a.jsx(Oe,{shortcuts:g,size:"sm"})]})});Ri.displayName="NiceToggle";const Od=180,Zn=({slides:e,slideSize:t,theme:n,currentIndex:i,onSelectSlide:r,onAddSlide:s,onDuplicateSlide:l,onRemoveSlide:c,className:d})=>{const u=Qt(),y=Od/t.width;return a.jsxs("div",{className:`nice-slide-thumbs ${d??""}`,style:{overflowY:"auto",padding:8},children:[e.map((f,p)=>a.jsxs("div",{className:`nice-slide-thumbs__item ${p===i?"nice-slide-thumbs__item--active":""}`,onClick:()=>r(p),style:{marginBottom:8,border:p===i?"2px solid #2196f3":"2px solid transparent",borderRadius:4,cursor:"pointer",position:"relative"},children:[a.jsx("div",{style:{pointerEvents:"none"},children:a.jsx(mt,{slide:f,slideSize:t,theme:n,scale:y})}),a.jsxs("div",{style:{fontSize:10,textAlign:"center",padding:"2px 0",color:"#666"},children:[p+1,". ",f.title]}),(l||c)&&a.jsxs("div",{className:"nice-slide-thumbs__actions",style:{position:"absolute",top:2,right:2,display:"flex",gap:2},children:[l&&a.jsx(xe,{className:"nice-slide-thumbs__action-btn",variant:"ghost",size:"sm",onClick:m=>{m.stopPropagation(),l(f.id)},title:u("toolbar.duplicateSlide"),style:{fontSize:10,padding:"1px 4px"},children:"⧉"}),c&&e.length>1&&a.jsx(xe,{className:"nice-slide-thumbs__action-btn",variant:"ghost",size:"sm",onClick:m=>{m.stopPropagation(),c(f.id)},title:u("toolbar.deleteSlide"),style:{fontSize:10,padding:"1px 4px",color:"#d32f2f"},children:"×"})]})]},f.id)),s&&a.jsxs(xe,{className:"nice-slide-thumbs__add",variant:"ghost",size:"sm",onClick:s,style:{width:"100%",padding:"8px 0",fontSize:13,color:"#888"},children:["+ ",u("toolbar.addSlide")]})]})};Zn.displayName="SlideThumbnailList";const Ld=["text","image","shape","chart","table","code","diagram","icon"],Bd=["blank","titleSlide","titleContent","twoColumn","titleOnly","sectionHeader","comparison"],Gn=({onAddElement:e,onAddSlide:t,onUndo:n,onRedo:i,canUndo:r=!1,canRedo:s=!1,onPresent:l,onExport:c,className:d})=>{const u=Qt(),[y,f]=o.useState(!1),[p,m]=o.useState(!1),[w,k]=o.useState(!1),z=o.useCallback(g=>{e==null||e(g),f(!1)},[e]),$=o.useCallback(g=>{t==null||t(g),m(!1)},[t]);return a.jsxs("div",{className:`nice-pres-toolbar ${d??""}`,children:[a.jsxs("div",{className:"nice-pres-toolbar__group nice-pres-toolbar__group--relative",children:[a.jsxs(xe,{className:"nice-pres-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>m(g=>!g),children:["+ ",u("toolbar.addSlide")]}),p&&a.jsx("div",{className:"nice-pres-toolbar__dropdown",children:Bd.map(g=>a.jsx(xe,{className:"nice-pres-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>$(g),children:u(`layout.${g}`)},g))})]}),a.jsxs("div",{className:"nice-pres-toolbar__group nice-pres-toolbar__group--relative",children:[a.jsxs(xe,{className:"nice-pres-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>f(g=>!g),children:["+ ",u("element.addElement")]}),y&&a.jsx("div",{className:"nice-pres-toolbar__dropdown",children:Ld.map(g=>a.jsx(xe,{className:"nice-pres-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>z(g),children:u(`element.${g}`)},g))})]}),a.jsxs("div",{className:"nice-pres-toolbar__group",children:[a.jsx(xe,{className:"nice-pres-toolbar__btn",variant:"ghost",size:"sm",onClick:n,disabled:!r,title:u("toolbar.undo"),children:"↩"}),a.jsx(xe,{className:"nice-pres-toolbar__btn",variant:"ghost",size:"sm",onClick:i,disabled:!s,title:u("toolbar.redo"),children:"↪"})]}),a.jsx("div",{className:"nice-pres-toolbar__group",children:a.jsxs(xe,{className:"nice-pres-toolbar__btn nice-pres-toolbar__btn--primary",variant:"primary",size:"sm",onClick:l,children:["▶ ",u("toolbar.present")]})}),a.jsxs("div",{className:"nice-pres-toolbar__group nice-pres-toolbar__group--relative",children:[a.jsxs(xe,{className:"nice-pres-toolbar__btn",variant:"ghost",size:"sm",onClick:()=>k(g=>!g),children:["⤓ ",u("toolbar.export")]}),w&&a.jsxs("div",{className:"nice-pres-toolbar__dropdown",children:[a.jsx(xe,{className:"nice-pres-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{c==null||c("ndp"),k(!1)},children:u("export.ndp")}),a.jsx(xe,{className:"nice-pres-toolbar__dropdown-item",variant:"ghost",size:"sm",onClick:()=>{c==null||c("html"),k(!1)},children:u("export.html")})]})]})]})};Gn.displayName="PresentationToolbar";const Hd=["blank","titleSlide","titleContent","twoColumn","titleOnly","sectionHeader","comparison","custom"],Qn=({slide:e,selectedElement:t,onSlideChange:n,onElementChange:i,onRemoveElement:r,className:s})=>{const l=Qt();return e?t&&e?a.jsxs("div",{className:`nice-pres-panel ${s??""}`,children:[a.jsx("h3",{className:"nice-pres-panel__title",children:l("panel.elementProperties")}),a.jsxs("div",{className:"nice-pres-panel__row",children:[a.jsxs("label",{className:"nice-pres-panel__label nice-pres-panel__label--half",children:["X (%)",a.jsx(ut,{value:Math.round(t.position.x*10)/10,min:0,max:100,step:.5,onChange:c=>i==null?void 0:i(e.id,t.id,{position:{...t.position,x:c??0}}),className:"nice-pres-panel__input"})]}),a.jsxs("label",{className:"nice-pres-panel__label nice-pres-panel__label--half",children:["Y (%)",a.jsx(ut,{value:Math.round(t.position.y*10)/10,min:0,max:100,step:.5,onChange:c=>i==null?void 0:i(e.id,t.id,{position:{...t.position,y:c??0}}),className:"nice-pres-panel__input"})]})]}),a.jsxs("div",{className:"nice-pres-panel__row",children:[a.jsxs("label",{className:"nice-pres-panel__label nice-pres-panel__label--half",children:["W (%)",a.jsx(ut,{value:Math.round(t.position.width*10)/10,min:1,max:100,step:.5,onChange:c=>i==null?void 0:i(e.id,t.id,{position:{...t.position,width:c??1}}),className:"nice-pres-panel__input"})]}),a.jsxs("label",{className:"nice-pres-panel__label nice-pres-panel__label--half",children:["H (%)",a.jsx(ut,{value:Math.round(t.position.height*10)/10,min:1,max:100,step:.5,onChange:c=>i==null?void 0:i(e.id,t.id,{position:{...t.position,height:c??1}}),className:"nice-pres-panel__input"})]})]}),a.jsxs("label",{className:"nice-pres-panel__label",children:["Opacity",a.jsx(Jt,{min:0,max:1,step:.05,value:t.opacity??1,onChange:c=>i==null?void 0:i(e.id,t.id,{opacity:c})})]}),t.content.kind==="text"&&a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"nice-pres-panel__label",children:[l("element.text"),a.jsx("textarea",{value:t.content.text,onChange:c=>i==null?void 0:i(e.id,t.id,{content:{...t.content,text:c.target.value}}),className:"nice-pres-panel__textarea",rows:4})]}),a.jsxs("label",{className:"nice-pres-panel__label",children:["Font Size",a.jsx(ut,{value:t.content.fontSize??16,min:8,max:200,onChange:c=>i==null?void 0:i(e.id,t.id,{content:{...t.content,fontSize:c??16}}),className:"nice-pres-panel__input"})]})]}),a.jsx(xe,{className:"nice-pres-panel__btn nice-pres-panel__btn--danger",variant:"ghost",size:"sm",onClick:()=>r==null?void 0:r(e.id,t.id),children:"Delete Element"})]}):a.jsxs("div",{className:`nice-pres-panel ${s??""}`,children:[a.jsx("h3",{className:"nice-pres-panel__title",children:l("panel.slideProperties")}),a.jsxs("label",{className:"nice-pres-panel__label",children:["Title",a.jsx(pt,{value:e.title,onChange:c=>n==null?void 0:n(e.id,{title:c}),className:"nice-pres-panel__input"})]}),a.jsxs("label",{className:"nice-pres-panel__label",children:[l("panel.layout"),a.jsx(ht,{value:e.layout,onChange:c=>n==null?void 0:n(e.id,{layout:c}),options:Hd.map(c=>({value:c,label:l(`layout.${c}`)})),className:"nice-pres-panel__select"})]}),a.jsxs("label",{className:"nice-pres-panel__label",children:[l("panel.background"),a.jsx(gt,{value:e.background.color??"#ffffff",onChange:c=>n==null?void 0:n(e.id,{background:{...e.background,type:"solid",color:c}}),className:"nice-pres-panel__color"})]}),a.jsxs("label",{className:"nice-pres-panel__label",children:[l("panel.notes"),a.jsx("textarea",{value:e.notes??"",onChange:c=>n==null?void 0:n(e.id,{notes:c.target.value||void 0}),className:"nice-pres-panel__textarea",rows:4,placeholder:l("panel.notes")})]})]}):a.jsx("div",{className:`nice-pres-panel nice-pres-panel--empty ${s??""}`,children:a.jsx("p",{style:{color:"#999",fontStyle:"italic",textAlign:"center",padding:16},children:l("panel.noSelection")})})};Qn.displayName="SlidePropertyPanel";function qd(e){let t;try{t=JSON.parse(e)}catch{return{ok:!1,error:"Invalid JSON"}}if(typeof t!="object"||t===null)return{ok:!1,error:"Root must be an object"};const n=t;return n.version!=="1.0"?{ok:!1,error:`Unsupported version: ${String(n.version)}`}:!n.id||typeof n.id!="string"?{ok:!1,error:'Missing or invalid "id"'}:!n.title||typeof n.title!="string"?{ok:!1,error:'Missing or invalid "title"'}:Array.isArray(n.slides)?!n.theme||typeof n.theme!="object"?{ok:!1,error:'Missing "theme"'}:{ok:!0,document:t}:{ok:!1,error:'"slides" must be an array'}}function Pi(e,t=!1){return JSON.stringify(e,null,t?2:void 0)}function Oi(e){const{slideSize:t,theme:n,slides:i}=e,r=i.map((s,l)=>Wd(s,t,n,l)).join(`
|
|
730
|
+
`);return`<!DOCTYPE html>
|
|
731
|
+
<html lang="en">
|
|
732
|
+
<head>
|
|
733
|
+
<meta charset="UTF-8" />
|
|
734
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
735
|
+
<title>${Nt(e.title)}</title>
|
|
736
|
+
<style>
|
|
737
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
738
|
+
body { background: #000; overflow: hidden; font-family: ${n.fontFamily??"sans-serif"}; }
|
|
739
|
+
.ndp-slide {
|
|
740
|
+
position: absolute; top: 0; left: 0;
|
|
741
|
+
width: ${t.width}px; height: ${t.height}px;
|
|
742
|
+
transform-origin: top left;
|
|
743
|
+
display: none;
|
|
744
|
+
}
|
|
745
|
+
.ndp-slide.active { display: block; }
|
|
746
|
+
.ndp-element {
|
|
747
|
+
position: absolute;
|
|
748
|
+
}
|
|
749
|
+
.ndp-element-text { white-space: pre-wrap; }
|
|
750
|
+
.ndp-controls {
|
|
751
|
+
position: fixed; bottom: 20px; right: 20px; z-index: 1000;
|
|
752
|
+
display: flex; gap: 8px;
|
|
753
|
+
}
|
|
754
|
+
.ndp-controls button {
|
|
755
|
+
padding: 8px 16px; border: none; border-radius: 4px;
|
|
756
|
+
background: rgba(255,255,255,0.2); color: #fff;
|
|
757
|
+
cursor: pointer; font-size: 14px;
|
|
758
|
+
}
|
|
759
|
+
.ndp-controls button:hover { background: rgba(255,255,255,0.35); }
|
|
760
|
+
.ndp-counter {
|
|
761
|
+
position: fixed; bottom: 20px; left: 20px; z-index: 1000;
|
|
762
|
+
color: rgba(255,255,255,0.5); font-size: 14px;
|
|
763
|
+
}
|
|
764
|
+
</style>
|
|
765
|
+
</head>
|
|
766
|
+
<body>
|
|
767
|
+
${r}
|
|
768
|
+
<div class="ndp-controls">
|
|
769
|
+
<button onclick="prevSlide()">◀ Prev</button>
|
|
770
|
+
<button onclick="nextSlide()">Next ▶</button>
|
|
771
|
+
</div>
|
|
772
|
+
<div class="ndp-counter" id="counter"></div>
|
|
773
|
+
<script>
|
|
774
|
+
(function() {
|
|
775
|
+
var slides = document.querySelectorAll('.ndp-slide');
|
|
776
|
+
var current = 0;
|
|
777
|
+
var total = slides.length;
|
|
778
|
+
function show(idx) {
|
|
779
|
+
slides.forEach(function(s) { s.classList.remove('active'); });
|
|
780
|
+
slides[idx].classList.add('active');
|
|
781
|
+
document.getElementById('counter').textContent = (idx + 1) + ' / ' + total;
|
|
782
|
+
fitSlide();
|
|
783
|
+
}
|
|
784
|
+
function fitSlide() {
|
|
785
|
+
var sw = ${t.width}, sh = ${t.height};
|
|
786
|
+
var ww = window.innerWidth, wh = window.innerHeight;
|
|
787
|
+
var scale = Math.min(ww / sw, wh / sh);
|
|
788
|
+
var ox = (ww - sw * scale) / 2, oy = (wh - sh * scale) / 2;
|
|
789
|
+
slides.forEach(function(s) {
|
|
790
|
+
s.style.transform = 'translate(' + ox + 'px,' + oy + 'px) scale(' + scale + ')';
|
|
791
|
+
});
|
|
792
|
+
}
|
|
793
|
+
window.nextSlide = function() { if (current < total - 1) show(++current); };
|
|
794
|
+
window.prevSlide = function() { if (current > 0) show(--current); };
|
|
795
|
+
document.addEventListener('keydown', function(e) {
|
|
796
|
+
if (e.key === 'ArrowRight' || e.key === ' ') { e.preventDefault(); nextSlide(); }
|
|
797
|
+
if (e.key === 'ArrowLeft') { e.preventDefault(); prevSlide(); }
|
|
798
|
+
if (e.key === 'Escape' || e.key === 'f' || e.key === 'F') {
|
|
799
|
+
if (!document.fullscreenElement) document.documentElement.requestFullscreen();
|
|
800
|
+
else document.exitFullscreen();
|
|
801
|
+
}
|
|
802
|
+
});
|
|
803
|
+
window.addEventListener('resize', fitSlide);
|
|
804
|
+
show(0);
|
|
805
|
+
})();
|
|
806
|
+
<\/script>
|
|
807
|
+
</body>
|
|
808
|
+
</html>`}function Wd(e,t,n,i){const r=n.backgroundColor??"#ffffff",s=n.textColor??"#000000";let l="";const c=e.background;if(c.type==="gradient"&&c.gradientStops){const u=c.gradientStops.map(y=>`${y.color} ${y.position*100}%`).join(", ");l=`background: linear-gradient(${c.gradientDirection??180}deg, ${u});`}else c.type==="image"&&c.imageUrl?l=`background: url('${c.imageUrl}') center/${c.imageFit??"cover"} no-repeat; background-color: ${c.color??r};`:l=`background: ${c.color??r};`;const d=e.elements.map(u=>Vd(u,t,n)).join(`
|
|
809
|
+
`);return`<div class="ndp-slide${i===0?" active":""}" style="${l} color: ${s};">
|
|
810
|
+
${d}
|
|
811
|
+
</div>`}function Vd(e,t,n){const{position:i}=e,r=i.x/100*t.width,s=i.y/100*t.height,l=i.width/100*t.width,c=i.height/100*t.height,d=e.rotation?`transform: rotate(${e.rotation}deg);`:"",u=e.opacity!==void 0?`opacity: ${e.opacity};`:"",y=`position: absolute; left: ${r}px; top: ${s}px; width: ${l}px; height: ${c}px; ${d} ${u}`,f=e.content;switch(f.kind??f.type){case"text":{const m=f,w=m.fontSize??16,k=m.fontColor??n.textColor??"#000",z=m.fontFamily??n.fontFamily??"sans-serif",$=m.fontWeight??"normal",g=m.textAlign??"left";return`<div class="ndp-element ndp-element-text" style="${y} font-size: ${w}px; color: ${k}; font-family: ${z}; font-weight: ${$}; text-align: ${g};">${Nt(m.text)}</div>`}case"image":{const m=f;return`<div class="ndp-element" style="${y}"><img src="${Nt(m.src)}" alt="${Nt(m.alt??"")}" style="width:100%;height:100%;object-fit:${m.objectFit??"contain"};border-radius:${m.borderRadius??0}px;" /></div>`}case"code":{const m=f;return`<div class="ndp-element" style="${y} background: ${m.theme==="light"?"#f5f5f5":"#1e1e1e"}; color: ${m.theme==="light"?"#333":"#d4d4d4"}; padding: 16px; border-radius: 8px; overflow: auto; font-family: monospace; font-size: ${m.fontSize??14}px; white-space: pre;">${Nt(m.code)}</div>`}case"shape":{const m=f,w=m.fill??"#ccc";return`<div class="ndp-element" style="${y} background: ${w}; border-radius: ${m.shapeType==="ellipse"?"50%":"0"}; border: ${m.strokeWidth??0}px solid ${m.stroke??"transparent"};"></div>`}default:return`<div class="ndp-element" style="${y}"></div>`}}function Nt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Kd(e){const t={x:20,y:20,width:60,height:40};switch(e){case"text":return{position:{x:10,y:30,width:80,height:20},content:{kind:"text",text:"New Text",fontSize:24,textAlign:"left"}};case"shape":return{position:{x:30,y:30,width:40,height:30},content:{kind:"shape",shapeType:"rectangle",fill:"#6366f1",stroke:"#4f46e5",strokeWidth:2}};case"code":return{position:{x:10,y:20,width:80,height:50},content:{kind:"code",code:`// Your code here
|
|
812
|
+
console.log("Hello!");`,language:"typescript",theme:"dark"}};case"chart":return{position:t,content:{kind:"chart",chartType:"bar",data:{labels:["Q1","Q2","Q3","Q4"],series:[{name:"Revenue",values:[30,45,60,80],color:"#6366f1"}]}}};case"table":return{position:{x:10,y:20,width:80,height:40},content:{kind:"table",headers:["Name","Value","Status"],rows:[["Item A","100","Active"],["Item B","200","Pending"]],stripedRows:!0}};case"image":return{position:t,content:{kind:"image",src:"",alt:"Image",objectFit:"contain"}};case"diagram":return{position:t,content:{kind:"diagram",autoPlayAnimations:!1}};case"icon":return{position:{x:45,y:40,width:10,height:15},content:{kind:"icon",name:"star",size:48,color:"#6366f1"}};default:return{position:t,content:{kind:"text",text:e,fontSize:16}}}}const Li=({initialDocument:e,onChange:t,onExport:n,onPresent:i,lang:r="en",showToolbar:s=!0,showThumbnails:l=!0,showPropertyPanel:c=!0,className:d,style:u})=>{const y=Aa(e),[f,p]=o.useState(null),[m,w]=o.useState(!1),[k,z]=o.useState(5),$=o.useRef(y.document);y.document!==$.current&&($.current=y.document,t==null||t(y.document));const g=y.currentSlide,v=o.useMemo(()=>f&&g?g.elements.find(x=>x.id===f)??null:null,[f,g]),N=o.useMemo(()=>Math.min(1,800/y.document.slideSize.width),[y.document.slideSize]),j=o.useCallback(x=>{if(!g)return;const{content:P,position:A}=Kd(x),E=y.addElement(g.id,{type:x,position:A,content:P});E&&p(E.id)},[g,y]),I=o.useCallback(x=>{y.addSlide(y.currentSlideIndex,x),y.setCurrentSlideIndex(y.currentSlideIndex+1)},[y]),D=o.useCallback(x=>{y.removeSlide(x),y.currentSlideIndex>=y.slides.length-1&&y.setCurrentSlideIndex(Math.max(0,y.slides.length-2))},[y]),b=o.useCallback((x,P,A)=>{if(!g)return;const E=g.elements.find(h=>h.id===x);E&&y.moveElement(g.id,x,{...E.position,x:P,y:A})},[g,y]),T=o.useCallback((x,P,A,E,h)=>{if(!g)return;const C=g.elements.find(_=>_.id===x);C&&y.moveElement(g.id,x,{...C.position,width:P,height:A,...E!=null?{x:E}:{},...h!=null?{y:h}:{}})},[g,y]),R=o.useCallback(()=>{if(!g||!f)return;const x=Math.max(0,...g.elements.map(P=>P.zIndex??0));y.updateElement(g.id,f,{zIndex:x+1})},[g,f,y]),L=o.useCallback(()=>{if(!g||!f)return;const x=Math.min(0,...g.elements.map(P=>P.zIndex??0));y.updateElement(g.id,f,{zIndex:x-1})},[g,f,y]),M=o.useCallback(x=>{const P=y.document;let A;switch(x){case"ndp":A=Pi(P,!0);break;case"html":A=Oi(P);break}n==null||n(x,A)},[y,n]),S=o.useCallback(()=>{i==null||i(y.document,y.currentSlideIndex)},[y,i]);return a.jsx(Da,{lang:r,children:a.jsxs("div",{className:`nice-pres-editor ${d??""}`,style:{display:"flex",flexDirection:"column",height:"100%",...u},children:[s&&a.jsx(Gn,{onAddElement:j,onAddSlide:I,onUndo:y.undo,onRedo:y.redo,canUndo:y.canUndo,canRedo:y.canRedo,onPresent:S,onExport:M}),s&&a.jsxs("div",{style:{display:"flex",gap:4,padding:"2px 8px",borderBottom:"1px solid #eee",alignItems:"center",fontSize:"0.85em"},children:[a.jsx(xe,{size:"sm",variant:m?"primary":"ghost",onClick:()=>w(x=>!x),children:"⊞ Grid"}),v&&a.jsxs(a.Fragment,{children:[a.jsx(xe,{size:"sm",variant:"ghost",onClick:R,title:"Bring to front",children:"↑ Front"}),a.jsx(xe,{size:"sm",variant:"ghost",onClick:L,title:"Send to back",children:"↓ Back"}),a.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>{if(g&&f){const x={...v,id:`el-${Date.now().toString(36)}`,position:{...v.position,x:v.position.x+3,y:v.position.y+3}};y.addElement(g.id,x)}},title:"Duplicate",children:"⧉ Duplicate"})]})]}),a.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[l&&a.jsx("div",{style:{width:200,borderRight:"1px solid #ddd",background:"#fafafa"},children:a.jsx(Zn,{slides:y.slides,slideSize:y.document.slideSize,theme:y.theme,currentIndex:y.currentSlideIndex,onSelectSlide:y.setCurrentSlideIndex,onAddSlide:()=>I(),onDuplicateSlide:x=>y.duplicateSlide(x),onRemoveSlide:D})}),a.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",background:"#e8e8e8",overflow:"auto",padding:24},children:g&&a.jsx(mt,{slide:g,slideSize:y.document.slideSize,theme:y.theme,scale:N,selectedElementId:f,onSelectElement:p,onElementDrag:b,onElementResize:T,showGrid:m,gridSnap:k,interactive:!0})}),c&&a.jsx("div",{style:{width:260,borderLeft:"1px solid #ddd",overflowY:"auto"},children:a.jsx(Qn,{slide:g,selectedElement:v,onSlideChange:y.updateSlide,onElementChange:y.updateElement,onRemoveElement:y.removeElement})})]})]})})};Li.displayName="NicePresentationEditor";const Ea={linear:e=>e,easeIn:e=>e*e,easeOut:e=>e*(2-e),easeInOut:e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*.5)*Math.exp(-6*e),bounce:e=>{if(e<1/2.75)return 7.5625*e*e;if(e<2/2.75){const n=e-.5454545454545454;return 7.5625*n*n+.75}if(e<2.5/2.75){const n=e-.8181818181818182;return 7.5625*n*n+.9375}const t=e-2.625/2.75;return 7.5625*t*t+.984375}},Bt={opacity:1,transform:"",filter:"",visible:!0};function Ud(e,t,n){if(!e)return{...Bt};const i=e.entrance;if(!i)return{...Bt};if((e.trigger==="onClick"||e.trigger==="afterPrevious")&&!n)return{...Bt,opacity:0,visible:!1};const r=i.delayMs??0,s=t-r;if(s<0)return{...Bt,opacity:0,visible:!1};const l=Math.min(s/i.durationMs,1),c=(Ea[i.easing??"linear"]??Ea.linear)(l);return Yd(i.effect,c)}function Yd(e,t){const n={opacity:1,transform:"",filter:"",visible:!0};switch(e){case"fadeIn":n.opacity=t;break;case"fadeOut":n.opacity=1-t;break;case"slideInLeft":n.transform=`translateX(${-100*(1-t)}%)`,n.opacity=t;break;case"slideInRight":n.transform=`translateX(${100*(1-t)}%)`,n.opacity=t;break;case"slideInTop":n.transform=`translateY(${-100*(1-t)}%)`,n.opacity=t;break;case"slideInBottom":n.transform=`translateY(${100*(1-t)}%)`,n.opacity=t;break;case"zoomIn":n.transform=`scale(${t})`,n.opacity=t;break;case"zoomOut":n.transform=`scale(${2-t})`,n.opacity=t;break;case"bounceIn":n.transform=`scale(${t>.8?1+.1*Math.sin((t-.8)/.2*Math.PI):t})`,n.opacity=t;break;case"flipInX":n.transform=`perspective(400px) rotateX(${90*(1-t)}deg)`,n.opacity=t;break;case"flipInY":n.transform=`perspective(400px) rotateY(${90*(1-t)}deg)`,n.opacity=t;break;case"rotateIn":n.transform=`rotate(${-180*(1-t)}deg) scale(${t})`,n.opacity=t;break;case"typewriter":n.opacity=t>0?1:0;break;case"wipeLeft":n.transform=`scaleX(${t})`,n.opacity=1;break;case"wipeRight":n.transform=`scaleX(${t})`,n.opacity=1;break;case"splitReveal":n.transform=`scaleY(${t})`,n.opacity=1;break;case"pulse":n.transform=`scale(${1+.05*Math.sin(t*Math.PI*4)})`;break;case"shake":n.transform=`translateX(${5*Math.sin(t*Math.PI*8)*(1-t)}px)`;break;case"glow":n.filter=`drop-shadow(0 0 ${8*t}px gold)`;break}return n}function Bi(e,t,n="left"){const i={},r={};switch(e){case"fade":i.opacity=1-t,r.opacity=t;break;case"slide":{const s=n==="right"||n==="down"?-1:1,l=n==="up"||n==="down"?"Y":"X";i.transform=`translate${l}(${-s*t*100}%)`,r.transform=`translate${l}(${s*(1-t)*100}%)`;break}case"zoom":i.transform=`scale(${1-t*.3})`,i.opacity=1-t,r.transform=`scale(${.7+t*.3})`,r.opacity=t;break;case"flip":i.transform=`perspective(1000px) rotateY(${t*90}deg)`,i.opacity=t>.5?0:1,r.transform=`perspective(1000px) rotateY(${(1-t)*-90}deg)`,r.opacity=t>.5?1:0;break;default:i.opacity=1-t,r.opacity=t;break}return{outgoing:i,incoming:r}}const Zd={width:1920,height:1080},Gd={width:1024,height:768},Qd={width:2560,height:1440},Hi={name:"Corporate",backgroundColor:"#ffffff",primaryColor:"#1a365d",secondaryColor:"#2b6cb0",accentColor:"#ed8936",textColor:"#2d3748",headingColor:"#1a365d",fontFamily:'"Segoe UI", Roboto, sans-serif',headingFontFamily:'"Segoe UI", Roboto, sans-serif',codeFontFamily:'"Cascadia Code", "Fira Code", monospace'},Xd={name:"Modern Dark",backgroundColor:"#1a1a2e",primaryColor:"#e94560",secondaryColor:"#0f3460",accentColor:"#16213e",textColor:"#e0e0e0",headingColor:"#ffffff",fontFamily:"Inter, sans-serif",headingFontFamily:"Inter, sans-serif",codeFontFamily:'"JetBrains Mono", monospace'},Jd={name:"Minimal",backgroundColor:"#fafafa",primaryColor:"#333333",secondaryColor:"#666666",accentColor:"#2196f3",textColor:"#333333",headingColor:"#111111",fontFamily:'"Helvetica Neue", Arial, sans-serif',codeFontFamily:'"SF Mono", monospace'},eu={name:"NiceToDev",backgroundColor:"#f8f9fa",primaryColor:"#6366f1",secondaryColor:"#8b5cf6",accentColor:"#06b6d4",textColor:"#334155",headingColor:"#1e293b",fontFamily:"Inter, sans-serif",headingFontFamily:'"Plus Jakarta Sans", Inter, sans-serif',codeFontFamily:'"Fira Code", monospace'},tu=500,qi=({document:e,startSlide:t=0,onExit:n,autoAdvanceMs:i=0,showNotes:r=!1,showSlideNumber:s=!0,showProgressBar:l=!0,showTimer:c=!1,enableTouch:d=!0,className:u})=>{const[y,f]=o.useState(t),[p,m]=o.useState(0),[w,k]=o.useState(!1),[z,$]=o.useState(0),[g,v]=o.useState(null),[N,j]=o.useState(!1),[I,D]=o.useState(0),b=o.useRef(null),T=o.useRef(0),R=o.useRef(null),L=o.useRef(null),M=e.slides,S=M[y]??null,x=g!==null?M[g]??null:null,P=e.theme??Hi,A=e.slideSize,E=M.length,h=o.useMemo(()=>{if(!S)return 0;const Z=S.elements.filter(X=>{var oe;return(oe=X.animation)==null?void 0:oe.entrance}).map(X=>{var oe;return((oe=X.animation)==null?void 0:oe.buildOrder)??0});return Z.length>0?Math.max(...Z)+1:0},[S]),C=o.useCallback(Z=>{var le,pe;if(Z<0||Z>=E||Z===y||w)return;const X=M[Z];if((((le=X==null?void 0:X.transition)==null?void 0:le.effect)??"none")==="none"){v(null),f(Z),m(0);return}v(y),f(Z),m(0),k(!0);const re=((pe=X==null?void 0:X.transition)==null?void 0:pe.durationMs)??tu,he=performance.now(),J=me=>{const ve=Math.min(1,(me-he)/re);$(ve),ve<1?T.current=requestAnimationFrame(J):(k(!1),v(null))};T.current=requestAnimationFrame(J)},[y,E,w,M]),_=o.useCallback(()=>{if(p<h){m(Z=>Z+1);return}y<E-1&&C(y+1)},[p,h,y,E,C]),F=o.useCallback(()=>{if(p>0){m(Z=>Z-1);return}y>0&&C(y-1)},[p,y,C]);o.useEffect(()=>{const Z=X=>{switch(X.key){case"ArrowRight":case"ArrowDown":case" ":case"Enter":X.preventDefault(),_();break;case"ArrowLeft":case"ArrowUp":case"Backspace":X.preventDefault(),F();break;case"Escape":X.preventDefault(),n==null||n();break;case"Home":X.preventDefault(),C(0);break;case"End":X.preventDefault(),C(E-1);break}};return window.addEventListener("keydown",Z),()=>window.removeEventListener("keydown",Z)},[_,F,n,C,E]);const O=o.useCallback(Z=>{if(!d)return;const X=Z.touches[0];R.current={x:X.clientX,y:X.clientY,time:Date.now()}},[d]),H=o.useCallback(Z=>{if(!d||!R.current)return;const X=Z.changedTouches[0],oe=X.clientX-R.current.x,re=X.clientY-R.current.y,he=Date.now()-R.current.time;if(R.current=null,he>500||Math.abs(oe)<30&&Math.abs(re)<30){_();return}Math.abs(oe)>Math.abs(re)&&(oe<-30?_():oe>30&&F())},[d,_,F]);o.useEffect(()=>{if(c)return L.current=setInterval(()=>D(Z=>Z+1e3),1e3),()=>{L.current&&clearInterval(L.current)}},[c]);const V=Z=>{const X=Math.floor(Z/1e3),oe=Math.floor(X/60),re=Math.floor(oe/60);return re>0?`${re}:${String(oe%60).padStart(2,"0")}:${String(X%60).padStart(2,"0")}`:`${oe}:${String(X%60).padStart(2,"0")}`};o.useEffect(()=>{const Z=X=>{(X.key==="g"||X.key==="G")&&j(oe=>!oe)};return window.addEventListener("keydown",Z),()=>window.removeEventListener("keydown",Z)},[]),o.useEffect(()=>{if(i<=0||w)return;const Z=setTimeout(_,i);return()=>clearTimeout(Z)},[i,_,w,y,p]),o.useEffect(()=>{var X;const Z=b.current;return Z&&!window.document.fullscreenElement&&((X=Z.requestFullscreen)==null||X.call(Z).catch(()=>{})),()=>{var oe,re;window.document.fullscreenElement&&((re=(oe=window.document).exitFullscreen)==null||re.call(oe).catch(()=>{})),T.current&&cancelAnimationFrame(T.current)}},[]);const U=o.useMemo(()=>S?S.elements.filter(Z=>{var oe;return(oe=Z.animation)!=null&&oe.entrance?(Z.animation.buildOrder??0)<=p:!0}):[],[S,p]),B=o.useMemo(()=>{if(!w||!S)return{outgoing:{},incoming:{}};const Z=S.transition??{effect:"fade"};return Bi(Z.effect,z,Z.direction)},[w,S,z]),[W,Q]=o.useState(1);return o.useEffect(()=>{const Z=()=>{const X=window.innerWidth,oe=window.innerHeight,re=A.width,he=A.height;Q(Math.min(X/re,oe/he))};return Z(),window.addEventListener("resize",Z),()=>window.removeEventListener("resize",Z)},[A]),a.jsxs("div",{ref:b,className:`nice-pres-player ${u??""}`,style:{position:"fixed",inset:0,background:"#000",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",cursor:"none",zIndex:9999},onClick:_,onContextMenu:Z=>{Z.preventDefault(),F()},onTouchStart:O,onTouchEnd:H,children:[N&&a.jsx("div",{style:{position:"absolute",inset:0,zIndex:100,background:"rgba(0,0,0,0.9)",overflowY:"auto",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))",gap:16,padding:24,alignContent:"start"},onClick:Z=>Z.stopPropagation(),children:M.map((Z,X)=>a.jsxs("div",{style:{cursor:"pointer",border:X===y?"3px solid #2196f3":"2px solid transparent",borderRadius:4,overflow:"hidden"},onClick:()=>{C(X),j(!1)},children:[a.jsx(mt,{slide:Z,slideSize:A,theme:P,scale:240/A.width,interactive:!1}),a.jsxs("div",{style:{color:"#fff",fontSize:12,textAlign:"center",padding:4},children:[X+1,". ",Z.title]})]},Z.id))}),w&&x&&a.jsx("div",{style:{position:"absolute",...B.outgoing},children:a.jsx(mt,{slide:x,slideSize:A,theme:P,scale:W,interactive:!1})}),S&&a.jsx("div",{style:{position:"absolute",...w?B.incoming:{}},children:a.jsx(mt,{slide:{...S,elements:U},slideSize:A,theme:P,scale:W,interactive:!1})}),s&&a.jsxs("div",{style:{position:"absolute",bottom:12,right:20,color:"rgba(255,255,255,0.5)",fontSize:14,fontFamily:"sans-serif",pointerEvents:"none"},children:[y+1," / ",E]}),r&&(S==null?void 0:S.notes)&&a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,background:"rgba(0,0,0,0.8)",color:"#fff",padding:"12px 24px",fontSize:14,fontFamily:"sans-serif",maxHeight:"20vh",overflowY:"auto",pointerEvents:"none"},children:S.notes}),l&&a.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:3,background:"rgba(255,255,255,0.15)",pointerEvents:"none",zIndex:50},children:a.jsx("div",{style:{height:"100%",width:`${(y+1)/E*100}%`,background:"#2196f3",transition:"width 0.3s ease"}})}),c&&a.jsx("div",{style:{position:"absolute",top:12,right:20,color:"rgba(255,255,255,0.5)",fontSize:14,fontFamily:"monospace",pointerEvents:"none",zIndex:50},children:V(I)}),a.jsxs("div",{className:"nice-pres-player-controls",style:{position:"absolute",bottom:12,left:"50%",transform:"translateX(-50%)",display:"flex",gap:8,opacity:.3},onMouseEnter:Z=>{Z.currentTarget.style.opacity="0.9",Z.currentTarget.style.cursor="pointer"},onMouseLeave:Z=>{Z.currentTarget.style.opacity="0.3"},children:[a.jsx(xe,{variant:"ghost",size:"sm",onClick:Z=>{Z.stopPropagation(),F()},style:{background:"rgba(255,255,255,0.15)",color:"#fff",padding:"6px 14px",borderRadius:4,fontSize:16},title:"Previous",children:"◀"}),a.jsx(xe,{variant:"ghost",size:"sm",onClick:Z=>{Z.stopPropagation(),_()},style:{background:"rgba(255,255,255,0.15)",color:"#fff",padding:"6px 14px",borderRadius:4,fontSize:16},title:"Next",children:"▶"}),a.jsx(xe,{variant:"ghost",size:"sm",onClick:Z=>{Z.stopPropagation(),n==null||n()},style:{background:"rgba(255,255,255,0.15)",color:"#fff",padding:"6px 14px",borderRadius:4,fontSize:14},title:"Exit (Esc)",children:"✕"}),a.jsx(xe,{variant:"ghost",size:"sm",onClick:Z=>{Z.stopPropagation(),j(X=>!X)},style:{background:"rgba(255,255,255,0.15)",color:"#fff",padding:"6px 14px",borderRadius:4,fontSize:14},title:"Overview (G)",children:"⊞"})]})]})};qi.displayName="NicePresentationPlayer";const nu="_interactiveElement_1mfsb_13",au="_interactiveButton_1mfsb_27",iu="_disabled_1mfsb_57",ru="_variant_primary_1mfsb_87",ou="_variant_secondary_1mfsb_97",su="_variant_outline_1mfsb_107",lu="_variant_ghost_1mfsb_119",cu="_size_small_1mfsb_139",du="_size_medium_1mfsb_149",uu="_size_large_1mfsb_159",pu="_buttonIcon_1mfsb_169",mu="_buttonLabel_1mfsb_177",hu="_interactivePoll_1mfsb_189",fu="_pollQuestion_1mfsb_209",gu="_pollOptions_1mfsb_223",yu="_pollOption_1mfsb_223",bu="_pollOptionDisabled_1mfsb_261",xu="_pollOptionSelected_1mfsb_271",vu="_pollOptionContent_1mfsb_289",wu="_pollOptionIcon_1mfsb_305",ku="_pollOptionText_1mfsb_313",Su="_pollCheckbox_1mfsb_321",Cu="_pollResultBar_1mfsb_331",_u="_pollResultFill_1mfsb_353",ju="_pollResultPercent_1mfsb_365",Nu="_pollResultCount_1mfsb_381",Eu="_pollSubmitBtn_1mfsb_395",Mu="_pollTotalVotes_1mfsb_431",zu="_pollVotedMessage_1mfsb_443",$u="_interactiveQuiz_1mfsb_485",Au="_quizHeader_1mfsb_505",Fu="_quizQuestion_1mfsb_519",Iu="_quizTimer_1mfsb_537",Du="_quizTimerWarning_1mfsb_555",Tu="_timerPulse_1mfsb_1",Ru="_quizPoints_1mfsb_577",Pu="_quizAnswers_1mfsb_595",Ou="_quizAnswer_1mfsb_595",Lu="_quizAnswerDisabled_1mfsb_633",Bu="_quizAnswerSelected_1mfsb_643",Hu="_quizAnswerCorrect_1mfsb_661",qu="_quizAnswerIncorrect_1mfsb_671",Wu="_quizAnswerMarker_1mfsb_681",Vu="_quizAnswerText_1mfsb_691",Ku="_quizCorrectMark_1mfsb_703",Uu="_quizIncorrectMark_1mfsb_715",Yu="_quizSubmitBtn_1mfsb_727",Zu="_quizFeedback_1mfsb_775",Gu="_quizFeedbackMessage_1mfsb_783",Qu="_quizFeedbackCorrect_1mfsb_797",Xu="_quizFeedbackIncorrect_1mfsb_807",Ju="_quizExplanation_1mfsb_817",ep="_interactiveCountdown_1mfsb_841",tp="_countdownWarning_1mfsb_857",np="_countdownPulse_1mfsb_1",ap="_countdownComplete_1mfsb_875",ip="_countdownDigital_1mfsb_885",rp="_countdownSeparator_1mfsb_903",op="_countdownDigit_1mfsb_885",sp="_countdownCircular_1mfsb_923",lp="_countdownCircleSvg_1mfsb_935",cp="_countdownProgressRing_1mfsb_947",dp="_countdownCircleText_1mfsb_955",up="_countdownLargeSeconds_1mfsb_975",pp="_countdownFlip_1mfsb_985",mp="_flipCardContainer_1mfsb_997",hp="_flipCard_1mfsb_997",fp="_flipLabel_1mfsb_1033",gp="_flipSeparator_1mfsb_1047",yp="_countdownMinimal_1mfsb_1063",bp="_countdownCompleteMessage_1mfsb_1075",xp="_interactiveQnA_1mfsb_1093",vp="_qnaHeader_1mfsb_1117",wp="_qnaTitle_1mfsb_1133",kp="_qnaCount_1mfsb_1147",Sp="_qnaInputForm_1mfsb_1157",Cp="_qnaInputWrapper_1mfsb_1169",_p="_qnaInput_1mfsb_1157",jp="_qnaCharCount_1mfsb_1219",Np="_qnaInputActions_1mfsb_1235",Ep="_qnaAnonymousToggle_1mfsb_1249",Mp="_qnaSubmitBtn_1mfsb_1279",zp="_qnaClosedMessage_1mfsb_1321",$p="_qnaQuestionsList_1mfsb_1339",Ap="_qnaQuestion_1mfsb_1339",Fp="_qnaQuestionAnswered_1mfsb_1381",Ip="_qnaQuestionContent_1mfsb_1391",Dp="_qnaQuestionText_1mfsb_1405",Tp="_qnaQuestionMeta_1mfsb_1417",Rp="_qnaAuthor_1mfsb_1431",Pp="_qnaQuestionActions_1mfsb_1439",Op="_qnaUpvoteBtn_1mfsb_1453",Lp="_qnaUpvoted_1mfsb_1489",Bp="_qnaUpvoteIcon_1mfsb_1509",Hp="_qnaUpvoteCount_1mfsb_1517",qp="_qnaAnsweredBtn_1mfsb_1527",Wp="_qnaMarkedAnswered_1mfsb_1555",Vp="_qnaEmptyState_1mfsb_1567",Kp="_qnaMoreQuestions_1mfsb_1581",Up="_qnaStyle_stack_1mfsb_1599",Yp="_qnaStyle_floating_1mfsb_1609",se={interactiveElement:nu,interactiveButton:au,disabled:iu,variant_primary:ru,variant_secondary:ou,variant_outline:su,variant_ghost:lu,size_small:cu,size_medium:du,size_large:uu,buttonIcon:pu,buttonLabel:mu,interactivePoll:hu,pollQuestion:fu,pollOptions:gu,pollOption:yu,pollOptionDisabled:bu,pollOptionSelected:xu,pollOptionContent:vu,pollOptionIcon:wu,pollOptionText:ku,pollCheckbox:Su,pollResultBar:Cu,pollResultFill:_u,pollResultPercent:ju,pollResultCount:Nu,pollSubmitBtn:Eu,pollTotalVotes:Mu,pollVotedMessage:zu,"pollStyle_horizontal-bar":"_pollStyle_horizontal-bar_1mfsb_463",interactiveQuiz:$u,quizHeader:Au,quizQuestion:Fu,quizTimer:Iu,quizTimerWarning:Du,timerPulse:Tu,quizPoints:Ru,quizAnswers:Pu,quizAnswer:Ou,quizAnswerDisabled:Lu,quizAnswerSelected:Bu,quizAnswerCorrect:Hu,quizAnswerIncorrect:qu,quizAnswerMarker:Wu,quizAnswerText:Vu,quizCorrectMark:Ku,quizIncorrectMark:Uu,quizSubmitBtn:Yu,quizFeedback:Zu,quizFeedbackMessage:Gu,quizFeedbackCorrect:Qu,quizFeedbackIncorrect:Xu,quizExplanation:Ju,interactiveCountdown:ep,countdownWarning:tp,countdownPulse:np,countdownComplete:ap,countdownDigital:ip,countdownSeparator:rp,countdownDigit:op,countdownCircular:sp,countdownCircleSvg:lp,countdownProgressRing:cp,countdownCircleText:dp,countdownLargeSeconds:up,countdownFlip:pp,flipCardContainer:mp,flipCard:hp,flipLabel:fp,flipSeparator:gp,countdownMinimal:yp,countdownCompleteMessage:bp,interactiveQnA:xp,qnaHeader:vp,qnaTitle:wp,qnaCount:kp,qnaInputForm:Sp,qnaInputWrapper:Cp,qnaInput:_p,qnaCharCount:jp,qnaInputActions:Np,qnaAnonymousToggle:Ep,qnaSubmitBtn:Mp,qnaClosedMessage:zp,qnaQuestionsList:$p,qnaQuestion:Ap,qnaQuestionAnswered:Fp,qnaQuestionContent:Ip,qnaQuestionText:Dp,qnaQuestionMeta:Tp,qnaAuthor:Rp,qnaQuestionActions:Pp,qnaUpvoteBtn:Op,qnaUpvoted:Lp,qnaUpvoteIcon:Bp,qnaUpvoteCount:Hp,qnaAnsweredBtn:qp,qnaMarkedAnswered:Wp,qnaEmptyState:Vp,qnaMoreQuestions:Kp,qnaStyle_stack:Up,qnaStyle_floating:Yp},Zp=({content:e,onAction:t,disabled:n=!1,className:i,theme:r})=>{const{label:s,action:l,variant:c="primary",size:d="medium",icon:u,iconPosition:y="left",backgroundColor:f,textColor:p,borderRadius:m}=e,w=o.useCallback(()=>{if(!n){if(l.type==="openUrl"){const{url:g,newTab:v=!0}=l;v?window.open(g,"_blank","noopener,noreferrer"):window.location.href=g}t==null||t(l)}},[l,n,t]),k={backgroundColor:f??(c==="primary"?r==null?void 0:r.primaryColor:void 0),color:p,borderRadius:m!==void 0?`${m}px`:void 0,fontFamily:r==null?void 0:r.fontFamily},z=[se.interactiveButton,se[`variant_${c}`],se[`size_${d}`],n?se.disabled:"",i??""].filter(Boolean).join(" "),$=()=>u?a.jsx("span",{className:se.buttonIcon,children:Gp(u)}):null;return a.jsxs("button",{className:z,style:k,onClick:w,disabled:n,type:"button",children:[y==="left"&&$(),a.jsx("span",{className:se.buttonLabel,children:s}),y==="right"&&$()]})};function Gp(e){return{"arrow-right":"→","arrow-left":"←",play:"▶",pause:"⏸",stop:"⏹",link:"🔗",external:"↗",check:"✓",close:"✕",info:"ℹ",question:"?",star:"★",heart:"♥",download:"⬇",upload:"⬆",share:"↗",copy:"📋",edit:"✏",delete:"🗑",refresh:"↻"}[e]??e}const Qp=({content:e,onVote:t,onResultsUpdate:n,votingClosed:i=!1,userVote:r,className:s,theme:l})=>{const{question:c,options:d,multiSelect:u=!1,showResultsAfterVote:y=!0,liveResults:f=!1,displayStyle:p="buttons",resultColors:m,results:w={}}=e,[k,z]=o.useState(r??[]),[$,g]=o.useState(!!(r!=null&&r.length)),[v,N]=o.useState(w),j=o.useMemo(()=>Object.values(v).reduce((M,S)=>M+S,0),[v]),I=[(l==null?void 0:l.primaryColor)??"#6366f1","#8b5cf6","#06b6d4","#10b981","#f59e0b","#ef4444"],D=m??I,b=o.useCallback(M=>{$||i||z(S=>u?S.includes(M)?S.filter(x=>x!==M):[...S,M]:[M])},[$,i,u]),T=o.useCallback(()=>{if(k.length===0||$)return;const M={...v};k.forEach(S=>{M[S]=(M[S]??0)+1}),N(M),g(!0),t==null||t(k),n==null||n(M)},[k,$,v,t,n]),R=f||y&&$,L=(M,S)=>{const x=k.includes(M.id),P=v[M.id]??0,A=j>0?P/j*100:0,E=M.color??D[S%D.length],h=[se.pollOption,se[`pollStyle_${p}`],x?se.pollOptionSelected:"",$||i?se.pollOptionDisabled:""].filter(Boolean).join(" ");return a.jsxs("button",{className:h,onClick:()=>b(M.id),disabled:$||i,type:"button",style:{"--poll-option-color":E,fontFamily:l==null?void 0:l.fontFamily},children:[a.jsxs("div",{className:se.pollOptionContent,children:[M.icon&&a.jsx("span",{className:se.pollOptionIcon,children:M.icon}),a.jsx("span",{className:se.pollOptionText,children:M.text}),u&&!$&&a.jsx("span",{className:se.pollCheckbox,children:x?"☑":"☐"})]}),R&&a.jsxs("div",{className:se.pollResultBar,children:[a.jsx("div",{className:se.pollResultFill,style:{width:`${A}%`,backgroundColor:E}}),a.jsxs("span",{className:se.pollResultPercent,children:[A.toFixed(0),"%"]}),a.jsxs("span",{className:se.pollResultCount,children:["(",P,")"]})]})]},M.id)};return a.jsxs("div",{className:`${se.interactivePoll} ${s??""}`,children:[a.jsx("h3",{className:se.pollQuestion,style:{fontFamily:l==null?void 0:l.fontFamily},children:c}),a.jsx("div",{className:se.pollOptions,children:d.map((M,S)=>L(M,S))}),!$&&!i&&k.length>0&&a.jsx("button",{className:se.pollSubmitBtn,onClick:T,style:{backgroundColor:l==null?void 0:l.primaryColor,fontFamily:l==null?void 0:l.fontFamily},children:"Oddaj głos"}),R&&j>0&&a.jsxs("div",{className:se.pollTotalVotes,children:["Łącznie głosów: ",j]}),$&&a.jsx("div",{className:se.pollVotedMessage,children:"✓ Dziękujemy za głos!"})]})},Xp=({content:e,onSubmit:t,locked:n=!1,className:i,theme:r})=>{const{question:s,answers:l,quizType:c="single",showCorrectAfterSubmit:d=!0,timeLimitSeconds:u=0,points:y=10,correctFeedback:f="Poprawna odpowiedź! 🎉",incorrectFeedback:p="Niestety, to nie jest poprawna odpowiedź.",explanation:m}=e,[w,k]=o.useState([]),[z,$]=o.useState(!1),[g,v]=o.useState(!1),[N,j]=o.useState(u),I=o.useRef(null);o.useEffect(()=>{if(u>0&&!z&&!n)return j(u),I.current=setInterval(()=>{j(L=>L<=1?(clearInterval(I.current),0):L-1)},1e3),()=>{I.current&&clearInterval(I.current)}},[u,z,n]),o.useEffect(()=>{N===0&&u>0&&!z&&b()},[N,u,z]);const D=o.useCallback(L=>{z||n||k(M=>c==="single"||c==="true-false"?[L]:M.includes(L)?M.filter(S=>S!==L):[...M,L])},[z,n,c]),b=o.useCallback(()=>{if(z||w.length===0)return;I.current&&clearInterval(I.current);const L=l.filter(A=>A.isCorrect).map(A=>A.id),M=new Set(w),S=new Set(L),x=M.size===S.size&&[...M].every(A=>S.has(A));v(x),$(!0);const P=x?y:0;t==null||t(w,x,P)},[z,w,l,y,t]),T=L=>{const M=Math.floor(L/60),S=L%60;return M>0?`${M}:${S.toString().padStart(2,"0")}`:`${S}s`},R=L=>{const M=w.includes(L.id),S=z&&d,x=[se.quizAnswer,M?se.quizAnswerSelected:"",z?se.quizAnswerDisabled:"",S&&L.isCorrect?se.quizAnswerCorrect:"",S&&M&&!L.isCorrect?se.quizAnswerIncorrect:""].filter(Boolean).join(" ");return a.jsxs("button",{className:x,onClick:()=>D(L.id),disabled:z||n,type:"button",style:{fontFamily:r==null?void 0:r.fontFamily},children:[a.jsxs("span",{className:se.quizAnswerMarker,children:[c==="multiple"&&(M?"☑":"☐"),(c==="single"||c==="true-false")&&(M?"●":"○")]}),a.jsx("span",{className:se.quizAnswerText,children:L.text}),S&&L.isCorrect&&a.jsx("span",{className:se.quizCorrectMark,children:"✓"}),S&&M&&!L.isCorrect&&a.jsx("span",{className:se.quizIncorrectMark,children:"✗"})]},L.id)};return a.jsxs("div",{className:`${se.interactiveQuiz} ${i??""}`,children:[a.jsxs("div",{className:se.quizHeader,children:[a.jsx("h3",{className:se.quizQuestion,style:{fontFamily:r==null?void 0:r.fontFamily},children:s}),u>0&&!z&&a.jsxs("div",{className:`${se.quizTimer} ${N<=10?se.quizTimerWarning:""}`,children:["⏱ ",T(N)]}),y>0&&a.jsx("div",{className:se.quizPoints,children:z?g?`+${y} pkt`:"0 pkt":`${y} pkt`})]}),a.jsx("div",{className:se.quizAnswers,children:l.map(R)}),!z&&!n&&w.length>0&&a.jsx("button",{className:se.quizSubmitBtn,onClick:b,style:{backgroundColor:r==null?void 0:r.primaryColor,fontFamily:r==null?void 0:r.fontFamily},children:"Zatwierdź odpowiedź"}),z&&d&&a.jsxs("div",{className:se.quizFeedback,children:[a.jsx("div",{className:`${se.quizFeedbackMessage} ${g?se.quizFeedbackCorrect:se.quizFeedbackIncorrect}`,children:g?f:p}),m&&a.jsxs("div",{className:se.quizExplanation,children:[a.jsx("strong",{children:"Wyjaśnienie:"})," ",m]})]})]})},Jp=({content:e,onComplete:t,paused:n=!1,className:i,theme:r})=>{const{target:s,format:l="mm:ss",style:c="digital",showLabels:d=!0,onComplete:u,textColor:y,backgroundColor:f,warningThreshold:p=10,warningColor:m="#ef4444"}=e,[w,k]=o.useState(()=>{if(typeof s=="number")return s;const M=new Date(s),S=new Date;return Math.max(0,Math.floor((M.getTime()-S.getTime())/1e3))}),[z,$]=o.useState(!1),g=o.useRef(null);o.useEffect(()=>{if(n||z){g.current&&(clearInterval(g.current),g.current=null);return}return g.current=setInterval(()=>{k(M=>M<=1?(clearInterval(g.current),$(!0),0):M-1)},1e3),()=>{g.current&&clearInterval(g.current)}},[n,z]),o.useEffect(()=>{z&&(t==null||t(u))},[z,t,u]);const v=o.useMemo(()=>{const M=Math.floor(w/3600),S=Math.floor(w%3600/60),x=w%60;return{hours:M,minutes:S,seconds:x}},[w]),N=w<=p&&w>0,j=(M,S=2)=>M.toString().padStart(S,"0"),I=()=>{const{hours:M,minutes:S,seconds:x}=v;let P=[];return l==="hh:mm:ss"||M>0?P=[j(M),j(S),j(x)]:l==="mm:ss"?P=[j(S),j(x)]:P=[x.toString()],a.jsx("div",{className:se.countdownDigital,children:P.map((A,E)=>a.jsxs(o.Fragment,{children:[E>0&&a.jsx("span",{className:se.countdownSeparator,children:":"}),a.jsx("span",{className:se.countdownDigit,children:A})]},E))})},D=()=>{const{hours:M,minutes:S,seconds:x}=v,P=typeof s=="number"?s:w,A=P>0?w/P:0,E=2*Math.PI*45;return a.jsxs("div",{className:se.countdownCircular,children:[a.jsxs("svg",{viewBox:"0 0 100 100",className:se.countdownCircleSvg,children:[a.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:"currentColor",strokeWidth:"8",opacity:"0.2"}),a.jsx("circle",{cx:"50",cy:"50",r:"45",fill:"none",stroke:N?m:y??(r==null?void 0:r.primaryColor)??"#6366f1",strokeWidth:"8",strokeLinecap:"round",strokeDasharray:E,strokeDashoffset:E*(1-A),transform:"rotate(-90 50 50)",className:se.countdownProgressRing})]}),a.jsx("div",{className:se.countdownCircleText,children:l!=="ss"?a.jsxs(a.Fragment,{children:[M>0&&a.jsxs("span",{children:[j(M),":"]}),a.jsxs("span",{children:[j(S),":"]}),a.jsx("span",{children:j(x)})]}):a.jsx("span",{className:se.countdownLargeSeconds,children:x})})]})},b=()=>{const{hours:M,minutes:S,seconds:x}=v,P=(A,E)=>a.jsxs("div",{className:se.flipCardContainer,children:[a.jsx("div",{className:se.flipCard,children:a.jsx("span",{children:A})}),d&&a.jsx("span",{className:se.flipLabel,children:E})]});return a.jsxs("div",{className:se.countdownFlip,children:[(l==="hh:mm:ss"||M>0)&&a.jsxs(a.Fragment,{children:[P(j(M),"godz."),a.jsx("span",{className:se.flipSeparator,children:":"})]}),l!=="ss"&&a.jsxs(a.Fragment,{children:[P(j(S),"min."),a.jsx("span",{className:se.flipSeparator,children:":"})]}),P(j(x),"sek.")]})},T=()=>{const{hours:M,minutes:S,seconds:x}=v;if(l==="ss")return a.jsxs("span",{className:se.countdownMinimal,children:[x,"s"]});let P="";return M>0&&(P+=`${M}h `),(S>0||M>0)&&(P+=`${S}m `),P+=`${x}s`,a.jsx("span",{className:se.countdownMinimal,children:P.trim()})},R={color:N?m:y,backgroundColor:f,fontFamily:r==null?void 0:r.fontFamily},L=[se.interactiveCountdown,se[`countdownStyle_${c}`],N?se.countdownWarning:"",z?se.countdownComplete:"",i??""].filter(Boolean).join(" ");return a.jsxs("div",{className:L,style:R,children:[c==="digital"&&I(),c==="circular"&&D(),c==="flip"&&b(),c==="minimal"&&T(),z&&a.jsx("div",{className:se.countdownCompleteMessage,children:"⏰ Czas minął!"})]})},em=({content:e,userName:t,onSubmitQuestion:n,onUpvote:i,onMarkAnswered:r,submissionClosed:s=!1,isModerator:l=!1,upvotedQuestions:c=[],className:d,theme:u})=>{const{placeholder:y="Zadaj pytanie...",allowAnonymous:f=!0,moderated:p=!1,allowUpvote:m=!0,maxVisible:w=10,displayStyle:k="list",charLimit:z=500,questions:$=[]}=e,[g,v]=o.useState($),[N,j]=o.useState(""),[I,D]=o.useState(!1),[b,T]=o.useState(new Set(c)),R=o.useMemo(()=>[...g].filter(E=>!p||E.answered||l).sort((E,h)=>h.upvotes!==E.upvotes?h.upvotes-E.upvotes:new Date(h.timestamp).getTime()-new Date(E.timestamp).getTime()).slice(0,w),[g,p,l,w]),L=o.useCallback(E=>{E.preventDefault();const h=N.trim();if(!h||s)return;const C={id:`q_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,text:h,author:I||!t?void 0:t,timestamp:new Date().toISOString(),upvotes:0,answered:!1};v(_=>[C,..._]),j(""),n==null||n({text:C.text,author:C.author,answered:!1})},[N,s,I,t,n]),M=o.useCallback(E=>{!m||b.has(E)||(v(h=>h.map(C=>C.id===E?{...C,upvotes:C.upvotes+1}:C)),T(h=>new Set(h).add(E)),i==null||i(E))},[m,b,i]),S=o.useCallback(E=>{l&&(v(h=>h.map(C=>C.id===E?{...C,answered:!C.answered}:C)),r==null||r(E))},[l,r]),x=()=>a.jsxs("form",{className:se.qnaInputForm,onSubmit:L,children:[a.jsxs("div",{className:se.qnaInputWrapper,children:[a.jsx("textarea",{className:se.qnaInput,placeholder:y,value:N,onChange:E=>j(E.target.value.slice(0,z)),disabled:s,rows:2,style:{fontFamily:u==null?void 0:u.fontFamily}}),a.jsxs("span",{className:se.qnaCharCount,children:[N.length,"/",z]})]}),a.jsxs("div",{className:se.qnaInputActions,children:[f&&a.jsxs("label",{className:se.qnaAnonymousToggle,children:[a.jsx("input",{type:"checkbox",checked:I,onChange:E=>D(E.target.checked)}),a.jsx("span",{children:"Anonimowo"})]}),a.jsx("button",{type:"submit",className:se.qnaSubmitBtn,disabled:!N.trim()||s,style:{backgroundColor:u==null?void 0:u.primaryColor,fontFamily:u==null?void 0:u.fontFamily},children:"Wyślij pytanie"})]})]}),P=E=>{const h=b.has(E.id);return a.jsxs("div",{className:`${se.qnaQuestion} ${E.answered?se.qnaQuestionAnswered:""}`,children:[a.jsxs("div",{className:se.qnaQuestionContent,children:[a.jsx("span",{className:se.qnaQuestionText,style:{fontFamily:u==null?void 0:u.fontFamily},children:E.text}),a.jsxs("div",{className:se.qnaQuestionMeta,children:[a.jsx("span",{className:se.qnaAuthor,children:E.author?`@${E.author}`:"👤 Anonim"}),a.jsx("span",{className:se.qnaTimestamp,children:tm(E.timestamp)})]})]}),a.jsxs("div",{className:se.qnaQuestionActions,children:[m&&a.jsxs("button",{className:`${se.qnaUpvoteBtn} ${h?se.qnaUpvoted:""}`,onClick:()=>M(E.id),disabled:h,title:h?"Już zagłosowałeś":"Zagłosuj",children:[a.jsx("span",{className:se.qnaUpvoteIcon,children:"▲"}),a.jsx("span",{className:se.qnaUpvoteCount,children:E.upvotes})]}),l&&a.jsx("button",{className:`${se.qnaAnsweredBtn} ${E.answered?se.qnaMarkedAnswered:""}`,onClick:()=>S(E.id),title:E.answered?"Oznacz jako nieodpowiedziane":"Oznacz jako odpowiedziane",children:E.answered?"✓":"○"})]})]},E.id)},A=[se.interactiveQnA,se[`qnaStyle_${k}`],d??""].filter(Boolean).join(" ");return a.jsxs("div",{className:A,children:[a.jsxs("div",{className:se.qnaHeader,children:[a.jsx("h3",{className:se.qnaTitle,style:{fontFamily:u==null?void 0:u.fontFamily},children:"Pytania i odpowiedzi"}),a.jsxs("span",{className:se.qnaCount,children:[g.length," ",g.length===1?"pytanie":"pytań"]})]}),!s&&x(),s&&a.jsx("div",{className:se.qnaClosedMessage,children:"Zadawanie pytań zostało zamknięte"}),a.jsx("div",{className:se.qnaQuestionsList,children:R.length===0?a.jsx("div",{className:se.qnaEmptyState,children:"Brak pytań. Bądź pierwszy!"}):R.map(P)}),g.length>w&&a.jsxs("div",{className:se.qnaMoreQuestions,children:["+",g.length-w," więcej pytań"]})]})};function tm(e){const t=new Date(e),i=new Date().getTime()-t.getTime(),r=Math.floor(i/6e4);if(r<1)return"Teraz";if(r<60)return`${r} min temu`;const s=Math.floor(r/60);return s<24?`${s}h temu`:t.toLocaleDateString("pl-PL",{day:"numeric",month:"short"})}const Wi={id:"fade",name:"Fade",description:"Smooth fade between slides",outgoingStyles:{from:{opacity:1},to:{opacity:0}},incomingStyles:{from:{opacity:0},to:{opacity:1}},defaultDuration:500,defaultEasing:"ease-in-out",category:"basic"},Vi={id:"slide-left",name:"Slide Left",description:"Slide to the left",outgoingStyles:{from:{transform:"translateX(0%)"},to:{transform:"translateX(-100%)"}},incomingStyles:{from:{transform:"translateX(100%)"},to:{transform:"translateX(0%)"}},defaultDuration:600,defaultEasing:"ease-in-out",supportsDirection:!0,category:"slide"},Ki={id:"slide-right",name:"Slide Right",description:"Slide to the right",outgoingStyles:{from:{transform:"translateX(0%)"},to:{transform:"translateX(100%)"}},incomingStyles:{from:{transform:"translateX(-100%)"},to:{transform:"translateX(0%)"}},defaultDuration:600,defaultEasing:"ease-in-out",supportsDirection:!0,category:"slide"},Ui={id:"slide-up",name:"Slide Up",description:"Slide upward",outgoingStyles:{from:{transform:"translateY(0%)"},to:{transform:"translateY(-100%)"}},incomingStyles:{from:{transform:"translateY(100%)"},to:{transform:"translateY(0%)"}},defaultDuration:600,defaultEasing:"ease-in-out",supportsDirection:!0,category:"slide"},Yi={id:"slide-down",name:"Slide Down",description:"Slide downward",outgoingStyles:{from:{transform:"translateY(0%)"},to:{transform:"translateY(100%)"}},incomingStyles:{from:{transform:"translateY(-100%)"},to:{transform:"translateY(0%)"}},defaultDuration:600,defaultEasing:"ease-in-out",supportsDirection:!0,category:"slide"},Zi={id:"zoom-in",name:"Zoom In",description:"Zoom in from center",outgoingStyles:{from:{transform:"scale(1)",opacity:1},to:{transform:"scale(1.2)",opacity:0}},incomingStyles:{from:{transform:"scale(0.8)",opacity:0},to:{transform:"scale(1)",opacity:1}},defaultDuration:500,defaultEasing:"ease-out",category:"zoom"},Gi={id:"zoom-out",name:"Zoom Out",description:"Zoom out to center",outgoingStyles:{from:{transform:"scale(1)",opacity:1},to:{transform:"scale(0.8)",opacity:0}},incomingStyles:{from:{transform:"scale(1.2)",opacity:0},to:{transform:"scale(1)",opacity:1}},defaultDuration:500,defaultEasing:"ease-out",category:"zoom"},Qi={id:"flip-horizontal",name:"Flip Horizontal",description:"3D flip around vertical axis",outgoingStyles:{from:{transform:"perspective(1000px) rotateY(0deg)",opacity:1},to:{transform:"perspective(1000px) rotateY(-90deg)",opacity:0}},incomingStyles:{from:{transform:"perspective(1000px) rotateY(90deg)",opacity:0},to:{transform:"perspective(1000px) rotateY(0deg)",opacity:1}},defaultDuration:700,defaultEasing:"ease-in-out",category:"3d"},Xi={id:"flip-vertical",name:"Flip Vertical",description:"3D flip around horizontal axis",outgoingStyles:{from:{transform:"perspective(1000px) rotateX(0deg)",opacity:1},to:{transform:"perspective(1000px) rotateX(90deg)",opacity:0}},incomingStyles:{from:{transform:"perspective(1000px) rotateX(-90deg)",opacity:0},to:{transform:"perspective(1000px) rotateX(0deg)",opacity:1}},defaultDuration:700,defaultEasing:"ease-in-out",category:"3d"},Ji={id:"cube-left",name:"Cube Left",description:"3D cube rotation to the left",outgoingStyles:{from:{transform:"perspective(1000px) translateZ(0) rotateY(0deg)"},to:{transform:"perspective(1000px) translateZ(-50%) rotateY(90deg)"}},incomingStyles:{from:{transform:"perspective(1000px) translateZ(-50%) rotateY(-90deg)"},to:{transform:"perspective(1000px) translateZ(0) rotateY(0deg)"}},defaultDuration:800,defaultEasing:"ease-in-out",category:"3d"},er={id:"rotate-in",name:"Rotate In",description:"Rotate and fade in",outgoingStyles:{from:{transform:"rotate(0deg) scale(1)",opacity:1},to:{transform:"rotate(-15deg) scale(0.8)",opacity:0}},incomingStyles:{from:{transform:"rotate(15deg) scale(0.8)",opacity:0},to:{transform:"rotate(0deg) scale(1)",opacity:1}},defaultDuration:600,defaultEasing:"ease-out",category:"rotate"},tr={id:"blur-fade",name:"Blur Fade",description:"Fade with blur effect",outgoingStyles:{from:{filter:"blur(0px)",opacity:1},to:{filter:"blur(10px)",opacity:0}},incomingStyles:{from:{filter:"blur(10px)",opacity:0},to:{filter:"blur(0px)",opacity:1}},defaultDuration:600,defaultEasing:"ease-in-out",category:"blur"},nr={id:"wipe-left",name:"Wipe Left",description:"Wipe from right to left",outgoingStyles:{from:{clipPath:"inset(0 0 0 0)"},to:{clipPath:"inset(0 100% 0 0)"}},incomingStyles:{from:{clipPath:"inset(0 0 0 100%)"},to:{clipPath:"inset(0 0 0 0)"}},defaultDuration:600,defaultEasing:"ease-in-out",category:"creative"},ar={id:"wipe-right",name:"Wipe Right",description:"Wipe from left to right",outgoingStyles:{from:{clipPath:"inset(0 0 0 0)"},to:{clipPath:"inset(0 0 0 100%)"}},incomingStyles:{from:{clipPath:"inset(0 100% 0 0)"},to:{clipPath:"inset(0 0 0 0)"}},defaultDuration:600,defaultEasing:"ease-in-out",category:"creative"},ir={id:"circle-reveal",name:"Circle Reveal",description:"Reveal with expanding circle",outgoingStyles:{from:{clipPath:"circle(100% at 50% 50%)"},to:{clipPath:"circle(0% at 50% 50%)"}},incomingStyles:{from:{clipPath:"circle(0% at 50% 50%)"},to:{clipPath:"circle(100% at 50% 50%)"}},defaultDuration:700,defaultEasing:"ease-out",category:"creative"},rr={id:"glitch",name:"Glitch",description:"Digital glitch effect",outgoingStyles:{from:{transform:"translateX(0)",filter:"hue-rotate(0deg)"},keyframes:[{offset:.2,style:{transform:"translateX(-5px)",filter:"hue-rotate(90deg)"}},{offset:.4,style:{transform:"translateX(5px)",filter:"hue-rotate(180deg)"}},{offset:.6,style:{transform:"translateX(-3px)",filter:"hue-rotate(270deg)"}},{offset:.8,style:{transform:"translateX(3px)",filter:"hue-rotate(360deg)"}}],to:{transform:"translateX(0)",filter:"hue-rotate(0deg)",opacity:0}},incomingStyles:{from:{transform:"translateX(0)",filter:"hue-rotate(0deg)",opacity:0},keyframes:[{offset:.2,style:{transform:"translateX(5px)",filter:"hue-rotate(270deg)",opacity:.5}},{offset:.4,style:{transform:"translateX(-5px)",filter:"hue-rotate(180deg)",opacity:.7}},{offset:.6,style:{transform:"translateX(3px)",filter:"hue-rotate(90deg)",opacity:.9}},{offset:.8,style:{transform:"translateX(-3px)",filter:"hue-rotate(0deg)",opacity:1}}],to:{transform:"translateX(0)",filter:"hue-rotate(0deg)",opacity:1}},defaultDuration:500,defaultEasing:"linear",category:"creative"},or={id:"morph",name:"Morph",description:"Smooth morphing effect",outgoingStyles:{from:{transform:"scale(1)",borderRadius:"0%",opacity:1},to:{transform:"scale(0.5)",borderRadius:"50%",opacity:0}},incomingStyles:{from:{transform:"scale(0.5)",borderRadius:"50%",opacity:0},to:{transform:"scale(1)",borderRadius:"0%",opacity:1}},defaultDuration:700,defaultEasing:"ease-in-out",category:"creative"},sr=[Wi,Vi,Ki,Ui,Yi,Zi,Gi,Qi,Xi,Ji,er,tr,nr,ar,ir,rr,or];class nm{constructor(){this.transitions=new Map,sr.forEach(t=>this.transitions.set(t.id,t))}get(t){return this.transitions.get(t)}register(t){this.transitions.has(t.id)&&console.warn(`Transition "${t.id}" already exists and will be overwritten.`),this.transitions.set(t.id,t)}unregister(t){this.transitions.delete(t)}getAll(){return Array.from(this.transitions.values())}getByCategory(t){return this.getAll().filter(n=>n.category===t)}}const lr=new nm;function Ma(e,t,n,i){if(i&&i.length>0){const r=[{offset:0,style:e},...i,{offset:1,style:t}].sort((u,y)=>u.offset-y.offset);let s=r[0],l=r[r.length-1];for(let u=0;u<r.length-1;u++)if(n>=r[u].offset&&n<=r[u+1].offset){s=r[u],l=r[u+1];break}const c=l.offset-s.offset,d=c>0?(n-s.offset)/c:1;return za(s.style,l.style,d)}return za(e,t,n)}function za(e,t,n){const i={};return new Set([...Object.keys(e),...Object.keys(t)]).forEach(s=>{const l=e[s],c=t[s];l===void 0?i[s]=c:c===void 0?i[s]=l:typeof l=="number"&&typeof c=="number"?i[s]=l+(c-l)*n:i[s]=n<.5?l:c}),i}function am(e,t){const n=lr.get(e);if(!n)return{progress:t,outgoingStyle:{opacity:1-t},incomingStyle:{opacity:t},isComplete:t>=1};const{outgoingStyles:i,incomingStyles:r}=n;return{progress:t,outgoingStyle:Ma(i.from,i.to,t,i.keyframes),incomingStyle:Ma(r.from,r.to,t,r.keyframes),isComplete:t>=1}}function im(e,t){return{none:"fade",fade:"fade",slide:t==="right"?"slide-right":t==="up"?"slide-up":t==="down"?"slide-down":"slide-left",zoom:"zoom-in",flip:"flip-horizontal",cube:"cube-left",wipe:t==="right"?"wipe-right":"wipe-left",dissolve:"blur-fade",push:t==="right"?"slide-right":"slide-left",cover:"slide-left"}[e]??"fade"}function rm(e,t){switch(t){case"linear":return e;case"ease-in":return e*e;case"ease-out":return 1-Math.pow(1-e,2);case"ease-in-out":return e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2;case"ease":default:return e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2}}function om(e,t,n,i,r){return{id:e,name:t,outgoingStyles:n,incomingStyles:i,defaultDuration:(r==null?void 0:r.defaultDuration)??500,defaultEasing:(r==null?void 0:r.defaultEasing)??"ease-in-out",description:r==null?void 0:r.description,supportsDirection:r==null?void 0:r.supportsDirection,previewUrl:r==null?void 0:r.previewUrl,category:(r==null?void 0:r.category)??"custom"}}function sm(e,t){const n=t==="outgoing"?e.outgoingStyles:e.incomingStyles,i=[];return i.push({offset:0,...n.from}),n.keyframes&&n.keyframes.forEach(r=>{i.push({offset:r.offset,...r.style})}),i.push({offset:1,...n.to}),i}function $t(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0}).format(e)}function Ht(e){return`${e>=0?"+":""}${e.toFixed(1)}%`}function qt(e){return e>=0?"#10B981":"#EF4444"}function lm(e){return{id:"slide-title",title:"Title",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#1E3A8A",position:0},{color:"#3B82F6",position:100}],gradientDirection:135},elements:[{id:"title-main",type:"text",position:{x:10,y:35,width:80,height:15,unit:"percent"},content:{type:"text",text:`${e.quarter} ${e.year} Quarterly Report`,style:{fontFamily:"Inter, sans-serif",fontSize:56,fontWeight:700,color:"#FFFFFF",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:800,delayMs:200}},{id:"title-company",type:"text",position:{x:10,y:52,width:80,height:8,unit:"percent"},content:{type:"text",text:e.companyName,style:{fontFamily:"Inter, sans-serif",fontSize:32,fontWeight:400,color:"#93C5FD",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:600,delayMs:600}},{id:"title-date",type:"text",position:{x:10,y:85,width:80,height:5,unit:"percent"},content:{type:"text",text:e.reportDate||new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}),style:{fontFamily:"Inter, sans-serif",fontSize:18,color:"#BFDBFE",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1e3}}],notes:"Welcome stakeholders. This presentation covers our Q"+e.quarter[1]+" results.",durationMs:3e4}}function cm(e){const t=[{id:"kpi-revenue",type:"shape",position:{x:5,y:22,width:21,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#E5E7EB",strokeWidth:1,cornerRadius:12},animation:{effect:"slideInLeft",durationMs:500,delayMs:200}},{id:"kpi-revenue-icon",type:"text",position:{x:7,y:25,width:17,height:6,unit:"percent"},content:{type:"text",text:"💰",style:{fontSize:36,textAlign:"center"}}},{id:"kpi-revenue-label",type:"text",position:{x:7,y:32,width:17,height:4,unit:"percent"},content:{type:"text",text:"Revenue",style:{fontSize:14,color:"#6B7280",textAlign:"center",fontWeight:500}}},{id:"kpi-revenue-value",type:"text",position:{x:7,y:37,width:17,height:8,unit:"percent"},content:{type:"text",text:$t(e.kpis.revenue.value),style:{fontSize:28,fontWeight:700,color:"#1F2937",textAlign:"center"}}},{id:"kpi-revenue-change",type:"text",position:{x:7,y:46,width:17,height:4,unit:"percent"},content:{type:"text",text:Ht(e.kpis.revenue.change),style:{fontSize:16,fontWeight:600,color:qt(e.kpis.revenue.change),textAlign:"center"}}},{id:"kpi-profit",type:"shape",position:{x:28,y:22,width:21,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#E5E7EB",strokeWidth:1,cornerRadius:12},animation:{effect:"slideInLeft",durationMs:500,delayMs:350}},{id:"kpi-profit-icon",type:"text",position:{x:30,y:25,width:17,height:6,unit:"percent"},content:{type:"text",text:"📈",style:{fontSize:36,textAlign:"center"}}},{id:"kpi-profit-label",type:"text",position:{x:30,y:32,width:17,height:4,unit:"percent"},content:{type:"text",text:"Profit",style:{fontSize:14,color:"#6B7280",textAlign:"center",fontWeight:500}}},{id:"kpi-profit-value",type:"text",position:{x:30,y:37,width:17,height:8,unit:"percent"},content:{type:"text",text:$t(e.kpis.profit.value),style:{fontSize:28,fontWeight:700,color:"#1F2937",textAlign:"center"}}},{id:"kpi-profit-change",type:"text",position:{x:30,y:46,width:17,height:4,unit:"percent"},content:{type:"text",text:Ht(e.kpis.profit.change),style:{fontSize:16,fontWeight:600,color:qt(e.kpis.profit.change),textAlign:"center"}}},{id:"kpi-customers",type:"shape",position:{x:51,y:22,width:21,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#E5E7EB",strokeWidth:1,cornerRadius:12},animation:{effect:"slideInLeft",durationMs:500,delayMs:500}},{id:"kpi-customers-icon",type:"text",position:{x:53,y:25,width:17,height:6,unit:"percent"},content:{type:"text",text:"👥",style:{fontSize:36,textAlign:"center"}}},{id:"kpi-customers-label",type:"text",position:{x:53,y:32,width:17,height:4,unit:"percent"},content:{type:"text",text:"Customers",style:{fontSize:14,color:"#6B7280",textAlign:"center",fontWeight:500}}},{id:"kpi-customers-value",type:"text",position:{x:53,y:37,width:17,height:8,unit:"percent"},content:{type:"text",text:e.kpis.customers.value.toLocaleString(),style:{fontSize:28,fontWeight:700,color:"#1F2937",textAlign:"center"}}},{id:"kpi-customers-change",type:"text",position:{x:53,y:46,width:17,height:4,unit:"percent"},content:{type:"text",text:Ht(e.kpis.customers.change),style:{fontSize:16,fontWeight:600,color:qt(e.kpis.customers.change),textAlign:"center"}}},{id:"kpi-satisfaction",type:"shape",position:{x:74,y:22,width:21,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#E5E7EB",strokeWidth:1,cornerRadius:12},animation:{effect:"slideInLeft",durationMs:500,delayMs:650}},{id:"kpi-satisfaction-icon",type:"text",position:{x:76,y:25,width:17,height:6,unit:"percent"},content:{type:"text",text:"⭐",style:{fontSize:36,textAlign:"center"}}},{id:"kpi-satisfaction-label",type:"text",position:{x:76,y:32,width:17,height:4,unit:"percent"},content:{type:"text",text:"Satisfaction",style:{fontSize:14,color:"#6B7280",textAlign:"center",fontWeight:500}}},{id:"kpi-satisfaction-value",type:"text",position:{x:76,y:37,width:17,height:8,unit:"percent"},content:{type:"text",text:`${e.kpis.satisfaction.value}%`,style:{fontSize:28,fontWeight:700,color:"#1F2937",textAlign:"center"}}},{id:"kpi-satisfaction-change",type:"text",position:{x:76,y:46,width:17,height:4,unit:"percent"},content:{type:"text",text:Ht(e.kpis.satisfaction.change),style:{fontSize:16,fontWeight:600,color:qt(e.kpis.satisfaction.change),textAlign:"center"}}}];return{id:"slide-kpis",title:"Key Performance Indicators",layout:"titleContent",background:{type:"solid",color:"#F3F4F6"},elements:[{id:"kpis-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Key Performance Indicators",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},...t],notes:"Review each KPI and highlight the most significant changes from last quarter.",durationMs:45e3}}function dm(e){var n;const t={type:"chart",chartType:"bar",title:"Monthly Revenue",data:{labels:e.financials.revenueByMonth.map(i=>i.month),datasets:[{label:`${e.year}`,data:e.financials.revenueByMonth.map(i=>i.value),backgroundColor:"#3B82F6"},...((n=e.financials.revenueByMonth[0])==null?void 0:n.lastYear)!==void 0?[{label:`${e.year-1}`,data:e.financials.revenueByMonth.map(i=>i.lastYear||0),backgroundColor:"#93C5FD"}]:[]]},options:{showLegend:!0,showGridLines:!0,animation:!0}};return{id:"slide-revenue",title:"Revenue Analysis",layout:"titleContent",background:{type:"solid",color:"#FFFFFF"},elements:[{id:"revenue-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Revenue Analysis",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},{id:"revenue-chart",type:"chart",position:{x:5,y:18,width:90,height:75,unit:"percent"},content:t,animation:{effect:"fadeIn",durationMs:800,delayMs:400}}],notes:"Highlight the revenue trend and compare with last year if applicable.",durationMs:6e4}}function um(e){const t={type:"chart",chartType:"pie",title:"Cost Breakdown",data:{labels:e.financials.costBreakdown.map(n=>n.category),datasets:[{label:"Cost Distribution",data:e.financials.costBreakdown.map(n=>n.value),backgroundColor:["#3B82F6","#10B981","#F59E0B","#EF4444","#8B5CF6","#EC4899","#14B8A6","#6366F1"]}]},options:{showLegend:!0,showDataLabels:!0,animation:!0}};return{id:"slide-costs",title:"Cost Analysis",layout:"twoColumn",background:{type:"solid",color:"#FFFFFF"},elements:[{id:"costs-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Cost Analysis",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},{id:"costs-chart",type:"chart",position:{x:5,y:18,width:45,height:70,unit:"percent"},content:t,animation:{effect:"zoomIn",durationMs:600,delayMs:400}},{id:"costs-table",type:"table",position:{x:52,y:18,width:43,height:70,unit:"percent"},content:{type:"table",headers:["Category","Amount","%"],rows:e.financials.costBreakdown.map(n=>[n.category,$t(n.value),`${n.percentage}%`]),style:{headerBackground:"#F3F4F6",headerColor:"#374151",cellPadding:12,fontSize:14,borderColor:"#E5E7EB"}},animation:{effect:"slideInRight",durationMs:600,delayMs:600}}],notes:"Discuss major cost categories and opportunities for optimization.",durationMs:6e4}}function pm(e){const t=e.pipeline.opportunities.map((i,r)=>({id:`pipeline-stage-${r}`,type:"shape",position:{x:5+r*2,y:25+r*12,width:90-r*4,height:10,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:`hsl(${220-r*15}, 70%, ${50+r*8}%)`,cornerRadius:6},animation:{effect:"slideInLeft",durationMs:400,delayMs:200+r*150}})),n=e.pipeline.opportunities.map((i,r)=>({id:`pipeline-label-${r}`,type:"text",position:{x:8+r*2,y:26.5+r*12,width:84-r*4,height:7,unit:"percent"},content:{type:"text",text:`${i.stage}: ${i.count} opportunities (${$t(i.value)})`,style:{fontSize:16,fontWeight:600,color:r<2?"#FFFFFF":"#1F2937",textAlign:"center"}}}));return{id:"slide-pipeline",title:"Sales Pipeline",layout:"titleContent",background:{type:"solid",color:"#FFFFFF"},elements:[{id:"pipeline-title",type:"text",position:{x:5,y:5,width:60,height:10,unit:"percent"},content:{type:"text",text:"Sales Pipeline",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},{id:"pipeline-total",type:"text",position:{x:65,y:5,width:30,height:10,unit:"percent"},content:{type:"text",text:`Total: ${$t(e.pipeline.totalValue)}`,style:{fontSize:28,fontWeight:700,color:"#3B82F6",textAlign:"right"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},...t,...n],notes:"Walk through the pipeline stages and highlight key deals approaching close.",durationMs:6e4}}function mm(e){const t={high:"#EF4444",medium:"#F59E0B",low:"#10B981"},n=e.risks.slice(0,5).flatMap((i,r)=>[{id:`risk-card-${r}`,type:"shape",position:{x:5,y:20+r*15,width:90,height:13,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:t[i.impact],strokeWidth:2,cornerRadius:8},animation:{effect:"slideInLeft",durationMs:400,delayMs:200+r*100}},{id:`risk-name-${r}`,type:"text",position:{x:7,y:21.5+r*15,width:50,height:5,unit:"percent"},content:{type:"text",text:i.name,style:{fontSize:16,fontWeight:600,color:"#1F2937"}}},{id:`risk-impact-${r}`,type:"text",position:{x:58,y:21.5+r*15,width:15,height:5,unit:"percent"},content:{type:"text",text:`Impact: ${i.impact.toUpperCase()}`,style:{fontSize:12,fontWeight:500,color:t[i.impact]}}},{id:`risk-prob-${r}`,type:"text",position:{x:75,y:21.5+r*15,width:18,height:5,unit:"percent"},content:{type:"text",text:`Prob: ${i.probability.toUpperCase()}`,style:{fontSize:12,fontWeight:500,color:"#6B7280"}}},{id:`risk-mitigation-${r}`,type:"text",position:{x:7,y:27+r*15,width:86,height:4,unit:"percent"},content:{type:"text",text:`Mitigation: ${i.mitigation}`,style:{fontSize:12,color:"#6B7280"}}}]);return{id:"slide-risks",title:"Risks & Mitigation",layout:"titleContent",background:{type:"solid",color:"#F9FAFB"},elements:[{id:"risks-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Risks & Mitigation",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},...n],notes:"Discuss each risk, its current status, and mitigation actions in progress.",durationMs:9e4}}function hm(e){const t={"on-track":"#10B981","at-risk":"#F59E0B",completed:"#3B82F6","not-started":"#9CA3AF"},n={"on-track":"✅","at-risk":"⚠️",completed:"🎉","not-started":"⏳"},i=e.plan.slice(0,6).flatMap((r,s)=>[{id:`plan-item-${s}`,type:"shape",position:{x:5,y:18+s*13,width:90,height:11,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:t[r.status],strokeWidth:2,cornerRadius:8},animation:{effect:"slideInRight",durationMs:400,delayMs:200+s*100}},{id:`plan-icon-${s}`,type:"text",position:{x:7,y:20+s*13,width:5,height:7,unit:"percent"},content:{type:"text",text:n[r.status],style:{fontSize:24}}},{id:`plan-goal-${s}`,type:"text",position:{x:13,y:20+s*13,width:60,height:7,unit:"percent"},content:{type:"text",text:r.goal,style:{fontSize:16,fontWeight:500,color:"#1F2937"}}},{id:`plan-status-${s}`,type:"text",position:{x:75,y:20+s*13,width:18,height:7,unit:"percent"},content:{type:"text",text:r.status.replace("-"," ").toUpperCase(),style:{fontSize:12,fontWeight:600,color:t[r.status],textAlign:"right"}}}]);return{id:"slide-plan",title:"Strategic Plan",layout:"titleContent",background:{type:"solid",color:"#FFFFFF"},elements:[{id:"plan-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Strategic Plan Status",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},...i],notes:"Review progress on strategic initiatives and discuss any blockers.",durationMs:6e4}}function fm(e){const t=e.team||{headcount:0,newHires:0,departures:0,highlights:[]};return{id:"slide-team",title:"Team Updates",layout:"twoColumn",background:{type:"gradient",gradientStops:[{color:"#F0F9FF",position:0},{color:"#E0F2FE",position:100}],gradientDirection:180},elements:[{id:"team-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Team Updates",style:{fontFamily:"Inter, sans-serif",fontSize:40,fontWeight:700,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:0}},{id:"team-headcount-card",type:"shape",position:{x:5,y:20,width:28,height:25,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#3B82F6",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:500,delayMs:200}},{id:"team-headcount-icon",type:"text",position:{x:12,y:23,width:14,height:8,unit:"percent"},content:{type:"text",text:"👥",style:{fontSize:40,textAlign:"center"}}},{id:"team-headcount-value",type:"text",position:{x:7,y:32,width:24,height:8,unit:"percent"},content:{type:"text",text:t.headcount.toString(),style:{fontSize:36,fontWeight:700,color:"#1F2937",textAlign:"center"}}},{id:"team-headcount-label",type:"text",position:{x:7,y:40,width:24,height:4,unit:"percent"},content:{type:"text",text:"Total Headcount",style:{fontSize:12,color:"#6B7280",textAlign:"center"}}},{id:"team-new-card",type:"shape",position:{x:36,y:20,width:28,height:25,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#10B981",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:500,delayMs:350}},{id:"team-new-icon",type:"text",position:{x:43,y:23,width:14,height:8,unit:"percent"},content:{type:"text",text:"🆕",style:{fontSize:40,textAlign:"center"}}},{id:"team-new-value",type:"text",position:{x:38,y:32,width:24,height:8,unit:"percent"},content:{type:"text",text:`+${t.newHires||0}`,style:{fontSize:36,fontWeight:700,color:"#10B981",textAlign:"center"}}},{id:"team-new-label",type:"text",position:{x:38,y:40,width:24,height:4,unit:"percent"},content:{type:"text",text:"New Hires",style:{fontSize:12,color:"#6B7280",textAlign:"center"}}},{id:"team-dept-card",type:"shape",position:{x:67,y:20,width:28,height:25,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#F59E0B",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:500,delayMs:500}},{id:"team-dept-icon",type:"text",position:{x:74,y:23,width:14,height:8,unit:"percent"},content:{type:"text",text:"👋",style:{fontSize:40,textAlign:"center"}}},{id:"team-dept-value",type:"text",position:{x:69,y:32,width:24,height:8,unit:"percent"},content:{type:"text",text:`-${t.departures||0}`,style:{fontSize:36,fontWeight:700,color:"#F59E0B",textAlign:"center"}}},{id:"team-dept-label",type:"text",position:{x:69,y:40,width:24,height:4,unit:"percent"},content:{type:"text",text:"Departures",style:{fontSize:12,color:"#6B7280",textAlign:"center"}}},{id:"team-highlights-title",type:"text",position:{x:5,y:50,width:90,height:6,unit:"percent"},content:{type:"text",text:"Team Highlights",style:{fontSize:24,fontWeight:600,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:700}},...(t.highlights||[]).slice(0,4).map((n,i)=>({id:`team-highlight-${i}`,type:"text",position:{x:7,y:58+i*8,width:88,height:6,unit:"percent"},content:{type:"text",text:`• ${n}`,style:{fontSize:16,color:"#374151"}},animation:{effect:"slideInLeft",durationMs:300,delayMs:800+i*100}}))],notes:"Celebrate new team members and acknowledge departures. Highlight team achievements.",durationMs:45e3}}function gm(e){return{id:"slide-qa",title:"Q&A",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#1E3A8A",position:0},{color:"#3B82F6",position:100}],gradientDirection:135},elements:[{id:"qa-title",type:"text",position:{x:10,y:35,width:80,height:20,unit:"percent"},content:{type:"text",text:"Questions?",style:{fontFamily:"Inter, sans-serif",fontSize:72,fontWeight:700,color:"#FFFFFF",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:800,delayMs:200}},{id:"qa-subtitle",type:"text",position:{x:10,y:55,width:80,height:10,unit:"percent"},content:{type:"text",text:"Thank you for your attention",style:{fontFamily:"Inter, sans-serif",fontSize:28,color:"#93C5FD",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:600,delayMs:800}},{id:"qa-contact",type:"text",position:{x:10,y:85,width:80,height:5,unit:"percent"},content:{type:"text",text:e.preparedBy?`Prepared by: ${e.preparedBy}`:e.companyName,style:{fontSize:16,color:"#BFDBFE",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1200}}],notes:"Open floor for questions. Have backup slides ready for detailed questions.",durationMs:3e5}}function ym(e){return{version:"1.0",id:`quarterly-report-${e.quarter}-${e.year}`,title:`${e.quarter} ${e.year} Quarterly Report - ${e.companyName}`,author:e.preparedBy,slideSize:{width:1920,height:1080,unit:"px"},slides:[lm(e),cm(e),dm(e),um(e),pm(e),mm(e),hm(e),fm(e),gm(e)],theme:{colors:{primary:"#3B82F6",secondary:"#10B981",background:"#FFFFFF",text:"#1F2937",accent:"#F59E0B"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["quarterly-report",e.quarter,e.year.toString()],templateId:"quarterly-report-v1"}}}function bm(){return{quarter:"Q4",year:2024,companyName:"TechCorp Inc.",reportDate:"January 15, 2025",preparedBy:"Finance Team",kpis:{revenue:{value:125e5,change:15.3,target:12e6},profit:{value:28e5,change:8.7,target:25e5},customers:{value:1250,change:22.5,target:1e3},satisfaction:{value:92,change:3.2,target:90}},financials:{revenueByMonth:[{month:"Oct",value:38e5,lastYear:32e5},{month:"Nov",value:42e5,lastYear:35e5},{month:"Dec",value:45e5,lastYear:4e6}],costBreakdown:[{category:"Personnel",value:52e5,percentage:42},{category:"Infrastructure",value:23e5,percentage:18},{category:"Marketing",value:18e5,percentage:14},{category:"R&D",value:15e5,percentage:12},{category:"Operations",value:11e5,percentage:9},{category:"Other",value:6e5,percentage:5}],profitMargin:[{month:"Oct",margin:21},{month:"Nov",margin:22},{month:"Dec",margin:24}]},pipeline:{totalValue:185e5,opportunities:[{stage:"Qualified",count:45,value:85e5},{stage:"Proposal",count:28,value:52e5},{stage:"Negotiation",count:15,value:32e5},{stage:"Closing",count:8,value:16e5}]},risks:[{name:"Supply chain delays",impact:"high",probability:"medium",mitigation:"Diversifying suppliers and increasing inventory buffer",owner:"Operations"},{name:"Key talent retention",impact:"high",probability:"low",mitigation:"Competitive compensation review and career development programs",owner:"HR"},{name:"Market competition",impact:"medium",probability:"high",mitigation:"Accelerating product innovation and customer loyalty programs",owner:"Product"}],plan:[{goal:"Launch v2.0 platform",status:"on-track",dueDate:"Q1 2025",owner:"Engineering"},{goal:"Expand to EMEA market",status:"at-risk",dueDate:"Q2 2025",owner:"Sales"},{goal:"Achieve SOC2 certification",status:"completed",owner:"Security"},{goal:"Implement AI-powered support",status:"on-track",dueDate:"Q1 2025",owner:"Support"},{goal:"Reduce customer churn by 15%",status:"on-track",dueDate:"Q4 2024",owner:"Customer Success"}],team:{headcount:156,newHires:23,departures:8,highlights:["Promoted 12 team members to senior roles","Launched engineering mentorship program","Achieved 95% employee engagement score","Completed company-wide DEI training"]}}}function xm(e){const t=e.problem.painPoints.slice(0,4).map((n,i)=>({id:`pain-${i}`,type:"text",position:{x:55,y:28+i*15,width:40,height:12,unit:"percent"},content:{type:"text",text:`❌ ${n}`,style:{fontSize:20,color:"#374151",lineHeight:1.5}},animation:{effect:"slideInRight",durationMs:400,delayMs:400+i*200}}));return{id:"slide-problem",title:"The Problem",layout:"twoColumn",background:{type:"solid",color:"#FEF2F2"},elements:[{id:"problem-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:e.problem.headline,style:{fontSize:48,fontWeight:700,color:"#991B1B"}},animation:{effect:"fadeIn",durationMs:600,delayMs:0}},{id:"problem-icon",type:"text",position:{x:10,y:30,width:35,height:40,unit:"percent"},content:{type:"text",text:"😫",style:{fontSize:150,textAlign:"center"}},animation:{effect:"zoomIn",durationMs:500,delayMs:200}},...t,...(e.problem.statistics||[]).slice(0,2).map((n,i)=>({id:`stat-${i}`,type:"shape",position:{x:5+i*47,y:80,width:43,height:15,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FEE2E2",cornerRadius:8},animation:{effect:"fadeIn",durationMs:400,delayMs:1e3+i*200}}))],notes:"Set up the problem. Make the audience feel the pain before presenting the solution.",durationMs:6e4}}function vm(e){const t=e.solution.keyBenefits.slice(0,3).flatMap((n,i)=>[{id:`benefit-card-${i}`,type:"shape",position:{x:5+i*32,y:45,width:29,height:45,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#10B981",strokeWidth:2,cornerRadius:12},animation:{effect:"slideInUp",durationMs:500,delayMs:400+i*200}},{id:`benefit-icon-${i}`,type:"text",position:{x:10+i*32,y:50,width:19,height:12,unit:"percent"},content:{type:"text",text:n.icon||"✅",style:{fontSize:48,textAlign:"center"}}},{id:`benefit-title-${i}`,type:"text",position:{x:7+i*32,y:64,width:25,height:8,unit:"percent"},content:{type:"text",text:n.title,style:{fontSize:20,fontWeight:600,color:"#1F2937",textAlign:"center"}}},{id:`benefit-desc-${i}`,type:"text",position:{x:7+i*32,y:73,width:25,height:14,unit:"percent"},content:{type:"text",text:n.description,style:{fontSize:14,color:"#6B7280",textAlign:"center",lineHeight:1.4}}}]);return{id:"slide-solution",title:"The Solution",layout:"titleContent",background:{type:"gradient",gradientStops:[{color:"#ECFDF5",position:0},{color:"#D1FAE5",position:100}],gradientDirection:180},elements:[{id:"solution-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:e.solution.headline,style:{fontSize:48,fontWeight:700,color:"#047857"}},animation:{effect:"fadeIn",durationMs:600,delayMs:0}},{id:"solution-desc",type:"text",position:{x:5,y:20,width:90,height:15,unit:"percent"},content:{type:"text",text:e.solution.description,style:{fontSize:24,color:"#374151",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:500,delayMs:300}},...t],notes:"Introduce your solution as the hero. Emphasize key benefits.",durationMs:6e4}}function wm(e){var n,i;const t=(((n=e.demo)==null?void 0:n.features)||[]).slice(0,5).map((r,s)=>({id:`demo-feature-${s}`,type:"text",position:{x:55,y:25+s*12,width:40,height:10,unit:"percent"},content:{type:"text",text:`▸ ${r.name}`,style:{fontSize:18,color:"#374151",fontWeight:500}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+s*150}}));return{id:"slide-demo",title:"Product Demo",layout:"twoColumn",background:{type:"solid",color:"#FFFFFF"},elements:[{id:"demo-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:`See ${e.productName} in Action`,style:{fontSize:44,fontWeight:700,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"demo-screenshot",type:"shape",position:{x:5,y:22,width:45,height:70,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#F3F4F6",stroke:"#E5E7EB",strokeWidth:2,cornerRadius:12},animation:{effect:"slideInLeft",durationMs:600,delayMs:300}},{id:"demo-placeholder",type:"text",position:{x:15,y:50,width:25,height:10,unit:"percent"},content:{type:"text",text:(i=e.demo)!=null&&i.screenshotUrl?"":"📱 Demo Screenshot",style:{fontSize:20,color:"#9CA3AF",textAlign:"center"}}},{id:"features-title",type:"text",position:{x:55,y:18,width:40,height:6,unit:"percent"},content:{type:"text",text:"Key Features",style:{fontSize:24,fontWeight:600,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},...t],notes:"This is where you do the live demo or show screenshots. Keep it focused.",durationMs:12e4}}function km(e){const t=e.features.slice(0,6).flatMap((n,i)=>{const r=Math.floor(i/3),s=i%3,l=n.highlight;return[{id:`feature-card-${i}`,type:"shape",position:{x:5+s*32,y:22+r*38,width:29,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:l?"#3B82F6":"#FFFFFF",stroke:l?"#2563EB":"#E5E7EB",strokeWidth:l?3:1,cornerRadius:12},animation:{effect:"zoomIn",durationMs:400,delayMs:200+i*100}},{id:`feature-icon-${i}`,type:"text",position:{x:10+s*32,y:26+r*38,width:19,height:10,unit:"percent"},content:{type:"text",text:n.icon||"⚡",style:{fontSize:36,textAlign:"center"}}},{id:`feature-name-${i}`,type:"text",position:{x:7+s*32,y:37+r*38,width:25,height:6,unit:"percent"},content:{type:"text",text:n.name,style:{fontSize:18,fontWeight:600,color:l?"#FFFFFF":"#1F2937",textAlign:"center"}}},{id:`feature-desc-${i}`,type:"text",position:{x:7+s*32,y:44+r*38,width:25,height:10,unit:"percent"},content:{type:"text",text:n.description,style:{fontSize:12,color:l?"#DBEAFE":"#6B7280",textAlign:"center",lineHeight:1.3}}}]});return{id:"slide-features",title:"Features",layout:"titleContent",background:{type:"solid",color:"#F9FAFB"},elements:[{id:"features-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:"Powerful Features",style:{fontSize:44,fontWeight:700,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t],notes:"Highlight key features. Focus on benefits, not just functionality.",durationMs:6e4}}function Sm(e){const t=e.pricing.plans.slice(0,3).flatMap((n,i)=>{const r=n.highlighted,s=r?18:22,l=r?72:65;return[{id:`pricing-card-${i}`,type:"shape",position:{x:5+i*32,y:s,width:29,height:l,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:r?"#3B82F6":"#FFFFFF",stroke:r?"#1D4ED8":"#E5E7EB",strokeWidth:r?3:1,cornerRadius:16},animation:{effect:"slideInUp",durationMs:500,delayMs:200+i*150}},...r?[{id:`pricing-badge-${i}`,type:"text",position:{x:10+i*32,y:s+2,width:19,height:4,unit:"percent"},content:{type:"text",text:"⭐ POPULAR",style:{fontSize:12,fontWeight:700,color:"#FCD34D",textAlign:"center"}}}]:[],{id:`pricing-name-${i}`,type:"text",position:{x:7+i*32,y:s+(r?8:5),width:25,height:6,unit:"percent"},content:{type:"text",text:n.name,style:{fontSize:24,fontWeight:600,color:r?"#FFFFFF":"#1F2937",textAlign:"center"}}},{id:`pricing-price-${i}`,type:"text",position:{x:7+i*32,y:s+(r?16:13),width:25,height:10,unit:"percent"},content:{type:"text",text:n.price==="custom"?"Custom":`${e.pricing.currency}${n.price}/${n.period==="month"?"mo":n.period==="year"?"yr":""}`,style:{fontSize:36,fontWeight:700,color:r?"#FFFFFF":"#3B82F6",textAlign:"center"}}},...n.features.slice(0,5).map((c,d)=>({id:`pricing-feature-${i}-${d}`,type:"text",position:{x:7+i*32,y:s+(r?28:25)+d*7,width:25,height:5,unit:"percent"},content:{type:"text",text:`✓ ${c}`,style:{fontSize:12,color:r?"#DBEAFE":"#6B7280",textAlign:"center"}}})),{id:`pricing-cta-${i}`,type:"shape",position:{x:9+i*32,y:s+l-12,width:21,height:8,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:r?"#FFFFFF":"#3B82F6",cornerRadius:8}},{id:`pricing-cta-text-${i}`,type:"text",position:{x:9+i*32,y:s+l-10.5,width:21,height:5,unit:"percent"},content:{type:"text",text:n.cta||"Get Started",style:{fontSize:14,fontWeight:600,color:r?"#3B82F6":"#FFFFFF",textAlign:"center"}}}]});return{id:"slide-pricing",title:"Pricing",layout:"titleContent",background:{type:"solid",color:"#FFFFFF"},elements:[{id:"pricing-title",type:"text",position:{x:5,y:3,width:90,height:10,unit:"percent"},content:{type:"text",text:"Simple, Transparent Pricing",style:{fontSize:44,fontWeight:700,color:"#1F2937"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t],notes:"Present pricing clearly. Emphasize value, not just cost.",durationMs:6e4}}function Cm(e){return{id:"slide-cta",title:"Call to Action",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#1E40AF",position:0},{color:"#3B82F6",position:50},{color:"#60A5FA",position:100}],gradientDirection:135},elements:[{id:"cta-headline",type:"text",position:{x:10,y:25,width:80,height:20,unit:"percent"},content:{type:"text",text:e.cta.headline,style:{fontSize:56,fontWeight:700,color:"#FFFFFF",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:700,delayMs:0}},...e.cta.subheadline?[{id:"cta-subheadline",type:"text",position:{x:15,y:48,width:70,height:10,unit:"percent"},content:{type:"text",text:e.cta.subheadline,style:{fontSize:24,color:"#BFDBFE",textAlign:"center",lineHeight:1.4}},animation:{effect:"fadeIn",durationMs:500,delayMs:500}}]:[],{id:"cta-button",type:"shape",position:{x:35,y:65,width:30,height:12,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",cornerRadius:30},animation:{effect:"slideInUp",durationMs:500,delayMs:800}},{id:"cta-button-text",type:"text",position:{x:35,y:68,width:30,height:6,unit:"percent"},content:{type:"text",text:e.cta.buttonText,style:{fontSize:24,fontWeight:700,color:"#1E40AF",textAlign:"center"}}},...e.cta.contactEmail?[{id:"cta-contact",type:"text",position:{x:20,y:82,width:60,height:6,unit:"percent"},content:{type:"text",text:`📧 ${e.cta.contactEmail}`,style:{fontSize:18,color:"#93C5FD",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1e3}}]:[],...e.cta.websiteUrl?[{id:"cta-website",type:"text",position:{x:20,y:88,width:60,height:5,unit:"percent"},content:{type:"text",text:`🌐 ${e.cta.websiteUrl}`,style:{fontSize:16,color:"#93C5FD",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1100}}]:[]],notes:"Strong call to action. Make it easy for them to take the next step.",durationMs:6e4}}function _m(e){return{id:"slide-title",title:"Title",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#0F172A",position:0},{color:"#1E293B",position:100}],gradientDirection:180},elements:[{id:"title-product",type:"text",position:{x:10,y:30,width:80,height:20,unit:"percent"},content:{type:"text",text:e.productName,style:{fontSize:72,fontWeight:800,color:"#FFFFFF",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:800,delayMs:200}},{id:"title-tagline",type:"text",position:{x:15,y:52,width:70,height:12,unit:"percent"},content:{type:"text",text:e.tagline,style:{fontSize:28,color:"#94A3B8",textAlign:"center",lineHeight:1.4}},animation:{effect:"fadeIn",durationMs:600,delayMs:800}},{id:"title-company",type:"text",position:{x:10,y:88,width:80,height:6,unit:"percent"},content:{type:"text",text:e.companyName,style:{fontSize:18,color:"#64748B",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1200}}],notes:"Opening slide. Create intrigue and set the tone.",durationMs:15e3}}function jm(e){return{version:"1.0",id:`product-pitch-${e.productName.toLowerCase().replace(/\s+/g,"-")}`,title:`${e.productName} - Product Pitch`,slideSize:{width:1920,height:1080,unit:"px"},slides:[_m(e),xm(e),vm(e),wm(e),km(e),Sm(e),Cm(e)],theme:{colors:{primary:"#3B82F6",secondary:"#10B981",background:"#FFFFFF",text:"#1F2937",accent:"#F59E0B"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["product-pitch","sales"],templateId:"product-pitch-v1"}}}function Nm(){return{productName:"FlowSync",tagline:"Seamless workflow automation that actually works",companyName:"FlowSync Inc.",problem:{headline:"Manual processes are killing productivity",painPoints:["Teams waste 20+ hours/week on repetitive tasks","Data silos cause costly errors and delays","No visibility into process bottlenecks","Integration nightmares with existing tools"],statistics:[{stat:"60%",description:"of knowledge workers spend time on busy work"},{stat:"$1.8T",description:"lost annually to inefficient processes"}]},solution:{headline:"Automate in minutes, not months",description:"FlowSync connects your existing tools and automates workflows with AI-powered intelligence. No coding required.",keyBenefits:[{title:"Easy Setup",description:"Connect apps in seconds with 200+ integrations",icon:"🔌"},{title:"AI-Powered",description:"Smart automation that learns from your workflows",icon:"🧠"},{title:"Real-time Insights",description:"Dashboard with live metrics and bottleneck detection",icon:"📊"}]},demo:{features:[{name:"Visual Workflow Builder",description:"Drag-and-drop interface"},{name:"Smart Triggers",description:"Event-based automation"},{name:"Error Handling",description:"Automatic retry and alerts"},{name:"Version Control",description:"Track changes and rollback"},{name:"Team Collaboration",description:"Share and comment on flows"}]},features:[{name:"Visual Builder",description:"Intuitive drag-and-drop workflow design",icon:"🎨",highlight:!0},{name:"200+ Integrations",description:"Connect to popular apps instantly",icon:"🔗"},{name:"AI Suggestions",description:"Get smart automation recommendations",icon:"🤖"},{name:"Real-time Monitoring",description:"Track all workflows in one dashboard",icon:"📈"},{name:"Enterprise Security",description:"SOC2 compliant, encrypted data",icon:"🔒"},{name:"24/7 Support",description:"Expert help whenever you need it",icon:"💬"}],pricing:{currency:"$",plans:[{name:"Starter",price:29,period:"month",features:["5 workflows","1,000 runs/month","10 integrations","Email support"],cta:"Start Free"},{name:"Professional",price:99,period:"month",features:["Unlimited workflows","50,000 runs/month","All integrations","Priority support","AI suggestions"],highlighted:!0,cta:"Try 14 Days Free"},{name:"Enterprise",price:"custom",period:"month",features:["Everything in Pro","Unlimited runs","Dedicated support","Custom integrations","SLA guarantee"],cta:"Contact Sales"}]},cta:{headline:"Ready to automate your workflow?",subheadline:"Join 10,000+ teams already saving hours every week",buttonText:"Start Your Free Trial",contactEmail:"hello@flowsync.io",websiteUrl:"flowsync.io"}}}function Em(e){const t=Math.round(e.completed.totalPoints/e.completed.committedPoints*100);return{id:"slide-title",title:"Sprint Review",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#1E3A8A",position:0},{color:"#3B82F6",position:100}],gradientDirection:135},elements:[{id:"title-sprint",type:"text",position:{x:10,y:25,width:80,height:15,unit:"percent"},content:{type:"text",text:`Sprint ${e.sprint.number} Review`,style:{fontSize:64,fontWeight:700,color:"#FFFFFF",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:600,delayMs:0}},{id:"title-name",type:"text",position:{x:15,y:42,width:70,height:8,unit:"percent"},content:{type:"text",text:e.sprint.name,style:{fontSize:32,color:"#93C5FD",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:500,delayMs:300}},{id:"title-team",type:"text",position:{x:30,y:55,width:40,height:5,unit:"percent"},content:{type:"text",text:`Team ${e.team.name}`,style:{fontSize:20,color:"#BFDBFE",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"title-dates",type:"text",position:{x:25,y:62,width:50,height:5,unit:"percent"},content:{type:"text",text:`${e.sprint.startDate} - ${e.sprint.endDate}`,style:{fontSize:18,color:"#93C5FD",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:600}},{id:"title-completion",type:"text",position:{x:35,y:75,width:30,height:10,unit:"percent"},content:{type:"text",text:`${t}% Complete`,style:{fontSize:36,fontWeight:700,color:t>=80?"#4ADE80":t>=60?"#FBBF24":"#F87171",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:600,delayMs:800}}],notes:"Welcome stakeholders. Quick overview of sprint completion.",durationMs:3e4}}function Mm(e){return{id:"slide-goal",title:"Sprint Goal",layout:"titleContent",background:{type:"solid",color:"#F0F9FF"},elements:[{id:"goal-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Sprint Goal",style:{fontSize:44,fontWeight:700,color:"#1E3A8A"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"goal-card",type:"shape",position:{x:10,y:25,width:80,height:30,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#3B82F6",strokeWidth:3,cornerRadius:16},animation:{effect:"slideInUp",durationMs:500,delayMs:200}},{id:"goal-icon",type:"text",position:{x:15,y:30,width:10,height:15,unit:"percent"},content:{type:"text",text:"🎯",style:{fontSize:64}}},{id:"goal-text",type:"text",position:{x:27,y:32,width:58,height:20,unit:"percent"},content:{type:"text",text:e.sprint.goal,style:{fontSize:28,color:"#1F2937",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"goal-status",type:"text",position:{x:10,y:60,width:80,height:8,unit:"percent"},content:{type:"text",text:e.completed.totalPoints>=e.completed.committedPoints*.8?"✅ Goal Achieved":"⚠️ Goal Partially Met",style:{fontSize:32,fontWeight:600,color:e.completed.totalPoints>=e.completed.committedPoints*.8?"#059669":"#D97706",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:500,delayMs:700}}],notes:"Review whether the sprint goal was achieved and why.",durationMs:45e3}}function zm(e){const t=e.completed.stories.slice(0,8).map((n,i)=>{const r=Math.floor(i/2),s=i%2,l=n.type==="feature"?"✨":n.type==="bug"?"🐛":n.type==="tech-debt"?"🔧":"🔬",c=n.type==="feature"?"#059669":n.type==="bug"?"#DC2626":n.type==="tech-debt"?"#7C3AED":"#0891B2";return{id:`story-${i}`,type:"text",position:{x:5+s*48,y:22+r*9,width:44,height:7,unit:"percent"},content:{type:"text",text:`${l} ${n.key}: ${n.title}`,style:{fontSize:16,color:c,fontWeight:n.demo?700:400}},animation:{effect:"slideInRight",durationMs:300,delayMs:300+i*100}}});return{id:"slide-completed",title:"Completed Work",layout:"titleContent",background:{type:"solid",color:"#F0FDF4"},elements:[{id:"completed-title",type:"text",position:{x:5,y:5,width:60,height:10,unit:"percent"},content:{type:"text",text:"Completed Work",style:{fontSize:44,fontWeight:700,color:"#166534"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"completed-points",type:"text",position:{x:70,y:5,width:25,height:12,unit:"percent"},content:{type:"text",text:`${e.completed.totalPoints} / ${e.completed.committedPoints} pts`,style:{fontSize:32,fontWeight:700,color:"#059669",textAlign:"right"}},animation:{effect:"zoomIn",durationMs:500,delayMs:200}},...t,{id:"legend",type:"text",position:{x:5,y:90,width:90,height:5,unit:"percent"},content:{type:"text",text:"✨ Feature | 🐛 Bug Fix | 🔧 Tech Debt | 🔬 Spike",style:{fontSize:14,color:"#6B7280",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1200}}],notes:"Walk through completed items. Highlight any notable achievements.",durationMs:9e4}}function $m(e){const t=Math.max(...e.velocity.history.map(r=>r.points),e.velocity.current),n=e.velocity.history.slice(-5).map((r,s)=>{const l=r.points/t*45;return{id:`bar-${s}`,type:"shape",position:{x:10+s*16,y:75-l,width:12,height:l,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#93C5FD",cornerRadius:8},animation:{effect:"slideInUp",durationMs:500,delayMs:400+s*100}}}),i=e.velocity.current/t*45;return{id:"slide-velocity",title:"Velocity",layout:"titleContent",background:{type:"solid",color:"#FFFFFF"},elements:[{id:"velocity-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Sprint Velocity",style:{fontSize:44,fontWeight:700,color:"#1E3A8A"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...n,{id:"current-bar",type:"shape",position:{x:10+e.velocity.history.slice(-5).length*16,y:75-i,width:12,height:i,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#3B82F6",cornerRadius:8},animation:{effect:"slideInUp",durationMs:600,delayMs:900}},{id:"current-label",type:"text",position:{x:10+e.velocity.history.slice(-5).length*16,y:77,width:12,height:6,unit:"percent"},content:{type:"text",text:`S${e.sprint.number}`,style:{fontSize:14,color:"#1E3A8A",fontWeight:600,textAlign:"center"}}},{id:"current-value",type:"text",position:{x:10+e.velocity.history.slice(-5).length*16,y:70-i,width:12,height:5,unit:"percent"},content:{type:"text",text:`${e.velocity.current}`,style:{fontSize:18,color:"#3B82F6",fontWeight:700,textAlign:"center"}}},{id:"average-line",type:"text",position:{x:5,y:18,width:35,height:10,unit:"percent"},content:{type:"text",text:`Average: ${e.velocity.average} pts/sprint`,style:{fontSize:24,color:"#6B7280"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"trend",type:"text",position:{x:60,y:18,width:35,height:10,unit:"percent"},content:{type:"text",text:e.velocity.current>=e.velocity.average?"📈 On Track":"📉 Below Average",style:{fontSize:24,color:e.velocity.current>=e.velocity.average?"#059669":"#DC2626",textAlign:"right"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1e3}}],notes:"Review velocity trends. Discuss any significant changes.",durationMs:6e4}}function Am(e){const t=(e.impediments||[]).slice(0,5).map((n,i)=>{const r=n.status==="resolved"?"✅":n.status==="ongoing"?"🔄":"🚨",s=n.status==="resolved"?"#059669":n.status==="ongoing"?"#D97706":"#DC2626";return{id:`impediment-${i}`,type:"text",position:{x:5,y:25+i*13,width:90,height:11,unit:"percent"},content:{type:"text",text:`${r} ${n.description}${n.owner?` (${n.owner})`:""}`,style:{fontSize:20,color:s,lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:400,delayMs:300+i*150}}});return{id:"slide-impediments",title:"Impediments",layout:"titleContent",background:{type:"solid",color:"#FEF2F2"},elements:[{id:"impediments-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:"Impediments & Blockers",style:{fontSize:44,fontWeight:700,color:"#991B1B"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t,{id:"legend-impediments",type:"text",position:{x:5,y:90,width:90,height:5,unit:"percent"},content:{type:"text",text:"✅ Resolved | 🔄 Ongoing | 🚨 Escalated",style:{fontSize:14,color:"#6B7280",textAlign:"center"}}}],notes:"Discuss blockers and what help is needed from stakeholders.",durationMs:6e4}}function Fm(e){const t=e.nextSprint.topPriorities.slice(0,5).map((n,i)=>({id:`priority-${i}`,type:"text",position:{x:5,y:45+i*10,width:90,height:8,unit:"percent"},content:{type:"text",text:`${i+1}. ${n.key}: ${n.title}${n.points?` (${n.points} pts)`:""}`,style:{fontSize:20,color:"#374151",lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+i*100}}));return{id:"slide-next",title:"Next Sprint",layout:"titleContent",background:{type:"gradient",gradientStops:[{color:"#EEF2FF",position:0},{color:"#E0E7FF",position:100}],gradientDirection:180},elements:[{id:"next-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:`Sprint ${e.sprint.number+1} Preview`,style:{fontSize:44,fontWeight:700,color:"#4338CA"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"next-goal-label",type:"text",position:{x:5,y:18,width:20,height:6,unit:"percent"},content:{type:"text",text:"Sprint Goal:",style:{fontSize:20,fontWeight:600,color:"#6366F1"}}},{id:"next-goal",type:"text",position:{x:5,y:25,width:90,height:12,unit:"percent"},content:{type:"text",text:e.nextSprint.goal,style:{fontSize:28,color:"#1F2937",lineHeight:1.4}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},{id:"priorities-label",type:"text",position:{x:5,y:40,width:30,height:5,unit:"percent"},content:{type:"text",text:"Top Priorities:",style:{fontSize:20,fontWeight:600,color:"#6366F1"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},...t,{id:"capacity",type:"text",position:{x:70,y:5,width:25,height:10,unit:"percent"},content:{type:"text",text:`Capacity: ${e.nextSprint.capacity} pts`,style:{fontSize:20,fontWeight:600,color:"#059669",textAlign:"right"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}}],notes:"Preview next sprint. Get stakeholder input on priorities.",durationMs:6e4}}function Im(e){const t=[Em(e),Mm(e),zm(e),$m(e)];return e.impediments&&e.impediments.length>0&&t.push(Am(e)),t.push(Fm(e)),{version:"1.0",id:`sprint-review-${e.sprint.number}`,title:`Sprint ${e.sprint.number} Review - ${e.team.name}`,slideSize:{width:1920,height:1080,unit:"px"},slides:t,theme:{colors:{primary:"#3B82F6",secondary:"#10B981",background:"#FFFFFF",text:"#1F2937",accent:"#8B5CF6"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["sprint-review","agile","scrum"],templateId:"sprint-review-v1"}}}function Dm(){return{sprint:{number:24,name:"Phoenix Release",startDate:"2024-03-04",endDate:"2024-03-15",goal:"Complete user authentication flow and improve dashboard performance by 50%"},team:{name:"Alpha",members:[{name:"Sarah Chen",role:"Tech Lead"},{name:"Mike Johnson",role:"Senior Dev"},{name:"Emily Davis",role:"Frontend Dev"},{name:"Alex Kim",role:"QA Engineer"}]},completed:{stories:[{key:"AUTH-123",title:"OAuth2 integration",points:8,assignee:"Sarah",type:"feature",demo:!0},{key:"AUTH-124",title:"Password reset flow",points:5,assignee:"Mike",type:"feature",demo:!0},{key:"DASH-45",title:"Query optimization",points:8,assignee:"Sarah",type:"tech-debt"},{key:"DASH-46",title:"Caching layer",points:5,assignee:"Mike",type:"feature"},{key:"BUG-89",title:"Login timeout issue",points:3,assignee:"Emily",type:"bug"},{key:"BUG-90",title:"Memory leak in charts",points:5,assignee:"Emily",type:"bug"}],totalPoints:34,committedPoints:40},notCompleted:[{key:"AUTH-125",title:"MFA implementation",points:6,reason:"Blocked by security review"}],demos:[{title:"OAuth2 Login",description:"Full OAuth2 flow with Google and GitHub",presenter:"Sarah"},{title:"Password Reset",description:"Email-based password reset with security tokens",presenter:"Mike"}],velocity:{current:34,history:[{sprint:"S20",points:28},{sprint:"S21",points:32},{sprint:"S22",points:35},{sprint:"S23",points:30}],average:31},metrics:{bugsFixed:2,bugsCreated:1,testCoverage:78,deployments:3,cycleTime:4.2},impediments:[{description:"Security review delayed MFA implementation",status:"ongoing",owner:"Security Team"},{description:"CI pipeline slow - 45min builds",status:"resolved",owner:"DevOps"}],nextSprint:{goal:"Complete MFA implementation and launch beta user onboarding",topPriorities:[{key:"AUTH-125",title:"MFA implementation",points:6},{key:"ONBOARD-01",title:"Welcome wizard",points:8},{key:"ONBOARD-02",title:"User tutorial system",points:5},{key:"DASH-50",title:"Real-time notifications",points:5}],capacity:32}}}function Tm(e){return{id:"slide-title",title:"Architecture Overview",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#0F172A",position:0},{color:"#1E293B",position:100}],gradientDirection:135},elements:[{id:"title-main",type:"text",position:{x:10,y:28,width:80,height:15,unit:"percent"},content:{type:"text",text:e.project.name,style:{fontSize:64,fontWeight:700,color:"#FFFFFF",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:600,delayMs:0}},{id:"title-subtitle",type:"text",position:{x:15,y:45,width:70,height:8,unit:"percent"},content:{type:"text",text:"Architecture Overview",style:{fontSize:36,color:"#60A5FA",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:500,delayMs:300}},{id:"title-version",type:"text",position:{x:35,y:58,width:30,height:5,unit:"percent"},content:{type:"text",text:`v${e.project.version}`,style:{fontSize:20,color:"#94A3B8",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"title-desc",type:"text",position:{x:15,y:68,width:70,height:12,unit:"percent"},content:{type:"text",text:e.project.description,style:{fontSize:18,color:"#CBD5E1",textAlign:"center",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:700}},...e.project.team?[{id:"title-team",type:"text",position:{x:10,y:88,width:80,height:5,unit:"percent"},content:{type:"text",text:`Team: ${e.project.team}`,style:{fontSize:16,color:"#64748B",textAlign:"center"}}}]:[]],notes:"Introduction to the system architecture. Set context for the audience.",durationMs:3e4}}function Rm(e){const t=e.systemOverview.keyCharacteristics.slice(0,4).map((n,i)=>[{id:`char-card-${i}`,type:"shape",position:{x:5+i*24,y:65,width:22,height:28,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#1E293B",stroke:"#334155",strokeWidth:1,cornerRadius:12},animation:{effect:"slideInUp",durationMs:400,delayMs:600+i*100}},{id:`char-value-${i}`,type:"text",position:{x:7+i*24,y:70,width:18,height:10,unit:"percent"},content:{type:"text",text:n.value,style:{fontSize:32,fontWeight:700,color:"#60A5FA",textAlign:"center"}}},{id:`char-label-${i}`,type:"text",position:{x:7+i*24,y:82,width:18,height:8,unit:"percent"},content:{type:"text",text:n.label,style:{fontSize:14,color:"#94A3B8",textAlign:"center"}}}]).flat();return{id:"slide-overview",title:"System Overview",layout:"titleContent",background:{type:"solid",color:"#0F172A"},elements:[{id:"overview-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"System Overview",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"overview-summary",type:"text",position:{x:5,y:18,width:90,height:15,unit:"percent"},content:{type:"text",text:e.systemOverview.summary,style:{fontSize:22,color:"#CBD5E1",lineHeight:1.6}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},{id:"diagram-placeholder",type:"shape",position:{x:20,y:35,width:60,height:25,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#1E293B",stroke:"#334155",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:500,delayMs:400}},{id:"diagram-label",type:"text",position:{x:35,y:45,width:30,height:6,unit:"percent"},content:{type:"text",text:"📊 System Diagram",style:{fontSize:18,color:"#64748B",textAlign:"center"}}},...t],notes:"High-level system overview. Explain the main purpose and characteristics.",durationMs:6e4}}function Pm(e){const t={frontend:"#3B82F6",backend:"#10B981",service:"#8B5CF6",database:"#F59E0B",cache:"#EC4899",queue:"#06B6D4",external:"#6B7280"},n={frontend:"🖥️",backend:"⚙️",service:"🔧",database:"🗄️",cache:"⚡",queue:"📬",external:"🔗"},i=e.components.slice(0,6).flatMap((r,s)=>{const l=Math.floor(s/3),c=s%3,d=t[r.type]||"#6B7280",u=n[r.type]||"📦";return[{id:`comp-card-${s}`,type:"shape",position:{x:5+c*32,y:22+l*38,width:29,height:35,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#1E293B",stroke:d,strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:400,delayMs:200+s*100}},{id:`comp-icon-${s}`,type:"text",position:{x:7+c*32,y:25+l*38,width:6,height:8,unit:"percent"},content:{type:"text",text:u,style:{fontSize:28}}},{id:`comp-name-${s}`,type:"text",position:{x:14+c*32,y:26+l*38,width:18,height:6,unit:"percent"},content:{type:"text",text:r.name,style:{fontSize:18,fontWeight:600,color:"#F8FAFC"}}},{id:`comp-tech-${s}`,type:"text",position:{x:7+c*32,y:34+l*38,width:25,height:5,unit:"percent"},content:{type:"text",text:r.technology,style:{fontSize:12,color:d,fontWeight:500}}},{id:`comp-desc-${s}`,type:"text",position:{x:7+c*32,y:40+l*38,width:25,height:14,unit:"percent"},content:{type:"text",text:r.description,style:{fontSize:12,color:"#94A3B8",lineHeight:1.4}}}]});return{id:"slide-components",title:"Components",layout:"titleContent",background:{type:"solid",color:"#0F172A"},elements:[{id:"components-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"System Components",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...i],notes:"Walk through each component. Explain responsibilities and interactions.",durationMs:9e4}}function Om(e){const n=[{key:"frontend",label:"Frontend",icon:"🖥️",color:"#3B82F6"},{key:"backend",label:"Backend",icon:"⚙️",color:"#10B981"},{key:"database",label:"Database",icon:"🗄️",color:"#F59E0B"},{key:"infrastructure",label:"Infrastructure",icon:"☁️",color:"#8B5CF6"}].flatMap((i,r)=>{const s=e.techStack[i.key];if(!s||s.length===0)return[];const l=r%2,c=Math.floor(r/2);return[{id:`tech-header-${i.key}`,type:"text",position:{x:5+l*48,y:20+c*40,width:44,height:6,unit:"percent"},content:{type:"text",text:`${i.icon} ${i.label}`,style:{fontSize:24,fontWeight:600,color:i.color}},animation:{effect:"fadeIn",durationMs:400,delayMs:200+r*100}},...s.slice(0,4).map((d,u)=>({id:`tech-item-${i.key}-${u}`,type:"text",position:{x:7+l*48,y:28+c*40+u*7,width:40,height:5,unit:"percent"},content:{type:"text",text:`• ${d.name}${d.version?` v${d.version}`:""} - ${d.purpose}`,style:{fontSize:14,color:"#CBD5E1",lineHeight:1.3}},animation:{effect:"slideInRight",durationMs:300,delayMs:400+r*100+u*50}}))]});return{id:"slide-techstack",title:"Tech Stack",layout:"titleContent",background:{type:"solid",color:"#0F172A"},elements:[{id:"techstack-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Technology Stack",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...n],notes:"Overview of technologies used. Explain key decisions.",durationMs:6e4}}function Lm(e){const t=e.infrastructure.services.slice(0,8).map((n,i)=>{const r=i%4,s=Math.floor(i/4);return{id:`infra-svc-${i}`,type:"text",position:{x:5+r*24,y:50+s*15,width:22,height:12,unit:"percent"},content:{type:"text",text:`${n.icon||"☁️"} ${n.name}
|
|
813
|
+
${n.purpose}`,style:{fontSize:14,color:"#CBD5E1",textAlign:"center",lineHeight:1.4}},animation:{effect:"zoomIn",durationMs:300,delayMs:400+i*80}}});return{id:"slide-infrastructure",title:"Infrastructure",layout:"titleContent",background:{type:"gradient",gradientStops:[{color:"#0F172A",position:0},{color:"#1E1B4B",position:100}],gradientDirection:180},elements:[{id:"infra-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Infrastructure",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"infra-provider",type:"text",position:{x:5,y:18,width:45,height:8,unit:"percent"},content:{type:"text",text:`☁️ Provider: ${e.infrastructure.provider}`,style:{fontSize:24,color:"#A78BFA"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},...e.infrastructure.regions?[{id:"infra-regions",type:"text",position:{x:55,y:18,width:40,height:8,unit:"percent"},content:{type:"text",text:`🌍 Regions: ${e.infrastructure.regions.join(", ")}`,style:{fontSize:18,color:"#94A3B8",textAlign:"right"}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}}]:[],{id:"infra-diagram",type:"shape",position:{x:15,y:28,width:70,height:18,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#1E293B",stroke:"#8B5CF6",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:500,delayMs:350}},{id:"infra-diagram-text",type:"text",position:{x:35,y:35,width:30,height:5,unit:"percent"},content:{type:"text",text:"🏗️ Infrastructure Diagram",style:{fontSize:16,color:"#64748B",textAlign:"center"}}},...t],notes:"Explain infrastructure setup, scaling strategy, and deployment.",durationMs:6e4}}function Bm(e){if(!e.security)return{id:"slide-security",title:"Security",layout:"titleContent",background:{type:"solid",color:"#0F172A"},elements:[{id:"security-placeholder",type:"text",position:{x:30,y:45,width:40,height:10,unit:"percent"},content:{type:"text",text:"Security details to be added",style:{fontSize:24,color:"#64748B",textAlign:"center"}}}],durationMs:3e4};const t=e.security.practices.slice(0,6).map((n,i)=>({id:`practice-${i}`,type:"text",position:{x:5,y:55+i*7,width:90,height:5,unit:"percent"},content:{type:"text",text:`✓ ${n}`,style:{fontSize:18,color:"#4ADE80"}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+i*100}}));return{id:"slide-security",title:"Security",layout:"titleContent",background:{type:"solid",color:"#0F172A"},elements:[{id:"security-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"🔒 Security",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"security-auth",type:"text",position:{x:5,y:20,width:45,height:10,unit:"percent"},content:{type:"text",text:`🔑 Auth: ${e.security.authMethod}`,style:{fontSize:22,color:"#60A5FA"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"security-encryption",type:"text",position:{x:5,y:30,width:45,height:10,unit:"percent"},content:{type:"text",text:`🔐 Encryption: ${e.security.encryption}`,style:{fontSize:22,color:"#60A5FA"}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},...e.security.compliance?[{id:"security-compliance",type:"text",position:{x:55,y:20,width:40,height:20,unit:"percent"},content:{type:"text",text:`📋 Compliance:
|
|
814
|
+
${e.security.compliance.join(`
|
|
815
|
+
`)}`,style:{fontSize:18,color:"#94A3B8",lineHeight:1.6}},animation:{effect:"fadeIn",durationMs:400,delayMs:400}}]:[],{id:"practices-header",type:"text",position:{x:5,y:45,width:90,height:8,unit:"percent"},content:{type:"text",text:"Security Practices",style:{fontSize:24,fontWeight:600,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},...t],notes:"Cover security measures and compliance requirements.",durationMs:6e4}}function Hm(e){const t=[Tm(e),Rm(e),Pm(e),Om(e),Lm(e)];return e.security&&t.push(Bm(e)),{version:"1.0",id:`architecture-${e.project.name.toLowerCase().replace(/\s+/g,"-")}`,title:`${e.project.name} - Architecture Overview`,slideSize:{width:1920,height:1080,unit:"px"},slides:t,theme:{colors:{primary:"#3B82F6",secondary:"#8B5CF6",background:"#0F172A",text:"#F8FAFC",accent:"#10B981"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["architecture","technical","system-design"],templateId:"architecture-overview-v1"}}}function qm(){return{project:{name:"E-Commerce Platform",version:"2.5.0",description:"Scalable microservices-based e-commerce platform serving 10M+ users",team:"Platform Engineering"},systemOverview:{summary:"A modern e-commerce platform built on microservices architecture, designed for high availability, horizontal scaling, and real-time inventory management. The system handles 50K+ concurrent users with sub-100ms response times.",keyCharacteristics:[{label:"Services",value:"12"},{label:"Availability",value:"99.9%"},{label:"Response Time",value:"<100ms"},{label:"Daily Orders",value:"500K+"}]},components:[{name:"Web App",type:"frontend",description:"React SPA with SSR support",technology:"Next.js 14"},{name:"Mobile BFF",type:"backend",description:"Backend for mobile apps",technology:"Node.js/Express"},{name:"Order Service",type:"service",description:"Order processing and management",technology:"Go"},{name:"Inventory Service",type:"service",description:"Real-time stock management",technology:"Rust"},{name:"PostgreSQL",type:"database",description:"Primary transactional database",technology:"PostgreSQL 15"},{name:"Redis Cluster",type:"cache",description:"Session and caching layer",technology:"Redis 7"}],dataFlow:{description:"Request flows from CDN through API Gateway to microservices",steps:[{from:"Client",to:"CDN",description:"Static assets",protocol:"HTTPS"},{from:"Client",to:"API Gateway",description:"API requests",protocol:"HTTPS"},{from:"API Gateway",to:"Services",description:"Routed requests",protocol:"gRPC"},{from:"Services",to:"Message Queue",description:"Async events",protocol:"AMQP"}]},techStack:{frontend:[{name:"Next.js",version:"14",purpose:"React framework with SSR"},{name:"TypeScript",version:"5.3",purpose:"Type safety"},{name:"Tailwind CSS",version:"3.4",purpose:"Styling"}],backend:[{name:"Go",version:"1.21",purpose:"High-performance services"},{name:"Node.js",version:"20",purpose:"BFF and tooling"},{name:"gRPC",purpose:"Service communication"}],database:[{name:"PostgreSQL",version:"15",purpose:"Primary OLTP"},{name:"Redis",version:"7",purpose:"Caching"},{name:"Elasticsearch",version:"8",purpose:"Search"}],infrastructure:[{name:"Kubernetes",purpose:"Container orchestration"},{name:"Terraform",purpose:"Infrastructure as Code"},{name:"ArgoCD",purpose:"GitOps deployments"}]},infrastructure:{provider:"AWS",regions:["us-east-1","eu-west-1","ap-southeast-1"],services:[{name:"EKS",purpose:"Kubernetes",icon:"⚙️"},{name:"RDS",purpose:"PostgreSQL",icon:"🗄️"},{name:"ElastiCache",purpose:"Redis",icon:"⚡"},{name:"S3",purpose:"Object Storage",icon:"📦"},{name:"CloudFront",purpose:"CDN",icon:"🌐"},{name:"Route 53",purpose:"DNS",icon:"🔗"},{name:"SQS/SNS",purpose:"Messaging",icon:"📬"},{name:"CloudWatch",purpose:"Monitoring",icon:"📊"}]},security:{authMethod:"OAuth 2.0 + JWT",encryption:"AES-256 at rest, TLS 1.3 in transit",compliance:["SOC 2 Type II","PCI DSS","GDPR"],practices:["Zero-trust network architecture","Secrets managed via HashiCorp Vault","Regular penetration testing","Automated vulnerability scanning","Role-based access control (RBAC)","Audit logging for all operations"]}}}function Wm(e){return{id:"slide-welcome",title:"Welcome",layout:"titleSlide",background:{type:"gradient",gradientStops:[{color:"#7C3AED",position:0},{color:"#A78BFA",position:50},{color:"#C4B5FD",position:100}],gradientDirection:135},elements:[{id:"welcome-title",type:"text",position:{x:10,y:20,width:80,height:15,unit:"percent"},content:{type:"text",text:`Welcome to ${e.company.name}! 🎉`,style:{fontSize:56,fontWeight:700,color:"#FFFFFF",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:700,delayMs:0}},{id:"welcome-name",type:"text",position:{x:15,y:42,width:70,height:12,unit:"percent"},content:{type:"text",text:e.newHire.name,style:{fontSize:48,fontWeight:600,color:"#FFFFFF",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:600,delayMs:400}},{id:"welcome-role",type:"text",position:{x:20,y:56,width:60,height:8,unit:"percent"},content:{type:"text",text:e.newHire.role,style:{fontSize:28,color:"#EDE9FE",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:500,delayMs:600}},{id:"welcome-team",type:"text",position:{x:25,y:66,width:50,height:6,unit:"percent"},content:{type:"text",text:`Team: ${e.newHire.team}`,style:{fontSize:22,color:"#DDD6FE",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:750}},{id:"welcome-date",type:"text",position:{x:30,y:75,width:40,height:5,unit:"percent"},content:{type:"text",text:`Start Date: ${e.newHire.startDate}`,style:{fontSize:18,color:"#C4B5FD",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:900}},...e.company.tagline?[{id:"welcome-tagline",type:"text",position:{x:15,y:88,width:70,height:5,unit:"percent"},content:{type:"text",text:`"${e.company.tagline}"`,style:{fontSize:18,fontStyle:"italic",color:"#EDE9FE",textAlign:"center"}}}]:[]],notes:"Warm welcome! Make the new hire feel excited to join.",durationMs:3e4}}function Vm(e){const t=e.culture.values.slice(0,4).flatMap((n,i)=>{const r=i%2,s=Math.floor(i/2);return[{id:`value-card-${i}`,type:"shape",position:{x:5+r*48,y:45+s*27,width:44,height:24,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#E9D5FF",strokeWidth:2,cornerRadius:12},animation:{effect:"zoomIn",durationMs:400,delayMs:500+i*150}},{id:`value-icon-${i}`,type:"text",position:{x:8+r*48,y:48+s*27,width:8,height:10,unit:"percent"},content:{type:"text",text:n.icon||"✨",style:{fontSize:36}}},{id:`value-name-${i}`,type:"text",position:{x:17+r*48,y:49+s*27,width:30,height:6,unit:"percent"},content:{type:"text",text:n.name,style:{fontSize:20,fontWeight:600,color:"#6D28D9"}}},{id:`value-desc-${i}`,type:"text",position:{x:8+r*48,y:58+s*27,width:38,height:10,unit:"percent"},content:{type:"text",text:n.description,style:{fontSize:14,color:"#6B7280",lineHeight:1.4}}}]});return{id:"slide-culture",title:"Culture & Values",layout:"titleContent",background:{type:"solid",color:"#FAF5FF"},elements:[{id:"culture-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Our Culture & Values",style:{fontSize:44,fontWeight:700,color:"#6D28D9"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"culture-mission-label",type:"text",position:{x:5,y:18,width:20,height:5,unit:"percent"},content:{type:"text",text:"🎯 Our Mission",style:{fontSize:18,fontWeight:600,color:"#7C3AED"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"culture-mission",type:"text",position:{x:5,y:25,width:90,height:15,unit:"percent"},content:{type:"text",text:e.culture.mission,style:{fontSize:24,color:"#374151",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:500,delayMs:350}},...t],notes:"Explain company culture and core values. Share real examples.",durationMs:9e4}}function Km(e){const t=e.team.members.slice(0,8).map((n,i)=>{const r=i%4,s=Math.floor(i/4);return{id:`member-${i}`,type:"text",position:{x:5+r*24,y:40+s*25,width:22,height:22,unit:"percent"},content:{type:"text",text:`👤
|
|
816
|
+
${n.name}
|
|
817
|
+
${n.role}`,style:{fontSize:14,color:"#374151",textAlign:"center",lineHeight:1.6}},animation:{effect:"zoomIn",durationMs:300,delayMs:400+i*80}}});return{id:"slide-team",title:"Meet the Team",layout:"titleContent",background:{type:"solid",color:"#F0FDF4"},elements:[{id:"team-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:`Meet Team ${e.team.name} 👋`,style:{fontSize:44,fontWeight:700,color:"#166534"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"team-desc",type:"text",position:{x:5,y:18,width:90,height:12,unit:"percent"},content:{type:"text",text:e.team.description,style:{fontSize:20,color:"#374151",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},...e.newHire.manager?[{id:"team-manager",type:"text",position:{x:5,y:32,width:45,height:6,unit:"percent"},content:{type:"text",text:`📋 Manager: ${e.newHire.manager}`,style:{fontSize:18,color:"#059669"}}}]:[],...e.newHire.buddy?[{id:"team-buddy",type:"text",position:{x:50,y:32,width:45,height:6,unit:"percent"},content:{type:"text",text:`🤝 Onboarding Buddy: ${e.newHire.buddy}`,style:{fontSize:18,color:"#059669"}}}]:[],...t],notes:"Introduce team members. Share their roles and how to reach them.",durationMs:9e4}}function Um(e){const t=e.tools.filter(s=>s.priority==="essential"),n=e.tools.filter(s=>s.priority==="recommended"),i=t.slice(0,4).map((s,l)=>({id:`tool-essential-${l}`,type:"text",position:{x:5,y:28+l*10,width:44,height:8,unit:"percent"},content:{type:"text",text:`${s.icon||"🔧"} ${s.name} - ${s.purpose}`,style:{fontSize:16,color:"#374151",lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:400+l*100}})),r=n.slice(0,4).map((s,l)=>({id:`tool-recommended-${l}`,type:"text",position:{x:52,y:28+l*10,width:44,height:8,unit:"percent"},content:{type:"text",text:`${s.icon||"📦"} ${s.name} - ${s.purpose}`,style:{fontSize:16,color:"#6B7280",lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+l*100}}));return{id:"slide-tools",title:"Tools & Access",layout:"twoColumn",background:{type:"solid",color:"#F0F9FF"},elements:[{id:"tools-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"🛠️ Tools & Access",style:{fontSize:44,fontWeight:700,color:"#1E40AF"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"tools-essential-header",type:"text",position:{x:5,y:18,width:44,height:8,unit:"percent"},content:{type:"text",text:"⭐ Essential (Day 1)",style:{fontSize:22,fontWeight:600,color:"#1D4ED8"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"tools-recommended-header",type:"text",position:{x:52,y:18,width:44,height:8,unit:"percent"},content:{type:"text",text:"📦 Recommended",style:{fontSize:22,fontWeight:600,color:"#3B82F6"}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},...i,...r,{id:"tools-note",type:"text",position:{x:5,y:85,width:90,height:8,unit:"percent"},content:{type:"text",text:"💡 IT will help set up your accounts. Contact IT Support if you have issues.",style:{fontSize:16,color:"#6B7280",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:1e3}}],notes:"Review all tools needed for day 1. Ensure access is set up.",durationMs:6e4}}function Ym(e){const t=e.firstTasks.slice(0,5).flatMap((n,i)=>[{id:`day-header-${i}`,type:"text",position:{x:5+i*19,y:22,width:17,height:8,unit:"percent"},content:{type:"text",text:`Day ${n.day}`,style:{fontSize:20,fontWeight:700,color:"#6D28D9",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200+i*100}},{id:`day-card-${i}`,type:"shape",position:{x:5+i*19,y:32,width:17,height:58,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:"#FFFFFF",stroke:"#E9D5FF",strokeWidth:1,cornerRadius:8},animation:{effect:"slideInUp",durationMs:400,delayMs:300+i*100}},...n.tasks.slice(0,4).map((r,s)=>({id:`task-${i}-${s}`,type:"text",position:{x:6+i*19,y:35+s*12,width:15,height:10,unit:"percent"},content:{type:"text",text:`☐ ${r.task}`,style:{fontSize:11,color:"#374151",lineHeight:1.3}}}))]);return{id:"slide-firstweek",title:"First Week",layout:"titleContent",background:{type:"solid",color:"#FAF5FF"},elements:[{id:"firstweek-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:"📅 Your First Week",style:{fontSize:44,fontWeight:700,color:"#6D28D9"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t],notes:"Walk through first week schedule. Be realistic about expectations.",durationMs:9e4}}function Zm(e){const t=[];let n=0;return e.contacts.hr&&(t.push({id:"contact-hr",type:"text",position:{x:5+n*32,y:45,width:29,height:25,unit:"percent"},content:{type:"text",text:`👥 HR
|
|
818
|
+
${e.contacts.hr.name}
|
|
819
|
+
${e.contacts.hr.email}`,style:{fontSize:18,color:"#374151",textAlign:"center",lineHeight:1.8}},animation:{effect:"zoomIn",durationMs:400,delayMs:400}}),n++),e.contacts.it&&(t.push({id:"contact-it",type:"text",position:{x:5+n*32,y:45,width:29,height:25,unit:"percent"},content:{type:"text",text:`💻 IT Support
|
|
820
|
+
${e.contacts.it.name}
|
|
821
|
+
${e.contacts.it.email}`,style:{fontSize:18,color:"#374151",textAlign:"center",lineHeight:1.8}},animation:{effect:"zoomIn",durationMs:400,delayMs:500}}),n++),e.contacts.facilities&&t.push({id:"contact-facilities",type:"text",position:{x:5+n*32,y:45,width:29,height:25,unit:"percent"},content:{type:"text",text:`🏢 Facilities
|
|
822
|
+
${e.contacts.facilities.name}
|
|
823
|
+
${e.contacts.facilities.email}`,style:{fontSize:18,color:"#374151",textAlign:"center",lineHeight:1.8}},animation:{effect:"zoomIn",durationMs:400,delayMs:600}}),{id:"slide-contacts",title:"Key Contacts",layout:"titleContent",background:{type:"gradient",gradientStops:[{color:"#7C3AED",position:0},{color:"#8B5CF6",position:100}],gradientDirection:180},elements:[{id:"contacts-title",type:"text",position:{x:5,y:10,width:90,height:12,unit:"percent"},content:{type:"text",text:"📞 Key Contacts",style:{fontSize:44,fontWeight:700,color:"#FFFFFF"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"contacts-subtitle",type:"text",position:{x:10,y:25,width:80,height:10,unit:"percent"},content:{type:"text",text:"Your go-to people for help",style:{fontSize:24,color:"#DDD6FE",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},...t,{id:"contacts-welcome",type:"text",position:{x:15,y:80,width:70,height:12,unit:"percent"},content:{type:"text",text:"We're excited to have you on the team! 🚀",style:{fontSize:28,fontWeight:600,color:"#FFFFFF",textAlign:"center"}},animation:{effect:"zoomIn",durationMs:600,delayMs:800}}],notes:"Share key contacts. Encourage asking questions.",durationMs:45e3}}function Gm(e){return{version:"1.0",id:`onboarding-${e.newHire.name.toLowerCase().replace(/\s+/g,"-")}`,title:`${e.newHire.name} - Welcome to ${e.company.name}`,slideSize:{width:1920,height:1080,unit:"px"},slides:[Wm(e),Vm(e),Km(e),Um(e),Ym(e),Zm(e)],theme:{colors:{primary:"#7C3AED",secondary:"#10B981",background:"#FFFFFF",text:"#1F2937",accent:"#F59E0B"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["onboarding","new-hire","welcome"],templateId:"onboarding-v1"}}}function Qm(){return{company:{name:"TechCorp",tagline:"Building the future, together",founded:"2015"},newHire:{name:"Alex Johnson",role:"Senior Software Engineer",team:"Platform",startDate:"March 20, 2024",manager:"Sarah Chen",buddy:"Mike Rodriguez"},culture:{mission:"To empower developers worldwide with tools that make their work more productive, enjoyable, and impactful.",values:[{name:"Innovation",description:"We embrace new ideas and technologies to solve problems in creative ways.",icon:"💡"},{name:"Collaboration",description:"Great things happen when we work together. We value every voice.",icon:"🤝"},{name:"Quality",description:"We take pride in our craft and deliver excellence in everything we do.",icon:"⭐"},{name:"Growth",description:"We invest in learning and support each other's professional development.",icon:"🌱"}]},team:{name:"Platform",description:"We build and maintain the core infrastructure that powers all TechCorp products. Our focus is on reliability, scalability, and developer experience.",members:[{name:"Sarah Chen",role:"Engineering Manager"},{name:"Mike Rodriguez",role:"Staff Engineer"},{name:"Emily Park",role:"Senior Engineer"},{name:"James Wilson",role:"Senior Engineer"},{name:"Priya Sharma",role:"Engineer II"},{name:"David Kim",role:"Engineer I"}],channels:[{name:"#platform-team",purpose:"Team discussions"},{name:"#platform-oncall",purpose:"On-call coordination"}]},tools:[{name:"Slack",purpose:"Team communication",icon:"💬",priority:"essential"},{name:"GitHub",purpose:"Code repository",icon:"🐙",priority:"essential"},{name:"Jira",purpose:"Project tracking",icon:"📋",priority:"essential"},{name:"Notion",purpose:"Documentation",icon:"📝",priority:"essential"},{name:"Figma",purpose:"Design collaboration",icon:"🎨",priority:"recommended"},{name:"1Password",purpose:"Password management",icon:"🔐",priority:"recommended"},{name:"Zoom",purpose:"Video meetings",icon:"📹",priority:"recommended"}],processes:[{name:"Daily Standup",description:"15min sync every morning at 9:30am",frequency:"Daily"},{name:"Sprint Planning",description:"Plan upcoming sprint work",frequency:"Bi-weekly"},{name:"Code Review",description:"All PRs require 2 approvals",frequency:"Per PR"},{name:"1:1 with Manager",description:"Regular check-in with your manager",frequency:"Weekly"}],firstTasks:[{day:1,tasks:[{task:"Complete HR paperwork"},{task:"Set up laptop"},{task:"Join Slack channels"},{task:"Meet your buddy"}]},{day:2,tasks:[{task:"Dev environment setup"},{task:"Read team docs"},{task:"Shadow code review"},{task:"Team lunch 🍕"}]},{day:3,tasks:[{task:"First small PR"},{task:"Attend standup"},{task:"Architecture overview"},{task:"1:1 with manager"}]},{day:4,tasks:[{task:"Deep-dive session"},{task:"Continue coding"},{task:"Ask questions!"}]},{day:5,tasks:[{task:"Week 1 retro"},{task:"Set goals for week 2"},{task:"Friday demo"}]}],resources:[{category:"Engineering",items:[{name:"Engineering Handbook",url:"notion.so/engineering",description:"Our engineering practices"},{name:"Architecture Docs",url:"notion.so/architecture",description:"System design docs"}]}],contacts:{hr:{name:"Lisa Thompson",email:"lisa.t@techcorp.com"},it:{name:"IT Help Desk",email:"it-support@techcorp.com"},facilities:{name:"Office Admin",email:"facilities@techcorp.com"}}}}function Xm(e){return{P1:"#DC2626",P2:"#F59E0B",P3:"#3B82F6",P4:"#6B7280"}[e]||"#6B7280"}function Jm(e){return{P1:"Critical",P2:"High",P3:"Medium",P4:"Low"}[e]||"Unknown"}function eh(e){const t=Xm(e.incident.severity);return{id:"slide-title",title:"Incident Report",layout:"titleSlide",background:{type:"solid",color:"#0F172A"},elements:[{id:"title-badge",type:"shape",position:{x:35,y:15,width:30,height:8,unit:"percent"},content:{type:"shape",shape:"roundedRect",fill:t,cornerRadius:20},animation:{effect:"zoomIn",durationMs:400,delayMs:0}},{id:"title-severity",type:"text",position:{x:35,y:16.5,width:30,height:5,unit:"percent"},content:{type:"text",text:`${e.incident.severity} - ${Jm(e.incident.severity)}`,style:{fontSize:24,fontWeight:700,color:"#FFFFFF",textAlign:"center"}}},{id:"title-main",type:"text",position:{x:5,y:28,width:90,height:18,unit:"percent"},content:{type:"text",text:`Incident Report:
|
|
824
|
+
${e.incident.title}`,style:{fontSize:44,fontWeight:700,color:"#F8FAFC",textAlign:"center",lineHeight:1.3}},animation:{effect:"fadeIn",durationMs:600,delayMs:200}},{id:"title-id",type:"text",position:{x:35,y:50,width:30,height:5,unit:"percent"},content:{type:"text",text:`ID: ${e.incident.id}`,style:{fontSize:18,color:"#94A3B8",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:400}},{id:"title-date",type:"text",position:{x:25,y:60,width:50,height:5,unit:"percent"},content:{type:"text",text:`Date: ${e.incident.date} | Duration: ${e.incident.duration}`,style:{fontSize:20,color:"#CBD5E1",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"title-status",type:"text",position:{x:35,y:70,width:30,height:5,unit:"percent"},content:{type:"text",text:`Status: ${e.incident.status.toUpperCase()}`,style:{fontSize:22,fontWeight:600,color:e.incident.status==="resolved"?"#4ADE80":"#FBBF24",textAlign:"center"}},animation:{effect:"fadeIn",durationMs:400,delayMs:600}},...e.incident.commander?[{id:"title-commander",type:"text",position:{x:30,y:80,width:40,height:5,unit:"percent"},content:{type:"text",text:`Incident Commander: ${e.incident.commander}`,style:{fontSize:16,color:"#64748B",textAlign:"center"}}}]:[]],notes:"Set the context. State severity and basic facts.",durationMs:3e4}}function th(e){return{id:"slide-summary",title:"Executive Summary",layout:"titleContent",background:{type:"solid",color:"#0F172A"},elements:[{id:"summary-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"Executive Summary",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"summary-what-label",type:"text",position:{x:5,y:20,width:90,height:5,unit:"percent"},content:{type:"text",text:"❓ What Happened",style:{fontSize:22,fontWeight:600,color:"#60A5FA"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"summary-what",type:"text",position:{x:5,y:27,width:90,height:15,unit:"percent"},content:{type:"text",text:e.summary.whatHappened,style:{fontSize:18,color:"#CBD5E1",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},{id:"summary-impact-label",type:"text",position:{x:5,y:45,width:90,height:5,unit:"percent"},content:{type:"text",text:"💥 Impact",style:{fontSize:22,fontWeight:600,color:"#F87171"}},animation:{effect:"fadeIn",durationMs:400,delayMs:400}},{id:"summary-impact",type:"text",position:{x:5,y:52,width:90,height:12,unit:"percent"},content:{type:"text",text:e.summary.impact,style:{fontSize:18,color:"#CBD5E1",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"summary-resolution-label",type:"text",position:{x:5,y:68,width:90,height:5,unit:"percent"},content:{type:"text",text:"✅ Resolution",style:{fontSize:22,fontWeight:600,color:"#4ADE80"}},animation:{effect:"fadeIn",durationMs:400,delayMs:600}},{id:"summary-resolution",type:"text",position:{x:5,y:75,width:90,height:15,unit:"percent"},content:{type:"text",text:e.summary.resolution,style:{fontSize:18,color:"#CBD5E1",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:700}}],notes:"High-level summary for executives. Keep it brief and factual.",durationMs:6e4}}function nh(e){const t={detection:"#F59E0B",escalation:"#EF4444",action:"#3B82F6",resolution:"#10B981",communication:"#8B5CF6"},n={detection:"🔍",escalation:"🚨",action:"⚡",resolution:"✅",communication:"📢"},i=e.timeline.slice(0,10).flatMap((r,s)=>{const l=22+s*7.5,c=t[r.type]||"#6B7280",d=n[r.type]||"•";return[{id:`timeline-time-${s}`,type:"text",position:{x:5,y:l,width:12,height:6,unit:"percent"},content:{type:"text",text:r.time,style:{fontSize:14,fontWeight:600,color:"#94A3B8"}},animation:{effect:"fadeIn",durationMs:200,delayMs:300+s*100}},{id:`timeline-dot-${s}`,type:"text",position:{x:18,y:l,width:4,height:6,unit:"percent"},content:{type:"text",text:d,style:{fontSize:16}}},{id:`timeline-event-${s}`,type:"text",position:{x:23,y:l,width:72,height:6,unit:"percent"},content:{type:"text",text:r.event,style:{fontSize:15,color:c}},animation:{effect:"slideInRight",durationMs:300,delayMs:350+s*100}}]});return{id:"slide-timeline",title:"Timeline",layout:"titleContent",background:{type:"solid",color:"#0F172A"},elements:[{id:"timeline-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"📅 Incident Timeline",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"timeline-line",type:"shape",position:{x:20,y:22,width:.5,height:70,unit:"percent"},content:{type:"shape",shape:"rect",fill:"#334155"},animation:{effect:"fadeIn",durationMs:300,delayMs:200}},...i,{id:"timeline-legend",type:"text",position:{x:5,y:92,width:90,height:5,unit:"percent"},content:{type:"text",text:"🔍 Detection | 🚨 Escalation | ⚡ Action | ✅ Resolution | 📢 Communication",style:{fontSize:12,color:"#64748B",textAlign:"center"}}}],notes:"Walk through the timeline. Identify key decision points.",durationMs:12e4}}function ah(e){const t=[];let n=0;e.impact.usersAffected&&(t.push({id:"impact-users",type:"text",position:{x:5+n*24,y:25,width:22,height:20,unit:"percent"},content:{type:"text",text:`👥
|
|
825
|
+
${e.impact.usersAffected}
|
|
826
|
+
Users Affected`,style:{fontSize:18,color:"#F87171",textAlign:"center",lineHeight:1.8}},animation:{effect:"zoomIn",durationMs:400,delayMs:300+n*100}}),n++),e.impact.revenueImpact&&(t.push({id:"impact-revenue",type:"text",position:{x:5+n*24,y:25,width:22,height:20,unit:"percent"},content:{type:"text",text:`💰
|
|
827
|
+
${e.impact.revenueImpact}
|
|
828
|
+
Revenue Impact`,style:{fontSize:18,color:"#FBBF24",textAlign:"center",lineHeight:1.8}},animation:{effect:"zoomIn",durationMs:400,delayMs:300+n*100}}),n++),e.impact.slaViolation!==void 0&&(t.push({id:"impact-sla",type:"text",position:{x:5+n*24,y:25,width:22,height:20,unit:"percent"},content:{type:"text",text:`📋
|
|
829
|
+
${e.impact.slaViolation?"Yes":"No"}
|
|
830
|
+
SLA Violation`,style:{fontSize:18,color:e.impact.slaViolation?"#F87171":"#4ADE80",textAlign:"center",lineHeight:1.8}},animation:{effect:"zoomIn",durationMs:400,delayMs:300+n*100}}),n++);const i=e.impact.affectedServices.slice(0,6).map((r,s)=>({id:`impact-svc-${s}`,type:"text",position:{x:5+s%3*32,y:55+Math.floor(s/3)*10,width:30,height:8,unit:"percent"},content:{type:"text",text:`⚠️ ${r}`,style:{fontSize:16,color:"#F87171"}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+s*80}}));return{id:"slide-impact",title:"Impact Assessment",layout:"titleContent",background:{type:"solid",color:"#0F172A"},elements:[{id:"impact-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"💥 Impact Assessment",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t,{id:"impact-services-label",type:"text",position:{x:5,y:48,width:90,height:6,unit:"percent"},content:{type:"text",text:"Affected Services",style:{fontSize:22,fontWeight:600,color:"#94A3B8"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},...i,...e.impact.dataLoss?[{id:"impact-dataloss",type:"text",position:{x:5,y:80,width:90,height:10,unit:"percent"},content:{type:"text",text:`📊 Data Loss: ${e.impact.dataLoss}`,style:{fontSize:18,color:"#F87171"}},animation:{effect:"fadeIn",durationMs:400,delayMs:900}}]:[]],notes:"Quantify the impact. Be specific about affected users and services.",durationMs:6e4}}function ih(e){const t=e.rootCause.contributing.slice(0,4).map((n,i)=>({id:`contributing-${i}`,type:"text",position:{x:5,y:68+i*7,width:90,height:6,unit:"percent"},content:{type:"text",text:`• ${n}`,style:{fontSize:16,color:"#94A3B8",lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:800+i*100}}));return{id:"slide-rootcause",title:"Root Cause Analysis",layout:"titleContent",background:{type:"solid",color:"#0F172A"},elements:[{id:"rootcause-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"🔍 Root Cause Analysis",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"rootcause-immediate-label",type:"text",position:{x:5,y:18,width:90,height:5,unit:"percent"},content:{type:"text",text:"⚡ Immediate Cause",style:{fontSize:20,fontWeight:600,color:"#F87171"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"rootcause-immediate",type:"text",position:{x:5,y:25,width:90,height:12,unit:"percent"},content:{type:"text",text:e.rootCause.immediate,style:{fontSize:18,color:"#CBD5E1",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:350}},{id:"rootcause-underlying-label",type:"text",position:{x:5,y:40,width:90,height:5,unit:"percent"},content:{type:"text",text:"🎯 Underlying Root Cause",style:{fontSize:20,fontWeight:600,color:"#FBBF24"}},animation:{effect:"fadeIn",durationMs:400,delayMs:500}},{id:"rootcause-underlying",type:"text",position:{x:5,y:47,width:90,height:12,unit:"percent"},content:{type:"text",text:e.rootCause.underlying,style:{fontSize:18,color:"#CBD5E1",lineHeight:1.5}},animation:{effect:"fadeIn",durationMs:400,delayMs:650}},{id:"rootcause-contributing-label",type:"text",position:{x:5,y:62,width:90,height:5,unit:"percent"},content:{type:"text",text:"📋 Contributing Factors",style:{fontSize:20,fontWeight:600,color:"#60A5FA"}},animation:{effect:"fadeIn",durationMs:400,delayMs:750}},...t],notes:"Be blameless. Focus on systems and processes, not individuals.",durationMs:9e4}}function rh(e){const t=e.remediation.immediate.slice(0,4).map((i,r)=>{const s=i.status==="done"?"✅":i.status==="in-progress"?"🔄":"📋",l=i.status==="done"?"#4ADE80":i.status==="in-progress"?"#FBBF24":"#94A3B8";return{id:`remediation-immediate-${r}`,type:"text",position:{x:5,y:28+r*10,width:44,height:8,unit:"percent"},content:{type:"text",text:`${s} ${i.action}
|
|
831
|
+
Owner: ${i.owner}`,style:{fontSize:14,color:l,lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:400+r*100}}}),n=e.remediation.longTerm.slice(0,4).map((i,r)=>{const s=i.priority==="high"?"🔴":i.priority==="medium"?"🟡":"🟢";return{id:`remediation-longterm-${r}`,type:"text",position:{x:52,y:28+r*10,width:44,height:8,unit:"percent"},content:{type:"text",text:`${s} ${i.action}
|
|
832
|
+
Owner: ${i.owner}`,style:{fontSize:14,color:"#CBD5E1",lineHeight:1.4}},animation:{effect:"slideInRight",durationMs:300,delayMs:600+r*100}}});return{id:"slide-remediation",title:"Remediation",layout:"twoColumn",background:{type:"solid",color:"#0F172A"},elements:[{id:"remediation-title",type:"text",position:{x:5,y:5,width:90,height:10,unit:"percent"},content:{type:"text",text:"🔧 Remediation Actions",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},{id:"remediation-immediate-header",type:"text",position:{x:5,y:18,width:44,height:8,unit:"percent"},content:{type:"text",text:"⚡ Immediate Actions",style:{fontSize:22,fontWeight:600,color:"#F87171"}},animation:{effect:"fadeIn",durationMs:400,delayMs:200}},{id:"remediation-longterm-header",type:"text",position:{x:52,y:18,width:44,height:8,unit:"percent"},content:{type:"text",text:"📅 Long-term Actions",style:{fontSize:22,fontWeight:600,color:"#60A5FA"}},animation:{effect:"fadeIn",durationMs:400,delayMs:300}},...t,...n,{id:"remediation-legend",type:"text",position:{x:5,y:88,width:90,height:5,unit:"percent"},content:{type:"text",text:"✅ Done | 🔄 In Progress | 📋 Planned || 🔴 High | 🟡 Medium | 🟢 Low",style:{fontSize:12,color:"#64748B",textAlign:"center"}}}],notes:"Track action items. Ensure clear ownership and deadlines.",durationMs:6e4}}function oh(e){const t=e.lessons.slice(0,6).map((n,i)=>({id:`lesson-${i}`,type:"text",position:{x:5,y:25+i*12,width:90,height:10,unit:"percent"},content:{type:"text",text:`${i+1}. ${n}`,style:{fontSize:20,color:"#CBD5E1",lineHeight:1.5}},animation:{effect:"slideInRight",durationMs:400,delayMs:300+i*150}}));return{id:"slide-lessons",title:"Lessons Learned",layout:"titleContent",background:{type:"gradient",gradientStops:[{color:"#0F172A",position:0},{color:"#1E3A8A",position:100}],gradientDirection:180},elements:[{id:"lessons-title",type:"text",position:{x:5,y:5,width:90,height:12,unit:"percent"},content:{type:"text",text:"💡 Lessons Learned",style:{fontSize:44,fontWeight:700,color:"#F8FAFC"}},animation:{effect:"fadeIn",durationMs:500,delayMs:0}},...t],notes:"Key takeaways. Focus on actionable improvements.",durationMs:9e4}}function sh(e){return{version:"1.0",id:`incident-${e.incident.id}`,title:`Incident Report - ${e.incident.id}: ${e.incident.title}`,slideSize:{width:1920,height:1080,unit:"px"},slides:[eh(e),th(e),nh(e),ah(e),ih(e),rh(e),oh(e)],theme:{colors:{primary:"#3B82F6",secondary:"#F87171",background:"#0F172A",text:"#F8FAFC",accent:"#4ADE80"},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"},spacing:{base:16}},speakerSettings:{showTimer:!0,showNotes:!0,showNextSlide:!0},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),tags:["incident","postmortem","PIR"],templateId:"incident-report-v1"}}}function lh(){return{incident:{id:"INC-2024-0342",title:"Payment Service Outage",severity:"P1",status:"resolved",date:"March 15, 2024",duration:"2h 34m",commander:"Emily Chen"},summary:{whatHappened:"The payment processing service became unresponsive due to a database connection pool exhaustion, preventing customers from completing purchases.",impact:"Approximately 15,000 users were unable to complete transactions, resulting in an estimated revenue loss of $127,000.",resolution:"Database connection pool limits were increased, and a connection leak in the payment service was identified and fixed."},timeline:[{time:"14:23",event:"Automated alert: Payment service error rate >5%",type:"detection"},{time:"14:25",event:"On-call engineer acknowledges alert",type:"action"},{time:"14:32",event:"Incident declared, Emily Chen as IC",type:"escalation"},{time:"14:35",event:"Status page updated",type:"communication"},{time:"14:45",event:"Database team joined",type:"escalation"},{time:"15:12",event:"Root cause identified: connection pool exhaustion",type:"action"},{time:"15:28",event:"Emergency fix deployed",type:"action"},{time:"16:15",event:"Service fully recovered",type:"resolution"},{time:"16:57",event:"Incident marked resolved",type:"resolution"}],impact:{usersAffected:"~15,000",revenueImpact:"$127,000",slaViolation:!0,affectedServices:["Payment Gateway","Checkout Flow","Order Service","Mobile App"],regions:["North America","Europe"]},rootCause:{immediate:"Database connection pool was exhausted due to connections not being properly released after use.",underlying:"A recent code change introduced a connection leak in the retry logic of the payment service.",contributing:["Insufficient connection pool monitoring alerts","Code review did not catch the connection leak","No automated testing for connection handling","Documentation for database client usage was outdated"]},response:{detectionTime:"2 minutes",responseTime:"9 minutes",resolutionTime:"2h 34m",whatWorked:["Automated alerting triggered quickly","Clear incident commander assignment","Good cross-team communication"],whatDidntWork:["Initial diagnosis took too long","Runbooks were outdated","No quick rollback option available"]},remediation:{immediate:[{action:"Increase connection pool size",owner:"Platform Team",status:"done"},{action:"Fix connection leak in payment service",owner:"Payments Team",status:"done"},{action:"Add connection pool metrics to dashboard",owner:"SRE Team",status:"in-progress"}],longTerm:[{action:"Implement automated connection leak detection",owner:"Platform Team",priority:"high",dueDate:"Q2 2024"},{action:"Update code review checklist",owner:"Engineering Leads",priority:"medium",dueDate:"April 2024"},{action:"Improve runbooks for database issues",owner:"SRE Team",priority:"medium",dueDate:"April 2024"},{action:"Add integration tests for connection handling",owner:"Payments Team",priority:"high",dueDate:"Q2 2024"}]},lessons:["Connection pool monitoring should be a standard metric for all services","Code changes affecting database connections need explicit review","Having a quick rollback plan is critical for payment systems","Runbooks must be tested and updated regularly","Cross-team communication during incidents was effective and should be maintained"],team:[{name:"Emily Chen",role:"Incident Commander"},{name:"Marcus Johnson",role:"On-call Engineer"},{name:"Priya Patel",role:"Database Expert"},{name:"Alex Kim",role:"Payments Team Lead"}]}}function cr(e){return{name:e.name,primaryColor:e.colors.primary,secondaryColor:e.colors.secondary,accentColor:e.colors.accent,backgroundColor:e.colors.background,textColor:e.colors.text,headingColor:e.colors.heading,fontFamily:e.fonts.body,headingFontFamily:e.fonts.heading,codeFontFamily:e.fonts.code??"monospace",colors:e.colors.palette}}function ch(e,t){const n=cr(t),i=e.slides.map(r=>{let s=[...r.elements];if(t.logo&&!s.some(c=>c.id===`brand-logo-${t.id}`)){const c=uh(t.logo);s=[...s,{id:`brand-logo-${t.id}`,type:"image",position:c,content:{type:"image",src:t.logo.url,alt:`${t.name} logo`,objectFit:"contain"},opacity:.9}]}return{...r,elements:s}});return{...e,theme:n,slides:i,metadata:{...e.metadata,updatedAt:new Date().toISOString()}}}function dh(e,t){const n=e.slides.map(i=>({...i,elements:i.elements.filter(r=>r.id!==`brand-logo-${t}`)}));return{...e,slides:n,metadata:{...e.metadata,updatedAt:new Date().toISOString()}}}function uh(e){const t=e.width??8,n=e.height??5,i=e.position??"bottom-right",r={"top-left":{x:2,y:2},"top-right":{x:90,y:2},"bottom-left":{x:2,y:93},"bottom-right":{x:90,y:93}},{x:s,y:l}=r[i];return{x:s,y:l,width:t,height:n,unit:"percent"}}const ph={id:"nice2dev",name:"NiceToDev",colors:{primary:"#6366F1",secondary:"#8B5CF6",accent:"#06B6D4",background:"#0F172A",text:"#E2E8F0",heading:"#FFFFFF",palette:["#6366F1","#8B5CF6","#06B6D4","#10B981","#F59E0B"]},fonts:{heading:"Inter, sans-serif",body:"Inter, sans-serif",code:"JetBrains Mono, monospace"}},mh={id:"corporate",name:"Corporate Blue",colors:{primary:"#1A365D",secondary:"#2B6CB0",accent:"#ED8936",background:"#FFFFFF",text:"#2D3748",heading:"#1A365D",palette:["#1A365D","#2B6CB0","#4299E1","#ED8936","#48BB78"]},fonts:{heading:"Georgia, serif",body:"Arial, sans-serif",code:"Consolas, monospace"}},hh={id:"startup",name:"Startup Fresh",colors:{primary:"#7C3AED",secondary:"#EC4899",accent:"#34D399",background:"#FAFAFA",text:"#374151",heading:"#111827",palette:["#7C3AED","#EC4899","#34D399","#F59E0B","#3B82F6"]},fonts:{heading:"Poppins, sans-serif",body:"Open Sans, sans-serif",code:"Fira Code, monospace"}};class dr{constructor(t,n={}){this.currentAnimation=null,this.frameIndex=0,this.elapsed=0,this.playing=!1,this.loop=!0,this.speed=1,this.onComplete=null,this.onEvent=null,this.character=t,this.onComplete=n.onAnimationComplete||null,this.onEvent=n.onFrameEvent||null}getCharacter(){return this.character}getCurrentAnimation(){return this.currentAnimation}getCurrentFrameIndex(){return this.frameIndex}isPlaying(){return this.playing}play(t,n={}){const i=this.character.animations.find(r=>r.id===t);if(!i){console.warn(`Animation "${t}" not found on character "${this.character.id}"`);return}this.currentAnimation=i,this.frameIndex=n.startFrame??0,this.elapsed=0,this.playing=!0,this.loop=n.loop??i.loop,this.speed=n.speed??1,this.checkFrameEvent()}stop(){this.playing=!1}pause(){this.playing=!1}resume(){this.currentAnimation&&(this.playing=!0)}setSpeed(t){this.speed=t}update(t){if(!this.playing||!this.currentAnimation)return;const n=this.currentAnimation,i=n.frames[this.frameIndex];if(!i)return;const r=1e3/n.fps,s=i.duration??r;for(this.elapsed+=t*this.speed;this.elapsed>=s&&this.playing;){if(this.elapsed-=s,this.frameIndex++,this.frameIndex>=n.frames.length)if(this.loop)this.frameIndex=0;else{this.frameIndex=n.frames.length-1,this.playing=!1,this.onComplete&&this.onComplete(n.id);return}this.checkFrameEvent()}}checkFrameEvent(){if(!this.currentAnimation||!this.onEvent)return;const t=this.currentAnimation.frames[this.frameIndex];t!=null&&t.event&&this.onEvent(this.currentAnimation.id,t.event)}getCurrentFrame(){return this.currentAnimation?this.currentAnimation.frames[this.frameIndex]??null:null}getSpriteRect(){const t=this.getCurrentFrame();if(!t||!this.character.visual.atlas)return null;const i=this.character.visual.atlas.frames[t.frameId];return i?i.frame:null}}function fh(e,t,n,i,r){if(!r.visible||r.opacity===0||!i.getCurrentFrame())return;const l=i.getSpriteRect();if(!l)return;const{position:c,scale:d,rotation:u,opacity:y,flipX:f}=r,{anchor:p}=t;e.save(),e.translate(c.x,c.y),e.scale(f?-d:d,d),e.rotate(u*Math.PI/180),e.globalAlpha=y;const m=-p.x*l.w,w=-p.y*l.h;e.drawImage(n,l.x,l.y,l.w,l.h,m,w,l.w,l.h),e.restore()}function gh({character:e,state:t,spriteSheet:n,className:i,style:r}){const[s,l]=o.useState(null);if(o.useEffect(()=>{if(!e.visual.atlas)return;const k=e.animations.find(g=>g.id===t.currentAnimation);if(!k)return;const z=k.frames[t.animationFrame];if(!z)return;const $=e.visual.atlas.frames[z.frameId];l($||null)},[e,t.currentAnimation,t.animationFrame]),!t.visible||!s)return null;const{position:c,scale:d,rotation:u,opacity:y,flipX:f}=t,{frame:p}=s,m={position:"absolute",left:c.x,top:c.y,transform:`
|
|
833
|
+
translate(-${e.anchor.x*100}%, -${e.anchor.y*100}%)
|
|
834
|
+
scale(${f?-d:d}, ${d})
|
|
835
|
+
rotate(${u}deg)
|
|
836
|
+
`,opacity:y,transformOrigin:`${e.anchor.x*100}% ${e.anchor.y*100}%`,pointerEvents:"none",...r},w={width:p.w,height:p.h,backgroundImage:n?`url(${n.src})`:`url(${e.visual.spriteSheet})`,backgroundPosition:`-${p.x}px -${p.y}px`,backgroundRepeat:"no-repeat"};return o.createElement("div",{className:i,style:m},o.createElement("div",{style:w}))}class Xn{constructor(){this.characters=new Map,this.spriteSheets=new Map,this.loadingPromises=new Map}register(t){this.characters.set(t.id,t)}unregister(t){this.characters.delete(t),this.spriteSheets.delete(t)}get(t){return this.characters.get(t)}getAll(){return Array.from(this.characters.values())}async loadSpriteSheet(t){const n=this.spriteSheets.get(t);if(n)return n;const i=this.loadingPromises.get(t);if(i)return i;const r=this.characters.get(t);if(!(r!=null&&r.visual.spriteSheet))throw new Error(`Character ${t} has no sprite sheet`);const s=new Promise((l,c)=>{const d=new Image;d.onload=()=>{this.spriteSheets.set(t,d),this.loadingPromises.delete(t),l(d)},d.onerror=()=>{this.loadingPromises.delete(t),c(new Error(`Failed to load sprite sheet for ${t}`))},d.src=r.visual.spriteSheet});return this.loadingPromises.set(t,s),s}getSpriteSheet(t){return this.spriteSheets.get(t)}}function yh(e,t={}){const n=o.useRef(null),[i,r]=o.useState(0),[s,l]=o.useState(!1),[c,d]=o.useState(null);n.current||(n.current=new dr(e,{...t,onAnimationComplete:m=>{var w;(w=t.onAnimationComplete)==null||w.call(t,m),l(!1)},onFrameEvent:t.onFrameEvent})),o.useEffect(()=>{let m,w=performance.now();const k=z=>{const $=z-w;w=z,n.current&&(n.current.update($),r(n.current.getCurrentFrameIndex()),d(n.current.getCurrentFrame()),l(n.current.isPlaying())),m=requestAnimationFrame(k)};return m=requestAnimationFrame(k),()=>{cancelAnimationFrame(m)}},[]);const u=o.useCallback((m,w)=>{var k;(k=n.current)==null||k.play(m,w),l(!0)},[]),y=o.useCallback(()=>{var m;(m=n.current)==null||m.stop(),l(!1)},[]),f=o.useCallback(()=>{var m;(m=n.current)==null||m.pause(),l(!1)},[]),p=o.useCallback(()=>{var m;(m=n.current)==null||m.resume(),l(!0)},[]);return{controller:n.current,currentFrame:c,frameIndex:i,isPlaying:s,play:u,stop:y,pause:f,resume:p}}function bh(){const e=o.useRef(null);e.current||(e.current=new Xn);const t=o.useCallback(r=>{var s;(s=e.current)==null||s.register(r)},[]),n=o.useCallback(r=>{var s;return(s=e.current)==null?void 0:s.get(r)},[]),i=o.useCallback(r=>e.current.loadSpriteSheet(r),[]);return{registry:e.current,register:t,get:n,loadSpriteSheet:i}}function xh(e,t,n,i,r,s,l){const c={};for(let d=0;d<s;d++){const u=d%l,y=Math.floor(d/l);c[`frame_${d}`]={frame:{x:u*i,y:y*r,w:i,h:r},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:i,h:r},sourceSize:{w:i,h:r}}}return{id:e,name:t,type:"sprite",visual:{type:"sprite",spriteSheet:n,atlas:{frames:c,meta:{image:n,size:{w:l*i,h:Math.ceil(s/l)*r},scale:1}},width:i,height:r},animations:[],expressions:[],defaultScale:1,anchor:{x:.5,y:1}}}function vh(e,t,n,i,r,s,l="custom"){const c=i.map(y=>({frameId:y})),d=c.length/r*1e3,u={id:t,name:n,category:l,frames:c,fps:r,loop:s,duration:d};return{...e,animations:[...e.animations,u]}}function wh(e,t,n,i,r,s){const l={id:t,name:n,emotion:i,frameId:r,overlay:s};return{...e,expressions:[...e.expressions,l]}}const kh=o.createContext(null);function Sh(){const e=o.useContext(kh);if(!e)throw new Error("usePuppetStage must be used within PuppetStageProvider");return e}function ur({background:e,width:t,height:n}){const i={position:"absolute",top:0,left:0,width:t,height:n,overflow:"hidden"};switch(e.type){case"solid":return o.createElement("div",{style:{...i,backgroundColor:e.color||"#000000"}});case"gradient":{const r=e.gradient;if(!r)return o.createElement("div",{style:{...i,backgroundColor:"#000000"}});const s=r.stops.map(c=>`${c.color} ${c.position*100}%`).join(", "),l=r.type==="radial"?`radial-gradient(circle, ${s})`:`linear-gradient(${r.angle||180}deg, ${s})`;return o.createElement("div",{style:{...i,background:l}})}case"image":return o.createElement("div",{style:{...i,backgroundImage:`url(${e.image})`,backgroundSize:"cover",backgroundPosition:"center"}});case"video":return o.createElement("div",{style:i},o.createElement("video",{src:e.video,autoPlay:!0,loop:!0,muted:!0,style:{width:"100%",height:"100%",objectFit:"cover"}}));case"parallax":{const r=e.parallaxLayers||[];return o.createElement("div",{style:i},r.map((s,l)=>{var c,d;return o.createElement("div",{key:l,style:{position:"absolute",top:((c=s.offset)==null?void 0:c.y)||0,left:((d=s.offset)==null?void 0:d.x)||0,width:"100%",height:"100%",backgroundImage:`url(${s.image})`,backgroundRepeat:s.repeat?"repeat-x":"no-repeat",backgroundSize:"auto 100%"}})}))}default:return o.createElement("div",{style:{...i,backgroundColor:"#000000"}})}}function pr({effects:e,width:t,height:n}){return e.length===0?null:o.createElement(o.Fragment,null,e.map(i=>{const{effectId:r,type:s,params:l,progress:c}=i;switch(s){case"flash":return o.createElement("div",{key:r,style:{position:"absolute",top:0,left:0,width:t,height:n,backgroundColor:l.color||"#ffffff",opacity:1-c,pointerEvents:"none"}});case"vignette":return o.createElement("div",{key:r,style:{position:"absolute",top:0,left:0,width:t,height:n,background:`radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,${l.intensity||.5}) 100%)`,pointerEvents:"none"}});case"colorFilter":return o.createElement("div",{key:r,style:{position:"absolute",top:0,left:0,width:t,height:n,backgroundColor:l.color,opacity:l.intensity||.3,mixBlendMode:l.blendMode||"multiply",pointerEvents:"none"}});case"fog":return o.createElement("div",{key:r,style:{position:"absolute",top:0,left:0,width:t,height:n,background:`linear-gradient(to top, rgba(200,200,200,${l.density||.5}) 0%, transparent 70%)`,pointerEvents:"none"}});default:return null}}))}function mr({document:e,scene:t,characterStates:n,camera:i,activeEffects:r,characterRegistry:s,className:l,style:c,onCharacterClick:d}){const u=o.useRef(null),[y,f]=o.useState({width:0,height:0}),p=o.useMemo(()=>{if(y.width===0||y.height===0)return 1;const $=y.width/e.stageSize.width,g=y.height/e.stageSize.height;return Math.min($,g)},[y,e.stageSize]);o.useEffect(()=>{const $=u.current;if(!$)return;const g=new ResizeObserver(v=>{const N=v[0];N&&f({width:N.contentRect.width,height:N.contentRect.height})});return g.observe($),()=>g.disconnect()},[]);const m=e.stageSize.width,w=e.stageSize.height,k=o.useMemo(()=>{const{position:$,zoom:g,rotation:v}=i,N=m/2,j=w/2,I=N-$.x,D=j-$.y;return`translate(${I}px, ${D}px) scale(${g}) rotate(${v}deg)`},[i,m,w]),z=o.useMemo(()=>{const $=[];return t.cast.forEach(g=>{$.push({type:"character",data:g,zIndex:g.zIndex})}),t.scenery.forEach(g=>{$.push({type:"prop",data:g,zIndex:g.zIndex})}),$.sort((g,v)=>g.zIndex-v.zIndex)},[t.cast,t.scenery]);return o.createElement("div",{ref:u,className:l,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"#000000",...c}},o.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",width:m,height:w,transform:`translate(-50%, -50%) scale(${p})`,transformOrigin:"center center"}},o.createElement("div",{style:{position:"absolute",top:0,left:0,width:m,height:w,transform:k,transformOrigin:"center center"}},o.createElement(ur,{background:t.background,width:m,height:w}),z.map(({type:$,data:g})=>{if($==="character"){const v=g,N=n.get(v.instanceId);if(!N||!N.visible)return null;const j=e.characters.find(I=>I.id===v.characterId);return j?o.createElement(Ch,{key:v.instanceId,characterDef:j,state:N,onClick:d?()=>d(v.instanceId):void 0}):null}else{const v=g,N=e.props.find(j=>j.id===v.propId);return N?o.createElement(_h,{key:v.instanceId,propDef:N,state:v}):null}}),o.createElement(pr,{effects:r,width:m,height:w}))))}function Ch({characterDef:e,state:t,onClick:n}){const{position:i,scale:r,rotation:s,opacity:l,flipX:c,currentAnimation:d,animationFrame:u}=t,y=o.useMemo(()=>{const w=e.animations.find(z=>z.id===d);if(!w)return null;const k=w.frames[u];return!k||!e.visual.atlas?null:e.visual.atlas.frames[k.frameId]},[e,d,u]);if(!y)return null;const{frame:f}=y,p={position:"absolute",left:i.x,top:i.y,transform:`
|
|
837
|
+
translate(-${e.anchor.x*100}%, -${e.anchor.y*100}%)
|
|
838
|
+
scale(${c?-r:r}, ${r})
|
|
839
|
+
rotate(${s}deg)
|
|
840
|
+
`,opacity:l,transformOrigin:`${e.anchor.x*100}% ${e.anchor.y*100}%`,cursor:n?"pointer":"default"},m={width:f.w,height:f.h,backgroundImage:`url(${e.visual.spriteSheet})`,backgroundPosition:`-${f.x}px -${f.y}px`,backgroundRepeat:"no-repeat"};return o.createElement("div",{style:p,onClick:n},o.createElement("div",{style:m}))}function _h({propDef:e,state:t}){const{position:n,scale:i,rotation:r,opacity:s}=t,l={position:"absolute",left:n.x,top:n.y,transform:`
|
|
841
|
+
translate(-${e.anchor.x*100}%, -${e.anchor.y*100}%)
|
|
842
|
+
scale(${i})
|
|
843
|
+
rotate(${r}deg)
|
|
844
|
+
`,opacity:s,transformOrigin:`${e.anchor.x*100}% ${e.anchor.y*100}%`};return e.type==="image"||e.type==="sprite"?o.createElement("img",{src:e.asset,style:{...l,width:e.width,height:e.height,pointerEvents:"none"},alt:e.name}):e.type==="vector"?o.createElement("div",{style:l,dangerouslySetInnerHTML:{__html:e.asset}}):e.type==="text"?o.createElement("div",{style:l},e.asset):o.createElement("div",{style:l})}function hr({text:e,speakerName:t,style:n={},targetPosition:i,visible:r,typewriterProgress:s=1}){if(!r)return null;const{position:l="bottom",backgroundColor:c="rgba(0,0,0,0.85)",textColor:d="#ffffff",fontSize:u=18,maxWidth:y=600}=n,f=e.slice(0,Math.floor(e.length*s)),p={position:"absolute",maxWidth:y,padding:"16px 24px",backgroundColor:c,color:d,fontSize:u,borderRadius:12,boxShadow:"0 4px 20px rgba(0,0,0,0.3)",zIndex:1e3};switch(l){case"bottom":Object.assign(p,{bottom:20,left:"50%",transform:"translateX(-50%)",width:"90%"});break;case"top":Object.assign(p,{top:20,left:"50%",transform:"translateX(-50%)",width:"90%"});break;case"center":Object.assign(p,{top:"50%",left:"50%",transform:"translate(-50%, -50%)"});break;case"bubble":i&&Object.assign(p,{left:i.x,bottom:i.y+20,transform:"translateX(-50%)"});break}return o.createElement("div",{style:p},t&&o.createElement("div",{style:{fontWeight:"bold",marginBottom:8,color:"#60a5fa"}},t),o.createElement("div",null,f))}function jh(e,t,n){const[i,r]=o.useState({offsetX:0,offsetY:0}),s=o.useRef(null);return o.useEffect(()=>{if(!n){r({offsetX:0,offsetY:0});return}s.current=performance.now();let l;const c=d=>{const u=d-s.current;if(u>=t){r({offsetX:0,offsetY:0});return}const f=1-u/t,p=(Math.random()-.5)*2*e*f,m=(Math.random()-.5)*2*e*f;r({offsetX:p,offsetY:m}),l=requestAnimationFrame(c)};return l=requestAnimationFrame(c),()=>{cancelAnimationFrame(l)}},[n,e,t]),i}const vt={linear:e=>e,easeIn:e=>e*e,easeOut:e=>e*(2-e),easeInOut:e=>e<.5?2*e*e:-1+(4-2*e)*e,easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e*e:-1+(4-2*e)*e,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,easeInElastic:e=>e===0||e===1?e:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI),easeOutElastic:e=>e===0||e===1?e:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1,easeInOutElastic:e=>e===0||e===1?e:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1),easeInBounce:e=>1-vt.easeOutBounce(1-e),easeOutBounce:e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,easeInOutBounce:e=>e<.5?vt.easeInBounce(e*2)*.5:vt.easeOutBounce(e*2-1)*.5+.5,step:e=>Math.round(e)};function fr(e){return vt[e]||vt.linear}function nt(e,t,n){return e+(t-e)*n}function mn(e,t,n){return{x:nt(e.x,t.x,n),y:nt(e.y,t.y,n)}}class gr{constructor(t){this.currentTime=0,this.scene=t.scene,this.characterDefs=new Map(t.characterDefs.map(n=>[n.id,n])),this.typewriterSpeed=t.typewriterSpeed||30,this.onAudioCommand=t.onAudioCommand}evaluate(t){this.currentTime=t;const n=this.evaluateAllCharacters(t),i=this.evaluateCamera(t),r=this.evaluateDialogue(t),s=this.evaluateEffects(t),l=this.evaluateAudio(t);return{characterStates:n,camera:i,activeDialogue:r,activeEffects:s,audioCommands:l}}getDuration(){return this.scene.duration}findSurroundingKeyframes(t,n){const i=t.keyframes;if(i.length===0)return{prev:null,next:null,progress:0};let r=-1;for(let p=0;p<i.length&&i[p].time<=n;p++)r=p;if(r===-1)return{prev:null,next:i[0],progress:0};const s=i[r],l=i[r+1]||null;if(!l)return{prev:s,next:null,progress:1};const c=l.time-s.time,d=n-s.time,u=c>0?d/c:0,f=fr(s.easing||"linear")(Math.min(1,Math.max(0,u)));return{prev:s,next:l,progress:f}}evaluateAllCharacters(t){const n=new Map;for(const i of this.scene.cast){const r=this.evaluateCharacter(i.instanceId,t);n.set(i.instanceId,r)}return n}evaluateCharacter(t,n){var l;const i=this.scene.cast.find(c=>c.instanceId===t);if(!i)return this.createDefaultCharacterState();const r=this.characterDefs.get(i.characterId);let s={instanceId:t,characterId:i.characterId,position:{...i.position},scale:i.scale,rotation:i.rotation,opacity:i.opacity??1,flipX:i.flipX??!1,visible:!0,currentAnimation:i.initialAnimation||(((l=r==null?void 0:r.animations[0])==null?void 0:l.id)??""),animationFrame:0,animationStartTime:0,currentExpression:i.initialExpression??""};for(const c of this.scene.timeline)if(c.targetId===t)switch(c.type){case"animation":s=this.applyAnimationTrack(c,s,n);break;case"transform":s=this.applyTransformTrack(c,s,n);break;case"expression":s=this.applyExpressionTrack(c,s,n);break}if(r&&s.currentAnimation){const c=r.animations.find(d=>d.id===s.currentAnimation);if(c){const d=(n-s.animationStartTime)%(c.duration||c.frames.length/c.fps*1e3),u=Math.floor(d/1e3*c.fps)%c.frames.length;s.animationFrame=u}}return s}createDefaultCharacterState(){return{instanceId:"",characterId:"",position:{x:0,y:0},scale:1,rotation:0,opacity:1,flipX:!1,visible:!1,currentAnimation:"",animationFrame:0,animationStartTime:0,currentExpression:""}}applyAnimationTrack(t,n,i){const{prev:r}=this.findSurroundingKeyframes(t,i);if(r){const s=r.value;return{...n,currentAnimation:s.animationId,animationStartTime:r.time}}return n}applyTransformTrack(t,n,i){const{prev:r,next:s,progress:l}=this.findSurroundingKeyframes(t,i);if(!r)return n;const c=r.value,d=s?s.value:null;return d?{...n,position:c.position&&d.position?mn(c.position,d.position,l):c.position??n.position,scale:c.scale!==void 0&&d.scale!==void 0?nt(c.scale,d.scale,l):c.scale??n.scale,rotation:c.rotation!==void 0&&d.rotation!==void 0?nt(c.rotation,d.rotation,l):c.rotation??n.rotation,opacity:c.opacity!==void 0&&d.opacity!==void 0?nt(c.opacity,d.opacity,l):c.opacity??n.opacity}:{...n,position:c.position??n.position,scale:c.scale??n.scale,rotation:c.rotation??n.rotation,opacity:c.opacity??n.opacity}}applyExpressionTrack(t,n,i){const{prev:r}=this.findSurroundingKeyframes(t,i);if(r){const s=r.value;return{...n,currentExpression:s.expressionId}}return n}evaluateCamera(t){let n=this.scene.camera?{...this.scene.camera}:{position:{x:640,y:360},zoom:1,rotation:0};for(const i of this.scene.timeline){if(i.type!=="camera")continue;const{prev:r,next:s,progress:l}=this.findSurroundingKeyframes(i,t);if(!r)continue;const c=r.value,d=s?s.value:null;d?n={position:c.position&&d.position?mn(c.position,d.position,l):c.position??n.position,zoom:c.zoom!==void 0&&d.zoom!==void 0?nt(c.zoom,d.zoom,l):c.zoom??n.zoom,rotation:c.rotation!==void 0&&d.rotation!==void 0?nt(c.rotation,d.rotation,l):c.rotation??n.rotation}:n={position:c.position??n.position,zoom:c.zoom??n.zoom,rotation:c.rotation??n.rotation}}return n}evaluateDialogue(t){for(const n of this.scene.timeline){if(n.type!=="dialogue")continue;const{prev:i}=this.findSurroundingKeyframes(n,t);if(i){const r=i.value,s=i.time+(i.duration??0);if(t>=i.time&&t<s){const l=t-i.time,c=r.text.length/this.typewriterSpeed*1e3,d=Math.min(1,l/c);return{text:r.text,speakerId:n.targetId,typewriterProgress:d}}}}return null}evaluateEffects(t){const n=[];for(const i of this.scene.timeline)if(i.type==="effect")for(const r of i.keyframes){const s=r.value,l=r.time+(r.duration??0);if(t>=r.time&&t<l){const c=r.duration?(t-r.time)/r.duration:1;n.push({effectId:i.id+"_"+r.time,type:s.effectType,params:s.params,startTime:r.time,duration:r.duration??0,progress:c})}}return n}evaluateAudio(t){const n=[];for(const i of this.scene.timeline)if(i.type==="audio")for(const r of i.keyframes){const s=r.value;Math.abs(t-r.time)<50&&n.push({trackId:i.targetId,command:s.action,time:t})}return n}}class Nh{constructor(t,n,i){this.track={id:i||`track_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,type:t,targetId:n,keyframes:[]}}addAnimationKeyframe(t,n,i){return this.track.keyframes.push({time:t,easing:(i==null?void 0:i.easing)??"linear",value:{type:"animation",animationId:n,speed:(i==null?void 0:i.speed)??1}}),this}addTransformKeyframe(t,n,i){return this.track.keyframes.push({time:t,easing:i??"easeInOut",value:{type:"transform",...n}}),this}addExpressionKeyframe(t,n,i){return this.track.keyframes.push({time:t,easing:(i==null?void 0:i.easing)??"easeOut",duration:(i==null?void 0:i.transition)??200,value:{type:"expression",expressionId:n}}),this}addDialogueKeyframe(t,n,i,r){return this.track.keyframes.push({time:t,duration:i,easing:(r==null?void 0:r.easing)??"linear",value:{type:"dialogue",text:n,audioClip:r==null?void 0:r.voiceOver,style:r==null?void 0:r.style}}),this}addCameraKeyframe(t,n,i){return this.track.keyframes.push({time:t,easing:i??"easeInOut",value:{type:"camera",...n}}),this}addEffectKeyframe(t,n,i,r,s){return this.track.keyframes.push({time:t,duration:i,easing:s??"linear",value:{type:"effect",effectType:n,params:r??{}}}),this}build(){return this.track.keyframes.sort((t,n)=>t.time-n.time),this.track}}class Eh{constructor(t,n,i){this.scene={id:t,title:n,duration:i,background:{type:"solid",color:"#000000"},cast:[],scenery:[],timeline:[],camera:{position:{x:640,y:360},zoom:1,rotation:0}}}setBackground(t){return this.scene.background=t,this}setCamera(t){return this.scene.camera=t,this}setTransition(t){return this.scene.transition=t,this}addCastMember(t,n,i){return this.scene.cast.push({instanceId:t,characterId:n,position:i.position??{x:640,y:360},scale:i.scale??1,rotation:i.rotation??0,zIndex:i.zIndex??this.scene.cast.length,initialAnimation:i.initialAnimation,initialExpression:i.initialExpression,opacity:i.opacity??1,flipX:i.flipX??!1}),this}addProp(t,n,i){return this.scene.scenery.push({instanceId:t,propId:n,position:i.position??{x:640,y:360},scale:i.scale??1,rotation:i.rotation??0,zIndex:i.zIndex??this.scene.scenery.length,opacity:i.opacity??1}),this}addTrack(t){return this.scene.timeline.push(t),this}addAudio(t){return this.scene.audio=t,this}build(){return this.scene}}function Mh(e){return JSON.parse(JSON.stringify(e))}function yr(e){if(e.keyframes.length===0)return 0;const t=e.keyframes[e.keyframes.length-1];return"duration"in t&&typeof t.duration=="number"?t.time+t.duration:t.time}function zh(e){let t=0;for(const n of e.timeline){const i=yr(n);i>t&&(t=i)}return Math.max(e.duration,t)}function $h(e,t){return Math.floor(e/1e3*t)}function Ah(e,t){return e/t*1e3}function Fh(e){const t=Math.floor(e/1e3),n=Math.floor(t/60),i=t%60,r=Math.floor(e%1e3/10);return`${n.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}.${r.toString().padStart(2,"0")}`}function Ih(e){const t=e.match(/^(\d+):(\d{2})(?:\.(\d{2}))?$/);if(!t)return 0;const n=parseInt(t[1],10),i=parseInt(t[2],10),r=t[3]?parseInt(t[3],10)*10:0;return(n*60+i)*1e3+r}const br=o.createContext(null);function Dh(){const e=o.useContext(br);if(!e)throw new Error("usePuppetPlayer must be used within PuppetPlayerProvider");return e}class Th{constructor(){this.audioElements=new Map,this.volume=1,this.muted=!1}preloadAudio(t,n){return new Promise((i,r)=>{const s=new Audio(n);s.preload="auto",s.volume=this.volume,s.muted=this.muted,s.addEventListener("canplaythrough",()=>i(),{once:!0}),s.addEventListener("error",r,{once:!0}),this.audioElements.set(t,s)})}play(t,n){const i=this.audioElements.get(t);i&&(n!==void 0&&(i.currentTime=n/1e3),i.play().catch(()=>{}))}pause(t){const n=this.audioElements.get(t);n&&n.pause()}stop(t){const n=this.audioElements.get(t);n&&(n.pause(),n.currentTime=0)}stopAll(){this.audioElements.forEach(t=>{t.pause(),t.currentTime=0})}setVolume(t){this.volume=Math.max(0,Math.min(1,t)),this.audioElements.forEach(n=>{n.volume=this.volume})}setMuted(t){this.muted=t,this.audioElements.forEach(n=>{n.muted=t})}dispose(){this.stopAll(),this.audioElements.clear()}}function xr(e){const{document:t,autoPlay:n=!1,loop:i=!1,initialVolume:r=1,initialSpeed:s=1}=e,[l,c]=o.useState({isPlaying:!1,isPaused:!1,currentSceneIndex:0,currentTime:0,totalDuration:0,playbackSpeed:s,volume:r,isMuted:!1,characterStates:new Map,activeEffects:[],loop:i}),[d,u]=o.useState(null),y=o.useRef(null),f=o.useRef(0),p=o.useRef(new Th),m=o.useRef(null),w=o.useRef(new Xn),k=o.useMemo(()=>t.scenes.reduce((S,x)=>S+x.duration,0),[t.scenes]),z=o.useMemo(()=>t.scenes[l.currentSceneIndex]||null,[t.scenes,l.currentSceneIndex]);o.useEffect(()=>{z&&(m.current=new gr({scene:z,characterDefs:t.characters,onAudioCommand:(S,x,P)=>{const A=p.current;switch(x){case"play":A.play(S,P);break;case"pause":A.pause(S);break;case"stop":A.stop(S);break}}}))},[z,t.characters]),o.useEffect(()=>{var x;const S=p.current;return(x=t.audioTracks)==null||x.forEach(P=>{P.src&&S.preloadAudio(P.id,P.src).catch(()=>{})}),()=>{S.dispose()}},[t.audioTracks]);const $=o.useCallback(S=>{if(!m.current)return;const x=S-f.current;f.current=S,c(P=>{var h,C,_;if(!P.isPlaying||P.isPaused)return P;const A=P.currentTime+x*P.playbackSpeed,E=(z==null?void 0:z.duration)??0;if(A>=E){const F=P.currentSceneIndex+1;return F>=t.scenes.length?P.loop?((h=e.onSceneChange)==null||h.call(e,0,t.scenes[0]),{...P,currentSceneIndex:0,currentTime:0}):((C=e.onEnd)==null||C.call(e),{...P,isPlaying:!1,isPaused:!1,currentTime:E}):((_=e.onSceneChange)==null||_.call(e,F,t.scenes[F]),{...P,currentSceneIndex:F,currentTime:0})}return{...P,currentTime:A}}),y.current=requestAnimationFrame($)},[z,t.scenes,e]);o.useEffect(()=>(l.isPlaying&&!l.isPaused?(f.current=performance.now(),y.current=requestAnimationFrame($)):y.current&&cancelAnimationFrame(y.current),()=>{y.current&&cancelAnimationFrame(y.current)}),[l.isPlaying,l.isPaused,$]),o.useEffect(()=>{if(m.current){const S=m.current.evaluate(l.currentTime);u(S),S.audioCommands.forEach(x=>{const P=p.current;switch(x.command){case"play":P.play(x.trackId);break;case"pause":P.pause(x.trackId);break;case"stop":P.stop(x.trackId);break}}),c(x=>({...x,characterStates:S.characterStates,activeEffects:S.activeEffects}))}},[l.currentTime]),o.useEffect(()=>{n&&c(S=>({...S,isPlaying:!0}))},[n]);const g=o.useCallback(()=>{c(S=>({...S,isPlaying:!0,isPaused:!1}))},[]),v=o.useCallback(()=>{c(S=>({...S,isPaused:!0})),p.current.stopAll()},[]),N=o.useCallback(()=>{c(S=>({...S,isPlaying:!1,isPaused:!1,currentTime:0,currentSceneIndex:0})),p.current.stopAll()},[]),j=o.useCallback(S=>{c(x=>({...x,currentTime:Math.max(0,Math.min(S,(z==null?void 0:z.duration)??0))}))},[z]),I=o.useCallback(S=>{var x;S>=0&&S<t.scenes.length&&(p.current.stopAll(),c(P=>({...P,currentSceneIndex:S,currentTime:0})),(x=e.onSceneChange)==null||x.call(e,S,t.scenes[S]))},[t.scenes,e]),D=o.useCallback(S=>{c(x=>({...x,playbackSpeed:Math.max(.25,Math.min(4,S))}))},[]),b=o.useCallback(S=>{const x=Math.max(0,Math.min(1,S));p.current.setVolume(x),c(P=>({...P,volume:x}))},[]),T=o.useCallback(()=>{c(S=>{const x=!S.isMuted;return p.current.setMuted(x),{...S,isMuted:x}})},[]),R=o.useCallback(()=>{I(l.currentSceneIndex+1)},[l.currentSceneIndex,I]),L=o.useCallback(()=>{I(l.currentSceneIndex-1)},[l.currentSceneIndex,I]),M=o.useCallback(S=>{c(x=>({...x,loop:S}))},[]);return{playerState:{...l,totalDuration:k},timelineState:d,characterRegistry:w.current,play:g,pause:v,stop:N,seek:j,seekToScene:I,setPlaybackSpeed:D,setVolume:b,toggleMute:T,nextScene:R,previousScene:L,setLoop:M}}function vr({document:e,autoPlay:t=!1,loop:n=!1,showControls:i=!0,className:r,style:s,onSceneChange:l,onEnd:c}){var D;const{playerState:d,timelineState:u,characterRegistry:y,play:f,pause:p,stop:m,seek:w,seekToScene:k,setPlaybackSpeed:z,setVolume:$,toggleMute:g,nextScene:v,previousScene:N,setLoop:j}=xr({document:e,autoPlay:t,loop:n,onSceneChange:l,onEnd:c}),I=e.scenes[d.currentSceneIndex];return I?o.createElement(br.Provider,{value:{document:e,playerState:d,play:f,pause:p,stop:m,seek:w,seekToScene:k,setPlaybackSpeed:z,setVolume:$,toggleMute:g,nextScene:v,previousScene:N,setLoop:j}},o.createElement("div",{className:r,style:{display:"flex",flexDirection:"column",width:"100%",height:"100%",backgroundColor:"#000",...s}},o.createElement("div",{style:{flex:1,position:"relative"}},o.createElement(mr,{document:e,scene:I,characterStates:d.characterStates,camera:(u==null?void 0:u.camera)??I.camera??{position:{x:640,y:360},zoom:1,rotation:0},activeEffects:d.activeEffects,characterRegistry:y}),(u==null?void 0:u.activeDialogue)&&o.createElement(hr,{text:u.activeDialogue.text,speakerName:(D=e.characters.find(b=>{var T;return b.id===((T=u.activeDialogue)==null?void 0:T.speakerId)}))==null?void 0:D.name,visible:!0,typewriterProgress:u.activeDialogue.typewriterProgress})),i&&o.createElement(Rh,{playerState:d,currentScene:I,totalScenes:e.scenes.length,onPlay:f,onPause:p,onStop:m,onSeek:w,onPreviousScene:N,onNextScene:v,onSpeedChange:z,onVolumeChange:$,onToggleMute:g,onToggleLoop:()=>j(!d.loop)}))):o.createElement("div",{className:r,style:s},"No scenes")}function Rh({playerState:e,currentScene:t,totalScenes:n,onPlay:i,onPause:r,onStop:s,onSeek:l,onPreviousScene:c,onNextScene:d,onSpeedChange:u,onVolumeChange:y,onToggleMute:f,onToggleLoop:p}){const m=g=>{const v=Math.floor(g/1e3),N=Math.floor(v/60),j=v%60;return`${N}:${j.toString().padStart(2,"0")}`},w=t.duration>0?e.currentTime/t.duration*100:0,k={display:"flex",alignItems:"center",gap:8,padding:"12px 16px",backgroundColor:"rgba(0,0,0,0.9)",color:"#fff"},z={background:"none",border:"none",color:"#fff",cursor:"pointer",padding:"8px",fontSize:16,opacity:.9},$={flex:1,height:4,backgroundColor:"#444",borderRadius:2,cursor:"pointer"};return o.createElement("div",{style:k},o.createElement("button",{style:z,onClick:e.isPlaying&&!e.isPaused?r:i,title:e.isPlaying&&!e.isPaused?"Pause":"Play"},e.isPlaying&&!e.isPaused?"⏸":"▶"),o.createElement("button",{style:z,onClick:s,title:"Stop"},"⏹"),o.createElement("button",{style:{...z,opacity:e.currentSceneIndex>0?.9:.3},onClick:c,disabled:e.currentSceneIndex<=0,title:"Previous Scene"},"⏮"),o.createElement("button",{style:{...z,opacity:e.currentSceneIndex<n-1?.9:.3},onClick:d,disabled:e.currentSceneIndex>=n-1,title:"Next Scene"},"⏭"),o.createElement("span",{style:{fontSize:12,fontFamily:"monospace"}},`${m(e.currentTime)} / ${m(t.duration)}`),o.createElement("div",{style:$,onClick:g=>{const v=g.currentTarget.getBoundingClientRect(),j=(g.clientX-v.left)/v.width;l(j*t.duration)}},o.createElement("div",{style:{width:`${w}%`,height:"100%",backgroundColor:"#60a5fa",borderRadius:2}})),o.createElement("select",{value:e.playbackSpeed,onChange:g=>u(parseFloat(g.target.value)),style:{background:"#333",color:"#fff",border:"none",padding:"4px 8px",borderRadius:4,fontSize:12}},o.createElement("option",{value:.25},"0.25x"),o.createElement("option",{value:.5},"0.5x"),o.createElement("option",{value:1},"1x"),o.createElement("option",{value:1.5},"1.5x"),o.createElement("option",{value:2},"2x")),o.createElement("button",{style:z,onClick:f,title:e.isMuted?"Unmute":"Mute"},e.isMuted?"🔇":"🔊"),o.createElement("input",{type:"range",min:0,max:1,step:.1,value:e.volume,onChange:g=>y(parseFloat(g.target.value)),style:{width:60}}),o.createElement("button",{style:{...z,color:e.loop?"#60a5fa":"#fff"},onClick:p,title:"Loop"},"🔁"),o.createElement("span",{style:{fontSize:12}},`Scene ${e.currentSceneIndex+1}/${n}`))}function Ph({document:e,width:t=320,height:n=240,autoPlay:i=!1,className:r,style:s}){return o.createElement(vr,{document:e,autoPlay:i,showControls:!1,className:r,style:{width:t,height:n,borderRadius:8,overflow:"hidden",...s}})}function wr(e,t,n){var l,c,d,u;const i=t.assets.find(y=>y.id===e.assetId),r=[];if(e.animations)for(const[y,f]of Object.entries(e.animations)){const p=f.frames.map((m,w)=>({frameId:`${y}_frame_${w}`,duration:m.duration||1e3/f.fps,offset:{x:0,y:0}}));r.push({id:`anim_${y}`,name:y,category:_r(y),frames:p,fps:f.fps,loop:f.loop,duration:p.reduce((m,w)=>m+(w.duration??0),0)})}const s={};if(e.animations)for(const[y,f]of Object.entries(e.animations))f.frames.forEach((p,m)=>{s[`${y}_frame_${m}`]={frame:{x:p.srcRect.x,y:p.srcRect.y,w:p.srcRect.width,h:p.srcRect.height},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:p.srcRect.width,h:p.srcRect.height},sourceSize:{w:p.srcRect.width,h:p.srcRect.height}}});return{id:`char_${e.id}`,name:e.name,type:"sprite",visual:{type:"sprite",spriteSheet:(i==null?void 0:i.path)||"",atlas:{frames:s,meta:{image:(i==null?void 0:i.path)||"",size:{w:((l=i==null?void 0:i.metadata)==null?void 0:l.width)||e.width,h:((c=i==null?void 0:i.metadata)==null?void 0:c.height)||e.height},scale:1}},width:((d=i==null?void 0:i.metadata)==null?void 0:d.width)||e.width||100,height:((u=i==null?void 0:i.metadata)==null?void 0:u.height)||e.height||100},anchor:e.anchor||{x:.5,y:1},animations:r,expressions:[],defaultScale:1}}function kr(e,t,n){var u,y,f,p;const{sprite:i,animator:r,transform:s}=e.components;if(!i)return null;const l=t.assets.find(m=>m.id===i.assetId),c=[];if(r!=null&&r.animations)for(const[m,w]of Object.entries(r.animations)){const k=w.frames.map((z,$)=>({frameId:`${m}_frame_${$}`,duration:z.duration||1e3/w.fps,offset:{x:0,y:0}}));c.push({id:`anim_${m}`,name:m,category:_r(m),frames:k,fps:w.fps,loop:w.loop,duration:k.reduce((z,$)=>z+($.duration??0),0)})}const d={};if(r!=null&&r.animations)for(const[m,w]of Object.entries(r.animations))w.frames.forEach((k,z)=>{d[`${m}_frame_${z}`]={frame:{x:k.srcRect.x,y:k.srcRect.y,w:k.srcRect.width,h:k.srcRect.height},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:k.srcRect.width,h:k.srcRect.height},sourceSize:{w:k.srcRect.width,h:k.srcRect.height}}});return{id:`char_${e.id}`,name:e.name,type:"sprite",visual:{type:"sprite",spriteSheet:(l==null?void 0:l.path)||"",atlas:{frames:d,meta:{image:(l==null?void 0:l.path)||"",size:{w:((u=l==null?void 0:l.metadata)==null?void 0:u.width)||i.width,h:((y=l==null?void 0:l.metadata)==null?void 0:y.height)||i.height},scale:1}},width:((f=l==null?void 0:l.metadata)==null?void 0:f.width)||i.width||100,height:((p=l==null?void 0:l.metadata)==null?void 0:p.height)||i.height||100},anchor:i.anchor||{x:.5,y:1},animations:c,expressions:[],defaultScale:1}}function Sr(e,t){var n,i;return e.type!=="image"&&e.type!=="spritesheet"?null:{id:`prop_${e.id}`,name:e.name,type:"image",asset:e.path,width:((n=e.metadata)==null?void 0:n.width)||100,height:((i=e.metadata)==null?void 0:i.height)||100,anchor:{x:.5,y:.5}}}function Oh(e,t){const n=[];for(const i of e.sprites)n.push(wr(i,e));for(const i of e.entities){const r=kr(i,e);r&&n.push(r)}return n}function Lh(e,t){const n=[];for(const i of e.assets){const r=Sr(i);r&&n.push(r)}return n}function Cr(e){const t={};for(const r of e.animations){const s=[];if(e.visual.atlas)for(const l of r.frames){const c=e.visual.atlas.frames[l.frameId];c&&s.push({assetId:e.id+"_sheet",srcRect:{x:c.frame.x,y:c.frame.y,width:c.frame.w,height:c.frame.h},duration:l.duration})}t[r.name]={frames:s,fps:r.fps,loop:r.loop}}let n=64,i=64;if(e.visual.atlas){const r=Object.keys(e.visual.atlas.frames)[0];if(r){const s=e.visual.atlas.frames[r];n=s.frame.w,i=s.frame.h}}return{id:e.id,name:e.name,assetId:e.id+"_sheet",width:n,height:i,anchor:e.anchor,animations:t}}function Bh(e,t){var i;const n=Cr(e);return{id:e.id,name:e.name,components:{sprite:{assetId:n.assetId,width:n.width,height:n.height,anchor:n.anchor,visible:!0},animator:{currentAnimation:((i=e.animations[0])==null?void 0:i.name)||"",animations:n.animations||{},frame:0,elapsed:0,playing:!0,loop:!0},transform:{position:t||{x:0,y:0},rotation:0,scale:{x:1,y:1}}}}}function _r(e){const t=e.toLowerCase();return t.includes("idle")||t.includes("stand")?"idle":t.includes("walk")?"walk":t.includes("run")||t.includes("sprint")?"run":t.includes("jump")||t.includes("fall")||t.includes("attack")||t.includes("hit")||t.includes("shoot")?"action":t.includes("hurt")||t.includes("damage")||t.includes("die")?"emotion":(t.includes("special")||t.includes("skill"),"custom")}function Hh(e,t){const n=(t==null?void 0:t.columns)||Math.ceil(Math.sqrt(e.length)),i=(t==null?void 0:t.padding)||0;if(e.length===0)return{image:"",atlas:{frames:{},meta:{image:"",size:{w:0,h:0},scale:1}}};const r=e[0].width,s=e[0].height,l=Math.ceil(e.length/n),c=n*(r+i)-i,d=l*(s+i)-i,u={};return e.forEach((y,f)=>{const p=f%n,m=Math.floor(f/n);u[y.id]={frame:{x:p*(r+i),y:m*(s+i),w:r,h:s},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:r,h:s},sourceSize:{w:r,h:s}}}),{image:"",atlas:{frames:u,meta:{image:"",size:{w:c,h:d},scale:1}}}}function qh(e,t,n,i,r){const s=r||Math.ceil(Math.sqrt(i)),l={};for(let d=0;d<i;d++){const u=d%s,y=Math.floor(d/s);l[`frame_${d}`]={frame:{x:u*t,y:y*n,w:t,h:n},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:t,h:n},sourceSize:{w:t,h:n}}}const c=Math.ceil(i/s);return{frames:l,meta:{image:e,size:{w:s*t,h:c*n},scale:1}}}function Wh(e){const t=[],n=[];e.id||t.push("Project is missing an ID"),(!e.assets||e.assets.length===0)&&n.push("Project has no assets"),!e.sprites&&!e.entities&&t.push("Project has no sprites or entities to import");for(const i of e.sprites||[])e.assets.find(s=>s.id===i.assetId)||n.push(`Sprite "${i.name}" references missing asset: ${i.assetId}`);for(const i of e.sprites||[])(!i.animations||Object.keys(i.animations).length===0)&&n.push(`Sprite "${i.name}" has no animations`);return{valid:t.length===0,errors:t,warnings:n}}function Vh(e,t){var c,d,u;const{flattenScenes:n=!1,includeCharacterSprites:i=!0,includeDialogue:r=!0,slideDuration:s=5e3}=t||{},l=[];if(n)for(const y of e.scenes){const f=Kh(y);for(let p=0;p<f.length;p++){const m=f[p],w=f[p+1]??y.duration,k=Uh(e,y,m,w-m,i,r);l.push(k)}}else for(const y of e.scenes){const f=Yh(e,y,i,r);l.push(f)}return{version:"1.0.0",id:e.id+"_presentation",title:e.title,description:(c=e.metadata)==null?void 0:c.description,author:(d=e.metadata)==null?void 0:d.author,createdAt:((u=e.metadata)==null?void 0:u.createdAt)||new Date().toISOString(),updatedAt:new Date().toISOString(),layout:{width:e.stageSize.width,height:e.stageSize.height,aspectRatio:`${e.stageSize.width}:${e.stageSize.height}`},slides:l,metadata:{sourcePuppetShow:e.id,convertedAt:new Date().toISOString()}}}function Kh(e){const t=new Set([0]);for(const n of e.timeline)for(const i of n.keyframes)t.add(i.time),"duration"in i&&typeof i.duration=="number"&&t.add(i.time+i.duration);return Array.from(t).sort((n,i)=>n-i)}function Uh(e,t,n,i,r,s){var c,d;const l=[];if(r)for(const u of t.cast){const y=e.characters.find(m=>m.id===u.characterId);if(!y)continue;const f=Zh(t,u.instanceId,n)||u.position,p=Gh(t,u.instanceId,n);l.push({id:`char_${u.instanceId}_${n}`,type:"image",position:{x:f.x,y:f.y,rotation:(p==null?void 0:p.rotation)??u.rotation},size:{width:((c=y.visual.atlas)==null?void 0:c.meta.size.w)??100,height:((d=y.visual.atlas)==null?void 0:d.meta.size.h)??100},content:{src:y.visual.spriteSheet,alt:y.name},style:{opacity:(p==null?void 0:p.opacity)??u.opacity??1,transform:(p==null?void 0:p.scale)!==void 0?`scale(${u.flipX?-p.scale:p.scale}, ${p.scale})`:void 0},zIndex:u.zIndex})}if(s){const u=Qh(t,n);if(u){const y=e.characters.find(f=>{const p=t.timeline.find(m=>m.type==="dialogue");return(p==null?void 0:p.targetId)===f.id});l.push({id:`dialogue_${n}`,type:"text",position:{x:e.stageSize.width/2,y:e.stageSize.height-100},size:{width:e.stageSize.width*.9,height:80},content:{text:y?`${y.name}: ${u.text}`:u.text},style:{backgroundColor:"rgba(0,0,0,0.85)",borderRadius:12},zIndex:1e3})}}return{id:`slide_${t.id}_${n}`,title:t.title,elements:l,background:jr(t.background),transition:t.transition?{type:t.transition.type,duration:t.transition.duration}:void 0,duration:i}}function Yh(e,t,n,i){var s,l;const r=[];if(n)for(const c of t.cast){const d=e.characters.find(u=>u.id===c.characterId);d&&r.push({id:`char_${c.instanceId}`,type:"image",position:{x:c.position.x,y:c.position.y,rotation:c.rotation},size:{width:((s=d.visual.atlas)==null?void 0:s.meta.size.w)??100,height:((l=d.visual.atlas)==null?void 0:l.meta.size.h)??100},content:{src:d.visual.spriteSheet,alt:d.name},style:{opacity:c.opacity??1},animation:Jh(t,c.instanceId),zIndex:c.zIndex})}for(const c of t.scenery){const d=e.props.find(u=>u.id===c.propId);d&&r.push({id:`prop_${c.instanceId}`,type:"image",position:{x:c.position.x,y:c.position.y,rotation:c.rotation},size:{width:d.width,height:d.height},content:{src:d.asset,alt:d.name},style:{opacity:c.opacity??1},zIndex:c.zIndex})}return i&&Xh(t).forEach((d,u)=>{const y=e.characters.find(f=>f.id===d.speakerId);r.push({id:`dialogue_${u}`,type:"text",position:{x:e.stageSize.width/2,y:e.stageSize.height-100},size:{width:e.stageSize.width*.9,height:80},content:{text:y?`${y.name}: ${d.text}`:d.text},style:{backgroundColor:"rgba(0,0,0,0.85)",borderRadius:12},animation:{enter:{type:"fadeIn",duration:300,delay:d.time},exit:{type:"fadeOut",duration:300,delay:d.time+d.duration-300}},zIndex:1e3+u})}),{id:`slide_${t.id}`,title:t.title,elements:r,background:jr(t.background),transition:t.transition?{type:t.transition.type,duration:t.transition.duration}:void 0,duration:t.duration,notes:`Converted from Puppet Show scene: ${t.title}`}}function Zh(e,t,n){const i=e.timeline.find(l=>l.type==="transform"&&l.targetId===t);if(!i)return null;const r=i.keyframes;let s=null;for(const l of r){const c=l.value;l.time<=n&&c.position&&(s=c)}return(s==null?void 0:s.position)??null}function Gh(e,t,n){const i=e.timeline.find(l=>l.type==="transform"&&l.targetId===t);if(!i)return null;const r=i.keyframes;let s=null;for(const l of r)l.time<=n&&(s=l.value);return s?{scale:s.scale,rotation:s.rotation,opacity:s.opacity}:null}function Qh(e,t){for(const n of e.timeline)if(n.type==="dialogue")for(const i of n.keyframes){const r=i.value;if(t>=i.time&&t<i.time+(i.duration??0))return{text:r.text,speakerId:n.targetId}}return null}function Xh(e){const t=[];for(const n of e.timeline)if(n.type==="dialogue")for(const i of n.keyframes){const r=i.value;t.push({text:r.text,speakerId:n.targetId,time:i.time,duration:i.duration??0})}return t.sort((n,i)=>n.time-i.time)}function jr(e){var t,n;switch(e.type){case"solid":return{type:"solid",color:e.color};case"gradient":return e.gradient?{type:"gradient",gradient:e.gradient}:{type:"solid",color:"#000000"};case"image":return{type:"image",image:e.image};case"video":return{type:"video",video:e.video};case"parallax":return{type:"image",image:(n=(t=e.parallaxLayers)==null?void 0:t[0])==null?void 0:n.image};default:return{type:"solid",color:"#000000"}}}function Jh(e,t){const n=e.timeline.find(r=>r.type==="transform"&&r.targetId===t);return!n||n.keyframes.length===0?void 0:{timeline:n.keyframes.map(r=>{var l,c;const s=r.value;return{time:r.time,properties:{x:(l=s.position)==null?void 0:l.x,y:(c=s.position)==null?void 0:c.y,scale:s.scale,rotation:s.rotation,opacity:s.opacity},easing:r.easing}})}}function ef(e,t){const n=[],i=[],r=[],s=new Map;for(const l of e.slides)for(const c of l.elements)c.type==="image"&&c.content.src&&(s.has(c.content.src)||s.set(c.content.src,new Set),s.get(c.content.src).add(c));if(t!=null&&t.createCharacterFromImages){for(const[l,c]of s)if(c.size>=2){const d=Array.from(c)[0],u=`char_${n.length}`;n.push({id:u,name:d.content.alt||`Character ${n.length+1}`,type:"sprite",visual:{type:"sprite",spriteSheet:l,atlas:{frames:{default:{frame:{x:0,y:0,w:d.size.width,h:d.size.height},rotated:!1,trimmed:!1,spriteSourceSize:{x:0,y:0,w:d.size.width,h:d.size.height},sourceSize:{w:d.size.width,h:d.size.height}}},meta:{image:l,size:{w:d.size.width,h:d.size.height},scale:1}},width:d.size.width,height:d.size.height},anchor:{x:.5,y:1},animations:[{id:"idle",name:"Idle",category:"idle",frames:[{frameId:"default",duration:1e3,offset:{x:0,y:0}}],fps:1,loop:!0,duration:1e3}],expressions:[],defaultScale:1})}}for(const[l,c]of s)if(c.size<2||!(t!=null&&t.createCharacterFromImages)){const d=Array.from(c)[0];i.push({id:`prop_${i.length}`,name:d.content.alt||`Prop ${i.length+1}`,type:"image",asset:l,width:d.size.width,height:d.size.height,anchor:{x:.5,y:.5}})}for(const l of e.slides){const c=tf(l,e,n,i);r.push(c)}return{version:"1.0",id:e.id+"_puppetshow",title:e.title,stageSize:{width:e.layout.width,height:e.layout.height},scenes:r,characters:n,props:i,audioTracks:[],settings:{defaultFps:24,allowSpeedControl:!0,allowSeek:!0,autoPlay:!1,showControls:!0,loop:!1},metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),duration:e.slides.reduce((l,c)=>l+(c.duration??5e3),0),sceneCount:r.length,characterCount:n.length,sourcePresentation:e.id,convertedAt:new Date().toISOString()}}}function tf(e,t,n,i){var u,y,f,p;const r=[],s=[],l=[];let c=0,d=0;for(const m of e.elements)if(m.type==="image"&&m.content.src){const w=n.find(k=>k.visual.spriteSheet===m.content.src);if(w){const k=`${w.id}_instance_${c++}`;if(r.push({instanceId:k,characterId:w.id,position:{x:m.position.x,y:m.position.y},scale:1,rotation:m.position.rotation??0,zIndex:m.zIndex??c,opacity:((u=m.style)==null?void 0:u.opacity)??1,flipX:!1}),(y=m.animation)!=null&&y.timeline&&m.animation.timeline.length>1){const z={id:`transform_${k}`,type:"transform",targetId:k,keyframes:m.animation.timeline.map($=>({time:$.time,easing:$.easing??"easeInOut",value:{type:"transform",position:$.properties.x!==void 0?{x:$.properties.x,y:$.properties.y??0}:void 0,scale:$.properties.scale,rotation:$.properties.rotation,opacity:$.properties.opacity}}))};l.push(z)}}else{const k=i.find(z=>z.asset===m.content.src);k&&s.push({instanceId:`${k.id}_instance_${d++}`,propId:k.id,position:{x:m.position.x,y:m.position.y},scale:1,rotation:m.position.rotation??0,zIndex:m.zIndex??d,opacity:((f=m.style)==null?void 0:f.opacity)??1})}}else if(m.type==="text"&&m.content.text&&m.position.y>t.layout.height*.7){const k=((p=r[0])==null?void 0:p.characterId)??"narrator",z=l.find(g=>g.type==="dialogue"&&g.targetId===k),$={time:0,duration:e.duration??3e3,easing:"linear",value:{type:"dialogue",text:m.content.text}};z?z.keyframes.push($):l.push({id:`dialogue_${k}`,type:"dialogue",targetId:k,keyframes:[$]})}return{id:e.id,title:e.title||"Untitled Scene",duration:e.duration??5e3,background:e.background?{type:e.background.type,color:e.background.color,gradient:e.background.gradient,image:e.background.image,video:e.background.video}:{type:"solid",color:"#000000"},cast:r,scenery:s,timeline:l,camera:{position:{x:t.layout.width/2,y:t.layout.height/2},zoom:1,rotation:0},transition:e.transition?{type:(()=>{const m=e.transition.type;return m==="fade"?"fade":m==="zoom"?"zoom":m==="slide"?"slideLeft":"cut"})(),duration:e.transition.duration??500}:void 0}}function nf(e){const t=[],n=[];e.id||t.push("Document missing id"),e.title||n.push("Document missing title"),e.version||n.push("Document missing version"),e.stageSize||t.push("Document missing stageSize"),(!e.scenes||e.scenes.length===0)&&t.push("Document has no scenes");const i=new Set(e.characters.map(s=>s.id));for(const s of e.scenes)for(const l of s.cast)i.has(l.characterId)||t.push(`Scene "${s.id}" references unknown character: ${l.characterId}`);const r=new Set(e.props.map(s=>s.id));for(const s of e.scenes)for(const l of s.scenery)r.has(l.propId)||t.push(`Scene "${s.id}" references unknown prop: ${l.propId}`);return{valid:t.length===0,errors:t,warnings:n}}function af(e,t){if(e.length===0)throw new Error("Cannot merge empty array of puppet shows");const n={version:"1.0",id:`merged_${Date.now()}`,title:e.map(s=>s.title).join(" + "),stageSize:e[0].stageSize,scenes:[],characters:[],props:[],audioTracks:[],settings:e[0].settings,metadata:{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),duration:e.reduce((s,l)=>{var c;return s+(((c=l.metadata)==null?void 0:c.duration)??0)},0),sceneCount:0,characterCount:0,mergedFrom:e.map(s=>s.id),mergedAt:new Date().toISOString()}},i=new Map,r=new Map;for(const s of e){for(const l of s.characters){if(t!=null&&t.deduplicateCharacters){const d=n.characters.find(u=>u.name===l.name);if(d){i.set(l.id,d.id);continue}}const c=`${s.id}_${l.id}`;i.set(l.id,c),n.characters.push({...l,id:c})}for(const l of s.props){const c=`${s.id}_${l.id}`;r.set(l.id,c),n.props.push({...l,id:c})}for(const l of s.scenes){const c={...l,id:`${s.id}_${l.id}`,cast:l.cast.map(d=>({...d,instanceId:`${s.id}_${d.instanceId}`,characterId:i.get(d.characterId)||d.characterId})),scenery:l.scenery.map(d=>({...d,instanceId:`${s.id}_${d.instanceId}`,propId:r.get(d.propId)||d.propId})),timeline:l.timeline.map(d=>({...d,id:`${s.id}_${d.id}`,targetId:i.get(d.targetId)||r.get(d.targetId)||`${s.id}_${d.targetId}`}))};n.scenes.push(c)}for(const l of s.audioTracks||[])n.audioTracks.push({...l,id:`${s.id}_${l.id}`})}return n}const Nr={good:"#4caf50",warning:"#ff9800",critical:"#f44336",info:"#2196f3",neutral:"#9e9e9e",background:"#ffffff",text:"#212121",textMuted:"#757575"};function rf(e){const t={...Nr,...e.colorScheme};return{id:e.id,title:e.title,type:"dashboard",layout:{columns:e.columns,rows:e.rows,gap:e.gap??16,padding:e.padding??24},widgets:e.widgets.map(n=>({...n,colSpan:n.colSpan??1,rowSpan:n.rowSpan??1,colors:{...t,...n.colors},animation:{countUp:!0,countUpDuration:1e3,entrance:"fadeIn",entranceDelay:0,...n.animation}})),dataSources:e.dataSources??[],refreshInterval:e.refreshInterval??3e4,colorScheme:t,background:e.background??t.background,showLastUpdated:e.showLastUpdated??!0,autoCycle:e.autoCycle??!1,autoCycleInterval:e.autoCycleInterval??5e3,lastUpdated:new Date().toISOString()}}function of(e,t,n=!0){var r;if(!t||t.length===0)return"neutral";const i=[...t].sort((s,l)=>n?l.value-s.value:s.value-l.value);for(const s of i)if(n){if(e>=s.value)return s.status}else if(e<=s.value)return s.status;return((r=i[i.length-1])==null?void 0:r.status)??"neutral"}function sf(e,t){return t==null?"unknown":e>t?"up":e<t?"down":"flat"}function lf(e,t){if(typeof e=="string")return e;const{unit:n="",precision:i=0,compact:r=!1,locale:s="en-US"}=t??{};let l;return r&&Math.abs(e)>=1e3?l=new Intl.NumberFormat(s,{notation:"compact",maximumFractionDigits:1}).format(e):l=e.toLocaleString(s,{minimumFractionDigits:i,maximumFractionDigits:i}),n?`${l}${n}`:l}function Er(e){return{id:"revenue",title:"Revenue",type:"number-tile",column:1,row:1,unit:"$",precision:0,icon:"dollar-sign",thresholds:[{value:1e6,status:"good"},{value:5e5,status:"warning"},{value:0,status:"critical"}],...e}}function Mr(e){return{id:"customers",title:"Customers",type:"number-tile",column:2,row:1,icon:"users",thresholds:[{value:1e4,status:"good"},{value:5e3,status:"warning"},{value:0,status:"critical"}],...e}}function cf(e){return{id:"percentage-gauge",title:"Completion",type:"gauge",column:1,row:1,unit:"%",precision:1,gaugeConfig:{min:0,max:100,style:"semicircle",showNeedle:!0,showTicks:!0,tickCount:5,thickness:20},thresholds:[{value:80,status:"good"},{value:50,status:"warning"},{value:0,status:"critical"}],...e}}function df(e){return{id:"sparkline-trend",title:"Weekly Trend",type:"sparkline",column:1,row:1,sparklineData:[],...e}}function uf(e){return{id:"traffic-light",title:"System Status",type:"traffic-light",column:1,row:1,...e}}function pf(e){return{id:"comparison",title:"Budget vs Actual",type:"comparison",column:1,row:1,targetValue:1e5,value:85e3,unit:"$",...e}}function mf(){return{id:"executive-dashboard",title:"Executive Summary",columns:4,rows:3,widgets:[Er({column:1,row:1,colSpan:1}),Mr({column:2,row:1,colSpan:1}),{id:"orders",title:"Orders",type:"number-tile",column:3,row:1,icon:"shopping-cart"},{id:"satisfaction",title:"CSAT Score",type:"gauge",column:4,row:1,unit:"%",gaugeConfig:{min:0,max:100,style:"semicircle"}},{id:"revenue-trend",title:"Revenue Trend",type:"sparkline",column:1,row:2,colSpan:2},{id:"top-products",title:"Top Products",type:"mini-bar",column:3,row:2,colSpan:2,chartData:[{label:"Product A",value:45e3},{label:"Product B",value:38e3},{label:"Product C",value:32e3},{label:"Product D",value:28e3},{label:"Product E",value:22e3}]},{id:"regional-breakdown",title:"Regional Sales",type:"mini-pie",column:1,row:3,colSpan:2,chartData:[{label:"North",value:35},{label:"South",value:25},{label:"East",value:22},{label:"West",value:18}]},{id:"budget-status",title:"Budget Status",type:"bullet-chart",column:3,row:3,colSpan:2,value:72e3,targetValue:1e5,unit:"$"}]}}function hf(){return{id:"operational-dashboard",title:"Operational Metrics",columns:3,rows:2,widgets:[{id:"uptime",title:"System Uptime",type:"gauge",column:1,row:1,value:99.9,unit:"%",gaugeConfig:{min:0,max:100,style:"full-circle"},thresholds:[{value:99.5,status:"good"},{value:99,status:"warning"},{value:0,status:"critical"}]},{id:"response-time",title:"Avg Response Time",type:"number-tile",column:2,row:1,value:145,unit:"ms",icon:"clock",thresholds:[{value:0,status:"good"},{value:200,status:"warning"},{value:500,status:"critical"}]},{id:"error-rate",title:"Error Rate",type:"traffic-light",column:3,row:1,value:.5,unit:"%"},{id:"throughput",title:"Requests/sec",type:"sparkline",column:1,row:2,colSpan:2,sparklineData:[120,135,128,145,152,148,160,155,170,165]},{id:"incidents",title:"Open Incidents",type:"number-tile",column:3,row:2,value:3,icon:"alert-triangle",thresholds:[{value:0,status:"good"},{value:5,status:"warning"},{value:10,status:"critical"}]}]}}function ff(e){var t,n,i;return{id:e.id,type:"datagrid",title:e.title,subtitle:e.subtitle,config:{...e,columns:e.columns.map(r=>({width:"auto",align:"left",dataType:"string",sortable:!0,filterable:!1,...r})),interactiveSort:e.interactiveSort??!0,interactiveFilter:e.interactiveFilter??!1,enableSelection:e.enableSelection??!0,showRowNumbers:e.showRowNumbers??!1,showColumnBorders:e.showColumnBorders??!1,stripedRows:e.stripedRows??!0,pageSize:e.pageSize??10,animation:{rowEntrance:"fadeIn",staggerDelay:50,duration:300,progressiveReveal:!1,revealBatchSize:5,...e.animation},style:{headerBackground:"#f5f5f5",headerColor:"#212121",rowBackground:"#ffffff",rowBackgroundAlt:"#fafafa",cellColor:"#424242",borderColor:"#e0e0e0",fontSize:14,headerFontSize:14,rowHeight:48,cellPadding:12,borderRadius:8,...e.style}},state:{currentSort:e.defaultSort??[],currentFilters:e.defaultFilters??[],selectedCells:[],currentPage:0,revealedRowCount:(t=e.animation)!=null&&t.progressiveReveal?e.animation.revealBatchSize??5:((n=e.data)==null?void 0:n.length)??0,isFullyRevealed:!((i=e.animation)!=null&&i.progressiveReveal),lastUpdated:new Date().toISOString()}}}function gf(e,t){return t.length===0?e:[...e].sort((n,i)=>{for(const r of t){const s=n[r.field],l=i[r.field];let c=0;if(s==null&&l==null?c=0:s==null?c=1:l==null?c=-1:typeof s=="number"&&typeof l=="number"?c=s-l:c=String(s).localeCompare(String(l)),c!==0)return r.direction==="desc"?-c:c}return 0})}function yf(e,t){return t.length===0?e:e.filter(n=>t.every(i=>{const r=n[i.field],s=i.value;switch(i.operator){case"equals":return r===s;case"notEquals":return r!==s;case"contains":return String(r).toLowerCase().includes(String(s).toLowerCase());case"startsWith":return String(r).toLowerCase().startsWith(String(s).toLowerCase());case"endsWith":return String(r).toLowerCase().endsWith(String(s).toLowerCase());case"greaterThan":return Number(r)>Number(s);case"lessThan":return Number(r)<Number(s);case"between":return Number(r)>=Number(s)&&Number(r)<=Number(i.valueTo);case"in":return Array.isArray(s)&&s.includes(r);default:return!0}}))}function bf(e,t){const n={};for(const i of t.columns){const r=e.map(s=>s[i.columnId]).filter(s=>s!=null);switch(i.aggregation){case"sum":n[i.columnId]=r.reduce((s,l)=>s+Number(l),0);break;case"avg":n[i.columnId]=r.length>0?r.reduce((s,l)=>s+Number(l),0)/r.length:0;break;case"min":n[i.columnId]=Math.min(...r.map(Number));break;case"max":n[i.columnId]=Math.max(...r.map(Number));break;case"count":n[i.columnId]=r.length;break;case"custom":n[i.columnId]=i.customValue??"";break}}return n}function xf(e,t,n="en-US"){if(e==null)return"";switch(t.dataType){case"number":return Number(e).toLocaleString(n,{minimumFractionDigits:t.precision??0,maximumFractionDigits:t.precision??0});case"currency":return Number(e).toLocaleString(n,{style:"currency",currency:t.currency??"USD"});case"percent":return Number(e).toLocaleString(n,{style:"percent",minimumFractionDigits:t.precision??0});case"date":return new Date(String(e)).toLocaleDateString(n);case"boolean":return e?"✓":"✗";default:return String(e)}}function vf(e,t){if(!t)return null;for(const n of t){const{operator:i,value:r,valueTo:s}=n.condition;let l=!1;switch(i){case"equals":l=e===r;break;case"notEquals":l=e!==r;break;case"greaterThan":l=Number(e)>Number(r);break;case"lessThan":l=Number(e)<Number(r);break;case"between":l=Number(e)>=Number(r)&&Number(e)<=Number(s);break;case"contains":l=String(e).toLowerCase().includes(String(r).toLowerCase());break;case"isEmpty":l=e==null||e==="";break}if(l)return n.style}return null}function wf(e){return{id:"sales-grid",title:"Sales Report",subtitle:"Q4 2025 Performance",columns:[{id:"region",header:"Region",field:"region",width:150},{id:"product",header:"Product",field:"product",width:200},{id:"units",header:"Units Sold",field:"units",dataType:"number",align:"right"},{id:"revenue",header:"Revenue",field:"revenue",dataType:"currency",align:"right",conditionalFormat:[{condition:{operator:"greaterThan",value:1e5},style:{backgroundColor:"#e8f5e9",color:"#2e7d32"}},{condition:{operator:"lessThan",value:5e4},style:{backgroundColor:"#ffebee",color:"#c62828"}}]},{id:"growth",header:"Growth %",field:"growth",dataType:"percent",align:"right",precision:1}],data:e??[{region:"North",product:"Widget Pro",units:1250,revenue:125e3,growth:.15},{region:"South",product:"Widget Pro",units:980,revenue:98e3,growth:.08},{region:"East",product:"Gadget Plus",units:1500,revenue:18e4,growth:.22},{region:"West",product:"Gadget Plus",units:1100,revenue:132e3,growth:.12}],summaryRow:{enabled:!0,columns:[{columnId:"units",aggregation:"sum",label:"Total"},{columnId:"revenue",aggregation:"sum"},{columnId:"growth",aggregation:"avg"}]},animation:{rowEntrance:"slideInLeft",staggerDelay:100}}}function kf(e){return{id:"employee-grid",title:"Team Directory",columns:[{id:"name",header:"Name",field:"name",width:180},{id:"role",header:"Role",field:"role",width:150},{id:"department",header:"Department",field:"department",width:120,filterable:!0},{id:"email",header:"Email",field:"email",width:200},{id:"status",header:"Status",field:"status",cellRenderer:"badge",width:100}],data:e??[],showRowNumbers:!0,interactiveFilter:!0}}function Sf(e){var n;const t={};return(n=e.parameters)==null||n.forEach(i=>{i.defaultValue!==void 0&&(t[i.name]=i.defaultValue)}),{id:e.id,type:"query",title:e.title,subtitle:e.subtitle,config:{...e,autoExecute:e.autoExecute??!1,showQueryEditor:e.showQueryEditor??!0,allowQueryEdit:e.allowQueryEdit??!1,showExecutionStats:e.showExecutionStats??!0,cacheDuration:e.cacheDuration??0,style:{editorTheme:"dark",editorFontSize:14,resultBackground:"#ffffff",accentColor:"#1976d2",borderRadius:8,...e.style}},state:{currentQuery:e.query,currentParameters:t,result:null,isExecuting:!1,lastExecutedAt:null,error:null,visualizationMode:e.visualization.mode,history:[]}}}function Cf(e,t){const n=[];switch(t){case"sql":const i=e.matchAll(/[@:](\w+)/g);for(const c of i)n.includes(c[1])||n.push(c[1]);break;case"odata":const r=e.matchAll(/\{(\w+)\}/g);for(const c of r)n.includes(c[1])||n.push(c[1]);break;case"graphql":const s=e.matchAll(/\$(\w+)/g);for(const c of s)n.includes(c[1])||n.push(c[1]);break;case"kql":const l=e.matchAll(/\{(\w+)\}/g);for(const c of l)n.includes(c[1])||n.push(c[1]);break}return n}function _f(e,t,n){let i=e;for(const[r,s]of Object.entries(n)){const l=jf(s);switch(t){case"sql":i=i.replace(new RegExp(`@${r}\\b`,"g"),l),i=i.replace(new RegExp(`:${r}\\b`,"g"),l);break;case"odata":case"kql":i=i.replace(new RegExp(`\\{${r}\\}`,"g"),l);break}}return i}function jf(e){return e==null?"NULL":typeof e=="number"?String(e):typeof e=="boolean"?e?"TRUE":"FALSE":e instanceof Date?`'${e.toISOString()}'`:`'${String(e).replace(/'/g,"''")}'`}function Nf(e,t){const n={};for(const i of e){const r=t[i.name];if(i.required&&(r==null||r==="")){n[i.name]=`${i.label} is required`;continue}if(r!=null&&i.validation){if(i.type==="number"){const s=Number(r);i.validation.min!==void 0&&s<i.validation.min&&(n[i.name]=i.validation.message??`Minimum value is ${i.validation.min}`),i.validation.max!==void 0&&s>i.validation.max&&(n[i.name]=i.validation.message??`Maximum value is ${i.validation.max}`)}i.type==="string"&&i.validation.pattern&&(new RegExp(i.validation.pattern).test(String(r))||(n[i.name]=i.validation.message??"Invalid format"))}}return{valid:Object.keys(n).length===0,errors:n}}function Ef(e){if(!e.success||e.rowCount===0)return"table";const t=e.columns.filter(i=>i.type==="number"),n=e.columns.filter(i=>i.type==="date");return e.rowCount===1&&t.length>=3?"metrics":n.length===1&&t.length>=1&&e.rowCount>3?"line-chart":t.length===1&&e.rowCount<=15?"bar-chart":t.length===1&&e.rowCount<=8?"pie-chart":"table"}function Mf(e,t){var c,d,u;if(!e.success||e.columns.length===0)return;const n=e.columns.filter(y=>y.type==="number"),i=e.columns.filter(y=>y.type!=="number"),s=((c=e.columns.filter(y=>y.type==="date")[0])==null?void 0:c.name)??((d=i[0])==null?void 0:d.name)??e.columns[0].name,l=n.length>0?n.length===1?n[0].name:n.slice(0,3).map(y=>y.name):(u=e.columns[1])==null?void 0:u.name;return{xAxis:s,yAxis:l,showLegend:Array.isArray(l)&&l.length>1,showGrid:!0,colorScheme:["#1976d2","#43a047","#fb8c00","#e53935","#8e24aa"]}}function zf(){return{id:"sales-query",title:"Sales Analysis",subtitle:"Query live sales data",language:"sql",query:`SELECT
|
|
845
|
+
Region,
|
|
846
|
+
ProductCategory,
|
|
847
|
+
SUM(Revenue) as TotalRevenue,
|
|
848
|
+
COUNT(*) as OrderCount,
|
|
849
|
+
AVG(Revenue) as AvgOrderValue
|
|
850
|
+
FROM Sales
|
|
851
|
+
WHERE OrderDate >= @startDate AND OrderDate <= @endDate
|
|
852
|
+
GROUP BY Region, ProductCategory
|
|
853
|
+
ORDER BY TotalRevenue DESC`,parameters:[{name:"startDate",label:"Start Date",type:"date",required:!0,defaultValue:new Date(Date.now()-30*24*60*60*1e3).toISOString().split("T")[0]},{name:"endDate",label:"End Date",type:"date",required:!0,defaultValue:new Date().toISOString().split("T")[0]}],dataSource:{id:"sales-query-ds",name:"Sales Query Source",type:"rest-api",config:{type:"rest-api",url:"/api/query",method:"POST"},status:"idle"},visualization:{mode:"bar-chart",chartConfig:{xAxis:"Region",yAxis:"TotalRevenue",seriesField:"ProductCategory",showLegend:!0}},showQueryEditor:!0,showExecutionStats:!0}}function $f(){return{id:"odata-query",title:"Product Catalog",subtitle:"OData Query Example",language:"odata",query:"Products?$filter=Category eq '{category}' and Price gt {minPrice}&$orderby=Price desc&$top=20&$select=Name,Category,Price,Stock",parameters:[{name:"category",label:"Category",type:"select",required:!0,defaultValue:"Electronics",options:[{value:"Electronics",label:"Electronics"},{value:"Clothing",label:"Clothing"},{value:"Books",label:"Books"}]},{name:"minPrice",label:"Minimum Price",type:"number",defaultValue:0,validation:{min:0}}],dataSource:{id:"odata-query-ds",name:"OData Query Source",type:"rest-api",config:{type:"rest-api",url:"https://api.example.com/odata",method:"GET"},status:"idle"},visualization:{mode:"table",tableConfig:{pageSize:10,sortable:!0}}}}function Af(){return{id:"kql-query",title:"Application Insights",subtitle:"Request Performance Analysis",language:"kql",query:`requests
|
|
854
|
+
| where timestamp > ago({timeRange})
|
|
855
|
+
| summarize
|
|
856
|
+
RequestCount = count(),
|
|
857
|
+
AvgDuration = avg(duration),
|
|
858
|
+
P95Duration = percentile(duration, 95),
|
|
859
|
+
FailureRate = countif(success == false) * 100.0 / count()
|
|
860
|
+
by bin(timestamp, 1h)
|
|
861
|
+
| order by timestamp asc`,parameters:[{name:"timeRange",label:"Time Range",type:"select",defaultValue:"24h",options:[{value:"1h",label:"Last Hour"},{value:"24h",label:"Last 24 Hours"},{value:"7d",label:"Last 7 Days"},{value:"30d",label:"Last 30 Days"}]}],dataSource:{id:"kql-query-ds",name:"KQL Query Source",type:"rest-api",config:{type:"rest-api",url:"https://api.applicationinsights.azure.com/v1/apps/{app-id}/query",method:"POST"},status:"idle"},visualization:{mode:"line-chart",chartConfig:{xAxis:"timestamp",yAxis:["AvgDuration","P95Duration"],showLegend:!0,showGrid:!0}},autoExecute:!0}}class Ff{constructor(t,n,i){this.versions=new Map,this.branches=new Map,this.currentVersionId=null,this.currentBranch="main",this.autoSaveTimer=null,this.lastAutoSaveTime=0,this.presentationId=t,this.config={maxVersions:50,autoSaveInterval:6e4,autoSaveDebounce:5e3,preserveLabeledVersions:!0,enableBranching:!0,...n},this.onChange=i,this.branches.set("main",{name:"main",headVersionId:"",createdAt:new Date().toISOString(),createdBy:n.currentUser})}getVersionHistory(){return Array.from(this.versions.values()).filter(t=>!t.branchName||t.branchName===this.currentBranch).sort((t,n)=>n.versionNumber-t.versionNumber)}getVersion(t){return this.versions.get(t)}getCurrentVersion(){return this.currentVersionId?this.versions.get(this.currentVersionId):void 0}saveVersion(t,n={}){var u;const i=this.generateVersionId(),r=this.getCurrentVersion(),s=((r==null?void 0:r.versionNumber)??0)+1,l=r?this.calculateDiff(r.snapshot,t):void 0,c={versionId:i,versionNumber:s,snapshot:this.clonePresentation(t),createdAt:new Date().toISOString(),createdBy:this.config.currentUser,label:n.label,description:n.description??this.generateAutoDescription(l),tags:n.tags,isAutoSave:n.isAutoSave??!1,parentVersionId:this.currentVersionId??void 0,branchName:this.currentBranch,diff:l};this.versions.set(i,c),this.currentVersionId=i;const d=this.branches.get(this.currentBranch);return d&&(d.headVersionId=i),this.pruneVersions(),(u=this.onChange)==null||u.call(this,c),c}scheduleAutoSave(t){if(this.config.autoSaveInterval<=0)return;this.autoSaveTimer&&clearTimeout(this.autoSaveTimer);const i=Date.now()-this.lastAutoSaveTime,r=Math.max(this.config.autoSaveDebounce,this.config.autoSaveInterval-i);this.autoSaveTimer=setTimeout(()=>{this.saveVersion(t,{isAutoSave:!0}),this.lastAutoSaveTime=Date.now()},r)}cancelAutoSave(){this.autoSaveTimer&&(clearTimeout(this.autoSaveTimer),this.autoSaveTimer=null)}restoreVersion(t){const n=this.versions.get(t);if(!n)return null;const i=this.getCurrentVersion();return i&&this.saveVersion(i.snapshot,{label:`Before restore to v${n.versionNumber}`,description:`Auto-saved before restoring to version ${n.versionNumber}`}),this.saveVersion(n.snapshot,{description:`Restored from version ${n.versionNumber}`}).snapshot}previewVersion(t){const n=this.versions.get(t);return n?this.clonePresentation(n.snapshot):null}labelVersion(t,n){const i=this.versions.get(t);return i?(i.label=n,!0):!1}tagVersion(t,n){const i=this.versions.get(t);return i?(i.tags=[...new Set([...i.tags??[],...n])],!0):!1}createBranch(t,n){if(!this.config.enableBranching||this.branches.has(t))return null;const i={name:t,headVersionId:this.currentVersionId??"",createdAt:new Date().toISOString(),createdBy:this.config.currentUser,description:n};return this.branches.set(t,i),i}switchBranch(t){const n=this.branches.get(t);return n?(this.currentBranch=t,this.currentVersionId=n.headVersionId,!0):!1}getBranches(){return Array.from(this.branches.values())}getCurrentBranch(){return this.currentBranch}compareVersions(t,n){const i=this.versions.get(t),r=this.versions.get(n);return!i||!r?null:this.calculateDiff(i.snapshot,r.snapshot)}calculateDiff(t,n){const i=[],r=[],s=new Map(t.slides.map((w,k)=>[w.id,{slide:w,index:k}])),l=new Map(n.slides.map((w,k)=>[w.id,{slide:w,index:k}]));let c=0,d=0,u=0,y=0,f=0,p=0;for(const[w,{slide:k,index:z}]of l){const $=s.get(w);if(!$)c++,y+=k.elements.length,i.push({slideId:w,slideIndex:z,changeType:"added",slideTitle:this.getSlideTitle(k)});else{const g=this.calculateElementChanges($.slide,k);if((g.length>0||$.index!==z)&&($.index!==z&&i.push({slideId:w,slideIndex:z,changeType:"reordered",slideTitle:this.getSlideTitle(k),previousIndex:$.index}),g.length>0)){u++,i.push({slideId:w,slideIndex:z,changeType:"modified",slideTitle:this.getSlideTitle(k),elementChanges:g});for(const v of g)v.changeType==="added"?y++:v.changeType==="removed"?f++:p++}}}for(const[w,{slide:k,index:z}]of s)l.has(w)||(d++,f+=k.elements.length,i.push({slideId:w,slideIndex:z,changeType:"removed",slideTitle:this.getSlideTitle(k)}));const m=["title","author","theme"];for(const w of m)JSON.stringify(t[w])!==JSON.stringify(n[w])&&r.push({property:w,oldValue:t[w],newValue:n[w]});return{summary:{slidesAdded:c,slidesRemoved:d,slidesModified:u,elementsAdded:y,elementsRemoved:f,elementsModified:p,totalChanges:c+d+u+r.length},slideChanges:i,metadataChanges:r}}calculateElementChanges(t,n){const i=[],r=new Map(t.elements.map(l=>[l.id,l])),s=new Map(n.elements.map(l=>[l.id,l]));for(const[l,c]of s){const d=r.get(l);if(!d)i.push({elementId:l,elementType:c.type,changeType:"added"});else{const u=this.calculatePropertyChanges(d,c);u.length>0&&i.push({elementId:l,elementType:c.type,changeType:"modified",propertyChanges:u})}}for(const[l,c]of r)s.has(l)||i.push({elementId:l,elementType:c.type,changeType:"removed"});return i}calculatePropertyChanges(t,n){const i=[],r=t,s=n,l=new Set([...Object.keys(r),...Object.keys(s)]);for(const c of l)c!=="id"&&JSON.stringify(r[c])!==JSON.stringify(s[c])&&i.push({property:c,oldValue:r[c],newValue:s[c]});return i}getSlideTitle(t){const n=t.elements.find(i=>{var r;return i.type==="text"&&((r=i.content)==null?void 0:r.text)});if(n){const i=n.content.text;return i.substring(0,50)+(i.length>50?"...":"")}return`Slide ${t.id}`}generateAutoDescription(t){if(!t)return"Initial version";const n=[],{summary:i}=t;return i.slidesAdded>0&&n.push(`+${i.slidesAdded} slide(s)`),i.slidesRemoved>0&&n.push(`-${i.slidesRemoved} slide(s)`),i.slidesModified>0&&n.push(`~${i.slidesModified} slide(s) modified`),t.metadataChanges.length>0&&n.push("metadata updated"),n.length>0?n.join(", "):"No significant changes"}clonePresentation(t){return JSON.parse(JSON.stringify(t))}generateVersionId(){return`v_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}pruneVersions(){const t=Array.from(this.versions.values()).filter(r=>!r.branchName||r.branchName===this.currentBranch).sort((r,s)=>r.versionNumber-s.versionNumber),n=new Set;if(this.currentVersionId&&n.add(this.currentVersionId),this.config.preserveLabeledVersions)for(const r of t)r.label&&n.add(r.versionId);const i=t.slice(-this.config.maxVersions);for(const r of i)n.add(r.versionId);for(const r of t)n.has(r.versionId)||this.versions.delete(r.versionId)}exportHistory(){return JSON.stringify({presentationId:this.presentationId,currentVersionId:this.currentVersionId,currentBranch:this.currentBranch,versions:Array.from(this.versions.values()),branches:Array.from(this.branches.values())})}importHistory(t){const n=JSON.parse(t);this.presentationId=n.presentationId,this.currentVersionId=n.currentVersionId,this.currentBranch=n.currentBranch,this.versions=new Map(n.versions.map(i=>[i.versionId,i])),this.branches=new Map(n.branches.map(i=>[i.name,i]))}dispose(){this.cancelAutoSave()}}class If{constructor(t,n){this.slides=new Map,this.elements=new Map,this.templates=new Map,this.collections=new Map,this.linkedInstances=new Map,this.currentUser=t,this.onUpdate=n}addSlide(t,n){const i=this.generateId(),r=new Date().toISOString(),s={metadata:{id:i,type:"slide",name:n.name,description:n.description,tags:n.tags??[],collectionIds:n.collectionIds??[],createdBy:this.currentUser,createdAt:r,updatedAt:r,version:1,usageCount:0,visibility:n.visibility??"private"},slide:this.cloneSlide(t),placeholders:n.placeholders};return this.slides.set(i,s),this.updateCollectionCounts(),s}updateSlide(t,n){var r;const i=this.slides.get(t);return!i||i.metadata.createdBy.id!==this.currentUser.id?null:(n.slide&&(i.slide=this.cloneSlide(n.slide),i.metadata.version++),n.name!==void 0&&(i.metadata.name=n.name),n.description!==void 0&&(i.metadata.description=n.description),n.tags!==void 0&&(i.metadata.tags=n.tags),n.placeholders!==void 0&&(i.placeholders=n.placeholders),i.metadata.updatedAt=new Date().toISOString(),(r=this.onUpdate)==null||r.call(this,"slide",t),i)}removeSlide(t){const n=this.slides.get(t);return!n||n.metadata.createdBy.id!==this.currentUser.id?!1:(this.slides.delete(t),this.updateCollectionCounts(),!0)}getSlide(t){return this.slides.get(t)}useSlide(t,n){const i=this.slides.get(t);if(!i)return null;i.metadata.usageCount++;const r=this.cloneSlide(i.slide);if(r.id=this.generateId(),n!=null&&n.placeholderValues&&i.placeholders&&this.applyPlaceholderValues(r,i.placeholders,n.placeholderValues),n!=null&&n.elementOverrides)for(const s of r.elements){const l=n.elementOverrides[s.id];l&&Object.assign(s,l)}return n!=null&&n.backgroundOverride&&(r.background=n.backgroundOverride),r}linkSlide(t,n,i,r){const s=this.slides.get(t);if(!s)return null;const l=this.generateId(),c={instanceId:l,libraryItemId:t,presentationId:n,slideIndex:i,overrides:r,syncStatus:"synced",syncedVersion:s.metadata.version};return this.linkedInstances.set(l,c),s.metadata.usageCount++,c}syncLinkedSlide(t){const n=this.linkedInstances.get(t);if(!n)return null;const i=this.slides.get(n.libraryItemId);if(!i)return null;const r=this.useSlide(n.libraryItemId,n.overrides);return r&&(n.syncStatus="synced",n.syncedVersion=i.metadata.version),r}getOutdatedInstances(){const t=[];for(const n of this.linkedInstances.values()){const i=this.slides.get(n.libraryItemId);i&&i.metadata.version>n.syncedVersion&&(n.syncStatus="outdated",t.push(n))}return t}addElement(t,n){const i=this.generateId(),r=new Date().toISOString(),s={metadata:{id:i,type:"element",name:n.name,description:n.description,tags:n.tags??[],createdBy:this.currentUser,createdAt:r,updatedAt:r,version:1,usageCount:0,visibility:n.visibility??"private"},element:JSON.parse(JSON.stringify(t))};return this.elements.set(i,s),s}getElement(t){return this.elements.get(t)}useElement(t){const n=this.elements.get(t);if(!n)return null;n.metadata.usageCount++;const i=JSON.parse(JSON.stringify(n.element));return i.id=this.generateId(),i}addTemplate(t,n){const i=this.generateId(),r=new Date().toISOString(),s={metadata:{id:i,type:"template",name:n.name,description:n.description,tags:n.tags??[],createdBy:this.currentUser,createdAt:r,updatedAt:r,version:1,usageCount:0,visibility:n.visibility??"private"},slides:t.map(l=>this.cloneSlide(l)),variables:n.variables,useCases:n.useCases};return this.templates.set(i,s),s}getTemplate(t){return this.templates.get(t)}useTemplate(t,n){const i=this.templates.get(t);if(!i)return null;i.metadata.usageCount++;const r=i.slides.map(s=>{const l=this.cloneSlide(s);return l.id=this.generateId(),l});return n&&i.variables&&this.applyTemplateVariables(r,i.variables,n),r}createCollection(t){const n=this.generateId(),i={id:n,name:t.name,description:t.description,icon:t.icon,color:t.color,parentId:t.parentId,itemCount:0,createdBy:this.currentUser,createdAt:new Date().toISOString(),visibility:t.visibility??"private"};return this.collections.set(n,i),i}getCollections(){return Array.from(this.collections.values())}addToCollection(t,n){const i=this.slides.get(t),r=this.elements.get(t),s=this.templates.get(t),l=i??r??s;return!l||!this.collections.get(n)?!1:(l.metadata.collectionIds||(l.metadata.collectionIds=[]),l.metadata.collectionIds.includes(n)||(l.metadata.collectionIds.push(n),this.updateCollectionCounts()),!0)}search(t){let n=[];const i=t.types??["slide","element","template"];if(i.includes("slide")&&n.push(...Array.from(this.slides.values())),i.includes("element")&&n.push(...Array.from(this.elements.values())),i.includes("template")&&n.push(...Array.from(this.templates.values())),t.visibility&&(n=n.filter(u=>t.visibility.includes(u.metadata.visibility))),t.query){const u=t.query.toLowerCase();n=n.filter(y=>{var f,p;return y.metadata.name.toLowerCase().includes(u)||((f=y.metadata.description)==null?void 0:f.toLowerCase().includes(u))||((p=y.metadata.tags)==null?void 0:p.some(m=>m.toLowerCase().includes(u)))})}t.tags&&t.tags.length>0&&(n=n.filter(u=>t.tags.some(y=>{var f;return(f=u.metadata.tags)==null?void 0:f.includes(y)}))),t.collectionIds&&t.collectionIds.length>0&&(n=n.filter(u=>t.collectionIds.some(y=>{var f;return(f=u.metadata.collectionIds)==null?void 0:f.includes(y)}))),t.createdBy&&(n=n.filter(u=>u.metadata.createdBy.id===t.createdBy));const r=t.sortBy??"updatedAt",s=t.sortOrder??"desc";n.sort((u,y)=>{let f=0;switch(r){case"name":f=u.metadata.name.localeCompare(y.metadata.name);break;case"createdAt":f=u.metadata.createdAt.localeCompare(y.metadata.createdAt);break;case"updatedAt":f=u.metadata.updatedAt.localeCompare(y.metadata.updatedAt);break;case"usageCount":f=u.metadata.usageCount-y.metadata.usageCount;break}return s==="desc"?-f:f});const l=n.length,c=t.offset??0,d=t.limit??20;return n=n.slice(c,c+d),{items:n,totalCount:l,hasMore:c+n.length<l}}getRecent(t=10){return this.search({sortBy:"updatedAt",sortOrder:"desc",limit:t}).items}getFavorites(){return[...Array.from(this.slides.values()),...Array.from(this.elements.values()),...Array.from(this.templates.values())].filter(n=>n.metadata.isFavorite)}toggleFavorite(t){const n=this.slides.get(t)??this.elements.get(t)??this.templates.get(t);return n?(n.metadata.isFavorite=!n.metadata.isFavorite,!0):!1}generateId(){return`lib_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}cloneSlide(t){return JSON.parse(JSON.stringify(t))}applyPlaceholderValues(t,n,i){for(const r of n){const s=i[r.id];if(s===void 0)continue;const l=t.elements.find(c=>c.id===r.elementId);if(l)switch(r.type){case"text":l.type==="text"&&l.content&&(l.content.text=String(s));break;case"image":l.type==="image"&&l.content&&(l.content.src=String(s));break;case"chart-data":l.type==="chart"&&l.content&&(l.content.data=s);break;case"table-data":l.type==="table"&&l.content&&(l.content.rows=s);break}}}applyTemplateVariables(t,n,i){const r={};for(const s of n){const l=i[s.name]??s.defaultValue;l!==void 0&&(r[`{{${s.name}}}`]=String(l))}for(const s of t)for(const l of s.elements)if(l.type==="text"&&l.content){let c=l.content.text;for(const[d,u]of Object.entries(r))c=c.replace(new RegExp(d.replace(/[{}]/g,"\\$&"),"g"),u);l.content.text=c}}updateCollectionCounts(){for(const n of this.collections.values())n.itemCount=0;const t=[...Array.from(this.slides.values()),...Array.from(this.elements.values()),...Array.from(this.templates.values())];for(const n of t)for(const i of n.metadata.collectionIds??[]){const r=this.collections.get(i);r&&r.itemCount++}}exportLibrary(){return JSON.stringify({slides:Array.from(this.slides.values()),elements:Array.from(this.elements.values()),templates:Array.from(this.templates.values()),collections:Array.from(this.collections.values())})}importLibrary(t){const n=JSON.parse(t);this.slides=new Map(n.slides.map(i=>[i.metadata.id,i])),this.elements=new Map(n.elements.map(i=>[i.metadata.id,i])),this.templates=new Map(n.templates.map(i=>[i.metadata.id,i])),this.collections=new Map(n.collections.map(i=>[i.id,i]))}}function zr(e){const t=e.data;if(typeof t=="string")return t;switch(t.type){case"url":return t.url;case"email":return`mailto:${t.to}${t.subject||t.body?"?":""}${t.subject?`subject=${encodeURIComponent(t.subject)}`:""}${t.subject&&t.body?"&":""}${t.body?`body=${encodeURIComponent(t.body)}`:""}`;case"phone":return`tel:${t.number}`;case"sms":return`sms:${t.number}${t.message?`?body=${encodeURIComponent(t.message)}`:""}`;case"vcard":return Df(t);case"wifi":return`WIFI:T:${t.encryption};S:${t.ssid};P:${t.password??""};H:${t.hidden?"true":"false"};;`;case"geo":return`geo:${t.latitude},${t.longitude}${t.altitude?`,${t.altitude}`:""}${t.label?`?q=${encodeURIComponent(t.label)}`:""}`;case"calendar":return Tf(t);case"presentation-link":return Rf(t);case"feedback-form":return`${hn()}/feedback/${t.formId}?p=${t.presentationId}`;case"poll":return`${hn()}/poll/${t.pollId}`;default:return String(t)}}function Df(e){const t=["BEGIN:VCARD","VERSION:3.0",`N:${e.lastName};${e.firstName};;;`,`FN:${e.firstName} ${e.lastName}`];if(e.organization&&t.push(`ORG:${e.organization}`),e.title&&t.push(`TITLE:${e.title}`),e.email&&t.push(`EMAIL:${e.email}`),e.phone&&t.push(`TEL;TYPE=WORK:${e.phone}`),e.mobile&&t.push(`TEL;TYPE=CELL:${e.mobile}`),e.website&&t.push(`URL:${e.website}`),e.note&&t.push(`NOTE:${e.note}`),e.address){const n=e.address;t.push(`ADR;TYPE=WORK:;;${n.street??""};${n.city??""};${n.state??""};${n.postalCode??""};${n.country??""}`)}return t.push("END:VCARD"),t.join(`
|
|
862
|
+
`)}function Tf(e){const t=(i,r)=>{const s=new Date(i);return r?s.toISOString().replace(/[-:]/g,"").split("T")[0]:s.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,"")},n=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",`DTSTART${e.allDay?";VALUE=DATE":""}:${t(e.startDate,e.allDay)}`,`DTEND${e.allDay?";VALUE=DATE":""}:${t(e.endDate,e.allDay)}`,`SUMMARY:${e.title}`];return e.description&&n.push(`DESCRIPTION:${e.description}`),e.location&&n.push(`LOCATION:${e.location}`),n.push("END:VEVENT","END:VCALENDAR"),n.join(`
|
|
863
|
+
`)}function Rf(e){const t=`${hn()}/present/${e.presentationId}`,n=new URLSearchParams;e.slideIndex!==void 0&&n.set("slide",String(e.slideIndex)),e.accessCode&&n.set("code",e.accessCode),e.allowDownload&&n.set("download","1");const i=n.toString();return i?`${t}?${i}`:t}function hn(){return typeof window<"u"?window.location.origin:"https://app.nice2dev.com"}function Pf(e){const t=e.qrCodes.map(n=>({id:n.id,dataUrl:"",rawData:zr(n),size:n.size??256,config:{...n,errorCorrection:n.errorCorrection??"M",style:{foregroundColor:"#000000",backgroundColor:"#ffffff",cornerSquareStyle:"square",dotStyle:"square",...n.style}}}));return{id:e.id,type:"qrcode",title:e.title,subtitle:e.subtitle,config:{...e,layout:e.layout??"single",showLabels:e.showLabels??!0,animate:e.animate??!0},qrCodes:t}}function Of(e,t){return{id:"presentation-link-slide",title:(t==null?void 0:t.title)??"Join the Presentation",subtitle:"Scan to follow along on your device",layout:"single",qrCodes:[{id:"presentation-qr",type:"presentation-link",data:{type:"presentation-link",presentationId:e,accessCode:t==null?void 0:t.accessCode,expiresAt:t!=null&&t.expiresIn?new Date(Date.now()+t.expiresIn*60*60*1e3).toISOString():void 0},label:"Open Presentation",size:400,style:{cornerSquareStyle:"rounded",dotStyle:"rounded",frame:{style:"banner",text:"Scan Me",color:"#1976d2",textColor:"#ffffff"}}}],callToAction:"Scan the QR code to view on your device",showLabels:!0,animate:!0}}function Lf(e,t){return{id:"feedback-slide",title:"We Value Your Feedback",subtitle:"Help us improve",layout:"single",qrCodes:[{id:"feedback-qr",type:"feedback-form",data:{type:"feedback-form",formId:`feedback_${Date.now()}`,presentationId:e,questions:t??[{id:"q1",type:"rating",question:"How would you rate this presentation?",required:!0},{id:"q2",type:"text",question:"What did you find most valuable?",required:!1},{id:"q3",type:"text",question:"Any suggestions for improvement?",required:!1}],anonymous:!0},label:"Share Feedback",size:350,style:{foregroundColor:"#2e7d32",cornerSquareStyle:"rounded",dotStyle:"classy-rounded"}}],callToAction:"Your feedback helps us improve!",instructions:"Scan the code and answer a few quick questions",showLabels:!0}}function Bf(e,t,n){const i=`poll_${Date.now()}`;return{id:"poll-slide",title:"Live Poll",subtitle:e,layout:"single",qrCodes:[{id:"poll-qr",type:"poll",data:{type:"poll",pollId:i,question:e,options:t,allowMultiple:(n==null?void 0:n.allowMultiple)??!1,showResults:(n==null?void 0:n.showResults)??!0,closesAt:n!=null&&n.closesIn?new Date(Date.now()+n.closesIn*60*1e3).toISOString():void 0},label:"Vote Now",size:350,style:{foregroundColor:"#7b1fa2",cornerSquareStyle:"dot",dotStyle:"dots"}}],callToAction:"Cast your vote!",instructions:"Scan to participate in the poll",showLabels:!0,animate:!0}}function Hf(e){return{id:"contact-slide",title:"Connect With Me",subtitle:`${e.firstName} ${e.lastName}`,layout:"single",qrCodes:[{id:"contact-qr",type:"vcard",data:{type:"vcard",...e},label:"Save Contact",size:350,style:{cornerSquareStyle:"rounded",dotStyle:"rounded",frame:{style:"rounded",text:"Add to Contacts",color:"#424242",textColor:"#ffffff"}}}],callToAction:"Scan to save my contact information",showLabels:!0}}function qf(e,t,n="WPA"){return{id:"wifi-slide",title:"WiFi Network",subtitle:e,layout:"single",qrCodes:[{id:"wifi-qr",type:"wifi",data:{type:"wifi",ssid:e,password:t,encryption:n},label:"Connect to WiFi",size:300,style:{foregroundColor:"#0288d1",cornerSquareStyle:"rounded",dotStyle:"rounded"}}],callToAction:"Scan to connect automatically",showLabels:!0}}function Wf(e){return{id:"multi-qr-slide",title:"Resources & Links",layout:e.length<=2?"side-by-side":"grid",qrCodes:e.map((t,n)=>({id:`qr-${n}`,type:"url",data:t.url,label:t.label,size:e.length<=2?250:180,style:{foregroundColor:t.color??"#000000",cornerSquareStyle:"rounded",dotStyle:"rounded"}})),showLabels:!0,animate:!0}}const $a=["#FF6B6B","#4ECDC4","#45B7D1","#96CEB4","#FFEAA7","#DDA0DD","#98D8C8","#F7DC6F","#BB8FCE","#85C1E9"];function Vf(e){return $a[e%$a.length]}function $r(e,t){const n=e.toArray();return{version:"1.0",id:t.get("id")||Date.now().toString(),title:t.get("title")||"Untitled",author:t.get("author"),slideSize:t.get("slideSize")??{width:1920,height:1080},slides:n,theme:t.get("theme")??{backgroundColor:"#1a1a2e",textColor:"#ffffff",accentColor:"#4ECDC4",fontHeading:"Inter",fontBody:"Inter"},speakerSettings:t.get("speakerSettings"),metadata:t.get("metadata")??{createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}}}function fn(e,t,n,i){i.transact(()=>{t.length>0&&t.delete(0,t.length),t.push(e.slides),n.set("id",e.id),n.set("version",e.version),n.set("title",e.title),n.set("author",e.author),n.set("slideSize",e.slideSize),n.set("theme",e.theme),n.set("speakerSettings",e.speakerSettings),n.set("metadata",{...e.metadata,updatedAt:new Date().toISOString()})})}function Kf(e){const{provider:t,user:n,initialDocument:i,onSync:r,onUserJoin:s,onUserLeave:l,onConnectionChange:c,createYDoc:d,createProvider:u,createUndoManager:y}=e,f=o.useRef(null),p=o.useRef(null),m=o.useRef(null),[w,k]=o.useState({document:i||null,collaborators:[],collaboratorSlides:new Map,collaboratorEditing:new Map,cursors:new Map,selections:new Map,isConnected:!1,isSynced:!1,localUser:n,undoManager:null});o.useEffect(()=>{var U,B;if(!d)return;const F=d();f.current=F;const O=F.getArray("slides"),H=F.getMap("meta");if(i&&fn(i,O,H,F),y){const W=y(F,[O,H]);m.current=W,k(Q=>({...Q,undoManager:W}))}const V=()=>{const W=$r(O,H);k(Q=>({...Q,document:W})),r==null||r(W)};if(F.on("update",V),t&&u){const W=u(F,t);p.current=W,W.on("sync",X=>{k(oe=>({...oe,isSynced:X})),X&&V()}),W.on("connection-error",()=>{k(X=>({...X,isConnected:!1})),c==null||c(!1)}),W.on("connection-close",()=>{k(X=>({...X,isConnected:!1})),c==null||c(!1)});const Q=W.awareness;Q.setLocalState({user:n,currentSlideId:(B=(U=i==null?void 0:i.slides)==null?void 0:U[0])==null?void 0:B.id});const Z=X=>{const oe=Q.getStates(),re=[],he=new Map,J=new Map,le=new Map,pe=new Map;oe.forEach((me,ve)=>{if(ve===Q.clientID||!(me!=null&&me.user))return;const K={id:me.user.id,name:me.user.name,color:me.user.color||Vf(re.length),avatar:me.user.avatar};re.push(K),me.currentSlideId&&he.set(K.id,me.currentSlideId),me.editingElementId!==void 0&&J.set(K.id,me.editingElementId),me.cursor&&le.set(K.id,{x:me.cursor.x,y:me.cursor.y}),me.selection&&pe.set(K.id,me.selection)}),k(me=>({...me,collaborators:re,collaboratorSlides:he,collaboratorEditing:J,cursors:le,selections:pe,isConnected:W.connected}));for(const me of X.added){const ve=oe.get(me);ve!=null&&ve.user&&(s==null||s(ve.user))}for(const me of X.removed)l==null||l({id:String(me),name:"",color:""})};Q.on("change",Z),W.connect(),k(X=>({...X,isConnected:W.connected})),c==null||c(W.connected)}return()=>{var W,Q;F.off("update",V),(W=p.current)==null||W.destroy(),(Q=f.current)==null||Q.destroy(),m.current=null,f.current=null,p.current=null}},[]);const z=o.useCallback((F,O)=>{const H=f.current;if(!H)return;const V=H.getArray("slides");H.transact(()=>{O!==void 0&&O<V.length?V.insert(O,[F]):V.push([F])})},[]),$=o.useCallback((F,O)=>{const H=f.current;if(!H)return;const V=H.getArray("slides");H.transact(()=>{const U=V.toArray(),B=U.findIndex(Q=>Q.id===F);if(B===-1)return;const W={...U[B],...O};V.delete(B,1),V.insert(B,[W])})},[]),g=o.useCallback(F=>{const O=f.current;if(!O)return;const H=O.getArray("slides");O.transact(()=>{const U=H.toArray().findIndex(B=>B.id===F);U!==-1&&H.delete(U,1)})},[]),v=o.useCallback(F=>{const O=f.current;if(!O)return;const H=O.getArray("slides");O.transact(()=>{const V=H.toArray(),U=F.map(B=>V.find(W=>W.id===B)).filter(Boolean);U.length===V.length&&(H.delete(0,H.length),H.push(U))})},[]),N=o.useCallback((F,O)=>{const H=f.current;if(!H)return;const V=H.getArray("slides");H.transact(()=>{const U=V.toArray(),B=U.findIndex(Z=>Z.id===F);if(B===-1)return;const W=U[B],Q={...W,elements:[...W.elements,O]};V.delete(B,1),V.insert(B,[Q])})},[]),j=o.useCallback((F,O,H)=>{const V=f.current;if(!V)return;const U=V.getArray("slides");V.transact(()=>{const B=U.toArray(),W=B.findIndex(oe=>oe.id===F);if(W===-1)return;const Q=B[W],Z=Q.elements.map(oe=>oe.id===O?{...oe,...H}:oe),X={...Q,elements:Z};U.delete(W,1),U.insert(W,[X])})},[]),I=o.useCallback((F,O)=>{const H=f.current;if(!H)return;const V=H.getArray("slides");H.transact(()=>{const U=V.toArray(),B=U.findIndex(Z=>Z.id===F);if(B===-1)return;const W=U[B],Q={...W,elements:W.elements.filter(Z=>Z.id!==O)};V.delete(B,1),V.insert(B,[Q])})},[]),D=o.useCallback(F=>{const O=f.current;if(!O)return;const H=O.getMap("meta");O.transact(()=>{const V=H.get("theme")||{};H.set("theme",{...V,...F})})},[]),b=o.useCallback(F=>{const O=f.current;if(!O)return;const H=O.getMap("meta");O.transact(()=>{const V=H.get("metadata")||{};H.set("metadata",{...V,...F,updatedAt:new Date().toISOString()})})},[]),T=o.useCallback(F=>{const O=f.current;if(!O)return;const H=O.getMap("meta");O.transact(()=>{H.set("title",F)})},[]),R=o.useCallback(F=>{var O;(O=p.current)==null||O.awareness.setLocalStateField("currentSlideId",F)},[]),L=o.useCallback(F=>{var O;(O=p.current)==null||O.awareness.setLocalStateField("editingElementId",F)},[]),M=o.useCallback(F=>{var O,H;F?(O=p.current)==null||O.awareness.setLocalStateField("cursor",{...F,timestamp:Date.now()}):(H=p.current)==null||H.awareness.setLocalStateField("cursor",null)},[]),S=o.useCallback(F=>{var O;(O=p.current)==null||O.awareness.setLocalStateField("selection",F)},[]),x=o.useCallback(()=>{var F;(F=m.current)==null||F.undo()},[]),P=o.useCallback(()=>{var F;(F=m.current)==null||F.redo()},[]),A=o.useCallback(()=>{var F;(F=p.current)==null||F.connect()},[]),E=o.useCallback(()=>{var F;(F=p.current)==null||F.disconnect()},[]),h=o.useCallback(F=>{const O=f.current;if(!O){k(U=>({...U,document:F}));return}const H=O.getArray("slides"),V=O.getMap("meta");fn(F,H,V,O)},[]),C=o.useCallback(()=>w.document,[w.document]);return{state:w,actions:{addSlide:z,updateSlide:$,deleteSlide:g,reorderSlides:v,addElement:N,updateElement:j,deleteElement:I,updateTheme:D,updateMetadata:b,setTitle:T,setCurrentSlide:R,setEditingElement:L,setCursor:M,setSelection:S,undo:x,redo:P,connect:A,disconnect:E,setDocument:h,getDocument:C}}}exports.$i=In;exports.$t=xn;exports.Ae=gt;exports.An=Cn;exports.BRAND_KIT_CORPORATE=mh;exports.BRAND_KIT_NICE2DEV=ph;exports.BRAND_KIT_STARTUP=hh;exports.BUILT_IN_TRANSITIONS=sr;exports.BackgroundRenderer=ur;exports.Bo=Wa;exports.CharacterRegistry=Xn;exports.DEFAULT_KPI_COLORS=Nr;exports.De=ht;exports.Di=Pn;exports.DialogueBox=hr;exports.Dn=Jt;exports.EffectRenderer=pr;exports.Ei=Rn;exports.En=Sn;exports.Es=co;exports.Fe=xe;exports.Ii=On;exports.InteractiveButton=Zp;exports.InteractiveCountdown=Jp;exports.InteractivePoll=Qp;exports.InteractiveQnA=em;exports.InteractiveQuiz=Xp;exports.Ke=Pa;exports.Lo=qa;exports.Mi=Dn;exports.Ms=fo;exports.NiceI18nProvider=Da;exports.NicePresentationEditor=Li;exports.NicePresentationPlayer=qi;exports.PresentationModel=Gt;exports.PresentationToolbar=Gn;exports.PresentationVersionManager=Ff;exports.PuppetAnimationController=dr;exports.PuppetCharacter=gh;exports.PuppetSceneBuilder=Eh;exports.PuppetShowMiniPlayer=Ph;exports.PuppetShowPlayer=vr;exports.PuppetStage=mr;exports.Qa=Ya;exports.Qi=Ro;exports.Qi$1=Bn;exports.Re=pt;exports.SLIDE_16_9=Zd;exports.SLIDE_4_3=Gd;exports.SLIDE_WIDESCREEN=Qd;exports.SlideCanvas=mt;exports.SlideLibraryManager=If;exports.SlidePropertyPanel=Qn;exports.SlideThumbnailList=Zn;exports.THEME_CORPORATE=Hi;exports.THEME_MINIMAL=Jd;exports.THEME_MODERN_DARK=Xd;exports.THEME_NICE2DEV=eu;exports.TRANSITION_BLUR_FADE=tr;exports.TRANSITION_CIRCLE_REVEAL=ir;exports.TRANSITION_CUBE_LEFT=Ji;exports.TRANSITION_FADE=Wi;exports.TRANSITION_FLIP_HORIZONTAL=Qi;exports.TRANSITION_FLIP_VERTICAL=Xi;exports.TRANSITION_GLITCH=rr;exports.TRANSITION_MORPH=or;exports.TRANSITION_ROTATE_IN=er;exports.TRANSITION_SLIDE_DOWN=Yi;exports.TRANSITION_SLIDE_LEFT=Vi;exports.TRANSITION_SLIDE_RIGHT=Ki;exports.TRANSITION_SLIDE_UP=Ui;exports.TRANSITION_WIPE_LEFT=nr;exports.TRANSITION_WIPE_RIGHT=ar;exports.TRANSITION_ZOOM_IN=Zi;exports.TRANSITION_ZOOM_OUT=Gi;exports.Ti=Tn;exports.TimelineEngine=gr;exports.TimelineTrackBuilder=Nh;exports.Vn=Nn;exports.Zn=En;exports.a=kn;exports.addAnimationToCharacter=vh;exports.addExpressionToCharacter=wh;exports.ao=si;exports.applyBrandKit=ch;exports.applyEasing=rm;exports.applyFiltersToData=yf;exports.applySortToData=gf;exports.brandKitToTheme=cr;exports.ca=Vn;exports.calculateSummaryRow=bf;exports.cl=Be;exports.cloneTimeline=Mh;exports.cn=en;exports.computeCustomTransitionState=am;exports.computeElementState=Ud;exports.computeKPIStatus=of;exports.computeTransitionState=Bi;exports.computeTrend=sf;exports.createCharacterFromSpriteSheet=xh;exports.createComparisonWidget=pf;exports.createContactSlide=Hf;exports.createCustomTransition=om;exports.createCustomerCountWidget=Mr;exports.createDashboardSlide=rf;exports.createDataGridSlide=ff;exports.createEmployeeDataGrid=kf;exports.createExecutiveDashboard=mf;exports.createFeedbackSlide=Lf;exports.createKQLQuerySlide=Af;exports.createMultiQRSlide=Wf;exports.createODataQuerySlide=$f;exports.createOperationalDashboard=hf;exports.createPercentageGauge=cf;exports.createPollSlide=Bf;exports.createPresentationLinkSlide=Of;exports.createQRCodeSlide=Pf;exports.createQuerySlide=Sf;exports.createRevenueWidget=Er;exports.createSalesDataGrid=wf;exports.createSalesQuerySlide=zf;exports.createSampleArchitectureData=qm;exports.createSampleIncidentReportData=lh;exports.createSampleOnboardingData=Qm;exports.createSampleProductPitchData=Nm;exports.createSampleQuarterlyReportData=bm;exports.createSampleSprintReviewData=Dm;exports.createSparklineTrend=df;exports.createSpriteSheetFromFrames=Hh;exports.createTrafficLight=uf;exports.createWiFiSlide=qf;exports.de=ke;exports.detectBestVisualization=Ef;exports.ea=Hn;exports.easingFunctions=vt;exports.ei=Ee;exports.encodeQRContent=zr;exports.eo=ai;exports.exportCharacterToEntity=Bh;exports.exportCharacterToSprite=Cr;exports.exportToHtml=Oi;exports.extractQueryParameters=Cf;exports.fi=$n;exports.fi$1=ko;exports.fl=lc;exports.formatCellValue=xf;exports.formatKPIValue=lf;exports.formatTime=Fh;exports.framesToTime=Ah;exports.generateArchitectureOverview=Hm;exports.generateChartConfig=Mf;exports.generateIncidentReport=sh;exports.generateOnboarding=Gm;exports.generateProductPitch=jm;exports.generateQuarterlyReport=ym;exports.generateSprintReview=Im;exports.getConditionalStyle=vf;exports.getEasingFunction=fr;exports.getSceneDuration=zh;exports.getTrackDuration=yr;exports.gi=So;exports.hi=zn;exports.ie=ut;exports.ii=Mn;exports.importAssetAsProp=Sr;exports.importEntityAsCharacter=kr;exports.importProjectCharacters=Oh;exports.importProjectProps=Lh;exports.importSpriteAsCharacter=wr;exports.io=oi;exports.ki=An;exports.ki$1=_o;exports.le=Ri;exports.lerp=nt;exports.lerpPosition=mn;exports.ll=Ye;exports.mapTransitionEffectToId=im;exports.mergePuppetShows=af;exports.no=ri;exports.oa=Wn;exports.oo=li;exports.parseNdpJson=qd;exports.parseSpriteSheetGrid=qh;exports.parseTime=Ih;exports.pi=wo;exports.presentationToPuppetShow=ef;exports.puppetShowToPresentation=Vh;exports.qr=ho;exports.removeBrandKit=dh;exports.renderCharacterToCanvas=fh;exports.renderChartSvg=Fa;exports.rl=Ho;exports.sa=Kn;exports.se=Ti;exports.sn=tn;exports.stringifyNdpJson=Pi;exports.substituteParameters=_f;exports.syncPresentationToYjs=fn;exports.syncYjsToPresentation=$r;exports.ta=qn;exports.timeToFrames=$h;exports.tl=Bo;exports.to=ii;exports.transitionRegistry=lr;exports.transitionToKeyframes=sm;exports.ue=it;exports.useCameraShake=jh;exports.useCharacterRegistry=bh;exports.useCollaborativePresentation=Kf;exports.useNiceTranslation=Qt;exports.usePresentationEditor=Aa;exports.usePuppetAnimation=yh;exports.usePuppetPlayer=Dh;exports.usePuppetShowPlayer=xr;exports.usePuppetStage=Sh;exports.validateParameters=Nf;exports.validateProjectForImport=Wh;exports.validatePuppetShowDocument=nf;exports.vs=at;exports.wa=Yn;exports.ws=Or;exports.xi=Fn;exports.ys=we;
|