@aiquants/contact-map 0.25.0 → 0.25.2
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 +29 -4
- package/dist/client.js +2 -2
- package/dist/client.mjs +2 -2
- package/dist/styles/contact-map.standalone.css +1 -1
- package/package.json +9 -8
package/dist/client.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var hi=Object.defineProperty;var Me=(e,t)=>()=>(e&&(t=e(e=0)),t);var yi=(e,t)=>{for(var n in t)hi(e,n,{get:t[n],enumerable:!0})};var Ge,Ht,Pa,rn,an,Rn,gt,Fe,Gn,$r,Or,at,re,Ft=Me(()=>{"use strict";Ge=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},Ht=e=>!e||typeof e!="object"?null:"item"in e?e.item??null:"person_id"in e?e:null,Pa=(e,t)=>{if(!e)return{value:null,fieldKey:null};for(let n of t){let a=Ge(e[n]);if(a)return{value:a,fieldKey:n}}return{value:null,fieldKey:null}},rn=e=>Pa(e,["custom_email","email"]),an=e=>Pa(e,["custom_mobile_phone_number","mobile_phone_number","company_phone_number"]),Rn=e=>{let t=Ge(e);if(!t)return null;let n=t.replace(/[^0-9+#*]/g,"");return n.length===0?null:`tel:${n}`},gt=(e,t)=>{let n=Ge(e);return n?t?`https://mail.google.com/mail/?view=cm&fs=1&to=${encodeURIComponent(n)}`:`mailto:${encodeURIComponent(n)}`:null},Fe=(e,t)=>String(e).padStart(t,"0"),Gn=e=>`${Fe(e.getUTCFullYear(),4)}-${Fe(e.getUTCMonth()+1,2)}-${Fe(e.getUTCDate(),2)}`,$r=e=>`${Gn(e)} ${Fe(e.getUTCHours(),2)}:${Fe(e.getUTCMinutes(),2)}:${Fe(e.getUTCSeconds(),2)}`,Or=e=>`${Fe(e.getFullYear(),4)}-${Fe(e.getMonth()+1,2)}-${Fe(e.getDate(),2)} ${Fe(e.getHours(),2)}:${Fe(e.getMinutes(),2)}:${Fe(e.getSeconds(),2)}`,at=(e,t)=>{if(e==null||e==="")return"-";let n=typeof e=="string"?new Date(e):e;return Number.isNaN(n.getTime())?typeof e=="string"?e:"-":t(n)},re=e=>e==null?"-":typeof e=="string"?Ge(e)??"-":typeof e=="number"?Number.isFinite(e)?String(e):"-":String(e)});var ee,_a,Lt=Me(()=>{"use strict";ee=e=>{switch(typeof e){case"string":return JSON.stringify(e);case"bigint":return`${e}n`;case"symbol":return e.toString();case"object":return e===null?"null":_a(e);case"function":return _a(e);case"number":return Object.is(e,-0)?"-0":String(e);default:return String(e)}},_a=e=>{try{return Object.prototype.toString.call(e)}catch{return"[object ?]"}}});var on,Le,sn=Me(()=>{"use strict";on=e=>{if(typeof e!="object"||e===null)return!1;try{let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}catch{return!1}},Le=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0});var bi,qn,Dr=Me(()=>{"use strict";bi=(e,t)=>{let n=Array.from({length:t.length+1},(a,i)=>i);for(let a=1;a<=e.length;a+=1){let i=[a];for(let o=1;o<=t.length;o+=1){let r=n[o-1]+(e[a-1]===t[o-1]?0:1);i.push(Math.min(n[o]+1,i[o-1]+1,r))}n=i}return n[t.length]},qn=(e,t)=>{let n=e.toLowerCase();if(n.length>=3){let i=t.find(o=>o.toLowerCase().startsWith(n));if(i!==void 0)return i}let a;for(let i of t){let o=bi(n,i.toLowerCase());o<=Math.max(1,Math.floor(i.length/4))&&(a===void 0||o<a.distance)&&(a={key:i,distance:o})}return a?.key}});import{DIRECTORY_TREE_LABEL_CATALOGS as Aa,DIRECTORY_TREE_LABEL_KEYS as Wr,resolveDirectoryTreeLabels as Si}from"@aiquants/directory-tree";import{resolveVirtualScrollLocale as Ci,VIRTUAL_SCROLL_LABEL_KEYS as vi}from"@aiquants/virtualscroll";var xi,ne,It,Yn,Oa,Pn,ht,Ti,$a,Da,Ni,Hr,Mi,Ei,Li,Fr,Ir,Br,Bt=Me(()=>{"use strict";Ft();Lt();sn();Dr();xi=Object.freeze({en:"en-US",ja:"ja-JP"}),ne=(e,t)=>t.toLocaleString(xi[e]),It=(e,t,n)=>e==="1"?t:n,Yn=Object.freeze({en:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"Total:",annotationCompaniesLabel:"Companies:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`Streaming (${ne("en",e)} / ${ne("en",t)} \xB7 ${n}%)`,annotationStreamingCount:e=>`Streaming (${ne("en",e)} loaded)`,streamLoadFailed:e=>`Failed to load (${ne("en",e)} received)`,annotationReconnecting:e=>`Reconnecting (${ne("en",e)} received)`,streamRetry:"Retry",recordUnit:e=>It(e,"record","records"),companyUnit:e=>It(e,"company","companies"),searchTab:"Fuzzy search",searchSettings:"Search settings",searchStatistics:"Search statistics",operatorAndTitle:"AND search (all terms match)",operatorOrTitle:"OR search (any term matches)",operatorAnd:"AND",operatorOr:"OR",operatorAndHint:"All terms",operatorOrHint:"Any term",searchPlaceholder:"Fuzzy search...",searchBusyTitle:"Searching",clearSearch:"Clear search",searching:"Searching...",registeredCountLabel:"Registered:",rebuildingIndex:"Rebuilding index...",errorLabel:"Error:",resultCountLabel:"Results:",resultUnit:e=>It(e,"match","matches"),listViewTab:"List",treeViewTab:"Tree",columnNo:"No",columnId:"ID",columnScore:"Score",columnName:"Name",columnTitle:"Title",columnCompany:"Company",columnDepartment:"Department",columnPhone:"Phone",columnEmail:"Email",columnUpdatedAt:"Updated",listRowNumber:e=>`No. ${e}`,listNoSearchResults:"No search results found",listNoData:"No data",listboxLabel:"Contact list",listKeyboardHelp:"Up and down arrows move between contacts, Page Up and Page Down move by a screen, Home and End go to the first and the last; Enter or Space opens the contact's details.",listResizeHandle:"Resize the border between the contact list and the detail pane",detailHeading:"Contact details",close:"Close",noName:"(No Name)",treeNodeCountTitle:"Number of nodes built in the tree view",treeNodeCountLabel:"Nodes:",treeNodeCount:e=>ne("en",e),uncategorizedCompany:"Uncategorized",treeDirectoryName:(e,t)=>`${e} (${ne("en",t)})`,treeStreamInterruptedTitle:"Streaming was interrupted. Only the data received so far is shown",treeStreamInterrupted:"Interrupted",treeStreamLoadingTitle:"Receiving data streamed from the network",treeStreamLoading:"Loading...",treeBuildingTitle:"Building and expanding the directory tree from the received data",treeBuilding:"Treeing...",treeCompleteTitle:"Every tree node has been built",treeComplete:"Complete",treeShowEntireCompanyTitle:"Show the whole company of every search hit",treeShowEntireCompany:"Whole company",treeExpandAll:"Expand all directories",treeExpandAllTitle:"Expand all",treeCollapseAll:"Collapse all directories",treeCollapseAllTitle:"Collapse all",treeNoMatches:"No contacts match the criteria",treeEmpty:"No contacts to display",treeResizeHandle:"Resize the border between the directory tree and the detail pane",copyField:e=>`Copy ${e}`,detailEmptyTitle:"Select a contact to see its details",detailEmptyHint:"Choose a person from the list",detailTabSummary:"Summary",detailTabBasic:"Basic info",detailBasicProfile:"Profile",detailTabContact:"Contact",detailTabMeta:"Metadata",preferred:"Preferred",summaryEmail:"Email",summaryPhone:"Phone",summaryLastContact:"Last contact",sectionEmail:"Email",sectionEmailEmpty:"No email addresses registered",sectionPhone:"Phone / Fax",sectionPhoneEmpty:"No phone numbers registered",fieldFullName:"Name",fieldFullNameReading:"Name (reading)",fieldTitle:"Title",fieldDepartment:"Department",fieldCompanyName:"Company",fieldCompanyNameReading:"Company (reading)",fieldAddress:"Address",fieldPostalCode:"Postal code",fieldUrl:"URL",fieldCustomEmail:"Custom email",fieldEmail:"Email",fieldCustomMobilePhone:"Custom mobile",fieldMobilePhone:"Mobile",fieldCompanyPhone:"Company phone",fieldCompanyFax:"Company fax",fieldCreatedBy:"Created by",fieldCreatedAt:"Created at",fieldUpdatedBy:"Updated by",fieldUpdatedAt:"Updated at",recordDateTime:$r,recordDate:Gn,popupCustomMobilePhone:"Mobile (custom)",popupMobilePhone:"Mobile",popupCustomCompanyPhone:"Company phone (custom)",popupCompanyPhone:"Company phone",popupCustomEmail:"Email (custom)",popupEmail:"Email",popupGmailHint:"Double-click or double-tap to open Gmail",popupLastContactDate:"Last contact:",popupNoContactMethods:"No contact information to display",overlayTitle:"Details",settingsResetAllTitle:"Reset all settings",settingsResetAll:"Reset all",settingsTabsLabel:"Search option tabs",settingsBasicTab:"Basic settings",settingsAdvancedTab:"Advanced settings",indexWorkerName:"Index Worker",levenshteinWorkerName:"Levenshtein Worker",currentValueLabel:"Current:",resetToDefaultsTitle:"Reset to defaults",reset:"Reset",relevanceOnlyNotice:"Editable only when sorting by relevance",relevanceWeightsHeading:"Relevance score weights",fieldWeight:"Field weight",scoreTuningHeading:"Score tuning",maxResults:"Maximum results",noLimit:"No limit",basicThresholdHeading:"Final similarity threshold",basicThresholdLabel:"Adjust the minimum score",basicThresholdRangeRelevance:"In relevance mode a score can exceed 1.0 (range: 0.0-1.5)",basicThresholdRange:"Range: 0.0-1.0",basicDisplayHeading:"Display options",basicCaseSensitive:"Case-sensitive",basicHighlight:"Highlight matches",basicOpenEmailsWithGmail:"Open email addresses in Gmail compose",basicMultiTermOperator:"Operator for words inside quotes",basicOperatorOr:"OR (any word matches)",basicOperatorAnd:"AND (all words match)",basicMultiTermHint:'How words between quotation marks ("tanaka taro") are combined (default: AND). Words outside quotation marks are separate keywords combined by the AND / OR button',basicSortHeading:"Sorting",basicSortBy:"Sort by",basicSortByScore:"Score",basicSortByRelevance:"Relevance",basicSortByOriginal:"Original order",basicSortOrder:"Sort order",basicSortDescending:"Descending",basicSortAscending:"Ascending",basicEngineHeading:"Search engine",basicStrategy:"Parallel search strategy",basicStrategyBalanced:"Balanced",basicStrategyIndexFirst:"Index first",basicStrategyLevenshteinFirst:"Levenshtein first",basicIndexFiltering:"Index filtering",basicLevenshtein:"Levenshtein distance",advancedLearningHeading:"Learning weight",advancedLearningLabel:"Weight factor",advancedLearningHint:"Weight applied when re-learning (higher favors past search results)",advancedDebounceHeading:"Debounce time",advancedDebounceLabel:"Input delay (ms)",advancedDebounceHint:"How long input is awaited. Shorter is more real-time, longer reduces load",indexSettingsHeading:"Index Worker settings",indexBuildHeading:"Index build",indexNgramSize:"N-gram size",indexNgramSizeHint:"How many characters each chunk holds. Smaller is faster but less accurate",indexMinNgramOverlap:"Minimum N-gram matches",indexMinNgramOverlapHint:"Candidates with fewer matches are excluded",indexCandidateHeading:"Candidate filtering",indexThreshold:"Index threshold",indexThresholdHint:"Lower bound of the Jaro-Winkler similarity (range: 0.0-1.0)",indexNgramOverlapThreshold:"N-gram overlap threshold",indexNgramOverlapThresholdHint:"How much N-grams must overlap. Higher narrows candidates more strictly",indexStrategyHeading:"Search strategy and candidates",indexStrategy:"Search strategy",indexStrategyFast:"Fast",indexStrategyAccurate:"Accurate",indexStrategyHybrid:"Hybrid (adaptive)",indexStrategyHint:"Balance processing load against accuracy",indexMinCandidatesRatio:"Minimum candidate ratio",indexMinCandidatesRatioHint:"Share of candidates always kept",indexMaxCandidatesRatio:"Maximum candidate ratio",indexMaxCandidatesRatioHint:"Upper bound on candidates; narrowed dynamically when exceeded",indexJaroWinklerPrefix:"Jaro-Winkler prefix weight",indexJaroWinklerPrefixHint:"Bonus given to a matching prefix",indexMaxResultsHint:"Maximum number of results to fetch. Larger is more thorough but slower",indexFieldWeightHint:"How much the number of matched fields counts",indexPerfectMatchBonus:"Exact match bonus",indexPerfectMatchBonusHint:"Bonus added on an exact match",indexContainmentHeading:"Containment score (Japanese / substrings)",indexContainmentBase:"Containment base score (containmentScoreBase)",indexContainmentBaseHint:"Minimum base score when the query is fully contained in the string (rescues short Japanese queries such as 2 characters)",indexContainmentCoverage:"Containment coverage weight (containmentCoverageWeight)",indexContainmentCoverageHint:"Extra score by the query length / field length ratio (total capped at 1.0)",levenshteinSettingsHeading:"Levenshtein Worker settings",levenshteinCandidateHeading:"Candidate filter",levenshteinThreshold:"Levenshtein threshold",levenshteinThresholdHintRelevance:"Keep only results at or above this threshold (range: 0.0-1.5)",levenshteinThresholdHint:"Keep only results at or above this threshold (range: 0.0-1.0)",levenshteinLengthSimilarity:"Length similarity threshold",levenshteinLengthSimilarityHint:"Exclude candidates whose length differs greatly, for speed",levenshteinLengthPenalty:"Length difference penalty",levenshteinLengthPenaltyHint:"How much a length difference is penalized. Larger favors equal lengths",levenshteinResultsHeading:"Result count",levenshteinMaxResultsHint:"Maximum number of results to return. Larger is more thorough but slower",levenshteinFieldWeightHint:"Weight of the number of matched fields",levenshteinPartialBonus:"Partial match bonus",levenshteinPartialBonusHint:"Extra score for a partial match",statsRebuildingTitle:"Rebuilding the index",statsRebuildIndexTabOnlyTitle:"Available on the Index tab only",statsRebuildTitle:"Rebuild the index",statsRebuilding:"Rebuilding...",statsRebuild:"Rebuild Index",statsResetTitle:"Reset statistics",statsTabsLabel:"Statistics tabs",statsOverviewTab:"Overview",statsIndexTab:"Index",statsLevenshteinTab:"Levenshtein",statTotalSearches:"Total searches",statAverageSearchTime:"Average search time",statDataCount:"Data items",statResultCount:"Search results",statDisplayedCount:"Displayed items",statsNoData:"No statistics yet",statsBasicHeading:"Basic statistics",statTotalProcessingTime:"Total processing time",statLastSearchTime:"Last search time",statErrorCount:"Errors",statUpdatedAt:"Statistics updated at",statsTimestamp:Or,statsOperationsHeading:"Operations",statTotalOperations:"Total operations",statsIndexHeading:"Index statistics",statIndexBuilds:"Index builds",statDataSize:"Data size",statLastBuildTime:"Last build time",statsCacheHeading:"Cache statistics",statCacheNgram:"N-gram",statCacheWord:"Words",statCachePhonetic:"Phonetic",statsIndexMetadataHeading:"Index metadata",statsCalculationsHeading:"Calculations",statTotalCalculations:"Total calculations",statDistanceCalculations:"Distance calculations",statAverageDistance:"Average distance",statMinDistance:"Minimum distance",statMaxDistance:"Maximum distance",notAvailable:"N/A",statsMatchesHeading:"Matches",statPartialMatches:"Partial matches",statPerfectMatches:"Exact matches",statEarlyTerminations:"Early terminations",statsSimilarityHeading:"Similarity distribution",statAbove80:"80% or more",statAbove60:"60% or more",statAbove40:"40% or more",statBelow40:"Below 40%",statsDistanceHeading:"Distance distribution (top 6)",statDistance:e=>`Distance ${e}`,statsQueryLengthHeading:"Query lengths (top 6)",statQueryLength:e=>`Length ${e}`,statQueryLengthValue:({count:e,averagePercent:t})=>{let n=ne("en",e);return`${n} ${It(n,"time","times")} / average ${t}%`},statsFieldPerformanceHeading:"Field performance (top 6)",statAverageScore:"Average score",statMatchCount:"Matches",statBestWorstScore:"Best / worst score",statsInsightsHeading:"Performance insights",statBestField:"Best-performing field",statRecentAverageTime:"Recent average processing time",statRecentAverageResults:"Recent average results",statThroughput:"Throughput",statCommonQueryLength:"Most common query length",statHistoryEntries:"History entries",statHighSimilarity:"High similarity",statMediumSimilarity:"Medium similarity",statLowSimilarity:"Low similarity",statVeryLowSimilarity:"Very low similarity",statsRecentHistoryHeading:"Recent history (latest 3)",statsHistoryEntry:({processingTimeMs:e,resultCount:t})=>`Processing time: ${e} ms / results: ${ne("en",t)}`,timesUnit:e=>It(e," time"," times"),itemsUnit:e=>It(e," item"," items"),charactersUnit:e=>It(e," character"," characters"),throughputUnit:" ops/s"}),ja:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"\u7DCF\u4EF6\u6570:",annotationCompaniesLabel:"\u4F01\u696D\u6570:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${ne("ja",e)} / ${ne("ja",t)} \u4EF6\u30FB${n}%)`,annotationStreamingCount:e=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${ne("ja",e)} \u4EF6)`,streamLoadFailed:e=>`\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F (${ne("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationReconnecting:e=>`\u518D\u63A5\u7D9A\u4E2D (${ne("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,streamRetry:"\u518D\u8A66\u884C",recordUnit:()=>"\u4EF6",companyUnit:()=>"\u793E",searchTab:"\u3042\u3044\u307E\u3044\u691C\u7D22",searchSettings:"\u691C\u7D22\u8A2D\u5B9A",searchStatistics:"\u691C\u7D22\u7D71\u8A08",operatorAndTitle:"AND \u691C\u7D22 (\u3059\u3079\u3066\u4E00\u81F4)",operatorOrTitle:"OR \u691C\u7D22 (\u3044\u305A\u308C\u304B\u4E00\u81F4)",operatorAnd:"AND",operatorOr:"OR",operatorAndHint:"\u5168\u8A9E\u4E00\u81F4",operatorOrHint:"\u3044\u305A\u308C\u304B\u4E00\u81F4",searchPlaceholder:"\u3042\u3044\u307E\u3044\u691C\u7D22...",searchBusyTitle:"\u691C\u7D22\u51E6\u7406\u4E2D",clearSearch:"\u691C\u7D22\u3092\u30AF\u30EA\u30A2",searching:"\u691C\u7D22\u4E2D...",registeredCountLabel:"\u767B\u9332\u4EF6\u6570:",rebuildingIndex:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D...",errorLabel:"\u30A8\u30E9\u30FC:",resultCountLabel:"\u691C\u7D22\u7D50\u679C:",resultUnit:()=>"\u4EF6",listViewTab:"\u4E00\u89A7",treeViewTab:"\u30C4\u30EA\u30FC",columnNo:"No",columnId:"ID",columnScore:"\u30B9\u30B3\u30A2",columnName:"\u6C0F\u540D",columnTitle:"\u5F79\u8077",columnCompany:"\u4F1A\u793E\u540D",columnDepartment:"\u90E8\u7F72",columnPhone:"\u96FB\u8A71\u756A\u53F7",columnEmail:"\u30E1\u30FC\u30EB",columnUpdatedAt:"\u66F4\u65B0\u65E5\u6642",listRowNumber:e=>`No. ${e}`,listNoSearchResults:"\u691C\u7D22\u7D50\u679C\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",listNoData:"\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093",listboxLabel:"\u9023\u7D61\u5148\u4E00\u89A7",listKeyboardHelp:"\u4E0A\u4E0B\u306E\u77E2\u5370\u30AD\u30FC\u3067\u9023\u7D61\u5148\u3092\u79FB\u308A\u3001Page Up \u3068 Page Down \u3067 1 \u753B\u9762\u305A\u3064\u3001Home \u3068 End \u3067\u5148\u982D\u3068\u672B\u5C3E\u3078\u79FB\u308A\u307E\u3059\u3002Enter \u304B Space \u3067\u9023\u7D61\u5148\u306E\u8A73\u7D30\u3092\u958B\u304D\u307E\u3059\u3002",listResizeHandle:"\u9023\u7D61\u5148\u4E00\u89A7\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",detailHeading:"\u9023\u7D61\u5148\u8A73\u7D30",close:"\u9589\u3058\u308B",noName:"\u540D\u524D\u672A\u8A2D\u5B9A",treeNodeCountTitle:"\u30C4\u30EA\u30FC\u30D3\u30E5\u30FC\u3067\u69CB\u7BC9\u3055\u308C\u305F\u5168\u30CE\u30FC\u30C9\u6570",treeNodeCountLabel:"\u30CE\u30FC\u30C9:",treeNodeCount:e=>`${ne("ja",e)} \u500B`,uncategorizedCompany:"\u672A\u5206\u985E",treeDirectoryName:(e,t)=>`${e} (${ne("ja",t)})`,treeStreamInterruptedTitle:"\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u304C\u4E2D\u65AD\u3055\u308C\u307E\u3057\u305F\u3002\u53D7\u4FE1\u6E08\u307F\u30C7\u30FC\u30BF\u306E\u307F\u8868\u793A\u3057\u3066\u3044\u307E\u3059",treeStreamInterrupted:"\u4E2D\u65AD",treeStreamLoadingTitle:"\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u304B\u3089\u306E\u30C7\u30FC\u30BF\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u3092\u53D7\u4FE1\u4E2D",treeStreamLoading:"\u8AAD\u307F\u8FBC\u307F\u4E2D...",treeBuildingTitle:"\u53D7\u53D6\u30C7\u30FC\u30BF\u3092\u57FA\u306B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30C4\u30EA\u30FC\u69CB\u9020\u3092\u6700\u7D42\u69CB\u7BC9\u30FB\u5C55\u958B\u4E2D",treeBuilding:"\u30C4\u30EA\u30FC\u69CB\u7BC9\u4E2D...",treeCompleteTitle:"\u30C4\u30EA\u30FC\u30CE\u30FC\u30C9\u306E\u5168\u4EF6\u69CB\u7BC9\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F",treeComplete:"\u5B8C\u4E86",treeShowEntireCompanyTitle:"\u691C\u7D22\u30D2\u30C3\u30C8\u3057\u305F\u4F1A\u793E\u5168\u4F53\u3092\u8868\u793A",treeShowEntireCompany:"\u5168\u4F53\u8868\u793A",treeExpandAll:"\u5168\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u5C55\u958B",treeExpandAllTitle:"\u3059\u3079\u3066\u5C55\u958B",treeCollapseAll:"\u5168\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6298\u308A\u305F\u305F\u307F",treeCollapseAllTitle:"\u3059\u3079\u3066\u6298\u308A\u305F\u305F\u307F",treeNoMatches:"\u6761\u4EF6\u306B\u4E00\u81F4\u3059\u308B\u9023\u7D61\u5148\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",treeEmpty:"\u8868\u793A\u3059\u308B\u9023\u7D61\u5148\u304C\u3042\u308A\u307E\u305B\u3093",treeResizeHandle:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30C4\u30EA\u30FC\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",copyField:e=>`\u300C${e}\u300D\u3092\u30B3\u30D4\u30FC`,detailEmptyTitle:"\u9023\u7D61\u5148\u3092\u9078\u629E\u3059\u308B\u3068\u8A73\u7D30\u304C\u8868\u793A\u3055\u308C\u307E\u3059",detailEmptyHint:"\u4E00\u89A7\u304B\u3089\u5BFE\u8C61\u306E\u4EBA\u7269\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",detailTabSummary:"\u30B5\u30DE\u30EA\u30FC",detailTabBasic:"\u57FA\u672C\u60C5\u5831",detailBasicProfile:"\u57FA\u672C\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB",detailTabContact:"\u9023\u7D61\u5148",detailTabMeta:"\u30E1\u30BF\u60C5\u5831",preferred:"\u512A\u5148",summaryEmail:"\u30E1\u30FC\u30EB",summaryPhone:"\u96FB\u8A71",summaryLastContact:"\u6700\u7D42\u63A5\u89E6",sectionEmail:"\u30E1\u30FC\u30EB",sectionEmailEmpty:"\u767B\u9332\u3055\u308C\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306F\u3042\u308A\u307E\u305B\u3093",sectionPhone:"\u96FB\u8A71\u30FBFAX",sectionPhoneEmpty:"\u767B\u9332\u3055\u308C\u305F\u96FB\u8A71\u756A\u53F7\u306F\u3042\u308A\u307E\u305B\u3093",fieldFullName:"\u6C0F\u540D",fieldFullNameReading:"\u6C0F\u540D (\u304B\u306A)",fieldTitle:"\u5F79\u8077",fieldDepartment:"\u90E8\u7F72",fieldCompanyName:"\u4F1A\u793E\u540D",fieldCompanyNameReading:"\u4F1A\u793E\u540D (\u304B\u306A)",fieldAddress:"\u4F4F\u6240",fieldPostalCode:"\u90F5\u4FBF\u756A\u53F7",fieldUrl:"URL",fieldCustomEmail:"\u30AB\u30B9\u30BF\u30E0\u30E1\u30FC\u30EB",fieldEmail:"\u30E1\u30FC\u30EB",fieldCustomMobilePhone:"\u30AB\u30B9\u30BF\u30E0\u643A\u5E2F\u756A\u53F7",fieldMobilePhone:"\u643A\u5E2F\u756A\u53F7",fieldCompanyPhone:"\u4F1A\u793E\u96FB\u8A71\u756A\u53F7",fieldCompanyFax:"\u4F1A\u793E FAX \u756A\u53F7",fieldCreatedBy:"\u4F5C\u6210\u8005",fieldCreatedAt:"\u4F5C\u6210\u65E5\u6642",fieldUpdatedBy:"\u66F4\u65B0\u8005",fieldUpdatedAt:"\u66F4\u65B0\u65E5\u6642",recordDateTime:$r,recordDate:Gn,popupCustomMobilePhone:"\u643A\u5E2F\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupMobilePhone:"\u643A\u5E2F\u96FB\u8A71",popupCustomCompanyPhone:"\u4F1A\u793E\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupCompanyPhone:"\u4F1A\u793E\u96FB\u8A71",popupCustomEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9 (\u30AB\u30B9\u30BF\u30E0)",popupEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",popupGmailHint:"\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u307E\u305F\u306F\u4E8C\u5EA6\u30BF\u30C3\u30D7\u3067 Gmail \u3092\u958B\u304D\u307E\u3059",popupLastContactDate:"\u6700\u7D42\u30B3\u30F3\u30BF\u30AF\u30C8\u65E5:",popupNoContactMethods:"\u8868\u793A\u3067\u304D\u308B\u9023\u7D61\u5148\u60C5\u5831\u304C\u3042\u308A\u307E\u305B\u3093",overlayTitle:"\u8A73\u7D30",settingsResetAllTitle:"\u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u30EA\u30BB\u30C3\u30C8",settingsResetAll:"\u3059\u3079\u3066\u30EA\u30BB\u30C3\u30C8",settingsTabsLabel:"\u691C\u7D22\u30AA\u30D7\u30B7\u30E7\u30F3\u8A2D\u5B9A\u30BF\u30D6",settingsBasicTab:"\u57FA\u672C\u8A2D\u5B9A",settingsAdvancedTab:"\u8A73\u7D30\u8A2D\u5B9A",indexWorkerName:"Index Worker",levenshteinWorkerName:"Levenshtein Worker",currentValueLabel:"\u73FE\u5728\u5024:",resetToDefaultsTitle:"\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u306B\u30EA\u30BB\u30C3\u30C8",reset:"\u30EA\u30BB\u30C3\u30C8",relevanceOnlyNotice:"Relevance \u30BD\u30FC\u30C8\u6642\u306E\u307F\u5909\u66F4\u53EF\u80FD",relevanceWeightsHeading:"Relevance \u30B9\u30B3\u30A2\u91CD\u307F",fieldWeight:"\u30D5\u30A3\u30FC\u30EB\u30C9\u91CD\u307F",scoreTuningHeading:"\u30B9\u30B3\u30A2\u8ABF\u6574",maxResults:"\u6700\u5927\u7D50\u679C\u6570",noLimit:"\u4E0A\u9650\u306A\u3057",basicThresholdHeading:"\u6700\u7D42\u985E\u4F3C\u5EA6\u95BE\u5024",basicThresholdLabel:"\u30B9\u30B3\u30A2\u306E\u4E0B\u9650\u3092\u8ABF\u6574",basicThresholdRangeRelevance:"Relevance \u30E2\u30FC\u30C9\u3067\u306F\u30B9\u30B3\u30A2\u304C 1.0 \u3092\u8D85\u3048\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059 (\u7BC4\u56F2: 0.0-1.5)",basicThresholdRange:"\u7BC4\u56F2: 0.0-1.0",basicDisplayHeading:"\u8868\u793A\u30AA\u30D7\u30B7\u30E7\u30F3",basicCaseSensitive:"\u5927\u6587\u5B57\u5C0F\u6587\u5B57\u3092\u533A\u5225",basicHighlight:"\u30CF\u30A4\u30E9\u30A4\u30C8\u8868\u793A",basicOpenEmailsWithGmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 Gmail \u306E\u4F5C\u6210\u753B\u9762\u3067\u958B\u304F",basicMultiTermOperator:"\u5F15\u7528\u7B26\u306E\u4E2D\u306E\u8A9E\u306E\u6F14\u7B97\u5B50",basicOperatorOr:"OR (\u3044\u305A\u308C\u304B\u4E00\u81F4)",basicOperatorAnd:"AND (\u3059\u3079\u3066\u4E00\u81F4)",basicMultiTermHint:'\u5F15\u7528\u7B26\u3067\u56F2\u3093\u3060\u8A9E ("\u7530\u4E2D \u592A\u90CE") \u306E\u7D50\u5408\u65B9\u6CD5 (\u65E2\u5B9A\u306F AND)\u3002\u5F15\u7528\u7B26\u306E\u5916\u306E\u8A9E\u306F\u305D\u308C\u305E\u308C\u5225\u306E\u30AD\u30FC\u30EF\u30FC\u30C9\u3067\u3001AND / OR \u30DC\u30BF\u30F3\u3067\u7D50\u5408\u3059\u308B',basicSortHeading:"\u30BD\u30FC\u30C8\u8A2D\u5B9A",basicSortBy:"\u30BD\u30FC\u30C8\u57FA\u6E96",basicSortByScore:"\u30B9\u30B3\u30A2",basicSortByRelevance:"\u95A2\u9023\u6027",basicSortByOriginal:"\u5143\u306E\u9806\u5E8F",basicSortOrder:"\u30BD\u30FC\u30C8\u9806\u5E8F",basicSortDescending:"\u964D\u9806",basicSortAscending:"\u6607\u9806",basicEngineHeading:"\u691C\u7D22\u30A8\u30F3\u30B8\u30F3\u8A2D\u5B9A",basicStrategy:"\u4E26\u5217\u691C\u7D22\u6226\u7565",basicStrategyBalanced:"\u30D0\u30E9\u30F3\u30B9",basicStrategyIndexFirst:"Index \u512A\u5148",basicStrategyLevenshteinFirst:"Levenshtein \u512A\u5148",basicIndexFiltering:"Index \u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0",basicLevenshtein:"Levenshtein \u8DDD\u96E2\u8A08\u7B97",advancedLearningHeading:"\u5B66\u7FD2\u91CD\u307F",advancedLearningLabel:"\u91CD\u307F\u4FC2\u6570",advancedLearningHint:"\u518D\u5B66\u7FD2\u6642\u306E\u91CD\u307F\u4ED8\u3051 (\u5927\u304D\u3044\u307B\u3069\u904E\u53BB\u306E\u691C\u7D22\u7D50\u679C\u3092\u512A\u5148)",advancedDebounceHeading:"\u30C7\u30D0\u30A6\u30F3\u30B9\u6642\u9593",advancedDebounceLabel:"\u5165\u529B\u9045\u5EF6 (ms)",advancedDebounceHint:"\u5165\u529B\u306E\u5F85\u3061\u6642\u9593\u3002\u77ED\u3044\u307B\u3069\u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u3001\u9577\u3044\u307B\u3069\u8CA0\u8377\u8EFD\u6E1B",indexSettingsHeading:"Index Worker \u8A2D\u5B9A",indexBuildHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u69CB\u7BC9",indexNgramSize:"N-gram \u30B5\u30A4\u30BA",indexNgramSizeHint:"\u6587\u5B57\u5217\u3092\u4F55\u6587\u5B57\u5358\u4F4D\u3067\u5206\u5272\u3059\u308B\u304B\u3002\u5C0F\u3055\u3044\u307B\u3069\u9AD8\u901F\u3060\u304C\u7CBE\u5EA6\u4F4E\u4E0B",indexMinNgramOverlap:"\u6700\u5C0F N-gram \u4E00\u81F4\u6570",indexMinNgramOverlapHint:"\u4E00\u81F4\u6570\u304C\u3053\u306E\u5024\u3092\u4E0B\u56DE\u308B\u5019\u88DC\u306F\u9664\u5916",indexCandidateHeading:"\u5019\u88DC\u7D5E\u308A\u8FBC\u307F",indexThreshold:"Index \u95BE\u5024",indexThresholdHint:"Jaro-Winkler \u985E\u4F3C\u5EA6\u306E\u4E0B\u9650 (\u7BC4\u56F2: 0.0-1.0)",indexNgramOverlapThreshold:"N-gram \u91CD\u8907\u5EA6\u95BE\u5024",indexNgramOverlapThresholdHint:"N-gram \u306E\u91CD\u306A\u308A\u5177\u5408\u3002\u9AD8\u3044\u307B\u3069\u53B3\u5BC6\u306B\u5019\u88DC\u3092\u7D5E\u308B",indexStrategyHeading:"\u691C\u7D22\u6226\u7565\u3068\u5019\u88DC\u6570",indexStrategy:"\u691C\u7D22\u6226\u7565",indexStrategyFast:"Fast (\u9AD8\u901F)",indexStrategyAccurate:"Accurate (\u6B63\u78BA)",indexStrategyHybrid:"Hybrid (\u52D5\u7684)",indexStrategyHint:"\u51E6\u7406\u8CA0\u8377\u3068\u7CBE\u5EA6\u306E\u30D0\u30E9\u30F3\u30B9\u3092\u9078\u629E",indexMinCandidatesRatio:"\u6700\u5C0F\u5019\u88DC\u6BD4\u7387",indexMinCandidatesRatioHint:"\u6700\u4F4E\u9650\u78BA\u4FDD\u3059\u308B\u5019\u88DC\u5272\u5408",indexMaxCandidatesRatio:"\u6700\u5927\u5019\u88DC\u6BD4\u7387",indexMaxCandidatesRatioHint:"\u5019\u88DC\u6570\u306E\u4E0A\u9650\u3002\u8D85\u3048\u308B\u3068\u52D5\u7684\u306B\u7D5E\u308A\u8FBC\u307F",indexJaroWinklerPrefix:"Jaro-Winkler \u63A5\u982D\u8F9E\u91CD\u307F",indexJaroWinklerPrefixHint:"\u5148\u982D\u4E00\u81F4\u306B\u4ED8\u4E0E\u3059\u308B\u30DC\u30FC\u30CA\u30B9\u5024",indexMaxResultsHint:"\u53D6\u5F97\u3059\u308B\u6700\u5927\u4EF6\u6570\u3002\u5927\u304D\u3044\u307B\u3069\u5305\u62EC\u7684\u3060\u304C\u9045\u5EF6\u304C\u5897\u52A0",indexFieldWeightHint:"\u30DE\u30C3\u30C1\u30D5\u30A3\u30FC\u30EB\u30C9\u6570\u306B\u3069\u308C\u3060\u3051\u91CD\u307F\u4ED8\u3051\u3059\u308B\u304B",indexPerfectMatchBonus:"\u5B8C\u5168\u4E00\u81F4\u30DC\u30FC\u30CA\u30B9",indexPerfectMatchBonusHint:"\u5B8C\u5168\u4E00\u81F4\u6642\u306B\u8FFD\u52A0\u3059\u308B\u30DC\u30FC\u30CA\u30B9\u5024",indexContainmentHeading:"\u548C\u6587\u30FB\u90E8\u5206\u6587\u5B57\u5217\u5305\u542B\u30B9\u30B3\u30A2",indexContainmentBase:"\u5305\u542B \u57FA\u790E\u30B9\u30B3\u30A2 (containmentScoreBase)",indexContainmentBaseHint:"\u30AF\u30A8\u30EA\u304C\u6587\u5B57\u5217\u4E2D\u306B\u5B8C\u5168\u306B\u542B\u307E\u308C\u308B\u5834\u5408\u306E\u6700\u4F4E\u57FA\u790E\u30B9\u30B3\u30A2 (\u548C\u6587 2 \u6587\u5B57\u7B49\u306E\u6551\u6E08)",indexContainmentCoverage:"\u5305\u542B \u88AB\u8986\u7387\u91CD\u307F (containmentCoverageWeight)",indexContainmentCoverageHint:"\u30AF\u30A8\u30EA\u9577 / \u30D5\u30A3\u30FC\u30EB\u30C9\u9577\u306E\u6BD4\u7387\u306B\u5FDC\u3058\u305F\u52A0\u7B97\u30B9\u30B3\u30A2 (\u5408\u8A08 1.0 \u4EE5\u4E0B\u306B\u5236\u9650)",levenshteinSettingsHeading:"Levenshtein Worker \u8A73\u7D30\u8A2D\u5B9A",levenshteinCandidateHeading:"\u5019\u88DC\u30D5\u30A3\u30EB\u30BF",levenshteinThreshold:"Levenshtein \u95BE\u5024",levenshteinThresholdHintRelevance:"\u3053\u306E\u95BE\u5024\u4EE5\u4E0A\u306E\u7D50\u679C\u306E\u307F\u4FDD\u6301 (\u7BC4\u56F2: 0.0-1.5)",levenshteinThresholdHint:"\u3053\u306E\u95BE\u5024\u4EE5\u4E0A\u306E\u7D50\u679C\u306E\u307F\u4FDD\u6301 (\u7BC4\u56F2: 0.0-1.0)",levenshteinLengthSimilarity:"\u9577\u3055\u985E\u4F3C\u5EA6\u95BE\u5024",levenshteinLengthSimilarityHint:"\u9577\u3055\u304C\u5927\u304D\u304F\u7570\u306A\u308B\u5019\u88DC\u3092\u4E8B\u524D\u306B\u9664\u5916\u3057\u3066\u901F\u5EA6\u5411\u4E0A",levenshteinLengthPenalty:"\u9577\u3055\u5DEE\u30DA\u30CA\u30EB\u30C6\u30A3",levenshteinLengthPenaltyHint:"\u9577\u3055\u5DEE\u3092\u3069\u308C\u3060\u3051\u6E1B\u70B9\u3059\u308B\u304B\u3002\u5927\u304D\u3044\u307B\u3069\u9577\u3055\u4E00\u81F4\u3092\u91CD\u8996",levenshteinResultsHeading:"\u7D50\u679C\u6570\u5236\u5FA1",levenshteinMaxResultsHint:"\u8FD4\u5374\u3059\u308B\u6700\u5927\u4EF6\u6570\u3002\u5927\u304D\u3044\u307B\u3069\u7DB2\u7F85\u7684\u3060\u304C\u51E6\u7406\u6642\u9593\u304C\u5897\u52A0",levenshteinFieldWeightHint:"\u4E00\u81F4\u30D5\u30A3\u30FC\u30EB\u30C9\u6570\u306E\u8A55\u4FA1\u91CD\u307F",levenshteinPartialBonus:"\u90E8\u5206\u4E00\u81F4\u30DC\u30FC\u30CA\u30B9",levenshteinPartialBonusHint:"\u90E8\u5206\u4E00\u81F4\u306B\u4ED8\u4E0E\u3059\u308B\u8FFD\u52A0\u30B9\u30B3\u30A2",statsRebuildingTitle:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D",statsRebuildIndexTabOnlyTitle:"Index \u30BF\u30D6\u3067\u306E\u307F\u4F7F\u7528\u53EF\u80FD",statsRebuildTitle:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3092\u518D\u69CB\u7BC9",statsRebuilding:"\u518D\u69CB\u7BC9\u4E2D...",statsRebuild:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9",statsResetTitle:"\u7D71\u8A08\u3092\u30EA\u30BB\u30C3\u30C8",statsTabsLabel:"\u691C\u7D22\u7D71\u8A08\u30BF\u30D6",statsOverviewTab:"\u6982\u8981",statsIndexTab:"Index",statsLevenshteinTab:"Levenshtein",statTotalSearches:"\u7DCF\u691C\u7D22\u56DE\u6570",statAverageSearchTime:"\u5E73\u5747\u691C\u7D22\u6642\u9593",statDataCount:"\u30C7\u30FC\u30BF\u4EF6\u6570",statResultCount:"\u691C\u7D22\u7D50\u679C\u4EF6\u6570",statDisplayedCount:"\u8868\u793A\u4EF6\u6570",statsNoData:"\u7D71\u8A08\u30C7\u30FC\u30BF\u306A\u3057",statsBasicHeading:"\u57FA\u672C\u7D71\u8A08",statTotalProcessingTime:"\u7DCF\u51E6\u7406\u6642\u9593",statLastSearchTime:"\u6700\u5F8C\u306E\u691C\u7D22\u6642\u9593",statErrorCount:"\u30A8\u30E9\u30FC\u6570",statUpdatedAt:"\u7D71\u8A08\u66F4\u65B0\u6642\u523B",statsTimestamp:Or,statsOperationsHeading:"\u64CD\u4F5C\u7D71\u8A08",statTotalOperations:"\u7DCF\u64CD\u4F5C\u6570",statsIndexHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u7D71\u8A08",statIndexBuilds:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u69CB\u7BC9\u56DE\u6570",statDataSize:"\u30C7\u30FC\u30BF\u30B5\u30A4\u30BA",statLastBuildTime:"\u6700\u5F8C\u306E\u69CB\u7BC9\u6642\u9593",statsCacheHeading:"\u30AD\u30E3\u30C3\u30B7\u30E5\u7D71\u8A08",statCacheNgram:"N-gram",statCacheWord:"\u5358\u8A9E",statCachePhonetic:"\u97F3\u97FB",statsIndexMetadataHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u30E1\u30BF\u30C7\u30FC\u30BF",statsCalculationsHeading:"\u8A08\u7B97\u7D71\u8A08",statTotalCalculations:"\u7DCF\u8A08\u7B97\u6570",statDistanceCalculations:"\u8DDD\u96E2\u8A08\u7B97\u6570",statAverageDistance:"\u5E73\u5747\u8DDD\u96E2",statMinDistance:"\u6700\u5C0F\u8DDD\u96E2",statMaxDistance:"\u6700\u5927\u8DDD\u96E2",notAvailable:"N/A",statsMatchesHeading:"\u30DE\u30C3\u30C1\u7D71\u8A08",statPartialMatches:"\u90E8\u5206\u30DE\u30C3\u30C1\u6570",statPerfectMatches:"\u5B8C\u5168\u30DE\u30C3\u30C1\u6570",statEarlyTerminations:"\u65E9\u671F\u7D42\u4E86\u6570",statsSimilarityHeading:"\u985E\u4F3C\u5EA6\u5206\u5E03",statAbove80:"80% \u4EE5\u4E0A",statAbove60:"60% \u4EE5\u4E0A",statAbove40:"40% \u4EE5\u4E0A",statBelow40:"40% \u672A\u6E80",statsDistanceHeading:"\u8DDD\u96E2\u5206\u5E03 (\u4E0A\u4F4D 6)",statDistance:e=>`\u8DDD\u96E2 ${e}`,statsQueryLengthHeading:"\u30AF\u30A8\u30EA\u9577\u7D71\u8A08 (\u4E0A\u4F4D 6)",statQueryLength:e=>`\u9577\u3055 ${e}`,statQueryLengthValue:({count:e,averagePercent:t})=>`${ne("ja",e)} \u56DE / \u5E73\u5747 ${t}%`,statsFieldPerformanceHeading:"\u30D5\u30A3\u30FC\u30EB\u30C9\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9 (\u4E0A\u4F4D 6)",statAverageScore:"\u5E73\u5747\u30B9\u30B3\u30A2",statMatchCount:"\u30DE\u30C3\u30C1\u6570",statBestWorstScore:"\u6700\u9AD8 / \u6700\u4F4E\u30B9\u30B3\u30A2",statsInsightsHeading:"\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6D1E\u5BDF",statBestField:"\u6700\u9AD8\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u30D5\u30A3\u30FC\u30EB\u30C9",statRecentAverageTime:"\u6700\u8FD1\u306E\u5E73\u5747\u51E6\u7406\u6642\u9593",statRecentAverageResults:"\u6700\u8FD1\u306E\u5E73\u5747\u7D50\u679C\u6570",statThroughput:"\u30B9\u30EB\u30FC\u30D7\u30C3\u30C8",statCommonQueryLength:"\u6700\u983B\u51FA\u30AF\u30A8\u30EA\u9577",statHistoryEntries:"\u5C65\u6B74\u30A8\u30F3\u30C8\u30EA\u6570",statHighSimilarity:"\u9AD8\u985E\u4F3C",statMediumSimilarity:"\u4E2D\u985E\u4F3C",statLowSimilarity:"\u4F4E\u985E\u4F3C",statVeryLowSimilarity:"\u6975\u4F4E\u985E\u4F3C",statsRecentHistoryHeading:"\u6700\u8FD1\u306E\u5C65\u6B74 (\u6700\u65B0 3 \u4EF6)",statsHistoryEntry:({processingTimeMs:e,resultCount:t})=>`\u51E6\u7406\u6642\u9593: ${e} ms / \u7D50\u679C: ${ne("ja",t)} \u4EF6`,timesUnit:()=>" \u56DE",itemsUnit:()=>" \u4EF6",charactersUnit:()=>" \u6587\u5B57",throughputUnit:" ops/\u79D2"})}),Oa=Object.freeze(Object.keys(Yn.en)),Pn=Object.freeze([...Wr,...Oa]),ht=Object.freeze({en:Object.freeze({...Aa.en,...Yn.en}),ja:Object.freeze({...Aa.ja,...Yn.ja})}),Ti=new Set(Pn),$a=Object.keys(ht).map(e=>JSON.stringify(e)).join(" or "),Da=Object.freeze({locale:"locale",labels:"labels"}),Ni=(e,t,n)=>{e[t]=n},Hr=(e,t=Da.locale)=>{if(e!==void 0&&typeof e!="string")throw new TypeError(`[contact-map] ${t} must be ${$a} or left out; got ${ee(e)}`);if(e!==void 0&&!Object.hasOwn(ht,e))throw new RangeError(`[contact-map] ${t} must be ${$a} or left out; got ${ee(e)}`);return Ci(e)},Mi=(e,t,n,a)=>{if(typeof a=="function"){if(typeof n!="function")throw new TypeError(`[contact-map] ${e}.${t} must be a function; got ${ee(n)}`);return}if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string; got ${ee(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${ee(n)}`)},Ei=(e,t,n)=>{let a=Object.create(null);for(let i of Object.getOwnPropertyNames(e)){if(!Ti.has(i)){let r=qn(i,Pn);throw new RangeError(`[contact-map] ${n} has a key that is not a label key (${r===void 0?"":`did you mean ${JSON.stringify(r)}? `}CONTACT_MAP_LABEL_KEYS lists every key); got ${ee(i)}`)}let o=e[i];o!==void 0&&(Mi(n,i,o,t[i]),a[i]=o)}return a},Li=e=>{let t={},n=!1;for(let a of Wr){let i=e[a];i!==void 0&&(t[a]=i,n=!0)}return n?t:void 0},Fr=(e,t,n=Da)=>{let a=Hr(e,n.locale);if(t===void 0)return ht[a];if(!on(t))throw new TypeError(`[contact-map] ${n.labels} must be a plain object or left out; got ${ee(t)}`);let i=Ei(t,ht[a],n.labels),r={...Si(a,Li(i)),...Yn[a]};for(let u of Oa){let d=i[u];d!==void 0&&Ni(r,u,d)}return Object.freeze(r)},Ir=e=>{let t={};for(let n of Wr)t[n]=e[n];return Object.freeze(t)},Br=e=>{let t={};for(let n of vi)t[n]=e[n];return Object.freeze(t)}});import{DIRECTORY_TREE_LABEL_KEYS as ki}from"@aiquants/directory-tree";import{VIRTUAL_SCROLL_LABEL_KEYS as wi}from"@aiquants/virtualscroll";import{createContext as Ri,useContext as Ha,useMemo as Wa,useRef as Pi}from"react";import{jsx as Ai}from"react/jsx-runtime";var _i,Ur,zr,Fa,Pe,Q,ge=Me(()=>{"use strict";Bt();_i=Object.freeze({locale:"en",labels:ht.en,treeLabels:Ir(ht.en),engineLabels:Br(ht.en)}),Ur=Ri(_i),zr=(e,t)=>{let n=Pi(null),a=n.current;return a!==null&&t.every(i=>a[i]===e[i])?a:(n.current=e,e)},Fa=({locale:e,labels:t,surface:n,children:a})=>{let i=Hr(e,n.locale),o=Wa(()=>Fr(i,t,n),[i,t,n]),r=zr(o,Pn),u=zr(Ir(r),ki),d=zr(Br(r),wi),c=Wa(()=>({locale:i,labels:r,treeLabels:u,engineLabels:d}),[i,r,u,d]);return Ai(Ur.Provider,{value:c,children:a})},Pe=()=>Ha(Ur),Q=()=>Ha(Ur).labels});var s,M,I,m,X,A,qe,Ia,Te,zt,E,kt,Ba,de=Me(()=>{"use strict";s={fg:"text-[color:light-dark(#0f172b,#f8fafc)]",fgSecondary:"text-[color:light-dark(#314158,#e2e8f0)]",fgMuted:"text-[color:light-dark(#44536a,#cad5e2)]",onPrimary:"text-[color:light-dark(#ffffff,#0f172b)]"},M={surface:"bg-[color:light-dark(#ffffff,#0f172b)]",subtle:"bg-[color:light-dark(#f8fafc,#1d293d)]",muted:"bg-[color:light-dark(#f1f5f9,#1d293d)]"},I={borderSubtle:"border-[color:light-dark(#e2e8f0,#314158)]",borderControl:"border-[color:light-dark(#62748e,#90a1b9)]"},m={amber:"text-[color:light-dark(#7b3306,#fee685)]",blue:"text-[color:light-dark(#193cb8,#bedbff)]",cyan:"text-[color:light-dark(#104e64,#a2f4fd)]",emerald:"text-[color:light-dark(#004f3b,#a4f4cf)]",fuchsia:"text-[color:light-dark(#8a0194,#f6cfff)]",green:"text-[color:light-dark(#0d542b,#b9f8cf)]",indigo:"text-[color:light-dark(#372aac,#c6d2ff)]",lime:"text-[color:light-dark(#35530e,#d8f999)]",orange:"text-[color:light-dark(#7e2a0c,#ffd6a7)]",pink:"text-[color:light-dark(#a3004c,#fccee8)]",purple:"text-[color:light-dark(#6e11b0,#e9d4ff)]",red:"text-[color:light-dark(#9f0712,#ffc9c9)]",rose:"text-[color:light-dark(#a50036,#ffccd3)]",sky:"text-[color:light-dark(#024a70,#b8e6fe)]",teal:"text-[color:light-dark(#0b4f4a,#96f7e4)]",violet:"text-[color:light-dark(#5d0ec0,#ddd6ff)]"},X={amber:"bg-[color:light-dark(#fffbeb,#461901)]",blue:"bg-[color:light-dark(#eff6ff,#162456)]",emerald:"bg-[color:light-dark(#ecfdf5,#002c22)]",green:"bg-[color:light-dark(#f0fdf4,#032e15)]",purple:"bg-[color:light-dark(#faf5ff,#3c0366)]",rose:"bg-[color:light-dark(#fff1f2,#4d0218)]",sky:"bg-[color:light-dark(#f0f9ff,#052f4a)]"},A={amber:"border-[color:light-dark(#fee685,#7b3306)]",blue:"border-[color:light-dark(#bedbff,#193cb8)]",cyan:"border-[color:light-dark(#a2f4fd,#104e64)]",emerald:"border-[color:light-dark(#a4f4cf,#004f3b)]",fuchsia:"border-[color:light-dark(#f6cfff,#8a0194)]",green:"border-[color:light-dark(#b9f8cf,#0d542b)]",indigo:"border-[color:light-dark(#c6d2ff,#372aac)]",pink:"border-[color:light-dark(#fccee8,#a3004c)]",purple:"border-[color:light-dark(#e9d4ff,#6e11b0)]",rose:"border-[color:light-dark(#ffccd3,#a50036)]",sky:"border-[color:light-dark(#b8e6fe,#024a70)]",teal:"border-[color:light-dark(#96f7e4,#0b4f4a)]",violet:"border-[color:light-dark(#ddd6ff,#5d0ec0)]"},qe={amber:"bg-[color:light-dark(#bb4d00,#fcbb00)]",blue:"bg-[color:light-dark(#155dfc,#51a2ff)]",emerald:"bg-[color:light-dark(#009966,#00d492)]",rose:"bg-[color:light-dark(#ec003f,#ff637e)]",sky:"bg-[color:light-dark(#0084d1,#00bcff)]"},Ia={amber:"border-[color:light-dark(#bb4d00,#fcbb00)]"},Te={blue:"bg-[color:light-dark(#193cb8,#bedbff)]",green:"bg-[color:light-dark(#0d542b,#b9f8cf)]",orange:"bg-[color:light-dark(#7e2a0c,#ffd6a7)]",purple:"bg-[color:light-dark(#6e11b0,#e9d4ff)]",red:"bg-[color:light-dark(#9f0712,#ffc9c9)]"},zt={blue:"hover:bg-[color:light-dark(#162456,#eff6ff)]",red:"hover:bg-[color:light-dark(#460809,#fef2f2)]"},E={hoverSurface:"hover:bg-[color:light-dark(#ffffff,#0f172b)]",hoverMuted:"hover:bg-[color:light-dark(#f1f5f9,#1d293d)]",hoverBlueTint:"hover:bg-[color:light-dark(#eff6ff,#162456)]",hoverRoseTint:"hover:bg-[color:light-dark(#fff1f2,#4d0218)]",hoverFg:"hover:text-[color:light-dark(#0f172b,#f8fafc)]",hoverFgSecondary:"hover:text-[color:light-dark(#314158,#e2e8f0)]",hoverBlueFg:"hover:text-[color:light-dark(#193cb8,#bedbff)]",hoverBlueAccentBorder:"hover:border-[color:light-dark(#155dfc,#51a2ff)]",focusRing:"focus:ring-[color:light-dark(#1447e6,#74d4ff)]",focusBorder:"focus:border-[color:light-dark(#1447e6,#74d4ff)]",focusVisibleRing:"focus-visible:ring-[color:light-dark(#1447e6,#74d4ff)]",focusVisibleOutline:"focus-visible:outline-[color:light-dark(#1447e6,#74d4ff)]",activeRowOutline:"in-focus-visible:data-[contact-map-row-active]:outline-[color:light-dark(#1447e6,#74d4ff)]",ringOffsetSurface:"ring-offset-[color:light-dark(#ffffff,#0f172b)]",selectedRing:"ring-[color:light-dark(#155dfc,#51a2ff)]",activeTabSurface:"data-[state=active]:bg-[color:light-dark(#ffffff,#0f172b)]",activeTabFg:"data-[state=active]:text-[color:light-dark(#0f172b,#f8fafc)]",activeTabBlueFg:"data-[state=active]:text-[color:light-dark(#193cb8,#bedbff)]",treeNameSky:"[&_.directory-tree-name]:text-[color:light-dark(#024a70,#b8e6fe)]"},kt={mark:"bg-[color:light-dark(#fff085,#733e0a)]",progressTrack:"bg-[color:light-dark(#bedbff,#193cb8)]",scrim:"bg-[color:rgb(15_23_43/0.5)]"},Ba="#71829b"});var x,wt,w,Ee=Me(()=>{"use strict";x="text-[length:var(--aqcm-font-size-body,0.8125rem)] leading-[var(--aqcm-line-height-body,1.25rem)]",wt="text-[length:var(--aqcm-font-size-caption,0.6875rem)]",w=`${wt} leading-[var(--aqcm-line-height-caption,1.25rem)]`});var Xn,Qn,Jn,Zn,jr=Me(()=>{"use strict";de();Xn="fixed inset-y-0 left-0 m-0 h-auto max-h-none w-auto max-w-none border-0 bg-transparent p-0 text-inherit outline-none backdrop:bg-transparent motion-safe:transition-[right] motion-safe:duration-500 motion-safe:ease-[ease]",Qn=Object.freeze({right:"var(--aqcm-overlay-right, 0px)"}),Jn=`absolute inset-0 ${kt.scrim}`,Zn=()=>!1});var Di,Wi,st,Ua,Va,cn,dn=Me(()=>{"use strict";de();Di="min-w-11 py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",Wi=2,st=`focus-visible:outline-2 ${E.focusVisibleOutline} focus-visible:outline-offset-2`,Ua=`in-focus-visible:data-[contact-map-row-active]:outline-2 in-focus-visible:data-[contact-map-row-active]:-outline-offset-2 ${E.activeRowOutline}`,Va=Wi,cn=`inline-block max-w-full underline-offset-2 hover:underline focus-visible:underline ${st} ${Di}`});import{clsx as Hi}from"clsx";import{twMerge as Fi}from"tailwind-merge";function ke(...e){return Fi(Hi(e))}var _n=Me(()=>{"use strict"});import{useOverlayDialog as Ii}from"@aiquants/swipe-overlay";import Bi from"lucide-react/dist/esm/icons/check.js";import zi from"lucide-react/dist/esm/icons/copy.js";import Ui from"lucide-react/dist/esm/icons/x.js";import{useCallback as pn,useEffect as Ka,useId as Vi,useMemo as er,useRef as ja,useState as Ki}from"react";import{createPortal as ji}from"react-dom";import{jsx as ae,jsxs as Ye}from"react/jsx-runtime";var Gi,De,qi,Yi,Xi,An,mn,Qi,Ji,un,Gr,qr,tr,Yr=Me(()=>{"use strict";Ft();ge();jr();de();dn();Ee();_n();Gi=350,De=e=>e.stopPropagation(),qi=Object.freeze({onClick:De,onDoubleClick:De,onContextMenu:De,onPointerDown:De,onPointerUp:De,onMouseDown:De,onMouseUp:De,onTouchStart:De,onTouchEnd:De,onKeyDown:De,onKeyUp:De,onFocus:De,onBlur:De}),Yi=ke(Xn,"flex items-center justify-center px-4 py-6"),Xi=`relative max-h-full w-full max-w-md overflow-y-auto overscroll-contain rounded-lg border ${I.borderControl} ${M.surface} p-4 shadow-lg transition-colors`,An=0,mn=null,Qi=()=>{let e=document.body.style;An+=1,An===1&&(mn={userSelect:e.userSelect,webkitUserSelect:e.webkitUserSelect}),e.userSelect="none",typeof e.webkitUserSelect<"u"&&(e.webkitUserSelect="none")},Ji=()=>{if(An=Math.max(0,An-1),An>0||!mn)return;let e=document.body.style;e.userSelect=mn.userSelect,typeof mn.webkitUserSelect<"u"&&(e.webkitUserSelect=mn.webkitUserSelect),mn=null},un=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},Gr=(e,t)=>{let n=new Set;return e.reduce((a,i)=>{let o=typeof i.value=="string"?i.value.trim():"";if(!o)return a;let{normalized:r,key:u,entry:d}=t(o,i);return r&&!n.has(u)&&(n.add(u),a.push(d(r))),a},[])},qr=({value:e,ariaLabel:t})=>{let[n,a]=Ki(!1),i=ja(null),o=pn(async d=>{if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(d),!0}catch{}if(typeof document>"u")return!1;let c=document.createElement("textarea");c.value=d,c.setAttribute("readonly",""),c.style.position="absolute",c.style.left="-9999px",document.body.appendChild(c),c.select(),c.setSelectionRange(0,c.value.length);let f=document.execCommand("copy");return document.body.removeChild(c),f},[]),r=pn(async d=>{d.preventDefault(),d.stopPropagation(),i.current!==null&&typeof window<"u"&&(window.clearTimeout(i.current),i.current=null);let c=await o(e);a(c),c&&typeof window<"u"&&(i.current=window.setTimeout(()=>{a(!1),i.current=null},1500))},[o,e]);Ka(()=>()=>{i.current!==null&&typeof window<"u"&&(window.clearTimeout(i.current),i.current=null)},[]);let u=n?Bi:zi;return ae("button",{type:"button",className:`inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md border ${I.borderControl} ${s.fgMuted} transition-colors ${E.hoverMuted} ${st}`,onClick:r,"aria-label":t,title:t,children:ae(u,{className:"h-3.5 w-3.5","aria-hidden":"true"})})},tr=({contactData:e,openEmailsWithGmail:t,openGmailCompose:n,onRequestClose:a})=>{let i=Q(),o=ja(null),r=er(()=>e.contacted_at?at(e.contacted_at,i.recordDate):null,[e.contacted_at,i.recordDate]),u=un(e.full_name)??i.noName,d=un(e.company_name),c=un(e.department),f=un(e.title),p=er(()=>Gr([{fieldKey:"company_name",label:i.fieldCompanyName,value:d},{fieldKey:"department",label:i.fieldDepartment,value:c},{fieldKey:"title",label:i.fieldTitle,value:f}],(C,{fieldKey:k,label:H})=>({normalized:C,key:`${k}-${C.toLowerCase()}`,entry:S=>({fieldKey:k,label:H,value:S})})),[d,c,f,i]),l=er(()=>Gr([{fieldKey:"custom_mobile_phone_number",label:i.popupCustomMobilePhone,value:e.custom_mobile_phone_number},{fieldKey:"mobile_phone_number",label:i.popupMobilePhone,value:e.mobile_phone_number},{fieldKey:"custom_company_phone_number",label:i.popupCustomCompanyPhone,value:e.custom_company_phone_number},{fieldKey:"company_phone_number",label:i.popupCompanyPhone,value:e.company_phone_number}],(C,{fieldKey:k,label:H})=>{let S=Rn(C);return{normalized:un(C),key:(S??C).toLowerCase(),entry:oe=>({fieldKey:k,label:H,value:oe,href:S})}}),[e.custom_mobile_phone_number,e.mobile_phone_number,e.custom_company_phone_number,e.company_phone_number,i]),g=er(()=>Gr([{fieldKey:"custom_email",label:i.popupCustomEmail,value:e.custom_email},{fieldKey:"email",label:i.popupEmail,value:e.email}],(C,{fieldKey:k,label:H})=>{let S=un(C),L=gt(C,t),oe=!!L?.startsWith("https://mail.google.com");return{normalized:S,key:C.toLowerCase(),entry:F=>({fieldKey:k,label:H,value:F,href:L,isGmailLink:oe})}}),[e.custom_email,e.email,t,i]),b=l.length>0||g.length>0,v=Vi(),T=pn(()=>{a(),o.current=null},[a]),N=pn(C=>C.ownerDocument.getElementById(v),[v]),{dialogProps:U,backdropProps:z}=Ii({isOpen:!0,onClose:T,isCloseBlocked:Zn,initialFocus:N}),y=pn((C,k)=>{k.isGmailLink&&(C.preventDefault(),n(k.value))},[n]),h=pn((C,k)=>{if(!k.isGmailLink){o.current=null;return}let H=Date.now(),S=o.current;if(S&&S.email===k.value&&H-S.timestamp<=Gi){o.current=null,C.preventDefault(),n(k.value);return}o.current={email:k.value,timestamp:H}},[n]);return Ka(()=>(Qi(),Ji),[]),ji(Ye("dialog",{...U,...qi,"data-contact-popup-root":"true","aria-labelledby":v,className:Yi,style:Qn,children:[ae("div",{...z,"data-contact-popup-backdrop":"",className:Jn}),Ye("div",{"data-contact-popup-card":"",className:Xi,children:[Ye("div",{className:"flex items-center justify-between gap-4",children:[ae("h2",{id:v,tabIndex:-1,className:`wrap-break-word min-w-0 font-semibold ${s.fg} text-lg outline-none`,children:u}),ae("button",{type:"button",className:`inline-flex shrink-0 items-center justify-center rounded-md p-3.5 ${s.fgMuted} transition-colors ${E.hoverMuted} ${st}`,onClick:T,"aria-label":i.close,children:ae(Ui,{className:"h-4 w-4","aria-hidden":"true"})})]}),p.length>0?ae("div",{className:`mt-2 space-y-2 ${s.fgSecondary} text-sm`,children:p.map(C=>Ye("div",{className:"flex items-center gap-3",children:[ae("p",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:C.value}),ae(qr,{value:C.value,ariaLabel:i.copyField(C.label)})]},C.fieldKey))}):null,Ye("div",{className:`mt-4 space-y-4 ${s.fgSecondary}`,children:[l.length>0?ae("div",{children:ae("ul",{className:"space-y-3 text-sm",children:l.map(C=>ae("li",{className:"flex items-start gap-3",children:Ye("div",{className:"min-w-0 flex-1",children:[ae("span",{className:`${s.fgMuted} text-xs`,children:C.label}),Ye("div",{className:"mt-1 flex items-center gap-3",children:[ae("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:C.href?ae("a",{href:C.href,className:`wrap-break-word ${m.blue} ${cn}`,children:C.value}):ae("span",{className:`wrap-break-word ${s.fg}`,children:C.value})}),ae(qr,{value:C.value,ariaLabel:i.copyField(C.label)})]})]})},`${C.fieldKey}-${C.value}`))})}):null,g.length>0?ae("div",{children:ae("ul",{className:"space-y-3 text-sm",children:g.map(C=>ae("li",{className:"flex items-start gap-3",children:Ye("div",{className:"min-w-0 flex-1",children:[ae("span",{className:`${s.fgMuted} text-xs`,children:C.label}),Ye("div",{className:"mt-1 flex items-start gap-3",children:[Ye("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:[C.href?ae("a",{href:C.href,className:`wrap-break-word ${m.blue} ${cn}`,target:C.isGmailLink?"_blank":void 0,rel:C.isGmailLink?"noopener noreferrer":void 0,onDoubleClick:k=>y(k,C),onTouchEnd:k=>h(k,C),children:C.value}):ae("span",{className:`wrap-break-word ${s.fg}`,children:C.value}),C.isGmailLink?ae("span",{className:`mt-1 block ${w} ${s.fgMuted}`,children:i.popupGmailHint}):null]}),ae(qr,{value:C.value,ariaLabel:i.copyField(C.label)})]})]})},`${C.fieldKey}-${C.value}`))})}):null,r?Ye("div",{className:`mt-2 flex items-center gap-2 ${s.fgMuted} text-sm`,children:[ae("span",{className:"text-xs",children:i.popupLastContactDate}),ae("span",{children:r})]}):null,b?null:ae("p",{className:`${s.fgMuted} text-sm`,children:i.popupNoContactMethods})]})]})]}),document.body)}});import{jsx as _e,jsxs as $n}from"react/jsx-runtime";var nr,Xr=Me(()=>{"use strict";de();Ee();nr=({fullName:e,title:t="-",companyName:n="-",department:a="-",phoneNumber:i="-",email:o="-",updatedAtText:r="-"})=>$n("div",{className:`flex h-full w-full flex-col justify-center gap-0.5 ${s.fg} text-xs leading-tight transition-colors sm:grid sm:grid-cols-3 sm:gap-2 sm:text-sm xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[$n("div",{className:"flex items-center gap-1 sm:hidden",children:[_e("div",{className:`flex-1 truncate font-medium ${s.fg} text-sm leading-tight`,children:e}),_e("div",{className:`shrink-0 whitespace-nowrap ${wt} ${s.fgMuted}`,children:i})]}),_e("div",{className:"flex items-center gap-1 sm:hidden",children:_e("div",{className:`flex-1 truncate ${s.fgSecondary} text-xs leading-tight`,children:n})}),_e("div",{className:"block sm:hidden",children:_e("span",{className:`w-full truncate text-left ${wt} ${s.fgSecondary} leading-tight`,children:a})}),$n("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[_e("span",{className:`truncate font-medium ${s.fg}`,children:e}),_e("span",{className:`truncate ${s.fgMuted} text-xs`,children:t})]}),$n("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[_e("span",{className:`truncate ${s.fg}`,children:n}),_e("span",{className:`truncate ${s.fgMuted} text-xs`,children:a})]}),$n("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[_e("span",{className:`truncate ${s.fgSecondary}`,children:i}),_e("span",{className:`truncate ${s.fgMuted} text-xs`,children:o})]}),_e("div",{className:`hidden items-end justify-end ${wt} ${s.fgMuted} xl:flex`,children:_e("span",{className:"truncate",children:r})})]})});import{formatQuerySets as Zi,parseQuerySets as es}from"@aiquants/fuzzy-search";import{getNormalizedVariants as ts,normalizeText as ns,romajiToKatakana as rs}from"@aiquants/select-box";var Ya,as,os,is,ss,Xa,Qa,ls,cs,ds,us,ms,ps,fs,gs,Ja,Za,Ga,qa,rr,hs,ys,Qr,eo,Jr=Me(()=>{"use strict";Ya=/[]/g,as=/^[\s ]+|[\s ]+$/g,os=/\s+/,is=/^[\p{Script=Latin}\s]+$/u,ss=/\p{Script=Latin}/u,Xa=Object.freeze({convertWidth:!0,convertKana:!0,convertCase:!0,convertRomaji:!1,normalizeVariants:!1,ignoreSpaces:!1,ignoreSymbols:!1,ignoreLongVowels:!1}),Qa="union",ls=65377,cs=65439,ds=["\uFF9E","\uFF9F"],us=(()=>{let e=new Map;for(let t=ls;t<=cs;t+=1){let n=String.fromCharCode(t);e.set(n.normalize("NFKC"),n);for(let a of ds){let i=(n+a).normalize("NFKC");i.length===1&&e.set(i,n+a)}}return e})(),ms=/[-ヿ]/u,ps=e=>{let t=Array.from(e,n=>us.get(n)??n).join("");return ms.test(t)?null:t},fs=e=>ns(e.replace(Ya,"").replace(as,""),Xa),gs=e=>{if(!is.test(e))return null;let t=rs(e);return ss.test(t)?null:t},Ja=e=>e.split(os).filter(Boolean),Za=e=>es(e,Qa).sets.map(({query:t})=>t),Ga=e=>Za(e).flatMap(t=>Ja(t)),qa=e=>Zi({combine:Qa,sets:Array.from(new Set(e),t=>({query:t}))}),rr=e=>{let t=Za(e.replace(Ya,"")).map(a=>Ja(fs(a)).join(" ")).filter(a=>a!==""),n=[];for(let a of t){let i=gs(a);if(i===null)return qa(t);n.push(i)}return qa(n)},hs=e=>{let t=new Set([...Ga(e),...Ga(rr(e))]),n=new Set;for(let a of t)for(let i of ts(a,Xa)){let o=i.trim();if(!o)continue;n.add(o);let r=ps(o);r!==null&&n.add(r)}return Array.from(n)},ys=/[.*+?^${}()|[\]\\]/g,Qr=e=>{let t=hs(e);if(t.length===0)return null;let n=t.map(a=>a.replace(ys,"\\$&")).sort((a,i)=>i.length-a.length);return new RegExp(n.join("|"),"gi")},eo=(e,t)=>{let n=Qr(e);if(n===null)return i=>i;let a=i=>t.some(o=>{let r=i[o];return typeof r=="string"&&r.search(n)!==-1});return i=>{let o=[],r=[];for(let u of i)a(u.item)?o.push(u):r.push(u);return[...o,...r]}}});import{memo as bs}from"react";import{Fragment as Zr,jsx as ar}from"react/jsx-runtime";var Ss,Ne,or=Me(()=>{"use strict";Jr();de();Ss=`rounded ${kt.mark} px-1 ${s.fg}`,Ne=bs(({text:e,query:t,enabled:n=!0})=>{if(!(n&&t?.trim()&&e))return ar(Zr,{children:e});let a=Qr(t);if(a===null)return ar(Zr,{children:e});let i=[],o=0,r=a.exec(e),u=0;for(;r;){let d=r[0],c=r.index;if(c>o&&i.push(e.substring(o,c)),d.length===0){a.lastIndex++,r=a.exec(e);continue}i.push(ar("mark",{className:Ss,children:d},`highlight-${c}-${u}`)),o=c+d.length,u+=1,r=a.exec(e)}return o<e.length&&i.push(e.substring(o)),ar(Zr,{children:i})});Ne.displayName="HighlightedText"});var no={};yi(no,{ContactDetailGrid:()=>to,default:()=>Cs});import{useMemo as ea}from"react";import{Fragment as vs,jsx as ta,jsxs as xs}from"react/jsx-runtime";var ir,to,Cs,ro=Me(()=>{"use strict";Ft();ge();Yr();Xr();or();ir=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},to=({contactData:e,searchTerm:t,enableHighlighting:n,openEmailsWithGmail:a,openGmailCompose:i,isPopupVisible:o,onRequestClose:r})=>{let u=Q(),d=ea(()=>rn(e),[e]),c=ea(()=>an(e),[e]),f=d.value??"-",p=c.value??"-",l=ea(()=>at(e.updated_at,u.recordDateTime),[e.updated_at,u.recordDateTime]),g=ir(e.full_name)??u.noName,b=ir(e.company_name),v=ir(e.department),T=(N,U="-")=>ta(Ne,{text:N??U,query:t,enabled:n});return xs(vs,{children:[ta(nr,{fullName:T(g),title:T(ir(e.title)),companyName:T(b),department:T(v),phoneNumber:p,email:T(f),updatedAtText:l}),o?ta(tr,{contactData:e,openEmailsWithGmail:a,openGmailCompose:i,onRequestClose:r}):null]})},Cs=to});ge();de();Ee();import{DEFAULT_FUZZY_SEARCH_OPTIONS as ln}from"@aiquants/fuzzy-search";import{memo as $i,useId as za}from"react";import{jsx as ot,jsxs as yt}from"react/jsx-runtime";var Vr=$i(({searchOptions:e,setSearchOptions:t})=>{let n=Q(),a=`flex flex-col gap-1 rounded-md border ${M.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=za(),r=za(),u=[];return u.push(yt("div",{className:`${a} ${A.sky} border-l-4`,children:[yt("div",{className:`${i} ${m.sky}`,children:["\u{1F4D8} ",n.advancedLearningHeading]}),ot("label",{htmlFor:o,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.advancedLearningLabel}),ot("input",{id:o,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.learningWeight||ln.learningWeight,onChange:d=>t(c=>({...c,learningWeight:parseFloat(d.target.value)})),className:"h-11 w-full"}),yt("span",{className:`${m.sky} text-xs`,children:[n.currentValueLabel," ",e.learningWeight||ln.learningWeight]}),ot("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.advancedLearningHint})]},"learning")),u.push(yt("div",{className:`${a} ${A.indigo} border-l-4`,children:[yt("div",{className:`${i} ${m.indigo}`,children:["\u23F1\uFE0F ",n.advancedDebounceHeading]}),ot("label",{htmlFor:r,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.advancedDebounceLabel}),ot("input",{id:r,type:"range",min:"100",max:"1000",step:"50",value:e.debounceMs??ln.debounceMs,onChange:d=>t(c=>({...c,debounceMs:parseInt(d.target.value,10)})),className:"h-11 w-full"}),yt("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.debounceMs??ln.debounceMs]}),ot("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.advancedDebounceHint})]},"debounce")),yt("section",{className:"space-y-3",children:[yt("div",{className:"flex items-center justify-between gap-3",children:[yt("div",{className:`flex items-center gap-2 font-semibold ${s.fgSecondary} text-xs transition-colors`,children:[ot("span",{children:"\u26A1"}),ot("span",{className:"tracking-wide",children:n.settingsAdvancedTab})]}),ot("button",{type:"button",onClick:()=>t(d=>({...d,learningWeight:ln.learningWeight,debounceMs:ln.debounceMs})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${I.borderControl} ${M.muted} px-2 font-medium ${s.fgSecondary} ${x} transition-colors ${E.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),ot("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:u})]})});Vr.displayName="AdvancedSearchSettings";ge();de();Ee();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Ut}from"@aiquants/fuzzy-search";import{memo as Oi,useId as it}from"react";import{jsx as se,jsxs as ue}from"react/jsx-runtime";var Kr=Oi(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:i,setOpenEmailsWithGmail:o})=>{let r=Q(),u=`flex flex-col gap-1 rounded-md border ${M.surface} px-2 py-1 shadow-sm transition-colors`,d="text-xs font-semibold",c=it(),f=it(),p=it(),l=it(),g=it(),b=it(),v=it(),T=it(),N=it(),U=it(),z=[];return z.push(ue("div",{className:`${u} ${A.blue} border-l-4`,children:[ue("div",{className:`${d} ${m.blue}`,children:["\u{1F3AF} ",r.basicThresholdHeading]}),se("label",{htmlFor:c,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicThresholdLabel}),se("input",{id:c,type:"range",min:"0.0",max:e.sortBy==="relevance"?"1.5":"1.0",step:"0.05",value:e.threshold??Ut.threshold,onChange:y=>t(h=>({...h,threshold:parseFloat(y.target.value)})),className:"h-11 w-full"}),ue("span",{className:`${m.blue} text-xs`,children:[r.currentValueLabel," ",e.threshold??Ut.threshold]}),se("p",{className:`${w} ${s.fgMuted} transition-colors`,children:e.sortBy==="relevance"?r.basicThresholdRangeRelevance:r.basicThresholdRange})]},"threshold")),z.push(ue("div",{className:`${u} ${A.amber} border-l-4`,children:[ue("div",{className:`${d} ${m.amber}`,children:["\u{1FA84} ",r.basicDisplayHeading]}),ue("label",{htmlFor:f,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[se("input",{id:f,type:"checkbox",checked:e.caseSensitive??Ut.caseSensitive,onChange:y=>t(h=>({...h,caseSensitive:y.target.checked})),className:"h-3 w-3"}),r.basicCaseSensitive]}),ue("label",{htmlFor:p,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[se("input",{id:p,type:"checkbox",checked:n,onChange:y=>a(y.target.checked),className:"h-3 w-3"}),r.basicHighlight]}),ue("label",{htmlFor:l,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[se("input",{id:l,type:"checkbox",checked:i,onChange:y=>o(y.target.checked),className:"h-3 w-3"}),r.basicOpenEmailsWithGmail]}),ue("div",{className:"flex flex-col gap-1",children:[se("label",{htmlFor:g,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicMultiTermOperator}),ue("select",{id:g,value:e.multiTermOperator??Ut.multiTermOperator,onChange:y=>t(h=>({...h,multiTermOperator:y.target.value})),className:`min-h-11 rounded border ${I.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${M.surface} ${s.fg}`,children:[se("option",{value:"or",children:r.basicOperatorOr}),se("option",{value:"and",children:r.basicOperatorAnd})]}),se("p",{className:`${w} ${s.fgMuted} transition-colors`,children:r.basicMultiTermHint})]})]},"display")),z.push(ue("div",{className:`${u} ${A.emerald} border-l-4`,children:[ue("div",{className:`${d} ${m.emerald}`,children:["\u{1F4DA} ",r.basicSortHeading]}),ue("div",{className:"flex flex-col gap-2",children:[se("label",{htmlFor:b,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicSortBy}),ue("select",{id:b,value:e.sortBy||Ut.sortBy,onChange:y=>t(h=>({...h,sortBy:y.target.value})),className:`min-h-11 rounded border ${I.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${M.surface} ${s.fg}`,children:[se("option",{value:"score",children:r.basicSortByScore}),se("option",{value:"relevance",children:r.basicSortByRelevance}),se("option",{value:"original",children:r.basicSortByOriginal})]})]}),ue("div",{className:"flex flex-col gap-2",children:[se("label",{htmlFor:v,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicSortOrder}),ue("select",{id:v,value:e.sortOrder||Ut.sortOrder,onChange:y=>t(h=>({...h,sortOrder:y.target.value})),className:`min-h-11 rounded border ${I.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${M.surface} ${s.fg}`,children:[se("option",{value:"desc",children:r.basicSortDescending}),se("option",{value:"asc",children:r.basicSortAscending})]})]})]},"sorting")),z.push(ue("div",{className:`${u} ${A.purple} border-l-4`,children:[ue("div",{className:`${d} ${m.purple}`,children:["\u2699\uFE0F ",r.basicEngineHeading]}),se("label",{htmlFor:T,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicStrategy}),ue("select",{id:T,value:e.parallelSearchStrategy||Ut.parallelSearchStrategy,onChange:y=>t(h=>({...h,parallelSearchStrategy:y.target.value})),className:`min-h-11 rounded border ${I.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${M.surface} ${s.fg}`,children:[se("option",{value:"balanced",children:r.basicStrategyBalanced}),se("option",{value:"index-first",children:r.basicStrategyIndexFirst}),se("option",{value:"levenshtein-first",children:r.basicStrategyLevenshteinFirst})]}),ue("div",{className:"mt-2 space-y-2",children:[ue("label",{htmlFor:N,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[se("input",{id:N,type:"checkbox",checked:e.enableIndexFiltering!==!1,onChange:y=>t(h=>({...h,enableIndexFiltering:y.target.checked})),className:"h-3 w-3"}),r.basicIndexFiltering]}),ue("label",{htmlFor:U,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[se("input",{id:U,type:"checkbox",checked:e.enableLevenshtein!==!1,onChange:y=>t(h=>({...h,enableLevenshtein:y.target.checked})),className:"h-3 w-3"}),r.basicLevenshtein]})]})]},"engine")),ue("section",{className:"space-y-3",children:[ue("div",{className:`flex items-center gap-2 font-semibold ${m.blue} text-xs transition-colors`,children:[se("span",{children:"\u{1F527}"}),se("span",{className:"tracking-wide",children:r.settingsBasicTab})]}),se("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:z})]})});Kr.displayName="BasicSearchSettings";Ft();import{SWIPE_OVERLAY_SCROLL_AREA_STYLE as Ts}from"@aiquants/swipe-overlay";import Ns from"lucide-react/dist/esm/icons/badge-check.js";import Ms from"lucide-react/dist/esm/icons/building-2.js";import Es from"lucide-react/dist/esm/icons/calendar-clock.js";import Ls from"lucide-react/dist/esm/icons/check.js";import ks from"lucide-react/dist/esm/icons/copy.js";import ws from"lucide-react/dist/esm/icons/id-card.js";import Rs from"lucide-react/dist/esm/icons/mail.js";import Ps from"lucide-react/dist/esm/icons/phone.js";import _s from"lucide-react/dist/esm/icons/user-round.js";import{useCallback as As,useEffect as $s,useMemo as cr,useRef as Os,useState as Ds}from"react";var lt={info:(e,...t)=>console.info(`[contact-map] ${e}`,...t),warn:(e,...t)=>console.warn(`[contact-map] ${e}`,...t),error:(e,...t)=>console.error(`[contact-map] ${e}`,...t)};ge();de();de();_n();import*as Xe from"@radix-ui/react-tabs";import*as sr from"react";import{jsx as na}from"react/jsx-runtime";var lr=Xe.Root,On=sr.forwardRef(({className:e,...t},n)=>na(Xe.List,{ref:n,className:ke(`inline-flex h-10 items-center justify-center rounded-md ${M.muted} p-1 ${s.fgMuted}`,e),...t}));On.displayName=Xe.List.displayName;var Vt=sr.forwardRef(({className:e,...t},n)=>na(Xe.Trigger,{ref:n,className:ke(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ${E.ringOffsetSurface} transition-all focus-visible:outline-hidden focus-visible:ring-2 ${E.focusVisibleRing} focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 ${E.activeTabSurface} ${E.activeTabFg} data-[state=active]:shadow-2xs`,e),...t}));Vt.displayName=Xe.Trigger.displayName;var Kt=sr.forwardRef(({className:e,...t},n)=>na(Xe.Content,{ref:n,className:ke(`mt-2 ${E.ringOffsetSurface} focus-visible:outline-hidden focus-visible:ring-2 ${E.focusVisibleRing} focus-visible:ring-offset-2 data-[state=inactive]:hidden`,e),...t}));Kt.displayName=Xe.Content.displayName;dn();Ee();or();import{jsx as R,jsxs as ve}from"react/jsx-runtime";var ao=`truncate font-semibold ${s.fg} ${x}`,oo={height:"var(--contact-panel-height, 100%)",maxHeight:"100%"},Ws=({icon:e,label:t,value:n,fieldKey:a,copyValue:i,onCopy:o,isCopied:r,linkHref:u,searchTerm:d,enableHighlighting:c})=>{let f=Q(),p=!!(o&&a&&i),l=u?.startsWith("https://mail.google.com")?"_blank":void 0;return ve("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${I.borderSubtle} ${M.subtle} px-2.5 py-1.5 transition-colors`,children:[ve("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[R("div",{className:`flex h-7 w-7 items-center justify-center rounded-full ${M.surface} ${s.fgMuted} transition-colors`,children:R(e,{size:14})}),ve("div",{className:"min-w-0 flex-1",children:[R("div",{className:`font-medium ${w} ${s.fgMuted}`,children:t}),u?R("a",{href:u,className:`align-top ${ao} ${cn}`,target:l,rel:l?"noopener noreferrer":void 0,children:R(Ne,{text:n,query:d??"",enabled:c})}):R("div",{className:ao,children:R(Ne,{text:n,query:d??"",enabled:c})})]})]}),p?R("button",{type:"button",onClick:()=>o&&a&&i&&o(a,i,t),className:`inline-flex h-11 w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border ${I.borderControl} ${M.surface} ${s.fgMuted} transition-colors ${E.hoverBlueAccentBorder} ${E.hoverBlueFg} ${st}`,"aria-label":f.copyField(t),children:r?R(Ls,{size:14}):R(ks,{size:14})}):null]})},io=({items:e,searchTerm:t,enableHighlighting:n})=>R("dl",{className:"grid grid-cols-1 gap-x-3 gap-y-1.5 sm:grid-cols-2",children:e.map(a=>ve("div",{className:`flex flex-col gap-0.5 rounded-md border ${I.borderSubtle} ${M.surface} px-2 py-1 transition-colors`,children:[R("dt",{className:`font-semibold ${w} ${s.fgMuted} uppercase tracking-wide`,children:a.label}),R("dd",{className:`wrap-break-word ${s.fg} text-xs`,children:R(Ne,{text:a.value,query:t??"",enabled:n})})]},a.fieldKey))}),ra=({title:e})=>R("h3",{className:`font-semibold ${s.fgSecondary} text-xs`,children:e}),Hs=()=>{let e=Q();return ve("div",{className:`flex h-full min-h-40 w-full flex-1 flex-col items-center justify-center gap-2 rounded-xl border ${I.borderSubtle} border-dashed ${M.surface} p-4 text-center transition-colors`,children:[R("p",{className:`font-medium ${s.fgMuted} text-xs`,children:e.detailEmptyTitle}),R("p",{className:`${w} ${s.fgMuted}`,children:e.detailEmptyHint})]})},Fs=Object.freeze({overlay:Ts,pane:void 0}),fn=({contact:e,placement:t,searchTerm:n,enableHighlighting:a,style:i,className:o=""})=>{let r=Q(),[u,d]=Ds(null),c=Os(null),f=cr(()=>({...oo,...i}),[i]);$s(()=>()=>{c.current!==null&&window.clearTimeout(c.current)},[]);let p=cr(()=>rn(e),[e]),l=cr(()=>an(e),[e]),g=cr(()=>at(e?.contacted_at,r.recordDateTime),[e?.contacted_at,r.recordDateTime]),b=As(async(S,L,oe)=>{try{await navigator.clipboard.writeText(L),d(S),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{d(null)},2e3)}catch(F){lt.error("Failed to copy contact detail",F)}},[]);if(!e)return R("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${I.borderSubtle} ${M.surface} shadow-sm transition-colors`,style:oo,children:R(Hs,{})});let v=[re(e.title),re(e.department)].filter(S=>S!=="-"),T=[v.join(" / "),re(e.company_name)].filter(S=>S&&S!=="-").join(" \u30FB ")||"-",N=Ge(e.full_name)??r.noName,U=[{fieldKey:"full_name",label:r.fieldFullName,value:N},{fieldKey:"full_name_reading",label:r.fieldFullNameReading,value:re(e.full_name_reading)},{fieldKey:"title",label:r.fieldTitle,value:re(e.title)},{fieldKey:"department",label:r.fieldDepartment,value:re(e.department)},{fieldKey:"company_name",label:r.fieldCompanyName,value:re(e.company_name)},{fieldKey:"company_name_reading",label:r.fieldCompanyNameReading,value:re(e.company_name_reading)},{fieldKey:"address",label:r.fieldAddress,value:re(e.address)},{fieldKey:"postal_code",label:r.fieldPostalCode,value:re(e.postal_code)},{fieldKey:"url",label:r.fieldUrl,value:re(e.url)}],z=[{label:r.fieldCustomEmail,value:re(e.custom_email),fieldKey:"custom_email",rawValue:e.custom_email},{label:r.fieldEmail,value:re(e.email),fieldKey:"email",rawValue:e.email}].filter(S=>S.value!=="-"),y=[{label:r.fieldCustomMobilePhone,value:re(e.custom_mobile_phone_number),fieldKey:"custom_mobile_phone_number",rawValue:e.custom_mobile_phone_number},{label:r.fieldMobilePhone,value:re(e.mobile_phone_number),fieldKey:"mobile_phone_number",rawValue:e.mobile_phone_number},{label:r.fieldCompanyPhone,value:re(e.company_phone_number),fieldKey:"company_phone_number",rawValue:e.company_phone_number},{label:r.fieldCompanyFax,value:re(e.company_fax_number),fieldKey:"company_fax_number",rawValue:e.company_fax_number}].filter(S=>S.value!=="-"),h=[{fieldKey:"person_id",label:"person_id",value:re(e.person_id)},{fieldKey:"person_id_redirect_to",label:"person_id_redirect_to",value:re(e.person_id_redirect_to)},{fieldKey:"is_active",label:"is_active",value:re(e.is_active)},{fieldKey:"is_contact_synced",label:"is_contact_synced",value:re(e.is_contact_synced)},{fieldKey:"is_incomplete",label:"is_incomplete",value:re(e.is_incomplete)},{fieldKey:"is_in_eight",label:"is_in_eight",value:re(e.is_in_eight)},{fieldKey:"created_by",label:r.fieldCreatedBy,value:re(e.created_by)},{fieldKey:"created_at",label:r.fieldCreatedAt,value:at(e.created_at,r.recordDateTime)},{fieldKey:"updated_by",label:r.fieldUpdatedBy,value:re(e.updated_by)},{fieldKey:"updated_at",label:r.fieldUpdatedAt,value:at(e.updated_at,r.recordDateTime)}],C=[{rowKey:"person_id",icon:ws,label:"person_id",value:re(e.person_id),fieldKey:"person_id",copyValue:String(e.person_id)},{rowKey:"primary_email",icon:Rs,label:r.summaryEmail,value:p.value??"-",fieldKey:"primary_email",copyValue:p.value,linkHref:gt(p.value,!1)},{rowKey:"primary_phone",icon:Ps,label:r.summaryPhone,value:l.value??"-",fieldKey:"primary_phone",copyValue:l.value,linkHref:Rn(l.value)},{rowKey:"contacted_at",icon:Es,label:r.summaryLastContact,value:g}],k=[{sectionKey:"email",title:r.sectionEmail,emptyText:r.sectionEmailEmpty,entries:z,recommendedKey:p.fieldKey??null,resolveHref:S=>gt(S!=null?String(S):null,!1)},{sectionKey:"phone",title:r.sectionPhone,emptyText:r.sectionPhoneEmpty,entries:y,recommendedKey:l.fieldKey??null,resolveHref:S=>Rn(S!=null?String(S):null)}],H=[{value:"summary",label:r.detailTabSummary,content:ve("div",{className:"flex flex-col gap-4",children:[ve("div",{className:"flex flex-col gap-1",children:[ve("div",{className:`flex items-center gap-2 ${s.fgMuted} text-sm`,children:[R(Ms,{size:16}),R("span",{children:R(Ne,{text:re(e.company_name),query:n??"",enabled:a})})]}),v.length>0?R("div",{className:`${s.fgMuted} text-sm`,children:v.map((S,L)=>ve("span",{children:[L>0&&" / ",R(Ne,{text:S,query:n??"",enabled:a})]},`header-line-${L}`))}):null]}),R("div",{className:"flex flex-col gap-3",children:C.map(S=>R(Ws,{icon:S.icon,label:S.label,value:S.value,fieldKey:S.fieldKey,copyValue:S.copyValue,onCopy:b,isCopied:S.fieldKey?u===S.fieldKey:!1,linkHref:S.linkHref,searchTerm:n,enableHighlighting:a},S.rowKey))})]})},{value:"basic",label:r.detailTabBasic,content:ve("div",{className:"flex flex-col gap-3",children:[R(ra,{title:r.detailBasicProfile}),R(io,{items:U,searchTerm:n,enableHighlighting:a})]})},{value:"contact",label:r.detailTabContact,content:R("div",{className:"flex flex-col gap-4",children:k.map(({sectionKey:S,title:L,emptyText:oe,entries:F,recommendedKey:be,resolveHref:ie})=>ve("div",{className:"flex flex-col gap-2",children:[R(ra,{title:L}),F.length===0?R("p",{className:`${s.fgMuted} text-xs`,children:oe}):R("div",{className:"flex flex-col gap-2",children:F.map(W=>{let O=ie(W.rawValue),q=W.fieldKey===be;return ve("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${I.borderSubtle} ${M.surface} px-3 py-2 transition-colors`,children:[ve("div",{className:"min-w-0 flex-1",children:[R("div",{className:`font-medium ${s.fgMuted} text-xs`,children:W.label}),R("div",{className:`wrap-break-word ${s.fg} text-sm`,children:O?R("a",{href:O,className:`text-inherit ${cn}`,children:R(Ne,{text:W.value,query:n??"",enabled:a})}):R(Ne,{text:W.value,query:n??"",enabled:a})})]}),q?ve("span",{className:`inline-flex shrink-0 items-center gap-1 rounded-full ${X.emerald} px-2 py-0.5 font-semibold ${w} ${m.emerald} transition-colors`,children:[R(Ns,{size:14}),r.preferred]}):null]},W.fieldKey)})})]},S))})},{value:"meta",label:r.detailTabMeta,content:ve("div",{className:"flex flex-col gap-3",children:[R(ra,{title:r.detailTabMeta}),R(io,{items:h,searchTerm:n,enableHighlighting:a})]})}];return ve("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${I.borderSubtle} ${M.surface} shadow-sm transition-colors ${o}`.trim(),style:f,children:[R("div",{className:`${I.borderSubtle} border-b px-3 py-1.5 transition-colors ${M.subtle}`,children:ve("div",{className:"flex items-center gap-2",children:[R("div",{className:`flex h-8 w-8 items-center justify-center rounded-full ${X.blue} ${m.blue} transition-colors`,children:R(_s,{size:16})}),ve("div",{className:"min-w-0 flex-1",children:[R("div",{className:`truncate font-semibold ${s.fg} text-sm`,children:R(Ne,{text:N,query:n??"",enabled:a})}),R("div",{className:`truncate ${w} ${s.fgMuted}`,children:R(Ne,{text:T,query:n??"",enabled:a})})]})]})}),ve(lr,{defaultValue:"summary",className:"flex flex-1 flex-col overflow-hidden",children:[R(On,{className:`grid h-auto grid-cols-4 gap-1 rounded-none ${I.borderSubtle} border-b ${M.subtle} px-2 py-1 transition-colors`,children:H.map(S=>R(Vt,{value:S.value,className:`flex min-h-11 min-w-0 touch-manipulation rounded-md px-1 py-1 font-semibold ${s.fgSecondary} ${x} transition-colors ${E.activeTabSurface} ${E.activeTabBlueFg}`,children:R("span",{className:"min-w-0 truncate",children:S.label})},S.value))}),H.map(S=>R(Kt,{value:S.value,className:`scrollbar-thin flex-1 overflow-y-auto px-2.5 py-2 transition-colors ${s.fgSecondary}`,style:Fs[t],children:S.content},S.value))]})]})};Bt();ge();de();import{memo as Is}from"react";import{jsx as Rt,jsxs as aa}from"react/jsx-runtime";var oa=Is(({recordCount:e,companyCount:t,phase:n,loadedCount:a,totalCount:i})=>{let{locale:o,labels:r}=Pe(),u=ne(o,e),d=ne(o,t);return aa("div",{"data-testid":"contact-map-annotation",className:"flex flex-wrap items-center gap-2 leading-1 transition-colors",children:[aa("span",{className:"flex items-baseline gap-1",children:[Rt("span",{className:s.fgMuted,children:r.annotationTotalLabel}),Rt("span",{className:s.fg,"data-testid":"contact-map-record-count",children:u}),Rt("span",{className:s.fgMuted,children:r.recordUnit(u)})]}),aa("span",{className:"flex items-baseline gap-1",children:[Rt("span",{className:s.fgMuted,children:r.annotationCompaniesLabel}),Rt("span",{className:s.fg,"data-testid":"contact-map-company-count",children:d}),Rt("span",{className:s.fgMuted,children:r.companyUnit(d)})]}),n==="streaming"||n==="idle"?Rt("span",{"data-testid":"contact-map-stream-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${X.blue} px-2 py-0.5 font-medium ${m.blue} text-xs`,children:i!==null&&i>0?r.annotationStreamingProgress({loaded:a,total:i,percent:Math.min(100,Math.round(a/i*100))}):r.annotationStreamingCount(a)}):null,n==="retrying"?Rt("span",{"data-testid":"contact-map-reconnecting-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${X.amber} px-2 py-0.5 font-medium ${m.amber} text-xs`,children:r.annotationReconnecting(a)}):null]})});oa.displayName="ContactMapAnnotation";sn();import{useMemo as fi}from"react";Lt();var dr=e=>e==="unauthenticated"||e==="forbidden";function ur(e,t){if(typeof e!="function")throw new TypeError(`[contact-map] ${t} must be the host's access failure presenter (a function, AccessFailurePresenter of @aiquants/auth-core); got ${ee(e)}`)}function so(e,t){if(typeof e!="number")throw new TypeError(`[contact-map] ${t} must be the stream's accessFailureNumber (a number); got ${ee(e)}`);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`[contact-map] ${t} must be a non-negative safe integer (the stream's accessFailureNumber); got ${ee(e)}`)}Lt();sn();ge();import{createContext as zs,useContext as Us,useMemo as Vs}from"react";Lt();sn();Dr();var Bs=["indexWorker","levenshteinWorker","treeWorker"];function lo(e,t,n){if(n!==void 0){if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string or left out (pass url.href for a URL object); got ${ee(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${ee(n)}`)}}var co={setting:"workerUrls"},uo=(e,t)=>{if(e===void 0)return;let{setting:n,keys:a=Bs,hints:i={}}=t;if(!on(e))throw new TypeError(`[contact-map] ${n} must be a plain object or left out; got ${ee(e)}`);let o=Object.getOwnPropertyNames(e).map(d=>({key:d,url:e[d]})),r=o.find(({key:d,url:c})=>c!==void 0&&!a.includes(d));if(r!==void 0){let d=Object.hasOwn(i,r.key)?i[r.key]:void 0,c=d===void 0?qn(r.key,a):void 0;throw new RangeError(`[contact-map] ${n} has a key it does not take (it takes ${a.join(", ")}${d===void 0?"":`; ${d}`}${c===void 0?"":`; did you mean ${JSON.stringify(c)}?`}); got ${ee(r.key)}`)}let u=Object.create(null);for(let{key:d,url:c}of o){let f=d;lo(n,f,c),c!==void 0&&(u[f]=c)}return u};function Nm(e,t=co){uo(e,t)}function mo(e){lo("workerUrls","treeWorker",e)}var gn=(e,t,n=co)=>{let a=uo(t,n);return{indexWorker:a?.indexWorker===void 0?e?.indexWorker:a.indexWorker,levenshteinWorker:a?.levenshteinWorker===void 0?e?.levenshteinWorker:a.levenshteinWorker,treeWorker:a?.treeWorker===void 0?e?.treeWorker:a.treeWorker}};import{jsx as ia}from"react/jsx-runtime";var po=e=>{if(!on(e))throw new TypeError(`[contact-map] config must be a plain object; got ${ee(e)}`);let t=e;return{streamEndpoint:Le(t,"streamEndpoint"),openEmailsWithGmail:Le(t,"openEmailsWithGmail"),treeWorkerFactory:Le(t,"treeWorkerFactory"),workerUrls:gn(void 0,Le(t,"workerUrls")),locale:Le(t,"locale"),labels:Le(t,"labels")}},fo=({workerUrls:e,...t})=>{let{indexWorker:n,levenshteinWorker:a,treeWorker:i}=e;return Object.freeze(Object.assign(Object.create(null),t,{workerUrls:Object.freeze({indexWorker:n,levenshteinWorker:a,treeWorker:i})}))},Ks=fo(po({})),go=zs(Ks),js=Object.freeze({locale:"locale",labels:"labels"});function sa({config:e,chromeSurface:t,children:n}){let{streamEndpoint:a,openEmailsWithGmail:i,treeWorkerFactory:o,workerUrls:r,locale:u,labels:d}=po(e),{indexWorker:c,levenshteinWorker:f,treeWorker:p}=r,l=Vs(()=>fo({streamEndpoint:a,openEmailsWithGmail:i,treeWorkerFactory:o,workerUrls:{indexWorker:c,levenshteinWorker:f,treeWorker:p},locale:u,labels:d}),[a,i,o,c,f,p,u,d]);return ia(go.Provider,{value:l,children:ia(Fa,{locale:u,labels:d,surface:t,children:n})})}function Gs({config:e,children:t}){return ia(sa,{config:e,chromeSurface:js,children:t})}function bt(){return Us(go)}import{useCallback as la,useEffect as el,useMemo as fr,useSyncExternalStore as ho}from"react";Lt();import{accessFailureKindOfStatus as qs}from"@aiquants/auth-core";var Ys=1e3,Xs=3e4,Qs=6;function pr(e){if(typeof e!="string")throw new TypeError(`[contact-map] streamEndpoint must be a same-origin absolute path such as "/api/contact_map/stream", set on ContactMapConfigProvider or ContactMapAppView; got ${ee(e)}`);if(/[\s\p{Cc}#]/u.test(e))throw new RangeError(`[contact-map] streamEndpoint must not contain whitespace, control characters or "#"; got ${ee(e)}`);if(!e.startsWith("/")||e.startsWith("//")||e.startsWith("/\\"))throw new RangeError(`[contact-map] streamEndpoint must be a same-origin absolute path such as "/api/contact_map/stream"; got ${ee(e)}`)}var Js=e=>({...e,contacted_at:e.contacted_at?new Date(e.contacted_at):null,created_at:e.created_at?new Date(e.created_at):void 0,updated_at:e.updated_at?new Date(e.updated_at):void 0}),Zs=e=>Array.isArray(e.records),mr=class{constructor(t){this.recordMap=new Map;this.listeners=new Set;this.lastCursor=null;this.consecutiveFailures=0;this.started=!1;this.disposed=!1;this.activeController=null;this.wakeRetryWait=null;this.state={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null,accessFailureNumber:0};this.handleOnline=()=>{this.wakeRetryWait?.()};pr(t.endpoint),this.fetchFn=t.fetchFn??((...n)=>fetch(...n)),this.endpoint=t.endpoint,this.initialRetryDelayMs=t.initialRetryDelayMs??Ys,this.maxRetryDelayMs=t.maxRetryDelayMs??Xs,this.maxConsecutiveFailures=t.maxConsecutiveFailures??Qs,this.logger=t.logger??lt}getState(){return this.state}getRecordMap(){return this.recordMap}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}start(){this.started||this.disposed||(this.started=!0,typeof window<"u"&&window.addEventListener("online",this.handleOnline),this.runStreamLoop())}retryNow(){if(!this.disposed)switch(this.state.phase){case"retrying":this.wakeRetryWait?.();return;case"failed":case"unauthenticated":case"forbidden":this.consecutiveFailures=0,this.setState({error:null,isLoading:this.recordMap.size===0}),this.runStreamLoop();return;case"idle":case"streaming":case"complete":return}}dispose(){this.disposed=!0,this.activeController?.abort(),this.wakeRetryWait?.(),typeof window<"u"&&window.removeEventListener("online",this.handleOnline)}setState(t){this.state={...this.state,...t};for(let n of this.listeners)n(this.state)}publishRecords(t={}){let n=Array.from(this.recordMap.values());this.setState({records:n,loadedCount:n.length,isLoading:!1,...t})}async runStreamLoop(){this.setState({phase:"streaming"});let t=!1;for(;!this.disposed;){let n=this.lastCursor!==null,a=await this.streamOnce();if(a==="aborted")return;if(a==="complete"){this.publishRecords({isComplete:!0,phase:"complete",error:null});return}if(typeof a=="object"){this.setState({phase:a.accessFailure,isLoading:!1,error:null,accessFailureNumber:this.state.accessFailureNumber+1});return}if(a==="rejected"){if(n&&!t){t=!0,this.lastCursor=null,this.logger.warn("[ContactMapStream] the server rejected the resume cursor (400); restarting from the beginning");continue}this.setState({phase:"failed",isLoading:!1,error:new Error("[contact-map] the server rejected the stream request (400); reload the page")});return}if(this.consecutiveFailures+=1,this.consecutiveFailures>=this.maxConsecutiveFailures){this.setState({phase:"failed",isLoading:!1});return}let i=Math.min(this.initialRetryDelayMs*2**(this.consecutiveFailures-1),this.maxRetryDelayMs);if(this.setState({phase:"retrying",isLoading:this.recordMap.size===0}),this.logger.warn(`[ContactMapStream] retrying in ${i}ms (attempt ${this.consecutiveFailures})`),await this.waitBeforeRetry(i),this.disposed)return;this.setState({phase:"streaming"})}}waitBeforeRetry(t){return new Promise(n=>{let a=setTimeout(()=>{this.wakeRetryWait=null,n()},t);this.wakeRetryWait=()=>{clearTimeout(a),this.wakeRetryWait=null,n()}})}buildStreamUrl(){if(!this.lastCursor)return this.endpoint;let t=this.endpoint.includes("?")?"&":"?",n=new URLSearchParams;return this.lastCursor.contacted_at!==null&&n.set("cursor_contacted_at",this.lastCursor.contacted_at),n.set("cursor_person_id",String(this.lastCursor.person_id)),`${this.endpoint}${t}${n.toString()}`}async streamOnce(){this.activeController=new AbortController;try{let t=await this.fetchFn(this.buildStreamUrl(),{signal:this.activeController.signal,credentials:"same-origin"}),n=qs(t.status);if(n!==null)return{accessFailure:n};if(t.status===400)return"rejected";if(!(t.ok&&t.body))return this.logger.warn(`[ContactMapStream] unexpected response: ${t.status}`),this.setState({error:new Error(`[contact-map] the stream request failed (status ${t.status})`)}),"retryable";let a=t.body.getReader(),i=new TextDecoder,o="",r=!1,u=!1;for(;;){let{done:d,value:c}=await a.read();if(d)break;let f=i.decode(c,{stream:!0}),p=(o+f).split(`
|
|
2
|
-
`);o=p.pop()??"";let l=!1;for(let g of p){let b=g.trim();if(!b)continue;let v;try{v=JSON.parse(b)}catch(T){this.logger.warn("[ContactMapStream] failed to parse NDJSON line:",T);continue}if("type"in v&&v.type==="METADATA"){Number.isSafeInteger(v.total)&&v.total>=0&&this.setState({totalCount:v.total});continue}if(!Zs(v)){this.logger.warn("[ContactMapStream] server reported error:","error"in v?v.error:""),u=!0;continue}for(let T of v.records)T&&typeof T.person_id=="number"&&(this.recordMap.set(T.person_id,Js(T)),l=!0);v.nextCursor&&(this.lastCursor=v.nextCursor),v.isLast&&(r=!0)}l&&(this.consecutiveFailures=0,this.publishRecords({error:null}))}return u?(this.setState({error:new Error("Stream interrupted by server error")}),"retryable"):r?"complete":(this.setState({error:new Error("Stream ended before completion")}),"retryable")}catch(t){if(t instanceof Error&&t.name==="AbortError")return"aborted";let n=t instanceof Error?t:new Error(String(t));return this.setState({error:n}),"retryable"}finally{this.activeController=null}}};var Qe=null,tl=e=>{if(Qe!==null&&Qe.endpoint===e)return Qe;if(pr(e),Qe===null)return Qe=new mr({endpoint:e}),Qe;if(Qe.endpoint!==e)throw new Error(`[contact-map] the stream client already streams from ${JSON.stringify(Qe.endpoint)} and cannot also stream from ${JSON.stringify(e)}; give every contact-map view in the browser tab the same streamEndpoint, on every route (after changing it, reload the page)`);return Qe},Bm=()=>{Qe?.dispose(),Qe=null},nl=new Map,rl={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null,accessFailureNumber:0},al=()=>{let{streamEndpoint:e}=bt();return fr(()=>(pr(e),e),[e])};function ol(){let e=al(),t=la(()=>tl(e),[e]);el(()=>{let r=t();r.start(),r.retryNow()},[t]);let n=la(r=>t().subscribe(r),[t]),a=ho(n,()=>t().getState(),()=>rl),i=ho(n,()=>t().getRecordMap(),()=>nl),o=la(()=>t().retryNow(),[t]);return fr(()=>({...a,recordMap:i,retryNow:o}),[a,i,o])}var il=e=>{let t=new Set;for(let{company_name:n}of e)typeof n=="string"&&n.trim().length>0&&t.add(n);return t.size};function gr(){let{records:e,recordMap:t,isComplete:n,phase:a,loadedCount:i,totalCount:o,error:r,accessFailureNumber:u,retryNow:d}=ol(),c=fr(()=>il(e),[e]);return{context:fr(()=>({contactMapRecords:e,contactMapRecordMap:t,isStreamingComplete:n,isStreamingFailed:a==="failed"||dr(a),streamPhase:a,streamAccessFailureNumber:u,loadedCount:i,companyCount:c,totalCount:o,errorMessage:r?.message??null}),[e,t,n,a,u,i,c,o,r]),retryNow:d}}ge();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Bc,parseQuerySets as zc}from"@aiquants/fuzzy-search";import{useFuzzySearch as Uc}from"@aiquants/fuzzy-search/react";import Vc from"lucide-react/dist/esm/icons/search.js";import{useCallback as xn,useEffect as Ct,useMemo as _t,useRef as oi,useState as et,useTransition as Kc}from"react";import{useNavigation as jc,useSearchParams as Gc}from"react-router";Jr();sn();import{useCallback as jt,useEffect as sl,useRef as yo}from"react";var Pt=e=>{let t=yo(null),n=yo({isPointerDown:!1,isDragging:!1,startX:0,scrollLeft:0,pointerId:0,hasCapture:!1,didDrag:!1,pointerType:""}),a=e?.dragThreshold??4,i=jt(p=>{let l=p.currentTarget,g=p.deltaY;!l||g===0||(p.preventDefault(),l.scrollBy({left:g,behavior:"smooth"}))},[]),o=jt(p=>{t.current?.removeEventListener("wheel",i),t.current=p,p?.addEventListener("wheel",i,{passive:!1})},[i]);sl(()=>()=>{t.current&&t.current.removeEventListener("wheel",i)},[i]);let r=jt(p=>{if(p.pointerType==="touch")return;let l=n.current;l.isPointerDown=!0,l.isDragging=!1,l.startX=p.clientX,l.scrollLeft=p.currentTarget.scrollLeft,l.pointerId=p.pointerId,l.hasCapture=!1,l.pointerType=p.pointerType},[]),u=jt(p=>{let l=n.current;if(!l.isPointerDown||l.pointerType==="touch")return;let g=p.currentTarget,b=p.clientX-l.startX;!l.isDragging&&Math.abs(b)>a&&(l.isDragging=!0,l.hasCapture||(g.setPointerCapture?.(p.pointerId),l.hasCapture=!0)),l.isDragging&&(p.preventDefault(),g.scrollLeft=l.scrollLeft-b)},[a]),d=jt(p=>{let l=n.current;if(l.pointerType==="touch")return;let g=p.currentTarget;l.isPointerDown&&l.hasCapture&&g.hasPointerCapture?.(p.pointerId)&&g.releasePointerCapture(p.pointerId),l.isDragging&&(l.didDrag=!0,window.setTimeout(()=>{l.didDrag=!1},0)),l.isPointerDown=!1,l.isDragging=!1,l.pointerId=0,l.hasCapture=!1},[]),c=jt(p=>{d(p)},[d]),f=jt(p=>{n.current.didDrag&&(p.preventDefault(),p.stopPropagation(),n.current.didDrag=!1)},[]);return{setScrollableRef:o,onPointerDown:r,onPointerMove:u,onPointerUp:c,onPointerLeave:c,onPointerCancel:c,onClickCapture:f}};Bt();ge();import{DEFAULT_FUZZY_SEARCH_OPTIONS as ll}from"@aiquants/fuzzy-search";var hr=e=>{let{indexWorkerOptions:t,levenshteinWorkerOptions:n,...a}=ll;return{...a,autoSearchOnIndexRebuild:!1,multiTermOperator:"and",workerUrls:e,indexWorkerOptions:{...t},levenshteinWorkerOptions:{...n}}};de();de();_n();import{jsx as bo}from"react/jsx-runtime";function So({value:e,max:t=100,className:n,indicatorClassName:a,...i}){let o=e===void 0,r=o?0:Math.min(100,Math.max(0,e/t*100));return bo("div",{role:"progressbar","aria-valuenow":o?void 0:r,"aria-valuemin":0,"aria-valuemax":100,"data-slot":"progress",className:ke(`relative h-2 w-full overflow-hidden rounded-full ${kt.progressTrack}`,n),...i,children:bo("div",{"data-slot":"progress-indicator",className:ke(`h-full rounded-full ${qe.blue} transition-[width] duration-300 ease-in-out will-change-transform`,o&&"w-1/3 animate-progress-indeterminate",a),style:o?void 0:{width:`${r}%`}})})}Ee();var hn="view";import{useCallback as Lc,useState as kc}from"react";import{useSearchParams as wc}from"react-router";ge();de();Ee();Ft();import{Panel as Lo,PanelGroup as Pl,PanelResizeHandle as _l}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as Al,VirtualScroll as $l,virtualScrollItemElementId as Ol}from"@aiquants/virtualscroll";import{lazy as Dl,memo as Wl,Suspense as Hl,useCallback as Ie,useEffect as $o,useId as ko,useLayoutEffect as Oo,useMemo as Gt,useRef as yn,useState as Hn}from"react";var Dn={listPanelMinWidth:320,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35},Wn={listPanelMinWidth:280,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35};function yr(e){let t=e.listPanelMinWidth+e.detailPanelMinWidth+e.handleThickness+e.listPaddingAndBorder+e.detailPaddingAndBorder,n=t+e.scrollbarSafetyBuffer,a=n+e.hysteresisSafetyMargin,i=a-n;return{physicalMinWidth:t,collapseThreshold:n,expandThreshold:a,hysteresisWidth:i}}import{useCallback as cl,useEffect as dl,useState as ul}from"react";var Co=(e,t)=>{let{enableMutationObserver:n=!1,bottomGap:a=4,minFallbackHeight:i=240}=t??{},[o,r]=ul(600),u=cl(()=>{if(typeof window>"u")return;let d=e.current;if(!d||d.offsetParent===null&&window.getComputedStyle(d).position!=="fixed")return;let c=L=>Number.parseFloat(L)||0,{top:f}=d.getBoundingClientRect(),p=d.parentElement?.getBoundingClientRect(),l=window.getComputedStyle(document.documentElement),g=c(l.getPropertyValue("--footer-height")),b=c(l.getPropertyValue("--header-height")),v=c(l.getPropertyValue("--scrollbar-height")),T=window.getComputedStyle(d),N=c(T.marginBottom),U=c(T.paddingBottom),z=window.innerHeight-g-v-a,y=p?Math.min(p.bottom,z):z,h=p?Math.max(p.top,b):b,C=Math.max(f,h),k=y-C-N-U,H=Number.isFinite(k)?Math.floor(k):0,S=H>0?H:i;S>0&&Number.isFinite(S)&&r(L=>Math.abs(L-S)>1?S:L)},[a,e,i]);return dl(()=>{if(typeof window>"u")return;let d=null,c=null,f=null,p=null,l=()=>{d!==null&&window.cancelAnimationFrame(d),d=window.requestAnimationFrame(()=>{u()})};l(),c=window.setTimeout(()=>{l()},150);let g=e.current;return typeof ResizeObserver<"u"&&g&&(f=new ResizeObserver(()=>{l()}),f.observe(g),g.parentElement&&f.observe(g.parentElement)),n&&typeof MutationObserver<"u"&&(p=new MutationObserver(()=>{l()}),p.observe(document.body,{attributes:!0,childList:!0,subtree:!0})),window.addEventListener("resize",l),()=>{d!==null&&window.cancelAnimationFrame(d),c!==null&&window.clearTimeout(c),f&&f.disconnect(),p&&p.disconnect(),window.removeEventListener("resize",l)}},[e,n,u]),{viewportHeight:o,updateViewportHeight:u}};import{useCallback as St,useEffect as vo,useRef as br,useState as xo}from"react";var ml=600,To=8,Sr=({ref:e,onSelect:t,resolveItem:n,item:a})=>{let[i,o]=xo(!1),[r,u]=xo(null),d=br(null),c=br(!1),f=br(null),p=br({onSelect:t,resolveItem:n,item:a});vo(()=>{p.current={onSelect:t,resolveItem:n,item:a}},[t,n,a]);let l=St(()=>{typeof window>"u"||d.current!==null&&(window.clearTimeout(d.current),d.current=null)},[]),g=St(()=>{f.current&&(l(),f.current=null)},[l]),b=St(h=>{typeof window>"u"||h.button!==0&&h.pointerType==="mouse"||(l(),c.current=!1,f.current={x:h.clientX,y:h.clientY,pointerId:h.pointerId},d.current=window.setTimeout(()=>{let C=p.current,k=null;C.item!==void 0?k=C.item:C.resolveItem&&h.target&&(k=C.resolveItem(h.target)),k!==null&&(c.current=!0,C.onSelect?.(k),u(k),o(!0)),g()},ml))},[l,g]),v=St(h=>{f.current&&h.pointerId===f.current.pointerId&&(l(),f.current=null)},[l]),T=St(h=>{c.current&&(h.preventDefault(),h.stopPropagation(),h.type==="click"&&(c.current=!1))},[]),N=St(()=>{c.current=!1},[]),U=St(h=>{if(!f.current||h.pointerId!==f.current.pointerId)return;let C=Math.abs(h.clientX-f.current.x),k=Math.abs(h.clientY-f.current.y);(C>To||k>To)&&(l(),f.current=null)},[l]),z=St(h=>{(i||d.current!==null)&&(h.preventDefault(),h.stopPropagation())},[i]),y=St(()=>{o(!1),u(null),c.current=!1,f.current=null},[]);return vo(()=>{let h=e.current;if(!(h&&typeof window<"u"))return;let C=[["pointerdown",b,void 0],["pointerup",v,void 0],["pointercancel",v,void 0],["pointermove",U,void 0],["pointerleave",v,void 0],["contextmenu",z,void 0]],k=[["mousedown",T,!0],["mouseup",T,!0],["click",T,!0],["pointerdown",N,!0],["keydown",N,!0],["contextmenu",z,!0],["pointerup",v,!0],["pointercancel",v,!0]];for(let[H,S,L]of C)h.addEventListener(H,S,L);for(let[H,S,L]of k)window.addEventListener(H,S,L);return()=>{for(let[H,S,L]of C)h.removeEventListener(H,S,L);for(let[H,S,L]of k)window.removeEventListener(H,S,L);l()}},[e,b,v,U,T,N,z,l]),{isPopupVisible:i,popupItem:r,handleClosePopup:y}};import{useCallback as pl,useEffect as fl,useState as No,useSyncExternalStore as gl}from"react";function Cr(e,t,n){let a=n?.mediaQuery??"(min-width: 1024px)",i=gl(pl(f=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let p=window.matchMedia(a);return p.addEventListener("change",f),()=>p.removeEventListener("change",f)},[a]),()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(a).matches:!0,()=>!1),[o,r]=No(!1),[u,d]=No(0);return fl(()=>{if(typeof window>"u"||typeof ResizeObserver>"u")return;let f=e.current;if(!f)return;let p=new ResizeObserver(l=>{for(let g of l){if(g.target!==f)continue;let b=0;g.borderBoxSize&&g.borderBoxSize.length>0?b=g.borderBoxSize[0].inlineSize:b=g.contentRect.width,!(!Number.isFinite(b)||b<=0)&&(d(b),r(v=>v&&b>=t.expandThreshold?!1:!v&&b<t.collapseThreshold?!0:v))}});return p.observe(f),()=>p.disconnect()},[e,t.collapseThreshold,t.expandThreshold]),{isTwoColumn:i&&!o,isContainerNarrow:o,isMediaMatches:i,containerWidth:u}}ge();Lt();var Mo=e=>e.isComposing||e.keyCode===229;var Eo=(e,t)=>{if(bl(t),e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||Mo(e)||t.itemCount===0)return null;if(e.key==="Enter"||e.key===" ")return{kind:"activate"};let n=t.itemCount-1;if(t.activeIndex===null)return yl(e.key)?{kind:"move",index:t.startIndex,direction:1}:null;let a=t.activeIndex;switch(e.key){case"ArrowDown":return{kind:"move",index:Math.min(a+1,n),direction:1};case"ArrowUp":return{kind:"move",index:Math.max(a-1,0),direction:-1};case"PageDown":return{kind:"move",index:Math.min(a+t.pageSize,n),direction:1};case"PageUp":return{kind:"move",index:Math.max(a-t.pageSize,0),direction:-1};case"Home":return{kind:"move",index:0,direction:1};case"End":return{kind:"move",index:n,direction:-1};default:return null}},hl=new Set(["ArrowDown","ArrowUp","PageDown","PageUp","Home","End"]),yl=e=>hl.has(e),bl=e=>{let{activeIndex:t,startIndex:n,itemCount:a,pageSize:i}=e;if(!Number.isInteger(a)||a<0)throw new RangeError(`[contact-map] listbox itemCount must be a non-negative integer; got ${ee(a)}`);if(!Number.isInteger(i)||i<1)throw new RangeError(`[contact-map] listbox pageSize must be an integer of at least 1; got ${ee(i)}`);let o=r=>Number.isInteger(r)&&r>=0&&r<a;if(a>0&&!o(n))throw new RangeError(`[contact-map] listbox startIndex must be an index below ${a}; got ${ee(n)}`);if(t!==null&&!o(t))throw new RangeError(`[contact-map] listbox activeIndex must be null or an index below ${a}; got ${ee(t)}`)};de();ge();jr();de();dn();_n();import{SWIPE_OVERLAY_SCROLL_AREA_STYLE as Sl,useOverlayPresence as Cl,useSwipeOverlayDialog as vl}from"@aiquants/swipe-overlay";import{useCallback as xl,useId as Tl}from"react";import{jsx as vr,jsxs as ca}from"react/jsx-runtime";var Nl=ke(Xn,"flex overflow-hidden"),Ml=ke(Jn,"motion-safe:transition-opacity motion-safe:duration-200"),El=`relative ml-auto flex h-full w-full max-w-lg flex-col ${M.surface} shadow-xl motion-safe:transition-[transform] motion-safe:duration-200 motion-safe:ease-out`,Ll=`flex shrink-0 items-center justify-between gap-3 ${I.borderSubtle} border-b px-3 py-2`,kl=`min-w-0 truncate font-semibold text-base ${s.fg} outline-none`,wl=`inline-flex min-h-11 min-w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border ${I.borderControl} px-4 font-medium ${s.fgSecondary} text-sm ${E.hoverMuted} ${st}`,Rl="flex min-h-0 flex-1 flex-col overflow-y-auto p-3",xr=({isOpen:e,onClose:t,children:n,className:a,title:i})=>{let o=Q(),r=Tl(),u=Cl(e),d=xl(b=>b.ownerDocument.getElementById(r),[r]),{dialogProps:c,backdropProps:f,panelProps:p,attemptClose:l,isSwiping:g}=vl({isOpen:e,onClose:t,isCloseBlocked:Zn,skipWhenTextSelected:!0,initialFocus:d});return u?ca("dialog",{...c,"data-testid":"contact-map-mobile-overlay","aria-labelledby":r,className:ke(Nl,e&&!g?"pointer-events-auto":"pointer-events-none"),style:Qn,children:[vr("div",{...f,"data-contact-map-overlay-backdrop":"",className:ke(Ml,e?"opacity-100":"opacity-0")}),ca("div",{...p,"data-contact-map-overlay-panel":"",className:ke(El,e?"pointer-events-auto":"pointer-events-none",a),children:[ca("div",{className:Ll,children:[vr("h2",{id:r,tabIndex:-1,className:kl,children:i===void 0?o.overlayTitle:i}),vr("button",{type:"button",className:wl,onClick:()=>l(),children:o.close})]}),vr("div",{"data-contact-map-overlay-body":"",className:Rl,style:Sl,children:n})]})]}):null};dn();Ee();Xr();import{Fragment as Jl,jsx as K,jsxs as Je}from"react/jsx-runtime";var Fl=Dl(async()=>({default:(await Promise.resolve().then(()=>(ro(),no))).default})),da=64,wo="h-[64px]",Ro=240,Il=4,ua=yr(Dn),Bl=Dn.listPanelMinWidth,zl=Dn.detailPanelMinWidth,Ul=Dn.handleThickness,$p=ua.collapseThreshold,Op=ua.expandThreshold,Vl=({contactData:e})=>{let t=Q(),n=Ge(e?.full_name)??t.noName,a=Ge(e?.title)??"-",i=Ge(e?.company_name)??"-",o=Ge(e?.department)??"-",r=rn(e).value??"-",u=an(e).value??"-",d=at(e?.updated_at,t.recordDateTime);return K(nr,{fullName:n,title:a,companyName:i,department:o,phoneNumber:u,email:r,updatedAtText:d})},Kl=e=>({"--contact-panel-height":`${e}px`}),jl=e=>typeof e=="object"&&e!==null&&"item"in e,Gl=(e,t)=>t!==void 0?`${e}:${t.toFixed(3)}`:void 0,ql=(e,t)=>{for(let n of e){let a=Ht(n);if(a?.person_id===t)return a}return null},Po=(e,t)=>t!==null&&Ht(e)?.person_id===t,_o=(e,t,n)=>{for(let a=t;a>=0&&a<e.length;a+=n){let i=Ht(e[a]);if(i!==null)return{index:a,personId:i.person_id}}return null},Ao=(e,t,n)=>{let a=_o(e,t,n);return a!==null?a:_o(e,t-n,n===1?-1:1)},ma=(e,t,n)=>{let{viewportHeight:a}=Co(t,{enableMutationObserver:!0,bottomGap:Il,minFallbackHeight:Ro}),[i,o]=Hn(0),r=Ie(()=>{let p=n.current,l=t.current;if(!(p&&l))return;let g=p.getBoundingClientRect(),b=l.getBoundingClientRect(),v=Math.ceil(b.top-g.top);Number.isFinite(v)&&v>0&&o(T=>Math.abs(T-v)>1?v:T)},[t,n]);Oo(()=>{if(!e)return;r();let p=requestAnimationFrame(r);return window.addEventListener("resize",r),()=>{cancelAnimationFrame(p),window.removeEventListener("resize",r)}},[e,r]);let u=a>0?a:Ro,d=i>0?i:0,c=u+d,f=Gt(()=>Kl(c),[c]);return{normalizedViewportHeight:u,normalizedDetailHeight:c,panelSizingStyle:f}},Yl=new Set,Xl=()=>{let[e,t]=Hn(Yl),n=Ie((a,i)=>{t(o=>{if(o.has(a)===i)return o;let r=new Set(o);return i?r.add(a):r.delete(a),r})},[]);return{isAnyPopupVisible:e.size>0,handlePopupVisibilityChange:n}},Ql=(e,t,n)=>{let a=yn(n);Oo(()=>{a.current=n},[n]),$o(()=>{if(e!==null)return a.current(e,t),()=>{a.current(e,!1)}},[e,t])},Do=Wl(({entry:e,index:t,itemCount:n,listboxId:a,isSelected:i,isActive:o,onSelect:r,onLongPressSelect:u,searchQuery:d,enableHighlighting:c,openEmailsWithGmail:f,openGmailCompose:p,onPopupVisibilityChange:l})=>{let g=Q(),b=yn(null),v=K("div",{className:wo}),T=jl(e)?e:null,N=Ht(e),{isPopupVisible:U,handleClosePopup:z}=Sr({ref:b,onSelect:u,item:N?.person_id});if(Ql(N?.person_id??null,U,l),!e||!N)return v;let{person_id:y}=N,h=t%2===0?M.surface:M.subtle,C=`${X.blue} ring-1 ${E.selectedRing}`,k=i?C:h,H=["B","F"].map(S=>Gl(S,S==="B"?T?.baseScore:T?.score)).filter(Boolean);return Je("div",{ref:b,id:Ol(a,y),className:`flex ${wo} w-full items-center overflow-hidden ${I.borderSubtle} border-b px-4 py-2 text-left transition-colors ${E.hoverBlueTint} ${k} ${Ua}`,style:{height:da},role:"option","aria-selected":i,"aria-posinset":t+1,"aria-setsize":n,"data-selected":i?"true":"false","data-contact-map-row-active":o?"":void 0,onClick:()=>r(y),children:[Je("div",{className:"hidden w-28 shrink-0 flex-col items-center gap-0.5 text-center sm:flex",children:[K("div",{className:`whitespace-nowrap font-medium ${s.fgSecondary} text-xs leading-tight`,children:g.listRowNumber(t+1)}),K("div",{className:`truncate ${wt} ${s.fgSecondary} leading-tight`,children:y}),K("div",{className:`flex items-center gap-1 whitespace-nowrap font-mono ${wt} ${s.fgMuted} leading-tight`,children:H.length?H.map(S=>K("span",{children:S},S)):K("span",{children:"-"})})]}),K(Hl,{fallback:K(Vl,{contactData:N}),children:K(Fl,{contactData:N,searchTerm:d,enableHighlighting:c,openEmailsWithGmail:f,openGmailCompose:p,isPopupVisible:U,onRequestClose:z})})]})});Do.displayName="ContactListRow";var Wo=({context:e})=>{let{contactMapRecords:t,filteredItems:n,searchQuery:a,hasSearchTerm:i,enableHighlighting:o,openEmailsWithGmail:r,isSearchTabActive:u}=e,{locale:d,labels:c,engineLabels:f}=Pe(),p=yn(null),l=yn(null),[g,b]=Hn(null),{normalizedViewportHeight:v,panelSizingStyle:T}=ma(u,l,p),{isAnyPopupVisible:N,handlePopupVisibilityChange:U}=Xl(),z=Gt(()=>({enablePointerDrag:!N,enableKeyboardNavigation:!1}),[N]),y=Gt(()=>i?n:t,[i,n,t]),[h,C]=Hn(null),k=Ie(Y=>{b(Y),C(Y)},[]),H=Ie(Y=>{if(!r)return;let ye=Y.trim();if(!ye||ye==="-"||typeof window>"u")return;let J=gt(ye,!0);J&&window.open(J,"_blank","noopener,noreferrer")},[r]),[S,L]=Hn(!1),oe=Ie(()=>L(!1),[]),F=Ie(Y=>{k(Y),L(!0)},[k]),be=ko(),ie=ko(),W=yn(null),O=y.length,q=Ie((Y,ye)=>K(Do,{entry:Y,index:ye,itemCount:O,listboxId:be,isSelected:Po(Y,g),isActive:Po(Y,h),onSelect:F,onLongPressSelect:k,searchQuery:a,enableHighlighting:o,openEmailsWithGmail:r,openGmailCompose:H,onPopupVisibilityChange:U}),[O,be,g,h,F,k,a,o,r,H,U]),pe=Gt(()=>{let Y=new Map;return y.forEach((ye,J)=>{let mt=Ht(ye);mt!==null&&Y.set(mt.person_id,J)}),Y},[y]),Se=h===null?null:pe.get(h)??null,$e=g===null?null:pe.get(g)??null,$t=Math.max(1,Math.floor(v/da)),Qt=Ie(Y=>{if(Y.target.id!==be)return;let ye=Eo(Y.nativeEvent,{activeIndex:Se,startIndex:$e===null?0:$e,itemCount:O,pageSize:$t});if(ye===null)return;if(Y.preventDefault(),ye.kind==="activate"){Se!==null&&h!==null&&F(h);return}let J=Ao(y,ye.index,ye.direction);J!==null&&(C(J.personId),W.current?.scrollToIndex(J.index,{align:"nearest"}))},[be,Se,$e,O,$t,h,F,y]),vt=Ie(Y=>{if(Y.target.id!==be||Se!==null||!Y.target.matches(":focus-visible"))return;let ye=Ao(y,$e===null?0:$e,1);ye!==null&&C(ye.personId)},[be,Se,$e,y]),Jt=Gt(()=>({id:be,role:"listbox",tabIndex:0,"aria-label":c.listboxLabel,"aria-describedby":ie}),[be,c.listboxLabel,ie]),Ce=Ie(Y=>y[Y],[y]),Zt=Ie(Y=>Ht(y[Y])?.person_id??`row-${Y}`,[y]),Ve=Ie(()=>da,[]),ut=Gt(()=>({enabled:!0,renderVisual:Al}),[]),Ke=Gt(()=>g===null?null:ql(y,g),[g,y]);$o(()=>{g!==null&&!Ke&&b(null)},[g,Ke]);let He=yn(null),{isTwoColumn:en}=Cr(He,ua);S&&(en||Ke===null)&&L(!1);let xt=Je("div",{ref:p,className:"flex min-h-0 flex-1 flex-col gap-1",children:[K("div",{className:`hidden rounded-t-lg border ${I.borderSubtle} ${M.subtle} px-4 py-2 transition-colors sm:block`,children:Je("div",{className:"flex items-center",children:[Je("div",{className:`flex w-28 shrink-0 flex-col items-center gap-0.5 text-center ${w} ${s.fgSecondary} uppercase tracking-wider`,children:[K("span",{className:`font-semibold ${s.fg} text-xs`,children:c.columnNo}),K("span",{className:"leading-tight",children:c.columnId}),K("span",{className:"whitespace-nowrap leading-tight",children:c.columnScore})]}),Je("div",{className:`hidden w-full grid-cols-3 gap-2 font-medium ${s.fgSecondary} text-xs uppercase tracking-wider transition-colors sm:grid xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[Je("div",{className:"flex flex-col gap-0.5",children:[K("span",{children:c.columnName}),K("span",{className:`font-normal ${w} ${s.fgMuted} uppercase tracking-wider`,children:c.columnTitle})]}),Je("div",{className:"flex flex-col gap-0.5",children:[K("span",{children:c.columnCompany}),K("span",{className:`font-normal ${w} ${s.fgMuted} uppercase tracking-wider`,children:c.columnDepartment})]}),Je("div",{className:"flex flex-col gap-0.5",children:[K("span",{children:c.columnPhone}),K("span",{className:`font-normal ${w} ${s.fgMuted} uppercase tracking-wider`,children:c.columnEmail})]}),K("div",{className:"hidden items-end justify-end xl:flex",children:K("span",{className:`font-normal ${w} ${s.fgMuted} uppercase tracking-wider`,children:c.columnUpdatedAt})})]})]})}),K("p",{id:ie,hidden:!0,children:c.listKeyboardHelp}),K("div",{ref:l,className:"flex-1",onKeyDown:Qt,onFocus:vt,children:K($l,{ref:W,contentProps:Jt,activeItemIndex:O===0?void 0:Se,activeItemVisibleInset:Va,itemCount:O,getItemKey:Zt,behaviorOptions:z,getItem:Ce,getItemHeight:Ve,viewportSize:v,overscanCount:10,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:ut},locale:d,labels:f,className:`w-full rounded-b-lg border ${I.borderSubtle} border-t-0 ${M.surface} pr-0.75 transition-colors`,children:(Y,ye)=>q(Y,ye)})}),n.length===0&&i?K("div",{className:"py-8 text-center",children:K("p",{className:s.fgMuted,children:c.listNoSearchResults})}):null,O===0&&!i?K("div",{className:"py-8 text-center",children:K("p",{className:s.fgMuted,children:c.listNoData})}):null]});return K("div",{ref:He,"data-testid":"contact-map-list-root",className:"flex min-h-0 flex-1 flex-col",style:T,children:en?Je(Pl,{id:"contact-map-list-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-list-panel-group",children:[K(Lo,{id:"contact-map-list-pane",defaultSize:{value:68,unit:"percentage"},minSize:{value:Bl,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:xt}),K(_l,{id:"contact-map-list-handle",thickness:Ul,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:`cursor-col-resize rounded transition-colors ${E.hoverMuted} focus:outline-none focus-visible:ring-2 ${E.focusVisibleRing} ${E.ringOffsetSurface} focus-visible:ring-offset-1`,"aria-label":c.listResizeHandle}),K(Lo,{id:"contact-map-list-detail-pane",defaultSize:{value:32,unit:"percentage"},minSize:{value:zl,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:K(fn,{placement:"pane",contact:Ke,searchTerm:a,enableHighlighting:o})})]}):Je(Jl,{children:[xt,Ke?K(xr,{isOpen:S,onClose:oe,title:c.detailHeading,children:K(fn,{placement:"overlay",contact:Ke,searchTerm:a,enableHighlighting:o})}):null]})})};Ft();import{DirectoryTree as cc}from"@aiquants/directory-tree";import{Panel as Vo,PanelGroup as dc,PanelResizeHandle as uc}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as mc}from"@aiquants/virtualscroll";import pc from"@heroicons/react/24/solid/FolderMinusIcon.js";import fc from"@heroicons/react/24/solid/FolderPlusIcon.js";import{useCallback as Be,useEffect as bn,useMemo as Ze,useRef as Er,useState as Yt}from"react";import{createPortal as gc}from"react-dom";var pa=(e,t)=>e&&e.trim()||t;import{useEffect as Zl,useRef as Tr,useState as ec}from"react";var Ho=(e,t=250)=>{let[n,a]=ec(e),i=Tr(null),o=Tr(e),r=Tr(null),u=Tr(!1);return Zl(()=>{if(!u.current){u.current=!0,a(e),o.current=e;return}o.current=n,i.current=null;let d=c=>{i.current??(i.current=c);let f=c-i.current,p=Math.min(1,Math.max(0,f/t)),l=1-(1-p)**3,g=Math.max(0,Math.round(o.current+(e-o.current)*l));a(g),p<1&&(r.current=requestAnimationFrame(d))};return r.current=requestAnimationFrame(d),()=>{r.current!==null&&cancelAnimationFrame(r.current)}},[e,t]),Math.max(0,n)};Lt();import{useCallback as fa,useEffect as ga,useMemo as Fo,useRef as tc,useSyncExternalStore as nc}from"react";ge();var rc=250,ac=4e3,Nr=3,Io={treeWorkerFactory:"the view remounts","workerUrls.treeWorker":"the page reloads"},Bo=(e,t)=>e.uncategorizedCompany===t.uncategorizedCompany&&e.unnamedPerson===t.unnamedPerson,Mr=class{constructor(t,{workerSource:n,logger:a=lt}){this.worker=null;this.generation=0;this.postedCount=0;this.latestSnapshot=null;this.workerNeedsReset=!1;this.lastSyncedRecords=[];this.postedNaming=null;this.lastSyncedNaming=null;this.consecutiveFailures=0;this.finalizeRequest=null;this.finalizedPostedCount=null;this.retryTimer=null;this.listeners=new Set;this.state={snapshot:null,isBuilding:!1};this.getState=()=>this.state;this.subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));this.handleMessage=t=>{let n=t.data;n.type!=="TREE_CHUNK"||n.generation!==this.generation||n.uniquePersonCount===0&&this.postedCount>0&&(this.latestSnapshot?.uniquePersonCount??0)>0||this.latestSnapshot!==null&&n.uniquePersonCount<this.latestSnapshot.uniquePersonCount&&!(n.isIdle&&n.consumedRecords>=this.postedCount)||(n.isIdle&&n.consumedRecords>=this.postedCount&&(this.consecutiveFailures=0),this.latestSnapshot={tree:n.tree,directoryPaths:n.directoryPaths,consumedRecords:n.consumedRecords,uniquePersonCount:n.uniquePersonCount,isIdle:n.isIdle,rebuildEpoch:n.rebuildEpoch},this.updateState())};this.handleFailure=t=>{if(this.worker?.terminate(),this.worker=null,this.postedCount=0,this.consecutiveFailures+=1,this.updateState(),this.consecutiveFailures>=Nr){this.logger.error(`[TreeWorker] the tree Worker failed ${Nr} times in a row; the tree stops updating until ${Io[this.workerSource]} (check ${this.workerSource})`,t);return}let n=Math.min(rc*2**(this.consecutiveFailures-1),ac);this.logger.warn(`[TreeWorker] the tree Worker failed; retrying in ${n}ms (failure ${this.consecutiveFailures} of ${Nr})`,t),this.retryTimer!==null&&clearTimeout(this.retryTimer),this.retryTimer=setTimeout(()=>{this.retryTimer=null;let a=this.lastSyncedNaming;a!==null&&this.syncRecords(this.lastSyncedRecords,a)},n)};if(typeof n!="string")throw new TypeError(`[contact-map] TreeWorkerSession workerSource must be a string; got ${ee(n)}`);if(!Object.hasOwn(Io,n))throw new RangeError(`[contact-map] TreeWorkerSession workerSource must be "treeWorkerFactory" or "workerUrls.treeWorker"; got ${ee(n)}`);this.workerFactory=t,this.workerSource=n,this.logger=a}updateState(){let t=this.postedCount>(this.latestSnapshot?.consumedRecords??0);this.state.snapshot===this.latestSnapshot&&this.state.isBuilding===t||(this.state={snapshot:this.latestSnapshot,isBuilding:t},this.notify())}notify(){for(let t of this.listeners)t()}ensureWorker(){if(this.consecutiveFailures>=Nr||this.retryTimer!==null)return null;if(!this.worker)try{this.worker=this.workerFactory(),this.workerNeedsReset=!0,this.worker.onerror=this.handleFailure,this.worker.onmessageerror=this.handleFailure,this.worker.onmessage=this.handleMessage}catch(t){return this.handleFailure(t),null}return this.worker}syncRecords(t,n){this.finalizeRequest!==null&&(t.length<this.finalizeRequest.recordCount||this.finalizeRequest.naming===null||!Bo(this.finalizeRequest.naming,n))&&(this.finalizeRequest=null),this.lastSyncedRecords=t,this.lastSyncedNaming=n;let a=this.ensureWorker();if(!a)return;let i=this.workerNeedsReset,o=this.postedNaming===null||!Bo(this.postedNaming,n);if((this.workerNeedsReset||o||t.length<this.postedCount)&&(this.generation+=1,this.postedCount=0,this.finalizedPostedCount=null,this.workerNeedsReset=!1,this.postedNaming=n,a.postMessage({type:"RESET_TREE",generation:this.generation,epochBase:this.latestSnapshot?.rebuildEpoch??0,naming:n}),this.updateState()),t.length>this.postedCount){let r=t.slice(this.postedCount);this.postedCount=t.length,a.postMessage({type:"APPEND_RECORDS",generation:this.generation,records:r}),this.updateState()}i&&this.finalizeRequest!==null&&this.finalize()}finalize(){this.finalizeRequest={recordCount:this.lastSyncedRecords.length,naming:this.lastSyncedNaming},!(this.worker===null||this.finalizedPostedCount===this.postedCount)&&(this.finalizedPostedCount=this.postedCount,this.worker.postMessage({type:"FINALIZE_TREE",generation:this.generation}))}cancelWorker(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.worker?.terminate(),this.worker=null,this.postedCount=0,this.postedNaming=null,this.finalizedPostedCount=null}stop(){this.cancelWorker(),this.consecutiveFailures=0,this.updateState()}reset(){this.cancelWorker(),this.listeners.clear(),this.latestSnapshot=null,this.lastSyncedRecords=[],this.lastSyncedNaming=null,this.consecutiveFailures=0,this.finalizeRequest=null,this.state={snapshot:null,isBuilding:!1}}},oc=e=>{if(e!==void 0)return new Worker(e,{type:"module"});let t=typeof import.meta<"u"?import.meta.url:void 0;if(t){let a=t.includes(".ts")?"../workers/treeWorker.ts":"./worker/treeWorker.mjs";return new Worker(new URL(a,t),{type:"module"})}throw new Error("[contact-map] the tree Worker needs workerUrls.treeWorker in a build without import.meta.url (CommonJS)")},qt=null,zo=e=>e===void 0?"the bundled Worker file (workerUrls.treeWorker unset)":JSON.stringify(e),ic=e=>{if(e===void 0)throw new Error("[contact-map] treeWorkerFactory was removed from the config while its tree session was still in use");return e},sc=e=>{if(mo(e),qt===null){let t=new Mr(()=>oc(e),{workerSource:"workerUrls.treeWorker"});return qt={session:t,workerUrl:e},t}if(qt.workerUrl!==e)throw new Error(`[contact-map] the tree session already loads its Worker from ${zo(qt.workerUrl)} and cannot also load it from ${zo(e)}; give every contact-map view in the browser tab the same workerUrls.treeWorker, on every route (after changing it, reload the page)`);return qt.session},Gp=()=>{qt?.session.reset(),qt=null},lc={snapshot:null,isBuilding:!1};function Uo(e,t=!1){let n=bt(),a=n.treeWorkerFactory,i=n.workerUrls?.treeWorker,{labels:o}=Pe(),r=o.uncategorizedCompany,u=o.noName,d=Fo(()=>({uncategorizedCompany:r,unnamedPerson:u}),[r,u]),c=tc(a);ga(()=>{c.current=a},[a]);let f=a!==void 0,p=f?void 0:i,l=Fo(()=>f?new Mr(()=>ic(c.current)(),{workerSource:"treeWorkerFactory"}):null,[f]),g=fa(()=>l===null?sc(p):l,[l,p]),b=fa(T=>g().subscribe(T),[g]),v=fa(()=>g().getState(),[g]);return ga(()=>{let T=g();T.syncRecords(e,d),t&&T.finalize()},[g,e,t,d]),ga(()=>{if(l!==null)return()=>l.stop()},[l]),nc(b,v,()=>lc)}ge();de();Ee();Yr();or();import{Fragment as Ec,jsx as j,jsxs as Ae}from"react/jsx-runtime";var ba=yr(Wn),hc=Wn.listPanelMinWidth,yc=Wn.detailPanelMinWidth,bc=Wn.handleThickness,Sf=ba.collapseThreshold,Cf=ba.expandThreshold,Sc=(e,t)=>{let{searchQuery:n,enableHighlighting:a}=t,i=pa(e.full_name,t.noName),o=pa(e.title,""),r=j(Ne,{text:i,query:n,enabled:a});return o?Ae("span",{className:"flex items-center gap-1.5",children:[j("span",{children:r}),j("span",{className:`${s.fgMuted} text-xs`,children:j(Ne,{text:o,query:n,enabled:a})})]}):r},Cc="contact-map-tree h-full w-full",vc={hoverClassName:M.muted,directorySelectedClassName:`${X.sky} ${E.treeNameSky}`,itemSelectedClassName:`${X.sky} ${E.treeNameSky}`},ha="h-4 w-4 shrink-0 transition-colors duration-150",xc=(e,t,n)=>({...e,viewportHeightOverride:t,behaviorOptions:{...e.behaviorOptions,enablePointerDrag:!n}}),Lr=null,Ko=null,Fn=new Map,jo="",Go=null,qo=null,Tc=(e,t,n,a,i)=>{let o=`${n?"icons":"plain"}#${a}#${i.noName}`;(o!==jo||i.formatDirectoryName!==Go||t!==qo)&&(Fn.clear(),jo=o,Go=i.formatDirectoryName,qo=t);let r={entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},u=new Set;for(let d of e){u.add(d.absolutePath);let c=`${d.name}\0${d.memberCount}`,f=Fn.get(d.absolutePath);(!f||f.signature!==c)&&(f={signature:c,result:Qo([d],t,n,{searchQuery:"",enableHighlighting:!1,noName:i.noName,formatDirectoryName:i.formatDirectoryName})},Fn.set(d.absolutePath,f));let p=f.result;p.entries.length>0&&r.entries.push(p.entries[0]);for(let[l,g]of p.personPathMap){let b=r.personPathMap.get(l);if(b)for(let v of g)b.add(v);else r.personPathMap.set(l,new Set(g))}for(let[l,g]of p.contactByPath)r.contactByPath.set(l,g);for(let[l,g]of p.ancestorsByPath)r.ancestorsByPath.set(l,g);r.totalCount+=p.totalCount,!r.firstPerson&&p.firstPerson&&(r.firstPerson=p.firstPerson)}for(let d of Fn.keys())u.has(d)||Fn.delete(d);return r},ya=e=>e.isSelected||e.isItemSelected?m.sky:e.isExpanded&&e.isDirectory?s.fgSecondary:s.fgMuted,Xo=e=>{let t=[];for(let n of e)n.type==="directory"&&(t.push(n.absolutePath),n.children&&t.push(...Xo(n.children)));return t},Nc=e=>{if(e.memberCount===void 0)throw new Error(`[contact-map] directory entry ${e.absolutePath} has no memberCount`);return e.memberCount},Qo=(e,t,n,a,i)=>{let o=new Map,r=new Map,u=new Map,d=0,c=null,f=(l,g)=>{let b=[...g,l.absolutePath];u.set(l.absolutePath,b);let v,T,N=l.type==="directory"?a.formatDirectoryName(l.name,Nc(l)):l.name,U=j(Ne,{text:N,query:a.searchQuery,enabled:a.enableHighlighting});if(l.type==="file"&&l.personId){if(i&&!i.has(l.personId))return null;let z=t.get(l.personId);if(z){r.set(l.absolutePath,z),o.has(l.personId)||o.set(l.personId,new Set);let y=o.get(l.personId);y&&y.add(l.absolutePath),d++,c||(c={personId:l.personId,path:l.absolutePath}),n&&(T=h=>{let C=ya(h);return h.isSelected||h.isItemSelected||l.isPrimary&&(C=l.title?m.indigo:m.orange),j(n.person,{"aria-hidden":"true",className:`${ha} ${C}`})},l.title&&(U=Sc(z,a))),U=j("span",{"data-contact-path":l.absolutePath,className:"block w-full",children:U})}}else if(l.children){let z=l.children.map(y=>f(y,b)).filter(y=>y!==null);if(i&&z.length===0)return null;if(v=z,n){let y=l.relativePath.startsWith("company:")?n.company:n.department;T=h=>j(y,{"aria-hidden":"true",className:`${ha} ${ya(h)}`})}}return{name:N,label:U,type:l.type,absolutePath:l.absolutePath,relativePath:l.relativePath,icon:T,children:v}};return{entries:e.map(l=>f(l,[])).filter(l=>l!==null),personPathMap:o,contactByPath:r,ancestorsByPath:u,firstPerson:c,totalCount:d}},Mc=(e,t,n)=>{let a=new Set,i=new Set,o=new Map;t.forEach((f,p)=>{o.set(f.item.person_id,p)});for(let f of t){let p=f.item.person_id,l=e.personPathMap.get(p);if(l)for(let g of l){a.add(g);let b=e.ancestorsByPath.get(g);if(b){for(let v of b)a.add(v);n&&b.length>0&&i.add(b[0])}}}let r=new Map,u=f=>{let p=r.get(f.absolutePath);if(p!==void 0)return p;let l=1/0;if(f.type==="file"){let g=e.contactByPath.get(f.absolutePath);g&&(l=o.get(g.person_id)??1/0)}else if(f.children)for(let g of f.children)l=Math.min(l,u(g));return r.set(f.absolutePath,l),l},d=(f,p=0)=>f.filter(l=>n&&p===0&&i.has(l.absolutePath)?!0:a.has(l.absolutePath)).map(l=>n&&p===0&&i.has(l.absolutePath)?l:l.type==="directory"&&l.children?{...l,children:d(l.children,p+1)}:l).sort((l,g)=>p===0?u(l)-u(g):0),c=d(e.entries);return{...e,entries:c}},Yo=(e,t,n)=>{if(e===null)return null;let a=n.get(e);if(a===void 0)return null;if(t!==null&&a.has(t))return t;let i=a.values().next();return i.done?null:i.value},Jo=({context:e,controlsContainer:t})=>{let{contactMapRecords:n,contactMapRecordMap:a,filteredItems:i,hasSearchTerm:o,isSearchInProgress:r,isSearchTabActive:u}=e,{locale:d,labels:c,treeLabels:f}=Pe(),p=c.noName,l=c.treeDirectoryName,g=Ze(()=>({noName:p,formatDirectoryName:l}),[p,l]),[b,v]=Yt(null),[T,N]=Yt(!1),{snapshot:U,isBuilding:z}=Uo(n,e.isStreamingComplete),y=U?.tree??null,h=U?.rebuildEpoch??0,C=Ze(()=>y?Tc(y,a,b,h,g):null,[y,a,b,h,g]),k=Ze(()=>{if(!y)return null;if(!o)return C;let D;T||(D=new Set(i.map(fe=>fe.item.person_id)));let le=Qo(y,a,b,{...g,searchQuery:e.searchQuery,enableHighlighting:e.enableHighlighting},D);return Mc(le,i,T)},[y,C,a,b,e.searchQuery,e.enableHighlighting,o,i,T,g]),H=Ze(()=>k||{entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},[k]),S=o&&e.errorMessage!==null,[L,oe]=Yt(H),F=Er(!1);bn(()=>{if(!(r||S)){F.current=!!y,oe(H);return}!F.current&&y&&H.entries.length>0&&(F.current=!0,oe(H))},[H,y,r,S]);let be=o&&(r||S)?L:H,{entries:ie,personPathMap:W,contactByPath:O,totalCount:q}=be,pe=Ze(()=>Xo(ie),[ie]),[Se,$e]=Yt(()=>Ko??new Set),$t=Be(D=>!Se.has(D),[Se]),Qt=Be(D=>{$e(le=>{let fe=new Set(le);return fe.has(D)?fe.delete(D):fe.add(D),fe})},[]),vt=Be(D=>{D.length!==0&&$e(le=>{let fe=new Set(le);for(let ft of D)fe.add(ft);return fe})},[]),Jt=Be(D=>{$e(le=>{if(le.size===0)return le;let fe=!1,ft=new Set(le);for(let V of D)ft.delete(V)&&(fe=!0);return fe?ft:le})},[]);bn(()=>{Ko=Se},[Se]),bn(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem("contact-map.tree-expanded")}catch{}},[]);let[Ce,Zt]=Yt(null),[Ve,ut]=Yt(null),[Ke,He]=Yt(!1),en=Be(()=>He(!1),[]),xt=Er(null),Y=Er(null),{normalizedViewportHeight:ye,panelSizingStyle:J}=ma(u,Y,xt),mt=Be(D=>{let le=O.get(D);return le?(Ce!==le.person_id&&Zt(le.person_id),D!==Ve&&ut(D),!0):!1},[O,Ve,Ce]),Ot=Be(D=>{mt(D)&&He(!0)},[mt]),Nn=Be(D=>{Ot(D.entry.absolutePath)},[Ot]),Tt=Be(D=>D instanceof Element?D.closest("[data-contact-path]")?.getAttribute("data-contact-path")??null:null,[]),{isPopupVisible:Oe,popupItem:Mn,handleClosePopup:En}=Sr({ref:Y,resolveItem:Tt,onSelect:mt}),tt=Be(D=>{if(!e.openEmailsWithGmail)return;let le=D.trim();if(!le||le==="-"||typeof window>"u")return;let fe=gt(le,!0);fe&&window.open(fe,"_blank","noopener,noreferrer")},[e.openEmailsWithGmail]),Nt=Mn?O.get(Mn):null,nt=Oe&&Nt!==null&&Nt!==void 0;bn(()=>{Oe&&!Nt&&En()},[Oe,Nt,En]);let Dt=Ze(()=>({overscanCount:16,callbackThrottleMs:16,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:{enabled:!0,renderVisual:mc}},behaviorOptions:{resetOnGetItemHeightChange:!1},preserveScrollAnchor:!0}),[]),Mt=Ze(()=>xc(Dt,ye,nt),[Dt,ye,nt]);bn(()=>{let D=!1;return typeof window>"u"?()=>{D=!0}:Lr?(v(Lr),()=>{D=!0}):((async()=>{try{let[fe,ft,V,Z]=await Promise.all([import("lucide-react/dist/esm/icons/building-2.js"),import("lucide-react/dist/esm/icons/users-round.js"),import("lucide-react/dist/esm/icons/id-card.js"),import("lucide-react/dist/esm/icons/user-round.js")]);if(D)return;let xe=fe.default,rt=ft.default,Ar=V.default,Ra=Z.default;xe&&rt&&Ar&&Ra&&(Lr={company:xe,department:rt,title:Ar,person:Ra},v(Lr))}catch(fe){lt.warn("Failed to load lucide icons",fe)}})(),()=>{D=!0})},[]);let Wt=Ze(()=>{if(!b)return;let D=Z=>xe=>j(Z,{"aria-hidden":"true",className:`${ha} ${ya(xe)}`}),le={company:D(b.company),department:D(b.department),title:D(b.title)},fe=D(b.person),ft=Z=>Z in le,V=Z=>{let[xe]=Z.entry.relativePath.split(":",1);return(ft(xe)?le[xe]:le.company)(Z)};return{directory:V,directoryExpanded:V,file:fe}},[b]),tn=Be(()=>{$e(D=>D.size===0?D:new Set)},[]),Rr=Be(()=>{pe.length>0&&vt(pe)},[pe,vt]),Et=Yo(Ce,Ve,W);bn(()=>{let D=Yo(Ce,Ve,W);if(D===null){Ce!==null&&Zt(null),Ve!==null&&ut(null);return}D!==Ve&&ut(D)},[Ce,Ve,W]);let je=Et===null?null:O.get(Et)??null,Ln=e.isStreamingComplete,Pr=e.isStreamingFailed,Bn=Ln&&n.length===0,zn=(z||!y)&&!Bn,Un=Ho(q,250),pt=y!==null||Bn,nn=Ae("div",{className:"flex flex-wrap items-center gap-1.5",children:[Ae("span",{className:`inline-flex h-5 items-center gap-1 rounded ${M.muted} px-1.5 font-medium font-mono ${w} ${s.fgSecondary}`,title:c.treeNodeCountTitle,children:[j("span",{children:"\u{1F333}"})," ",c.treeNodeCountLabel," ",pt?c.treeNodeCount(Un):"\u2026"]}),Pr&&!Ln?Ae("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${A.rose} ${X.rose} px-1.5 font-medium ${w} ${m.rose}`,title:c.treeStreamInterruptedTitle,children:[j("span",{className:`h-1.5 w-1.5 rounded-full ${qe.rose}`}),j("span",{children:"\u26D4"})," ",c.treeStreamInterrupted]}):Ln?zn?Ae("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${A.amber} ${X.amber} px-1.5 font-medium ${w} ${m.amber}`,title:c.treeBuildingTitle,children:[Ae("span",{className:"relative flex h-1.5 w-1.5",children:[j("span",{className:`absolute inline-flex h-full w-full animate-ping rounded-full ${qe.amber}`}),j("span",{className:`relative inline-flex h-1.5 w-1.5 rounded-full ${qe.amber}`})]}),j("span",{children:"\u{1F33F}"})," ",c.treeBuilding]}):Ae("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${A.emerald} ${X.emerald} px-1.5 font-medium ${w} ${m.emerald}`,title:c.treeCompleteTitle,children:[j("span",{className:`h-1.5 w-1.5 rounded-full ${qe.emerald}`}),j("span",{children:"\u2705"})," ",c.treeComplete]}):Ae("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${A.sky} ${X.sky} px-1.5 font-medium ${w} ${m.sky}`,title:c.treeStreamLoadingTitle,children:[Ae("span",{className:"relative flex h-1.5 w-1.5",children:[j("span",{className:`absolute inline-flex h-full w-full animate-ping rounded-full ${qe.sky}`}),j("span",{className:`relative inline-flex h-1.5 w-1.5 rounded-full ${qe.sky}`})]}),j("span",{children:"\u23F3"})," ",c.treeStreamLoading]}),o&&Ae("button",{type:"button",onClick:()=>N(!T),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${T?`${X.blue} ${m.blue}`:`${s.fgMuted} ${E.hoverMuted}`}`,title:c.treeShowEntireCompanyTitle,children:[j("span",{children:"\u{1F3E2}"})," ",c.treeShowEntireCompany]}),pe.length>0?Ae("div",{className:"flex items-center gap-1",children:[j("button",{type:"button",onClick:tn,className:`inline-flex h-11 w-11 items-center justify-center rounded border ${I.borderControl} ${M.surface} ${s.fgMuted} transition-colors ${E.hoverMuted} ${E.hoverFgSecondary}`,"aria-label":c.treeExpandAll,title:c.treeExpandAllTitle,children:j(fc,{className:"h-4 w-4"})}),j("button",{type:"button",onClick:Rr,className:`inline-flex h-11 w-11 items-center justify-center rounded border ${I.borderControl} ${M.surface} ${s.fgMuted} transition-colors ${E.hoverMuted} ${E.hoverFgSecondary}`,"aria-label":c.treeCollapseAll,title:c.treeCollapseAllTitle,children:j(pc,{className:"h-4 w-4"})})]}):null]}),Vn=Er(null),{isTwoColumn:kn}=Cr(Vn,ba,{mediaQuery:"(min-width: 768px)"});Ke&&(kn||je===null)&&He(!1);let Kn=Ze(()=>({toggle:Qt,isExpanded:$t,expandMultiple:Jt,collapseMultiple:vt,isPending:r}),[vt,Jt,$t,Qt,r]),jn=Ze(()=>({onEntryClick:Nn,selectedPath:Et}),[Nn,Et]),_r=Ze(()=>({className:Cc,lineColor:Ba,iconOverrides:Wt,showDirectoryIcons:!!Wt,showFileIcons:!!Wt,highlightStyles:vc,entryClassName:"rounded-md",nameClassName:"tracking-tight",directoryNameClassName:`font-normal ${s.fg}`,fileNameClassName:s.fgSecondary}),[Wt]),wn=j("div",{ref:xt,className:`flex min-h-0 flex-1 flex-col rounded-xl border ${I.borderSubtle} ${M.surface} shadow-sm transition-colors`,children:j("div",{ref:Y,className:"flex min-h-0 flex-1 flex-col overflow-hidden p-2",children:ie.length>0?j(cc,{entries:ie,expansion:Kn,selection:jn,visual:_r,virtualScroll:Mt,locale:d,labels:f}):j("div",{className:`flex h-full w-full items-center justify-center rounded-lg border ${I.borderSubtle} border-dashed ${M.surface} px-6 text-center ${s.fgMuted} text-sm transition-colors`,children:o?c.treeNoMatches:c.treeEmpty})})});return Ae("div",{ref:Vn,"data-testid":"contact-map-tree-root",className:"flex min-h-0 flex-1 flex-col",style:J,children:[t&&gc(nn,t),kn?Ae(dc,{id:"contact-map-tree-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-tree-panel-group",children:[j(Vo,{id:"contact-map-tree-pane",defaultSize:{value:60,unit:"percentage"},minSize:{value:hc,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:wn}),j(uc,{id:"contact-map-tree-handle",thickness:bc,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:`cursor-col-resize rounded transition-colors ${E.hoverMuted} focus:outline-none focus-visible:ring-2 ${E.focusVisibleRing} ${E.ringOffsetSurface} focus-visible:ring-offset-1`,"aria-label":c.treeResizeHandle}),j(Vo,{id:"contact-map-tree-detail-pane",defaultSize:{value:40,unit:"percentage"},minSize:{value:yc,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:j(fn,{placement:"pane",contact:je,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})})]}):Ae(Ec,{children:[wn,je?j(xr,{isOpen:Ke,onClose:en,title:c.detailHeading,children:j(fn,{placement:"overlay",contact:je,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})}):null]}),nt&&Nt&&j(tr,{contactData:Nt,openEmailsWithGmail:e.openEmailsWithGmail,openGmailCompose:tt,onRequestClose:En})]})};import{jsx as In,jsxs as Sn}from"react/jsx-runtime";var Rc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Pc=e=>e==="tree"?"tree":"list",Zo=({context:e})=>{let t=Q(),[n,a]=wc(),[i,o]=kc(null),r=Pc(n.get(hn)),{setScrollableRef:u,onPointerDown:d,onPointerMove:c,onPointerUp:f,onPointerLeave:p,onPointerCancel:l,onClickCapture:g}=Pt(),b=Lc(v=>{let T=v==="tree"?"tree":"list";if(T===r)return;let N=new URLSearchParams(typeof window<"u"?window.location.search:"");T==="list"?N.delete(hn):N.set(hn,T),a(N,{replace:!0})},[r,a]);return Sn("div",{"data-testid":"contact-map-search-tab-group",className:"flex h-full flex-1 flex-col",children:[Sn("div",{className:"mt-1 mb-1.5 flex shrink-0 flex-wrap items-center gap-2",children:[Sn("div",{ref:u,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-lg ${M.muted} p-0.5 transition-colors`,style:Rc,onPointerDown:d,onPointerMove:c,onPointerUp:f,onPointerLeave:p,onPointerCancel:l,onClickCapture:g,children:[Sn("button",{type:"button","data-testid":"contact-map-tab-list","aria-pressed":r==="list",onClick:()=>b("list"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 ${x} transition-colors ${r==="list"?`${Te.blue} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4C4} ",t.listViewTab]}),Sn("button",{type:"button","data-testid":"contact-map-tab-tree","aria-pressed":r==="tree",onClick:()=>b("tree"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 ${x} transition-colors ${r==="tree"?`${Te.green} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F333} ",t.treeViewTab]})]}),In("div",{ref:o,className:"flex flex-wrap items-center gap-1.5"})]}),Sn("div",{className:"flex h-full flex-1 flex-col",children:[In("div",{className:`${r==="list"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="list"?In(Wo,{context:e}):null}),In("div",{className:`${r==="tree"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="tree"?In(Jo,{context:e,controlsContainer:i}):null})]})]})};import{memo as $c}from"react";ge();de();Ee();ge();de();Ee();import{DEFAULT_FUZZY_SEARCH_OPTIONS as G}from"@aiquants/fuzzy-search";import{memo as _c,useId as We}from"react";import{jsx as $,jsxs as B}from"react/jsx-runtime";var Sa=1e3,Ca=_c(({searchOptions:e,setSearchOptions:t})=>{let n=Q(),a=`flex flex-col gap-1 rounded-md border ${M.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=e.sortBy==="relevance",r=We(),u=We(),d=We(),c=We(),f=We(),p=We(),l=We(),g=We(),b=We(),v=We(),T=We(),N=[];N.push(B("div",{className:`${a} ${A.green} border-l-4`,children:[B("div",{className:`${i} ${m.green}`,children:["\u{1F3D7}\uFE0F ",n.indexBuildHeading]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:r,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexNgramSize}),$("input",{id:r,type:"range",min:"1",max:"4",step:"1",value:e.ngramSize||G.ngramSize,onChange:y=>t(h=>({...h,ngramSize:parseInt(y.target.value,10)})),className:"h-11 w-full"}),B("span",{className:`${m.green} text-xs`,children:[n.currentValueLabel," ",e.ngramSize||G.ngramSize]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexNgramSizeHint})]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:u,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexMinNgramOverlap}),$("input",{id:u,type:"range",min:"1",max:"5",step:"1",value:e.minNgramOverlap||G.minNgramOverlap,onChange:y=>t(h=>({...h,minNgramOverlap:parseInt(y.target.value,10)})),className:"h-11 w-full"}),B("span",{className:`${m.green} text-xs`,children:[n.currentValueLabel," ",e.minNgramOverlap||G.minNgramOverlap]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexMinNgramOverlapHint})]})]},"index-build")),N.push(B("div",{className:`${a} ${A.blue} border-l-4`,children:[B("div",{className:`${i} ${m.blue}`,children:["\u{1F50D} ",n.indexCandidateHeading]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:d,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexThreshold}),$("input",{id:d,type:"range",min:"0.0",max:"1.0",step:"0.05",value:e.indexWorkerOptions?.threshold??G.indexWorkerOptions?.threshold,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,threshold:parseFloat(y.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.blue} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.threshold??G.indexWorkerOptions?.threshold]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexThresholdHint})]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:f,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexNgramOverlapThreshold}),$("input",{id:f,type:"range",min:"0.1",max:"0.9",step:"0.1",value:e.indexWorkerOptions?.ngramOverlapThreshold??G.indexWorkerOptions?.ngramOverlapThreshold,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,ngramOverlapThreshold:parseFloat(y.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.blue} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.ngramOverlapThreshold??G.indexWorkerOptions?.ngramOverlapThreshold]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexNgramOverlapThresholdHint})]})]},"candidate-control")),N.push(B("div",{className:`${a} ${A.cyan} border-l-4`,children:[B("div",{className:`${i} ${m.cyan}`,children:["\u{1F9ED} ",n.indexStrategyHeading]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:c,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexStrategy}),B("select",{id:c,value:e.indexWorkerOptions?.strategy??G.indexWorkerOptions?.strategy??"hybrid",onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,strategy:y.target.value}})),className:`min-h-11 rounded border ${I.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${M.surface} ${s.fg}`,children:[$("option",{value:"fast",children:n.indexStrategyFast}),$("option",{value:"accurate",children:n.indexStrategyAccurate}),$("option",{value:"hybrid",children:n.indexStrategyHybrid})]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexStrategyHint})]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:p,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexMinCandidatesRatio}),$("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.minCandidatesRatio??G.indexWorkerOptions?.minCandidatesRatio,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,minCandidatesRatio:parseFloat(y.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.cyan} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.minCandidatesRatio??G.indexWorkerOptions?.minCandidatesRatio]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexMinCandidatesRatioHint})]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:l,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexMaxCandidatesRatio}),$("input",{id:l,type:"range",min:"0.3",max:"0.8",step:"0.1",value:e.indexWorkerOptions?.maxCandidatesRatio??G.indexWorkerOptions?.maxCandidatesRatio,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxCandidatesRatio:parseFloat(y.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.cyan} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxCandidatesRatio??G.indexWorkerOptions?.maxCandidatesRatio]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexMaxCandidatesRatioHint})]})]},"strategy")),N.push(B("div",{className:`${a} ${A.indigo} border-l-4`,children:[B("div",{className:`${i} ${m.indigo}`,children:["\u{1F521} ",n.scoreTuningHeading]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:g,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexJaroWinklerPrefix}),$("input",{id:g,type:"range",min:"0.05",max:"0.25",step:"0.05",value:e.indexWorkerOptions?.jaroWinklerPrefix??G.indexWorkerOptions?.jaroWinklerPrefix,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,jaroWinklerPrefix:parseFloat(y.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.jaroWinklerPrefix??G.indexWorkerOptions?.jaroWinklerPrefix]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexJaroWinklerPrefixHint})]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:b,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.maxResults}),B("label",{className:`flex min-h-11 items-center gap-2 ${x} ${s.fgMuted}`,children:[$("input",{type:"checkbox",checked:e.indexWorkerOptions?.maxResults===void 0,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxResults:y.target.checked?void 0:Sa}}))}),n.noLimit]}),$("input",{id:b,type:"range",min:Sa,max:"10000",step:"1000",disabled:e.indexWorkerOptions?.maxResults===void 0,value:e.indexWorkerOptions?.maxResults===void 0?Sa:e.indexWorkerOptions.maxResults,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxResults:parseInt(y.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),B("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxResults===void 0?n.noLimit:e.indexWorkerOptions.maxResults]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexMaxResultsHint})]})]},"jaro")),N.push(B("div",{className:`${a} ${A.emerald} border-l-4`,children:[B("div",{className:`${i} ${m.emerald}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:v,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.fieldWeight}),$("input",{id:v,type:"range",min:"0",max:"1",step:"0.05",value:e.indexWorkerOptions?.relevanceFieldWeight??G.indexWorkerOptions?.relevanceFieldWeight??.2,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,relevanceFieldWeight:parseFloat(y.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),B("span",{className:`${m.emerald} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevanceFieldWeight??G.indexWorkerOptions?.relevanceFieldWeight??.2]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexFieldWeightHint})]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:T,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexPerfectMatchBonus}),$("input",{id:T,type:"range",min:"0",max:"0.3",step:"0.1",value:e.indexWorkerOptions?.relevancePerfectMatchBonus??G.indexWorkerOptions?.relevancePerfectMatchBonus??.1,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,relevancePerfectMatchBonus:parseFloat(y.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),B("span",{className:`${m.emerald} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevancePerfectMatchBonus??G.indexWorkerOptions?.relevancePerfectMatchBonus??.1]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexPerfectMatchBonusHint})]}),!o&&$("p",{className:`${w} ${m.emerald}`,children:n.relevanceOnlyNotice})]},"relevance"));let U=We(),z=We();return N.push(B("div",{className:`${a} ${A.teal} border-l-4`,children:[B("div",{className:`${i} ${m.teal}`,children:["\u{1F524} ",n.indexContainmentHeading]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:U,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexContainmentBase}),$("input",{id:U,type:"range",min:"0.0",max:"0.7",step:"0.05",value:e.indexWorkerOptions?.containmentScoreBase??G.indexWorkerOptions?.containmentScoreBase??.7,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,containmentScoreBase:parseFloat(y.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.teal} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentScoreBase??G.indexWorkerOptions?.containmentScoreBase??.7]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexContainmentBaseHint})]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:z,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexContainmentCoverage}),$("input",{id:z,type:"range",min:"0.0",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.containmentCoverageWeight??G.indexWorkerOptions?.containmentCoverageWeight??.3,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,containmentCoverageWeight:parseFloat(y.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.teal} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentCoverageWeight??G.indexWorkerOptions?.containmentCoverageWeight??.3]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexContainmentCoverageHint})]})]},"containment")),B("section",{className:"space-y-3",children:[B("div",{className:"flex items-center justify-between gap-3",children:[B("div",{className:`flex items-center gap-2 font-semibold ${m.green} text-xs transition-colors`,children:[$("span",{children:"\u{1F4CA}"}),$("span",{className:"tracking-wide",children:n.indexSettingsHeading})]}),$("button",{type:"button",onClick:()=>t(y=>({...y,indexWorkerOptions:{threshold:G.indexWorkerOptions?.threshold||.4,ngramOverlapThreshold:G.indexWorkerOptions?.ngramOverlapThreshold||.3,minCandidatesRatio:G.indexWorkerOptions?.minCandidatesRatio||.1,maxCandidatesRatio:G.indexWorkerOptions?.maxCandidatesRatio||.5,jaroWinklerPrefix:G.indexWorkerOptions?.jaroWinklerPrefix||.1,maxResults:void 0,relevanceFieldWeight:G.indexWorkerOptions?.relevanceFieldWeight||.2,relevancePerfectMatchBonus:G.indexWorkerOptions?.relevancePerfectMatchBonus||.1,containmentScoreBase:G.indexWorkerOptions?.containmentScoreBase||.7,containmentCoverageWeight:G.indexWorkerOptions?.containmentCoverageWeight||.3,strategy:G.indexWorkerOptions?.strategy},ngramSize:G.ngramSize,minNgramOverlap:G.minNgramOverlap})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${A.green} ${X.green} px-2 font-medium ${m.green} ${x} transition-colors ${E.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),$("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:N})]})});Ca.displayName="IndexWorkerSettings";ge();de();Ee();import{DEFAULT_FUZZY_SEARCH_OPTIONS as we}from"@aiquants/fuzzy-search";import{memo as Ac,useId as Cn}from"react";import{jsx as me,jsxs as he}from"react/jsx-runtime";var va=1e3,xa=Ac(({searchOptions:e,setSearchOptions:t})=>{let n=Q(),a=`flex flex-col gap-1 rounded-md border ${M.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=e.sortBy==="relevance",r=Cn(),u=Cn(),d=Cn(),c=Cn(),f=Cn(),p=Cn(),l=[];return l.push(he("div",{className:`${a} ${A.purple} border-l-4`,children:[he("div",{className:`${i} ${m.purple}`,children:["\u{1F9EE} ",n.levenshteinCandidateHeading]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:r,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.levenshteinThreshold}),me("input",{id:r,type:"range",min:"0.0",max:o?"1.5":"1.0",step:"0.05",value:e.levenshteinWorkerOptions?.threshold??we.levenshteinWorkerOptions?.threshold,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,threshold:parseFloat(g.target.value)}})),className:"h-11 w-full"}),he("span",{className:`${m.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.threshold??we.levenshteinWorkerOptions?.threshold]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:o?n.levenshteinThresholdHintRelevance:n.levenshteinThresholdHint})]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:u,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarity}),me("input",{id:u,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.lengthSimilarityThreshold??we.levenshteinWorkerOptions?.lengthSimilarityThreshold,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,lengthSimilarityThreshold:parseFloat(g.target.value)}})),className:"h-11 w-full"}),he("span",{className:`${m.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthSimilarityThreshold??we.levenshteinWorkerOptions?.lengthSimilarityThreshold]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarityHint})]})]},"threshold")),l.push(he("div",{className:`${a} ${A.pink} border-l-4`,children:[he("div",{className:`${i} ${m.pink}`,children:["\u{1FA84} ",n.scoreTuningHeading]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:d,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenalty}),me("input",{id:d,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.levenshteinWorkerOptions?.lengthDiffPenalty??we.levenshteinWorkerOptions?.lengthDiffPenalty,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,lengthDiffPenalty:parseFloat(g.target.value)}})),className:"h-11 w-full"}),he("span",{className:`${m.pink} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthDiffPenalty??we.levenshteinWorkerOptions?.lengthDiffPenalty]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenaltyHint})]})]},"penalty")),l.push(he("div",{className:`${a} ${A.violet} border-l-4`,children:[he("div",{className:`${i} ${m.violet}`,children:["\u{1F4E6} ",n.levenshteinResultsHeading]}),me("label",{htmlFor:c,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.maxResults}),he("label",{className:`flex min-h-11 items-center gap-2 ${x} ${s.fgMuted}`,children:[me("input",{type:"checkbox",checked:e.levenshteinWorkerOptions?.maxResults===void 0,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,maxResults:g.target.checked?void 0:va}}))}),n.noLimit]}),me("input",{id:c,type:"range",min:va,max:"10000",step:"1000",disabled:e.levenshteinWorkerOptions?.maxResults===void 0,value:e.levenshteinWorkerOptions?.maxResults===void 0?va:e.levenshteinWorkerOptions.maxResults,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,maxResults:parseInt(g.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),he("span",{className:`${m.violet} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.maxResults===void 0?n.noLimit:e.levenshteinWorkerOptions.maxResults]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinMaxResultsHint})]},"max-results")),l.push(he("div",{className:`${a} ${A.rose} border-l-4`,children:[he("div",{className:`${i} ${m.rose}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:f,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.fieldWeight}),me("input",{id:f,type:"range",min:"0",max:"1",step:"0.05",value:e.levenshteinWorkerOptions?.relevanceFieldWeight??we.levenshteinWorkerOptions?.relevanceFieldWeight??.15,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,relevanceFieldWeight:parseFloat(g.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),he("span",{className:`${m.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.relevanceFieldWeight??we.levenshteinWorkerOptions?.relevanceFieldWeight??.15]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinFieldWeightHint})]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:p,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonus}),me("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.partialMatchBonus??we.levenshteinWorkerOptions?.partialMatchBonus,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,partialMatchBonus:parseFloat(g.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),he("span",{className:`${m.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.partialMatchBonus??we.levenshteinWorkerOptions?.partialMatchBonus]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonusHint})]}),!o&&me("p",{className:`${w} ${m.rose}`,children:n.relevanceOnlyNotice})]},"relevance")),he("section",{className:"space-y-3",children:[he("div",{className:"flex items-center justify-between gap-3",children:[he("div",{className:`flex items-center gap-2 font-semibold ${m.purple} text-xs transition-colors`,children:[me("span",{children:"\u{1F4CF}"}),me("span",{className:"tracking-wide",children:n.levenshteinSettingsHeading})]}),me("button",{type:"button",onClick:()=>t(g=>({...g,levenshteinWorkerOptions:{threshold:we.levenshteinWorkerOptions?.threshold||.3,lengthSimilarityThreshold:we.levenshteinWorkerOptions?.lengthSimilarityThreshold||.1,partialMatchBonus:we.levenshteinWorkerOptions?.partialMatchBonus||.1,lengthDiffPenalty:we.levenshteinWorkerOptions?.lengthDiffPenalty||1,maxResults:void 0,relevanceFieldWeight:we.levenshteinWorkerOptions?.relevanceFieldWeight||.15}})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${A.purple} ${X.purple} px-2 font-medium ${m.purple} ${x} transition-colors ${E.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),me("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:l})]})});xa.displayName="LevenshteinWorkerSettings";import{jsx as dt,jsxs as ct}from"react/jsx-runtime";var Oc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Ta=$c(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:i,setOpenEmailsWithGmail:o,activeTab:r,onTabChange:u})=>{let d=Q(),{setScrollableRef:c,onPointerDown:f,onPointerMove:p,onPointerUp:l,onPointerLeave:g,onPointerCancel:b,onClickCapture:v}=Pt();return ct("div",{className:`wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border ${A.blue} ${M.surface} p-1.5 shadow-md transition-colors`,children:[ct("div",{className:`mb-0.5 flex shrink-0 flex-col gap-1 rounded ${X.blue} px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between`,children:[ct("h3",{className:`font-semibold ${s.fgSecondary} text-xs transition-colors`,children:["\u2699\uFE0F ",d.searchSettings]}),dt("div",{className:"flex flex-wrap gap-1.5",children:ct("button",{type:"button",onClick:()=>t(T=>hr(T.workerUrls)),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded ${Te.red} px-1.5 ${x} ${s.onPrimary} transition-colors ${zt.red}`,title:d.settingsResetAllTitle,children:["\u{1F504} ",d.settingsResetAll]})})]}),dt("div",{className:"mb-0 shrink-0",children:ct("div",{ref:c,role:"tablist","aria-label":d.settingsTabsLabel,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-md ${M.muted} p-0.5 transition-colors`,style:Oc,onPointerDown:f,onPointerMove:p,onPointerUp:l,onPointerLeave:g,onPointerCancel:b,onClickCapture:v,children:[ct("button",{type:"button",role:"tab","aria-selected":r==="basic",onClick:()=>u("basic"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${r==="basic"?`${Te.blue} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F527} ",d.settingsBasicTab]}),ct("button",{type:"button",role:"tab","aria-selected":r==="advanced",onClick:()=>u("advanced"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${r==="advanced"?`${Te.orange} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u26A1 ",d.settingsAdvancedTab]}),ct("button",{type:"button",role:"tab","aria-selected":r==="index",onClick:()=>u("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${r==="index"?`${Te.green} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CA} ",d.indexWorkerName]}),ct("button",{type:"button",role:"tab","aria-selected":r==="levenshtein",onClick:()=>u("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${r==="levenshtein"?`${Te.purple} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CF} ",d.levenshteinWorkerName]})]})}),ct("div",{className:"flex flex-col gap-1",children:[dt("div",{className:`${r==="basic"?"block":"hidden"}`,children:dt(Kr,{searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:i,setOpenEmailsWithGmail:o})}),dt("div",{className:`${r==="advanced"?"block":"hidden"}`,children:dt(Vr,{searchOptions:e,setSearchOptions:t})}),dt("div",{className:`${r==="index"?"block":"hidden"}`,children:dt(Ca,{searchOptions:e,setSearchOptions:t})}),dt("div",{className:`${r==="levenshtein"?"block":"hidden"}`,children:dt(xa,{searchOptions:e,setSearchOptions:t})})]})]})});Ta.displayName="SearchOptionsPanel";import{memo as Hc,useCallback as Fc}from"react";Bt();ge();de();Ee();de();import{memo as Dc}from"react";import{jsxs as Na}from"react/jsx-runtime";var _=Dc(({label:e,value:t,unit:n,color:a=s.fgMuted})=>Na("div",{className:`wrap-break-word flex min-w-0 flex-col overflow-hidden ${s.fgSecondary} transition-colors sm:flex-row sm:justify-between`,children:[Na("span",{className:"wrap-break-word overflow-hidden text-left",children:[e,":"]}),Na("span",{className:`font-medium ${a} min-w-0 overflow-hidden break-all transition-colors sm:ml-2`,children:[t,n]})]}));_.displayName="StatItem";Bt();ge();de();Ee();import{memo as Wc}from"react";import{jsx as P,jsxs as te}from"react/jsx-runtime";var vn=Wc(({kind:e,icon:t,stats:n,color:a})=>{let{locale:i,labels:o}=Pe(),r=W=>ne(i,W);if(!n)return P("section",{className:`rounded-lg border ${I.borderSubtle} border-dashed ${M.surface} p-3 ${s.fgMuted} text-xs transition-colors`,children:o.statsNoData});let u=n.basic||{},d=n.workerSpecific||{},c=n.analysis||{},f=u.totalSearches??0,p=u.totalProcessingTime??0,l=u.averageSearchTime??0,g=u.lastSearchTime??0,b=u.errorCount??0,v=u.timestamp,T=c.fieldPerformance||{},N=c.performanceInsights||{},U=c.recentHistory||[],z=d.specificMetrics||{},y=d.operationCount??0,h=d.operationDistribution||{},C=e==="index",k=e==="levenshtein",H=C?o.indexWorkerName:o.levenshteinWorkerName,S=z,L=z,oe=`flex flex-col gap-1 rounded-lg border ${M.surface} p-3 shadow-sm transition-colors`,F="text-xs font-semibold transition-colors",be=W=>{if(!W)return;let O=new Date(W);return Number.isNaN(O.getTime())?void 0:o.statsTimestamp(O)},ie=[];if(ie.push(te("div",{className:`${oe} ${A.blue} border-l-4`,children:[te("div",{className:`${F} ${a}`,children:["\u{1F4CA} ",o.statsBasicHeading]}),P(_,{label:o.statTotalSearches,value:r(f),color:a}),P(_,{label:o.statAverageSearchTime,value:l.toFixed(2),unit:"ms",color:a}),P(_,{label:o.statTotalProcessingTime,value:p.toFixed(2),unit:"ms",color:a}),P(_,{label:o.statLastSearchTime,value:g.toFixed(2),unit:"ms",color:a}),P(_,{label:o.statErrorCount,value:b,color:b>0?m.red:a}),be(v)&&P(_,{label:o.statUpdatedAt,value:be(v),color:s.fgMuted})]},"basic")),y>0||Object.keys(h).length>0){let W=Object.entries(h).sort(([,O],[,q])=>(Number(q)||0)-(Number(O)||0)).slice(0,6);ie.push(te("div",{className:`${oe} ${A.amber} border-l-4`,children:[te("div",{className:`${F} ${m.amber}`,children:["\u{1F527} ",o.statsOperationsHeading]}),P(_,{label:o.statTotalOperations,value:r(y),color:m.amber}),W.length>0&&P("div",{className:"mt-1 space-y-1",children:W.map(([O,q])=>P(_,{label:O,value:r(Number(q)),unit:o.timesUnit(r(Number(q))),color:m.amber},O))})]},"operations"))}if(C&&(ie.push(te("div",{className:`${oe} ${A.green} border-l-4`,children:[te("div",{className:`${F} ${m.green}`,children:["\u{1F3D7}\uFE0F ",o.statsIndexHeading]}),P(_,{label:o.statIndexBuilds,value:r(S.totalIndexBuilds??0),color:m.green}),P(_,{label:o.statDataSize,value:r(S.currentDataSize??0),unit:o.itemsUnit(r(S.currentDataSize??0)),color:m.green}),P(_,{label:o.statLastBuildTime,value:(S.lastIndexTime??0).toFixed(2),unit:"ms",color:m.green})]},"index-core")),S.cacheSize&&ie.push(te("div",{className:`${oe} ${A.emerald} border-l-4`,children:[te("div",{className:`${F} ${m.emerald}`,children:["\u{1F4BE} ",o.statsCacheHeading]}),P(_,{label:o.statCacheNgram,value:r(S.cacheSize.ngram??0),color:m.emerald}),P(_,{label:o.statCacheWord,value:r(S.cacheSize.word??0),color:m.emerald}),P(_,{label:o.statCachePhonetic,value:r(S.cacheSize.phonetic??0),color:m.emerald})]},"index-cache")),S.indexMetadata)){let W=Object.entries(S.indexMetadata).slice(0,6);W.length>0&&ie.push(te("div",{className:`${oe} ${A.teal} border-l-4`,children:[te("div",{className:`${F} ${m.teal}`,children:["\u{1F4CB} ",o.statsIndexMetadataHeading]}),W.map(([O,q])=>{let pe;if(typeof q=="number"){let Se=O.toLowerCase();Se.includes("time")&&!Se.includes("timestamp")?pe=`${q.toFixed(2)}ms`:Se.includes("timestamp")||Se.includes("at")?pe=be(q)??q.toString():pe=r(q)}else pe=String(q);return P(_,{label:O,value:pe,color:m.teal},O)})]},"index-meta"))}if(k){if(ie.push(te("div",{className:`${oe} ${A.purple} border-l-4`,children:[te("div",{className:`${F} ${m.purple}`,children:["\u{1F522} ",o.statsCalculationsHeading]}),P(_,{label:o.statTotalCalculations,value:r(L.totalCalculations??0),color:m.purple}),P(_,{label:o.statDistanceCalculations,value:r(L.totalDistanceCalculations??0),color:m.purple}),P(_,{label:o.statAverageDistance,value:typeof L.averageDistance=="number"?L.averageDistance.toFixed(2):"0.00",color:m.purple}),P(_,{label:o.statMinDistance,value:L.minDistance??o.notAvailable,color:m.purple}),P(_,{label:o.statMaxDistance,value:L.maxDistance??0,color:m.purple})]},"lev-basic")),ie.push(te("div",{className:`${oe} ${A.fuchsia} border-l-4`,children:[te("div",{className:`${F} ${m.fuchsia}`,children:["\u{1F3AF} ",o.statsMatchesHeading]}),P(_,{label:o.statPartialMatches,value:r(L.partialMatches??0),color:m.fuchsia}),P(_,{label:o.statPerfectMatches,value:r(L.perfectMatches??0),color:m.fuchsia}),P(_,{label:o.statEarlyTerminations,value:r(L.earlyTerminations??0),color:m.fuchsia})]},"lev-match")),L.similarityThresholds&&ie.push(te("div",{className:`${oe} ${A.rose} border-l-4`,children:[te("div",{className:`${F} ${m.rose}`,children:["\u{1F4C8} ",o.statsSimilarityHeading]}),P(_,{label:o.statAbove80,value:r(L.similarityThresholds.above80??0),color:m.emerald}),P(_,{label:o.statAbove60,value:r(L.similarityThresholds.above60??0),color:m.lime}),P(_,{label:o.statAbove40,value:r(L.similarityThresholds.above40??0),color:m.orange}),P(_,{label:o.statBelow40,value:r(L.similarityThresholds.below40??0),color:m.red})]},"lev-similarity")),L.distanceDistribution){let W=Object.entries(L.distanceDistribution).sort(([,O],[,q])=>Number(q)-Number(O)).slice(0,6);W.length>0&&ie.push(te("div",{className:`${oe} ${A.indigo} border-l-4`,children:[te("div",{className:`${F} ${m.indigo}`,children:["\u{1F4CA} ",o.statsDistanceHeading]}),W.map(([O,q])=>P(_,{label:o.statDistance(O),value:r(Number(q)),unit:o.timesUnit(r(Number(q))),color:m.indigo},O))]},"lev-distance"))}if(L.queryLengthStats){let W=Object.entries(L.queryLengthStats).sort(([,O],[,q])=>(q.count??0)-(O.count??0)).slice(0,6);W.length>0&&ie.push(te("div",{className:`${oe} ${A.violet} border-l-4`,children:[te("div",{className:`${F} ${m.violet}`,children:["\u{1F4CF} ",o.statsQueryLengthHeading]}),W.map(([O,q])=>{let pe=Number(q.count??0),Se=Number(q.averageScore??0);return P(_,{label:o.statQueryLength(O),value:o.statQueryLengthValue({count:pe,averagePercent:(Se*100).toFixed(1)}),color:m.violet},O)})]},"lev-query-length"))}}if(Object.keys(T).length>0){let W=Object.entries(T).sort(([,O],[,q])=>(q.averageScore??0)-(O.averageScore??0)).slice(0,6);ie.push(te("div",{className:`${oe} ${A.purple} border-l-4`,children:[te("div",{className:`${F} ${m.purple}`,children:["\u{1F4CB} ",o.statsFieldPerformanceHeading]}),W.map(([O,q])=>{let pe=q;return te("div",{className:`space-y-1 rounded ${X.purple} p-2 transition-colors`,children:[P("div",{className:`font-semibold ${m.purple} text-xs transition-colors`,children:O}),P(_,{label:o.statAverageScore,value:`${((pe.averageScore??0)*100).toFixed(1)}%`,color:m.purple}),P(_,{label:o.statMatchCount,value:r(pe.matchCount??0),unit:o.itemsUnit(r(pe.matchCount??0)),color:m.purple}),P(_,{label:o.statBestWorstScore,value:`${((pe.bestScore??0)*100).toFixed(1)}% / ${((pe.worstScore??0)*100).toFixed(1)}%`,color:m.purple})]},O)})]},"field-performance"))}if(N.bestPerformingField||N.totalHistoryEntries||N.similarityDistribution){let W=(N.recentAverageResultCount??0).toFixed(1);ie.push(te("div",{className:`${oe} ${A.blue} border-l-4`,children:[te("div",{className:`${F} ${m.blue}`,children:["\u{1F50D} ",o.statsInsightsHeading]}),N.bestPerformingField&&P(_,{label:o.statBestField,value:N.bestPerformingField,color:m.blue}),P(_,{label:o.statRecentAverageTime,value:(N.recentAverageProcessingTime??0).toFixed(2),unit:"ms",color:m.blue}),P(_,{label:o.statRecentAverageResults,value:W,unit:o.itemsUnit(W),color:m.blue}),P(_,{label:o.statThroughput,value:(N.throughputPerSecond??0).toFixed(2),unit:o.throughputUnit,color:m.blue}),P(_,{label:o.statCommonQueryLength,value:r(N.mostCommonQueryLength??0),unit:o.charactersUnit(r(N.mostCommonQueryLength??0)),color:m.blue}),P(_,{label:o.statHistoryEntries,value:r(N.totalHistoryEntries??0),color:m.blue}),N.similarityDistribution&&te("div",{className:"mt-1 grid grid-cols-2 gap-1",children:[P(_,{label:o.statHighSimilarity,value:r(N.similarityDistribution.highSimilarity??0),color:m.emerald}),P(_,{label:o.statMediumSimilarity,value:r(N.similarityDistribution.mediumSimilarity??0),color:m.lime}),P(_,{label:o.statLowSimilarity,value:r(N.similarityDistribution.lowSimilarity??0),color:m.orange}),P(_,{label:o.statVeryLowSimilarity,value:r(N.similarityDistribution.veryLowSimilarity??0),color:m.red})]})]},"performance-insights"))}return U.length>0&&ie.push(te("div",{className:`${oe} ${A.sky} border-l-4`,children:[te("div",{className:`${F} ${m.sky}`,children:["\u{1F4C8} ",o.statsRecentHistoryHeading]}),U.slice(-3).reverse().map((W,O)=>te("div",{className:`rounded ${X.sky} p-2 transition-colors`,children:[P("div",{className:`font-medium ${m.sky} transition-colors`,children:W.operationType}),P("div",{className:`${m.sky} text-xs transition-colors`,children:o.statsHistoryEntry({processingTimeMs:W.processingTime.toFixed(2),resultCount:W.resultCount??0})}),be(W.timestamp)&&P("div",{className:`${w} ${m.sky} transition-colors`,children:be(W.timestamp)})]},`${W.operationType}-${W.timestamp??O}`))]},"recent-history")),te("section",{className:"space-y-2",children:[te("div",{className:`flex items-center gap-2 font-semibold text-xs ${a}`,children:[P("span",{children:t}),P("span",{className:"tracking-wide",children:H})]}),P("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:ie})]})});vn.displayName="WorkerStatsSection";import{jsx as Ue,jsxs as ze}from"react/jsx-runtime";var Ic={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Ma=Hc(({performanceMetrics:e,searchTerm:t,totalDataCount:n,resultsCount:a,resetStats:i,rebuildIndex:o,isIndexBuilding:r,activeTab:u,onTabChange:d})=>{let{locale:c,labels:f}=Pe(),p=t.trim(),l=p?a:n,{setScrollableRef:g,onPointerDown:b,onPointerMove:v,onPointerUp:T,onPointerLeave:N,onPointerCancel:U,onClickCapture:z}=Pt(),y=u!=="index"||r,h=r?f.statsRebuildingTitle:u!=="index"?f.statsRebuildIndexTabOnlyTitle:f.statsRebuildTitle,C=y?`cursor-not-allowed ${M.muted} ${s.fgMuted}`:`${Te.blue} ${s.onPrimary} ${zt.blue}`,k=r?`\u23F3 ${f.statsRebuilding}`:`\u{1F3D7}\uFE0F ${f.statsRebuild}`,H=Fc(()=>{o().catch(()=>{})},[o]);return ze("div",{className:`wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border ${A.blue} ${M.surface} p-1.5 shadow-md transition-colors`,children:[ze("div",{className:`mb-0.5 flex shrink-0 flex-col gap-1 rounded ${X.blue} px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between`,children:[ze("h3",{className:`font-semibold ${s.fgSecondary} text-xs transition-colors`,children:["\u{1F4CA} ",f.searchStatistics]}),ze("div",{className:"flex flex-wrap gap-1.5",children:[Ue("button",{type:"button",onClick:H,disabled:y,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${C}`,title:h,children:k}),ze("button",{type:"button",onClick:i,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded ${Te.red} px-1.5 ${x} ${s.onPrimary} transition-colors ${zt.red}`,title:f.statsResetTitle,children:["\u{1F504} ",f.reset]})]})]}),Ue("div",{className:"mb-0 shrink-0",children:ze("div",{ref:g,role:"tablist","aria-label":f.statsTabsLabel,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-md ${M.muted} p-0.5 transition-colors`,style:Ic,onPointerDown:b,onPointerMove:v,onPointerUp:T,onPointerLeave:N,onPointerCancel:U,onClickCapture:z,children:[ze("button",{type:"button",role:"tab","aria-selected":u==="overview",onClick:()=>d("overview"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${u==="overview"?`${Te.blue} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CB} ",f.statsOverviewTab]}),ze("button",{type:"button",role:"tab","aria-selected":u==="index",onClick:()=>d("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${u==="index"?`${Te.green} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CA} ",f.statsIndexTab]}),ze("button",{type:"button",role:"tab","aria-selected":u==="levenshtein",onClick:()=>d("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${u==="levenshtein"?`${Te.purple} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CF} ",f.statsLevenshteinTab]})]})}),ze("div",{className:"flex flex-col gap-1 pb-0.5",children:[ze("div",{className:`${u==="overview"?"grid":"hidden"} grid-cols-1 gap-2 pr-1 ${s.fgMuted} text-xs transition-colors sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4`,children:[Ue(_,{label:f.statTotalSearches,value:ne(c,e.totalSearches)}),Ue(_,{label:f.statAverageSearchTime,value:e.averageSearchTime.toFixed(1),unit:"ms"}),Ue(_,{label:f.statDataCount,value:ne(c,e.itemCount)}),Ue(_,{label:p?f.statResultCount:f.statDisplayedCount,value:ne(c,l)})]}),Ue("div",{className:`${u==="index"?"space-y-3":"hidden"} pr-1 ${s.fgMuted} text-xs transition-colors`,children:Ue(vn,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:m.green})}),Ue("div",{className:`${u==="levenshtein"?"space-y-3":"hidden"} pr-1 ${s.fgMuted} text-xs transition-colors`,children:Ue(vn,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:m.purple})}),ze("div",{className:"hidden",children:[Ue(vn,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:m.green}),Ue(vn,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:m.purple})]})]})]})});Ma.displayName="StatisticsPanel";import{Fragment as ai,jsx as ce,jsxs as Re}from"react/jsx-runtime";var qc=/[\u200B\uFEFF]/g,Ea=typeof window<"u",ii=Ea&&typeof document<"u",kr=(e,t=[],n=!1)=>{let a=oi(e);a.current=e,Ct(()=>{if(!(!Ea||n&&!ii))return a.current()},[n,...t])},ei=(e,t,n)=>{let[a,i]=et(()=>{let o=ti(r=>r.getItem(e));return o&&t.includes(o)?o:n});return kr(()=>{ti(o=>{o.setItem(e,a)})},[e,a]),[a,i]},ti=e=>{if(!Ea)return null;try{return e(window.sessionStorage)}catch{return null}},ni=(e,t)=>{let[n,a]=et(e);return Ct(()=>{let i=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(i)}},[e,t]),n},Yc="contact-map.settings-tab",Xc="contact-map.statistics-tab",Qc=["basic","advanced","index","levenshtein"],Jc=["overview","index","levenshtein"],ri=["full_name","company_name","department","title","email","company_phone_number","mobile_phone_number"],Zc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},si=({streamState:e,...t}={})=>e===void 0?ce(ed,{...t}):ce(li,{...t,streamState:e}),ed=e=>{let{context:t}=gr();return ce(li,{...e,streamState:t})},td={setting:"ContactMapSearchPage workerUrls",keys:["indexWorker","levenshteinWorker"],hints:{treeWorker:"set treeWorker on ContactMapConfigProvider or ContactMapAppView"}},li=e=>{let{streamState:t,onFooterVisibilityChange:n,children:a}=e,i=Le(e,"workerUrls"),o=bt(),{locale:r,labels:u}=Pe(),{contactMapRecords:d,contactMapRecordMap:c,isStreamingComplete:f,isStreamingFailed:p}=t,l=jc(),[g]=Gc(),b=oi(null),[v,T]=et(!0),[N,U]=et(o.openEmailsWithGmail??!1),{indexWorker:z,levenshteinWorker:y}=gn(o.workerUrls,i,td),[h,C]=et(()=>hr({indexWorker:z,levenshteinWorker:y})),[k,H]=et(g.get("q")||""),S=ni(k,h.debounceMs??Bc.debounceMs);Ct(()=>{let V=g.get("q")||"";H(Z=>Z!==V?V:Z)},[g]),Ct(()=>{if(typeof window>"u")return;let V=new URL(window.location.href);(V.searchParams.get("q")||"")!==S&&(S?V.searchParams.set("q",S):V.searchParams.delete("q"),window.history.replaceState(window.history.state,"",V.toString()))},[S]);let[L,oe]=Kc(),[F,be]=et("search"),[ie,W]=ei(Yc,Qc,"basic"),[O,q]=ei(Xc,Jc,"overview"),{setScrollableRef:pe,onPointerDown:Se,onPointerMove:$e,onPointerUp:$t,onPointerLeave:Qt,onPointerCancel:vt,onClickCapture:Jt}=Pt(),Ce=xn(()=>{if(!ii)return;let V=b.current;!V||document.activeElement===V||window.requestAnimationFrame(()=>{try{V.focus({preventScroll:!0})}catch{}})},[]),Zt=xn(V=>{let Z=V;be(Z),Z==="search"&&Ce()},[Ce]),Ve=_t(()=>({...h,debounceMs:0}),[h]),[ut,Ke]=et("union"),He=ut==="intersection",en=He?u.operatorAndTitle:u.operatorOrTitle,xt=xn(V=>zc(V,ut),[ut]),Y=_t(()=>({querySetsOf:xt}),[xt]),ye=ni(d,f?0:800),{searchTerm:J,setSearchTerm:mt,filteredItems:Ot,resultTerm:Nn,isSearching:Tt,isIndexBuilding:Oe,clearSearch:Mn,resetStats:En,performanceMetrics:tt,rebuildIndex:Nt,error:nt}=Uc(ye,ri,Ve,Y),Dt=J.trim().length>0,[Mt,Wt]=et(""),[tn,Rr]=et(()=>J),Et=_t(()=>rr(k),[k]),je=_t(()=>rr(S),[S]);Ct(()=>{S===Mt&&je===J||oe(()=>{Wt(S),mt(je)})},[S,Mt,je,J,mt]);let Ln=xn(V=>{let xe=V.target.value.replace(qc,"");H(xe)},[]),Pr=xn(()=>{H(""),Wt(""),Mn(),Ce()},[Mn,Ce]),Bn=xn(()=>{Ke(V=>V==="intersection"?"union":"intersection"),Ce()},[Ce]);kr(()=>{if(!(F==="search"&&l.state==="idle"&&!L))return;let Z=document.activeElement;if(!!!(Z?.matches('[role="tab"]')||Z?.closest('[role="tablist"]')?.getAttribute("role")==="tablist")&&Z&&Z!==document.body&&Z!==b.current)return;let rt=window.requestAnimationFrame(()=>{Ce()});return()=>{window.cancelAnimationFrame(rt)}},[F,l.state,L,Ce],!0),kr(()=>{if(F!=="search")return;let V=[[document,"visibilitychange",()=>{document.visibilityState==="visible"&&Ce()}],[window,"pageshow",()=>{Ce()}]];for(let[Z,xe,rt]of V)Z.addEventListener(xe,rt);return()=>{for(let[Z,xe,rt]of V)Z.removeEventListener(xe,rt)}},[F,Ce],!0),Ct(()=>(n&&n(F==="search"?"mobile-hidden":"visible"),()=>{n&&n("visible")}),[F,n]),kr(()=>{let V=document.body,Z=V.style.overflow;return F==="search"&&(V.style.overflow="hidden"),()=>{V.style.overflow=Z}},[F],!0),Ct(()=>{tt&<.info("\u{1F4CA} [STATE] \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6307\u6A19\u304C\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F:",{totalSearches:tt.totalSearches,averageSearchTime:tt.averageSearchTime,itemCount:tt.itemCount,resultsCount:tt.resultsCount,workersAvailable:!!tt.workerStats})},[tt]);let{isAwaitingDebounce:zn,isAwaitingSearchTermSync:Un,isSearchInProgress:pt}=_t(()=>{let V=Et!==je,Z=je!==J,xe=J.trim().length>0||Et.trim().length>0;return{isAwaitingDebounce:V,isAwaitingSearchTermSync:Z,isSearchInProgress:L||Tt||Nn!==J&&nt===null||xe&&Oe||V||Z||tn!==J}},[Et,je,J,Nn,nt,L,Tt,Oe,tn]),[nn,Vn]=et(J);Ct(()=>{nn!==J&&Vn(J)},[J,nn]),Ct(()=>{zn||Un||L||Tt||Oe||nn===J&&tn!==J&&Rr(J)},[J,tn,zn,Un,L,Tt,Oe,nn]);let kn=_t(()=>eo(Mt,ri),[Mt]),Kn=_t(()=>kn(Ot),[kn,Ot]),jn=_t(()=>({contactMapRecords:d,contactMapRecordMap:c,filteredItems:Kn,searchQuery:Mt,searchTerm:J,isSearching:Tt,isIndexBuilding:Oe,isPending:L,hasSearchTerm:Dt,enableHighlighting:v,openEmailsWithGmail:N,isSearchInProgress:pt,isSearchTabActive:F==="search",errorMessage:nt??null,isStreamingComplete:f,isStreamingFailed:p}),[d,c,Kn,Mt,J,Tt,Oe,L,Dt,v,N,pt,F,nt,f,p]),_r=Dt?Ot.length:d.length,wn=ne(r,d.length),D=ne(r,Ot.length),fe=`${`scrollbar-hidden ${M.subtle} ${s.fg}`}${F==="search"?" h-full min-h-0":""}`;return ce("div",{"data-contact-map-search-page":"",className:fe,children:Re(lr,{value:F,onValueChange:Zt,className:`flex flex-col${F==="search"?" h-full min-h-0":""}`,children:[Re(On,{ref:pe,"data-contact-map-page-tabs":"",style:Zc,className:`scrollbar-none mt-0 mb-1 flex h-auto w-full touch-pan-x flex-nowrap overflow-x-auto overflow-y-hidden rounded-md ${M.subtle} transition-colors ${s.fgSecondary}`,onPointerDown:Se,onPointerMove:$e,onPointerUp:$t,onPointerLeave:Qt,onPointerCancel:vt,onClickCapture:Jt,children:[Re(Vt,{value:"search",className:`min-h-11 min-w-16 px-2 py-0 ${x} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u{1F50D} ",u.searchTab]}),Re(Vt,{value:"settings",className:`min-h-11 min-w-16 px-2 py-0 ${x} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u2699\uFE0F ",u.searchSettings]}),Re(Vt,{value:"statistics",className:`min-h-11 min-w-16 px-2 py-0 ${x} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u{1F4CA} ",u.searchStatistics]})]}),ce(Kt,{value:"search",className:"mt-0 flex h-full min-h-0 flex-col overflow-hidden",children:Re("div",{className:"flex h-full flex-col",children:[ce("div",{className:`rounded-md border ${I.borderSubtle} ${M.surface} shadow-sm transition-colors`,children:Re("div",{className:"flex flex-col",children:[ce("div",{className:"relative",children:Re("div",{className:"flex items-center gap-1 p-1",children:[Re("button",{type:"button",onClick:Bn,"aria-pressed":He,title:en,className:`inline-flex min-h-11 min-w-11 items-center justify-center gap-0.5 rounded border px-1.5 font-semibold ${x} transition-colors sm:min-w-12 sm:px-2 ${He?`border-transparent ${Te.blue} ${s.onPrimary} ${zt.blue}`:`${Ia.amber} ${X.amber} ${m.amber} ${E.hoverSurface}`}`,children:[ce("span",{children:He?u.operatorAnd:u.operatorOr}),ce("span",{className:`hidden ${w} sm:inline`,children:He?u.operatorAndHint:u.operatorOrHint})]}),ce("input",{ref:b,"data-contact-map-search-field":"",type:"text",value:k,onChange:Ln,placeholder:u.searchPlaceholder,className:`min-h-11 flex-1 rounded border ${I.borderControl} border-solid px-2 pointer-coarse:text-base ${x} shadow-sm transition-colors ${E.focusBorder} focus:ring-1 ${E.focusRing} ${M.surface} ${s.fg}`}),k&&ce("button",{type:"button",onClick:Pr,className:`flex min-h-11 min-w-11 items-center justify-center gap-1 rounded border ${I.borderControl} px-1.5 ${x} transition-colors ${E.hoverFg} sm:px-2 ${s.fgMuted}`,title:pt?u.searchBusyTitle:u.clearSearch,"aria-label":pt?void 0:u.clearSearch,disabled:pt,children:pt?Re(ai,{children:[ce(Vc,{"aria-hidden":"true",className:"h-3 w-3 animate-spin sm:h-3.5 sm:w-3.5"}),ce("span",{className:"hidden sm:inline",children:u.searching})]}):"\u2715"})]})}),Re("p",{className:`px-1.5 py-0.5 ${w} ${s.fgSecondary} transition-colors`,children:[u.registeredCountLabel," ",ce("span",{className:`font-semibold ${x} ${s.fg}`,children:wn})," ",u.recordUnit(wn),Oe?Re("span",{className:`ml-1.5 inline-flex items-center rounded ${X.blue} px-1.5 py-0.2 ${m.blue}`,children:["\u23F3 ",u.rebuildingIndex]}):null,nt?Re("span",{className:`ml-1.5 inline-flex items-center rounded ${X.rose} px-1.5 py-0.2 ${m.rose}`,children:["\u26A0\uFE0F ",u.errorLabel,ce("span",{className:"ml-1 break-all font-semibold",children:nt})]}):null,Dt&&Re("span",{className:`ml-1.5 ${m.blue}`,children:["| ",u.resultCountLabel,pt?ce("span",{className:"ml-1 font-semibold",children:u.searching}):Re(ai,{children:[ce("span",{className:`ml-1 font-semibold ${x} ${s.fg}`,children:D}),ce("span",{className:"ml-0.5",children:u.resultUnit(D)})]})]})]}),ce("div",{className:"h-2.5 px-2 pb-1.5",children:Oe?ce(So,{className:`h-1 ${kt.progressTrack}`,indicatorClassName:qe.blue}):null})]})}),a?a(jn):ce(Zo,{context:jn})]})}),ce(Kt,{value:"settings",className:"mt-0",children:ce(Ta,{searchOptions:h,setSearchOptions:C,enableHighlighting:v,setEnableHighlighting:T,openEmailsWithGmail:N,setOpenEmailsWithGmail:U,activeTab:ie,onTabChange:W})}),ce(Kt,{value:"statistics",className:"mt-0",children:ce(Ma,{performanceMetrics:tt,searchTerm:J,totalDataCount:d.length,resultsCount:_r,resetStats:En,rebuildIndex:Nt,isIndexBuilding:Oe,activeTab:O,onTabChange:q})})]})})};ge();import{memo as nd,useState as rd}from"react";import{jsx as ci,jsxs as od}from"react/jsx-runtime";var ad=(e,t,n)=>{switch(e){case"retrying":return{phase:e,status:n.annotationReconnecting(t),alert:""};case"failed":return{phase:e,status:"",alert:n.streamLoadFailed(t)};case"unauthenticated":case"forbidden":return{phase:e,status:"",alert:""};case"idle":case"streaming":case"complete":return{phase:e,status:"",alert:""}}},La=nd(({phase:e,loadedCount:t})=>{let n=Q(),[a,i]=rd(()=>({phase:e,status:"",alert:""})),o=a.phase===e?a:ad(e,t,n);return o!==a&&i(o),od("span",{"data-testid":"contact-map-stream-announcer",className:"sr-only",children:[ci("span",{role:"status",children:o.status}),ci("span",{role:"alert",children:o.alert})]})});La.displayName="ContactMapStreamAnnouncer";import{memo as ld,useId as cd,useLayoutEffect as ka,useRef as wr,useState as dd}from"react";ge();var id="[data-contact-map-search-page]",sd=["[data-contact-map-search-field]",'[data-contact-map-page-tabs] [role="tab"][aria-selected="true"]'],di=e=>{for(let t=e;t!==null;t=t.parentElement){let n=t.querySelector(id);if(n!==null)return n}return null},ui=e=>{let{ownerDocument:t}=e,{activeElement:n}=t;if(n!==null&&n!==t.body)return null;for(let a of sd){let i=e.querySelector(a);if(i!==null&&(i.focus(),t.activeElement===i))return i}return null};de();dn();Ee();import{jsx as Xt,jsxs as yd}from"react/jsx-runtime";var mi="shrink-0 pb-2",ud=`flex items-center gap-2 rounded-md border ${A.rose} ${X.rose} px-[11px] py-[3px] ${m.rose} ${x}`,md=`inline-flex min-h-11 min-w-11 shrink-0 items-center justify-center rounded border ${I.borderControl} ${M.surface} px-[11px] font-semibold ${m.rose} ${x} transition-colors ${E.hoverRoseTint} ${st}`,pd=e=>e==="failed"||dr(e),pi=(e,t)=>{ka(()=>{let n=e.current;return()=>{n?.contains(n.ownerDocument.activeElement)&&(t.current=di(n))}},[e,t])},fd=({loadedCount:e,errorMessage:t,onRetry:n,leftWithFocusRef:a})=>{let i=Q(),o=cd(),r=wr(null);return pi(r,a),Xt("div",{className:mi,children:yd("div",{ref:r,role:"group","aria-labelledby":o,"data-testid":"contact-map-stream-failure-notice","data-phase":"failed",className:ud,children:[Xt("span",{"aria-hidden":"true",children:"\u26D4"}),Xt("span",{id:o,className:"min-w-0 flex-1 font-medium",title:t??void 0,children:i.streamLoadFailed(e)}),Xt("button",{type:"button","data-testid":"contact-map-retry-button","aria-describedby":o,onClick:n,className:md,children:i.streamRetry})]})})},gd=(e,t)=>Object.freeze({kind:e,place:"read",deniedSentence:null,retry:t}),hd=({kind:e,onRetry:t,accessFailure:n,leftWithFocusRef:a})=>{let i=wr(null),o=wr(t);ka(()=>{o.current=t});let[r]=dd(()=>gd(e,()=>o.current()));return pi(i,a),Xt("div",{ref:i,"data-testid":"contact-map-stream-access-failure","data-phase":e,className:mi,children:n(r)})},wa=ld(({phase:e,accessFailureNumber:t,loadedCount:n,errorMessage:a,onRetry:i,accessFailure:o})=>{ur(o,"ContactMapStreamFailureNotice accessFailure"),so(t,"ContactMapStreamFailureNotice accessFailureNumber");let r=wr(null);return ka(()=>{let u=r.current;u!==null&&(r.current=null,ui(u))}),pd(e)?e==="failed"?Xt(fd,{loadedCount:n,errorMessage:a,onRetry:i,leftWithFocusRef:r}):Xt(hd,{kind:e,onRetry:i,accessFailure:o,leftWithFocusRef:r},t):null});wa.displayName="ContactMapStreamFailureNotice";import{jsx as At,jsxs as gi}from"react/jsx-runtime";var bd=({accessFailure:e,renderHeader:t,title:n,onFooterVisibilityChange:a})=>{let i=Q(),o=n===void 0?i.appTitle:n,{context:r,retryNow:u}=gr(),d=At(oa,{recordCount:r.contactMapRecords.length,companyCount:r.companyCount,phase:r.streamPhase,loadedCount:r.loadedCount,totalCount:r.totalCount});return gi("div",{"data-testid":"contact-map-app-view",className:"flex h-full w-full flex-col",children:[At(La,{phase:r.streamPhase,loadedCount:r.loadedCount}),t?t({title:o,annotation:d}):gi("div",{"data-testid":"contact-map-default-header",className:"mb-2 flex items-center justify-between",children:[At("h1",{className:"font-bold text-xl",children:o}),d]}),At(wa,{phase:r.streamPhase,accessFailureNumber:r.streamAccessFailureNumber,loadedCount:r.loadedCount,errorMessage:r.errorMessage,onRetry:u,accessFailure:e}),At("div",{className:"min-h-0 flex-1",children:At(si,{streamState:r,onFooterVisibilityChange:a})})]})},Th=e=>{let t=Le(e,"accessFailure");ur(t,"ContactMapAppView accessFailure");let n=bt(),a=Le(e,"streamEndpoint"),i=Le(e,"workerUrls"),o=Le(e,"locale"),r=Le(e,"labels"),u=fi(()=>({...n,streamEndpoint:a===void 0?n.streamEndpoint:a,workerUrls:gn(n.workerUrls,i,{setting:"ContactMapAppView workerUrls"}),locale:o===void 0?n.locale:o,labels:r===void 0?n.labels:r}),[n,a,i,o,r]),d=o!==void 0,c=r!==void 0,f=fi(()=>({locale:d?"ContactMapAppView locale":"locale",labels:c?"ContactMapAppView labels":"labels"}),[d,c]);return At(sa,{config:u,chromeSurface:f,children:At(bd,{...e,accessFailure:t})})};Bt();ge();import{createShouldRevalidate as Sd}from"@aiquants/route-revalidation";var kh=Sd({submissions:"url",query:{ignore:[hn,"q"]}});export{Vr as AdvancedSearchSettings,Kr as BasicSearchSettings,ht as CONTACT_MAP_LABEL_CATALOGS,Pn as CONTACT_MAP_LABEL_KEYS,to as ContactDetailGrid,fn as ContactDetailPanel,tr as ContactDetailPopup,nr as ContactDetailRowLayout,oa as ContactMapAnnotation,Th as ContactMapAppView,Gs as ContactMapConfigProvider,Wo as ContactMapSearchListView,si as ContactMapSearchPage,Zo as ContactMapSearchTabGroup,Jo as ContactMapSearchTreeView,La as ContactMapStreamAnnouncer,mr as ContactMapStreamClient,wa as ContactMapStreamFailureNotice,Ne as HighlightedText,Ca as IndexWorkerSettings,$p as LIST_COLLAPSE_THRESHOLD,zl as LIST_DETAIL_PANEL_MIN_WIDTH,Op as LIST_EXPAND_THRESHOLD,Bl as LIST_PANEL_MIN_WIDTH,Ul as LIST_RESIZE_HANDLE_THICKNESS,xa as LevenshteinWorkerSettings,So as Progress,Ta as SearchOptionsPanel,_ as StatItem,Ma as StatisticsPanel,xr as SwipeOverlay,Sf as TREE_COLLAPSE_THRESHOLD,yc as TREE_DETAIL_PANEL_MIN_WIDTH,Cf as TREE_EXPAND_THRESHOLD,hc as TREE_PANEL_MIN_WIDTH,bc as TREE_RESIZE_HANDLE_THICKNESS,lr as Tabs,Kt as TabsContent,On as TabsList,Vt as TabsTrigger,Mr as TreeWorkerSession,vn as WorkerStatsSection,pr as assertContactMapStreamEndpoint,mo as assertContactMapTreeWorkerUrl,Nm as assertContactMapWorkerUrls,xc as composeTreeVirtualScrollOptions,kh as contactMapShouldRevalidate,il as countContactMapCompanies,Js as deserializeStreamRecord,tl as getContactMapStreamClient,sc as getTreeWorkerSession,gn as layerContactMapWorkerUrls,Bm as resetContactMapStreamClientForTesting,Gp as resetTreeWorkerSessionForTesting,Fr as resolveContactMapLabels,Ho as useAnimatedNumber,bt as useContactMapConfig,Q as useContactMapLabels,ol as useContactMapStream,ma as useContactPanelSizing,Co as useDynamicViewportHeight,Pt as useHorizontalDragScroll,Sr as useLongPressPopup,Ql as useReportPopupVisibility,Cr as useResponsiveTwoColumnLayout,Xl as useRowPopupRegistry,gr as useStreamedContactMapContext,Uo as useTreeWorker};
|
|
1
|
+
var yi=Object.defineProperty;var Me=(e,t)=>()=>(e&&(t=e(e=0)),t);var bi=(e,t)=>{for(var n in t)yi(e,n,{get:t[n],enumerable:!0})};var Ge,Ht,_a,rn,an,Rn,gt,Fe,Gn,$r,Or,at,re,Ft=Me(()=>{"use strict";Ge=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},Ht=e=>!e||typeof e!="object"?null:"item"in e?e.item??null:"person_id"in e?e:null,_a=(e,t)=>{if(!e)return{value:null,fieldKey:null};for(let n of t){let a=Ge(e[n]);if(a)return{value:a,fieldKey:n}}return{value:null,fieldKey:null}},rn=e=>_a(e,["custom_email","email"]),an=e=>_a(e,["custom_mobile_phone_number","mobile_phone_number","company_phone_number"]),Rn=e=>{let t=Ge(e);if(!t)return null;let n=t.replace(/[^0-9+#*]/g,"");return n.length===0?null:`tel:${n}`},gt=(e,t)=>{let n=Ge(e);return n?t?`https://mail.google.com/mail/?view=cm&fs=1&to=${encodeURIComponent(n)}`:`mailto:${encodeURIComponent(n)}`:null},Fe=(e,t)=>String(e).padStart(t,"0"),Gn=e=>`${Fe(e.getUTCFullYear(),4)}-${Fe(e.getUTCMonth()+1,2)}-${Fe(e.getUTCDate(),2)}`,$r=e=>`${Gn(e)} ${Fe(e.getUTCHours(),2)}:${Fe(e.getUTCMinutes(),2)}:${Fe(e.getUTCSeconds(),2)}`,Or=e=>`${Fe(e.getFullYear(),4)}-${Fe(e.getMonth()+1,2)}-${Fe(e.getDate(),2)} ${Fe(e.getHours(),2)}:${Fe(e.getMinutes(),2)}:${Fe(e.getSeconds(),2)}`,at=(e,t)=>{if(e==null||e==="")return"-";let n=typeof e=="string"?new Date(e):e;return Number.isNaN(n.getTime())?typeof e=="string"?e:"-":t(n)},re=e=>e==null?"-":typeof e=="string"?Ge(e)??"-":typeof e=="number"?Number.isFinite(e)?String(e):"-":String(e)});var ee,Aa,Lt=Me(()=>{"use strict";ee=e=>{switch(typeof e){case"string":return JSON.stringify(e);case"bigint":return`${e}n`;case"symbol":return e.toString();case"object":return e===null?"null":Aa(e);case"function":return Aa(e);case"number":return Object.is(e,-0)?"-0":String(e);default:return String(e)}},Aa=e=>{try{return Object.prototype.toString.call(e)}catch{return"[object ?]"}}});var on,Le,sn=Me(()=>{"use strict";on=e=>{if(typeof e!="object"||e===null)return!1;try{let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}catch{return!1}},Le=(e,t)=>Object.hasOwn(e,t)?e[t]:void 0});var Si,qn,Dr=Me(()=>{"use strict";Si=(e,t)=>{let n=Array.from({length:t.length+1},(a,i)=>i);for(let a=1;a<=e.length;a+=1){let i=[a];for(let o=1;o<=t.length;o+=1){let r=n[o-1]+(e[a-1]===t[o-1]?0:1);i.push(Math.min(n[o]+1,i[o-1]+1,r))}n=i}return n[t.length]},qn=(e,t)=>{let n=e.toLowerCase();if(n.length>=3){let i=t.find(o=>o.toLowerCase().startsWith(n));if(i!==void 0)return i}let a;for(let i of t){let o=Si(n,i.toLowerCase());o<=Math.max(1,Math.floor(i.length/4))&&(a===void 0||o<a.distance)&&(a={key:i,distance:o})}return a?.key}});import{DIRECTORY_TREE_LABEL_CATALOGS as $a,DIRECTORY_TREE_LABEL_KEYS as Wr,resolveDirectoryTreeLabels as Ci}from"@aiquants/directory-tree";import{resolveVirtualScrollLocale as vi,VIRTUAL_SCROLL_LABEL_KEYS as xi}from"@aiquants/virtualscroll";var Ti,ne,It,Xn,Da,Pn,ht,Ni,Oa,Wa,Mi,Hr,Ei,Li,ki,Fr,Ir,Br,Bt=Me(()=>{"use strict";Ft();Lt();sn();Dr();Ti=Object.freeze({en:"en-US",ja:"ja-JP"}),ne=(e,t)=>t.toLocaleString(Ti[e]),It=(e,t,n)=>e==="1"?t:n,Xn=Object.freeze({en:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"Total:",annotationCompaniesLabel:"Companies:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`Streaming (${ne("en",e)} / ${ne("en",t)} \xB7 ${n}%)`,annotationStreamingCount:e=>`Streaming (${ne("en",e)} loaded)`,streamLoadFailed:e=>`Failed to load (${ne("en",e)} received)`,annotationReconnecting:e=>`Reconnecting (${ne("en",e)} received)`,streamRetry:"Retry",recordUnit:e=>It(e,"record","records"),companyUnit:e=>It(e,"company","companies"),searchTab:"Fuzzy search",searchSettings:"Search settings",searchStatistics:"Search statistics",operatorAndTitle:"AND search (all terms match)",operatorOrTitle:"OR search (any term matches)",operatorAnd:"AND",operatorOr:"OR",operatorAndHint:"All terms",operatorOrHint:"Any term",searchPlaceholder:"Fuzzy search...",searchBusyTitle:"Searching",clearSearch:"Clear search",searching:"Searching...",registeredCountLabel:"Registered:",rebuildingIndex:"Rebuilding index...",errorLabel:"Error:",resultCountLabel:"Results:",resultUnit:e=>It(e,"match","matches"),listViewTab:"List",treeViewTab:"Tree",columnNo:"No",columnId:"ID",columnScore:"Score",columnName:"Name",columnTitle:"Title",columnCompany:"Company",columnDepartment:"Department",columnPhone:"Phone",columnEmail:"Email",columnUpdatedAt:"Updated",listRowNumber:e=>`No. ${e}`,listNoSearchResults:"No search results found",listNoData:"No data",listboxLabel:"Contact list",listKeyboardHelp:"Up and down arrows move between contacts, Page Up and Page Down move by a screen, Home and End go to the first and the last; Enter or Space opens the contact's details.",listResizeHandle:"Resize the border between the contact list and the detail pane",detailHeading:"Contact details",close:"Close",noName:"(No Name)",treeNodeCountTitle:"Number of nodes built in the tree view",treeNodeCountLabel:"Nodes:",treeNodeCount:e=>ne("en",e),uncategorizedCompany:"Uncategorized",treeDirectoryName:(e,t)=>`${e} (${ne("en",t)})`,treeStreamInterruptedTitle:"Streaming was interrupted. Only the data received so far is shown",treeStreamInterrupted:"Interrupted",treeStreamLoadingTitle:"Receiving data streamed from the network",treeStreamLoading:"Loading...",treeBuildingTitle:"Building and expanding the directory tree from the received data",treeBuilding:"Treeing...",treeCompleteTitle:"Every tree node has been built",treeComplete:"Complete",treeShowEntireCompanyTitle:"Show the whole company of every search hit",treeShowEntireCompany:"Whole company",treeExpandAll:"Expand all directories",treeExpandAllTitle:"Expand all",treeCollapseAll:"Collapse all directories",treeCollapseAllTitle:"Collapse all",treeNoMatches:"No contacts match the criteria",treeEmpty:"No contacts to display",treeResizeHandle:"Resize the border between the directory tree and the detail pane",copyField:e=>`Copy ${e}`,detailEmptyTitle:"Select a contact to see its details",detailEmptyHint:"Choose a person from the list",detailTabSummary:"Summary",detailTabBasic:"Basic info",detailBasicProfile:"Profile",detailTabContact:"Contact",detailTabMeta:"Metadata",preferred:"Preferred",summaryEmail:"Email",summaryPhone:"Phone",summaryLastContact:"Last contact",sectionEmail:"Email",sectionEmailEmpty:"No email addresses registered",sectionPhone:"Phone / Fax",sectionPhoneEmpty:"No phone numbers registered",fieldFullName:"Name",fieldFullNameReading:"Name (reading)",fieldTitle:"Title",fieldDepartment:"Department",fieldCompanyName:"Company",fieldCompanyNameReading:"Company (reading)",fieldAddress:"Address",fieldPostalCode:"Postal code",fieldUrl:"URL",fieldCustomEmail:"Custom email",fieldEmail:"Email",fieldCustomMobilePhone:"Custom mobile",fieldMobilePhone:"Mobile",fieldCompanyPhone:"Company phone",fieldCompanyFax:"Company fax",fieldCreatedBy:"Created by",fieldCreatedAt:"Created at",fieldUpdatedBy:"Updated by",fieldUpdatedAt:"Updated at",recordDateTime:$r,recordDate:Gn,popupCustomMobilePhone:"Mobile (custom)",popupMobilePhone:"Mobile",popupCustomCompanyPhone:"Company phone (custom)",popupCompanyPhone:"Company phone",popupCustomEmail:"Email (custom)",popupEmail:"Email",popupGmailHint:"Double-click or double-tap to open Gmail",popupLastContactDate:"Last contact:",popupNoContactMethods:"No contact information to display",overlayTitle:"Details",settingsResetAllTitle:"Reset all settings",settingsResetAll:"Reset all",settingsTabsLabel:"Search option tabs",settingsBasicTab:"Basic settings",settingsAdvancedTab:"Advanced settings",indexWorkerName:"Index Worker",levenshteinWorkerName:"Levenshtein Worker",currentValueLabel:"Current:",resetToDefaultsTitle:"Reset to defaults",reset:"Reset",relevanceOnlyNotice:"Editable only when sorting by relevance",relevanceWeightsHeading:"Relevance score weights",fieldWeight:"Field weight",scoreTuningHeading:"Score tuning",maxResults:"Maximum results",noLimit:"No limit",basicThresholdHeading:"Final similarity threshold",basicThresholdLabel:"Adjust the minimum score",basicThresholdRangeRelevance:"In relevance mode a score can exceed 1.0 (range: 0.0-1.5)",basicThresholdRange:"Range: 0.0-1.0",basicDisplayHeading:"Display options",basicCaseSensitive:"Case-sensitive",basicHighlight:"Highlight matches",basicOpenEmailsWithGmail:"Open email addresses in Gmail compose",basicMultiTermOperator:"Operator for words inside quotes",basicOperatorOr:"OR (any word matches)",basicOperatorAnd:"AND (all words match)",basicMultiTermHint:'How words between quotation marks ("tanaka taro") are combined (default: AND). Words outside quotation marks are separate keywords combined by the AND / OR button',basicSortHeading:"Sorting",basicSortBy:"Sort by",basicSortByScore:"Score",basicSortByRelevance:"Relevance",basicSortByOriginal:"Original order",basicSortOrder:"Sort order",basicSortDescending:"Descending",basicSortAscending:"Ascending",basicEngineHeading:"Search engine",basicStrategy:"Parallel search strategy",basicStrategyBalanced:"Balanced",basicStrategyIndexFirst:"Index first",basicStrategyLevenshteinFirst:"Levenshtein first",basicIndexFiltering:"Index filtering",basicLevenshtein:"Levenshtein distance",advancedLearningHeading:"Learning weight",advancedLearningLabel:"Weight factor",advancedLearningHint:"Weight applied when re-learning (higher favors past search results)",advancedDebounceHeading:"Debounce time",advancedDebounceLabel:"Input delay (ms)",advancedDebounceHint:"How long input is awaited. Shorter is more real-time, longer reduces load",indexSettingsHeading:"Index Worker settings",indexBuildHeading:"Index build",indexNgramSize:"N-gram size",indexNgramSizeHint:"How many characters each chunk holds. Smaller is faster but less accurate",indexMinNgramOverlap:"Minimum N-gram matches",indexMinNgramOverlapHint:"Candidates with fewer matches are excluded",indexCandidateHeading:"Candidate filtering",indexThreshold:"Index threshold",indexThresholdHint:"Lower bound of the Jaro-Winkler similarity (range: 0.0-1.0)",indexNgramOverlapThreshold:"N-gram overlap threshold",indexNgramOverlapThresholdHint:"How much N-grams must overlap. Higher narrows candidates more strictly",indexStrategyHeading:"Search strategy and candidates",indexStrategy:"Search strategy",indexStrategyFast:"Fast",indexStrategyAccurate:"Accurate",indexStrategyHybrid:"Hybrid (adaptive)",indexStrategyHint:"Balance processing load against accuracy",indexMinCandidatesRatio:"Minimum candidate ratio",indexMinCandidatesRatioHint:"Share of candidates always kept",indexMaxCandidatesRatio:"Maximum candidate ratio",indexMaxCandidatesRatioHint:"Upper bound on candidates; narrowed dynamically when exceeded",indexJaroWinklerPrefix:"Jaro-Winkler prefix weight",indexJaroWinklerPrefixHint:"Bonus given to a matching prefix",indexMaxResultsHint:"Maximum number of results to fetch. Larger is more thorough but slower",indexFieldWeightHint:"How much the number of matched fields counts",indexPerfectMatchBonus:"Exact match bonus",indexPerfectMatchBonusHint:"Bonus added on an exact match",indexContainmentHeading:"Containment score (Japanese / substrings)",indexContainmentBase:"Containment base score (containmentScoreBase)",indexContainmentBaseHint:"Minimum base score when the query is fully contained in the string (rescues short Japanese queries such as 2 characters)",indexContainmentCoverage:"Containment coverage weight (containmentCoverageWeight)",indexContainmentCoverageHint:"Extra score by the query length / field length ratio (total capped at 1.0)",levenshteinSettingsHeading:"Levenshtein Worker settings",levenshteinCandidateHeading:"Candidate filter",levenshteinThreshold:"Levenshtein threshold",levenshteinThresholdHintRelevance:"Keep only results at or above this threshold (range: 0.0-1.5)",levenshteinThresholdHint:"Keep only results at or above this threshold (range: 0.0-1.0)",levenshteinLengthSimilarity:"Length similarity threshold",levenshteinLengthSimilarityHint:"Exclude candidates whose length differs greatly, for speed",levenshteinLengthPenalty:"Length difference penalty",levenshteinLengthPenaltyHint:"How much a length difference is penalized. Larger favors equal lengths",levenshteinResultsHeading:"Result count",levenshteinMaxResultsHint:"Maximum number of results to return. Larger is more thorough but slower",levenshteinFieldWeightHint:"Weight of the number of matched fields",levenshteinPartialBonus:"Partial match bonus",levenshteinPartialBonusHint:"Extra score for a partial match",statsRebuildingTitle:"Rebuilding the index",statsRebuildIndexTabOnlyTitle:"Available on the Index tab only",statsRebuildTitle:"Rebuild the index",statsRebuilding:"Rebuilding...",statsRebuild:"Rebuild Index",statsResetTitle:"Reset statistics",statsTabsLabel:"Statistics tabs",statsOverviewTab:"Overview",statsIndexTab:"Index",statsLevenshteinTab:"Levenshtein",statTotalSearches:"Total searches",statAverageSearchTime:"Average search time",statDataCount:"Data items",statResultCount:"Search results",statDisplayedCount:"Displayed items",statsNoData:"No statistics yet",statsBasicHeading:"Basic statistics",statTotalProcessingTime:"Total processing time",statLastSearchTime:"Last search time",statErrorCount:"Errors",statUpdatedAt:"Statistics updated at",statsTimestamp:Or,statsOperationsHeading:"Operations",statTotalOperations:"Total operations",statsIndexHeading:"Index statistics",statIndexBuilds:"Index builds",statDataSize:"Data size",statLastBuildTime:"Last build time",statsCacheHeading:"Cache statistics",statCacheNgram:"N-gram",statCacheWord:"Words",statCachePhonetic:"Phonetic",statsIndexMetadataHeading:"Index metadata",statsCalculationsHeading:"Calculations",statTotalCalculations:"Total calculations",statDistanceCalculations:"Distance calculations",statAverageDistance:"Average distance",statMinDistance:"Minimum distance",statMaxDistance:"Maximum distance",notAvailable:"N/A",statsMatchesHeading:"Matches",statPartialMatches:"Partial matches",statPerfectMatches:"Exact matches",statEarlyTerminations:"Early terminations",statsSimilarityHeading:"Similarity distribution",statAbove80:"80% or more",statAbove60:"60% or more",statAbove40:"40% or more",statBelow40:"Below 40%",statsDistanceHeading:"Distance distribution (top 6)",statDistance:e=>`Distance ${e}`,statsQueryLengthHeading:"Query lengths (top 6)",statQueryLength:e=>`Length ${e}`,statQueryLengthValue:({count:e,averagePercent:t})=>{let n=ne("en",e);return`${n} ${It(n,"time","times")} / average ${t}%`},statsFieldPerformanceHeading:"Field performance (top 6)",statAverageScore:"Average score",statMatchCount:"Matches",statBestWorstScore:"Best / worst score",statsInsightsHeading:"Performance insights",statBestField:"Best-performing field",statRecentAverageTime:"Recent average processing time",statRecentAverageResults:"Recent average results",statThroughput:"Throughput",statCommonQueryLength:"Most common query length",statHistoryEntries:"History entries",statHighSimilarity:"High similarity",statMediumSimilarity:"Medium similarity",statLowSimilarity:"Low similarity",statVeryLowSimilarity:"Very low similarity",statsRecentHistoryHeading:"Recent history (latest 3)",statsHistoryEntry:({processingTimeMs:e,resultCount:t})=>`Processing time: ${e} ms / results: ${ne("en",t)}`,timesUnit:e=>It(e," time"," times"),itemsUnit:e=>It(e," item"," items"),charactersUnit:e=>It(e," character"," characters"),throughputUnit:" ops/s"}),ja:Object.freeze({appTitle:"Contact Map",annotationTotalLabel:"\u7DCF\u4EF6\u6570:",annotationCompaniesLabel:"\u4F01\u696D\u6570:",annotationStreamingProgress:({loaded:e,total:t,percent:n})=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${ne("ja",e)} / ${ne("ja",t)} \u4EF6\u30FB${n}%)`,annotationStreamingCount:e=>`\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u8AAD\u307F\u8FBC\u307F\u4E2D (${ne("ja",e)} \u4EF6)`,streamLoadFailed:e=>`\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F (${ne("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,annotationReconnecting:e=>`\u518D\u63A5\u7D9A\u4E2D (${ne("ja",e)} \u4EF6\u53D7\u4FE1\u6E08)`,streamRetry:"\u518D\u8A66\u884C",recordUnit:()=>"\u4EF6",companyUnit:()=>"\u793E",searchTab:"\u3042\u3044\u307E\u3044\u691C\u7D22",searchSettings:"\u691C\u7D22\u8A2D\u5B9A",searchStatistics:"\u691C\u7D22\u7D71\u8A08",operatorAndTitle:"AND \u691C\u7D22 (\u3059\u3079\u3066\u4E00\u81F4)",operatorOrTitle:"OR \u691C\u7D22 (\u3044\u305A\u308C\u304B\u4E00\u81F4)",operatorAnd:"AND",operatorOr:"OR",operatorAndHint:"\u5168\u8A9E\u4E00\u81F4",operatorOrHint:"\u3044\u305A\u308C\u304B\u4E00\u81F4",searchPlaceholder:"\u3042\u3044\u307E\u3044\u691C\u7D22...",searchBusyTitle:"\u691C\u7D22\u51E6\u7406\u4E2D",clearSearch:"\u691C\u7D22\u3092\u30AF\u30EA\u30A2",searching:"\u691C\u7D22\u4E2D...",registeredCountLabel:"\u767B\u9332\u4EF6\u6570:",rebuildingIndex:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D...",errorLabel:"\u30A8\u30E9\u30FC:",resultCountLabel:"\u691C\u7D22\u7D50\u679C:",resultUnit:()=>"\u4EF6",listViewTab:"\u4E00\u89A7",treeViewTab:"\u30C4\u30EA\u30FC",columnNo:"No",columnId:"ID",columnScore:"\u30B9\u30B3\u30A2",columnName:"\u6C0F\u540D",columnTitle:"\u5F79\u8077",columnCompany:"\u4F1A\u793E\u540D",columnDepartment:"\u90E8\u7F72",columnPhone:"\u96FB\u8A71\u756A\u53F7",columnEmail:"\u30E1\u30FC\u30EB",columnUpdatedAt:"\u66F4\u65B0\u65E5\u6642",listRowNumber:e=>`No. ${e}`,listNoSearchResults:"\u691C\u7D22\u7D50\u679C\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",listNoData:"\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093",listboxLabel:"\u9023\u7D61\u5148\u4E00\u89A7",listKeyboardHelp:"\u4E0A\u4E0B\u306E\u77E2\u5370\u30AD\u30FC\u3067\u9023\u7D61\u5148\u3092\u79FB\u308A\u3001Page Up \u3068 Page Down \u3067 1 \u753B\u9762\u305A\u3064\u3001Home \u3068 End \u3067\u5148\u982D\u3068\u672B\u5C3E\u3078\u79FB\u308A\u307E\u3059\u3002Enter \u304B Space \u3067\u9023\u7D61\u5148\u306E\u8A73\u7D30\u3092\u958B\u304D\u307E\u3059\u3002",listResizeHandle:"\u9023\u7D61\u5148\u4E00\u89A7\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",detailHeading:"\u9023\u7D61\u5148\u8A73\u7D30",close:"\u9589\u3058\u308B",noName:"\u540D\u524D\u672A\u8A2D\u5B9A",treeNodeCountTitle:"\u30C4\u30EA\u30FC\u30D3\u30E5\u30FC\u3067\u69CB\u7BC9\u3055\u308C\u305F\u5168\u30CE\u30FC\u30C9\u6570",treeNodeCountLabel:"\u30CE\u30FC\u30C9:",treeNodeCount:e=>`${ne("ja",e)} \u500B`,uncategorizedCompany:"\u672A\u5206\u985E",treeDirectoryName:(e,t)=>`${e} (${ne("ja",t)})`,treeStreamInterruptedTitle:"\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u304C\u4E2D\u65AD\u3055\u308C\u307E\u3057\u305F\u3002\u53D7\u4FE1\u6E08\u307F\u30C7\u30FC\u30BF\u306E\u307F\u8868\u793A\u3057\u3066\u3044\u307E\u3059",treeStreamInterrupted:"\u4E2D\u65AD",treeStreamLoadingTitle:"\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u304B\u3089\u306E\u30C7\u30FC\u30BF\u30B9\u30C8\u30EA\u30FC\u30DF\u30F3\u30B0\u3092\u53D7\u4FE1\u4E2D",treeStreamLoading:"\u8AAD\u307F\u8FBC\u307F\u4E2D...",treeBuildingTitle:"\u53D7\u53D6\u30C7\u30FC\u30BF\u3092\u57FA\u306B\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30C4\u30EA\u30FC\u69CB\u9020\u3092\u6700\u7D42\u69CB\u7BC9\u30FB\u5C55\u958B\u4E2D",treeBuilding:"\u30C4\u30EA\u30FC\u69CB\u7BC9\u4E2D...",treeCompleteTitle:"\u30C4\u30EA\u30FC\u30CE\u30FC\u30C9\u306E\u5168\u4EF6\u69CB\u7BC9\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F",treeComplete:"\u5B8C\u4E86",treeShowEntireCompanyTitle:"\u691C\u7D22\u30D2\u30C3\u30C8\u3057\u305F\u4F1A\u793E\u5168\u4F53\u3092\u8868\u793A",treeShowEntireCompany:"\u5168\u4F53\u8868\u793A",treeExpandAll:"\u5168\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u5C55\u958B",treeExpandAllTitle:"\u3059\u3079\u3066\u5C55\u958B",treeCollapseAll:"\u5168\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u6298\u308A\u305F\u305F\u307F",treeCollapseAllTitle:"\u3059\u3079\u3066\u6298\u308A\u305F\u305F\u307F",treeNoMatches:"\u6761\u4EF6\u306B\u4E00\u81F4\u3059\u308B\u9023\u7D61\u5148\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",treeEmpty:"\u8868\u793A\u3059\u308B\u9023\u7D61\u5148\u304C\u3042\u308A\u307E\u305B\u3093",treeResizeHandle:"\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30C4\u30EA\u30FC\u3068\u8A73\u7D30\u30DA\u30A4\u30F3\u306E\u5883\u754C\u306E\u30B5\u30A4\u30BA\u5909\u66F4\u30CF\u30F3\u30C9\u30EB",copyField:e=>`\u300C${e}\u300D\u3092\u30B3\u30D4\u30FC`,detailEmptyTitle:"\u9023\u7D61\u5148\u3092\u9078\u629E\u3059\u308B\u3068\u8A73\u7D30\u304C\u8868\u793A\u3055\u308C\u307E\u3059",detailEmptyHint:"\u4E00\u89A7\u304B\u3089\u5BFE\u8C61\u306E\u4EBA\u7269\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044",detailTabSummary:"\u30B5\u30DE\u30EA\u30FC",detailTabBasic:"\u57FA\u672C\u60C5\u5831",detailBasicProfile:"\u57FA\u672C\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB",detailTabContact:"\u9023\u7D61\u5148",detailTabMeta:"\u30E1\u30BF\u60C5\u5831",preferred:"\u512A\u5148",summaryEmail:"\u30E1\u30FC\u30EB",summaryPhone:"\u96FB\u8A71",summaryLastContact:"\u6700\u7D42\u63A5\u89E6",sectionEmail:"\u30E1\u30FC\u30EB",sectionEmailEmpty:"\u767B\u9332\u3055\u308C\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306F\u3042\u308A\u307E\u305B\u3093",sectionPhone:"\u96FB\u8A71\u30FBFAX",sectionPhoneEmpty:"\u767B\u9332\u3055\u308C\u305F\u96FB\u8A71\u756A\u53F7\u306F\u3042\u308A\u307E\u305B\u3093",fieldFullName:"\u6C0F\u540D",fieldFullNameReading:"\u6C0F\u540D (\u304B\u306A)",fieldTitle:"\u5F79\u8077",fieldDepartment:"\u90E8\u7F72",fieldCompanyName:"\u4F1A\u793E\u540D",fieldCompanyNameReading:"\u4F1A\u793E\u540D (\u304B\u306A)",fieldAddress:"\u4F4F\u6240",fieldPostalCode:"\u90F5\u4FBF\u756A\u53F7",fieldUrl:"URL",fieldCustomEmail:"\u30AB\u30B9\u30BF\u30E0\u30E1\u30FC\u30EB",fieldEmail:"\u30E1\u30FC\u30EB",fieldCustomMobilePhone:"\u30AB\u30B9\u30BF\u30E0\u643A\u5E2F\u756A\u53F7",fieldMobilePhone:"\u643A\u5E2F\u756A\u53F7",fieldCompanyPhone:"\u4F1A\u793E\u96FB\u8A71\u756A\u53F7",fieldCompanyFax:"\u4F1A\u793E FAX \u756A\u53F7",fieldCreatedBy:"\u4F5C\u6210\u8005",fieldCreatedAt:"\u4F5C\u6210\u65E5\u6642",fieldUpdatedBy:"\u66F4\u65B0\u8005",fieldUpdatedAt:"\u66F4\u65B0\u65E5\u6642",recordDateTime:$r,recordDate:Gn,popupCustomMobilePhone:"\u643A\u5E2F\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupMobilePhone:"\u643A\u5E2F\u96FB\u8A71",popupCustomCompanyPhone:"\u4F1A\u793E\u96FB\u8A71 (\u30AB\u30B9\u30BF\u30E0)",popupCompanyPhone:"\u4F1A\u793E\u96FB\u8A71",popupCustomEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9 (\u30AB\u30B9\u30BF\u30E0)",popupEmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",popupGmailHint:"\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u307E\u305F\u306F\u4E8C\u5EA6\u30BF\u30C3\u30D7\u3067 Gmail \u3092\u958B\u304D\u307E\u3059",popupLastContactDate:"\u6700\u7D42\u30B3\u30F3\u30BF\u30AF\u30C8\u65E5:",popupNoContactMethods:"\u8868\u793A\u3067\u304D\u308B\u9023\u7D61\u5148\u60C5\u5831\u304C\u3042\u308A\u307E\u305B\u3093",overlayTitle:"\u8A73\u7D30",settingsResetAllTitle:"\u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u30EA\u30BB\u30C3\u30C8",settingsResetAll:"\u3059\u3079\u3066\u30EA\u30BB\u30C3\u30C8",settingsTabsLabel:"\u691C\u7D22\u30AA\u30D7\u30B7\u30E7\u30F3\u8A2D\u5B9A\u30BF\u30D6",settingsBasicTab:"\u57FA\u672C\u8A2D\u5B9A",settingsAdvancedTab:"\u8A73\u7D30\u8A2D\u5B9A",indexWorkerName:"Index Worker",levenshteinWorkerName:"Levenshtein Worker",currentValueLabel:"\u73FE\u5728\u5024:",resetToDefaultsTitle:"\u30C7\u30D5\u30A9\u30EB\u30C8\u5024\u306B\u30EA\u30BB\u30C3\u30C8",reset:"\u30EA\u30BB\u30C3\u30C8",relevanceOnlyNotice:"Relevance \u30BD\u30FC\u30C8\u6642\u306E\u307F\u5909\u66F4\u53EF\u80FD",relevanceWeightsHeading:"Relevance \u30B9\u30B3\u30A2\u91CD\u307F",fieldWeight:"\u30D5\u30A3\u30FC\u30EB\u30C9\u91CD\u307F",scoreTuningHeading:"\u30B9\u30B3\u30A2\u8ABF\u6574",maxResults:"\u6700\u5927\u7D50\u679C\u6570",noLimit:"\u4E0A\u9650\u306A\u3057",basicThresholdHeading:"\u6700\u7D42\u985E\u4F3C\u5EA6\u95BE\u5024",basicThresholdLabel:"\u30B9\u30B3\u30A2\u306E\u4E0B\u9650\u3092\u8ABF\u6574",basicThresholdRangeRelevance:"Relevance \u30E2\u30FC\u30C9\u3067\u306F\u30B9\u30B3\u30A2\u304C 1.0 \u3092\u8D85\u3048\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059 (\u7BC4\u56F2: 0.0-1.5)",basicThresholdRange:"\u7BC4\u56F2: 0.0-1.0",basicDisplayHeading:"\u8868\u793A\u30AA\u30D7\u30B7\u30E7\u30F3",basicCaseSensitive:"\u5927\u6587\u5B57\u5C0F\u6587\u5B57\u3092\u533A\u5225",basicHighlight:"\u30CF\u30A4\u30E9\u30A4\u30C8\u8868\u793A",basicOpenEmailsWithGmail:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 Gmail \u306E\u4F5C\u6210\u753B\u9762\u3067\u958B\u304F",basicMultiTermOperator:"\u5F15\u7528\u7B26\u306E\u4E2D\u306E\u8A9E\u306E\u6F14\u7B97\u5B50",basicOperatorOr:"OR (\u3044\u305A\u308C\u304B\u4E00\u81F4)",basicOperatorAnd:"AND (\u3059\u3079\u3066\u4E00\u81F4)",basicMultiTermHint:'\u5F15\u7528\u7B26\u3067\u56F2\u3093\u3060\u8A9E ("\u7530\u4E2D \u592A\u90CE") \u306E\u7D50\u5408\u65B9\u6CD5 (\u65E2\u5B9A\u306F AND)\u3002\u5F15\u7528\u7B26\u306E\u5916\u306E\u8A9E\u306F\u305D\u308C\u305E\u308C\u5225\u306E\u30AD\u30FC\u30EF\u30FC\u30C9\u3067\u3001AND / OR \u30DC\u30BF\u30F3\u3067\u7D50\u5408\u3059\u308B',basicSortHeading:"\u30BD\u30FC\u30C8\u8A2D\u5B9A",basicSortBy:"\u30BD\u30FC\u30C8\u57FA\u6E96",basicSortByScore:"\u30B9\u30B3\u30A2",basicSortByRelevance:"\u95A2\u9023\u6027",basicSortByOriginal:"\u5143\u306E\u9806\u5E8F",basicSortOrder:"\u30BD\u30FC\u30C8\u9806\u5E8F",basicSortDescending:"\u964D\u9806",basicSortAscending:"\u6607\u9806",basicEngineHeading:"\u691C\u7D22\u30A8\u30F3\u30B8\u30F3\u8A2D\u5B9A",basicStrategy:"\u4E26\u5217\u691C\u7D22\u6226\u7565",basicStrategyBalanced:"\u30D0\u30E9\u30F3\u30B9",basicStrategyIndexFirst:"Index \u512A\u5148",basicStrategyLevenshteinFirst:"Levenshtein \u512A\u5148",basicIndexFiltering:"Index \u30D5\u30A3\u30EB\u30BF\u30EA\u30F3\u30B0",basicLevenshtein:"Levenshtein \u8DDD\u96E2\u8A08\u7B97",advancedLearningHeading:"\u5B66\u7FD2\u91CD\u307F",advancedLearningLabel:"\u91CD\u307F\u4FC2\u6570",advancedLearningHint:"\u518D\u5B66\u7FD2\u6642\u306E\u91CD\u307F\u4ED8\u3051 (\u5927\u304D\u3044\u307B\u3069\u904E\u53BB\u306E\u691C\u7D22\u7D50\u679C\u3092\u512A\u5148)",advancedDebounceHeading:"\u30C7\u30D0\u30A6\u30F3\u30B9\u6642\u9593",advancedDebounceLabel:"\u5165\u529B\u9045\u5EF6 (ms)",advancedDebounceHint:"\u5165\u529B\u306E\u5F85\u3061\u6642\u9593\u3002\u77ED\u3044\u307B\u3069\u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u3001\u9577\u3044\u307B\u3069\u8CA0\u8377\u8EFD\u6E1B",indexSettingsHeading:"Index Worker \u8A2D\u5B9A",indexBuildHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u69CB\u7BC9",indexNgramSize:"N-gram \u30B5\u30A4\u30BA",indexNgramSizeHint:"\u6587\u5B57\u5217\u3092\u4F55\u6587\u5B57\u5358\u4F4D\u3067\u5206\u5272\u3059\u308B\u304B\u3002\u5C0F\u3055\u3044\u307B\u3069\u9AD8\u901F\u3060\u304C\u7CBE\u5EA6\u4F4E\u4E0B",indexMinNgramOverlap:"\u6700\u5C0F N-gram \u4E00\u81F4\u6570",indexMinNgramOverlapHint:"\u4E00\u81F4\u6570\u304C\u3053\u306E\u5024\u3092\u4E0B\u56DE\u308B\u5019\u88DC\u306F\u9664\u5916",indexCandidateHeading:"\u5019\u88DC\u7D5E\u308A\u8FBC\u307F",indexThreshold:"Index \u95BE\u5024",indexThresholdHint:"Jaro-Winkler \u985E\u4F3C\u5EA6\u306E\u4E0B\u9650 (\u7BC4\u56F2: 0.0-1.0)",indexNgramOverlapThreshold:"N-gram \u91CD\u8907\u5EA6\u95BE\u5024",indexNgramOverlapThresholdHint:"N-gram \u306E\u91CD\u306A\u308A\u5177\u5408\u3002\u9AD8\u3044\u307B\u3069\u53B3\u5BC6\u306B\u5019\u88DC\u3092\u7D5E\u308B",indexStrategyHeading:"\u691C\u7D22\u6226\u7565\u3068\u5019\u88DC\u6570",indexStrategy:"\u691C\u7D22\u6226\u7565",indexStrategyFast:"Fast (\u9AD8\u901F)",indexStrategyAccurate:"Accurate (\u6B63\u78BA)",indexStrategyHybrid:"Hybrid (\u52D5\u7684)",indexStrategyHint:"\u51E6\u7406\u8CA0\u8377\u3068\u7CBE\u5EA6\u306E\u30D0\u30E9\u30F3\u30B9\u3092\u9078\u629E",indexMinCandidatesRatio:"\u6700\u5C0F\u5019\u88DC\u6BD4\u7387",indexMinCandidatesRatioHint:"\u6700\u4F4E\u9650\u78BA\u4FDD\u3059\u308B\u5019\u88DC\u5272\u5408",indexMaxCandidatesRatio:"\u6700\u5927\u5019\u88DC\u6BD4\u7387",indexMaxCandidatesRatioHint:"\u5019\u88DC\u6570\u306E\u4E0A\u9650\u3002\u8D85\u3048\u308B\u3068\u52D5\u7684\u306B\u7D5E\u308A\u8FBC\u307F",indexJaroWinklerPrefix:"Jaro-Winkler \u63A5\u982D\u8F9E\u91CD\u307F",indexJaroWinklerPrefixHint:"\u5148\u982D\u4E00\u81F4\u306B\u4ED8\u4E0E\u3059\u308B\u30DC\u30FC\u30CA\u30B9\u5024",indexMaxResultsHint:"\u53D6\u5F97\u3059\u308B\u6700\u5927\u4EF6\u6570\u3002\u5927\u304D\u3044\u307B\u3069\u5305\u62EC\u7684\u3060\u304C\u9045\u5EF6\u304C\u5897\u52A0",indexFieldWeightHint:"\u30DE\u30C3\u30C1\u30D5\u30A3\u30FC\u30EB\u30C9\u6570\u306B\u3069\u308C\u3060\u3051\u91CD\u307F\u4ED8\u3051\u3059\u308B\u304B",indexPerfectMatchBonus:"\u5B8C\u5168\u4E00\u81F4\u30DC\u30FC\u30CA\u30B9",indexPerfectMatchBonusHint:"\u5B8C\u5168\u4E00\u81F4\u6642\u306B\u8FFD\u52A0\u3059\u308B\u30DC\u30FC\u30CA\u30B9\u5024",indexContainmentHeading:"\u548C\u6587\u30FB\u90E8\u5206\u6587\u5B57\u5217\u5305\u542B\u30B9\u30B3\u30A2",indexContainmentBase:"\u5305\u542B \u57FA\u790E\u30B9\u30B3\u30A2 (containmentScoreBase)",indexContainmentBaseHint:"\u30AF\u30A8\u30EA\u304C\u6587\u5B57\u5217\u4E2D\u306B\u5B8C\u5168\u306B\u542B\u307E\u308C\u308B\u5834\u5408\u306E\u6700\u4F4E\u57FA\u790E\u30B9\u30B3\u30A2 (\u548C\u6587 2 \u6587\u5B57\u7B49\u306E\u6551\u6E08)",indexContainmentCoverage:"\u5305\u542B \u88AB\u8986\u7387\u91CD\u307F (containmentCoverageWeight)",indexContainmentCoverageHint:"\u30AF\u30A8\u30EA\u9577 / \u30D5\u30A3\u30FC\u30EB\u30C9\u9577\u306E\u6BD4\u7387\u306B\u5FDC\u3058\u305F\u52A0\u7B97\u30B9\u30B3\u30A2 (\u5408\u8A08 1.0 \u4EE5\u4E0B\u306B\u5236\u9650)",levenshteinSettingsHeading:"Levenshtein Worker \u8A73\u7D30\u8A2D\u5B9A",levenshteinCandidateHeading:"\u5019\u88DC\u30D5\u30A3\u30EB\u30BF",levenshteinThreshold:"Levenshtein \u95BE\u5024",levenshteinThresholdHintRelevance:"\u3053\u306E\u95BE\u5024\u4EE5\u4E0A\u306E\u7D50\u679C\u306E\u307F\u4FDD\u6301 (\u7BC4\u56F2: 0.0-1.5)",levenshteinThresholdHint:"\u3053\u306E\u95BE\u5024\u4EE5\u4E0A\u306E\u7D50\u679C\u306E\u307F\u4FDD\u6301 (\u7BC4\u56F2: 0.0-1.0)",levenshteinLengthSimilarity:"\u9577\u3055\u985E\u4F3C\u5EA6\u95BE\u5024",levenshteinLengthSimilarityHint:"\u9577\u3055\u304C\u5927\u304D\u304F\u7570\u306A\u308B\u5019\u88DC\u3092\u4E8B\u524D\u306B\u9664\u5916\u3057\u3066\u901F\u5EA6\u5411\u4E0A",levenshteinLengthPenalty:"\u9577\u3055\u5DEE\u30DA\u30CA\u30EB\u30C6\u30A3",levenshteinLengthPenaltyHint:"\u9577\u3055\u5DEE\u3092\u3069\u308C\u3060\u3051\u6E1B\u70B9\u3059\u308B\u304B\u3002\u5927\u304D\u3044\u307B\u3069\u9577\u3055\u4E00\u81F4\u3092\u91CD\u8996",levenshteinResultsHeading:"\u7D50\u679C\u6570\u5236\u5FA1",levenshteinMaxResultsHint:"\u8FD4\u5374\u3059\u308B\u6700\u5927\u4EF6\u6570\u3002\u5927\u304D\u3044\u307B\u3069\u7DB2\u7F85\u7684\u3060\u304C\u51E6\u7406\u6642\u9593\u304C\u5897\u52A0",levenshteinFieldWeightHint:"\u4E00\u81F4\u30D5\u30A3\u30FC\u30EB\u30C9\u6570\u306E\u8A55\u4FA1\u91CD\u307F",levenshteinPartialBonus:"\u90E8\u5206\u4E00\u81F4\u30DC\u30FC\u30CA\u30B9",levenshteinPartialBonusHint:"\u90E8\u5206\u4E00\u81F4\u306B\u4ED8\u4E0E\u3059\u308B\u8FFD\u52A0\u30B9\u30B3\u30A2",statsRebuildingTitle:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9\u4E2D",statsRebuildIndexTabOnlyTitle:"Index \u30BF\u30D6\u3067\u306E\u307F\u4F7F\u7528\u53EF\u80FD",statsRebuildTitle:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3092\u518D\u69CB\u7BC9",statsRebuilding:"\u518D\u69CB\u7BC9\u4E2D...",statsRebuild:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u518D\u69CB\u7BC9",statsResetTitle:"\u7D71\u8A08\u3092\u30EA\u30BB\u30C3\u30C8",statsTabsLabel:"\u691C\u7D22\u7D71\u8A08\u30BF\u30D6",statsOverviewTab:"\u6982\u8981",statsIndexTab:"Index",statsLevenshteinTab:"Levenshtein",statTotalSearches:"\u7DCF\u691C\u7D22\u56DE\u6570",statAverageSearchTime:"\u5E73\u5747\u691C\u7D22\u6642\u9593",statDataCount:"\u30C7\u30FC\u30BF\u4EF6\u6570",statResultCount:"\u691C\u7D22\u7D50\u679C\u4EF6\u6570",statDisplayedCount:"\u8868\u793A\u4EF6\u6570",statsNoData:"\u7D71\u8A08\u30C7\u30FC\u30BF\u306A\u3057",statsBasicHeading:"\u57FA\u672C\u7D71\u8A08",statTotalProcessingTime:"\u7DCF\u51E6\u7406\u6642\u9593",statLastSearchTime:"\u6700\u5F8C\u306E\u691C\u7D22\u6642\u9593",statErrorCount:"\u30A8\u30E9\u30FC\u6570",statUpdatedAt:"\u7D71\u8A08\u66F4\u65B0\u6642\u523B",statsTimestamp:Or,statsOperationsHeading:"\u64CD\u4F5C\u7D71\u8A08",statTotalOperations:"\u7DCF\u64CD\u4F5C\u6570",statsIndexHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u7D71\u8A08",statIndexBuilds:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u69CB\u7BC9\u56DE\u6570",statDataSize:"\u30C7\u30FC\u30BF\u30B5\u30A4\u30BA",statLastBuildTime:"\u6700\u5F8C\u306E\u69CB\u7BC9\u6642\u9593",statsCacheHeading:"\u30AD\u30E3\u30C3\u30B7\u30E5\u7D71\u8A08",statCacheNgram:"N-gram",statCacheWord:"\u5358\u8A9E",statCachePhonetic:"\u97F3\u97FB",statsIndexMetadataHeading:"\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u30E1\u30BF\u30C7\u30FC\u30BF",statsCalculationsHeading:"\u8A08\u7B97\u7D71\u8A08",statTotalCalculations:"\u7DCF\u8A08\u7B97\u6570",statDistanceCalculations:"\u8DDD\u96E2\u8A08\u7B97\u6570",statAverageDistance:"\u5E73\u5747\u8DDD\u96E2",statMinDistance:"\u6700\u5C0F\u8DDD\u96E2",statMaxDistance:"\u6700\u5927\u8DDD\u96E2",notAvailable:"N/A",statsMatchesHeading:"\u30DE\u30C3\u30C1\u7D71\u8A08",statPartialMatches:"\u90E8\u5206\u30DE\u30C3\u30C1\u6570",statPerfectMatches:"\u5B8C\u5168\u30DE\u30C3\u30C1\u6570",statEarlyTerminations:"\u65E9\u671F\u7D42\u4E86\u6570",statsSimilarityHeading:"\u985E\u4F3C\u5EA6\u5206\u5E03",statAbove80:"80% \u4EE5\u4E0A",statAbove60:"60% \u4EE5\u4E0A",statAbove40:"40% \u4EE5\u4E0A",statBelow40:"40% \u672A\u6E80",statsDistanceHeading:"\u8DDD\u96E2\u5206\u5E03 (\u4E0A\u4F4D 6)",statDistance:e=>`\u8DDD\u96E2 ${e}`,statsQueryLengthHeading:"\u30AF\u30A8\u30EA\u9577\u7D71\u8A08 (\u4E0A\u4F4D 6)",statQueryLength:e=>`\u9577\u3055 ${e}`,statQueryLengthValue:({count:e,averagePercent:t})=>`${ne("ja",e)} \u56DE / \u5E73\u5747 ${t}%`,statsFieldPerformanceHeading:"\u30D5\u30A3\u30FC\u30EB\u30C9\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9 (\u4E0A\u4F4D 6)",statAverageScore:"\u5E73\u5747\u30B9\u30B3\u30A2",statMatchCount:"\u30DE\u30C3\u30C1\u6570",statBestWorstScore:"\u6700\u9AD8 / \u6700\u4F4E\u30B9\u30B3\u30A2",statsInsightsHeading:"\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6D1E\u5BDF",statBestField:"\u6700\u9AD8\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u30D5\u30A3\u30FC\u30EB\u30C9",statRecentAverageTime:"\u6700\u8FD1\u306E\u5E73\u5747\u51E6\u7406\u6642\u9593",statRecentAverageResults:"\u6700\u8FD1\u306E\u5E73\u5747\u7D50\u679C\u6570",statThroughput:"\u30B9\u30EB\u30FC\u30D7\u30C3\u30C8",statCommonQueryLength:"\u6700\u983B\u51FA\u30AF\u30A8\u30EA\u9577",statHistoryEntries:"\u5C65\u6B74\u30A8\u30F3\u30C8\u30EA\u6570",statHighSimilarity:"\u9AD8\u985E\u4F3C",statMediumSimilarity:"\u4E2D\u985E\u4F3C",statLowSimilarity:"\u4F4E\u985E\u4F3C",statVeryLowSimilarity:"\u6975\u4F4E\u985E\u4F3C",statsRecentHistoryHeading:"\u6700\u8FD1\u306E\u5C65\u6B74 (\u6700\u65B0 3 \u4EF6)",statsHistoryEntry:({processingTimeMs:e,resultCount:t})=>`\u51E6\u7406\u6642\u9593: ${e} ms / \u7D50\u679C: ${ne("ja",t)} \u4EF6`,timesUnit:()=>" \u56DE",itemsUnit:()=>" \u4EF6",charactersUnit:()=>" \u6587\u5B57",throughputUnit:" ops/\u79D2"})}),Da=Object.freeze(Object.keys(Xn.en)),Pn=Object.freeze([...Wr,...Da]),ht=Object.freeze({en:Object.freeze({...$a.en,...Xn.en}),ja:Object.freeze({...$a.ja,...Xn.ja})}),Ni=new Set(Pn),Oa=Object.keys(ht).map(e=>JSON.stringify(e)).join(" or "),Wa=Object.freeze({locale:"locale",labels:"labels"}),Mi=(e,t,n)=>{e[t]=n},Hr=(e,t=Wa.locale)=>{if(e!==void 0&&typeof e!="string")throw new TypeError(`[contact-map] ${t} must be ${Oa} or left out; got ${ee(e)}`);if(e!==void 0&&!Object.hasOwn(ht,e))throw new RangeError(`[contact-map] ${t} must be ${Oa} or left out; got ${ee(e)}`);return vi(e)},Ei=(e,t,n,a)=>{if(typeof a=="function"){if(typeof n!="function")throw new TypeError(`[contact-map] ${e}.${t} must be a function; got ${ee(n)}`);return}if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string; got ${ee(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${ee(n)}`)},Li=(e,t,n)=>{let a=Object.create(null);for(let i of Object.getOwnPropertyNames(e)){if(!Ni.has(i)){let r=qn(i,Pn);throw new RangeError(`[contact-map] ${n} has a key that is not a label key (${r===void 0?"":`did you mean ${JSON.stringify(r)}? `}CONTACT_MAP_LABEL_KEYS lists every key); got ${ee(i)}`)}let o=e[i];o!==void 0&&(Ei(n,i,o,t[i]),a[i]=o)}return a},ki=e=>{let t={},n=!1;for(let a of Wr){let i=e[a];i!==void 0&&(t[a]=i,n=!0)}return n?t:void 0},Fr=(e,t,n=Wa)=>{let a=Hr(e,n.locale);if(t===void 0)return ht[a];if(!on(t))throw new TypeError(`[contact-map] ${n.labels} must be a plain object or left out; got ${ee(t)}`);let i=Li(t,ht[a],n.labels),r={...Ci(a,ki(i)),...Xn[a]};for(let u of Da){let d=i[u];d!==void 0&&Mi(r,u,d)}return Object.freeze(r)},Ir=e=>{let t={};for(let n of Wr)t[n]=e[n];return Object.freeze(t)},Br=e=>{let t={};for(let n of xi)t[n]=e[n];return Object.freeze(t)}});import{DIRECTORY_TREE_LABEL_KEYS as wi}from"@aiquants/directory-tree";import{VIRTUAL_SCROLL_LABEL_KEYS as Ri}from"@aiquants/virtualscroll";import{createContext as Pi,useContext as Fa,useMemo as Ha,useRef as _i}from"react";import{jsx as $i}from"react/jsx-runtime";var Ai,Ur,zr,Ia,Pe,Q,ge=Me(()=>{"use strict";Bt();Ai=Object.freeze({locale:"en",labels:ht.en,treeLabels:Ir(ht.en),engineLabels:Br(ht.en)}),Ur=Pi(Ai),zr=(e,t)=>{let n=_i(null),a=n.current;return a!==null&&t.every(i=>a[i]===e[i])?a:(n.current=e,e)},Ia=({locale:e,labels:t,surface:n,children:a})=>{let i=Hr(e,n.locale),o=Ha(()=>Fr(i,t,n),[i,t,n]),r=zr(o,Pn),u=zr(Ir(r),wi),d=zr(Br(r),Ri),c=Ha(()=>({locale:i,labels:r,treeLabels:u,engineLabels:d}),[i,r,u,d]);return $i(Ur.Provider,{value:c,children:a})},Pe=()=>Fa(Ur),Q=()=>Fa(Ur).labels});var s,M,I,m,Y,A,qe,Ba,Te,zt,E,kt,za,de=Me(()=>{"use strict";s={fg:"text-[color:light-dark(#0f172b,#f8fafc)]",fgSecondary:"text-[color:light-dark(#314158,#e2e8f0)]",fgMuted:"text-[color:light-dark(#44536a,#cad5e2)]",onPrimary:"text-[color:light-dark(#ffffff,#0f172b)]"},M={surface:"bg-[color:light-dark(#ffffff,#0f172b)]",subtle:"bg-[color:light-dark(#f8fafc,#1d293d)]",muted:"bg-[color:light-dark(#f1f5f9,#1d293d)]"},I={borderSubtle:"border-[color:light-dark(#e2e8f0,#314158)]",borderControl:"border-[color:light-dark(#62748e,#90a1b9)]"},m={amber:"text-[color:light-dark(#7b3306,#fee685)]",blue:"text-[color:light-dark(#193cb8,#bedbff)]",cyan:"text-[color:light-dark(#104e64,#a2f4fd)]",emerald:"text-[color:light-dark(#004f3b,#a4f4cf)]",fuchsia:"text-[color:light-dark(#8a0194,#f6cfff)]",green:"text-[color:light-dark(#0d542b,#b9f8cf)]",indigo:"text-[color:light-dark(#372aac,#c6d2ff)]",lime:"text-[color:light-dark(#35530e,#d8f999)]",orange:"text-[color:light-dark(#7e2a0c,#ffd6a7)]",pink:"text-[color:light-dark(#a3004c,#fccee8)]",purple:"text-[color:light-dark(#6e11b0,#e9d4ff)]",red:"text-[color:light-dark(#9f0712,#ffc9c9)]",rose:"text-[color:light-dark(#a50036,#ffccd3)]",sky:"text-[color:light-dark(#024a70,#b8e6fe)]",teal:"text-[color:light-dark(#0b4f4a,#96f7e4)]",violet:"text-[color:light-dark(#5d0ec0,#ddd6ff)]"},Y={amber:"bg-[color:light-dark(#fffbeb,#461901)]",blue:"bg-[color:light-dark(#eff6ff,#162456)]",emerald:"bg-[color:light-dark(#ecfdf5,#002c22)]",green:"bg-[color:light-dark(#f0fdf4,#032e15)]",purple:"bg-[color:light-dark(#faf5ff,#3c0366)]",rose:"bg-[color:light-dark(#fff1f2,#4d0218)]",sky:"bg-[color:light-dark(#f0f9ff,#052f4a)]"},A={amber:"border-[color:light-dark(#fee685,#7b3306)]",blue:"border-[color:light-dark(#bedbff,#193cb8)]",cyan:"border-[color:light-dark(#a2f4fd,#104e64)]",emerald:"border-[color:light-dark(#a4f4cf,#004f3b)]",fuchsia:"border-[color:light-dark(#f6cfff,#8a0194)]",green:"border-[color:light-dark(#b9f8cf,#0d542b)]",indigo:"border-[color:light-dark(#c6d2ff,#372aac)]",pink:"border-[color:light-dark(#fccee8,#a3004c)]",purple:"border-[color:light-dark(#e9d4ff,#6e11b0)]",rose:"border-[color:light-dark(#ffccd3,#a50036)]",sky:"border-[color:light-dark(#b8e6fe,#024a70)]",teal:"border-[color:light-dark(#96f7e4,#0b4f4a)]",violet:"border-[color:light-dark(#ddd6ff,#5d0ec0)]"},qe={amber:"bg-[color:light-dark(#bb4d00,#fcbb00)]",blue:"bg-[color:light-dark(#155dfc,#51a2ff)]",emerald:"bg-[color:light-dark(#009966,#00d492)]",rose:"bg-[color:light-dark(#ec003f,#ff637e)]",sky:"bg-[color:light-dark(#0084d1,#00bcff)]"},Ba={amber:"border-[color:light-dark(#bb4d00,#fcbb00)]"},Te={blue:"bg-[color:light-dark(#193cb8,#bedbff)]",green:"bg-[color:light-dark(#0d542b,#b9f8cf)]",orange:"bg-[color:light-dark(#7e2a0c,#ffd6a7)]",purple:"bg-[color:light-dark(#6e11b0,#e9d4ff)]",red:"bg-[color:light-dark(#9f0712,#ffc9c9)]"},zt={blue:"hover:bg-[color:light-dark(#162456,#eff6ff)]",red:"hover:bg-[color:light-dark(#460809,#fef2f2)]"},E={hoverSurface:"hover:bg-[color:light-dark(#ffffff,#0f172b)]",hoverMuted:"hover:bg-[color:light-dark(#f1f5f9,#1d293d)]",hoverBlueTint:"hover:bg-[color:light-dark(#eff6ff,#162456)]",hoverRoseTint:"hover:bg-[color:light-dark(#fff1f2,#4d0218)]",hoverFg:"hover:text-[color:light-dark(#0f172b,#f8fafc)]",hoverFgSecondary:"hover:text-[color:light-dark(#314158,#e2e8f0)]",hoverBlueFg:"hover:text-[color:light-dark(#193cb8,#bedbff)]",hoverBlueAccentBorder:"hover:border-[color:light-dark(#155dfc,#51a2ff)]",focusRing:"focus:ring-[color:light-dark(#1447e6,#74d4ff)]",focusBorder:"focus:border-[color:light-dark(#1447e6,#74d4ff)]",focusVisibleRing:"focus-visible:ring-[color:light-dark(#1447e6,#74d4ff)]",focusVisibleOutline:"focus-visible:outline-[color:light-dark(#1447e6,#74d4ff)]",activeRowOutline:"in-focus-visible:data-[contact-map-row-active]:outline-[color:light-dark(#1447e6,#74d4ff)]",ringOffsetSurface:"ring-offset-[color:light-dark(#ffffff,#0f172b)]",selectedRing:"ring-[color:light-dark(#155dfc,#51a2ff)]",activeTabSurface:"data-[state=active]:bg-[color:light-dark(#ffffff,#0f172b)]",activeTabFg:"data-[state=active]:text-[color:light-dark(#0f172b,#f8fafc)]",activeTabBlueFg:"data-[state=active]:text-[color:light-dark(#193cb8,#bedbff)]",treeNameSky:"[&_.directory-tree-name]:text-[color:light-dark(#024a70,#b8e6fe)]"},kt={mark:"bg-[color:light-dark(#fff085,#733e0a)]",progressTrack:"bg-[color:light-dark(#bedbff,#193cb8)]",scrim:"bg-[color:rgb(15_23_43/0.5)]"},za="#71829b"});var x,wt,w,Ee=Me(()=>{"use strict";x="text-[length:var(--aqcm-font-size-body,0.8125rem)] leading-[var(--aqcm-line-height-body,1.25rem)]",wt="text-[length:var(--aqcm-font-size-caption,0.6875rem)]",w=`${wt} leading-[var(--aqcm-line-height-caption,1.25rem)]`});var Yn,Qn,Jn,Zn,jr=Me(()=>{"use strict";de();Yn="fixed inset-y-0 left-0 m-0 h-auto max-h-none w-auto max-w-none border-0 bg-transparent p-0 text-inherit outline-none backdrop:bg-transparent motion-safe:transition-[right] motion-safe:duration-500 motion-safe:ease-[ease]",Qn=Object.freeze({right:"var(--aqcm-overlay-right, 0px)"}),Jn=`absolute inset-0 ${kt.scrim}`,Zn=()=>!1});var Wi,Hi,st,Va,Ka,cn,dn=Me(()=>{"use strict";de();Wi="min-w-11 py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",Hi=2,st=`focus-visible:outline-2 ${E.focusVisibleOutline} focus-visible:outline-offset-2`,Va=`in-focus-visible:data-[contact-map-row-active]:outline-2 in-focus-visible:data-[contact-map-row-active]:-outline-offset-2 ${E.activeRowOutline}`,Ka=Hi,cn=`inline-block max-w-full underline-offset-2 hover:underline focus-visible:underline ${st} ${Wi}`});import{clsx as Fi}from"clsx";import{twMerge as Ii}from"tailwind-merge";function ke(...e){return Ii(Fi(e))}var _n=Me(()=>{"use strict"});import{useOverlayDialog as Bi}from"@aiquants/swipe-overlay";import zi from"lucide-react/dist/esm/icons/check.js";import Ui from"lucide-react/dist/esm/icons/copy.js";import Vi from"lucide-react/dist/esm/icons/x.js";import{useCallback as pn,useEffect as ja,useId as Ki,useMemo as er,useRef as Ga,useState as ji}from"react";import{createPortal as Gi}from"react-dom";import{jsx as ae,jsxs as Xe}from"react/jsx-runtime";var qi,De,Xi,Yi,Qi,An,mn,Ji,Zi,un,Gr,qr,tr,Xr=Me(()=>{"use strict";Ft();ge();jr();de();dn();Ee();_n();qi=350,De=e=>e.stopPropagation(),Xi=Object.freeze({onClick:De,onDoubleClick:De,onContextMenu:De,onPointerDown:De,onPointerUp:De,onMouseDown:De,onMouseUp:De,onTouchStart:De,onTouchEnd:De,onKeyDown:De,onKeyUp:De,onFocus:De,onBlur:De}),Yi=ke(Yn,"flex items-center justify-center px-4 py-6"),Qi=`relative max-h-full w-full max-w-md overflow-y-auto overscroll-contain rounded-lg border ${I.borderControl} ${M.surface} p-4 shadow-lg transition-colors`,An=0,mn=null,Ji=()=>{let e=document.body.style;An+=1,An===1&&(mn={userSelect:e.userSelect,webkitUserSelect:e.webkitUserSelect}),e.userSelect="none",typeof e.webkitUserSelect<"u"&&(e.webkitUserSelect="none")},Zi=()=>{if(An=Math.max(0,An-1),An>0||!mn)return;let e=document.body.style;e.userSelect=mn.userSelect,typeof mn.webkitUserSelect<"u"&&(e.webkitUserSelect=mn.webkitUserSelect),mn=null},un=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},Gr=(e,t)=>{let n=new Set;return e.reduce((a,i)=>{let o=typeof i.value=="string"?i.value.trim():"";if(!o)return a;let{normalized:r,key:u,entry:d}=t(o,i);return r&&!n.has(u)&&(n.add(u),a.push(d(r))),a},[])},qr=({value:e,ariaLabel:t})=>{let[n,a]=ji(!1),i=Ga(null),o=pn(async d=>{if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(d),!0}catch{}if(typeof document>"u")return!1;let c=document.createElement("textarea");c.value=d,c.setAttribute("readonly",""),c.style.position="absolute",c.style.left="-9999px",document.body.appendChild(c),c.select(),c.setSelectionRange(0,c.value.length);let f=document.execCommand("copy");return document.body.removeChild(c),f},[]),r=pn(async d=>{d.preventDefault(),d.stopPropagation(),i.current!==null&&typeof window<"u"&&(window.clearTimeout(i.current),i.current=null);let c=await o(e);a(c),c&&typeof window<"u"&&(i.current=window.setTimeout(()=>{a(!1),i.current=null},1500))},[o,e]);ja(()=>()=>{i.current!==null&&typeof window<"u"&&(window.clearTimeout(i.current),i.current=null)},[]);let u=n?zi:Ui;return ae("button",{type:"button",className:`inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md border ${I.borderControl} ${s.fgMuted} transition-colors ${E.hoverMuted} ${st}`,onClick:r,"aria-label":t,title:t,children:ae(u,{className:"h-3.5 w-3.5","aria-hidden":"true"})})},tr=({contactData:e,openEmailsWithGmail:t,openGmailCompose:n,onRequestClose:a})=>{let i=Q(),o=Ga(null),r=er(()=>e.contacted_at?at(e.contacted_at,i.recordDate):null,[e.contacted_at,i.recordDate]),u=un(e.full_name)??i.noName,d=un(e.company_name),c=un(e.department),f=un(e.title),p=er(()=>Gr([{fieldKey:"company_name",label:i.fieldCompanyName,value:d},{fieldKey:"department",label:i.fieldDepartment,value:c},{fieldKey:"title",label:i.fieldTitle,value:f}],(C,{fieldKey:k,label:H})=>({normalized:C,key:`${k}-${C.toLowerCase()}`,entry:S=>({fieldKey:k,label:H,value:S})})),[d,c,f,i]),l=er(()=>Gr([{fieldKey:"custom_mobile_phone_number",label:i.popupCustomMobilePhone,value:e.custom_mobile_phone_number},{fieldKey:"mobile_phone_number",label:i.popupMobilePhone,value:e.mobile_phone_number},{fieldKey:"custom_company_phone_number",label:i.popupCustomCompanyPhone,value:e.custom_company_phone_number},{fieldKey:"company_phone_number",label:i.popupCompanyPhone,value:e.company_phone_number}],(C,{fieldKey:k,label:H})=>{let S=Rn(C);return{normalized:un(C),key:(S??C).toLowerCase(),entry:oe=>({fieldKey:k,label:H,value:oe,href:S})}}),[e.custom_mobile_phone_number,e.mobile_phone_number,e.custom_company_phone_number,e.company_phone_number,i]),g=er(()=>Gr([{fieldKey:"custom_email",label:i.popupCustomEmail,value:e.custom_email},{fieldKey:"email",label:i.popupEmail,value:e.email}],(C,{fieldKey:k,label:H})=>{let S=un(C),L=gt(C,t),oe=!!L?.startsWith("https://mail.google.com");return{normalized:S,key:C.toLowerCase(),entry:F=>({fieldKey:k,label:H,value:F,href:L,isGmailLink:oe})}}),[e.custom_email,e.email,t,i]),b=l.length>0||g.length>0,v=Ki(),T=pn(()=>{a(),o.current=null},[a]),N=pn(C=>C.ownerDocument.getElementById(v),[v]),{dialogProps:U,backdropProps:z}=Bi({isOpen:!0,onClose:T,isCloseBlocked:Zn,initialFocus:N}),y=pn((C,k)=>{k.isGmailLink&&(C.preventDefault(),n(k.value))},[n]),h=pn((C,k)=>{if(!k.isGmailLink){o.current=null;return}let H=Date.now(),S=o.current;if(S&&S.email===k.value&&H-S.timestamp<=qi){o.current=null,C.preventDefault(),n(k.value);return}o.current={email:k.value,timestamp:H}},[n]);return ja(()=>(Ji(),Zi),[]),Gi(Xe("dialog",{...U,...Xi,"data-contact-popup-root":"true","aria-labelledby":v,className:Yi,style:Qn,children:[ae("div",{...z,"data-contact-popup-backdrop":"",className:Jn}),Xe("div",{"data-contact-popup-card":"",className:Qi,children:[Xe("div",{className:"flex items-center justify-between gap-4",children:[ae("h2",{id:v,tabIndex:-1,className:`wrap-break-word min-w-0 font-semibold ${s.fg} text-lg outline-none`,children:u}),ae("button",{type:"button",className:`inline-flex shrink-0 items-center justify-center rounded-md p-3.5 ${s.fgMuted} transition-colors ${E.hoverMuted} ${st}`,onClick:T,"aria-label":i.close,children:ae(Vi,{className:"h-4 w-4","aria-hidden":"true"})})]}),p.length>0?ae("div",{className:`mt-2 space-y-2 ${s.fgSecondary} text-sm`,children:p.map(C=>Xe("div",{className:"flex items-center gap-3",children:[ae("p",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:C.value}),ae(qr,{value:C.value,ariaLabel:i.copyField(C.label)})]},C.fieldKey))}):null,Xe("div",{className:`mt-4 space-y-4 ${s.fgSecondary}`,children:[l.length>0?ae("div",{children:ae("ul",{className:"space-y-3 text-sm",children:l.map(C=>ae("li",{className:"flex items-start gap-3",children:Xe("div",{className:"min-w-0 flex-1",children:[ae("span",{className:`${s.fgMuted} text-xs`,children:C.label}),Xe("div",{className:"mt-1 flex items-center gap-3",children:[ae("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:C.href?ae("a",{href:C.href,className:`wrap-break-word ${m.blue} ${cn}`,children:C.value}):ae("span",{className:`wrap-break-word ${s.fg}`,children:C.value})}),ae(qr,{value:C.value,ariaLabel:i.copyField(C.label)})]})]})},`${C.fieldKey}-${C.value}`))})}):null,g.length>0?ae("div",{children:ae("ul",{className:"space-y-3 text-sm",children:g.map(C=>ae("li",{className:"flex items-start gap-3",children:Xe("div",{className:"min-w-0 flex-1",children:[ae("span",{className:`${s.fgMuted} text-xs`,children:C.label}),Xe("div",{className:"mt-1 flex items-start gap-3",children:[Xe("div",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:[C.href?ae("a",{href:C.href,className:`wrap-break-word ${m.blue} ${cn}`,target:C.isGmailLink?"_blank":void 0,rel:C.isGmailLink?"noopener noreferrer":void 0,onDoubleClick:k=>y(k,C),onTouchEnd:k=>h(k,C),children:C.value}):ae("span",{className:`wrap-break-word ${s.fg}`,children:C.value}),C.isGmailLink?ae("span",{className:`mt-1 block ${w} ${s.fgMuted}`,children:i.popupGmailHint}):null]}),ae(qr,{value:C.value,ariaLabel:i.copyField(C.label)})]})]})},`${C.fieldKey}-${C.value}`))})}):null,r?Xe("div",{className:`mt-2 flex items-center gap-2 ${s.fgMuted} text-sm`,children:[ae("span",{className:"text-xs",children:i.popupLastContactDate}),ae("span",{children:r})]}):null,b?null:ae("p",{className:`${s.fgMuted} text-sm`,children:i.popupNoContactMethods})]})]})]}),document.body)}});import{jsx as _e,jsxs as $n}from"react/jsx-runtime";var nr,Yr=Me(()=>{"use strict";de();Ee();nr=({fullName:e,title:t="-",companyName:n="-",department:a="-",phoneNumber:i="-",email:o="-",updatedAtText:r="-"})=>$n("div",{className:`flex h-full w-full flex-col justify-center gap-0.5 ${s.fg} text-xs leading-tight transition-colors sm:grid sm:grid-cols-3 sm:gap-2 sm:text-sm xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[$n("div",{className:"flex items-center gap-1 sm:hidden",children:[_e("div",{className:`flex-1 truncate font-medium ${s.fg} text-sm leading-tight`,children:e}),_e("div",{className:`shrink-0 whitespace-nowrap ${wt} ${s.fgMuted}`,children:i})]}),_e("div",{className:"flex items-center gap-1 sm:hidden",children:_e("div",{className:`flex-1 truncate ${s.fgSecondary} text-xs leading-tight`,children:n})}),_e("div",{className:"block sm:hidden",children:_e("span",{className:`w-full truncate text-left ${wt} ${s.fgSecondary} leading-tight`,children:a})}),$n("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[_e("span",{className:`truncate font-medium ${s.fg}`,children:e}),_e("span",{className:`truncate ${s.fgMuted} text-xs`,children:t})]}),$n("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[_e("span",{className:`truncate ${s.fg}`,children:n}),_e("span",{className:`truncate ${s.fgMuted} text-xs`,children:a})]}),$n("div",{className:"hidden flex-col gap-0.5 truncate sm:flex",children:[_e("span",{className:`truncate ${s.fgSecondary}`,children:i}),_e("span",{className:`truncate ${s.fgMuted} text-xs`,children:o})]}),_e("div",{className:`hidden items-end justify-end ${wt} ${s.fgMuted} xl:flex`,children:_e("span",{className:"truncate",children:r})})]})});import{formatQuerySets as es,parseQuerySets as ts}from"@aiquants/fuzzy-search";import{getNormalizedVariants as ns,normalizeText as rs,romajiToKatakana as as}from"@aiquants/select-box";var Ya,os,is,ss,ls,Qa,Ja,cs,ds,us,ms,ps,fs,gs,hs,Za,eo,qa,Xa,rr,ys,bs,Qr,to,Jr=Me(()=>{"use strict";Ya=/[]/g,os=/^[\s ]+|[\s ]+$/g,is=/\s+/,ss=/^[\p{Script=Latin}\s]+$/u,ls=/\p{Script=Latin}/u,Qa=Object.freeze({convertWidth:!0,convertKana:!0,convertCase:!0,convertRomaji:!1,normalizeVariants:!1,ignoreSpaces:!1,ignoreSymbols:!1,ignoreLongVowels:!1}),Ja="union",cs=65377,ds=65439,us=["\uFF9E","\uFF9F"],ms=(()=>{let e=new Map;for(let t=cs;t<=ds;t+=1){let n=String.fromCharCode(t);e.set(n.normalize("NFKC"),n);for(let a of us){let i=(n+a).normalize("NFKC");i.length===1&&e.set(i,n+a)}}return e})(),ps=/[-ヿ]/u,fs=e=>{let t=Array.from(e,n=>ms.get(n)??n).join("");return ps.test(t)?null:t},gs=e=>rs(e.replace(Ya,"").replace(os,""),Qa),hs=e=>{if(!ss.test(e))return null;let t=as(e);return ls.test(t)?null:t},Za=e=>e.split(is).filter(Boolean),eo=e=>ts(e,Ja).sets.map(({query:t})=>t),qa=e=>eo(e).flatMap(t=>Za(t)),Xa=e=>es({combine:Ja,sets:Array.from(new Set(e),t=>({query:t}))}),rr=e=>{let t=eo(e.replace(Ya,"")).map(a=>Za(gs(a)).join(" ")).filter(a=>a!==""),n=[];for(let a of t){let i=hs(a);if(i===null)return Xa(t);n.push(i)}return Xa(n)},ys=e=>{let t=new Set([...qa(e),...qa(rr(e))]),n=new Set;for(let a of t)for(let i of ns(a,Qa)){let o=i.trim();if(!o)continue;n.add(o);let r=fs(o);r!==null&&n.add(r)}return Array.from(n)},bs=/[.*+?^${}()|[\]\\]/g,Qr=e=>{let t=ys(e);if(t.length===0)return null;let n=t.map(a=>a.replace(bs,"\\$&")).sort((a,i)=>i.length-a.length);return new RegExp(n.join("|"),"gi")},to=(e,t)=>{let n=Qr(e);if(n===null)return i=>i;let a=i=>t.some(o=>{let r=i[o];return typeof r=="string"&&r.search(n)!==-1});return i=>{let o=[],r=[];for(let u of i)a(u.item)?o.push(u):r.push(u);return[...o,...r]}}});import{memo as Ss}from"react";import{Fragment as Zr,jsx as ar}from"react/jsx-runtime";var Cs,Ne,or=Me(()=>{"use strict";Jr();de();Cs=`rounded ${kt.mark} px-1 ${s.fg}`,Ne=Ss(({text:e,query:t,enabled:n=!0})=>{if(!(n&&t?.trim()&&e))return ar(Zr,{children:e});let a=Qr(t);if(a===null)return ar(Zr,{children:e});let i=[],o=0,r=a.exec(e),u=0;for(;r;){let d=r[0],c=r.index;if(c>o&&i.push(e.substring(o,c)),d.length===0){a.lastIndex++,r=a.exec(e);continue}i.push(ar("mark",{className:Cs,children:d},`highlight-${c}-${u}`)),o=c+d.length,u+=1,r=a.exec(e)}return o<e.length&&i.push(e.substring(o)),ar(Zr,{children:i})});Ne.displayName="HighlightedText"});var ro={};bi(ro,{ContactDetailGrid:()=>no,default:()=>vs});import{useMemo as ea}from"react";import{Fragment as xs,jsx as ta,jsxs as Ts}from"react/jsx-runtime";var ir,no,vs,ao=Me(()=>{"use strict";Ft();ge();Xr();Yr();or();ir=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},no=({contactData:e,searchTerm:t,enableHighlighting:n,openEmailsWithGmail:a,openGmailCompose:i,isPopupVisible:o,onRequestClose:r})=>{let u=Q(),d=ea(()=>rn(e),[e]),c=ea(()=>an(e),[e]),f=d.value??"-",p=c.value??"-",l=ea(()=>at(e.updated_at,u.recordDateTime),[e.updated_at,u.recordDateTime]),g=ir(e.full_name)??u.noName,b=ir(e.company_name),v=ir(e.department),T=(N,U="-")=>ta(Ne,{text:N??U,query:t,enabled:n});return Ts(xs,{children:[ta(nr,{fullName:T(g),title:T(ir(e.title)),companyName:T(b),department:T(v),phoneNumber:p,email:T(f),updatedAtText:l}),o?ta(tr,{contactData:e,openEmailsWithGmail:a,openGmailCompose:i,onRequestClose:r}):null]})},vs=no});ge();de();Ee();import{DEFAULT_FUZZY_SEARCH_OPTIONS as ln}from"@aiquants/fuzzy-search";import{memo as Oi,useId as Ua}from"react";import{jsx as ot,jsxs as yt}from"react/jsx-runtime";var Vr=Oi(({searchOptions:e,setSearchOptions:t})=>{let n=Q(),a=`flex flex-col gap-1 rounded-md border ${M.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=Ua(),r=Ua(),u=[];return u.push(yt("div",{className:`${a} ${A.sky} border-l-4`,children:[yt("div",{className:`${i} ${m.sky}`,children:["\u{1F4D8} ",n.advancedLearningHeading]}),ot("label",{htmlFor:o,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.advancedLearningLabel}),ot("input",{id:o,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.learningWeight||ln.learningWeight,onChange:d=>t(c=>({...c,learningWeight:parseFloat(d.target.value)})),className:"h-11 w-full"}),yt("span",{className:`${m.sky} text-xs`,children:[n.currentValueLabel," ",e.learningWeight||ln.learningWeight]}),ot("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.advancedLearningHint})]},"learning")),u.push(yt("div",{className:`${a} ${A.indigo} border-l-4`,children:[yt("div",{className:`${i} ${m.indigo}`,children:["\u23F1\uFE0F ",n.advancedDebounceHeading]}),ot("label",{htmlFor:r,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.advancedDebounceLabel}),ot("input",{id:r,type:"range",min:"100",max:"1000",step:"50",value:e.debounceMs??ln.debounceMs,onChange:d=>t(c=>({...c,debounceMs:parseInt(d.target.value,10)})),className:"h-11 w-full"}),yt("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.debounceMs??ln.debounceMs]}),ot("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.advancedDebounceHint})]},"debounce")),yt("section",{className:"space-y-3",children:[yt("div",{className:"flex items-center justify-between gap-3",children:[yt("div",{className:`flex items-center gap-2 font-semibold ${s.fgSecondary} text-xs transition-colors`,children:[ot("span",{children:"\u26A1"}),ot("span",{className:"tracking-wide",children:n.settingsAdvancedTab})]}),ot("button",{type:"button",onClick:()=>t(d=>({...d,learningWeight:ln.learningWeight,debounceMs:ln.debounceMs})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${I.borderControl} ${M.muted} px-2 font-medium ${s.fgSecondary} ${x} transition-colors ${E.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),ot("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:u})]})});Vr.displayName="AdvancedSearchSettings";ge();de();Ee();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Ut}from"@aiquants/fuzzy-search";import{memo as Di,useId as it}from"react";import{jsx as se,jsxs as ue}from"react/jsx-runtime";var Kr=Di(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:i,setOpenEmailsWithGmail:o})=>{let r=Q(),u=`flex flex-col gap-1 rounded-md border ${M.surface} px-2 py-1 shadow-sm transition-colors`,d="text-xs font-semibold",c=it(),f=it(),p=it(),l=it(),g=it(),b=it(),v=it(),T=it(),N=it(),U=it(),z=[];return z.push(ue("div",{className:`${u} ${A.blue} border-l-4`,children:[ue("div",{className:`${d} ${m.blue}`,children:["\u{1F3AF} ",r.basicThresholdHeading]}),se("label",{htmlFor:c,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicThresholdLabel}),se("input",{id:c,type:"range",min:"0.0",max:e.sortBy==="relevance"?"1.5":"1.0",step:"0.05",value:e.threshold??Ut.threshold,onChange:y=>t(h=>({...h,threshold:parseFloat(y.target.value)})),className:"h-11 w-full"}),ue("span",{className:`${m.blue} text-xs`,children:[r.currentValueLabel," ",e.threshold??Ut.threshold]}),se("p",{className:`${w} ${s.fgMuted} transition-colors`,children:e.sortBy==="relevance"?r.basicThresholdRangeRelevance:r.basicThresholdRange})]},"threshold")),z.push(ue("div",{className:`${u} ${A.amber} border-l-4`,children:[ue("div",{className:`${d} ${m.amber}`,children:["\u{1FA84} ",r.basicDisplayHeading]}),ue("label",{htmlFor:f,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[se("input",{id:f,type:"checkbox",checked:e.caseSensitive??Ut.caseSensitive,onChange:y=>t(h=>({...h,caseSensitive:y.target.checked})),className:"h-3 w-3"}),r.basicCaseSensitive]}),ue("label",{htmlFor:p,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[se("input",{id:p,type:"checkbox",checked:n,onChange:y=>a(y.target.checked),className:"h-3 w-3"}),r.basicHighlight]}),ue("label",{htmlFor:l,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[se("input",{id:l,type:"checkbox",checked:i,onChange:y=>o(y.target.checked),className:"h-3 w-3"}),r.basicOpenEmailsWithGmail]}),ue("div",{className:"flex flex-col gap-1",children:[se("label",{htmlFor:g,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicMultiTermOperator}),ue("select",{id:g,value:e.multiTermOperator??Ut.multiTermOperator,onChange:y=>t(h=>({...h,multiTermOperator:y.target.value})),className:`min-h-11 rounded border ${I.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${M.surface} ${s.fg}`,children:[se("option",{value:"or",children:r.basicOperatorOr}),se("option",{value:"and",children:r.basicOperatorAnd})]}),se("p",{className:`${w} ${s.fgMuted} transition-colors`,children:r.basicMultiTermHint})]})]},"display")),z.push(ue("div",{className:`${u} ${A.emerald} border-l-4`,children:[ue("div",{className:`${d} ${m.emerald}`,children:["\u{1F4DA} ",r.basicSortHeading]}),ue("div",{className:"flex flex-col gap-2",children:[se("label",{htmlFor:b,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicSortBy}),ue("select",{id:b,value:e.sortBy||Ut.sortBy,onChange:y=>t(h=>({...h,sortBy:y.target.value})),className:`min-h-11 rounded border ${I.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${M.surface} ${s.fg}`,children:[se("option",{value:"score",children:r.basicSortByScore}),se("option",{value:"relevance",children:r.basicSortByRelevance}),se("option",{value:"original",children:r.basicSortByOriginal})]})]}),ue("div",{className:"flex flex-col gap-2",children:[se("label",{htmlFor:v,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicSortOrder}),ue("select",{id:v,value:e.sortOrder||Ut.sortOrder,onChange:y=>t(h=>({...h,sortOrder:y.target.value})),className:`min-h-11 rounded border ${I.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${M.surface} ${s.fg}`,children:[se("option",{value:"desc",children:r.basicSortDescending}),se("option",{value:"asc",children:r.basicSortAscending})]})]})]},"sorting")),z.push(ue("div",{className:`${u} ${A.purple} border-l-4`,children:[ue("div",{className:`${d} ${m.purple}`,children:["\u2699\uFE0F ",r.basicEngineHeading]}),se("label",{htmlFor:T,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicStrategy}),ue("select",{id:T,value:e.parallelSearchStrategy||Ut.parallelSearchStrategy,onChange:y=>t(h=>({...h,parallelSearchStrategy:y.target.value})),className:`min-h-11 rounded border ${I.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${M.surface} ${s.fg}`,children:[se("option",{value:"balanced",children:r.basicStrategyBalanced}),se("option",{value:"index-first",children:r.basicStrategyIndexFirst}),se("option",{value:"levenshtein-first",children:r.basicStrategyLevenshteinFirst})]}),ue("div",{className:"mt-2 space-y-2",children:[ue("label",{htmlFor:N,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[se("input",{id:N,type:"checkbox",checked:e.enableIndexFiltering!==!1,onChange:y=>t(h=>({...h,enableIndexFiltering:y.target.checked})),className:"h-3 w-3"}),r.basicIndexFiltering]}),ue("label",{htmlFor:U,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[se("input",{id:U,type:"checkbox",checked:e.enableLevenshtein!==!1,onChange:y=>t(h=>({...h,enableLevenshtein:y.target.checked})),className:"h-3 w-3"}),r.basicLevenshtein]})]})]},"engine")),ue("section",{className:"space-y-3",children:[ue("div",{className:`flex items-center gap-2 font-semibold ${m.blue} text-xs transition-colors`,children:[se("span",{children:"\u{1F527}"}),se("span",{className:"tracking-wide",children:r.settingsBasicTab})]}),se("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:z})]})});Kr.displayName="BasicSearchSettings";Ft();import{SWIPE_OVERLAY_SCROLL_AREA_STYLE as Ns}from"@aiquants/swipe-overlay";import Ms from"lucide-react/dist/esm/icons/badge-check.js";import Es from"lucide-react/dist/esm/icons/building-2.js";import Ls from"lucide-react/dist/esm/icons/calendar-clock.js";import ks from"lucide-react/dist/esm/icons/check.js";import ws from"lucide-react/dist/esm/icons/copy.js";import Rs from"lucide-react/dist/esm/icons/id-card.js";import Ps from"lucide-react/dist/esm/icons/mail.js";import _s from"lucide-react/dist/esm/icons/phone.js";import As from"lucide-react/dist/esm/icons/user-round.js";import{useCallback as $s,useEffect as Os,useMemo as cr,useRef as Ds,useState as Ws}from"react";var lt={info:(e,...t)=>console.info(`[contact-map] ${e}`,...t),warn:(e,...t)=>console.warn(`[contact-map] ${e}`,...t),error:(e,...t)=>console.error(`[contact-map] ${e}`,...t)};ge();de();de();_n();import*as Ye from"@radix-ui/react-tabs";import*as sr from"react";import{jsx as na}from"react/jsx-runtime";var lr=Ye.Root,On=sr.forwardRef(({className:e,...t},n)=>na(Ye.List,{ref:n,className:ke(`inline-flex h-10 items-center justify-center rounded-md ${M.muted} p-1 ${s.fgMuted}`,e),...t}));On.displayName=Ye.List.displayName;var Vt=sr.forwardRef(({className:e,...t},n)=>na(Ye.Trigger,{ref:n,className:ke(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ${E.ringOffsetSurface} transition-all focus-visible:outline-hidden focus-visible:ring-2 ${E.focusVisibleRing} focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 ${E.activeTabSurface} ${E.activeTabFg} data-[state=active]:shadow-2xs`,e),...t}));Vt.displayName=Ye.Trigger.displayName;var Kt=sr.forwardRef(({className:e,...t},n)=>na(Ye.Content,{ref:n,className:ke(`mt-2 ${E.ringOffsetSurface} focus-visible:outline-hidden focus-visible:ring-2 ${E.focusVisibleRing} focus-visible:ring-offset-2 data-[state=inactive]:hidden`,e),...t}));Kt.displayName=Ye.Content.displayName;dn();Ee();or();import{jsx as R,jsxs as ve}from"react/jsx-runtime";var oo=`truncate font-semibold ${s.fg} ${x}`,io={height:"var(--contact-panel-height, 100%)",maxHeight:"100%"},Hs=({icon:e,label:t,value:n,fieldKey:a,copyValue:i,onCopy:o,isCopied:r,linkHref:u,searchTerm:d,enableHighlighting:c})=>{let f=Q(),p=!!(o&&a&&i),l=u?.startsWith("https://mail.google.com")?"_blank":void 0;return ve("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${I.borderSubtle} ${M.subtle} px-2.5 py-1.5 transition-colors`,children:[ve("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[R("div",{className:`flex h-7 w-7 items-center justify-center rounded-full ${M.surface} ${s.fgMuted} transition-colors`,children:R(e,{size:14})}),ve("div",{className:"min-w-0 flex-1",children:[R("div",{className:`font-medium ${w} ${s.fgMuted}`,children:t}),u?R("a",{href:u,className:`align-top ${oo} ${cn}`,target:l,rel:l?"noopener noreferrer":void 0,children:R(Ne,{text:n,query:d??"",enabled:c})}):R("div",{className:oo,children:R(Ne,{text:n,query:d??"",enabled:c})})]})]}),p?R("button",{type:"button",onClick:()=>o&&a&&i&&o(a,i,t),className:`inline-flex h-11 w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border ${I.borderControl} ${M.surface} ${s.fgMuted} transition-colors ${E.hoverBlueAccentBorder} ${E.hoverBlueFg} ${st}`,"aria-label":f.copyField(t),children:r?R(ks,{size:14}):R(ws,{size:14})}):null]})},so=({items:e,searchTerm:t,enableHighlighting:n})=>R("dl",{className:"grid grid-cols-1 gap-x-3 gap-y-1.5 sm:grid-cols-2",children:e.map(a=>ve("div",{className:`flex flex-col gap-0.5 rounded-md border ${I.borderSubtle} ${M.surface} px-2 py-1 transition-colors`,children:[R("dt",{className:`font-semibold ${w} ${s.fgMuted} uppercase tracking-wide`,children:a.label}),R("dd",{className:`wrap-break-word ${s.fg} text-xs`,children:R(Ne,{text:a.value,query:t??"",enabled:n})})]},a.fieldKey))}),ra=({title:e})=>R("h3",{className:`font-semibold ${s.fgSecondary} text-xs`,children:e}),Fs=()=>{let e=Q();return ve("div",{className:`flex h-full min-h-40 w-full flex-1 flex-col items-center justify-center gap-2 rounded-xl border ${I.borderSubtle} border-dashed ${M.surface} p-4 text-center transition-colors`,children:[R("p",{className:`font-medium ${s.fgMuted} text-xs`,children:e.detailEmptyTitle}),R("p",{className:`${w} ${s.fgMuted}`,children:e.detailEmptyHint})]})},Is=Object.freeze({overlay:Ns,pane:void 0}),fn=({contact:e,placement:t,searchTerm:n,enableHighlighting:a,style:i,className:o=""})=>{let r=Q(),[u,d]=Ws(null),c=Ds(null),f=cr(()=>({...io,...i}),[i]);Os(()=>()=>{c.current!==null&&window.clearTimeout(c.current)},[]);let p=cr(()=>rn(e),[e]),l=cr(()=>an(e),[e]),g=cr(()=>at(e?.contacted_at,r.recordDateTime),[e?.contacted_at,r.recordDateTime]),b=$s(async(S,L,oe)=>{try{await navigator.clipboard.writeText(L),d(S),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{d(null)},2e3)}catch(F){lt.error("Failed to copy contact detail",F)}},[]);if(!e)return R("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${I.borderSubtle} ${M.surface} shadow-sm transition-colors`,style:io,children:R(Fs,{})});let v=[re(e.title),re(e.department)].filter(S=>S!=="-"),T=[v.join(" / "),re(e.company_name)].filter(S=>S&&S!=="-").join(" \u30FB ")||"-",N=Ge(e.full_name)??r.noName,U=[{fieldKey:"full_name",label:r.fieldFullName,value:N},{fieldKey:"full_name_reading",label:r.fieldFullNameReading,value:re(e.full_name_reading)},{fieldKey:"title",label:r.fieldTitle,value:re(e.title)},{fieldKey:"department",label:r.fieldDepartment,value:re(e.department)},{fieldKey:"company_name",label:r.fieldCompanyName,value:re(e.company_name)},{fieldKey:"company_name_reading",label:r.fieldCompanyNameReading,value:re(e.company_name_reading)},{fieldKey:"address",label:r.fieldAddress,value:re(e.address)},{fieldKey:"postal_code",label:r.fieldPostalCode,value:re(e.postal_code)},{fieldKey:"url",label:r.fieldUrl,value:re(e.url)}],z=[{label:r.fieldCustomEmail,value:re(e.custom_email),fieldKey:"custom_email",rawValue:e.custom_email},{label:r.fieldEmail,value:re(e.email),fieldKey:"email",rawValue:e.email}].filter(S=>S.value!=="-"),y=[{label:r.fieldCustomMobilePhone,value:re(e.custom_mobile_phone_number),fieldKey:"custom_mobile_phone_number",rawValue:e.custom_mobile_phone_number},{label:r.fieldMobilePhone,value:re(e.mobile_phone_number),fieldKey:"mobile_phone_number",rawValue:e.mobile_phone_number},{label:r.fieldCompanyPhone,value:re(e.company_phone_number),fieldKey:"company_phone_number",rawValue:e.company_phone_number},{label:r.fieldCompanyFax,value:re(e.company_fax_number),fieldKey:"company_fax_number",rawValue:e.company_fax_number}].filter(S=>S.value!=="-"),h=[{fieldKey:"person_id",label:"person_id",value:re(e.person_id)},{fieldKey:"person_id_redirect_to",label:"person_id_redirect_to",value:re(e.person_id_redirect_to)},{fieldKey:"is_active",label:"is_active",value:re(e.is_active)},{fieldKey:"is_contact_synced",label:"is_contact_synced",value:re(e.is_contact_synced)},{fieldKey:"is_incomplete",label:"is_incomplete",value:re(e.is_incomplete)},{fieldKey:"is_in_eight",label:"is_in_eight",value:re(e.is_in_eight)},{fieldKey:"created_by",label:r.fieldCreatedBy,value:re(e.created_by)},{fieldKey:"created_at",label:r.fieldCreatedAt,value:at(e.created_at,r.recordDateTime)},{fieldKey:"updated_by",label:r.fieldUpdatedBy,value:re(e.updated_by)},{fieldKey:"updated_at",label:r.fieldUpdatedAt,value:at(e.updated_at,r.recordDateTime)}],C=[{rowKey:"person_id",icon:Rs,label:"person_id",value:re(e.person_id),fieldKey:"person_id",copyValue:String(e.person_id)},{rowKey:"primary_email",icon:Ps,label:r.summaryEmail,value:p.value??"-",fieldKey:"primary_email",copyValue:p.value,linkHref:gt(p.value,!1)},{rowKey:"primary_phone",icon:_s,label:r.summaryPhone,value:l.value??"-",fieldKey:"primary_phone",copyValue:l.value,linkHref:Rn(l.value)},{rowKey:"contacted_at",icon:Ls,label:r.summaryLastContact,value:g}],k=[{sectionKey:"email",title:r.sectionEmail,emptyText:r.sectionEmailEmpty,entries:z,recommendedKey:p.fieldKey??null,resolveHref:S=>gt(S!=null?String(S):null,!1)},{sectionKey:"phone",title:r.sectionPhone,emptyText:r.sectionPhoneEmpty,entries:y,recommendedKey:l.fieldKey??null,resolveHref:S=>Rn(S!=null?String(S):null)}],H=[{value:"summary",label:r.detailTabSummary,content:ve("div",{className:"flex flex-col gap-4",children:[ve("div",{className:"flex flex-col gap-1",children:[ve("div",{className:`flex items-center gap-2 ${s.fgMuted} text-sm`,children:[R(Es,{size:16}),R("span",{children:R(Ne,{text:re(e.company_name),query:n??"",enabled:a})})]}),v.length>0?R("div",{className:`${s.fgMuted} text-sm`,children:v.map((S,L)=>ve("span",{children:[L>0&&" / ",R(Ne,{text:S,query:n??"",enabled:a})]},`header-line-${L}`))}):null]}),R("div",{className:"flex flex-col gap-3",children:C.map(S=>R(Hs,{icon:S.icon,label:S.label,value:S.value,fieldKey:S.fieldKey,copyValue:S.copyValue,onCopy:b,isCopied:S.fieldKey?u===S.fieldKey:!1,linkHref:S.linkHref,searchTerm:n,enableHighlighting:a},S.rowKey))})]})},{value:"basic",label:r.detailTabBasic,content:ve("div",{className:"flex flex-col gap-3",children:[R(ra,{title:r.detailBasicProfile}),R(so,{items:U,searchTerm:n,enableHighlighting:a})]})},{value:"contact",label:r.detailTabContact,content:R("div",{className:"flex flex-col gap-4",children:k.map(({sectionKey:S,title:L,emptyText:oe,entries:F,recommendedKey:be,resolveHref:ie})=>ve("div",{className:"flex flex-col gap-2",children:[R(ra,{title:L}),F.length===0?R("p",{className:`${s.fgMuted} text-xs`,children:oe}):R("div",{className:"flex flex-col gap-2",children:F.map(W=>{let O=ie(W.rawValue),q=W.fieldKey===be;return ve("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${I.borderSubtle} ${M.surface} px-3 py-2 transition-colors`,children:[ve("div",{className:"min-w-0 flex-1",children:[R("div",{className:`font-medium ${s.fgMuted} text-xs`,children:W.label}),R("div",{className:`wrap-break-word ${s.fg} text-sm`,children:O?R("a",{href:O,className:`text-inherit ${cn}`,children:R(Ne,{text:W.value,query:n??"",enabled:a})}):R(Ne,{text:W.value,query:n??"",enabled:a})})]}),q?ve("span",{className:`inline-flex shrink-0 items-center gap-1 rounded-full ${Y.emerald} px-2 py-0.5 font-semibold ${w} ${m.emerald} transition-colors`,children:[R(Ms,{size:14}),r.preferred]}):null]},W.fieldKey)})})]},S))})},{value:"meta",label:r.detailTabMeta,content:ve("div",{className:"flex flex-col gap-3",children:[R(ra,{title:r.detailTabMeta}),R(so,{items:h,searchTerm:n,enableHighlighting:a})]})}];return ve("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${I.borderSubtle} ${M.surface} shadow-sm transition-colors ${o}`.trim(),style:f,children:[R("div",{className:`${I.borderSubtle} border-b px-3 py-1.5 transition-colors ${M.subtle}`,children:ve("div",{className:"flex items-center gap-2",children:[R("div",{className:`flex h-8 w-8 items-center justify-center rounded-full ${Y.blue} ${m.blue} transition-colors`,children:R(As,{size:16})}),ve("div",{className:"min-w-0 flex-1",children:[R("div",{className:`truncate font-semibold ${s.fg} text-sm`,children:R(Ne,{text:N,query:n??"",enabled:a})}),R("div",{className:`truncate ${w} ${s.fgMuted}`,children:R(Ne,{text:T,query:n??"",enabled:a})})]})]})}),ve(lr,{defaultValue:"summary",className:"flex flex-1 flex-col overflow-hidden",children:[R(On,{className:`grid h-auto grid-cols-4 gap-1 rounded-none ${I.borderSubtle} border-b ${M.subtle} px-2 py-1 transition-colors`,children:H.map(S=>R(Vt,{value:S.value,className:`flex min-h-11 min-w-0 touch-manipulation rounded-md px-1 py-1 font-semibold ${s.fgSecondary} ${x} transition-colors ${E.activeTabSurface} ${E.activeTabBlueFg}`,children:R("span",{className:"min-w-0 truncate",children:S.label})},S.value))}),H.map(S=>R(Kt,{value:S.value,className:`scrollbar-thin flex-1 overflow-y-auto px-2.5 py-2 transition-colors ${s.fgSecondary}`,style:Is[t],children:S.content},S.value))]})]})};Bt();ge();de();import{memo as Bs}from"react";import{jsx as Rt,jsxs as aa}from"react/jsx-runtime";var oa=Bs(({recordCount:e,companyCount:t,phase:n,loadedCount:a,totalCount:i})=>{let{locale:o,labels:r}=Pe(),u=ne(o,e),d=ne(o,t);return aa("div",{"data-testid":"contact-map-annotation",className:"flex flex-wrap items-center gap-2 leading-1 transition-colors",children:[aa("span",{className:"flex items-baseline gap-1",children:[Rt("span",{className:s.fgMuted,children:r.annotationTotalLabel}),Rt("span",{className:s.fg,"data-testid":"contact-map-record-count",children:u}),Rt("span",{className:s.fgMuted,children:r.recordUnit(u)})]}),aa("span",{className:"flex items-baseline gap-1",children:[Rt("span",{className:s.fgMuted,children:r.annotationCompaniesLabel}),Rt("span",{className:s.fg,"data-testid":"contact-map-company-count",children:d}),Rt("span",{className:s.fgMuted,children:r.companyUnit(d)})]}),n==="streaming"||n==="idle"?Rt("span",{"data-testid":"contact-map-stream-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${Y.blue} px-2 py-0.5 font-medium ${m.blue} text-xs`,children:i!==null&&i>0?r.annotationStreamingProgress({loaded:a,total:i,percent:Math.min(100,Math.round(a/i*100))}):r.annotationStreamingCount(a)}):null,n==="retrying"?Rt("span",{"data-testid":"contact-map-reconnecting-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${Y.amber} px-2 py-0.5 font-medium ${m.amber} text-xs`,children:r.annotationReconnecting(a)}):null]})});oa.displayName="ContactMapAnnotation";sn();import{useMemo as gi}from"react";Lt();var dr=e=>e==="unauthenticated"||e==="forbidden";function ur(e,t){if(typeof e!="function")throw new TypeError(`[contact-map] ${t} must be the host's access failure presenter (a function, AccessFailurePresenter of @aiquants/auth-core); got ${ee(e)}`)}function lo(e,t){if(typeof e!="number")throw new TypeError(`[contact-map] ${t} must be the stream's accessFailureNumber (a number); got ${ee(e)}`);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`[contact-map] ${t} must be a non-negative safe integer (the stream's accessFailureNumber); got ${ee(e)}`)}Lt();sn();ge();import{createContext as Us,useContext as Vs,useMemo as Ks}from"react";Lt();sn();Dr();var zs=["indexWorker","levenshteinWorker","treeWorker"];function co(e,t,n){if(n!==void 0){if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string or left out (pass url.href for a URL object); got ${ee(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${ee(n)}`)}}var uo={setting:"workerUrls"},mo=(e,t)=>{if(e===void 0)return;let{setting:n,keys:a=zs,hints:i={}}=t;if(!on(e))throw new TypeError(`[contact-map] ${n} must be a plain object or left out; got ${ee(e)}`);let o=Object.getOwnPropertyNames(e).map(d=>({key:d,url:e[d]})),r=o.find(({key:d,url:c})=>c!==void 0&&!a.includes(d));if(r!==void 0){let d=Object.hasOwn(i,r.key)?i[r.key]:void 0,c=d===void 0?qn(r.key,a):void 0;throw new RangeError(`[contact-map] ${n} has a key it does not take (it takes ${a.join(", ")}${d===void 0?"":`; ${d}`}${c===void 0?"":`; did you mean ${JSON.stringify(c)}?`}); got ${ee(r.key)}`)}let u=Object.create(null);for(let{key:d,url:c}of o){let f=d;co(n,f,c),c!==void 0&&(u[f]=c)}return u};function wm(e,t=uo){mo(e,t)}function po(e){co("workerUrls","treeWorker",e)}var gn=(e,t,n=uo)=>{let a=mo(t,n);return{indexWorker:a?.indexWorker===void 0?e?.indexWorker:a.indexWorker,levenshteinWorker:a?.levenshteinWorker===void 0?e?.levenshteinWorker:a.levenshteinWorker,treeWorker:a?.treeWorker===void 0?e?.treeWorker:a.treeWorker}};import{jsx as ia}from"react/jsx-runtime";var fo=e=>{if(!on(e))throw new TypeError(`[contact-map] config must be a plain object; got ${ee(e)}`);let t=e;return{streamEndpoint:Le(t,"streamEndpoint"),openEmailsWithGmail:Le(t,"openEmailsWithGmail"),treeWorkerFactory:Le(t,"treeWorkerFactory"),workerUrls:gn(void 0,Le(t,"workerUrls")),locale:Le(t,"locale"),labels:Le(t,"labels")}},go=({workerUrls:e,...t})=>{let{indexWorker:n,levenshteinWorker:a,treeWorker:i}=e;return Object.freeze(Object.assign(Object.create(null),t,{workerUrls:Object.freeze({indexWorker:n,levenshteinWorker:a,treeWorker:i})}))},js=go(fo({})),ho=Us(js),Gs=Object.freeze({locale:"locale",labels:"labels"});function sa({config:e,chromeSurface:t,children:n}){let{streamEndpoint:a,openEmailsWithGmail:i,treeWorkerFactory:o,workerUrls:r,locale:u,labels:d}=fo(e),{indexWorker:c,levenshteinWorker:f,treeWorker:p}=r,l=Ks(()=>go({streamEndpoint:a,openEmailsWithGmail:i,treeWorkerFactory:o,workerUrls:{indexWorker:c,levenshteinWorker:f,treeWorker:p},locale:u,labels:d}),[a,i,o,c,f,p,u,d]);return ia(ho.Provider,{value:l,children:ia(Ia,{locale:u,labels:d,surface:t,children:n})})}function qs({config:e,children:t}){return ia(sa,{config:e,chromeSurface:Gs,children:t})}function bt(){return Vs(ho)}import{useCallback as la,useEffect as tl,useMemo as fr,useSyncExternalStore as yo}from"react";Lt();import{accessFailureKindOfStatus as Xs}from"@aiquants/auth-core";var Ys=1e3,Qs=3e4,Js=6;function pr(e){if(typeof e!="string")throw new TypeError(`[contact-map] streamEndpoint must be a same-origin absolute path such as "/api/contact_map/stream", set on ContactMapConfigProvider or ContactMapAppView; got ${ee(e)}`);if(/[\s\p{Cc}#]/u.test(e))throw new RangeError(`[contact-map] streamEndpoint must not contain whitespace, control characters or "#"; got ${ee(e)}`);if(!e.startsWith("/")||e.startsWith("//")||e.startsWith("/\\"))throw new RangeError(`[contact-map] streamEndpoint must be a same-origin absolute path such as "/api/contact_map/stream"; got ${ee(e)}`)}var Zs=e=>({...e,contacted_at:e.contacted_at?new Date(e.contacted_at):null,created_at:e.created_at?new Date(e.created_at):void 0,updated_at:e.updated_at?new Date(e.updated_at):void 0}),el=e=>Array.isArray(e.records),mr=class{constructor(t){this.recordMap=new Map;this.listeners=new Set;this.lastCursor=null;this.consecutiveFailures=0;this.started=!1;this.disposed=!1;this.activeController=null;this.wakeRetryWait=null;this.state={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null,accessFailureNumber:0};this.handleOnline=()=>{this.wakeRetryWait?.()};pr(t.endpoint),this.fetchFn=t.fetchFn??((...n)=>fetch(...n)),this.endpoint=t.endpoint,this.initialRetryDelayMs=t.initialRetryDelayMs??Ys,this.maxRetryDelayMs=t.maxRetryDelayMs??Qs,this.maxConsecutiveFailures=t.maxConsecutiveFailures??Js,this.logger=t.logger??lt}getState(){return this.state}getRecordMap(){return this.recordMap}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}start(){this.started||this.disposed||(this.started=!0,typeof window<"u"&&window.addEventListener("online",this.handleOnline),this.runStreamLoop())}retryNow(){if(!this.disposed)switch(this.state.phase){case"retrying":this.wakeRetryWait?.();return;case"failed":case"unauthenticated":case"forbidden":this.consecutiveFailures=0,this.setState({error:null,isLoading:this.recordMap.size===0}),this.runStreamLoop();return;case"idle":case"streaming":case"complete":return}}dispose(){this.disposed=!0,this.activeController?.abort(),this.wakeRetryWait?.(),typeof window<"u"&&window.removeEventListener("online",this.handleOnline)}setState(t){this.state={...this.state,...t};for(let n of this.listeners)n(this.state)}publishRecords(t={}){let n=Array.from(this.recordMap.values());this.setState({records:n,loadedCount:n.length,isLoading:!1,...t})}async runStreamLoop(){this.setState({phase:"streaming"});let t=!1;for(;!this.disposed;){let n=this.lastCursor!==null,a=await this.streamOnce();if(a==="aborted")return;if(a==="complete"){this.publishRecords({isComplete:!0,phase:"complete",error:null});return}if(typeof a=="object"){this.setState({phase:a.accessFailure,isLoading:!1,error:null,accessFailureNumber:this.state.accessFailureNumber+1});return}if(a==="rejected"){if(n&&!t){t=!0,this.lastCursor=null,this.logger.warn("[ContactMapStream] the server rejected the resume cursor (400); restarting from the beginning");continue}this.setState({phase:"failed",isLoading:!1,error:new Error("[contact-map] the server rejected the stream request (400); reload the page")});return}if(this.consecutiveFailures+=1,this.consecutiveFailures>=this.maxConsecutiveFailures){this.setState({phase:"failed",isLoading:!1});return}let i=Math.min(this.initialRetryDelayMs*2**(this.consecutiveFailures-1),this.maxRetryDelayMs);if(this.setState({phase:"retrying",isLoading:this.recordMap.size===0}),this.logger.warn(`[ContactMapStream] retrying in ${i}ms (attempt ${this.consecutiveFailures})`),await this.waitBeforeRetry(i),this.disposed)return;this.setState({phase:"streaming"})}}waitBeforeRetry(t){return new Promise(n=>{let a=setTimeout(()=>{this.wakeRetryWait=null,n()},t);this.wakeRetryWait=()=>{clearTimeout(a),this.wakeRetryWait=null,n()}})}buildStreamUrl(){if(!this.lastCursor)return this.endpoint;let t=this.endpoint.includes("?")?"&":"?",n=new URLSearchParams;return this.lastCursor.contacted_at!==null&&n.set("cursor_contacted_at",this.lastCursor.contacted_at),n.set("cursor_person_id",String(this.lastCursor.person_id)),`${this.endpoint}${t}${n.toString()}`}async streamOnce(){this.activeController=new AbortController;try{let t=await this.fetchFn(this.buildStreamUrl(),{signal:this.activeController.signal,credentials:"same-origin"}),n=Xs(t.status);if(n!==null)return{accessFailure:n};if(t.status===400)return"rejected";if(!(t.ok&&t.body))return this.logger.warn(`[ContactMapStream] unexpected response: ${t.status}`),this.setState({error:new Error(`[contact-map] the stream request failed (status ${t.status})`)}),"retryable";let a=t.body.getReader(),i=new TextDecoder,o="",r=!1,u=!1;for(;;){let{done:d,value:c}=await a.read();if(d)break;let f=i.decode(c,{stream:!0}),p=(o+f).split(`
|
|
2
|
+
`);o=p.pop()??"";let l=!1;for(let g of p){let b=g.trim();if(!b)continue;let v;try{v=JSON.parse(b)}catch(T){this.logger.warn("[ContactMapStream] failed to parse NDJSON line:",T);continue}if("type"in v&&v.type==="METADATA"){Number.isSafeInteger(v.total)&&v.total>=0&&this.setState({totalCount:v.total});continue}if(!el(v)){this.logger.warn("[ContactMapStream] server reported error:","error"in v?v.error:""),u=!0;continue}for(let T of v.records)T&&typeof T.person_id=="number"&&(this.recordMap.set(T.person_id,Zs(T)),l=!0);v.nextCursor&&(this.lastCursor=v.nextCursor),v.isLast&&(r=!0)}l&&(this.consecutiveFailures=0,this.publishRecords({error:null}))}return u?(this.setState({error:new Error("Stream interrupted by server error")}),"retryable"):r?"complete":(this.setState({error:new Error("Stream ended before completion")}),"retryable")}catch(t){if(t instanceof Error&&t.name==="AbortError")return"aborted";let n=t instanceof Error?t:new Error(String(t));return this.setState({error:n}),"retryable"}finally{this.activeController=null}}};var Qe=null,nl=e=>{if(Qe!==null&&Qe.endpoint===e)return Qe;if(pr(e),Qe===null)return Qe=new mr({endpoint:e}),Qe;if(Qe.endpoint!==e)throw new Error(`[contact-map] the stream client already streams from ${JSON.stringify(Qe.endpoint)} and cannot also stream from ${JSON.stringify(e)}; give every contact-map view in the browser tab the same streamEndpoint, on every route (after changing it, reload the page)`);return Qe},jm=()=>{Qe?.dispose(),Qe=null},rl=new Map,al={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null,accessFailureNumber:0},ol=()=>{let{streamEndpoint:e}=bt();return fr(()=>(pr(e),e),[e])};function il(){let e=ol(),t=la(()=>nl(e),[e]);tl(()=>{let r=t();r.start(),r.retryNow()},[t]);let n=la(r=>t().subscribe(r),[t]),a=yo(n,()=>t().getState(),()=>al),i=yo(n,()=>t().getRecordMap(),()=>rl),o=la(()=>t().retryNow(),[t]);return fr(()=>({...a,recordMap:i,retryNow:o}),[a,i,o])}var sl=e=>{let t=new Set;for(let{company_name:n}of e)typeof n=="string"&&n.trim().length>0&&t.add(n);return t.size};function gr(){let{records:e,recordMap:t,isComplete:n,phase:a,loadedCount:i,totalCount:o,error:r,accessFailureNumber:u,retryNow:d}=il(),c=fr(()=>sl(e),[e]);return{context:fr(()=>({contactMapRecords:e,contactMapRecordMap:t,isStreamingComplete:n,isStreamingFailed:a==="failed"||dr(a),streamPhase:a,streamAccessFailureNumber:u,loadedCount:i,companyCount:c,totalCount:o,errorMessage:r?.message??null}),[e,t,n,a,u,i,c,o,r]),retryNow:d}}ge();import{DEFAULT_FUZZY_SEARCH_OPTIONS as qc,parseQuerySets as Xc}from"@aiquants/fuzzy-search";import{useFuzzySearch as Yc}from"@aiquants/fuzzy-search/react";import Qc from"lucide-react/dist/esm/icons/search.js";import{useCallback as xn,useEffect as Ct,useMemo as _t,useRef as li,useState as et,useTransition as Jc}from"react";import{useNavigation as Zc,useSearchParams as ed}from"react-router";Jr();sn();import{useCallback as jt,useEffect as ll,useRef as bo}from"react";var Pt=e=>{let t=bo(null),n=bo({isPointerDown:!1,isDragging:!1,startX:0,scrollLeft:0,pointerId:0,hasCapture:!1,didDrag:!1,pointerType:""}),a=e?.dragThreshold??4,i=jt(p=>{let l=p.currentTarget,g=p.deltaY;!l||g===0||(p.preventDefault(),l.scrollBy({left:g,behavior:"smooth"}))},[]),o=jt(p=>{t.current?.removeEventListener("wheel",i),t.current=p,p?.addEventListener("wheel",i,{passive:!1})},[i]);ll(()=>()=>{t.current&&t.current.removeEventListener("wheel",i)},[i]);let r=jt(p=>{if(p.pointerType==="touch")return;let l=n.current;l.isPointerDown=!0,l.isDragging=!1,l.startX=p.clientX,l.scrollLeft=p.currentTarget.scrollLeft,l.pointerId=p.pointerId,l.hasCapture=!1,l.pointerType=p.pointerType},[]),u=jt(p=>{let l=n.current;if(!l.isPointerDown||l.pointerType==="touch")return;let g=p.currentTarget,b=p.clientX-l.startX;!l.isDragging&&Math.abs(b)>a&&(l.isDragging=!0,l.hasCapture||(g.setPointerCapture?.(p.pointerId),l.hasCapture=!0)),l.isDragging&&(p.preventDefault(),g.scrollLeft=l.scrollLeft-b)},[a]),d=jt(p=>{let l=n.current;if(l.pointerType==="touch")return;let g=p.currentTarget;l.isPointerDown&&l.hasCapture&&g.hasPointerCapture?.(p.pointerId)&&g.releasePointerCapture(p.pointerId),l.isDragging&&(l.didDrag=!0,window.setTimeout(()=>{l.didDrag=!1},0)),l.isPointerDown=!1,l.isDragging=!1,l.pointerId=0,l.hasCapture=!1},[]),c=jt(p=>{d(p)},[d]),f=jt(p=>{n.current.didDrag&&(p.preventDefault(),p.stopPropagation(),n.current.didDrag=!1)},[]);return{setScrollableRef:o,onPointerDown:r,onPointerMove:u,onPointerUp:c,onPointerLeave:c,onPointerCancel:c,onClickCapture:f}};Bt();ge();import{DEFAULT_FUZZY_SEARCH_OPTIONS as cl}from"@aiquants/fuzzy-search";var dl="@aiquants/contact-map:search",hr=e=>{let{indexWorkerOptions:t,levenshteinWorkerOptions:n,...a}=cl;return{...a,autoSearchOnIndexRebuild:!1,multiTermOperator:"and",workerId:dl,workerUrls:e,indexWorkerOptions:{...t},levenshteinWorkerOptions:{...n}}};var ul="[data-contact-map-search-page]",ml="[data-contact-map-search-field]",So='[data-contact-map-page-tabs] [role="tab"][aria-selected="true"]',pl=[ml,So],fl="(pointer: coarse)",ca=e=>e!==null&&typeof e.matchMedia=="function"&&e.matchMedia(fl).matches,Co=e=>{for(let t=e;t!==null;t=t.parentElement){let n=t.querySelector(ul);if(n!==null)return n}return null},vo=e=>{let{ownerDocument:t}=e,{activeElement:n}=t;if(n!==null&&n!==t.body)return null;let a=ca(t.defaultView)?[So]:pl;for(let i of a){let o=e.querySelector(i);if(o!==null&&(o.focus(),t.activeElement===o))return o}return null};de();de();_n();import{jsx as xo}from"react/jsx-runtime";function To({value:e,max:t=100,className:n,indicatorClassName:a,...i}){let o=e===void 0,r=o?0:Math.min(100,Math.max(0,e/t*100));return xo("div",{role:"progressbar","aria-valuenow":o?void 0:r,"aria-valuemin":0,"aria-valuemax":100,"data-slot":"progress",className:ke(`relative h-2 w-full overflow-hidden rounded-full ${kt.progressTrack}`,n),...i,children:xo("div",{"data-slot":"progress-indicator",className:ke(`h-full rounded-full ${qe.blue} transition-[width] duration-300 ease-in-out will-change-transform`,o&&"w-1/3 animate-progress-indeterminate",a),style:o?void 0:{width:`${r}%`}})})}Ee();var hn="view";import{useCallback as $c,useState as Oc}from"react";import{useSearchParams as Dc}from"react-router";ge();de();Ee();Ft();import{Panel as Ro,PanelGroup as Hl,PanelResizeHandle as Fl}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as Il,VirtualScroll as Bl,virtualScrollItemElementId as zl}from"@aiquants/virtualscroll";import{lazy as Ul,memo as Vl,Suspense as Kl,useCallback as Ie,useEffect as Wo,useId as Po,useLayoutEffect as Ho,useMemo as Gt,useRef as yn,useState as Hn}from"react";var Dn={listPanelMinWidth:320,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35},Wn={listPanelMinWidth:280,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:35};function yr(e){let t=e.listPanelMinWidth+e.detailPanelMinWidth+e.handleThickness+e.listPaddingAndBorder+e.detailPaddingAndBorder,n=t+e.scrollbarSafetyBuffer,a=n+e.hysteresisSafetyMargin,i=a-n;return{physicalMinWidth:t,collapseThreshold:n,expandThreshold:a,hysteresisWidth:i}}import{useCallback as gl,useEffect as hl,useState as yl}from"react";var No=(e,t)=>{let{enableMutationObserver:n=!1,bottomGap:a=4,minFallbackHeight:i=240}=t??{},[o,r]=yl(600),u=gl(()=>{if(typeof window>"u")return;let d=e.current;if(!d||d.offsetParent===null&&window.getComputedStyle(d).position!=="fixed")return;let c=L=>Number.parseFloat(L)||0,{top:f}=d.getBoundingClientRect(),p=d.parentElement?.getBoundingClientRect(),l=window.getComputedStyle(document.documentElement),g=c(l.getPropertyValue("--footer-height")),b=c(l.getPropertyValue("--header-height")),v=c(l.getPropertyValue("--scrollbar-height")),T=window.getComputedStyle(d),N=c(T.marginBottom),U=c(T.paddingBottom),z=window.innerHeight-g-v-a,y=p?Math.min(p.bottom,z):z,h=p?Math.max(p.top,b):b,C=Math.max(f,h),k=y-C-N-U,H=Number.isFinite(k)?Math.floor(k):0,S=H>0?H:i;S>0&&Number.isFinite(S)&&r(L=>Math.abs(L-S)>1?S:L)},[a,e,i]);return hl(()=>{if(typeof window>"u")return;let d=null,c=null,f=null,p=null,l=()=>{d!==null&&window.cancelAnimationFrame(d),d=window.requestAnimationFrame(()=>{u()})};l(),c=window.setTimeout(()=>{l()},150);let g=e.current;return typeof ResizeObserver<"u"&&g&&(f=new ResizeObserver(()=>{l()}),f.observe(g),g.parentElement&&f.observe(g.parentElement)),n&&typeof MutationObserver<"u"&&(p=new MutationObserver(()=>{l()}),p.observe(document.body,{attributes:!0,childList:!0,subtree:!0})),window.addEventListener("resize",l),()=>{d!==null&&window.cancelAnimationFrame(d),c!==null&&window.clearTimeout(c),f&&f.disconnect(),p&&p.disconnect(),window.removeEventListener("resize",l)}},[e,n,u]),{viewportHeight:o,updateViewportHeight:u}};import{useCallback as St,useEffect as Mo,useRef as br,useState as Eo}from"react";var bl=600,Lo=8,Sr=({ref:e,onSelect:t,resolveItem:n,item:a})=>{let[i,o]=Eo(!1),[r,u]=Eo(null),d=br(null),c=br(!1),f=br(null),p=br({onSelect:t,resolveItem:n,item:a});Mo(()=>{p.current={onSelect:t,resolveItem:n,item:a}},[t,n,a]);let l=St(()=>{typeof window>"u"||d.current!==null&&(window.clearTimeout(d.current),d.current=null)},[]),g=St(()=>{f.current&&(l(),f.current=null)},[l]),b=St(h=>{typeof window>"u"||h.button!==0&&h.pointerType==="mouse"||(l(),c.current=!1,f.current={x:h.clientX,y:h.clientY,pointerId:h.pointerId},d.current=window.setTimeout(()=>{let C=p.current,k=null;C.item!==void 0?k=C.item:C.resolveItem&&h.target&&(k=C.resolveItem(h.target)),k!==null&&(c.current=!0,C.onSelect?.(k),u(k),o(!0)),g()},bl))},[l,g]),v=St(h=>{f.current&&h.pointerId===f.current.pointerId&&(l(),f.current=null)},[l]),T=St(h=>{c.current&&(h.preventDefault(),h.stopPropagation(),h.type==="click"&&(c.current=!1))},[]),N=St(()=>{c.current=!1},[]),U=St(h=>{if(!f.current||h.pointerId!==f.current.pointerId)return;let C=Math.abs(h.clientX-f.current.x),k=Math.abs(h.clientY-f.current.y);(C>Lo||k>Lo)&&(l(),f.current=null)},[l]),z=St(h=>{(i||d.current!==null)&&(h.preventDefault(),h.stopPropagation())},[i]),y=St(()=>{o(!1),u(null),c.current=!1,f.current=null},[]);return Mo(()=>{let h=e.current;if(!(h&&typeof window<"u"))return;let C=[["pointerdown",b,void 0],["pointerup",v,void 0],["pointercancel",v,void 0],["pointermove",U,void 0],["pointerleave",v,void 0],["contextmenu",z,void 0]],k=[["mousedown",T,!0],["mouseup",T,!0],["click",T,!0],["pointerdown",N,!0],["keydown",N,!0],["contextmenu",z,!0],["pointerup",v,!0],["pointercancel",v,!0]];for(let[H,S,L]of C)h.addEventListener(H,S,L);for(let[H,S,L]of k)window.addEventListener(H,S,L);return()=>{for(let[H,S,L]of C)h.removeEventListener(H,S,L);for(let[H,S,L]of k)window.removeEventListener(H,S,L);l()}},[e,b,v,U,T,N,z,l]),{isPopupVisible:i,popupItem:r,handleClosePopup:y}};import{useCallback as Sl,useEffect as Cl,useState as ko,useSyncExternalStore as vl}from"react";function Cr(e,t,n){let a=n?.mediaQuery??"(min-width: 1024px)",i=vl(Sl(f=>{if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let p=window.matchMedia(a);return p.addEventListener("change",f),()=>p.removeEventListener("change",f)},[a]),()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(a).matches:!0,()=>!1),[o,r]=ko(!1),[u,d]=ko(0);return Cl(()=>{if(typeof window>"u"||typeof ResizeObserver>"u")return;let f=e.current;if(!f)return;let p=new ResizeObserver(l=>{for(let g of l){if(g.target!==f)continue;let b=0;g.borderBoxSize&&g.borderBoxSize.length>0?b=g.borderBoxSize[0].inlineSize:b=g.contentRect.width,!(!Number.isFinite(b)||b<=0)&&(d(b),r(v=>v&&b>=t.expandThreshold?!1:!v&&b<t.collapseThreshold?!0:v))}});return p.observe(f),()=>p.disconnect()},[e,t.collapseThreshold,t.expandThreshold]),{isTwoColumn:i&&!o,isContainerNarrow:o,isMediaMatches:i,containerWidth:u}}ge();Lt();import{isInputMethodKey as xl}from"@aiquants/input-method";var wo=(e,t)=>{if(Ml(t),e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||xl(e)||t.itemCount===0)return null;if(e.key==="Enter"||e.key===" ")return{kind:"activate"};let n=t.itemCount-1;if(t.activeIndex===null)return Nl(e.key)?{kind:"move",index:t.startIndex,direction:1}:null;let a=t.activeIndex;switch(e.key){case"ArrowDown":return{kind:"move",index:Math.min(a+1,n),direction:1};case"ArrowUp":return{kind:"move",index:Math.max(a-1,0),direction:-1};case"PageDown":return{kind:"move",index:Math.min(a+t.pageSize,n),direction:1};case"PageUp":return{kind:"move",index:Math.max(a-t.pageSize,0),direction:-1};case"Home":return{kind:"move",index:0,direction:1};case"End":return{kind:"move",index:n,direction:-1};default:return null}},Tl=new Set(["ArrowDown","ArrowUp","PageDown","PageUp","Home","End"]),Nl=e=>Tl.has(e),Ml=e=>{let{activeIndex:t,startIndex:n,itemCount:a,pageSize:i}=e;if(!Number.isInteger(a)||a<0)throw new RangeError(`[contact-map] listbox itemCount must be a non-negative integer; got ${ee(a)}`);if(!Number.isInteger(i)||i<1)throw new RangeError(`[contact-map] listbox pageSize must be an integer of at least 1; got ${ee(i)}`);let o=r=>Number.isInteger(r)&&r>=0&&r<a;if(a>0&&!o(n))throw new RangeError(`[contact-map] listbox startIndex must be an index below ${a}; got ${ee(n)}`);if(t!==null&&!o(t))throw new RangeError(`[contact-map] listbox activeIndex must be null or an index below ${a}; got ${ee(t)}`)};de();ge();jr();de();dn();_n();import{SWIPE_OVERLAY_SCROLL_AREA_STYLE as El,useOverlayPresence as Ll,useSwipeOverlayDialog as kl}from"@aiquants/swipe-overlay";import{useCallback as wl,useId as Rl}from"react";import{jsx as vr,jsxs as da}from"react/jsx-runtime";var Pl=ke(Yn,"flex overflow-hidden"),_l=ke(Jn,"motion-safe:transition-opacity motion-safe:duration-200"),Al=`relative ml-auto flex h-full w-full max-w-lg flex-col ${M.surface} shadow-xl motion-safe:transition-[transform] motion-safe:duration-200 motion-safe:ease-out`,$l=`flex shrink-0 items-center justify-between gap-3 ${I.borderSubtle} border-b px-3 py-2`,Ol=`min-w-0 truncate font-semibold text-base ${s.fg} outline-none`,Dl=`inline-flex min-h-11 min-w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border ${I.borderControl} px-4 font-medium ${s.fgSecondary} text-sm ${E.hoverMuted} ${st}`,Wl="flex min-h-0 flex-1 flex-col overflow-y-auto p-3",xr=({isOpen:e,onClose:t,children:n,className:a,title:i})=>{let o=Q(),r=Rl(),u=Ll(e),d=wl(b=>b.ownerDocument.getElementById(r),[r]),{dialogProps:c,backdropProps:f,panelProps:p,attemptClose:l,isSwiping:g}=kl({isOpen:e,onClose:t,isCloseBlocked:Zn,skipWhenTextSelected:!0,initialFocus:d});return u?da("dialog",{...c,"data-testid":"contact-map-mobile-overlay","aria-labelledby":r,className:ke(Pl,e&&!g?"pointer-events-auto":"pointer-events-none"),style:Qn,children:[vr("div",{...f,"data-contact-map-overlay-backdrop":"",className:ke(_l,e?"opacity-100":"opacity-0")}),da("div",{...p,"data-contact-map-overlay-panel":"",className:ke(Al,e?"pointer-events-auto":"pointer-events-none",a),children:[da("div",{className:$l,children:[vr("h2",{id:r,tabIndex:-1,className:Ol,children:i===void 0?o.overlayTitle:i}),vr("button",{type:"button",className:Dl,onClick:()=>l(),children:o.close})]}),vr("div",{"data-contact-map-overlay-body":"",className:Wl,style:El,children:n})]})]}):null};dn();Ee();Yr();import{Fragment as oc,jsx as K,jsxs as Je}from"react/jsx-runtime";var jl=Ul(async()=>({default:(await Promise.resolve().then(()=>(ao(),ro))).default})),ua=64,_o="h-[64px]",Ao=240,Gl=4,ma=yr(Dn),ql=Dn.listPanelMinWidth,Xl=Dn.detailPanelMinWidth,Yl=Dn.handleThickness,Fp=ma.collapseThreshold,Ip=ma.expandThreshold,Ql=({contactData:e})=>{let t=Q(),n=Ge(e?.full_name)??t.noName,a=Ge(e?.title)??"-",i=Ge(e?.company_name)??"-",o=Ge(e?.department)??"-",r=rn(e).value??"-",u=an(e).value??"-",d=at(e?.updated_at,t.recordDateTime);return K(nr,{fullName:n,title:a,companyName:i,department:o,phoneNumber:u,email:r,updatedAtText:d})},Jl=e=>({"--contact-panel-height":`${e}px`}),Zl=e=>typeof e=="object"&&e!==null&&"item"in e,ec=(e,t)=>t!==void 0?`${e}:${t.toFixed(3)}`:void 0,tc=(e,t)=>{for(let n of e){let a=Ht(n);if(a?.person_id===t)return a}return null},$o=(e,t)=>t!==null&&Ht(e)?.person_id===t,Oo=(e,t,n)=>{for(let a=t;a>=0&&a<e.length;a+=n){let i=Ht(e[a]);if(i!==null)return{index:a,personId:i.person_id}}return null},Do=(e,t,n)=>{let a=Oo(e,t,n);return a!==null?a:Oo(e,t-n,n===1?-1:1)},pa=(e,t,n)=>{let{viewportHeight:a}=No(t,{enableMutationObserver:!0,bottomGap:Gl,minFallbackHeight:Ao}),[i,o]=Hn(0),r=Ie(()=>{let p=n.current,l=t.current;if(!(p&&l))return;let g=p.getBoundingClientRect(),b=l.getBoundingClientRect(),v=Math.ceil(b.top-g.top);Number.isFinite(v)&&v>0&&o(T=>Math.abs(T-v)>1?v:T)},[t,n]);Ho(()=>{if(!e)return;r();let p=requestAnimationFrame(r);return window.addEventListener("resize",r),()=>{cancelAnimationFrame(p),window.removeEventListener("resize",r)}},[e,r]);let u=a>0?a:Ao,d=i>0?i:0,c=u+d,f=Gt(()=>Jl(c),[c]);return{normalizedViewportHeight:u,normalizedDetailHeight:c,panelSizingStyle:f}},nc=new Set,rc=()=>{let[e,t]=Hn(nc),n=Ie((a,i)=>{t(o=>{if(o.has(a)===i)return o;let r=new Set(o);return i?r.add(a):r.delete(a),r})},[]);return{isAnyPopupVisible:e.size>0,handlePopupVisibilityChange:n}},ac=(e,t,n)=>{let a=yn(n);Ho(()=>{a.current=n},[n]),Wo(()=>{if(e!==null)return a.current(e,t),()=>{a.current(e,!1)}},[e,t])},Fo=Vl(({entry:e,index:t,itemCount:n,listboxId:a,isSelected:i,isActive:o,onSelect:r,onLongPressSelect:u,searchQuery:d,enableHighlighting:c,openEmailsWithGmail:f,openGmailCompose:p,onPopupVisibilityChange:l})=>{let g=Q(),b=yn(null),v=K("div",{className:_o}),T=Zl(e)?e:null,N=Ht(e),{isPopupVisible:U,handleClosePopup:z}=Sr({ref:b,onSelect:u,item:N?.person_id});if(ac(N?.person_id??null,U,l),!e||!N)return v;let{person_id:y}=N,h=t%2===0?M.surface:M.subtle,C=`${Y.blue} ring-1 ${E.selectedRing}`,k=i?C:h,H=["B","F"].map(S=>ec(S,S==="B"?T?.baseScore:T?.score)).filter(Boolean);return Je("div",{ref:b,id:zl(a,y),className:`flex ${_o} w-full items-center overflow-hidden ${I.borderSubtle} border-b px-4 py-2 text-left transition-colors ${E.hoverBlueTint} ${k} ${Va}`,style:{height:ua},role:"option","aria-selected":i,"aria-posinset":t+1,"aria-setsize":n,"data-selected":i?"true":"false","data-contact-map-row-active":o?"":void 0,onClick:()=>r(y),children:[Je("div",{className:"hidden w-28 shrink-0 flex-col items-center gap-0.5 text-center sm:flex",children:[K("div",{className:`whitespace-nowrap font-medium ${s.fgSecondary} text-xs leading-tight`,children:g.listRowNumber(t+1)}),K("div",{className:`truncate ${wt} ${s.fgSecondary} leading-tight`,children:y}),K("div",{className:`flex items-center gap-1 whitespace-nowrap font-mono ${wt} ${s.fgMuted} leading-tight`,children:H.length?H.map(S=>K("span",{children:S},S)):K("span",{children:"-"})})]}),K(Kl,{fallback:K(Ql,{contactData:N}),children:K(jl,{contactData:N,searchTerm:d,enableHighlighting:c,openEmailsWithGmail:f,openGmailCompose:p,isPopupVisible:U,onRequestClose:z})})]})});Fo.displayName="ContactListRow";var Io=({context:e})=>{let{contactMapRecords:t,filteredItems:n,searchQuery:a,hasSearchTerm:i,enableHighlighting:o,openEmailsWithGmail:r,isSearchTabActive:u}=e,{locale:d,labels:c,engineLabels:f}=Pe(),p=yn(null),l=yn(null),[g,b]=Hn(null),{normalizedViewportHeight:v,panelSizingStyle:T}=pa(u,l,p),{isAnyPopupVisible:N,handlePopupVisibilityChange:U}=rc(),z=Gt(()=>({enablePointerDrag:!N,enableKeyboardNavigation:!1}),[N]),y=Gt(()=>i?n:t,[i,n,t]),[h,C]=Hn(null),k=Ie(X=>{b(X),C(X)},[]),H=Ie(X=>{if(!r)return;let ye=X.trim();if(!ye||ye==="-"||typeof window>"u")return;let J=gt(ye,!0);J&&window.open(J,"_blank","noopener,noreferrer")},[r]),[S,L]=Hn(!1),oe=Ie(()=>L(!1),[]),F=Ie(X=>{k(X),L(!0)},[k]),be=Po(),ie=Po(),W=yn(null),O=y.length,q=Ie((X,ye)=>K(Fo,{entry:X,index:ye,itemCount:O,listboxId:be,isSelected:$o(X,g),isActive:$o(X,h),onSelect:F,onLongPressSelect:k,searchQuery:a,enableHighlighting:o,openEmailsWithGmail:r,openGmailCompose:H,onPopupVisibilityChange:U}),[O,be,g,h,F,k,a,o,r,H,U]),pe=Gt(()=>{let X=new Map;return y.forEach((ye,J)=>{let mt=Ht(ye);mt!==null&&X.set(mt.person_id,J)}),X},[y]),Se=h===null?null:pe.get(h)??null,$e=g===null?null:pe.get(g)??null,$t=Math.max(1,Math.floor(v/ua)),Qt=Ie(X=>{if(X.target.id!==be)return;let ye=wo(X.nativeEvent,{activeIndex:Se,startIndex:$e===null?0:$e,itemCount:O,pageSize:$t});if(ye===null)return;if(X.preventDefault(),ye.kind==="activate"){Se!==null&&h!==null&&F(h);return}let J=Do(y,ye.index,ye.direction);J!==null&&(C(J.personId),W.current?.scrollToIndex(J.index,{align:"nearest"}))},[be,Se,$e,O,$t,h,F,y]),vt=Ie(X=>{if(X.target.id!==be||Se!==null||!X.target.matches(":focus-visible"))return;let ye=Do(y,$e===null?0:$e,1);ye!==null&&C(ye.personId)},[be,Se,$e,y]),Jt=Gt(()=>({id:be,role:"listbox",tabIndex:0,"aria-label":c.listboxLabel,"aria-describedby":ie}),[be,c.listboxLabel,ie]),Ce=Ie(X=>y[X],[y]),Zt=Ie(X=>Ht(y[X])?.person_id??`row-${X}`,[y]),Ve=Ie(()=>ua,[]),ut=Gt(()=>({enabled:!0,renderVisual:Il}),[]),Ke=Gt(()=>g===null?null:tc(y,g),[g,y]);Wo(()=>{g!==null&&!Ke&&b(null)},[g,Ke]);let He=yn(null),{isTwoColumn:en}=Cr(He,ma);S&&(en||Ke===null)&&L(!1);let xt=Je("div",{ref:p,className:"flex min-h-0 flex-1 flex-col gap-1",children:[K("div",{className:`hidden rounded-t-lg border ${I.borderSubtle} ${M.subtle} px-4 py-2 transition-colors sm:block`,children:Je("div",{className:"flex items-center",children:[Je("div",{className:`flex w-28 shrink-0 flex-col items-center gap-0.5 text-center ${w} ${s.fgSecondary} uppercase tracking-wider`,children:[K("span",{className:`font-semibold ${s.fg} text-xs`,children:c.columnNo}),K("span",{className:"leading-tight",children:c.columnId}),K("span",{className:"whitespace-nowrap leading-tight",children:c.columnScore})]}),Je("div",{className:`hidden w-full grid-cols-3 gap-2 font-medium ${s.fgSecondary} text-xs uppercase tracking-wider transition-colors sm:grid xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[Je("div",{className:"flex flex-col gap-0.5",children:[K("span",{children:c.columnName}),K("span",{className:`font-normal ${w} ${s.fgMuted} uppercase tracking-wider`,children:c.columnTitle})]}),Je("div",{className:"flex flex-col gap-0.5",children:[K("span",{children:c.columnCompany}),K("span",{className:`font-normal ${w} ${s.fgMuted} uppercase tracking-wider`,children:c.columnDepartment})]}),Je("div",{className:"flex flex-col gap-0.5",children:[K("span",{children:c.columnPhone}),K("span",{className:`font-normal ${w} ${s.fgMuted} uppercase tracking-wider`,children:c.columnEmail})]}),K("div",{className:"hidden items-end justify-end xl:flex",children:K("span",{className:`font-normal ${w} ${s.fgMuted} uppercase tracking-wider`,children:c.columnUpdatedAt})})]})]})}),K("p",{id:ie,hidden:!0,children:c.listKeyboardHelp}),K("div",{ref:l,className:"flex-1",onKeyDown:Qt,onFocus:vt,children:K(Bl,{ref:W,contentProps:Jt,activeItemIndex:O===0?void 0:Se,activeItemVisibleInset:Ka,itemCount:O,getItemKey:Zt,behaviorOptions:z,getItem:Ce,getItemHeight:Ve,viewportSize:v,overscanCount:10,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:ut},locale:d,labels:f,className:`w-full rounded-b-lg border ${I.borderSubtle} border-t-0 ${M.surface} pr-0.75 transition-colors`,children:(X,ye)=>q(X,ye)})}),n.length===0&&i?K("div",{className:"py-8 text-center",children:K("p",{className:s.fgMuted,children:c.listNoSearchResults})}):null,O===0&&!i?K("div",{className:"py-8 text-center",children:K("p",{className:s.fgMuted,children:c.listNoData})}):null]});return K("div",{ref:He,"data-testid":"contact-map-list-root",className:"flex min-h-0 flex-1 flex-col",style:T,children:en?Je(Hl,{id:"contact-map-list-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-list-panel-group",children:[K(Ro,{id:"contact-map-list-pane",defaultSize:{value:68,unit:"percentage"},minSize:{value:ql,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:xt}),K(Fl,{id:"contact-map-list-handle",thickness:Yl,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:`cursor-col-resize rounded transition-colors ${E.hoverMuted} focus:outline-none focus-visible:ring-2 ${E.focusVisibleRing} ${E.ringOffsetSurface} focus-visible:ring-offset-1`,"aria-label":c.listResizeHandle}),K(Ro,{id:"contact-map-list-detail-pane",defaultSize:{value:32,unit:"percentage"},minSize:{value:Xl,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:K(fn,{placement:"pane",contact:Ke,searchTerm:a,enableHighlighting:o})})]}):Je(oc,{children:[xt,Ke?K(xr,{isOpen:S,onClose:oe,title:c.detailHeading,children:K(fn,{placement:"overlay",contact:Ke,searchTerm:a,enableHighlighting:o})}):null]})})};Ft();import{DirectoryTree as hc}from"@aiquants/directory-tree";import{Panel as Go,PanelGroup as yc,PanelResizeHandle as bc}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as Sc}from"@aiquants/virtualscroll";import Cc from"@heroicons/react/24/solid/FolderMinusIcon.js";import vc from"@heroicons/react/24/solid/FolderPlusIcon.js";import{useCallback as Be,useEffect as bn,useMemo as Ze,useRef as Er,useState as Xt}from"react";import{createPortal as xc}from"react-dom";var fa=(e,t)=>e&&e.trim()||t;import{useEffect as ic,useRef as Tr,useState as sc}from"react";var Bo=(e,t=250)=>{let[n,a]=sc(e),i=Tr(null),o=Tr(e),r=Tr(null),u=Tr(!1);return ic(()=>{if(!u.current){u.current=!0,a(e),o.current=e;return}o.current=n,i.current=null;let d=c=>{i.current??(i.current=c);let f=c-i.current,p=Math.min(1,Math.max(0,f/t)),l=1-(1-p)**3,g=Math.max(0,Math.round(o.current+(e-o.current)*l));a(g),p<1&&(r.current=requestAnimationFrame(d))};return r.current=requestAnimationFrame(d),()=>{r.current!==null&&cancelAnimationFrame(r.current)}},[e,t]),Math.max(0,n)};Lt();import{useCallback as ga,useEffect as ha,useMemo as zo,useRef as lc,useSyncExternalStore as cc}from"react";ge();var dc=250,uc=4e3,Nr=3,Uo={treeWorkerFactory:"the view remounts","workerUrls.treeWorker":"the page reloads"},Vo=(e,t)=>e.uncategorizedCompany===t.uncategorizedCompany&&e.unnamedPerson===t.unnamedPerson,Mr=class{constructor(t,{workerSource:n,logger:a=lt}){this.worker=null;this.generation=0;this.postedCount=0;this.latestSnapshot=null;this.workerNeedsReset=!1;this.lastSyncedRecords=[];this.postedNaming=null;this.lastSyncedNaming=null;this.consecutiveFailures=0;this.finalizeRequest=null;this.finalizedPostedCount=null;this.retryTimer=null;this.listeners=new Set;this.state={snapshot:null,isBuilding:!1};this.getState=()=>this.state;this.subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));this.handleMessage=t=>{let n=t.data;n.type!=="TREE_CHUNK"||n.generation!==this.generation||n.uniquePersonCount===0&&this.postedCount>0&&(this.latestSnapshot?.uniquePersonCount??0)>0||this.latestSnapshot!==null&&n.uniquePersonCount<this.latestSnapshot.uniquePersonCount&&!(n.isIdle&&n.consumedRecords>=this.postedCount)||(n.isIdle&&n.consumedRecords>=this.postedCount&&(this.consecutiveFailures=0),this.latestSnapshot={tree:n.tree,directoryPaths:n.directoryPaths,consumedRecords:n.consumedRecords,uniquePersonCount:n.uniquePersonCount,isIdle:n.isIdle,rebuildEpoch:n.rebuildEpoch},this.updateState())};this.handleFailure=t=>{if(this.worker?.terminate(),this.worker=null,this.postedCount=0,this.consecutiveFailures+=1,this.updateState(),this.consecutiveFailures>=Nr){this.logger.error(`[TreeWorker] the tree Worker failed ${Nr} times in a row; the tree stops updating until ${Uo[this.workerSource]} (check ${this.workerSource})`,t);return}let n=Math.min(dc*2**(this.consecutiveFailures-1),uc);this.logger.warn(`[TreeWorker] the tree Worker failed; retrying in ${n}ms (failure ${this.consecutiveFailures} of ${Nr})`,t),this.retryTimer!==null&&clearTimeout(this.retryTimer),this.retryTimer=setTimeout(()=>{this.retryTimer=null;let a=this.lastSyncedNaming;a!==null&&this.syncRecords(this.lastSyncedRecords,a)},n)};if(typeof n!="string")throw new TypeError(`[contact-map] TreeWorkerSession workerSource must be a string; got ${ee(n)}`);if(!Object.hasOwn(Uo,n))throw new RangeError(`[contact-map] TreeWorkerSession workerSource must be "treeWorkerFactory" or "workerUrls.treeWorker"; got ${ee(n)}`);this.workerFactory=t,this.workerSource=n,this.logger=a}updateState(){let t=this.postedCount>(this.latestSnapshot?.consumedRecords??0);this.state.snapshot===this.latestSnapshot&&this.state.isBuilding===t||(this.state={snapshot:this.latestSnapshot,isBuilding:t},this.notify())}notify(){for(let t of this.listeners)t()}ensureWorker(){if(this.consecutiveFailures>=Nr||this.retryTimer!==null)return null;if(!this.worker)try{this.worker=this.workerFactory(),this.workerNeedsReset=!0,this.worker.onerror=this.handleFailure,this.worker.onmessageerror=this.handleFailure,this.worker.onmessage=this.handleMessage}catch(t){return this.handleFailure(t),null}return this.worker}syncRecords(t,n){this.finalizeRequest!==null&&(t.length<this.finalizeRequest.recordCount||this.finalizeRequest.naming===null||!Vo(this.finalizeRequest.naming,n))&&(this.finalizeRequest=null),this.lastSyncedRecords=t,this.lastSyncedNaming=n;let a=this.ensureWorker();if(!a)return;let i=this.workerNeedsReset,o=this.postedNaming===null||!Vo(this.postedNaming,n);if((this.workerNeedsReset||o||t.length<this.postedCount)&&(this.generation+=1,this.postedCount=0,this.finalizedPostedCount=null,this.workerNeedsReset=!1,this.postedNaming=n,a.postMessage({type:"RESET_TREE",generation:this.generation,epochBase:this.latestSnapshot?.rebuildEpoch??0,naming:n}),this.updateState()),t.length>this.postedCount){let r=t.slice(this.postedCount);this.postedCount=t.length,a.postMessage({type:"APPEND_RECORDS",generation:this.generation,records:r}),this.updateState()}i&&this.finalizeRequest!==null&&this.finalize()}finalize(){this.finalizeRequest={recordCount:this.lastSyncedRecords.length,naming:this.lastSyncedNaming},!(this.worker===null||this.finalizedPostedCount===this.postedCount)&&(this.finalizedPostedCount=this.postedCount,this.worker.postMessage({type:"FINALIZE_TREE",generation:this.generation}))}cancelWorker(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.worker?.terminate(),this.worker=null,this.postedCount=0,this.postedNaming=null,this.finalizedPostedCount=null}stop(){this.cancelWorker(),this.consecutiveFailures=0,this.updateState()}reset(){this.cancelWorker(),this.listeners.clear(),this.latestSnapshot=null,this.lastSyncedRecords=[],this.lastSyncedNaming=null,this.consecutiveFailures=0,this.finalizeRequest=null,this.state={snapshot:null,isBuilding:!1}}},mc=e=>{if(e!==void 0)return new Worker(e,{type:"module"});let t=typeof import.meta<"u"?import.meta.url:void 0;if(t){let a=t.includes(".ts")?"../workers/treeWorker.ts":"./worker/treeWorker.mjs";return new Worker(new URL(a,t),{type:"module"})}throw new Error("[contact-map] the tree Worker needs workerUrls.treeWorker in a build without import.meta.url (CommonJS)")},qt=null,Ko=e=>e===void 0?"the bundled Worker file (workerUrls.treeWorker unset)":JSON.stringify(e),pc=e=>{if(e===void 0)throw new Error("[contact-map] treeWorkerFactory was removed from the config while its tree session was still in use");return e},fc=e=>{if(po(e),qt===null){let t=new Mr(()=>mc(e),{workerSource:"workerUrls.treeWorker"});return qt={session:t,workerUrl:e},t}if(qt.workerUrl!==e)throw new Error(`[contact-map] the tree session already loads its Worker from ${Ko(qt.workerUrl)} and cannot also load it from ${Ko(e)}; give every contact-map view in the browser tab the same workerUrls.treeWorker, on every route (after changing it, reload the page)`);return qt.session},Jp=()=>{qt?.session.reset(),qt=null},gc={snapshot:null,isBuilding:!1};function jo(e,t=!1){let n=bt(),a=n.treeWorkerFactory,i=n.workerUrls?.treeWorker,{labels:o}=Pe(),r=o.uncategorizedCompany,u=o.noName,d=zo(()=>({uncategorizedCompany:r,unnamedPerson:u}),[r,u]),c=lc(a);ha(()=>{c.current=a},[a]);let f=a!==void 0,p=f?void 0:i,l=zo(()=>f?new Mr(()=>pc(c.current)(),{workerSource:"treeWorkerFactory"}):null,[f]),g=ga(()=>l===null?fc(p):l,[l,p]),b=ga(T=>g().subscribe(T),[g]),v=ga(()=>g().getState(),[g]);return ha(()=>{let T=g();T.syncRecords(e,d),t&&T.finalize()},[g,e,t,d]),ha(()=>{if(l!==null)return()=>l.stop()},[l]),cc(b,v,()=>gc)}ge();de();Ee();Xr();or();import{Fragment as Ac,jsx as j,jsxs as Ae}from"react/jsx-runtime";var Sa=yr(Wn),Tc=Wn.listPanelMinWidth,Nc=Wn.detailPanelMinWidth,Mc=Wn.handleThickness,Nf=Sa.collapseThreshold,Mf=Sa.expandThreshold,Ec=(e,t)=>{let{searchQuery:n,enableHighlighting:a}=t,i=fa(e.full_name,t.noName),o=fa(e.title,""),r=j(Ne,{text:i,query:n,enabled:a});return o?Ae("span",{className:"flex items-center gap-1.5",children:[j("span",{children:r}),j("span",{className:`${s.fgMuted} text-xs`,children:j(Ne,{text:o,query:n,enabled:a})})]}):r},Lc="contact-map-tree h-full w-full",kc={hoverClassName:M.muted,directorySelectedClassName:`${Y.sky} ${E.treeNameSky}`,itemSelectedClassName:`${Y.sky} ${E.treeNameSky}`},ya="h-4 w-4 shrink-0 transition-colors duration-150",wc=(e,t,n)=>({...e,viewportHeightOverride:t,behaviorOptions:{...e.behaviorOptions,enablePointerDrag:!n}}),Lr=null,qo=null,Fn=new Map,Xo="",Yo=null,Qo=null,Rc=(e,t,n,a,i)=>{let o=`${n?"icons":"plain"}#${a}#${i.noName}`;(o!==Xo||i.formatDirectoryName!==Yo||t!==Qo)&&(Fn.clear(),Xo=o,Yo=i.formatDirectoryName,Qo=t);let r={entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},u=new Set;for(let d of e){u.add(d.absolutePath);let c=`${d.name}\0${d.memberCount}`,f=Fn.get(d.absolutePath);(!f||f.signature!==c)&&(f={signature:c,result:ei([d],t,n,{searchQuery:"",enableHighlighting:!1,noName:i.noName,formatDirectoryName:i.formatDirectoryName})},Fn.set(d.absolutePath,f));let p=f.result;p.entries.length>0&&r.entries.push(p.entries[0]);for(let[l,g]of p.personPathMap){let b=r.personPathMap.get(l);if(b)for(let v of g)b.add(v);else r.personPathMap.set(l,new Set(g))}for(let[l,g]of p.contactByPath)r.contactByPath.set(l,g);for(let[l,g]of p.ancestorsByPath)r.ancestorsByPath.set(l,g);r.totalCount+=p.totalCount,!r.firstPerson&&p.firstPerson&&(r.firstPerson=p.firstPerson)}for(let d of Fn.keys())u.has(d)||Fn.delete(d);return r},ba=e=>e.isSelected||e.isItemSelected?m.sky:e.isExpanded&&e.isDirectory?s.fgSecondary:s.fgMuted,Zo=e=>{let t=[];for(let n of e)n.type==="directory"&&(t.push(n.absolutePath),n.children&&t.push(...Zo(n.children)));return t},Pc=e=>{if(e.memberCount===void 0)throw new Error(`[contact-map] directory entry ${e.absolutePath} has no memberCount`);return e.memberCount},ei=(e,t,n,a,i)=>{let o=new Map,r=new Map,u=new Map,d=0,c=null,f=(l,g)=>{let b=[...g,l.absolutePath];u.set(l.absolutePath,b);let v,T,N=l.type==="directory"?a.formatDirectoryName(l.name,Pc(l)):l.name,U=j(Ne,{text:N,query:a.searchQuery,enabled:a.enableHighlighting});if(l.type==="file"&&l.personId){if(i&&!i.has(l.personId))return null;let z=t.get(l.personId);if(z){r.set(l.absolutePath,z),o.has(l.personId)||o.set(l.personId,new Set);let y=o.get(l.personId);y&&y.add(l.absolutePath),d++,c||(c={personId:l.personId,path:l.absolutePath}),n&&(T=h=>{let C=ba(h);return h.isSelected||h.isItemSelected||l.isPrimary&&(C=l.title?m.indigo:m.orange),j(n.person,{"aria-hidden":"true",className:`${ya} ${C}`})},l.title&&(U=Ec(z,a))),U=j("span",{"data-contact-path":l.absolutePath,className:"block w-full",children:U})}}else if(l.children){let z=l.children.map(y=>f(y,b)).filter(y=>y!==null);if(i&&z.length===0)return null;if(v=z,n){let y=l.relativePath.startsWith("company:")?n.company:n.department;T=h=>j(y,{"aria-hidden":"true",className:`${ya} ${ba(h)}`})}}return{name:N,label:U,type:l.type,absolutePath:l.absolutePath,relativePath:l.relativePath,icon:T,children:v}};return{entries:e.map(l=>f(l,[])).filter(l=>l!==null),personPathMap:o,contactByPath:r,ancestorsByPath:u,firstPerson:c,totalCount:d}},_c=(e,t,n)=>{let a=new Set,i=new Set,o=new Map;t.forEach((f,p)=>{o.set(f.item.person_id,p)});for(let f of t){let p=f.item.person_id,l=e.personPathMap.get(p);if(l)for(let g of l){a.add(g);let b=e.ancestorsByPath.get(g);if(b){for(let v of b)a.add(v);n&&b.length>0&&i.add(b[0])}}}let r=new Map,u=f=>{let p=r.get(f.absolutePath);if(p!==void 0)return p;let l=1/0;if(f.type==="file"){let g=e.contactByPath.get(f.absolutePath);g&&(l=o.get(g.person_id)??1/0)}else if(f.children)for(let g of f.children)l=Math.min(l,u(g));return r.set(f.absolutePath,l),l},d=(f,p=0)=>f.filter(l=>n&&p===0&&i.has(l.absolutePath)?!0:a.has(l.absolutePath)).map(l=>n&&p===0&&i.has(l.absolutePath)?l:l.type==="directory"&&l.children?{...l,children:d(l.children,p+1)}:l).sort((l,g)=>p===0?u(l)-u(g):0),c=d(e.entries);return{...e,entries:c}},Jo=(e,t,n)=>{if(e===null)return null;let a=n.get(e);if(a===void 0)return null;if(t!==null&&a.has(t))return t;let i=a.values().next();return i.done?null:i.value},ti=({context:e,controlsContainer:t})=>{let{contactMapRecords:n,contactMapRecordMap:a,filteredItems:i,hasSearchTerm:o,isSearchInProgress:r,isSearchTabActive:u}=e,{locale:d,labels:c,treeLabels:f}=Pe(),p=c.noName,l=c.treeDirectoryName,g=Ze(()=>({noName:p,formatDirectoryName:l}),[p,l]),[b,v]=Xt(null),[T,N]=Xt(!1),{snapshot:U,isBuilding:z}=jo(n,e.isStreamingComplete),y=U?.tree??null,h=U?.rebuildEpoch??0,C=Ze(()=>y?Rc(y,a,b,h,g):null,[y,a,b,h,g]),k=Ze(()=>{if(!y)return null;if(!o)return C;let D;T||(D=new Set(i.map(fe=>fe.item.person_id)));let le=ei(y,a,b,{...g,searchQuery:e.searchQuery,enableHighlighting:e.enableHighlighting},D);return _c(le,i,T)},[y,C,a,b,e.searchQuery,e.enableHighlighting,o,i,T,g]),H=Ze(()=>k||{entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},[k]),S=o&&e.errorMessage!==null,[L,oe]=Xt(H),F=Er(!1);bn(()=>{if(!(r||S)){F.current=!!y,oe(H);return}!F.current&&y&&H.entries.length>0&&(F.current=!0,oe(H))},[H,y,r,S]);let be=o&&(r||S)?L:H,{entries:ie,personPathMap:W,contactByPath:O,totalCount:q}=be,pe=Ze(()=>Zo(ie),[ie]),[Se,$e]=Xt(()=>qo??new Set),$t=Be(D=>!Se.has(D),[Se]),Qt=Be(D=>{$e(le=>{let fe=new Set(le);return fe.has(D)?fe.delete(D):fe.add(D),fe})},[]),vt=Be(D=>{D.length!==0&&$e(le=>{let fe=new Set(le);for(let ft of D)fe.add(ft);return fe})},[]),Jt=Be(D=>{$e(le=>{if(le.size===0)return le;let fe=!1,ft=new Set(le);for(let V of D)ft.delete(V)&&(fe=!0);return fe?ft:le})},[]);bn(()=>{qo=Se},[Se]),bn(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem("contact-map.tree-expanded")}catch{}},[]);let[Ce,Zt]=Xt(null),[Ve,ut]=Xt(null),[Ke,He]=Xt(!1),en=Be(()=>He(!1),[]),xt=Er(null),X=Er(null),{normalizedViewportHeight:ye,panelSizingStyle:J}=pa(u,X,xt),mt=Be(D=>{let le=O.get(D);return le?(Ce!==le.person_id&&Zt(le.person_id),D!==Ve&&ut(D),!0):!1},[O,Ve,Ce]),Ot=Be(D=>{mt(D)&&He(!0)},[mt]),Nn=Be(D=>{Ot(D.entry.absolutePath)},[Ot]),Tt=Be(D=>D instanceof Element?D.closest("[data-contact-path]")?.getAttribute("data-contact-path")??null:null,[]),{isPopupVisible:Oe,popupItem:Mn,handleClosePopup:En}=Sr({ref:X,resolveItem:Tt,onSelect:mt}),tt=Be(D=>{if(!e.openEmailsWithGmail)return;let le=D.trim();if(!le||le==="-"||typeof window>"u")return;let fe=gt(le,!0);fe&&window.open(fe,"_blank","noopener,noreferrer")},[e.openEmailsWithGmail]),Nt=Mn?O.get(Mn):null,nt=Oe&&Nt!==null&&Nt!==void 0;bn(()=>{Oe&&!Nt&&En()},[Oe,Nt,En]);let Dt=Ze(()=>({overscanCount:16,callbackThrottleMs:16,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:{enabled:!0,renderVisual:Sc}},behaviorOptions:{resetOnGetItemHeightChange:!1},preserveScrollAnchor:!0}),[]),Mt=Ze(()=>wc(Dt,ye,nt),[Dt,ye,nt]);bn(()=>{let D=!1;return typeof window>"u"?()=>{D=!0}:Lr?(v(Lr),()=>{D=!0}):((async()=>{try{let[fe,ft,V,Z]=await Promise.all([import("lucide-react/dist/esm/icons/building-2.js"),import("lucide-react/dist/esm/icons/users-round.js"),import("lucide-react/dist/esm/icons/id-card.js"),import("lucide-react/dist/esm/icons/user-round.js")]);if(D)return;let xe=fe.default,rt=ft.default,Ar=V.default,Pa=Z.default;xe&&rt&&Ar&&Pa&&(Lr={company:xe,department:rt,title:Ar,person:Pa},v(Lr))}catch(fe){lt.warn("Failed to load lucide icons",fe)}})(),()=>{D=!0})},[]);let Wt=Ze(()=>{if(!b)return;let D=Z=>xe=>j(Z,{"aria-hidden":"true",className:`${ya} ${ba(xe)}`}),le={company:D(b.company),department:D(b.department),title:D(b.title)},fe=D(b.person),ft=Z=>Z in le,V=Z=>{let[xe]=Z.entry.relativePath.split(":",1);return(ft(xe)?le[xe]:le.company)(Z)};return{directory:V,directoryExpanded:V,file:fe}},[b]),tn=Be(()=>{$e(D=>D.size===0?D:new Set)},[]),Rr=Be(()=>{pe.length>0&&vt(pe)},[pe,vt]),Et=Jo(Ce,Ve,W);bn(()=>{let D=Jo(Ce,Ve,W);if(D===null){Ce!==null&&Zt(null),Ve!==null&&ut(null);return}D!==Ve&&ut(D)},[Ce,Ve,W]);let je=Et===null?null:O.get(Et)??null,Ln=e.isStreamingComplete,Pr=e.isStreamingFailed,Bn=Ln&&n.length===0,zn=(z||!y)&&!Bn,Un=Bo(q,250),pt=y!==null||Bn,nn=Ae("div",{className:"flex flex-wrap items-center gap-1.5",children:[Ae("span",{className:`inline-flex h-5 items-center gap-1 rounded ${M.muted} px-1.5 font-medium font-mono ${w} ${s.fgSecondary}`,title:c.treeNodeCountTitle,children:[j("span",{children:"\u{1F333}"})," ",c.treeNodeCountLabel," ",pt?c.treeNodeCount(Un):"\u2026"]}),Pr&&!Ln?Ae("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${A.rose} ${Y.rose} px-1.5 font-medium ${w} ${m.rose}`,title:c.treeStreamInterruptedTitle,children:[j("span",{className:`h-1.5 w-1.5 rounded-full ${qe.rose}`}),j("span",{children:"\u26D4"})," ",c.treeStreamInterrupted]}):Ln?zn?Ae("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${A.amber} ${Y.amber} px-1.5 font-medium ${w} ${m.amber}`,title:c.treeBuildingTitle,children:[Ae("span",{className:"relative flex h-1.5 w-1.5",children:[j("span",{className:`absolute inline-flex h-full w-full animate-ping rounded-full ${qe.amber}`}),j("span",{className:`relative inline-flex h-1.5 w-1.5 rounded-full ${qe.amber}`})]}),j("span",{children:"\u{1F33F}"})," ",c.treeBuilding]}):Ae("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${A.emerald} ${Y.emerald} px-1.5 font-medium ${w} ${m.emerald}`,title:c.treeCompleteTitle,children:[j("span",{className:`h-1.5 w-1.5 rounded-full ${qe.emerald}`}),j("span",{children:"\u2705"})," ",c.treeComplete]}):Ae("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${A.sky} ${Y.sky} px-1.5 font-medium ${w} ${m.sky}`,title:c.treeStreamLoadingTitle,children:[Ae("span",{className:"relative flex h-1.5 w-1.5",children:[j("span",{className:`absolute inline-flex h-full w-full animate-ping rounded-full ${qe.sky}`}),j("span",{className:`relative inline-flex h-1.5 w-1.5 rounded-full ${qe.sky}`})]}),j("span",{children:"\u23F3"})," ",c.treeStreamLoading]}),o&&Ae("button",{type:"button",onClick:()=>N(!T),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${T?`${Y.blue} ${m.blue}`:`${s.fgMuted} ${E.hoverMuted}`}`,title:c.treeShowEntireCompanyTitle,children:[j("span",{children:"\u{1F3E2}"})," ",c.treeShowEntireCompany]}),pe.length>0?Ae("div",{className:"flex items-center gap-1",children:[j("button",{type:"button",onClick:tn,className:`inline-flex h-11 w-11 items-center justify-center rounded border ${I.borderControl} ${M.surface} ${s.fgMuted} transition-colors ${E.hoverMuted} ${E.hoverFgSecondary}`,"aria-label":c.treeExpandAll,title:c.treeExpandAllTitle,children:j(vc,{className:"h-4 w-4"})}),j("button",{type:"button",onClick:Rr,className:`inline-flex h-11 w-11 items-center justify-center rounded border ${I.borderControl} ${M.surface} ${s.fgMuted} transition-colors ${E.hoverMuted} ${E.hoverFgSecondary}`,"aria-label":c.treeCollapseAll,title:c.treeCollapseAllTitle,children:j(Cc,{className:"h-4 w-4"})})]}):null]}),Vn=Er(null),{isTwoColumn:kn}=Cr(Vn,Sa,{mediaQuery:"(min-width: 768px)"});Ke&&(kn||je===null)&&He(!1);let Kn=Ze(()=>({toggle:Qt,isExpanded:$t,expandMultiple:Jt,collapseMultiple:vt,isPending:r}),[vt,Jt,$t,Qt,r]),jn=Ze(()=>({onEntryClick:Nn,selectedPath:Et}),[Nn,Et]),_r=Ze(()=>({className:Lc,lineColor:za,iconOverrides:Wt,showDirectoryIcons:!!Wt,showFileIcons:!!Wt,highlightStyles:kc,entryClassName:"rounded-md",nameClassName:"tracking-tight",directoryNameClassName:`font-normal ${s.fg}`,fileNameClassName:s.fgSecondary}),[Wt]),wn=j("div",{ref:xt,className:`flex min-h-0 flex-1 flex-col rounded-xl border ${I.borderSubtle} ${M.surface} shadow-sm transition-colors`,children:j("div",{ref:X,className:"flex min-h-0 flex-1 flex-col overflow-hidden p-2",children:ie.length>0?j(hc,{entries:ie,expansion:Kn,selection:jn,visual:_r,virtualScroll:Mt,locale:d,labels:f}):j("div",{className:`flex h-full w-full items-center justify-center rounded-lg border ${I.borderSubtle} border-dashed ${M.surface} px-6 text-center ${s.fgMuted} text-sm transition-colors`,children:o?c.treeNoMatches:c.treeEmpty})})});return Ae("div",{ref:Vn,"data-testid":"contact-map-tree-root",className:"flex min-h-0 flex-1 flex-col",style:J,children:[t&&xc(nn,t),kn?Ae(yc,{id:"contact-map-tree-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-tree-panel-group",children:[j(Go,{id:"contact-map-tree-pane",defaultSize:{value:60,unit:"percentage"},minSize:{value:Tc,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:wn}),j(bc,{id:"contact-map-tree-handle",thickness:Mc,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:`cursor-col-resize rounded transition-colors ${E.hoverMuted} focus:outline-none focus-visible:ring-2 ${E.focusVisibleRing} ${E.ringOffsetSurface} focus-visible:ring-offset-1`,"aria-label":c.treeResizeHandle}),j(Go,{id:"contact-map-tree-detail-pane",defaultSize:{value:40,unit:"percentage"},minSize:{value:Nc,unit:"pixels"},maxSize:{value:600,unit:"pixels"},contentOverflow:"hidden",className:"flex min-h-0 flex-col pl-1",children:j(fn,{placement:"pane",contact:je,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})})]}):Ae(Ac,{children:[wn,je?j(xr,{isOpen:Ke,onClose:en,title:c.detailHeading,children:j(fn,{placement:"overlay",contact:je,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})}):null]}),nt&&Nt&&j(tr,{contactData:Nt,openEmailsWithGmail:e.openEmailsWithGmail,openGmailCompose:tt,onRequestClose:En})]})};import{jsx as In,jsxs as Sn}from"react/jsx-runtime";var Wc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Hc=e=>e==="tree"?"tree":"list",ni=({context:e})=>{let t=Q(),[n,a]=Dc(),[i,o]=Oc(null),r=Hc(n.get(hn)),{setScrollableRef:u,onPointerDown:d,onPointerMove:c,onPointerUp:f,onPointerLeave:p,onPointerCancel:l,onClickCapture:g}=Pt(),b=$c(v=>{let T=v==="tree"?"tree":"list";if(T===r)return;let N=new URLSearchParams(typeof window<"u"?window.location.search:"");T==="list"?N.delete(hn):N.set(hn,T),a(N,{replace:!0})},[r,a]);return Sn("div",{"data-testid":"contact-map-search-tab-group",className:"flex h-full flex-1 flex-col",children:[Sn("div",{className:"mt-1 mb-1.5 flex shrink-0 flex-wrap items-center gap-2",children:[Sn("div",{ref:u,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-lg ${M.muted} p-0.5 transition-colors`,style:Wc,onPointerDown:d,onPointerMove:c,onPointerUp:f,onPointerLeave:p,onPointerCancel:l,onClickCapture:g,children:[Sn("button",{type:"button","data-testid":"contact-map-tab-list","aria-pressed":r==="list",onClick:()=>b("list"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 ${x} transition-colors ${r==="list"?`${Te.blue} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4C4} ",t.listViewTab]}),Sn("button",{type:"button","data-testid":"contact-map-tab-tree","aria-pressed":r==="tree",onClick:()=>b("tree"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-2 ${x} transition-colors ${r==="tree"?`${Te.green} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F333} ",t.treeViewTab]})]}),In("div",{ref:o,className:"flex flex-wrap items-center gap-1.5"})]}),Sn("div",{className:"flex h-full flex-1 flex-col",children:[In("div",{className:`${r==="list"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="list"?In(Io,{context:e}):null}),In("div",{className:`${r==="tree"?"flex h-full flex-1 flex-col":"hidden"}`,children:r==="tree"?In(ti,{context:e,controlsContainer:i}):null})]})]})};import{memo as Bc}from"react";ge();de();Ee();ge();de();Ee();import{DEFAULT_FUZZY_SEARCH_OPTIONS as G}from"@aiquants/fuzzy-search";import{memo as Fc,useId as We}from"react";import{jsx as $,jsxs as B}from"react/jsx-runtime";var Ca=1e3,va=Fc(({searchOptions:e,setSearchOptions:t})=>{let n=Q(),a=`flex flex-col gap-1 rounded-md border ${M.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=e.sortBy==="relevance",r=We(),u=We(),d=We(),c=We(),f=We(),p=We(),l=We(),g=We(),b=We(),v=We(),T=We(),N=[];N.push(B("div",{className:`${a} ${A.green} border-l-4`,children:[B("div",{className:`${i} ${m.green}`,children:["\u{1F3D7}\uFE0F ",n.indexBuildHeading]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:r,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexNgramSize}),$("input",{id:r,type:"range",min:"1",max:"4",step:"1",value:e.ngramSize||G.ngramSize,onChange:y=>t(h=>({...h,ngramSize:parseInt(y.target.value,10)})),className:"h-11 w-full"}),B("span",{className:`${m.green} text-xs`,children:[n.currentValueLabel," ",e.ngramSize||G.ngramSize]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexNgramSizeHint})]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:u,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexMinNgramOverlap}),$("input",{id:u,type:"range",min:"1",max:"5",step:"1",value:e.minNgramOverlap||G.minNgramOverlap,onChange:y=>t(h=>({...h,minNgramOverlap:parseInt(y.target.value,10)})),className:"h-11 w-full"}),B("span",{className:`${m.green} text-xs`,children:[n.currentValueLabel," ",e.minNgramOverlap||G.minNgramOverlap]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexMinNgramOverlapHint})]})]},"index-build")),N.push(B("div",{className:`${a} ${A.blue} border-l-4`,children:[B("div",{className:`${i} ${m.blue}`,children:["\u{1F50D} ",n.indexCandidateHeading]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:d,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexThreshold}),$("input",{id:d,type:"range",min:"0.0",max:"1.0",step:"0.05",value:e.indexWorkerOptions?.threshold??G.indexWorkerOptions?.threshold,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,threshold:parseFloat(y.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.blue} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.threshold??G.indexWorkerOptions?.threshold]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexThresholdHint})]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:f,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexNgramOverlapThreshold}),$("input",{id:f,type:"range",min:"0.1",max:"0.9",step:"0.1",value:e.indexWorkerOptions?.ngramOverlapThreshold??G.indexWorkerOptions?.ngramOverlapThreshold,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,ngramOverlapThreshold:parseFloat(y.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.blue} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.ngramOverlapThreshold??G.indexWorkerOptions?.ngramOverlapThreshold]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexNgramOverlapThresholdHint})]})]},"candidate-control")),N.push(B("div",{className:`${a} ${A.cyan} border-l-4`,children:[B("div",{className:`${i} ${m.cyan}`,children:["\u{1F9ED} ",n.indexStrategyHeading]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:c,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexStrategy}),B("select",{id:c,value:e.indexWorkerOptions?.strategy??G.indexWorkerOptions?.strategy??"hybrid",onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,strategy:y.target.value}})),className:`min-h-11 rounded border ${I.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${M.surface} ${s.fg}`,children:[$("option",{value:"fast",children:n.indexStrategyFast}),$("option",{value:"accurate",children:n.indexStrategyAccurate}),$("option",{value:"hybrid",children:n.indexStrategyHybrid})]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexStrategyHint})]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:p,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexMinCandidatesRatio}),$("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.minCandidatesRatio??G.indexWorkerOptions?.minCandidatesRatio,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,minCandidatesRatio:parseFloat(y.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.cyan} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.minCandidatesRatio??G.indexWorkerOptions?.minCandidatesRatio]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexMinCandidatesRatioHint})]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:l,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexMaxCandidatesRatio}),$("input",{id:l,type:"range",min:"0.3",max:"0.8",step:"0.1",value:e.indexWorkerOptions?.maxCandidatesRatio??G.indexWorkerOptions?.maxCandidatesRatio,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxCandidatesRatio:parseFloat(y.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.cyan} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxCandidatesRatio??G.indexWorkerOptions?.maxCandidatesRatio]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexMaxCandidatesRatioHint})]})]},"strategy")),N.push(B("div",{className:`${a} ${A.indigo} border-l-4`,children:[B("div",{className:`${i} ${m.indigo}`,children:["\u{1F521} ",n.scoreTuningHeading]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:g,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexJaroWinklerPrefix}),$("input",{id:g,type:"range",min:"0.05",max:"0.25",step:"0.05",value:e.indexWorkerOptions?.jaroWinklerPrefix??G.indexWorkerOptions?.jaroWinklerPrefix,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,jaroWinklerPrefix:parseFloat(y.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.jaroWinklerPrefix??G.indexWorkerOptions?.jaroWinklerPrefix]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexJaroWinklerPrefixHint})]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:b,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.maxResults}),B("label",{className:`flex min-h-11 items-center gap-2 ${x} ${s.fgMuted}`,children:[$("input",{type:"checkbox",checked:e.indexWorkerOptions?.maxResults===void 0,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxResults:y.target.checked?void 0:Ca}}))}),n.noLimit]}),$("input",{id:b,type:"range",min:Ca,max:"10000",step:"1000",disabled:e.indexWorkerOptions?.maxResults===void 0,value:e.indexWorkerOptions?.maxResults===void 0?Ca:e.indexWorkerOptions.maxResults,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,maxResults:parseInt(y.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),B("span",{className:`${m.indigo} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxResults===void 0?n.noLimit:e.indexWorkerOptions.maxResults]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexMaxResultsHint})]})]},"jaro")),N.push(B("div",{className:`${a} ${A.emerald} border-l-4`,children:[B("div",{className:`${i} ${m.emerald}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:v,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.fieldWeight}),$("input",{id:v,type:"range",min:"0",max:"1",step:"0.05",value:e.indexWorkerOptions?.relevanceFieldWeight??G.indexWorkerOptions?.relevanceFieldWeight??.2,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,relevanceFieldWeight:parseFloat(y.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),B("span",{className:`${m.emerald} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevanceFieldWeight??G.indexWorkerOptions?.relevanceFieldWeight??.2]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexFieldWeightHint})]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:T,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexPerfectMatchBonus}),$("input",{id:T,type:"range",min:"0",max:"0.3",step:"0.1",value:e.indexWorkerOptions?.relevancePerfectMatchBonus??G.indexWorkerOptions?.relevancePerfectMatchBonus??.1,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,relevancePerfectMatchBonus:parseFloat(y.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),B("span",{className:`${m.emerald} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevancePerfectMatchBonus??G.indexWorkerOptions?.relevancePerfectMatchBonus??.1]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexPerfectMatchBonusHint})]}),!o&&$("p",{className:`${w} ${m.emerald}`,children:n.relevanceOnlyNotice})]},"relevance"));let U=We(),z=We();return N.push(B("div",{className:`${a} ${A.teal} border-l-4`,children:[B("div",{className:`${i} ${m.teal}`,children:["\u{1F524} ",n.indexContainmentHeading]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:U,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexContainmentBase}),$("input",{id:U,type:"range",min:"0.0",max:"0.7",step:"0.05",value:e.indexWorkerOptions?.containmentScoreBase??G.indexWorkerOptions?.containmentScoreBase??.7,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,containmentScoreBase:parseFloat(y.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.teal} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentScoreBase??G.indexWorkerOptions?.containmentScoreBase??.7]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexContainmentBaseHint})]}),B("div",{className:"space-y-2",children:[$("label",{htmlFor:z,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexContainmentCoverage}),$("input",{id:z,type:"range",min:"0.0",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.containmentCoverageWeight??G.indexWorkerOptions?.containmentCoverageWeight??.3,onChange:y=>t(h=>({...h,indexWorkerOptions:{...h.indexWorkerOptions,containmentCoverageWeight:parseFloat(y.target.value)}})),className:"h-11 w-full"}),B("span",{className:`${m.teal} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentCoverageWeight??G.indexWorkerOptions?.containmentCoverageWeight??.3]}),$("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.indexContainmentCoverageHint})]})]},"containment")),B("section",{className:"space-y-3",children:[B("div",{className:"flex items-center justify-between gap-3",children:[B("div",{className:`flex items-center gap-2 font-semibold ${m.green} text-xs transition-colors`,children:[$("span",{children:"\u{1F4CA}"}),$("span",{className:"tracking-wide",children:n.indexSettingsHeading})]}),$("button",{type:"button",onClick:()=>t(y=>({...y,indexWorkerOptions:{threshold:G.indexWorkerOptions?.threshold||.4,ngramOverlapThreshold:G.indexWorkerOptions?.ngramOverlapThreshold||.3,minCandidatesRatio:G.indexWorkerOptions?.minCandidatesRatio||.1,maxCandidatesRatio:G.indexWorkerOptions?.maxCandidatesRatio||.5,jaroWinklerPrefix:G.indexWorkerOptions?.jaroWinklerPrefix||.1,maxResults:void 0,relevanceFieldWeight:G.indexWorkerOptions?.relevanceFieldWeight||.2,relevancePerfectMatchBonus:G.indexWorkerOptions?.relevancePerfectMatchBonus||.1,containmentScoreBase:G.indexWorkerOptions?.containmentScoreBase||.7,containmentCoverageWeight:G.indexWorkerOptions?.containmentCoverageWeight||.3,strategy:G.indexWorkerOptions?.strategy},ngramSize:G.ngramSize,minNgramOverlap:G.minNgramOverlap})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${A.green} ${Y.green} px-2 font-medium ${m.green} ${x} transition-colors ${E.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),$("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:N})]})});va.displayName="IndexWorkerSettings";ge();de();Ee();import{DEFAULT_FUZZY_SEARCH_OPTIONS as we}from"@aiquants/fuzzy-search";import{memo as Ic,useId as Cn}from"react";import{jsx as me,jsxs as he}from"react/jsx-runtime";var xa=1e3,Ta=Ic(({searchOptions:e,setSearchOptions:t})=>{let n=Q(),a=`flex flex-col gap-1 rounded-md border ${M.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=e.sortBy==="relevance",r=Cn(),u=Cn(),d=Cn(),c=Cn(),f=Cn(),p=Cn(),l=[];return l.push(he("div",{className:`${a} ${A.purple} border-l-4`,children:[he("div",{className:`${i} ${m.purple}`,children:["\u{1F9EE} ",n.levenshteinCandidateHeading]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:r,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.levenshteinThreshold}),me("input",{id:r,type:"range",min:"0.0",max:o?"1.5":"1.0",step:"0.05",value:e.levenshteinWorkerOptions?.threshold??we.levenshteinWorkerOptions?.threshold,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,threshold:parseFloat(g.target.value)}})),className:"h-11 w-full"}),he("span",{className:`${m.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.threshold??we.levenshteinWorkerOptions?.threshold]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:o?n.levenshteinThresholdHintRelevance:n.levenshteinThresholdHint})]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:u,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarity}),me("input",{id:u,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.lengthSimilarityThreshold??we.levenshteinWorkerOptions?.lengthSimilarityThreshold,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,lengthSimilarityThreshold:parseFloat(g.target.value)}})),className:"h-11 w-full"}),he("span",{className:`${m.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthSimilarityThreshold??we.levenshteinWorkerOptions?.lengthSimilarityThreshold]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarityHint})]})]},"threshold")),l.push(he("div",{className:`${a} ${A.pink} border-l-4`,children:[he("div",{className:`${i} ${m.pink}`,children:["\u{1FA84} ",n.scoreTuningHeading]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:d,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenalty}),me("input",{id:d,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.levenshteinWorkerOptions?.lengthDiffPenalty??we.levenshteinWorkerOptions?.lengthDiffPenalty,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,lengthDiffPenalty:parseFloat(g.target.value)}})),className:"h-11 w-full"}),he("span",{className:`${m.pink} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthDiffPenalty??we.levenshteinWorkerOptions?.lengthDiffPenalty]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenaltyHint})]})]},"penalty")),l.push(he("div",{className:`${a} ${A.violet} border-l-4`,children:[he("div",{className:`${i} ${m.violet}`,children:["\u{1F4E6} ",n.levenshteinResultsHeading]}),me("label",{htmlFor:c,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.maxResults}),he("label",{className:`flex min-h-11 items-center gap-2 ${x} ${s.fgMuted}`,children:[me("input",{type:"checkbox",checked:e.levenshteinWorkerOptions?.maxResults===void 0,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,maxResults:g.target.checked?void 0:xa}}))}),n.noLimit]}),me("input",{id:c,type:"range",min:xa,max:"10000",step:"1000",disabled:e.levenshteinWorkerOptions?.maxResults===void 0,value:e.levenshteinWorkerOptions?.maxResults===void 0?xa:e.levenshteinWorkerOptions.maxResults,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,maxResults:parseInt(g.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),he("span",{className:`${m.violet} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.maxResults===void 0?n.noLimit:e.levenshteinWorkerOptions.maxResults]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinMaxResultsHint})]},"max-results")),l.push(he("div",{className:`${a} ${A.rose} border-l-4`,children:[he("div",{className:`${i} ${m.rose}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:f,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.fieldWeight}),me("input",{id:f,type:"range",min:"0",max:"1",step:"0.05",value:e.levenshteinWorkerOptions?.relevanceFieldWeight??we.levenshteinWorkerOptions?.relevanceFieldWeight??.15,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,relevanceFieldWeight:parseFloat(g.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),he("span",{className:`${m.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.relevanceFieldWeight??we.levenshteinWorkerOptions?.relevanceFieldWeight??.15]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinFieldWeightHint})]}),he("div",{className:"space-y-2",children:[me("label",{htmlFor:p,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonus}),me("input",{id:p,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.partialMatchBonus??we.levenshteinWorkerOptions?.partialMatchBonus,onChange:g=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,partialMatchBonus:parseFloat(g.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),he("span",{className:`${m.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.partialMatchBonus??we.levenshteinWorkerOptions?.partialMatchBonus]}),me("p",{className:`${w} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonusHint})]}),!o&&me("p",{className:`${w} ${m.rose}`,children:n.relevanceOnlyNotice})]},"relevance")),he("section",{className:"space-y-3",children:[he("div",{className:"flex items-center justify-between gap-3",children:[he("div",{className:`flex items-center gap-2 font-semibold ${m.purple} text-xs transition-colors`,children:[me("span",{children:"\u{1F4CF}"}),me("span",{className:"tracking-wide",children:n.levenshteinSettingsHeading})]}),me("button",{type:"button",onClick:()=>t(g=>({...g,levenshteinWorkerOptions:{threshold:we.levenshteinWorkerOptions?.threshold||.3,lengthSimilarityThreshold:we.levenshteinWorkerOptions?.lengthSimilarityThreshold||.1,partialMatchBonus:we.levenshteinWorkerOptions?.partialMatchBonus||.1,lengthDiffPenalty:we.levenshteinWorkerOptions?.lengthDiffPenalty||1,maxResults:void 0,relevanceFieldWeight:we.levenshteinWorkerOptions?.relevanceFieldWeight||.15}})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${A.purple} ${Y.purple} px-2 font-medium ${m.purple} ${x} transition-colors ${E.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),me("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:l})]})});Ta.displayName="LevenshteinWorkerSettings";import{jsx as dt,jsxs as ct}from"react/jsx-runtime";var zc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Na=Bc(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:i,setOpenEmailsWithGmail:o,activeTab:r,onTabChange:u})=>{let d=Q(),{setScrollableRef:c,onPointerDown:f,onPointerMove:p,onPointerUp:l,onPointerLeave:g,onPointerCancel:b,onClickCapture:v}=Pt();return ct("div",{className:`wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border ${A.blue} ${M.surface} p-1.5 shadow-md transition-colors`,children:[ct("div",{className:`mb-0.5 flex shrink-0 flex-col gap-1 rounded ${Y.blue} px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between`,children:[ct("h3",{className:`font-semibold ${s.fgSecondary} text-xs transition-colors`,children:["\u2699\uFE0F ",d.searchSettings]}),dt("div",{className:"flex flex-wrap gap-1.5",children:ct("button",{type:"button",onClick:()=>t(T=>hr(T.workerUrls)),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded ${Te.red} px-1.5 ${x} ${s.onPrimary} transition-colors ${zt.red}`,title:d.settingsResetAllTitle,children:["\u{1F504} ",d.settingsResetAll]})})]}),dt("div",{className:"mb-0 shrink-0",children:ct("div",{ref:c,role:"tablist","aria-label":d.settingsTabsLabel,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-md ${M.muted} p-0.5 transition-colors`,style:zc,onPointerDown:f,onPointerMove:p,onPointerUp:l,onPointerLeave:g,onPointerCancel:b,onClickCapture:v,children:[ct("button",{type:"button",role:"tab","aria-selected":r==="basic",onClick:()=>u("basic"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${r==="basic"?`${Te.blue} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F527} ",d.settingsBasicTab]}),ct("button",{type:"button",role:"tab","aria-selected":r==="advanced",onClick:()=>u("advanced"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${r==="advanced"?`${Te.orange} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u26A1 ",d.settingsAdvancedTab]}),ct("button",{type:"button",role:"tab","aria-selected":r==="index",onClick:()=>u("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${r==="index"?`${Te.green} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CA} ",d.indexWorkerName]}),ct("button",{type:"button",role:"tab","aria-selected":r==="levenshtein",onClick:()=>u("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${r==="levenshtein"?`${Te.purple} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CF} ",d.levenshteinWorkerName]})]})}),ct("div",{className:"flex flex-col gap-1",children:[dt("div",{className:`${r==="basic"?"block":"hidden"}`,children:dt(Kr,{searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:i,setOpenEmailsWithGmail:o})}),dt("div",{className:`${r==="advanced"?"block":"hidden"}`,children:dt(Vr,{searchOptions:e,setSearchOptions:t})}),dt("div",{className:`${r==="index"?"block":"hidden"}`,children:dt(va,{searchOptions:e,setSearchOptions:t})}),dt("div",{className:`${r==="levenshtein"?"block":"hidden"}`,children:dt(Ta,{searchOptions:e,setSearchOptions:t})})]})]})});Na.displayName="SearchOptionsPanel";import{memo as Kc,useCallback as jc}from"react";Bt();ge();de();Ee();de();import{memo as Uc}from"react";import{jsxs as Ma}from"react/jsx-runtime";var _=Uc(({label:e,value:t,unit:n,color:a=s.fgMuted})=>Ma("div",{className:`wrap-break-word flex min-w-0 flex-col overflow-hidden ${s.fgSecondary} transition-colors sm:flex-row sm:justify-between`,children:[Ma("span",{className:"wrap-break-word overflow-hidden text-left",children:[e,":"]}),Ma("span",{className:`font-medium ${a} min-w-0 overflow-hidden break-all transition-colors sm:ml-2`,children:[t,n]})]}));_.displayName="StatItem";Bt();ge();de();Ee();import{memo as Vc}from"react";import{jsx as P,jsxs as te}from"react/jsx-runtime";var vn=Vc(({kind:e,icon:t,stats:n,color:a})=>{let{locale:i,labels:o}=Pe(),r=W=>ne(i,W);if(!n)return P("section",{className:`rounded-lg border ${I.borderSubtle} border-dashed ${M.surface} p-3 ${s.fgMuted} text-xs transition-colors`,children:o.statsNoData});let u=n.basic||{},d=n.workerSpecific||{},c=n.analysis||{},f=u.totalSearches??0,p=u.totalProcessingTime??0,l=u.averageSearchTime??0,g=u.lastSearchTime??0,b=u.errorCount??0,v=u.timestamp,T=c.fieldPerformance||{},N=c.performanceInsights||{},U=c.recentHistory||[],z=d.specificMetrics||{},y=d.operationCount??0,h=d.operationDistribution||{},C=e==="index",k=e==="levenshtein",H=C?o.indexWorkerName:o.levenshteinWorkerName,S=z,L=z,oe=`flex flex-col gap-1 rounded-lg border ${M.surface} p-3 shadow-sm transition-colors`,F="text-xs font-semibold transition-colors",be=W=>{if(!W)return;let O=new Date(W);return Number.isNaN(O.getTime())?void 0:o.statsTimestamp(O)},ie=[];if(ie.push(te("div",{className:`${oe} ${A.blue} border-l-4`,children:[te("div",{className:`${F} ${a}`,children:["\u{1F4CA} ",o.statsBasicHeading]}),P(_,{label:o.statTotalSearches,value:r(f),color:a}),P(_,{label:o.statAverageSearchTime,value:l.toFixed(2),unit:"ms",color:a}),P(_,{label:o.statTotalProcessingTime,value:p.toFixed(2),unit:"ms",color:a}),P(_,{label:o.statLastSearchTime,value:g.toFixed(2),unit:"ms",color:a}),P(_,{label:o.statErrorCount,value:b,color:b>0?m.red:a}),be(v)&&P(_,{label:o.statUpdatedAt,value:be(v),color:s.fgMuted})]},"basic")),y>0||Object.keys(h).length>0){let W=Object.entries(h).sort(([,O],[,q])=>(Number(q)||0)-(Number(O)||0)).slice(0,6);ie.push(te("div",{className:`${oe} ${A.amber} border-l-4`,children:[te("div",{className:`${F} ${m.amber}`,children:["\u{1F527} ",o.statsOperationsHeading]}),P(_,{label:o.statTotalOperations,value:r(y),color:m.amber}),W.length>0&&P("div",{className:"mt-1 space-y-1",children:W.map(([O,q])=>P(_,{label:O,value:r(Number(q)),unit:o.timesUnit(r(Number(q))),color:m.amber},O))})]},"operations"))}if(C&&(ie.push(te("div",{className:`${oe} ${A.green} border-l-4`,children:[te("div",{className:`${F} ${m.green}`,children:["\u{1F3D7}\uFE0F ",o.statsIndexHeading]}),P(_,{label:o.statIndexBuilds,value:r(S.totalIndexBuilds??0),color:m.green}),P(_,{label:o.statDataSize,value:r(S.currentDataSize??0),unit:o.itemsUnit(r(S.currentDataSize??0)),color:m.green}),P(_,{label:o.statLastBuildTime,value:(S.lastIndexTime??0).toFixed(2),unit:"ms",color:m.green})]},"index-core")),S.cacheSize&&ie.push(te("div",{className:`${oe} ${A.emerald} border-l-4`,children:[te("div",{className:`${F} ${m.emerald}`,children:["\u{1F4BE} ",o.statsCacheHeading]}),P(_,{label:o.statCacheNgram,value:r(S.cacheSize.ngram??0),color:m.emerald}),P(_,{label:o.statCacheWord,value:r(S.cacheSize.word??0),color:m.emerald}),P(_,{label:o.statCachePhonetic,value:r(S.cacheSize.phonetic??0),color:m.emerald})]},"index-cache")),S.indexMetadata)){let W=Object.entries(S.indexMetadata).slice(0,6);W.length>0&&ie.push(te("div",{className:`${oe} ${A.teal} border-l-4`,children:[te("div",{className:`${F} ${m.teal}`,children:["\u{1F4CB} ",o.statsIndexMetadataHeading]}),W.map(([O,q])=>{let pe;if(typeof q=="number"){let Se=O.toLowerCase();Se.includes("time")&&!Se.includes("timestamp")?pe=`${q.toFixed(2)}ms`:Se.includes("timestamp")||Se.includes("at")?pe=be(q)??q.toString():pe=r(q)}else pe=String(q);return P(_,{label:O,value:pe,color:m.teal},O)})]},"index-meta"))}if(k){if(ie.push(te("div",{className:`${oe} ${A.purple} border-l-4`,children:[te("div",{className:`${F} ${m.purple}`,children:["\u{1F522} ",o.statsCalculationsHeading]}),P(_,{label:o.statTotalCalculations,value:r(L.totalCalculations??0),color:m.purple}),P(_,{label:o.statDistanceCalculations,value:r(L.totalDistanceCalculations??0),color:m.purple}),P(_,{label:o.statAverageDistance,value:typeof L.averageDistance=="number"?L.averageDistance.toFixed(2):"0.00",color:m.purple}),P(_,{label:o.statMinDistance,value:L.minDistance??o.notAvailable,color:m.purple}),P(_,{label:o.statMaxDistance,value:L.maxDistance??0,color:m.purple})]},"lev-basic")),ie.push(te("div",{className:`${oe} ${A.fuchsia} border-l-4`,children:[te("div",{className:`${F} ${m.fuchsia}`,children:["\u{1F3AF} ",o.statsMatchesHeading]}),P(_,{label:o.statPartialMatches,value:r(L.partialMatches??0),color:m.fuchsia}),P(_,{label:o.statPerfectMatches,value:r(L.perfectMatches??0),color:m.fuchsia}),P(_,{label:o.statEarlyTerminations,value:r(L.earlyTerminations??0),color:m.fuchsia})]},"lev-match")),L.similarityThresholds&&ie.push(te("div",{className:`${oe} ${A.rose} border-l-4`,children:[te("div",{className:`${F} ${m.rose}`,children:["\u{1F4C8} ",o.statsSimilarityHeading]}),P(_,{label:o.statAbove80,value:r(L.similarityThresholds.above80??0),color:m.emerald}),P(_,{label:o.statAbove60,value:r(L.similarityThresholds.above60??0),color:m.lime}),P(_,{label:o.statAbove40,value:r(L.similarityThresholds.above40??0),color:m.orange}),P(_,{label:o.statBelow40,value:r(L.similarityThresholds.below40??0),color:m.red})]},"lev-similarity")),L.distanceDistribution){let W=Object.entries(L.distanceDistribution).sort(([,O],[,q])=>Number(q)-Number(O)).slice(0,6);W.length>0&&ie.push(te("div",{className:`${oe} ${A.indigo} border-l-4`,children:[te("div",{className:`${F} ${m.indigo}`,children:["\u{1F4CA} ",o.statsDistanceHeading]}),W.map(([O,q])=>P(_,{label:o.statDistance(O),value:r(Number(q)),unit:o.timesUnit(r(Number(q))),color:m.indigo},O))]},"lev-distance"))}if(L.queryLengthStats){let W=Object.entries(L.queryLengthStats).sort(([,O],[,q])=>(q.count??0)-(O.count??0)).slice(0,6);W.length>0&&ie.push(te("div",{className:`${oe} ${A.violet} border-l-4`,children:[te("div",{className:`${F} ${m.violet}`,children:["\u{1F4CF} ",o.statsQueryLengthHeading]}),W.map(([O,q])=>{let pe=Number(q.count??0),Se=Number(q.averageScore??0);return P(_,{label:o.statQueryLength(O),value:o.statQueryLengthValue({count:pe,averagePercent:(Se*100).toFixed(1)}),color:m.violet},O)})]},"lev-query-length"))}}if(Object.keys(T).length>0){let W=Object.entries(T).sort(([,O],[,q])=>(q.averageScore??0)-(O.averageScore??0)).slice(0,6);ie.push(te("div",{className:`${oe} ${A.purple} border-l-4`,children:[te("div",{className:`${F} ${m.purple}`,children:["\u{1F4CB} ",o.statsFieldPerformanceHeading]}),W.map(([O,q])=>{let pe=q;return te("div",{className:`space-y-1 rounded ${Y.purple} p-2 transition-colors`,children:[P("div",{className:`font-semibold ${m.purple} text-xs transition-colors`,children:O}),P(_,{label:o.statAverageScore,value:`${((pe.averageScore??0)*100).toFixed(1)}%`,color:m.purple}),P(_,{label:o.statMatchCount,value:r(pe.matchCount??0),unit:o.itemsUnit(r(pe.matchCount??0)),color:m.purple}),P(_,{label:o.statBestWorstScore,value:`${((pe.bestScore??0)*100).toFixed(1)}% / ${((pe.worstScore??0)*100).toFixed(1)}%`,color:m.purple})]},O)})]},"field-performance"))}if(N.bestPerformingField||N.totalHistoryEntries||N.similarityDistribution){let W=(N.recentAverageResultCount??0).toFixed(1);ie.push(te("div",{className:`${oe} ${A.blue} border-l-4`,children:[te("div",{className:`${F} ${m.blue}`,children:["\u{1F50D} ",o.statsInsightsHeading]}),N.bestPerformingField&&P(_,{label:o.statBestField,value:N.bestPerformingField,color:m.blue}),P(_,{label:o.statRecentAverageTime,value:(N.recentAverageProcessingTime??0).toFixed(2),unit:"ms",color:m.blue}),P(_,{label:o.statRecentAverageResults,value:W,unit:o.itemsUnit(W),color:m.blue}),P(_,{label:o.statThroughput,value:(N.throughputPerSecond??0).toFixed(2),unit:o.throughputUnit,color:m.blue}),P(_,{label:o.statCommonQueryLength,value:r(N.mostCommonQueryLength??0),unit:o.charactersUnit(r(N.mostCommonQueryLength??0)),color:m.blue}),P(_,{label:o.statHistoryEntries,value:r(N.totalHistoryEntries??0),color:m.blue}),N.similarityDistribution&&te("div",{className:"mt-1 grid grid-cols-2 gap-1",children:[P(_,{label:o.statHighSimilarity,value:r(N.similarityDistribution.highSimilarity??0),color:m.emerald}),P(_,{label:o.statMediumSimilarity,value:r(N.similarityDistribution.mediumSimilarity??0),color:m.lime}),P(_,{label:o.statLowSimilarity,value:r(N.similarityDistribution.lowSimilarity??0),color:m.orange}),P(_,{label:o.statVeryLowSimilarity,value:r(N.similarityDistribution.veryLowSimilarity??0),color:m.red})]})]},"performance-insights"))}return U.length>0&&ie.push(te("div",{className:`${oe} ${A.sky} border-l-4`,children:[te("div",{className:`${F} ${m.sky}`,children:["\u{1F4C8} ",o.statsRecentHistoryHeading]}),U.slice(-3).reverse().map((W,O)=>te("div",{className:`rounded ${Y.sky} p-2 transition-colors`,children:[P("div",{className:`font-medium ${m.sky} transition-colors`,children:W.operationType}),P("div",{className:`${m.sky} text-xs transition-colors`,children:o.statsHistoryEntry({processingTimeMs:W.processingTime.toFixed(2),resultCount:W.resultCount??0})}),be(W.timestamp)&&P("div",{className:`${w} ${m.sky} transition-colors`,children:be(W.timestamp)})]},`${W.operationType}-${W.timestamp??O}`))]},"recent-history")),te("section",{className:"space-y-2",children:[te("div",{className:`flex items-center gap-2 font-semibold text-xs ${a}`,children:[P("span",{children:t}),P("span",{className:"tracking-wide",children:H})]}),P("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:ie})]})});vn.displayName="WorkerStatsSection";import{jsx as Ue,jsxs as ze}from"react/jsx-runtime";var Gc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Ea=Kc(({performanceMetrics:e,searchTerm:t,totalDataCount:n,resultsCount:a,resetStats:i,rebuildIndex:o,isIndexBuilding:r,activeTab:u,onTabChange:d})=>{let{locale:c,labels:f}=Pe(),p=t.trim(),l=p?a:n,{setScrollableRef:g,onPointerDown:b,onPointerMove:v,onPointerUp:T,onPointerLeave:N,onPointerCancel:U,onClickCapture:z}=Pt(),y=u!=="index"||r,h=r?f.statsRebuildingTitle:u!=="index"?f.statsRebuildIndexTabOnlyTitle:f.statsRebuildTitle,C=y?`cursor-not-allowed ${M.muted} ${s.fgMuted}`:`${Te.blue} ${s.onPrimary} ${zt.blue}`,k=r?`\u23F3 ${f.statsRebuilding}`:`\u{1F3D7}\uFE0F ${f.statsRebuild}`,H=jc(()=>{o().catch(()=>{})},[o]);return ze("div",{className:`wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border ${A.blue} ${M.surface} p-1.5 shadow-md transition-colors`,children:[ze("div",{className:`mb-0.5 flex shrink-0 flex-col gap-1 rounded ${Y.blue} px-1.5 py-0.5 transition-colors sm:flex-row sm:items-center sm:justify-between`,children:[ze("h3",{className:`font-semibold ${s.fgSecondary} text-xs transition-colors`,children:["\u{1F4CA} ",f.searchStatistics]}),ze("div",{className:"flex flex-wrap gap-1.5",children:[Ue("button",{type:"button",onClick:H,disabled:y,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${C}`,title:h,children:k}),ze("button",{type:"button",onClick:i,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded ${Te.red} px-1.5 ${x} ${s.onPrimary} transition-colors ${zt.red}`,title:f.statsResetTitle,children:["\u{1F504} ",f.reset]})]})]}),Ue("div",{className:"mb-0 shrink-0",children:ze("div",{ref:g,role:"tablist","aria-label":f.statsTabsLabel,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-md ${M.muted} p-0.5 transition-colors`,style:Gc,onPointerDown:b,onPointerMove:v,onPointerUp:T,onPointerLeave:N,onPointerCancel:U,onClickCapture:z,children:[ze("button",{type:"button",role:"tab","aria-selected":u==="overview",onClick:()=>d("overview"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${u==="overview"?`${Te.blue} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CB} ",f.statsOverviewTab]}),ze("button",{type:"button",role:"tab","aria-selected":u==="index",onClick:()=>d("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${u==="index"?`${Te.green} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CA} ",f.statsIndexTab]}),ze("button",{type:"button",role:"tab","aria-selected":u==="levenshtein",onClick:()=>d("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${u==="levenshtein"?`${Te.purple} ${s.onPrimary}`:`${s.fgMuted} ${E.hoverSurface}`}`,children:["\u{1F4CF} ",f.statsLevenshteinTab]})]})}),ze("div",{className:"flex flex-col gap-1 pb-0.5",children:[ze("div",{className:`${u==="overview"?"grid":"hidden"} grid-cols-1 gap-2 pr-1 ${s.fgMuted} text-xs transition-colors sm:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4`,children:[Ue(_,{label:f.statTotalSearches,value:ne(c,e.totalSearches)}),Ue(_,{label:f.statAverageSearchTime,value:e.averageSearchTime.toFixed(1),unit:"ms"}),Ue(_,{label:f.statDataCount,value:ne(c,e.itemCount)}),Ue(_,{label:p?f.statResultCount:f.statDisplayedCount,value:ne(c,l)})]}),Ue("div",{className:`${u==="index"?"space-y-3":"hidden"} pr-1 ${s.fgMuted} text-xs transition-colors`,children:Ue(vn,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:m.green})}),Ue("div",{className:`${u==="levenshtein"?"space-y-3":"hidden"} pr-1 ${s.fgMuted} text-xs transition-colors`,children:Ue(vn,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:m.purple})}),ze("div",{className:"hidden",children:[Ue(vn,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:m.green}),Ue(vn,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:m.purple})]})]})]})});Ea.displayName="StatisticsPanel";import{Fragment as si,jsx as ce,jsxs as Re}from"react/jsx-runtime";var td=/[\u200B\uFEFF]/g,La=typeof window<"u",ci=La&&typeof document<"u",kr=(e,t=[],n=!1)=>{let a=li(e);a.current=e,Ct(()=>{if(!(!La||n&&!ci))return a.current()},[n,...t])},ri=(e,t,n)=>{let[a,i]=et(()=>{let o=ai(r=>r.getItem(e));return o&&t.includes(o)?o:n});return kr(()=>{ai(o=>{o.setItem(e,a)})},[e,a]),[a,i]},ai=e=>{if(!La)return null;try{return e(window.sessionStorage)}catch{return null}},oi=(e,t)=>{let[n,a]=et(e);return Ct(()=>{let i=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(i)}},[e,t]),n},nd="contact-map.settings-tab",rd="contact-map.statistics-tab",ad=["basic","advanced","index","levenshtein"],od=["overview","index","levenshtein"],ii=["full_name","company_name","department","title","email","company_phone_number","mobile_phone_number"],id={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},di=({streamState:e,...t}={})=>e===void 0?ce(sd,{...t}):ce(ui,{...t,streamState:e}),sd=e=>{let{context:t}=gr();return ce(ui,{...e,streamState:t})},ld={setting:"ContactMapSearchPage workerUrls",keys:["indexWorker","levenshteinWorker"],hints:{treeWorker:"set treeWorker on ContactMapConfigProvider or ContactMapAppView"}},ui=e=>{let{streamState:t,onFooterVisibilityChange:n,children:a}=e,i=Le(e,"workerUrls"),o=bt(),{locale:r,labels:u}=Pe(),{contactMapRecords:d,contactMapRecordMap:c,isStreamingComplete:f,isStreamingFailed:p}=t,l=Zc(),[g]=ed(),b=li(null),[v,T]=et(!0),[N,U]=et(o.openEmailsWithGmail??!1),{indexWorker:z,levenshteinWorker:y}=gn(o.workerUrls,i,ld),[h,C]=et(()=>hr({indexWorker:z,levenshteinWorker:y})),[k,H]=et(g.get("q")||""),S=oi(k,h.debounceMs??qc.debounceMs);Ct(()=>{let V=g.get("q")||"";H(Z=>Z!==V?V:Z)},[g]),Ct(()=>{if(typeof window>"u")return;let V=new URL(window.location.href);(V.searchParams.get("q")||"")!==S&&(S?V.searchParams.set("q",S):V.searchParams.delete("q"),window.history.replaceState(window.history.state,"",V.toString()))},[S]);let[L,oe]=Jc(),[F,be]=et("search"),[ie,W]=ri(nd,ad,"basic"),[O,q]=ri(rd,od,"overview"),{setScrollableRef:pe,onPointerDown:Se,onPointerMove:$e,onPointerUp:$t,onPointerLeave:Qt,onPointerCancel:vt,onClickCapture:Jt}=Pt(),Ce=xn(()=>{if(!ci||ca(window))return;let V=b.current;!V||document.activeElement===V||window.requestAnimationFrame(()=>{try{V.focus({preventScroll:!0})}catch{}})},[]),Zt=xn(V=>{let Z=V;be(Z),Z==="search"&&Ce()},[Ce]),Ve=_t(()=>({...h,debounceMs:0}),[h]),[ut,Ke]=et("union"),He=ut==="intersection",en=He?u.operatorAndTitle:u.operatorOrTitle,xt=xn(V=>Xc(V,ut),[ut]),X=_t(()=>({querySetsOf:xt}),[xt]),ye=oi(d,f?0:800),{searchTerm:J,setSearchTerm:mt,filteredItems:Ot,resultTerm:Nn,isSearching:Tt,isIndexBuilding:Oe,clearSearch:Mn,resetStats:En,performanceMetrics:tt,rebuildIndex:Nt,error:nt}=Yc(ye,ii,Ve,X),Dt=J.trim().length>0,[Mt,Wt]=et(""),[tn,Rr]=et(()=>J),Et=_t(()=>rr(k),[k]),je=_t(()=>rr(S),[S]);Ct(()=>{S===Mt&&je===J||oe(()=>{Wt(S),mt(je)})},[S,Mt,je,J,mt]);let Ln=xn(V=>{let xe=V.target.value.replace(td,"");H(xe)},[]),Pr=xn(()=>{H(""),Wt(""),Mn(),Ce()},[Mn,Ce]),Bn=xn(()=>{Ke(V=>V==="intersection"?"union":"intersection"),Ce()},[Ce]);kr(()=>{if(!(F==="search"&&l.state==="idle"&&!L))return;let Z=document.activeElement;if(!!!(Z?.matches('[role="tab"]')||Z?.closest('[role="tablist"]')?.getAttribute("role")==="tablist")&&Z&&Z!==document.body&&Z!==b.current)return;let rt=window.requestAnimationFrame(()=>{Ce()});return()=>{window.cancelAnimationFrame(rt)}},[F,l.state,L,Ce],!0),kr(()=>{if(F!=="search")return;let V=[[document,"visibilitychange",()=>{document.visibilityState==="visible"&&Ce()}],[window,"pageshow",()=>{Ce()}]];for(let[Z,xe,rt]of V)Z.addEventListener(xe,rt);return()=>{for(let[Z,xe,rt]of V)Z.removeEventListener(xe,rt)}},[F,Ce],!0),Ct(()=>(n&&n(F==="search"?"mobile-hidden":"visible"),()=>{n&&n("visible")}),[F,n]),kr(()=>{let V=document.body,Z=V.style.overflow;return F==="search"&&(V.style.overflow="hidden"),()=>{V.style.overflow=Z}},[F],!0),Ct(()=>{tt&<.info("\u{1F4CA} [STATE] \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6307\u6A19\u304C\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F:",{totalSearches:tt.totalSearches,averageSearchTime:tt.averageSearchTime,itemCount:tt.itemCount,resultsCount:tt.resultsCount,workersAvailable:!!tt.workerStats})},[tt]);let{isAwaitingDebounce:zn,isAwaitingSearchTermSync:Un,isSearchInProgress:pt}=_t(()=>{let V=Et!==je,Z=je!==J,xe=J.trim().length>0||Et.trim().length>0;return{isAwaitingDebounce:V,isAwaitingSearchTermSync:Z,isSearchInProgress:L||Tt||Nn!==J&&nt===null||xe&&Oe||V||Z||tn!==J}},[Et,je,J,Nn,nt,L,Tt,Oe,tn]),[nn,Vn]=et(J);Ct(()=>{nn!==J&&Vn(J)},[J,nn]),Ct(()=>{zn||Un||L||Tt||Oe||nn===J&&tn!==J&&Rr(J)},[J,tn,zn,Un,L,Tt,Oe,nn]);let kn=_t(()=>to(Mt,ii),[Mt]),Kn=_t(()=>kn(Ot),[kn,Ot]),jn=_t(()=>({contactMapRecords:d,contactMapRecordMap:c,filteredItems:Kn,searchQuery:Mt,searchTerm:J,isSearching:Tt,isIndexBuilding:Oe,isPending:L,hasSearchTerm:Dt,enableHighlighting:v,openEmailsWithGmail:N,isSearchInProgress:pt,isSearchTabActive:F==="search",errorMessage:nt??null,isStreamingComplete:f,isStreamingFailed:p}),[d,c,Kn,Mt,J,Tt,Oe,L,Dt,v,N,pt,F,nt,f,p]),_r=Dt?Ot.length:d.length,wn=ne(r,d.length),D=ne(r,Ot.length),fe=`${`scrollbar-hidden ${M.subtle} ${s.fg}`}${F==="search"?" h-full min-h-0":""}`;return ce("div",{"data-contact-map-search-page":"",className:fe,children:Re(lr,{value:F,onValueChange:Zt,className:`flex flex-col${F==="search"?" h-full min-h-0":""}`,children:[Re(On,{ref:pe,"data-contact-map-page-tabs":"",style:id,className:`scrollbar-none mt-0 mb-1 flex h-auto w-full touch-pan-x flex-nowrap overflow-x-auto overflow-y-hidden rounded-md ${M.subtle} transition-colors ${s.fgSecondary}`,onPointerDown:Se,onPointerMove:$e,onPointerUp:$t,onPointerLeave:Qt,onPointerCancel:vt,onClickCapture:Jt,children:[Re(Vt,{value:"search",className:`min-h-11 min-w-16 px-2 py-0 ${x} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u{1F50D} ",u.searchTab]}),Re(Vt,{value:"settings",className:`min-h-11 min-w-16 px-2 py-0 ${x} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u2699\uFE0F ",u.searchSettings]}),Re(Vt,{value:"statistics",className:`min-h-11 min-w-16 px-2 py-0 ${x} transition-colors sm:min-w-24 sm:px-2.5`,children:["\u{1F4CA} ",u.searchStatistics]})]}),ce(Kt,{value:"search",className:"mt-0 flex h-full min-h-0 flex-col overflow-hidden",children:Re("div",{className:"flex h-full flex-col",children:[ce("div",{className:`rounded-md border ${I.borderSubtle} ${M.surface} shadow-sm transition-colors`,children:Re("div",{className:"flex flex-col",children:[ce("div",{className:"relative",children:Re("div",{className:"flex items-center gap-1 p-1",children:[Re("button",{type:"button",onClick:Bn,"aria-pressed":He,title:en,className:`inline-flex min-h-11 min-w-11 items-center justify-center gap-0.5 rounded border px-1.5 font-semibold ${x} transition-colors sm:min-w-12 sm:px-2 ${He?`border-transparent ${Te.blue} ${s.onPrimary} ${zt.blue}`:`${Ba.amber} ${Y.amber} ${m.amber} ${E.hoverSurface}`}`,children:[ce("span",{children:He?u.operatorAnd:u.operatorOr}),ce("span",{className:`hidden ${w} sm:inline`,children:He?u.operatorAndHint:u.operatorOrHint})]}),ce("input",{ref:b,"data-contact-map-search-field":"",type:"text",value:k,onChange:Ln,placeholder:u.searchPlaceholder,className:`min-h-11 flex-1 rounded border ${I.borderControl} border-solid px-2 pointer-coarse:text-base ${x} shadow-sm transition-colors ${E.focusBorder} focus:ring-1 ${E.focusRing} ${M.surface} ${s.fg}`}),k&&ce("button",{type:"button",onClick:Pr,className:`flex min-h-11 min-w-11 items-center justify-center gap-1 rounded border ${I.borderControl} px-1.5 ${x} transition-colors ${E.hoverFg} sm:px-2 ${s.fgMuted}`,title:pt?u.searchBusyTitle:u.clearSearch,"aria-label":pt?void 0:u.clearSearch,disabled:pt,children:pt?Re(si,{children:[ce(Qc,{"aria-hidden":"true",className:"h-3 w-3 animate-spin sm:h-3.5 sm:w-3.5"}),ce("span",{className:"hidden sm:inline",children:u.searching})]}):"\u2715"})]})}),Re("p",{className:`px-1.5 py-0.5 ${w} ${s.fgSecondary} transition-colors`,children:[u.registeredCountLabel," ",ce("span",{className:`font-semibold ${x} ${s.fg}`,children:wn})," ",u.recordUnit(wn),Oe?Re("span",{className:`ml-1.5 inline-flex items-center rounded ${Y.blue} px-1.5 py-0.2 ${m.blue}`,children:["\u23F3 ",u.rebuildingIndex]}):null,nt?Re("span",{className:`ml-1.5 inline-flex items-center rounded ${Y.rose} px-1.5 py-0.2 ${m.rose}`,children:["\u26A0\uFE0F ",u.errorLabel,ce("span",{className:"ml-1 break-all font-semibold",children:nt})]}):null,Dt&&Re("span",{className:`ml-1.5 ${m.blue}`,children:["| ",u.resultCountLabel,pt?ce("span",{className:"ml-1 font-semibold",children:u.searching}):Re(si,{children:[ce("span",{className:`ml-1 font-semibold ${x} ${s.fg}`,children:D}),ce("span",{className:"ml-0.5",children:u.resultUnit(D)})]})]})]}),ce("div",{className:"h-2.5 px-2 pb-1.5",children:Oe?ce(To,{className:`h-1 ${kt.progressTrack}`,indicatorClassName:qe.blue}):null})]})}),a?a(jn):ce(ni,{context:jn})]})}),ce(Kt,{value:"settings",className:"mt-0",children:ce(Na,{searchOptions:h,setSearchOptions:C,enableHighlighting:v,setEnableHighlighting:T,openEmailsWithGmail:N,setOpenEmailsWithGmail:U,activeTab:ie,onTabChange:W})}),ce(Kt,{value:"statistics",className:"mt-0",children:ce(Ea,{performanceMetrics:tt,searchTerm:J,totalDataCount:d.length,resultsCount:_r,resetStats:En,rebuildIndex:Nt,isIndexBuilding:Oe,activeTab:O,onTabChange:q})})]})})};ge();import{memo as cd,useState as dd}from"react";import{jsx as mi,jsxs as md}from"react/jsx-runtime";var ud=(e,t,n)=>{switch(e){case"retrying":return{phase:e,status:n.annotationReconnecting(t),alert:""};case"failed":return{phase:e,status:"",alert:n.streamLoadFailed(t)};case"unauthenticated":case"forbidden":return{phase:e,status:"",alert:""};case"idle":case"streaming":case"complete":return{phase:e,status:"",alert:""}}},ka=cd(({phase:e,loadedCount:t})=>{let n=Q(),[a,i]=dd(()=>({phase:e,status:"",alert:""})),o=a.phase===e?a:ud(e,t,n);return o!==a&&i(o),md("span",{"data-testid":"contact-map-stream-announcer",className:"sr-only",children:[mi("span",{role:"status",children:o.status}),mi("span",{role:"alert",children:o.alert})]})});ka.displayName="ContactMapStreamAnnouncer";import{memo as pd,useId as fd,useLayoutEffect as wa,useRef as wr,useState as gd}from"react";ge();de();dn();Ee();import{jsx as Yt,jsxs as xd}from"react/jsx-runtime";var pi="shrink-0 pb-2",hd=`flex items-center gap-2 rounded-md border ${A.rose} ${Y.rose} px-[11px] py-[3px] ${m.rose} ${x}`,yd=`inline-flex min-h-11 min-w-11 shrink-0 items-center justify-center rounded border ${I.borderControl} ${M.surface} px-[11px] font-semibold ${m.rose} ${x} transition-colors ${E.hoverRoseTint} ${st}`,bd=e=>e==="failed"||dr(e),fi=(e,t)=>{wa(()=>{let n=e.current;return()=>{n?.contains(n.ownerDocument.activeElement)&&(t.current=Co(n))}},[e,t])},Sd=({loadedCount:e,errorMessage:t,onRetry:n,leftWithFocusRef:a})=>{let i=Q(),o=fd(),r=wr(null);return fi(r,a),Yt("div",{className:pi,children:xd("div",{ref:r,role:"group","aria-labelledby":o,"data-testid":"contact-map-stream-failure-notice","data-phase":"failed",className:hd,children:[Yt("span",{"aria-hidden":"true",children:"\u26D4"}),Yt("span",{id:o,className:"min-w-0 flex-1 font-medium",title:t??void 0,children:i.streamLoadFailed(e)}),Yt("button",{type:"button","data-testid":"contact-map-retry-button","aria-describedby":o,onClick:n,className:yd,children:i.streamRetry})]})})},Cd=(e,t)=>Object.freeze({kind:e,place:"read",deniedSentence:null,retry:t}),vd=({kind:e,onRetry:t,accessFailure:n,leftWithFocusRef:a})=>{let i=wr(null),o=wr(t);wa(()=>{o.current=t});let[r]=gd(()=>Cd(e,()=>o.current()));return fi(i,a),Yt("div",{ref:i,"data-testid":"contact-map-stream-access-failure","data-phase":e,className:pi,children:n(r)})},Ra=pd(({phase:e,accessFailureNumber:t,loadedCount:n,errorMessage:a,onRetry:i,accessFailure:o})=>{ur(o,"ContactMapStreamFailureNotice accessFailure"),lo(t,"ContactMapStreamFailureNotice accessFailureNumber");let r=wr(null);return wa(()=>{let u=r.current;u!==null&&(r.current=null,vo(u))}),bd(e)?e==="failed"?Yt(Sd,{loadedCount:n,errorMessage:a,onRetry:i,leftWithFocusRef:r}):Yt(vd,{kind:e,onRetry:i,accessFailure:o,leftWithFocusRef:r},t):null});Ra.displayName="ContactMapStreamFailureNotice";import{jsx as At,jsxs as hi}from"react/jsx-runtime";var Td=({accessFailure:e,renderHeader:t,title:n,onFooterVisibilityChange:a})=>{let i=Q(),o=n===void 0?i.appTitle:n,{context:r,retryNow:u}=gr(),d=At(oa,{recordCount:r.contactMapRecords.length,companyCount:r.companyCount,phase:r.streamPhase,loadedCount:r.loadedCount,totalCount:r.totalCount});return hi("div",{"data-testid":"contact-map-app-view",className:"flex h-full w-full flex-col",children:[At(ka,{phase:r.streamPhase,loadedCount:r.loadedCount}),t?t({title:o,annotation:d}):hi("div",{"data-testid":"contact-map-default-header",className:"mb-2 flex items-center justify-between",children:[At("h1",{className:"font-bold text-xl",children:o}),d]}),At(Ra,{phase:r.streamPhase,accessFailureNumber:r.streamAccessFailureNumber,loadedCount:r.loadedCount,errorMessage:r.errorMessage,onRetry:u,accessFailure:e}),At("div",{className:"min-h-0 flex-1",children:At(di,{streamState:r,onFooterVisibilityChange:a})})]})},kh=e=>{let t=Le(e,"accessFailure");ur(t,"ContactMapAppView accessFailure");let n=bt(),a=Le(e,"streamEndpoint"),i=Le(e,"workerUrls"),o=Le(e,"locale"),r=Le(e,"labels"),u=gi(()=>({...n,streamEndpoint:a===void 0?n.streamEndpoint:a,workerUrls:gn(n.workerUrls,i,{setting:"ContactMapAppView workerUrls"}),locale:o===void 0?n.locale:o,labels:r===void 0?n.labels:r}),[n,a,i,o,r]),d=o!==void 0,c=r!==void 0,f=gi(()=>({locale:d?"ContactMapAppView locale":"locale",labels:c?"ContactMapAppView labels":"labels"}),[d,c]);return At(sa,{config:u,chromeSurface:f,children:At(Td,{...e,accessFailure:t})})};Bt();ge();import{createShouldRevalidate as Nd}from"@aiquants/route-revalidation";var Ah=Nd({submissions:"url",query:{ignore:[hn,"q"]}});export{Vr as AdvancedSearchSettings,Kr as BasicSearchSettings,ht as CONTACT_MAP_LABEL_CATALOGS,Pn as CONTACT_MAP_LABEL_KEYS,no as ContactDetailGrid,fn as ContactDetailPanel,tr as ContactDetailPopup,nr as ContactDetailRowLayout,oa as ContactMapAnnotation,kh as ContactMapAppView,qs as ContactMapConfigProvider,Io as ContactMapSearchListView,di as ContactMapSearchPage,ni as ContactMapSearchTabGroup,ti as ContactMapSearchTreeView,ka as ContactMapStreamAnnouncer,mr as ContactMapStreamClient,Ra as ContactMapStreamFailureNotice,Ne as HighlightedText,va as IndexWorkerSettings,Fp as LIST_COLLAPSE_THRESHOLD,Xl as LIST_DETAIL_PANEL_MIN_WIDTH,Ip as LIST_EXPAND_THRESHOLD,ql as LIST_PANEL_MIN_WIDTH,Yl as LIST_RESIZE_HANDLE_THICKNESS,Ta as LevenshteinWorkerSettings,To as Progress,Na as SearchOptionsPanel,_ as StatItem,Ea as StatisticsPanel,xr as SwipeOverlay,Nf as TREE_COLLAPSE_THRESHOLD,Nc as TREE_DETAIL_PANEL_MIN_WIDTH,Mf as TREE_EXPAND_THRESHOLD,Tc as TREE_PANEL_MIN_WIDTH,Mc as TREE_RESIZE_HANDLE_THICKNESS,lr as Tabs,Kt as TabsContent,On as TabsList,Vt as TabsTrigger,Mr as TreeWorkerSession,vn as WorkerStatsSection,pr as assertContactMapStreamEndpoint,po as assertContactMapTreeWorkerUrl,wm as assertContactMapWorkerUrls,wc as composeTreeVirtualScrollOptions,Ah as contactMapShouldRevalidate,sl as countContactMapCompanies,Zs as deserializeStreamRecord,nl as getContactMapStreamClient,fc as getTreeWorkerSession,gn as layerContactMapWorkerUrls,jm as resetContactMapStreamClientForTesting,Jp as resetTreeWorkerSessionForTesting,Fr as resolveContactMapLabels,Bo as useAnimatedNumber,bt as useContactMapConfig,Q as useContactMapLabels,il as useContactMapStream,pa as useContactPanelSizing,No as useDynamicViewportHeight,Pt as useHorizontalDragScroll,Sr as useLongPressPopup,ac as useReportPopupVisibility,Cr as useResponsiveTwoColumnLayout,rc as useRowPopupRegistry,gr as useStreamedContactMapContext,jo as useTreeWorker};
|