@yuktishaalaa/yuktai 5.3.11 → 5.3.12
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/README.md +1 -1
- package/dist/index.js +10 -10
- package/dist/index.mjs +7 -7
- package/package.json +1 -1
- package/vanilla/index.js +3 -1
- package/vanilla/index.min.js +18 -18
package/dist/index.mjs
CHANGED
|
@@ -378,18 +378,18 @@ import{$ as lr,$a as ls,$b as la,A as Li,Aa as Lr,Ab as Ls,Ac as La,B as Yi,Ba a
|
|
|
378
378
|
`,document.body.appendChild(e),rn=e}function In(e){return e.getAttribute("aria-label")?.trim()||e.getAttribute("aria-labelledby")||e.getAttribute("title")?.trim()||e.textContent?.trim()?!0:!!e.querySelector("img[alt]:not([alt='']), svg[aria-label], svg title, [aria-label]")}function Cn(e){let t={critical:20,serious:10,moderate:5,minor:2},A=e.details.reduce((o,n)=>o+(t[n.severity]||0),0);return Math.max(0,Math.min(100,100-A))}var Ge={name:"yuktai-a11y",version:"4.0.0",observer:null,async execute(e){if(!e.enabled)return this.stopObserver(),"yuktai: disabled.";Nt=e,ng(e),ig(),rg(),Za(),_a(),e.showSkipLinks!==!1&&ja(),e.showPreferencePanel,og(e);let t=this.applyFixes(e);t.score=Cn(t),e.showAuditBadge&&tg(t),e.timeoutWarning&&fn(e.timeoutWarning),e.autoFix&&this.startObserver(e),e.plainEnglish&&await gn(!0),e.summarisePage&&await ln(!0),e.translateLanguage&&e.translateLanguage!=="en"&&await cn(e.translateLanguage),e.voiceControl&&await un(!0),e.smartLabels&&await dn(!0);let A=`${t.fixed} fixes applied. Score: ${t.score}/100.`;return re(A,t.score>=90?"success":"info",!1),`yuktai v4.0.0: ${A} Scanned ${t.scanned} elements in ${t.renderTime}ms.`},applyFixes(e){let t={fixed:0,scanned:0,renderTime:0,score:100,details:[]};if(typeof document>"u")return t;let A=performance.now(),o=document.querySelectorAll("*");t.scanned=o.length;let n=(r,i,s,g)=>{t.details.push({tag:r,fix:i,severity:s,element:g.outerHTML.slice(0,100)}),t.fixed++};return o.forEach(r=>{let i=r,s=i.tagName.toLowerCase();if(s==="html"&&!i.getAttribute("lang")&&(i.setAttribute("lang","en"),n(s,'lang="en" added',"critical",i)),s==="meta"){let l=i.getAttribute("name"),I=i.getAttribute("content")||"";l==="viewport"&&I.includes("user-scalable=no")&&(i.setAttribute("content",I.replace("user-scalable=no","user-scalable=yes")),n(s,"user-scalable=yes restored","serious",i)),l==="viewport"&&/maximum-scale=1(?:[^0-9]|$)/.test(I)&&(i.setAttribute("content",I.replace(/maximum-scale=1(?=[^0-9]|$)/,"maximum-scale=5")),n(s,"maximum-scale=5 restored","serious",i))}if(s==="main"&&!i.getAttribute("tabindex")&&(i.setAttribute("tabindex","-1"),i.getAttribute("id")||i.setAttribute("id","main-content")),s==="img"&&(i.hasAttribute("alt")||(i.setAttribute("alt",""),i.setAttribute("aria-hidden","true"),n(s,'alt="" aria-hidden="true"',"serious",i))),s==="svg"&&(!i.getAttribute("aria-hidden")&&!i.getAttribute("aria-label")&&!r.querySelector("title")&&(i.setAttribute("aria-hidden","true"),n(s,'aria-hidden="true" (decorative svg)',"minor",i)),i.getAttribute("focusable")||i.setAttribute("focusable","false")),s==="iframe"&&!i.getAttribute("title")&&!i.getAttribute("aria-label")&&(i.setAttribute("title","embedded content"),i.setAttribute("aria-label","embedded content"),n(s,"title + aria-label added","serious",i)),s==="button"){if(!In(i)){let l=i.getAttribute("title")||"button";i.setAttribute("aria-label",l),n(s,`aria-label="${l}" (empty button)`,"critical",i)}i.hasAttribute("disabled")&&!i.getAttribute("aria-disabled")&&(i.setAttribute("aria-disabled","true"),t.fixed++)}if(s==="a"){let l=i;In(i)||(i.setAttribute("aria-label",i.getAttribute("title")||"link"),n(s,"aria-label added (empty link)","critical",i)),l.target==="_blank"&&!l.rel?.includes("noopener")&&(l.rel="noopener noreferrer",t.fixed++)}if(an.has(s)){let l=i;if(!(!!(l.labels&&l.labels.length)||!!i.getAttribute("title")||l.type==="hidden"||l.type==="submit"||l.type==="button"||l.type==="reset")&&!i.getAttribute("aria-label")&&!i.getAttribute("aria-labelledby")){let u=i.getAttribute("placeholder")||i.getAttribute("name")||s;i.setAttribute("aria-label",u),n(s,`aria-label="${u}"`,"serious",i)}if(i.hasAttribute("required")&&!i.getAttribute("aria-required")&&(i.setAttribute("aria-required","true"),t.fixed++),s==="input"&&!l.autocomplete){let u=l.name||"",C=l.type==="email"||u.includes("email")?"email":l.type==="tel"||u.includes("tel")?"tel":l.type==="password"?"current-password":"";C&&(l.autocomplete=C,t.fixed++)}}s==="th"&&!i.getAttribute("scope")&&(i.setAttribute("scope",i.closest("thead")?"col":"row"),n(s,"scope added to <th>","moderate",i));let g=(s==="header"||s==="footer")&&!!i.parentElement?.closest("article,aside,main,nav,section,[role='dialog'],[role='region']");oo[s]&&!i.getAttribute("role")&&!g&&(i.setAttribute("role",oo[s]),n(s,`role="${oo[s]}"`,"minor",i));let a=i.getAttribute("role")||"";a==="tab"&&!i.getAttribute("aria-selected")&&(i.setAttribute("aria-selected","false"),t.fixed++),["alert","status","log"].includes(a)&&!i.getAttribute("aria-live")&&(i.setAttribute("aria-live",a==="alert"?"assertive":"polite"),n(s,`aria-live added on role=${a}`,"moderate",i)),a==="combobox"&&!i.getAttribute("aria-expanded")&&(i.setAttribute("aria-expanded","false"),n(s,'aria-expanded="false" on combobox',"serious",i)),(a==="checkbox"||a==="radio")&&!i.getAttribute("aria-checked")&&(i.setAttribute("aria-checked","false"),n(s,`aria-checked="false" on role=${a}`,"serious",i))}),t.renderTime=parseFloat((performance.now()-A).toFixed(2)),t},scan(){let e={fixed:0,scanned:0,renderTime:0,score:100,details:[]};if(typeof document>"u")return e;let t=performance.now(),A=document.querySelectorAll("*");e.scanned=A.length;let o=(n,r,i,s)=>e.details.push({tag:n,fix:r,severity:i,element:s.outerHTML.slice(0,100)});return A.forEach(n=>{let r=n,i=r.tagName.toLowerCase();(i==="a"||i==="button")&&!r.innerText?.trim()&&!r.getAttribute("aria-label")&&o(i,"needs aria-label (empty)","critical",r),i==="img"&&!r.hasAttribute("alt")&&o(i,"needs alt text","serious",r),an.has(i)&&!r.getAttribute("aria-label")&&!r.getAttribute("aria-labelledby")&&o(i,"needs aria-label","serious",r),i==="iframe"&&!r.getAttribute("title")&&!r.getAttribute("aria-label")&&o(i,"iframe needs title","serious",r)}),e.fixed=e.details.length,e.score=Cn(e),e.renderTime=parseFloat((performance.now()-t).toFixed(2)),e},startObserver(e){this.observer||typeof document>"u"||(this.observer=new MutationObserver(()=>this.applyFixes(e)),this.observer.observe(document.body,{childList:!0,subtree:!0,attributes:!1}))},stopObserver(){this.observer?.disconnect(),this.observer=null},announce:re,speak:no,showVisualAlert:pn,trapFocus:bA,handlePlainEnglish:gn,handleSummarisePage:ln,handleTranslate:cn,handleVoiceControl:un,handleSmartLabels:dn,SUPPORTED_LANGUAGES:mA};import di,{useEffect as At,useState as ae,useCallback as lt}from"react";import{forwardRef as sg,useEffect as EA,useState as bt}from"react";import{jsx as k,jsxs as _}from"react/jsx-runtime";var io={highContrast:!1,reduceMotion:!1,autoFix:!0,dyslexiaFont:!1,fontScale:100,localFont:"",darkMode:!1,largeTargets:!1,speechEnabled:!1,colorBlindMode:"none",showAuditBadge:!1,timeoutWarning:void 0,plainEnglish:!1,summarisePage:!1,translateLanguage:"en",voiceControl:!1,smartLabels:!1},Ft=[80,90,100,110,120,130],ag=[{value:"none",label:"None"},{value:"deuteranopia",label:"Deuteranopia"},{value:"protanopia",label:"Protanopia"},{value:"tritanopia",label:"Tritanopia"},{value:"achromatopsia",label:"Greyscale"}],gg=["Prompt API for Gemini Nano","Summarization API for Gemini Nano","Writer API for Gemini Nano","Rewriter API for Gemini Nano","Translation API"];function lg(){let[e,t]=bt(typeof window<"u"?window.innerWidth:1024);return EA(()=>{let A=()=>t(window.innerWidth);return window.addEventListener("resize",A),()=>window.removeEventListener("resize",A)},[]),{isMobile:e<=480,isTablet:e>480&&e<=768}}function cg({checked:e,onChange:t,label:A,disabled:o=!1}){return _("label",{"aria-label":A,style:{position:"relative",display:"inline-flex",width:"40px",height:"24px",cursor:o?"not-allowed":"pointer",flexShrink:0,opacity:o?.4:1},children:[k("input",{type:"checkbox",checked:e,disabled:o,onChange:n=>t(n.target.checked),style:{opacity:0,width:0,height:0,position:"absolute"}}),k("span",{style:{position:"absolute",inset:0,borderRadius:"99px",background:e?"#0d9488":"#cbd5e1",transition:"background 0.2s"}}),k("span",{style:{position:"absolute",top:"3px",left:e?"19px":"3px",width:"18px",height:"18px",background:"#fff",borderRadius:"50%",transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)",pointerEvents:"none"}})]})}function Tt({label:e,color:t="#64748b",badge:A,concept:o}){return _("div",{style:{margin:"10px 18px 4px"},children:[_("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[k("p",{style:{margin:0,fontSize:"10px",fontWeight:600,color:t,letterSpacing:"0.06em",textTransform:"uppercase"},children:e}),A&&k("span",{style:{fontSize:"9px",fontWeight:500,padding:"1px 7px",borderRadius:"99px",background:"#f5f3ff",color:"#7c3aed",border:"0.5px solid #c4b5fd",whiteSpace:"nowrap"},children:A})]}),o&&k("p",{style:{margin:"2px 0 0",fontSize:"9px",color:"#94a3b8",fontStyle:"italic"},children:o})]})}function Ue({icon:e,label:t,desc:A,checked:o,onChange:n,disabled:r=!1,disabledReason:i,tip:s}){return _("div",{title:r?i:s,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 18px",gap:"12px"},children:[_("div",{style:{display:"flex",alignItems:"center",gap:"10px",flex:1,minWidth:0},children:[k("span",{"aria-hidden":"true",style:{width:"32px",height:"32px",borderRadius:"8px",background:r?"#f1f5f9":"#f0fdfa",color:r?"#94a3b8":"#0d9488",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"15px",flexShrink:0,fontWeight:700},children:e}),_("div",{style:{minWidth:0},children:[k("p",{style:{margin:0,fontSize:"13px",fontWeight:500,color:r?"#94a3b8":"#0f172a",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t}),k("p",{style:{margin:0,fontSize:"10px",color:"#94a3b8"},children:r?i:A})]})]}),k(cg,{checked:o,onChange:n,label:`Toggle ${t}`,disabled:r})]})}function Be(){return k("div",{style:{height:"1px",background:"#f1f5f9"}})}function Vt({steps:e}){return _("div",{style:{margin:"0 18px 8px",padding:"8px 10px",background:"#f8fafc",borderRadius:"8px",border:"0.5px solid #e2e8f0"},children:[k("p",{style:{margin:"0 0 4px",fontSize:"9px",fontWeight:600,color:"#64748b",textTransform:"uppercase",letterSpacing:"0.05em"},children:"How to use"}),e.map((t,A)=>_("p",{style:{margin:"0 0 2px",fontSize:"10px",color:"#475569"},children:[A+1,". ",t]},A))]})}var ro=sg(({position:e,settings:t,report:A,isActive:o,aiSupported:n,voiceSupported:r,set:i,onApply:s,onReset:g,onClose:a},l)=>{let{isMobile:I,isTablet:u}=lg(),[C,h]=bt([]),[y,f]=bt(""),[B,m]=bt(""),[p,c]=bt(!1),[d,Q]=bt(null),[b,S]=bt("idle");EA(()=>{let E=window;!!(E.LanguageModel||E.ai?.languageModel)&&n?Q("gemini"):dA()&&Q("transformers")},[n]),EA(()=>{if(d!=="transformers")return;let E=setInterval(()=>{S(zt())},500);return()=>clearInterval(E)},[d]);let F=async()=>{if(!(!y.trim()||p)){if(!d){m("\u26A0\uFE0F No AI engine available on this device.");return}c(!0),m("");try{let E;d==="gemini"?E=await Jo(y):(S("loading"),E=await Po(y),S("ready")),m(E.success&&E.answer?E.answer.replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/#+\s/g,"").trim():"\u26A0\uFE0F "+(E.error||"No answer found on this page"))}catch{m("\u26A0\uFE0F Failed to get answer. Please try again.")}c(!1)}};EA(()=>{(async()=>{try{let j=window;if(!j.queryLocalFonts)return;let Ae=await j.queryLocalFonts(),J=[...new Set(Ae.map(ee=>ee.family))].sort();h(J.slice(0,50))}catch{}})()},[]);let P=d==="gemini"?"Gemini Nano":d==="transformers"?"Transformers.js \xB7 All devices":"Detecting...",G=d==="transformers"&&b==="loading"?"Loading AI model... (first time only)":"...",D=I?{position:"fixed",bottom:0,left:0,right:0,zIndex:9999,background:"#fff",border:"1px solid #e2e8f0",borderRadius:"16px 16px 0 0",boxShadow:"0 -8px 32px rgba(0,0,0,0.12)",maxHeight:"90vh",overflowY:"auto",fontFamily:"system-ui,-apple-system,sans-serif",width:"100%"}:{position:"fixed",bottom:"84px",[e]:"24px",zIndex:9999,width:u?"300px":"320px",maxWidth:"calc(100vw - 48px)",background:"#fff",border:"1px solid #e2e8f0",borderRadius:"16px",boxShadow:"0 8px 32px rgba(0,0,0,0.12)",maxHeight:"80vh",overflowY:"auto",fontFamily:"system-ui,-apple-system,sans-serif"};return _("div",{ref:l,role:"dialog","aria-modal":"true","aria-label":"yuktai accessibility preferences","data-yuktai-panel":"true",style:D,children:[_("div",{style:{padding:"14px 18px 12px",borderBottom:"1px solid #f1f5f9",display:"flex",alignItems:"flex-start",justifyContent:"space-between",position:"sticky",top:0,background:"#fff",zIndex:1},children:[_("div",{children:[_("div",{style:{display:"flex",alignItems:"center",gap:"7px",marginBottom:"4px",flexWrap:"wrap"},children:[k("span",{style:{fontSize:"10px",fontWeight:700,padding:"2px 7px",borderRadius:"99px",background:"#f0fdfa",color:"#0d9488",letterSpacing:"0.05em",fontFamily:"monospace"},children:"@yuktishaalaa/yuktai"}),o&&k("span",{style:{fontSize:"10px",fontWeight:700,padding:"2px 7px",borderRadius:"99px",background:"#f0fdfa",color:"#0f766e",border:"1px solid #99f6e4"},children:"\u25CF ACTIVE"})]}),k("p",{style:{margin:"0 0 1px",fontSize:"15px",fontWeight:600,color:"#0f172a"},children:"Accessibility"}),k("p",{style:{margin:0,fontSize:"11px",color:"#64748b"},children:"WCAG 2.2 \xB7 Open source \xB7 Zero cost \xB7 All devices"})]}),k("button",{onClick:a,"aria-label":"Close accessibility panel",style:{background:"none",border:"none",cursor:"pointer",padding:"4px",color:"#94a3b8",fontSize:"20px",lineHeight:1,borderRadius:"6px",flexShrink:0,minWidth:I?"44px":"auto",minHeight:I?"44px":"auto",display:"flex",alignItems:"center",justifyContent:"center"},children:"\xD7"})]}),k(Tt,{label:"\u267F Core Accessibility",concept:"Rule-based engine \u2014 works on all browsers and devices"}),k(Vt,{steps:["Toggle any feature on","Click Apply settings","Preferences saved automatically"]}),k(Ue,{icon:"\u{1F527}",label:"Auto-fix ARIA",desc:"Injects missing labels and roles automatically",checked:t.autoFix,onChange:E=>i("autoFix",E),tip:"Fixes aria-label, alt text, roles on every element"}),k(Be,{}),k(Ue,{icon:"\u{1F50A}",label:"Speak on focus",desc:"Browser reads elements aloud as you tab",checked:t.speechEnabled,onChange:E=>i("speechEnabled",E),tip:"Uses browser SpeechSynthesis \u2014 no install needed"}),k(Be,{}),k(Ue,{icon:"\u{1F399}\uFE0F",label:"Voice control",desc:"Say commands to navigate the page",checked:t.voiceControl,onChange:E=>i("voiceControl",E),disabled:!r,disabledReason:"Not supported in this browser",tip:'Say "scroll down", "go to main", "click"'}),k(Be,{}),k(Tt,{label:"\u{1F916} AI Features",color:"#7c3aed",badge:"Gemini Nano",concept:"Large Language Model running privately on your device \u2014 Chrome 127+ only"}),k("div",{style:{margin:"4px 18px 6px",padding:"8px 10px",background:n?"#f0fdfa":"#f5f3ff",borderRadius:"8px",border:`0.5px solid ${n?"#99f6e4":"#c4b5fd"}`,fontSize:"10px",color:n?"#0f766e":"#7c3aed",lineHeight:1.5},children:n?"\u2705 Gemini Nano detected \u2014 AI features ready. Runs privately on your device.":"\u2699\uFE0F AI features need one-time setup \u2014 see guide below."}),!n&&_("div",{style:{margin:"0 18px 8px",padding:"10px 12px",background:"#fafafa",borderRadius:"8px",border:"0.5px solid #e2e8f0",fontSize:"11px",color:"#475569",lineHeight:1.7},children:[k("p",{style:{margin:"0 0 6px",fontWeight:600,color:"#0f172a",fontSize:"11px"},children:"\u{1F6E0} One-time setup \u2014 5 steps:"}),_("p",{style:{margin:"0 0 3px"},children:["1. Open Chrome \u2192 ",k("code",{style:{background:"#f1f5f9",padding:"1px 5px",borderRadius:"4px",fontSize:"10px",color:"#0d9488",fontFamily:"monospace"},children:"chrome://flags"})]}),k("p",{style:{margin:"0 0 3px"},children:"2. Enable each flag:"}),k("div",{style:{display:"flex",flexDirection:"column",gap:"2px",margin:"4px 0 6px 10px"},children:gg.map(E=>_("span",{style:{fontSize:"10px",color:"#7c3aed",fontFamily:"monospace"},children:["\u2192 ",E]},E))}),_("p",{style:{margin:"0 0 3px"},children:["3. Click ",k("strong",{style:{color:"#0f172a"},children:"Relaunch"})]}),_("p",{style:{margin:"0 0 3px"},children:["4. ",k("code",{style:{background:"#f1f5f9",padding:"1px 5px",borderRadius:"4px",fontSize:"10px",color:"#0d9488",fontFamily:"monospace"},children:"chrome://components"})," \u2192 Optimization Guide On Device Model \u2192 Check for update"]}),k("p",{style:{margin:"0"},children:"5. Refresh \u2014 AI features unlock automatically \u2705"})]}),k(Ue,{icon:"\u{1F4DD}",label:"Plain English mode",desc:"Rewrites complex text in simple language",checked:t.plainEnglish,onChange:E=>i("plainEnglish",E),disabled:!n,disabledReason:"Enable Gemini Nano \u2014 see setup above",tip:"AI concept: LLM text rewriting"}),k(Be,{}),k(Ue,{icon:"\u{1F4CB}",label:"Summarise page",desc:"3-sentence summary appears at top",checked:t.summarisePage,onChange:E=>i("summarisePage",E),disabled:!n,disabledReason:"Enable Gemini Nano \u2014 see setup above",tip:"AI concept: Abstractive summarisation"}),k(Be,{}),k(Ue,{icon:"\u{1F3F7}\uFE0F",label:"Smart aria-labels",desc:"AI generates meaningful labels for elements",checked:t.smartLabels,onChange:E=>i("smartLabels",E),disabled:!n,disabledReason:"Enable Gemini Nano \u2014 see setup above",tip:"AI concept: Context-aware label generation"}),k(Be,{}),k(Tt,{label:"\u{1F441}\uFE0F Visual",concept:"CSS filter-based \u2014 works on all browsers and devices"}),k(Vt,{steps:["Toggle any visual mode","Changes apply instantly","Works on mobile and desktop"]}),k(Ue,{icon:"\u25D1",label:"High contrast",desc:"Boosts contrast for low vision users",checked:t.highContrast,onChange:E=>i("highContrast",E),tip:"CSS filter: contrast()"}),k(Be,{}),k(Ue,{icon:"\u{1F319}",label:"Dark mode",desc:"Inverts colours \u2014 easy on eyes at night",checked:t.darkMode,onChange:E=>i("darkMode",E),tip:"CSS filter: invert + hue-rotate"}),k(Be,{}),k(Ue,{icon:"\u23F8\uFE0F",label:"Reduce motion",desc:"Disables all animations",checked:t.reduceMotion,onChange:E=>i("reduceMotion",E),tip:"WCAG 2.3.3 \u2014 vestibular disorders"}),k(Be,{}),k(Ue,{icon:"\u{1F446}",label:"Large targets",desc:"44\xD744px minimum touch targets",checked:t.largeTargets,onChange:E=>i("largeTargets",E),tip:"WCAG 2.5.8 \u2014 motor impaired users"}),k(Be,{}),_("div",{style:{padding:"10px 18px"},children:[k("p",{style:{margin:"0 0 2px",fontSize:"12px",fontWeight:500,color:"#0f172a"},children:"\u{1F3A8} Colour blindness"}),k("p",{style:{margin:"0 0 8px",fontSize:"10px",color:"#94a3b8"},children:"SVG colour matrix filters \u2014 all devices"}),k("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:ag.map(E=>k("button",{onClick:()=>i("colorBlindMode",E.value),"aria-pressed":t.colorBlindMode===E.value,style:{padding:"4px 10px",borderRadius:"20px",fontSize:"11px",fontWeight:500,border:`1px solid ${t.colorBlindMode===E.value?"#0d9488":"#e2e8f0"}`,background:t.colorBlindMode===E.value?"#f0fdfa":"#fff",color:t.colorBlindMode===E.value?"#0d9488":"#64748b",cursor:"pointer",minHeight:I?"36px":"auto"},children:E.label},E.value))})]}),k(Be,{}),k(Tt,{label:"\u{1F524} Font",concept:"Browser Font API + CSS \u2014 Chrome 103+"}),k(Vt,{steps:["Toggle dyslexia font or pick from device","Adjust size with + / \u2212","Saved across visits"]}),k(Ue,{icon:"Aa",label:"Dyslexia-friendly font",desc:"Atkinson Hyperlegible \u2014 research-backed",checked:t.dyslexiaFont,onChange:E=>i("dyslexiaFont",E),tip:"By Braille Institute \u2014 free and open source"}),k(Be,{}),_("div",{style:{padding:"10px 18px"},children:[k("p",{style:{margin:"0 0 2px",fontSize:"12px",fontWeight:500,color:"#0f172a"},children:"\u{1F5A5}\uFE0F Local font"}),k("p",{style:{margin:"0 0 8px",fontSize:"10px",color:"#94a3b8"},children:"window.queryLocalFonts() \u2014 Chrome 103+"}),C.length>0?_("select",{value:t.localFont,onChange:E=>i("localFont",E.target.value),"aria-label":"Choose a font from your device",style:{width:"100%",padding:"8px 10px",borderRadius:"8px",border:"1px solid #e2e8f0",fontSize:"13px",color:"#0f172a",background:"#fff",cursor:"pointer",height:I?"44px":"36px"},children:[k("option",{value:"",children:"System default"}),C.map(E=>k("option",{value:E,style:{fontFamily:E},children:E},E))]}):k("p",{style:{margin:0,fontSize:"11px",color:"#94a3b8"},children:"Allow font access when Chrome prompts you."})]}),k(Be,{}),_("div",{style:{padding:"10px 18px 14px"},children:[_("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"10px"},children:[_("div",{children:[k("p",{style:{margin:0,fontSize:"12px",fontWeight:500,color:"#0f172a"},children:"\u{1F4CF} Text size"}),k("p",{style:{margin:0,fontSize:"10px",color:"#94a3b8"},children:"Scales all text on the page"})]}),_("span",{style:{fontSize:"12px",fontWeight:600,color:"#0d9488",background:"#f0fdfa",padding:"2px 8px",borderRadius:"99px"},children:[t.fontScale,"%"]})]}),_("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[k("button",{onClick:()=>{let E=Ft.indexOf(t.fontScale);E>0&&i("fontScale",Ft[E-1])},disabled:t.fontScale<=80,"aria-label":"Decrease text size",style:{width:I?"44px":"30px",height:I?"44px":"30px",borderRadius:"8px",border:"1px solid #e2e8f0",background:"#fff",cursor:t.fontScale<=80?"not-allowed":"pointer",fontSize:"16px",color:t.fontScale<=80?"#cbd5e1":"#0f172a",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:"\u2212"}),k("div",{style:{flex:1,display:"flex",gap:"3px"},children:Ft.map(E=>k("button",{onClick:()=>i("fontScale",E),"aria-label":`Set text size to ${E}%`,style:{flex:1,height:"6px",borderRadius:"99px",border:"none",cursor:"pointer",padding:0,background:E<=t.fontScale?"#0d9488":"#e2e8f0",transition:"background 0.15s"}},E))}),k("button",{onClick:()=>{let E=Ft.indexOf(t.fontScale);E<Ft.length-1&&i("fontScale",Ft[E+1])},disabled:t.fontScale>=130,"aria-label":"Increase text size",style:{width:I?"44px":"30px",height:I?"44px":"30px",borderRadius:"8px",border:"1px solid #e2e8f0",background:"#fff",cursor:t.fontScale>=130?"not-allowed":"pointer",fontSize:"16px",color:t.fontScale>=130?"#cbd5e1":"#0f172a",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:"+"})]})]}),k(Be,{}),k(Tt,{label:"\u{1F310} Translate",color:"#7c3aed",badge:"Gemini Nano",concept:"Chrome Translation API \u2014 on device, no internet after setup"}),k(Vt,{steps:["Enable Gemini Nano first","Pick your language","Full page translates instantly"]}),_("div",{style:{padding:"6px 18px 12px"},children:[k("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:mA.slice(0,I?8:18).map(E=>k("button",{onClick:()=>i("translateLanguage",E.code),"aria-pressed":t.translateLanguage===E.code,disabled:!n,style:{padding:"4px 10px",borderRadius:"20px",fontSize:"11px",fontWeight:500,border:`1px solid ${t.translateLanguage===E.code?"#7c3aed":"#e2e8f0"}`,background:t.translateLanguage===E.code?"#f5f3ff":"#fff",color:t.translateLanguage===E.code?"#7c3aed":"#64748b",cursor:n?"pointer":"not-allowed",opacity:n?1:.5,minHeight:I?"36px":"auto"},children:E.label},E.code))}),!n&&k("p",{style:{margin:"6px 0 0",fontSize:"10px",color:"#94a3b8"},children:"Enable Gemini Nano using the setup guide above."})]}),k(Be,{}),k(Tt,{label:"\u{1F4AC} Ask This Page",color:"#0d9488",badge:P,concept:"RAG \u2014 Retrieval Augmented Generation. Works on all devices including mobile."}),k(Vt,{steps:["Type any question about this page","Press Ask or hit Enter",d==="transformers"?"Transformers.js answers \u2014 works on mobile, offline":"Gemini Nano reads page and answers privately","Zero cost. No data leaves your device."]}),_("div",{style:{margin:"0 18px 8px",padding:"6px 10px",background:d==="gemini"?"#f0fdfa":d==="transformers"?"#f5f3ff":"#f8fafc",borderRadius:"8px",border:`0.5px solid ${d==="gemini"?"#99f6e4":d==="transformers"?"#c4b5fd":"#e2e8f0"}`,fontSize:"10px",color:d==="gemini"?"#0f766e":d==="transformers"?"#7c3aed":"#94a3b8"},children:[d==="gemini"&&"\u2705 Using Gemini Nano \u2014 on device, private, instant",d==="transformers"&&"\u2705 Using Transformers.js \u2014 works on mobile and all browsers",!d&&"\u23F3 Detecting AI engine...",d==="transformers"&&b==="loading"&&" \xB7 Loading model...",d==="transformers"&&b==="ready"&&" \xB7 Model ready \u2705"]}),_("div",{style:{padding:"0 18px 14px"},children:[_("div",{style:{display:"flex",gap:"6px",marginBottom:"8px"},children:[k("input",{type:"text",value:y,onChange:E=>f(E.target.value),onKeyDown:E=>{E.key==="Enter"&&F()},placeholder:"e.g. What does this page do?",disabled:p||!d,"aria-label":"Ask a question about this page",style:{flex:1,padding:"8px 10px",borderRadius:"8px",border:"1px solid #e2e8f0",fontSize:"12px",color:"#0f172a",background:d?"#fff":"#f8fafc",outline:"none",height:I?"44px":"36px"}}),k("button",{onClick:F,disabled:p||!y.trim()||!d,"aria-label":"Ask question",style:{padding:"8px 14px",borderRadius:"8px",border:"none",background:d&&y.trim()&&!p?"#0d9488":"#e2e8f0",color:d&&y.trim()&&!p?"#fff":"#94a3b8",fontSize:"12px",fontWeight:600,cursor:d&&y.trim()&&!p?"pointer":"not-allowed",flexShrink:0,height:I?"44px":"36px",minWidth:"52px",transition:"background 0.2s"},children:p?G:"Ask"})]}),B&&_("div",{role:"status","aria-live":"polite",style:{padding:"10px 12px",background:"#f0fdfa",border:"1px solid #99f6e4",borderRadius:"8px",fontSize:"12px",color:"#0f766e",lineHeight:1.6,maxHeight:"180px",overflowY:"auto"},children:[k("strong",{style:{display:"block",marginBottom:"4px",fontSize:"11px",color:"#0d9488"},children:"\u{1F4AC} Answer"}),B,k("button",{onClick:()=>{m(""),f("")},style:{display:"block",marginTop:"6px",background:"none",border:"none",color:"#94a3b8",fontSize:"10px",cursor:"pointer",padding:0},children:"Clear"})]})]}),A&&k("div",{role:"status",style:{margin:"0 14px 10px",padding:"8px 12px",background:"#f0fdfa",border:"1px solid #99f6e4",borderRadius:"8px",fontSize:"12px",color:"#0f766e",fontWeight:500,fontFamily:"monospace"},children:A.fixed>0?`\u2713 ${A.fixed} fixes \xB7 ${A.scanned} nodes \xB7 ${A.renderTime}ms \xB7 Score: ${A.score}/100`:`\u2713 0 auto-fixes needed \xB7 ${A.scanned} nodes \xB7 ${A.renderTime}ms`}),_("div",{style:{display:"flex",gap:"8px",padding:"12px 14px 14px",position:I?"sticky":"relative",bottom:I?0:"auto",background:"#fff",borderTop:"1px solid #f1f5f9"},children:[k("button",{onClick:g,style:{flex:1,padding:I?"12px 0":"8px 0",fontSize:"13px",fontWeight:500,borderRadius:"9px",border:"1px solid #e2e8f0",background:"#fff",color:"#64748b",cursor:"pointer"},children:"Reset"}),k("button",{onClick:s,style:{flex:2,padding:I?"12px 0":"8px 0",fontSize:"13px",fontWeight:600,borderRadius:"9px",border:"none",background:"#0d9488",color:"#fff",cursor:"pointer"},children:"Apply settings"})]})]})});ro.displayName="WidgetPanel";import{useState as jt,useCallback as hn}from"react";var ug={hotel:["hotel","resort","motel","inn","accommodation","lodge","stay","room","booking","hospitality"],ecommerce:["shop","store","ecommerce","e-commerce","sell","product","cart","buy","marketplace","retail"],restaurant:["restaurant","food","cafe","cafeteria","menu","dining","eat","cuisine","bistro","takeaway","delivery"],portfolio:["portfolio","freelance","personal","designer","developer","creative","showcase","work","hire me"],blog:["blog","article","post","write","news","magazine","journal","content"],saas:["saas","dashboard","app","software","platform","tool","analytics","admin","manage","crm"],government:["government","govt","portal","citizen","scheme","welfare","municipal","public","official"],healthcare:["hospital","clinic","doctor","health","medical","patient","appointment","pharmacy"],education:["school","college","university","course","learn","education","student","lms","training"],realestate:["real estate","property","house","flat","apartment","rent","buy property","listing"],landing:["landing","startup","launch","product launch","coming soon","waitlist"],generic:[]},dg={hotel:["home","rooms","booking","about","contact"],ecommerce:["home","products","cart","checkout","about","contact"],restaurant:["home","menu","reservations","about","contact"],portfolio:["home","portfolio","about","contact"],blog:["home","blog","about","contact"],saas:["home","pricing","dashboard","auth","about","contact"],government:["home","services","about","contact","faq"],healthcare:["home","services","booking","team","about","contact"],education:["home","services","pricing","about","contact"],realestate:["home","products","about","contact"],landing:["home","pricing","about","contact"],generic:["home","about","services","contact"]},Ig={home:["home","homepage","main","landing"],about:["about","who we are","our story","company"],contact:["contact","reach us","get in touch","location"],services:["service","what we offer","solution","offering"],pricing:["pricing","price","plan","subscription","cost","fee"],blog:["blog","article","news","post"],auth:["login","register","signup","sign up","sign in","auth","account"],dashboard:["dashboard","admin","panel","manage","analytics"],gallery:["gallery","photo","image","portfolio"],products:["product","shop","store","item","catalogue"],cart:["cart","basket","shopping cart"],checkout:["checkout","payment","pay","order"],rooms:["room","suite","accommodation","stay"],booking:["booking","reserve","reservation","schedule","appointment"],menu:["menu","food","dish","cuisine"],reservations:["reservation","table booking","book table"],portfolio:["portfolio","work","project","case study"],team:["team","staff","member","people","who we are"],faq:["faq","question","answer","help","support"],terms:["terms","condition","legal"],privacy:["privacy","policy","gdpr","data"]},Cg={Authentication:["login","register","auth","signup","sign in","account"],Payment:["payment","stripe","pay","checkout","billing"],Search:["search","filter","find"],"Dark mode":["dark mode","dark theme","night mode"],"Multi-language":["multilingual","multi language","translation","i18n"],SEO:["seo","search engine","meta","google"],Analytics:["analytics","tracking","stats","dashboard"],Email:["email","newsletter","contact form","notification"],Map:["map","location","address","google maps"],"Social media":["social","instagram","facebook","twitter","share"],"Image gallery":["gallery","photo","image","carousel"],"Booking system":["booking","reservation","appointment","schedule"],"Shopping cart":["cart","basket","shop","ecommerce"],"Blog/CMS":["blog","cms","content","article","post"]},pg={blue:["blue","navy","sky","ocean","corporate"],green:["green","nature","eco","environment","health","fresh"],purple:["purple","violet","luxury","creative","royal"],red:["red","bold","energy","passion","food"],orange:["orange","warm","friendly","fun"],teal:["teal","turquoise","modern","tech"],indigo:["indigo","professional","trust","finance","bank"],gray:["gray","minimal","clean","simple","neutral"]},fg={hotel:"indigo",ecommerce:"blue",restaurant:"red",portfolio:"purple",blog:"gray",saas:"teal",government:"blue",healthcare:"green",education:"indigo",realestate:"orange",landing:"purple",generic:"blue"};function mg(e){let t=[/(?:for|called|named|company|business|brand)\s+["']?([A-Z][a-zA-Z\s]{1,30})["']?/i,/["']([A-Z][a-zA-Z\s]{1,30})["']/,/^([A-Z][a-zA-Z]+(?:\s[A-Z][a-zA-Z]+)?)/m];for(let A of t){let o=e.match(A);if(o?.[1]){let n=o[1].trim();if(n.length>2&&n.length<40)return n}}return"My Business"}function hg(e){let t=e.toLowerCase(),A="generic",o=0;for(let[n,r]of Object.entries(ug)){let i=0;for(let s of r)t.includes(s)&&i++;i>o&&(o=i,A=n)}return A}function yg(e,t){let A=e.toLowerCase(),o=new Set(dg[t]);for(let[n,r]of Object.entries(Ig))for(let i of r)if(A.includes(i)){o.add(n);break}return o.add("home"),o.add("contact"),Array.from(o)}function Qg(e){let t=e.toLowerCase(),A=[];for(let[o,n]of Object.entries(Cg))for(let r of n)if(t.includes(r)){A.push(o);break}return A}function Bg(e,t){let A=e.toLowerCase();for(let[o,n]of Object.entries(pg))for(let r of n)if(A.includes(r))return o;return fg[t]}function mn(e){let t=hg(e),A=yg(e,t),o=Qg(e),n=Bg(e,t);return{siteName:mg(e),websiteType:t,pages:A,features:o,theme:n,description:e.slice(0,200)}}import{Fragment as xg,jsx as V,jsxs as le}from"react/jsx-runtime";var bg=["Hotel booking website for Grand Palace Hotels with rooms, booking and payment","E-commerce store for organic food products with cart and checkout","Restaurant website for Spice Garden with menu and table reservations","Portfolio website for a freelance designer with gallery and contact","SaaS dashboard for project management with pricing and auth","Government portal for citizen services with FAQ and contact"],Eg={home:"\u{1F3E0}",about:"\u2139\uFE0F",contact:"\u{1F4EC}",services:"\u2699\uFE0F",pricing:"\u{1F4B0}",blog:"\u{1F4DD}",auth:"\u{1F510}",dashboard:"\u{1F4CA}",gallery:"\u{1F5BC}\uFE0F",products:"\u{1F6D2}",cart:"\u{1F6CD}\uFE0F",checkout:"\u{1F4B3}",rooms:"\u{1F6CF}\uFE0F",booking:"\u{1F4C5}",menu:"\u{1F37D}\uFE0F",reservations:"\u{1FA91}",portfolio:"\u{1F4BC}",team:"\u{1F465}",faq:"\u2753",terms:"\u{1F4C4}",privacy:"\u{1F512}"},wg={hotel:"\u{1F3E8}",ecommerce:"\u{1F6D2}",restaurant:"\u{1F37D}\uFE0F",portfolio:"\u{1F4BC}",blog:"\u{1F4DD}",saas:"\u26A1",government:"\u{1F3DB}\uFE0F",healthcare:"\u{1F3E5}",education:"\u{1F393}",realestate:"\u{1F3E0}",landing:"\u{1F680}",generic:"\u{1F310}"};function so({position:e,onClose:t}){let[A,o]=jt("input"),[n,r]=jt(""),[i,s]=jt(null),[g,a]=jt(0),[l,I]=jt(""),u=hn(()=>{if(!n.trim())return;let f=mn(n);s(f),o("preview")},[n]),C=hn(async()=>{if(i){o("generating"),a(0),I("");try{let f=[{msg:"Parsing requirement...",pct:15},{msg:"Loading templates...",pct:30},{msg:"Generating pages...",pct:55},{msg:"Building components...",pct:70},{msg:"Creating styles...",pct:85},{msg:"Packaging ZIP...",pct:95}];for(let m of f)a(m.pct),await new Promise(p=>setTimeout(p,200));let{generateZip:B}=await import("./zip-generator-D5EXBBNS.mjs");await B(i),a(100),o("done")}catch(f){I(f instanceof Error?f.message:"Generation failed. Please try again."),o("preview")}}},[i]),h=()=>{o("input"),r(""),s(null),a(0),I("")},y={position:"fixed",bottom:"204px",[e]:"24px",zIndex:9999,width:"340px",maxWidth:"calc(100vw - 48px)",background:"#fff",border:"1px solid #e2e8f0",borderRadius:"16px",boxShadow:"0 8px 32px rgba(0,0,0,0.14)",fontFamily:"system-ui,-apple-system,sans-serif",maxHeight:"75vh",overflowY:"auto"};return le("div",{role:"dialog","aria-modal":"true","aria-label":"yuktai Vibe Coder","data-yuktai-panel":"true",style:y,children:[le("div",{style:{padding:"14px 16px 12px",borderBottom:"1px solid #f1f5f9",display:"flex",alignItems:"flex-start",justifyContent:"space-between",position:"sticky",top:0,background:"#fff",zIndex:1},children:[le("div",{children:[V("p",{style:{margin:"0 0 2px",fontSize:"13px",fontWeight:700,color:"#0f172a"},children:"\u26A1 Vibe Coder"}),V("p",{style:{margin:0,fontSize:"10px",color:"#64748b"},children:"Describe your website \u2192 Download Next.js ZIP"})]}),V("button",{onClick:t,"aria-label":"Close vibe coder",style:{background:"none",border:"none",cursor:"pointer",color:"#94a3b8",fontSize:"18px",padding:"2px"},children:"\xD7"})]}),A==="input"&&le("div",{style:{padding:"14px 16px"},children:[V("p",{style:{margin:"0 0 10px",fontSize:"11px",color:"#64748b"},children:"Describe your business website in plain English. The plugin will generate a complete Next.js project for you."}),V("p",{style:{margin:"0 0 6px",fontSize:"10px",fontWeight:600,color:"#94a3b8",textTransform:"uppercase"},children:"Examples"}),V("div",{style:{display:"flex",flexDirection:"column",gap:"4px",marginBottom:"12px"},children:bg.slice(0,3).map(f=>V("button",{onClick:()=>r(f),style:{padding:"6px 10px",borderRadius:"8px",border:"1px solid #e2e8f0",background:"#f8fafc",color:"#475569",fontSize:"10px",cursor:"pointer",textAlign:"left",lineHeight:1.4},children:f},f))}),V("textarea",{value:n,onChange:f=>r(f.target.value),placeholder:"e.g. I need a hotel booking website with rooms, search, and payment for Grand Palace Hotels",rows:4,"aria-label":"Describe your website",style:{width:"100%",padding:"10px",borderRadius:"8px",border:"1px solid #e2e8f0",fontSize:"12px",color:"#0f172a",resize:"vertical",outline:"none",fontFamily:"inherit",lineHeight:1.5}}),V("button",{onClick:u,disabled:!n.trim(),style:{width:"100%",marginTop:"10px",padding:"10px",borderRadius:"8px",border:"none",background:n.trim()?"#f59e0b":"#e2e8f0",color:n.trim()?"#fff":"#94a3b8",fontSize:"13px",fontWeight:700,cursor:n.trim()?"pointer":"not-allowed",transition:"background 0.2s"},children:"Analyse Requirement \u2192"})]}),A==="preview"&&i&&le("div",{style:{padding:"14px 16px"},children:[l&&le("div",{style:{padding:"10px",background:"#fef2f2",border:"1px solid #fca5a5",borderRadius:"8px",marginBottom:"12px",fontSize:"11px",color:"#dc2626"},children:["\u26A0\uFE0F ",l]}),le("div",{style:{background:"#f8fafc",borderRadius:"10px",padding:"12px",marginBottom:"12px"},children:[le("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"8px"},children:[V("span",{style:{fontSize:"1.5rem"},children:wg[i.websiteType]||"\u{1F310}"}),le("div",{children:[V("p",{style:{margin:0,fontSize:"13px",fontWeight:700,color:"#0f172a"},children:i.siteName}),le("p",{style:{margin:0,fontSize:"10px",color:"#64748b",textTransform:"capitalize"},children:[i.websiteType," website \xB7 ",i.theme," theme"]})]})]}),le("p",{style:{margin:"8px 0 6px",fontSize:"10px",fontWeight:600,color:"#94a3b8",textTransform:"uppercase"},children:["Pages to generate (",i.pages.length,")"]}),V("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px"},children:i.pages.map(f=>le("span",{style:{padding:"2px 8px",borderRadius:"99px",background:"#f0fdf4",border:"1px solid #86efac",fontSize:"10px",color:"#166534",fontWeight:500},children:[Eg[f]||"\u{1F4C4}"," ",f]},f))}),i.features.length>0&&le(xg,{children:[V("p",{style:{margin:"10px 0 6px",fontSize:"10px",fontWeight:600,color:"#94a3b8",textTransform:"uppercase"},children:"Detected features"}),V("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px"},children:i.features.map(f=>V("span",{style:{padding:"2px 8px",borderRadius:"99px",background:"#f5f3ff",border:"1px solid #c4b5fd",fontSize:"10px",color:"#7c3aed",fontWeight:500},children:f},f))})]})]}),le("div",{style:{margin:"0 0 12px",padding:"10px 12px",background:"#f0fdf4",borderRadius:"8px",border:"1px solid #86efac"},children:[V("p",{style:{margin:"0 0 4px",fontSize:"10px",fontWeight:700,color:"#166534"},children:"\u{1F4E6} What you get:"}),le("p",{style:{margin:0,fontSize:"10px",color:"#166534",lineHeight:1.6},children:["\u2705 Complete Next.js 16 project",V("br",{}),"\u2705 Tailwind CSS + CSS Modules",V("br",{}),"\u2705 TypeScript configured",V("br",{}),"\u2705 Navbar + Footer components",V("br",{}),"\u2705 All ",i.pages.length," pages ready",V("br",{}),"\u2705 Mobile responsive",V("br",{}),"\u2705 npm run dev \u2192 works immediately"]})]}),le("div",{style:{display:"flex",gap:"8px"},children:[V("button",{onClick:h,style:{flex:1,padding:"9px",borderRadius:"8px",border:"1px solid #e2e8f0",background:"#fff",color:"#64748b",fontSize:"12px",fontWeight:600,cursor:"pointer"},children:"\u2190 Edit"}),V("button",{onClick:C,style:{flex:2,padding:"9px",borderRadius:"8px",border:"none",background:"#f59e0b",color:"#fff",fontSize:"13px",fontWeight:700,cursor:"pointer"},children:"\u2B07\uFE0F Generate & Download ZIP"})]})]}),A==="generating"&&le("div",{style:{padding:"2rem 16px",textAlign:"center"},children:[V("p",{style:{fontSize:"2rem",marginBottom:"1rem"},children:"\u26A1"}),V("p",{style:{fontSize:"13px",fontWeight:700,color:"#0f172a",marginBottom:"0.5rem"},children:"Generating your project..."}),V("p",{style:{fontSize:"11px",color:"#64748b",marginBottom:"1.5rem"},children:g<30?"Parsing requirement...":g<55?"Loading templates...":g<70?"Generating pages...":g<85?"Building components...":g<95?"Creating styles...":"Packaging ZIP..."}),V("div",{style:{height:"8px",background:"#e2e8f0",borderRadius:"99px",overflow:"hidden"},children:V("div",{style:{height:"100%",width:`${g}%`,background:"#f59e0b",borderRadius:"99px",transition:"width 0.3s ease"}})}),le("p",{style:{marginTop:"0.5rem",fontSize:"10px",color:"#94a3b8"},children:[g,"%"]})]}),A==="done"&&i&&le("div",{style:{padding:"2rem 16px",textAlign:"center"},children:[V("p",{style:{fontSize:"3rem",marginBottom:"0.75rem"},children:"\u2705"}),le("p",{style:{fontSize:"14px",fontWeight:700,color:"#0f172a",marginBottom:"0.5rem"},children:[i.siteName," downloaded!"]}),V("p",{style:{fontSize:"11px",color:"#64748b",marginBottom:"1.5rem",lineHeight:1.6},children:"Your ZIP is downloading. Unzip it and run:"}),["npm install","npm run dev"].map(f=>V("div",{style:{background:"#0f172a",borderRadius:"8px",padding:"8px 12px",marginBottom:"6px",textAlign:"left"},children:le("code",{style:{fontSize:"12px",color:"#a7f3d0",fontFamily:"monospace"},children:["$ ",f]})},f)),V("p",{style:{fontSize:"11px",color:"#10b981",margin:"1rem 0",fontWeight:600},children:"Then open http://localhost:3000 \u{1F680}"}),le("div",{style:{display:"flex",gap:"8px"},children:[V("button",{onClick:h,style:{flex:1,padding:"9px",borderRadius:"8px",border:"1px solid #e2e8f0",background:"#fff",color:"#64748b",fontSize:"12px",fontWeight:600,cursor:"pointer"},children:"New Project"}),V("button",{onClick:C,style:{flex:1,padding:"9px",borderRadius:"8px",border:"none",background:"#f59e0b",color:"#fff",fontSize:"12px",fontWeight:700,cursor:"pointer"},children:"\u2B07\uFE0F Download Again"})]})]})]})}var yn=["AGFzbQEAAAABggESYAN/f38Bf2ACf38Bf2ACf38AYAN/f38AYAN/fH8AYAN/f3wAYAV/f39/fwBgBX9/f39/AX9gBH9/f38AYAR/","f39/AX9gAX8AYAp/f39/f3x/f39/AX9gAABgAX8Bf2AIf39/f3x/f38Bf2AAAX9gBn9/f39/fwBgBn9/f39/fwF/A2xrAgMEBQMD","AwMGAwAGAwYHBwcDAwgICAgDAwMDAwMDAwMIAwMDCQkJCQkJCQkJCQkJAQEAAwkHCgELCAIDCggKAwMADA0ODwIMAgMGEAIDAgYK","AwYCAgwKCgMBCAEDEQgJAAEICAMDAwwJAwAEBQFwAQICBQMBABEGCQF/AUGAgMAACwdaBgZtZW1vcnkCAAx5a19yYWdfYnVpbGQA","QQx5a19yYWdfcmVzZXQAQg55a19yYWdfc2NyYXRjaABDDXlrX3JhZ19zZWFyY2gARA55a19yYWdfdmVyc2lvbgBFCQcBAEEBCwFh","CqTuAWuOAgEGfwJAAkACQCAAKAIIIgJFDQAgASgCACIDKAIIIQRBACEFIAAoAgQiBiEBA0AgASgCACIHIARPDQICQCADKAIEIAdB","A3RqKwMARAAAAAAAAAAAZA0AAkAgBUEBaiACTw0AIAFBBGohASAFQX9zIAJqIQIDQCABKAIAIgcgAygCCCIETw0GAkAgAygCBCAH","QQN0aisDAEQAAAAAAAAAAGRFDQAgBiAFQQJ0aiAHNgIAIAVBAWohBQsgAUEEaiEBIAJBf2oiAg0ACwsgACAFNgIIDwsgAUEEaiEB","IAIgBUEBaiIFRw0ACwsPCyAHIARB8IbAgAAQ3ICAgAAACyAHIARB8IbAgAAQ3ICAgAAAC4gBAQJ/AkBBACACIAFrIgMgAyACSxsi","BCAAKAIAIAAoAggiA2tNDQAgACADIARBBEEEEMqAgIAAIAAoAgghAwsCQCABIAJPDQAgAyACaiABayEEIAAoAgQgA0ECdGohAwNA","IAMgATYCACADQQRqIQMgAiABQQFqIgFHDQALIAQhAwsgACADNgIIC/ABAQN/I4CAgIAAQSBrIgMkgICAgAACQAJAAkACQCABvVAN","ACADQRRqIAJBAEEIQQgQz4CAgAAgAygCGCEEIAMoAhRBAUYNAiADQQA2AhAgAyADKAIcNgIMIAMgBDYCCCADQQhqIAIgARCDgICA","ACAAIAMoAhA2AgggACADKQIINwIADAELIANBFGogAkEBQQhBCBDPgICAACADKAIYIQQgAygCFEEBRg0CIAMoAhwhBSAAIAI2Aggg","ACAFNgIEIAAgBDYCAAsgA0EgaiSAgICAAA8LIAQgAygCHBDMgICAAAALIAQgAygCHBDMgICAAAALlAEBA38CQCABIAAoAgAgACgC","CCIDa00NACAAIAMgAUEIQQgQyoCAgAAgACgCCCEDCyAAKAIEIANBA3RqIQQCQAJAAkAgAUECSQ0AIAFBf2ohBQNAIAQgAjkDACAE","QQhqIQQgBUF/aiIFDQALIAMgAWpBf2ohAwwBCyABRQ0BCyAEIAI5AwAgA0EBaiEDCyAAIAM2AggLzAEBA38jgICAgABBEGsiAySA","gICAAAJAAkACQAJAIAFB/wFxDQAgA0EEaiACQQFBAUEBEM+AgIAAIAMoAgghBCADKAIEQQFGDQIgAygCDCEFDAELIANBBGogAkEA","QQFBARDPgICAACADKAIIIQQgAygCBEEBRg0CIAMoAgwhBSACRQ0AIAUgASAC/AsACyAAIAI2AgggACAFNgIEIAAgBDYCACADQRBq","JICAgIAADwsgBCADKAIMEMyAgIAAAAsgBCADKAIMEMyAgIAAAAvvAQECfyOAgICAAEEgayIDJICAgIAAAkACQAJAAkAgAUUNACAD","QRRqIAJBAEEEQQQQz4CAgAAgAygCGCEEIAMoAhRBAUYNAiADQQA2AhAgAyADKAIcNgIMIAMgBDYCCCADQQhqIAIgARCGgICAACAA","IAMoAhA2AgggACADKQIINwIADAELIANBFGogAkEBQQRBBBDPgICAACADKAIYIQEgAygCFEEBRg0CIAMoAhwhBCAAIAI2AgggACAE","NgIEIAAgATYCAAsgA0EgaiSAgICAAA8LIAQgAygCHBDMgICAAAALIAEgAygCHBDMgICAAAALlAEBA38CQCABIAAoAgAgACgCCCID","a00NACAAIAMgAUEEQQQQyoCAgAAgACgCCCEDCyAAKAIEIANBAnRqIQQCQAJAAkAgAUECSQ0AIAFBf2ohBQNAIAQgAjYCACAEQQRq","IQQgBUF/aiIFDQALIAMgAWpBf2ohAwwBCyABRQ0BCyAEIAI2AgAgA0EBaiEDCyAAIAM2AggLkAUDBX8CfAN/AkAgAUECSQ0AAkAC","QAJAAkACQAJAAkAgACgCACIDIAIoAgAoAgAiBCgCCCIFTw0AIAAoAgQiBiAFTw0BAkACQEEAQQBBfyAEKAIEIgcgA0EDdGorAwAi","CCAHIAZBA3RqKwMAIglmIgQbQQFBfiAEGyAIIAllGyAIIAhiIAkgCWJyGyIEQX9GIAYgA0kgBBsiCg0AQQIhAyABQQJGDQEgAEEI","a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A5lGyASIBJiIhMgD3IbIgpB","f0YgCyAMSSAKG0cNACAHIAggEUEAQQBBfyASIA1mIgYbQQFBfiAGGyASIA1lGyATIBByGyIGQX9GIAkgDEkgBhtzGyEGCyAGIABr","IghBAnYhBiACRQ0GIAAgCGooAgAiCCAEKAIAKAIAIgkoAggiC08NAyACKAIAIgcgC08NBEEAQQBBfyAJKAIEIgsgCEEDdGorAwAi","DiALIAdBA3RqKwMAIg1mIgsbQQFBfiALGyAOIA1lGyAOIA5iIA0gDWJyGyILQX9GIAcgCEkgCxsNBiAFIAQ2AgwgACABIAYgBUEM","ahCqgICAACIGQQFqIQIgBiABTw0FIAEgAmshASAAIAJBAnRqIQBBACECDAcLIAkgBkHQhsCAABDcgICAAAALIAsgBkHghsCAABDc","gICAAAALIAwgBkHQhsCAABDcgICAAAALIAggC0HQhsCAABDcgICAAAALIAcgC0HghsCAABDcgICAAAALIAIgASABQcCGwIAAENqA","gIAAAAsgACAAIAEgBiAEEKyAgIAAIgYgAiADIAQQiICAgAAgASAGQX9zaiEBIAAgBkECdGoiAkEEaiEACyADQX9qIQMgAUEhTw0A","CwsgACABIAQQnYCAgAALIAVBEGokgICAgAALlQIBBH8CQCABQQJJDQACQAJAAkAgAiAAQQRqIAAQioCAgAAiAw0AQQIhBCABQQJG","DQEgAEEEaiEFQQIhBANAIAIgBUEEaiIGIAUQioCAgAANAiAGIQUgASAEQQFqIgRHDQAMAwsLQQIhBCABQQJGDQAgAEEEaiEFQQIh","BANAIAIgBUEEaiIGIAUQioCAgABFDQEgBiEFIAEgBEEBaiIERg0CDAALCyAEIAFGDQAgACABQQAgAUEBcmdBAXRBPnMgAhCLgICA","AAwBCyADRQ0AIAFBAXYhBSABQQJ0IABqQXxqIQQDQCAAKAIAIQEgACAEKAIANgIAIAQgATYCACAEQXxqIQQgAEEEaiEAIAVBf2oi","BQ0ACwsLwAIBBX8CQAJAAkACQAJAAkAgASgCACIDIAAoAgAiACgCBCIEKAIIIgFPDQAgA0EBaiI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CGohBiAHIQMgASAFQQFqIgVGDQIMAAsLIAUgAUYN","ACAAIAFBACABQQFyZ0EBdEE+cyACEI2AgIAADAELIARFDQAgAUEBdiEGIAFBA3QgAGpBeGohBQNAIAApAwAhAyAAIAUpAwA3AwAg","BSADNwMAIAVBeGohBSAAQQhqIQAgBkF/aiIGDQALCwvbAgIDfwN+AkAgAUEhSQ0AIANBf2ohAwNAAkAgA0F/Rw0AIAAgASAAEKOA","gIAADwsgACABQQN2IgVBOGxqIQYgACAFQQV0aiEHAkACQCABQcAASQ0AIAAgByAGIAUgBBCQgICAACEFDAELIAAgBiAHIAApAwAi","CCAHKQMAIglUIgUgCSAGKQMAIgpUcxsgBSAIIApUcxshBQsgBSAAayIGQQN2IQUCQAJAIAJFDQAgAikDACAAIAZqKQMAVA0AIAAg","ASAFIAAQroCAgAAiBUEBaiECAkAgBSABTw0AIAEgAmshASAAIAJBA3RqIQBBACECDAILIAIgASABQcCGwIAAENqAgIAAAAsgACAA","IAEgBSAAEK+AgIAAIgUgAiADIAQQjYCAgAAgASAFQX9zaiEBIAAgBUEDdGoiAkEIaiEACyADQX9qIQMgAUEhTw0ACwsgACABIAQQ","n4CAgAALswMFA38CfAJ/AXwBfwJAIANB+P///wFxRQ0AIAAgACADQQN2IgNBBHQiBWogACADQRxsIgZqIAMgBBCOgICAACEAIAEg","ASAFaiABIAZqIAMgBBCOgICAACEBIAIgAiAFaiACIAZqIAMgBBCOgICAACECCwJAAkACQCABKAIAIgMgBCgCACgCACIHKAIIIgZP","DQAgACgCACIEIAZPDQEgAigCACIFIAZPDQICQEEAQQBBfyAHKAIEIgYgA0EDdGorAwAiCCAGIARBA3RqKwMAIglmIgcbQQFBfiAH","GyAIIAllGyAIIAhiIgogCSAJYiIHchsiC0F/RiAEIANJIAsbIgtBAEEAQX8gBiAFQQN0aisDACIMIAlmIgYbQQFBfiAGGyAMIAll","GyAMIAxiIg0gB3IbIgZBf0YgBCAFSSAGG0cNACACIAEgC0EAQQBBfyAMIAhmIgAbQQFBfiAAGyAMIAhlGyANIApyGyIAQX9GIAMg","BUkgABtzGyEACyAADwsgAyAGQdCGwIAAENyAgIAAAAsgBCAGQeCGwIAAENyAgIAAAAsgBSAGQdCGwIAAENyAgIAAAAuiAQECfwJA","IANB+P///wFxRQ0AIAAgACADQQN2IgNBBHQiBWogACADQRxsIgZqIAMgBBCPgICAACEAIAEgASAFaiABIAZqIAMgBBCPgICAACEB","IAIgAiAFaiACIAZqIAMgBBCPgICAACECCwJAIAQgACABEIqAgIAAIgMgBCAAIAIQioCAgABHDQAgAiABIAMgBCABIAIQioCAgABz","GyEACyAAC5gBAgJ/A34CQCADQfj///8BcUUNACAAIAAgA0EDdiIDQQV0IgVqIAAgA0E4bCIGaiADIAQQkICAgAAhACABIAEgBWog","ASAGaiADIAQQkICAgAAhASACIAIgBWogAiAGaiADIAQQkICAgAAhAgsgACACIAEgACkDACIHIAEpAwAiCFQiAyAIIAIpAwAiCVRz","GyADIAcgCVRzGwvwAgQFfwF8AX8BfAJAAkACQAJAIAFBfGoiAygCACIEIAIoAgAiBSgCACIGKAIIIgdPDQAgASgCACICIAdPDQEC","QEEAQQBBfyAGKAIEIgEgBEEDdGorAwAiCCABIAJBA3QiCWorAwAiCmYiARtBAUF+IAEbIAggCmUbIAggCGIgCiAKYnIbIgFBf0Yg","AiAESSABG0EBRw0AAkADQCADIgFBBGogBDYCACABIABGDQEgAUF8aiIDKAIAIgQgBSgCACIGKAIIIgdPDQUgAiAHTw0GQQBBAEF/","IAYoAgQiByAEQQN0aisDACIIIAcgCWorAwAiCmYiBxtBAUF+IAcbIAggCmUbIAggCGIgCiAKYnIbIgdBf0YgAiAESSAHGw0ACwsg","ASACNgIACw8LIAQgB0HQhsCAABDcgICAAAALIAIgB0HghsCAABDcgICAAAALIAQgB0HQhsCAABDcgICAAAALIAIgB0HghsCAABDc","gICAAAALfAEDfyOAgICAAEEQayIDJICAgIAAAkAgAiABIAFBfGoiBBCKgICAAEUNACADIAEoAgAiBT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AgAEEDQQUgAhCWgICAACAAQQZBCCACEJaAgIAAIABBAkEDIAIQloCA","gAAgAEEEQQUgAhCWgICAACAAQQZBByACEJaAgIAAIABBAUECIAIQloCAgAAgAEEDQQQgAhCWgICAACAAQQVBBiACEJaAgIAADwsA","C8wKAQl/AkAgAUEJSQ0AIABBDEEAIAIgAEEMaiIBIAAQioCAgAAiAxtqKAIAIQQgACAAQQBBDCADG2ooAgA2AgwgACAENgIAIABB","HEEEIAIgAEEcaiIFIABBBGoiBhCKgICAACIDG2ooAgAhBCAAIABBBEEcIAMbaigCADYCHCAAIAQ2AgQgAEEUQQggAiAAQRRqIgMg","AEEIaiIHEIqAgIAAIgQbaigCACEIIAAgAEEIQRQgBBtqKAIANgIUIAAgCDYCCCAAQSBBECACIABBIGoiCSAAQRBqIgQQioCAgAAi","CBtqKAIAIQogACAAQRBBICAIG2ooAgA2AiAgACAKNgIQIABBHEEAIAIgBSAAEIqAgIAAIggbaigCACEKIAAgAEEAQRwgCBtqKAIA","NgIcIAAgCjYCACAAQRBBCCACIAQgBxCKgICAACIIG2ooAgAhCiAAIABBCEEQIAgbaigCADYCECAAIAo2AgggAEEgQQwgAiAJIAEQ","ioCAgAAiCBtqKAIAIQogACAAQQxBICAIG2ooAgA2AiAgACAKNgIMIABBGEEUIAIgAEEYaiIIIAMQioCAgAAiChtqKAIAIQsgACAA","QRRBGCAKG2ooAgA2AhggACALNgIUIABBCEEAIAIgByAAEIqAgIAAIgobaigCACELIAAgAEEAQQggChtqKAIANgIIIAAgCzYCACAA","QQxBBCACIAEgBhCKgICAACIKG2ooAgAhCyAAIABBBEEMIAobaigCADYCDCAAIAs2AgQgAEEUQRAgAiADIAQQioCAgAAiChtqKAIA","IQsgACAAQRBBFCAKG2ooAgA2AhQgACALNgIQIABBIEEcIAIgCSAFEIqAgIAAIgobaigCACELIAAgAEEcQSAgChtqKAIANgIgIAAg","CzYCHCAAQRBBBCACIAQgBhCKgICAACIKG2ooAgAhCyAAIABBBEEQIAobaigCADYCECAAIAs2AgQgAEEYQQwgAiAIIAEQioCAgAAi","ChtqKAIAIQsgACAAQQxBGCAKG2ooAgA2AhggACALNgIMIABBHEEUIAIgBSADEIqAgIAAIgobaigCACELIAAgAEEUQRwgChtqKAIA","NgIcIAAgCzYCFCAAQQRBACACIAYgABCKgICAACIKG2ooAgAhCyAAIABBAEEEIAobaigCADYCBCAAIAs2AgAgAEEQQQggAiAEIAcQ","ioCAgAAiChtqKAIAIQsgACAAQQhBECAKG2ooAgA2AhAgACALNgIIIABBFEEMIAIgAyABEIqAgIAAIgobaigCACELIAAgAEEMQRQg","ChtqKAIANgIUIAAgCzYCDCAAQSBBGCACIAkgCBCKgICAACIJG2ooAgAhCiAAIABBGEEgIAkbaigCADYCICAAIAo2AhggAEEMQQgg","AiABIAcQioCAgAAiCRtqKAIAIQogACAAQQhBDCAJG2ooAgA2AgwgACAKNgIIIABBFEEQIAIgAyAEEIqAgIAAIgkbaigCACEKIAAg","AEEQQRQgCRtqKAIANgIUIAAgCjYCECAAQRxBGCACIAUgCBCKgICAACIFG2ooAgAhCSAAIABBGEEcIAUbaigCADYCHCAAIAk2Ahgg","AEEIQQQgAiAHIAYQioCAgAAiBxtqKAIAIQUgACAAQQRBCCAHG2ooAgA2AgggACAFNgIEIABBEEEMIAIgBCABEIqAgIAAIgEbaigC","ACEEIAAgAEEMQRAgARtqKAIANgIQIAAgBDYCDCAAQRhBFCACIAggAxCKgICAACICG2ooAgAhASAAIABBFEEYIAIbaigCADYCGCAA","IAE2AhQPCwAL3gQBEH4CQCABQQlJDQAgACAAKQNAIgMgACkDICIEIAMgBFYbIgUgACkDGCIGIAApAwAiByAGIAdWGyIIIAUgCFYb","IgkgACkDOCIKIAApAwgiCyAKIAtWGyIMIAYgByAGIAdUGyIGIAwgBlYbIgcgCSAHVhsiDSAAKQMwIg4gACkDKCIPIAApAxAiECAP","IBBWGyIRIA4gEVYbIhIgBSAIIAUgCFQbIgUgCiALIAogC1QbIgggBSAIVhsiCiASIApWGyILIA0gC1YbNwNAIAAgDiARIA4gEVQb","Ig4gAyAEIAMgBFQbIgMgDyAQIA8gEFQbIgQgAyAEVhsiDyAOIA9UGyIQIAUgCCAFIAhUGyIFIBAgBVQbIgggAyAEIAMgBFQbIgMg","DCAGIAwgBlQbIgQgAyAEVBsiBiAIIAZUGzcDACAAIAkgByAJIAdUGyIHIA4gDyAOIA9WGyIJIAcgCVYbIgwgDSALIA0gC1QbIgsg","DCALVhs3AzggACAMIAsgDCALVBsiCyAHIAkgByAJVBsiByASIAogEiAKVBsiCSAHIAlWGyIKIBAgBSAQIAVWGyIFIAMgBCADIARW","GyIDIAUgA1YbIgQgCiAEVhsiDCALIAxWGzcDMCAAIAsgDCALIAxUGzcDKCAAIAogBCAKIARUGyIEIAcgCSAHIAlUGyIHIAUgAyAF","IANUGyIDIAcgA1YbIgUgBCAFVhs3AyAgACAEIAUgBCAFVBs3AxggACAHIAMgByADVBsiAyAIIAYgCCAGVhsiBCADIARWGzcDECAA","IAMgBCADIARUGzcDCA8LAAuEBQACQCABQQ1JDQAgAEEAQQwgAhCWgICAACAAQQFBCiACEJaAgIAAIABBAkEJIAIQloCAgAAgAEED","QQcgAhCWgICAACAAQQVBCyACEJaAgIAAIABBBkEIIAIQloCAgAAgAEEBQQYgAhCWgICAACAAQQJBAyACEJaAgIAAIABBBEELIAIQ","loCAgAAgAEEHQQkgAhCWgICAACAAQQhBCiACEJaAgIAAIABBAEEEIAIQloCAgAAgAEEBQQIgAhCWgICAACAAQQNBBiACEJaAgIAA","IABBB0EIIAIQloCAgAAgAEEJQQogAhCWgICAACAAQQtBDCACEJaAgIAAIABBBEEGIAIQloCAgAAgAEEFQQkgAhCWgICAACAAQQhB","CyACEJaAgIAAIABBCkEMIAIQloCAgAAgAEEAQQUgAhCWgICAACAAQQNBCCACEJaAgIAAIABBBEEHIAIQloCAgAAgAEEGQQsgAhCW","gICAACAAQQlBCiACEJaAgIAAIABBAEEBIAIQloCAgAAgAEECQQUgAhCWgICAACAAQQZBCSACEJaAgIAAIABBB0EIIAIQloCAgAAg","AEEKQQsgAhCWgICAACAAQQFBAyACEJaAgIAAIABBAkEEIAIQloCAgAAgAEEFQQYgAhCWgICAACAAQQlBCiACEJaAgIAAIABBAUEC","IAIQloCAgAAgAEEDQQQgAhCWgICAACAAQQVBByACEJaAgIAAIABBBkEIIAIQloCAgAAgAEECQQMgAhCWgICAACAAQQRBBSACEJaA","gIAAIABBBkEHIAIQloCAgAAgAEEIQQkgAhCWgICAACAAQQNBBCACEJaAgIAAIABBBUEGIAIQloCAgAAPCwAL8BIBDX8CQCABQQ1J","DQAgAEEwQQAgAiAAQTBqIgMgABCKgICAACIBG2ooAgAhBCAAIABBAEEwIAEbaigCADYCMCAAIAQ2AgAgAEEoQQQgAiAAQShqIgUg","AEEEaiIGEIqAgIAAIgEbaigCACEEIAAgAEEEQSggARtqKAIANgIoIAAgBDYCBCAAQSRBCCACIABBJGoiBCAAQQhqIgcQioCAgAAi","ARtqKAIAIQggACAAQQhBJCABG2ooAgA2AiQgACAINgIIIABBHEEMIAIgAEEcaiIJIABBDGoiCBCKgICAACIBG2ooAgAhCiAAIABB","DEEcIAEbaigCADYCHCAAIAo2AgwgAEEsQRQgAiAAQSxqIgsgAEEUaiIKEIqAgIAAIgEbaigCACEMIAAgAEEUQSwgARtqKAIANgIs","IAAgDDYCFCAAQSBBGCACIABBIGoiDCAAQRhqIgEQioCAgAAiDRtqKAIAIQ4gACAAQRhBICANG2ooAgA2AiAgACAONgIYIABBGEEE","IAIgASAGEIqAgIAAIg0baigCACEOIAAgAEEEQRggDRtqKAIANgIYIAAgDjYCBCAAQQxBCCACIAggBxCKgICAACING2ooAgAhDiAA","IABBCEEMIA0baigCADYCDCAAIA42AgggAEEsQRAgAiALIABBEGoiDRCKgICAACIOG2ooAgAhDyAAIABBEEEsIA4baigCADYCLCAA","IA82AhAgAEEkQRwgAiAEIAkQioCAgAAiDhtqKAIAIQ8gACAAQRxBJCAOG2ooAgA2AiQgACAPNgIcIABBKEEgIAIgBSAMEIqAgIAA","Ig4baigCACEPIAAgAEEgQSggDhtqKAIANgIoIAAgDzYCICAAQRBBACACIA0gABCKgICAACIOG2ooAgAhDyAAIABBAEEQIA4baigC","ADYCECAAIA82AgAgAEEIQQQgAiAHIAYQioCAgAAiDhtqKAIAIQ8gACAAQQRBCCAOG2ooAgA2AgggACAPNgIEIABBGEEMIAIgASAI","EIqAgIAAIg4baigCACEPIAAgAEEMQRggDhtqKAIANgIYIAAgDzYCDCAAQSBBHCACIAwgCRCKgICAACIOG2ooAgAhDyAAIABBHEEg","IA4baigCADYCICAAIA82AhwgAEEoQSQgAiAFIAQQioCAgAAiDhtqKAIAIQ8gACAAQSRBKCAOG2ooAgA2AiggACAPNgIkIABBMEEs","IAIgAyALEIqAgIAAIg4baigCACEPIAAgAEEsQTAgDhtqKAIANgIwIAAgDzYCLCAAQRhBECACIAEgDRCKgICAACIOG2ooAgAhDyAA","IABBEEEYIA4baigCADYCGCAAIA82AhAgAEEkQRQgAiAEIAoQioCAgAAiDhtqKAIAIQ8gACAAQRRBJCAOG2ooAgA2AiQgACAPNgIU","IABBLEEgIAIgCyAMEIqAgIAAIg4baigCACEPIAAgAEEgQSwgDhtqKAIANgIsIAAgDzYCICAAQTBBKCACIAMgBRCKgICAACIDG2oo","AgAhDiAAIABBKEEwIAMbaigCADYCMCAAIA42AiggAEEUQQAgAiAKIAAQioCAgAAiAxtqKAIAIQ4gACAAQQBBFCADG2ooAgA2AhQg","ACAONgIAIABBIEEMIAIgDCAIEIqAgIAAIgMbaigCACEOIAAgAEEMQSAgAxtqKAIANgIgIAAgDjYCDCAAQRxBECACIAkgDRCKgICA","ACIDG2ooAgAhDiAAIABBEEEcIAMbaigCADYCHCAAIA42AhAgAEEsQRggAiALIAEQioCAgAAiAxtqKAIAIQ4gACAAQRhBLCADG2oo","AgA2AiwgACAONgIYIABBKEEkIAIgBSAEEIqAgIAAIgMbaigCACEOIAAgAEEkQSggAxtqKAIANgIoIAAgDjYCJCAAQQRBACACIAYg","ABCKgICAACIDG2ooAgAhDiAAIABBAEEEIAMbaigCADYCBCAAIA42AgAgAEEUQQggAiAKIAcQioCAgAAiAxtqKAIAIQ4gACAAQQhB","FCADG2ooAgA2AhQgACAONgIIIABBJEEYIAIgBCABEIqAgIAAIgMbaigCACEOIAAgAEEYQSQgAxtqKAIANgIkIAAgDjYCGCAAQSBB","HCACIAwgCRCKgICAACIDG2ooAgAhDiAAIABBHEEgIAMbaigCADYCICAAIA42AhwgAEEsQSggAiALIAUQioCAgAAiCxtqKAIAIQMg","ACAAQShBLCALG2ooAgA2AiwgACADNgIoIABBDEEEIAIgCCAGEIqAgIAAIgsbaigCACEDIAAgAEEEQQwgCxtqKAIANgIMIAAgAzYC","BCAAQRBBCCACIA0gBxCKgICAACILG2ooAgAhAyAAIABBCEEQIAsbaigCADYCECAAIAM2AgggAEEYQRQgAiABIAoQioCAgAAiCxtq","KAIAIQMgACAAQRRBGCALG2ooAgA2AhggACADNgIUIABBKEEkIAIgBSAEEIqAgIAAIgUbaigCACELIAAgAEEkQSggBRtqKAIANgIo","IAAgCzYCJCAAQQhBBCACIAcgBhCKgICAACIFG2ooAgAhBiAAIABBBEEIIAUbaigCADYCCCAAIAY2AgQgAEEQQQwgAiANIAgQioCA","gAAiBRtqKAIAIQYgACAAQQxBECAFG2ooAgA2AhAgACAGNgIMIABBHEEUIAIgCSAKEIqAgIAAIgUbaigCACEGIAAgAEEUQRwgBRtq","KAIANgIcIAAgBjYCFCAAQSBBGCACIAwgARCKgICAACIFG2ooAgAhBiAAIABBGEEgIAUbaigCADYCICAAIAY2AhggAEEMQQggAiAI","IAcQioCAgAAiBRtqKAIAIQcgACAAQQhBDCAFG2ooAgA2AgwgACAHNgIIIABBFEEQIAIgCiANEIqAgIAAIgUbaigCACEHIAAgAEEQ","QRQgBRtqKAIANgIUIAAgBzYCECAAQRxBGCACIAkgARCKgICAACIFG2ooAgAhByAAIABBGEEcIAUbaigCADYCHCAA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gBiACEJuAgIAAQQ0hBAsgBEF/aiAGTw0CAkAgBCAGRg0AIARBAnQh","BCAGQQJ0IQYDQCAJIAkgBGogAhCSgICAACAGIARBBGoiBEcNAAsLIAUNASAJIABGIQQgCCEJIAchBiAEDQALIAAgASADIAIQlICA","gAAgAUECdCIERQ0AIAAgAyAE/AoAAAsgA0GAAWokgICAgAAPCwAL5AEBB38jgICAgABBgAJrIgMkgICAgAACQAJAIAFBAkkNACAB","QSBLDQEgASABQQF2IgQgAUESSSIFGyEGIAEgBGshByAAIARBA3RqIQggACEEA0ACQAJAIAZBDEsNAEEBIQkgBkEITQ0BIAQgBiAG","EJmAgIAAQQkhCQwBCyAEIAYgBhCcgICAAEENIQkLIAQgBiAJIAYQoICAgAAgBQ0BIAQgAEYhCSAIIQQgByEGIAkNAAsgACABIAMg","BhCVgICAACABQQN0IgZFDQAgACADIAb8CgAACyADQYACaiSAgICAAA8LAAusAQIDfwJ+AkAgAkF/aiABTw0AAkAgAiABRg0AIAAg","AUEDdGohBCAAIAJBA3QiBWohBgNAAkAgBikDACIHIAZBeGopAwAiCFoNACAFIQICQANAIAAgAmoiASAINwMAAkAgAkEIRw0AIAAh","AgwCCyACQXhqIQIgByABQXBqKQMAIghUDQALIAAgAmohAgsgAiAHNwMACyAFQQhqIQUgBkEIaiIGIARHDQALCw8LAAuXBAIJfwJ8","AkACQAJAAkACQCABQQF2IAFqIgNFDQAgAigCACEEA0ACQAJAIANBf2oiAyABTw0AIAAoAgAhAiAAIAAgA0ECdGoiBSgCADYCACAF","IAI2AgBBACEFDAELIAMgAWshBQsCQCAFQQF0IgZBAXIiAiABIAMgASADSRsiB08NACAEKAIAIQgDQAJAAkAgBkECaiIGIAdJDQAg","CCgCCCEJIAIhBgwBCyAAIAZBAnRqKAIAIgYgCCgCCCIJTw0FIAAgAkECdGooAgAiCiAJTw0GIAJBAEEAQX8gCCgCBCILIAZBA3Rq","KwMAIgwgCyAKQQN0aisDACINZiILG0EBQX4gCxsgDCANZRs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AACAFC6cCBAJ+BH8BfgF/AkAgAQ0AQQAPCyACKQMAIQQgACkDACEF","QQAhAiAAIQYCQCAAQQhqIgcgACABQQN0aiIIQXhqIglPDQBBACECIAAhBgNAIAYiByAAIAJBA3RqIgYpAwA3AwAgBiAHQQhqIgEp","AwAiCjcDACABIAAgAiAEIApaaiICQQN0aiILKQMANwMAIAsgB0EQaiIGKQMAIgo3AwAgAiAEIApaaiECIAdBGGogCUkNAAsgBkEI","aiEHCwJAIAcgCEYNAANAIAYgACACQQN0aiIBKQMANwMAIAEgByIGKQMAIgo3AwAgAiAEIApaaiECIAZBCGoiByAIRw0ACyAHQXhq","IQYLIAYgACACQQN0aiIHKQMANwMAIAcgBTcDACACIAQgBVpqC6cCBAJ+BH8BfgF/AkAgAQ0AQQAPCyACKQMAIQQgACkDACEFQQAh","AiAAIQYCQCAAQQhqIgcgACABQQN0aiIIQXhqIglPDQBBACECIAAhBgNAIAYiByAAIAJBA3RqIgYpAwA3AwAgBiAHQQhqIgEpAwAi","CjcDACABIAAgAiAKIARUaiICQQN0aiILKQMANwMAIAsgB0EQaiIGKQMAIgo3AwAgAiAKIARUaiECIAdBGGogCUkNAAsgBkEIaiEH","CwJAIAcgCEYNAANAIAYgACACQQN0aiIBKQMANwMAIAEgByIGKQMAIgo3AwAgAiAKIARUaiECIAZBCGoiByAIRw0ACyAHQXhqIQYL","IAYgACACQQN0aiIHKQMANwMAIAcgBTcDACACIAUgBFRqC3cBAX8CQCABDQBBAA8LAkAgAiABTw0AIAAoAgAhBCAAIAAgAkECdGoi","AigCADYCACACIAQ2AgAgAEEEaiABQX9qIAAgAxCkgICAACICIAFPDQAgACgCACEBIAAgACACQQJ0aiIDKAIANgIAIAMgATYCACAC","DwsAC3cBAX8CQCABDQBBAA8LAkAgAiABTw0AIAAoAgAhBCAAIAAgAkECdGoiAigCADYCACACIAQ2AgAgAEEEaiABQX9qIAAgAxCl","gICAACICIAFPDQAgACgCACEBIAAgACACQQJ0aiIDKAIANgIAIAMgATYCACACDwsAC3cBAX8CQCABDQBBAA8LAkAgAiABTw0AIAAo","AgAhBCAAIAAgAkECdGoiAigCADYCACACIAQ2AgAgAEEEaiABQX9qIAAgAxCmgICAACICIAFPDQAgACgCACEBIAAgACACQQJ0aiID","KAIANgIAIAMgATYCACACDwsAC3cBAX8CQCABDQBBAA8LAkAgAiABTw0AIAAoAgAhBCAAIAAgAkECdGoiAigCADYCACACIAQ2AgAg","AEEEaiABQX9qIAAgAxCngICAACICIAFPDQAgACgCACEBIAAgACACQQJ0aiIDKAIANgIAIAMgATYCACACDwsAC3cBAX4CQCABDQBB","AA8LAkAgAiABTw0AIAApAwAhBCAAIAAgAkEDdGoiAikDADcDACACIAQ3AwAgAEEIaiABQX9qIAAgABCogICAACICIAFPDQAgACkD","ACEEIAAgACACQQN0aiIBKQMANwMAIAEgBDcDACACDwsAC3cBAX4CQCABDQBBAA8LAkAgAiABTw0AIAApAwAhBCAAIAAgAkEDdGoi","AikDADcDACACIAQ3AwAgAEEIaiABQX9qIAAgABCpgICAACICIAFPDQAgACkDACEEIAAgACACQQN0aiIBKQMANwMAIAEgBDcDACAC","DwsAC38BA38jgICAgABBEGsiAiSAgICAACACQQhqIAAgARDpgICAAAJAAkAgAigCCCIBIAIoAgwiA0cNAEEAIQAMAQtBACEAA0BB","AEECQQEgAS0AACIEQe8BSxsgBMBBQEgbIABqIQAgAUEBaiIBIANHDQALCyACQRBqJICAgIAAIAALDgAgACABIAAQsoCAgAALiQEB","An9BACEDAkBBACgC6I/AgAAiBA0AQfCPwIAAIQRBAEHwj8CAADYC6I/AgAALAkACQCABIARqQX9qQQAgAWtxIgEgAmoiBCABSQ0A","IAQ/AEEQdCICTQ0BQQAhAyAEIAJrQRB2IARB//8DcUEAR2pAAEF/Rw0BCyADDwtBACAENgLoj8CAACABCyEAAkAgASAAakEAKALo","j8CAAEcNAEEAIAA2AuiPwIAACwsSACADIAAgAiABIAMQtYCAgAALlAEBAX9BACEFAkACQCADIAFqQQAoAuiPwIAARg0AIAEgAiAE","ELKAgIAAIgJFDQECQCAEIAMgBCADSRsiA0UNACACIAEgA/wKAAALIAIhBQwBCwJAIAQgAWoiAz8AQRB0IgRNDQBBACEFIAMgBGtB","EHYgA0H//wNxQQBHakAAQX9GDQELQQAgAzYC6I/AgAAgAQ8LIAULAwAACyYAAkAgACABIAAQsoCAgAAiAUUNACAARQ0AIAFBACAA","/AsACyABC8AQAg5/AnwjgICAgABBMGsiCiSAgICAACAAQZwBaiELIABBkAFqIQxBACENAkADQCANIQ4gASEPIAJFDQFBACEQAkAC","QANAIA8gEGoiES0AACISQSBGDQEgAiAQQQFqIhBHDQALIAIhECAPIQEMAQsgEUEBaiEBIBBBf3MgAmohAgsgDiAETw0BIBBFDQEg","ACAAKALAAUEBaiIRNgLAAQJAIBENAAJAIAAoArABIhFFDQAgEUECdCIRRQ0AIAAoAqwBQQAgEfwLAAsgAEEBNgLAAQsgAEEANgK8","AQJAAkAgDyAQELCAgIAAQQNLDQAgCkEgaiAAIA8gEBC5gICAACAKKAIgQQFxRQ0BIAAgCigCJBC6gICAAAwBCyAAKAIsIhNFDQBB","ACEUAkADQCATIBRqQQF2IhEgACgCLCIVTw0BIApBGGogACAAKAIoIBFBAnRqKAIAELuAgIAAIBFBAWogFCAKKAIYIA8gCigCHCIV","IBAgFSAQSRsQ6oCAgAAiFiAVIBBrIBYbQQBIIhUbIhQgEyARIBUbIhNJDQALIBQgACgCLE8NASAUQQJ0IREDQCAKQRBqIAAgACgC","KCARaigCACITELuAgIAAIAooAhQgEEkNAiAPIAooAhAgEBDqgICAAA0CIAAgExC6gICAACARQQRqIREgFEEBaiIUIAAoAixPDQIM","AAsLIBEgFUGAiMCAABDcgICAAAALIA5BAWohDUEBIRECQAJAA0ACQAJAIBEgEEkiFEUNACAPIBFqLAAAQUBIDQELIA8gERCwgICA","AEEESQ0AIApBCGogACAPIBEQuYCAgAAgCigCCEEBRw0AIAooAgwiEyAAKAIgIhVPDQIgACgCHCATQQJ0aig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AEKAK4","AiEHIA1BBEEEEMmAgIAAIARBADYC7AEgBCAHNgLoASAEIAM2AuQBIAAgBEEwakHEAfwKAAAgBEGkAmpBCEEIEMmAgIAAIARBwAJq","JICAgIAADwsgA0F/aiAFQeCKwIAAENyAgIAAAAsgAyAFQfCKwIAAENyAgIAAAAsgAyAEKAK4AhDMgICAAAALVQEBfyOAgICAAEEQ","ayIBJICAgIAAIAFBCGogACAAKAIAQQFBCEEIEMuAgIAAAkAgASgCCCIAQX9GDQAgACABKAIMEMyAgIAAAAsgAUEQaiSAgICAAAud","AQECfyOAgICAAEEgayIDJICAgIAAIANBFGpBACACIAFrIgQgBCACSxtBAEEEQQQQz4CAgAAgAygCGCEEAkAgAygCFEEBRw0AIAQg","AygCHBDMgICAAAALIANBADYCECADIAMoAhw2AgwgAyAENgIIIANBCGogASACEIGAgIAAIAAgAygCEDYCCCAAIAMpAgg3AgAgA0Eg","aiSAgICAAAttAQN/IAAgARDTgICAACAAKAIEIgMgACgCCCIEaiEFAkACQAJAIAFBAkkNAAJAIAFBf2oiAUUNACAFIAIgAfwLAAsg","AyABIARqIgRqIQUMAQsgAUUNAQsgBSACOgAAIARBAWohBAsgACAENgIIC/ICAQF/I4CAgIAAQdABayIDJICAgIAAIANBDGogACAB","IAIQvYCAgAAgAygCICECAkBBACgCpI7AgABBf0YNAEGkjsCAABDXgICAAEGkjsCAABDWgICAAEGwjsCAAEEEQQQQyYCAgABBvI7A","gABBBEEEEMmAgIAAQciOwIAAQQRBBBDJgICAAEHUjsCAAEEEQQQQyYCAgABB4I7AgABBBEEEEMmAgIAAQeyOwIAAQQRBBBDJgICA","AEH4jsCAAEEEQQQQyYCAgABBhI/AgABBBEEEEMmAgIAAQZCPwIAAQQRBBBDJgICAAEGcj8CAAEEIQQgQyYCAgABBqI/AgAAQ14CA","gABBqI/AgAAQ1oCAgABBtI/AgABBBEEEEMmAgIAAQcCPwIAAQQRBBBDJgICAAEHMj8CAAEEEQQQQyYCAgABB2I/AgABBBEEEEMmA","gIAAC0GkjsCAACADQQxqQcQB/AoAACADQdABaiSAgICAACACQX9qC14BAX8jgICAgABBEGsiACSAgICAAEEAQX82AqSOwIAAIABB","CGoQ0ICAgABBAEHwj8CAADYC6I/AgABBACAAKQMINwKYjsCAAEEAQQA2AqCOwIAAIABBEGokgICAgAALPgEBfwJAIABBCGoiAEEA","KAKgjsCAACIBTQ0AQZiOwIAAIAAgAWtBABDAgICAAAtBACgCnI7AgABBB2pBeHELOwEBf0EAIQgCQEEAKAKkjsCAAEF/Rg0AQaSO","wIAAIAAgASACIAMgBCAGIAUgByAFELiAgIAAIQgLIAgLBABBAQsNACAAIAEQzoCAgAAPCwMADwsNACAAIAEQ1ICAgAAAC4gBAQR/","I4CAgIAAQRBrIgMkgICAgABBACEEIANBDGohBQJAAkAgAkUNACAAKAIAIgZFDQAgAyABNgIMIAYgAmwhBCAAKAIEIQIgA0EIaiEF","DAELCyAFIAQ2AgACQCADKAIMIgRFDQAgAygCCCIFRQ0AIAIgBSAEELOAgIAACyADQRBqJICAgIAAC1IBAX8jgICAgABBEGsiBSSA","gICAACAFQQhqIAAgASACIAMgBBDLgICAAAJAIAUoAggiBEF/Rg0AIAQgBSgCDBDMgICAAAALIAVBEGokgICAgAALuQEBAn8jgICA","gABBEGsiBiSAgICAAEEAIQcCQAJAIAUNAAwBCyADIAJqIgIgA0kNACAGQQRqIAEgAiABKAIAQQF0IgMgAiADSxsiA0EIQQRBASAF","QYEISRsgBUEBRhsiAiADIAJLGyIDIAQgBRDSgICAACAGKAIIIQcCQCAGKAIERQ0AIAYoAgwhAgwBCyABIAM2AgAgASAHNgIEQX8h","BwsgACACNgIEIAAgBzYCACAGQRBqJICAgIAACxwAAkAgAEUNACAAIAEQyICAgAAACxDVgICAAAALYwECfwJAAkACQCACIAFrIgMg","ACgCACAAKAIIIgRrTQ0AIAAgBCADQQFBARDKgICAACAAKAIIIQQMAQsgAiABRg0BCyADRQ0AIAAoAgQgBGogASAD/AoAAAsgACAE","IANqNgIIC0sBAX8jgICAgABBEGsiAiSAgICAACACIAA2AgQgAkGBgICAADYCDCACIAJBBGo2AghBmobAgAAgAkEIakEAQbCLwIAA","EOKAgIAAAAuxAQEBfgJAAkACQCAErSABrX4iBUIgiKcNACAFpyIEIAMQ24CAgAANAQsgAEEANgIEQQEhAQwBCwJAIAQNACAAIAM2","AghBACEBIABBADYCBAwBCxDHgICAAAJAAkAgAg0AIAQgAxCxgICAACECDAELIAQgAxC3gICAACECCwJAIAINACAAIAQ2AgggACAD","NgIEQQEhAQwBCyAAIAI2AgggACABNgIEQQAhAQsgACABNgIACw0AIABCgICAgBA3AwALEQAgACABIAEgAmoQzYCAgAALoAIDAX8B","fgN/I4CAgIAAQRBrIgUkgICAgAAgBK0gAq1+IganIQICQAJAAkACQAJAIAZCIIinDQAgAiADENuAgIAADQELIABBADYCBAwBC0EA","IQcgBUEMaiEIAkACQCAERQ0AIAEoAgAiCUUNACAFIAM2AgwgCSAEbCEHIAEoAgQhBCAFQQhqIQgMAQsLIAggBzYCAAJAAkACQCAF","KAIMRQ0AAkAgBSgCCCIBDQAgAg0CIAMhBAwDCyAEIAEgAyACELSAgIAAIQQMAgsgAg0AIAMhBAwDCxDHgICAACACIAMQsYCAgAAh","BAsgBA0BIAAgAzYCBAtBASEEDAELIAAgBDYCBEEAIQQLIAAgBDYCACAAIAI2AgggBUEQaiSAgICAAAspAQF/AkAgASAAKAIAIAAo","AggiAmtNDQAgACACIAFBAUEBEMqAgIAACwsNACABIAAQxoCAgAAACxcAQcCLwIAAQSNB1IvAgAAQ2ICAgAAACw4AIABBAUEBEMmA","gIAACwIAC0cBAX8jgICAgABBIGsiAySAgICAACADIAE2AhAgAyAANgIMIANBATsBHCADIAI2AhggAyADQQxqNgIUIANBFGoQtoCA","gAAAC5gEAQl/AkACQCABIABBA2pBfHEiAiAAayIDSQ0AIAEgA2siBEECdiIFRQ0AIARBA3EhBkEAIQdBACEIAkAgAiAARg0AIAAg","AmshAkEAIQggACEBA0A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gCiAHaiEHCwJAAkACQAJAAkAgByAALwEMIgpPDQAgCEGAgIAIcQ0BQQEhASAGIAAgCiAHa0EBEN6AgIAAIAYoAgAi","B0F/Rg0EIAYvAQQhCyAAIAkgAiADEN+AgIAADQQgACgCACIDIAQgBSAAKAIEIgIoAgwRgICAgACAgICAAA0EQQAhCiALQf//A3Eh","CwNAIAsgCkH//wNxIgBLIQEgCyAATQ0FIApBAWohCiADIAcgAigCEBGBgICAAICAgIAARQ0ADAULCyAAIAkgAiADEN+AgIAARQ0B","DAILIAAgACkCCCIMp0GAgID/eXFBsICAgAJyNgIIIAAgCSACIAMQ34CAgAANAUEBIQEgBkEIaiAAIAogB2tBARDegICAACAGKAII","IgtBf0YNAiAGLwEMIQIgACgCACIHIAQgBSAAKAIEIgMoAgwRgICAgACAgICAAA0CQQAhCiACQf//A3EhAgJAA0AgAiAKQf//A3FN","DQFBASEBIApBAWohCiAHIAsgAygCEBGBgICAAICAgIAARQ0ADAQLCyAAIAw3AghBACEBDAILIAAoAgAgBCAFIAAoAgQoAgwRgICA","gACAgICAACEBDAELQQEhAQsgBkEQaiSAgICAACABC7gBAQN/IAIhBAJAAkACQAJAIAEoAggiBUEddkEDcQ4EAQMAAgELIAJB/v8D","cUEBdiEEDAILQQAhBAwBCyACQQAgA0H/AXEbIQQLIAVB////AHEhBSABKAIEIQMgASgCACEGQQAhAQJAAkADQCABQf//A3EgBEH/","/wNxTw0BIAFBAWohASAGIAUgAygCEBGBgICAAICAgIAARQ0AC0F/IQUMAQsgAiAEayEBCyAAIAE7AQQgACAFNgIAC1IAAkAgAUF/","Rg0AIAAoAgAgASAAKAIEKAIQEYGAgIAAgICAgABFDQBBAQ8LAkAgAg0AQQAPCyAAKAIAIAIgAyAAKAIEKAIMEYCAgIAAgICAgAAL","0QMBCX8CQAJAIABB6AdPDQAgACEDDAELIAFBfGohBEEAIQUgACEGAkACQAJAAkACQANAIAYgBkGQzgBuIgNBkM4AbGsiB0H//wNx","QeQAbiEIIAIgBWoiCUF8aiACTw0BIAQgAmoiCiAIQQF0IgstAPSLwIAAOgAAIAlBfWogAk8NAiAKQQFqIAtB9YvAgABqLQAAOgAA","IAlBfmogAk8NAyAKQQJqIAcgCEHkAGxrQQF0Qf7/B3EiCC0A9IvAgAA6AAAgCUF/aiACTw0EIApBA2ogCEH1i8CAAGotAAA6AAAg","BEF8aiEEIAVBfGohBSAGQf+s4gRLIQkgAyEGIAlFDQUMAAsLIAlBfGogAkHki8CAABDcgICAAAALIAlBfWogAkHki8CAABDcgICA","AAALIAlBfmogAkHki8CAABDcgICAAAALIAlBf2ogAkHki8CAABDcgICAAAALIAIgBWohAgsCQAJAIANBCk8NACADIQYMAQsgASAC","QX5qIgJqIAMgA0H//wNxQeQAbiIGQeQAbGtB//8DcUEBdC8A9IvAgAA7AAALAkACQCAARQ0AIAZFDQELIAEgAkF/aiICaiAGQQF0","QR5xLQD1i8CAADoAAAsgAgtRAQF/I4CAgIAAQRBrIgIkgICAgAAgAUEBQQFBACACQQZqIAAoAgAgAkEGakEKEOCAgIAAIgBqQQog","AGsQ3YCAgAAhACACQRBqJICAgIAAIAALEQAgACABIAIgAxDjgICAAAALTgEBfyOAgICAAEEgayIEJICAgIAAIAQgATYCECAEIAA2","AgwgBCACOgAdIARBADoAHCAEIAM2AhggBCAEQQxqNgIUIARBFGoQtoCAgAAAC2EBAX8jgICAgABBIGsiAySAgICAACADIAE2Agwg","AyAANgIIIANBgYCAgAA2AhwgA0GBgICAADYCFCADIANBDGo2AhggAyADQQhqNgIQQYCAwIAAIANBEGogAhDYgICAAAALYQEBfyOA","gICAAEEgayIDJICAgIAAIAMgATYCDCADIAA2AgggA0GBgICAADYCHCADQYGAgIAANgIUIAMgA0EMajYCGCADIANBCGo2AhBB34DA","gAAgA0EQaiACENiAgIAAAAthAQF/I4CAgIAAQSBrIgMkgICAgAAgAyABNgIMIAMgADYCCCADQYGAgIAANgIcIANBgYCAgAA2AhQg","AyADQQxqNgIYIAMgA0EIajYCEEGYg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IgAUEBdiEGIAFBAnQg","AGpBfGohAwNAIAAoAgAhCiAAIAMoAgA2AgAgAyAKNgIAIANBfGohAyAAQQRqIQAgBkF/aiIGDQAMAwsLIAMgBUHUhMCAABCYgICA","AAALIAYgBUHkhMCAABCYgICAAAALC7YIBAh/AnwDfwF8I4CAgIAAQRBrIgUkgICAgAACQAJAIAFBIUkNACADQX9qIQMDQAJAIANB","f0cNACAAIAEgBBCJgICAAAwDCyAAIAFBA3YiBkEcbGohByAAIAZBBHRqIQgCQAJAIAFBwABJDQAgACAIIAcgBiAEEIKAgIAAIQYM","AQsCQAJAAkACQAJAAkAgACgCACIGIAQoAgAiCSgCBCIKTw0AIAgoAgAiCyAKTw0BIAkoAgAiDCALQQN0aisDACENAkACQAJAAkAg","DCAGQQN0aisDACIOIA5iIg8NACANIA1hDQFBASEQDAMLIA0gDWINAUEAIRAMAgtBAEEAQX8gDiANZiIRG0EBQX4gERsgDiANZRsi","EWsgESAJKAIILQAAG0H/AXEiEUH/AUYgBiALSSARGyEQDAELIAYgC0khEAsgBygCACIRIApPDQIgDCARQQN0aisDACESAkACQAJA","AkACQAJAAkAgDw0AIBIgEmENASAAIQYgEEUNDSANIA1iDQYMCwsgEiASYg0BIAAhBiAQDQwgDSANYQ0DDAkLQQBBAEF/IA4gEmYi","ChtBAUF+IAobIA4gEmUbIgprIAogCSgCCC0AABtB/wFxIgpB/wFGIAYgEUkgChshCgwBCyAGIBFJIQoLIAAhBiAQIApHDQkgDSAN","Yg0BIBIgEmINBwtBAEEAQX8gDSASZiIGG0EBQX4gBhsgDSASZRsiBmsgBiAJKAIILQAAG0H/AXEiBkH/AUYgCyARSSAGGyEGDAcL","IBIgEmENBAsgCyARSSEGDAULIAYgCkHUhMCAABCYgICAAAALIAsgCkHkhMCAABCYgICAAAALIBEgCkHkhMCAABCYgICAAAALQQAh","BgwBC0EBIQYLIAcgCCAQIAZzGyEGCyAGIABrIgdBAnYhBgJAAkAgAkUNAAJAAkACQCACKAIAIgggBCgCACIJKAIEIgtPDQAgACAH","aigCACIHIAtPDQEgCSgCACILIAdBA3RqKwMAIQ0CQAJAIAsgCEEDdGorAwAiEiASYg0AIA0gDWINBUEAQQBBfyASIA1mIgsbQQFB","fiALGyASIA1lGyILayALIAkoAggtAAAbQf8BcSIJQf8BRiAIIAdJIAkbDQUMAQsgCCAHTw0AIA0gDWINBAsgBSAENgIMIAAgASAG","IAVBDGoQjICAgAAiBkEBaiECIAYgAU8NAiABIAJrIQEgACACQQJ0aiEAQQAhAgwECyAIIAtB1ITAgAAQmICAgAAACyAHIAtB5ITA","gAAQmICAgAAACyACIAEgAUHEhMCAABCXgICAAAALIAAgACABIAYgBBCNgICAACIGIAIgAyAEEIGAgIAAIAEgBkF/c2ohASAAIAZB","AnRqIgJBBGohAAsgA0F/aiEDIAFBIU8NAAsLIAAgASAEEIiAgIAACyAFQRBqJICAgIAAC4kFBAR/AnwCfwF8AkAgA0H4////AXFF","DQAgACAAIANBA3YiA0EEdCIFaiAAIANBHGwiBmogAyAEEIKAgIAAIQAgASABIAVqIAEgBmogAyAEEIKAgIAAIQEgAiACIAVqIAIg","BmogAyAEEIKAgIAAIQILAkACQAJAAkACQAJAAkAgACgCACIDIAQoAgAiBCgCBCIHTw0AIAEoAgAiBSAHTw0BIAQoAgAiCCAFQQN0","aisDACEJAkACQAJAAkAgCCADQQN0aisDACIKIApiIgsNACAJIAlhDQFBASEMDAMLIAkgCWINAUEAIQwMAgtBAEEAQX8gCiAJZiIG","G0EBQX4gBhsgCiAJZRsiBmsgBiAEKAIILQAAG0H/AXEiBkH/AUYgAyAFSSAGGyEMDAELIAMgBUkhDAsgAigCACIGIAdPDQIgCCAG","QQN0aisDACENAkACQAJAAkACQAJAAkAgCw0AIA0gDWENASAMRQ0NIAkgCWINBgwLCyANIA1iDQEgDA0MIAkgCWENAwwJC0EAQQBB","fyAKIA1mIgcbQQFBfiAHGyAKIA1lGyIHayAHIAQoAggtAAAbQf8BcSIHQf8BRiADIAZJIAcbIQMMAQsgAyAGSSEDCyAMIANHDQkg","CSAJYg0BIA0gDWINBwtBAEEAQX8gCSANZiIAG0EBQX4gABsgCSANZRsiAGsgACAEKAIILQAAG0H/AXEiAEH/AUYgBSAGSSAAGyEA","DAcLIA0gDWENBAsgBSAGSSEADAULIAMgB0HUhMCAABCYgICAAAALIAUgB0HkhMCAABCYgICAAAALIAYgB0HkhMCAABCYgICAAAAL","QQAhAAwBC0EBIQALIAIgASAMIABzGyEACyAAC9wDAwR/AnwBfwJAAkAgASgCACIDIAIoAgAiAigCBCIETw0AAkAgAUF8aiIFKAIA","IgYgBE8NACACKAIAIgQgBkEDdGorAwAhBwJAAkAgBCADQQN0aisDACIIIAhiDQAgByAHYg0BQQBBAEF/IAggB2YiBBtBAUF+IAQb","IAggB2UbIgRrIAQgAigCCC0AABtB/wFxIgRB/wFGIAMgBkkgBBtBAUYNAQwECyADIAZPDQMgByAHYQ0DCyABIAY2AgACQCAFIABG","DQAgA0EDdCEJA0AgBSEGAkACQAJAIAMgAigCBCIETw0AIAZBfGoiBSgCACIBIARPDQEgAigCACIEIAFBA3RqKwMAIQcCQAJAIAQg","CWorAwAiCCAIYg0AIAcgB2INBEEAQQBBfyAIIAdmIgQbQQFBfiAEGyAIIAdlGyIEayAEIAIoAggtAAAbQf8BcSIEQf8BRiADIAFJ","IAQbQQFHDQEMBAsgAyABTw0AIAcgB2INAwsgBiEFDAQLIAMgBEHUhMCAABCYgICAAAALIAEgBEHkhMCAABCYgICAAAALIAYgATYC","ACAFIABHDQALCyAFIAM2AgAPCyAGIARB5ITAgAAQmICAgAAACyADIARB1ITAgAAQmICAgAAACwunBQMIfwJ8A38gAiABQQJ0QXxq","IgRqIQUgACAEaiEGIAAgAUEBdiIHQQJ0aiIIQXxqIQkgAygCACEDAkACQAJAAkACQANAIAgoAgAiCiADKAIEIgtPDQEgACgCACIE","IAtPDQIgAygCACILIARBA3RqKwMAIQwCQAJAAkAgCyAKQQN0aisDACINIA1iDQAgDCAMYg0BQQAhC0EAQQBBfyANIAxmIg4bQQFB","fiAOGyANIAxlGyIOayAOIAMoAggtAAAbQf8BcSIOQf8BRiAKIARJIA4bQQFGDQEMAgtBACELIAogBE8NASAMIAxhDQELQQEhCyAK","IQQLIAIgBDYCACAGKAIAIgQgAygCBCIOTw0DIAkoAgAiCiAOTw0EIAtBAnQhDiALQQFzQQJ0IQ8gAygCACILIApBA3RqKwMAIQwC","QAJAAkAgCyAEQQN0aisDACINIA1iDQAgDCAMYg0BQQAhC0EAQQBBfyANIAxmIhAbQQFBfiAQGyANIAxlGyIQayAQIAMoAggtAAAb","Qf8BcSIQQf8BRiAEIApJIBAbQQFGDQEMAgtBACELIAQgCk8NASAMIAxhDQELQQEhCyAKIQQLIAJBBGohAiAIIA5qIQggACAPaiEA","IAUgBDYCACAFQXxqIQUgCSALQQJ0IgRrIQkgBCAGakF8aiEGIAdBf2oiBw0ACyAGQQRqIQQgCUEEaiEDAkAgAUEBcUUNACACIAAg","CCAAIANJIgobKAIANgIAIAggACADT0ECdGohCCAAIApBAnRqIQALAkAgCCAERw0AIAAgA0YNBQsQoYCAgAAACyAKIAtB1ITAgAAQ","mICAgAAACyAEIAtB5ITAgAAQmICAgAAACyAEIA5B1ITAgAAQmICAgAAACyAKIA5B5ITAgAAQmICAgAAACwuDAgICfwJ8AkACQAJA","AkAgACACQQJ0aiIEKAIAIgIgAygCACIDKAIEIgVPDQAgACABQQJ0aiIBKAIAIgAgBU8NASADKAIAIgUgAEEDdGorAwAhBgJAAkAg","BSACQQN0aisDACIHIAdiDQAgBiAGYg0EQQBBAEF/IAcgBmYiBRtBAUF+IAUbIAcgBmUbIgVrIAUgAygCCC0AABtB/wFxIgNB/wFG","IAIgAEkgAxtBAUcNAQwECyACIABPDQAgBiAGYg0DCyAAIQMgAiEADAMLIAIgBUHUhMCAABCYgICAAAALIAAgBUHkhMCAABCYgICA","AAALIAIhAwsgASADNgIAIAQgADYCAAvsAgACQCABQQlJDQAgAEEAQQMgAhCFgICAACAAQQFBByACEIWAgIAAIABBAkEFIAIQhYCA","gAAgAEEEQQggAhCFgICAACAAQQBBByACEIWAgIAAIABBAkEEIAIQhYCAgAAgAEEDQQggAhCFgICAACAAQQVBBiACEIWAgIAAIABB","AEECIAIQhYCAgAAgAEEBQQMgAhCFgICAACAAQQRBBSACEIWAgIAAIABBB0EIIAIQhYCAgAAgAEEBQQQgAhCFgICAACAAQQNBBiAC","EIWAgIAAIABBBUEHIAIQhYCAgAAgAEEAQQEgAhCFgICAACAAQQJBBCACEIWAgIAAIABBA0EFIAIQhYCAgAAgAEEGQQggAhCFgICA","ACAAQQJBAyACEIWAgIAAIABBBEEFIAIQhYCAgAAgAEEGQQcgAhCFgICAACAAQQFBAiACEIWAgIAAIABBA0EEIAIQhYCAgAAgAEEF","QQYgAhCFgICAAA8LAAuEBQACQCABQQ1JDQAgAEEAQQwgAhCFgICAACAAQQFBCiACEIWAgIAAIABBAkEJIAIQhYCAgAAgAEEDQQcg","AhCFgICAACAAQQVBCyACEIWAgIAAIABBBkEIIAIQhYCAgAAgAEEBQQYgAhCFgICAACAAQQJBAyACEIWAgIAAIABBBEELIAIQhYCA","gAAgAEEHQQkgAhCFgICAACAAQQhBCiACEIWAgIAAIABBAEEEIAIQhYCAgAAgAEEBQQIgAhCFgICAACAAQQNBBiACEIWAgIAAIABB","B0EIIAIQhYCAgAAgAEEJQQogAhCFgICAACAAQQtBDCACEIWAgIAAIABBBEEGIAIQhYCAgAAgAEEFQQkgAhCFgICAACAAQQhBCyAC","EIWAgIAAIABBCkEMIAIQhYCAgAAgAEEAQQUgAhCFgICAACAAQQNBCCACEIWAgIAAIABBBEEHIAIQhYCAgAAgAEEGQQsgAhCFgICA","ACAAQQlBCiACEIWAgIAAIABBAEEBIAIQhYCAgAAgAEECQQUgAhCFgICAACAAQQZBCSACEIWAgIAAIABBB0EIIAIQhYCAgAAgAEEK","QQsgAhCFgICAACAAQQFBAyACEIWAgIAAIABBAkEEIAIQhYCAgAAgAEEFQQYgAhCFgICAACAAQQlBCiACEIWAgIAAIABBAUECIAIQ","hYCAgAAgAEEDQQQgAhCFgICAACAAQQVBByACEIWAgIAAIABBBkEIIAIQhYCAgAAgAEECQQMgAhCFgICAACAAQQRBBSACEIWAgIAA","IABBBkEHIAIQhYCAgAAgAEEIQQkgAhCFgICAACAAQQNBBCACEIWAgIAAIABBBUEGIAIQhYCAgAAPCwALlgIBB38jgICAgABBgAFr","IgMkgICAgAACQAJAIAFBAkkNACABQSBLDQEgASABQQF2IgQgAUESSSIFGyEGIAEgBGshByAAIARBAnRqIQggACEJA0ACQAJAIAZB","DEsNAEEBIQQgBkEITQ0BIAkgBiACEIaAgIAAQQkhBAwBCyAJIAYgAhCHgICAAEENIQQLIARBf2ogBk8NAgJAIAQgBkYNACAEQQJ0","IQQgBkECdCEGA0AgCSAJIARqIAIQg4CAgAAgBiAEQQRqIgRHDQALCyAFDQEgCSAARiEEIAghCSAHIQYgBA0ACyAAIAEgAyACEISA","gIAAIAFBAnQiBEUNACAAIAMgBPwKAAALIANBgAFqJICAgIAADwsAC/0EAwh/AnwBfwJAAkACQAJAAkAgAUEBdiABaiIDRQ0AIAIo","AgAhBANAAkACQCADQX9qIgMgAU8NACAAKAIAIQIgACAAIANBAnRqIgUoAgA2AgAgBSACNgIAQQAhAgwBCyADIAFrIQILAkAgAkEB","dCIGQQFyIgUgASADIAEgA0kbIgdPDQAgBCgCBCEIA0AgAiEJAkACQCAGQQJqIgIgB0kNACAFIQIMAQsgACAFQQJ0aigCACIGIAhP","DQUgACACQQJ0aigCACICIAhPDQYgBCgCACIKIAJBA3RqKwMAIQsCQAJAAkACQCAKIAZBA3RqKwMAIgwgDGINACALIAthDQFBASEC","DAMLIAsgC2INAUEAIQIMAgtBAEEAQX8gDCALZiIKG0EBQX4gChsgDCALZRsiCmsgCiAEKAIILQAAG0H/AXEiCkH/AUYgBiACSSAK","GyECDAELIAYgAkkhAgsgBSACaiECCyAAIAlBAnRqIgooAgAiBSAITw0GIAAgAkECd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HIARJIBAbIQ8MAQsgByAESSEPCyACIAAgBkECdGoiECgCADYCACAQIAc2AgAgAkEIaiICKAIAIgcgAU8NAyAGIA9q","IQYCQAJAAkACQCAMIAdBA3RqKwMAIg4gDmINACANIA1hDQFBASEMDAMLIA0gDWINAUEAIQwMAgtBAEEAQX8gDiANZiIMG0EBQX4g","DBsgDiANZRsiDGsgDCAKKAIILQAAG0H/AXEiDEH/AUYgByAESSAMGyEMDAELIAcgBEkhDAsgCyAAIAZBAnRqIhAoAgA2AgAgECAH","NgIAIAYgDGohBiACQQRqIAlPDQQMAAsLIAcgAUHUhMCAABCYgICAAAALIAQgAUHkhMCAABCYgICAAAALIAcgAUHUhMCAABCYgICA","AAALIAJBBGohBwsCQAJAAkACQAJAIAcgCEYNACADKAIAIQEDQCACIQwgByICKAIAIgcgASgCBCIKTw0CIAQgCk8NAyABKAIAIgog","BEEDdGorAwAhDQJAAkACQAJAIAogB0EDdGorAwAiDiAOYg0AIA0gDWENAUEBIQoMAwsgDSANYg0BQQAhCgwCC0EAQQBBfyAOIA1m","IgobQQFBfiAKGyAOIA1lGyIKayAKIAEoAggtAAAbQf8BcSIKQf8BRiAHIARJIAobIQoMAQsgByAESSEKCyAMIAAgBkECdGoiCygC","ADYCACALIAc2AgAgBiAKaiEGIAJBBGoiByAIRw0ACyAHQXxqIQILIAUgAygCACIHKAIEIgFPDQIgBCABTw0DIAcoAgAiASAEQQN0","aisDACENAkACQAJAAkAgASAFQQN0aisDACIOIA5iDQAgDSANYQ0BQQEhBAwDCyANIA1iDQFBACEEDAILQQBBAEF/IA4gDWYiARtB","AUF+IAEbIA4gDWUbIgFrIAEgBygCCC0AABtB/wFxIgdB/wFGIAUgBEkgBxshBAwBCyAFIARJIQQLIAIgACAGQQJ0aiIHKAIANgIA","IAcgBTYCACAGIARqDwsgByAKQdSEwIAAEJiAgIAAAAsgBCAKQeSEwIAAEJiAgIAAAAsgBSABQdSEwIAAEJiAgIAAAAsgBCABQeSE","wIAAEJiAgIAAAAt3AQF/AkAgAQ0AQQAPCwJAIAIgAU8NACAAKAIAIQQgACAAIAJBAnRqIgIoAgA2AgAgAiAENgIAIABBBGogAUF/","aiAAIAMQioCAgAAiAiABTw0AIAAoAgAhASAAIAAgAkECdGoiAygCADYCACADIAE2AgAgAg8LAAt3AQF/AkAgAQ0AQQAPCwJAIAIg","AU8NACAAKAIAIQQgACAAIAJBAnRqIgIoAgA2AgAgAiAENgIAIABBBGogAUF/aiAAIAMQi4CAgAAiAiABTw0AIAAoAgAhASAAIAAg","AkECdGoiAygCADYCACADIAE2AgAgAg8LAAvRAQEDfyOAgICAAEEgayIFJICAgIAAIAUgAjoADwJAIAQgASAEIAFJGyIGRQ0AIAZB","AnQhB0EAIQRBACECA0AgAyAEaiACNgIAIAJBAWohAiAHIARBBGoiBEcNAAsgBSABNgIUIAUgADYCECAFIAVBD2o2AhggBSAFQRBq","NgIcIAZBAUYNAAJAIAZBFUkNACADIAYgBUEcahCAgICAAAwBC0EEIQQDQCADIAMgBGogBUEcahCDgICAACAHIARBBGoiBEcNAAsL","IAVBIGokgICAgAALxgIBC39BACEIAkACQAJAIANBAkkNACAFRQ0AQQEgBWshCSADQX9qIQpBACEIQQAhCwNAIAggB08hDANAIAsg","CiALIApLGyENIAIgC0ECdGohAwNAIA0gC0YNAyAMDQMgC0EBaiELIAMoAgAhDiADQQRqIg8hAyAPKAIAIhAgDkkNACAPIQMgECAB","Sw0ACyAAIA5qIQ0gBSAQIA5rIg9LDQAgCSAQaiAOayERQQAhAyAELQAAQf8BcSEQA0AgDyADRg0EAkACQCANIANqIg4tAAAgEEcN","ACAFIANqIhIgD0sNByAOIAQgBRCigICAAEUNAQsgESADQQFqIgNGDQIMAQsLCyAGIAhBAnRqIAtBf2o2AgAgCEEBaiEIDAALCyAI","DwsgDyAPQfSEwIAAEJiAgIAAAAsgAyASIA9BhIXAgAAQl4CAgAAACwMAAAsIAEHQh8CAAAsbACAAIAEgAiADQQFqIAQgBSAGIAMQ","j4CAgAALFQAgACABIAJBAEcgAyABEI6AgIAACwQAQQELRwEBfyOAgICAAEEgayIDJICAgIAAIAMgATYCECADIAA2AgwgA0EBOwEc","IAMgAjYCGCADIANBDGo2AhQgA0EUahCQgICAAAALmAQBCX8CQAJAIAEgAEEDakF8cSICIABrIgNJDQAgASADayIEQQJ2IgVFDQAg","BEEDcSEGQQAhB0EAIQgCQCACIABGDQAgACACayECQQAhCCAAIQEDQCAIIAEsAABBv39KaiEIIAFBAWohASACQQFqIgINAAsLIAAg","A2ohCQJAIAZFDQAgCSAEQfz///8HcWohAEEAIQcDQCAHIAAsAABBv39KaiEHIABBAWohACAGQX9qIgYNAAsLIAcgCGohAgNAIAkh","AyAFRQ0CIAVBwAEgBUHAAUkbIgRBA3EhCgJAAkAgBEECdCIJQfAHcSIADQBBACEBDAELIAMgAGohCEEAIQEgAyEGA0BBACEAA0Ag","BiAAaigCACIHQX9zQQd2IAdBBnZyQYGChAhxIAFqIQEgAEEEaiIAQRBHDQALIAZBEGoiBiAIRw0ACwsgBSAEayEFIAMgCWohCSAB","QQh2Qf+B/AdxIAFB/4H8B3FqQYGABGxBEHYgAmohAiAKRQ0ACyAKQQJ0IQcgAyAEQfwBcUECdGohAEEAIQEDQCAAKAIAIgZBf3NB","B3YgBkEGdnJBgYKECHEgAWohASAAQQRqIQAgB0F8aiIHDQALIAFBCHZB/4H8B3EgAUH/gfwHcWpBgYAEbEEQdiACaiECDAELQQAh","AiABRQ0AA0AgAiAALAAAQb9/SmohAiAAQQFqIQAgAUF/aiIBDQALCyACC0QAAkACQCAAIAJLDQAgASACSw0BIAAgAU0NASAAIAEg","AxCegICAAAALIAAgAiADEJ+AgIAAAAsgASACIAMQoICAgAAAC2EBAX8jgICAgABBIGsiAySAgICAACADIAE2AgwgAyAANgIIIANB","gYCAgAA2AhwgA0GBgICAADYCFCADIANBCGo2AhggAyADQQxqNgIQQaiAwIAAIANBEGogAhCVgICAAAALjwUCBn8BfiOAgICAAEEQ","ayIGJICAgIAAAkACQCABDQAgBUEBaiEHIAAoAgghCEEtIQkMAQtBK0F/IAAoAggiCEGAgIABcSIBGyEJIAFBFXYgBWohBwsCQAJA","IAhBgICABHENAEEAIQIMAQsCQAJAIANBEEkNACACIAMQloCAgAAhCgwBC0EAIQogA0UNACACIQEgAyELA0AgCiABLAAAQb9/Smoh","CiABQQFqIQEgC0F/aiILDQALCyAKIAdqIQcLAkACQAJAAkACQCAHIAAvAQwiCk8NACAIQYCAgAhxDQFBASEBIAYgACAKIAdrQQEQ","moCAgAAgBigCACIHQX9GDQQgBi8BBCELIAAgCSACIAMQm4CAgAANBCAAKAIAIgMgBCAFIAAoAgQiAigCDBGAgICAAICAgIAADQRB","ACEKIAtB//8DcSELA0AgCyAKQf//A3EiAEshASALIABNDQUgCkEBaiEKIAMgByACKAIQEYGAgIAAgICAgABFDQAMBQsLIAAgCSAC","IAMQm4CAgABFDQEMAgsgACAAKQIIIgynQYCAgP95cUGwgICAAnI2AgggACAJIAIgAxCbgICAAA0BQQEhASAGQQhqIAAgCiAHa0EB","EJqAgIAAIAYoAggiC0F/Rg0CIAYvAQwhAiAAKAIAIgcgBCAFIAAoAgQiAygCDBGAgICAAICAgIAADQJBACEKIAJB//8DcSECAkAD","QCACIApB//8DcU0NAUEBIQEgCkEBaiEKIAcgCyADKAIQEYGAgIAAgICAgABFDQAMBAsLIAAgDDcCCEEAIQEMAgsgACgCACAEIAUg","ACgCBCgCDBGAgICAAICAgIAAIQEMAQtBASEBCyAGQRBqJICAgIAAIAELuAEBA38gAiEEAkACQAJAAkAgASgCCCIFQR12QQNxDgQB","AwACAQsgAkH+/wNxQQF2IQQMAgtBACEEDAELIAJBACADQf8BcRshBAsgBUH///8AcSEFIAEoAgQhAyABKAIAIQZBACEBAkACQANA","IAFB//8DcSAEQf//A3FPDQEgAUEBaiEBIAYgBSADKAIQEYGAgIAAgICAgABFDQALQX8hBQwBCyACIARrIQELIAAgATsBBCAAIAU2","AgALUgACQCABQX9GDQAgACgCACABIAAoAgQoAhARgYCAgACAgICAAEUNAEEBDwsCQCACDQBBAA8LIAAoAgAgAiADIAAoAgQoAgwR","gICAgACAgICAAAvRAwEJfwJAAkAgAEHoB08NACAAIQMMAQsgAUF8aiEEQQAhBSAAIQYCQAJAAkACQAJAA0AgBiAGQZDOAG4iA0GQ","zgBsayIHQf//A3FB5ABuIQggAiAFaiIJQXxqIAJPDQEgBCACaiIKIAhBAXQiCy0ApIXAgAA6AAAgCUF9aiACTw0CIApBAWogC0Gl","hcCAAGotAAA6AAAgCUF+aiACTw0DIApBAmogByAIQeQAbGtBAXRB/v8HcSIILQCkhcCAADoAACAJQX9qIAJPDQQgCkEDaiAIQaWF","wIAAai0AADoAACAEQXxqIQQgBUF8aiEFIAZB/6ziBEshCSADIQYgCUUNBQwACwsgCUF8aiACQZSFwIAAEJiAgIAAAAsgCUF9aiAC","QZSFwIAAEJiAgIAAAAsgCUF+aiACQZSFwIAAEJiAgIAAAAsgCUF/aiACQZSFwIAAEJiAgIAAAAsgAiAFaiECCwJAAkAgA0EKTw0A","IAMhBgwBCyABIAJBfmoiAmogAyADQf//A3FB5ABuIgZB5ABsa0H//wNxQQF0LwCkhcCAADsAAAsCQAJAIABFDQAgBkUNAQsgASAC","QX9qIgJqIAZBAXRBHnEtAKWFwIAAOgAACyACC1EBAX8jgICAgABBEGsiAiSAgICAACABQQFBAUEAIAJBBmogACgCACACQQZqQQoQ","nICAgAAiAGpBCiAAaxCZgICAACEAIAJBEGokgICAgAAgAAthAQF/I4CAgIAAQSBrIgMkgICAgAAgAyABNgIMIAMgADYCCCADQYGA","gIAANgIcIANBgYCAgAA2AhQgAyADQQxqNgIYIAMgA0EIajYCEEGAgMCAACADQRBqIAIQlYCAgAAAC2EBAX8jgICAgABBIGsiAySA","gICAACADIAE2AgwgAyAANgIIIANBgYCAgAA2AhwgA0GBgICAADYCFCADIANBDGo2AhggAyADQQhqNgIQQd+AwIAAIANBEGogAhCV","gICAAAALYQEBfyOAgICAAEEgayIDJICAgI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AAAJgAAABIAAAA3AhAACgAAAGAAAAAMAAAANwIQAAoAAABgAAAAIwAAAM0BEABpAAAAWAIAAAUAAAAwMDAxMDIw","MzA0MDUwNjA3MDgwOTEwMTExMjEzMTQxNTE2MTcxODE5MjAyMTIyMjMyNDI1MjYyNzI4MjkzMDMxMzIzMzM0MzUzNjM3MzgzOTQw","NDE0MjQzNDQ0NTQ2NDc0ODQ5NTA1MTUyNTM1NDU1NTY1NzU4NTk2MDYxNjI2MzY0NjU2NjY3Njg2OTcwNzE3MjczNzQ3NTc2Nzc3","ODc5ODA4MTgyODM4NDg1ODY4Nzg4ODk5MDkxOTI5Mzk0OTU5Njk3OTg5OXVzZXItcHJvdmlkZWQgY29tcGFyaXNvbiBmdW5jdGlv","biBkb2VzIG5vdCBjb3JyZWN0bHkgaW1wbGVtZW50IGEgdG90YWwgb3JkZXLPABAAfQAAAFYDAAAFAAAA"].join("");var bn=1e4,eA="\0";function go(e,t){return e==="rust"||e==="auto"&&t>=bn}var kg=1,Dg=65536,Mt=null,ao=null;function lo(e){if(typeof atob=="function"){let A=atob(e),o=new Uint8Array(A.length);for(let n=0;n<A.length;n++)o[n]=A.charCodeAt(n);return o}let t=globalThis.Buffer;if(t)return new Uint8Array(t.from(e,"base64"));throw new Error("No base64 decoder")}function co(){return Mt?Promise.resolve(Mt):(ao||(ao=(async()=>{try{return typeof WebAssembly>"u"?null:(Mt=await WebAssembly.compile(lo(Qn)),Mt)}catch{return null}})()),ao)}function En(){return Mt}function Bn(e){let t=e.isWellFormed;if(typeof t=="function")return t.call(e);for(let A=0;A<e.length;A++){let o=e.charCodeAt(A);if(o>=55296&&o<=56319){let n=e.charCodeAt(A+1);if(n>=56320&&n<=57343){A++;continue}return!1}if(o>=56320&&o<=57343)return!1}return!0}var Zt=e=>e+7&-8,_t=class e{x;base;encoder=new TextEncoder;offsetsPtr=0;textPtr=0;textLen=0;rows=0;hasIndex=!1;freePtr;constructor(t){this.x=t,this.base=Zt(t.yk_heap_base()),this.freePtr=this.base}static create(t=Mt){if(!t)return null;try{let o=new WebAssembly.Instance(t,{}).exports;return o.yk_version()!==kg?null:new e(o)}catch{return null}}ensure(t){let A=t-this.x.memory.buffer.byteLength;A>0&&this.x.memory.grow(Math.ceil(A/Dg))}setSearchTexts(t){this.hasIndex=!1,this.freePtr=this.base;try{let A=0;for(let l of t){if(!Bn(l))return!1;A+=l.length*3}let o=t.length,n=this.base,r=Zt(n+(o+1)*4);this.ensure(r+A);let i=this.x.memory.buffer,s=new Uint32Array(i,n,o+1),g=new Uint8Array(i,r,A),a=0;for(let l=0;l<o;l++)s[l]=a,a+=this.encoder.encodeInto(t[l],g.subarray(a)).written??0;return s[o]=a,this.offsetsPtr=n,this.textPtr=r,this.textLen=a,this.rows=o,this.freePtr=Zt(r+a),this.hasIndex=!0,!0}catch{return!1}}search(t){if(!this.hasIndex||!t||t.includes(eA)||!Bn(t))return null;try{let A=this.encoder.encode(t),o=this.freePtr,n=Zt(o+A.length);this.ensure(n+this.rows*4),new Uint8Array(this.x.memory.buffer,o,A.length).set(A);let r=this.x.yk_search(this.textPtr,this.textLen,this.offsetsPtr,this.rows,o,A.length,n);return new Uint32Array(this.x.memory.buffer,n,r).slice()}catch{return null}}sortByKeys(t,A){try{let o=t.length,n=this.freePtr,r=Zt(n+o*8);return this.ensure(r+o*4),new Float64Array(this.x.memory.buffer,n,o).set(t),this.x.yk_sort(n,o,A?1:0,r),new Uint32Array(this.x.memory.buffer,r,o).slice()}catch{return null}}};function wA(e){return e>=.1?`${e<10?e.toFixed(1):Math.round(e)} ms`:"<0.1 ms"}function Lt(e,t){let A=new Array(t.length);for(let o=0;o<t.length;o++)A[o]=e[t[o]];return A}var Sg=1e3;function tA(e,t){return e==="rust"||e==="auto"&&t>=Sg}var Gg=1,Yt=null,uo=null;function xn(){return Yt?Promise.resolve(Yt):(uo||(uo=(async()=>{try{return typeof WebAssembly>"u"?null:(Yt=await WebAssembly.compile(lo(yn)),Yt)}catch{return null}})()),uo)}function kn(){return Yt}var wn=e=>e+7&-8,xA=class e{x;encoder=new TextEncoder;docs=0;ready=!1;constructor(t){this.x=t}static create(t=Yt){if(!t)return null;try{let A=new WebAssembly.Instance(t,{}).exports;return A.yk_rag_version()!==Gg?null:new e(A)}catch{return null}}build(t){this.ready=!1;try{let A=this.encoder.encode(t.map(n=>n.join(" ")).join(`
|
|
379
379
|
`));this.x.yk_rag_reset();let o=this.x.yk_rag_scratch(A.length);return new Uint8Array(this.x.memory.buffer,o,A.length).set(A),this.x.yk_rag_build(o,A.length,t.length),this.docs=t.length,this.ready=!0,!0}catch{return!1}}search(t,A,o,n){if(!this.ready||t.length!==A.length||t.some(r=>!r||/[ \n]/.test(r)))return null;try{let r=Math.max(0,Math.min(n,this.docs)),i=this.encoder.encode(t.join(" ")),s=wn(i.length),g=s+A.length*8,a=wn(g+r*4),l=a+r*8,I=this.x.yk_rag_scratch(l),u=this.x.memory.buffer;new Uint8Array(u,I,i.length).set(i),new Float64Array(u,I+s,A.length).set(A);let C=this.x.yk_rag_search(I,i.length,I+s,A.length,o,r,I+g,I+a),h=this.x.memory.buffer,y=new Uint32Array(h,I+g,C),f=new Float64Array(h,I+a,C),B=[];for(let m=0;m<C;m++)B.push({doc:y[m],score:f[m]});return B}catch{return null}}};var vg=new Set("a an the is are was were be to of and or in on at for with what which who whom how why when where does do did this that these those it its from by as about any all please tell me show give".split(" "));function kA(e){return(e.normalize("NFC").toLowerCase().match(/[\p{L}\p{M}\p{N}]+/gu)??[]).filter(t=>t.length>1&&!vg.has(t))}function Rg(e,t=600){let A=Ne(e);if(!A)return[];let o=[],n="",r="",i=()=>{r.trim()&&o.push({id:`page-${o.length+1}`,source:"page",text:r.trim(),ref:n||void 0}),r=""};for(let s of O(A,"h1,h2,h3,h4,p,li,td,th,dt,dd,blockquote,figcaption,label,summary")){if(s.querySelector("p,li,h1,h2,h3,h4"))continue;let g=rt(s.textContent);if(g){if(/^H[1-4]$/.test(s.tagName)){i(),n=g,r=`${g}. `;continue}r.length+g.length>t&&i(),r+=`${g} `}}return i(),o}function Ng(e,t,A="id"){return e.map((o,n)=>{let r=o,i=String(r[A]??n+1);return{id:`grid-${i}`,source:"grid",ref:i,text:t.map(s=>`${s.label}: ${String(r[s.key]??"")}`).join(". ")}})}function DA(e={}){let t={...e,engine:e.engine??"rust"},A=[],o=[],n=new Map,r=0,i=null,s=null,g=null,a=!1,l=null;function I(){return tA(t.engine,A.length)?s?Promise.resolve(!0):(l||(l=xn().then(f=>(s=f?xA.create(f):null,!!s))),l):Promise.resolve(!1)}function u(){let f=[...t.includePage===!1?[]:Rg(t.root),...t.rows&&t.columns?Ng(t.rows,t.columns,t.rowKey):[],...(t.documents??[]).map(m=>({id:m.id,source:"custom",text:m.text}))],B=f.map(m=>`${m.source}${m.id}${m.ref??""}${m.text}`).join("");if(B!==i){i=B,A=f,o=A.map(m=>kA(m.text)),n=new Map;for(let m of o)for(let p of new Set(m))n.set(p,(n.get(p)??0)+1);r=o.reduce((m,p)=>m+p.length,0)/Math.max(1,o.length)}}u(),tA(t.engine,A.length)&&kn()&&I();function C(f,B){if(!s||!tA(t.engine,A.length)||!Number.isInteger(B)||B<=0||(g!==o&&(a=s.build(o),g=o),!a))return null;let m=o.length,p=f.map(d=>Math.log(1+(m-(n.get(d)??1)+.5)/((n.get(d)??1)+.5))),c=s.search(f,p,r||1,B);return c?c.map(d=>({...A[d.doc],score:d.score})):null}function h(f,B=5){let m=kA(f);if(!m.length)return[];let p=C(m,B);if(p)return p;s||I();let c=o.length;return o.map((Q,b)=>{let S=0;for(let F of m){let P=0;for(let D of Q)(D===F||F.length>=4&&D.startsWith(F)||D.length>=4&&F.startsWith(D))&&P++;if(!P)continue;let G=Math.log(1+(c-(n.get(F)??1)+.5)/((n.get(F)??1)+.5));S+=G*(P*2.2/(P+1.2*(.25+.75*(Q.length/(r||1)))))}return{...A[b],score:S}}).filter(Q=>Q.score>0).sort((Q,b)=>b.score-Q.score).slice(0,B)}async function y(f,B={}){await I();let m=h(f,B.k??4);if(!m.length)return{answer:"I couldn't find anything about that on this page or in the data.",hits:m,generated:!1};if(B.generate)try{let Q=m.map((S,F)=>`[${F+1}] ${S.text}`).join(`
|
|
380
380
|
`),b=await B.generate(f,Q);if(b?.trim())return{answer:b.trim(),hits:m,generated:!0}}catch{}let p=new Set(kA(f)),c=m.flatMap(Q=>Q.text.split(/(?<=[.!?।])\s+|\.\s+(?=\p{Lu})/u).map(b=>({s:b.trim(),h:Q}))).map(({s:Q,h:b})=>({s:Q,h:b,overlap:kA(Q).filter(S=>p.has(S)).length})).filter(Q=>Q.s&&Q.overlap>0).sort((Q,b)=>b.overlap-Q.overlap).slice(0,3);return{answer:c.length?c.map(Q=>Q.h.source==="grid"?`Row ${Q.h.ref}: ${Q.s}`:Q.s).join(`
|
|
381
|
-
`):m[0].text.slice(0,300),hits:m,generated:!1}}return{search:h,ask:y,rebuild:u,update(f){Object.assign(t,f),u()},size:()=>A.length,get engine(){return s&&tA(t.engine,A.length)?"rust":"ts"},whenEngineReady:()=>I().then(f=>f?"rust":"ts")}}import{useCallback as Eo,useEffect as li,useMemo as wo,useRef as iA,useState as ue}from"react";var Fg={en:{found:e=>`${e} row(s) found.`,count:e=>`${e} row(s).`,columns:"Grid columns retrieved.",rowFound:"Row found.",notFound:e=>`Row "${e}" not found.`,noneFound:"None of the given rows were found.",highlighted:e=>`${e} row(s) highlighted.`,selected:e=>`Row "${e}" selected.`,opened:e=>`Row "${e}" opened.`,notSupported:e=>`This grid does not support "${e}".`,emptyQuery:"Please enter something to search.",noIds:"No row IDs were given.",unknownColumn:e=>`Unknown column "${e}".`,badOperator:e=>`Unknown filter operator "${e}".`,badValue:"The filter value is not valid for this column.",filtered:e=>`Filter applied: ${e} row(s) match.`,filtersCleared:"All filters cleared.",sorted:(e,t)=>`Sorted by ${e} (${t==="asc"?"ascending":"descending"}).`,sortCleared:"Sorting cleared.",internal:"Something went wrong while running this action."},te:{found:e=>`${e} \u0C35\u0C30\u0C41\u0C38(\u0C32\u0C41) \u0C26\u0C4A\u0C30\u0C3F\u0C15\u0C3E\u0C2F\u0C3F.`,count:e=>`\u0C2E\u0C4A\u0C24\u0C4D\u0C24\u0C02 ${e} \u0C35\u0C30\u0C41\u0C38\u0C32\u0C41.`,columns:"\u0C15\u0C3E\u0C32\u0C2E\u0C4D\u200C\u0C32 \u0C35\u0C3F\u0C35\u0C30\u0C3E\u0C32\u0C41.",rowFound:"\u0C35\u0C30\u0C41\u0C38 \u0C26\u0C4A\u0C30\u0C3F\u0C15\u0C3F\u0C02\u0C26\u0C3F.",notFound:e=>`"${e}" \u0C35\u0C30\u0C41\u0C38 \u0C26\u0C4A\u0C30\u0C15\u0C32\u0C47\u0C26\u0C41.`,noneFound:"\u0C07\u0C1A\u0C4D\u0C1A\u0C3F\u0C28 \u0C35\u0C30\u0C41\u0C38\u0C32\u0C47\u0C35\u0C40 \u0C26\u0C4A\u0C30\u0C15\u0C32\u0C47\u0C26\u0C41.",highlighted:e=>`${e} \u0C35\u0C30\u0C41\u0C38(\u0C32\u0C41) \u0C39\u0C48\u0C32\u0C48\u0C1F\u0C4D \u0C1A\u0C47\u0C36\u0C3E\u0C28\u0C41.`,selected:e=>`"${e}" \u0C0E\u0C02\u0C1A\u0C41\u0C15\u0C41\u0C28\u0C4D\u0C28\u0C3E\u0C28\u0C41.`,opened:e=>`"${e}" \u0C24\u0C46\u0C30\u0C3F\u0C1A\u0C3E\u0C28\u0C41.`,notSupported:e=>`\u0C08 \u0C2A\u0C1F\u0C4D\u0C1F\u0C3F\u0C15\u0C32\u0C4B "${e}" \u0C38\u0C4C\u0C15\u0C30\u0C4D\u0C2F\u0C02 \u0C32\u0C47\u0C26\u0C41.`,emptyQuery:"\u0C35\u0C46\u0C24\u0C15\u0C21\u0C3E\u0C28\u0C3F\u0C15\u0C3F \u0C0F\u0C26\u0C48\u0C28\u0C3E \u0C30\u0C3E\u0C2F\u0C02\u0C21\u0C3F.",noIds:"\u0C35\u0C30\u0C41\u0C38 ID\u0C32\u0C41 \u0C07\u0C35\u0C4D\u0C35\u0C32\u0C47\u0C26\u0C41.",unknownColumn:e=>`"${e}" \u0C05\u0C28\u0C47 \u0C15\u0C3E\u0C32\u0C2E\u0C4D \u0C32\u0C47\u0C26\u0C41.`,badOperator:e=>`"${e}" \u0C05\u0C28\u0C47 \u0C2B\u0C3F\u0C32\u0C4D\u0C1F\u0C30\u0C4D \u0C35\u0C3F\u0C27\u0C3E\u0C28\u0C02 \u0C32\u0C47\u0C26\u0C41.`,badValue:"\u0C08 \u0C15\u0C3E\u0C32\u0C2E\u0C4D\u200C\u0C15\u0C3F \u0C08 \u0C2B\u0C3F\u0C32\u0C4D\u0C1F\u0C30\u0C4D \u0C35\u0C3F\u0C32\u0C41\u0C35 \u0C38\u0C30\u0C3F\u0C2A\u0C4B\u0C26\u0C41.",filtered:e=>`\u0C2B\u0C3F\u0C32\u0C4D\u0C1F\u0C30\u0C4D \u0C35\u0C47\u0C36\u0C3E\u0C28\u0C41: ${e} \u0C35\u0C30\u0C41\u0C38\u0C32\u0C41 \u0C38\u0C30\u0C3F\u0C2A\u0C4B\u0C2F\u0C3E\u0C2F\u0C3F.`,filtersCleared:"\u0C2B\u0C3F\u0C32\u0C4D\u0C1F\u0C30\u0C4D\u0C32\u0C28\u0C4D\u0C28\u0C40 \u0C24\u0C40\u0C38\u0C47\u0C36\u0C3E\u0C28\u0C41.",sorted:(e,t)=>`${e} \u0C2A\u0C4D\u0C30\u0C15\u0C3E\u0C30\u0C02 \u0C15\u0C4D\u0C30\u0C2E\u0C02 (${t==="asc"?"\u0C06\u0C30\u0C4B\u0C39\u0C23":"\u0C05\u0C35\u0C30\u0C4B\u0C39\u0C23"}).`,sortCleared:"\u0C15\u0C4D\u0C30\u0C2E\u0C02 \u0C24\u0C40\u0C38\u0C47\u0C36\u0C3E\u0C28\u0C41.",internal:"\u0C08 \u0C2A\u0C28\u0C3F \u0C1A\u0C47\u0C38\u0C4D\u0C24\u0C41\u0C02\u0C21\u0C17\u0C3E \u0C38\u0C2E\u0C38\u0C4D\u0C2F \u0C35\u0C1A\u0C4D\u0C1A\u0C3F\u0C02\u0C26\u0C3F."}};function Te(e){return Fg[e.locale??"en"]}function Je(e,t){return{success:!0,message:e,data:t}}function ce(e,t){return{success:!1,message:t,error:{code:e}}}var Sn=["contains","equals","startsWith","endsWith","greaterThan","lessThan","between"];function he(e,t="id"){let A=e?.[t];return A==null?"":String(A)}function Et(e){return String(e??"").normalize("NFC").toLowerCase().trim()}function Gn(e){if(typeof e=="number")return Number.isFinite(e)?e:null;let t=String(e??"").trim();if(t==="")return null;let A=Number(t);return Number.isFinite(A)?A:null}function vn(e){if(e instanceof Date)return e.getTime();let t=new Date(String(e??"")).getTime();return Number.isFinite(t)?t:null}function Rn(e){return(Array.isArray(e)?e:typeof e=="string"?e.split(","):[]).map(A=>String(A).trim()).filter(Boolean)}function Io(e,t){let A=Et(t);return e.columns.find(o=>Et(o.key)===A||Et(o.label)===A)}function SA(e,t){return e.data.find(A=>he(A,e.rowKey)===t)}function Tg(e,t){return e[t]}function Mg(e,t,A){let o=Tg(e,A.key),n=A.type??"text";if(n==="number"||n==="date"){let s=n==="number"?Gn:vn,g=s(o);if(g===null)return!1;if(t.operator==="between"){let[l,I]=t.value,u=s(l),C=s(I);return u!==null&&C!==null&&g>=Math.min(u,C)&&g<=Math.max(u,C)}let a=s(t.value);if(a===null)return!1;switch(t.operator){case"equals":return g===a;case"greaterThan":return g>a;case"lessThan":return g<a;default:break}}let r=Et(o),i=Et(t.value);switch(t.operator){case"equals":return r===i;case"startsWith":return r.startsWith(i);case"endsWith":return r.endsWith(i);case"contains":return r.includes(i);default:return!1}}function Lg(e,t){let A=t.type??"text",o=A==="date"?vn:Gn;return e.operator==="between"?A==="text"||!Array.isArray(e.value)||e.value.length!==2?!1:o(e.value[0])!==null&&o(e.value[1])!==null:e.operator==="greaterThan"||e.operator==="lessThan"?A!=="text"&&o(e.value)!==null:!Array.isArray(e.value)&&String(e.value).trim()!==""}function st(e,t,A){return A.length?Nn({data:e,columns:t},A):e}function wt(e){return e.map(t=>({key:String(t.key),label:t.label,type:t.type==="number"?"number":t.type==="date"?"date":"text"}))}function Nn(e,t){return e.data.filter(A=>t.every(o=>{let n=Io(e,o.key);return n?Mg(A,o,n):!0}))}function Fn(e,t){let A=Te(e),o=Et(t);if(!o)return ce("INVALID_INPUT",A.emptyQuery);let n=e.data.filter(i=>e.columns.some(s=>Et(i[s.key]).includes(o))),r=n.map(i=>he(i,e.rowKey)).filter(Boolean);return e.onHighlightRows?.(r),Je(A.found(n.length),n)}function Tn(e){return Je(Te(e).count(e.data.length),e.data.length)}function Mn(e){return Je(Te(e).columns,e.columns)}function Ln(e,t){let A=Te(e),o=String(t??"").trim();if(!o)return ce("INVALID_INPUT",A.noIds);let n=SA(e,o);return n?Je(A.rowFound,n):ce("NOT_FOUND",A.notFound(o))}function AA(e,t){let A=Te(e),o=Rn(t);if(o.length===0)return ce("INVALID_INPUT",A.noIds);if(!e.onHighlightRows)return ce("NOT_SUPPORTED",A.notSupported("highlight"));let n=o.filter(r=>SA(e,r)!==void 0);return n.length===0?ce("NOT_FOUND",A.noneFound):(e.onHighlightRows(n),Je(A.highlighted(n.length),n))}function GA(e,t){let A=Te(e),o=String(t??"").trim();return o?e.onSelectRow?SA(e,o)?(e.onSelectRow(o),Je(A.selected(o),o)):ce("NOT_FOUND",A.notFound(o)):ce("NOT_SUPPORTED",A.notSupported("select")):ce("INVALID_INPUT",A.noIds)}function vA(e,t){let A=Te(e),o=String(t??"").trim();return o?e.onOpenRow?SA(e,o)?(e.onOpenRow(o),Je(A.opened(o),o)):ce("NOT_FOUND",A.notFound(o)):ce("NOT_SUPPORTED",A.notSupported("open")):ce("INVALID_INPUT",A.noIds)}function Yn(e,t){let A=Te(e),o=Io(e,t?.key??"");if(!o)return ce("INVALID_INPUT",A.unknownColumn(String(t?.key??"")));if(!Sn.includes(t.operator))return ce("INVALID_INPUT",A.badOperator(String(t.operator)));let n={...t,key:o.key};if(!Lg(n,o))return ce("INVALID_INPUT",A.badValue);if(!e.onFiltersChange)return ce("NOT_SUPPORTED",A.notSupported("filter"));let r=[...(e.filters??[]).filter(s=>s.key!==o.key),n],i=Nn(e,r).length;return e.onFiltersChange(r),Je(A.filtered(i),{filters:r,count:i})}function Un(e){let t=Te(e);return e.onFiltersChange?(e.onFiltersChange([]),Je(t.filtersCleared,[])):ce("NOT_SUPPORTED",t.notSupported("clear filters"))}function Jn(e,t,A="asc"){let o=Te(e),n=Io(e,t);if(!n)return ce("INVALID_INPUT",o.unknownColumn(String(t)));if(A!=="asc"&&A!=="desc")return ce("INVALID_INPUT",o.badValue);if(!e.onSortChange)return ce("NOT_SUPPORTED",o.notSupported("sort"));let r={key:n.key,direction:A};return e.onSortChange(r),Je(o.sorted(n.label,A),r)}function Pn(e){let t=Te(e);return e.onSortChange?(e.onSortChange(null),Je(t.sortCleared,null)):ce("NOT_SUPPORTED",t.notSupported("clear sort"))}var Yg={search:"Search all columns for text. Matching rows are highlighted.",count:"Count the rows currently in the grid.",columns:"List the grid's columns with their keys, labels and types.",get_row:"Get one row by its ID.",highlight:"Highlight one or more rows by ID without filtering the grid.",select:"Select one row by ID.",open:"Open one row by ID to show its full details.",filter:"Filter the grid by one column. Replaces any existing filter on that column.",clear_filters:"Remove all filters.",sort:"Sort the grid by one column, ascending or descending.",clear_sort:"Remove sorting."},Dn={en:{search:"Search",count:"Count",columns:"Columns",get_row:"Get row",highlight:"Highlight",select:"Select",open:"Open",filter:"Filter",clear_filters:"Clear filters",sort:"Sort",clear_sort:"Clear sort"},te:{search:"\u0C35\u0C46\u0C24\u0C41\u0C15\u0C41",count:"\u0C32\u0C46\u0C15\u0C4D\u0C15",columns:"\u0C15\u0C3E\u0C32\u0C2E\u0C4D\u200C\u0C32\u0C41",get_row:"\u0C35\u0C30\u0C41\u0C38 \u0C1A\u0C42\u0C2A\u0C41",highlight:"\u0C39\u0C48\u0C32\u0C48\u0C1F\u0C4D",select:"\u0C0E\u0C02\u0C1A\u0C41\u0C15\u0C4B",open:"\u0C24\u0C46\u0C30\u0C41\u0C35\u0C41",filter:"\u0C2B\u0C3F\u0C32\u0C4D\u0C1F\u0C30\u0C4D",clear_filters:"\u0C2B\u0C3F\u0C32\u0C4D\u0C1F\u0C30\u0C4D\u0C32\u0C41 \u0C24\u0C40\u0C38\u0C47\u0C2F\u0C3F",sort:"\u0C15\u0C4D\u0C30\u0C2E\u0C02",clear_sort:"\u0C15\u0C4D\u0C30\u0C2E\u0C02 \u0C24\u0C40\u0C38\u0C47\u0C2F\u0C3F"}};async function Ug(e,t){try{return t()}catch{return ce("INTERNAL",Te(e).internal)}}function oA(e,t={}){let A=t.name??"yuktai_grid",o=Dn[e.locale??"en"],n=g=>t.descriptions?.[g]??Yg[g],r={id:{type:"string",description:"Row ID"}},i=e.columns.map(g=>g.key);return[{id:"search",available:!0,schema:{type:"object",properties:{query:{type:"string"}},required:["query"]},run:g=>Fn(e,String(g.query??""))},{id:"count",available:!0,schema:{type:"object",properties:{}},run:()=>Tn(e)},{id:"columns",available:!0,schema:{type:"object",properties:{}},run:()=>Mn(e)},{id:"get_row",available:!0,schema:{type:"object",properties:r,required:["id"]},run:g=>Ln(e,String(g.id??""))},{id:"highlight",available:!!e.onHighlightRows,schema:{type:"object",properties:{ids:{type:"array",items:{type:"string"},description:"Row IDs"}},required:["ids"]},run:g=>AA(e,Rn(g.ids))},{id:"select",available:!!e.onSelectRow,schema:{type:"object",properties:r,required:["id"]},run:g=>GA(e,String(g.id??""))},{id:"open",available:!!e.onOpenRow,schema:{type:"object",properties:r,required:["id"]},run:g=>vA(e,String(g.id??""))},{id:"filter",available:!!e.onFiltersChange,schema:{type:"object",properties:{key:{type:"string",enum:i},operator:{type:"string",enum:Sn},value:{description:"Text or number; for 'between' an array of two numbers or dates"}},required:["key","operator","value"]},run:g=>Yn(e,{key:String(g.key??""),operator:String(g.operator??""),value:g.value})},{id:"clear_filters",available:!!e.onFiltersChange,schema:{type:"object",properties:{}},run:()=>Un(e)},{id:"sort",available:!!e.onSortChange,schema:{type:"object",properties:{key:{type:"string",enum:i},direction:{type:"string",enum:["asc","desc"]}},required:["key"]},run:g=>Jn(e,String(g.key??""),g.direction==="desc"?"desc":"asc")},{id:"clear_sort",available:!!e.onSortChange,schema:{type:"object",properties:{}},run:()=>Pn(e)}].filter(g=>g.available).map(g=>({name:`${A}_${g.id}`,title:Dn.en[g.id],description:n(g.id),label:o[g.id],inputSchema:g.schema,execute:a=>Ug(e,()=>g.run(a??{}))}))}var RA={"html-lang":{title:"Page language is set",wcag:"3.1.1",severity:"serious",why:"Screen readers pick their voice and pronunciation from the page language. Without it, Telugu or Hindi text may be read with English rules."},"page-title":{title:"Page has a title",wcag:"2.4.2",severity:"serious",why:"The title is the first thing announced and the name shown on browser tabs and bookmarks."},"image-alt":{title:"Images have alternative text",wcag:"1.1.1",severity:"critical",why:'People who cannot see the image get no information from it unless alt text describes it (or alt="" marks it as decorative).'},"heading-order":{title:"Headings follow a logical order",wcag:"1.3.1",severity:"moderate",why:"Many screen-reader users jump between headings. Skipped levels make the page outline confusing."},"single-h1":{title:"Page has one main heading",wcag:"best practice",severity:"minor",why:"A single h1 tells everyone what the page is about."},"landmark-main":{title:"Main content landmark exists",wcag:"1.3.1 / 2.4.1",severity:"moderate",why:"A <main> region lets keyboard and screen-reader users skip straight past menus to the content."},"form-label":{title:"Form fields have labels",wcag:"1.3.1 / 4.1.2",severity:"critical",why:'Without a label, a screen reader just says "edit text" and the user has to guess what to type.'},"button-name":{title:"Buttons have names",wcag:"4.1.2",severity:"critical",why:'An icon-only button with no name is announced as just "button", so its purpose is unknown.'},"link-name":{title:"Links have names",wcag:"2.4.4",severity:"serious",why:"Links are often read out of context in a list. An empty link gives no clue where it goes."},"color-contrast":{title:"Text has enough contrast",wcag:"1.4.3",severity:"serious",why:"Low-contrast text is hard to read for older users, people with low vision, and anyone outdoors on a phone."},"positive-tabindex":{title:"No positive tabindex",wcag:"2.4.3",severity:"moderate",why:"tabindex greater than 0 forces a custom keyboard order that usually doesn't match the visual order."},"keyboard-access":{title:"Clickable things work with a keyboard",wcag:"2.1.1",severity:"critical",why:"A div or span with a click handler can't be reached or activated with Tab and Enter, locking out keyboard users."},"duplicate-id":{title:"IDs are unique",wcag:"best practice",severity:"minor",why:"Labels and ARIA references point at ids. Duplicates make them point at the wrong element."},"form-error":{title:"Errors are linked to their fields",wcag:"3.3.1",severity:"serious",why:"When a field is marked invalid, the error message must be connected to it so it's announced together with the field."},"target-size":{title:"Touch targets are large enough",wcag:"2.5.8",severity:"moderate",why:"Small targets are hard to tap for people with tremors, seniors and everyone on mobile."}},Jg={critical:10,serious:5,moderate:2,minor:1};function at(e={}){let t=Ne(e.root),A=new Set(e.skip??[]),o=[],n={},r=t?Bt(t)?t:t.ownerDocument:null,i=(s,g,a,l,I=!1)=>{if(A.has(s))return;let u=RA[s],C=n[s]=(n[s]??0)+1;o.push({id:`${s}-${C}`,rule:s,severity:u.severity,wcag:u.wcag,message:a,why:u.why,fix:l,selector:g?ze(g):"document",snippet:g?me(g.outerHTML,120):"",autoFixable:I,element:g??void 0})};if(t&&r){r.documentElement.getAttribute("lang")||i("html-lang",r.documentElement,"The <html> element has no lang attribute.",'Add lang to <html>, e.g. <html lang="te"> or "en".',!0),r.title.trim()||i("page-title",null,"The page has no <title>.","Add a short, descriptive <title> that names this page.");for(let c of O(t,"img"))if(!(c.getAttribute("role")==="presentation"||c.getAttribute("role")==="none")&&!c.hasAttribute("alt")&&!c.getAttribute("aria-label")&&!c.getAttribute("aria-labelledby")){let d=c.getAttribute("title");i("image-alt",c,`Image has no alt text${c.getAttribute("src")?` (${me(c.getAttribute("src")??"",40)})`:""}.`,d?`Use the title as alt: alt="${me(d,40)}".`:'Describe the image in alt, or use alt="" if it is purely decorative.',!!d)}let s=O(t,"h1,h2,h3,h4,h5,h6"),g=0;for(let c of s){let d=Number(c.tagName[1]);g>0&&d>g+1&&i("heading-order",c,`Heading jumps from h${g} to h${d}: "${me(c.textContent??"",40)}".`,`Change it to h${g+1}, or add the missing level above it.`),g=d}let a=s.filter(c=>c.tagName==="H1");a.length===0?i("single-h1",null,"The page has no h1.","Add one h1 that names the page."):a.length>1&&i("single-h1",a[1],`The page has ${a.length} h1 headings.`,"Keep one h1; turn the others into h2."),t.querySelectorAll("main,[role='main']").length===0&&i("landmark-main",null,"No <main> landmark found.","Wrap the primary content in <main>.");let l=O(t,"input,select,textarea").filter(c=>{let d=(c.getAttribute("type")??"text").toLowerCase();return!["hidden","submit","button","reset","image"].includes(d)});for(let c of l){if(!Ye(c)){let d=c.getAttribute("placeholder")||c.getAttribute("name");i("form-label",c,`Form field has no label${d?` (placeholder/name: "${me(d,30)}")`:""}.`,d?`Add a visible <label>. Quick fix: aria-label="${me(d,30)}".`:"Add a visible <label for=\u2026> describing what to enter.",!!d)}c.getAttribute("aria-invalid")==="true"&&(c.getAttribute("aria-describedby")||c.getAttribute("aria-errormessage")||i("form-error",c,"Field is marked invalid but no error message is linked to it.","Put the error text in an element with an id and point aria-describedby at it."))}for(let c of O(t,"button,[role='button'],input[type='submit'],input[type='button']"))if(!Ye(c)){let d=c.getAttribute("title");i("button-name",c,"Button has no accessible name.",d?`Use the title as the name: aria-label="${d}".`:"Add visible text or an aria-label that says what the button does.",!!d)}for(let c of O(t,"a[href]"))if(!Ye(c)){let d=c.getAttribute("title");i("link-name",c,`Link has no text (${me(c.getAttribute("href")??"",40)}).`,d?`Use the title as the name: aria-label="${d}".`:"Add link text that says where it goes.",!!d)}for(let c of O(t,"[tabindex]"))Number(c.getAttribute("tabindex"))>0&&i("positive-tabindex",c,`tabindex="${c.getAttribute("tabindex")}" overrides the natural tab order.`,'Use tabindex="0" and fix the order in the HTML instead.',!0);let I="a[href],button,input,select,textarea,summary";for(let c of O(t,"[onclick],[role='button'],[role='link']"))c.matches(I)||c.hasAttribute("tabindex")||i("keyboard-access",c,`<${c.tagName.toLowerCase()}> is clickable but can't be reached with the keyboard.`,'Use a real <button>, or add tabindex="0", a role and Enter/Space key handling.',!0);let u=new Map;for(let c of Array.from(t.querySelectorAll("[id]")))c.closest(IA)||u.set(c.id,(u.get(c.id)??0)+1);for(let[c,d]of u)d>1&&i("duplicate-id",t.querySelector(`[id="${c.replace(/"/g,'\\"')}"]`),`id="${c}" is used ${d} times.`,"Give each element a unique id.");let C=e.maxContrastChecks??600,h=0;for(let c of O(t,"body *")){if(h>=C)break;if(!Ot(c)||["SCRIPT","STYLE","NOSCRIPT","OPTION"].includes(c.tagName))continue;h++;let d=zA(window.getComputedStyle(c).color),Q=Ko(c);if(!d||!Q)continue;let b=OA(d,Q),S=qo(c)?3:4.5;b<S&&i("color-contrast",c,`Contrast ${b}:1 is below ${S}:1 for "${me(c.textContent??"",30)}".`,`Darken the text or lighten the background until the ratio is at least ${S}:1.`)}let y=e.minTargetSize??24,f=O(t,CA).map(c=>({el:c,rect:c.getBoundingClientRect()})).filter(c=>c.rect.width>0||c.rect.height>0),B=c=>c.width<y||c.height<y,m=c=>[c.left+c.width/2,c.top+c.height/2],p=(c,d,Q)=>Math.hypot(Math.max(Q.left-c,0,c-Q.right),Math.max(Q.top-d,0,d-Q.bottom));for(let c of f){if(!B(c.rect)||c.el.tagName==="A"&&c.el.closest("p,li,td"))continue;let[d,Q]=m(c.rect);f.some(S=>{if(S===c||S.el.contains(c.el)||c.el.contains(S.el))return!1;if(p(d,Q,S.rect)<y/2)return!0;if(!B(S.rect))return!1;let[F,P]=m(S.rect);return Math.hypot(d-F,Q-P)<y})&&i("target-size",c.el,`Target is ${Math.round(c.rect.width)}\xD7${Math.round(c.rect.height)}px and too close to another target (needs ${y}\xD7${y}, or ${y}px of space around it).`,`Increase padding so it's at least ${y}\xD7${y}px (44\xD744 is better for seniors), or add space between targets.`)}}return Pg(o,r,A)}function Pg(e,t,A){let o=Object.keys(RA).filter(g=>!A.has(g)).map(g=>{let a=e.filter(l=>l.rule===g).length;return{rule:g,title:RA[g].title,passed:a===0,issueCount:a}}),n=0;for(let g of o){let a=Jg[RA[g.rule].severity];n+=Math.min(25,g.issueCount*a)}let r=Math.max(0,100-n),i=o.filter(g=>!g.passed),s=e.filter(g=>g.severity==="critical").length;return{url:t?.location?.href??"",title:t?.title??"",generatedAt:new Date().toISOString(),score:r,passed:s===0&&r>=80,checks:o,issues:e,summary:e.length===0?`All ${o.length} checks passed.`:`${o.length-i.length} of ${o.length} checks passed. ${e.length} issue(s) found, ${s} critical. Score ${r}/100.`}}function Kn(e){let t=["# Accessibility QA report","",`- Page: ${e.title||"(untitled)"} ${e.url}`,`- Generated: ${e.generatedAt}`,`- Score: **${e.score}/100** \u2014 ${e.passed?"PASS":"FAIL"}`,"",e.summary,"","## Checks","","| Check | Result | Issues |","|---|---|---|",...e.checks.map(A=>`| ${A.title} | ${A.passed?"\u2705 Pass":"\u274C Fail"} | ${A.issueCount} |`)];if(e.issues.length){t.push("","## Issues","");for(let A of e.issues)t.push(`### ${A.id} \xB7 ${A.severity} \xB7 WCAG ${A.wcag}`,"",`- **Problem:** ${A.message}`,`- **Why it matters:** ${A.why}`,`- **Fix:** ${A.fix}`,`- **Where:** \`${A.selector}\``,"")}return t.join(`
|
|
381
|
+
`):m[0].text.slice(0,300),hits:m,generated:!1}}return{search:h,ask:y,rebuild:u,update(f){Object.assign(t,f),u()},size:()=>A.length,get engine(){return s&&tA(t.engine,A.length)?"rust":"ts"},whenEngineReady:()=>I().then(f=>f?"rust":"ts")}}import{useCallback as Eo,useEffect as li,useMemo as wo,useRef as iA,useState as ue}from"react";var Fg={en:{found:e=>`${e} row(s) found.`,count:e=>`${e} row(s).`,columns:"Grid columns retrieved.",rowFound:"Row found.",notFound:e=>`Row "${e}" not found.`,noneFound:"None of the given rows were found.",highlighted:e=>`${e} row(s) highlighted.`,selected:e=>`Row "${e}" selected.`,opened:e=>`Row "${e}" opened.`,notSupported:e=>`This grid does not support "${e}".`,emptyQuery:"Please enter something to search.",noIds:"No row IDs were given.",unknownColumn:e=>`Unknown column "${e}".`,badOperator:e=>`Unknown filter operator "${e}".`,badValue:"The filter value is not valid for this column.",filtered:e=>`Filter applied: ${e} row(s) match.`,filtersCleared:"All filters cleared.",sorted:(e,t)=>`Sorted by ${e} (${t==="asc"?"ascending":"descending"}).`,sortCleared:"Sorting cleared.",internal:"Something went wrong while running this action."},te:{found:e=>`${e} \u0C35\u0C30\u0C41\u0C38(\u0C32\u0C41) \u0C26\u0C4A\u0C30\u0C3F\u0C15\u0C3E\u0C2F\u0C3F.`,count:e=>`\u0C2E\u0C4A\u0C24\u0C4D\u0C24\u0C02 ${e} \u0C35\u0C30\u0C41\u0C38\u0C32\u0C41.`,columns:"\u0C15\u0C3E\u0C32\u0C2E\u0C4D\u200C\u0C32 \u0C35\u0C3F\u0C35\u0C30\u0C3E\u0C32\u0C41.",rowFound:"\u0C35\u0C30\u0C41\u0C38 \u0C26\u0C4A\u0C30\u0C3F\u0C15\u0C3F\u0C02\u0C26\u0C3F.",notFound:e=>`"${e}" \u0C35\u0C30\u0C41\u0C38 \u0C26\u0C4A\u0C30\u0C15\u0C32\u0C47\u0C26\u0C41.`,noneFound:"\u0C07\u0C1A\u0C4D\u0C1A\u0C3F\u0C28 \u0C35\u0C30\u0C41\u0C38\u0C32\u0C47\u0C35\u0C40 \u0C26\u0C4A\u0C30\u0C15\u0C32\u0C47\u0C26\u0C41.",highlighted:e=>`${e} \u0C35\u0C30\u0C41\u0C38(\u0C32\u0C41) \u0C39\u0C48\u0C32\u0C48\u0C1F\u0C4D \u0C1A\u0C47\u0C36\u0C3E\u0C28\u0C41.`,selected:e=>`"${e}" \u0C0E\u0C02\u0C1A\u0C41\u0C15\u0C41\u0C28\u0C4D\u0C28\u0C3E\u0C28\u0C41.`,opened:e=>`"${e}" \u0C24\u0C46\u0C30\u0C3F\u0C1A\u0C3E\u0C28\u0C41.`,notSupported:e=>`\u0C08 \u0C2A\u0C1F\u0C4D\u0C1F\u0C3F\u0C15\u0C32\u0C4B "${e}" \u0C38\u0C4C\u0C15\u0C30\u0C4D\u0C2F\u0C02 \u0C32\u0C47\u0C26\u0C41.`,emptyQuery:"\u0C35\u0C46\u0C24\u0C15\u0C21\u0C3E\u0C28\u0C3F\u0C15\u0C3F \u0C0F\u0C26\u0C48\u0C28\u0C3E \u0C30\u0C3E\u0C2F\u0C02\u0C21\u0C3F.",noIds:"\u0C35\u0C30\u0C41\u0C38 ID\u0C32\u0C41 \u0C07\u0C35\u0C4D\u0C35\u0C32\u0C47\u0C26\u0C41.",unknownColumn:e=>`"${e}" \u0C05\u0C28\u0C47 \u0C15\u0C3E\u0C32\u0C2E\u0C4D \u0C32\u0C47\u0C26\u0C41.`,badOperator:e=>`"${e}" \u0C05\u0C28\u0C47 \u0C2B\u0C3F\u0C32\u0C4D\u0C1F\u0C30\u0C4D \u0C35\u0C3F\u0C27\u0C3E\u0C28\u0C02 \u0C32\u0C47\u0C26\u0C41.`,badValue:"\u0C08 \u0C15\u0C3E\u0C32\u0C2E\u0C4D\u200C\u0C15\u0C3F \u0C08 \u0C2B\u0C3F\u0C32\u0C4D\u0C1F\u0C30\u0C4D \u0C35\u0C3F\u0C32\u0C41\u0C35 \u0C38\u0C30\u0C3F\u0C2A\u0C4B\u0C26\u0C41.",filtered:e=>`\u0C2B\u0C3F\u0C32\u0C4D\u0C1F\u0C30\u0C4D \u0C35\u0C47\u0C36\u0C3E\u0C28\u0C41: ${e} \u0C35\u0C30\u0C41\u0C38\u0C32\u0C41 \u0C38\u0C30\u0C3F\u0C2A\u0C4B\u0C2F\u0C3E\u0C2F\u0C3F.`,filtersCleared:"\u0C2B\u0C3F\u0C32\u0C4D\u0C1F\u0C30\u0C4D\u0C32\u0C28\u0C4D\u0C28\u0C40 \u0C24\u0C40\u0C38\u0C47\u0C36\u0C3E\u0C28\u0C41.",sorted:(e,t)=>`${e} \u0C2A\u0C4D\u0C30\u0C15\u0C3E\u0C30\u0C02 \u0C15\u0C4D\u0C30\u0C2E\u0C02 (${t==="asc"?"\u0C06\u0C30\u0C4B\u0C39\u0C23":"\u0C05\u0C35\u0C30\u0C4B\u0C39\u0C23"}).`,sortCleared:"\u0C15\u0C4D\u0C30\u0C2E\u0C02 \u0C24\u0C40\u0C38\u0C47\u0C36\u0C3E\u0C28\u0C41.",internal:"\u0C08 \u0C2A\u0C28\u0C3F \u0C1A\u0C47\u0C38\u0C4D\u0C24\u0C41\u0C02\u0C21\u0C17\u0C3E \u0C38\u0C2E\u0C38\u0C4D\u0C2F \u0C35\u0C1A\u0C4D\u0C1A\u0C3F\u0C02\u0C26\u0C3F."}};function Te(e){return Fg[e.locale??"en"]}function Je(e,t){return{success:!0,message:e,data:t}}function ce(e,t){return{success:!1,message:t,error:{code:e}}}var Sn=["contains","equals","startsWith","endsWith","greaterThan","lessThan","between"];function he(e,t="id"){let A=e?.[t];return A==null?"":String(A)}function Et(e){return String(e??"").normalize("NFC").toLowerCase().trim()}function Gn(e){if(typeof e=="number")return Number.isFinite(e)?e:null;let t=String(e??"").trim();if(t==="")return null;let A=Number(t);return Number.isFinite(A)?A:null}function vn(e){if(e instanceof Date)return e.getTime();let t=new Date(String(e??"")).getTime();return Number.isFinite(t)?t:null}function Rn(e){return(Array.isArray(e)?e:typeof e=="string"?e.split(","):[]).map(A=>String(A).trim()).filter(Boolean)}function Io(e,t){let A=Et(t);return e.columns.find(o=>Et(o.key)===A||Et(o.label)===A)}function SA(e,t){return e.data.find(A=>he(A,e.rowKey)===t)}function Tg(e,t){return e[t]}function Mg(e,t,A){let o=Tg(e,A.key),n=A.type??"text";if(n==="number"||n==="date"){let s=n==="number"?Gn:vn,g=s(o);if(g===null)return!1;if(t.operator==="between"){let[l,I]=t.value,u=s(l),C=s(I);return u!==null&&C!==null&&g>=Math.min(u,C)&&g<=Math.max(u,C)}let a=s(t.value);if(a===null)return!1;switch(t.operator){case"equals":return g===a;case"greaterThan":return g>a;case"lessThan":return g<a;default:break}}let r=Et(o),i=Et(t.value);switch(t.operator){case"equals":return r===i;case"startsWith":return r.startsWith(i);case"endsWith":return r.endsWith(i);case"contains":return r.includes(i);default:return!1}}function Lg(e,t){let A=t.type??"text",o=A==="date"?vn:Gn;return e.operator==="between"?A==="text"||!Array.isArray(e.value)||e.value.length!==2?!1:o(e.value[0])!==null&&o(e.value[1])!==null:e.operator==="greaterThan"||e.operator==="lessThan"?A!=="text"&&o(e.value)!==null:!Array.isArray(e.value)&&String(e.value).trim()!==""}function st(e,t,A){return A.length?Nn({data:e,columns:t},A):e}function wt(e){return e.map(t=>({key:String(t.key),label:t.label,type:t.type==="number"?"number":t.type==="date"?"date":"text"}))}function Nn(e,t){return e.data.filter(A=>t.every(o=>{let n=Io(e,o.key);return n?Mg(A,o,n):!0}))}function Fn(e,t){let A=Te(e),o=Et(t);if(!o)return ce("INVALID_INPUT",A.emptyQuery);let n=e.data.filter(i=>e.columns.some(s=>Et(i[s.key]).includes(o))),r=n.map(i=>he(i,e.rowKey)).filter(Boolean);return e.onHighlightRows?.(r),Je(A.found(n.length),n)}function Tn(e){return Je(Te(e).count(e.data.length),e.data.length)}function Mn(e){return Je(Te(e).columns,e.columns)}function Ln(e,t){let A=Te(e),o=String(t??"").trim();if(!o)return ce("INVALID_INPUT",A.noIds);let n=SA(e,o);return n?Je(A.rowFound,n):ce("NOT_FOUND",A.notFound(o))}function AA(e,t){let A=Te(e),o=Rn(t);if(o.length===0)return ce("INVALID_INPUT",A.noIds);if(!e.onHighlightRows)return ce("NOT_SUPPORTED",A.notSupported("highlight"));let n=o.filter(r=>SA(e,r)!==void 0);return n.length===0?ce("NOT_FOUND",A.noneFound):(e.onHighlightRows(n),Je(A.highlighted(n.length),n))}function GA(e,t){let A=Te(e),o=String(t??"").trim();return o?e.onSelectRow?SA(e,o)?(e.onSelectRow(o),Je(A.selected(o),o)):ce("NOT_FOUND",A.notFound(o)):ce("NOT_SUPPORTED",A.notSupported("select")):ce("INVALID_INPUT",A.noIds)}function vA(e,t){let A=Te(e),o=String(t??"").trim();return o?e.onOpenRow?SA(e,o)?(e.onOpenRow(o),Je(A.opened(o),o)):ce("NOT_FOUND",A.notFound(o)):ce("NOT_SUPPORTED",A.notSupported("open")):ce("INVALID_INPUT",A.noIds)}function Yn(e,t){let A=Te(e),o=Io(e,t?.key??"");if(!o)return ce("INVALID_INPUT",A.unknownColumn(String(t?.key??"")));if(!Sn.includes(t.operator))return ce("INVALID_INPUT",A.badOperator(String(t.operator)));let n={...t,key:o.key};if(!Lg(n,o))return ce("INVALID_INPUT",A.badValue);if(!e.onFiltersChange)return ce("NOT_SUPPORTED",A.notSupported("filter"));let r=[...(e.filters??[]).filter(s=>s.key!==o.key),n],i=Nn(e,r).length;return e.onFiltersChange(r),Je(A.filtered(i),{filters:r,count:i})}function Un(e){let t=Te(e);return e.onFiltersChange?(e.onFiltersChange([]),Je(t.filtersCleared,[])):ce("NOT_SUPPORTED",t.notSupported("clear filters"))}function Jn(e,t,A="asc"){let o=Te(e),n=Io(e,t);if(!n)return ce("INVALID_INPUT",o.unknownColumn(String(t)));if(A!=="asc"&&A!=="desc")return ce("INVALID_INPUT",o.badValue);if(!e.onSortChange)return ce("NOT_SUPPORTED",o.notSupported("sort"));let r={key:n.key,direction:A};return e.onSortChange(r),Je(o.sorted(n.label,A),r)}function Pn(e){let t=Te(e);return e.onSortChange?(e.onSortChange(null),Je(t.sortCleared,null)):ce("NOT_SUPPORTED",t.notSupported("clear sort"))}var Yg={search:"Search all columns for text. Matching rows are highlighted.",count:"Count the rows currently in the grid.",columns:"List the grid's columns with their keys, labels and types.",get_row:"Get one row by its ID.",highlight:"Highlight one or more rows by ID without filtering the grid.",select:"Select one row by ID.",open:"Open one row by ID to show its full details.",filter:"Filter the grid by one column. Replaces any existing filter on that column.",clear_filters:"Remove all filters.",sort:"Sort the grid by one column, ascending or descending.",clear_sort:"Remove sorting."},Dn={en:{search:"Search",count:"Count",columns:"Columns",get_row:"Get row",highlight:"Highlight",select:"Select",open:"Open",filter:"Filter",clear_filters:"Clear filters",sort:"Sort",clear_sort:"Clear sort"},te:{search:"\u0C35\u0C46\u0C24\u0C41\u0C15\u0C41",count:"\u0C32\u0C46\u0C15\u0C4D\u0C15",columns:"\u0C15\u0C3E\u0C32\u0C2E\u0C4D\u200C\u0C32\u0C41",get_row:"\u0C35\u0C30\u0C41\u0C38 \u0C1A\u0C42\u0C2A\u0C41",highlight:"\u0C39\u0C48\u0C32\u0C48\u0C1F\u0C4D",select:"\u0C0E\u0C02\u0C1A\u0C41\u0C15\u0C4B",open:"\u0C24\u0C46\u0C30\u0C41\u0C35\u0C41",filter:"\u0C2B\u0C3F\u0C32\u0C4D\u0C1F\u0C30\u0C4D",clear_filters:"\u0C2B\u0C3F\u0C32\u0C4D\u0C1F\u0C30\u0C4D\u0C32\u0C41 \u0C24\u0C40\u0C38\u0C47\u0C2F\u0C3F",sort:"\u0C15\u0C4D\u0C30\u0C2E\u0C02",clear_sort:"\u0C15\u0C4D\u0C30\u0C2E\u0C02 \u0C24\u0C40\u0C38\u0C47\u0C2F\u0C3F"}};async function Ug(e,t){try{return t()}catch{return ce("INTERNAL",Te(e).internal)}}function oA(e,t={}){let A=t.name??"yuktai_grid",o=Dn[e.locale??"en"],n=g=>t.descriptions?.[g]??Yg[g],r={id:{type:"string",description:"Row ID"}},i=e.columns.map(g=>g.key);return[{id:"search",available:!0,schema:{type:"object",properties:{query:{type:"string"}},required:["query"]},run:g=>Fn(e,String(g.query??""))},{id:"count",available:!0,schema:{type:"object",properties:{}},run:()=>Tn(e)},{id:"columns",available:!0,schema:{type:"object",properties:{}},run:()=>Mn(e)},{id:"get_row",available:!0,schema:{type:"object",properties:r,required:["id"]},run:g=>Ln(e,String(g.id??""))},{id:"highlight",available:!!e.onHighlightRows,schema:{type:"object",properties:{ids:{type:"array",items:{type:"string"},description:"Row IDs"}},required:["ids"]},run:g=>AA(e,Rn(g.ids))},{id:"select",available:!!e.onSelectRow,schema:{type:"object",properties:r,required:["id"]},run:g=>GA(e,String(g.id??""))},{id:"open",available:!!e.onOpenRow,schema:{type:"object",properties:r,required:["id"]},run:g=>vA(e,String(g.id??""))},{id:"filter",available:!!e.onFiltersChange,schema:{type:"object",properties:{key:{type:"string",enum:i},operator:{type:"string",enum:Sn},value:{description:"Text or number; for 'between' an array of two numbers or dates"}},required:["key","operator","value"]},run:g=>Yn(e,{key:String(g.key??""),operator:String(g.operator??""),value:g.value})},{id:"clear_filters",available:!!e.onFiltersChange,schema:{type:"object",properties:{}},run:()=>Un(e)},{id:"sort",available:!!e.onSortChange,schema:{type:"object",properties:{key:{type:"string",enum:i},direction:{type:"string",enum:["asc","desc"]}},required:["key"]},run:g=>Jn(e,String(g.key??""),g.direction==="desc"?"desc":"asc")},{id:"clear_sort",available:!!e.onSortChange,schema:{type:"object",properties:{}},run:()=>Pn(e)}].filter(g=>g.available).map(g=>({name:`${A}_${g.id}`,title:Dn.en[g.id],description:n(g.id),label:o[g.id],inputSchema:g.schema,execute:a=>Ug(e,()=>g.run(a??{}))}))}var Jg="button[disabled],input[disabled],select[disabled],textarea[disabled],fieldset[disabled],[aria-disabled='true']",RA={"html-lang":{title:"Page language is set",wcag:"3.1.1",severity:"serious",why:"Screen readers pick their voice and pronunciation from the page language. Without it, Telugu or Hindi text may be read with English rules."},"page-title":{title:"Page has a title",wcag:"2.4.2",severity:"serious",why:"The title is the first thing announced and the name shown on browser tabs and bookmarks."},"image-alt":{title:"Images have alternative text",wcag:"1.1.1",severity:"critical",why:'People who cannot see the image get no information from it unless alt text describes it (or alt="" marks it as decorative).'},"heading-order":{title:"Headings follow a logical order",wcag:"1.3.1",severity:"moderate",why:"Many screen-reader users jump between headings. Skipped levels make the page outline confusing."},"single-h1":{title:"Page has one main heading",wcag:"best practice",severity:"minor",why:"A single h1 tells everyone what the page is about."},"landmark-main":{title:"Main content landmark exists",wcag:"1.3.1 / 2.4.1",severity:"moderate",why:"A <main> region lets keyboard and screen-reader users skip straight past menus to the content."},"form-label":{title:"Form fields have labels",wcag:"1.3.1 / 4.1.2",severity:"critical",why:'Without a label, a screen reader just says "edit text" and the user has to guess what to type.'},"button-name":{title:"Buttons have names",wcag:"4.1.2",severity:"critical",why:'An icon-only button with no name is announced as just "button", so its purpose is unknown.'},"link-name":{title:"Links have names",wcag:"2.4.4",severity:"serious",why:"Links are often read out of context in a list. An empty link gives no clue where it goes."},"color-contrast":{title:"Text has enough contrast",wcag:"1.4.3",severity:"serious",why:"Low-contrast text is hard to read for older users, people with low vision, and anyone outdoors on a phone."},"positive-tabindex":{title:"No positive tabindex",wcag:"2.4.3",severity:"moderate",why:"tabindex greater than 0 forces a custom keyboard order that usually doesn't match the visual order."},"keyboard-access":{title:"Clickable things work with a keyboard",wcag:"2.1.1",severity:"critical",why:"A div or span with a click handler can't be reached or activated with Tab and Enter, locking out keyboard users."},"duplicate-id":{title:"IDs are unique",wcag:"best practice",severity:"minor",why:"Labels and ARIA references point at ids. Duplicates make them point at the wrong element."},"form-error":{title:"Errors are linked to their fields",wcag:"3.3.1",severity:"serious",why:"When a field is marked invalid, the error message must be connected to it so it's announced together with the field."},"target-size":{title:"Touch targets are large enough",wcag:"2.5.8",severity:"moderate",why:"Small targets are hard to tap for people with tremors, seniors and everyone on mobile."}},Pg={critical:10,serious:5,moderate:2,minor:1};function at(e={}){let t=Ne(e.root),A=new Set(e.skip??[]),o=[],n={},r=t?Bt(t)?t:t.ownerDocument:null,i=(s,g,a,l,I=!1)=>{if(A.has(s))return;let u=RA[s],C=n[s]=(n[s]??0)+1;o.push({id:`${s}-${C}`,rule:s,severity:u.severity,wcag:u.wcag,message:a,why:u.why,fix:l,selector:g?ze(g):"document",snippet:g?me(g.outerHTML,120):"",autoFixable:I,element:g??void 0})};if(t&&r){r.documentElement.getAttribute("lang")||i("html-lang",r.documentElement,"The <html> element has no lang attribute.",'Add lang to <html>, e.g. <html lang="te"> or "en".',!0),r.title.trim()||i("page-title",null,"The page has no <title>.","Add a short, descriptive <title> that names this page.");for(let c of O(t,"img"))if(!(c.getAttribute("role")==="presentation"||c.getAttribute("role")==="none")&&!c.hasAttribute("alt")&&!c.getAttribute("aria-label")&&!c.getAttribute("aria-labelledby")){let d=c.getAttribute("title");i("image-alt",c,`Image has no alt text${c.getAttribute("src")?` (${me(c.getAttribute("src")??"",40)})`:""}.`,d?`Use the title as alt: alt="${me(d,40)}".`:'Describe the image in alt, or use alt="" if it is purely decorative.',!!d)}let s=O(t,"h1,h2,h3,h4,h5,h6"),g=0;for(let c of s){let d=Number(c.tagName[1]);g>0&&d>g+1&&i("heading-order",c,`Heading jumps from h${g} to h${d}: "${me(c.textContent??"",40)}".`,`Change it to h${g+1}, or add the missing level above it.`),g=d}let a=s.filter(c=>c.tagName==="H1");a.length===0?i("single-h1",null,"The page has no h1.","Add one h1 that names the page."):a.length>1&&i("single-h1",a[1],`The page has ${a.length} h1 headings.`,"Keep one h1; turn the others into h2."),t.querySelectorAll("main,[role='main']").length===0&&i("landmark-main",null,"No <main> landmark found.","Wrap the primary content in <main>.");let l=O(t,"input,select,textarea").filter(c=>{let d=(c.getAttribute("type")??"text").toLowerCase();return!["hidden","submit","button","reset","image"].includes(d)});for(let c of l){if(!Ye(c)){let d=c.getAttribute("placeholder")||c.getAttribute("name");i("form-label",c,`Form field has no label${d?` (placeholder/name: "${me(d,30)}")`:""}.`,d?`Add a visible <label>. Quick fix: aria-label="${me(d,30)}".`:"Add a visible <label for=\u2026> describing what to enter.",!!d)}c.getAttribute("aria-invalid")==="true"&&(c.getAttribute("aria-describedby")||c.getAttribute("aria-errormessage")||i("form-error",c,"Field is marked invalid but no error message is linked to it.","Put the error text in an element with an id and point aria-describedby at it."))}for(let c of O(t,"button,[role='button'],input[type='submit'],input[type='button']"))if(!Ye(c)){let d=c.getAttribute("title");i("button-name",c,"Button has no accessible name.",d?`Use the title as the name: aria-label="${d}".`:"Add visible text or an aria-label that says what the button does.",!!d)}for(let c of O(t,"a[href]"))if(!Ye(c)){let d=c.getAttribute("title");i("link-name",c,`Link has no text (${me(c.getAttribute("href")??"",40)}).`,d?`Use the title as the name: aria-label="${d}".`:"Add link text that says where it goes.",!!d)}for(let c of O(t,"[tabindex]"))Number(c.getAttribute("tabindex"))>0&&i("positive-tabindex",c,`tabindex="${c.getAttribute("tabindex")}" overrides the natural tab order.`,'Use tabindex="0" and fix the order in the HTML instead.',!0);let I="a[href],button,input,select,textarea,summary";for(let c of O(t,"[onclick],[role='button'],[role='link']"))c.matches(I)||c.hasAttribute("tabindex")||i("keyboard-access",c,`<${c.tagName.toLowerCase()}> is clickable but can't be reached with the keyboard.`,'Use a real <button>, or add tabindex="0", a role and Enter/Space key handling.',!0);let u=new Map;for(let c of Array.from(t.querySelectorAll("[id]")))c.closest(IA)||u.set(c.id,(u.get(c.id)??0)+1);for(let[c,d]of u)d>1&&i("duplicate-id",t.querySelector(`[id="${c.replace(/"/g,'\\"')}"]`),`id="${c}" is used ${d} times.`,"Give each element a unique id.");let C=e.maxContrastChecks??600,h=0;for(let c of O(t,"body *")){if(h>=C)break;if(!Ot(c)||["SCRIPT","STYLE","NOSCRIPT","OPTION"].includes(c.tagName)||c.closest(Jg))continue;h++;let d=zA(window.getComputedStyle(c).color),Q=Ko(c);if(!d||!Q)continue;let b=OA(d,Q),S=qo(c)?3:4.5;b<S&&i("color-contrast",c,`Contrast ${b}:1 is below ${S}:1 for "${me(c.textContent??"",30)}".`,`Darken the text or lighten the background until the ratio is at least ${S}:1.`)}let y=e.minTargetSize??24,f=O(t,CA).map(c=>({el:c,rect:c.getBoundingClientRect()})).filter(c=>c.rect.width>0||c.rect.height>0),B=c=>c.width<y||c.height<y,m=c=>[c.left+c.width/2,c.top+c.height/2],p=(c,d,Q)=>Math.hypot(Math.max(Q.left-c,0,c-Q.right),Math.max(Q.top-d,0,d-Q.bottom));for(let c of f){if(!B(c.rect)||c.el.tagName==="A"&&c.el.closest("p,li,td"))continue;let[d,Q]=m(c.rect);f.some(S=>{if(S===c||S.el.contains(c.el)||c.el.contains(S.el))return!1;if(p(d,Q,S.rect)<y/2)return!0;if(!B(S.rect))return!1;let[F,P]=m(S.rect);return Math.hypot(d-F,Q-P)<y})&&i("target-size",c.el,`Target is ${Math.round(c.rect.width)}\xD7${Math.round(c.rect.height)}px and too close to another target (needs ${y}\xD7${y}, or ${y}px of space around it).`,`Increase padding so it's at least ${y}\xD7${y}px (44\xD744 is better for seniors), or add space between targets.`)}}return Kg(o,r,A)}function Kg(e,t,A){let o=Object.keys(RA).filter(g=>!A.has(g)).map(g=>{let a=e.filter(l=>l.rule===g).length;return{rule:g,title:RA[g].title,passed:a===0,issueCount:a}}),n=0;for(let g of o){let a=Pg[RA[g.rule].severity];n+=Math.min(25,g.issueCount*a)}let r=Math.max(0,100-n),i=o.filter(g=>!g.passed),s=e.filter(g=>g.severity==="critical").length;return{url:t?.location?.href??"",title:t?.title??"",generatedAt:new Date().toISOString(),score:r,passed:s===0&&r>=80,checks:o,issues:e,summary:e.length===0?`All ${o.length} checks passed.`:`${o.length-i.length} of ${o.length} checks passed. ${e.length} issue(s) found, ${s} critical. Score ${r}/100.`}}function Kn(e){let t=["# Accessibility QA report","",`- Page: ${e.title||"(untitled)"} ${e.url}`,`- Generated: ${e.generatedAt}`,`- Score: **${e.score}/100** \u2014 ${e.passed?"PASS":"FAIL"}`,"",e.summary,"","## Checks","","| Check | Result | Issues |","|---|---|---|",...e.checks.map(A=>`| ${A.title} | ${A.passed?"\u2705 Pass":"\u274C Fail"} | ${A.issueCount} |`)];if(e.issues.length){t.push("","## Issues","");for(let A of e.issues)t.push(`### ${A.id} \xB7 ${A.severity} \xB7 WCAG ${A.wcag}`,"",`- **Problem:** ${A.message}`,`- **Why it matters:** ${A.why}`,`- **Fix:** ${A.fix}`,`- **Where:** \`${A.selector}\``,"")}return t.join(`
|
|
382
382
|
`)}function qn(e){return JSON.stringify({...e,issues:e.issues.map(({element:t,...A})=>A)},null,2)}function Hn(e={}){let t=null,A=null,o=null,n=!1,r=[],i=()=>({report:t,watching:A!==null,appliedFixes:r.length}),s=()=>e.onUpdate?.(i()),g=u=>t?.issues.find(C=>C.id===u),a=(u,C,h)=>{r.push({element:u,attribute:C,previous:u.getAttribute(C)}),u.setAttribute(C,h)};function l(u){let C=u.element,h=(y,f)=>({issueId:u.id,applied:y,message:f});if(!u.autoFixable||!C)return h(!1,"This needs a human decision \u2014 see the suggested fix.");switch(u.rule){case"html-lang":{let y=e.defaultLang||(tt()?navigator.language:"")||"en";return a(C,"lang",y),h(!0,`Set lang="${y}" on <html>.`)}case"image-alt":{let y=C.getAttribute("title");if(!y)break;return a(C,"alt",y),h(!0,`Used the image title as alt text: "${y}".`)}case"form-label":{let y=C.getAttribute("placeholder")||C.getAttribute("name");if(!y)break;let f=y.replace(/[_-]+/g," ").trim();return a(C,"aria-label",f),h(!0,`Added aria-label="${f}". A visible <label> is still better.`)}case"button-name":case"link-name":{let y=C.getAttribute("title");if(!y)break;return a(C,"aria-label",y),h(!0,`Added aria-label="${y}".`)}case"positive-tabindex":return a(C,"tabindex","0"),h(!0,"Changed tabindex to 0 so the natural order applies.");case"keyboard-access":{a(C,"tabindex","0"),C.getAttribute("role")||a(C,"role","button");let y=f=>{let B=f.key;(B==="Enter"||B===" ")&&(f.preventDefault(),C.click())};return C.addEventListener("keydown",y),r.push({element:C,attribute:"",previous:null,listener:y}),h(!0,"Made it focusable and added Enter/Space support.")}default:break}return h(!1,"No safe automatic fix for this one \u2014 see the suggested fix.")}function I(){if(t=at(e),e.autoApply){n=!0;let u=t.issues.filter(C=>C.autoFixable).map(l);n=!1,u.some(C=>C.applied)&&(t=at(e))}return s(),t}return{start(){if(!tt()||A)return;let u=Ne(e.root),C=Bt(u)?u.body:u;C&&(A=new MutationObserver(h=>{n||!h.some(f=>!f.target.closest?.(IA))||(o&&clearTimeout(o),o=setTimeout(I,e.debounceMs??600))}),A.observe(C,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["alt","aria-label","aria-invalid","tabindex","lang","title"]}),I())},stop(){A?.disconnect(),A=null,o&&clearTimeout(o),o=null,s()},scan:I,explain(u){let C=g(u);return C?[`${C.message}`,`Why it matters: ${C.why}`,`How to fix: ${C.fix}`,`Standard: WCAG ${C.wcag} (${C.severity}).`,C.autoFixable?"I can apply a safe fix for this in the browser.":"This one needs a change in your code."].join(`
|
|
383
|
-
`):`No issue "${u}" in the current report. Run a scan first.`},applyFix(u){let C=g(u);if(!C)return{issueId:u,applied:!1,message:"Issue not found. Run a scan first."};n=!0;let h=l(C);return n=!1,h.applied&&I(),h},applyAllFixes(){t||I(),n=!0;let u=(t?.issues??[]).filter(C=>C.autoFixable).map(l);return n=!1,I(),u},undoAll(){let u=r.length;for(n=!0;r.length;){let C=r.pop();C.listener?C.element.removeEventListener("keydown",C.listener):C.previous===null?C.element.removeAttribute(C.attribute):C.element.setAttribute(C.attribute,C.previous)}return n=!1,I(),u},getState:i}}var $n={high:12,medium:6,low:2};function Wn(e={}){let t=Ne(e.root),A=[],o=(s,g,a,l,I)=>A.push({category:s,severity:g,message:a,suggestion:l,selector:I?ze(I):void 0});if(t&&tt()){let s=e.minFontSize??14,g=e.maxLineLength??90,a=G=>window.getComputedStyle(G),l=O(t,"h1");l.length===0&&o("hierarchy","medium","There is no h1, so the page has no clear main title.","Add one prominent h1 near the top."),l.length>1&&o("hierarchy","low",`${l.length} h1 headings compete for attention.`,"Keep one h1 and demote the rest.",l[1]);let I=G=>{let D=O(t,G)[0];return D&&parseFloat(a(D).fontSize)||0},[u,C,h]=[I("h1"),I("h2"),I("h3")];u&&C&&C>=u&&o("hierarchy","medium",`h2 (${C}px) is as large as or larger than h1 (${u}px).`,"Make each heading level visibly smaller than the one above it."),C&&h&&h>C&&o("hierarchy","low",`h3 (${h}px) is larger than h2 (${C}px).`,"Keep heading sizes in descending order.");let y=at({root:e.root,skip:["color-contrast","target-size","duplicate-id","page-title","html-lang","form-error","positive-tabindex"]});for(let G of y.issues.filter(D=>D.rule==="heading-order").slice(0,3))o("hierarchy","low",G.message,G.fix,G.element);let f=0,B;for(let G of O(t,"p,li,td,span,a,label,small,div").slice(0,1500)){if(!Ot(G))continue;(parseFloat(a(G).fontSize)||16)<s&&(f++,B??=G)}f&&o("readability",f>10?"high":"medium",`${f} text element(s) are smaller than ${s}px, e.g. "${me(B?.textContent??"",30)}".`,`Use at least ${s}px for body text (16px for senior-friendly pages).`,B);for(let G of O(t,"p").slice(0,200)){let D=a(G),E=parseFloat(D.fontSize)||16,j=G.getBoundingClientRect().width,Ae=j/(E*.5);if(j>0&&Ae>g&&(G.textContent??"").length>g){o("readability","low",`A paragraph is about ${Math.round(Ae)} characters wide.`,`Limit text width to ~${g} characters (e.g. max-width: 70ch).`,G);break}let J=parseFloat(D.lineHeight);if(Number.isFinite(J)&&J/E<1.3){o("readability","low",`Line height is ${(J/E).toFixed(2)}\xD7 the font size.`,"Use line-height of at least 1.5 for body text (WCAG 1.4.12).",G);break}}let m=at({root:e.root,skip:["html-lang","page-title","image-alt","heading-order","single-h1","landmark-main","form-label","button-name","link-name","positive-tabindex","keyboard-access","duplicate-id","form-error","target-size"]});m.issues.length&&o("readability",m.issues.length>5?"high":"medium",`${m.issues.length} text element(s) have weak contrast. ${m.issues[0].message}`,"Raise contrast to at least 4.5:1 for body text.",m.issues[0].element);let p=Kg();p.length&&o("interaction","high",`Focus outlines are removed by CSS (${p.slice(0,2).join(", ")}) with no replacement.`,"Never remove outlines without a visible :focus-visible style (WCAG 2.4.7).");let c=O(t,CA).filter(G=>{let D=G.getBoundingClientRect();return D.width>0&&D.height>0&&(D.width<24||D.height<24)&&!(G.tagName==="A"&&G.closest("p,li"))});c.length&&o("interaction",c.length>5?"high":"medium",`${c.length} control(s) are smaller than 24\xD724px.`,"Give controls at least 24\xD724px, ideally 44\xD744px for touch and seniors.",c[0]);let d=window.innerHeight||800,Q=O(t,Ho).filter(G=>{let D=G.getBoundingClientRect();return D.height>0&&D.top<d});Q.length>40&&o("clutter","medium",`${Q.length} interactive elements in the first screen.`,"Group secondary actions into menus and keep the first screen focused on one task.");let b=O(t,"button,a[href],[role='button']").filter(G=>{let D=G.getBoundingClientRect();if(D.height===0||D.top>d)return!1;let E=a(G).backgroundColor;return!!E&&!/rgba\(0, 0, 0, 0\)|transparent/.test(E)&&!/rgb\(255, 255, 255\)/.test(E)});b.length>4&&o("clutter","medium",`${b.length} filled buttons compete in the first screen.`,"Keep one primary action per view; make the rest secondary (outline or text).",b[0]);let S=new Set,F=new Set;for(let G of O(t,"body *").slice(0,2e3)){if(!Ot(G))continue;let D=a(G);S.add(D.fontFamily.split(",")[0].replace(/["']/g,"").trim().toLowerCase()),F.add(Math.round(parseFloat(D.fontSize)||0))}S.size>4&&o("consistency","low",`${S.size} different font families are used.`,"Stick to 1\u20132 font families (e.g. one Telugu + one Latin)."),F.size>10&&o("consistency","low",`${F.size} different font sizes are used.`,"Use a small type scale (5\u20137 sizes) for a calmer page.");let P=O(t,"img:not([width]):not([height])").filter(G=>!a(G).aspectRatio||a(G).aspectRatio==="auto");P.length>3&&o("consistency","low",`${P.length} images have no width/height, so the layout jumps while loading.`,"Set width and height (or aspect-ratio) on images.",P[0])}let n=["hierarchy","readability","interaction","clutter","consistency"].reduce((s,g)=>{let a=A.filter(l=>l.category===g);return s[g]={score:Math.max(0,100-a.reduce((l,I)=>l+$n[I.severity]*2,0)),findings:a.length},s},{}),r=Math.max(0,100-A.reduce((s,g)=>s+$n[g.severity],0)),i=Object.entries(n).sort((s,g)=>s[1].score-g[1].score)[0];return{score:r,categories:n,findings:A,summary:A.length?`Design score ${r}/100 with ${A.length} finding(s). Weakest area: ${i[0]}.`:"No design issues found by the automatic review."}}function Kg(){let e=[],t=!1,A=o=>{for(let n of Array.from(o)){let r=n.cssRules;r&&A(r);let i=n;if(!i.selectorText||!/:focus/.test(i.selectorText))continue;let s=`${i.style.outline} ${i.style.outlineStyle} ${i.style.outlineWidth}`,g=/\bnone\b|\b0(px)?\b/.test(s),a=!!(i.style.boxShadow&&i.style.boxShadow!=="none")||!!i.style.borderColor||!!i.style.backgroundColor||!!i.style.textDecoration;/:focus-visible/.test(i.selectorText)&&(!g||a)&&(t=!0),g&&!a&&e.push(i.selectorText)}};for(let o of Array.from(document.styleSheets))try{A(o.cssRules)}catch{}return t?[]:e}var qg=/^(field|input|value|text|enter|details?|info|data|\*|:)$/i,Hg=/^(go|ok|submit|send|click here|>|→|next)$/i,$g=[[/e-?mail/i,"email","email"],[/phone|mobile|tel/i,"tel","tel"],[/^(full)?name$|full.?name/i,"name"],[/first.?name|given/i,"given-name"],[/last.?name|surname|family/i,"family-name"],[/address|street/i,"street-address"],[/zip|postal|pin.?code|pincode/i,"postal-code"],[/city|town/i,"address-level2"],[/country/i,"country-name"],[/password/i,"current-password","password"],[/dob|birth/i,"bday"]];function Wg(e){let t=e.getAttribute("id");return t&&e.ownerDocument.querySelector(`label[for="${t.replace(/"/g,'\\"')}"]`)?!0:!!e.closest("label")}function zg(e){return O(e,"input,select,textarea").filter(t=>!["hidden","submit","button","reset","image"].includes((t.getAttribute("type")??"text").toLowerCase())).map(t=>({label:Ye(t),type:t.tagName==="INPUT"?(t.getAttribute("type")??"text").toLowerCase():t.tagName.toLowerCase(),name:t.getAttribute("name")??t.getAttribute("id")??"",required:t.hasAttribute("required")||t.getAttribute("aria-required")==="true",hasVisibleLabel:Wg(t),selector:ze(t),element:t}))}function Og(e,t={}){let A=t.seniorFriendly!==!1,o=t.maxFieldsPerStep??8,n=zg(e),r=[],i=(u,C,h,y)=>r.push({level:u,message:C,suggestion:h,field:y?.label||y?.name,selector:y?.selector});for(let u of n){let C=u.element,h=u.label||u.name||u.type,y=C.getAttribute("placeholder");!u.label&&y?i("problem",`"${y}" uses only a placeholder as its label.`,"Placeholders disappear when typing starts and aren't read by every screen reader. Add a visible label above the field.",u):u.label?!u.hasVisibleLabel&&y&&!C.getAttribute("aria-label")?i("problem",`"${h}" uses only a placeholder as its label.`,"Placeholders disappear when typing starts. Add a visible label above the field.",u):qg.test(u.label)&&i("improvement",`The label "${u.label}" is unclear.`,'Say exactly what is needed, e.g. "Mobile number (10 digits)".',u):i("problem",`A ${u.type} field${u.name?` ("${u.name}")`:""} has no label.`,"Add a visible <label> that says exactly what to enter.",u),u.required&&u.label&&!/\*|required|mandatory|తప్పనిసరి|आवश्यक/i.test(u.label)&&i("improvement",`"${h}" is required but the label doesn't say so.`,'Add "(required)" to the label so everyone knows before submitting.',u);let f=`${u.name} ${u.label}`;for(let[B,m,p]of $g)if(B.test(f)){C.getAttribute("autocomplete")||i("improvement",`"${h}" has no autocomplete hint.`,`Add autocomplete="${m}" so browsers can fill it in (WCAG 1.3.5).`,u),p&&u.type==="text"&&i("improvement",`"${h}" uses type="text".`,`Use type="${p}" for the right mobile keyboard and validation.`,u);break}if(C.getAttribute("aria-invalid")==="true"&&!C.getAttribute("aria-describedby")&&!C.getAttribute("aria-errormessage")&&i("problem",`"${h}" shows an error that isn't connected to the field.`,"Link the error text with aria-describedby and explain how to fix it.",u),A){let B=parseFloat(window.getComputedStyle(C).fontSize)||16;B<16&&i("improvement",`"${h}" text is ${B}px.`,"Use at least 16px in inputs; it is easier to read and stops mobile browsers from zooming.",u)}}n.length>o&&i("improvement",`This form has ${n.length} fields on one screen.`,`Split it into steps of about ${o} fields with a progress indicator.`);let s=O(e,"button,input[type='submit'],input[type='button']");if(s.length===0)i("problem","No submit button found.",'Add a clear <button type="submit"> so the form can be completed with the keyboard.');else if(A){let u=rt(Ye(s[s.length-1]));Hg.test(u)&&i("improvement",`The button says "${u}".`,'Name the result, e.g. "Send message" or "Book appointment".')}!O(e,"[role='alert'],[aria-live]",{includeHidden:!0}).length&&n.some(u=>u.required)&&i("improvement","No live region for error messages.",'Add an element with role="alert" so errors are announced when the form is submitted.');let g=r.filter(u=>u.level==="problem").length,a=r.length-g,l=Math.max(0,100-g*15-a*4),I=e.getAttribute("aria-label")||rt(e.querySelector("legend,h1,h2,h3")?.textContent)||e.getAttribute("name")||e.getAttribute("id")||"Form";return{name:me(I,50),selector:ze(e),fields:n,findings:r,score:l,summary:r.length===0?`"${me(I,40)}" looks clear: ${n.length} labelled field(s), nothing to fix.`:`"${me(I,40)}" has ${n.length} field(s): ${g} problem(s) and ${a} suggestion(s). Score ${l}/100.`}}function NA(e={}){let t=Ne(e.root);return t?O(t,"form,[role='form']").map(A=>Og(A,e)):[]}var Oe=e=>String(e??"").normalize("NFC").toLowerCase().replace(/\s+/g," ").trim(),Xg=new Set("show me find list get give which who what all the a an rows row records record entries with where that are is have has having and or of for in on to please display only those whose any".split(" "));function Co(e){let t=Oe(e).replace(/(₹|rs\.?|inr|\$|usd|€|£)/g," ").match(/(-?\d[\d,]*(?:\.\d+)?|-?\.\d+)\s*(k|thousand|lakhs?|lacs?|crores?|cr|mn|million|m|bn|billion)?(?![\p{L}])/u);if(!t)return null;let A=Number(t[1].replace(/,/g,""));if(!Number.isFinite(A))return null;let o=t[2]??"",n=/^k|thousand/.test(o)?1e3:/^la/.test(o)?1e5:/^(crore|cr)/.test(o)?1e7:/^(m|mn|million)$/.test(o)?1e6:/^(bn|billion)$/.test(o)?1e9:1;return A*n}function Xn(e){let t=new Set([Oe(e.label),Oe(e.key),Oe(e.key.replace(/[_-]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2"))]);for(let A of Array.from(t))A.endsWith("s")?t.add(A.slice(0,-1)):t.add(`${A}s`);return Array.from(t).filter(A=>A.length>1)}function Pe(e,t,A){let o=` ${Oe(e)} `,n;for(let r of t)if(!(A&&(r.type??"text")!==A))for(let i of Xn(r)){let s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");new RegExp(`(^|[^\\p{L}\\p{M}\\p{N}])${s}($|[^\\p{L}\\p{M}\\p{N}])`,"u").test(o)&&(!n||i.length>n.length)&&(n={column:r,length:i.length})}return n?.column}var Vg=/amount|balance|total|price|salary|value|due|revenue|cost|fee|sales|outstanding|paid/i;function po(e){let t=e.filter(A=>A.type==="number");return t.find(A=>Vg.test(`${A.key} ${A.label}`))??t[0]}var FA=/(>=|=>|>|\bover\b|\babove\b|\bmore than\b|\bgreater than\b|\bexceeds?\b|\bexceeding\b|\bhigher than\b|\bat least\b|\bminimum\b|\bmin\b|కంటే ఎక్కువ)/,fo=/(<=|=<|<|\bunder\b|\bbelow\b|\bless than\b|\blower than\b|\bat most\b|\bmaximum\b|\bmax\b|\bup to\b|కంటే తక్కువ)/,zn=/\b(after|since|from)\b/,jg=/\b(before|until|till)\b/,Zg="(?:\\s*(?:k|thousand|lakhs?|lacs?|crores?|cr|mn|million|m|bn|billion))?",mo=`(?:\u20B9|rs\\.?\\s*|\\$)?\\s*-?\\d[\\d,]*(?:\\.\\d+)?${Zg}`;function Ut(e,t,A={}){let o={filters:[],search:[],sort:null,limit:null,notes:[],explanation:""},n=Oe(e).replace(/[?!]+/g," ").replace(/\.(?!\d)/g," ").trim(),r=[],i=n.match(/\b(top|first|bottom|last|lowest|highest)\s+(\d+)\b/);i&&(o.limit=Number(i[2]),n=n.replace(i[0],` ${i[1]} `));let s=n.match(/\b(?:sort(?:ed)?|order(?:ed)?)\s+by\s+([\p{L}\p{M}\p{N} _]+?)(?:\s+(asc|ascending|desc|descending))?(?=$|,|\band\b|\bthen\b)/u),g=n.match(/\b(top|highest|largest|biggest|most|bottom|lowest|smallest|least)\b(?:\s+\d+)?\s+(?:by\s+)?([\p{L}\p{M}\p{N} _]+)/u);if(s){let h=Pe(s[1],t);h&&(o.sort={key:h.key,direction:/^desc/.test(s[2]??"")?"desc":"asc"},n=n.replace(s[0]," "))}else if(g){let h=Pe(g[2],t,"number")??Pe(g[2],t)??po(t);if(h){let y=/top|highest|largest|biggest|most/.test(g[1]);o.sort={key:h.key,direction:y?"desc":"asc"},n=n.replace(new RegExp(`\\b${g[1]}\\b`)," "),!i&&/top|bottom/.test(g[1])&&(o.limit=10)}}let a=new RegExp(`\\bbetween\\s+(${mo}|\\d{4}-\\d{2}-\\d{2})\\s+(?:and|to|-)\\s+(${mo}|\\d{4}-\\d{2}-\\d{2})`,"u"),l;for(;l=n.match(a);){let h=n.slice(Math.max(0,(l.index??0)-40),l.index??0),y=/\d{4}-\d{2}-\d{2}/.test(l[1]),f=y?Pe(h,t,"date")??t.find(p=>p.type==="date"):Pe(h,t,"number")??po(t),B=y?l[1]:Co(l[1]),m=y?l[2]:Co(l[2]);f&&B!==null&&m!==null&&(o.filters.push({key:f.key,operator:"between",value:[B,m]}),r.push(`${f.label} between ${l[1]} and ${l[2]}`)),n=n.replace(l[0]," ")}let I=n.split(/\s*(?:(?<!\d),|,(?!\d)|;|\band\b|(?<!(?:starts?|starting|ends?|ending|begins?|beginning)\s)\bwith\b|\bwhere\b|\bwho\b|\bthat\b|&|మరియు)\s*/u).map(h=>h.trim()).filter(Boolean),u=t.filter(h=>(h.type??"text")==="text"),C=new Map;for(let h of u){let y=new Set;for(let f of(A.data??[]).slice(0,5e3)){let B=Oe(f[h.key]);if(B&&B.length<=40&&y.add(B),y.size>300)break}y.size&&y.size<=300&&C.set(h.key,y)}for(let h of I){let y=o.filters.length,f=Pe(h,t),B=h.match(new RegExp(mo,"u")),m=h.match(/\d{4}-\d{2}-\d{2}/);if(m&&(zn.test(h)||jg.test(h)||FA.test(h)||fo.test(h))){let p=(f?.type==="date"?f:void 0)??t.find(c=>c.type==="date");if(p){let c=zn.test(h)||FA.test(h);o.filters.push({key:p.key,operator:c?"greaterThan":"lessThan",value:m[0]}),r.push(`${p.label} ${c?"after":"before"} ${m[0]}`)}}else if(B&&(FA.test(h)||fo.test(h)||f?.type==="number"&&/\b(is|equals?)\b|=/.test(h))){let p=f?.type==="number"?f:void 0;p||(p=po(t),p&&o.notes.push(`Assumed "${h}" refers to ${p.label}.`));let c=Co(B[0]);if(p&&c!==null){let d=/at least|minimum|\bmin\b|>=|=>|at most|maximum|\bmax\b|up to|<=|=</.test(h);FA.test(h)?(o.filters.push({key:p.key,operator:"greaterThan",value:d?c-1e-9:c}),r.push(`${p.label} ${d?"\u2265":">"} ${c.toLocaleString("en-IN")}`)):fo.test(h)?(o.filters.push({key:p.key,operator:"lessThan",value:d?c+1e-9:c}),r.push(`${p.label} ${d?"\u2264":"<"} ${c.toLocaleString("en-IN")}`)):(o.filters.push({key:p.key,operator:"equals",value:c}),r.push(`${p.label} = ${c.toLocaleString("en-IN")}`))}}else{let p=h.match(/\b(?:starts?|starting|begins?|beginning)\s+with\s+(.+)$/),c=h.match(/\b(?:ends?|ending)\s+with\s+(.+)$/),d=h.match(/\b(?:contains?|containing|including|includes?|mentions?)\s+(.+)$/),Q=h.match(/\b(?:is|equals?|=|:)\s+(.+)$/),b=p??c??d??Q;if(b){let S=f??u[0],F=b[1].replace(/^["'“‘]|["'”’]$/g,"").trim();if(S&&F){let P=p?"startsWith":c?"endsWith":d?"contains":"equals";o.filters.push({key:S.key,operator:P,value:F}),r.push(`${S.label} ${P==="equals"?"is":P==="contains"?"contains":P==="startsWith"?"starts with":"ends with"} "${F}"`),f||o.notes.push(`Assumed "${h}" refers to ${S.label}.`)}}}if(o.filters.length===y)for(let[p,c]of C){let d="";for(let Q of c){if(Q.length<2||Q.length<=d.length)continue;let b=Q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");new RegExp(`(^|[^\\p{L}\\p{M}\\p{N}])${b}($|[^\\p{L}\\p{M}\\p{N}])`,"u").test(h)&&(d=Q)}if(d){let Q=t.find(b=>b.key===p);o.filters.push({key:p,operator:"equals",value:d}),r.push(`${Q.label} is "${d}"`)}}if(o.filters.length===y){let p=h.split(/\s+/).filter(d=>!Xg.has(d)&&!/^(top|first|bottom|last|lowest|highest|by|desc|asc|sort(ed)?)$/.test(d)),c=p.length>0&&p.every(d=>t.some(Q=>Xn(Q).includes(d)));if(p.length&&!c&&!(f&&p.length===1)){let d=p.join(" ");/^(customers?|users?|people|items?|entries|poems?|orders?|products?|employees?|students?|members?)$/.test(d)||(o.search.push(d),r.push(`any column contains "${d}"`))}}}if(o.sort){let h=t.find(y=>y.key===o.sort.key)?.label??o.sort.key;r.push(`sorted by ${h} ${o.sort.direction==="desc"?"high \u2192 low":"low \u2192 high"}`)}return o.limit&&r.push(`first ${o.limit}`),o.explanation=r.length?`Showing rows where ${r.join(", ")}.`:"No conditions understood \u2014 showing all rows.",o}function _g(e,t,A){return A==="number"?(Number(e)||0)-(Number(t)||0):A==="date"?(new Date(String(e)).getTime()||0)-(new Date(String(t)).getTime()||0):String(e??"").localeCompare(String(t??""),void 0,{numeric:!0})}function gt(e,t,A){let o=st(e,t,A.filters);for(let n of A.search)o=o.filter(r=>t.some(i=>Oe(r[i.key]).includes(n)));if(A.sort){let n=t.find(i=>i.key===A.sort.key),r=A.sort.direction==="desc"?-1:1;o=[...o].sort((i,s)=>r*_g(i[A.sort.key],s[A.sort.key],n?.type))}return A.limit&&(o=o.slice(0,A.limit)),o}function el(e,t,A={}){let o=Ut(e,t.columns,{data:t.data}),n=gt(t.data,t.columns,o),r=n.map(s=>he(s,t.rowKey)).filter(Boolean);A.apply!==!1&&(o.filters.length&&t.onFiltersChange?.(o.filters),o.sort&&t.onSortChange?.(o.sort),r.length&&t.onHighlightRows?.(r));let i=n.length?`${n.length} row(s) found. ${o.explanation}${o.notes.length?` (${o.notes.join(" ")})`:""}`:`No rows match. ${o.explanation}`;return{rows:n,ids:r,parsed:o,message:i}}function On(e,t){let A=(e.length-1)*t,o=Math.floor(A),n=A-o;return e[o+1]!==void 0?e[o]+n*(e[o+1]-e[o]):e[o]}function ho(e,t,A={}){let o=A.factor??1.5,n=[],r=t.filter(a=>a.type==="number"&&(!A.columns||A.columns.includes(a.key))),i=a=>a.toLocaleString("en-IN",{maximumFractionDigits:2});for(let a of r){let l=e.map(B=>Number(B[a.key])).filter(B=>Number.isFinite(B));if(l.length<5)continue;let I=[...l].sort((B,m)=>B-m),u=On(I,.25),C=On(I,.75),h=C-u;if(h===0)continue;let y=u-o*h,f=C+o*h;for(let B of e){let m=Number(B[a.key]);!Number.isFinite(m)||m>=y&&m<=f||n.push({rowId:he(B,A.rowKey),column:a.key,label:a.label,value:m,kind:m>f?"high":"low",reason:`${a.label} ${i(m)} is far ${m>f?"above":"below"} the typical range (${i(u)}\u2013${i(C)}).`})}}let s=A.rowKey??"id",g=new Map;for(let a of e){let l=JSON.stringify(t.filter(C=>C.key!==s).map(C=>Oe(a[C.key]))),I=he(a,A.rowKey),u=g.get(l);u!==void 0?n.push({rowId:I,column:s,label:"Row",value:I,kind:"duplicate",reason:`Row ${I} has the same values as row ${u}.`}):g.set(l,I)}return n}function yo(e,t){if(!e.length)return"No rows to summarise.";let A=[`${e.length} row(s).`],o=n=>n.toLocaleString("en-IN",{maximumFractionDigits:2});for(let n of t){let r=e.map(i=>i[n.key]);if(n.type==="number"){let i=r.map(Number).filter(Number.isFinite);if(!i.length)continue;let s=i.reduce((g,a)=>g+a,0);A.push(`${n.label}: total ${o(s)}, average ${o(s/i.length)}, range ${o(Math.min(...i))}\u2013${o(Math.max(...i))}.`)}else if(n.type==="date"){let i=r.map(g=>new Date(String(g)).getTime()).filter(Number.isFinite);if(!i.length)continue;let s=g=>new Date(g).toISOString().slice(0,10);A.push(`${n.label}: from ${s(Math.min(...i))} to ${s(Math.max(...i))}.`)}else{let i=new Map;for(let g of r){let a=String(g??"").trim();a&&i.set(a,(i.get(a)??0)+1)}if(i.size===0||i.size>Math.max(8,e.length/3))continue;let s=Array.from(i.entries()).sort((g,a)=>a[1]-g[1]).slice(0,4);A.push(`${n.label}: ${s.map(([g,a])=>`${g} (${a})`).join(", ")}.`)}}return A.join(`
|
|
383
|
+
`):`No issue "${u}" in the current report. Run a scan first.`},applyFix(u){let C=g(u);if(!C)return{issueId:u,applied:!1,message:"Issue not found. Run a scan first."};n=!0;let h=l(C);return n=!1,h.applied&&I(),h},applyAllFixes(){t||I(),n=!0;let u=(t?.issues??[]).filter(C=>C.autoFixable).map(l);return n=!1,I(),u},undoAll(){let u=r.length;for(n=!0;r.length;){let C=r.pop();C.listener?C.element.removeEventListener("keydown",C.listener):C.previous===null?C.element.removeAttribute(C.attribute):C.element.setAttribute(C.attribute,C.previous)}return n=!1,I(),u},getState:i}}var $n={high:12,medium:6,low:2};function Wn(e={}){let t=Ne(e.root),A=[],o=(s,g,a,l,I)=>A.push({category:s,severity:g,message:a,suggestion:l,selector:I?ze(I):void 0});if(t&&tt()){let s=e.minFontSize??14,g=e.maxLineLength??90,a=G=>window.getComputedStyle(G),l=O(t,"h1");l.length===0&&o("hierarchy","medium","There is no h1, so the page has no clear main title.","Add one prominent h1 near the top."),l.length>1&&o("hierarchy","low",`${l.length} h1 headings compete for attention.`,"Keep one h1 and demote the rest.",l[1]);let I=G=>{let D=O(t,G)[0];return D&&parseFloat(a(D).fontSize)||0},[u,C,h]=[I("h1"),I("h2"),I("h3")];u&&C&&C>=u&&o("hierarchy","medium",`h2 (${C}px) is as large as or larger than h1 (${u}px).`,"Make each heading level visibly smaller than the one above it."),C&&h&&h>C&&o("hierarchy","low",`h3 (${h}px) is larger than h2 (${C}px).`,"Keep heading sizes in descending order.");let y=at({root:e.root,skip:["color-contrast","target-size","duplicate-id","page-title","html-lang","form-error","positive-tabindex"]});for(let G of y.issues.filter(D=>D.rule==="heading-order").slice(0,3))o("hierarchy","low",G.message,G.fix,G.element);let f=0,B;for(let G of O(t,"p,li,td,span,a,label,small,div").slice(0,1500)){if(!Ot(G))continue;(parseFloat(a(G).fontSize)||16)<s&&(f++,B??=G)}f&&o("readability",f>10?"high":"medium",`${f} text element(s) are smaller than ${s}px, e.g. "${me(B?.textContent??"",30)}".`,`Use at least ${s}px for body text (16px for senior-friendly pages).`,B);for(let G of O(t,"p").slice(0,200)){let D=a(G),E=parseFloat(D.fontSize)||16,j=G.getBoundingClientRect().width,Ae=j/(E*.5);if(j>0&&Ae>g&&(G.textContent??"").length>g){o("readability","low",`A paragraph is about ${Math.round(Ae)} characters wide.`,`Limit text width to ~${g} characters (e.g. max-width: 70ch).`,G);break}let J=parseFloat(D.lineHeight);if(Number.isFinite(J)&&J/E<1.3){o("readability","low",`Line height is ${(J/E).toFixed(2)}\xD7 the font size.`,"Use line-height of at least 1.5 for body text (WCAG 1.4.12).",G);break}}let m=at({root:e.root,skip:["html-lang","page-title","image-alt","heading-order","single-h1","landmark-main","form-label","button-name","link-name","positive-tabindex","keyboard-access","duplicate-id","form-error","target-size"]});m.issues.length&&o("readability",m.issues.length>5?"high":"medium",`${m.issues.length} text element(s) have weak contrast. ${m.issues[0].message}`,"Raise contrast to at least 4.5:1 for body text.",m.issues[0].element);let p=qg();p.length&&o("interaction","high",`Focus outlines are removed by CSS (${p.slice(0,2).join(", ")}) with no replacement.`,"Never remove outlines without a visible :focus-visible style (WCAG 2.4.7).");let c=O(t,CA).filter(G=>{let D=G.getBoundingClientRect();return D.width>0&&D.height>0&&(D.width<24||D.height<24)&&!(G.tagName==="A"&&G.closest("p,li"))});c.length&&o("interaction",c.length>5?"high":"medium",`${c.length} control(s) are smaller than 24\xD724px.`,"Give controls at least 24\xD724px, ideally 44\xD744px for touch and seniors.",c[0]);let d=window.innerHeight||800,Q=O(t,Ho).filter(G=>{let D=G.getBoundingClientRect();return D.height>0&&D.top<d});Q.length>40&&o("clutter","medium",`${Q.length} interactive elements in the first screen.`,"Group secondary actions into menus and keep the first screen focused on one task.");let b=O(t,"button,a[href],[role='button']").filter(G=>{let D=G.getBoundingClientRect();if(D.height===0||D.top>d)return!1;let E=a(G).backgroundColor;return!!E&&!/rgba\(0, 0, 0, 0\)|transparent/.test(E)&&!/rgb\(255, 255, 255\)/.test(E)});b.length>4&&o("clutter","medium",`${b.length} filled buttons compete in the first screen.`,"Keep one primary action per view; make the rest secondary (outline or text).",b[0]);let S=new Set,F=new Set;for(let G of O(t,"body *").slice(0,2e3)){if(!Ot(G))continue;let D=a(G);S.add(D.fontFamily.split(",")[0].replace(/["']/g,"").trim().toLowerCase()),F.add(Math.round(parseFloat(D.fontSize)||0))}S.size>4&&o("consistency","low",`${S.size} different font families are used.`,"Stick to 1\u20132 font families (e.g. one Telugu + one Latin)."),F.size>10&&o("consistency","low",`${F.size} different font sizes are used.`,"Use a small type scale (5\u20137 sizes) for a calmer page.");let P=O(t,"img:not([width]):not([height])").filter(G=>!a(G).aspectRatio||a(G).aspectRatio==="auto");P.length>3&&o("consistency","low",`${P.length} images have no width/height, so the layout jumps while loading.`,"Set width and height (or aspect-ratio) on images.",P[0])}let n=["hierarchy","readability","interaction","clutter","consistency"].reduce((s,g)=>{let a=A.filter(l=>l.category===g);return s[g]={score:Math.max(0,100-a.reduce((l,I)=>l+$n[I.severity]*2,0)),findings:a.length},s},{}),r=Math.max(0,100-A.reduce((s,g)=>s+$n[g.severity],0)),i=Object.entries(n).sort((s,g)=>s[1].score-g[1].score)[0];return{score:r,categories:n,findings:A,summary:A.length?`Design score ${r}/100 with ${A.length} finding(s). Weakest area: ${i[0]}.`:"No design issues found by the automatic review."}}function qg(){let e=[],t=!1,A=o=>{for(let n of Array.from(o)){let r=n.cssRules;r&&A(r);let i=n;if(!i.selectorText||!/:focus/.test(i.selectorText))continue;let s=`${i.style.outline} ${i.style.outlineStyle} ${i.style.outlineWidth}`,g=/\bnone\b|\b0(px)?\b/.test(s),a=!!(i.style.boxShadow&&i.style.boxShadow!=="none")||!!i.style.borderColor||!!i.style.backgroundColor||!!i.style.textDecoration;/:focus-visible/.test(i.selectorText)&&(!g||a)&&(t=!0),g&&!a&&e.push(i.selectorText)}};for(let o of Array.from(document.styleSheets))try{A(o.cssRules)}catch{}return t?[]:e}var Hg=/^(field|input|value|text|enter|details?|info|data|\*|:)$/i,$g=/^(go|ok|submit|send|click here|>|→|next)$/i,Wg=[[/e-?mail/i,"email","email"],[/phone|mobile|tel/i,"tel","tel"],[/^(full)?name$|full.?name/i,"name"],[/first.?name|given/i,"given-name"],[/last.?name|surname|family/i,"family-name"],[/address|street/i,"street-address"],[/zip|postal|pin.?code|pincode/i,"postal-code"],[/city|town/i,"address-level2"],[/country/i,"country-name"],[/password/i,"current-password","password"],[/dob|birth/i,"bday"]];function zg(e){let t=e.getAttribute("id");return t&&e.ownerDocument.querySelector(`label[for="${t.replace(/"/g,'\\"')}"]`)?!0:!!e.closest("label")}function Og(e){return O(e,"input,select,textarea").filter(t=>!["hidden","submit","button","reset","image"].includes((t.getAttribute("type")??"text").toLowerCase())).map(t=>({label:Ye(t),type:t.tagName==="INPUT"?(t.getAttribute("type")??"text").toLowerCase():t.tagName.toLowerCase(),name:t.getAttribute("name")??t.getAttribute("id")??"",required:t.hasAttribute("required")||t.getAttribute("aria-required")==="true",hasVisibleLabel:zg(t),selector:ze(t),element:t}))}function Xg(e,t={}){let A=t.seniorFriendly!==!1,o=t.maxFieldsPerStep??8,n=Og(e),r=[],i=(u,C,h,y)=>r.push({level:u,message:C,suggestion:h,field:y?.label||y?.name,selector:y?.selector});for(let u of n){let C=u.element,h=u.label||u.name||u.type,y=C.getAttribute("placeholder");!u.label&&y?i("problem",`"${y}" uses only a placeholder as its label.`,"Placeholders disappear when typing starts and aren't read by every screen reader. Add a visible label above the field.",u):u.label?!u.hasVisibleLabel&&y&&!C.getAttribute("aria-label")?i("problem",`"${h}" uses only a placeholder as its label.`,"Placeholders disappear when typing starts. Add a visible label above the field.",u):Hg.test(u.label)&&i("improvement",`The label "${u.label}" is unclear.`,'Say exactly what is needed, e.g. "Mobile number (10 digits)".',u):i("problem",`A ${u.type} field${u.name?` ("${u.name}")`:""} has no label.`,"Add a visible <label> that says exactly what to enter.",u),u.required&&u.label&&!/\*|required|mandatory|తప్పనిసరి|आवश्यक/i.test(u.label)&&i("improvement",`"${h}" is required but the label doesn't say so.`,'Add "(required)" to the label so everyone knows before submitting.',u);let f=`${u.name} ${u.label}`;for(let[B,m,p]of Wg)if(B.test(f)){C.getAttribute("autocomplete")||i("improvement",`"${h}" has no autocomplete hint.`,`Add autocomplete="${m}" so browsers can fill it in (WCAG 1.3.5).`,u),p&&u.type==="text"&&i("improvement",`"${h}" uses type="text".`,`Use type="${p}" for the right mobile keyboard and validation.`,u);break}if(C.getAttribute("aria-invalid")==="true"&&!C.getAttribute("aria-describedby")&&!C.getAttribute("aria-errormessage")&&i("problem",`"${h}" shows an error that isn't connected to the field.`,"Link the error text with aria-describedby and explain how to fix it.",u),A){let B=parseFloat(window.getComputedStyle(C).fontSize)||16;B<16&&i("improvement",`"${h}" text is ${B}px.`,"Use at least 16px in inputs; it is easier to read and stops mobile browsers from zooming.",u)}}n.length>o&&i("improvement",`This form has ${n.length} fields on one screen.`,`Split it into steps of about ${o} fields with a progress indicator.`);let s=O(e,"button,input[type='submit'],input[type='button']");if(s.length===0)i("problem","No submit button found.",'Add a clear <button type="submit"> so the form can be completed with the keyboard.');else if(A){let u=rt(Ye(s[s.length-1]));$g.test(u)&&i("improvement",`The button says "${u}".`,'Name the result, e.g. "Send message" or "Book appointment".')}!O(e,"[role='alert'],[aria-live]",{includeHidden:!0}).length&&n.some(u=>u.required)&&i("improvement","No live region for error messages.",'Add an element with role="alert" so errors are announced when the form is submitted.');let g=r.filter(u=>u.level==="problem").length,a=r.length-g,l=Math.max(0,100-g*15-a*4),I=e.getAttribute("aria-label")||rt(e.querySelector("legend,h1,h2,h3")?.textContent)||e.getAttribute("name")||e.getAttribute("id")||"Form";return{name:me(I,50),selector:ze(e),fields:n,findings:r,score:l,summary:r.length===0?`"${me(I,40)}" looks clear: ${n.length} labelled field(s), nothing to fix.`:`"${me(I,40)}" has ${n.length} field(s): ${g} problem(s) and ${a} suggestion(s). Score ${l}/100.`}}function NA(e={}){let t=Ne(e.root);return t?O(t,"form,[role='form']").map(A=>Xg(A,e)):[]}var Oe=e=>String(e??"").normalize("NFC").toLowerCase().replace(/\s+/g," ").trim(),Vg=new Set("show me find list get give which who what all the a an rows row records record entries with where that are is have has having and or of for in on to please display only those whose any".split(" "));function Co(e){let t=Oe(e).replace(/(₹|rs\.?|inr|\$|usd|€|£)/g," ").match(/(-?\d[\d,]*(?:\.\d+)?|-?\.\d+)\s*(k|thousand|lakhs?|lacs?|crores?|cr|mn|million|m|bn|billion)?(?![\p{L}])/u);if(!t)return null;let A=Number(t[1].replace(/,/g,""));if(!Number.isFinite(A))return null;let o=t[2]??"",n=/^k|thousand/.test(o)?1e3:/^la/.test(o)?1e5:/^(crore|cr)/.test(o)?1e7:/^(m|mn|million)$/.test(o)?1e6:/^(bn|billion)$/.test(o)?1e9:1;return A*n}function Xn(e){let t=new Set([Oe(e.label),Oe(e.key),Oe(e.key.replace(/[_-]+/g," ").replace(/([a-z])([A-Z])/g,"$1 $2"))]);for(let A of Array.from(t))A.endsWith("s")?t.add(A.slice(0,-1)):t.add(`${A}s`);return Array.from(t).filter(A=>A.length>1)}function Pe(e,t,A){let o=` ${Oe(e)} `,n;for(let r of t)if(!(A&&(r.type??"text")!==A))for(let i of Xn(r)){let s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");new RegExp(`(^|[^\\p{L}\\p{M}\\p{N}])${s}($|[^\\p{L}\\p{M}\\p{N}])`,"u").test(o)&&(!n||i.length>n.length)&&(n={column:r,length:i.length})}return n?.column}var jg=/amount|balance|total|price|salary|value|due|revenue|cost|fee|sales|outstanding|paid/i;function po(e){let t=e.filter(A=>A.type==="number");return t.find(A=>jg.test(`${A.key} ${A.label}`))??t[0]}var FA=/(>=|=>|>|\bover\b|\babove\b|\bmore than\b|\bgreater than\b|\bexceeds?\b|\bexceeding\b|\bhigher than\b|\bat least\b|\bminimum\b|\bmin\b|కంటే ఎక్కువ)/,fo=/(<=|=<|<|\bunder\b|\bbelow\b|\bless than\b|\blower than\b|\bat most\b|\bmaximum\b|\bmax\b|\bup to\b|కంటే తక్కువ)/,zn=/\b(after|since|from)\b/,Zg=/\b(before|until|till)\b/,_g="(?:\\s*(?:k|thousand|lakhs?|lacs?|crores?|cr|mn|million|m|bn|billion))?",mo=`(?:\u20B9|rs\\.?\\s*|\\$)?\\s*-?\\d[\\d,]*(?:\\.\\d+)?${_g}`;function Ut(e,t,A={}){let o={filters:[],search:[],sort:null,limit:null,notes:[],explanation:""},n=Oe(e).replace(/[?!]+/g," ").replace(/\.(?!\d)/g," ").trim(),r=[],i=n.match(/\b(top|first|bottom|last|lowest|highest)\s+(\d+)\b/);i&&(o.limit=Number(i[2]),n=n.replace(i[0],` ${i[1]} `));let s=n.match(/\b(?:sort(?:ed)?|order(?:ed)?)\s+by\s+([\p{L}\p{M}\p{N} _]+?)(?:\s+(asc|ascending|desc|descending))?(?=$|,|\band\b|\bthen\b)/u),g=n.match(/\b(top|highest|largest|biggest|most|bottom|lowest|smallest|least)\b(?:\s+\d+)?\s+(?:by\s+)?([\p{L}\p{M}\p{N} _]+)/u);if(s){let h=Pe(s[1],t);h&&(o.sort={key:h.key,direction:/^desc/.test(s[2]??"")?"desc":"asc"},n=n.replace(s[0]," "))}else if(g){let h=Pe(g[2],t,"number")??Pe(g[2],t)??po(t);if(h){let y=/top|highest|largest|biggest|most/.test(g[1]);o.sort={key:h.key,direction:y?"desc":"asc"},n=n.replace(new RegExp(`\\b${g[1]}\\b`)," "),!i&&/top|bottom/.test(g[1])&&(o.limit=10)}}let a=new RegExp(`\\bbetween\\s+(${mo}|\\d{4}-\\d{2}-\\d{2})\\s+(?:and|to|-)\\s+(${mo}|\\d{4}-\\d{2}-\\d{2})`,"u"),l;for(;l=n.match(a);){let h=n.slice(Math.max(0,(l.index??0)-40),l.index??0),y=/\d{4}-\d{2}-\d{2}/.test(l[1]),f=y?Pe(h,t,"date")??t.find(p=>p.type==="date"):Pe(h,t,"number")??po(t),B=y?l[1]:Co(l[1]),m=y?l[2]:Co(l[2]);f&&B!==null&&m!==null&&(o.filters.push({key:f.key,operator:"between",value:[B,m]}),r.push(`${f.label} between ${l[1]} and ${l[2]}`)),n=n.replace(l[0]," ")}let I=n.split(/\s*(?:(?<!\d),|,(?!\d)|;|\band\b|(?<!(?:starts?|starting|ends?|ending|begins?|beginning)\s)\bwith\b|\bwhere\b|\bwho\b|\bthat\b|&|మరియు)\s*/u).map(h=>h.trim()).filter(Boolean),u=t.filter(h=>(h.type??"text")==="text"),C=new Map;for(let h of u){let y=new Set;for(let f of(A.data??[]).slice(0,5e3)){let B=Oe(f[h.key]);if(B&&B.length<=40&&y.add(B),y.size>300)break}y.size&&y.size<=300&&C.set(h.key,y)}for(let h of I){let y=o.filters.length,f=Pe(h,t),B=h.match(new RegExp(mo,"u")),m=h.match(/\d{4}-\d{2}-\d{2}/);if(m&&(zn.test(h)||Zg.test(h)||FA.test(h)||fo.test(h))){let p=(f?.type==="date"?f:void 0)??t.find(c=>c.type==="date");if(p){let c=zn.test(h)||FA.test(h);o.filters.push({key:p.key,operator:c?"greaterThan":"lessThan",value:m[0]}),r.push(`${p.label} ${c?"after":"before"} ${m[0]}`)}}else if(B&&(FA.test(h)||fo.test(h)||f?.type==="number"&&/\b(is|equals?)\b|=/.test(h))){let p=f?.type==="number"?f:void 0;p||(p=po(t),p&&o.notes.push(`Assumed "${h}" refers to ${p.label}.`));let c=Co(B[0]);if(p&&c!==null){let d=/at least|minimum|\bmin\b|>=|=>|at most|maximum|\bmax\b|up to|<=|=</.test(h);FA.test(h)?(o.filters.push({key:p.key,operator:"greaterThan",value:d?c-1e-9:c}),r.push(`${p.label} ${d?"\u2265":">"} ${c.toLocaleString("en-IN")}`)):fo.test(h)?(o.filters.push({key:p.key,operator:"lessThan",value:d?c+1e-9:c}),r.push(`${p.label} ${d?"\u2264":"<"} ${c.toLocaleString("en-IN")}`)):(o.filters.push({key:p.key,operator:"equals",value:c}),r.push(`${p.label} = ${c.toLocaleString("en-IN")}`))}}else{let p=h.match(/\b(?:starts?|starting|begins?|beginning)\s+with\s+(.+)$/),c=h.match(/\b(?:ends?|ending)\s+with\s+(.+)$/),d=h.match(/\b(?:contains?|containing|including|includes?|mentions?)\s+(.+)$/),Q=h.match(/\b(?:is|equals?|=|:)\s+(.+)$/),b=p??c??d??Q;if(b){let S=f??u[0],F=b[1].replace(/^["'“‘]|["'”’]$/g,"").trim();if(S&&F){let P=p?"startsWith":c?"endsWith":d?"contains":"equals";o.filters.push({key:S.key,operator:P,value:F}),r.push(`${S.label} ${P==="equals"?"is":P==="contains"?"contains":P==="startsWith"?"starts with":"ends with"} "${F}"`),f||o.notes.push(`Assumed "${h}" refers to ${S.label}.`)}}}if(o.filters.length===y)for(let[p,c]of C){let d="";for(let Q of c){if(Q.length<2||Q.length<=d.length)continue;let b=Q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");new RegExp(`(^|[^\\p{L}\\p{M}\\p{N}])${b}($|[^\\p{L}\\p{M}\\p{N}])`,"u").test(h)&&(d=Q)}if(d){let Q=t.find(b=>b.key===p);o.filters.push({key:p,operator:"equals",value:d}),r.push(`${Q.label} is "${d}"`)}}if(o.filters.length===y){let p=h.split(/\s+/).filter(d=>!Vg.has(d)&&!/^(top|first|bottom|last|lowest|highest|by|desc|asc|sort(ed)?)$/.test(d)),c=p.length>0&&p.every(d=>t.some(Q=>Xn(Q).includes(d)));if(p.length&&!c&&!(f&&p.length===1)){let d=p.join(" ");/^(customers?|users?|people|items?|entries|poems?|orders?|products?|employees?|students?|members?)$/.test(d)||(o.search.push(d),r.push(`any column contains "${d}"`))}}}if(o.sort){let h=t.find(y=>y.key===o.sort.key)?.label??o.sort.key;r.push(`sorted by ${h} ${o.sort.direction==="desc"?"high \u2192 low":"low \u2192 high"}`)}return o.limit&&r.push(`first ${o.limit}`),o.explanation=r.length?`Showing rows where ${r.join(", ")}.`:"No conditions understood \u2014 showing all rows.",o}function el(e,t,A){return A==="number"?(Number(e)||0)-(Number(t)||0):A==="date"?(new Date(String(e)).getTime()||0)-(new Date(String(t)).getTime()||0):String(e??"").localeCompare(String(t??""),void 0,{numeric:!0})}function gt(e,t,A){let o=st(e,t,A.filters);for(let n of A.search)o=o.filter(r=>t.some(i=>Oe(r[i.key]).includes(n)));if(A.sort){let n=t.find(i=>i.key===A.sort.key),r=A.sort.direction==="desc"?-1:1;o=[...o].sort((i,s)=>r*el(i[A.sort.key],s[A.sort.key],n?.type))}return A.limit&&(o=o.slice(0,A.limit)),o}function tl(e,t,A={}){let o=Ut(e,t.columns,{data:t.data}),n=gt(t.data,t.columns,o),r=n.map(s=>he(s,t.rowKey)).filter(Boolean);A.apply!==!1&&(o.filters.length&&t.onFiltersChange?.(o.filters),o.sort&&t.onSortChange?.(o.sort),r.length&&t.onHighlightRows?.(r));let i=n.length?`${n.length} row(s) found. ${o.explanation}${o.notes.length?` (${o.notes.join(" ")})`:""}`:`No rows match. ${o.explanation}`;return{rows:n,ids:r,parsed:o,message:i}}function On(e,t){let A=(e.length-1)*t,o=Math.floor(A),n=A-o;return e[o+1]!==void 0?e[o]+n*(e[o+1]-e[o]):e[o]}function ho(e,t,A={}){let o=A.factor??1.5,n=[],r=t.filter(a=>a.type==="number"&&(!A.columns||A.columns.includes(a.key))),i=a=>a.toLocaleString("en-IN",{maximumFractionDigits:2});for(let a of r){let l=e.map(B=>Number(B[a.key])).filter(B=>Number.isFinite(B));if(l.length<5)continue;let I=[...l].sort((B,m)=>B-m),u=On(I,.25),C=On(I,.75),h=C-u;if(h===0)continue;let y=u-o*h,f=C+o*h;for(let B of e){let m=Number(B[a.key]);!Number.isFinite(m)||m>=y&&m<=f||n.push({rowId:he(B,A.rowKey),column:a.key,label:a.label,value:m,kind:m>f?"high":"low",reason:`${a.label} ${i(m)} is far ${m>f?"above":"below"} the typical range (${i(u)}\u2013${i(C)}).`})}}let s=A.rowKey??"id",g=new Map;for(let a of e){let l=JSON.stringify(t.filter(C=>C.key!==s).map(C=>Oe(a[C.key]))),I=he(a,A.rowKey),u=g.get(l);u!==void 0?n.push({rowId:I,column:s,label:"Row",value:I,kind:"duplicate",reason:`Row ${I} has the same values as row ${u}.`}):g.set(l,I)}return n}function yo(e,t){if(!e.length)return"No rows to summarise.";let A=[`${e.length} row(s).`],o=n=>n.toLocaleString("en-IN",{maximumFractionDigits:2});for(let n of t){let r=e.map(i=>i[n.key]);if(n.type==="number"){let i=r.map(Number).filter(Number.isFinite);if(!i.length)continue;let s=i.reduce((g,a)=>g+a,0);A.push(`${n.label}: total ${o(s)}, average ${o(s/i.length)}, range ${o(Math.min(...i))}\u2013${o(Math.max(...i))}.`)}else if(n.type==="date"){let i=r.map(g=>new Date(String(g)).getTime()).filter(Number.isFinite);if(!i.length)continue;let s=g=>new Date(g).toISOString().slice(0,10);A.push(`${n.label}: from ${s(Math.min(...i))} to ${s(Math.max(...i))}.`)}else{let i=new Map;for(let g of r){let a=String(g??"").trim();a&&i.set(a,(i.get(a)??0)+1)}if(i.size===0||i.size>Math.max(8,e.length/3))continue;let s=Array.from(i.entries()).sort((g,a)=>a[1]-g[1]).slice(0,4);A.push(`${n.label}: ${s.map(([g,a])=>`${g} (${a})`).join(", ")}.`)}}return A.join(`
|
|
384
384
|
`)}function Vn(e,t){let A=Oe(e);if(/unusual|anomal|outlier|odd|strange|suspicious|duplicate|అసాధారణ/.test(A)){let n=ho(t.data,t.columns,{rowKey:t.rowKey}),r=Array.from(new Set(n.map(s=>s.rowId)));r.length&&t.onHighlightRows?.(r);let i=new Set(r);return{kind:"anomalies",message:n.length?`${r.length} unusual row(s):
|
|
385
385
|
${n.slice(0,10).map(s=>`\u2022 ${s.reason}`).join(`
|
|
386
|
-
`)}`:"Nothing unusual found.",ids:r,rows:t.data.filter(s=>i.has(he(s,t.rowKey))),anomalies:n}}if(/summar|overview|describe|సారాంశం/.test(A)){let n=st(t.data,t.columns,t.filters??[]);return{kind:"summary",message:yo(n,t.columns),ids:[],rows:n}}let o=el(e,t);return{kind:"query",message:o.message,ids:o.ids,rows:o.rows}}var TA=e=>{let t=typeof e=="number"?e:Number(String(e??"").replace(/[,₹$%\s]/g,""));return Number.isFinite(t)?t:null},jn=e=>{let t=e instanceof Date?e.getTime():new Date(String(e??"")).getTime();return Number.isFinite(t)?t:null};function nA(e,t){if(t==="count")return e.length;if(!e.length)return 0;switch(t){case"sum":return e.reduce((A,o)=>A+o,0);case"avg":return e.reduce((A,o)=>A+o,0)/e.length;case"min":return Math.min(...e);case"max":return Math.max(...e)}}function tl(e,t,A,o="sum"){let n=new Map;for(let r of e){let i=String(r[t]??"\u2014").trim()||"\u2014",s=n.get(i)??[];if(A===null||o==="count")s.push(1);else{let g=TA(r[A]);g!==null&&s.push(g)}n.set(i,s)}return Array.from(n.entries()).map(([r,i])=>({group:r,value:nA(i,o),count:i.length})).sort((r,i)=>i.value-r.value)}function Zn(e,t,A=1){let o=new Date(e);return o.setHours(0,0,0,0),t==="week"&&o.setDate(o.getDate()-(o.getDay()-A+7)%7),t==="month"&&o.setDate(1),t==="quarter"&&o.setMonth(Math.floor(o.getMonth()/3)*3,1),t==="year"&&o.setMonth(0,1),o}function Bo(e,t,A){let o=new Date(e);return t==="day"&&o.setDate(o.getDate()+A),t==="week"&&o.setDate(o.getDate()+7*A),t==="month"&&o.setMonth(o.getMonth()+A),t==="quarter"&&o.setMonth(o.getMonth()+3*A),t==="year"&&o.setFullYear(o.getFullYear()+A),o}function Al(e,t){let A=t.referenceDate?new Date(t.referenceDate):new Date,o=Zn(A,t.period,t.weekStartsOn),n=t.toDate===!1?Bo(o,t.period,1):new Date(Math.max(A.getTime()+1,o.getTime()+1)),r=Bo(o,t.period,-1),i=t.toDate===!1?o:new Date(r.getTime()+(n.getTime()-o.getTime())),s=t.agg??"sum",g=new Map,a=new Map;for(let u of e){let C=jn(u[t.dateKey]);if(C===null)continue;let h=C>=o.getTime()&&C<n.getTime()?g:C>=r.getTime()&&C<i.getTime()?a:null;if(!h)continue;let y=t.groupKey?String(u[t.groupKey]??"\u2014"):"All",f=s==="count"?1:TA(u[t.metricKey]);f!==null&&h.set(y,[...h.get(y)??[],f])}let l=new Set([...g.keys(),...a.keys()]),I=Array.from(l).map(u=>{let C=nA(g.get(u)??[],s),h=nA(a.get(u)??[],s);return{group:u,current:C,previous:h,change:C-h,changePct:h===0?null:(C-h)/Math.abs(h)*100}});return{period:t.period,current:{from:o,to:n},previous:{from:r,to:i},rows:I}}function ol(e,t,A,o,n="sum"){let r=new Map;for(let i of e){let s=jn(i[t]),g=n==="count"?1:TA(i[A]);if(s===null||g===null)continue;let a=Zn(new Date(s),o).getTime();r.set(a,[...r.get(a)??[],g])}return Array.from(r.entries()).sort((i,s)=>i[0]-s[0]).map(([i,s])=>({start:new Date(i),value:nA(s,n)}))}var nl=/rate|conversion|ratio|percent|%|score|rating|margin|ctr|avg|average/i;function il(e){let t=e.match(/\b(today|yesterday|this|last|previous|past)\s*(day|week|month|quarter|year)?\b/);return t?t[1]==="today"?{period:"day",shift:0}:t[1]==="yesterday"?{period:"day",shift:-1}:t[2]?{period:t[2],shift:t[1]==="this"?0:-1}:null:null}var be=e=>e.toLocaleString("en-IN",{maximumFractionDigits:2}),Qo=e=>e===null?"new":`${e>0?"+":""}${e.toFixed(1)}%`;function _n(e,t,A,o={}){let n=e.toLowerCase(),r=A.filter(p=>p.type==="number"),i=Pe(n,A,"number")??r.find(p=>/amount|revenue|sales|total|value/i.test(`${p.key} ${p.label}`))??r[0],s=A.find(p=>p.type==="date")??A.find(p=>/date|time|day|created|month/i.test(`${p.key} ${p.label}`)),g=n.match(/\b(?:which|by|per|each|across|every|top|for each)\s+([\p{L}\p{M}\p{N} _]+)/u)?.[1]??"",a=Pe(g,A,"text"),l=/how many|number of|count/.test(n),I=l?"count":/average|avg|mean/.test(n)?"avg":/\btotal\b|\bsum\b/.test(n)?"sum":i&&nl.test(`${i.key} ${i.label}`)?"avg":"sum",u=/drop|decline|decrease|fell|fall|down|worst|lost|shrink|reduc/.test(n),C=/increase|growth|grew|rise|rose|up\b|best|improv|gain/.test(n),h=/lowest|least|smallest|bottom|worst|minimum/.test(n),y=il(n);if(!i&&!l)return{kind:"unknown",answer:"I couldn't find a numeric column to analyse.",table:[]};let f=l?"rows":i.label;if(y&&s&&(C||u||/change|compare|vs|versus/.test(n))){let p=o.referenceDate?new Date(o.referenceDate):new Date,c=y.shift?Bo(p,y.period,y.shift):p,Q=[...Al(t,{dateKey:s.key,metricKey:i?.key??s.key,groupKey:a?.key,agg:I,period:y.period,referenceDate:c,toDate:y.shift===0}).rows].sort((j,Ae)=>u?j.change-Ae.change:Ae.change-j.change),b=Q.map(j=>({[a?.label??"Group"]:j.group,Current:be(j.current),Previous:be(j.previous),Change:be(j.change),"Change %":Qo(j.changePct)}));if(!Q.length)return{kind:"period-change",answer:`No ${f} data in this ${y.period} or the one before.`,table:b};let S=Q[0],F=`${y.shift?"last":"this"} ${y.period} vs the ${y.period} before`,P=S.change===0?"did not change":S.change<0?`dropped ${be(Math.abs(S.change))}`:`rose ${be(S.change)}`,G=`${f} ${P} (${be(S.previous)} \u2192 ${be(S.current)}, ${Qo(S.changePct)}) \u2014 ${F}.`,D=u&&S.change>=0||C&&S.change<=0;return{kind:"period-change",answer:a?D?`No ${a.label.toLowerCase()} ${u?"dropped":"grew"}. Closest is ${S.group}: ${G}`:`${S.group}: ${G}`:G,table:b}}if(/trend|over time|month by month|week by week/.test(n)&&s&&i){let p=/week/.test(n)?"week":/day|daily/.test(n)?"day":/year/.test(n)?"year":"month",c=ol(t,s.key,i.key,p,I),d=c.map(F=>({Period:F.start.toISOString().slice(0,10),[i.label]:be(F.value)}));if(c.length<2)return{kind:"trend",answer:`Not enough ${p}s of data for a trend.`,table:d};let Q=c[0].value,b=c[c.length-1].value,S=c.reduce((F,P)=>P.value>F.value?P:F);return{kind:"trend",answer:`${i.label} went from ${be(Q)} to ${be(b)} over ${c.length} ${p}s (${Qo(Q?(b-Q)/Math.abs(Q)*100:null)}). Peak: ${be(S.value)} in the ${p} of ${S.start.toISOString().slice(0,10)}.`,table:d}}if(a){let p=tl(t,a.key,i?.key??null,I),c=h?[...p].reverse():p,d=c.map(b=>({[a.label]:b.group,[`${I} of ${f}`]:be(b.value),Rows:b.count}));if(!c.length)return{kind:"group",answer:"No data.",table:d};let Q=c[0];return{kind:"group",answer:`${Q.group} has the ${h?"lowest":"highest"} ${I==="sum"?"total":I==="avg"?"average":I} ${f}: ${be(Q.value)} (across ${c.length} ${a.label.toLowerCase()} groups).`,table:d}}let B=l?t.map(()=>1):t.map(p=>TA(p[i.key])).filter(p=>p!==null),m=nA(B,I);return{kind:"total",answer:`${I==="avg"?"Average":I==="count"?"Count of":I==="sum"?"Total":I} ${f}: ${be(m)} across ${t.length} row(s).`,table:[{Metric:f,Aggregation:I,Value:be(m)}]}}function rl(e){let t=Ne(e),A={title:"",description:"",language:"",headings:[],landmarks:{},counts:{links:0,buttons:0,images:0,forms:0,tables:0,fields:0},unlabeledFields:[],imagesWithoutAlt:[],purpose:""};if(!t)return A;let o=Bt(t)?t:t.ownerDocument,n=O(t,"h1,h2,h3,h4,h5,h6").map(l=>({level:Number(l.tagName[1]),text:me(l.textContent??"",80)})),r={};for(let[l,I]of Object.entries({header:"header,[role='banner']",navigation:"nav,[role='navigation']",main:"main,[role='main']",search:"search,[role='search']",footer:"footer,[role='contentinfo']"}))r[l]=O(t,I).length;let i=O(t,"input,select,textarea").filter(l=>!["hidden","submit","button","reset","image"].includes((l.getAttribute("type")??"text").toLowerCase())),s=i.filter(l=>!Ye(l)).map(l=>({type:l.tagName==="INPUT"?l.getAttribute("type")??"text":l.tagName.toLowerCase(),hint:l.getAttribute("placeholder")||l.getAttribute("name")||"",selector:ze(l)})),g=O(t,"img:not([alt])").map(l=>({src:l.getAttribute("src")??"",selector:ze(l)})),a={title:o.title,description:rt(o.querySelector('meta[name="description"]')?.getAttribute("content")),language:o.documentElement.getAttribute("lang")??"",headings:n,landmarks:r,counts:{links:O(t,"a[href]").length,buttons:O(t,"button,[role='button'],input[type='submit']").length,images:O(t,"img").length,forms:O(t,"form,[role='form']").length,tables:O(t,"table,[role='grid'],[role='table']").length,fields:i.length},unlabeledFields:s,imagesWithoutAlt:g,purpose:""};return a.purpose=sl(a,i),a}function sl(e,t){let A=e.headings.find(i=>i.level===1)?.text||e.title||"This page",o=t.map(i=>`${i.getAttribute("type")} ${i.getAttribute("name")} ${Ye(i)}`).join(" ").toLowerCase(),n=[];/password/.test(o)?n.push("sign in or create an account"):(/search|query|వెతుకు/.test(o)||e.landmarks.search)&&n.push("search"),/message|comment|feedback|contact|enquiry/.test(o)&&n.push("send a message"),/card|payment|upi|amount/.test(o)&&n.push("make a payment"),e.counts.tables&&n.push(`browse ${e.counts.tables} table(s) of data`),!n.length&&e.counts.forms&&n.push(`fill in ${e.counts.forms} form(s)`),n.length||n.push("read content");let r=e.headings.filter(i=>i.level===2).slice(0,5).map(i=>i.text);return[`"${A}" lets you ${n.join(", ")}.`,e.description?`It describes itself as: ${me(e.description,140)}`:"",r.length?`Main sections: ${r.join(" \xB7 ")}.`:""].filter(Boolean).join(" ")}var al=[["missing-labels",/label|unlabel|లేబుల్/i],["images",/image|alt text|picture|photo|చిత్ర/i],["structure",/heading|structure|outline|section|landmark|శీర్షిక/i],["forms",/form|field|input|ఫారం/i],["links",/link|లింక్/i],["counts",/how many|count|ఎన్ని/i],["purpose",/what (does|is)|purpose|about|summar|explain|ఏమి|గురించి/i]];function gl(e){for(let[t,A]of al)if(A.test(e))return t;return"unknown"}async function ei(e,t={}){let A=rl(t.root),o=gl(e);switch(o){case"missing-labels":return A.unlabeledFields.length?{intent:o,answer:`${A.unlabeledFields.length} of ${A.counts.fields} field(s) have no label: ${A.unlabeledFields.map(n=>`${n.type}${n.hint?` ("${n.hint}")`:""}`).join(", ")}.`,targets:A.unlabeledFields.map(n=>n.selector),suggestions:["Add a visible <label for=\u2026> to each field.","Run the Accessibility Copilot to add aria-labels from placeholders as a quick fix."]}:{intent:o,answer:`All ${A.counts.fields} form field(s) have labels.`,targets:[],suggestions:[]};case"images":return{intent:o,answer:A.imagesWithoutAlt.length?`${A.imagesWithoutAlt.length} of ${A.counts.images} image(s) have no alt text.`:`All ${A.counts.images} image(s) have alt text.`,targets:A.imagesWithoutAlt.map(n=>n.selector),suggestions:A.imagesWithoutAlt.length?['Describe meaningful images in alt; use alt="" for decorative ones.']:[]};case"structure":{let n=A.headings.slice(0,15).map(i=>`${" ".repeat(i.level-1)}h${i.level} ${i.text}`).join(`
|
|
386
|
+
`)}`:"Nothing unusual found.",ids:r,rows:t.data.filter(s=>i.has(he(s,t.rowKey))),anomalies:n}}if(/summar|overview|describe|సారాంశం/.test(A)){let n=st(t.data,t.columns,t.filters??[]);return{kind:"summary",message:yo(n,t.columns),ids:[],rows:n}}let o=tl(e,t);return{kind:"query",message:o.message,ids:o.ids,rows:o.rows}}var TA=e=>{let t=typeof e=="number"?e:Number(String(e??"").replace(/[,₹$%\s]/g,""));return Number.isFinite(t)?t:null},jn=e=>{let t=e instanceof Date?e.getTime():new Date(String(e??"")).getTime();return Number.isFinite(t)?t:null};function nA(e,t){if(t==="count")return e.length;if(!e.length)return 0;switch(t){case"sum":return e.reduce((A,o)=>A+o,0);case"avg":return e.reduce((A,o)=>A+o,0)/e.length;case"min":return Math.min(...e);case"max":return Math.max(...e)}}function Al(e,t,A,o="sum"){let n=new Map;for(let r of e){let i=String(r[t]??"\u2014").trim()||"\u2014",s=n.get(i)??[];if(A===null||o==="count")s.push(1);else{let g=TA(r[A]);g!==null&&s.push(g)}n.set(i,s)}return Array.from(n.entries()).map(([r,i])=>({group:r,value:nA(i,o),count:i.length})).sort((r,i)=>i.value-r.value)}function Zn(e,t,A=1){let o=new Date(e);return o.setHours(0,0,0,0),t==="week"&&o.setDate(o.getDate()-(o.getDay()-A+7)%7),t==="month"&&o.setDate(1),t==="quarter"&&o.setMonth(Math.floor(o.getMonth()/3)*3,1),t==="year"&&o.setMonth(0,1),o}function Bo(e,t,A){let o=new Date(e);return t==="day"&&o.setDate(o.getDate()+A),t==="week"&&o.setDate(o.getDate()+7*A),t==="month"&&o.setMonth(o.getMonth()+A),t==="quarter"&&o.setMonth(o.getMonth()+3*A),t==="year"&&o.setFullYear(o.getFullYear()+A),o}function ol(e,t){let A=t.referenceDate?new Date(t.referenceDate):new Date,o=Zn(A,t.period,t.weekStartsOn),n=t.toDate===!1?Bo(o,t.period,1):new Date(Math.max(A.getTime()+1,o.getTime()+1)),r=Bo(o,t.period,-1),i=t.toDate===!1?o:new Date(r.getTime()+(n.getTime()-o.getTime())),s=t.agg??"sum",g=new Map,a=new Map;for(let u of e){let C=jn(u[t.dateKey]);if(C===null)continue;let h=C>=o.getTime()&&C<n.getTime()?g:C>=r.getTime()&&C<i.getTime()?a:null;if(!h)continue;let y=t.groupKey?String(u[t.groupKey]??"\u2014"):"All",f=s==="count"?1:TA(u[t.metricKey]);f!==null&&h.set(y,[...h.get(y)??[],f])}let l=new Set([...g.keys(),...a.keys()]),I=Array.from(l).map(u=>{let C=nA(g.get(u)??[],s),h=nA(a.get(u)??[],s);return{group:u,current:C,previous:h,change:C-h,changePct:h===0?null:(C-h)/Math.abs(h)*100}});return{period:t.period,current:{from:o,to:n},previous:{from:r,to:i},rows:I}}function nl(e,t,A,o,n="sum"){let r=new Map;for(let i of e){let s=jn(i[t]),g=n==="count"?1:TA(i[A]);if(s===null||g===null)continue;let a=Zn(new Date(s),o).getTime();r.set(a,[...r.get(a)??[],g])}return Array.from(r.entries()).sort((i,s)=>i[0]-s[0]).map(([i,s])=>({start:new Date(i),value:nA(s,n)}))}var il=/rate|conversion|ratio|percent|%|score|rating|margin|ctr|avg|average/i;function rl(e){let t=e.match(/\b(today|yesterday|this|last|previous|past)\s*(day|week|month|quarter|year)?\b/);return t?t[1]==="today"?{period:"day",shift:0}:t[1]==="yesterday"?{period:"day",shift:-1}:t[2]?{period:t[2],shift:t[1]==="this"?0:-1}:null:null}var be=e=>e.toLocaleString("en-IN",{maximumFractionDigits:2}),Qo=e=>e===null?"new":`${e>0?"+":""}${e.toFixed(1)}%`;function _n(e,t,A,o={}){let n=e.toLowerCase(),r=A.filter(p=>p.type==="number"),i=Pe(n,A,"number")??r.find(p=>/amount|revenue|sales|total|value/i.test(`${p.key} ${p.label}`))??r[0],s=A.find(p=>p.type==="date")??A.find(p=>/date|time|day|created|month/i.test(`${p.key} ${p.label}`)),g=n.match(/\b(?:which|by|per|each|across|every|top|for each)\s+([\p{L}\p{M}\p{N} _]+)/u)?.[1]??"",a=Pe(g,A,"text"),l=/how many|number of|count/.test(n),I=l?"count":/average|avg|mean/.test(n)?"avg":/\btotal\b|\bsum\b/.test(n)?"sum":i&&il.test(`${i.key} ${i.label}`)?"avg":"sum",u=/drop|decline|decrease|fell|fall|down|worst|lost|shrink|reduc/.test(n),C=/increase|growth|grew|rise|rose|up\b|best|improv|gain/.test(n),h=/lowest|least|smallest|bottom|worst|minimum/.test(n),y=rl(n);if(!i&&!l)return{kind:"unknown",answer:"I couldn't find a numeric column to analyse.",table:[]};let f=l?"rows":i.label;if(y&&s&&(C||u||/change|compare|vs|versus/.test(n))){let p=o.referenceDate?new Date(o.referenceDate):new Date,c=y.shift?Bo(p,y.period,y.shift):p,Q=[...ol(t,{dateKey:s.key,metricKey:i?.key??s.key,groupKey:a?.key,agg:I,period:y.period,referenceDate:c,toDate:y.shift===0}).rows].sort((j,Ae)=>u?j.change-Ae.change:Ae.change-j.change),b=Q.map(j=>({[a?.label??"Group"]:j.group,Current:be(j.current),Previous:be(j.previous),Change:be(j.change),"Change %":Qo(j.changePct)}));if(!Q.length)return{kind:"period-change",answer:`No ${f} data in this ${y.period} or the one before.`,table:b};let S=Q[0],F=`${y.shift?"last":"this"} ${y.period} vs the ${y.period} before`,P=S.change===0?"did not change":S.change<0?`dropped ${be(Math.abs(S.change))}`:`rose ${be(S.change)}`,G=`${f} ${P} (${be(S.previous)} \u2192 ${be(S.current)}, ${Qo(S.changePct)}) \u2014 ${F}.`,D=u&&S.change>=0||C&&S.change<=0;return{kind:"period-change",answer:a?D?`No ${a.label.toLowerCase()} ${u?"dropped":"grew"}. Closest is ${S.group}: ${G}`:`${S.group}: ${G}`:G,table:b}}if(/trend|over time|month by month|week by week/.test(n)&&s&&i){let p=/week/.test(n)?"week":/day|daily/.test(n)?"day":/year/.test(n)?"year":"month",c=nl(t,s.key,i.key,p,I),d=c.map(F=>({Period:F.start.toISOString().slice(0,10),[i.label]:be(F.value)}));if(c.length<2)return{kind:"trend",answer:`Not enough ${p}s of data for a trend.`,table:d};let Q=c[0].value,b=c[c.length-1].value,S=c.reduce((F,P)=>P.value>F.value?P:F);return{kind:"trend",answer:`${i.label} went from ${be(Q)} to ${be(b)} over ${c.length} ${p}s (${Qo(Q?(b-Q)/Math.abs(Q)*100:null)}). Peak: ${be(S.value)} in the ${p} of ${S.start.toISOString().slice(0,10)}.`,table:d}}if(a){let p=Al(t,a.key,i?.key??null,I),c=h?[...p].reverse():p,d=c.map(b=>({[a.label]:b.group,[`${I} of ${f}`]:be(b.value),Rows:b.count}));if(!c.length)return{kind:"group",answer:"No data.",table:d};let Q=c[0];return{kind:"group",answer:`${Q.group} has the ${h?"lowest":"highest"} ${I==="sum"?"total":I==="avg"?"average":I} ${f}: ${be(Q.value)} (across ${c.length} ${a.label.toLowerCase()} groups).`,table:d}}let B=l?t.map(()=>1):t.map(p=>TA(p[i.key])).filter(p=>p!==null),m=nA(B,I);return{kind:"total",answer:`${I==="avg"?"Average":I==="count"?"Count of":I==="sum"?"Total":I} ${f}: ${be(m)} across ${t.length} row(s).`,table:[{Metric:f,Aggregation:I,Value:be(m)}]}}function sl(e){let t=Ne(e),A={title:"",description:"",language:"",headings:[],landmarks:{},counts:{links:0,buttons:0,images:0,forms:0,tables:0,fields:0},unlabeledFields:[],imagesWithoutAlt:[],purpose:""};if(!t)return A;let o=Bt(t)?t:t.ownerDocument,n=O(t,"h1,h2,h3,h4,h5,h6").map(l=>({level:Number(l.tagName[1]),text:me(l.textContent??"",80)})),r={};for(let[l,I]of Object.entries({header:"header,[role='banner']",navigation:"nav,[role='navigation']",main:"main,[role='main']",search:"search,[role='search']",footer:"footer,[role='contentinfo']"}))r[l]=O(t,I).length;let i=O(t,"input,select,textarea").filter(l=>!["hidden","submit","button","reset","image"].includes((l.getAttribute("type")??"text").toLowerCase())),s=i.filter(l=>!Ye(l)).map(l=>({type:l.tagName==="INPUT"?l.getAttribute("type")??"text":l.tagName.toLowerCase(),hint:l.getAttribute("placeholder")||l.getAttribute("name")||"",selector:ze(l)})),g=O(t,"img:not([alt])").map(l=>({src:l.getAttribute("src")??"",selector:ze(l)})),a={title:o.title,description:rt(o.querySelector('meta[name="description"]')?.getAttribute("content")),language:o.documentElement.getAttribute("lang")??"",headings:n,landmarks:r,counts:{links:O(t,"a[href]").length,buttons:O(t,"button,[role='button'],input[type='submit']").length,images:O(t,"img").length,forms:O(t,"form,[role='form']").length,tables:O(t,"table,[role='grid'],[role='table']").length,fields:i.length},unlabeledFields:s,imagesWithoutAlt:g,purpose:""};return a.purpose=al(a,i),a}function al(e,t){let A=e.headings.find(i=>i.level===1)?.text||e.title||"This page",o=t.map(i=>`${i.getAttribute("type")} ${i.getAttribute("name")} ${Ye(i)}`).join(" ").toLowerCase(),n=[];/password/.test(o)?n.push("sign in or create an account"):(/search|query|వెతుకు/.test(o)||e.landmarks.search)&&n.push("search"),/message|comment|feedback|contact|enquiry/.test(o)&&n.push("send a message"),/card|payment|upi|amount/.test(o)&&n.push("make a payment"),e.counts.tables&&n.push(`browse ${e.counts.tables} table(s) of data`),!n.length&&e.counts.forms&&n.push(`fill in ${e.counts.forms} form(s)`),n.length||n.push("read content");let r=e.headings.filter(i=>i.level===2).slice(0,5).map(i=>i.text);return[`"${A}" lets you ${n.join(", ")}.`,e.description?`It describes itself as: ${me(e.description,140)}`:"",r.length?`Main sections: ${r.join(" \xB7 ")}.`:""].filter(Boolean).join(" ")}var gl=[["missing-labels",/label|unlabel|లేబుల్/i],["images",/image|alt text|picture|photo|చిత్ర/i],["structure",/heading|structure|outline|section|landmark|శీర్షిక/i],["forms",/form|field|input|ఫారం/i],["links",/link|లింక్/i],["counts",/how many|count|ఎన్ని/i],["purpose",/what (does|is)|purpose|about|summar|explain|ఏమి|గురించి/i]];function ll(e){for(let[t,A]of gl)if(A.test(e))return t;return"unknown"}async function ei(e,t={}){let A=sl(t.root),o=ll(e);switch(o){case"missing-labels":return A.unlabeledFields.length?{intent:o,answer:`${A.unlabeledFields.length} of ${A.counts.fields} field(s) have no label: ${A.unlabeledFields.map(n=>`${n.type}${n.hint?` ("${n.hint}")`:""}`).join(", ")}.`,targets:A.unlabeledFields.map(n=>n.selector),suggestions:["Add a visible <label for=\u2026> to each field.","Run the Accessibility Copilot to add aria-labels from placeholders as a quick fix."]}:{intent:o,answer:`All ${A.counts.fields} form field(s) have labels.`,targets:[],suggestions:[]};case"images":return{intent:o,answer:A.imagesWithoutAlt.length?`${A.imagesWithoutAlt.length} of ${A.counts.images} image(s) have no alt text.`:`All ${A.counts.images} image(s) have alt text.`,targets:A.imagesWithoutAlt.map(n=>n.selector),suggestions:A.imagesWithoutAlt.length?['Describe meaningful images in alt; use alt="" for decorative ones.']:[]};case"structure":{let n=A.headings.slice(0,15).map(i=>`${" ".repeat(i.level-1)}h${i.level} ${i.text}`).join(`
|
|
387
387
|
`),r=Object.entries(A.landmarks).filter(([,i])=>i===0).map(([i])=>i);return{intent:o,answer:`${A.headings.length} heading(s).
|
|
388
388
|
${n}${r.length?`
|
|
389
389
|
Missing landmarks: ${r.join(", ")}.`:""}`,targets:[],suggestions:r.includes("main")?["Wrap the primary content in <main>."]:[]}}case"forms":{let n=NA({root:t.root});return{intent:o,answer:n.length?n.map(r=>r.summary).join(`
|
|
390
|
-
`):"There are no forms on this page.",targets:n.flatMap(r=>r.findings.map(i=>i.selector).filter(i=>!!i)),suggestions:n.flatMap(r=>r.findings.slice(0,3).map(i=>i.suggestion))}}case"links":case"counts":{let n=A.counts;return{intent:o,answer:`${n.links} links, ${n.buttons} buttons, ${n.fields} form fields in ${n.forms} form(s), ${n.images} images, ${n.tables} tables.`,targets:[],suggestions:[]}}case"purpose":case"unknown":{let n=A.purpose;if(t.summarize)try{let i=Ne(t.root),s=rt((i&&Bt(i)?i.body:i)?.textContent).slice(0,4e3);n=await t.summarize(s)||n}catch{}let r=[];return A.unlabeledFields.length&&r.push(`${A.unlabeledFields.length} form field(s) need labels.`),A.imagesWithoutAlt.length&&r.push(`${A.imagesWithoutAlt.length} image(s) need alt text.`),{intent:o,answer:n,targets:[],suggestions:r}}}}var oi="highlight|mark|flag|sort|order|rank|arrange|summari[sz]e|summary|recap|count|how many|open|select|pick|show|filter|find|list|clear|reset|remove|detect|spot|tell";function bo(e){return e.replace(/[?!]/g," ").split(/\s*(?:;|\.(?!\d)\s*|,?\s*\band then\b|,?\s*\bthen\b|,?\s*\bafter that\b|,?\s*\bfinally\b|,?\s*\bnext\b|ఆ తర్వాత)\s*/i).flatMap(o=>o.split(new RegExp(`\\s*(?:,|\\band\\b)\\s+(?=(?:${oi})\\b)`,"i"))).map(o=>o.trim()).filter(o=>o.length>1).map(o=>({action:
|
|
391
|
-
${yo(p,n)}`};break}}}catch(p){m={...f,success:!1,message:`This step failed: ${p instanceof Error?p.message:String(p)}`}}u.push(m),A.onStep?.(m,y,o.length)}let h=l().length;return{steps:u,before:I,after:{rows:h,filters:i,sort:g,highlighted:a},summary:Ai(I,h,i,g,a,n)}}function Ai(e,t,A,o,n,r){let i=[`Rows: ${e.rows} \u2192 ${t}.`],s=A.filter(a=>!e.filters.some(l=>JSON.stringify(l)===JSON.stringify(a))),g=e.filters.filter(a=>!A.some(l=>JSON.stringify(a)===JSON.stringify(l)));return s.length&&i.push(`Filters added: ${s.map(a=>ti(a,r)).join("; ")}.`),g.length&&i.push(`Filters removed: ${g.map(a=>ti(a,r)).join("; ")}.`),o&&i.push(`Sorted by ${r.find(a=>a.key===o.key)?.label??o.key} ${o.direction==="desc"?"high \u2192 low":"low \u2192 high"}.`),n.length&&i.push(`${n.length} row(s) highlighted.`),i.join(" ")}var ul=/\b(off|disable|stop|remove|no more|turn off|switch off|deactivate)\b|ఆఫ్|ఆపు|తీసివేయి|बंद/i,dl=[{pattern:/high contrast|contrast|హై కాంట్రాస్ట్|కాంట్రాస్ట్/i,key:"highContrast",name:"High contrast"},{pattern:/dark mode|dark theme|night mode|డార్క్ మోడ్|చీకటి/i,key:"darkMode",name:"Dark mode"},{pattern:/reduce motion|less motion|stop animation|animations?|కదలికలు/i,key:"reduceMotion",name:"Reduced motion"},{pattern:/large targets?|bigger buttons?|big buttons?|larger buttons?|పెద్ద బటన్/i,key:"largeTargets",name:"Large targets"},{pattern:/dyslexia|readable font|easy font/i,key:"dyslexiaFont",name:"Dyslexia-friendly font"},{pattern:/speak on focus|read aloud|read out|screen reader|speech|చదివి వినిపించు/i,key:"speechEnabled",name:"Speak on focus"},{pattern:/skip links?/i,key:"showSkipLinks",name:"Skip links"}],Il=[[/deuteranop|green.?blind/i,"deuteranopia"],[/protanop|red.?blind/i,"protanopia"],[/tritanop|blue.?blind/i,"tritanopia"],[/grey ?scale|gray ?scale|achromat|black and white/i,"achromatopsia"]],ii=.1,Cl=.8,pl=1.3;function fl(e,t={}){let A=e.trim().toLowerCase();if(!A)return null;if(/\b(next|down)\s+(row|line|record|item)\b|తర్వాతి (వరుస|అంశం)/.test(A))return{type:"grid",action:"next-row",say:"Next row."};if(/\b(previous|prev|back|up)\s+(row|line|record|item)\b|ముందరి (వరుస|అంశం)|వెనుక (వరుస|అంశం)/.test(A))return{type:"grid",action:"previous-row",say:"Previous row."};if(/\bfirst\s+(row|record|item)\b|మొదటి (వరుస|అంశం)/.test(A))return{type:"grid",action:"first-row",say:"First row."};if(/\blast\s+(row|record|item)\b|చివరి (వరుస|అంశం)/.test(A))return{type:"grid",action:"last-row",say:"Last row."};if(/\b(open|expand|read)\s+(this\s+)?(row|record|item)\b|ఈ (వరుస|అంశం) తెరువు/.test(A))return{type:"grid",action:"open-row",say:"Opening row."};if(/\b(reset|default|restore)\b.*\b(settings?|accessibility|everything|all)\b|^reset$|రీసెట్/.test(A))return{type:"reset",say:"Accessibility settings reset."};let o=t.fontSizeMultiplier??1,n=i=>Math.round(Math.min(pl,Math.max(Cl,i))*100)/100;if(/\b(bigger|larger|increase|zoom in)\b.*\b(text|font|letters?)\b|\b(text|font)\b.*\b(bigger|larger|up)\b|పెద్ద అక్షరాలు|అక్షరాలు పెద్ద/.test(A)){let i=n(o+ii);return{type:"setting",patch:{fontSizeMultiplier:i},say:`Text size ${Math.round(i*100)}%.`}}if(/\b(smaller|decrease|reduce|zoom out)\b.*\b(text|font|letters?)\b|\b(text|font)\b.*\b(smaller|down)\b|చిన్న అక్షరాలు|అక్షరాలు చిన్న/.test(A)){let i=n(o-ii);return{type:"setting",patch:{fontSizeMultiplier:i},say:`Text size ${Math.round(i*100)}%.`}}if(/\b(normal|default|reset)\b.*\b(text|font)\s*(size)?\b/.test(A))return{type:"setting",patch:{fontSizeMultiplier:1},say:"Text size 100%."};let r=ul.test(A);for(let[i,s]of Il)if(i.test(A))return r?{type:"setting",patch:{colorBlindMode:"none"},say:"Colour filter off."}:{type:"setting",patch:{colorBlindMode:s},say:`${s} filter on.`};if(/colou?r.?blind/.test(A)&&r)return{type:"setting",patch:{colorBlindMode:"none"},say:"Colour filter off."};for(let i of dl){if(!i.pattern.test(A))continue;let s=/\btoggle\b/.test(A)?!t[i.key]:!r;return i.key==="reduceMotion"&&!/reduce motion|less motion|కదలికలు తగ్గించు/.test(A)&&/animations?/.test(A)&&(s=r||/\bno\b/.test(A)),{type:"setting",patch:{[i.key]:s},say:`${i.name} ${s?"on":"off"}.`}}return null}var ri={highContrast:!1,darkMode:!1,reduceMotion:!1,largeTargets:!1,dyslexiaFont:!1,speechEnabled:!1,colorBlindMode:"none",fontSizeMultiplier:1};function ml(e,t={}){if(!tt())return null;let A=t.root??document,o=t.rowSelector??"[data-yuktai-row-id], [role='row']",n=Array.from(A.querySelectorAll(o)).filter(a=>!a.querySelector("th,[role='columnheader']"));if(!n.length)return null;let r=document.activeElement?.closest(o),i=r?n.indexOf(r):-1;if(e==="open-row"){let a=i>=0?n[i]:n[0];return a.click(),a}let s=e==="first-row"?0:e==="last-row"?n.length-1:e==="next-row"?Math.min(n.length-1,i+1):Math.max(0,i-1),g=n[s];return g.hasAttribute("tabindex")||g.setAttribute("tabindex","-1"),g.focus(),g.scrollIntoView?.({block:"nearest"}),g}function si(e={}){let t={enabled:!0,...ri,...e.initial},A=null,o=!1,n=async a=>e.apply?e.apply(a):Ge.execute(a),r=a=>{if(e.speak===!1||!tt()||!("speechSynthesis"in window))return;let l=new SpeechSynthesisUtterance(a);l.lang=e.lang??"en-IN",window.speechSynthesis.cancel(),window.speechSynthesis.speak(l)};async function i(a){let l=fl(a,t);if(e.onTranscript?.(a,l),!l)return null;if(l.type==="grid"){let I=ml(l.action,{root:e.gridRoot});return r(I?l.say:"No table rows found."),l}return t=l.type==="reset"?{...t,...ri}:{...t,...l.patch},await n(t),r(l.say),l}function s(){if(!tt()||o)return o;let a=window,l=a.SpeechRecognition??a.webkitSpeechRecognition;return l?(A=new l,A.lang=e.lang??"en-IN",A.continuous=!0,A.interimResults=!1,A.onresult=I=>{let u=I.results,C=u[u.length-1];C?.[0]?.transcript&&i(C[0].transcript)},A.onend=()=>{o&&A?.start()},A.onerror=I=>{(I.error==="not-allowed"||I.error==="service-not-allowed")&&(o=!1)},o=!0,A.start(),!0):!1}function g(){o=!1,A?.stop(),A=null}return{start:s,stop:g,handle:i,isListening:()=>o,getConfig:()=>({...t})}}import{Fragment as gi,jsx as v,jsxs as se}from"react/jsx-runtime";var hl=/\b(trend|over time|this (week|month|quarter|year)|last (week|month|quarter|year)|compare|versus|vs)\b|\b(by|per|each|which)\b.*\b(total|average|avg|sum|drop|increase|growth|highest|lowest|most|least)\b|\b(total|average|avg|sum)\b.*\b(by|per|each)\b/i;function td(e){let{data:t,rowKey:A="id"}=e,o=wo(()=>wt(e.columns),[e.columns]),[n,r]=ue([]),[i,s]=ue(null),[g,a]=ue([]),[l,I]=ue(""),[u,C]=ue(null),[h,y]=ue([]),[f,B]=ue([]),[m,p]=ue(!1),c=iA(n);c.current=n;let d=Eo(()=>({data:t,columns:o,rowKey:A,filters:c.current,onFiltersChange:F=>{c.current=F,r(F)},onSortChange:s,onHighlightRows:a,onOpenRow:e.onOpenRow,onSelectRow:F=>a([F])}),[t,o,A,e.onOpenRow]),Q=Eo(async F=>{let P=F.trim();if(P){p(!0),B([]),y([]);try{if(bo(P).length>1){let G=[],D=await ni(P,d(),{onStep:E=>B((G.push(E),[...G]))});C("tasks"),I(D.summary)}else if(hl.test(P)){let G=gt(t,o,{filters:c.current,search:[],sort:null,limit:null,notes:[],explanation:""}),D=_n(P,G,o,{referenceDate:e.referenceDate});C("insight"),I(D.answer),y(D.table)}else{let G=Vn(P,d());C(G.kind),I(G.message)}}finally{p(!1)}}},[d,t,o,e.referenceDate]),b=Eo(()=>{c.current=[],r([]),s(null),a([]),I(""),C(null),y([]),B([])},[]),S=wo(()=>gt(t,o,{filters:n,search:[],sort:i,limit:null,notes:[],explanation:""}),[t,o,n,i]);return{gridData:S,highlightIds:g,filters:n,sort:i,ask:Q,reset:b,answer:l,kind:u,table:h,steps:f,busy:m,visibleIds:S.map(F=>he(F,A))}}var ci={border:"1px solid color-mix(in srgb, CanvasText 20%, transparent)",borderRadius:12,padding:16,background:"Canvas",color:"CanvasText",font:"inherit"},Ie={minHeight:44,padding:"8px 14px",borderRadius:8,border:"1px solid color-mix(in srgb, CanvasText 35%, transparent)",background:"ButtonFace",color:"ButtonText",font:"inherit",cursor:"pointer"},xo={...Ie,flex:1,minWidth:0,background:"Field",color:"FieldText",cursor:"text"},LA={opacity:.75,fontSize:"0.9em"};function ko({rows:e}){if(!e.length)return null;let t=Object.keys(e[0]);return v("div",{style:{overflowX:"auto",marginTop:12},children:se("table",{style:{borderCollapse:"collapse",width:"100%"},children:[v("thead",{children:v("tr",{children:t.map(A=>v("th",{scope:"col",style:{textAlign:"left",padding:"6px 8px",borderBottom:"1px solid currentColor"},children:A},A))})}),v("tbody",{children:e.slice(0,50).map((A,o)=>v("tr",{children:t.map(n=>v("td",{style:{padding:"6px 8px",borderBottom:"1px solid color-mix(in srgb, CanvasText 12%, transparent)"},children:A[n]},n))},o))})]})})}function ai(e,t,A){let o=URL.createObjectURL(new Blob([t],{type:A})),n=document.createElement("a");n.href=o,n.download=e,n.click(),setTimeout(()=>URL.revokeObjectURL(o),1e3)}function Ad({grid:e,placeholder:t="Ask about this data, e.g. \u201Coverdue and over \u20B910,000\u201D",examples:A=[],style:o}){let[n,r]=ue(""),i=s=>{s.preventDefault(),e.ask(n)};return se("section",{"data-yuktai-panel":"","aria-label":"Data assistant",style:{...ci,...o},children:[se("form",{onSubmit:i,style:{display:"flex",gap:8,flexWrap:"wrap"},children:[v("label",{htmlFor:"yuktai-grid-ask",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"},children:"Question about the data"}),v("input",{id:"yuktai-grid-ask",value:n,onChange:s=>r(s.target.value),placeholder:t,style:xo}),v("button",{type:"submit",style:Ie,disabled:e.busy,children:e.busy?"Working\u2026":"Ask"}),v("button",{type:"button",style:Ie,onClick:()=>{r(""),e.reset()},children:"Reset"})]}),A.length>0&&v("div",{style:{display:"flex",gap:6,flexWrap:"wrap",marginTop:8},children:A.map(s=>v("button",{type:"button",style:{...Ie,minHeight:36,fontSize:"0.85em"},onClick:()=>{r(s),e.ask(s)},children:s},s))}),v("div",{"aria-live":"polite",style:{marginTop:12,whiteSpace:"pre-line"},children:e.answer}),e.steps.length>0&&v("ol",{style:{marginTop:8,paddingLeft:20},children:e.steps.map((s,g)=>se("li",{style:{marginBottom:4},children:[v("span",{"aria-hidden":"true",children:s.success?"\u2705 ":"\u26A0\uFE0F "}),v("strong",{children:s.text})," \u2014 ",v("span",{style:{whiteSpace:"pre-line"},children:s.message})]},g))}),v(ko,{rows:e.table})]})}var MA=[["copilot","Copilot"],["qa","QA report"],["forms","Forms"],["design","Design"],["ask","Ask page"],["voice","Voice"]];function ui({defaultTab:e="copilot",voiceLang:t="en-IN",generate:A,engine:o,style:n}){let[r,i]=ue(e),s=iA([]),g=(a,l)=>{let I=a.key==="ArrowRight"?1:a.key==="ArrowLeft"?-1:0;if(!I)return;a.preventDefault();let u=(l+I+MA.length)%MA.length;i(MA[u][0]),s.current[u]?.focus()};return se("section",{"data-yuktai-panel":"","aria-label":"yuktai agentic tools",style:{...ci,...n},children:[v("div",{role:"tablist","aria-label":"Tools",style:{display:"flex",gap:6,flexWrap:"wrap",marginBottom:12},children:MA.map(([a,l],I)=>v("button",{ref:u=>{s.current[I]=u},role:"tab",id:`yuktai-tab-${a}`,"aria-selected":r===a,"aria-controls":`yuktai-tabpanel-${a}`,tabIndex:r===a?0:-1,onClick:()=>i(a),onKeyDown:u=>g(u,I),style:{...Ie,fontWeight:r===a?700:400,outlineOffset:2,borderWidth:r===a?2:1},children:l},a))}),se("div",{role:"tabpanel",id:`yuktai-tabpanel-${r}`,"aria-labelledby":`yuktai-tab-${r}`,children:[r==="copilot"&&v(yl,{}),r==="qa"&&v(Ql,{}),r==="forms"&&v(Bl,{}),r==="design"&&v(bl,{}),r==="ask"&&v(El,{generate:A,engine:o}),r==="voice"&&v(wl,{lang:t})]})]})}function yl(){let e=iA(null),[t,A]=ue(null),[o,n]=ue(null),[r,i]=ue("");li(()=>(e.current=Hn({onUpdate:A}),e.current.scan(),()=>e.current?.stop()),[]);let s=e.current,g=t?.report?.issues??[];return se("div",{children:[se("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[v("button",{type:"button",style:Ie,onClick:()=>t?.watching?s?.stop():s?.start(),children:t?.watching?"Stop watching":"Watch page live"}),v("button",{type:"button",style:Ie,onClick:()=>s?.scan(),children:"Scan now"}),v("button",{type:"button",style:Ie,onClick:()=>i(`${s?.applyAllFixes().filter(a=>a.applied).length??0} fix(es) applied.`),children:"Apply safe fixes"}),v("button",{type:"button",style:Ie,onClick:()=>i(`${s?.undoAll()??0} change(s) undone.`),children:"Undo all"})]}),se("p",{"aria-live":"polite",style:{marginTop:12},children:[t?.report?.summary," ",r]}),v("ul",{style:{listStyle:"none",padding:0,margin:0},children:g.slice(0,40).map(a=>se("li",{style:{borderTop:"1px solid color-mix(in srgb, CanvasText 12%, transparent)",padding:"8px 0"},children:[se("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[v("span",{style:{...LA,minWidth:70},children:a.severity}),v("span",{style:{flex:1},children:a.message}),v("button",{type:"button",style:Ie,"aria-expanded":o===a.id,onClick:()=>n(o===a.id?null:a.id),children:"Why?"}),a.autoFixable&&v("button",{type:"button",style:Ie,onClick:()=>i(s?.applyFix(a.id).message??""),children:"Fix"})]}),o===a.id&&v("p",{style:{whiteSpace:"pre-line",margin:"8px 0 0"},children:s?.explain(a.id)})]},a.id))})]})}function Ql(){let[e,t]=ue(null);return se("div",{children:[se("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[v("button",{type:"button",style:Ie,onClick:()=>t(at()),children:"Run QA check"}),e&&se(gi,{children:[v("button",{type:"button",style:Ie,onClick:()=>ai("accessibility-report.md",Kn(e),"text/markdown"),children:"Download .md"}),v("button",{type:"button",style:Ie,onClick:()=>ai("accessibility-report.json",qn(e),"application/json"),children:"Download .json"})]})]}),e&&se(gi,{children:[se("p",{"aria-live":"polite",style:{marginTop:12},children:[v("strong",{children:e.passed?"PASS":"FAIL"})," \u2014 ",e.summary]}),v(ko,{rows:e.checks.map(A=>({Check:A.title,Result:A.passed?"\u2705 Pass":"\u274C Fail",Issues:A.issueCount}))})]})]})}function Bl(){let[e,t]=ue(null);return se("div",{children:[v("button",{type:"button",style:Ie,onClick:()=>t(NA()),children:"Review forms"}),se("div",{"aria-live":"polite",children:[e&&e.length===0&&v("p",{children:"No forms on this page."}),e?.map(A=>se("div",{style:{marginTop:12},children:[v("p",{children:v("strong",{children:A.summary})}),v("ul",{children:A.findings.map((o,n)=>se("li",{children:[o.level==="problem"?"Problem: ":"Suggestion: ",o.message," ",v("span",{style:LA,children:o.suggestion})]},n))})]},A.selector))]})]})}function bl(){let[e,t]=ue(null);return se("div",{children:[v("button",{type:"button",style:Ie,onClick:()=>t(Wn()),children:"Review design"}),e&&se("div",{"aria-live":"polite",children:[v("p",{style:{marginTop:12},children:v("strong",{children:e.summary})}),v(ko,{rows:Object.entries(e.categories).map(([A,o])=>({Area:A,Score:o.score,Findings:o.findings}))}),v("ul",{children:e.findings.map((A,o)=>se("li",{children:["[",A.severity,"] ",A.message," ",v("span",{style:LA,children:A.suggestion})]},o))})]})]})}function El({generate:e,engine:t}){let[A,o]=ue(""),n=iA(null),r=iA(t),[i,s]=ue(""),[g,a]=ue([]);return se("div",{children:[se("form",{onSubmit:async I=>{if(I.preventDefault(),!A.trim())return;let u=await ei(A);if(u.intent!=="unknown"&&u.intent!=="purpose"){s(u.answer),a(u.suggestions);return}!n.current||r.current!==t?(n.current=DA({engine:t}),r.current=t):n.current.rebuild();let C=await n.current.ask(A,{generate:e});s(u.intent==="purpose"&&!C.hits.length?u.answer:C.hits.length?C.answer:u.answer),a(u.suggestions)},style:{display:"flex",gap:8,flexWrap:"wrap"},children:[v("label",{htmlFor:"yuktai-page-ask",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"},children:"Question about this page"}),v("input",{id:"yuktai-page-ask",value:A,onChange:I=>o(I.target.value),placeholder:"What does this page do? Which fields are missing labels?",style:xo}),v("button",{type:"submit",style:Ie,children:"Ask"})]}),v("p",{"aria-live":"polite",style:{whiteSpace:"pre-line",marginTop:12},children:i}),g.length>0&&v("ul",{children:g.map((I,u)=>v("li",{children:I},u))})]})}function wl({lang:e}){let t=wo(()=>si({lang:e,onTranscript:(g,a)=>r(`\u201C${g}\u201D \u2192 ${a?a.say:"not a command"}`)}),[e]),[A,o]=ue(!1),[n,r]=ue(""),[i,s]=ue("");return li(()=>()=>t.stop(),[t]),se("div",{children:[v("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:v("button",{type:"button",style:Ie,"aria-pressed":A,onClick:()=>{A?(t.stop(),o(!1)):o(t.start())},children:A?"Stop listening":"Start voice commands"})}),se("form",{onSubmit:g=>{g.preventDefault(),t.handle(i),s("")},style:{display:"flex",gap:8,marginTop:8,flexWrap:"wrap"},children:[v("label",{htmlFor:"yuktai-voice-typed",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"},children:"Type a command"}),v("input",{id:"yuktai-voice-typed",value:i,onChange:g=>s(g.target.value),placeholder:"Or type: turn on high contrast",style:xo}),v("button",{type:"submit",style:Ie,children:"Run"})]}),v("p",{"aria-live":"polite",style:{marginTop:12},children:n}),v("p",{style:LA,children:"Try: \u201Cturn on high contrast\u201D, \u201Cbigger text\u201D, \u201Cdark mode off\u201D, \u201Cnext row\u201D, \u201C\u0C2A\u0C46\u0C26\u0C4D\u0C26 \u0C05\u0C15\u0C4D\u0C37\u0C30\u0C3E\u0C32\u0C41\u201D, \u201Creset settings\u201D."})]})}import{Fragment as kl,jsx as H,jsxs as Ee}from"react/jsx-runtime";var Ii="yuktai-tools-open";async function xl(){try{if(typeof window>"u")return!1;let e=window;if(e.LanguageModel)try{if(typeof e.LanguageModel.availability=="function"){let A=await e.LanguageModel.availability({...WA});if(A==="readily"||A==="available"||A==="downloadable")return!0}else return!0}catch{}if(e.Summarizer)try{let A=await e.Summarizer.availability?.({...We});if(!A||A==="readily"||A==="available")return!0}catch{}if(e.Rewriter)try{let A=await e.Rewriter.availability?.({...We});if(!A||A==="readily"||A==="available")return!0}catch{}if(e.Writer)try{let A=await e.Writer.availability?.({...We});if(!A||A==="readily"||A==="available")return!0}catch{}let t=e.ai||globalThis.ai;if(t){if(t.languageModel?.availability)try{let A=await t.languageModel.availability({...WA});if(A==="readily"||A==="available")return!0}catch{}if(t.languageModel&&typeof t.languageModel.create=="function"||t.summarizer||t.rewriter||t.writer||t.languageModel)return!0}return!!(e.Translator||e.translation?.canTranslate)}catch{return!1}}function Do({position:e="left",children:t,config:A={},showRag:o=!1,showAgent:n=!1,showAccessibility:r,showVibeCoder:i,launcher:s,engine:g,showPageTools:a=!1,pageToolsTab:l="copilot",voiceLang:I}){let u=r!==void 0||i!==void 0||s!==void 0,C=u?!!r:!0,h=u?!!i:n,y=o,f=n,[B,m]=ae(!1),p=!s||B,[c,d]=ae(!1),[Q,b]=ae(io),[S,F]=ae(null),[P,G]=ae(!1),[D,E]=ae(!1),[j,Ae]=ae(!1),J=di.useRef(null),[ee,ie]=ae(!1),[R,oe]=ae(""),[T,Y]=ae(""),[X,q]=ae(!1),[z,xe]=ae(null),[ve,L]=ae("idle"),[ne,de]=ae(!1),[pe,ke]=ae(""),[fe,He]=ae(""),[De,Ct]=ae(!1),[Me,Xe]=ae([]),[Qe,Re]=ae(null),Se=x=>{let U=[],ye=s?84:24;for(let $t of x)U.push(ye),$t&&(ye+=60);return U},[$e,pt,St,gA]=u?Se([C,y,f,h]):[24,84,o?144:84,204],[Le,Ve]=ae(!1),[je,ot]=ae(!1),Pt=Math.max(s?24:-36,C?$e:-36,y?pt:-36,f?St:-36,h?gA:-36)+60;At(()=>{(c||ee||ne||Le)&&ot(!1)},[c,ee,ne,Le]);let ft=g!==void 0,[lA,mt]=ae([]),[ht,yt]=ae(null),Ze=di.useRef(null);At(()=>{if(typeof window>"u")return;let x=window;!!(x.LanguageModel||x.ai?.languageModel)&&D?(xe("gemini"),Re("gemini")):dA()&&(xe("transformers"),Re("transformers"))},[D]),At(()=>{if(z!=="transformers")return;let x=setInterval(()=>L(zt()),500);return()=>clearInterval(x)},[z]);let Kt=x=>x.replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/#+\s/g,"").trim(),Qt=lt(async()=>{let x=R.trim();if(!(!x||X)){q(!0),Y(""),mt([]),yt(null);try{Ze.current?Ze.current.rebuild():Ze.current=DA({engine:g}),await Ze.current.whenEngineReady();let U=performance.now(),ye=await Ze.current.ask(x,{k:4}),$t=performance.now()-U;if(Y(ye.answer),mt(ye.hits.slice(0,3).map(Gt=>Gt.text.length>160?`${Gt.text.slice(0,157)}\u2026`:Gt.text)),yt({ms:$t,engine:Ze.current.engine,ai:!1}),ye.hits.length&&z){let Gt=ye.hits.map(et=>et.text).join(`
|
|
392
|
-
`),Wt;if(z==="gemini"){let{askWithContext:et}=await import("./rag-O3FDQPTX.mjs");Wt=await et(x,Gt)}else{L("loading");let{answerFromContext:et}=await import("./transformers-rag-MQZRMFTG.mjs");Wt=await et(x,Gt),L(zt())}Wt.success&&Wt.answer&&(Y(Kt(Wt.answer)),yt(et=>et&&{...et,ai:!0}))}}catch{Y(U=>U||"\u26A0\uFE0F Something went wrong.")}q(!1)}},[R,X,z,g]),qt=lt(async()=>{if(ft)return Qt();if(!(!R.trim()||X)){if(!z){Y("\u26A0\uFE0F No AI engine available.");return}q(!0),Y("");try{let x;if(z==="gemini"){let{askPage:U}=await import("./rag-O3FDQPTX.mjs");x=await U(R)}else{L("loading");let{askPageWithTransformers:U}=await import("./transformers-rag-MQZRMFTG.mjs");x=await U(R),L("ready")}Y(x.success&&x.answer?x.answer.replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/#+\s/g,"").trim():"\u26A0\uFE0F "+(x.error||"No answer found."))}catch{Y("\u26A0\uFE0F Something went wrong.")}q(!1)}},[R,X,z,ft,Qt]),cA=lt(async()=>{if(!pe.trim()||De)return;if(!Qe){He("\u26A0\uFE0F No AI engine available.");return}Ct(!0),Xe([]),He("");let{runAgent:x}=await import("./agent-SZENB4QE.mjs");await x(pe,Qe,U=>{Xe(ye=>[...ye,U.text])}),Ct(!1),He("done")},[pe,De,Qe]);At(()=>{if(typeof window>"u")return;let U=setTimeout(async()=>{let ye=window,$t=await xl();E($t),Ae(!!(ye.SpeechRecognition||ye.webkitSpeechRecognition))},800);return()=>clearTimeout(U)},[]),At(()=>{if(!(typeof window>"u"))try{let x=localStorage.getItem("yuktai-a11y-prefs");x&&b(U=>({...U,...JSON.parse(x)}))}catch{}},[]);let Ht=lt(async x=>{let U={enabled:!0,highContrast:x.highContrast,darkMode:x.darkMode,reduceMotion:x.reduceMotion,largeTargets:x.largeTargets,speechEnabled:x.speechEnabled,autoFix:x.autoFix,dyslexiaFont:x.dyslexiaFont,localFont:x.localFont,fontSizeMultiplier:x.fontScale/100,colorBlindMode:x.colorBlindMode,showAuditBadge:x.showAuditBadge,showSkipLinks:!0,showPreferencePanel:!1,plainEnglish:x.plainEnglish,summarisePage:x.summarisePage,translateLanguage:x.translateLanguage,voiceControl:x.voiceControl,smartLabels:x.smartLabels,...A};await Ge.execute(U),F(Ge.applyFixes(U)),G(!0)},[A]),te=lt(async()=>{try{localStorage.setItem("yuktai-a11y-prefs",JSON.stringify(Q))}catch{}await Ht(Q),d(!1)},[Q,Ht]),Yo=lt(()=>{b(io);try{localStorage.removeItem("yuktai-a11y-prefs")}catch{}let x=document.documentElement;["data-yuktai-high-contrast","data-yuktai-dark","data-yuktai-reduce-motion","data-yuktai-large-targets","data-yuktai-keyboard","data-yuktai-dyslexia"].forEach(U=>x.removeAttribute(U)),document.body.style.filter="",document.body.style.fontFamily="",document.documentElement.style.fontSize="",F(null),G(!1)},[]),Uo=lt((x,U)=>{b(ye=>({...ye,[x]:U}))},[]);At(()=>{let x=U=>{U.key==="Escape"&&(c||ee||ne||Le||je?(d(!1),ie(!1),de(!1),Ve(!1),ot(!1)):s&&B&&m(!1))};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[c,ee,ne,Le,je,s,B]),At(()=>{if(s)try{localStorage.getItem(Ii)==="1"&&m(!0)}catch{}},[s]),At(()=>{if(!(!s||typeof document>"u")){document.documentElement.setAttribute("data-yuktai-tools",B?"open":"closed");try{localStorage.setItem(Ii,B?"1":"0")}catch{}}},[s,B]);let uA=lt(()=>{m(x=>(x&&(d(!1),ie(!1),de(!1),Ve(!1),ot(!1)),!x))},[]);At(()=>{c&&J.current&&Ge.trapFocus(J.current)},[c]);let nt=(x,U,ye)=>({position:"fixed",bottom:`${x}px`,[e]:"24px",zIndex:9998,width:"52px",height:"52px",borderRadius:"50%",background:U,color:"#fff",border:"none",cursor:"pointer",fontSize:"22px",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 16px rgba(0,0,0,0.25)",transition:"transform 0.15s, background 0.2s"}),_e=x=>{x.currentTarget.style.transform="scale(1.08)"},it=x=>{x.currentTarget.style.transform="scale(1)"},M=ft?`${g==="ts"?"Page search":"Rust page search"}${z==="gemini"?" + Gemini Nano":z==="transformers"?" + Transformers.js":" \xB7 On device"}`:z==="gemini"?"Gemini Nano \xB7 On device":z==="transformers"?"Transformers.js \xB7 All devices":"Detecting...",$=ft||!!z,Z=z==="transformers"&&ve==="loading"?"Loading model...":"...";return Ee(kl,{children:[t,s&&H("button",{type:"button","data-yuktai-ui":"true",style:nt(24,B?"#134e4a":"#0f766e",B),"aria-expanded":B,"aria-label":B?"Hide yuktai tools":"Show yuktai tools",title:B?"Hide yuktai tools":"yuktai tools","data-yuktai-launcher":"true",onClick:uA,onMouseEnter:_e,onMouseLeave:it,children:B?H("svg",{"aria-hidden":"true",width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:H("path",{d:"M6 6l12 12M18 6L6 18"})}):Ee("svg",{"aria-hidden":"true",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[H("path",{d:"M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z"}),H("path",{d:"M19 15l.8 2.2L22 18l-2.2.8L19 21l-.8-2.2L16 18l2.2-.8z"})]})}),a&&p&&H("button",{type:"button","data-yuktai-ui":"true",style:nt(Pt,je?"#312e81":"#4338ca",je),"aria-label":"Open page tools","aria-haspopup":"dialog","aria-expanded":je,title:"\u{1F6E0} Page tools: QA report, forms, design, ask, voice","data-yuktai-page-tools":"true",onClick:()=>{ot(x=>!x),d(!1),ie(!1),de(!1),Ve(!1)},onMouseEnter:_e,onMouseLeave:it,children:"\u{1F6E0}"}),a&&p&&je&&Ee("div",{role:"dialog","aria-label":"yuktai page tools","data-yuktai-panel":"true",style:{position:"fixed",bottom:`${Pt+64}px`,[e]:"24px",zIndex:9999,width:"420px",maxWidth:"calc(100vw - 48px)",maxHeight:`calc(100vh - ${Pt+88}px)`,minHeight:"160px",overflowY:"auto",boxShadow:"0 8px 32px rgba(0,0,0,0.18)",borderRadius:"16px",background:"Canvas",color:"CanvasText",border:"1px solid color-mix(in srgb, CanvasText 20%, transparent)"},children:[H("div",{style:{display:"flex",justifyContent:"flex-end",position:"sticky",top:0,zIndex:1,background:"Canvas"},children:H("button",{type:"button",onClick:()=>ot(!1),"aria-label":"Close page tools",style:{margin:"6px 6px 0 0",minWidth:32,minHeight:32,borderRadius:8,border:"1px solid #94a3b8",background:"#fff",color:"#0f172a",cursor:"pointer",fontSize:16},children:"\u2715"})}),H(ui,{defaultTab:l,voiceLang:I,engine:g,style:{margin:0,border:0,paddingTop:4}})]}),h&&p&&H("button",{"data-yuktai-ui":"true",style:nt(gA,Le?"#92400e":"#b45309",Le),"aria-label":"Open Vibe Coder",title:"\u26A1 Vibe Coder \u2014 Generate Next.js project",onClick:()=>{Ve(x=>!x),de(!1),ie(!1),d(!1)},onMouseEnter:_e,onMouseLeave:it,children:"\u26A1"}),h&&p&&Le&&H(so,{position:e,onClose:()=>Ve(!1)}),f&&p&&H("button",{"data-yuktai-ui":"true",style:nt(St,ne?"#065f46":"#047857",ne),"aria-label":"Open AI agent","aria-haspopup":"dialog","aria-expanded":ne,title:"\u{1F916} AI Agent \u2014 guide me through this page",onClick:()=>{de(x=>!x),ie(!1),d(!1)},onMouseEnter:_e,onMouseLeave:it,children:"\u{1F916}"}),f&&p&&ne&&Ee("div",{role:"dialog","aria-modal":"true","aria-label":"yuktai AI Agent","data-yuktai-panel":"true",style:{position:"fixed",bottom:`${St+64}px`,[e]:"24px",zIndex:9999,width:"300px",maxWidth:"calc(100vw - 48px)",background:"#fff",border:"1px solid #e2e8f0",borderRadius:"16px",boxShadow:"0 8px 32px rgba(0,0,0,0.12)",fontFamily:"system-ui,-apple-system,sans-serif",padding:"14px",maxHeight:"70vh",overflowY:"auto"},children:[Ee("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"10px"},children:[Ee("div",{children:[H("p",{style:{margin:"0 0 2px",fontSize:"13px",fontWeight:600,color:"#0f172a"},children:"\u{1F916} AI Agent"}),H("p",{style:{margin:0,fontSize:"10px",color:"#10b981"},children:Qe==="gemini"?"Gemini Nano \xB7 On device":Qe==="transformers"?"Transformers.js \xB7 All devices":"Detecting..."})]}),H("button",{onClick:()=>de(!1),"aria-label":"Close agent panel",style:{background:"none",border:"none",cursor:"pointer",color:"#94a3b8",fontSize:"18px",lineHeight:1,padding:"2px"},children:"\xD7"})]}),H("p",{style:{margin:"0 0 8px",fontSize:"11px",color:"#64748b"},children:"Tell me what you want to do on this page. I will guide you step by step."}),H("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",marginBottom:"8px"},children:["Fill this form","Find contact info","What is this page?","Guide me to apply"].map(x=>H("button",{onClick:()=>ke(x),style:{padding:"3px 8px",borderRadius:"20px",fontSize:"10px",border:"1px solid #e2e8f0",background:"#f8fafc",color:"#64748b",cursor:"pointer"},children:x},x))}),Ee("div",{style:{display:"flex",gap:"6px",marginBottom:"8px"},children:[H("input",{type:"text",value:pe,onChange:x=>ke(x.target.value),onKeyDown:x=>{x.key==="Enter"&&cA()},placeholder:"e.g. Help me fill this form",disabled:De||!Qe,"aria-label":"Tell the agent what to do",style:{flex:1,padding:"8px 10px",borderRadius:"8px",border:"1px solid #e2e8f0",fontSize:"12px",color:"#0f172a",background:Qe?"#fff":"#f8fafc",outline:"none",height:"36px"}}),H("button",{onClick:cA,disabled:De||!pe.trim()||!Qe,"aria-label":"Run agent",style:{padding:"8px 12px",borderRadius:"8px",border:"none",background:Qe&&pe.trim()&&!De?"#10b981":"#e2e8f0",color:Qe&&pe.trim()&&!De?"#fff":"#94a3b8",fontSize:"12px",fontWeight:600,cursor:Qe&&pe.trim()&&!De?"pointer":"not-allowed",height:"36px",minWidth:"52px",transition:"background 0.2s"},children:De?"...":"Go"})]}),Me.length>0&&Ee("div",{style:{padding:"10px 12px",background:"#f0fdf4",border:"1px solid #86efac",borderRadius:"8px",fontSize:"11px",color:"#166534",lineHeight:1.7},children:[Me.map((x,U)=>H("p",{style:{margin:"0 0 2px"},children:x},U)),fe==="done"&&H("button",{onClick:()=>{Xe([]),ke(""),He("")},style:{display:"block",marginTop:"6px",background:"none",border:"none",color:"#94a3b8",fontSize:"10px",cursor:"pointer",padding:0},children:"Clear"})]}),!Qe&&H("p",{style:{margin:"4px 0 0",fontSize:"10px",color:"#94a3b8"},children:"Enable Gemini Nano via chrome://flags for best results."})]}),y&&p&&H("button",{"data-yuktai-ui":"true",style:nt(pt,ee?"#7c3aed":"#6d28d9",ee),"aria-label":"Ask a question about this page","aria-haspopup":"dialog","aria-expanded":ee,title:`\u{1F4AC} Ask this page \xB7 ${M}`,onClick:()=>{ie(x=>!x),d(!1),de(!1)},onMouseEnter:_e,onMouseLeave:it,children:"\u{1F4AC}"}),y&&p&&ee&&Ee("div",{role:"dialog","aria-modal":"true","aria-label":"Ask this page","data-yuktai-panel":"true",style:{position:"fixed",bottom:`${pt+64}px`,[e]:"24px",zIndex:9999,width:"300px",maxWidth:"calc(100vw - 48px)",background:"#fff",border:"1px solid #e2e8f0",borderRadius:"16px",boxShadow:"0 8px 32px rgba(0,0,0,0.12)",fontFamily:"system-ui,-apple-system,sans-serif",padding:"14px"},children:[Ee("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"10px"},children:[Ee("div",{children:[H("p",{style:{margin:"0 0 2px",fontSize:"13px",fontWeight:600,color:"#0f172a"},children:"\u{1F4AC} Ask this page"}),H("p",{style:{margin:0,fontSize:"10px",color:"#7c3aed"},children:M}),z==="transformers"&&ve==="loading"&&H("p",{style:{margin:"2px 0 0",fontSize:"9px",color:"#94a3b8"},children:"Downloading model \u2014 first time only"}),z==="transformers"&&ve==="ready"&&H("p",{style:{margin:"2px 0 0",fontSize:"9px",color:"#10b981"},children:"Model ready \u2705 \u2014 works offline"})]}),H("button",{onClick:()=>ie(!1),"aria-label":"Close ask panel",style:{background:"none",border:"none",cursor:"pointer",color:"#94a3b8",fontSize:"18px",lineHeight:1,padding:"2px"},children:"\xD7"})]}),Ee("div",{style:{display:"flex",gap:"6px",marginBottom:"8px"},children:[H("input",{type:"text",value:R,onChange:x=>oe(x.target.value),onKeyDown:x=>{x.key==="Enter"&&qt()},placeholder:"e.g. What does this page do?",disabled:X||!$,"aria-label":"Ask a question about this page",style:{flex:1,padding:"8px 10px",borderRadius:"8px",border:"1px solid #e2e8f0",fontSize:"12px",color:"#0f172a",background:$?"#fff":"#f8fafc",outline:"none",height:"36px"}}),H("button",{onClick:qt,disabled:X||!R.trim()||!$,"aria-label":"Submit question",style:{padding:"8px 12px",borderRadius:"8px",border:"none",background:$&&R.trim()&&!X?"#7c3aed":"#e2e8f0",color:$&&R.trim()&&!X?"#fff":"#94a3b8",fontSize:"12px",fontWeight:600,cursor:$&&R.trim()&&!X?"pointer":"not-allowed",height:"36px",minWidth:"48px",transition:"background 0.2s"},children:X?Z:"Ask"})]}),T&&Ee("div",{"aria-live":"polite",style:{padding:"10px",background:"#f5f3ff",borderRadius:"8px",fontSize:"12px",color:"#4c1d95",lineHeight:1.6,maxHeight:ft?"260px":"180px",overflowY:"auto",whiteSpace:"pre-line"},children:[H("strong",{style:{display:"block",marginBottom:"4px",fontSize:"11px",color:"#7c3aed"},children:"\u{1F4AC} Answer"}),T,lA.length>0&&Ee("div",{style:{marginTop:"8px"},children:[H("strong",{style:{display:"block",fontSize:"10px",color:"#6d28d9"},children:"From this page"}),H("ul",{style:{margin:"4px 0 0",paddingLeft:"16px",fontSize:"11px",color:"#5b21b6"},children:lA.map((x,U)=>H("li",{style:{marginBottom:"2px"},children:x},U))})]}),ht&&Ee("p",{style:{margin:"6px 0 0",fontSize:"10px",color:"#6d28d9"},children:["\u26A1 Found in ",wA(ht.ms)," \xB7 ",ht.engine==="rust"?"Rust":"TS"," \xB7 on device",ht.ai?" \xB7 answer written by AI":""]}),H("button",{onClick:()=>{Y(""),oe(""),mt([]),yt(null)},style:{display:"block",marginTop:"6px",background:"none",border:"none",color:"#94a3b8",fontSize:"10px",cursor:"pointer",padding:0},children:"Clear"})]}),!$&&H("p",{style:{margin:"4px 0 0",fontSize:"10px",color:"#94a3b8"},children:"Detecting AI engine..."})]}),C&&p&&H("button",{"data-yuktai-ui":"true",style:nt($e,P?"#0f766e":"#1a73e8",c),"aria-label":"Open accessibility preferences","aria-haspopup":"dialog","aria-expanded":c,"data-yuktai-pref-toggle":"true",title:"\u267F Accessibility settings",onClick:()=>{d(x=>!x),ie(!1),de(!1)},onMouseEnter:_e,onMouseLeave:it,children:"\u267F"}),C&&p&&c&&H(ro,{ref:J,position:e,settings:Q,report:S,isActive:P,aiSupported:D,voiceSupported:j,set:Uo,onApply:te,onReset:Yo,onClose:()=>d(!1)})]})}var YA={name:"ai.text",async execute(e){return`\u{1F916} YuktAI says: ${e}`}};var UA={name:"voice.text",async execute(e){return!e||e.trim()===""?"\u{1F3A4} No speech detected":`\u{1F3A4} You said: ${e}`}};var xt=class{plugins=new Map;register(t,A){if(!A||typeof A.execute!="function")throw new Error(`Invalid plugin: ${t}`);this.plugins.set(t,A)}use(t){return this.plugins.get(t)}async run(t,A){try{let o=this.use(t);if(!o)throw new Error(`Plugin not found: ${t}`);return await o.execute(A)}catch(o){throw console.error(`[YuktAI Runtime Error in ${t}]:`,o),o}}getPlugins(){return Array.from(this.plugins.keys())}};import{useCallback as No,useEffect as aA,useMemo as kt,useState as dt}from"react";import{useCallback as So,useEffect as rA,useMemo as Ci,useRef as pi,useState as ct}from"react";import{Fragment as Ll,jsx as N,jsxs as we}from"react/jsx-runtime";var fi={"en-US":{title:"Grid AI Assistant",subtitle:"Ask about your data",ask:"Ask",placeholder:"Ask or type a command...",listening:"Listening...",send:"Send",close:"Close",open:"Open AI assistant",inputLanguage:"Input language",speakNow:"Speak your question",working:"Working on it\u2026",english:"English",telugu:"\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41",searchStarted:e=>`Searching for "${e}".`,sortedAscending:e=>`Sorted by ${e} in ascending order.`,sortedDescending:e=>`Sorted by ${e} in descending order.`,count:e=>`There are ${e} rows in the grid.`,highest:(e,t,A)=>`The highest ${e} is ${t}, held by ${A}.`,lowest:(e,t,A)=>`The lowest ${e} is ${t}, held by ${A}.`,average:(e,t)=>`The average ${e} is ${t}.`,total:(e,t)=>`The total ${e} is ${t}.`,noData:"There is no data to analyze.",noColumn:"I could not find a column to analyze.",noNumericData:e=>`There is no numeric data in ${e}.`,notFound:e=>`I could not find anything matching "${e}".`,needName:"Please provide a value to look up.",fallback:"I can search, sort, count, and analyze the grid data.",unsupportedVoice:"Voice input is not supported in this browser."},"te-IN":{title:"\u0C17\u0C4D\u0C30\u0C3F\u0C21\u0C4D AI \u0C38\u0C39\u0C3E\u0C2F\u0C15\u0C41\u0C21\u0C41",subtitle:"\u0C2E\u0C40 \u0C21\u0C47\u0C1F\u0C3E \u0C17\u0C41\u0C30\u0C3F\u0C02\u0C1A\u0C3F \u0C05\u0C21\u0C17\u0C02\u0C21\u0C3F",ask:"\u0C05\u0C21\u0C17\u0C02\u0C21\u0C3F",placeholder:"\u0C2A\u0C4D\u0C30\u0C36\u0C4D\u0C28 \u0C32\u0C47\u0C26\u0C3E \u0C06\u0C26\u0C47\u0C36\u0C02 \u0C1F\u0C48\u0C2A\u0C4D \u0C1A\u0C47\u0C2F\u0C02\u0C21\u0C3F...",listening:"\u0C35\u0C3F\u0C02\u0C1F\u0C41\u0C28\u0C4D\u0C28\u0C3E\u0C28\u0C41...",send:"\u0C2A\u0C02\u0C2A\u0C02\u0C21\u0C3F",close:"\u0C2E\u0C42\u0C38\u0C3F\u0C35\u0C47\u0C2F\u0C02\u0C21\u0C3F",open:"AI \u0C38\u0C39\u0C3E\u0C2F\u0C15\u0C41\u0C21\u0C3F\u0C28\u0C3F \u0C24\u0C46\u0C30\u0C35\u0C02\u0C21\u0C3F",inputLanguage:"\u0C07\u0C28\u0C4D\u200C\u0C2A\u0C41\u0C1F\u0C4D \u0C2D\u0C3E\u0C37",speakNow:"\u0C2E\u0C40 \u0C2A\u0C4D\u0C30\u0C36\u0C4D\u0C28 \u0C1A\u0C46\u0C2A\u0C4D\u0C2A\u0C02\u0C21\u0C3F",working:"\u0C1A\u0C47\u0C38\u0C4D\u0C24\u0C41\u0C28\u0C4D\u0C28\u0C3E\u0C28\u0C41\u2026",english:"English",telugu:"\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41",searchStarted:e=>`\u201C${e}\u201D \u0C15\u0C4B\u0C38\u0C02 \u0C36\u0C4B\u0C27\u0C3F\u0C38\u0C4D\u0C24\u0C41\u0C28\u0C4D\u0C28\u0C3E\u0C28\u0C41.`,sortedAscending:e=>`${e}\u0C28\u0C41 \u0C06\u0C30\u0C4B\u0C39\u0C23 \u0C15\u0C4D\u0C30\u0C2E\u0C02\u0C32\u0C4B \u0C05\u0C2E\u0C30\u0C4D\u0C1A\u0C3E\u0C28\u0C41.`,sortedDescending:e=>`${e}\u0C28\u0C41 \u0C05\u0C35\u0C30\u0C4B\u0C39\u0C23 \u0C15\u0C4D\u0C30\u0C2E\u0C02\u0C32\u0C4B \u0C05\u0C2E\u0C30\u0C4D\u0C1A\u0C3E\u0C28\u0C41.`,count:e=>`\u0C17\u0C4D\u0C30\u0C3F\u0C21\u0C4D\u200C\u0C32\u0C4B \u0C2E\u0C4A\u0C24\u0C4D\u0C24\u0C02 ${e} \u0C35\u0C30\u0C41\u0C38\u0C32\u0C41 \u0C09\u0C28\u0C4D\u0C28\u0C3E\u0C2F\u0C3F.`,highest:(e,t,A)=>`\u0C05\u0C24\u0C4D\u0C2F\u0C27\u0C3F\u0C15 ${e} \u0C35\u0C3F\u0C32\u0C41\u0C35 ${t}. \u0C07\u0C26\u0C3F ${A}\u0C15\u0C41 \u0C38\u0C02\u0C2C\u0C02\u0C27\u0C3F\u0C02\u0C1A\u0C3F\u0C28\u0C26\u0C3F.`,lowest:(e,t,A)=>`\u0C05\u0C24\u0C4D\u0C2F\u0C32\u0C4D\u0C2A ${e} \u0C35\u0C3F\u0C32\u0C41\u0C35 ${t}. \u0C07\u0C26\u0C3F ${A}\u0C15\u0C41 \u0C38\u0C02\u0C2C\u0C02\u0C27\u0C3F\u0C02\u0C1A\u0C3F\u0C28\u0C26\u0C3F.`,average:(e,t)=>`${e} \u0C38\u0C17\u0C1F\u0C41 \u0C35\u0C3F\u0C32\u0C41\u0C35 ${t}.`,total:(e,t)=>`${e} \u0C2E\u0C4A\u0C24\u0C4D\u0C24\u0C02 \u0C35\u0C3F\u0C32\u0C41\u0C35 ${t}.`,noData:"\u0C35\u0C3F\u0C36\u0C4D\u0C32\u0C47\u0C37\u0C3F\u0C02\u0C1A\u0C21\u0C3E\u0C28\u0C3F\u0C15\u0C3F \u0C21\u0C47\u0C1F\u0C3E \u0C32\u0C47\u0C26\u0C41.",noColumn:"\u0C35\u0C3F\u0C36\u0C4D\u0C32\u0C47\u0C37\u0C3F\u0C02\u0C1A\u0C21\u0C3E\u0C28\u0C3F\u0C15\u0C3F \u0C24\u0C17\u0C3F\u0C28 \u0C15\u0C3E\u0C32\u0C2E\u0C4D \u0C15\u0C28\u0C2C\u0C21\u0C32\u0C47\u0C26\u0C41.",noNumericData:e=>`${e}\u0C32\u0C4B \u0C38\u0C02\u0C16\u0C4D\u0C2F\u0C3E \u0C38\u0C2E\u0C3E\u0C1A\u0C3E\u0C30\u0C02 \u0C32\u0C47\u0C26\u0C41.`,notFound:e=>`\u201C${e}\u201D\u0C15\u0C41 \u0C38\u0C30\u0C3F\u0C2A\u0C4B\u0C32\u0C47 \u0C38\u0C2E\u0C3E\u0C1A\u0C3E\u0C30\u0C02 \u0C15\u0C28\u0C2C\u0C21\u0C32\u0C47\u0C26\u0C41.`,needName:"\u0C36\u0C4B\u0C27\u0C3F\u0C02\u0C1A\u0C21\u0C3E\u0C28\u0C3F\u0C15\u0C3F \u0C12\u0C15 \u0C35\u0C3F\u0C32\u0C41\u0C35 \u0C07\u0C35\u0C4D\u0C35\u0C02\u0C21\u0C3F.",fallback:"\u0C17\u0C4D\u0C30\u0C3F\u0C21\u0C4D\u200C\u0C32\u0C4B \u0C36\u0C4B\u0C27\u0C28, \u0C15\u0C4D\u0C30\u0C2E\u0C2C\u0C26\u0C4D\u0C27\u0C40\u0C15\u0C30\u0C23, \u0C32\u0C46\u0C15\u0C4D\u0C15\u0C3F\u0C02\u0C2A\u0C41 \u0C2E\u0C30\u0C3F\u0C2F\u0C41 \u0C21\u0C47\u0C1F\u0C3E \u0C35\u0C3F\u0C36\u0C4D\u0C32\u0C47\u0C37\u0C23 \u0C1A\u0C47\u0C2F\u0C17\u0C32\u0C28\u0C41.",unsupportedVoice:"\u0C08 \u0C2C\u0C4D\u0C30\u0C4C\u0C1C\u0C30\u0C4D\u200C\u0C32\u0C4B \u0C35\u0C3E\u0C2F\u0C3F\u0C38\u0C4D \u0C07\u0C28\u0C4D\u200C\u0C2A\u0C41\u0C1F\u0C4D\u200C\u0C15\u0C41 \u0C2E\u0C26\u0C4D\u0C26\u0C24\u0C41 \u0C32\u0C47\u0C26\u0C41."}};function Ke(e){return e.toLowerCase().trim().replace(/\s+/g," ")}function Dl(e,t){let A=Ke(e);if(t==="te-IN")return/^(శోధించు|శోధించండి|వెతుకు|వెతకండి|చూపించు|చూపించండి|ఫిల్టర్)/.test(A)?{type:"search",payload:A.replace(/^(శోధించు|శోధించండి|వెతుకు|వెతకండి|చూపించు|చూపించండి|ఫిల్టర్)\s*/u,"").trim()||e}:/క్రమబద్ధీకర|అమర్చ|సార్ట్/.test(A)?{type:"sort",payload:{key:void 0,dir:/అవరోహణ|పెద్ద|అధిక|చివర/.test(A)?"desc":"asc"}}:/ఎన్ని|ఎంతమంది|లెక్క|మొత్తం వరుస|వరుసలు/.test(A)?{type:"question",payload:e}:/అత్యధిక|గరిష్ఠ|పెద్ద|ఎక్కువ/.test(A)?{type:"question",payload:e}:/అత్యల్ప|కనిష్ఠ|చిన్న|తక్కువ/.test(A)?{type:"question",payload:e}:/సగటు|సగటు విలువ/.test(A)?{type:"question",payload:e}:/మొత్తం|కలిపి/.test(A)?{type:"question",payload:e}:{type:"search",payload:e};if(/^(search|find|show|filter)/.test(A))return{type:"search",payload:A.replace(/^(search|find|show|filter)\s+(for\s+|by\s+)?/,"").trim()||e};if(/sort/.test(A)){let o=/desc|descending|high|higher|large|largest|top/.test(A);return{type:"sort",payload:{key:A.match(/(?:by|on)\s+([a-z0-9_-]+)/)?.[1],dir:o?"desc":"asc"}}}return/how many|count|highest|maximum|max|top|largest|lowest|minimum|min|smallest|bottom|average|avg|mean|sum|total|who|which|where|whose/.test(A)?{type:"question",payload:e}:{type:"search",payload:e}}function mi(e,t){let A=Ke(e);return t.find(o=>{let n=Ke(o.key),r=Ke(o.label);return A.includes(n)||A.includes(r)})}function JA(e,t){return e.toLocaleString(t==="te-IN"?"te-IN":"en-IN")}function Sl(e,t,A,o){let n=fi[o];if(t.length===0)return n.noData;let r=Ke(e),i=A.filter(m=>m.type==="number"),s=mi(e,A),g=s?.type==="number"?s:i[0],a=/how many|count|rows|ఎన్ని|ఎంతమంది|లెక్క|వరుసలు/.test(r);if(a)return n.count(t.length);if(/highest|maximum|max|top|largest|అత్యధిక|గరిష్ఠ|పెద్ద|ఎక్కువ/.test(r)){let m=s??g;if(!m)return n.noColumn;let p=t.map(b=>({row:b,value:Number(b[m.key])})).filter(b=>!Number.isNaN(b.value)).sort((b,S)=>S.value-b.value);if(p.length===0)return n.noNumericData(m.label);let c=p[0],d=A.find(b=>b.key==="name"||Ke(b.label)==="name"),Q=d?String(c.row[d.key]??""):o==="te-IN"?"\u0C08 \u0C35\u0C30\u0C41\u0C38":"this row";return n.highest(m.label,JA(c.value,o),Q)}if(/lowest|minimum|min|smallest|bottom|అత్యల్ప|కనిష్ఠ|చిన్న|తక్కువ/.test(r)){let m=s??g;if(!m)return n.noColumn;let p=t.map(b=>({row:b,value:Number(b[m.key])})).filter(b=>!Number.isNaN(b.value)).sort((b,S)=>b.value-S.value);if(p.length===0)return n.noNumericData(m.label);let c=p[0],d=A.find(b=>b.key==="name"||Ke(b.label)==="name"),Q=d?String(c.row[d.key]??""):o==="te-IN"?"\u0C08 \u0C35\u0C30\u0C41\u0C38":"this row";return n.lowest(m.label,JA(c.value,o),Q)}if(/average|avg|mean|సగటు/.test(r)){let m=s??g;if(!m)return n.noColumn;let p=t.map(d=>Number(d[m.key])).filter(d=>!Number.isNaN(d));if(p.length===0)return n.noNumericData(m.label);let c=p.reduce((d,Q)=>d+Q,0)/p.length;return n.average(m.label,JA(Math.round(c*100)/100,o))}if(/sum|total|మొత్తం|కలిపి/.test(r)&&!a){let m=s??g;if(!m)return n.noColumn;let p=t.map(d=>Number(d[m.key])).filter(d=>!Number.isNaN(d));if(p.length===0)return n.noNumericData(m.label);let c=p.reduce((d,Q)=>d+Q,0);return n.total(m.label,JA(c,o))}let h=r.match(/[\p{L}\p{N}_-]+/gu)??[],y=new Set(["who","what","which","where","whose","is","the","has","have","show","find","search","for","by","about"]),B=h.filter(m=>!y.has(m)).join(" ").trim();if(B){let m=t.find(p=>Object.values(p).some(c=>String(c??"").toLowerCase().includes(B.toLowerCase())));return m?A.map(p=>`${p.label}: ${String(m[p.key]??"")}`).join(o==="te-IN"?" \xB7 ":", "):n.notFound(B)}return n.fallback}function Gl(e,t){if(typeof window>"u"||!window.speechSynthesis)return;window.speechSynthesis.cancel();let A=new SpeechSynthesisUtterance(e);A.lang=t,A.rate=1,A.pitch=1,window.speechSynthesis.speak(A)}function vl(e){let[t,A]=ct(!1),[o,n]=ct(""),[r,i]=ct(!0),s=pi(null);rA(()=>{if(typeof window>"u")return;let l=window.SpeechRecognition||window.webkitSpeechRecognition;if(!l){i(!1),s.current=null;return}let I=new l;return I.continuous=!1,I.interimResults=!1,I.lang=e,I.onresult=u=>{let C=u?.results?.[0]?.[0]?.transcript??"";n(C),A(!1)},I.onerror=()=>{A(!1)},I.onend=()=>{A(!1)},s.current=I,()=>{try{I.stop()}catch{}s.current=null}},[e]);let g=So(()=>{if(s.current){n(""),A(!0);try{s.current.start()}catch{A(!1)}}},[]),a=So(()=>{try{s.current?.stop()}catch{}A(!1)},[]);return{listening:t,transcript:o,supported:r,start:g,stop:a}}function Rl(){return we("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[N("circle",{cx:"11",cy:"11",r:"6.5"}),N("path",{d:"m16 16 5 5"})]})}function Nl(){return we("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[N("rect",{x:"8",y:"3",width:"8",height:"12",rx:"4"}),N("path",{d:"M5 11a7 7 0 0 0 14 0"}),N("path",{d:"M12 18v3"}),N("path",{d:"M8 21h8"})]})}function Fl(){return we("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[N("path",{d:"m4 4 16 8-16 8 4-8-4-8Z"}),N("path",{d:"M8 12h12"})]})}function Tl(){return we("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[N("path",{d:"m6 6 12 12"}),N("path",{d:"m18 6-12 12"})]})}function Ml({data:e,columns:t,onSearch:A,onSort:o,theme:n="light",language:r="en-US",inputLanguage:i="en-US",embedded:s=!1,agent:g,onInputLanguageChange:a}){let l=fi[r],[I,u]=ct(i);rA(()=>{u(i)},[i]);let[C,h]=ct(!1),y=n==="dark",[f,B]=ct(s),[m,p]=ct(""),[c,d]=ct([]),Q=pi(null),{listening:b,transcript:S,supported:F,start:P,stop:G}=vl(I),D=Ci(()=>({bg:y?"#0F172A":"#FFFFFF",surface:y?"#1E293B":"#F8FAFC",border:y?"#334155":"#E2E8F0",text:y?"#F1F5F9":"#0F172A",muted:y?"#94A3B8":"#64748B",accent:"#10B981",userMsg:y?"#334155":"#DBEAFE",aiMsg:y?"#1E293B":"#F0FDF4"}),[y]),E=Ci(()=>({role:"ai",text:r==="te-IN"?"\u0C2E\u0C40 \u0C17\u0C4D\u0C30\u0C3F\u0C21\u0C4D \u0C21\u0C47\u0C1F\u0C3E \u0C17\u0C41\u0C30\u0C3F\u0C02\u0C1A\u0C3F \u0C2A\u0C4D\u0C30\u0C36\u0C4D\u0C28 \u0C05\u0C21\u0C17\u0C02\u0C21\u0C3F.":"Ask me about your grid data.",time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),[r]);rA(()=>{d(R=>R.length>0?R:[E])},[E]),rA(()=>{Q.current?.scrollIntoView({behavior:"smooth"})},[c]);let j=()=>new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),Ae=So(async R=>{let oe=R.trim();if(!oe)return;d(Y=>[...Y,{role:"user",text:oe,time:j()}]),p("");let T="";if(g){h(!0);try{T=(await g.ask(oe)).message}catch{T=l.fallback}finally{h(!1)}}else{let Y=Dl(oe,r);if(Y.type==="question")T=Sl(Y.payload??oe,e,t,r);else if(Y.type==="search"){let X=String(Y.payload??oe);A?.(X),T=l.searchStarted(X)}else if(Y.type==="sort"){let X=Y.payload?.key,q=X?t.find(z=>Ke(z.key)===Ke(X)||Ke(z.label)===Ke(X)):void 0;if(q||(q=mi(oe,t)),q&&o){let z=Y.payload?.dir==="desc"?"desc":"asc";o(String(q.key),z),T=z==="asc"?l.sortedAscending(q.label):l.sortedDescending(q.label)}else T=l.noColumn}}T||(T=l.fallback),d(Y=>[...Y,{role:"ai",text:T,time:j()}]),Gl(T,r)},[g,t,e,r,A,o,l]);rA(()=>{S&&Ae(S)},[S,Ae]);let J=()=>{Ae(m)},ee=r==="te-IN"?["\u0C0E\u0C28\u0C4D\u0C28\u0C3F \u0C35\u0C30\u0C41\u0C38\u0C32\u0C41","\u0C36\u0C4B\u0C27\u0C3F\u0C02\u0C1A\u0C02\u0C21\u0C3F","\u0C15\u0C4D\u0C30\u0C2E\u0C02"]:["how many rows","search","sort"],ie=we("div",{style:{width:s?"100%":360,maxWidth:s?"100%":"calc(100vw - 48px)",height:s?390:480,maxHeight:"70vh",background:D.bg,border:`1px solid ${D.border}`,borderRadius:s?12:16,boxShadow:s?"none":"0 20px 40px rgba(0,0,0,0.15)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[we("div",{style:{padding:"12px 14px",background:D.accent,color:"#FFFFFF",display:"flex",alignItems:"center",gap:10},children:[N("div",{style:{width:34,height:34,borderRadius:10,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.18)",fontSize:17},children:"AI"}),we("div",{style:{flex:1,minWidth:0},children:[N("div",{style:{fontWeight:700,fontSize:14},children:l.title}),N("div",{style:{fontSize:11,opacity:.9},children:l.subtitle})]}),!s&&N("button",{type:"button",onClick:()=>B(!1),"aria-label":l.close,title:l.close,style:{width:32,height:32,border:"none",borderRadius:8,background:"rgba(255,255,255,0.12)",color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:N(Tl,{})})]}),we("div",{style:{padding:"8px 10px",borderBottom:`1px solid ${D.border}`,display:"flex",alignItems:"center",gap:8,background:D.surface},children:[N("span",{style:{fontSize:11,color:D.muted},children:l.inputLanguage}),we("select",{value:I,onChange:R=>{let oe=R.target.value;u(oe),a?.(oe)},disabled:b,"aria-label":l.inputLanguage,style:{padding:"5px 8px",borderRadius:7,border:`1px solid ${D.border}`,background:D.bg,color:D.text,fontSize:11},children:[N("option",{value:"en-US",children:"English (US)"}),N("option",{value:"en-IN",children:"English (India)"}),N("option",{value:"as-IN",children:"Assamese"}),N("option",{value:"bn-IN",children:"Bengali"}),N("option",{value:"brx-IN",children:"Bodo"}),N("option",{value:"doi-IN",children:"Dogri"}),N("option",{value:"gu-IN",children:"Gujarati"}),N("option",{value:"hi-IN",children:"Hindi"}),N("option",{value:"kn-IN",children:"Kannada"}),N("option",{value:"ks-IN",children:"Kashmiri"}),N("option",{value:"kok-IN",children:"Konkani"}),N("option",{value:"mai-IN",children:"Maithili"}),N("option",{value:"ml-IN",children:"Malayalam"}),N("option",{value:"mni-IN",children:"Manipuri"}),N("option",{value:"mr-IN",children:"Marathi"}),N("option",{value:"ne-IN",children:"Nepali"}),N("option",{value:"or-IN",children:"Odia"}),N("option",{value:"pa-IN",children:"Punjabi"}),N("option",{value:"sa-IN",children:"Sanskrit"}),N("option",{value:"sat-IN",children:"Santali"}),N("option",{value:"sd-IN",children:"Sindhi"}),N("option",{value:"ta-IN",children:"Tamil"}),N("option",{value:"te-IN",children:"Telugu"}),N("option",{value:"ur-IN",children:"Urdu"})]})]}),we("div",{style:{flex:1,overflowY:"auto",padding:10,display:"flex",flexDirection:"column",gap:8},children:[c.map((R,oe)=>we("div",{style:{alignSelf:R.role==="user"?"flex-end":"flex-start",maxWidth:"88%",padding:"8px 11px",borderRadius:11,background:R.role==="user"?D.userMsg:D.aiMsg,color:D.text,fontSize:13,lineHeight:1.5},children:[N("div",{children:R.text}),N("div",{style:{marginTop:3,fontSize:10,opacity:.55,textAlign:"right"},children:R.time})]},`${R.time}-${oe}`)),b&&N("div",{style:{alignSelf:"flex-end",padding:"8px 11px",borderRadius:11,background:y?"#3F1D2E":"#FEE2E2",color:y?"#FCA5A5":"#991B1B",fontSize:13},children:l.listening}),(C||g?.loading)&&N("div",{role:"status","aria-live":"polite",style:{alignSelf:"flex-start",padding:"8px 11px",borderRadius:11,background:D.aiMsg,color:D.muted,fontSize:13},children:l.working}),N("div",{ref:Q})]}),N("div",{style:{padding:"7px 10px",borderTop:`1px solid ${D.border}`,display:"flex",gap:6,overflowX:"auto",flexShrink:0},children:ee.map(R=>N("button",{type:"button",onClick:()=>Ae(R),style:{padding:"5px 9px",borderRadius:12,border:`1px solid ${D.border}`,background:D.surface,color:D.text,fontSize:10.5,cursor:"pointer",whiteSpace:"nowrap"},children:R},R))}),we("div",{style:{padding:9,display:"flex",gap:6,borderTop:`1px solid ${D.border}`,background:D.surface},children:[we("div",{style:{position:"relative",flex:1},children:[N(Rl,{}),N("input",{type:"text",value:m,onChange:R=>p(R.target.value),onKeyDown:R=>{R.key==="Enter"&&J()},placeholder:l.placeholder,"aria-label":l.ask,style:{width:"100%",boxSizing:"border-box",padding:"9px 10px 9px 34px",borderRadius:8,border:`1px solid ${D.border}`,background:D.bg,color:D.text,fontSize:12,outline:"none"}})]}),F?N("button",{type:"button",onClick:b?G:P,"aria-label":b?l.listening:l.speakNow,title:b?l.listening:l.speakNow,style:{width:38,height:38,border:"none",borderRadius:8,background:b?"#EF4444":D.accent,color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",flexShrink:0},children:N(Nl,{})}):null,N("button",{type:"button",onClick:J,disabled:!m.trim(),"aria-label":l.send,title:l.send,style:{width:38,height:38,border:"none",borderRadius:8,background:m.trim()?D.accent:D.muted,color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",cursor:m.trim()?"pointer":"not-allowed",opacity:m.trim()?1:.6,flexShrink:0},children:N(Fl,{})})]})]});return s?N("div",{style:{width:"100%",minWidth:0},children:f?ie:we("button",{type:"button",onClick:()=>B(!0),"aria-label":l.open,style:{minHeight:40,padding:"8px 13px",borderRadius:9,border:"1px solid #10B981",background:y?"#064E3B":"#ECFDF5",color:y?"#A7F3D0":"#047857",display:"inline-flex",alignItems:"center",gap:8,cursor:"pointer",fontSize:12,fontWeight:600},children:[N("span",{"aria-hidden":"true",children:"AI"}),l.ask]})}):we(Ll,{children:[!f&&N("button",{type:"button",onClick:()=>B(!0),"aria-label":l.open,title:l.title,style:{position:"fixed",bottom:24,right:24,zIndex:9998,width:56,height:56,borderRadius:28,background:D.accent,color:"#FFFFFF",border:"none",cursor:"pointer",boxShadow:"0 8px 20px rgba(16,185,129,0.3)",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,fontSize:14},children:"AI"}),f&&N("div",{style:{position:"fixed",bottom:90,right:24,zIndex:9997},children:ie}),N("style",{children:`
|
|
390
|
+
`):"There are no forms on this page.",targets:n.flatMap(r=>r.findings.map(i=>i.selector).filter(i=>!!i)),suggestions:n.flatMap(r=>r.findings.slice(0,3).map(i=>i.suggestion))}}case"links":case"counts":{let n=A.counts;return{intent:o,answer:`${n.links} links, ${n.buttons} buttons, ${n.fields} form fields in ${n.forms} form(s), ${n.images} images, ${n.tables} tables.`,targets:[],suggestions:[]}}case"purpose":case"unknown":{let n=A.purpose;if(t.summarize)try{let i=Ne(t.root),s=rt((i&&Bt(i)?i.body:i)?.textContent).slice(0,4e3);n=await t.summarize(s)||n}catch{}let r=[];return A.unlabeledFields.length&&r.push(`${A.unlabeledFields.length} form field(s) need labels.`),A.imagesWithoutAlt.length&&r.push(`${A.imagesWithoutAlt.length} image(s) need alt text.`),{intent:o,answer:n,targets:[],suggestions:r}}}}var oi="highlight|mark|flag|sort|order|rank|arrange|summari[sz]e|summary|recap|count|how many|open|select|pick|show|filter|find|list|clear|reset|remove|detect|spot|tell";function bo(e){return e.replace(/[?!]/g," ").split(/\s*(?:;|\.(?!\d)\s*|,?\s*\band then\b|,?\s*\bthen\b|,?\s*\bafter that\b|,?\s*\bfinally\b|,?\s*\bnext\b|ఆ తర్వాత)\s*/i).flatMap(o=>o.split(new RegExp(`\\s*(?:,|\\band\\b)\\s+(?=(?:${oi})\\b)`,"i"))).map(o=>o.trim()).filter(o=>o.length>1).map(o=>({action:cl(o),text:o}))}function cl(e){let t=e.toLowerCase();return/^(clear|reset|remove)\b/.test(t)?"clear":/unusual|anomal|outlier|suspicious|odd ones|duplicate/.test(t)?"anomalies":/summari[sz]e|summary|what changed|recap|overview/.test(t)?"summarize":/^(highlight|mark|flag)\b/.test(t)?"highlight":/^(sort|order|rank|arrange)\b/.test(t)?"sort":/^(count|how many)\b/.test(t)?"count":/^(open|go to)\b/.test(t)&&!/filtered|results?/.test(t)?"open":/^(select|pick)\b/.test(t)?"select":"filter"}function ul(e){return e.replace(new RegExp(`^\\s*(?:${oi}|open|go to)\\b`,"i")," ").replace(/\b(the|filtered|results?|rows?|records?|entries|items?|ones|them|those|only|me|all)\b/gi," ").replace(/\s+/g," ").trim()}function ti(e,t){let A=t.find(r=>r.key===e.key)?.label??e.key,o=Array.isArray(e.value)?`${e.value[0]}\u2013${e.value[1]}`:typeof e.value=="number"?e.value.toLocaleString("en-IN",{maximumFractionDigits:2}):`"${e.value}"`,n={contains:"contains",equals:"is",startsWith:"starts with",endsWith:"ends with",greaterThan:">",lessThan:"<",between:"between"}[e.operator];return`${A} ${n} ${o}`}async function ni(e,t,A={}){let o=bo(e),{columns:n,data:r}=t,i=[...t.filters??[]],s=[],g=null,a=[],l=()=>gt(r,n,{filters:i,search:s,sort:g,limit:null,notes:[],explanation:""}),I={rows:l().length,filters:[...i]},u=[],C=()=>({...t,filters:i});for(let y=0;y<o.length;y++){let f=o[y],B=ul(f.text),m;try{switch(f.action){case"clear":{i=[],s=[],g=null,a=[],t.onFiltersChange?.([]),t.onSortChange?.(null),t.onHighlightRows?.([]),m={...f,success:!0,message:`Cleared filters, sorting and highlights. ${r.length} row(s) shown.`};break}case"filter":{let p=Ut(B,n,{data:r});if(!p.filters.length&&!p.search.length&&!p.sort){m={...f,success:!0,message:`Showing ${l().length} row(s) with the current filters.`};break}for(let Q of p.filters)i=[...i.filter(b=>b.key!==Q.key),Q];s=[...s,...p.search],p.sort&&(g=p.sort,t.onSortChange?.(g)),t.onFiltersChange?.(i);let c=l(),d=c.map(Q=>he(Q,t.rowKey)).filter(Boolean);p.search.length&&d.length&&(a=d,t.onHighlightRows?.(d)),m={...f,success:!0,message:`${c.length} row(s) now shown. ${p.explanation}`,ids:d};break}case"highlight":{let p=l(),c=Ut(B,n,{data:p}),Q=(c.filters.length||c.search.length?gt(p,n,{...c,sort:null,limit:c.limit}):p).map(S=>he(S,t.rowKey)).filter(Boolean);if(!Q.length){m={...f,success:!1,message:`Nothing to highlight for "${B||"all rows"}".`};break}let b=AA(C(),Q);b.success&&(a=b.data??Q),m={...f,success:b.success,message:b.success?`Highlighted ${a.length} row(s)${B?` matching "${B}"`:""}.`:b.message,ids:a};break}case"sort":{let c=Ut(f.text,n,{data:r}).sort;if(!c){let Q=Pe(B,n);Q&&(c={key:Q.key,direction:/desc|high|large|big|most|newest|latest|z.?to.?a/i.test(f.text)?"desc":"asc"})}if(!c){m={...f,success:!1,message:`Which column should I sort by? Columns: ${n.map(Q=>Q.label).join(", ")}.`};break}g=c,t.onSortChange?.(g);let d=n.find(Q=>Q.key===g.key)?.label??g.key;m={...f,success:!0,message:`Sorted by ${d} (${g.direction==="desc"?"high \u2192 low":"low \u2192 high"}).`};break}case"count":{m={...f,success:!0,message:`${l().length} row(s) shown${a.length?`, ${a.length} highlighted`:""}.`};break}case"anomalies":{let p=l(),c=ho(p,n,{rowKey:t.rowKey}),d=Array.from(new Set(c.map(Q=>Q.rowId)));if(d.length){let Q=AA(C(),d);Q.success&&(a=Q.data??d)}m={...f,success:!0,message:c.length?`${d.length} unusual row(s): ${c.slice(0,5).map(Q=>Q.reason).join(" ")}`:"Nothing unusual in the shown rows.",ids:d};break}case"open":case"select":{let p=l(),d=p.find(S=>B&&he(S,t.rowKey).toLowerCase()===B.toLowerCase())??gt(p,n,Ut(B,n,{data:p}))[0]??(B?void 0:p[0]);if(!d){m={...f,success:!1,message:`No row matches "${B}".`};break}let Q=he(d,t.rowKey),b=f.action==="open"?vA(C(),Q):GA(C(),Q);m={...f,success:b.success,message:b.message,ids:[Q]};break}case"summarize":{let p=l();m={...f,success:!0,message:`${Ai(I,p.length,i,g,a,n)}
|
|
391
|
+
${yo(p,n)}`};break}}}catch(p){m={...f,success:!1,message:`This step failed: ${p instanceof Error?p.message:String(p)}`}}u.push(m),A.onStep?.(m,y,o.length)}let h=l().length;return{steps:u,before:I,after:{rows:h,filters:i,sort:g,highlighted:a},summary:Ai(I,h,i,g,a,n)}}function Ai(e,t,A,o,n,r){let i=[`Rows: ${e.rows} \u2192 ${t}.`],s=A.filter(a=>!e.filters.some(l=>JSON.stringify(l)===JSON.stringify(a))),g=e.filters.filter(a=>!A.some(l=>JSON.stringify(a)===JSON.stringify(l)));return s.length&&i.push(`Filters added: ${s.map(a=>ti(a,r)).join("; ")}.`),g.length&&i.push(`Filters removed: ${g.map(a=>ti(a,r)).join("; ")}.`),o&&i.push(`Sorted by ${r.find(a=>a.key===o.key)?.label??o.key} ${o.direction==="desc"?"high \u2192 low":"low \u2192 high"}.`),n.length&&i.push(`${n.length} row(s) highlighted.`),i.join(" ")}var dl=/\b(off|disable|stop|remove|no more|turn off|switch off|deactivate)\b|ఆఫ్|ఆపు|తీసివేయి|बंद/i,Il=[{pattern:/high contrast|contrast|హై కాంట్రాస్ట్|కాంట్రాస్ట్/i,key:"highContrast",name:"High contrast"},{pattern:/dark mode|dark theme|night mode|డార్క్ మోడ్|చీకటి/i,key:"darkMode",name:"Dark mode"},{pattern:/reduce motion|less motion|stop animation|animations?|కదలికలు/i,key:"reduceMotion",name:"Reduced motion"},{pattern:/large targets?|bigger buttons?|big buttons?|larger buttons?|పెద్ద బటన్/i,key:"largeTargets",name:"Large targets"},{pattern:/dyslexia|readable font|easy font/i,key:"dyslexiaFont",name:"Dyslexia-friendly font"},{pattern:/speak on focus|read aloud|read out|screen reader|speech|చదివి వినిపించు/i,key:"speechEnabled",name:"Speak on focus"},{pattern:/skip links?/i,key:"showSkipLinks",name:"Skip links"}],Cl=[[/deuteranop|green.?blind/i,"deuteranopia"],[/protanop|red.?blind/i,"protanopia"],[/tritanop|blue.?blind/i,"tritanopia"],[/grey ?scale|gray ?scale|achromat|black and white/i,"achromatopsia"]],ii=.1,pl=.8,fl=1.3;function ml(e,t={}){let A=e.trim().toLowerCase();if(!A)return null;if(/\b(next|down)\s+(row|line|record|item)\b|తర్వాతి (వరుస|అంశం)/.test(A))return{type:"grid",action:"next-row",say:"Next row."};if(/\b(previous|prev|back|up)\s+(row|line|record|item)\b|ముందరి (వరుస|అంశం)|వెనుక (వరుస|అంశం)/.test(A))return{type:"grid",action:"previous-row",say:"Previous row."};if(/\bfirst\s+(row|record|item)\b|మొదటి (వరుస|అంశం)/.test(A))return{type:"grid",action:"first-row",say:"First row."};if(/\blast\s+(row|record|item)\b|చివరి (వరుస|అంశం)/.test(A))return{type:"grid",action:"last-row",say:"Last row."};if(/\b(open|expand|read)\s+(this\s+)?(row|record|item)\b|ఈ (వరుస|అంశం) తెరువు/.test(A))return{type:"grid",action:"open-row",say:"Opening row."};if(/\b(reset|default|restore)\b.*\b(settings?|accessibility|everything|all)\b|^reset$|రీసెట్/.test(A))return{type:"reset",say:"Accessibility settings reset."};let o=t.fontSizeMultiplier??1,n=i=>Math.round(Math.min(fl,Math.max(pl,i))*100)/100;if(/\b(bigger|larger|increase|zoom in)\b.*\b(text|font|letters?)\b|\b(text|font)\b.*\b(bigger|larger|up)\b|పెద్ద అక్షరాలు|అక్షరాలు పెద్ద/.test(A)){let i=n(o+ii);return{type:"setting",patch:{fontSizeMultiplier:i},say:`Text size ${Math.round(i*100)}%.`}}if(/\b(smaller|decrease|reduce|zoom out)\b.*\b(text|font|letters?)\b|\b(text|font)\b.*\b(smaller|down)\b|చిన్న అక్షరాలు|అక్షరాలు చిన్న/.test(A)){let i=n(o-ii);return{type:"setting",patch:{fontSizeMultiplier:i},say:`Text size ${Math.round(i*100)}%.`}}if(/\b(normal|default|reset)\b.*\b(text|font)\s*(size)?\b/.test(A))return{type:"setting",patch:{fontSizeMultiplier:1},say:"Text size 100%."};let r=dl.test(A);for(let[i,s]of Cl)if(i.test(A))return r?{type:"setting",patch:{colorBlindMode:"none"},say:"Colour filter off."}:{type:"setting",patch:{colorBlindMode:s},say:`${s} filter on.`};if(/colou?r.?blind/.test(A)&&r)return{type:"setting",patch:{colorBlindMode:"none"},say:"Colour filter off."};for(let i of Il){if(!i.pattern.test(A))continue;let s=/\btoggle\b/.test(A)?!t[i.key]:!r;return i.key==="reduceMotion"&&!/reduce motion|less motion|కదలికలు తగ్గించు/.test(A)&&/animations?/.test(A)&&(s=r||/\bno\b/.test(A)),{type:"setting",patch:{[i.key]:s},say:`${i.name} ${s?"on":"off"}.`}}return null}var ri={highContrast:!1,darkMode:!1,reduceMotion:!1,largeTargets:!1,dyslexiaFont:!1,speechEnabled:!1,colorBlindMode:"none",fontSizeMultiplier:1};function hl(e,t={}){if(!tt())return null;let A=t.root??document,o=t.rowSelector??"[data-yuktai-row-id], [role='row']",n=Array.from(A.querySelectorAll(o)).filter(a=>!a.querySelector("th,[role='columnheader']"));if(!n.length)return null;let r=document.activeElement?.closest(o),i=r?n.indexOf(r):-1;if(e==="open-row"){let a=i>=0?n[i]:n[0];return a.click(),a}let s=e==="first-row"?0:e==="last-row"?n.length-1:e==="next-row"?Math.min(n.length-1,i+1):Math.max(0,i-1),g=n[s];return g.hasAttribute("tabindex")||g.setAttribute("tabindex","-1"),g.focus(),g.scrollIntoView?.({block:"nearest"}),g}function si(e={}){let t={enabled:!0,...ri,...e.initial},A=null,o=!1,n=async a=>e.apply?e.apply(a):Ge.execute(a),r=a=>{if(e.speak===!1||!tt()||!("speechSynthesis"in window))return;let l=new SpeechSynthesisUtterance(a);l.lang=e.lang??"en-IN",window.speechSynthesis.cancel(),window.speechSynthesis.speak(l)};async function i(a){let l=ml(a,t);if(e.onTranscript?.(a,l),!l)return null;if(l.type==="grid"){let I=hl(l.action,{root:e.gridRoot});return r(I?l.say:"No table rows found."),l}return t=l.type==="reset"?{...t,...ri}:{...t,...l.patch},await n(t),r(l.say),l}function s(){if(!tt()||o)return o;let a=window,l=a.SpeechRecognition??a.webkitSpeechRecognition;return l?(A=new l,A.lang=e.lang??"en-IN",A.continuous=!0,A.interimResults=!1,A.onresult=I=>{let u=I.results,C=u[u.length-1];C?.[0]?.transcript&&i(C[0].transcript)},A.onend=()=>{o&&A?.start()},A.onerror=I=>{(I.error==="not-allowed"||I.error==="service-not-allowed")&&(o=!1)},o=!0,A.start(),!0):!1}function g(){o=!1,A?.stop(),A=null}return{start:s,stop:g,handle:i,isListening:()=>o,getConfig:()=>({...t})}}import{Fragment as gi,jsx as v,jsxs as se}from"react/jsx-runtime";var yl=/\b(trend|over time|this (week|month|quarter|year)|last (week|month|quarter|year)|compare|versus|vs)\b|\b(by|per|each|which)\b.*\b(total|average|avg|sum|drop|increase|growth|highest|lowest|most|least)\b|\b(total|average|avg|sum)\b.*\b(by|per|each)\b/i;function Ad(e){let{data:t,rowKey:A="id"}=e,o=wo(()=>wt(e.columns),[e.columns]),[n,r]=ue([]),[i,s]=ue(null),[g,a]=ue([]),[l,I]=ue(""),[u,C]=ue(null),[h,y]=ue([]),[f,B]=ue([]),[m,p]=ue(!1),c=iA(n);c.current=n;let d=Eo(()=>({data:t,columns:o,rowKey:A,filters:c.current,onFiltersChange:F=>{c.current=F,r(F)},onSortChange:s,onHighlightRows:a,onOpenRow:e.onOpenRow,onSelectRow:F=>a([F])}),[t,o,A,e.onOpenRow]),Q=Eo(async F=>{let P=F.trim();if(P){p(!0),B([]),y([]);try{if(bo(P).length>1){let G=[],D=await ni(P,d(),{onStep:E=>B((G.push(E),[...G]))});C("tasks"),I(D.summary)}else if(yl.test(P)){let G=gt(t,o,{filters:c.current,search:[],sort:null,limit:null,notes:[],explanation:""}),D=_n(P,G,o,{referenceDate:e.referenceDate});C("insight"),I(D.answer),y(D.table)}else{let G=Vn(P,d());C(G.kind),I(G.message)}}finally{p(!1)}}},[d,t,o,e.referenceDate]),b=Eo(()=>{c.current=[],r([]),s(null),a([]),I(""),C(null),y([]),B([])},[]),S=wo(()=>gt(t,o,{filters:n,search:[],sort:i,limit:null,notes:[],explanation:""}),[t,o,n,i]);return{gridData:S,highlightIds:g,filters:n,sort:i,ask:Q,reset:b,answer:l,kind:u,table:h,steps:f,busy:m,visibleIds:S.map(F=>he(F,A))}}var ci={border:"1px solid color-mix(in srgb, CanvasText 20%, transparent)",borderRadius:12,padding:16,background:"Canvas",color:"CanvasText",font:"inherit"},Ie={minHeight:44,padding:"8px 14px",borderRadius:8,border:"1px solid color-mix(in srgb, CanvasText 35%, transparent)",background:"ButtonFace",color:"ButtonText",font:"inherit",cursor:"pointer"},xo={...Ie,flex:1,minWidth:0,background:"Field",color:"FieldText",cursor:"text"},LA={opacity:.75,fontSize:"0.9em"};function ko({rows:e}){if(!e.length)return null;let t=Object.keys(e[0]);return v("div",{style:{overflowX:"auto",marginTop:12},children:se("table",{style:{borderCollapse:"collapse",width:"100%"},children:[v("thead",{children:v("tr",{children:t.map(A=>v("th",{scope:"col",style:{textAlign:"left",padding:"6px 8px",borderBottom:"1px solid currentColor"},children:A},A))})}),v("tbody",{children:e.slice(0,50).map((A,o)=>v("tr",{children:t.map(n=>v("td",{style:{padding:"6px 8px",borderBottom:"1px solid color-mix(in srgb, CanvasText 12%, transparent)"},children:A[n]},n))},o))})]})})}function ai(e,t,A){let o=URL.createObjectURL(new Blob([t],{type:A})),n=document.createElement("a");n.href=o,n.download=e,n.click(),setTimeout(()=>URL.revokeObjectURL(o),1e3)}function od({grid:e,placeholder:t="Ask about this data, e.g. \u201Coverdue and over \u20B910,000\u201D",examples:A=[],style:o}){let[n,r]=ue(""),i=s=>{s.preventDefault(),e.ask(n)};return se("section",{"data-yuktai-panel":"","aria-label":"Data assistant",style:{...ci,...o},children:[se("form",{onSubmit:i,style:{display:"flex",gap:8,flexWrap:"wrap"},children:[v("label",{htmlFor:"yuktai-grid-ask",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"},children:"Question about the data"}),v("input",{id:"yuktai-grid-ask",value:n,onChange:s=>r(s.target.value),placeholder:t,style:xo}),v("button",{type:"submit",style:Ie,disabled:e.busy,children:e.busy?"Working\u2026":"Ask"}),v("button",{type:"button",style:Ie,onClick:()=>{r(""),e.reset()},children:"Reset"})]}),A.length>0&&v("div",{style:{display:"flex",gap:6,flexWrap:"wrap",marginTop:8},children:A.map(s=>v("button",{type:"button",style:{...Ie,minHeight:36,fontSize:"0.85em"},onClick:()=>{r(s),e.ask(s)},children:s},s))}),v("div",{"aria-live":"polite",style:{marginTop:12,whiteSpace:"pre-line"},children:e.answer}),e.steps.length>0&&v("ol",{style:{marginTop:8,paddingLeft:20},children:e.steps.map((s,g)=>se("li",{style:{marginBottom:4},children:[v("span",{"aria-hidden":"true",children:s.success?"\u2705 ":"\u26A0\uFE0F "}),v("strong",{children:s.text})," \u2014 ",v("span",{style:{whiteSpace:"pre-line"},children:s.message})]},g))}),v(ko,{rows:e.table})]})}var MA=[["copilot","Copilot"],["qa","QA report"],["forms","Forms"],["design","Design"],["ask","Ask page"],["voice","Voice"]];function ui({defaultTab:e="copilot",voiceLang:t="en-IN",generate:A,engine:o,style:n}){let[r,i]=ue(e),s=iA([]),g=(a,l)=>{let I=a.key==="ArrowRight"?1:a.key==="ArrowLeft"?-1:0;if(!I)return;a.preventDefault();let u=(l+I+MA.length)%MA.length;i(MA[u][0]),s.current[u]?.focus()};return se("section",{"data-yuktai-panel":"","aria-label":"yuktai agentic tools",style:{...ci,...n},children:[v("div",{role:"tablist","aria-label":"Tools",style:{display:"flex",gap:6,flexWrap:"wrap",marginBottom:12},children:MA.map(([a,l],I)=>v("button",{ref:u=>{s.current[I]=u},role:"tab",id:`yuktai-tab-${a}`,"aria-selected":r===a,"aria-controls":`yuktai-tabpanel-${a}`,tabIndex:r===a?0:-1,onClick:()=>i(a),onKeyDown:u=>g(u,I),style:{...Ie,fontWeight:r===a?700:400,outlineOffset:2,borderWidth:r===a?2:1},children:l},a))}),se("div",{role:"tabpanel",id:`yuktai-tabpanel-${r}`,"aria-labelledby":`yuktai-tab-${r}`,children:[r==="copilot"&&v(Ql,{}),r==="qa"&&v(Bl,{}),r==="forms"&&v(bl,{}),r==="design"&&v(El,{}),r==="ask"&&v(wl,{generate:A,engine:o}),r==="voice"&&v(xl,{lang:t})]})]})}function Ql(){let e=iA(null),[t,A]=ue(null),[o,n]=ue(null),[r,i]=ue("");li(()=>(e.current=Hn({onUpdate:A}),e.current.scan(),()=>e.current?.stop()),[]);let s=e.current,g=t?.report?.issues??[];return se("div",{children:[se("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[v("button",{type:"button",style:Ie,onClick:()=>t?.watching?s?.stop():s?.start(),children:t?.watching?"Stop watching":"Watch page live"}),v("button",{type:"button",style:Ie,onClick:()=>s?.scan(),children:"Scan now"}),v("button",{type:"button",style:Ie,onClick:()=>i(`${s?.applyAllFixes().filter(a=>a.applied).length??0} fix(es) applied.`),children:"Apply safe fixes"}),v("button",{type:"button",style:Ie,onClick:()=>i(`${s?.undoAll()??0} change(s) undone.`),children:"Undo all"})]}),se("p",{"aria-live":"polite",style:{marginTop:12},children:[t?.report?.summary," ",r]}),v("ul",{style:{listStyle:"none",padding:0,margin:0},children:g.slice(0,40).map(a=>se("li",{style:{borderTop:"1px solid color-mix(in srgb, CanvasText 12%, transparent)",padding:"8px 0"},children:[se("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[v("span",{style:{...LA,minWidth:70},children:a.severity}),v("span",{style:{flex:1},children:a.message}),v("button",{type:"button",style:Ie,"aria-expanded":o===a.id,onClick:()=>n(o===a.id?null:a.id),children:"Why?"}),a.autoFixable&&v("button",{type:"button",style:Ie,onClick:()=>i(s?.applyFix(a.id).message??""),children:"Fix"})]}),o===a.id&&v("p",{style:{whiteSpace:"pre-line",margin:"8px 0 0"},children:s?.explain(a.id)})]},a.id))})]})}function Bl(){let[e,t]=ue(null);return se("div",{children:[se("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[v("button",{type:"button",style:Ie,onClick:()=>t(at()),children:"Run QA check"}),e&&se(gi,{children:[v("button",{type:"button",style:Ie,onClick:()=>ai("accessibility-report.md",Kn(e),"text/markdown"),children:"Download .md"}),v("button",{type:"button",style:Ie,onClick:()=>ai("accessibility-report.json",qn(e),"application/json"),children:"Download .json"})]})]}),e&&se(gi,{children:[se("p",{"aria-live":"polite",style:{marginTop:12},children:[v("strong",{children:e.passed?"PASS":"FAIL"})," \u2014 ",e.summary]}),v(ko,{rows:e.checks.map(A=>({Check:A.title,Result:A.passed?"\u2705 Pass":"\u274C Fail",Issues:A.issueCount}))})]})]})}function bl(){let[e,t]=ue(null);return se("div",{children:[v("button",{type:"button",style:Ie,onClick:()=>t(NA()),children:"Review forms"}),se("div",{"aria-live":"polite",children:[e&&e.length===0&&v("p",{children:"No forms on this page."}),e?.map(A=>se("div",{style:{marginTop:12},children:[v("p",{children:v("strong",{children:A.summary})}),v("ul",{children:A.findings.map((o,n)=>se("li",{children:[o.level==="problem"?"Problem: ":"Suggestion: ",o.message," ",v("span",{style:LA,children:o.suggestion})]},n))})]},A.selector))]})]})}function El(){let[e,t]=ue(null);return se("div",{children:[v("button",{type:"button",style:Ie,onClick:()=>t(Wn()),children:"Review design"}),e&&se("div",{"aria-live":"polite",children:[v("p",{style:{marginTop:12},children:v("strong",{children:e.summary})}),v(ko,{rows:Object.entries(e.categories).map(([A,o])=>({Area:A,Score:o.score,Findings:o.findings}))}),v("ul",{children:e.findings.map((A,o)=>se("li",{children:["[",A.severity,"] ",A.message," ",v("span",{style:LA,children:A.suggestion})]},o))})]})]})}function wl({generate:e,engine:t}){let[A,o]=ue(""),n=iA(null),r=iA(t),[i,s]=ue(""),[g,a]=ue([]);return se("div",{children:[se("form",{onSubmit:async I=>{if(I.preventDefault(),!A.trim())return;let u=await ei(A);if(u.intent!=="unknown"&&u.intent!=="purpose"){s(u.answer),a(u.suggestions);return}!n.current||r.current!==t?(n.current=DA({engine:t}),r.current=t):n.current.rebuild();let C=await n.current.ask(A,{generate:e});s(u.intent==="purpose"&&!C.hits.length?u.answer:C.hits.length?C.answer:u.answer),a(u.suggestions)},style:{display:"flex",gap:8,flexWrap:"wrap"},children:[v("label",{htmlFor:"yuktai-page-ask",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"},children:"Question about this page"}),v("input",{id:"yuktai-page-ask",value:A,onChange:I=>o(I.target.value),placeholder:"What does this page do? Which fields are missing labels?",style:xo}),v("button",{type:"submit",style:Ie,children:"Ask"})]}),v("p",{"aria-live":"polite",style:{whiteSpace:"pre-line",marginTop:12},children:i}),g.length>0&&v("ul",{children:g.map((I,u)=>v("li",{children:I},u))})]})}function xl({lang:e}){let t=wo(()=>si({lang:e,onTranscript:(g,a)=>r(`\u201C${g}\u201D \u2192 ${a?a.say:"not a command"}`)}),[e]),[A,o]=ue(!1),[n,r]=ue(""),[i,s]=ue("");return li(()=>()=>t.stop(),[t]),se("div",{children:[v("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:v("button",{type:"button",style:Ie,"aria-pressed":A,onClick:()=>{A?(t.stop(),o(!1)):o(t.start())},children:A?"Stop listening":"Start voice commands"})}),se("form",{onSubmit:g=>{g.preventDefault(),t.handle(i),s("")},style:{display:"flex",gap:8,marginTop:8,flexWrap:"wrap"},children:[v("label",{htmlFor:"yuktai-voice-typed",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"},children:"Type a command"}),v("input",{id:"yuktai-voice-typed",value:i,onChange:g=>s(g.target.value),placeholder:"Or type: turn on high contrast",style:xo}),v("button",{type:"submit",style:Ie,children:"Run"})]}),v("p",{"aria-live":"polite",style:{marginTop:12},children:n}),v("p",{style:LA,children:"Try: \u201Cturn on high contrast\u201D, \u201Cbigger text\u201D, \u201Cdark mode off\u201D, \u201Cnext row\u201D, \u201C\u0C2A\u0C46\u0C26\u0C4D\u0C26 \u0C05\u0C15\u0C4D\u0C37\u0C30\u0C3E\u0C32\u0C41\u201D, \u201Creset settings\u201D."})]})}import{Fragment as Dl,jsx as H,jsxs as Ee}from"react/jsx-runtime";var Ii="yuktai-tools-open";async function kl(){try{if(typeof window>"u")return!1;let e=window;if(e.LanguageModel)try{if(typeof e.LanguageModel.availability=="function"){let A=await e.LanguageModel.availability({...WA});if(A==="readily"||A==="available"||A==="downloadable")return!0}else return!0}catch{}if(e.Summarizer)try{let A=await e.Summarizer.availability?.({...We});if(!A||A==="readily"||A==="available")return!0}catch{}if(e.Rewriter)try{let A=await e.Rewriter.availability?.({...We});if(!A||A==="readily"||A==="available")return!0}catch{}if(e.Writer)try{let A=await e.Writer.availability?.({...We});if(!A||A==="readily"||A==="available")return!0}catch{}let t=e.ai||globalThis.ai;if(t){if(t.languageModel?.availability)try{let A=await t.languageModel.availability({...WA});if(A==="readily"||A==="available")return!0}catch{}if(t.languageModel&&typeof t.languageModel.create=="function"||t.summarizer||t.rewriter||t.writer||t.languageModel)return!0}return!!(e.Translator||e.translation?.canTranslate)}catch{return!1}}function Do({position:e="left",children:t,config:A={},showRag:o=!1,showAgent:n=!1,showAccessibility:r,showVibeCoder:i,launcher:s,engine:g,showPageTools:a=!1,pageToolsTab:l="copilot",voiceLang:I}){let u=r!==void 0||i!==void 0||s!==void 0,C=u?!!r:!0,h=u?!!i:n,y=o,f=n,[B,m]=ae(!1),p=!s||B,[c,d]=ae(!1),[Q,b]=ae(io),[S,F]=ae(null),[P,G]=ae(!1),[D,E]=ae(!1),[j,Ae]=ae(!1),J=di.useRef(null),[ee,ie]=ae(!1),[R,oe]=ae(""),[T,Y]=ae(""),[X,q]=ae(!1),[z,xe]=ae(null),[ve,L]=ae("idle"),[ne,de]=ae(!1),[pe,ke]=ae(""),[fe,He]=ae(""),[De,Ct]=ae(!1),[Me,Xe]=ae([]),[Qe,Re]=ae(null),Se=x=>{let U=[],ye=s?84:24;for(let $t of x)U.push(ye),$t&&(ye+=60);return U},[$e,pt,St,gA]=u?Se([C,y,f,h]):[24,84,o?144:84,204],[Le,Ve]=ae(!1),[je,ot]=ae(!1),Pt=Math.max(s?24:-36,C?$e:-36,y?pt:-36,f?St:-36,h?gA:-36)+60;At(()=>{(c||ee||ne||Le)&&ot(!1)},[c,ee,ne,Le]);let ft=g!==void 0,[lA,mt]=ae([]),[ht,yt]=ae(null),Ze=di.useRef(null);At(()=>{if(typeof window>"u")return;let x=window;!!(x.LanguageModel||x.ai?.languageModel)&&D?(xe("gemini"),Re("gemini")):dA()&&(xe("transformers"),Re("transformers"))},[D]),At(()=>{if(z!=="transformers")return;let x=setInterval(()=>L(zt()),500);return()=>clearInterval(x)},[z]);let Kt=x=>x.replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/#+\s/g,"").trim(),Qt=lt(async()=>{let x=R.trim();if(!(!x||X)){q(!0),Y(""),mt([]),yt(null);try{Ze.current?Ze.current.rebuild():Ze.current=DA({engine:g}),await Ze.current.whenEngineReady();let U=performance.now(),ye=await Ze.current.ask(x,{k:4}),$t=performance.now()-U;if(Y(ye.answer),mt(ye.hits.slice(0,3).map(Gt=>Gt.text.length>160?`${Gt.text.slice(0,157)}\u2026`:Gt.text)),yt({ms:$t,engine:Ze.current.engine,ai:!1}),ye.hits.length&&z){let Gt=ye.hits.map(et=>et.text).join(`
|
|
392
|
+
`),Wt;if(z==="gemini"){let{askWithContext:et}=await import("./rag-O3FDQPTX.mjs");Wt=await et(x,Gt)}else{L("loading");let{answerFromContext:et}=await import("./transformers-rag-MQZRMFTG.mjs");Wt=await et(x,Gt),L(zt())}Wt.success&&Wt.answer&&(Y(Kt(Wt.answer)),yt(et=>et&&{...et,ai:!0}))}}catch{Y(U=>U||"\u26A0\uFE0F Something went wrong.")}q(!1)}},[R,X,z,g]),qt=lt(async()=>{if(ft)return Qt();if(!(!R.trim()||X)){if(!z){Y("\u26A0\uFE0F No AI engine available.");return}q(!0),Y("");try{let x;if(z==="gemini"){let{askPage:U}=await import("./rag-O3FDQPTX.mjs");x=await U(R)}else{L("loading");let{askPageWithTransformers:U}=await import("./transformers-rag-MQZRMFTG.mjs");x=await U(R),L("ready")}Y(x.success&&x.answer?x.answer.replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/#+\s/g,"").trim():"\u26A0\uFE0F "+(x.error||"No answer found."))}catch{Y("\u26A0\uFE0F Something went wrong.")}q(!1)}},[R,X,z,ft,Qt]),cA=lt(async()=>{if(!pe.trim()||De)return;if(!Qe){He("\u26A0\uFE0F No AI engine available.");return}Ct(!0),Xe([]),He("");let{runAgent:x}=await import("./agent-SZENB4QE.mjs");await x(pe,Qe,U=>{Xe(ye=>[...ye,U.text])}),Ct(!1),He("done")},[pe,De,Qe]);At(()=>{if(typeof window>"u")return;let U=setTimeout(async()=>{let ye=window,$t=await kl();E($t),Ae(!!(ye.SpeechRecognition||ye.webkitSpeechRecognition))},800);return()=>clearTimeout(U)},[]),At(()=>{if(!(typeof window>"u"))try{let x=localStorage.getItem("yuktai-a11y-prefs");x&&b(U=>({...U,...JSON.parse(x)}))}catch{}},[]);let Ht=lt(async x=>{let U={enabled:!0,highContrast:x.highContrast,darkMode:x.darkMode,reduceMotion:x.reduceMotion,largeTargets:x.largeTargets,speechEnabled:x.speechEnabled,autoFix:x.autoFix,dyslexiaFont:x.dyslexiaFont,localFont:x.localFont,fontSizeMultiplier:x.fontScale/100,colorBlindMode:x.colorBlindMode,showAuditBadge:x.showAuditBadge,showSkipLinks:!0,showPreferencePanel:!1,plainEnglish:x.plainEnglish,summarisePage:x.summarisePage,translateLanguage:x.translateLanguage,voiceControl:x.voiceControl,smartLabels:x.smartLabels,...A};await Ge.execute(U),F(Ge.applyFixes(U)),G(!0)},[A]),te=lt(async()=>{try{localStorage.setItem("yuktai-a11y-prefs",JSON.stringify(Q))}catch{}await Ht(Q),d(!1)},[Q,Ht]),Yo=lt(()=>{b(io);try{localStorage.removeItem("yuktai-a11y-prefs")}catch{}let x=document.documentElement;["data-yuktai-high-contrast","data-yuktai-dark","data-yuktai-reduce-motion","data-yuktai-large-targets","data-yuktai-keyboard","data-yuktai-dyslexia"].forEach(U=>x.removeAttribute(U)),document.body.style.filter="",document.body.style.fontFamily="",document.documentElement.style.fontSize="",F(null),G(!1)},[]),Uo=lt((x,U)=>{b(ye=>({...ye,[x]:U}))},[]);At(()=>{let x=U=>{U.key==="Escape"&&(c||ee||ne||Le||je?(d(!1),ie(!1),de(!1),Ve(!1),ot(!1)):s&&B&&m(!1))};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[c,ee,ne,Le,je,s,B]),At(()=>{if(s)try{localStorage.getItem(Ii)==="1"&&m(!0)}catch{}},[s]),At(()=>{if(!(!s||typeof document>"u")){document.documentElement.setAttribute("data-yuktai-tools",B?"open":"closed");try{localStorage.setItem(Ii,B?"1":"0")}catch{}}},[s,B]);let uA=lt(()=>{m(x=>(x&&(d(!1),ie(!1),de(!1),Ve(!1),ot(!1)),!x))},[]);At(()=>{c&&J.current&&Ge.trapFocus(J.current)},[c]);let nt=(x,U,ye)=>({position:"fixed",bottom:`${x}px`,[e]:"24px",zIndex:9998,width:"52px",height:"52px",borderRadius:"50%",background:U,color:"#fff",border:"none",cursor:"pointer",fontSize:"22px",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 16px rgba(0,0,0,0.25)",transition:"transform 0.15s, background 0.2s"}),_e=x=>{x.currentTarget.style.transform="scale(1.08)"},it=x=>{x.currentTarget.style.transform="scale(1)"},M=ft?`${g==="ts"?"Page search":"Rust page search"}${z==="gemini"?" + Gemini Nano":z==="transformers"?" + Transformers.js":" \xB7 On device"}`:z==="gemini"?"Gemini Nano \xB7 On device":z==="transformers"?"Transformers.js \xB7 All devices":"Detecting...",$=ft||!!z,Z=z==="transformers"&&ve==="loading"?"Loading model...":"...";return Ee(Dl,{children:[t,s&&H("button",{type:"button","data-yuktai-ui":"true",style:nt(24,B?"#134e4a":"#0f766e",B),"aria-expanded":B,"aria-label":B?"Hide yuktai tools":"Show yuktai tools",title:B?"Hide yuktai tools":"yuktai tools","data-yuktai-launcher":"true",onClick:uA,onMouseEnter:_e,onMouseLeave:it,children:B?H("svg",{"aria-hidden":"true",width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:H("path",{d:"M6 6l12 12M18 6L6 18"})}):Ee("svg",{"aria-hidden":"true",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[H("path",{d:"M12 3l1.8 4.7L18.5 9.5l-4.7 1.8L12 16l-1.8-4.7L5.5 9.5l4.7-1.8z"}),H("path",{d:"M19 15l.8 2.2L22 18l-2.2.8L19 21l-.8-2.2L16 18l2.2-.8z"})]})}),a&&p&&H("button",{type:"button","data-yuktai-ui":"true",style:nt(Pt,je?"#312e81":"#4338ca",je),"aria-label":"Open page tools","aria-haspopup":"dialog","aria-expanded":je,title:"\u{1F6E0} Page tools: QA report, forms, design, ask, voice","data-yuktai-page-tools":"true",onClick:()=>{ot(x=>!x),d(!1),ie(!1),de(!1),Ve(!1)},onMouseEnter:_e,onMouseLeave:it,children:"\u{1F6E0}"}),a&&p&&je&&Ee("div",{role:"dialog","aria-label":"yuktai page tools","data-yuktai-panel":"true",style:{position:"fixed",bottom:`${Pt+64}px`,[e]:"24px",zIndex:9999,width:"420px",maxWidth:"calc(100vw - 48px)",maxHeight:`calc(100vh - ${Pt+88}px)`,minHeight:"160px",overflowY:"auto",boxShadow:"0 8px 32px rgba(0,0,0,0.18)",borderRadius:"16px",background:"Canvas",color:"CanvasText",border:"1px solid color-mix(in srgb, CanvasText 20%, transparent)"},children:[H("div",{style:{display:"flex",justifyContent:"flex-end",position:"sticky",top:0,zIndex:1,background:"Canvas"},children:H("button",{type:"button",onClick:()=>ot(!1),"aria-label":"Close page tools",style:{margin:"6px 6px 0 0",minWidth:32,minHeight:32,borderRadius:8,border:"1px solid #94a3b8",background:"#fff",color:"#0f172a",cursor:"pointer",fontSize:16},children:"\u2715"})}),H(ui,{defaultTab:l,voiceLang:I,engine:g,style:{margin:0,border:0,paddingTop:4}})]}),h&&p&&H("button",{"data-yuktai-ui":"true",style:nt(gA,Le?"#92400e":"#b45309",Le),"aria-label":"Open Vibe Coder",title:"\u26A1 Vibe Coder \u2014 Generate Next.js project",onClick:()=>{Ve(x=>!x),de(!1),ie(!1),d(!1)},onMouseEnter:_e,onMouseLeave:it,children:"\u26A1"}),h&&p&&Le&&H(so,{position:e,onClose:()=>Ve(!1)}),f&&p&&H("button",{"data-yuktai-ui":"true",style:nt(St,ne?"#065f46":"#047857",ne),"aria-label":"Open AI agent","aria-haspopup":"dialog","aria-expanded":ne,title:"\u{1F916} AI Agent \u2014 guide me through this page",onClick:()=>{de(x=>!x),ie(!1),d(!1)},onMouseEnter:_e,onMouseLeave:it,children:"\u{1F916}"}),f&&p&&ne&&Ee("div",{role:"dialog","aria-modal":"true","aria-label":"yuktai AI Agent","data-yuktai-panel":"true",style:{position:"fixed",bottom:`${St+64}px`,[e]:"24px",zIndex:9999,width:"300px",maxWidth:"calc(100vw - 48px)",background:"#fff",border:"1px solid #e2e8f0",borderRadius:"16px",boxShadow:"0 8px 32px rgba(0,0,0,0.12)",fontFamily:"system-ui,-apple-system,sans-serif",padding:"14px",maxHeight:"70vh",overflowY:"auto"},children:[Ee("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"10px"},children:[Ee("div",{children:[H("p",{style:{margin:"0 0 2px",fontSize:"13px",fontWeight:600,color:"#0f172a"},children:"\u{1F916} AI Agent"}),H("p",{style:{margin:0,fontSize:"10px",color:"#10b981"},children:Qe==="gemini"?"Gemini Nano \xB7 On device":Qe==="transformers"?"Transformers.js \xB7 All devices":"Detecting..."})]}),H("button",{onClick:()=>de(!1),"aria-label":"Close agent panel",style:{background:"none",border:"none",cursor:"pointer",color:"#94a3b8",fontSize:"18px",lineHeight:1,padding:"2px"},children:"\xD7"})]}),H("p",{style:{margin:"0 0 8px",fontSize:"11px",color:"#64748b"},children:"Tell me what you want to do on this page. I will guide you step by step."}),H("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",marginBottom:"8px"},children:["Fill this form","Find contact info","What is this page?","Guide me to apply"].map(x=>H("button",{onClick:()=>ke(x),style:{padding:"3px 8px",borderRadius:"20px",fontSize:"10px",border:"1px solid #e2e8f0",background:"#f8fafc",color:"#64748b",cursor:"pointer"},children:x},x))}),Ee("div",{style:{display:"flex",gap:"6px",marginBottom:"8px"},children:[H("input",{type:"text",value:pe,onChange:x=>ke(x.target.value),onKeyDown:x=>{x.key==="Enter"&&cA()},placeholder:"e.g. Help me fill this form",disabled:De||!Qe,"aria-label":"Tell the agent what to do",style:{flex:1,padding:"8px 10px",borderRadius:"8px",border:"1px solid #e2e8f0",fontSize:"12px",color:"#0f172a",background:Qe?"#fff":"#f8fafc",outline:"none",height:"36px"}}),H("button",{onClick:cA,disabled:De||!pe.trim()||!Qe,"aria-label":"Run agent",style:{padding:"8px 12px",borderRadius:"8px",border:"none",background:Qe&&pe.trim()&&!De?"#10b981":"#e2e8f0",color:Qe&&pe.trim()&&!De?"#fff":"#94a3b8",fontSize:"12px",fontWeight:600,cursor:Qe&&pe.trim()&&!De?"pointer":"not-allowed",height:"36px",minWidth:"52px",transition:"background 0.2s"},children:De?"...":"Go"})]}),Me.length>0&&Ee("div",{style:{padding:"10px 12px",background:"#f0fdf4",border:"1px solid #86efac",borderRadius:"8px",fontSize:"11px",color:"#166534",lineHeight:1.7},children:[Me.map((x,U)=>H("p",{style:{margin:"0 0 2px"},children:x},U)),fe==="done"&&H("button",{onClick:()=>{Xe([]),ke(""),He("")},style:{display:"block",marginTop:"6px",background:"none",border:"none",color:"#94a3b8",fontSize:"10px",cursor:"pointer",padding:0},children:"Clear"})]}),!Qe&&H("p",{style:{margin:"4px 0 0",fontSize:"10px",color:"#94a3b8"},children:"Enable Gemini Nano via chrome://flags for best results."})]}),y&&p&&H("button",{"data-yuktai-ui":"true",style:nt(pt,ee?"#7c3aed":"#6d28d9",ee),"aria-label":"Ask a question about this page","aria-haspopup":"dialog","aria-expanded":ee,title:`\u{1F4AC} Ask this page \xB7 ${M}`,onClick:()=>{ie(x=>!x),d(!1),de(!1)},onMouseEnter:_e,onMouseLeave:it,children:"\u{1F4AC}"}),y&&p&&ee&&Ee("div",{role:"dialog","aria-modal":"true","aria-label":"Ask this page","data-yuktai-panel":"true",style:{position:"fixed",bottom:`${pt+64}px`,[e]:"24px",zIndex:9999,width:"300px",maxWidth:"calc(100vw - 48px)",background:"#fff",border:"1px solid #e2e8f0",borderRadius:"16px",boxShadow:"0 8px 32px rgba(0,0,0,0.12)",fontFamily:"system-ui,-apple-system,sans-serif",padding:"14px"},children:[Ee("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"10px"},children:[Ee("div",{children:[H("p",{style:{margin:"0 0 2px",fontSize:"13px",fontWeight:600,color:"#0f172a"},children:"\u{1F4AC} Ask this page"}),H("p",{style:{margin:0,fontSize:"10px",color:"#7c3aed"},children:M}),z==="transformers"&&ve==="loading"&&H("p",{style:{margin:"2px 0 0",fontSize:"9px",color:"#94a3b8"},children:"Downloading model \u2014 first time only"}),z==="transformers"&&ve==="ready"&&H("p",{style:{margin:"2px 0 0",fontSize:"9px",color:"#10b981"},children:"Model ready \u2705 \u2014 works offline"})]}),H("button",{onClick:()=>ie(!1),"aria-label":"Close ask panel",style:{background:"none",border:"none",cursor:"pointer",color:"#94a3b8",fontSize:"18px",lineHeight:1,padding:"2px"},children:"\xD7"})]}),Ee("div",{style:{display:"flex",gap:"6px",marginBottom:"8px"},children:[H("input",{type:"text",value:R,onChange:x=>oe(x.target.value),onKeyDown:x=>{x.key==="Enter"&&qt()},placeholder:"e.g. What does this page do?",disabled:X||!$,"aria-label":"Ask a question about this page",style:{flex:1,padding:"8px 10px",borderRadius:"8px",border:"1px solid #e2e8f0",fontSize:"12px",color:"#0f172a",background:$?"#fff":"#f8fafc",outline:"none",height:"36px"}}),H("button",{onClick:qt,disabled:X||!R.trim()||!$,"aria-label":"Submit question",style:{padding:"8px 12px",borderRadius:"8px",border:"none",background:$&&R.trim()&&!X?"#7c3aed":"#e2e8f0",color:$&&R.trim()&&!X?"#fff":"#94a3b8",fontSize:"12px",fontWeight:600,cursor:$&&R.trim()&&!X?"pointer":"not-allowed",height:"36px",minWidth:"48px",transition:"background 0.2s"},children:X?Z:"Ask"})]}),T&&Ee("div",{"aria-live":"polite",style:{padding:"10px",background:"#f5f3ff",borderRadius:"8px",fontSize:"12px",color:"#4c1d95",lineHeight:1.6,maxHeight:ft?"260px":"180px",overflowY:"auto",whiteSpace:"pre-line"},children:[H("strong",{style:{display:"block",marginBottom:"4px",fontSize:"11px",color:"#7c3aed"},children:"\u{1F4AC} Answer"}),T,lA.length>0&&Ee("div",{style:{marginTop:"8px"},children:[H("strong",{style:{display:"block",fontSize:"10px",color:"#6d28d9"},children:"From this page"}),H("ul",{style:{margin:"4px 0 0",paddingLeft:"16px",fontSize:"11px",color:"#5b21b6"},children:lA.map((x,U)=>H("li",{style:{marginBottom:"2px"},children:x},U))})]}),ht&&Ee("p",{style:{margin:"6px 0 0",fontSize:"10px",color:"#6d28d9"},children:["\u26A1 Found in ",wA(ht.ms)," \xB7 ",ht.engine==="rust"?"Rust":"TS"," \xB7 on device",ht.ai?" \xB7 answer written by AI":""]}),H("button",{onClick:()=>{Y(""),oe(""),mt([]),yt(null)},style:{display:"block",marginTop:"6px",background:"none",border:"none",color:"#94a3b8",fontSize:"10px",cursor:"pointer",padding:0},children:"Clear"})]}),!$&&H("p",{style:{margin:"4px 0 0",fontSize:"10px",color:"#94a3b8"},children:"Detecting AI engine..."})]}),C&&p&&H("button",{"data-yuktai-ui":"true",style:nt($e,P?"#0f766e":"#1a73e8",c),"aria-label":"Open accessibility preferences","aria-haspopup":"dialog","aria-expanded":c,"data-yuktai-pref-toggle":"true",title:"\u267F Accessibility settings",onClick:()=>{d(x=>!x),ie(!1),de(!1)},onMouseEnter:_e,onMouseLeave:it,children:"\u267F"}),C&&p&&c&&H(ro,{ref:J,position:e,settings:Q,report:S,isActive:P,aiSupported:D,voiceSupported:j,set:Uo,onApply:te,onReset:Yo,onClose:()=>d(!1)})]})}var YA={name:"ai.text",async execute(e){return`\u{1F916} YuktAI says: ${e}`}};var UA={name:"voice.text",async execute(e){return!e||e.trim()===""?"\u{1F3A4} No speech detected":`\u{1F3A4} You said: ${e}`}};var xt=class{plugins=new Map;register(t,A){if(!A||typeof A.execute!="function")throw new Error(`Invalid plugin: ${t}`);this.plugins.set(t,A)}use(t){return this.plugins.get(t)}async run(t,A){try{let o=this.use(t);if(!o)throw new Error(`Plugin not found: ${t}`);return await o.execute(A)}catch(o){throw console.error(`[YuktAI Runtime Error in ${t}]:`,o),o}}getPlugins(){return Array.from(this.plugins.keys())}};import{useCallback as No,useEffect as aA,useMemo as kt,useState as dt}from"react";import{useCallback as So,useEffect as rA,useMemo as Ci,useRef as pi,useState as ct}from"react";import{Fragment as Yl,jsx as N,jsxs as we}from"react/jsx-runtime";var fi={"en-US":{title:"Grid AI Assistant",subtitle:"Ask about your data",ask:"Ask",placeholder:"Ask or type a command...",listening:"Listening...",send:"Send",close:"Close",open:"Open AI assistant",inputLanguage:"Input language",speakNow:"Speak your question",working:"Working on it\u2026",english:"English",telugu:"\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41",searchStarted:e=>`Searching for "${e}".`,sortedAscending:e=>`Sorted by ${e} in ascending order.`,sortedDescending:e=>`Sorted by ${e} in descending order.`,count:e=>`There are ${e} rows in the grid.`,highest:(e,t,A)=>`The highest ${e} is ${t}, held by ${A}.`,lowest:(e,t,A)=>`The lowest ${e} is ${t}, held by ${A}.`,average:(e,t)=>`The average ${e} is ${t}.`,total:(e,t)=>`The total ${e} is ${t}.`,noData:"There is no data to analyze.",noColumn:"I could not find a column to analyze.",noNumericData:e=>`There is no numeric data in ${e}.`,notFound:e=>`I could not find anything matching "${e}".`,needName:"Please provide a value to look up.",fallback:"I can search, sort, count, and analyze the grid data.",unsupportedVoice:"Voice input is not supported in this browser."},"te-IN":{title:"\u0C17\u0C4D\u0C30\u0C3F\u0C21\u0C4D AI \u0C38\u0C39\u0C3E\u0C2F\u0C15\u0C41\u0C21\u0C41",subtitle:"\u0C2E\u0C40 \u0C21\u0C47\u0C1F\u0C3E \u0C17\u0C41\u0C30\u0C3F\u0C02\u0C1A\u0C3F \u0C05\u0C21\u0C17\u0C02\u0C21\u0C3F",ask:"\u0C05\u0C21\u0C17\u0C02\u0C21\u0C3F",placeholder:"\u0C2A\u0C4D\u0C30\u0C36\u0C4D\u0C28 \u0C32\u0C47\u0C26\u0C3E \u0C06\u0C26\u0C47\u0C36\u0C02 \u0C1F\u0C48\u0C2A\u0C4D \u0C1A\u0C47\u0C2F\u0C02\u0C21\u0C3F...",listening:"\u0C35\u0C3F\u0C02\u0C1F\u0C41\u0C28\u0C4D\u0C28\u0C3E\u0C28\u0C41...",send:"\u0C2A\u0C02\u0C2A\u0C02\u0C21\u0C3F",close:"\u0C2E\u0C42\u0C38\u0C3F\u0C35\u0C47\u0C2F\u0C02\u0C21\u0C3F",open:"AI \u0C38\u0C39\u0C3E\u0C2F\u0C15\u0C41\u0C21\u0C3F\u0C28\u0C3F \u0C24\u0C46\u0C30\u0C35\u0C02\u0C21\u0C3F",inputLanguage:"\u0C07\u0C28\u0C4D\u200C\u0C2A\u0C41\u0C1F\u0C4D \u0C2D\u0C3E\u0C37",speakNow:"\u0C2E\u0C40 \u0C2A\u0C4D\u0C30\u0C36\u0C4D\u0C28 \u0C1A\u0C46\u0C2A\u0C4D\u0C2A\u0C02\u0C21\u0C3F",working:"\u0C1A\u0C47\u0C38\u0C4D\u0C24\u0C41\u0C28\u0C4D\u0C28\u0C3E\u0C28\u0C41\u2026",english:"English",telugu:"\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41",searchStarted:e=>`\u201C${e}\u201D \u0C15\u0C4B\u0C38\u0C02 \u0C36\u0C4B\u0C27\u0C3F\u0C38\u0C4D\u0C24\u0C41\u0C28\u0C4D\u0C28\u0C3E\u0C28\u0C41.`,sortedAscending:e=>`${e}\u0C28\u0C41 \u0C06\u0C30\u0C4B\u0C39\u0C23 \u0C15\u0C4D\u0C30\u0C2E\u0C02\u0C32\u0C4B \u0C05\u0C2E\u0C30\u0C4D\u0C1A\u0C3E\u0C28\u0C41.`,sortedDescending:e=>`${e}\u0C28\u0C41 \u0C05\u0C35\u0C30\u0C4B\u0C39\u0C23 \u0C15\u0C4D\u0C30\u0C2E\u0C02\u0C32\u0C4B \u0C05\u0C2E\u0C30\u0C4D\u0C1A\u0C3E\u0C28\u0C41.`,count:e=>`\u0C17\u0C4D\u0C30\u0C3F\u0C21\u0C4D\u200C\u0C32\u0C4B \u0C2E\u0C4A\u0C24\u0C4D\u0C24\u0C02 ${e} \u0C35\u0C30\u0C41\u0C38\u0C32\u0C41 \u0C09\u0C28\u0C4D\u0C28\u0C3E\u0C2F\u0C3F.`,highest:(e,t,A)=>`\u0C05\u0C24\u0C4D\u0C2F\u0C27\u0C3F\u0C15 ${e} \u0C35\u0C3F\u0C32\u0C41\u0C35 ${t}. \u0C07\u0C26\u0C3F ${A}\u0C15\u0C41 \u0C38\u0C02\u0C2C\u0C02\u0C27\u0C3F\u0C02\u0C1A\u0C3F\u0C28\u0C26\u0C3F.`,lowest:(e,t,A)=>`\u0C05\u0C24\u0C4D\u0C2F\u0C32\u0C4D\u0C2A ${e} \u0C35\u0C3F\u0C32\u0C41\u0C35 ${t}. \u0C07\u0C26\u0C3F ${A}\u0C15\u0C41 \u0C38\u0C02\u0C2C\u0C02\u0C27\u0C3F\u0C02\u0C1A\u0C3F\u0C28\u0C26\u0C3F.`,average:(e,t)=>`${e} \u0C38\u0C17\u0C1F\u0C41 \u0C35\u0C3F\u0C32\u0C41\u0C35 ${t}.`,total:(e,t)=>`${e} \u0C2E\u0C4A\u0C24\u0C4D\u0C24\u0C02 \u0C35\u0C3F\u0C32\u0C41\u0C35 ${t}.`,noData:"\u0C35\u0C3F\u0C36\u0C4D\u0C32\u0C47\u0C37\u0C3F\u0C02\u0C1A\u0C21\u0C3E\u0C28\u0C3F\u0C15\u0C3F \u0C21\u0C47\u0C1F\u0C3E \u0C32\u0C47\u0C26\u0C41.",noColumn:"\u0C35\u0C3F\u0C36\u0C4D\u0C32\u0C47\u0C37\u0C3F\u0C02\u0C1A\u0C21\u0C3E\u0C28\u0C3F\u0C15\u0C3F \u0C24\u0C17\u0C3F\u0C28 \u0C15\u0C3E\u0C32\u0C2E\u0C4D \u0C15\u0C28\u0C2C\u0C21\u0C32\u0C47\u0C26\u0C41.",noNumericData:e=>`${e}\u0C32\u0C4B \u0C38\u0C02\u0C16\u0C4D\u0C2F\u0C3E \u0C38\u0C2E\u0C3E\u0C1A\u0C3E\u0C30\u0C02 \u0C32\u0C47\u0C26\u0C41.`,notFound:e=>`\u201C${e}\u201D\u0C15\u0C41 \u0C38\u0C30\u0C3F\u0C2A\u0C4B\u0C32\u0C47 \u0C38\u0C2E\u0C3E\u0C1A\u0C3E\u0C30\u0C02 \u0C15\u0C28\u0C2C\u0C21\u0C32\u0C47\u0C26\u0C41.`,needName:"\u0C36\u0C4B\u0C27\u0C3F\u0C02\u0C1A\u0C21\u0C3E\u0C28\u0C3F\u0C15\u0C3F \u0C12\u0C15 \u0C35\u0C3F\u0C32\u0C41\u0C35 \u0C07\u0C35\u0C4D\u0C35\u0C02\u0C21\u0C3F.",fallback:"\u0C17\u0C4D\u0C30\u0C3F\u0C21\u0C4D\u200C\u0C32\u0C4B \u0C36\u0C4B\u0C27\u0C28, \u0C15\u0C4D\u0C30\u0C2E\u0C2C\u0C26\u0C4D\u0C27\u0C40\u0C15\u0C30\u0C23, \u0C32\u0C46\u0C15\u0C4D\u0C15\u0C3F\u0C02\u0C2A\u0C41 \u0C2E\u0C30\u0C3F\u0C2F\u0C41 \u0C21\u0C47\u0C1F\u0C3E \u0C35\u0C3F\u0C36\u0C4D\u0C32\u0C47\u0C37\u0C23 \u0C1A\u0C47\u0C2F\u0C17\u0C32\u0C28\u0C41.",unsupportedVoice:"\u0C08 \u0C2C\u0C4D\u0C30\u0C4C\u0C1C\u0C30\u0C4D\u200C\u0C32\u0C4B \u0C35\u0C3E\u0C2F\u0C3F\u0C38\u0C4D \u0C07\u0C28\u0C4D\u200C\u0C2A\u0C41\u0C1F\u0C4D\u200C\u0C15\u0C41 \u0C2E\u0C26\u0C4D\u0C26\u0C24\u0C41 \u0C32\u0C47\u0C26\u0C41."}};function Ke(e){return e.toLowerCase().trim().replace(/\s+/g," ")}function Sl(e,t){let A=Ke(e);if(t==="te-IN")return/^(శోధించు|శోధించండి|వెతుకు|వెతకండి|చూపించు|చూపించండి|ఫిల్టర్)/.test(A)?{type:"search",payload:A.replace(/^(శోధించు|శోధించండి|వెతుకు|వెతకండి|చూపించు|చూపించండి|ఫిల్టర్)\s*/u,"").trim()||e}:/క్రమబద్ధీకర|అమర్చ|సార్ట్/.test(A)?{type:"sort",payload:{key:void 0,dir:/అవరోహణ|పెద్ద|అధిక|చివర/.test(A)?"desc":"asc"}}:/ఎన్ని|ఎంతమంది|లెక్క|మొత్తం వరుస|వరుసలు/.test(A)?{type:"question",payload:e}:/అత్యధిక|గరిష్ఠ|పెద్ద|ఎక్కువ/.test(A)?{type:"question",payload:e}:/అత్యల్ప|కనిష్ఠ|చిన్న|తక్కువ/.test(A)?{type:"question",payload:e}:/సగటు|సగటు విలువ/.test(A)?{type:"question",payload:e}:/మొత్తం|కలిపి/.test(A)?{type:"question",payload:e}:{type:"search",payload:e};if(/^(search|find|show|filter)/.test(A))return{type:"search",payload:A.replace(/^(search|find|show|filter)\s+(for\s+|by\s+)?/,"").trim()||e};if(/sort/.test(A)){let o=/desc|descending|high|higher|large|largest|top/.test(A);return{type:"sort",payload:{key:A.match(/(?:by|on)\s+([a-z0-9_-]+)/)?.[1],dir:o?"desc":"asc"}}}return/how many|count|highest|maximum|max|top|largest|lowest|minimum|min|smallest|bottom|average|avg|mean|sum|total|who|which|where|whose/.test(A)?{type:"question",payload:e}:{type:"search",payload:e}}function mi(e,t){let A=Ke(e);return t.find(o=>{let n=Ke(o.key),r=Ke(o.label);return A.includes(n)||A.includes(r)})}function JA(e,t){return e.toLocaleString(t==="te-IN"?"te-IN":"en-IN")}function Gl(e,t,A,o){let n=fi[o];if(t.length===0)return n.noData;let r=Ke(e),i=A.filter(m=>m.type==="number"),s=mi(e,A),g=s?.type==="number"?s:i[0],a=/how many|count|rows|ఎన్ని|ఎంతమంది|లెక్క|వరుసలు/.test(r);if(a)return n.count(t.length);if(/highest|maximum|max|top|largest|అత్యధిక|గరిష్ఠ|పెద్ద|ఎక్కువ/.test(r)){let m=s??g;if(!m)return n.noColumn;let p=t.map(b=>({row:b,value:Number(b[m.key])})).filter(b=>!Number.isNaN(b.value)).sort((b,S)=>S.value-b.value);if(p.length===0)return n.noNumericData(m.label);let c=p[0],d=A.find(b=>b.key==="name"||Ke(b.label)==="name"),Q=d?String(c.row[d.key]??""):o==="te-IN"?"\u0C08 \u0C35\u0C30\u0C41\u0C38":"this row";return n.highest(m.label,JA(c.value,o),Q)}if(/lowest|minimum|min|smallest|bottom|అత్యల్ప|కనిష్ఠ|చిన్న|తక్కువ/.test(r)){let m=s??g;if(!m)return n.noColumn;let p=t.map(b=>({row:b,value:Number(b[m.key])})).filter(b=>!Number.isNaN(b.value)).sort((b,S)=>b.value-S.value);if(p.length===0)return n.noNumericData(m.label);let c=p[0],d=A.find(b=>b.key==="name"||Ke(b.label)==="name"),Q=d?String(c.row[d.key]??""):o==="te-IN"?"\u0C08 \u0C35\u0C30\u0C41\u0C38":"this row";return n.lowest(m.label,JA(c.value,o),Q)}if(/average|avg|mean|సగటు/.test(r)){let m=s??g;if(!m)return n.noColumn;let p=t.map(d=>Number(d[m.key])).filter(d=>!Number.isNaN(d));if(p.length===0)return n.noNumericData(m.label);let c=p.reduce((d,Q)=>d+Q,0)/p.length;return n.average(m.label,JA(Math.round(c*100)/100,o))}if(/sum|total|మొత్తం|కలిపి/.test(r)&&!a){let m=s??g;if(!m)return n.noColumn;let p=t.map(d=>Number(d[m.key])).filter(d=>!Number.isNaN(d));if(p.length===0)return n.noNumericData(m.label);let c=p.reduce((d,Q)=>d+Q,0);return n.total(m.label,JA(c,o))}let h=r.match(/[\p{L}\p{N}_-]+/gu)??[],y=new Set(["who","what","which","where","whose","is","the","has","have","show","find","search","for","by","about"]),B=h.filter(m=>!y.has(m)).join(" ").trim();if(B){let m=t.find(p=>Object.values(p).some(c=>String(c??"").toLowerCase().includes(B.toLowerCase())));return m?A.map(p=>`${p.label}: ${String(m[p.key]??"")}`).join(o==="te-IN"?" \xB7 ":", "):n.notFound(B)}return n.fallback}function vl(e,t){if(typeof window>"u"||!window.speechSynthesis)return;window.speechSynthesis.cancel();let A=new SpeechSynthesisUtterance(e);A.lang=t,A.rate=1,A.pitch=1,window.speechSynthesis.speak(A)}function Rl(e){let[t,A]=ct(!1),[o,n]=ct(""),[r,i]=ct(!0),s=pi(null);rA(()=>{if(typeof window>"u")return;let l=window.SpeechRecognition||window.webkitSpeechRecognition;if(!l){i(!1),s.current=null;return}let I=new l;return I.continuous=!1,I.interimResults=!1,I.lang=e,I.onresult=u=>{let C=u?.results?.[0]?.[0]?.transcript??"";n(C),A(!1)},I.onerror=()=>{A(!1)},I.onend=()=>{A(!1)},s.current=I,()=>{try{I.stop()}catch{}s.current=null}},[e]);let g=So(()=>{if(s.current){n(""),A(!0);try{s.current.start()}catch{A(!1)}}},[]),a=So(()=>{try{s.current?.stop()}catch{}A(!1)},[]);return{listening:t,transcript:o,supported:r,start:g,stop:a}}function Nl(){return we("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[N("circle",{cx:"11",cy:"11",r:"6.5"}),N("path",{d:"m16 16 5 5"})]})}function Fl(){return we("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[N("rect",{x:"8",y:"3",width:"8",height:"12",rx:"4"}),N("path",{d:"M5 11a7 7 0 0 0 14 0"}),N("path",{d:"M12 18v3"}),N("path",{d:"M8 21h8"})]})}function Tl(){return we("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[N("path",{d:"m4 4 16 8-16 8 4-8-4-8Z"}),N("path",{d:"M8 12h12"})]})}function Ml(){return we("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[N("path",{d:"m6 6 12 12"}),N("path",{d:"m18 6-12 12"})]})}function Ll({data:e,columns:t,onSearch:A,onSort:o,theme:n="light",language:r="en-US",inputLanguage:i="en-US",embedded:s=!1,agent:g,onInputLanguageChange:a}){let l=fi[r],[I,u]=ct(i);rA(()=>{u(i)},[i]);let[C,h]=ct(!1),y=n==="dark",[f,B]=ct(s),[m,p]=ct(""),[c,d]=ct([]),Q=pi(null),{listening:b,transcript:S,supported:F,start:P,stop:G}=Rl(I),D=Ci(()=>({bg:y?"#0F172A":"#FFFFFF",surface:y?"#1E293B":"#F8FAFC",border:y?"#334155":"#E2E8F0",text:y?"#F1F5F9":"#0F172A",muted:y?"#94A3B8":"#64748B",accent:"#047857",userMsg:y?"#334155":"#DBEAFE",aiMsg:y?"#1E293B":"#F0FDF4"}),[y]),E=Ci(()=>({role:"ai",text:r==="te-IN"?"\u0C2E\u0C40 \u0C17\u0C4D\u0C30\u0C3F\u0C21\u0C4D \u0C21\u0C47\u0C1F\u0C3E \u0C17\u0C41\u0C30\u0C3F\u0C02\u0C1A\u0C3F \u0C2A\u0C4D\u0C30\u0C36\u0C4D\u0C28 \u0C05\u0C21\u0C17\u0C02\u0C21\u0C3F.":"Ask me about your grid data.",time:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),[r]);rA(()=>{d(R=>R.length>0?R:[E])},[E]),rA(()=>{Q.current?.scrollIntoView({behavior:"smooth"})},[c]);let j=()=>new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),Ae=So(async R=>{let oe=R.trim();if(!oe)return;d(Y=>[...Y,{role:"user",text:oe,time:j()}]),p("");let T="";if(g){h(!0);try{T=(await g.ask(oe)).message}catch{T=l.fallback}finally{h(!1)}}else{let Y=Sl(oe,r);if(Y.type==="question")T=Gl(Y.payload??oe,e,t,r);else if(Y.type==="search"){let X=String(Y.payload??oe);A?.(X),T=l.searchStarted(X)}else if(Y.type==="sort"){let X=Y.payload?.key,q=X?t.find(z=>Ke(z.key)===Ke(X)||Ke(z.label)===Ke(X)):void 0;if(q||(q=mi(oe,t)),q&&o){let z=Y.payload?.dir==="desc"?"desc":"asc";o(String(q.key),z),T=z==="asc"?l.sortedAscending(q.label):l.sortedDescending(q.label)}else T=l.noColumn}}T||(T=l.fallback),d(Y=>[...Y,{role:"ai",text:T,time:j()}]),vl(T,r)},[g,t,e,r,A,o,l]);rA(()=>{S&&Ae(S)},[S,Ae]);let J=()=>{Ae(m)},ee=r==="te-IN"?["\u0C0E\u0C28\u0C4D\u0C28\u0C3F \u0C35\u0C30\u0C41\u0C38\u0C32\u0C41","\u0C36\u0C4B\u0C27\u0C3F\u0C02\u0C1A\u0C02\u0C21\u0C3F","\u0C15\u0C4D\u0C30\u0C2E\u0C02"]:["how many rows","search","sort"],ie=we("div",{style:{width:s?"100%":360,maxWidth:s?"100%":"calc(100vw - 48px)",height:s?390:480,maxHeight:"70vh",background:D.bg,border:`1px solid ${D.border}`,borderRadius:s?12:16,boxShadow:s?"none":"0 20px 40px rgba(0,0,0,0.15)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[we("div",{style:{padding:"12px 14px",background:D.accent,color:"#FFFFFF",display:"flex",alignItems:"center",gap:10},children:[N("div",{style:{width:34,height:34,borderRadius:10,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.2)",fontSize:17},children:"AI"}),we("div",{style:{flex:1,minWidth:0},children:[N("div",{style:{fontWeight:700,fontSize:14},children:l.title}),N("div",{style:{fontSize:11,opacity:.9},children:l.subtitle})]}),!s&&N("button",{type:"button",onClick:()=>B(!1),"aria-label":l.close,title:l.close,style:{width:32,height:32,border:"none",borderRadius:8,background:"rgba(255,255,255,0.12)",color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:N(Ml,{})})]}),we("div",{style:{padding:"8px 10px",borderBottom:`1px solid ${D.border}`,display:"flex",alignItems:"center",gap:8,background:D.surface},children:[N("span",{style:{fontSize:11,color:D.muted},children:l.inputLanguage}),we("select",{value:I,onChange:R=>{let oe=R.target.value;u(oe),a?.(oe)},disabled:b,"aria-label":l.inputLanguage,style:{padding:"5px 8px",borderRadius:7,border:`1px solid ${D.border}`,background:D.bg,color:D.text,fontSize:11},children:[N("option",{value:"en-US",children:"English (US)"}),N("option",{value:"en-IN",children:"English (India)"}),N("option",{value:"as-IN",children:"Assamese"}),N("option",{value:"bn-IN",children:"Bengali"}),N("option",{value:"brx-IN",children:"Bodo"}),N("option",{value:"doi-IN",children:"Dogri"}),N("option",{value:"gu-IN",children:"Gujarati"}),N("option",{value:"hi-IN",children:"Hindi"}),N("option",{value:"kn-IN",children:"Kannada"}),N("option",{value:"ks-IN",children:"Kashmiri"}),N("option",{value:"kok-IN",children:"Konkani"}),N("option",{value:"mai-IN",children:"Maithili"}),N("option",{value:"ml-IN",children:"Malayalam"}),N("option",{value:"mni-IN",children:"Manipuri"}),N("option",{value:"mr-IN",children:"Marathi"}),N("option",{value:"ne-IN",children:"Nepali"}),N("option",{value:"or-IN",children:"Odia"}),N("option",{value:"pa-IN",children:"Punjabi"}),N("option",{value:"sa-IN",children:"Sanskrit"}),N("option",{value:"sat-IN",children:"Santali"}),N("option",{value:"sd-IN",children:"Sindhi"}),N("option",{value:"ta-IN",children:"Tamil"}),N("option",{value:"te-IN",children:"Telugu"}),N("option",{value:"ur-IN",children:"Urdu"})]})]}),we("div",{style:{flex:1,overflowY:"auto",padding:10,display:"flex",flexDirection:"column",gap:8},children:[c.map((R,oe)=>we("div",{style:{alignSelf:R.role==="user"?"flex-end":"flex-start",maxWidth:"88%",padding:"8px 11px",borderRadius:11,background:R.role==="user"?D.userMsg:D.aiMsg,color:D.text,fontSize:13,lineHeight:1.5},children:[N("div",{children:R.text}),N("div",{style:{marginTop:3,fontSize:10,opacity:.55,textAlign:"right"},children:R.time})]},`${R.time}-${oe}`)),b&&N("div",{style:{alignSelf:"flex-end",padding:"8px 11px",borderRadius:11,background:y?"#3F1D2E":"#FEE2E2",color:y?"#FCA5A5":"#991B1B",fontSize:13},children:l.listening}),(C||g?.loading)&&N("div",{role:"status","aria-live":"polite",style:{alignSelf:"flex-start",padding:"8px 11px",borderRadius:11,background:D.aiMsg,color:D.muted,fontSize:13},children:l.working}),N("div",{ref:Q})]}),N("div",{style:{padding:"7px 10px",borderTop:`1px solid ${D.border}`,display:"flex",gap:6,overflowX:"auto",flexShrink:0},children:ee.map(R=>N("button",{type:"button",onClick:()=>Ae(R),style:{padding:"5px 9px",borderRadius:12,border:`1px solid ${D.border}`,background:D.surface,color:D.text,fontSize:10.5,cursor:"pointer",whiteSpace:"nowrap"},children:R},R))}),we("div",{style:{padding:9,display:"flex",gap:6,borderTop:`1px solid ${D.border}`,background:D.surface},children:[we("div",{style:{position:"relative",flex:1},children:[N(Nl,{}),N("input",{type:"text",value:m,onChange:R=>p(R.target.value),onKeyDown:R=>{R.key==="Enter"&&J()},placeholder:l.placeholder,"aria-label":l.ask,style:{width:"100%",boxSizing:"border-box",padding:"9px 10px 9px 34px",borderRadius:8,border:`1px solid ${D.border}`,background:D.bg,color:D.text,fontSize:12,outline:"none"}})]}),F?N("button",{type:"button",onClick:b?G:P,"aria-label":b?l.listening:l.speakNow,title:b?l.listening:l.speakNow,style:{width:38,height:38,border:"none",borderRadius:8,background:b?"#B91C1C":D.accent,color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",flexShrink:0},children:N(Fl,{})}):null,N("button",{type:"button",onClick:J,disabled:!m.trim(),"aria-label":l.send,title:l.send,style:{width:38,height:38,border:"none",borderRadius:8,background:m.trim()?D.accent:D.muted,color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",cursor:m.trim()?"pointer":"not-allowed",opacity:m.trim()?1:.6,flexShrink:0},children:N(Tl,{})})]})]});return s?N("div",{style:{width:"100%",minWidth:0},children:f?ie:we("button",{type:"button",onClick:()=>B(!0),"aria-label":l.open,style:{minHeight:40,padding:"8px 13px",borderRadius:9,border:"1px solid #10B981",background:y?"#064E3B":"#ECFDF5",color:y?"#A7F3D0":"#047857",display:"inline-flex",alignItems:"center",gap:8,cursor:"pointer",fontSize:12,fontWeight:600},children:[N("span",{"aria-hidden":"true",children:"AI"}),l.ask]})}):we(Yl,{children:[!f&&N("button",{type:"button",onClick:()=>B(!0),"aria-label":l.open,title:l.title,style:{position:"fixed",bottom:24,right:24,zIndex:9998,width:56,height:56,borderRadius:28,background:D.accent,color:"#FFFFFF",border:"none",cursor:"pointer",boxShadow:"0 8px 20px rgba(4,120,87,0.3)",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,fontSize:14},children:"AI"}),f&&N("div",{style:{position:"fixed",bottom:90,right:24,zIndex:9997},children:ie}),N("style",{children:`
|
|
393
393
|
@keyframes yuktai-ai-pulse {
|
|
394
394
|
0%, 100% {
|
|
395
395
|
transform: scale(1);
|
|
@@ -399,4 +399,4 @@ ${yo(p,n)}`};break}}}catch(p){m={...f,success:!1,message:`This step failed: ${p
|
|
|
399
399
|
transform: scale(1.05);
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
|
-
`})]})}var Go=Ml;import{useCallback as sA,useEffect as Yl,useRef as vo,useState as PA}from"react";var Ul={en:{done:"Done.",toolMissing:e=>`The action "${e}" is not available here.`,missingInput:e=>`Missing: ${e}.`,notUnderstood:"Sorry, I didn't understand. Try: a word to search, \u201Csort by <column>\u201D, or \u201Cclear filters\u201D.",noMatch:e=>`Nothing matched "${e}".`,failed:"Something went wrong while running this action."},te:{done:"\u0C2A\u0C42\u0C30\u0C4D\u0C24\u0C2F\u0C3F\u0C02\u0C26\u0C3F.",toolMissing:e=>`"${e}" \u0C38\u0C4C\u0C15\u0C30\u0C4D\u0C2F\u0C02 \u0C07\u0C15\u0C4D\u0C15\u0C21 \u0C05\u0C02\u0C26\u0C41\u0C2C\u0C3E\u0C1F\u0C41\u0C32\u0C4B \u0C32\u0C47\u0C26\u0C41.`,missingInput:e=>`\u0C07\u0C35\u0C3F \u0C15\u0C3E\u0C35\u0C3E\u0C32\u0C3F: ${e}.`,notUnderstood:"\u0C15\u0C4D\u0C37\u0C2E\u0C3F\u0C02\u0C1A\u0C02\u0C21\u0C3F, \u0C05\u0C30\u0C4D\u0C25\u0C02 \u0C15\u0C3E\u0C32\u0C47\u0C26\u0C41. \u0C07\u0C32\u0C3E \u0C2A\u0C4D\u0C30\u0C2F\u0C24\u0C4D\u0C28\u0C3F\u0C02\u0C1A\u0C02\u0C21\u0C3F: \u0C35\u0C46\u0C24\u0C15\u0C3E\u0C32\u0C4D\u0C38\u0C3F\u0C28 \u0C2A\u0C26\u0C02, \u201C<\u0C15\u0C3E\u0C32\u0C2E\u0C4D> \u0C2A\u0C4D\u0C30\u0C15\u0C3E\u0C30\u0C02 \u0C15\u0C4D\u0C30\u0C2E\u0C02\u201D, \u0C32\u0C47\u0C26\u0C3E \u201C\u0C2B\u0C3F\u0C32\u0C4D\u0C1F\u0C30\u0C4D\u0C32\u0C41 \u0C24\u0C40\u0C38\u0C47\u0C2F\u0C3F\u201D.",noMatch:e=>`"${e}" \u0C15\u0C3F \u0C0F\u0C2E\u0C40 \u0C38\u0C30\u0C3F\u0C2A\u0C4B\u0C32\u0C47\u0C26\u0C41.`,failed:"\u0C08 \u0C2A\u0C28\u0C3F \u0C1A\u0C47\u0C38\u0C4D\u0C24\u0C41\u0C02\u0C21\u0C17\u0C3E \u0C38\u0C2E\u0C38\u0C4D\u0C2F \u0C35\u0C1A\u0C4D\u0C1A\u0C3F\u0C02\u0C26\u0C3F."}},hi=e=>e.normalize("NFC").toLowerCase().trim(),ut={clearFilters:/\b(clear|remove|reset)\b.*\bfilters?\b|ఫిల్టర్.*(తీసే|తొలగ)/i,clearSort:/\b(clear|remove|reset)\b.*\bsort(ing)?\b|క్రమం.*(తీసే|తొలగ)/i,count:/^\s*(how many|count)\b|ఎన్ని|లెక్క/i,sort:/\bsort\b|\border by\b|క్రమ|అమర్చ|సార్ట్/i,desc:/\b(desc|descending|z\s*-\s*a|highest|largest|most)\b|అవరోహణ|తగ్గే|పెద్ద|అధిక|చివర|ఎక్కువ నుండి/i,openEn:/^\s*open\s+(.+?)\s*$/i,openTe:/^\s*(.+?)\s*(తెరువు|తెరవండి|తెరవు)\s*$/,searchFiller:/^\s*(search(\s+for)?|find|show(\s+me)?|filter(\s+by)?|look\s+for|వెతుకు|వెతకండి|శోధించు|శోధించండి|చూపించు|చూపించండి)\s+|\s+(వెతుకు|వెతకండి|శోధించు|శోధించండి|చూపించు|చూపించండి)\s*$/gi};function Jl(e,t){let A=hi(e),o=null;for(let n of t)for(let r of[n.label,n.key]){let i=hi(r);i&&A.includes(i)&&(!o||i.length>o.len)&&(o={key:n.key,len:i.length})}return o?.key??null}function Qi(e,t){let A=(e??"").trim();if(!A)return null;if(ut.clearFilters.test(A))return{kind:"tool",tool:"clear_filters",input:{}};if(ut.clearSort.test(A))return{kind:"tool",tool:"clear_sort",input:{}};if(ut.count.test(A))return{kind:"tool",tool:"count",input:{}};if(ut.sort.test(A)){let r=Jl(A,t.columns);return r?{kind:"tool",tool:"sort",input:{key:r,direction:ut.desc.test(A)?"desc":"asc"}}:null}let o=A.match(ut.openEn)??A.match(ut.openTe);if(o?.[1])return{kind:"open",text:o[1].trim()};let n=A.replace(ut.searchFiller,"").trim();return n?{kind:"tool",tool:"search",input:{query:n}}:null}function Pl(e){return!!e&&typeof e=="object"&&typeof e.success=="boolean"&&typeof e.message=="string"}function Kl(e,t){let A=e.inputSchema?.required;return Array.isArray(A)?A.map(String).filter(o=>t[o]===void 0||t[o]===null||String(t[o]).trim()===""):[]}function ql(e,t){let A=e.find(n=>n.name===t);if(A)return A;let o=e.filter(n=>n.name.endsWith(`_${t}`)).sort((n,r)=>n.name.length-r.name.length);if(o.length!==0&&!(o.length>1&&o[0].name.length===o[1].name.length))return o[0]}function yi(e){return e.normalize("NFC").trim().toLocaleLowerCase()}function Hl(e,t){let A=yi(e);return t.find(o=>o.phrases.some(n=>{let r=yi(n);return r.length>0&&A.includes(r)}))}function KA({tools:e,data:t=[],onResult:A,onError:o,locale:n="en",columns:r=[],rowKey:i="id",parseIntent:s,customRules:g=[],historyLimit:a=20}){let l=Ul[n],[I,u]=PA(0),[C,h]=PA(null),[y,f]=PA(null),[B,m]=PA([]),p=vo({tools:e,data:t,onResult:A,onError:o,columns:r,rowKey:i,parseIntent:s,customRules:g,historyLimit:a,m:l,locale:n});p.current={tools:e,data:t,onResult:A,onError:o,columns:r,rowKey:i,parseIntent:s,customRules:g,historyLimit:a,m:l,locale:n};let c=vo(!0),d=vo(0);Yl(()=>(c.current=!0,()=>{c.current=!1}),[]);let Q=sA((G,D,E,j,Ae)=>{c.current&&(Ae===d.current&&h(E),m(J=>[...J,{id:Ae,tool:G,input:D,result:E,source:j,at:Date.now()}].slice(-p.current.historyLimit)))},[]),b=sA(async(G,D,E)=>{let{tools:j,onResult:Ae,onError:J,m:ee}=p.current,ie=++d.current,R=ql(j,G);if(!R){let T={success:!1,message:ee.toolMissing(G),error:{code:"NOT_SUPPORTED"}},Y=new Error(T.message);return c.current&&f(Y),J?.(Y),Q(G,D,T,E,ie),T}let oe=Kl(R,D);if(oe.length){let T={success:!1,message:ee.missingInput(oe.join(", ")),error:{code:"INVALID_INPUT"},tool:R.name};return Q(R.name,D,T,E,ie),Ae?.(T),T}c.current&&u(T=>T+1);try{let T=await R.execute(D),Y=Pl(T)?{...T,tool:R.name}:{success:!0,message:ee.done,data:T,tool:R.name};return c.current&&Y.success&&f(null),Q(R.name,D,Y,E,ie),Ae?.(Y),Y}catch(T){let Y=T instanceof Error?T:new Error(String(T)),X={success:!1,message:ee.failed,error:{code:"INTERNAL"},tool:R.name};return c.current&&f(Y),J?.(Y),Q(R.name,D,X,E,ie),X}finally{c.current&&u(T=>Math.max(0,T-1))}},[Q]),S=sA((G,D={})=>b(G,D??{},"tool"),[b]),F=sA(async G=>{let{columns:D,locale:E,parseIntent:j,customRules:Ae,data:J,m:ee,rowKey:ie}=p.current,R=Hl(G,Ae??[]);if(R){let q={input:G,data:J,columns:D,executeTool:S};try{let xe={success:!0,message:await R.execute(q),tool:`rule:${R.name}`};return Q(`rule:${R.name}`,{text:G},xe,"ask",++d.current),p.current.onResult?.(xe),xe}catch(z){let xe=z instanceof Error?z:new Error(String(z)),ve={success:!1,message:ee.failed,error:{code:"INTERNAL"},tool:`rule:${R.name}`};return c.current&&f(xe),p.current.onError?.(xe),Q(`rule:${R.name}`,{text:G},ve,"ask",++d.current),ve}}let T=(j??Qi)(G,{columns:D,locale:E});if(!T){let q={success:!1,message:ee.notUnderstood,error:{code:"NOT_UNDERSTOOD"}};return Q("ask",{text:G},q,"ask",++d.current),q}if(T.kind==="tool")return b(T.tool,T.input,"ask");let Y=await b("search",{query:T.text},"ask"),X=Array.isArray(Y.data)?Y.data:[];if(!Y.success)return Y;if(X.length===0){let q={success:!1,message:ee.noMatch(T.text),error:{code:"NOT_FOUND"},tool:Y.tool};return Q("open",{text:T.text},q,"ask",++d.current),q}return b("open",{id:he(X[0],ie)},"ask")},[S,Q,b]),P=sA(()=>{m([]),h(null),f(null)},[]);return{loading:I>0,tools:e,executeTool:S,ask:F,lastResult:C,lastError:y,history:B,clearHistory:P}}var $l=KA;import{useEffect as Wl,useMemo as zl,useRef as Ro}from"react";function Ol(e){return JSON.stringify(e.map(t=>[t.name,t.title,t.description,t.inputSchema]))}function Xl({tools:e,data:t=[],columns:A=[],rowKey:o,locale:n,onSelectRow:r,onHighlightRows:i,onOpenRow:s,name:g="yuktai_grid",descriptions:a,onStatusChange:l}){let I=zl(()=>e||oA({data:t,columns:A,rowKey:o,locale:n,onSelectRow:r,onHighlightRows:i,onOpenRow:s},{name:g,descriptions:a}),[e,t,A,o,n,r,i,s,g,a]),u=Ro(I);u.current=I;let C=Ro(l);C.current=l;let h=Ro(Promise.resolve()),y=Ol(I);return Wl(()=>{let f=d=>C.current?.(d),B=typeof document<"u"?document.modelContext:void 0;if(!B?.registerTool){f({state:"unsupported",registered:[],errors:[]});return}let m=new AbortController,p=u.current,c=h.current.then(async()=>{if(m.signal.aborted)return;f({state:"registering",registered:[],errors:[]});let d=[],Q=[];for(let b of p){if(m.signal.aborted)return;try{await B.registerTool({name:b.name,title:b.title,description:b.description,inputSchema:b.inputSchema,execute:S=>{let F=u.current.find(P=>P.name===b.name);return F?F.execute(S??{}):{success:!1,message:`Tool "${b.name}" is no longer available.`,error:{code:"NOT_SUPPORTED"}}}},{signal:m.signal}),d.push(b.name)}catch(S){Q.push({tool:b.name,message:S instanceof Error?S.message:String(S)})}}m.signal.aborted||f({state:Q.length===0?"ready":d.length>0?"partial":"error",registered:d,errors:Q})});return h.current=c.catch(()=>{}),()=>m.abort()},[y]),null}var qA=Xl;import{useEffect as Vl,useMemo as jl,useState as Zl}from"react";function HA(e,t){let A=go(e,t),[o,n]=Zl(()=>A?En():null);return Vl(()=>{if(!A||o)return;let r=!0;return co().then(i=>{r&&i&&n(i)}),()=>{r=!1}},[A,o]),jl(()=>A&&o?_t.create(o):null,[A,o])}function Bi(e,t){return e.map(A=>t.map(o=>String(A[o.key]??"").toLowerCase()).join(eA))}function _l(e,t){let A=new Float64Array(e.length),o=0;for(let n=0;n<e.length;n++){let r=e[n][t];if(r==null){A[n]=NaN;continue}if(typeof r!="number"||Number.isNaN(r))return null;A[n]=r,o++}return o?A:null}function bi(e){return e.search==="rust"||e.sort==="rust"?"rust":e.search||e.sort?"ts":null}function Ei({data:e,columns:t,searchText:A,filters:o,toolColumns:n,sortKey:r,sortDirection:i,locale:s,core:g=null,searchReady:a=!1,stats:l}){let I=[...e];if(l&&(l.search=null,l.sort=null),A.trim()){let u=A.trim().toLowerCase(),C=g&&a?g.search(u):null;l&&(l.search=C?"rust":"ts"),C?I=Lt(e,C):I=I.filter(h=>t.some(y=>String(h[y.key]??"").toLowerCase().includes(u)))}if(o.length&&(I=st(I,n,o)),r){if(g){let u=_l(I,r),C=u&&g.sortByKeys(u,i!=="asc");if(C)return l&&(l.sort="rust"),Lt(I,C)}l&&(l.sort="ts"),I.sort((u,C)=>{let h=u[r],y=C[r];if(h==null&&y==null)return 0;if(h==null)return 1;if(y==null)return-1;if(typeof h=="number"&&typeof y=="number")return i==="asc"?h-y:y-h;let f=String(h).localeCompare(String(y),s,{numeric:!0,sensitivity:"base"});return i==="asc"?f:-f})}return I}import{jsx as K,jsxs as Ce}from"react/jsx-runtime";var ec={"en-US":{search:"Search...",searchAria:"Search grid",rows:"rows",row:"row",loading:"Loading...",noData:"No data found.",selectRow:"Select row",pageSize:"Page size",page:"Page",of:"of",previous:"Previous",next:"Next",yes:"Yes",no:"No",sortAscending:"Sort ascending",sortDescending:"Sort descending",filtersActive:e=>`${e} filter(s) applied`,clearFilters:"Clear filters"},"te-IN":{search:"\u0C36\u0C4B\u0C27\u0C3F\u0C02\u0C1A\u0C02\u0C21\u0C3F...",searchAria:"\u0C17\u0C4D\u0C30\u0C3F\u0C21\u0C4D\u200C\u0C32\u0C4B \u0C36\u0C4B\u0C27\u0C3F\u0C02\u0C1A\u0C02\u0C21\u0C3F",rows:"\u0C35\u0C30\u0C41\u0C38\u0C32\u0C41",row:"\u0C35\u0C30\u0C41\u0C38",loading:"\u0C32\u0C4B\u0C21\u0C4D \u0C05\u0C35\u0C41\u0C24\u0C4B\u0C02\u0C26\u0C3F...",noData:"\u0C21\u0C47\u0C1F\u0C3E \u0C15\u0C28\u0C2C\u0C21\u0C32\u0C47\u0C26\u0C41.",selectRow:"\u0C35\u0C30\u0C41\u0C38\u0C28\u0C41 \u0C0E\u0C02\u0C1A\u0C41\u0C15\u0C4B\u0C02\u0C21\u0C3F",pageSize:"\u0C2A\u0C47\u0C1C\u0C40 \u0C2A\u0C30\u0C3F\u0C2E\u0C3E\u0C23\u0C02",page:"\u0C2A\u0C47\u0C1C\u0C40",of:"\u0C32\u0C4B",previous:"\u0C35\u0C46\u0C28\u0C41\u0C15\u0C15\u0C41",next:"\u0C2E\u0C41\u0C02\u0C26\u0C41\u0C15\u0C41",yes:"\u0C05\u0C35\u0C41\u0C28\u0C41",no:"\u0C15\u0C3E\u0C26\u0C41",sortAscending:"\u0C06\u0C30\u0C4B\u0C39\u0C23 \u0C15\u0C4D\u0C30\u0C2E\u0C02\u0C32\u0C4B \u0C05\u0C2E\u0C30\u0C4D\u0C1A\u0C02\u0C21\u0C3F",sortDescending:"\u0C05\u0C35\u0C30\u0C4B\u0C39\u0C23 \u0C15\u0C4D\u0C30\u0C2E\u0C02\u0C32\u0C4B \u0C05\u0C2E\u0C30\u0C4D\u0C1A\u0C02\u0C21\u0C3F",filtersActive:e=>`${e} \u0C2B\u0C3F\u0C32\u0C4D\u0C1F\u0C30\u0C4D(\u0C32\u0C41) \u0C35\u0C47\u0C36\u0C3E\u0C30\u0C41`,clearFilters:"\u0C2B\u0C3F\u0C32\u0C4D\u0C1F\u0C30\u0C4D\u0C32\u0C41 \u0C24\u0C40\u0C38\u0C47\u0C2F\u0C02\u0C21\u0C3F"}};function tc({size:e=20,color:t="currentColor",strokeWidth:A=2.4}){return Ce("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:A,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[K("circle",{cx:"11",cy:"11",r:"6.5"}),K("path",{d:"m16 16 5 5"})]})}function Ac({size:e=18,color:t="currentColor",strokeWidth:A=2.4,label:o}){return Ce("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:A,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":o?void 0:!0,"aria-label":o,role:o?"img":void 0,children:[o?K("title",{children:o}):null,K("path",{d:"m6 15 6-6 6 6"})]})}function oc({size:e=18,color:t="currentColor",strokeWidth:A=2.4,label:o}){return Ce("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:A,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":o?void 0:!0,"aria-label":o,role:o?"img":void 0,children:[o?K("title",{children:o}):null,K("path",{d:"m6 9 6 6 6-6"})]})}function nc({size:e=20,color:t="currentColor",strokeWidth:A=2.4}){return K("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:A,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:K("path",{d:"m15 18-6-6 6-6"})})}function ic({size:e=20,color:t="currentColor",strokeWidth:A=2.4}){return K("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:A,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:K("path",{d:"m9 18 6-6-6-6"})})}function wi({size:e=18,color:t="currentColor",strokeWidth:A=2.4}){return K("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:A,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:K("path",{d:"m5 12 4 4L19 6"})})}function rc({data:e,columns:t,rowKey:A="id",view:o="auto",mobileBreakpoint:n=768,theme:r="default",locale:i="en-US",ai:s=!1,search:g=!0,selectable:a=!1,selectedKeys:l=[],onSelectionChange:I,pagination:u,loading:C=!1,highlightIds:h=[],highlightColor:y="#fff3a3",autoScrollToHighlight:f=!1,onRowClick:B,onSortChange:m,empty:p,className:c="",inputLanguage:d,toolName:Q="yuktai_grid",toolDescriptions:b,webmcp:S=!1,onWebMCPStatusChange:F,onAgentResult:P,customRules:G=[],engine:D="rust",showSearchTime:E=!1,onSearchTime:j}){let Ae=i==="te-IN"?"te-IN":"en-US",J=ec[Ae],ee=s===!0||typeof s=="object"&&s!==null,ie=u!==!1&&u!==void 0,R=typeof u=="object"?u.pageSize??20:20,oe=typeof u=="object"&&u.sizeOptions&&u.sizeOptions.length>0?u.sizeOptions:[10,20,50,100],[T,Y]=dt(""),[X,q]=dt(1),[z,xe]=dt(R),[ve,L]=dt(),[ne,de]=dt("asc"),[pe,ke]=dt(!1),[fe,He]=dt([]),[De,Ct]=dt([]),Me=kt(()=>wt(t.map(w=>({key:String(w.key),label:w.label,type:w.type}))),[t]);aA(()=>{xe(R),q(1)},[R]),aA(()=>{let w=()=>{ke(window.innerWidth<=n)};return w(),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)}},[n]);let Xe=HA(D,e.length),Qe=kt(()=>Xe?Xe.setSearchTexts(Bi(e,t)):!1,[Xe,e,t]),Re=kt(()=>{let w={search:null,sort:null},M=typeof performance<"u"?performance.now():Date.now(),$=Ei({data:e,columns:t,searchText:T,filters:fe,toolColumns:Me,sortKey:ve,sortDirection:ne,locale:i,core:Xe,searchReady:Qe,stats:w}),Z=(typeof performance<"u"?performance.now():Date.now())-M;return{rows:$,ms:Z,engine:bi(w)}},[e,t,T,fe,Me,ve,ne,i,Xe,Qe]),Se=Re.rows;aA(()=>{!j||!Re.engine||j({query:T.trim(),ms:Re.ms,rows:Re.rows.length,engine:Re.engine})},[Re]);let $e=ie?Math.max(1,Math.ceil(Se.length/z)):1;aA(()=>{X>$e&&q($e)},[X,$e]);let pt=kt(()=>{let w=[...h.map(String),...De];return Array.from(new Set(w))},[h,De]);aA(()=>{if(!f)return;let w=pt[0];if(w==null)return;let M=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(String(w)):String(w).replace(/["\\]/g,"\\$&");document.querySelector(`[data-yuktai-row-id="${M}"]`)?.scrollIntoView({behavior:"smooth",block:"center"})},[pt,f,X]);let St=kt(()=>{if(!ie)return Se;let w=(X-1)*z;return Se.slice(w,w+z)},[Se,ie,X,z]),gA=o==="card"||o==="auto"&&pe,Le=w=>String(w[A]??""),Ve=w=>l.some(M=>String(M)===w),je=w=>pt.some(M=>String(M)===w),ot=w=>{if(!a)return;let M=Le(w),$=Ve(M)?l.filter(Z=>String(Z)!==M):[...l,M];I?.($)},Pt=w=>{if(w.sortable===!1)return;let M=String(w.key),$=ve===M&&ne==="asc"?"desc":"asc";L(M),de($),q(1),m?.({key:M,direction:$})},ft=w=>{Y(w),q(1)},lA=(w,M)=>{let $=t.find(Z=>String(Z.key)===w||Z.label.toLowerCase()===w.toLowerCase());$&&(L(String($.key)),de(M),q(1),m?.({key:String($.key),direction:M}))},mt=Ae==="te-IN"?"te":"en",ht=No(w=>{w?(L(w.key),de(w.direction)):(L(void 0),de("asc")),q(1),m?.(w)},[m]),yt=No(w=>{He(w),q(1)},[]),Ze=No(w=>{if(Ct(w),ie&&w.length){let M=Se.findIndex($=>String($[A]??"")===w[0]);M>=0&&q(Math.floor(M/z)+1)}},[ie,Se,A,z]),Kt=kt(()=>oA({data:e,columns:Me,rowKey:String(A),locale:mt,filters:fe,onHighlightRows:Ze,onFiltersChange:yt,onSortChange:ht,onOpenRow:B?w=>{let M=Se.findIndex(Z=>String(Z[A]??"")===w),$=M>=0?Se[M]:e.find(Z=>String(Z[A]??"")===w);$&&B($,Math.max(M,0))}:void 0,onSelectRow:a&&I?w=>{l.some(M=>String(M)===w)||I([...l.map(String),w])}:void 0},{name:Q,descriptions:b}),[e,Me,A,mt,fe,Ze,yt,ht,B,Se,a,I,l,Q,b]),Qt=KA({tools:Kt,data:e,locale:mt,columns:Me,rowKey:String(A),customRules:G,onResult:P}),qt=kt(()=>Kt.map(w=>({...w,execute:M=>Qt.executeTool(w.name,M)})),[Kt,Qt.executeTool]),cA=()=>{He([]),q(1)},Ht=(w,M,$)=>{if(M.render)return M.render(w[M.key],w,$);let Z=w[M.key];if(Z==null)return"";if(M.type==="date"){let x=new Date(String(Z));if(!Number.isNaN(x.getTime()))return x.toLocaleDateString(i)}return M.type==="boolean"?Z?J.yes:J.no:String(Z)},te=r==="dark",uA={width:"100%",overflow:"hidden",border:r==="high-contrast"?"2px solid #000000":te?"1px solid #334155":"1px solid #e2e8f0",borderRadius:12,background:te?"#0f172a":"#ffffff",color:te?"#f8fafc":"#0f172a",fontFamily:r==="dyslexia"?"Arial, sans-serif":void 0},nt={padding:12,display:"flex",alignItems:"center",gap:12,flexWrap:"wrap",borderBottom:te?"1px solid #334155":"1px solid #e2e8f0"},_e=w=>({width:40,height:40,minWidth:40,display:"inline-flex",alignItems:"center",justifyContent:"center",padding:0,borderRadius:8,border:te?"1px solid #475569":"1px solid #cbd5e1",background:w?te?"#1e293b":"#f8fafc":te?"#1e293b":"#ffffff",color:w?"#94a3b8":te?"#f8fafc":"#0f172a",cursor:w?"not-allowed":"pointer",opacity:w?.55:1});if(C)return Ce("div",{className:c,style:uA,children:[S&&K(qA,{tools:qt,onStatusChange:F}),K("div",{style:{padding:32,textAlign:"center"},children:J.loading})]});let it=t.map(w=>({key:String(w.key),label:w.label,type:w.type==="number"?"number":w.type==="date"?"date":"text"}));return Ce("div",{className:c,style:uA,children:[S&&K(qA,{tools:qt,onStatusChange:F}),(g||ee||fe.length>0)&&Ce("div",{style:nt,children:[g&&Ce("div",{style:{position:"relative",width:"100%",maxWidth:420},children:[K("div",{style:{position:"absolute",left:12,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",color:te?"#cbd5e1":"#64748b",pointerEvents:"none"},children:K(tc,{size:19})}),K("input",{value:T,onChange:w=>{Y(w.target.value),q(1)},placeholder:J.search,"aria-label":J.searchAria,style:{width:"100%",padding:"10px 12px 10px 40px",borderRadius:8,border:te?"1px solid #475569":"1px solid #cbd5e1",background:te?"#1e293b":"#ffffff",color:te?"#ffffff":"#0f172a",outline:"none",boxSizing:"border-box"}})]}),fe.length>0&&Ce("button",{type:"button",onClick:cA,title:J.clearFilters,style:{padding:"6px 10px",borderRadius:999,border:te?"1px solid #475569":"1px solid #cbd5e1",background:te?"#1e293b":"#f1f5f9",color:"inherit",fontSize:12,cursor:"pointer"},children:[J.filtersActive(fe.length)," \u2715"]}),Ce("div",{style:{marginLeft:"auto",fontSize:13,opacity:.7,whiteSpace:"nowrap"},children:[Se.length," ",Se.length===1?J.row:J.rows,E&&Re.engine&&Ce("span",{title:Re.engine==="rust"?"Rust (WebAssembly)":"TypeScript",children:[" \xB7 ",wA(Re.ms)," \xB7 ",Re.engine==="rust"?"Rust":"TS"]})]}),ee&&K(Go,{data:e,columns:it,onSearch:ft,onSort:lA,theme:te?"dark":"light",language:Ae,inputLanguage:d??Ae,agent:{ask:Qt.ask,loading:Qt.loading},embedded:!0})]}),Se.length===0?K("div",{style:{padding:40,textAlign:"center",opacity:.7},children:p??J.noData}):gA?K("div",{style:{display:"grid",gap:12,padding:12},children:St.map((w,M)=>{let $=Le(w),Z=Ve($),x=je($);return Ce("div",{"data-yuktai-row-id":$,onClick:()=>B?.(w,M),style:{padding:14,borderRadius:10,border:te?"1px solid #334155":"1px solid #e2e8f0",background:x?y:Z?te?"#1e3a5f":"#eff6ff":te?"#1e293b":"#ffffff",cursor:B?"pointer":"default"},children:[a&&K("button",{type:"button",onClick:U=>{U.stopPropagation(),ot(w)},"aria-label":`${J.selectRow} ${$}`,"aria-pressed":Z,style:{width:32,height:32,display:"inline-flex",alignItems:"center",justifyContent:"center",padding:0,marginBottom:10,borderRadius:7,border:Z?"1px solid #2563eb":"1px solid #cbd5e1",background:Z?"#2563eb":"transparent",color:Z?"#ffffff":"currentColor",cursor:"pointer"},children:Z&&K(wi,{size:17})}),t.map(U=>Ce("div",{style:{display:"flex",gap:8,padding:"5px 0",alignItems:"flex-start"},children:[K("strong",{style:{minWidth:100,opacity:.7},children:U.label}),K("span",{children:Ht(w,U,M)})]},String(U.key)))]},$)})}):K("div",{style:{width:"100%",overflowX:"auto"},children:Ce("table",{style:{width:"100%",borderCollapse:"collapse"},children:[K("thead",{children:Ce("tr",{children:[a&&K("th",{style:{padding:10,borderBottom:te?"1px solid #334155":"1px solid #e2e8f0",width:52}}),t.filter(w=>!(pe&&w.hiddenOnMobile)).map(w=>{let M=ve===String(w.key);return K("th",{onClick:()=>Pt(w),style:{padding:10,textAlign:w.align??"left",borderBottom:te?"1px solid #334155":"1px solid #e2e8f0",whiteSpace:"nowrap",cursor:w.sortable===!1?"default":"pointer",width:w.width,userSelect:"none"},children:Ce("span",{style:{display:"inline-flex",alignItems:"center",gap:5},children:[w.label,M&&(ne==="asc"?K(Ac,{size:17,label:J.sortAscending}):K(oc,{size:17,label:J.sortDescending}))]})},String(w.key))})]})}),K("tbody",{children:St.map((w,M)=>{let $=Le(w),Z=Ve($),x=je($);return Ce("tr",{"data-yuktai-row-id":$,onClick:()=>B?.(w,M),style:{background:x?y:Z?te?"#1e3a5f":"#eff6ff":"transparent",cursor:B?"pointer":"default"},children:[a&&K("td",{style:{padding:10,borderBottom:te?"1px solid #334155":"1px solid #e2e8f0"},children:K("button",{type:"button",onClick:U=>{U.stopPropagation(),ot(w)},"aria-label":`${J.selectRow} ${$}`,"aria-pressed":Z,style:{width:28,height:28,display:"inline-flex",alignItems:"center",justifyContent:"center",padding:0,borderRadius:6,border:Z?"1px solid #2563eb":te?"1px solid #64748b":"1px solid #cbd5e1",background:Z?"#2563eb":"transparent",color:Z?"#ffffff":"currentColor",cursor:"pointer"},children:Z&&K(wi,{size:16})})}),t.filter(U=>!(pe&&U.hiddenOnMobile)).map(U=>K("td",{style:{padding:10,textAlign:U.align??"left",borderBottom:te?"1px solid #334155":"1px solid #e2e8f0"},children:Ht(w,U,M)},String(U.key)))]},$)})})]})}),ie&&Ce("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,flexWrap:"wrap",padding:12,borderTop:te?"1px solid #334155":"1px solid #e2e8f0"},children:[Ce("span",{style:{fontSize:13,opacity:.7},children:[J.page," ",X," ",J.of," ",$e]}),Ce("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[typeof u=="object"&&u.showSizeChanger&&K("select",{value:z,onChange:w=>{let M=Number(w.target.value);!Number.isFinite(M)||M<=0||(xe(M),q(1))},"aria-label":J.pageSize,style:{minHeight:40,padding:"7px 10px",borderRadius:8,border:te?"1px solid #475569":"1px solid #cbd5e1",background:te?"#1e293b":"#ffffff",color:te?"#ffffff":"#0f172a"},children:oe.map(w=>K("option",{value:w,children:w},w))}),K("button",{type:"button",disabled:X<=1,onClick:()=>q(w=>Math.max(1,w-1)),"aria-label":J.previous,title:J.previous,style:_e(X<=1),children:K(nc,{size:20})}),K("button",{type:"button",disabled:X>=$e,onClick:()=>q(w=>Math.min($e,w+1)),"aria-label":J.next,title:J.next,style:_e(X>=$e),children:K(ic,{size:20})})]})]})]})}import{useState as Jt,useMemo as Dt,useCallback as qe,useEffect as Fo}from"react";function xi(e){return e===!1?Number.MAX_SAFE_INTEGER:e===!0||e===void 0?10:e.pageSize??10}function To(e){return String(e??"").normalize("NFC").toLowerCase().trim()}function $A(e){return e==null||typeof e=="string"&&e.trim()===""}function Mo(e){if(typeof e=="number")return Number.isFinite(e)?e:null;let t=String(e??"").trim();if(t==="")return null;let A=Number(t);return Number.isFinite(A)?A:null}function Lo(e){let t=e instanceof Date?e.getTime():new Date(String(e)).getTime();return Number.isFinite(t)?t:null}function sc(e,t,A,o){if(A==="number"||typeof e=="number"&&typeof t=="number"){let n=Mo(e),r=Mo(t);if(n!==null&&r!==null)return n-r}if(A==="date"||e instanceof Date&&t instanceof Date){let n=Lo(e),r=Lo(t);if(n!==null&&r!==null)return n-r}return typeof e=="boolean"&&typeof t=="boolean"?e===t?0:e?1:-1:String(e).localeCompare(String(t),o,{sensitivity:"base",numeric:!0})}var It=()=>typeof performance<"u"?performance.now():Date.now();function ac(e,t){return e.map(A=>t.map(o=>{let n=A[o.key];return n==null?"":To(n)}).join(eA))}function gc(e,t,A){let o=!1,n=!0,r=!0,i=0;for(let a of e){let l=a[t];$A(l)||(i++,typeof l=="number"?o=!0:n=!1,l instanceof Date||(r=!1))}if(i===0)return null;let s=null;if(A==="number"||n?s=Mo:(A==="date"&&!o||r)&&(s=Lo),!s)return null;let g=new Float64Array(e.length);for(let a=0;a<e.length;a++){let l=e[a][t];if($A(l)){g[a]=NaN;continue}let I=s(l);if(I===null)return null;g[a]=I}return g}function lc(e){let{data:t,columns:A,pagination:o=!0,mobileBreakpoint:n=768,locale:r,initialFilters:i=[],engine:s="rust"}=e,g=HA(s,t.length),[a,l]=Jt(null),[I,u]=Jt(""),[C,h]=Jt(i),[y,f]=Jt(1),[B,m]=Jt(xi(o)),[p,c]=Jt(!1),d=xi(o);Fo(()=>{m(d),f(1)},[d]),Fo(()=>{if(typeof window>"u")return;let L=()=>{c(window.innerWidth<=n)};return L(),window.addEventListener("resize",L),()=>window.removeEventListener("resize",L)},[n]);let Q=Dt(()=>wt(A.map(L=>({key:String(L.key),label:L.label,type:L.type}))),[A]),b=qe(L=>{l(ne=>!ne||ne.key!==L?{key:L,direction:"asc"}:ne.direction==="asc"?{key:L,direction:"desc"}:null),f(1)},[]),S=qe(L=>{l(L&&L.direction?L:null),f(1)},[]),F=qe(()=>{l(null),f(1)},[]),P=qe(L=>{u(L),f(1)},[]),G=qe(L=>{h(L),f(1)},[]),D=qe(L=>{h(ne=>[...ne.filter(de=>de.key!==L.key),L]),f(1)},[]),E=qe(L=>{h(ne=>ne.filter(de=>de.key!==L)),f(1)},[]),j=qe(()=>{h([]),f(1)},[]),Ae=qe(L=>{m(Math.max(1,Math.floor(L)||1)),f(1)},[]),J=Dt(()=>g?g.setSearchTexts(ac(t,A)):!1,[g,t,A]),ee=Dt(()=>{let L=It(),ne=To(I);if(!ne)return{rows:t,ms:0,engine:null};if(g&&J){let pe=g.search(ne);if(pe)return{rows:Lt(t,pe),ms:It()-L,engine:"rust"}}return{rows:t.filter(pe=>A.some(ke=>{let fe=pe[ke.key];return fe==null?!1:To(fe).includes(ne)})),ms:It()-L,engine:"ts"}},[t,I,A,g,J]),ie=ee.rows,R=Dt(()=>{let L=It();return{rows:st(ie,Q,C),ms:It()-L}},[ie,Q,C]),oe=R.rows,T=Dt(()=>{if(!a||!a.direction)return{rows:oe,ms:0,engine:null};let L=It(),ne=A.find(ke=>String(ke.key)===a.key),de=a.direction==="desc"?-1:1;if(g){let ke=gc(oe,a.key,ne?.type),fe=ke&&g.sortByKeys(ke,de===-1);if(fe)return{rows:Lt(oe,fe),ms:It()-L,engine:"rust"}}return{rows:[...oe].sort((ke,fe)=>{let He=ke[a.key],De=fe[a.key],Ct=$A(He),Me=$A(De);return Ct&&Me?0:Ct?1:Me?-1:de*sc(He,De,ne?.type,r)}),ms:It()-L,engine:"ts"}},[oe,a,A,r,g]),Y=T.rows,X=Dt(()=>!ee.engine&&!T.engine?null:{query:I.trim(),ms:ee.ms+R.ms+T.ms,rows:oe.length,engine:ee.engine==="rust"||T.engine==="rust"?"rust":"ts"},[ee,R,T,I,oe.length]),q=Math.max(1,Math.ceil(Y.length/B)),z=Dt(()=>{if(o===!1)return Y;let L=(y-1)*B;return Y.slice(L,L+B)},[Y,y,B,o]);Fo(()=>{y>q&&f(q)},[y,q]);let xe=qe(L=>f(Math.min(Math.max(1,Math.floor(L)||1),q)),[q]),ve=qe(()=>{l(null),u(""),h([]),f(1)},[]);return{displayedData:z,rows:Y,searchTime:X,totalCount:t.length,filteredCount:Y.length,sort:a,toggleSort:b,setSort:S,clearSort:F,searchQuery:I,setSearchQuery:P,filters:C,setFilters:G,setFilter:D,removeFilter:E,clearFilters:j,page:y,pageSize:B,totalPages:q,setPage:xe,setPageSize:Ae,isMobile:p,reset:ve}}function cc(){if(typeof globalThis>"u")return new xt;if(!globalThis.__yuktai_runtime__){let e=new xt;e.register(Ge.name,Ge),e.register(YA.name,YA),e.register(UA.name,UA),globalThis.__yuktai_runtime__=e}return globalThis.__yuktai_runtime__}var ki=typeof window<"u"?cc():new xt,GI={wcagPlugin:Ge,list(){return ki.getPlugins()},use(e){return ki.use(e)},fix(e){return Ge.applyFixes({enabled:!0,autoFix:!0,...e})},scan(){return Ge.scan()}};export{RA as AUDIT_RULES,Qs as AbcIcon,Hi as AccessibilityIcon,Ea as AdminIcon,Ad as AgenticGridBar,ui as AgenticPanel,Cr as AlertIcon,Is as AlignCenterIcon,ps as AlignJustifyIcon,ds as AlignLeftIcon,Cs as AlignRightIcon,Ks as ApiIcon,ea as ArchitectureIcon,ra as ArrowDownIcon,Kr as ArrowLeftIcon,qr as ArrowRightIcon,Pr as ArrowUpIcon,ba as BarChartIcon,ls as BoldIcon,xr as BookIcon,js as BookmarkIcon,ta as BrainIcon,wa as BugReportIcon,ts as BulbIcon,Ba as CakeIcon,kr as CalendarIcon,ir as CardsIcon,rr as ChatIcon,Pi as CheckIcon,Ui as ChevronLeftIcon,Ji as ChevronRightIcon,or as ChevronsIcon,ca as CleaningIcon,Dr as ClockIcon,Ki as CloseIcon,Ws as CloudIcon,as as CodeIcon,Hs as ComputerIcon,$i as ContrastIcon,lr as CopyIcon,ri as DEFAULT_A11Y_SETTINGS,la as DashboardIcon,qs as DataObjectIcon,os as DeleteIcon,ga as DocumentScannerIcon,gr as DownloadIcon,ua as DragHandleIcon,pa as ExploreIcon,Jr as ExternalIcon,mr as EyeIcon,Vs as EyeOffIcon,pl as FONT_MAX,Cl as FONT_MIN,ii as FONT_STEP,sa as FactCheckIcon,Ur as FileIcon,cr as FilterIcon,ur as FirstIcon,hs as FontIcon,fr as FormIcon,Rs as FullscreenExitIcon,vs as FullscreenIcon,_s as GavelIcon,Lr as GiftIcon,vr as GlobeIcon,_t as GridCore,nr as GridIcon,Hr as HeadphonesIcon,rs as HeartFilledIcon,is as HeartIcon,jr as HelpIcon,Er as HomeIcon,ss as HubIcon,vi as ICON_MIN_CONTRAST,Gi as ICON_NAMES,Si as ICON_PATHS,Ti as IconBase,Yr as ImageIcon,aa as ImageSearchIcon,pr as InfoIcon,Ca as InsightsIcon,Vr as InstallIcon,ka as IntegrationIcon,cs as ItalicIcon,Fs as JoinIcon,ks as KeyIcon,ha as KeyboardIcon,ma as LabelIcon,Rr as LampIcon,dr as LastIcon,hr as LayoutIcon,bs as LinkIcon,Ta as LoaderIcon,ws as LockIcon,va as LoginIcon,Ra as LogoutIcon,zr as MapIcon,_r as MeditateIcon,wr as MenuIcon,Ns as MergeIcon,sr as MicIcon,er as MinusIcon,Wi as MoonIcon,zi as MotionIcon,Us as MovieIcon,$r as MusicIcon,Ls as MusicOffIcon,Ys as MusicVideoIcon,Da as NamaskarIcon,Bs as PageBreakIcon,ji as PaletteIcon,Fr as PauseIcon,Or as PenIcon,Sr as PersonIcon,$s as PhoneIcon,Wr as PinIcon,Nr as PlayIcon,br as PlugIcon,_i as PlusIcon,fs as QuoteIcon,bn as RUST_AUTO_MIN_ROWS,na as RadioCheckedIcon,oa as RadioIcon,Oi as ReadingIcon,Ds as RedoIcon,Fa as RepeatIcon,tr as ResetIcon,ns as RobotIcon,xt as Runtime,fa as SaveIcon,Zs as SchoolIcon,Mi as SearchIcon,Xs as SearchOffIcon,Tr as SendIcon,xa as SentimentSadIcon,Mr as ShareIcon,La as ShieldCheckIcon,Gs as ShuffleIcon,Zi as SkipIcon,Js as SlideshowIcon,Yi as SortDownIcon,Ar as SortIcon,Li as SortUpIcon,Ir as SparkIcon,Vi as SpeakerIcon,Na as SpeedIcon,ys as SpellcheckIcon,Ma as StarIcon,ar as StopIcon,Ps as StorageIcon,Es as StyleIcon,As as SunIcon,Sa as SunriseIcon,Ga as SunsetIcon,Ss as SwapIcon,Xi as TargetIcon,Zr as TempleIcon,gs as TextIcon,ms as TitleIcon,Br as ToolsIcon,Ts as TouchIcon,Qa as TrendingDownIcon,ya as TrendingUpIcon,es as TrophyIcon,us as UnderlineIcon,Qr as UndoIcon,xs as UnlockIcon,ia as UploadIcon,Gr as UsersIcon,Ms as VolumeOffIcon,Aa as VolunteerIcon,Xr as WalletIcon,yr as WandIcon,zs as WifiIcon,Os as WifiOffIcon,GI as YuktAI,Do as YuktAIWrapper,rc as YuktaiGrid,Go as YuktaiGridAI,$l as YuktaiGridAgent,qA as YuktaiGridWebMCP,qi as YuktaiIcon,da as ZoomInIcon,Ia as ZoomOutIcon,Ye as accessibleName,Bo as addPeriods,nA as aggregate,YA as aiPlugin,rl as analyzePage,Vn as answerGridQuestion,st as applyGridFilters,ei as askAboutPage,_n as askInsight,qn as auditToJSON,Kn as auditToMarkdown,Un as clearFilters,Pn as clearSort,Al as comparePeriods,OA as contrastRatio,Tn as countGrid,Hn as createA11yCopilot,DA as createContextIndex,oA as createGridTools,si as createVoiceA11yController,Do as default,ho as detectAnomalies,gl as detectPageIntent,gt as executeGridQuery,Yn as filterGrid,Pe as findMentionedColumn,Mn as getColumns,Ln as getRow,he as getRowId,Ng as gridPassages,tl as groupBy,AA as highlightRows,Ri as iconContrast,Fi as iconSvg,co as loadGridCore,ml as moveGridRowFocus,vA as openRow,Rg as pagePassages,Co as parseAmount,zA as parseColor,Qi as parseGridIntent,Ut as parseGridQuery,fl as parseVoiceA11yCommand,Ni as pickGlyphColor,bo as planTasks,zg as readFormFields,Di as relativeLuminance,Wn as reviewDesign,Og as reviewForm,NA as reviewForms,el as runGridQuery,at as runQaAudit,ni as runTasks,Fn as searchGrid,GA as selectRow,Jn as sortGrid,Zn as startOfPeriod,yo as summarizeRows,wt as toGridToolColumns,kA as tokenize,ol as trend,td as useAgenticGrid,lc as useGrid,KA as useYuktaiGridAgent,UA as voicePlugin,go as wantsRustEngine,Ge as wcag,Ge as wcagPlugin};
|
|
402
|
+
`})]})}var Go=Ll;import{useCallback as sA,useEffect as Ul,useRef as vo,useState as PA}from"react";var Jl={en:{done:"Done.",toolMissing:e=>`The action "${e}" is not available here.`,missingInput:e=>`Missing: ${e}.`,notUnderstood:"Sorry, I didn't understand. Try: a word to search, \u201Csort by <column>\u201D, or \u201Cclear filters\u201D.",noMatch:e=>`Nothing matched "${e}".`,failed:"Something went wrong while running this action."},te:{done:"\u0C2A\u0C42\u0C30\u0C4D\u0C24\u0C2F\u0C3F\u0C02\u0C26\u0C3F.",toolMissing:e=>`"${e}" \u0C38\u0C4C\u0C15\u0C30\u0C4D\u0C2F\u0C02 \u0C07\u0C15\u0C4D\u0C15\u0C21 \u0C05\u0C02\u0C26\u0C41\u0C2C\u0C3E\u0C1F\u0C41\u0C32\u0C4B \u0C32\u0C47\u0C26\u0C41.`,missingInput:e=>`\u0C07\u0C35\u0C3F \u0C15\u0C3E\u0C35\u0C3E\u0C32\u0C3F: ${e}.`,notUnderstood:"\u0C15\u0C4D\u0C37\u0C2E\u0C3F\u0C02\u0C1A\u0C02\u0C21\u0C3F, \u0C05\u0C30\u0C4D\u0C25\u0C02 \u0C15\u0C3E\u0C32\u0C47\u0C26\u0C41. \u0C07\u0C32\u0C3E \u0C2A\u0C4D\u0C30\u0C2F\u0C24\u0C4D\u0C28\u0C3F\u0C02\u0C1A\u0C02\u0C21\u0C3F: \u0C35\u0C46\u0C24\u0C15\u0C3E\u0C32\u0C4D\u0C38\u0C3F\u0C28 \u0C2A\u0C26\u0C02, \u201C<\u0C15\u0C3E\u0C32\u0C2E\u0C4D> \u0C2A\u0C4D\u0C30\u0C15\u0C3E\u0C30\u0C02 \u0C15\u0C4D\u0C30\u0C2E\u0C02\u201D, \u0C32\u0C47\u0C26\u0C3E \u201C\u0C2B\u0C3F\u0C32\u0C4D\u0C1F\u0C30\u0C4D\u0C32\u0C41 \u0C24\u0C40\u0C38\u0C47\u0C2F\u0C3F\u201D.",noMatch:e=>`"${e}" \u0C15\u0C3F \u0C0F\u0C2E\u0C40 \u0C38\u0C30\u0C3F\u0C2A\u0C4B\u0C32\u0C47\u0C26\u0C41.`,failed:"\u0C08 \u0C2A\u0C28\u0C3F \u0C1A\u0C47\u0C38\u0C4D\u0C24\u0C41\u0C02\u0C21\u0C17\u0C3E \u0C38\u0C2E\u0C38\u0C4D\u0C2F \u0C35\u0C1A\u0C4D\u0C1A\u0C3F\u0C02\u0C26\u0C3F."}},hi=e=>e.normalize("NFC").toLowerCase().trim(),ut={clearFilters:/\b(clear|remove|reset)\b.*\bfilters?\b|ఫిల్టర్.*(తీసే|తొలగ)/i,clearSort:/\b(clear|remove|reset)\b.*\bsort(ing)?\b|క్రమం.*(తీసే|తొలగ)/i,count:/^\s*(how many|count)\b|ఎన్ని|లెక్క/i,sort:/\bsort\b|\border by\b|క్రమ|అమర్చ|సార్ట్/i,desc:/\b(desc|descending|z\s*-\s*a|highest|largest|most)\b|అవరోహణ|తగ్గే|పెద్ద|అధిక|చివర|ఎక్కువ నుండి/i,openEn:/^\s*open\s+(.+?)\s*$/i,openTe:/^\s*(.+?)\s*(తెరువు|తెరవండి|తెరవు)\s*$/,searchFiller:/^\s*(search(\s+for)?|find|show(\s+me)?|filter(\s+by)?|look\s+for|వెతుకు|వెతకండి|శోధించు|శోధించండి|చూపించు|చూపించండి)\s+|\s+(వెతుకు|వెతకండి|శోధించు|శోధించండి|చూపించు|చూపించండి)\s*$/gi};function Pl(e,t){let A=hi(e),o=null;for(let n of t)for(let r of[n.label,n.key]){let i=hi(r);i&&A.includes(i)&&(!o||i.length>o.len)&&(o={key:n.key,len:i.length})}return o?.key??null}function Qi(e,t){let A=(e??"").trim();if(!A)return null;if(ut.clearFilters.test(A))return{kind:"tool",tool:"clear_filters",input:{}};if(ut.clearSort.test(A))return{kind:"tool",tool:"clear_sort",input:{}};if(ut.count.test(A))return{kind:"tool",tool:"count",input:{}};if(ut.sort.test(A)){let r=Pl(A,t.columns);return r?{kind:"tool",tool:"sort",input:{key:r,direction:ut.desc.test(A)?"desc":"asc"}}:null}let o=A.match(ut.openEn)??A.match(ut.openTe);if(o?.[1])return{kind:"open",text:o[1].trim()};let n=A.replace(ut.searchFiller,"").trim();return n?{kind:"tool",tool:"search",input:{query:n}}:null}function Kl(e){return!!e&&typeof e=="object"&&typeof e.success=="boolean"&&typeof e.message=="string"}function ql(e,t){let A=e.inputSchema?.required;return Array.isArray(A)?A.map(String).filter(o=>t[o]===void 0||t[o]===null||String(t[o]).trim()===""):[]}function Hl(e,t){let A=e.find(n=>n.name===t);if(A)return A;let o=e.filter(n=>n.name.endsWith(`_${t}`)).sort((n,r)=>n.name.length-r.name.length);if(o.length!==0&&!(o.length>1&&o[0].name.length===o[1].name.length))return o[0]}function yi(e){return e.normalize("NFC").trim().toLocaleLowerCase()}function $l(e,t){let A=yi(e);return t.find(o=>o.phrases.some(n=>{let r=yi(n);return r.length>0&&A.includes(r)}))}function KA({tools:e,data:t=[],onResult:A,onError:o,locale:n="en",columns:r=[],rowKey:i="id",parseIntent:s,customRules:g=[],historyLimit:a=20}){let l=Jl[n],[I,u]=PA(0),[C,h]=PA(null),[y,f]=PA(null),[B,m]=PA([]),p=vo({tools:e,data:t,onResult:A,onError:o,columns:r,rowKey:i,parseIntent:s,customRules:g,historyLimit:a,m:l,locale:n});p.current={tools:e,data:t,onResult:A,onError:o,columns:r,rowKey:i,parseIntent:s,customRules:g,historyLimit:a,m:l,locale:n};let c=vo(!0),d=vo(0);Ul(()=>(c.current=!0,()=>{c.current=!1}),[]);let Q=sA((G,D,E,j,Ae)=>{c.current&&(Ae===d.current&&h(E),m(J=>[...J,{id:Ae,tool:G,input:D,result:E,source:j,at:Date.now()}].slice(-p.current.historyLimit)))},[]),b=sA(async(G,D,E)=>{let{tools:j,onResult:Ae,onError:J,m:ee}=p.current,ie=++d.current,R=Hl(j,G);if(!R){let T={success:!1,message:ee.toolMissing(G),error:{code:"NOT_SUPPORTED"}},Y=new Error(T.message);return c.current&&f(Y),J?.(Y),Q(G,D,T,E,ie),T}let oe=ql(R,D);if(oe.length){let T={success:!1,message:ee.missingInput(oe.join(", ")),error:{code:"INVALID_INPUT"},tool:R.name};return Q(R.name,D,T,E,ie),Ae?.(T),T}c.current&&u(T=>T+1);try{let T=await R.execute(D),Y=Kl(T)?{...T,tool:R.name}:{success:!0,message:ee.done,data:T,tool:R.name};return c.current&&Y.success&&f(null),Q(R.name,D,Y,E,ie),Ae?.(Y),Y}catch(T){let Y=T instanceof Error?T:new Error(String(T)),X={success:!1,message:ee.failed,error:{code:"INTERNAL"},tool:R.name};return c.current&&f(Y),J?.(Y),Q(R.name,D,X,E,ie),X}finally{c.current&&u(T=>Math.max(0,T-1))}},[Q]),S=sA((G,D={})=>b(G,D??{},"tool"),[b]),F=sA(async G=>{let{columns:D,locale:E,parseIntent:j,customRules:Ae,data:J,m:ee,rowKey:ie}=p.current,R=$l(G,Ae??[]);if(R){let q={input:G,data:J,columns:D,executeTool:S};try{let xe={success:!0,message:await R.execute(q),tool:`rule:${R.name}`};return Q(`rule:${R.name}`,{text:G},xe,"ask",++d.current),p.current.onResult?.(xe),xe}catch(z){let xe=z instanceof Error?z:new Error(String(z)),ve={success:!1,message:ee.failed,error:{code:"INTERNAL"},tool:`rule:${R.name}`};return c.current&&f(xe),p.current.onError?.(xe),Q(`rule:${R.name}`,{text:G},ve,"ask",++d.current),ve}}let T=(j??Qi)(G,{columns:D,locale:E});if(!T){let q={success:!1,message:ee.notUnderstood,error:{code:"NOT_UNDERSTOOD"}};return Q("ask",{text:G},q,"ask",++d.current),q}if(T.kind==="tool")return b(T.tool,T.input,"ask");let Y=await b("search",{query:T.text},"ask"),X=Array.isArray(Y.data)?Y.data:[];if(!Y.success)return Y;if(X.length===0){let q={success:!1,message:ee.noMatch(T.text),error:{code:"NOT_FOUND"},tool:Y.tool};return Q("open",{text:T.text},q,"ask",++d.current),q}return b("open",{id:he(X[0],ie)},"ask")},[S,Q,b]),P=sA(()=>{m([]),h(null),f(null)},[]);return{loading:I>0,tools:e,executeTool:S,ask:F,lastResult:C,lastError:y,history:B,clearHistory:P}}var Wl=KA;import{useEffect as zl,useMemo as Ol,useRef as Ro}from"react";function Xl(e){return JSON.stringify(e.map(t=>[t.name,t.title,t.description,t.inputSchema]))}function Vl({tools:e,data:t=[],columns:A=[],rowKey:o,locale:n,onSelectRow:r,onHighlightRows:i,onOpenRow:s,name:g="yuktai_grid",descriptions:a,onStatusChange:l}){let I=Ol(()=>e||oA({data:t,columns:A,rowKey:o,locale:n,onSelectRow:r,onHighlightRows:i,onOpenRow:s},{name:g,descriptions:a}),[e,t,A,o,n,r,i,s,g,a]),u=Ro(I);u.current=I;let C=Ro(l);C.current=l;let h=Ro(Promise.resolve()),y=Xl(I);return zl(()=>{let f=d=>C.current?.(d),B=typeof document<"u"?document.modelContext:void 0;if(!B?.registerTool){f({state:"unsupported",registered:[],errors:[]});return}let m=new AbortController,p=u.current,c=h.current.then(async()=>{if(m.signal.aborted)return;f({state:"registering",registered:[],errors:[]});let d=[],Q=[];for(let b of p){if(m.signal.aborted)return;try{await B.registerTool({name:b.name,title:b.title,description:b.description,inputSchema:b.inputSchema,execute:S=>{let F=u.current.find(P=>P.name===b.name);return F?F.execute(S??{}):{success:!1,message:`Tool "${b.name}" is no longer available.`,error:{code:"NOT_SUPPORTED"}}}},{signal:m.signal}),d.push(b.name)}catch(S){Q.push({tool:b.name,message:S instanceof Error?S.message:String(S)})}}m.signal.aborted||f({state:Q.length===0?"ready":d.length>0?"partial":"error",registered:d,errors:Q})});return h.current=c.catch(()=>{}),()=>m.abort()},[y]),null}var qA=Vl;import{useEffect as jl,useMemo as Zl,useState as _l}from"react";function HA(e,t){let A=go(e,t),[o,n]=_l(()=>A?En():null);return jl(()=>{if(!A||o)return;let r=!0;return co().then(i=>{r&&i&&n(i)}),()=>{r=!1}},[A,o]),Zl(()=>A&&o?_t.create(o):null,[A,o])}function Bi(e,t){return e.map(A=>t.map(o=>String(A[o.key]??"").toLowerCase()).join(eA))}function ec(e,t){let A=new Float64Array(e.length),o=0;for(let n=0;n<e.length;n++){let r=e[n][t];if(r==null){A[n]=NaN;continue}if(typeof r!="number"||Number.isNaN(r))return null;A[n]=r,o++}return o?A:null}function bi(e){return e.search==="rust"||e.sort==="rust"?"rust":e.search||e.sort?"ts":null}function Ei({data:e,columns:t,searchText:A,filters:o,toolColumns:n,sortKey:r,sortDirection:i,locale:s,core:g=null,searchReady:a=!1,stats:l}){let I=[...e];if(l&&(l.search=null,l.sort=null),A.trim()){let u=A.trim().toLowerCase(),C=g&&a?g.search(u):null;l&&(l.search=C?"rust":"ts"),C?I=Lt(e,C):I=I.filter(h=>t.some(y=>String(h[y.key]??"").toLowerCase().includes(u)))}if(o.length&&(I=st(I,n,o)),r){if(g){let u=ec(I,r),C=u&&g.sortByKeys(u,i!=="asc");if(C)return l&&(l.sort="rust"),Lt(I,C)}l&&(l.sort="ts"),I.sort((u,C)=>{let h=u[r],y=C[r];if(h==null&&y==null)return 0;if(h==null)return 1;if(y==null)return-1;if(typeof h=="number"&&typeof y=="number")return i==="asc"?h-y:y-h;let f=String(h).localeCompare(String(y),s,{numeric:!0,sensitivity:"base"});return i==="asc"?f:-f})}return I}import{jsx as K,jsxs as Ce}from"react/jsx-runtime";var tc={"en-US":{search:"Search...",searchAria:"Search grid",rows:"rows",row:"row",loading:"Loading...",noData:"No data found.",selectRow:"Select row",pageSize:"Page size",page:"Page",of:"of",previous:"Previous",next:"Next",yes:"Yes",no:"No",sortAscending:"Sort ascending",sortDescending:"Sort descending",filtersActive:e=>`${e} filter(s) applied`,clearFilters:"Clear filters"},"te-IN":{search:"\u0C36\u0C4B\u0C27\u0C3F\u0C02\u0C1A\u0C02\u0C21\u0C3F...",searchAria:"\u0C17\u0C4D\u0C30\u0C3F\u0C21\u0C4D\u200C\u0C32\u0C4B \u0C36\u0C4B\u0C27\u0C3F\u0C02\u0C1A\u0C02\u0C21\u0C3F",rows:"\u0C35\u0C30\u0C41\u0C38\u0C32\u0C41",row:"\u0C35\u0C30\u0C41\u0C38",loading:"\u0C32\u0C4B\u0C21\u0C4D \u0C05\u0C35\u0C41\u0C24\u0C4B\u0C02\u0C26\u0C3F...",noData:"\u0C21\u0C47\u0C1F\u0C3E \u0C15\u0C28\u0C2C\u0C21\u0C32\u0C47\u0C26\u0C41.",selectRow:"\u0C35\u0C30\u0C41\u0C38\u0C28\u0C41 \u0C0E\u0C02\u0C1A\u0C41\u0C15\u0C4B\u0C02\u0C21\u0C3F",pageSize:"\u0C2A\u0C47\u0C1C\u0C40 \u0C2A\u0C30\u0C3F\u0C2E\u0C3E\u0C23\u0C02",page:"\u0C2A\u0C47\u0C1C\u0C40",of:"\u0C32\u0C4B",previous:"\u0C35\u0C46\u0C28\u0C41\u0C15\u0C15\u0C41",next:"\u0C2E\u0C41\u0C02\u0C26\u0C41\u0C15\u0C41",yes:"\u0C05\u0C35\u0C41\u0C28\u0C41",no:"\u0C15\u0C3E\u0C26\u0C41",sortAscending:"\u0C06\u0C30\u0C4B\u0C39\u0C23 \u0C15\u0C4D\u0C30\u0C2E\u0C02\u0C32\u0C4B \u0C05\u0C2E\u0C30\u0C4D\u0C1A\u0C02\u0C21\u0C3F",sortDescending:"\u0C05\u0C35\u0C30\u0C4B\u0C39\u0C23 \u0C15\u0C4D\u0C30\u0C2E\u0C02\u0C32\u0C4B \u0C05\u0C2E\u0C30\u0C4D\u0C1A\u0C02\u0C21\u0C3F",filtersActive:e=>`${e} \u0C2B\u0C3F\u0C32\u0C4D\u0C1F\u0C30\u0C4D(\u0C32\u0C41) \u0C35\u0C47\u0C36\u0C3E\u0C30\u0C41`,clearFilters:"\u0C2B\u0C3F\u0C32\u0C4D\u0C1F\u0C30\u0C4D\u0C32\u0C41 \u0C24\u0C40\u0C38\u0C47\u0C2F\u0C02\u0C21\u0C3F"}};function Ac({size:e=20,color:t="currentColor",strokeWidth:A=2.4}){return Ce("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:A,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[K("circle",{cx:"11",cy:"11",r:"6.5"}),K("path",{d:"m16 16 5 5"})]})}function oc({size:e=18,color:t="currentColor",strokeWidth:A=2.4,label:o}){return Ce("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:A,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":o?void 0:!0,"aria-label":o,role:o?"img":void 0,children:[o?K("title",{children:o}):null,K("path",{d:"m6 15 6-6 6 6"})]})}function nc({size:e=18,color:t="currentColor",strokeWidth:A=2.4,label:o}){return Ce("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:A,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":o?void 0:!0,"aria-label":o,role:o?"img":void 0,children:[o?K("title",{children:o}):null,K("path",{d:"m6 9 6 6 6-6"})]})}function ic({size:e=20,color:t="currentColor",strokeWidth:A=2.4}){return K("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:A,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:K("path",{d:"m15 18-6-6 6-6"})})}function rc({size:e=20,color:t="currentColor",strokeWidth:A=2.4}){return K("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:A,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:K("path",{d:"m9 18 6-6-6-6"})})}function wi({size:e=18,color:t="currentColor",strokeWidth:A=2.4}){return K("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:A,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:K("path",{d:"m5 12 4 4L19 6"})})}function sc({data:e,columns:t,rowKey:A="id",view:o="auto",mobileBreakpoint:n=768,theme:r="default",locale:i="en-US",ai:s=!1,search:g=!0,selectable:a=!1,selectedKeys:l=[],onSelectionChange:I,pagination:u,loading:C=!1,highlightIds:h=[],highlightColor:y="#fff3a3",autoScrollToHighlight:f=!1,onRowClick:B,onSortChange:m,empty:p,className:c="",inputLanguage:d,toolName:Q="yuktai_grid",toolDescriptions:b,webmcp:S=!1,onWebMCPStatusChange:F,onAgentResult:P,customRules:G=[],engine:D="rust",showSearchTime:E=!1,onSearchTime:j}){let Ae=i==="te-IN"?"te-IN":"en-US",J=tc[Ae],ee=s===!0||typeof s=="object"&&s!==null,ie=u!==!1&&u!==void 0,R=typeof u=="object"?u.pageSize??20:20,oe=typeof u=="object"&&u.sizeOptions&&u.sizeOptions.length>0?u.sizeOptions:[10,20,50,100],[T,Y]=dt(""),[X,q]=dt(1),[z,xe]=dt(R),[ve,L]=dt(),[ne,de]=dt("asc"),[pe,ke]=dt(!1),[fe,He]=dt([]),[De,Ct]=dt([]),Me=kt(()=>wt(t.map(w=>({key:String(w.key),label:w.label,type:w.type}))),[t]);aA(()=>{xe(R),q(1)},[R]),aA(()=>{let w=()=>{ke(window.innerWidth<=n)};return w(),window.addEventListener("resize",w),()=>{window.removeEventListener("resize",w)}},[n]);let Xe=HA(D,e.length),Qe=kt(()=>Xe?Xe.setSearchTexts(Bi(e,t)):!1,[Xe,e,t]),Re=kt(()=>{let w={search:null,sort:null},M=typeof performance<"u"?performance.now():Date.now(),$=Ei({data:e,columns:t,searchText:T,filters:fe,toolColumns:Me,sortKey:ve,sortDirection:ne,locale:i,core:Xe,searchReady:Qe,stats:w}),Z=(typeof performance<"u"?performance.now():Date.now())-M;return{rows:$,ms:Z,engine:bi(w)}},[e,t,T,fe,Me,ve,ne,i,Xe,Qe]),Se=Re.rows;aA(()=>{!j||!Re.engine||j({query:T.trim(),ms:Re.ms,rows:Re.rows.length,engine:Re.engine})},[Re]);let $e=ie?Math.max(1,Math.ceil(Se.length/z)):1;aA(()=>{X>$e&&q($e)},[X,$e]);let pt=kt(()=>{let w=[...h.map(String),...De];return Array.from(new Set(w))},[h,De]);aA(()=>{if(!f)return;let w=pt[0];if(w==null)return;let M=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(String(w)):String(w).replace(/["\\]/g,"\\$&");document.querySelector(`[data-yuktai-row-id="${M}"]`)?.scrollIntoView({behavior:"smooth",block:"center"})},[pt,f,X]);let St=kt(()=>{if(!ie)return Se;let w=(X-1)*z;return Se.slice(w,w+z)},[Se,ie,X,z]),gA=o==="card"||o==="auto"&&pe,Le=w=>String(w[A]??""),Ve=w=>l.some(M=>String(M)===w),je=w=>pt.some(M=>String(M)===w),ot=w=>{if(!a)return;let M=Le(w),$=Ve(M)?l.filter(Z=>String(Z)!==M):[...l,M];I?.($)},Pt=w=>{if(w.sortable===!1)return;let M=String(w.key),$=ve===M&&ne==="asc"?"desc":"asc";L(M),de($),q(1),m?.({key:M,direction:$})},ft=w=>{Y(w),q(1)},lA=(w,M)=>{let $=t.find(Z=>String(Z.key)===w||Z.label.toLowerCase()===w.toLowerCase());$&&(L(String($.key)),de(M),q(1),m?.({key:String($.key),direction:M}))},mt=Ae==="te-IN"?"te":"en",ht=No(w=>{w?(L(w.key),de(w.direction)):(L(void 0),de("asc")),q(1),m?.(w)},[m]),yt=No(w=>{He(w),q(1)},[]),Ze=No(w=>{if(Ct(w),ie&&w.length){let M=Se.findIndex($=>String($[A]??"")===w[0]);M>=0&&q(Math.floor(M/z)+1)}},[ie,Se,A,z]),Kt=kt(()=>oA({data:e,columns:Me,rowKey:String(A),locale:mt,filters:fe,onHighlightRows:Ze,onFiltersChange:yt,onSortChange:ht,onOpenRow:B?w=>{let M=Se.findIndex(Z=>String(Z[A]??"")===w),$=M>=0?Se[M]:e.find(Z=>String(Z[A]??"")===w);$&&B($,Math.max(M,0))}:void 0,onSelectRow:a&&I?w=>{l.some(M=>String(M)===w)||I([...l.map(String),w])}:void 0},{name:Q,descriptions:b}),[e,Me,A,mt,fe,Ze,yt,ht,B,Se,a,I,l,Q,b]),Qt=KA({tools:Kt,data:e,locale:mt,columns:Me,rowKey:String(A),customRules:G,onResult:P}),qt=kt(()=>Kt.map(w=>({...w,execute:M=>Qt.executeTool(w.name,M)})),[Kt,Qt.executeTool]),cA=()=>{He([]),q(1)},Ht=(w,M,$)=>{if(M.render)return M.render(w[M.key],w,$);let Z=w[M.key];if(Z==null)return"";if(M.type==="date"){let x=new Date(String(Z));if(!Number.isNaN(x.getTime()))return x.toLocaleDateString(i)}return M.type==="boolean"?Z?J.yes:J.no:String(Z)},te=r==="dark",uA={width:"100%",overflow:"hidden",border:r==="high-contrast"?"2px solid #000000":te?"1px solid #334155":"1px solid #e2e8f0",borderRadius:12,background:te?"#0f172a":"#ffffff",color:te?"#f8fafc":"#0f172a",fontFamily:r==="dyslexia"?"Arial, sans-serif":void 0},nt={padding:12,display:"flex",alignItems:"center",gap:12,flexWrap:"wrap",borderBottom:te?"1px solid #334155":"1px solid #e2e8f0"},_e=w=>({width:40,height:40,minWidth:40,display:"inline-flex",alignItems:"center",justifyContent:"center",padding:0,borderRadius:8,border:te?"1px solid #475569":"1px solid #cbd5e1",background:w?te?"#1e293b":"#f8fafc":te?"#1e293b":"#ffffff",color:w?"#94a3b8":te?"#f8fafc":"#0f172a",cursor:w?"not-allowed":"pointer",opacity:w?.55:1});if(C)return Ce("div",{className:c,style:uA,children:[S&&K(qA,{tools:qt,onStatusChange:F}),K("div",{style:{padding:32,textAlign:"center"},children:J.loading})]});let it=t.map(w=>({key:String(w.key),label:w.label,type:w.type==="number"?"number":w.type==="date"?"date":"text"}));return Ce("div",{className:c,style:uA,children:[S&&K(qA,{tools:qt,onStatusChange:F}),(g||ee||fe.length>0)&&Ce("div",{style:nt,children:[g&&Ce("div",{style:{position:"relative",width:"100%",maxWidth:420},children:[K("div",{style:{position:"absolute",left:12,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",color:te?"#cbd5e1":"#64748b",pointerEvents:"none"},children:K(Ac,{size:19})}),K("input",{value:T,onChange:w=>{Y(w.target.value),q(1)},placeholder:J.search,"aria-label":J.searchAria,style:{width:"100%",padding:"10px 12px 10px 40px",borderRadius:8,border:te?"1px solid #475569":"1px solid #cbd5e1",background:te?"#1e293b":"#ffffff",color:te?"#ffffff":"#0f172a",outline:"none",boxSizing:"border-box"}})]}),fe.length>0&&Ce("button",{type:"button",onClick:cA,title:J.clearFilters,style:{padding:"6px 10px",borderRadius:999,border:te?"1px solid #475569":"1px solid #cbd5e1",background:te?"#1e293b":"#f1f5f9",color:"inherit",fontSize:12,cursor:"pointer"},children:[J.filtersActive(fe.length)," \u2715"]}),Ce("div",{style:{marginLeft:"auto",fontSize:13,opacity:.7,whiteSpace:"nowrap"},children:[Se.length," ",Se.length===1?J.row:J.rows,E&&Re.engine&&Ce("span",{title:Re.engine==="rust"?"Rust (WebAssembly)":"TypeScript",children:[" \xB7 ",wA(Re.ms)," \xB7 ",Re.engine==="rust"?"Rust":"TS"]})]}),ee&&K(Go,{data:e,columns:it,onSearch:ft,onSort:lA,theme:te?"dark":"light",language:Ae,inputLanguage:d??Ae,agent:{ask:Qt.ask,loading:Qt.loading},embedded:!0})]}),Se.length===0?K("div",{style:{padding:40,textAlign:"center",opacity:.7},children:p??J.noData}):gA?K("div",{style:{display:"grid",gap:12,padding:12},children:St.map((w,M)=>{let $=Le(w),Z=Ve($),x=je($);return Ce("div",{"data-yuktai-row-id":$,onClick:()=>B?.(w,M),style:{padding:14,borderRadius:10,border:te?"1px solid #334155":"1px solid #e2e8f0",background:x?y:Z?te?"#1e3a5f":"#eff6ff":te?"#1e293b":"#ffffff",cursor:B?"pointer":"default"},children:[a&&K("button",{type:"button",onClick:U=>{U.stopPropagation(),ot(w)},"aria-label":`${J.selectRow} ${$}`,"aria-pressed":Z,style:{width:32,height:32,display:"inline-flex",alignItems:"center",justifyContent:"center",padding:0,marginBottom:10,borderRadius:7,border:Z?"1px solid #2563eb":"1px solid #cbd5e1",background:Z?"#2563eb":"transparent",color:Z?"#ffffff":"currentColor",cursor:"pointer"},children:Z&&K(wi,{size:17})}),t.map(U=>Ce("div",{style:{display:"flex",gap:8,padding:"5px 0",alignItems:"flex-start"},children:[K("strong",{style:{minWidth:100,opacity:.7},children:U.label}),K("span",{children:Ht(w,U,M)})]},String(U.key)))]},$)})}):K("div",{style:{width:"100%",overflowX:"auto"},children:Ce("table",{style:{width:"100%",borderCollapse:"collapse"},children:[K("thead",{children:Ce("tr",{children:[a&&K("th",{style:{padding:10,borderBottom:te?"1px solid #334155":"1px solid #e2e8f0",width:52}}),t.filter(w=>!(pe&&w.hiddenOnMobile)).map(w=>{let M=ve===String(w.key);return K("th",{onClick:()=>Pt(w),style:{padding:10,textAlign:w.align??"left",borderBottom:te?"1px solid #334155":"1px solid #e2e8f0",whiteSpace:"nowrap",cursor:w.sortable===!1?"default":"pointer",width:w.width,userSelect:"none"},children:Ce("span",{style:{display:"inline-flex",alignItems:"center",gap:5},children:[w.label,M&&(ne==="asc"?K(oc,{size:17,label:J.sortAscending}):K(nc,{size:17,label:J.sortDescending}))]})},String(w.key))})]})}),K("tbody",{children:St.map((w,M)=>{let $=Le(w),Z=Ve($),x=je($);return Ce("tr",{"data-yuktai-row-id":$,onClick:()=>B?.(w,M),style:{background:x?y:Z?te?"#1e3a5f":"#eff6ff":"transparent",cursor:B?"pointer":"default"},children:[a&&K("td",{style:{padding:10,borderBottom:te?"1px solid #334155":"1px solid #e2e8f0"},children:K("button",{type:"button",onClick:U=>{U.stopPropagation(),ot(w)},"aria-label":`${J.selectRow} ${$}`,"aria-pressed":Z,style:{width:28,height:28,display:"inline-flex",alignItems:"center",justifyContent:"center",padding:0,borderRadius:6,border:Z?"1px solid #2563eb":te?"1px solid #64748b":"1px solid #cbd5e1",background:Z?"#2563eb":"transparent",color:Z?"#ffffff":"currentColor",cursor:"pointer"},children:Z&&K(wi,{size:16})})}),t.filter(U=>!(pe&&U.hiddenOnMobile)).map(U=>K("td",{style:{padding:10,textAlign:U.align??"left",borderBottom:te?"1px solid #334155":"1px solid #e2e8f0"},children:Ht(w,U,M)},String(U.key)))]},$)})})]})}),ie&&Ce("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,flexWrap:"wrap",padding:12,borderTop:te?"1px solid #334155":"1px solid #e2e8f0"},children:[Ce("span",{style:{fontSize:13,opacity:.7},children:[J.page," ",X," ",J.of," ",$e]}),Ce("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[typeof u=="object"&&u.showSizeChanger&&K("select",{value:z,onChange:w=>{let M=Number(w.target.value);!Number.isFinite(M)||M<=0||(xe(M),q(1))},"aria-label":J.pageSize,style:{minHeight:40,padding:"7px 10px",borderRadius:8,border:te?"1px solid #475569":"1px solid #cbd5e1",background:te?"#1e293b":"#ffffff",color:te?"#ffffff":"#0f172a"},children:oe.map(w=>K("option",{value:w,children:w},w))}),K("button",{type:"button",disabled:X<=1,onClick:()=>q(w=>Math.max(1,w-1)),"aria-label":J.previous,title:J.previous,style:_e(X<=1),children:K(ic,{size:20})}),K("button",{type:"button",disabled:X>=$e,onClick:()=>q(w=>Math.min($e,w+1)),"aria-label":J.next,title:J.next,style:_e(X>=$e),children:K(rc,{size:20})})]})]})]})}import{useState as Jt,useMemo as Dt,useCallback as qe,useEffect as Fo}from"react";function xi(e){return e===!1?Number.MAX_SAFE_INTEGER:e===!0||e===void 0?10:e.pageSize??10}function To(e){return String(e??"").normalize("NFC").toLowerCase().trim()}function $A(e){return e==null||typeof e=="string"&&e.trim()===""}function Mo(e){if(typeof e=="number")return Number.isFinite(e)?e:null;let t=String(e??"").trim();if(t==="")return null;let A=Number(t);return Number.isFinite(A)?A:null}function Lo(e){let t=e instanceof Date?e.getTime():new Date(String(e)).getTime();return Number.isFinite(t)?t:null}function ac(e,t,A,o){if(A==="number"||typeof e=="number"&&typeof t=="number"){let n=Mo(e),r=Mo(t);if(n!==null&&r!==null)return n-r}if(A==="date"||e instanceof Date&&t instanceof Date){let n=Lo(e),r=Lo(t);if(n!==null&&r!==null)return n-r}return typeof e=="boolean"&&typeof t=="boolean"?e===t?0:e?1:-1:String(e).localeCompare(String(t),o,{sensitivity:"base",numeric:!0})}var It=()=>typeof performance<"u"?performance.now():Date.now();function gc(e,t){return e.map(A=>t.map(o=>{let n=A[o.key];return n==null?"":To(n)}).join(eA))}function lc(e,t,A){let o=!1,n=!0,r=!0,i=0;for(let a of e){let l=a[t];$A(l)||(i++,typeof l=="number"?o=!0:n=!1,l instanceof Date||(r=!1))}if(i===0)return null;let s=null;if(A==="number"||n?s=Mo:(A==="date"&&!o||r)&&(s=Lo),!s)return null;let g=new Float64Array(e.length);for(let a=0;a<e.length;a++){let l=e[a][t];if($A(l)){g[a]=NaN;continue}let I=s(l);if(I===null)return null;g[a]=I}return g}function cc(e){let{data:t,columns:A,pagination:o=!0,mobileBreakpoint:n=768,locale:r,initialFilters:i=[],engine:s="rust"}=e,g=HA(s,t.length),[a,l]=Jt(null),[I,u]=Jt(""),[C,h]=Jt(i),[y,f]=Jt(1),[B,m]=Jt(xi(o)),[p,c]=Jt(!1),d=xi(o);Fo(()=>{m(d),f(1)},[d]),Fo(()=>{if(typeof window>"u")return;let L=()=>{c(window.innerWidth<=n)};return L(),window.addEventListener("resize",L),()=>window.removeEventListener("resize",L)},[n]);let Q=Dt(()=>wt(A.map(L=>({key:String(L.key),label:L.label,type:L.type}))),[A]),b=qe(L=>{l(ne=>!ne||ne.key!==L?{key:L,direction:"asc"}:ne.direction==="asc"?{key:L,direction:"desc"}:null),f(1)},[]),S=qe(L=>{l(L&&L.direction?L:null),f(1)},[]),F=qe(()=>{l(null),f(1)},[]),P=qe(L=>{u(L),f(1)},[]),G=qe(L=>{h(L),f(1)},[]),D=qe(L=>{h(ne=>[...ne.filter(de=>de.key!==L.key),L]),f(1)},[]),E=qe(L=>{h(ne=>ne.filter(de=>de.key!==L)),f(1)},[]),j=qe(()=>{h([]),f(1)},[]),Ae=qe(L=>{m(Math.max(1,Math.floor(L)||1)),f(1)},[]),J=Dt(()=>g?g.setSearchTexts(gc(t,A)):!1,[g,t,A]),ee=Dt(()=>{let L=It(),ne=To(I);if(!ne)return{rows:t,ms:0,engine:null};if(g&&J){let pe=g.search(ne);if(pe)return{rows:Lt(t,pe),ms:It()-L,engine:"rust"}}return{rows:t.filter(pe=>A.some(ke=>{let fe=pe[ke.key];return fe==null?!1:To(fe).includes(ne)})),ms:It()-L,engine:"ts"}},[t,I,A,g,J]),ie=ee.rows,R=Dt(()=>{let L=It();return{rows:st(ie,Q,C),ms:It()-L}},[ie,Q,C]),oe=R.rows,T=Dt(()=>{if(!a||!a.direction)return{rows:oe,ms:0,engine:null};let L=It(),ne=A.find(ke=>String(ke.key)===a.key),de=a.direction==="desc"?-1:1;if(g){let ke=lc(oe,a.key,ne?.type),fe=ke&&g.sortByKeys(ke,de===-1);if(fe)return{rows:Lt(oe,fe),ms:It()-L,engine:"rust"}}return{rows:[...oe].sort((ke,fe)=>{let He=ke[a.key],De=fe[a.key],Ct=$A(He),Me=$A(De);return Ct&&Me?0:Ct?1:Me?-1:de*ac(He,De,ne?.type,r)}),ms:It()-L,engine:"ts"}},[oe,a,A,r,g]),Y=T.rows,X=Dt(()=>!ee.engine&&!T.engine?null:{query:I.trim(),ms:ee.ms+R.ms+T.ms,rows:oe.length,engine:ee.engine==="rust"||T.engine==="rust"?"rust":"ts"},[ee,R,T,I,oe.length]),q=Math.max(1,Math.ceil(Y.length/B)),z=Dt(()=>{if(o===!1)return Y;let L=(y-1)*B;return Y.slice(L,L+B)},[Y,y,B,o]);Fo(()=>{y>q&&f(q)},[y,q]);let xe=qe(L=>f(Math.min(Math.max(1,Math.floor(L)||1),q)),[q]),ve=qe(()=>{l(null),u(""),h([]),f(1)},[]);return{displayedData:z,rows:Y,searchTime:X,totalCount:t.length,filteredCount:Y.length,sort:a,toggleSort:b,setSort:S,clearSort:F,searchQuery:I,setSearchQuery:P,filters:C,setFilters:G,setFilter:D,removeFilter:E,clearFilters:j,page:y,pageSize:B,totalPages:q,setPage:xe,setPageSize:Ae,isMobile:p,reset:ve}}function uc(){if(typeof globalThis>"u")return new xt;if(!globalThis.__yuktai_runtime__){let e=new xt;e.register(Ge.name,Ge),e.register(YA.name,YA),e.register(UA.name,UA),globalThis.__yuktai_runtime__=e}return globalThis.__yuktai_runtime__}var ki=typeof window<"u"?uc():new xt,vI={wcagPlugin:Ge,list(){return ki.getPlugins()},use(e){return ki.use(e)},fix(e){return Ge.applyFixes({enabled:!0,autoFix:!0,...e})},scan(){return Ge.scan()}};export{RA as AUDIT_RULES,Qs as AbcIcon,Hi as AccessibilityIcon,Ea as AdminIcon,od as AgenticGridBar,ui as AgenticPanel,Cr as AlertIcon,Is as AlignCenterIcon,ps as AlignJustifyIcon,ds as AlignLeftIcon,Cs as AlignRightIcon,Ks as ApiIcon,ea as ArchitectureIcon,ra as ArrowDownIcon,Kr as ArrowLeftIcon,qr as ArrowRightIcon,Pr as ArrowUpIcon,ba as BarChartIcon,ls as BoldIcon,xr as BookIcon,js as BookmarkIcon,ta as BrainIcon,wa as BugReportIcon,ts as BulbIcon,Ba as CakeIcon,kr as CalendarIcon,ir as CardsIcon,rr as ChatIcon,Pi as CheckIcon,Ui as ChevronLeftIcon,Ji as ChevronRightIcon,or as ChevronsIcon,ca as CleaningIcon,Dr as ClockIcon,Ki as CloseIcon,Ws as CloudIcon,as as CodeIcon,Hs as ComputerIcon,$i as ContrastIcon,lr as CopyIcon,ri as DEFAULT_A11Y_SETTINGS,la as DashboardIcon,qs as DataObjectIcon,os as DeleteIcon,ga as DocumentScannerIcon,gr as DownloadIcon,ua as DragHandleIcon,pa as ExploreIcon,Jr as ExternalIcon,mr as EyeIcon,Vs as EyeOffIcon,fl as FONT_MAX,pl as FONT_MIN,ii as FONT_STEP,sa as FactCheckIcon,Ur as FileIcon,cr as FilterIcon,ur as FirstIcon,hs as FontIcon,fr as FormIcon,Rs as FullscreenExitIcon,vs as FullscreenIcon,_s as GavelIcon,Lr as GiftIcon,vr as GlobeIcon,_t as GridCore,nr as GridIcon,Hr as HeadphonesIcon,rs as HeartFilledIcon,is as HeartIcon,jr as HelpIcon,Er as HomeIcon,ss as HubIcon,vi as ICON_MIN_CONTRAST,Gi as ICON_NAMES,Si as ICON_PATHS,Ti as IconBase,Yr as ImageIcon,aa as ImageSearchIcon,pr as InfoIcon,Ca as InsightsIcon,Vr as InstallIcon,ka as IntegrationIcon,cs as ItalicIcon,Fs as JoinIcon,ks as KeyIcon,ha as KeyboardIcon,ma as LabelIcon,Rr as LampIcon,dr as LastIcon,hr as LayoutIcon,bs as LinkIcon,Ta as LoaderIcon,ws as LockIcon,va as LoginIcon,Ra as LogoutIcon,zr as MapIcon,_r as MeditateIcon,wr as MenuIcon,Ns as MergeIcon,sr as MicIcon,er as MinusIcon,Wi as MoonIcon,zi as MotionIcon,Us as MovieIcon,$r as MusicIcon,Ls as MusicOffIcon,Ys as MusicVideoIcon,Da as NamaskarIcon,Bs as PageBreakIcon,ji as PaletteIcon,Fr as PauseIcon,Or as PenIcon,Sr as PersonIcon,$s as PhoneIcon,Wr as PinIcon,Nr as PlayIcon,br as PlugIcon,_i as PlusIcon,fs as QuoteIcon,bn as RUST_AUTO_MIN_ROWS,na as RadioCheckedIcon,oa as RadioIcon,Oi as ReadingIcon,Ds as RedoIcon,Fa as RepeatIcon,tr as ResetIcon,ns as RobotIcon,xt as Runtime,fa as SaveIcon,Zs as SchoolIcon,Mi as SearchIcon,Xs as SearchOffIcon,Tr as SendIcon,xa as SentimentSadIcon,Mr as ShareIcon,La as ShieldCheckIcon,Gs as ShuffleIcon,Zi as SkipIcon,Js as SlideshowIcon,Yi as SortDownIcon,Ar as SortIcon,Li as SortUpIcon,Ir as SparkIcon,Vi as SpeakerIcon,Na as SpeedIcon,ys as SpellcheckIcon,Ma as StarIcon,ar as StopIcon,Ps as StorageIcon,Es as StyleIcon,As as SunIcon,Sa as SunriseIcon,Ga as SunsetIcon,Ss as SwapIcon,Xi as TargetIcon,Zr as TempleIcon,gs as TextIcon,ms as TitleIcon,Br as ToolsIcon,Ts as TouchIcon,Qa as TrendingDownIcon,ya as TrendingUpIcon,es as TrophyIcon,us as UnderlineIcon,Qr as UndoIcon,xs as UnlockIcon,ia as UploadIcon,Gr as UsersIcon,Ms as VolumeOffIcon,Aa as VolunteerIcon,Xr as WalletIcon,yr as WandIcon,zs as WifiIcon,Os as WifiOffIcon,vI as YuktAI,Do as YuktAIWrapper,sc as YuktaiGrid,Go as YuktaiGridAI,Wl as YuktaiGridAgent,qA as YuktaiGridWebMCP,qi as YuktaiIcon,da as ZoomInIcon,Ia as ZoomOutIcon,Ye as accessibleName,Bo as addPeriods,nA as aggregate,YA as aiPlugin,sl as analyzePage,Vn as answerGridQuestion,st as applyGridFilters,ei as askAboutPage,_n as askInsight,qn as auditToJSON,Kn as auditToMarkdown,Un as clearFilters,Pn as clearSort,ol as comparePeriods,OA as contrastRatio,Tn as countGrid,Hn as createA11yCopilot,DA as createContextIndex,oA as createGridTools,si as createVoiceA11yController,Do as default,ho as detectAnomalies,ll as detectPageIntent,gt as executeGridQuery,Yn as filterGrid,Pe as findMentionedColumn,Mn as getColumns,Ln as getRow,he as getRowId,Ng as gridPassages,Al as groupBy,AA as highlightRows,Ri as iconContrast,Fi as iconSvg,co as loadGridCore,hl as moveGridRowFocus,vA as openRow,Rg as pagePassages,Co as parseAmount,zA as parseColor,Qi as parseGridIntent,Ut as parseGridQuery,ml as parseVoiceA11yCommand,Ni as pickGlyphColor,bo as planTasks,Og as readFormFields,Di as relativeLuminance,Wn as reviewDesign,Xg as reviewForm,NA as reviewForms,tl as runGridQuery,at as runQaAudit,ni as runTasks,Fn as searchGrid,GA as selectRow,Jn as sortGrid,Zn as startOfPeriod,yo as summarizeRows,wt as toGridToolColumns,kA as tokenize,nl as trend,Ad as useAgenticGrid,cc as useGrid,KA as useYuktaiGridAgent,UA as voicePlugin,go as wantsRustEngine,Ge as wcag,Ge as wcagPlugin};
|