PageSourceSearch

https://www.pryv.ai/_next/static/chunks/38453-f759dd81ecc68026.js

js pryv.ai collected 2026-10-05 12:32:19 UTC 56,574 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[38453],{523:(e,t,r)=>{r.d(t,{E1:()=>u,Fb:()=>l,K_:()=>y,N1:()=>g,S1:()=>m,Wq:()=>b,Zu:()=>w,bH:()=>c,jq:()=>x,kz:()=>f,ly:()=>v,pU:()=>p,zj:()=>s});var i=r(96617);let n={"gpt-5.5":{id:"gpt-5.5",name:"GPT 5.5",description:"OpenAI's default flagship model",provider:"openai",devOnly:!1,supportsVision:!0,supportsPdf:!0,supportsCsvNative:!1,supportsWebSearch:!0},"gpt-5.4":{id:"gpt-5.4",name:"GPT 5.4",description:"OpenAI's previous flagship model",provider:"openai",devOnly:!1,supportsVision:!0,supportsPdf:!0,supportsCsvNative:!1,supportsWebSearch:!0},"gemini-3.1-pro-preview":{id:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro Preview",description:"Preview release of Gemini 3.1 Pro (Google)",provider:"google",devOnly:!1,supportsVision:!0,supportsPdf:!0,supportsCsvNative:!0,supportsWebSearch:!0},"claude-sonnet-4-6":{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",description:"Anthropic multimodal model",provider:"anthropic",devOnly:!1,supportsVision:!0,supportsPdf:!0,supportsCsvNative:!1,supportsWebSearch:!1},"claude-opus-4-7":{id:"claude-opus-4-7",name:"Claude Opus 4.7",description:"Anthropic flagship reasoning model",provider:"anthropic",devOnly:!1,supportsVision:!0,supportsPdf:!0,supportsCsvNative:!1,supportsWebSearch:!1},"grok-4-1-fast-reasoning":{id:"grok-4-1-fast-reasoning",name:"Grok 4.1 Fast Reasoning",description:"Fast reasoning model from xAI (4.1)",provider:"xai",devOnly:!1,supportsVision:!0,supportsPdf:!0,supportsCsvNative:!0,supportsWebSearch:!0}},l=Object.freeze(Object.keys(n)),s=Object.freeze(l.filter(e=>"openai"===n[e].provider)),a=Object.values(n).reduce((e,t)=>(e[t.name]=t.id,e),{}),d="gpt-5.5",o={"gpt-5.1":"gpt-5.5","gpt-5.2":"gpt-5.5","gpt-5.3":"gpt-5.5","gpt-5.4-pro":"gpt-5.4","gemini-3-pro-preview":"gemini-3.1-pro-preview","claude-sonnet-4-5":"claude-sonnet-4-6","claude-opus-4-5":"claude-opus-4-7","claude-opus-4-6":"claude-opus-4-7","grok-4":"grok-4-1-fast-reasoning","grok-4-fast-reasoning":"grok-4-1-fast-reasoning"};function c(e){var t;return"string"!=typeof e?d:e in n?e:null!=(t=o[e])?t:d}function u(e){return"string"==typeof e&&e in n?n[c(e)]:"string"==typeof e&&e in a?n[c(a[e])]:n[c(e)]}let p=Object.values(n).filter(e=>{let{devOnly:t}=e;return!t||i.IJ}),x=d;function m(e){var t;return!!(null==(t=n[c(e)])?void 0:t.supportsVision)}function f(e){let t=c(e);return m(t)?t:d}let h=["openai","xai","anthropic"];function b(e){let t=n[c(e)];return!!((null==t?void 0:t.supportsVision)&&h.includes(t.provider))}function g(e){let t=c(e);return b(t)?t:d}function v(e){var t;return!!(null==(t=n[c(e)])?void 0:t.supportsWebSearch)}function w(e){var t;return!!(null==(t=n[c(e)])?void 0:t.supportsPdf)}function y(e){var t;return!!(null==(t=n[c(e)])?void 0:t.supportsCsvNative)}},13838:(e,t,r)=>{r.d(t,{F0:()=>d,G_:()=>n,HV:()=>a,Nf:()=>s,qe:()=>l});var i=r(30916);function n(e){if(!e||"string"!=typeof e.modelId||0===e.modelId.length)return;let t={...(0,i.Ej)({modelId:e.modelId,reasoning:e.reasoning})};return"boolean"==typeof e.noPiiRedaction&&(t.noPiiRedaction=e.noPiiRedaction),void 0!==e.skipPiiRedaction&&(t.skipPiiRedaction=e.skipPiiRedaction),Array.isArray(e.piiEntities)&&e.piiEntities.length>0&&(t.piiEntities=[...e.piiEntities]),null!=e.piiConfig&&(t.piiConfig=e.piiConfig),Array.isArray(e.tools)&&e.tools.length>0&&(t.tools=[...e.tools]),Array.isArray(e.urls)&&e.urls.length>0&&(t.urls=[...e.urls]),Array.isArray(e.csvs)&&e.csvs.length>0&&(t.csvs=e.csvs.map(e=>({...e}))),t}function l(e){if(!e||"object"!=typeof e||Array.isArray(e))return null;let t=e.editablePrompt;return!t||"object"!=typeof t||Array.isArray(t)||"string"!=typeof t.modelId||0===t.modelId.length?null:{...(0,i.Ej)({modelId:t.modelId,reasoning:t.reasoning}),..."boolean"==typeof t.noPiiRedaction?{noPiiRedaction:t.noPiiRedaction}:{},...void 0!==t.skipPiiRedaction?{skipPiiRedaction:t.skipPiiRedaction}:{},...Array.isArray(t.piiEntities)?{piiEntities:[...t.piiEntities]}:{},...null!=t.piiConfig?{piiConfig:t.piiConfig}:{},...Array.isArray(t.tools)?{tools:[...t.tools]}:{},...Array.isArray(t.urls)?{urls:[...t.urls]}:{},...Array.isArray(t.csvs)?{csvs:t.csvs.map(e=>e&&"object"==typeof e?{...e}:e)}:{}}}function s(e){if(!e||!0===e.skipPiiRedaction)return!1;if(e.skipPiiRedaction&&"object"==typeof e.skipPiiRedaction&&!Array.isArray(e.skipPiiRedaction)){let t=e.skipPiiRedaction;return["text","image","pdf","csv"].some(e=>!0!==t[e])}return!0!==e.noPiiRedaction}function a(e,t){let r=s(e),i=(null==e?void 0:e.encryptedChatV2)===!0,n=null==e?void 0:e.privacyMode;if(r||i||n)return{showLock:!0,..."number"==typeof t?{replacementCount:t}:{},...i?{encryptedStorage:!0}:{},...n?{promptMode:n}:{}}}function d(e){if(!e||"object"!=typeof e||Array.isArray(e))return null;let t=e.privacy;return!t||"object"!=typeof t||Array.isArray(t)||!0!==t.showLock?null:{showLock:!0,..."number"==typeof t.replacementCount?{replacementCount:t.replacementCount}:{},...!0===t.encryptedStorage?{encryptedStorage:!0}:{},..."string"==typeof t.promptMode?{promptMode:t.promptMode}:{}}}},25575:(e,t,r)=>{r.d(t,{C:()=>n,r:()=>i});let i="auto";function n(e){let{blur:t,method:r=i,detectionStrength:n,blurStrength:l}=e;return t?{blur:!0,...r&&r!==i?{method:r}:{},..."number"==typeof n?{detectionStrength:n}:{},..."number"==typeof l?{blurStrength:l}:{}}:{blur:!1}}},30916:(e,t,r)=>{r.d(t,{Ej:()=>u,Fr:()=>a,Lc:()=>n,Ry:()=>p,Yg:()=>s,ZX:()=>d,lf:()=>x,w0:()=>o});var i=r(523);let n="gpt-5.4-pro",l=["gpt-5.5","gpt-5.4"],s=["none","low","medium","high","xhigh"],a="low";function d(e){return"string"==typeof e&&s.includes(e)}function o(e){return"string"==typeof e&&l.includes((0,i.bH)(e))}function c(e,t){return e===n?{effort:"high"}:o(e)?function(e){if(!e||"object"!=typeof e||Array.isArray(e))return;let t=e.effort;return d(t)?{effort:t}:void 0}(t):void 0}
1function u(e){let t=(0,i.bH)(e.modelId),r=c(e.modelId,e.reasoning);return{modelId:t,...r?{reasoning:r}:{}}}function p(e,t){var r,i;return null!=(i=null==(r=c(e,t))?void 0:r.effort)?i:a}function x(e,t){return o(e)?{effort:t}:void 0}},35620:(e,t,r)=>{r.d(t,{$:()=>i});function i(e){let{skipAll:t,redactText:r,redactImage:i,redactPdf:n,redactCsv:l}=e;return t?{noPiiRedaction:!0,skipPiiRedaction:!0}:{noPiiRedaction:!1,skipPiiRedaction:{text:!r,image:!i,pdf:!n,csv:!l}}}},58853:(e,t,r)=>{r.d(t,{G:()=>W});var i=r(95155),n=r(12115),l=r(5196),s=r(78749),a=r(92657),d=r(35169),o=r(1243),c=r(70257),u=r(66474),p=r(50591),x=r(56926),m=r(11595),f=r(50434),h=r(14061),b=r(97168),g=r(89852),v=r(523),w=r(30916),y=r(13838),j=r(96617),N=r(95784),C=r(99474),_=r(53999),S=r(97552);let R={CREDIT_CARD:"Credit Cards",CREDIT_CARD_LAST4:"Credit Card Last 4",CRYPTO:"Financial Accounts",EMAIL_ADDRESS:"Email Addresses",IBAN_CODE:"IBAN Codes",US_BANK_NUMBER:"US Bank Numbers",US_EIN:"Employer ID Numbers",PHONE_NUMBER:"Phone Numbers",PERSON:"Personal Names",US_SSN:"SSN",US_ITIN:"ITIN",US_PASSPORT:"US Passport",US_DRIVER_LICENSE:"Driver License",MEDICAL_LICENSE:"Medical License",UK_NHS:"UK NHS Numbers",UK_NINO:"UK NINO",IP_ADDRESS:"IP Addresses",LOCATION:"Locations",ADDRESS:"Street Addresses",DATE_TIME:"Dates & Times",DATE:"Date Patterns",NRP:"Nationality/Religion/Political",URL:"URLs",RECEIPT_NUMBER:"Receipt/Invoice Numbers"},A={EMAIL_ADDRESS:"Emails",PHONE_NUMBER:"Phone Numbers",PERSON:"Names",LOCATION:"Locations",ADDRESS:"Addresses",DATE_TIME:"Dates & Times",DATE:"Dates",URL:"URLs",CREDIT_CARD:"Credit Cards",CREDIT_CARD_LAST4:"Card Last 4",RECEIPT_NUMBER:"Receipt Numbers"},P=["CREDIT_CARD","CREDIT_CARD_LAST4","CRYPTO","EMAIL_ADDRESS","IBAN_CODE","US_BANK_NUMBER","US_EIN"],k=["PHONE_NUMBER","PERSON","US_SSN","US_ITIN","US_PASSPORT","US_DRIVER_LICENSE"],E=["MEDICAL_LICENSE","UK_NHS","UK_NINO"],I=["IP_ADDRESS","LOCATION","ADDRESS","DATE_TIME","DATE"],D=["NRP","URL","RECEIPT_NUMBER"],T=/<([A-Z]+(?:_[A-Z]+)*)_(\d+)(?:=[^>]+)?>/g;function O(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}function M(e){return"input_image"===e.type}function L(e){return"input_pdf"===e.type}function U(e){return"input_csv"===e.type}function F(e){var t;let{text:r,totalRows:n,totalColumns:l}=e,s=(0,S.pd)(r,{maxRows:j.Vh,maxColumns:j.Jk}),a=s.rows,d=null!=(t=a[0])?t:[],o=a.length>1?a.slice(1):[],c=new Map,u=d.map((e,t)=>{var r;let i=e||"empty",n=null!=(r=c.get(i))?r:0;return c.set(i,n+1),{key:"csv-header-".concat(i,"-").concat(n),label:e||"Column ".concat(t+1)}}),p=new Map,x=(o.length>0?o:[d]).map(e=>{var t;let r=e.join("\x1f")||"empty",i=null!=(t=p.get(r))?t:0;p.set(r,i+1);let n=new Map;return{key:"csv-row-".concat(r,"-").concat(i),cells:e.map(e=>{var t;let i="".concat(r,"-").concat(e||"empty"),l=null!=(t=n.get(i))?t:0;return n.set(i,l+1),{key:"csv-cell-".concat(i,"-").concat(l),value:e}})}}),m="number"==typeof n&&n>0?n:s.totalRows,f="number"==typeof l&&l>0?l:s.totalColumns;return(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)("div",{className:"overflow-hidden rounded-[14px] border border-white/80 bg-white/85",children:(0,i.jsx)("div",{className:"max-h-[260px] overflow-auto",children:(0,i.jsxs)("table",{className:"min-w-full border-separate border-spacing-0 text-left text-[11px] text-[#334155]",children:[(0,i.jsx)("thead",{className:"sticky top-0 bg-[#eef8ff] text-[10px] uppercase tracking-[0.08em] text-[#64839a]",children:(0,i.jsx)("tr",{children:u.map(e=>(0,i.jsx)("th",{className:"border-b border-white/80 px-3 py-2 font-semibold",children:e.label},e.key))})}),(0,i.jsx)("tbody",{children:x.map(e=>(0,i.jsx)("tr",{className:"odd:bg-white even:bg-[#f8fcff]",children:e.cells.map(e=>(0,i.jsx)("td",{className:"max-w-[220px] border-b border-white/70 px-3 py-2 align-top font-mono text-[11px] text-[#334155]",children:(0,i.jsx)("span",{className:"line-clamp-3 whitespace-pre-wrap break-words",children:e.value||" "})},e.key))},e.key))})]})})}),(0,i.jsxs)("div",{className:"text-[11px] text-[#64839a]",children:["Showing up to ",j.Vh," rows and ",j.Jk," columns.",m>0||f>0?" Source: ".concat(m," rows x ").concat(f," cols."):"",s.truncatedRows||s.truncatedColumns?" Preview truncated.":""]})]})}function B(e,t){return"number"==typeof e&&Number.isFinite(e)?Math.min(1,Math.max(0,e)):t}function V(e){return Object.prototype.hasOwnProperty.call(R,e)}function H(e){return V(e)?e:null}function z(e){let t=e.match(/^<([A-Z]+(?:_[A-Z]+)*)_(\d+)(?:=[^>]+)?>$/);return t?"<".concat(t[1],"_").concat(t[2],">"):e}function K(e){let{title:t,description:r,children:n,className:l,headerActions:s}=e;return(0,i.jsxs)("section",{className:(0,_.cn)("rounded-[16px] border border-[var(--shell-border)] bg-[var(--shell-surface-soft)] p-2.5 shadow-[inset_0_1px_0_rgba(255,255,255,0.18)] md:p-3",l),children:[(0,i.jsxs)("div",{className:"mb-2.5 flex flex-wrap items-start justify-between gap-2",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h3",{className:"text-xs font-semibold tracking-[-0.02em] text-foreground md:text-[13px]",children:t}),r?(0,i.jsx)("p",{className:"mt-0.5 text-[10px] leading-4 text-muted-foreground md:text-[11px]",children:r}):null]}),s?(0,i.jsx)("div",{className:"shrink-0",children:s}):null]}),n]})}
1function G(e){let{checked:t,label:r,description:n,onToggle:s,disabled:a=!1,dataTestId:d}=e;return(0,i.jsxs)("button",{type:"button",role:"checkbox","aria-checked":t,"aria-disabled":a,"data-testid":d,disabled:a,onClick:s,className:(0,_.cn)("flex w-full items-start gap-2 rounded-[14px] border px-2.5 py-2 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",t?"border-[var(--shell-border-strong)] bg-[var(--shell-surface-strong)] text-foreground shadow-sm":"border-[var(--shell-border)] bg-background/40 text-foreground/90 hover:bg-[var(--shell-surface)]",a?"cursor-not-allowed border-[var(--shell-border)] bg-background/25 text-muted-foreground":"cursor-pointer"),children:[(0,i.jsx)("span",{"aria-hidden":"true",className:(0,_.cn)("pii-checkbox mt-px h-[18px] w-[18px] shrink-0 rounded-[5px] border-[var(--shell-border-strong)] bg-background/70",t&&"is-active"),children:t?(0,i.jsx)(l.A,{className:"h-2.5 w-2.5 text-white"}):null}),(0,i.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,i.jsx)("span",{className:"block text-xs font-medium leading-4 text-inherit md:text-[13px]",children:r}),n?(0,i.jsx)("span",{className:"mt-0.5 block text-[10px] leading-4 text-muted-foreground md:text-[11px]",children:n}):null]})]})}function Z(e){let{id:t,label:r,value:n,onChange:l,disabled:s=!1,hint:a,dataTestId:d}=e;return(0,i.jsxs)("div",{className:(0,_.cn)("rounded-[14px] border border-[var(--shell-border)] bg-background/40 p-2.5 shadow-[inset_0_1px_0_rgba(255,255,255,0.1)]",s&&"bg-background/25"),children:[(0,i.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,i.jsx)("label",{htmlFor:t,className:"text-xs font-medium text-foreground md:text-[13px]",children:r}),(0,i.jsx)("span",{className:"rounded-full border border-[var(--shell-border)] bg-[var(--shell-surface-strong)] px-1.5 py-0.5 font-mono text-[10px] text-foreground/80 md:text-[11px]",children:n.toFixed(2)})]}),a?(0,i.jsx)("p",{className:"mt-1 text-[10px] leading-4 text-muted-foreground md:text-[11px]",children:a}):null,(0,i.jsx)("input",{id:t,"data-testid":d,type:"range",min:0,max:1,step:.05,value:n,onChange:l,className:"mt-2.5 h-1.5 w-full cursor-pointer accent-[var(--pii-brand)] disabled:cursor-not-allowed disabled:opacity-70",disabled:s})]})}function W(e){var t,r,j,S,W,Y,$,q,J,X,Q,ee,et,er,ei,en,el,es,ea,ed,eo,ec,eu,ep,ex,em,ef,eh,eb,eg,ev,ew,ey,ej,eN,eC,e_,eS,eR,eA,eP,ek,eE,eI,eD,eT,eO,eM,eL,eU,eF,eB;let{preview:eV,draftReq:eH,draftText:ez,piiSettings:eK,approvedDraft:eG,surfaceVariant:eZ="composer",isPreviewing:eW=!1,isApproving:eY=!1,isSending:e$=!1,requiresFreshPreview:eq=!1,onCancel:eJ,onDraftTextChange:eX,onRepreview:eQ,onApproveAndSend:e0}=e,e1="string"==typeof ez?ez:null!=(ey=null==eH?void 0:eH.message.content)?ey:"",e5=null!=(ej=null==eH?void 0:eH.message.content)?ej:"",e2=null!=(eN=null==eV?void 0:eV.preview.cleanPrompt)?eN:"",e4=0===e1.trim().length&&e5.trim().length>0&&e2.trim()===e5.trim()?e1:e2||e1,e8=Object.keys(null!=(eC=null==eV?void 0:eV.piiParameters)?eC:{}).length,e7=function(e){if(null==e)return null;let t="number"==typeof e?e:"string"==typeof e?Number(e):null;return null!=t&&Number.isFinite(t)?t<1e12?1e3*t:t:null}(null==eV?void 0:eV.expiresAt),e3=null!=e7?function(e){let t=e-Date.now();return t<=0?0:Math.ceil(t/6e4)}(e7):null,e9=(null==eV?void 0:eV.piiParameters)?Object.entries(eV.piiParameters):[],e6=null!=(eS=null!=(e_=null==eV?void 0:eV.draftId)?e_:null==eV?void 0:eV.draftDigest)?eS:"",te=null!=(eR=null==eV?void 0:eV.preview.contentForModel)?eR:null,tt=Array.isArray(te)?te:"string"==typeof te?[{type:"input_text",text:te}]:null,tr=(0,n.useMemo)(()=>tt?tt.filter(M):[],[tt]),ti=(0,n.useMemo)(()=>tt?tt.filter(L):[],[tt]),tn=(0,n.useMemo)(()=>tt?tt.filter(U):[],[tt]),tl=null!=(eA=null==eH||null==(t=eH.images)?void 0:t.length)?eA:0,ts=null!=(eP=null==eH||null==(r=eH.pdfs)?void 0:r.length)?eP:0,ta=null!=(ek=null==eH||null==(j=eH.csvs)?void 0:j.length)?ek:0,td=!!(null==eH||null==(S=eH.tools)?void 0:S.some(e=>"string"==typeof e?"web_search"===e:(null==e?void 0:e.type)==="web_search")),to="".concat(null!=(eE=null==eH?void 0:eH.message.id)?eE:"none",":").concat(null!=(eD=null!=(eI=null==eV?void 0:eV.draftId)?eI:null==eV?void 0:eV.draftDigest)?eD:"none"),tc=null!=(eT=null==eH?void 0:eH.message.id)?eT:"none",tu=eW||eY||e$,tp=eY||e$,tx="review"===eZ,tm=(0,n.useMemo)(()=>{var e,t;return(0,v.bH)(null!=(t=null==eV||null==(e=eV.preview)?void 0:e.modelId)?t:null==eH?void 0:eH.modelId)},[null==eH?void 0:eH.modelId,null==eV||null==(W=eV.preview)?void 0:W.modelId]),tf=(0,n.useMemo)(()=>{var e,t;return(0,w.Ry)(null!=(t=null==eV||null==(e=eV.preview)?void 0:e.modelId)?t:null==eH?void 0:eH.modelId,null==eH?void 0:eH.reasoning)},[null==eH?void 0:eH.modelId,null==eH?void 0:eH.reasoning,null==eV||null==(Y=eV.preview)?void 0:Y.modelId]),th=(eB=eK.skipAll,eH?!(0,y.Nf)(eH):eB),tb=function(e){let t=null==e?void 0:e.skipPiiRedaction;return!t||"object"!=typeof t||Array.isArray(t)?null:t}(eH),tg=Array.isArray(null==eH?void 0:eH.piiEntities)?eH.piiEntities.filter(e=>V(e)):eK.entities,tv=!th&&!(null!=(eO=null==tb?void 0:tb.text)&&eO),tw=!th&&!(null!=(eM=null==tb?void 0:tb.image)&&eM),ty=!th&&!(null!=(eL=null==tb?void 0:tb.pdf)&&eL),tj=!th&&!(null!=(eU=null==tb?void 0:tb.csv)&&eU),tN="boolean"!=typeof(null==eH||null==(q=eH.piiConfig)||null==($=q.preview)?void 0:$.includeRedactedMedia)||!!eH.piiConfig.preview.includeRedactedMedia,tC="boolean"==typeof(null==eH||null==(Q=eH.piiConfig)||null==(X=Q.image)||null==(J=X.faces)?void 0:J.blur)?!!eH.piiConfig.image.faces.blur:null==(eF=null==eK?void 0:eK.faceBlur)||eF,t_=(null==eH||null==(er=eH.piiConfig)||null==(et=er.image)||null==(ee=et.faces)?void 0:ee.method)==="face_recognition"?"face_recognition":(null==eH||null==(el=eH.piiConfig)||null==(en=el.image)||null==(ei=en.faces)?void 0:ei.method)==="opencv"?"opencv"
1:"auto",tS=B(null==eH||null==(ed=eH.piiConfig)||null==(ea=ed.image)||null==(es=ea.faces)?void 0:es.detectionStrength,.85),tR=B(null==eH||null==(eu=eH.piiConfig)||null==(ec=eu.image)||null==(eo=ec.faces)?void 0:eo.blurStrength,.9),tA="number"==typeof(null==eH||null==(ex=eH.piiConfig)||null==(ep=ex.analysis)?void 0:ep.scoreThreshold)?eH.piiConfig.analysis.scoreThreshold:"number"==typeof(null==eH||null==(ef=eH.piiConfig)||null==(em=ef.image)?void 0:em.scoreThreshold)?eH.piiConfig.image.scoreThreshold:"number"==typeof(null==eH||null==(eb=eH.piiConfig)||null==(eh=eb.pdf)?void 0:eh.scoreThreshold)?eH.piiConfig.pdf.scoreThreshold:"number"==typeof(null==eH||null==(ev=eH.piiConfig)||null==(eg=ev.csv)?void 0:eg.scoreThreshold)?eH.piiConfig.csv.scoreThreshold:.5,[tP,tk]=(0,n.useState)(!1),[tE,tI]=(0,n.useState)(!0),[tD,tT]=(0,n.useState)(""),[tO,tM]=(0,n.useState)(e4),[tL,tU]=(0,n.useState)([]),[tF,tB]=(0,n.useState)([]),[tV,tH]=(0,n.useState)([]),[tz,tK]=(0,n.useState)(th),[tG,tZ]=(0,n.useState)(tN),[tW,tY]=(0,n.useState)(tv),[t$,tq]=(0,n.use
1State)(tw),[tJ,tX]=(0,n.useState)(ty),[tQ,t0]=(0,n.useState)(tj),[t1,t5]=(0,n.useState)(tC),[t2,t4]=(0,n.useState)(tA),[t8,t7]=(0,n.useState)(t_),[t3,t9]=(0,n.useState)(tS),[t6,re]=(0,n.useState)(tR),[rt,rr]=(0,n.useState)(tg),[ri,rn]=(0,n.useState)(tm),[rl,rs]=(0,n.useState)(tf),[ra,rd]=(0,n.useState)(""),[ro,rc]=(0,n.useState)(!1),ru=(0,n.useRef)(null),rp=(0,n.useRef)(null),rx=(0,n.useMemo)(()=>new Set(rt),[rt]),rm=(0,n.useMemo)(()=>{var e;return Object.fromEntries(Object.entries(null!=(e=null==eV?void 0:eV.piiParameters)?e:{}).map(e=>{let[t,r]=e;return[z(t),r]}))},[null==eV?void 0:eV.piiParameters]),rf=(0,n.useMemo)(()=>{let e=Array.from(e4.matchAll(T),e=>z(e[0]));return e.length>0?e:Object.keys(rm)},[rm,e4]),rh=(0,n.useMemo)(()=>{var e,t,r;let i=(null==(e=rp.current)?void 0:e.sessionId)===tc?rp.current:null;return{sessionId:tc,placeholderOrder:function(e,t){if(0===e.length)return t;if(0===t.length)return e;let r=new Set(e),i=[...e];for(let e of t)r.has(e)||(r.add(e),i.push(e));return i}(null!=(t=null==i?void 0:i.placeholderOrder)?t:[],rf),piiParameters:{...null!=(r=null==i?void 0:i.piiParameters)?r:{},...rm}}},[rm,rf,tc]),rb=(0,n.useCallback)(e=>(function(e,t,r){let i=new Map(Object.entries(t).filter(e=>{let[t]=e;return!0}).map(e=>{let[t,r]=e;return[z(t),r]}));return e.replace(T,e=>{var t;return null!=(t=i.get(z(e)))?t:e})})(e,rh.piiParameters),[rh.piiParameters]),rg=(0,n.useCallback)(e=>{if(0===rh.placeholderOrder.length)return e1;let t=new Set(e),r=e1;for(let e of rh.placeholderOrder){let i=function(e){let t=e.match(/^<([A-Z]+(?:_[A-Z]+)*)_\d+(?:=[^>]+)?>$/);return t?H(t[1]):null}(e);if(!i||!t.has(i))continue;let n=rh.piiParameters[e];n&&(r=function(e,t,r){if(!t)return e;let i=e.indexOf(t);return -1===i?e:"".concat(e.slice(0,i)).concat(r).concat(e.slice(i+t.length))}(r,n,e))}return r},[e1,rh]),rv=(0,w.lf)(tm,tf),rw=(0,w.lf)(ri,rl),ry=ru.current===to?tO:e4,rj=!!(eV&&ry!==e4),rN=ri!==tm||(null==rw?void 0:rw.effort)!==(null==rv?void 0:rv.effort)||tz!==th||tG!==tN||tW!==tv||t$!==tw||tJ!==ty||tQ!==tj||t1!==tC||t8!==t_||Math.abs(t3-tS)>.001||Math.abs(t6-tR)>.001||Math.abs(t2-tA)>.001||!(rt.length===tg.length&&rt.every((e,t)=>e===tg[t])),rC=eq||rj,r_=rC||rN,rS=!!eV&&tE,rR=!!(eV&&eH&&rS&&!r_&&(tx||eG));(0,n.useEffect)(()=>{ru.current!==to&&(ru.current=to,tk(!1),tI(!0),tM(e4),rn(tm),rs(tf),tK(th),rr(tg),rd(""),tZ(tN),tY(tv),tq(tw),tX(ty),t0(tj),t5(tC),t7(t_),t9(tS),re(tR),t4(tA))},[e4,tg,tC,tR,tS,t_,tN,tw,ty,tv,tA,th,tm,tf,tj,to]),(0,n.useEffect)(()=>{var e,t;if(!eV)return;let r=null!=(t=null!=(e=eV.draftDigest)?e:eV.draftId)?t:"",i="undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"".concat(Date.now(),"-").concat(Math.random().toString(16).slice(2));tT("".concat(r,"-").concat(i))},[eV]),(0,n.useEffect)(()=>{if("none"===tc){rp.current=null,tU([]),tB([]),tH([]);return}rp.current=rh},[tc,rh]),(0,n.useEffect)(()=>{"none"!==tc&&(tU(tw?tr:[]),tB(ty?ti:[]),tH(tj?tn:[]))},[tc]),(0,n.useEffect)(()=>{tw&&tr.length>0&&tU(tr)},[tw,tr]),(0,n.useEffect)(()=>{ty&&ti.length>0&&tB(ti)},[ty,ti]),(0,n.useEffect)(()=>{tj&&tn.length>0&&tH(tn)},[tj,tn]),(0,n.useEffect)(()=>{eq&&tI(!1)},[eq]);let rA=(0,n.useMemo)(()=>Array.from((function(e,t){var r,i;let n=new Map;for(let i of(e.trim().length>0?e:Object.keys(t).join(" ")).matchAll(T)){let e=H(i[1]);e&&n.set(e,(null!=(r=n.get(e))?r:0)+1)}if(n.size>0)return n;for(let e of Object.keys(t)){let t=e.match(/<([A-Z]+(?:_[A-Z]+)*)_\d+(?:=[^>]+)?>/),r=t?H(t[1]):null;r&&n.set(r,(null!=(i=n.get(r))?i:0)+1)}return n})(rh.placeholderOrder.join(" "),rh.piiParameters).entries()).map(e=>{var t,r;let[i,n]=e;return{entity:i,count:n,label:(r=null!=(t=A[i])?t:R[i],n>1?"".concat(r,"(").concat(n,")"):r),active:!tz&&tW&&rx.has(i)}}),[rx,tW,tz,rh]),rP=(0,n.useMemo)(()=>{let e=[];return tl>0&&e.push({id:"image",count:tl,label:"Image(".concat(tl,")"),active:!tz&&t$}),ts>0&&e.push({id:"pdf",count:ts,label:"PDF(".concat(ts,")"),active:!tz&&tJ}),ta>0&&e.push({id:"csv",count:ta,label:"CSV(".concat(ta,")"),active:!tz&&tQ}),e},[ta,tl,tQ,t$,tJ,tz,ts]),rk=(0,n.useMemo)(()=>{var e,t,r;if(!eH)return[];let n=[],l="".concat(e6,"-").concat(tD),s=t$&&!tw,a=tJ&&!ty,d=tQ&&!tj,o=s?tL:tw?tr:[],c=a?tF:ty?ti:[],u=d?tV:tj?tn:[];return null==(e=eH.images)||e.forEach((e,t)=>{var r,a;let d="Image ".concat(t+1);if(!rS||!t$)return void n.push((0,i.jsx)(h.hF,{dataTestId:"pii-preview-media-card-original",name:d,badgeLabel:"Original",badgeTone:"muted",children:(0,i.jsx)("img",{"data-testid":"pii-preview-image-original",src:e.url,alt:"Original ".concat(t+1),className:h.fY})},"original-image-".concat(e.url,"-").concat(t)));
1let c="preview-image-".concat(t,"-").concat(l),u=o[t],p="string"==typeof(a=u?null!=(r=u.image_url)?r:u.imageUrl:null)?{omitted:!1,url:a}:"object"!=typeof a||null==a?{omitted:!1,url:null}:"omitted"in a?{omitted:!!a.omitted,url:null}:{omitted:!1,url:"string"==typeof a.url?a.url:"string"==typeof a.uri?a.uri:"string"==typeof a.href?a.href:null},m=p.url?function(e,t){if(!t||e.startsWith("data:"))return e;let r=e.includes("?")?"&":"?";return"".concat(e).concat(r,"v=").concat(encodeURIComponent(t))}(p.url,l):null;n.push((0,i.jsx)(h.hF,{dataTestId:"pii-preview-media-card-redacted",name:d,badgeLabel:"Redacted",badgeTone:"accent",children:u?p.omitted?(0,i.jsx)("div",{className:"flex min-h-[170px] w-[15rem] max-w-[15rem] items-center justify-center rounded-[14px] border border-dashed border-[#9dd8fe]/45 bg-white/40 px-4 text-center text-sm text-[#575858] md:w-[17rem] md:max-w-[17rem]",children:"Redacted media is hidden. Enable media preview in Advanced to inspect it."}):m?(0,i.jsx)("img",{"data-testid":"pii-preview-image-redacted",src:m,alt:
1d,className:h.fY}):(0,i.jsx)("div",{"data-testid":"pii-preview-image-unavailable",className:"flex min-h-[170px] w-[15rem] max-w-[15rem] items-center justify-center rounded-[14px] border border-dashed border-[#9dd8fe]/45 bg-white/40 px-4 text-center text-sm text-[#575858] md:w-[17rem] md:max-w-[17rem]",children:"Preview image unavailable."}):s?(0,i.jsxs)("div",{"data-testid":"pii-preview-image-refreshing",className:"flex min-h-[170px] w-[15rem] max-w-[15rem] flex-col items-center justify-center gap-3 rounded-[14px] border border-dashed border-[#9dd8fe]/45 bg-white/40 px-4 text-center text-sm text-[#575858] md:w-[17rem] md:max-w-[17rem]",children:[(0,i.jsx)(x.LottieLoader,{size:18}),(0,i.jsx)("span",{children:"Refreshing redacted image preview..."})]}):(0,i.jsx)("div",{"data-testid":"pii-preview-image-unavailable",className:"flex min-h-[170px] w-[15rem] max-w-[15rem] items-center justify-center rounded-[14px] border border-dashed border-[#9dd8fe]/45 bg-white/40 px-4 text-center text-sm text-[#575858] md:w-[17rem] md:max-w-[17rem]",children:"Preview image unavailable."})},c))}),null==(t=eH.pdfs)||t.forEach((e,t)=>{if(!rS||!tJ){var r;n.push((0,i.jsxs)("div",{"data-testid":"pii-preview-media-card-original",className:"overflow-hidden rounded-[18px] border border-white/70 bg-white/55 shadow-[inset_0_1px_0_rgba(255,255,255,0.45)] backdrop-blur-[10px]",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2 text-xs text-[#575858]",children:[(0,i.jsx)("span",{className:"font-medium",children:e.fileName||"PDF ".concat(t+1)}),(0,i.jsx)("span",{className:"rounded-full border border-white/80 bg-white/70 px-2 py-0.5 text-[11px] text-[#7c8a95]",children:"Original"})]}),(0,i.jsx)("div",{className:"border-t border-white/70 bg-transparent p-2",children:(0,i.jsx)(f.PdfPagePreview,{base64:e.base64,title:e.fileName?"PDF: ".concat(e.fileName):"PDF ".concat(t+1),dataTestId:"pii-preview-pdf-original",unavailableTestId:"pii-preview-pdf-original-unavailable"})})]},"original-pdf-".concat(null!=(r=e.fileName)?r:"".concat(t,"-").concat(e.base64.slice(0,32)))));return}let s="preview-pdf-".concat(t,"-").concat(l),d=c[t],o="object"==typeof(null==d?void 0:d.base64)&&null!=d.base64&&"omitted"in d.base64,u="string"==typeof(null==d?void 0:d.base64)?d.base64:null,p=(null==d?void 0:d.file_name)||e.fileName||"PDF ".concat(t+1);n.push((0,i.jsxs)("div",{"data-testid":"pii-preview-media-card-redacted","data-preview-kind":"pdf",className:"overflow-hidden rounded-[18px] border border-white/70 bg-white/55 shadow-[inset_0_1px_0_rgba(255,255,255,0.45)] backdrop-blur-[10px]",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2 text-xs text-[#575858]",children:[(0,i.jsx)("span",{className:"font-medium",children:p}),(0,i.jsx)("span",{className:"rounded-full border border-[#9dd8fe] bg-[#eff9ff] px-2 py-0.5 text-[11px] text-[#5cbefe]",children:"Preview"})]}),(0,i.jsx)("div",{className:"border-t border-white/70 bg-transparent p-2",children:d?o?(0,i.jsx)("div",{className:"flex min-h-[170px] items-center justify-center rounded-[14px] border border-dashed border-[#9dd8fe]/45 bg-white/40 px-4 text-center text-sm text-[#575858]",children:"Redacted PDF is hidden. Enable media preview in Advanced to inspect it."}):u?(0,i.jsx)(f.PdfPagePreview,{base64:u,title:(null==d?void 0:d.file_name)?"PDF: ".concat(d.file_name):"PDF preview ".concat(t+1),dataTestId:"pii-preview-pdf-redacted",unavailableTestId:"pii-preview-pdf-unavailable"}):(0,i.jsx)("div",{"data-testid":"pii-preview-pdf-unavailable",className:"flex min-h-[170px] items-center justify-center rounded-[14px] border border-dashed border-[#9dd8fe]/45 bg-white/40 px-4 text-center text-sm text-[#575858]",children:"Preview PDF unavailable."}):a?(0,i.jsxs)("div",{"data-testid":"pii-preview-pdf-refreshing",className:"flex min-h-[170px] flex-col items-center justify-center gap-3 rounded-[14px] border border-dashed border-[#9dd8fe]/45 bg-white/40 px-4 text-center text-sm text-[#575858]",children:[(0,i.jsx)(x.LottieLoader,{size:18}),(0,i.jsx)("span",{children:"Refreshing redacted PDF preview..."})]}):(0,i.jsx)("div",{"data-testid":"pii-preview-pdf-unavailable",className:"flex min-h-[170px] items-center justify-center rounded-[14px] border border-dashed border-[#9dd8fe]/45 bg-white/40 px-4 text-center text-sm text-[#575858]",children:"Preview PDF unavailable."})})]},s))}),null==(r=eH.csvs)||r.forEach((e,t)=>{if(!rS||!tQ)return void n.push((0,i.jsxs)("div",{"data-testid":"pii-preview-media-card-original",className:"overflow-hidden rounded-[18px] border border-white/70 bg-white/55 shadow-[inset_0_1px_0_rgba(255,255,255,0.45)] backdrop-blur-[10px]",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2 text-xs text-[#575858]",children:[(0,i.jsx)("span",{className:"font-medium",children:e.fileName||"CSV ".concat(t+1)}),(0,i.jsx)("span",{className:"rounded-full border border-white/80 bg-white/70 px-2 py-0.5 text-[11px] text-[#7c8a95]",children:"Original"})]}),(0,i.jsx)("div",{className:"border-t border-white/70 bg-transparent p-2",children:(0,i.jsx)(F,{text:e.text,totalRows:e.rowCount,totalColumns:e.columnCount})})]},"original-csv-".concat(e.fileName,"-").concat(t)));let r="preview-csv-".concat(t,"-").concat(l),s=u[t],a="object"==typeof(null==s?void 0:s.text)&&null!=s.text&&"omitted"in s.text,o="string"==typeof(null==s?void 0:s.text)?s.text:null,c=(null==s?void 0:s.file_name)||e.fileName||"CSV ".concat(t+1);n.push((0,i.jsxs)("div",{"data-testid":"pii-preview-media-card-redacted","data-
1preview-kind":"csv",className:"overflow-hidden rounded-[18px] border border-white/70 bg-white/55 shadow-[inset_0_1px_0_rgba(255,255,255,0.45)] backdrop-blur-[10px]",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2 text-xs text-[#575858]",children:[(0,i.jsx)("span",{className:"font-medium",children:c}),(0,i.jsx)("span",{className:"rounded-full border border-[#9dd8fe] bg-[#eff9ff] px-2 py-0.5 text-[11px] text-[#5cbefe]",children:"Preview"})]}),(0,i.jsx)("div",{className:"border-t border-white/70 bg-transparent p-2",children:s?a?(0,i.jsx)("div",{className:"flex min-h-[170px] items-center justify-center rounded-[14px] border border-dashed border-[#9dd8fe]/45 bg-white/40 px-4 text-center text-sm text-[#575858]",children:"Redacted CSV preview is hidden."}):o?(0,i.jsx)("div",{"data-testid":"pii-preview-csv-redacted",children:(0,i.jsx)(F,{text:o,totalRows:null==s?void 0:s.row_count,totalColumns:null==s?void 0:s.column_count})}):(0,i.jsx)("div",{"data-testid":"pii-preview-csv-unavailable",className:"flex min-h-[170px] items-center justify-center rounded-[14px] border border-dashed border-[#9dd8fe]/45 bg-white/40 px-4 text-center text-sm text-[#575858]",children:"Preview CSV unavailable."}):d?(0,i.jsxs)("div",{"data-testid":"pii-preview-csv-refreshing",className:"flex min-h-[170px] flex-col items-center justify-center gap-3 rounded-[14px] border border-dashed border-[#9dd8fe]/45 bg-white/40 px-4 text-center text-sm text-[#575858]",children:[(0,i.jsx)(x.LottieLoader,{size:18}),(0,i.jsx)("span",{children:"Refreshing redacted CSV preview..."})]}):(0,i.jsx)("div",{"data-testid":"pii-preview-csv-unavailable",className:"flex min-h-[170px] items-center justify-center rounded-[14px] border border-dashed border-[#9dd8fe]/45 bg-white/40 px-4 text-center text-sm text-[#575858]",children:"Preview CSV unavailable."})})]},r))}),n},[tV,tL,tF,tj,tw,ty,eH,tQ,t$,tJ,e6,tn,tr,tD,ti,rS]),rE=e=>{var t,r;let i=ra.trim().toLowerCase();if(!i)return!0;let n=null!=(r=null==(t=R[e])?void 0:t.toLowerCase())?r:"";return e.toLowerCase().includes(i)||n.includes(i)},rI=[{label:"Financial",entities:P.filter(rE)},{label:"Personal IDs",entities:k.filter(rE)},{label:"Medical/Gov",entities:E.filter(rE)},{label:"Location & Time",entities:I.filter(rE)},{label:"Other",entities:D.filter(rE)}].filter(e=>{let{entities:t}=e;return t.length>0}),rD=e=>{var t,r,i;return{...eK,skipAll:null!=(t=null==e?void 0:e.skipAll)?t:tz,entities:null!=(r=null==e?void 0:e.entities)?r:rt,faceBlur:null!=(i=null==e?void 0:e.faceBlur)?i:t1}},rT=(0,n.useCallback)(()=>{eJ(e1)},[eJ,e1]),rO=async function(){var e,t,r,i,n,l,s,a,d;let{settings:o,nextModelId:c,nextReasoningEffort:u,knobOverrides:p,nextEditorValue:x}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},m=null!=o?o:rD(),f={includeRedactedMedia:null!=(e=null==p?void 0:p.includeRedactedMedia)?e:tG,redactText:null!=(t=null==p?void 0:p.redactText)?t:tW,redactImage:null!=(r=null==p?void 0:p.redactImage)?r:t$,redactPdf:null!=(i=null==p?void 0:p.redactPdf)?i:tJ,redactCsv:null!=(n=null==p?void 0:p.redactCsv)?n:tQ,scoreThreshold:null!=(l=null==p?void 0:p.scoreThreshold)?l:t2,faceMethod:null!=(s=null==p?void 0:p.faceMethod)?s:t8,faceDetectionStrength:null!=(a=null==p?void 0:p.faceDetectionStrength)?a:t3,faceBlurStrength:null!=(d=null==p?void 0:p.faceBlurStrength)?d:t6},h=m.skipAll||!f.redactText?e1:rb(null!=x?x:ry);await eQ({nextSettings:m,nextModelId:null!=c?c:ri,nextReasoningEffort:null!=u?u:rl,knobs:f,nextMessageContent:h}),tI(!0)},rM=async()=>{if(eH&&!tu){if(rS)return void rT();if(eV&&!rC&&!tE)return void tI(!0);await rO()}},rL=async e=>{if(!eH||tp)return;let t=O(rt,e),r=rg(t);tK(!1),tY(!0),rr(t),r!==ry&&tM(r),await rO({settings:rD({skipAll:!1,entities:t}),knobOverrides:{redactText:!0},nextEditorValue:r})},rU=async e=>{if(!eH||tp)return;if("image"===e){let e=!t$||tz;tK(!1),tq(e),await rO({settings:rD({skipAll:!1}),knobOverrides:{redactImage:e}});return}let t=!tJ||tz;if("pdf"===e){tK(!1),tX(t),await rO({settings:rD({skipAll:!1}),knobOverrides:{redactPdf:t}});return}let r=!tQ||tz;tK(!1),t0(r),await rO({settings:rD({skipAll:!1}),knobOverrides:{redactCsv:r}})},rF=async()=>
1{if(!eH||tp||0===tl)return;let e=!(!tz&&t$&&t1);tK(!1),tq(!0),t5(e),await rO({settings:rD({skipAll:!1,faceBlur:e}),knobOverrides:{redactImage:!0}})},rB=async()=>{if(!eH||tu)return;let e=!tz,t=!e,r=!e&&(tl>0||t$),i=!e&&(ts>0||tJ),n=!e&&(ta>0||tQ),l=e||!t?e1:rg(rt);tK(e),tY(t),tq(r),tX(i),t0(n),l!==ry&&tM(l),await rO({settings:rD({skipAll:e}),knobOverrides:{redactText:t,redactImage:r,redactPdf:i,redactCsv:n},nextEditorValue:l})},rV=tx?"Resend":"Send",rH=!!(!tz&&t$&&t1),rz=tx?eW&&!eV?"Generating preview...":rS?"Hide Preview":"Show Preview":"Back",rK=tx?eW&&!eV?(0,i.jsx)(x.LottieLoader,{size:14}):rS?(0,i.jsx)(s.A,{className:"h-3.5 w-3.5"}):(0,i.jsx)(a.A,{className:"h-3.5 w-3.5"}):(0,i.jsx)(d.A,{className:"h-3.5 w-3.5"}),rG=tx?!eH||tu:eY||e$,rZ=tx?rC?"Show Preview to resend":rN?"Refresh Preview to resend":eY?"Approving...":e$?"Resending...":"Resend":rC?"Show Preview to ".concat(rV.toLowerCase()):rN?"Refresh Preview to ".concat(rV.toLowerCase()):eY?"Approving...":e$?"".concat(rV,"ing..."):rR?rV:"Approve & ".concat(rV),rW=!eV||!eH||tu||!rS&&!r_,rY=rk.length>0,r$=rC?"Preview is stale. Refresh it to review the latest draft.":rN?"Preview is stale. Refresh it to apply your latest controls.":rS?"Review exactly what will be sent.":"Preview hidden. Original attachments are restored below.";return(0,i.jsx)("div",{className:"relative flex min-h-0 w-full flex-col","data-testid":"pii-inline-preview",children:(0,i.jsxs)("div",{className:"max-h-[min(38rem,calc(100dvh-12rem))] min-h-0 space-y-2 overflow-y-auto overscroll-contain pr-1 md:max-h-[min(44rem,calc(100dvh-10rem))] xl:max-h-[min(48rem,calc(100dvh-8rem))]","data-testid":"pii-inline-preview-scrollable",children:[(0,i.jsxs)("div",{className:"relative overflow-hidden rounded-[20px] border border-white/70 bg-[#def2ff] p-[14px] shadow-[0_20px_44px_rgba(92,190,254,0.18)]",children:[(0,i.jsx)("div",{className:"pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_top_right,rgba(255,255,255,0.55),transparent_38%),radial-gradient(circle_at_bottom_left,rgba(92,190,254,0.18),transparent_44%)]"}),(0,i.jsxs)("div",{className:"relative flex flex-col gap-4",children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("div",{className:"text-[12px] font-semibold uppercase tracking-[0.08em] text-[#575858]",children:"Prompt"}),(0,i.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-[11px] text-[#575858]",children:[(0,i.jsxs)("button",{type:"button","data-testid":"pii-preview-toggle-button",className:(0,_.cn)("inline-flex h-8 items-center gap-1 rounded-full border px-3 text-[12px] font-medium tracking-[-0.03em] transition-colors hover:translate-y-0 disabled:cursor-not-allowed disabled:opacity-60",tx&&rS?"border-[#9dd8fe] bg-white/75 text-[#4a9cdb] hover:bg-white":"border-white/75 bg-white/55 text-[#575858] hover:bg-white/80"),disabled:rG,onClick:()=>{if(tx)return void rM();rT()},children:[rK,rz]}),r_?(0,i.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-amber-300/40 bg-amber-50 px-2 py-1 text-amber-800","data-testid":"pii-preview-stale-banner",children:[(0,i.jsx)(o.A,{className:"h-3.5 w-3.5"}),r$]}):(0,i.jsx)("span",{className:"rounded-full border border-white/80 bg-white/60 px-2 py-1 text-[#575858]",children:r$})]})]}),(0,i.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center justify-end gap-2",children:[(0,i.jsx)(p.b,{modelId:ri,reasoning:[rl,e=>{rs(e),tI(!1)}],variant:"message-edit"}),(0,i.jsx)(m.o,{model:[ri,e=>{rn(e),tI(!1)}],webSearchEnabled:td,hasImageAttachments:tl>0,hasPdfAttachments:ts>0,hasCsvAttachments:ta>0,variant:"message-edit"})]})]}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-[#575858]",children:[null!=e3?(0,i.jsxs)("span",{className:"rounded-full border border-white/80 bg-white/60 px-2 py-1",children:["expires in ~",e3," min"]}):null,e8>0?(0,i.jsxs)("span",{className:"rounded-full border border-white/80 bg-white/60 px-2 py-1",children:[e8," grouped redaction",1===e8?"":"s"]}
1):null,(null==eV||null==(ew=eV.preview)?void 0:ew.provider)?(0,i.jsx)("span",{className:"rounded-full border border-white/80 bg-white/60 px-2 py-1",children:eV.preview.provider}):null]}),rY?(0,i.jsx)("div",{"data-testid":"pii-preview-media-grid",className:(0,_.cn)("grid gap-3",rk.length>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"),children:rk}):null,(0,i.jsxs)("div",{"data-testid":"pii-preview-text-panel",className:"rounded-[16px] bg-[#eff9ff] px-[10px] py-[10px] shadow-[inset_0_0_0_1px_rgba(255,255,255,0.75)]",children:[(0,i.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-2",children:[(0,i.jsx)("div",{className:"text-[12px] font-semibold uppercase tracking-[0.08em] text-[#575858]",children:rS?"Preview text":"Draft text"}),rS?null:(0,i.jsx)("span",{className:"text-[11px] text-[#7c8a95]",children:"Original content restored"})]}),(0,i.jsx)(C.T,{"data-testid":"pii-input-text",value:ry,onChange:e=>(e=>{let t=rb(e);tI(!1),tM(t),eX(t)})(e.target.value),className:"block min-h-[82px] w-full overflow-y-auto resize-none rounded-none border-0 bg-transparent px-0 py-0 text-[14px] leading-[24px] tracking-[-0.02em] text-[#0f1010] placeholder:text-[#7c8a95] shadow-none focus-visible:outline-none focus-visible:ring-0 md:text-[14px]",disabled:!eH||tu})]}),(0,i.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,i.jsx)("div",{className:"text-[12px] font-semibold uppercase tracking-[0.08em] text-[#575858]",children:"PII Redaction"}),(0,i.jsx)("button",{type:"button","aria-label":tz?"Enable PII redaction":"Disable PII redaction",className:(0,_.cn)("inline-flex h-[24px] w-[44px] items-center rounded-full border px-[2px] transition-colors disabled:cursor-not-allowed disabled:opacity-60",tz?"border-white/80 bg-white/70 justify-start":"border-[#5cbefe] bg-[#5cbefe] justify-end"),disabled:!eH||tu,onClick:()=>{rB()},children:(0,i.jsx)("span",{className:"h-[18px] w-[18px] rounded-full bg-white shadow-sm"})})]}),(0,i.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2","data-testid":"pii-inline-preview-pills",children:[rA.map(e=>(0,i.jsxs)("button",{type:"button","data-testid":"pii-pill-text-".concat(e.entity),"aria-pressed":e.active,onClick:()=>{rL(e.entity)},disabled:!eH||tp,className:(0,_.cn)("inline-flex h-[30px] items-center gap-2 rounded-full border px-3 text-[12px] font-semibold tracking-[-0.03em] transition-colors",e.active?"border-[#9dd8fe] bg-[#5cbefe] text-white":"border-[#9dd8fe] bg-white/50 text-[#7dcbfe]"),children:[(0,i.jsx)("span",{className:(0,_.cn)("inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px]",e.active?"border-[#8fd3ff] bg-[#8fd3ff] text-white":"border-[#7dcbfe] bg-transparent text-transparent"),children:e.active?"✓":""}),e.label]},e.entity)),rP.map(e=>(0,i.jsxs)("button",{type:"button","data-testid":"pii-pill-".concat(e.id),"aria-pressed":e.active,onClick:()=>{rU(e.id)},disabled:!eH||tp,className:(0,_.cn)("inline-flex h-[30px] items-center gap-2 rounded-full border px-3 text-[12px] font-semibold tracking-[-0.03em] transition-colors",e.active?"border-[#9dd8fe] bg-[#5cbefe] text-white":"border-[#9dd8fe] bg-white/50 text-[#7dcbfe]"),children:[(0,i.jsx)("span",{className:(0,_.cn)("inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px]",e.active?"border-[#8fd3ff] bg-[#8fd3ff] text-white":"border-[#7dcbfe] bg-transparent text-transparent"),children:e.active?"✓":""}),e.label]},e.id)),tl>0?(0,i.jsxs)("button",{type:"button","data-testid":"pii-pill-face-blur","aria-pressed":rH,onClick:()=>{rF()},disabled:!eH||tp,className:(0,_.cn)("inline-flex h-[30px] items-center gap-2 rounded-full border px-3 text-[12px] font-semibold tracking-[-0.03em] transition-colors",rH?"border-[#9dd8fe] bg-[#5cbefe] text-white":"border-[#9dd8fe] bg-white/50 text-[#7dcbfe]"),children:[(0,i.jsx)("span",{className:(0,_.cn)("inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px]",rH?"border-[#8fd3ff] bg-[#8fd3ff] text-white":"border-[#7dcbfe] bg-transparent text-transparent"),children:rH?"✓":""}),"Face Blur"]}):null,0===rA.length&&0===rP.length&&0===tl?(0,i.jsx)("span",{className:"rounded-full border border-white/80 bg-white/60 px-3 py-2 text-[12px] text-[#7c8a95]",children:"No grouped redactions detected in this draft."}):null]}),(0,i.jsxs)("div",{className:(0,_.cn)("flex flex-col gap-3 pt-1 sm:flex-row sm:items-center",tx?"sm:justify-between":"sm:justify-end"),"data-testid":"pii-inline-preview-footer",children:[tx?(0,i.jsx)(b.$,{type:"button",variant:"outline",size:"sm","data-testid":"pii-preview-close-button",className:"h-[46px] rounded-[16px] border-white/80 bg-white/70 px-5 text-[14px] font-semibold text-[#3f4040] shadow-none hover:bg-white hover:text-[#0f1010] hover:translate-y-0",onClick:rT,disabled:tu,children:"Cancel"}):null,(0,i.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[tl>0?(0,i.jsxs)("span",{className:"rounded-full border border-white/80 bg-white/60 px-2 py-1 text-[11px] text-[#575858]",children:[tl," image",1===tl?"":"s"]}):null,ts>0?(0,i.jsxs)("span",{className:"rounded-full border border-white/80 bg-white/60 px-2 py-1 text-[11px] text-[#575858]",children:[ts," PDF",1===ts?"":"s"]}):null,ta>0?(0,i.jsxs)("span",{className:"rounded-full border border-white/80 bg-white/60 px-2 py-1 text-[11px] text-[#575858]",children:[ta," CSV",1===ta?"":"s"]}):null,(0,i.jsx)(b.$,{type:"button",size:"sm","data-testid":"pii-approve-send-button",className:(0,_.cn)("h-[46px] min-w-[170px] shrink-0 rounded-[16px] border border-[#5cbefe] bg-[#5cbefe] px-5 text-[14px] font-semibold text-white shadow-none hover:bg-[#4aaee8] hover:translate-y-0 sm:w-auto",rC&&"disabled:opacity-100 disabled:border-[#9ccff0] disabled:bg-white/70 disabled:text-[#5c7d94] disabled:shadow-none"),onClick:()=>
1{if(r_)return void rO();e0(rb(ry))},disabled:rW,children:rZ})]})]})]})]}),(0,i.jsxs)("details",{className:"group mt-2 overflow-hidden rounded-[18px] border border-[var(--shell-border-strong)] bg-[var(--shell-surface-strong)] shadow-[var(--shell-shadow)] backdrop-blur-xl","data-testid":"pii-advanced-controls",onToggle:e=>rc(e.currentTarget.open),children:[(0,i.jsx)("summary",{"data-testid":"pii-advanced-controls-toggle",className:"list-none cursor-pointer px-2.5 py-2.5 [&::-webkit-details-marker]:hidden md:px-3 md:py-3",children:(0,i.jsxs)("div",{className:"flex items-start justify-between gap-2.5",children:[(0,i.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[(0,i.jsx)("span",{className:"icon-chip mt-0.5 h-7 w-7 rounded-[12px] text-[var(--pii-brand)]",children:(0,i.jsx)(c.A,{className:"h-3 w-3"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("div",{className:"text-xs font-semibold tracking-[-0.02em] text-foreground md:text-[13px]",children:"Advanced preview controls"}),(0,i.jsx)("p",{className:"mt-0.5 text-[10px] leading-4 text-muted-foreground md:max-w-2xl md:text-[11px]",children:"Fine-tune redaction, preview behavior, face detection, and entity filters before refreshing the preview."})]})]}),(0,i.jsxs)("div",{className:"flex shrink-0 items-center gap-1 pl-1.5",children:[(0,i.jsx)("span",{className:"hidden rounded-full border border-[var(--shell-border)] bg-[var(--shell-surface-soft)] px-1.5 py-0.5 text-[9px] font-medium text-muted-foreground sm:inline-flex md:text-[10px]",children:r_?"Preview needs refresh":"Ready to tune"}),(0,i.jsx)("span",{className:"icon-chip h-7 w-7 rounded-[10px] text-foreground",children:(0,i.jsx)(u.A,{className:(0,_.cn)("h-3 w-3 transition-transform duration-200",ro&&"rotate-180")})})]})]})}),(0,i.jsx)("div",{className:"border-t border-[var(--shell-border)]",children:(0,i.jsxs)("div",{"data-testid":"pii-advanced-controls-content",className:"space-y-2.5 px-2.5 py-2.5 md:px-3 md:py-3",children:[(0,i.jsx)("div",{className:"rounded-[16px] border border-[var(--shell-border)] bg-[var(--shell-surface-soft)] px-2.5 py-2 text-xs leading-4 text-muted-foreground shadow-[inset_0_1px_0_rgba(255,255,255,0.16)] md:text-[13px] md:leading-5",children:"Footer pills refresh immediately. Changes below apply the next time you refresh the preview."}),e9.length>0?(0,i.jsx)(K,{title:"Revealed replacements",description:"Review the original values behind grouped placeholders before approving the draft.",headerActions:(0,i.jsx)(b.$,{type:"button",variant:"outline",size:"sm",className:"h-7 rounded-lg px-2 text-[11px]",onClick:()=>tk(e=>!e),children:tP?"Hide originals":"Reveal originals"}),children:(0,i.jsx)("div",{className:"rounded-[14px] border border-[var(--shell-border-strong)] bg-background/65 p-2",children:(0,i.jsxs)("table",{className:"w-full text-xs md:text-[13px]",children:[(0,i.jsx)("thead",{className:"text-[9px] uppercase tracking-[0.18em] text-muted-foreground md:text-[10px]",children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{className:"py-1 pr-2 text-left",children:"Placeholder"}),(0,i.jsx)("th",{className:"py-1 text-left",children:"Original"})]})}),(0,i.jsx)("tbody",{children:e9.map(e=>{let[t,r]=e;return(0,i.jsxs)("tr",{className:"border-t border-[var(--shell-border)]",children:[(0,i.jsx)("td",{className:"py-1 pr-2 font-mono text-foreground",children:t}),(0,i.jsx)("td",{className:"py-1 font-mono text-foreground/85",children:tP?r:"••••••"})]},t)})})]})})}):null,(0,i.jsxs)("div",{className:"grid gap-2.5 xl:grid-cols-2",children:[(0,i.jsx)(K,{title:"Redaction coverage",description:"Choose which parts of the next preview stay protected.",children:(0,i.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:[(0,i.jsx)(G,{checked:!tz,label:"Enable PII redaction",description:"Turn redaction on or off for the next preview.",onToggle:()=>tK(e=>!e),dataTestId:"pii-enable-redaction"}),(0,i.jsx)(G,{checked:tW,label:"Redact text",description:"Replace matching entities inside the prompt text.",onToggle:()=>tY(e=>!e),disabled:tz}),(0,i.jsx)(G,{checked:t$,label:"Redact images",description:"Apply redaction to attached images.",onToggle:()=>tq(e=>!e),disabled:tz}),(0,i.jsx)(G,{checked:tJ,label:"Redact PDFs",description:"Apply redaction to attached PDF pages.",onToggle:()=>tX(e=>!e),disabled:tz}),(0,i.jsx)(G,{checked:tQ,label:"Redact CSVs",description:"Apply redaction to attached CSV rows and cells.",onToggle:()=>t0(e=>!e),disabled:tz}),(0,i.jsx)("div",{className:"sm:col-span-2",children:(0,i.jsx)(G,{checked:t1,label:"Blur faces",description:"Blur faces inside images when image redaction is active.",onToggle:()=>t5(e=>!e),disabled:tz||!t$})})]})}),(0,i.jsx)(K,{title:"Preview behavior",description:"Control how refreshed previews handle attachments and strictness.",children:(0,i.jsxs)("div",{className:"space-y-2.5",children:[(0,i.jsx)(G,{checked:tG,label:"Include redacted media in preview",description:"Show redacted images and PDFs inside the preview cards when available.",onToggle:()=>tZ(e=>!e),dataTestId:"pii-include-redacted-media"}),(0,i.jsx)(Z,{id:"pii-score-threshold-input",dataTestId:"pii-score-threshold",label:"Redaction strictness",value:t2,onCh
1ange:e=>t4(Number(e.target.value)),hint:"Higher is stricter. Lower is more aggressive."})]})})]}),(0,i.jsxs)(K,{title:"Face settings",description:"Fine-tune face detection and blur strength for image previews.",children:[tz||!t$?(0,i.jsx)("div",{className:"mb-2.5 rounded-[12px] border border-dashed border-[var(--shell-border-strong)] bg-background/25 px-2.5 py-2 text-[10px] leading-4 text-muted-foreground md:text-[11px]",children:"Enable image redaction to adjust face controls. Blur strength becomes available once face blurring is enabled."}):null,(0,i.jsxs)("div",{className:"grid gap-2.5 lg:grid-cols-[minmax(0,0.95fr)_minmax(0,1.05fr)]",children:[(0,i.jsxs)("div",{className:"rounded-[14px] border border-[var(--shell-border)] bg-background/40 p-2.5 shadow-[inset_0_1px_0_rgba(255,255,255,0.1)]",children:[(0,i.jsx)("div",{className:"mb-1 text-[9px] font-semibold uppercase tracking-[0.18em] text-muted-foreground md:text-[10px]",children:"Detection method"}),(0,i.jsxs)(N.l6,{value:t8,onValueChange:e=>t7("face_recognition"===e?"face_recognition":"opencv"===e?"opencv":"auto"),disabled:tz||!t$,children:[(0,i.jsx)(N.bq,{className:"h-8 rounded-lg px-2.5 text-xs md:text-[13px]","data-testid":"pii-face-method",children:(0,i.jsx)(N.yv,{placeholder:"Choose a detection method"})}),(0,i.jsxs)(N.gC,{children:[(0,i.jsx)(N.eb,{value:"auto",children:"Auto (recommended)"}),(0,i.jsx)(N.eb,{value:"opencv",children:"OpenCV (fast)"}),(0,i.jsx)(N.eb,{value:"face_recognition",children:"Face recognition (stronger)"})]})]}),(0,i.jsx)("p",{className:"mt-1.5 text-[10px] leading-4 text-muted-foreground md:text-[11px]",children:"Switch between a balanced default mode and stronger or faster image face detection."})]}),(0,i.jsxs)("div",{className:"grid gap-2.5",children:[(0,i.jsx)(Z,{id:"pii-face-detection-strength",label:"Face detection strength",value:t3,onChange:e=>t9(B(Number(e.target.value),.85)),disabled:tz||!t$||!t1,hint:"Increase when faces are being missed. Lower it for fewer false positives."}),(0,i.jsx)(Z,{id:"pii-face-blur-strength",label:"Face blur strength",value:t6,onChange:e=>re(B(Number(e.target.value),.9)),disabled:tz||!t$||!t1,hint:"Controls how strong the blur effect appears in redacted image previews."})]})]})]}),(0,i.jsxs)(K,{title:"Entity filters",description:"Search and toggle the exact PII categories that should be redacted next.",children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-1",children:[(0,i.jsx)("p",{className:"text-[10px] leading-4 text-muted-foreground md:text-[11px]",children:tz?"Redaction is disabled. Re-enable it to choose specific entity types.":"Redacting ".concat(rt.length," entity types.")}),ra.trim().length>0?(0,i.jsxs)("span",{className:"rounded-full border border-[var(--shell-border)] bg-[var(--shell-surface-strong)] px-1.5 py-0.5 text-[9px] font-medium text-muted-foreground md:text-[10px]",children:[rI.reduce((e,t)=>e+t.entities.length,0)," ","matches"]}):null]}),(0,i.jsx)(g.p,{"data-testid":"pii-advanced-entity-search",value:ra,onChange:e=>rd(e.target.value),placeholder:"Search entities...","aria-label":"Search entity filters",className:"mt-2.5 h-8 rounded-lg px-2.5 text-xs md:text-[13px]"}),(0,i.jsx)("div",{"data-testid":"pii-advanced-entity-list",className:(0,_.cn)("mt-2.5 max-h-[220px] overflow-auto overscroll-contain rounded-[14px] border border-[var(--shell-border-strong)] bg-[var(--shell-surface)] p-2",tz&&"bg-[var(--shell-surface-soft)]"),children:0===rI.length?(0,i.jsx)("div",{className:"rounded-[12px] border border-dashed border-[var(--shell-border-strong)] px-3 py-4 text-center text-xs text-muted-foreground md:text-[13px]",children:"No entity types match your search."}):rI.map(e=>{let{label:t,entities:r}=e;return(0,i.jsxs)("div",{className:"mb-2.5 last:mb-0",children:[(0,i.jsx)("div",{className:"mb-1 text-[9px] font-semibold uppercase tracking-[0.18em] text-muted-foreground md:text-[10px]",children:t}),(0,i.jsx)("div",{className:"grid grid-cols-1 gap-1 sm:grid-cols-2",children:r.map(e=>{let t=rx.has(e);return(0,i.jsxs)("button",{type:"button",role:"checkbox","aria-checked":t,"aria-disabled":tz,disabled:tz,onClick:()=>rr(t=>O(t,e)),className:(0,_.cn)("pii-entity-row gap-2 rounded-[12px] border border-transparent bg-background/45 px-2.5 py-1.5 text-left text-xs leading-4 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background md:text-[13px]",t?"border-[var(--shell-border-strong)] bg-[var(--shell-surface-strong)] text-foreground shadow-sm":"text-foreground
1/90 hover:bg-[var(--shell-surface)]",tz&&"cursor-not-allowed bg-background/25 text-muted-foreground hover:bg-background/25"),children:[(0,i.jsx)("span",{className:(0,_.cn)("pii-checkbox h-[18px] w-[18px] rounded-[4px] border-[var(--shell-border-strong)] bg-background/70",t&&"is-active"),children:t?(0,i.jsx)(l.A,{className:"h-2.5 w-2.5 text-white"}):null}),(0,i.jsx)("span",{className:"pii-entity-label text-xs md:text-[13px]",children:R[e]})]},e)})})]},t)})})]})]})})]})]})})}},69612:(e,t,r)=>{r.d(t,{p:()=>i});let i=["CREDIT_CARD","CREDIT_CARD_LAST4","CRYPTO","EMAIL_ADDRESS","IBAN_CODE","US_BANK_NUMBER","US_EIN","PHONE_NUMBER","PERSON","US_SSN","US_ITIN","US_PASSPORT","US_DRIVER_LICENSE","MEDICAL_LICENSE","UK_NHS","UK_NINO","IP_ADDRESS","LOCATION","ADDRESS","DATE_TIME","DATE","NRP","URL","RECEIPT_NUMBER"]},89852:(e,t,r)=>{r.d(t,{p:()=>s});var i=r(95155),n=r(12115),l=r(53999);let s=n.forwardRef((e,t)=>{let{className:r,type:n,...s}=e;return(0,i.jsx)("input",{type:n,className:(0,l.cn)("flex h-11 w-full rounded-2xl border border-[var(--shell-border-strong)] bg-[var(--shell-surface-strong)] px-4 py-2.5 text-base text-foreground shadow-sm ring-offset-background backdrop-blur-xl file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),ref:t,...s})});s.displayName="Input"},97552:(e,t,r)=>{r.d(t,{TS:()=>u,decodeCsvBuffer:()=>a,parseCsvText:()=>d,pd:()=>o});var i=r(60408);let n=["utf-8","utf-16le","utf-16be"];function l(e){return 65279===e.charCodeAt(0)?e.slice(1):e}function s(e){return"string"==typeof e?e:null==e?"":String(e)}function a(e){for(let t of n)try{return l(new TextDecoder(t,{fatal:!0}).decode(e))}catch(e){}throw Error("CSV files must use UTF-8 or UTF-16 encoding.")}function d(e){let t=l(e),r=(0,i.parse)(t,{skipEmptyLines:"greedy"}),n=r.errors.filter(e=>"UndetectableDelimiter"!==e.code);if(n.length>0){var a,d;throw Error((null==(d=n[0])||null==(a=d.message)?void 0:a.trim())||"Unable to parse CSV.")}let o=r.data.map(e=>e.map(s)),c=o.length,u=o.reduce((e,t)=>Math.max(e,t.length),0);return{rows:o,rowCount:c,columnCount:u,delimiter:"string"==typeof r.meta.delimiter&&r.meta.delimiter.length>0?r.meta.delimiter:",",text:t}}function o(e){let{maxRows:t=25,maxColumns:r=10}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=Math.max(1,t),n=Math.max(1,r);try{let t=d(e);return{rows:t.rows.slice(0,i).map(e=>e.slice(0,n)),totalRows:t.rowCount,totalColumns:t.columnCount,truncatedRows:t.rowCount>i,truncatedColumns:t.columnCount>n}}catch(r){let t=function(e){let t=e.split(/\r\n|\n|\r/g).filter(e=>e.trim().length>0).map(e=>e.split(",").map(e=>e.trim())),r=t.reduce((e,t)=>Math.max(e,t.length),0);return{rows:t,totalColumns:r}}(e);return{rows:t.rows.slice(0,i).map(e=>e.slice(0,n)),totalRows:t.rows.length,totalColumns:t.totalColumns,truncatedRows:t.rows.length>i,truncatedColumns:t.totalColumns>n}}}function c(e){let t=e.text.split("\0").join("").trimEnd();return"[Attached CSV: ".concat(e.fileName,"]\n```csv\n").concat(t,"\n```")}function u(e,t){let r=t.filter(e=>"string"==typeof e.fileName&&e.fileName.length>0&&"string"==typeof e.text&&e.text.trim().length>0).map(c);if(0===r.length)return e.trim();let i=e.trim();return i.length>0?"".concat(i,"\n\n").concat(r.join("\n\n")):r.join("\n\n")}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.