@aiquants/contact-map 0.27.0 → 0.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.mjs CHANGED
@@ -1,2 +1,2 @@
1
- var hi=Object.defineProperty;var Ne=(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 qe,Ft,Aa,sn,ln,Pn,ht,We,Vn,Or,$r,rt,re,Ht=Ne(()=>{"use strict";qe=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},Ft=e=>!e||typeof e!="object"?null:"item"in e?e.item??null:"person_id"in e?e:null,Aa=(e,t)=>{if(!e)return{value:null,fieldKey:null};for(let n of t){let a=qe(e[n]);if(a)return{value:a,fieldKey:n}}return{value:null,fieldKey:null}},sn=e=>Aa(e,["custom_email","email"]),ln=e=>Aa(e,["custom_mobile_phone_number","mobile_phone_number","company_phone_number"]),Pn=e=>{let t=qe(e);if(!t)return null;let n=t.replace(/[^0-9+#*]/g,"");return n.length===0?null:`tel:${n}`},ht=(e,t)=>{let n=qe(e);return n?t?`https://mail.google.com/mail/?view=cm&fs=1&to=${encodeURIComponent(n)}`:`mailto:${encodeURIComponent(n)}`:null},We=(e,t)=>String(e).padStart(t,"0"),Vn=e=>`${We(e.getUTCFullYear(),4)}-${We(e.getUTCMonth()+1,2)}-${We(e.getUTCDate(),2)}`,Or=e=>`${Vn(e)} ${We(e.getUTCHours(),2)}:${We(e.getUTCMinutes(),2)}:${We(e.getUTCSeconds(),2)}`,$r=e=>`${We(e.getFullYear(),4)}-${We(e.getMonth()+1,2)}-${We(e.getDate(),2)} ${We(e.getHours(),2)}:${We(e.getMinutes(),2)}:${We(e.getSeconds(),2)}`,rt=(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"?qe(e)??"-":typeof e=="number"?Number.isFinite(e)?String(e):"-":String(e)});var Y,Oa,yt=Ne(()=>{"use strict";Y=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":Oa(e);case"function":return Oa(e);case"number":return Object.is(e,-0)?"-0":String(e);default:return String(e)}},Oa=e=>{try{return Object.prototype.toString.call(e)}catch{return"[object ?]"}}});var cn,Le,dn=Ne(()=>{"use strict";cn=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,Kn,Dr=Ne(()=>{"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]},Kn=(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 $a,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,Bt,jn,Wa,wn,bt,Ti,Da,Ia,Ni,Ir,Ei,Mi,Li,Fr,Hr,Br,zt=Ne(()=>{"use strict";Ht();yt();dn();Dr();xi=Object.freeze({en:"en-US",ja:"ja-JP"}),ne=(e,t)=>t.toLocaleString(xi[e]),Bt=(e,t,n)=>e==="1"?t:n,jn=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=>Bt(e,"record","records"),companyUnit:e=>Bt(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=>Bt(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:Or,recordDate:Vn,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:$r,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} ${Bt(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=>Bt(e," time"," times"),itemsUnit:e=>Bt(e," item"," items"),charactersUnit:e=>Bt(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:Or,recordDate:Vn,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:$r,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"})}),Wa=Object.freeze(Object.keys(jn.en)),wn=Object.freeze([...Wr,...Wa]),bt=Object.freeze({en:Object.freeze({...$a.en,...jn.en}),ja:Object.freeze({...$a.ja,...jn.ja})}),Ti=new Set(wn),Da=Object.keys(bt).map(e=>JSON.stringify(e)).join(" or "),Ia=Object.freeze({locale:"locale",labels:"labels"}),Ni=(e,t,n)=>{e[t]=n},Ir=(e,t=Ia.locale)=>{if(e!==void 0&&typeof e!="string")throw new TypeError(`[contact-map] ${t} must be ${Da} or left out; got ${Y(e)}`);if(e!==void 0&&!Object.hasOwn(bt,e))throw new RangeError(`[contact-map] ${t} must be ${Da} or left out; got ${Y(e)}`);return Ci(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 ${Y(n)}`);return}if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string; got ${Y(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${Y(n)}`)},Mi=(e,t,n)=>{let a=Object.create(null);for(let i of Object.getOwnPropertyNames(e)){if(!Ti.has(i)){let r=Kn(i,wn);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 ${Y(i)}`)}let o=e[i];o!==void 0&&(Ei(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=Ia)=>{let a=Ir(e,n.locale);if(t===void 0)return bt[a];if(!cn(t))throw new TypeError(`[contact-map] ${n.labels} must be a plain object or left out; got ${Y(t)}`);let i=Mi(t,bt[a],n.labels),r={...Si(a,Li(i)),...jn[a]};for(let d of Wa){let l=i[d];l!==void 0&&Ni(r,d,l)}return Object.freeze(r)},Hr=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 Ri}from"@aiquants/virtualscroll";import{createContext as Pi,useContext as Ha,useMemo as Fa,useRef as wi}from"react";import{jsx as Ai}from"react/jsx-runtime";var _i,Ur,zr,Ba,we,ee,ge=Ne(()=>{"use strict";zt();_i=Object.freeze({locale:"en",labels:bt.en,treeLabels:Hr(bt.en),engineLabels:Br(bt.en)}),Ur=Pi(_i),zr=(e,t)=>{let n=wi(null),a=n.current;return a!==null&&t.every(i=>a[i]===e[i])?a:(n.current=e,e)},Ba=({locale:e,labels:t,surface:n,children:a})=>{let i=Ir(e,n.locale),o=Fa(()=>Fr(i,t,n),[i,t,n]),r=zr(o,wn),d=zr(Hr(r),ki),l=zr(Br(r),Ri),p=Fa(()=>({locale:i,labels:r,treeLabels:d,engineLabels:l}),[i,r,d,l]);return Ai(Ur.Provider,{value:p,children:a})},we=()=>Ha(Ur),ee=()=>Ha(Ur).labels});var s,E,F,u,Z,$,Ge,za,ve,Ut,M,Pt,Ua,ue=Ne(()=>{"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)]"},E={surface:"bg-[color:light-dark(#ffffff,#0f172b)]",subtle:"bg-[color:light-dark(#f8fafc,#1d293d)]",muted:"bg-[color:light-dark(#f1f5f9,#1d293d)]"},F={borderSubtle:"border-[color:light-dark(#e2e8f0,#314158)]",borderControl:"border-[color:light-dark(#62748e,#90a1b9)]"},u={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)]"},Z={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)]"},$={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)]"},Ge={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)]"},za={amber:"border-[color:light-dark(#bb4d00,#fcbb00)]"},ve={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)]"},Ut={blue:"hover:bg-[color:light-dark(#162456,#eff6ff)]",red:"hover:bg-[color:light-dark(#460809,#fef2f2)]"},M={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)]"},Pt={mark:"bg-[color:light-dark(#fff085,#733e0a)]",progressTrack:"bg-[color:light-dark(#bedbff,#193cb8)]",scrim:"bg-[color:rgb(15_23_43/0.5)]"},Ua="#71829b"});var x,wt,R,Ee=Ne(()=>{"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)]",R=`${wt} leading-[var(--aqcm-line-height-caption,1.25rem)]`});var qn,Gn,Xn,Yn,jr=Ne(()=>{"use strict";ue();qn="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]",Gn=Object.freeze({right:"var(--aqcm-overlay-right, 0px)"}),Xn=`absolute inset-0 ${Pt.scrim}`,Yn=()=>!1});var Di,Wi,it,Ka,ja,mn,pn=Ne(()=>{"use strict";ue();Di="min-w-11 py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",Wi=2,it=`focus-visible:outline-2 ${M.focusVisibleOutline} focus-visible:outline-offset-2`,Ka=`in-focus-visible:data-[contact-map-row-active]:outline-2 in-focus-visible:data-[contact-map-row-active]:-outline-offset-2 ${M.activeRowOutline}`,ja=Wi,mn=`inline-block max-w-full underline-offset-2 hover:underline focus-visible:underline ${it} ${Di}`});import{clsx as Ii}from"clsx";import{twMerge as Fi}from"tailwind-merge";function ke(...e){return Fi(Ii(e))}var _n=Ne(()=>{"use strict"});import{useOverlayDialog as Hi}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 hn,useEffect as qa,useId as Vi,useMemo as Qn,useRef as Ga,useState as Ki}from"react";import{createPortal as ji}from"react-dom";import{jsx as ae,jsxs as Xe}from"react/jsx-runtime";var qi,Oe,Gi,Xi,Yi,An,gn,Qi,Ji,fn,qr,Gr,Jn,Xr=Ne(()=>{"use strict";Ht();ge();jr();ue();pn();Ee();_n();qi=350,Oe=e=>e.stopPropagation(),Gi=Object.freeze({onClick:Oe,onDoubleClick:Oe,onContextMenu:Oe,onPointerDown:Oe,onPointerUp:Oe,onMouseDown:Oe,onMouseUp:Oe,onTouchStart:Oe,onTouchEnd:Oe,onKeyDown:Oe,onKeyUp:Oe,onFocus:Oe,onBlur:Oe}),Xi=ke(qn,"flex items-center justify-center px-4 py-6"),Yi=`relative max-h-full w-full max-w-md overflow-y-auto overscroll-contain rounded-lg border ${F.borderControl} ${E.surface} p-4 shadow-lg transition-colors`,An=0,gn=null,Qi=()=>{let e=document.body.style;An+=1,An===1&&(gn={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||!gn)return;let e=document.body.style;e.userSelect=gn.userSelect,typeof gn.webkitUserSelect<"u"&&(e.webkitUserSelect=gn.webkitUserSelect),gn=null},fn=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},qr=(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:d,entry:l}=t(o,i);return r&&!n.has(d)&&(n.add(d),a.push(l(r))),a},[])},Gr=({value:e,ariaLabel:t})=>{let[n,a]=Ki(!1),i=Ga(null),o=hn(async l=>{if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(l),!0}catch{}if(typeof document>"u")return!1;let p=document.createElement("textarea");p.value=l,p.setAttribute("readonly",""),p.style.position="absolute",p.style.left="-9999px",document.body.appendChild(p),p.select(),p.setSelectionRange(0,p.value.length);let m=document.execCommand("copy");return document.body.removeChild(p),m},[]),r=hn(async l=>{l.preventDefault(),l.stopPropagation(),i.current!==null&&typeof window<"u"&&(window.clearTimeout(i.current),i.current=null);let p=await o(e);a(p),p&&typeof window<"u"&&(i.current=window.setTimeout(()=>{a(!1),i.current=null},1500))},[o,e]);qa(()=>()=>{i.current!==null&&typeof window<"u"&&(window.clearTimeout(i.current),i.current=null)},[]);let d=n?Bi:zi;return ae("button",{type:"button",className:`inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md border ${F.borderControl} ${s.fgMuted} transition-colors ${M.hoverMuted} ${it}`,onClick:r,"aria-label":t,title:t,children:ae(d,{className:"h-3.5 w-3.5","aria-hidden":"true"})})},Jn=({contactData:e,openEmailsWithGmail:t,openGmailCompose:n,onRequestClose:a})=>{let i=ee(),o=Ga(null),r=Qn(()=>e.contacted_at?rt(e.contacted_at,i.recordDate):null,[e.contacted_at,i.recordDate]),d=fn(e.full_name)??i.noName,l=fn(e.company_name),p=fn(e.department),m=fn(e.title),f=Qn(()=>qr([{fieldKey:"company_name",label:i.fieldCompanyName,value:l},{fieldKey:"department",label:i.fieldDepartment,value:p},{fieldKey:"title",label:i.fieldTitle,value:m}],(v,{fieldKey:k,label:C})=>({normalized:v,key:`${k}-${v.toLowerCase()}`,entry:L=>({fieldKey:k,label:C,value:L})})),[l,p,m,i]),c=Qn(()=>qr([{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}],(v,{fieldKey:k,label:C})=>{let L=Pn(v);return{normalized:fn(v),key:(L??v).toLowerCase(),entry:V=>({fieldKey:k,label:C,value:V,href:L})}}),[e.custom_mobile_phone_number,e.mobile_phone_number,e.custom_company_phone_number,e.company_phone_number,i]),h=Qn(()=>qr([{fieldKey:"custom_email",label:i.popupCustomEmail,value:e.custom_email},{fieldKey:"email",label:i.popupEmail,value:e.email}],(v,{fieldKey:k,label:C})=>{let L=fn(v),_=ht(v,t),V=!!_?.startsWith("https://mail.google.com");return{normalized:L,key:v.toLowerCase(),entry:Q=>({fieldKey:k,label:C,value:Q,href:_,isGmailLink:V})}}),[e.custom_email,e.email,t,i]),b=c.length>0||h.length>0,S=Vi(),T=hn(()=>{a(),o.current=null},[a]),N=hn(v=>v.ownerDocument.getElementById(S),[S]),{dialogProps:U,backdropProps:O}=Hi({isOpen:!0,onClose:T,isCloseBlocked:Yn,initialFocus:N}),y=hn((v,k)=>{k.isGmailLink&&(v.preventDefault(),n(k.value))},[n]),g=hn((v,k)=>{if(!k.isGmailLink){o.current=null;return}let C=Date.now(),L=o.current;if(L&&L.email===k.value&&C-L.timestamp<=qi){o.current=null,v.preventDefault(),n(k.value);return}o.current={email:k.value,timestamp:C}},[n]);return qa(()=>(Qi(),Ji),[]),ji(Xe("dialog",{...U,...Gi,"data-contact-popup-root":"true","aria-labelledby":S,className:Xi,style:Gn,children:[ae("div",{...O,"data-contact-popup-backdrop":"",className:Xn}),Xe("div",{"data-contact-popup-card":"",className:Yi,children:[Xe("div",{className:"flex items-center justify-between gap-4",children:[ae("h2",{id:S,tabIndex:-1,className:`wrap-break-word min-w-0 font-semibold ${s.fg} text-lg outline-none`,children:d}),ae("button",{type:"button",className:`inline-flex shrink-0 items-center justify-center rounded-md p-3.5 ${s.fgMuted} transition-colors ${M.hoverMuted} ${it}`,onClick:T,"aria-label":i.close,children:ae(Ui,{className:"h-4 w-4","aria-hidden":"true"})})]}),f.length>0?ae("div",{className:`mt-2 space-y-2 ${s.fgSecondary} text-sm`,children:f.map(v=>Xe("div",{className:"flex items-center gap-3",children:[ae("p",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:v.value}),ae(Gr,{value:v.value,ariaLabel:i.copyField(v.label)})]},v.fieldKey))}):null,Xe("div",{className:`mt-4 space-y-4 ${s.fgSecondary}`,children:[c.length>0?ae("div",{children:ae("ul",{className:"space-y-3 text-sm",children:c.map(v=>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:v.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:v.href?ae("a",{href:v.href,className:`wrap-break-word ${u.blue} ${mn}`,children:v.value}):ae("span",{className:`wrap-break-word ${s.fg}`,children:v.value})}),ae(Gr,{value:v.value,ariaLabel:i.copyField(v.label)})]})]})},`${v.fieldKey}-${v.value}`))})}):null,h.length>0?ae("div",{children:ae("ul",{className:"space-y-3 text-sm",children:h.map(v=>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:v.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:[v.href?ae("a",{href:v.href,className:`wrap-break-word ${u.blue} ${mn}`,target:v.isGmailLink?"_blank":void 0,rel:v.isGmailLink?"noopener noreferrer":void 0,onDoubleClick:k=>y(k,v),onTouchEnd:k=>g(k,v),children:v.value}):ae("span",{className:`wrap-break-word ${s.fg}`,children:v.value}),v.isGmailLink?ae("span",{className:`mt-1 block ${R} ${s.fgMuted}`,children:i.popupGmailHint}):null]}),ae(Gr,{value:v.value,ariaLabel:i.copyField(v.label)})]})]})},`${v.fieldKey}-${v.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 On}from"react/jsx-runtime";var Zn,Yr=Ne(()=>{"use strict";ue();Ee();Zn=({fullName:e,title:t="-",companyName:n="-",department:a="-",phoneNumber:i="-",email:o="-",updatedAtText:r="-"})=>On("div",{className:`flex h-full w-full flex-col justify-center gap-0.5 ${s.fg} text-xs leading-tight transition-colors @min-[640px]/aqcm-root:grid @min-[640px]/aqcm-root:grid-cols-3 @min-[640px]/aqcm-root:gap-2 @min-[640px]/aqcm-root:text-sm @min-[1280px]/aqcm-root:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[On("div",{className:"flex items-center gap-1 @min-[640px]/aqcm-root: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 @min-[640px]/aqcm-root:hidden",children:_e("div",{className:`flex-1 truncate ${s.fgSecondary} text-xs leading-tight`,children:n})}),_e("div",{className:"block @min-[640px]/aqcm-root:hidden",children:_e("span",{className:`w-full truncate text-left ${wt} ${s.fgSecondary} leading-tight`,children:a})}),On("div",{className:"hidden flex-col gap-0.5 truncate @min-[640px]/aqcm-root:flex",children:[_e("span",{className:`truncate font-medium ${s.fg}`,children:e}),_e("span",{className:`truncate ${s.fgMuted} text-xs`,children:t})]}),On("div",{className:"hidden flex-col gap-0.5 truncate @min-[640px]/aqcm-root:flex",children:[_e("span",{className:`truncate ${s.fg}`,children:n}),_e("span",{className:`truncate ${s.fgMuted} text-xs`,children:a})]}),On("div",{className:"hidden flex-col gap-0.5 truncate @min-[640px]/aqcm-root: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} @min-[1280px]/aqcm-root: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 Qa,as,os,is,ss,Ja,Za,ls,cs,ds,us,ms,ps,fs,gs,eo,to,Xa,Ya,er,hs,ys,Qr,no,Jr=Ne(()=>{"use strict";Qa=/[​]/g,as=/^[\s  ]+|[\s  ]+$/g,os=/\s+/,is=/^[\p{Script=Latin}\s]+$/u,ss=/\p{Script=Latin}/u,Ja=Object.freeze({convertWidth:!0,convertKana:!0,convertCase:!0,convertRomaji:!1,normalizeVariants:!1,ignoreSpaces:!1,ignoreSymbols:!1,ignoreLongVowels:!1}),Za="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(Qa,"").replace(as,""),Ja),gs=e=>{if(!is.test(e))return null;let t=rs(e);return ss.test(t)?null:t},eo=e=>e.split(os).filter(Boolean),to=e=>es(e,Za).sets.map(({query:t})=>t),Xa=e=>to(e).flatMap(t=>eo(t)),Ya=e=>Zi({combine:Za,sets:Array.from(new Set(e),t=>({query:t}))}),er=e=>{let t=to(e.replace(Qa,"")).map(a=>eo(fs(a)).join(" ")).filter(a=>a!==""),n=[];for(let a of t){let i=gs(a);if(i===null)return Ya(t);n.push(i)}return Ya(n)},hs=e=>{let t=new Set([...Xa(e),...Xa(er(e))]),n=new Set;for(let a of t)for(let i of ts(a,Ja)){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")},no=(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 d of i)a(d.item)?o.push(d):r.push(d);return[...o,...r]}}});import{memo as bs}from"react";import{Fragment as Zr,jsx as tr}from"react/jsx-runtime";var Ss,xe,nr=Ne(()=>{"use strict";Jr();ue();Ss=`rounded ${Pt.mark} px-1 ${s.fg}`,xe=bs(({text:e,query:t,enabled:n=!0})=>{if(!(n&&t?.trim()&&e))return tr(Zr,{children:e});let a=Qr(t);if(a===null)return tr(Zr,{children:e});let i=[],o=0,r=a.exec(e),d=0;for(;r;){let l=r[0],p=r.index;if(p>o&&i.push(e.substring(o,p)),l.length===0){a.lastIndex++,r=a.exec(e);continue}i.push(tr("mark",{className:Ss,children:l},`highlight-${p}-${d}`)),o=p+l.length,d+=1,r=a.exec(e)}return o<e.length&&i.push(e.substring(o)),tr(Zr,{children:i})});xe.displayName="HighlightedText"});var ao={};yi(ao,{ContactDetailGrid:()=>ro,default:()=>Cs});import{useMemo as ea}from"react";import{Fragment as vs,jsx as ta,jsxs as xs}from"react/jsx-runtime";var rr,ro,Cs,oo=Ne(()=>{"use strict";Ht();ge();Xr();Yr();nr();rr=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},ro=({contactData:e,searchTerm:t,enableHighlighting:n,openEmailsWithGmail:a,openGmailCompose:i,isPopupVisible:o,onRequestClose:r})=>{let d=ee(),l=ea(()=>sn(e),[e]),p=ea(()=>ln(e),[e]),m=l.value??"-",f=p.value??"-",c=ea(()=>rt(e.updated_at,d.recordDateTime),[e.updated_at,d.recordDateTime]),h=rr(e.full_name)??d.noName,b=rr(e.company_name),S=rr(e.department),T=(N,U="-")=>ta(xe,{text:N??U,query:t,enabled:n});return xs(vs,{children:[ta(Zn,{fullName:T(h),title:T(rr(e.title)),companyName:T(b),department:T(S),phoneNumber:f,email:T(m),updatedAtText:c}),o?ta(Jn,{contactData:e,openEmailsWithGmail:a,openGmailCompose:i,onRequestClose:r}):null]})},Cs=ro});ge();ue();Ee();import{DEFAULT_FUZZY_SEARCH_OPTIONS as un}from"@aiquants/fuzzy-search";import{memo as Oi,useId as Va}from"react";import{jsx as at,jsxs as St}from"react/jsx-runtime";var Vr=Oi(({searchOptions:e,setSearchOptions:t})=>{let n=ee(),a=`flex flex-col gap-1 rounded-md border ${E.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=Va(),r=Va(),d=[];return d.push(St("div",{className:`${a} ${$.sky} border-l-4`,children:[St("div",{className:`${i} ${u.sky}`,children:["\u{1F4D8} ",n.advancedLearningHeading]}),at("label",{htmlFor:o,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.advancedLearningLabel}),at("input",{id:o,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.learningWeight||un.learningWeight,onChange:l=>t(p=>({...p,learningWeight:parseFloat(l.target.value)})),className:"h-11 w-full"}),St("span",{className:`${u.sky} text-xs`,children:[n.currentValueLabel," ",e.learningWeight||un.learningWeight]}),at("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.advancedLearningHint})]},"learning")),d.push(St("div",{className:`${a} ${$.indigo} border-l-4`,children:[St("div",{className:`${i} ${u.indigo}`,children:["\u23F1\uFE0F ",n.advancedDebounceHeading]}),at("label",{htmlFor:r,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.advancedDebounceLabel}),at("input",{id:r,type:"range",min:"100",max:"1000",step:"50",value:e.debounceMs??un.debounceMs,onChange:l=>t(p=>({...p,debounceMs:parseInt(l.target.value,10)})),className:"h-11 w-full"}),St("span",{className:`${u.indigo} text-xs`,children:[n.currentValueLabel," ",e.debounceMs??un.debounceMs]}),at("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.advancedDebounceHint})]},"debounce")),St("section",{className:"space-y-3",children:[St("div",{className:"flex items-center justify-between gap-3",children:[St("div",{className:`flex items-center gap-2 font-semibold ${s.fgSecondary} text-xs transition-colors`,children:[at("span",{children:"\u26A1"}),at("span",{className:"tracking-wide",children:n.settingsAdvancedTab})]}),at("button",{type:"button",onClick:()=>t(l=>({...l,learningWeight:un.learningWeight,debounceMs:un.debounceMs})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${F.borderControl} ${E.muted} px-2 font-medium ${s.fgSecondary} ${x} transition-colors ${M.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),at("div",{className:"grid grid-cols-1 gap-2 @min-[640px]/aqcm-root:grid-cols-2",children:d})]})});Vr.displayName="AdvancedSearchSettings";ge();ue();Ee();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Vt}from"@aiquants/fuzzy-search";import{memo as $i,useId as ot}from"react";import{jsx as ie,jsxs as me}from"react/jsx-runtime";var Kr=$i(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:i,setOpenEmailsWithGmail:o})=>{let r=ee(),d=`flex flex-col gap-1 rounded-md border ${E.surface} px-2 py-1 shadow-sm transition-colors`,l="text-xs font-semibold",p=ot(),m=ot(),f=ot(),c=ot(),h=ot(),b=ot(),S=ot(),T=ot(),N=ot(),U=ot(),O=[];return O.push(me("div",{className:`${d} ${$.blue} border-l-4`,children:[me("div",{className:`${l} ${u.blue}`,children:["\u{1F3AF} ",r.basicThresholdHeading]}),ie("label",{htmlFor:p,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicThresholdLabel}),ie("input",{id:p,type:"range",min:"0.0",max:e.sortBy==="relevance"?"1.5":"1.0",step:"0.05",value:e.threshold??Vt.threshold,onChange:y=>t(g=>({...g,threshold:parseFloat(y.target.value)})),className:"h-11 w-full"}),me("span",{className:`${u.blue} text-xs`,children:[r.currentValueLabel," ",e.threshold??Vt.threshold]}),ie("p",{className:`${R} ${s.fgMuted} transition-colors`,children:e.sortBy==="relevance"?r.basicThresholdRangeRelevance:r.basicThresholdRange})]},"threshold")),O.push(me("div",{className:`${d} ${$.amber} border-l-4`,children:[me("div",{className:`${l} ${u.amber}`,children:["\u{1FA84} ",r.basicDisplayHeading]}),me("label",{htmlFor:m,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[ie("input",{id:m,type:"checkbox",checked:e.caseSensitive??Vt.caseSensitive,onChange:y=>t(g=>({...g,caseSensitive:y.target.checked})),className:"h-3 w-3"}),r.basicCaseSensitive]}),me("label",{htmlFor:f,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[ie("input",{id:f,type:"checkbox",checked:n,onChange:y=>a(y.target.checked),className:"h-3 w-3"}),r.basicHighlight]}),me("label",{htmlFor:c,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[ie("input",{id:c,type:"checkbox",checked:i,onChange:y=>o(y.target.checked),className:"h-3 w-3"}),r.basicOpenEmailsWithGmail]}),me("div",{className:"flex flex-col gap-1",children:[ie("label",{htmlFor:h,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicMultiTermOperator}),me("select",{id:h,value:e.multiTermOperator??Vt.multiTermOperator,onChange:y=>t(g=>({...g,multiTermOperator:y.target.value})),className:`min-h-11 rounded border ${F.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${E.surface} ${s.fg}`,children:[ie("option",{value:"or",children:r.basicOperatorOr}),ie("option",{value:"and",children:r.basicOperatorAnd})]}),ie("p",{className:`${R} ${s.fgMuted} transition-colors`,children:r.basicMultiTermHint})]})]},"display")),O.push(me("div",{className:`${d} ${$.emerald} border-l-4`,children:[me("div",{className:`${l} ${u.emerald}`,children:["\u{1F4DA} ",r.basicSortHeading]}),me("div",{className:"flex flex-col gap-2",children:[ie("label",{htmlFor:b,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicSortBy}),me("select",{id:b,value:e.sortBy||Vt.sortBy,onChange:y=>t(g=>({...g,sortBy:y.target.value})),className:`min-h-11 rounded border ${F.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${E.surface} ${s.fg}`,children:[ie("option",{value:"score",children:r.basicSortByScore}),ie("option",{value:"relevance",children:r.basicSortByRelevance}),ie("option",{value:"original",children:r.basicSortByOriginal})]})]}),me("div",{className:"flex flex-col gap-2",children:[ie("label",{htmlFor:S,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicSortOrder}),me("select",{id:S,value:e.sortOrder||Vt.sortOrder,onChange:y=>t(g=>({...g,sortOrder:y.target.value})),className:`min-h-11 rounded border ${F.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${E.surface} ${s.fg}`,children:[ie("option",{value:"desc",children:r.basicSortDescending}),ie("option",{value:"asc",children:r.basicSortAscending})]})]})]},"sorting")),O.push(me("div",{className:`${d} ${$.purple} border-l-4`,children:[me("div",{className:`${l} ${u.purple}`,children:["\u2699\uFE0F ",r.basicEngineHeading]}),ie("label",{htmlFor:T,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicStrategy}),me("select",{id:T,value:e.parallelSearchStrategy||Vt.parallelSearchStrategy,onChange:y=>t(g=>({...g,parallelSearchStrategy:y.target.value})),className:`min-h-11 rounded border ${F.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${E.surface} ${s.fg}`,children:[ie("option",{value:"balanced",children:r.basicStrategyBalanced}),ie("option",{value:"index-first",children:r.basicStrategyIndexFirst}),ie("option",{value:"levenshtein-first",children:r.basicStrategyLevenshteinFirst})]}),me("div",{className:"mt-2 space-y-2",children:[me("label",{htmlFor:N,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[ie("input",{id:N,type:"checkbox",checked:e.enableIndexFiltering!==!1,onChange:y=>t(g=>({...g,enableIndexFiltering:y.target.checked})),className:"h-3 w-3"}),r.basicIndexFiltering]}),me("label",{htmlFor:U,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[ie("input",{id:U,type:"checkbox",checked:e.enableLevenshtein!==!1,onChange:y=>t(g=>({...g,enableLevenshtein:y.target.checked})),className:"h-3 w-3"}),r.basicLevenshtein]})]})]},"engine")),me("section",{className:"space-y-3",children:[me("div",{className:`flex items-center gap-2 font-semibold ${u.blue} text-xs transition-colors`,children:[ie("span",{children:"\u{1F527}"}),ie("span",{className:"tracking-wide",children:r.settingsBasicTab})]}),ie("div",{className:"grid grid-cols-1 gap-2 @min-[640px]/aqcm-root:grid-cols-2 @min-[1280px]/aqcm-root:grid-cols-3 @min-[1536px]/aqcm-root:grid-cols-4",children:O})]})});Kr.displayName="BasicSearchSettings";Ht();import{SWIPE_OVERLAY_SCROLL_AREA_STYLE as Ts}from"@aiquants/swipe-overlay";import Ns from"lucide-react/dist/esm/icons/badge-check.js";import Es from"lucide-react/dist/esm/icons/building-2.js";import Ms 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 Rs from"lucide-react/dist/esm/icons/id-card.js";import Ps from"lucide-react/dist/esm/icons/mail.js";import ws 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 Os,useMemo as ra,useRef as $s,useState as Ds}from"react";var st={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();ue();ue();_n();import*as Ye from"@radix-ui/react-tabs";import*as ar from"react";import{jsx as na}from"react/jsx-runtime";var or=Ye.Root,$n=ar.forwardRef(({className:e,...t},n)=>na(Ye.List,{ref:n,className:ke(`inline-flex h-10 items-center justify-center rounded-md ${E.muted} p-1 ${s.fgMuted}`,e),...t}));$n.displayName=Ye.List.displayName;var Kt=ar.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 ${M.ringOffsetSurface} transition-all focus-visible:outline-hidden focus-visible:ring-2 ${M.focusVisibleRing} focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 ${M.activeTabSurface} ${M.activeTabFg} data-[state=active]:shadow-2xs`,e),...t}));Kt.displayName=Ye.Trigger.displayName;var jt=ar.forwardRef(({className:e,...t},n)=>na(Ye.Content,{ref:n,className:ke(`mt-2 ${M.ringOffsetSurface} focus-visible:outline-hidden focus-visible:ring-2 ${M.focusVisibleRing} focus-visible:ring-offset-2 data-[state=inactive]:hidden`,e),...t}));jt.displayName=Ye.Content.displayName;pn();Ee();nr();import{jsx as P,jsxs as Se}from"react/jsx-runtime";var io=`truncate font-semibold ${s.fg} ${x}`,Ws=({icon:e,label:t,value:n,fieldKey:a,copyValue:i,onCopy:o,isCopied:r,linkHref:d,searchTerm:l,enableHighlighting:p})=>{let m=ee(),f=!!(o&&a&&i),c=d?.startsWith("https://mail.google.com")?"_blank":void 0;return Se("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${F.borderSubtle} ${E.subtle} px-2.5 py-1.5 transition-colors`,children:[Se("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[P("div",{className:`flex h-7 w-7 items-center justify-center rounded-full ${E.surface} ${s.fgMuted} transition-colors`,children:P(e,{size:14})}),Se("div",{className:"min-w-0 flex-1",children:[P("div",{className:`font-medium ${R} ${s.fgMuted}`,children:t}),d?P("a",{href:d,className:`align-top ${io} ${mn}`,target:c,rel:c?"noopener noreferrer":void 0,children:P(xe,{text:n,query:l??"",enabled:p})}):P("div",{className:io,children:P(xe,{text:n,query:l??"",enabled:p})})]})]}),f?P("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 ${F.borderControl} ${E.surface} ${s.fgMuted} transition-colors ${M.hoverBlueAccentBorder} ${M.hoverBlueFg} ${it}`,"aria-label":m.copyField(t),children:r?P(Ls,{size:14}):P(ks,{size:14})}):null]})},so=({items:e,searchTerm:t,enableHighlighting:n})=>P("dl",{className:"grid grid-cols-1 gap-x-3 gap-y-1.5 @min-[640px]/aqcm-root:grid-cols-2",children:e.map(a=>Se("div",{className:`flex flex-col gap-0.5 rounded-md border ${F.borderSubtle} ${E.surface} px-2 py-1 transition-colors`,children:[P("dt",{className:`font-semibold ${R} ${s.fgMuted} uppercase tracking-wide`,children:a.label}),P("dd",{className:`wrap-break-word ${s.fg} text-xs`,children:P(xe,{text:a.value,query:t??"",enabled:n})})]},a.fieldKey))}),aa=({title:e})=>P("h3",{className:`font-semibold ${s.fgSecondary} text-xs`,children:e}),Is=()=>{let e=ee();return Se("div",{className:`flex h-full min-h-40 w-full flex-1 flex-col items-center justify-center gap-2 rounded-xl border ${F.borderSubtle} border-dashed ${E.surface} p-4 text-center transition-colors`,children:[P("p",{className:`font-medium ${s.fgMuted} text-xs`,children:e.detailEmptyTitle}),P("p",{className:`${R} ${s.fgMuted}`,children:e.detailEmptyHint})]})},Fs=Object.freeze({overlay:Ts,pane:void 0}),yn=({contact:e,placement:t,searchTerm:n,enableHighlighting:a,style:i,className:o=""})=>{let r=ee(),[d,l]=Ds(null),p=$s(null);Os(()=>()=>{p.current!==null&&window.clearTimeout(p.current)},[]);let m=ra(()=>sn(e),[e]),f=ra(()=>ln(e),[e]),c=ra(()=>rt(e?.contacted_at,r.recordDateTime),[e?.contacted_at,r.recordDateTime]),h=As(async(C,L,_)=>{try{await navigator.clipboard.writeText(L),l(C),p.current!==null&&window.clearTimeout(p.current),p.current=window.setTimeout(()=>{l(null)},2e3)}catch(V){st.error("Failed to copy contact detail",V)}},[]);if(!e)return P("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${F.borderSubtle} ${E.surface} shadow-sm transition-colors`,children:P(Is,{})});let b=[re(e.title),re(e.department)].filter(C=>C!=="-"),S=[b.join(" / "),re(e.company_name)].filter(C=>C&&C!=="-").join(" \u30FB ")||"-",T=qe(e.full_name)??r.noName,N=[{fieldKey:"full_name",label:r.fieldFullName,value:T},{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)}],U=[{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(C=>C.value!=="-"),O=[{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(C=>C.value!=="-"),y=[{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:rt(e.created_at,r.recordDateTime)},{fieldKey:"updated_by",label:r.fieldUpdatedBy,value:re(e.updated_by)},{fieldKey:"updated_at",label:r.fieldUpdatedAt,value:rt(e.updated_at,r.recordDateTime)}],g=[{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:m.value??"-",fieldKey:"primary_email",copyValue:m.value,linkHref:ht(m.value,!1)},{rowKey:"primary_phone",icon:ws,label:r.summaryPhone,value:f.value??"-",fieldKey:"primary_phone",copyValue:f.value,linkHref:Pn(f.value)},{rowKey:"contacted_at",icon:Ms,label:r.summaryLastContact,value:c}],v=[{sectionKey:"email",title:r.sectionEmail,emptyText:r.sectionEmailEmpty,entries:U,recommendedKey:m.fieldKey??null,resolveHref:C=>ht(C!=null?String(C):null,!1)},{sectionKey:"phone",title:r.sectionPhone,emptyText:r.sectionPhoneEmpty,entries:O,recommendedKey:f.fieldKey??null,resolveHref:C=>Pn(C!=null?String(C):null)}],k=[{value:"summary",label:r.detailTabSummary,content:Se("div",{className:"flex flex-col gap-4",children:[Se("div",{className:"flex flex-col gap-1",children:[Se("div",{className:`flex items-center gap-2 ${s.fgMuted} text-sm`,children:[P(Es,{size:16}),P("span",{children:P(xe,{text:re(e.company_name),query:n??"",enabled:a})})]}),b.length>0?P("div",{className:`${s.fgMuted} text-sm`,children:b.map((C,L)=>Se("span",{children:[L>0&&" / ",P(xe,{text:C,query:n??"",enabled:a})]},`header-line-${L}`))}):null]}),P("div",{className:"flex flex-col gap-3",children:g.map(C=>P(Ws,{icon:C.icon,label:C.label,value:C.value,fieldKey:C.fieldKey,copyValue:C.copyValue,onCopy:h,isCopied:C.fieldKey?d===C.fieldKey:!1,linkHref:C.linkHref,searchTerm:n,enableHighlighting:a},C.rowKey))})]})},{value:"basic",label:r.detailTabBasic,content:Se("div",{className:"flex flex-col gap-3",children:[P(aa,{title:r.detailBasicProfile}),P(so,{items:N,searchTerm:n,enableHighlighting:a})]})},{value:"contact",label:r.detailTabContact,content:P("div",{className:"flex flex-col gap-4",children:v.map(({sectionKey:C,title:L,emptyText:_,entries:V,recommendedKey:Q,resolveHref:Ce})=>Se("div",{className:"flex flex-col gap-2",children:[P(aa,{title:L}),V.length===0?P("p",{className:`${s.fgMuted} text-xs`,children:_}):P("div",{className:"flex flex-col gap-2",children:V.map(q=>{let W=Ce(q.rawValue),K=q.fieldKey===Q;return Se("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${F.borderSubtle} ${E.surface} px-3 py-2 transition-colors`,children:[Se("div",{className:"min-w-0 flex-1",children:[P("div",{className:`font-medium ${s.fgMuted} text-xs`,children:q.label}),P("div",{className:`wrap-break-word ${s.fg} text-sm`,children:W?P("a",{href:W,className:`text-inherit ${mn}`,children:P(xe,{text:q.value,query:n??"",enabled:a})}):P(xe,{text:q.value,query:n??"",enabled:a})})]}),K?Se("span",{className:`inline-flex shrink-0 items-center gap-1 rounded-full ${Z.emerald} px-2 py-0.5 font-semibold ${R} ${u.emerald} transition-colors`,children:[P(Ns,{size:14}),r.preferred]}):null]},q.fieldKey)})})]},C))})},{value:"meta",label:r.detailTabMeta,content:Se("div",{className:"flex flex-col gap-3",children:[P(aa,{title:r.detailTabMeta}),P(so,{items:y,searchTerm:n,enableHighlighting:a})]})}];return Se("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${F.borderSubtle} ${E.surface} shadow-sm transition-colors ${o}`.trim(),style:i,children:[P("div",{className:`${F.borderSubtle} border-b px-3 py-1.5 transition-colors ${E.subtle}`,children:Se("div",{className:"flex items-center gap-2",children:[P("div",{className:`flex h-8 w-8 items-center justify-center rounded-full ${Z.blue} ${u.blue} transition-colors`,children:P(_s,{size:16})}),Se("div",{className:"min-w-0 flex-1",children:[P("div",{className:`truncate font-semibold ${s.fg} text-sm`,children:P(xe,{text:T,query:n??"",enabled:a})}),P("div",{className:`truncate ${R} ${s.fgMuted}`,children:P(xe,{text:S,query:n??"",enabled:a})})]})]})}),Se(or,{defaultValue:"summary",className:"flex flex-1 flex-col overflow-hidden",children:[P($n,{className:`grid h-auto grid-cols-4 gap-1 rounded-none ${F.borderSubtle} border-b ${E.subtle} px-2 py-1 transition-colors`,children:k.map(C=>P(Kt,{value:C.value,className:`flex min-h-11 min-w-0 touch-manipulation rounded-md px-1 py-1 font-semibold ${s.fgSecondary} ${x} transition-colors ${M.activeTabSurface} ${M.activeTabBlueFg}`,children:P("span",{className:"min-w-0 truncate",children:C.label})},C.value))}),k.map(C=>P(jt,{value:C.value,className:`scrollbar-thin flex-1 overflow-y-auto px-2.5 py-2 transition-colors ${s.fgSecondary}`,style:Fs[t],children:C.content},C.value))]})]})};zt();ge();ue();import{memo as Hs}from"react";import{jsx as _t,jsxs as oa}from"react/jsx-runtime";var ia=Hs(({recordCount:e,companyCount:t,phase:n,loadedCount:a,totalCount:i})=>{let{locale:o,labels:r}=we(),d=ne(o,e),l=ne(o,t);return oa("div",{"data-testid":"contact-map-annotation",className:"flex flex-wrap items-center gap-2 leading-1 transition-colors",children:[oa("span",{className:"flex items-baseline gap-1",children:[_t("span",{className:s.fgMuted,children:r.annotationTotalLabel}),_t("span",{className:s.fg,"data-testid":"contact-map-record-count",children:d}),_t("span",{className:s.fgMuted,children:r.recordUnit(d)})]}),oa("span",{className:"flex items-baseline gap-1",children:[_t("span",{className:s.fgMuted,children:r.annotationCompaniesLabel}),_t("span",{className:s.fg,"data-testid":"contact-map-company-count",children:l}),_t("span",{className:s.fgMuted,children:r.companyUnit(l)})]}),n==="streaming"||n==="idle"?_t("span",{"data-testid":"contact-map-stream-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${Z.blue} px-2 py-0.5 font-medium ${u.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"?_t("span",{"data-testid":"contact-map-reconnecting-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${Z.amber} px-2 py-0.5 font-medium ${u.amber} text-xs`,children:r.annotationReconnecting(a)}):null]})});ia.displayName="ContactMapAnnotation";dn();import{useMemo as fi}from"react";yt();var ir=e=>e==="unauthenticated"||e==="forbidden";function sr(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 ${Y(e)}`)}function lo(e,t){if(typeof e!="number")throw new TypeError(`[contact-map] ${t} must be the stream's accessFailureNumber (a number); got ${Y(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 ${Y(e)}`)}yt();dn();ge();import{createContext as zs,useContext as Us,useMemo as Vs}from"react";yt();dn();Dr();var Bs=["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 ${Y(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${Y(n)}`)}}var uo={setting:"workerUrls"},mo=(e,t)=>{if(e===void 0)return;let{setting:n,keys:a=Bs,hints:i={}}=t;if(!cn(e))throw new TypeError(`[contact-map] ${n} must be a plain object or left out; got ${Y(e)}`);let o=Object.getOwnPropertyNames(e).map(l=>({key:l,url:e[l]})),r=o.find(({key:l,url:p})=>p!==void 0&&!a.includes(l));if(r!==void 0){let l=Object.hasOwn(i,r.key)?i[r.key]:void 0,p=l===void 0?Kn(r.key,a):void 0;throw new RangeError(`[contact-map] ${n} has a key it does not take (it takes ${a.join(", ")}${l===void 0?"":`; ${l}`}${p===void 0?"":`; did you mean ${JSON.stringify(p)}?`}); got ${Y(r.key)}`)}let d=Object.create(null);for(let{key:l,url:p}of o){let m=l;co(n,m,p),p!==void 0&&(d[m]=p)}return d};function $m(e,t=uo){mo(e,t)}function po(e){co("workerUrls","treeWorker",e)}var bn=(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 sa}from"react/jsx-runtime";var fo=e=>{if(!cn(e))throw new TypeError(`[contact-map] config must be a plain object; got ${Y(e)}`);let t=e;return{streamEndpoint:Le(t,"streamEndpoint"),openEmailsWithGmail:Le(t,"openEmailsWithGmail"),treeWorkerFactory:Le(t,"treeWorkerFactory"),workerUrls:bn(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})}))},Ks=go(fo({})),ho=zs(Ks),js=Object.freeze({locale:"locale",labels:"labels"});function la({config:e,chromeSurface:t,children:n}){let{streamEndpoint:a,openEmailsWithGmail:i,treeWorkerFactory:o,workerUrls:r,locale:d,labels:l}=fo(e),{indexWorker:p,levenshteinWorker:m,treeWorker:f}=r,c=Vs(()=>go({streamEndpoint:a,openEmailsWithGmail:i,treeWorkerFactory:o,workerUrls:{indexWorker:p,levenshteinWorker:m,treeWorker:f},locale:d,labels:l}),[a,i,o,p,m,f,d,l]);return sa(ho.Provider,{value:c,children:sa(Ba,{locale:d,labels:l,surface:t,children:n})})}function qs({config:e,children:t}){return sa(la,{config:e,chromeSurface:js,children:t})}function Ct(){return Us(ho)}import{useCallback as ca,useEffect as el,useMemo as dr,useSyncExternalStore as yo}from"react";yt();import{accessFailureKindOfStatus as Gs}from"@aiquants/auth-core";var Xs=1e3,Ys=3e4,Qs=6;function cr(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 ${Y(e)}`);if(/[\s\p{Cc}#]/u.test(e))throw new RangeError(`[contact-map] streamEndpoint must not contain whitespace, control characters or "#"; got ${Y(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 ${Y(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),lr=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?.()};cr(t.endpoint),this.fetchFn=t.fetchFn??((...n)=>fetch(...n)),this.endpoint=t.endpoint,this.initialRetryDelayMs=t.initialRetryDelayMs??Xs,this.maxRetryDelayMs=t.maxRetryDelayMs??Ys,this.maxConsecutiveFailures=t.maxConsecutiveFailures??Qs,this.logger=t.logger??st}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=Gs(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,d=!1;for(;;){let{done:l,value:p}=await a.read();if(l)break;let m=i.decode(p,{stream:!0}),f=(o+m).split(`
1
+ var hi=Object.defineProperty;var Ne=(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 qe,Ft,Aa,sn,ln,Pn,ht,We,Vn,Or,$r,rt,re,Ht=Ne(()=>{"use strict";qe=e=>{if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null},Ft=e=>!e||typeof e!="object"?null:"item"in e?e.item??null:"person_id"in e?e:null,Aa=(e,t)=>{if(!e)return{value:null,fieldKey:null};for(let n of t){let a=qe(e[n]);if(a)return{value:a,fieldKey:n}}return{value:null,fieldKey:null}},sn=e=>Aa(e,["custom_email","email"]),ln=e=>Aa(e,["custom_mobile_phone_number","mobile_phone_number","company_phone_number"]),Pn=e=>{let t=qe(e);if(!t)return null;let n=t.replace(/[^0-9+#*]/g,"");return n.length===0?null:`tel:${n}`},ht=(e,t)=>{let n=qe(e);return n?t?`https://mail.google.com/mail/?view=cm&fs=1&to=${encodeURIComponent(n)}`:`mailto:${encodeURIComponent(n)}`:null},We=(e,t)=>String(e).padStart(t,"0"),Vn=e=>`${We(e.getUTCFullYear(),4)}-${We(e.getUTCMonth()+1,2)}-${We(e.getUTCDate(),2)}`,Or=e=>`${Vn(e)} ${We(e.getUTCHours(),2)}:${We(e.getUTCMinutes(),2)}:${We(e.getUTCSeconds(),2)}`,$r=e=>`${We(e.getFullYear(),4)}-${We(e.getMonth()+1,2)}-${We(e.getDate(),2)} ${We(e.getHours(),2)}:${We(e.getMinutes(),2)}:${We(e.getSeconds(),2)}`,rt=(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"?qe(e)??"-":typeof e=="number"?Number.isFinite(e)?String(e):"-":String(e)});var Y,Oa,yt=Ne(()=>{"use strict";Y=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":Oa(e);case"function":return Oa(e);case"number":return Object.is(e,-0)?"-0":String(e);default:return String(e)}},Oa=e=>{try{return Object.prototype.toString.call(e)}catch{return"[object ?]"}}});var cn,Le,dn=Ne(()=>{"use strict";cn=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,Kn,Dr=Ne(()=>{"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]},Kn=(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 $a,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,Bt,jn,Wa,wn,bt,Ti,Da,Ia,Ni,Ir,Ei,Mi,Li,Fr,Hr,Br,zt=Ne(()=>{"use strict";Ht();yt();dn();Dr();xi=Object.freeze({en:"en-US",ja:"ja-JP"}),ne=(e,t)=>t.toLocaleString(xi[e]),Bt=(e,t,n)=>e==="1"?t:n,jn=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=>Bt(e,"record","records"),companyUnit:e=>Bt(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=>Bt(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:Or,recordDate:Vn,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:$r,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} ${Bt(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=>Bt(e," time"," times"),itemsUnit:e=>Bt(e," item"," items"),charactersUnit:e=>Bt(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:Or,recordDate:Vn,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:$r,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"})}),Wa=Object.freeze(Object.keys(jn.en)),wn=Object.freeze([...Wr,...Wa]),bt=Object.freeze({en:Object.freeze({...$a.en,...jn.en}),ja:Object.freeze({...$a.ja,...jn.ja})}),Ti=new Set(wn),Da=Object.keys(bt).map(e=>JSON.stringify(e)).join(" or "),Ia=Object.freeze({locale:"locale",labels:"labels"}),Ni=(e,t,n)=>{e[t]=n},Ir=(e,t=Ia.locale)=>{if(e!==void 0&&typeof e!="string")throw new TypeError(`[contact-map] ${t} must be ${Da} or left out; got ${Y(e)}`);if(e!==void 0&&!Object.hasOwn(bt,e))throw new RangeError(`[contact-map] ${t} must be ${Da} or left out; got ${Y(e)}`);return Ci(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 ${Y(n)}`);return}if(typeof n!="string")throw new TypeError(`[contact-map] ${e}.${t} must be a string; got ${Y(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${Y(n)}`)},Mi=(e,t,n)=>{let a=Object.create(null);for(let i of Object.getOwnPropertyNames(e)){if(!Ti.has(i)){let r=Kn(i,wn);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 ${Y(i)}`)}let o=e[i];o!==void 0&&(Ei(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=Ia)=>{let a=Ir(e,n.locale);if(t===void 0)return bt[a];if(!cn(t))throw new TypeError(`[contact-map] ${n.labels} must be a plain object or left out; got ${Y(t)}`);let i=Mi(t,bt[a],n.labels),r={...Si(a,Li(i)),...jn[a]};for(let d of Wa){let l=i[d];l!==void 0&&Ni(r,d,l)}return Object.freeze(r)},Hr=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 Ri}from"@aiquants/virtualscroll";import{createContext as Pi,useContext as Ha,useMemo as Fa,useRef as wi}from"react";import{jsx as Ai}from"react/jsx-runtime";var _i,Ur,zr,Ba,we,ee,ge=Ne(()=>{"use strict";zt();_i=Object.freeze({locale:"en",labels:bt.en,treeLabels:Hr(bt.en),engineLabels:Br(bt.en)}),Ur=Pi(_i),zr=(e,t)=>{let n=wi(null),a=n.current;return a!==null&&t.every(i=>a[i]===e[i])?a:(n.current=e,e)},Ba=({locale:e,labels:t,surface:n,children:a})=>{let i=Ir(e,n.locale),o=Fa(()=>Fr(i,t,n),[i,t,n]),r=zr(o,wn),d=zr(Hr(r),ki),l=zr(Br(r),Ri),p=Fa(()=>({locale:i,labels:r,treeLabels:d,engineLabels:l}),[i,r,d,l]);return Ai(Ur.Provider,{value:p,children:a})},we=()=>Ha(Ur),ee=()=>Ha(Ur).labels});var s,E,F,u,Z,$,Ge,za,ve,Ut,M,Pt,Ua,ue=Ne(()=>{"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)]"},E={surface:"bg-[color:light-dark(#ffffff,#0f172b)]",subtle:"bg-[color:light-dark(#f8fafc,#1d293d)]",muted:"bg-[color:light-dark(#f1f5f9,#1d293d)]"},F={borderSubtle:"border-[color:light-dark(#e2e8f0,#314158)]",borderControl:"border-[color:light-dark(#62748e,#90a1b9)]"},u={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)]"},Z={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)]"},$={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)]"},Ge={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)]"},za={amber:"border-[color:light-dark(#bb4d00,#fcbb00)]"},ve={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)]"},Ut={blue:"hover:bg-[color:light-dark(#162456,#eff6ff)]",red:"hover:bg-[color:light-dark(#460809,#fef2f2)]"},M={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)]"},Pt={mark:"bg-[color:light-dark(#fff085,#733e0a)]",progressTrack:"bg-[color:light-dark(#bedbff,#193cb8)]",scrim:"bg-[color:rgb(15_23_43/0.5)]"},Ua="#71829b"});var x,wt,R,Ee=Ne(()=>{"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)]",R=`${wt} leading-[var(--aqcm-line-height-caption,1.25rem)]`});var qn,Gn,Xn,Yn,jr=Ne(()=>{"use strict";ue();qn="fixed top-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]",Gn=Object.freeze({right:"var(--aqcm-overlay-right, 0px)",bottom:"var(--aqcm-overlay-bottom, 0px)"}),Xn=`absolute inset-0 ${Pt.scrim}`,Yn=()=>!1});var Di,Wi,it,Ka,ja,mn,pn=Ne(()=>{"use strict";ue();Di="min-w-11 py-[max(0px,calc((2.75rem_-_1lh)_/_2))]",Wi=2,it=`focus-visible:outline-2 ${M.focusVisibleOutline} focus-visible:outline-offset-2`,Ka=`in-focus-visible:data-[contact-map-row-active]:outline-2 in-focus-visible:data-[contact-map-row-active]:-outline-offset-2 ${M.activeRowOutline}`,ja=Wi,mn=`inline-block max-w-full underline-offset-2 hover:underline focus-visible:underline ${it} ${Di}`});import{clsx as Ii}from"clsx";import{twMerge as Fi}from"tailwind-merge";function ke(...e){return Fi(Ii(e))}var _n=Ne(()=>{"use strict"});import{useOverlayDialog as Hi}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 hn,useEffect as qa,useId as Vi,useMemo as Qn,useRef as Ga,useState as Ki}from"react";import{createPortal as ji}from"react-dom";import{jsx as ae,jsxs as Xe}from"react/jsx-runtime";var qi,Oe,Gi,Xi,Yi,An,gn,Qi,Ji,fn,qr,Gr,Jn,Xr=Ne(()=>{"use strict";Ht();ge();jr();ue();pn();Ee();_n();qi=350,Oe=e=>e.stopPropagation(),Gi=Object.freeze({onClick:Oe,onDoubleClick:Oe,onContextMenu:Oe,onPointerDown:Oe,onPointerUp:Oe,onMouseDown:Oe,onMouseUp:Oe,onTouchStart:Oe,onTouchEnd:Oe,onKeyDown:Oe,onKeyUp:Oe,onFocus:Oe,onBlur:Oe}),Xi=ke(qn,"flex items-center justify-center px-4 py-6"),Yi=`relative max-h-full w-full max-w-md overflow-y-auto overscroll-contain rounded-lg border ${F.borderControl} ${E.surface} p-4 shadow-lg transition-colors`,An=0,gn=null,Qi=()=>{let e=document.body.style;An+=1,An===1&&(gn={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||!gn)return;let e=document.body.style;e.userSelect=gn.userSelect,typeof gn.webkitUserSelect<"u"&&(e.webkitUserSelect=gn.webkitUserSelect),gn=null},fn=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},qr=(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:d,entry:l}=t(o,i);return r&&!n.has(d)&&(n.add(d),a.push(l(r))),a},[])},Gr=({value:e,ariaLabel:t})=>{let[n,a]=Ki(!1),i=Ga(null),o=hn(async l=>{if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(l),!0}catch{}if(typeof document>"u")return!1;let p=document.createElement("textarea");p.value=l,p.setAttribute("readonly",""),p.style.position="absolute",p.style.left="-9999px",document.body.appendChild(p),p.select(),p.setSelectionRange(0,p.value.length);let m=document.execCommand("copy");return document.body.removeChild(p),m},[]),r=hn(async l=>{l.preventDefault(),l.stopPropagation(),i.current!==null&&typeof window<"u"&&(window.clearTimeout(i.current),i.current=null);let p=await o(e);a(p),p&&typeof window<"u"&&(i.current=window.setTimeout(()=>{a(!1),i.current=null},1500))},[o,e]);qa(()=>()=>{i.current!==null&&typeof window<"u"&&(window.clearTimeout(i.current),i.current=null)},[]);let d=n?Bi:zi;return ae("button",{type:"button",className:`inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md border ${F.borderControl} ${s.fgMuted} transition-colors ${M.hoverMuted} ${it}`,onClick:r,"aria-label":t,title:t,children:ae(d,{className:"h-3.5 w-3.5","aria-hidden":"true"})})},Jn=({contactData:e,openEmailsWithGmail:t,openGmailCompose:n,onRequestClose:a})=>{let i=ee(),o=Ga(null),r=Qn(()=>e.contacted_at?rt(e.contacted_at,i.recordDate):null,[e.contacted_at,i.recordDate]),d=fn(e.full_name)??i.noName,l=fn(e.company_name),p=fn(e.department),m=fn(e.title),f=Qn(()=>qr([{fieldKey:"company_name",label:i.fieldCompanyName,value:l},{fieldKey:"department",label:i.fieldDepartment,value:p},{fieldKey:"title",label:i.fieldTitle,value:m}],(v,{fieldKey:k,label:C})=>({normalized:v,key:`${k}-${v.toLowerCase()}`,entry:L=>({fieldKey:k,label:C,value:L})})),[l,p,m,i]),c=Qn(()=>qr([{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}],(v,{fieldKey:k,label:C})=>{let L=Pn(v);return{normalized:fn(v),key:(L??v).toLowerCase(),entry:V=>({fieldKey:k,label:C,value:V,href:L})}}),[e.custom_mobile_phone_number,e.mobile_phone_number,e.custom_company_phone_number,e.company_phone_number,i]),h=Qn(()=>qr([{fieldKey:"custom_email",label:i.popupCustomEmail,value:e.custom_email},{fieldKey:"email",label:i.popupEmail,value:e.email}],(v,{fieldKey:k,label:C})=>{let L=fn(v),_=ht(v,t),V=!!_?.startsWith("https://mail.google.com");return{normalized:L,key:v.toLowerCase(),entry:Q=>({fieldKey:k,label:C,value:Q,href:_,isGmailLink:V})}}),[e.custom_email,e.email,t,i]),b=c.length>0||h.length>0,S=Vi(),T=hn(()=>{a(),o.current=null},[a]),N=hn(v=>v.ownerDocument.getElementById(S),[S]),{dialogProps:U,backdropProps:O}=Hi({isOpen:!0,onClose:T,isCloseBlocked:Yn,initialFocus:N}),y=hn((v,k)=>{k.isGmailLink&&(v.preventDefault(),n(k.value))},[n]),g=hn((v,k)=>{if(!k.isGmailLink){o.current=null;return}let C=Date.now(),L=o.current;if(L&&L.email===k.value&&C-L.timestamp<=qi){o.current=null,v.preventDefault(),n(k.value);return}o.current={email:k.value,timestamp:C}},[n]);return qa(()=>(Qi(),Ji),[]),ji(Xe("dialog",{...U,...Gi,"data-contact-popup-root":"true","aria-labelledby":S,className:Xi,style:Gn,children:[ae("div",{...O,"data-contact-popup-backdrop":"",className:Xn}),Xe("div",{"data-contact-popup-card":"",className:Yi,children:[Xe("div",{className:"flex items-center justify-between gap-4",children:[ae("h2",{id:S,tabIndex:-1,className:`wrap-break-word min-w-0 font-semibold ${s.fg} text-lg outline-none`,children:d}),ae("button",{type:"button",className:`inline-flex shrink-0 items-center justify-center rounded-md p-3.5 ${s.fgMuted} transition-colors ${M.hoverMuted} ${it}`,onClick:T,"aria-label":i.close,children:ae(Ui,{className:"h-4 w-4","aria-hidden":"true"})})]}),f.length>0?ae("div",{className:`mt-2 space-y-2 ${s.fgSecondary} text-sm`,children:f.map(v=>Xe("div",{className:"flex items-center gap-3",children:[ae("p",{className:"wrap-break-word min-w-0 flex-1 whitespace-normal",children:v.value}),ae(Gr,{value:v.value,ariaLabel:i.copyField(v.label)})]},v.fieldKey))}):null,Xe("div",{className:`mt-4 space-y-4 ${s.fgSecondary}`,children:[c.length>0?ae("div",{children:ae("ul",{className:"space-y-3 text-sm",children:c.map(v=>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:v.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:v.href?ae("a",{href:v.href,className:`wrap-break-word ${u.blue} ${mn}`,children:v.value}):ae("span",{className:`wrap-break-word ${s.fg}`,children:v.value})}),ae(Gr,{value:v.value,ariaLabel:i.copyField(v.label)})]})]})},`${v.fieldKey}-${v.value}`))})}):null,h.length>0?ae("div",{children:ae("ul",{className:"space-y-3 text-sm",children:h.map(v=>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:v.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:[v.href?ae("a",{href:v.href,className:`wrap-break-word ${u.blue} ${mn}`,target:v.isGmailLink?"_blank":void 0,rel:v.isGmailLink?"noopener noreferrer":void 0,onDoubleClick:k=>y(k,v),onTouchEnd:k=>g(k,v),children:v.value}):ae("span",{className:`wrap-break-word ${s.fg}`,children:v.value}),v.isGmailLink?ae("span",{className:`mt-1 block ${R} ${s.fgMuted}`,children:i.popupGmailHint}):null]}),ae(Gr,{value:v.value,ariaLabel:i.copyField(v.label)})]})]})},`${v.fieldKey}-${v.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 On}from"react/jsx-runtime";var Zn,Yr=Ne(()=>{"use strict";ue();Ee();Zn=({fullName:e,title:t="-",companyName:n="-",department:a="-",phoneNumber:i="-",email:o="-",updatedAtText:r="-"})=>On("div",{className:`flex h-full w-full flex-col justify-center gap-0.5 ${s.fg} text-xs leading-tight transition-colors @min-[640px]/aqcm-root:grid @min-[640px]/aqcm-root:grid-cols-3 @min-[640px]/aqcm-root:gap-2 @min-[640px]/aqcm-root:text-sm @min-[1280px]/aqcm-root:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[On("div",{className:"flex items-center gap-1 @min-[640px]/aqcm-root: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 @min-[640px]/aqcm-root:hidden",children:_e("div",{className:`flex-1 truncate ${s.fgSecondary} text-xs leading-tight`,children:n})}),_e("div",{className:"block @min-[640px]/aqcm-root:hidden",children:_e("span",{className:`w-full truncate text-left ${wt} ${s.fgSecondary} leading-tight`,children:a})}),On("div",{className:"hidden flex-col gap-0.5 truncate @min-[640px]/aqcm-root:flex",children:[_e("span",{className:`truncate font-medium ${s.fg}`,children:e}),_e("span",{className:`truncate ${s.fgMuted} text-xs`,children:t})]}),On("div",{className:"hidden flex-col gap-0.5 truncate @min-[640px]/aqcm-root:flex",children:[_e("span",{className:`truncate ${s.fg}`,children:n}),_e("span",{className:`truncate ${s.fgMuted} text-xs`,children:a})]}),On("div",{className:"hidden flex-col gap-0.5 truncate @min-[640px]/aqcm-root: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} @min-[1280px]/aqcm-root: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 Qa,as,os,is,ss,Ja,Za,ls,cs,ds,us,ms,ps,fs,gs,eo,to,Xa,Ya,er,hs,ys,Qr,no,Jr=Ne(()=>{"use strict";Qa=/[​]/g,as=/^[\s  ]+|[\s  ]+$/g,os=/\s+/,is=/^[\p{Script=Latin}\s]+$/u,ss=/\p{Script=Latin}/u,Ja=Object.freeze({convertWidth:!0,convertKana:!0,convertCase:!0,convertRomaji:!1,normalizeVariants:!1,ignoreSpaces:!1,ignoreSymbols:!1,ignoreLongVowels:!1}),Za="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(Qa,"").replace(as,""),Ja),gs=e=>{if(!is.test(e))return null;let t=rs(e);return ss.test(t)?null:t},eo=e=>e.split(os).filter(Boolean),to=e=>es(e,Za).sets.map(({query:t})=>t),Xa=e=>to(e).flatMap(t=>eo(t)),Ya=e=>Zi({combine:Za,sets:Array.from(new Set(e),t=>({query:t}))}),er=e=>{let t=to(e.replace(Qa,"")).map(a=>eo(fs(a)).join(" ")).filter(a=>a!==""),n=[];for(let a of t){let i=gs(a);if(i===null)return Ya(t);n.push(i)}return Ya(n)},hs=e=>{let t=new Set([...Xa(e),...Xa(er(e))]),n=new Set;for(let a of t)for(let i of ts(a,Ja)){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")},no=(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 d of i)a(d.item)?o.push(d):r.push(d);return[...o,...r]}}});import{memo as bs}from"react";import{Fragment as Zr,jsx as tr}from"react/jsx-runtime";var Ss,xe,nr=Ne(()=>{"use strict";Jr();ue();Ss=`rounded ${Pt.mark} px-1 ${s.fg}`,xe=bs(({text:e,query:t,enabled:n=!0})=>{if(!(n&&t?.trim()&&e))return tr(Zr,{children:e});let a=Qr(t);if(a===null)return tr(Zr,{children:e});let i=[],o=0,r=a.exec(e),d=0;for(;r;){let l=r[0],p=r.index;if(p>o&&i.push(e.substring(o,p)),l.length===0){a.lastIndex++,r=a.exec(e);continue}i.push(tr("mark",{className:Ss,children:l},`highlight-${p}-${d}`)),o=p+l.length,d+=1,r=a.exec(e)}return o<e.length&&i.push(e.substring(o)),tr(Zr,{children:i})});xe.displayName="HighlightedText"});var ao={};yi(ao,{ContactDetailGrid:()=>ro,default:()=>Cs});import{useMemo as ea}from"react";import{Fragment as vs,jsx as ta,jsxs as xs}from"react/jsx-runtime";var rr,ro,Cs,oo=Ne(()=>{"use strict";Ht();ge();Xr();Yr();nr();rr=e=>{let t=typeof e=="string"?e.trim():"";return t.length>0?t:null},ro=({contactData:e,searchTerm:t,enableHighlighting:n,openEmailsWithGmail:a,openGmailCompose:i,isPopupVisible:o,onRequestClose:r})=>{let d=ee(),l=ea(()=>sn(e),[e]),p=ea(()=>ln(e),[e]),m=l.value??"-",f=p.value??"-",c=ea(()=>rt(e.updated_at,d.recordDateTime),[e.updated_at,d.recordDateTime]),h=rr(e.full_name)??d.noName,b=rr(e.company_name),S=rr(e.department),T=(N,U="-")=>ta(xe,{text:N??U,query:t,enabled:n});return xs(vs,{children:[ta(Zn,{fullName:T(h),title:T(rr(e.title)),companyName:T(b),department:T(S),phoneNumber:f,email:T(m),updatedAtText:c}),o?ta(Jn,{contactData:e,openEmailsWithGmail:a,openGmailCompose:i,onRequestClose:r}):null]})},Cs=ro});ge();ue();Ee();import{DEFAULT_FUZZY_SEARCH_OPTIONS as un}from"@aiquants/fuzzy-search";import{memo as Oi,useId as Va}from"react";import{jsx as at,jsxs as St}from"react/jsx-runtime";var Vr=Oi(({searchOptions:e,setSearchOptions:t})=>{let n=ee(),a=`flex flex-col gap-1 rounded-md border ${E.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=Va(),r=Va(),d=[];return d.push(St("div",{className:`${a} ${$.sky} border-l-4`,children:[St("div",{className:`${i} ${u.sky}`,children:["\u{1F4D8} ",n.advancedLearningHeading]}),at("label",{htmlFor:o,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.advancedLearningLabel}),at("input",{id:o,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.learningWeight||un.learningWeight,onChange:l=>t(p=>({...p,learningWeight:parseFloat(l.target.value)})),className:"h-11 w-full"}),St("span",{className:`${u.sky} text-xs`,children:[n.currentValueLabel," ",e.learningWeight||un.learningWeight]}),at("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.advancedLearningHint})]},"learning")),d.push(St("div",{className:`${a} ${$.indigo} border-l-4`,children:[St("div",{className:`${i} ${u.indigo}`,children:["\u23F1\uFE0F ",n.advancedDebounceHeading]}),at("label",{htmlFor:r,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.advancedDebounceLabel}),at("input",{id:r,type:"range",min:"100",max:"1000",step:"50",value:e.debounceMs??un.debounceMs,onChange:l=>t(p=>({...p,debounceMs:parseInt(l.target.value,10)})),className:"h-11 w-full"}),St("span",{className:`${u.indigo} text-xs`,children:[n.currentValueLabel," ",e.debounceMs??un.debounceMs]}),at("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.advancedDebounceHint})]},"debounce")),St("section",{className:"space-y-3",children:[St("div",{className:"flex items-center justify-between gap-3",children:[St("div",{className:`flex items-center gap-2 font-semibold ${s.fgSecondary} text-xs transition-colors`,children:[at("span",{children:"\u26A1"}),at("span",{className:"tracking-wide",children:n.settingsAdvancedTab})]}),at("button",{type:"button",onClick:()=>t(l=>({...l,learningWeight:un.learningWeight,debounceMs:un.debounceMs})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${F.borderControl} ${E.muted} px-2 font-medium ${s.fgSecondary} ${x} transition-colors ${M.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),at("div",{className:"grid grid-cols-1 gap-2 @min-[640px]/aqcm-root:grid-cols-2",children:d})]})});Vr.displayName="AdvancedSearchSettings";ge();ue();Ee();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Vt}from"@aiquants/fuzzy-search";import{memo as $i,useId as ot}from"react";import{jsx as ie,jsxs as me}from"react/jsx-runtime";var Kr=$i(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:i,setOpenEmailsWithGmail:o})=>{let r=ee(),d=`flex flex-col gap-1 rounded-md border ${E.surface} px-2 py-1 shadow-sm transition-colors`,l="text-xs font-semibold",p=ot(),m=ot(),f=ot(),c=ot(),h=ot(),b=ot(),S=ot(),T=ot(),N=ot(),U=ot(),O=[];return O.push(me("div",{className:`${d} ${$.blue} border-l-4`,children:[me("div",{className:`${l} ${u.blue}`,children:["\u{1F3AF} ",r.basicThresholdHeading]}),ie("label",{htmlFor:p,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicThresholdLabel}),ie("input",{id:p,type:"range",min:"0.0",max:e.sortBy==="relevance"?"1.5":"1.0",step:"0.05",value:e.threshold??Vt.threshold,onChange:y=>t(g=>({...g,threshold:parseFloat(y.target.value)})),className:"h-11 w-full"}),me("span",{className:`${u.blue} text-xs`,children:[r.currentValueLabel," ",e.threshold??Vt.threshold]}),ie("p",{className:`${R} ${s.fgMuted} transition-colors`,children:e.sortBy==="relevance"?r.basicThresholdRangeRelevance:r.basicThresholdRange})]},"threshold")),O.push(me("div",{className:`${d} ${$.amber} border-l-4`,children:[me("div",{className:`${l} ${u.amber}`,children:["\u{1FA84} ",r.basicDisplayHeading]}),me("label",{htmlFor:m,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[ie("input",{id:m,type:"checkbox",checked:e.caseSensitive??Vt.caseSensitive,onChange:y=>t(g=>({...g,caseSensitive:y.target.checked})),className:"h-3 w-3"}),r.basicCaseSensitive]}),me("label",{htmlFor:f,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[ie("input",{id:f,type:"checkbox",checked:n,onChange:y=>a(y.target.checked),className:"h-3 w-3"}),r.basicHighlight]}),me("label",{htmlFor:c,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[ie("input",{id:c,type:"checkbox",checked:i,onChange:y=>o(y.target.checked),className:"h-3 w-3"}),r.basicOpenEmailsWithGmail]}),me("div",{className:"flex flex-col gap-1",children:[ie("label",{htmlFor:h,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicMultiTermOperator}),me("select",{id:h,value:e.multiTermOperator??Vt.multiTermOperator,onChange:y=>t(g=>({...g,multiTermOperator:y.target.value})),className:`min-h-11 rounded border ${F.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${E.surface} ${s.fg}`,children:[ie("option",{value:"or",children:r.basicOperatorOr}),ie("option",{value:"and",children:r.basicOperatorAnd})]}),ie("p",{className:`${R} ${s.fgMuted} transition-colors`,children:r.basicMultiTermHint})]})]},"display")),O.push(me("div",{className:`${d} ${$.emerald} border-l-4`,children:[me("div",{className:`${l} ${u.emerald}`,children:["\u{1F4DA} ",r.basicSortHeading]}),me("div",{className:"flex flex-col gap-2",children:[ie("label",{htmlFor:b,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicSortBy}),me("select",{id:b,value:e.sortBy||Vt.sortBy,onChange:y=>t(g=>({...g,sortBy:y.target.value})),className:`min-h-11 rounded border ${F.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${E.surface} ${s.fg}`,children:[ie("option",{value:"score",children:r.basicSortByScore}),ie("option",{value:"relevance",children:r.basicSortByRelevance}),ie("option",{value:"original",children:r.basicSortByOriginal})]})]}),me("div",{className:"flex flex-col gap-2",children:[ie("label",{htmlFor:S,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicSortOrder}),me("select",{id:S,value:e.sortOrder||Vt.sortOrder,onChange:y=>t(g=>({...g,sortOrder:y.target.value})),className:`min-h-11 rounded border ${F.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${E.surface} ${s.fg}`,children:[ie("option",{value:"desc",children:r.basicSortDescending}),ie("option",{value:"asc",children:r.basicSortAscending})]})]})]},"sorting")),O.push(me("div",{className:`${d} ${$.purple} border-l-4`,children:[me("div",{className:`${l} ${u.purple}`,children:["\u2699\uFE0F ",r.basicEngineHeading]}),ie("label",{htmlFor:T,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:r.basicStrategy}),me("select",{id:T,value:e.parallelSearchStrategy||Vt.parallelSearchStrategy,onChange:y=>t(g=>({...g,parallelSearchStrategy:y.target.value})),className:`min-h-11 rounded border ${F.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${E.surface} ${s.fg}`,children:[ie("option",{value:"balanced",children:r.basicStrategyBalanced}),ie("option",{value:"index-first",children:r.basicStrategyIndexFirst}),ie("option",{value:"levenshtein-first",children:r.basicStrategyLevenshteinFirst})]}),me("div",{className:"mt-2 space-y-2",children:[me("label",{htmlFor:N,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[ie("input",{id:N,type:"checkbox",checked:e.enableIndexFiltering!==!1,onChange:y=>t(g=>({...g,enableIndexFiltering:y.target.checked})),className:"h-3 w-3"}),r.basicIndexFiltering]}),me("label",{htmlFor:U,className:`flex min-h-11 items-center gap-2 ${s.fgSecondary} ${x} transition-colors`,children:[ie("input",{id:U,type:"checkbox",checked:e.enableLevenshtein!==!1,onChange:y=>t(g=>({...g,enableLevenshtein:y.target.checked})),className:"h-3 w-3"}),r.basicLevenshtein]})]})]},"engine")),me("section",{className:"space-y-3",children:[me("div",{className:`flex items-center gap-2 font-semibold ${u.blue} text-xs transition-colors`,children:[ie("span",{children:"\u{1F527}"}),ie("span",{className:"tracking-wide",children:r.settingsBasicTab})]}),ie("div",{className:"grid grid-cols-1 gap-2 @min-[640px]/aqcm-root:grid-cols-2 @min-[1280px]/aqcm-root:grid-cols-3 @min-[1536px]/aqcm-root:grid-cols-4",children:O})]})});Kr.displayName="BasicSearchSettings";Ht();import{SWIPE_OVERLAY_SCROLL_AREA_STYLE as Ts}from"@aiquants/swipe-overlay";import Ns from"lucide-react/dist/esm/icons/badge-check.js";import Es from"lucide-react/dist/esm/icons/building-2.js";import Ms 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 Rs from"lucide-react/dist/esm/icons/id-card.js";import Ps from"lucide-react/dist/esm/icons/mail.js";import ws 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 Os,useMemo as ra,useRef as $s,useState as Ds}from"react";var st={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();ue();ue();_n();import*as Ye from"@radix-ui/react-tabs";import*as ar from"react";import{jsx as na}from"react/jsx-runtime";var or=Ye.Root,$n=ar.forwardRef(({className:e,...t},n)=>na(Ye.List,{ref:n,className:ke(`inline-flex h-10 items-center justify-center rounded-md ${E.muted} p-1 ${s.fgMuted}`,e),...t}));$n.displayName=Ye.List.displayName;var Kt=ar.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 ${M.ringOffsetSurface} transition-all focus-visible:outline-hidden focus-visible:ring-2 ${M.focusVisibleRing} focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 ${M.activeTabSurface} ${M.activeTabFg} data-[state=active]:shadow-2xs`,e),...t}));Kt.displayName=Ye.Trigger.displayName;var jt=ar.forwardRef(({className:e,...t},n)=>na(Ye.Content,{ref:n,className:ke(`mt-2 ${M.ringOffsetSurface} focus-visible:outline-hidden focus-visible:ring-2 ${M.focusVisibleRing} focus-visible:ring-offset-2 data-[state=inactive]:hidden`,e),...t}));jt.displayName=Ye.Content.displayName;pn();Ee();nr();import{jsx as P,jsxs as Se}from"react/jsx-runtime";var io=`truncate font-semibold ${s.fg} ${x}`,Ws=({icon:e,label:t,value:n,fieldKey:a,copyValue:i,onCopy:o,isCopied:r,linkHref:d,searchTerm:l,enableHighlighting:p})=>{let m=ee(),f=!!(o&&a&&i),c=d?.startsWith("https://mail.google.com")?"_blank":void 0;return Se("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${F.borderSubtle} ${E.subtle} px-2.5 py-1.5 transition-colors`,children:[Se("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[P("div",{className:`flex h-7 w-7 items-center justify-center rounded-full ${E.surface} ${s.fgMuted} transition-colors`,children:P(e,{size:14})}),Se("div",{className:"min-w-0 flex-1",children:[P("div",{className:`font-medium ${R} ${s.fgMuted}`,children:t}),d?P("a",{href:d,className:`align-top ${io} ${mn}`,target:c,rel:c?"noopener noreferrer":void 0,children:P(xe,{text:n,query:l??"",enabled:p})}):P("div",{className:io,children:P(xe,{text:n,query:l??"",enabled:p})})]})]}),f?P("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 ${F.borderControl} ${E.surface} ${s.fgMuted} transition-colors ${M.hoverBlueAccentBorder} ${M.hoverBlueFg} ${it}`,"aria-label":m.copyField(t),children:r?P(Ls,{size:14}):P(ks,{size:14})}):null]})},so=({items:e,searchTerm:t,enableHighlighting:n})=>P("dl",{className:"grid grid-cols-1 gap-x-3 gap-y-1.5 @min-[640px]/aqcm-root:grid-cols-2",children:e.map(a=>Se("div",{className:`flex flex-col gap-0.5 rounded-md border ${F.borderSubtle} ${E.surface} px-2 py-1 transition-colors`,children:[P("dt",{className:`font-semibold ${R} ${s.fgMuted} uppercase tracking-wide`,children:a.label}),P("dd",{className:`wrap-break-word ${s.fg} text-xs`,children:P(xe,{text:a.value,query:t??"",enabled:n})})]},a.fieldKey))}),aa=({title:e})=>P("h3",{className:`font-semibold ${s.fgSecondary} text-xs`,children:e}),Is=()=>{let e=ee();return Se("div",{className:`flex h-full min-h-40 w-full flex-1 flex-col items-center justify-center gap-2 rounded-xl border ${F.borderSubtle} border-dashed ${E.surface} p-4 text-center transition-colors`,children:[P("p",{className:`font-medium ${s.fgMuted} text-xs`,children:e.detailEmptyTitle}),P("p",{className:`${R} ${s.fgMuted}`,children:e.detailEmptyHint})]})},Fs=Object.freeze({overlay:Ts,pane:void 0}),yn=({contact:e,placement:t,searchTerm:n,enableHighlighting:a,style:i,className:o=""})=>{let r=ee(),[d,l]=Ds(null),p=$s(null);Os(()=>()=>{p.current!==null&&window.clearTimeout(p.current)},[]);let m=ra(()=>sn(e),[e]),f=ra(()=>ln(e),[e]),c=ra(()=>rt(e?.contacted_at,r.recordDateTime),[e?.contacted_at,r.recordDateTime]),h=As(async(C,L,_)=>{try{await navigator.clipboard.writeText(L),l(C),p.current!==null&&window.clearTimeout(p.current),p.current=window.setTimeout(()=>{l(null)},2e3)}catch(V){st.error("Failed to copy contact detail",V)}},[]);if(!e)return P("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${F.borderSubtle} ${E.surface} shadow-sm transition-colors`,children:P(Is,{})});let b=[re(e.title),re(e.department)].filter(C=>C!=="-"),S=[b.join(" / "),re(e.company_name)].filter(C=>C&&C!=="-").join(" \u30FB ")||"-",T=qe(e.full_name)??r.noName,N=[{fieldKey:"full_name",label:r.fieldFullName,value:T},{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)}],U=[{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(C=>C.value!=="-"),O=[{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(C=>C.value!=="-"),y=[{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:rt(e.created_at,r.recordDateTime)},{fieldKey:"updated_by",label:r.fieldUpdatedBy,value:re(e.updated_by)},{fieldKey:"updated_at",label:r.fieldUpdatedAt,value:rt(e.updated_at,r.recordDateTime)}],g=[{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:m.value??"-",fieldKey:"primary_email",copyValue:m.value,linkHref:ht(m.value,!1)},{rowKey:"primary_phone",icon:ws,label:r.summaryPhone,value:f.value??"-",fieldKey:"primary_phone",copyValue:f.value,linkHref:Pn(f.value)},{rowKey:"contacted_at",icon:Ms,label:r.summaryLastContact,value:c}],v=[{sectionKey:"email",title:r.sectionEmail,emptyText:r.sectionEmailEmpty,entries:U,recommendedKey:m.fieldKey??null,resolveHref:C=>ht(C!=null?String(C):null,!1)},{sectionKey:"phone",title:r.sectionPhone,emptyText:r.sectionPhoneEmpty,entries:O,recommendedKey:f.fieldKey??null,resolveHref:C=>Pn(C!=null?String(C):null)}],k=[{value:"summary",label:r.detailTabSummary,content:Se("div",{className:"flex flex-col gap-4",children:[Se("div",{className:"flex flex-col gap-1",children:[Se("div",{className:`flex items-center gap-2 ${s.fgMuted} text-sm`,children:[P(Es,{size:16}),P("span",{children:P(xe,{text:re(e.company_name),query:n??"",enabled:a})})]}),b.length>0?P("div",{className:`${s.fgMuted} text-sm`,children:b.map((C,L)=>Se("span",{children:[L>0&&" / ",P(xe,{text:C,query:n??"",enabled:a})]},`header-line-${L}`))}):null]}),P("div",{className:"flex flex-col gap-3",children:g.map(C=>P(Ws,{icon:C.icon,label:C.label,value:C.value,fieldKey:C.fieldKey,copyValue:C.copyValue,onCopy:h,isCopied:C.fieldKey?d===C.fieldKey:!1,linkHref:C.linkHref,searchTerm:n,enableHighlighting:a},C.rowKey))})]})},{value:"basic",label:r.detailTabBasic,content:Se("div",{className:"flex flex-col gap-3",children:[P(aa,{title:r.detailBasicProfile}),P(so,{items:N,searchTerm:n,enableHighlighting:a})]})},{value:"contact",label:r.detailTabContact,content:P("div",{className:"flex flex-col gap-4",children:v.map(({sectionKey:C,title:L,emptyText:_,entries:V,recommendedKey:Q,resolveHref:Ce})=>Se("div",{className:"flex flex-col gap-2",children:[P(aa,{title:L}),V.length===0?P("p",{className:`${s.fgMuted} text-xs`,children:_}):P("div",{className:"flex flex-col gap-2",children:V.map(q=>{let W=Ce(q.rawValue),K=q.fieldKey===Q;return Se("div",{className:`flex items-center justify-between gap-2 rounded-lg border ${F.borderSubtle} ${E.surface} px-3 py-2 transition-colors`,children:[Se("div",{className:"min-w-0 flex-1",children:[P("div",{className:`font-medium ${s.fgMuted} text-xs`,children:q.label}),P("div",{className:`wrap-break-word ${s.fg} text-sm`,children:W?P("a",{href:W,className:`text-inherit ${mn}`,children:P(xe,{text:q.value,query:n??"",enabled:a})}):P(xe,{text:q.value,query:n??"",enabled:a})})]}),K?Se("span",{className:`inline-flex shrink-0 items-center gap-1 rounded-full ${Z.emerald} px-2 py-0.5 font-semibold ${R} ${u.emerald} transition-colors`,children:[P(Ns,{size:14}),r.preferred]}):null]},q.fieldKey)})})]},C))})},{value:"meta",label:r.detailTabMeta,content:Se("div",{className:"flex flex-col gap-3",children:[P(aa,{title:r.detailTabMeta}),P(so,{items:y,searchTerm:n,enableHighlighting:a})]})}];return Se("div",{className:`flex h-full min-h-0 w-full flex-col overflow-hidden rounded-xl border ${F.borderSubtle} ${E.surface} shadow-sm transition-colors ${o}`.trim(),style:i,children:[P("div",{className:`${F.borderSubtle} border-b px-3 py-1.5 transition-colors ${E.subtle}`,children:Se("div",{className:"flex items-center gap-2",children:[P("div",{className:`flex h-8 w-8 items-center justify-center rounded-full ${Z.blue} ${u.blue} transition-colors`,children:P(_s,{size:16})}),Se("div",{className:"min-w-0 flex-1",children:[P("div",{className:`truncate font-semibold ${s.fg} text-sm`,children:P(xe,{text:T,query:n??"",enabled:a})}),P("div",{className:`truncate ${R} ${s.fgMuted}`,children:P(xe,{text:S,query:n??"",enabled:a})})]})]})}),Se(or,{defaultValue:"summary",className:"flex flex-1 flex-col overflow-hidden",children:[P($n,{className:`grid h-auto grid-cols-4 gap-1 rounded-none ${F.borderSubtle} border-b ${E.subtle} px-2 py-1 transition-colors`,children:k.map(C=>P(Kt,{value:C.value,className:`flex min-h-11 min-w-0 touch-manipulation rounded-md px-1 py-1 font-semibold ${s.fgSecondary} ${x} transition-colors ${M.activeTabSurface} ${M.activeTabBlueFg}`,children:P("span",{className:"min-w-0 truncate",children:C.label})},C.value))}),k.map(C=>P(jt,{value:C.value,className:`scrollbar-thin flex-1 overflow-y-auto px-2.5 py-2 transition-colors ${s.fgSecondary}`,style:Fs[t],children:C.content},C.value))]})]})};zt();ge();ue();import{memo as Hs}from"react";import{jsx as _t,jsxs as oa}from"react/jsx-runtime";var ia=Hs(({recordCount:e,companyCount:t,phase:n,loadedCount:a,totalCount:i})=>{let{locale:o,labels:r}=we(),d=ne(o,e),l=ne(o,t);return oa("div",{"data-testid":"contact-map-annotation",className:"flex flex-wrap items-center gap-2 leading-1 transition-colors",children:[oa("span",{className:"flex items-baseline gap-1",children:[_t("span",{className:s.fgMuted,children:r.annotationTotalLabel}),_t("span",{className:s.fg,"data-testid":"contact-map-record-count",children:d}),_t("span",{className:s.fgMuted,children:r.recordUnit(d)})]}),oa("span",{className:"flex items-baseline gap-1",children:[_t("span",{className:s.fgMuted,children:r.annotationCompaniesLabel}),_t("span",{className:s.fg,"data-testid":"contact-map-company-count",children:l}),_t("span",{className:s.fgMuted,children:r.companyUnit(l)})]}),n==="streaming"||n==="idle"?_t("span",{"data-testid":"contact-map-stream-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${Z.blue} px-2 py-0.5 font-medium ${u.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"?_t("span",{"data-testid":"contact-map-reconnecting-badge",className:`ml-2 inline-flex items-center gap-1.5 rounded-full ${Z.amber} px-2 py-0.5 font-medium ${u.amber} text-xs`,children:r.annotationReconnecting(a)}):null]})});ia.displayName="ContactMapAnnotation";dn();import{useMemo as fi}from"react";yt();var ir=e=>e==="unauthenticated"||e==="forbidden";function sr(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 ${Y(e)}`)}function lo(e,t){if(typeof e!="number")throw new TypeError(`[contact-map] ${t} must be the stream's accessFailureNumber (a number); got ${Y(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 ${Y(e)}`)}yt();dn();ge();import{createContext as zs,useContext as Us,useMemo as Vs}from"react";yt();dn();Dr();var Bs=["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 ${Y(n)}`);if(n.trim()==="")throw new RangeError(`[contact-map] ${e}.${t} must not be empty or blank; got ${Y(n)}`)}}var uo={setting:"workerUrls"},mo=(e,t)=>{if(e===void 0)return;let{setting:n,keys:a=Bs,hints:i={}}=t;if(!cn(e))throw new TypeError(`[contact-map] ${n} must be a plain object or left out; got ${Y(e)}`);let o=Object.getOwnPropertyNames(e).map(l=>({key:l,url:e[l]})),r=o.find(({key:l,url:p})=>p!==void 0&&!a.includes(l));if(r!==void 0){let l=Object.hasOwn(i,r.key)?i[r.key]:void 0,p=l===void 0?Kn(r.key,a):void 0;throw new RangeError(`[contact-map] ${n} has a key it does not take (it takes ${a.join(", ")}${l===void 0?"":`; ${l}`}${p===void 0?"":`; did you mean ${JSON.stringify(p)}?`}); got ${Y(r.key)}`)}let d=Object.create(null);for(let{key:l,url:p}of o){let m=l;co(n,m,p),p!==void 0&&(d[m]=p)}return d};function $m(e,t=uo){mo(e,t)}function po(e){co("workerUrls","treeWorker",e)}var bn=(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 sa}from"react/jsx-runtime";var fo=e=>{if(!cn(e))throw new TypeError(`[contact-map] config must be a plain object; got ${Y(e)}`);let t=e;return{streamEndpoint:Le(t,"streamEndpoint"),openEmailsWithGmail:Le(t,"openEmailsWithGmail"),treeWorkerFactory:Le(t,"treeWorkerFactory"),workerUrls:bn(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})}))},Ks=go(fo({})),ho=zs(Ks),js=Object.freeze({locale:"locale",labels:"labels"});function la({config:e,chromeSurface:t,children:n}){let{streamEndpoint:a,openEmailsWithGmail:i,treeWorkerFactory:o,workerUrls:r,locale:d,labels:l}=fo(e),{indexWorker:p,levenshteinWorker:m,treeWorker:f}=r,c=Vs(()=>go({streamEndpoint:a,openEmailsWithGmail:i,treeWorkerFactory:o,workerUrls:{indexWorker:p,levenshteinWorker:m,treeWorker:f},locale:d,labels:l}),[a,i,o,p,m,f,d,l]);return sa(ho.Provider,{value:c,children:sa(Ba,{locale:d,labels:l,surface:t,children:n})})}function qs({config:e,children:t}){return sa(la,{config:e,chromeSurface:js,children:t})}function Ct(){return Us(ho)}import{useCallback as ca,useEffect as el,useMemo as dr,useSyncExternalStore as yo}from"react";yt();import{accessFailureKindOfStatus as Gs}from"@aiquants/auth-core";var Xs=1e3,Ys=3e4,Qs=6;function cr(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 ${Y(e)}`);if(/[\s\p{Cc}#]/u.test(e))throw new RangeError(`[contact-map] streamEndpoint must not contain whitespace, control characters or "#"; got ${Y(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 ${Y(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),lr=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?.()};cr(t.endpoint),this.fetchFn=t.fetchFn??((...n)=>fetch(...n)),this.endpoint=t.endpoint,this.initialRetryDelayMs=t.initialRetryDelayMs??Xs,this.maxRetryDelayMs=t.maxRetryDelayMs??Ys,this.maxConsecutiveFailures=t.maxConsecutiveFailures??Qs,this.logger=t.logger??st}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=Gs(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,d=!1;for(;;){let{done:l,value:p}=await a.read();if(l)break;let m=i.decode(p,{stream:!0}),f=(o+m).split(`
2
2
  `);o=f.pop()??"";let c=!1;for(let h of f){let b=h.trim();if(!b)continue;let S;try{S=JSON.parse(b)}catch(T){this.logger.warn("[ContactMapStream] failed to parse NDJSON line:",T);continue}if("type"in S&&S.type==="METADATA"){Number.isSafeInteger(S.total)&&S.total>=0&&this.setState({totalCount:S.total});continue}if(!Zs(S)){this.logger.warn("[ContactMapStream] server reported error:","error"in S?S.error:""),d=!0;continue}for(let T of S.records)T&&typeof T.person_id=="number"&&(this.recordMap.set(T.person_id,Js(T)),c=!0);S.nextCursor&&(this.lastCursor=S.nextCursor),S.isLast&&(r=!0)}c&&(this.consecutiveFailures=0,this.publishRecords({error:null}))}return d?(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(cr(e),Qe===null)return Qe=new lr({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},nl=new Map,rl={records:[],loadedCount:0,totalCount:null,isLoading:!0,isComplete:!1,phase:"idle",error:null,accessFailureNumber:0},al=()=>{let{streamEndpoint:e}=Ct();return dr(()=>(cr(e),e),[e])};function ol(){let e=al(),t=ca(()=>tl(e),[e]);el(()=>{let r=t();r.start(),r.retryNow()},[t]);let n=ca(r=>t().subscribe(r),[t]),a=yo(n,()=>t().getState(),()=>rl),i=yo(n,()=>t().getRecordMap(),()=>nl),o=ca(()=>t().retryNow(),[t]);return dr(()=>({...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 ur(){let{records:e,recordMap:t,isComplete:n,phase:a,loadedCount:i,totalCount:o,error:r,accessFailureNumber:d,retryNow:l}=ol(),p=dr(()=>il(e),[e]);return{context:dr(()=>({contactMapRecords:e,contactMapRecordMap:t,isStreamingComplete:n,isStreamingFailed:a==="failed"||ir(a),streamPhase:a,streamAccessFailureNumber:d,loadedCount:i,companyCount:p,totalCount:o,errorMessage:r?.message??null}),[e,t,n,a,d,i,p,o,r]),retryNow:l}}ge();var At="@container/aqcm-root";import{DEFAULT_FUZZY_SEARCH_OPTIONS as Zc,parseQuerySets as ed}from"@aiquants/fuzzy-search";import{useFuzzySearch as td}from"@aiquants/fuzzy-search/react";import nd from"lucide-react/dist/esm/icons/search.js";import{useCallback as En,useEffect as xt,useMemo as $t,useRef as si,useState as tt,useTransition as rd}from"react";import{useNavigation as ad,useSearchParams as od}from"react-router";Jr();dn();import{useCallback as qt,useEffect as sl,useRef as bo}from"react";var Ot=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=qt(f=>{let c=f.currentTarget,h=f.deltaY;!c||h===0||(f.preventDefault(),c.scrollBy({left:h,behavior:"smooth"}))},[]),o=qt(f=>{t.current?.removeEventListener("wheel",i),t.current=f,f?.addEventListener("wheel",i,{passive:!1})},[i]);sl(()=>()=>{t.current&&t.current.removeEventListener("wheel",i)},[i]);let r=qt(f=>{if(f.pointerType==="touch")return;let c=n.current;c.isPointerDown=!0,c.isDragging=!1,c.startX=f.clientX,c.scrollLeft=f.currentTarget.scrollLeft,c.pointerId=f.pointerId,c.hasCapture=!1,c.pointerType=f.pointerType},[]),d=qt(f=>{let c=n.current;if(!c.isPointerDown||c.pointerType==="touch")return;let h=f.currentTarget,b=f.clientX-c.startX;!c.isDragging&&Math.abs(b)>a&&(c.isDragging=!0,c.hasCapture||(h.setPointerCapture?.(f.pointerId),c.hasCapture=!0)),c.isDragging&&(f.preventDefault(),h.scrollLeft=c.scrollLeft-b)},[a]),l=qt(f=>{let c=n.current;if(c.pointerType==="touch")return;let h=f.currentTarget;c.isPointerDown&&c.hasCapture&&h.hasPointerCapture?.(f.pointerId)&&h.releasePointerCapture(f.pointerId),c.isDragging&&(c.didDrag=!0,window.setTimeout(()=>{c.didDrag=!1},0)),c.isPointerDown=!1,c.isDragging=!1,c.pointerId=0,c.hasCapture=!1},[]),p=qt(f=>{l(f)},[l]),m=qt(f=>{n.current.didDrag&&(f.preventDefault(),f.stopPropagation(),n.current.didDrag=!1)},[]);return{setScrollableRef:o,onPointerDown:r,onPointerMove:d,onPointerUp:p,onPointerLeave:p,onPointerCancel:p,onClickCapture:m}};zt();ge();import{DEFAULT_FUZZY_SEARCH_OPTIONS as ll}from"@aiquants/fuzzy-search";var cl="@aiquants/contact-map:search",mr=e=>{let{indexWorkerOptions:t,levenshteinWorkerOptions:n,...a}=ll;return{...a,autoSearchOnIndexRebuild:!1,multiTermOperator:"and",workerId:cl,workerUrls:e,indexWorkerOptions:{...t},levenshteinWorkerOptions:{...n}}};var dl="[data-contact-map-search-page]",ul="[data-contact-map-search-field]",So='[data-contact-map-page-tabs] [role="tab"][aria-selected="true"]',ml=[ul,So],pl="(pointer: coarse)",da=e=>e!==null&&typeof e.matchMedia=="function"&&e.matchMedia(pl).matches,Co=e=>{for(let t=e;t!==null;t=t.parentElement){let n=t.querySelector(dl);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=da(t.defaultView)?[So]:ml;for(let i of a){let o=e.querySelector(i);if(o!==null&&(o.focus(),t.activeElement===o))return o}return null};ue();ue();_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 ${Pt.progressTrack}`,n),...i,children:xo("div",{"data-slot":"progress-indicator",className:ke(`h-full rounded-full ${Ge.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 Sn="view";import{useCallback as Fc,useState as Hc}from"react";import{useSearchParams as Bc}from"react-router";ge();ue();Ee();Ht();import{Panel as wo,PanelGroup as Wl,PanelResizeHandle as Il}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as Fl,VirtualScroll as Hl,virtualScrollItemElementId as Bl}from"@aiquants/virtualscroll";import{lazy as zl,memo as Ul,Suspense as Vl,useCallback as Je,useEffect as Wo,useId as _o,useLayoutEffect as Kl,useMemo as Cn,useRef as Tr,useState as xr}from"react";yt();var No=35,Dn={listPanelMinWidth:320,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:No,twoColumnMinWidth:1024},Wn={listPanelMinWidth:280,detailPanelMinWidth:260,handleThickness:10,listPaddingAndBorder:0,detailPaddingAndBorder:0,scrollbarSafetyBuffer:20,hysteresisSafetyMargin:No,twoColumnMinWidth:768},fl=["listPanelMinWidth","detailPanelMinWidth","handleThickness","listPaddingAndBorder","detailPaddingAndBorder","scrollbarSafetyBuffer","hysteresisSafetyMargin","twoColumnMinWidth"],pr=e=>{for(let i of fl){let o=e[i];if(typeof o!="number")throw new TypeError(`[contact-map] ResponsiveLayoutSpec.${i} must be a number (CSS px); got ${Y(o)}`);if(!Number.isFinite(o)||o<0)throw new RangeError(`[contact-map] ResponsiveLayoutSpec.${i} must be a finite number of 0 or more (CSS px); got ${Y(o)}`)}let t=e.listPanelMinWidth+e.detailPanelMinWidth+e.handleThickness+e.listPaddingAndBorder+e.detailPaddingAndBorder,n=Math.max(t+e.scrollbarSafetyBuffer+e.hysteresisSafetyMargin,e.twoColumnMinWidth),a=n-e.hysteresisSafetyMargin;return{physicalMinWidth:t,collapseThreshold:a,expandThreshold:n,hysteresisWidth:e.hysteresisSafetyMargin}},Eo=(e,t,n)=>e<=0||!Number.isFinite(e)?!1:t?e>=n.collapseThreshold:e>=n.expandThreshold;import{useCallback as vt,useEffect as Mo,useRef as fr,useState as Lo}from"react";var gl=600,ko=8,gr=({ref:e,onSelect:t,resolveItem:n,item:a})=>{let[i,o]=Lo(!1),[r,d]=Lo(null),l=fr(null),p=fr(!1),m=fr(null),f=fr({onSelect:t,resolveItem:n,item:a});Mo(()=>{f.current={onSelect:t,resolveItem:n,item:a}},[t,n,a]);let c=vt(()=>{typeof window>"u"||l.current!==null&&(window.clearTimeout(l.current),l.current=null)},[]),h=vt(()=>{m.current&&(c(),m.current=null)},[c]),b=vt(g=>{typeof window>"u"||g.button!==0&&g.pointerType==="mouse"||(c(),p.current=!1,m.current={x:g.clientX,y:g.clientY,pointerId:g.pointerId},l.current=window.setTimeout(()=>{let v=f.current,k=null;v.item!==void 0?k=v.item:v.resolveItem&&g.target&&(k=v.resolveItem(g.target)),k!==null&&(p.current=!0,v.onSelect?.(k),d(k),o(!0)),h()},gl))},[c,h]),S=vt(g=>{m.current&&g.pointerId===m.current.pointerId&&(c(),m.current=null)},[c]),T=vt(g=>{p.current&&(g.preventDefault(),g.stopPropagation(),g.type==="click"&&(p.current=!1))},[]),N=vt(()=>{p.current=!1},[]),U=vt(g=>{if(!m.current||g.pointerId!==m.current.pointerId)return;let v=Math.abs(g.clientX-m.current.x),k=Math.abs(g.clientY-m.current.y);(v>ko||k>ko)&&(c(),m.current=null)},[c]),O=vt(g=>{(i||l.current!==null)&&(g.preventDefault(),g.stopPropagation())},[i]),y=vt(()=>{o(!1),d(null),p.current=!1,m.current=null},[]);return Mo(()=>{let g=e.current;if(!(g&&typeof window<"u"))return;let v=[["pointerdown",b,void 0],["pointerup",S,void 0],["pointercancel",S,void 0],["pointermove",U,void 0],["pointerleave",S,void 0],["contextmenu",O,void 0]],k=[["mousedown",T,!0],["mouseup",T,!0],["click",T,!0],["pointerdown",N,!0],["keydown",N,!0],["contextmenu",O,!0],["pointerup",S,!0],["pointercancel",S,!0]];for(let[C,L,_]of v)g.addEventListener(C,L,_);for(let[C,L,_]of k)window.addEventListener(C,L,_);return()=>{for(let[C,L,_]of v)g.removeEventListener(C,L,_);for(let[C,L,_]of k)window.removeEventListener(C,L,_);c()}},[e,b,S,U,T,N,O,c]),{isPopupVisible:i,popupItem:r,handleClosePopup:y}};import{useLayoutEffect as hl,useRef as yl,useState as bl}from"react";var hr=(e,t)=>{let[n,a]=bl(!1),i=yl(!1),{collapseThreshold:o,expandThreshold:r}=t;return hl(()=>{let d=e.current;if(d===null)return;let l=m=>{if(!(m>0&&Number.isFinite(m)))return;let f=Eo(m,i.current,{collapseThreshold:o,expandThreshold:r});f!==i.current&&(i.current=f,a(f))};l(d.getBoundingClientRect().width);let p=new ResizeObserver(m=>{for(let{borderBoxSize:f}of m){let[c]=f;c!==void 0&&l(c.inlineSize)}});return p.observe(d),()=>p.disconnect()},[e,o,r]),{isTwoColumn:n}};ge();yt();import{isInputMethodKey as Sl}from"@aiquants/input-method";var Ro=(e,t)=>{if(xl(t),e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||Sl(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 vl(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}},Cl=new Set(["ArrowDown","ArrowUp","PageDown","PageUp","Home","End"]),vl=e=>Cl.has(e),xl=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 ${Y(a)}`);if(!Number.isInteger(i)||i<1)throw new RangeError(`[contact-map] listbox pageSize must be an integer of at least 1; got ${Y(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 ${Y(n)}`);if(t!==null&&!o(t))throw new RangeError(`[contact-map] listbox activeIndex must be null or an index below ${a}; got ${Y(t)}`)};ue();ge();jr();ue();pn();_n();import{SWIPE_OVERLAY_SCROLL_AREA_STYLE as Tl,useOverlayPresence as Nl,useSwipeOverlayDialog as El}from"@aiquants/swipe-overlay";import{useCallback as Ml,useId as Ll}from"react";import{jsx as yr,jsxs as ua}from"react/jsx-runtime";var kl=ke(qn,"flex overflow-hidden"),Rl=ke(Xn,"motion-safe:transition-opacity motion-safe:duration-200"),Pl=`relative ml-auto flex h-full w-full max-w-lg flex-col ${E.surface} shadow-xl motion-safe:transition-[transform] motion-safe:duration-200 motion-safe:ease-out`,wl=`flex shrink-0 items-center justify-between gap-3 ${F.borderSubtle} border-b px-3 py-2`,_l=`min-w-0 truncate font-semibold text-base ${s.fg} outline-none`,Al=`inline-flex min-h-11 min-w-11 shrink-0 touch-manipulation items-center justify-center rounded-full border ${F.borderControl} px-4 font-medium ${s.fgSecondary} text-sm ${M.hoverMuted} ${it}`,Ol="flex min-h-0 flex-1 flex-col overflow-y-auto p-3",br=({isOpen:e,onClose:t,children:n,className:a,title:i})=>{let o=ee(),r=Ll(),d=Nl(e),l=Ml(b=>b.ownerDocument.getElementById(r),[r]),{dialogProps:p,backdropProps:m,panelProps:f,attemptClose:c,isSwiping:h}=El({isOpen:e,onClose:t,isCloseBlocked:Yn,skipWhenTextSelected:!0,initialFocus:l});return d?ua("dialog",{...p,"data-testid":"contact-map-mobile-overlay","aria-labelledby":r,className:ke(kl,e&&!h?"pointer-events-auto":"pointer-events-none"),style:Gn,children:[yr("div",{...m,"data-contact-map-overlay-backdrop":"",className:ke(Rl,e?"opacity-100":"opacity-0")}),ua("div",{...f,"data-contact-map-overlay-panel":"",className:ke(Pl,e?"pointer-events-auto":"pointer-events-none",a),children:[ua("div",{className:wl,children:[yr("h2",{id:r,tabIndex:-1,className:_l,children:i===void 0?o.overlayTitle:i}),yr("button",{type:"button",className:Al,onClick:()=>c(),children:o.close})]}),yr("div",{"data-contact-map-overlay-body":"",className:Ol,style:Tl,children:n})]})]}):null};pn();var Po=Object.freeze({value:0,unit:"pixels"}),$l=Object.freeze({minSize:void 0,maxSize:void 0}),Dl=Object.freeze({minSize:Po,maxSize:Po}),Sr=(e,t)=>e?t:$l,Cr=(e,t)=>e?t:Dl,vr=e=>e?"two-column":"single-column";Ee();Yr();import{jsx as B,jsxs as Ze}from"react/jsx-runtime";var jl=zl(async()=>({default:(await Promise.resolve().then(()=>(oo(),ao))).default})),ma=64,Ao="h-[64px]",pa=pr(Dn),ql=Dn.listPanelMinWidth,Gl=Dn.detailPanelMinWidth,Xl=Dn.handleThickness,Gp=pa.collapseThreshold,Xp=pa.expandThreshold,Yl=Object.freeze({value:68,unit:"percentage"}),Ql=Object.freeze({value:32,unit:"percentage"}),Jl=Object.freeze({minSize:Object.freeze({value:ql,unit:"pixels"}),maxSize:void 0}),Zl=Object.freeze({minSize:Object.freeze({value:Gl,unit:"pixels"}),maxSize:Object.freeze({value:600,unit:"pixels"})}),ec=e=>Math.max(1,Math.floor((e===null?0:e.getViewportSize())/ma)),tc=({contactData:e})=>{let t=ee(),n=qe(e?.full_name)??t.noName,a=qe(e?.title)??"-",i=qe(e?.company_name)??"-",o=qe(e?.department)??"-",r=sn(e).value??"-",d=ln(e).value??"-",l=rt(e?.updated_at,t.recordDateTime);return B(Zn,{fullName:n,title:a,companyName:i,department:o,phoneNumber:d,email:r,updatedAtText:l})},nc=e=>typeof e=="object"&&e!==null&&"item"in e,rc=(e,t)=>t!==void 0?`${e}:${t.toFixed(3)}`:void 0,ac=(e,t)=>{for(let n of e){let a=Ft(n);if(a?.person_id===t)return a}return null},Oo=(e,t)=>t!==null&&Ft(e)?.person_id===t,$o=(e,t,n)=>{for(let a=t;a>=0&&a<e.length;a+=n){let i=Ft(e[a]);if(i!==null)return{index:a,personId:i.person_id}}return null},Do=(e,t,n)=>{let a=$o(e,t,n);return a!==null?a:$o(e,t-n,n===1?-1:1)},oc=new Set,ic=()=>{let[e,t]=xr(oc),n=Je((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}},sc=(e,t,n)=>{let a=Tr(n);Kl(()=>{a.current=n},[n]),Wo(()=>{if(e!==null)return a.current(e,t),()=>{a.current(e,!1)}},[e,t])},Io=Ul(({entry:e,index:t,itemCount:n,listboxId:a,isSelected:i,isActive:o,onSelect:r,onLongPressSelect:d,searchQuery:l,enableHighlighting:p,openEmailsWithGmail:m,openGmailCompose:f,onPopupVisibilityChange:c})=>{let h=ee(),b=Tr(null),S=B("div",{className:Ao}),T=nc(e)?e:null,N=Ft(e),{isPopupVisible:U,handleClosePopup:O}=gr({ref:b,onSelect:d,item:N?.person_id});if(sc(N?.person_id??null,U,c),!e||!N)return S;let{person_id:y}=N,g=t%2===0?E.surface:E.subtle,v=`${Z.blue} ring-1 ${M.selectedRing}`,k=i?v:g,C=["B","F"].map(L=>rc(L,L==="B"?T?.baseScore:T?.score)).filter(Boolean);return Ze("div",{ref:b,id:Bl(a,y),className:`flex ${Ao} w-full items-center overflow-hidden ${F.borderSubtle} border-b px-4 py-2 text-left transition-colors ${M.hoverBlueTint} ${k} ${Ka}`,style:{height:ma},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:[Ze("div",{className:"hidden w-28 shrink-0 flex-col items-center gap-0.5 text-center @min-[640px]/aqcm-root:flex",children:[B("div",{className:`whitespace-nowrap font-medium ${s.fgSecondary} text-xs leading-tight`,children:h.listRowNumber(t+1)}),B("div",{className:`truncate ${wt} ${s.fgSecondary} leading-tight`,children:y}),B("div",{className:`flex items-center gap-1 whitespace-nowrap font-mono ${wt} ${s.fgMuted} leading-tight`,children:C.length?C.map(L=>B("span",{children:L},L)):B("span",{children:"-"})})]}),B(Vl,{fallback:B(tc,{contactData:N}),children:B(jl,{contactData:N,searchTerm:l,enableHighlighting:p,openEmailsWithGmail:m,openGmailCompose:f,isPopupVisible:U,onRequestClose:O})})]})});Io.displayName="ContactListRow";var Fo=({context:e})=>{let{contactMapRecords:t,filteredItems:n,searchQuery:a,hasSearchTerm:i,enableHighlighting:o,openEmailsWithGmail:r}=e,{locale:d,labels:l,engineLabels:p}=we(),[m,f]=xr(null),{isAnyPopupVisible:c,handlePopupVisibilityChange:h}=ic(),b=Cn(()=>({enablePointerDrag:!c,enableKeyboardNavigation:!1}),[c]),S=Cn(()=>i?n:t,[i,n,t]),[T,N]=xr(null),U=Je(J=>{f(J),N(J)},[]),O=Je(J=>{if(!r)return;let se=J.trim();if(!se||se==="-"||typeof window>"u")return;let Ae=ht(se,!0);Ae&&window.open(Ae,"_blank","noopener,noreferrer")},[r]),[y,g]=xr(!1),v=Je(()=>g(!1),[]),k=Je(J=>{U(J),g(!0)},[U]),C=_o(),L=_o(),_=Tr(null),V=S.length,Q=Je((J,se)=>B(Io,{entry:J,index:se,itemCount:V,listboxId:C,isSelected:Oo(J,m),isActive:Oo(J,T),onSelect:k,onLongPressSelect:U,searchQuery:a,enableHighlighting:o,openEmailsWithGmail:r,openGmailCompose:O,onPopupVisibilityChange:h}),[V,C,m,T,k,U,a,o,r,O,h]),Ce=Cn(()=>{let J=new Map;return S.forEach((se,Ae)=>{let ut=Ft(se);ut!==null&&J.set(ut.person_id,Ae)}),J},[S]),q=T===null?null:Ce.get(T)??null,W=m===null?null:Ce.get(m)??null,K=Je(J=>{if(J.target.id!==C)return;let se=Ro(J.nativeEvent,{activeIndex:q,startIndex:W===null?0:W,itemCount:V,pageSize:ec(_.current)});if(se===null)return;if(J.preventDefault(),se.kind==="activate"){q!==null&&T!==null&&k(T);return}let Ae=Do(S,se.index,se.direction);Ae!==null&&(N(Ae.personId),_.current?.scrollToIndex(Ae.index,{align:"nearest"}))},[C,q,W,V,T,k,S]),G=Je(J=>{if(J.target.id!==C||q!==null||!J.target.matches(":focus-visible"))return;let se=Do(S,W===null?0:W,1);se!==null&&N(se.personId)},[C,q,W,S]),ye=Cn(()=>({id:C,role:"listbox",tabIndex:0,"aria-label":l.listboxLabel,"aria-describedby":L}),[C,l.listboxLabel,L]),Me=Je(J=>S[J],[S]),Qt=Je(J=>Ft(S[J])?.person_id??`row-${J}`,[S]),Jt=Je(()=>ma,[]),Tt=Cn(()=>({enabled:!0,renderVisual:Fl}),[]),Be=Cn(()=>m===null?null:ac(S,m),[m,S]);Wo(()=>{m!==null&&!Be&&f(null)},[m,Be]);let ze=Tr(null),{isTwoColumn:fe}=hr(ze,pa);y&&(fe||Be===null)&&g(!1);let Ue=Ze("div",{className:"flex min-h-0 flex-1 flex-col gap-1",children:[B("div",{className:`hidden rounded-t-lg border ${F.borderSubtle} ${E.subtle} px-4 py-2 transition-colors @min-[640px]/aqcm-root:block`,children:Ze("div",{className:"flex items-center",children:[Ze("div",{className:`flex w-28 shrink-0 flex-col items-center gap-0.5 text-center ${R} ${s.fgSecondary} uppercase tracking-wider`,children:[B("span",{className:`font-semibold ${s.fg} text-xs`,children:l.columnNo}),B("span",{className:"leading-tight",children:l.columnId}),B("span",{className:"whitespace-nowrap leading-tight",children:l.columnScore})]}),Ze("div",{className:`hidden w-full grid-cols-3 gap-2 font-medium ${s.fgSecondary} text-xs uppercase tracking-wider transition-colors @min-[640px]/aqcm-root:grid @min-[1280px]/aqcm-root:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[Ze("div",{className:"flex flex-col gap-0.5",children:[B("span",{children:l.columnName}),B("span",{className:`font-normal ${R} ${s.fgMuted} uppercase tracking-wider`,children:l.columnTitle})]}),Ze("div",{className:"flex flex-col gap-0.5",children:[B("span",{children:l.columnCompany}),B("span",{className:`font-normal ${R} ${s.fgMuted} uppercase tracking-wider`,children:l.columnDepartment})]}),Ze("div",{className:"flex flex-col gap-0.5",children:[B("span",{children:l.columnPhone}),B("span",{className:`font-normal ${R} ${s.fgMuted} uppercase tracking-wider`,children:l.columnEmail})]}),B("div",{className:"hidden items-end justify-end @min-[1280px]/aqcm-root:flex",children:B("span",{className:`font-normal ${R} ${s.fgMuted} uppercase tracking-wider`,children:l.columnUpdatedAt})})]})]})}),B("p",{id:L,hidden:!0,children:l.listKeyboardHelp}),B("div",{className:"min-h-0 flex-1",onKeyDown:K,onFocus:G,children:B(Hl,{ref:_,contentProps:ye,activeItemIndex:V===0?void 0:q,activeItemVisibleInset:ja,itemCount:V,getItemKey:Qt,behaviorOptions:b,getItem:Me,getItemHeight:Jt,overscanCount:10,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:Tt},locale:d,labels:p,className:`w-full rounded-b-lg border ${F.borderSubtle} border-t-0 ${E.surface} pr-0.75 transition-colors`,children:(J,se)=>Q(J,se)})}),n.length===0&&i?B("div",{className:"py-8 text-center",children:B("p",{className:s.fgMuted,children:l.listNoSearchResults})}):null,V===0&&!i?B("div",{className:"py-8 text-center",children:B("p",{className:s.fgMuted,children:l.listNoData})}):null]}),Nt=Sr(fe,Jl),dt=Cr(fe,Zl);return Ze("div",{ref:ze,"data-testid":"contact-map-list-root","data-contact-map-layout":vr(fe),className:`${At} flex min-h-0 flex-1 flex-col`,children:[Ze(Wl,{id:"contact-map-list-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-list-panel-group",children:[B(wo,{id:"contact-map-list-pane",defaultSize:Yl,minSize:Nt.minSize,maxSize:Nt.maxSize,contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:Ue}),fe?B(Il,{id:"contact-map-list-handle",thickness:Xl,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:`cursor-col-resize rounded transition-colors ${M.hoverMuted} focus:outline-none focus-visible:ring-2 ${M.focusVisibleRing} ${M.ringOffsetSurface} focus-visible:ring-offset-1`,"aria-label":l.listResizeHandle}):null,B(wo,{id:"contact-map-list-detail-pane",defaultSize:Ql,minSize:dt.minSize,maxSize:dt.maxSize,contentOverflow:"hidden",className:"flex min-h-0 flex-col",inert:fe?void 0:!0,children:fe?B("div",{className:"flex min-h-0 flex-1 flex-col pl-1",children:B(yn,{placement:"pane",contact:Be,searchTerm:a,enableHighlighting:o})}):null})]}),!fe&&Be?B(br,{isOpen:y,onClose:v,title:l.detailHeading,children:B(yn,{placement:"overlay",contact:Be,searchTerm:a,enableHighlighting:o})}):null]})};Ht();import{DirectoryTree as bc}from"@aiquants/directory-tree";import{Panel as jo,PanelGroup as Sc,PanelResizeHandle as Cc}from"@aiquants/resize-panels";import{tapScrollCircleSampleVisual as vc}from"@aiquants/virtualscroll";import xc from"@heroicons/react/24/solid/FolderMinusIcon.js";import Tc from"@heroicons/react/24/solid/FolderPlusIcon.js";import{useCallback as Ie,useEffect as vn,useMemo as et,useRef as ya,useState as Xt}from"react";import{createPortal as Nc}from"react-dom";var fa=(e,t)=>e&&e.trim()||t;import{useEffect as lc,useRef as Nr,useState as cc}from"react";var Ho=(e,t=250)=>{let[n,a]=cc(e),i=Nr(null),o=Nr(e),r=Nr(null),d=Nr(!1);return lc(()=>{if(!d.current){d.current=!0,a(e),o.current=e;return}o.current=n,i.current=null;let l=p=>{i.current??(i.current=p);let m=p-i.current,f=Math.min(1,Math.max(0,m/t)),c=1-(1-f)**3,h=Math.max(0,Math.round(o.current+(e-o.current)*c));a(h),f<1&&(r.current=requestAnimationFrame(l))};return r.current=requestAnimationFrame(l),()=>{r.current!==null&&cancelAnimationFrame(r.current)}},[e,t]),Math.max(0,n)};yt();import{useCallback as ga,useEffect as ha,useMemo as Bo,useRef as dc,useSyncExternalStore as uc}from"react";ge();var mc=250,pc=4e3,Er=3,zo={treeWorkerFactory:"the view remounts","workerUrls.treeWorker":"the page reloads"},Uo=(e,t)=>e.uncategorizedCompany===t.uncategorizedCompany&&e.unnamedPerson===t.unnamedPerson,Mr=class{constructor(t,{workerSource:n,logger:a=st}){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>=Er){this.logger.error(`[TreeWorker] the tree Worker failed ${Er} times in a row; the tree stops updating until ${zo[this.workerSource]} (check ${this.workerSource})`,t);return}let n=Math.min(mc*2**(this.consecutiveFailures-1),pc);this.logger.warn(`[TreeWorker] the tree Worker failed; retrying in ${n}ms (failure ${this.consecutiveFailures} of ${Er})`,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 ${Y(n)}`);if(!Object.hasOwn(zo,n))throw new RangeError(`[contact-map] TreeWorkerSession workerSource must be "treeWorkerFactory" or "workerUrls.treeWorker"; got ${Y(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>=Er||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||!Uo(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||!Uo(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}}},fc=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)")},Gt=null,Vo=e=>e===void 0?"the bundled Worker file (workerUrls.treeWorker unset)":JSON.stringify(e),gc=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},hc=e=>{if(po(e),Gt===null){let t=new Mr(()=>fc(e),{workerSource:"workerUrls.treeWorker"});return Gt={session:t,workerUrl:e},t}if(Gt.workerUrl!==e)throw new Error(`[contact-map] the tree session already loads its Worker from ${Vo(Gt.workerUrl)} and cannot also load it from ${Vo(e)}; give every contact-map view in the browser tab the same workerUrls.treeWorker, on every route (after changing it, reload the page)`);return Gt.session},lf=()=>{Gt?.session.reset(),Gt=null},yc={snapshot:null,isBuilding:!1};function Ko(e,t=!1){let n=Ct(),a=n.treeWorkerFactory,i=n.workerUrls?.treeWorker,{labels:o}=we(),r=o.uncategorizedCompany,d=o.noName,l=Bo(()=>({uncategorizedCompany:r,unnamedPerson:d}),[r,d]),p=dc(a);ha(()=>{p.current=a},[a]);let m=a!==void 0,f=m?void 0:i,c=Bo(()=>m?new Mr(()=>gc(p.current)(),{workerSource:"treeWorkerFactory"}):null,[m]),h=ga(()=>c===null?hc(f):c,[c,f]),b=ga(T=>h().subscribe(T),[h]),S=ga(()=>h().getState(),[h]);return ha(()=>{let T=h();T.syncRecords(e,l),t&&T.finalize()},[h,e,t,l]),ha(()=>{if(c!==null)return()=>c.stop()},[c]),uc(b,S,()=>yc)}ge();ue();Ee();Xr();nr();import{jsx as z,jsxs as $e}from"react/jsx-runtime";var Ca=pr(Wn),Ec=Wn.listPanelMinWidth,Mc=Wn.detailPanelMinWidth,Lc=Wn.handleThickness,Of=Ca.collapseThreshold,$f=Ca.expandThreshold,kc=Object.freeze({value:60,unit:"percentage"}),Rc=Object.freeze({value:40,unit:"percentage"}),Pc=Object.freeze({minSize:Object.freeze({value:Ec,unit:"pixels"}),maxSize:void 0}),wc=Object.freeze({minSize:Object.freeze({value:Mc,unit:"pixels"}),maxSize:Object.freeze({value:600,unit:"pixels"})}),_c=(e,t)=>{let{searchQuery:n,enableHighlighting:a}=t,i=fa(e.full_name,t.noName),o=fa(e.title,""),r=z(xe,{text:i,query:n,enabled:a});return o?$e("span",{className:"flex items-center gap-1.5",children:[z("span",{children:r}),z("span",{className:`${s.fgMuted} text-xs`,children:z(xe,{text:o,query:n,enabled:a})})]}):r},Ac="contact-map-tree h-full w-full",Oc={hoverClassName:E.muted,directorySelectedClassName:`${Z.sky} ${M.treeNameSky}`,itemSelectedClassName:`${Z.sky} ${M.treeNameSky}`},ba="h-4 w-4 shrink-0 transition-colors duration-150",$c=(e,t)=>({...e,behaviorOptions:{...e.behaviorOptions,enablePointerDrag:!t}}),Lr=null,qo=null,In=new Map,Go="",Xo=null,Yo=null,Dc=(e,t,n,a,i)=>{let o=`${n?"icons":"plain"}#${a}#${i.noName}`;(o!==Go||i.formatDirectoryName!==Xo||t!==Yo)&&(In.clear(),Go=o,Xo=i.formatDirectoryName,Yo=t);let r={entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},d=new Set;for(let l of e){d.add(l.absolutePath);let p=`${l.name}\0${l.memberCount}`,m=In.get(l.absolutePath);(!m||m.signature!==p)&&(m={signature:p,result:Zo([l],t,n,{searchQuery:"",enableHighlighting:!1,noName:i.noName,formatDirectoryName:i.formatDirectoryName})},In.set(l.absolutePath,m));let f=m.result;f.entries.length>0&&r.entries.push(f.entries[0]);for(let[c,h]of f.personPathMap){let b=r.personPathMap.get(c);if(b)for(let S of h)b.add(S);else r.personPathMap.set(c,new Set(h))}for(let[c,h]of f.contactByPath)r.contactByPath.set(c,h);for(let[c,h]of f.ancestorsByPath)r.ancestorsByPath.set(c,h);r.totalCount+=f.totalCount,!r.firstPerson&&f.firstPerson&&(r.firstPerson=f.firstPerson)}for(let l of In.keys())d.has(l)||In.delete(l);return r},Sa=e=>e.isSelected||e.isItemSelected?u.sky:e.isExpanded&&e.isDirectory?s.fgSecondary:s.fgMuted,Jo=e=>{let t=[];for(let n of e)n.type==="directory"&&(t.push(n.absolutePath),n.children&&t.push(...Jo(n.children)));return t},Wc=e=>{if(e.memberCount===void 0)throw new Error(`[contact-map] directory entry ${e.absolutePath} has no memberCount`);return e.memberCount},Zo=(e,t,n,a,i)=>{let o=new Map,r=new Map,d=new Map,l=0,p=null,m=(c,h)=>{let b=[...h,c.absolutePath];d.set(c.absolutePath,b);let S,T,N=c.type==="directory"?a.formatDirectoryName(c.name,Wc(c)):c.name,U=z(xe,{text:N,query:a.searchQuery,enabled:a.enableHighlighting});if(c.type==="file"&&c.personId){if(i&&!i.has(c.personId))return null;let O=t.get(c.personId);if(O){r.set(c.absolutePath,O),o.has(c.personId)||o.set(c.personId,new Set);let y=o.get(c.personId);y&&y.add(c.absolutePath),l++,p||(p={personId:c.personId,path:c.absolutePath}),n&&(T=g=>{let v=Sa(g);return g.isSelected||g.isItemSelected||c.isPrimary&&(v=c.title?u.indigo:u.orange),z(n.person,{"aria-hidden":"true",className:`${ba} ${v}`})},c.title&&(U=_c(O,a))),U=z("span",{"data-contact-path":c.absolutePath,className:"block w-full",children:U})}}else if(c.children){let O=c.children.map(y=>m(y,b)).filter(y=>y!==null);if(i&&O.length===0)return null;if(S=O,n){let y=c.relativePath.startsWith("company:")?n.company:n.department;T=g=>z(y,{"aria-hidden":"true",className:`${ba} ${Sa(g)}`})}}return{name:N,label:U,type:c.type,absolutePath:c.absolutePath,relativePath:c.relativePath,icon:T,children:S}};return{entries:e.map(c=>m(c,[])).filter(c=>c!==null),personPathMap:o,contactByPath:r,ancestorsByPath:d,firstPerson:p,totalCount:l}},Ic=(e,t,n)=>{let a=new Set,i=new Set,o=new Map;t.forEach((m,f)=>{o.set(m.item.person_id,f)});for(let m of t){let f=m.item.person_id,c=e.personPathMap.get(f);if(c)for(let h of c){a.add(h);let b=e.ancestorsByPath.get(h);if(b){for(let S of b)a.add(S);n&&b.length>0&&i.add(b[0])}}}let r=new Map,d=m=>{let f=r.get(m.absolutePath);if(f!==void 0)return f;let c=1/0;if(m.type==="file"){let h=e.contactByPath.get(m.absolutePath);h&&(c=o.get(h.person_id)??1/0)}else if(m.children)for(let h of m.children)c=Math.min(c,d(h));return r.set(m.absolutePath,c),c},l=(m,f=0)=>m.filter(c=>n&&f===0&&i.has(c.absolutePath)?!0:a.has(c.absolutePath)).map(c=>n&&f===0&&i.has(c.absolutePath)?c:c.type==="directory"&&c.children?{...c,children:l(c.children,f+1)}:c).sort((c,h)=>f===0?d(c)-d(h):0),p=l(e.entries);return{...e,entries:p}},Qo=(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},ei=({context:e,controlsContainer:t})=>{let{contactMapRecords:n,contactMapRecordMap:a,filteredItems:i,hasSearchTerm:o,isSearchInProgress:r}=e,{locale:d,labels:l,treeLabels:p}=we(),m=l.noName,f=l.treeDirectoryName,c=et(()=>({noName:m,formatDirectoryName:f}),[m,f]),[h,b]=Xt(null),[S,T]=Xt(!1),{snapshot:N,isBuilding:U}=Ko(n,e.isStreamingComplete),O=N?.tree??null,y=N?.rebuildEpoch??0,g=et(()=>O?Dc(O,a,h,y,c):null,[O,a,h,y,c]),v=et(()=>{if(!O)return null;if(!o)return g;let I;S||(I=new Set(i.map(ce=>ce.item.person_id)));let oe=Zo(O,a,h,{...c,searchQuery:e.searchQuery,enableHighlighting:e.enableHighlighting},I);return Ic(oe,i,S)},[O,g,a,h,e.searchQuery,e.enableHighlighting,o,i,S,c]),k=et(()=>v||{entries:[],personPathMap:new Map,contactByPath:new Map,ancestorsByPath:new Map,firstPerson:null,totalCount:0},[v]),C=o&&e.errorMessage!==null,[L,_]=Xt(k),V=ya(!1);vn(()=>{if(!(r||C)){V.current=!!O,_(k);return}!V.current&&O&&k.entries.length>0&&(V.current=!0,_(k))},[k,O,r,C]);let Q=o&&(r||C)?L:k,{entries:Ce,personPathMap:q,contactByPath:W,totalCount:K}=Q,G=et(()=>Jo(Ce),[Ce]),[ye,Me]=Xt(()=>qo??new Set),Qt=Ie(I=>!ye.has(I),[ye]),Jt=Ie(I=>{Me(oe=>{let ce=new Set(oe);return ce.has(I)?ce.delete(I):ce.add(I),ce})},[]),Tt=Ie(I=>{I.length!==0&&Me(oe=>{let ce=new Set(oe);for(let pt of I)ce.add(pt);return ce})},[]),Be=Ie(I=>{Me(oe=>{if(oe.size===0)return oe;let ce=!1,pt=new Set(oe);for(let Rt of I)pt.delete(Rt)&&(ce=!0);return ce?pt:oe})},[]);vn(()=>{qo=ye},[ye]),vn(()=>{if(!(typeof window>"u"))try{window.localStorage.removeItem("contact-map.tree-expanded")}catch{}},[]);let[ze,fe]=Xt(null),[Ue,Nt]=Xt(null),[dt,J]=Xt(!1),se=Ie(()=>J(!1),[]),Ae=ya(null),ut=Ie(I=>{let oe=W.get(I);return oe?(ze!==oe.person_id&&fe(oe.person_id),I!==Ue&&Nt(I),!0):!1},[W,Ue,ze]),Hn=Ie(I=>{ut(I)&&J(!0)},[ut]),Bn=Ie(I=>{Hn(I.entry.absolutePath)},[Hn]),be=Ie(I=>I instanceof Element?I.closest("[data-contact-path]")?.getAttribute("data-contact-path")??null:null,[]),{isPopupVisible:Zt,popupItem:Wt,handleClosePopup:en}=gr({ref:Ae,resolveItem:be,onSelect:ut}),Et=Ie(I=>{if(!e.openEmailsWithGmail)return;let oe=I.trim();if(!oe||oe==="-"||typeof window>"u")return;let ce=ht(oe,!0);ce&&window.open(ce,"_blank","noopener,noreferrer")},[e.openEmailsWithGmail]),Te=Wt?W.get(Wt):null,tn=Zt&&Te!==null&&Te!==void 0;vn(()=>{Zt&&!Te&&en()},[Zt,Te,en]);let zn=et(()=>({overscanCount:16,callbackThrottleMs:16,scrollBarOptions:{width:8,enableArrowButtonTabStops:!1,enableScrollToTopBottomButtons:!0,tapScrollCircleOptions:{enabled:!0,renderVisual:vc}},behaviorOptions:{resetOnGetItemHeightChange:!1},preserveScrollAnchor:!0}),[]),nt=et(()=>$c(zn,tn),[zn,tn]);vn(()=>{let I=!1;return typeof window>"u"?()=>{I=!0}:Lr?(b(Lr),()=>{I=!0}):((async()=>{try{let[ce,pt,Rt,ft]=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(I)return;let X=ce.default,de=pt.default,je=Rt.default,gt=ft.default;X&&de&&je&&gt&&(Lr={company:X,department:de,title:je,person:gt},b(Lr))}catch(ce){st.warn("Failed to load lucide icons",ce)}})(),()=>{I=!0})},[]);let nn=et(()=>{if(!h)return;let I=ft=>X=>z(ft,{"aria-hidden":"true",className:`${ba} ${Sa(X)}`}),oe={company:I(h.company),department:I(h.department),title:I(h.title)},ce=I(h.person),pt=ft=>ft in oe,Rt=ft=>{let[X]=ft.entry.relativePath.split(":",1);return(pt(X)?oe[X]:oe.company)(ft)};return{directory:Rt,directoryExpanded:Rt,file:ce}},[h]),Mt=Ie(()=>{Me(I=>I.size===0?I:new Set)},[]),rn=Ie(()=>{G.length>0&&Tt(G)},[G,Tt]),Ve=Qo(ze,Ue,q);vn(()=>{let I=Qo(ze,Ue,q);if(I===null){ze!==null&&fe(null),Ue!==null&&Nt(null);return}I!==Ue&&Nt(I)},[ze,Ue,q]);let It=Ve===null?null:W.get(Ve)??null,Lt=e.isStreamingComplete,Rr=e.isStreamingFailed,an=Lt&&n.length===0,kt=(U||!O)&&!an,Pr=Ho(K,250),wr=O!==null||an,_r=$e("div",{className:"flex flex-wrap items-center gap-1.5",children:[$e("span",{className:`inline-flex h-5 items-center gap-1 rounded ${E.muted} px-1.5 font-medium font-mono ${R} ${s.fgSecondary}`,title:l.treeNodeCountTitle,children:[z("span",{children:"\u{1F333}"})," ",l.treeNodeCountLabel," ",wr?l.treeNodeCount(Pr):"\u2026"]}),Rr&&!Lt?$e("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${$.rose} ${Z.rose} px-1.5 font-medium ${R} ${u.rose}`,title:l.treeStreamInterruptedTitle,children:[z("span",{className:`h-1.5 w-1.5 rounded-full ${Ge.rose}`}),z("span",{children:"\u26D4"})," ",l.treeStreamInterrupted]}):Lt?kt?$e("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${$.amber} ${Z.amber} px-1.5 font-medium ${R} ${u.amber}`,title:l.treeBuildingTitle,children:[$e("span",{className:"relative flex h-1.5 w-1.5",children:[z("span",{className:`absolute inline-flex h-full w-full animate-ping rounded-full ${Ge.amber}`}),z("span",{className:`relative inline-flex h-1.5 w-1.5 rounded-full ${Ge.amber}`})]}),z("span",{children:"\u{1F33F}"})," ",l.treeBuilding]}):$e("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${$.emerald} ${Z.emerald} px-1.5 font-medium ${R} ${u.emerald}`,title:l.treeCompleteTitle,children:[z("span",{className:`h-1.5 w-1.5 rounded-full ${Ge.emerald}`}),z("span",{children:"\u2705"})," ",l.treeComplete]}):$e("span",{className:`inline-flex h-5 items-center gap-1 rounded border ${$.sky} ${Z.sky} px-1.5 font-medium ${R} ${u.sky}`,title:l.treeStreamLoadingTitle,children:[$e("span",{className:"relative flex h-1.5 w-1.5",children:[z("span",{className:`absolute inline-flex h-full w-full animate-ping rounded-full ${Ge.sky}`}),z("span",{className:`relative inline-flex h-1.5 w-1.5 rounded-full ${Ge.sky}`})]}),z("span",{children:"\u23F3"})," ",l.treeStreamLoading]}),o&&$e("button",{type:"button",onClick:()=>T(!S),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${S?`${Z.blue} ${u.blue}`:`${s.fgMuted} ${M.hoverMuted}`}`,title:l.treeShowEntireCompanyTitle,children:[z("span",{children:"\u{1F3E2}"})," ",l.treeShowEntireCompany]}),G.length>0?$e("div",{className:"flex items-center gap-1",children:[z("button",{type:"button",onClick:Mt,className:`inline-flex h-11 w-11 items-center justify-center rounded border ${F.borderControl} ${E.surface} ${s.fgMuted} transition-colors ${M.hoverMuted} ${M.hoverFgSecondary}`,"aria-label":l.treeExpandAll,title:l.treeExpandAllTitle,children:z(Tc,{className:"h-4 w-4"})}),z("button",{type:"button",onClick:rn,className:`inline-flex h-11 w-11 items-center justify-center rounded border ${F.borderControl} ${E.surface} ${s.fgMuted} transition-colors ${M.hoverMuted} ${M.hoverFgSecondary}`,"aria-label":l.treeCollapseAll,title:l.treeCollapseAllTitle,children:z(xc,{className:"h-4 w-4"})})]}):null]}),Ln=ya(null),{isTwoColumn:Ke}=hr(Ln,Ca);dt&&(Ke||It===null)&&J(!1);let mt=et(()=>({toggle:Jt,isExpanded:Qt,expandMultiple:Be,collapseMultiple:Tt,isPending:r}),[Tt,Be,Qt,Jt,r]),on=et(()=>({onEntryClick:Bn,selectedPath:Ve}),[Bn,Ve]),Ar=et(()=>({className:Ac,lineColor:Ua,iconOverrides:nn,showDirectoryIcons:!!nn,showFileIcons:!!nn,highlightStyles:Oc,entryClassName:"rounded-md",nameClassName:"tracking-tight",directoryNameClassName:`font-normal ${s.fg}`,fileNameClassName:s.fgSecondary}),[nn]),Un=z("div",{className:`flex min-h-0 flex-1 flex-col rounded-xl border ${F.borderSubtle} ${E.surface} shadow-sm transition-colors`,children:z("div",{ref:Ae,className:"flex min-h-0 flex-1 flex-col overflow-hidden p-2",children:Ce.length>0?z(bc,{entries:Ce,expansion:mt,selection:on,visual:Ar,virtualScroll:nt,locale:d,labels:p}):z("div",{className:`flex h-full w-full items-center justify-center rounded-lg border ${F.borderSubtle} border-dashed ${E.surface} px-6 text-center ${s.fgMuted} text-sm transition-colors`,children:o?l.treeNoMatches:l.treeEmpty})})}),kn=Sr(Ke,Pc),Rn=Cr(Ke,wc);return $e("div",{ref:Ln,"data-testid":"contact-map-tree-root","data-contact-map-layout":vr(Ke),className:`${At} flex min-h-0 flex-1 flex-col`,children:[t&&Nc(_r,t),$e(Sc,{id:"contact-map-tree-panels",direction:"horizontal",className:"flex min-h-0 w-full flex-1","data-testid":"contact-map-tree-panel-group",children:[z(jo,{id:"contact-map-tree-pane",defaultSize:kc,minSize:kn.minSize,maxSize:kn.maxSize,contentOverflow:"hidden",className:"flex min-h-0 flex-col",children:Un}),Ke?z(Cc,{id:"contact-map-tree-handle",thickness:Lc,indicator:{visible:!0,thickness:6,length:32,barThickness:2,barLength:16},className:`cursor-col-resize rounded transition-colors ${M.hoverMuted} focus:outline-none focus-visible:ring-2 ${M.focusVisibleRing} ${M.ringOffsetSurface} focus-visible:ring-offset-1`,"aria-label":l.treeResizeHandle}):null,z(jo,{id:"contact-map-tree-detail-pane",defaultSize:Rc,minSize:Rn.minSize,maxSize:Rn.maxSize,contentOverflow:"hidden",className:"flex min-h-0 flex-col",inert:Ke?void 0:!0,children:Ke?z("div",{className:"flex min-h-0 flex-1 flex-col pl-1",children:z(yn,{placement:"pane",contact:It,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})}):null})]}),!Ke&&It?z(br,{isOpen:dt,onClose:se,title:l.detailHeading,children:z(yn,{placement:"overlay",contact:It,searchTerm:e.searchQuery,enableHighlighting:e.enableHighlighting})}):null,tn&&Te&&z(Jn,{contactData:Te,openEmailsWithGmail:e.openEmailsWithGmail,openGmailCompose:Et,onRequestClose:en})]})};import{jsx as Fn,jsxs as xn}from"react/jsx-runtime";var zc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Uc=e=>e==="tree"?"tree":"list",ti=({context:e})=>{let t=ee(),[n,a]=Bc(),[i,o]=Hc(null),r=Uc(n.get(Sn)),{setScrollableRef:d,onPointerDown:l,onPointerMove:p,onPointerUp:m,onPointerLeave:f,onPointerCancel:c,onClickCapture:h}=Ot(),b=Fc(S=>{let T=S==="tree"?"tree":"list";if(T===r)return;let N=new URLSearchParams(typeof window<"u"?window.location.search:"");T==="list"?N.delete(Sn):N.set(Sn,T),a(N,{replace:!0})},[r,a]);return xn("div",{"data-testid":"contact-map-search-tab-group",className:"flex min-h-0 flex-1 flex-col",children:[xn("div",{className:"mt-1 mb-1.5 flex shrink-0 flex-wrap items-center gap-2",children:[xn("div",{ref:d,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-lg ${E.muted} p-0.5 transition-colors`,style:zc,onPointerDown:l,onPointerMove:p,onPointerUp:m,onPointerLeave:f,onPointerCancel:c,onClickCapture:h,children:[xn("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"?`${ve.blue} ${s.onPrimary}`:`${s.fgMuted} ${M.hoverSurface}`}`,children:["\u{1F4C4} ",t.listViewTab]}),xn("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"?`${ve.green} ${s.onPrimary}`:`${s.fgMuted} ${M.hoverSurface}`}`,children:["\u{1F333} ",t.treeViewTab]})]}),Fn("div",{ref:o,className:"flex flex-wrap items-center gap-1.5"})]}),xn("div",{className:"flex min-h-0 flex-1 flex-col",children:[Fn("div",{className:`${r==="list"?"flex min-h-0 flex-1 flex-col":"hidden"}`,children:r==="list"?Fn(Fo,{context:e}):null}),Fn("div",{className:`${r==="tree"?"flex min-h-0 flex-1 flex-col":"hidden"}`,children:r==="tree"?Fn(ei,{context:e,controlsContainer:i}):null})]})]})};import{memo as jc}from"react";ge();ue();Ee();ge();ue();Ee();import{DEFAULT_FUZZY_SEARCH_OPTIONS as j}from"@aiquants/fuzzy-search";import{memo as Vc,useId as De}from"react";import{jsx as D,jsxs as H}from"react/jsx-runtime";var va=1e3,xa=Vc(({searchOptions:e,setSearchOptions:t})=>{let n=ee(),a=`flex flex-col gap-1 rounded-md border ${E.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=e.sortBy==="relevance",r=De(),d=De(),l=De(),p=De(),m=De(),f=De(),c=De(),h=De(),b=De(),S=De(),T=De(),N=[];N.push(H("div",{className:`${a} ${$.green} border-l-4`,children:[H("div",{className:`${i} ${u.green}`,children:["\u{1F3D7}\uFE0F ",n.indexBuildHeading]}),H("div",{className:"space-y-2",children:[D("label",{htmlFor:r,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexNgramSize}),D("input",{id:r,type:"range",min:"1",max:"4",step:"1",value:e.ngramSize||j.ngramSize,onChange:y=>t(g=>({...g,ngramSize:parseInt(y.target.value,10)})),className:"h-11 w-full"}),H("span",{className:`${u.green} text-xs`,children:[n.currentValueLabel," ",e.ngramSize||j.ngramSize]}),D("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.indexNgramSizeHint})]}),H("div",{className:"space-y-2",children:[D("label",{htmlFor:d,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexMinNgramOverlap}),D("input",{id:d,type:"range",min:"1",max:"5",step:"1",value:e.minNgramOverlap||j.minNgramOverlap,onChange:y=>t(g=>({...g,minNgramOverlap:parseInt(y.target.value,10)})),className:"h-11 w-full"}),H("span",{className:`${u.green} text-xs`,children:[n.currentValueLabel," ",e.minNgramOverlap||j.minNgramOverlap]}),D("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.indexMinNgramOverlapHint})]})]},"index-build")),N.push(H("div",{className:`${a} ${$.blue} border-l-4`,children:[H("div",{className:`${i} ${u.blue}`,children:["\u{1F50D} ",n.indexCandidateHeading]}),H("div",{className:"space-y-2",children:[D("label",{htmlFor:l,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexThreshold}),D("input",{id:l,type:"range",min:"0.0",max:"1.0",step:"0.05",value:e.indexWorkerOptions?.threshold??j.indexWorkerOptions?.threshold,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,threshold:parseFloat(y.target.value)}})),className:"h-11 w-full"}),H("span",{className:`${u.blue} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.threshold??j.indexWorkerOptions?.threshold]}),D("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.indexThresholdHint})]}),H("div",{className:"space-y-2",children:[D("label",{htmlFor:m,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexNgramOverlapThreshold}),D("input",{id:m,type:"range",min:"0.1",max:"0.9",step:"0.1",value:e.indexWorkerOptions?.ngramOverlapThreshold??j.indexWorkerOptions?.ngramOverlapThreshold,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,ngramOverlapThreshold:parseFloat(y.target.value)}})),className:"h-11 w-full"}),H("span",{className:`${u.blue} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.ngramOverlapThreshold??j.indexWorkerOptions?.ngramOverlapThreshold]}),D("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.indexNgramOverlapThresholdHint})]})]},"candidate-control")),N.push(H("div",{className:`${a} ${$.cyan} border-l-4`,children:[H("div",{className:`${i} ${u.cyan}`,children:["\u{1F9ED} ",n.indexStrategyHeading]}),H("div",{className:"space-y-2",children:[D("label",{htmlFor:p,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexStrategy}),H("select",{id:p,value:e.indexWorkerOptions?.strategy??j.indexWorkerOptions?.strategy??"hybrid",onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,strategy:y.target.value}})),className:`min-h-11 rounded border ${F.borderControl} px-2 pointer-coarse:text-base ${x} transition-colors ${E.surface} ${s.fg}`,children:[D("option",{value:"fast",children:n.indexStrategyFast}),D("option",{value:"accurate",children:n.indexStrategyAccurate}),D("option",{value:"hybrid",children:n.indexStrategyHybrid})]}),D("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.indexStrategyHint})]}),H("div",{className:"space-y-2",children:[D("label",{htmlFor:f,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexMinCandidatesRatio}),D("input",{id:f,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.minCandidatesRatio??j.indexWorkerOptions?.minCandidatesRatio,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,minCandidatesRatio:parseFloat(y.target.value)}})),className:"h-11 w-full"}),H("span",{className:`${u.cyan} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.minCandidatesRatio??j.indexWorkerOptions?.minCandidatesRatio]}),D("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.indexMinCandidatesRatioHint})]}),H("div",{className:"space-y-2",children:[D("label",{htmlFor:c,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexMaxCandidatesRatio}),D("input",{id:c,type:"range",min:"0.3",max:"0.8",step:"0.1",value:e.indexWorkerOptions?.maxCandidatesRatio??j.indexWorkerOptions?.maxCandidatesRatio,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxCandidatesRatio:parseFloat(y.target.value)}})),className:"h-11 w-full"}),H("span",{className:`${u.cyan} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxCandidatesRatio??j.indexWorkerOptions?.maxCandidatesRatio]}),D("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.indexMaxCandidatesRatioHint})]})]},"strategy")),N.push(H("div",{className:`${a} ${$.indigo} border-l-4`,children:[H("div",{className:`${i} ${u.indigo}`,children:["\u{1F521} ",n.scoreTuningHeading]}),H("div",{className:"space-y-2",children:[D("label",{htmlFor:h,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexJaroWinklerPrefix}),D("input",{id:h,type:"range",min:"0.05",max:"0.25",step:"0.05",value:e.indexWorkerOptions?.jaroWinklerPrefix??j.indexWorkerOptions?.jaroWinklerPrefix,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,jaroWinklerPrefix:parseFloat(y.target.value)}})),className:"h-11 w-full"}),H("span",{className:`${u.indigo} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.jaroWinklerPrefix??j.indexWorkerOptions?.jaroWinklerPrefix]}),D("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.indexJaroWinklerPrefixHint})]}),H("div",{className:"space-y-2",children:[D("label",{htmlFor:b,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.maxResults}),H("label",{className:`flex min-h-11 items-center gap-2 ${x} ${s.fgMuted}`,children:[D("input",{type:"checkbox",checked:e.indexWorkerOptions?.maxResults===void 0,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxResults:y.target.checked?void 0:va}}))}),n.noLimit]}),D("input",{id:b,type:"range",min:va,max:"10000",step:"1000",disabled:e.indexWorkerOptions?.maxResults===void 0,value:e.indexWorkerOptions?.maxResults===void 0?va:e.indexWorkerOptions.maxResults,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,maxResults:parseInt(y.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),H("span",{className:`${u.indigo} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.maxResults===void 0?n.noLimit:e.indexWorkerOptions.maxResults]}),D("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.indexMaxResultsHint})]})]},"jaro")),N.push(H("div",{className:`${a} ${$.emerald} border-l-4`,children:[H("div",{className:`${i} ${u.emerald}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),H("div",{className:"space-y-2",children:[D("label",{htmlFor:S,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.fieldWeight}),D("input",{id:S,type:"range",min:"0",max:"1",step:"0.05",value:e.indexWorkerOptions?.relevanceFieldWeight??j.indexWorkerOptions?.relevanceFieldWeight??.2,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,relevanceFieldWeight:parseFloat(y.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),H("span",{className:`${u.emerald} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevanceFieldWeight??j.indexWorkerOptions?.relevanceFieldWeight??.2]}),D("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.indexFieldWeightHint})]}),H("div",{className:"space-y-2",children:[D("label",{htmlFor:T,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexPerfectMatchBonus}),D("input",{id:T,type:"range",min:"0",max:"0.3",step:"0.1",value:e.indexWorkerOptions?.relevancePerfectMatchBonus??j.indexWorkerOptions?.relevancePerfectMatchBonus??.1,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,relevancePerfectMatchBonus:parseFloat(y.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),H("span",{className:`${u.emerald} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.relevancePerfectMatchBonus??j.indexWorkerOptions?.relevancePerfectMatchBonus??.1]}),D("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.indexPerfectMatchBonusHint})]}),!o&&D("p",{className:`${R} ${u.emerald}`,children:n.relevanceOnlyNotice})]},"relevance"));let U=De(),O=De();return N.push(H("div",{className:`${a} ${$.teal} border-l-4`,children:[H("div",{className:`${i} ${u.teal}`,children:["\u{1F524} ",n.indexContainmentHeading]}),H("div",{className:"space-y-2",children:[D("label",{htmlFor:U,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexContainmentBase}),D("input",{id:U,type:"range",min:"0.0",max:"0.7",step:"0.05",value:e.indexWorkerOptions?.containmentScoreBase??j.indexWorkerOptions?.containmentScoreBase??.7,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,containmentScoreBase:parseFloat(y.target.value)}})),className:"h-11 w-full"}),H("span",{className:`${u.teal} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentScoreBase??j.indexWorkerOptions?.containmentScoreBase??.7]}),D("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.indexContainmentBaseHint})]}),H("div",{className:"space-y-2",children:[D("label",{htmlFor:O,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.indexContainmentCoverage}),D("input",{id:O,type:"range",min:"0.0",max:"0.3",step:"0.05",value:e.indexWorkerOptions?.containmentCoverageWeight??j.indexWorkerOptions?.containmentCoverageWeight??.3,onChange:y=>t(g=>({...g,indexWorkerOptions:{...g.indexWorkerOptions,containmentCoverageWeight:parseFloat(y.target.value)}})),className:"h-11 w-full"}),H("span",{className:`${u.teal} text-xs`,children:[n.currentValueLabel," ",e.indexWorkerOptions?.containmentCoverageWeight??j.indexWorkerOptions?.containmentCoverageWeight??.3]}),D("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.indexContainmentCoverageHint})]})]},"containment")),H("section",{className:"space-y-3",children:[H("div",{className:"flex items-center justify-between gap-3",children:[H("div",{className:`flex items-center gap-2 font-semibold ${u.green} text-xs transition-colors`,children:[D("span",{children:"\u{1F4CA}"}),D("span",{className:"tracking-wide",children:n.indexSettingsHeading})]}),D("button",{type:"button",onClick:()=>t(y=>({...y,indexWorkerOptions:{threshold:j.indexWorkerOptions?.threshold||.4,ngramOverlapThreshold:j.indexWorkerOptions?.ngramOverlapThreshold||.3,minCandidatesRatio:j.indexWorkerOptions?.minCandidatesRatio||.1,maxCandidatesRatio:j.indexWorkerOptions?.maxCandidatesRatio||.5,jaroWinklerPrefix:j.indexWorkerOptions?.jaroWinklerPrefix||.1,maxResults:void 0,relevanceFieldWeight:j.indexWorkerOptions?.relevanceFieldWeight||.2,relevancePerfectMatchBonus:j.indexWorkerOptions?.relevancePerfectMatchBonus||.1,containmentScoreBase:j.indexWorkerOptions?.containmentScoreBase||.7,containmentCoverageWeight:j.indexWorkerOptions?.containmentCoverageWeight||.3,strategy:j.indexWorkerOptions?.strategy},ngramSize:j.ngramSize,minNgramOverlap:j.minNgramOverlap})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${$.green} ${Z.green} px-2 font-medium ${u.green} ${x} transition-colors ${M.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),D("div",{className:"grid grid-cols-1 gap-2 @min-[640px]/aqcm-root:grid-cols-2 @min-[1280px]/aqcm-root:grid-cols-3 @min-[1536px]/aqcm-root:grid-cols-4",children:N})]})});xa.displayName="IndexWorkerSettings";ge();ue();Ee();import{DEFAULT_FUZZY_SEARCH_OPTIONS as Re}from"@aiquants/fuzzy-search";import{memo as Kc,useId as Tn}from"react";import{jsx as pe,jsxs as he}from"react/jsx-runtime";var Ta=1e3,Na=Kc(({searchOptions:e,setSearchOptions:t})=>{let n=ee(),a=`flex flex-col gap-1 rounded-md border ${E.surface} px-2 py-1 shadow-sm transition-colors`,i="text-xs font-semibold",o=e.sortBy==="relevance",r=Tn(),d=Tn(),l=Tn(),p=Tn(),m=Tn(),f=Tn(),c=[];return c.push(he("div",{className:`${a} ${$.purple} border-l-4`,children:[he("div",{className:`${i} ${u.purple}`,children:["\u{1F9EE} ",n.levenshteinCandidateHeading]}),he("div",{className:"space-y-2",children:[pe("label",{htmlFor:r,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.levenshteinThreshold}),pe("input",{id:r,type:"range",min:"0.0",max:o?"1.5":"1.0",step:"0.05",value:e.levenshteinWorkerOptions?.threshold??Re.levenshteinWorkerOptions?.threshold,onChange:h=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,threshold:parseFloat(h.target.value)}})),className:"h-11 w-full"}),he("span",{className:`${u.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.threshold??Re.levenshteinWorkerOptions?.threshold]}),pe("p",{className:`${R} ${s.fgMuted} transition-colors`,children:o?n.levenshteinThresholdHintRelevance:n.levenshteinThresholdHint})]}),he("div",{className:"space-y-2",children:[pe("label",{htmlFor:d,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarity}),pe("input",{id:d,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.lengthSimilarityThreshold??Re.levenshteinWorkerOptions?.lengthSimilarityThreshold,onChange:h=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,lengthSimilarityThreshold:parseFloat(h.target.value)}})),className:"h-11 w-full"}),he("span",{className:`${u.purple} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthSimilarityThreshold??Re.levenshteinWorkerOptions?.lengthSimilarityThreshold]}),pe("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthSimilarityHint})]})]},"threshold")),c.push(he("div",{className:`${a} ${$.pink} border-l-4`,children:[he("div",{className:`${i} ${u.pink}`,children:["\u{1FA84} ",n.scoreTuningHeading]}),he("div",{className:"space-y-2",children:[pe("label",{htmlFor:l,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenalty}),pe("input",{id:l,type:"range",min:"0.5",max:"2.0",step:"0.1",value:e.levenshteinWorkerOptions?.lengthDiffPenalty??Re.levenshteinWorkerOptions?.lengthDiffPenalty,onChange:h=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,lengthDiffPenalty:parseFloat(h.target.value)}})),className:"h-11 w-full"}),he("span",{className:`${u.pink} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.lengthDiffPenalty??Re.levenshteinWorkerOptions?.lengthDiffPenalty]}),pe("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.levenshteinLengthPenaltyHint})]})]},"penalty")),c.push(he("div",{className:`${a} ${$.violet} border-l-4`,children:[he("div",{className:`${i} ${u.violet}`,children:["\u{1F4E6} ",n.levenshteinResultsHeading]}),pe("label",{htmlFor:p,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:[pe("input",{type:"checkbox",checked:e.levenshteinWorkerOptions?.maxResults===void 0,onChange:h=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,maxResults:h.target.checked?void 0:Ta}}))}),n.noLimit]}),pe("input",{id:p,type:"range",min:Ta,max:"10000",step:"1000",disabled:e.levenshteinWorkerOptions?.maxResults===void 0,value:e.levenshteinWorkerOptions?.maxResults===void 0?Ta:e.levenshteinWorkerOptions.maxResults,onChange:h=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,maxResults:parseInt(h.target.value,10)}})),className:"h-11 w-full disabled:cursor-not-allowed"}),he("span",{className:`${u.violet} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.maxResults===void 0?n.noLimit:e.levenshteinWorkerOptions.maxResults]}),pe("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.levenshteinMaxResultsHint})]},"max-results")),c.push(he("div",{className:`${a} ${$.rose} border-l-4`,children:[he("div",{className:`${i} ${u.rose}`,children:["\u{1F3AF} ",n.relevanceWeightsHeading]}),he("div",{className:"space-y-2",children:[pe("label",{htmlFor:m,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.fieldWeight}),pe("input",{id:m,type:"range",min:"0",max:"1",step:"0.05",value:e.levenshteinWorkerOptions?.relevanceFieldWeight??Re.levenshteinWorkerOptions?.relevanceFieldWeight??.15,onChange:h=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,relevanceFieldWeight:parseFloat(h.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),he("span",{className:`${u.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.relevanceFieldWeight??Re.levenshteinWorkerOptions?.relevanceFieldWeight??.15]}),pe("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.levenshteinFieldWeightHint})]}),he("div",{className:"space-y-2",children:[pe("label",{htmlFor:f,className:`font-medium ${x} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonus}),pe("input",{id:f,type:"range",min:"0.05",max:"0.3",step:"0.05",value:e.levenshteinWorkerOptions?.partialMatchBonus??Re.levenshteinWorkerOptions?.partialMatchBonus,onChange:h=>t(b=>({...b,levenshteinWorkerOptions:{...b.levenshteinWorkerOptions,partialMatchBonus:parseFloat(h.target.value)}})),disabled:!o,className:"h-11 w-full disabled:cursor-not-allowed"}),he("span",{className:`${u.rose} text-xs`,children:[n.currentValueLabel," ",e.levenshteinWorkerOptions?.partialMatchBonus??Re.levenshteinWorkerOptions?.partialMatchBonus]}),pe("p",{className:`${R} ${s.fgMuted} transition-colors`,children:n.levenshteinPartialBonusHint})]}),!o&&pe("p",{className:`${R} ${u.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 ${u.purple} text-xs transition-colors`,children:[pe("span",{children:"\u{1F4CF}"}),pe("span",{className:"tracking-wide",children:n.levenshteinSettingsHeading})]}),pe("button",{type:"button",onClick:()=>t(h=>({...h,levenshteinWorkerOptions:{threshold:Re.levenshteinWorkerOptions?.threshold||.3,lengthSimilarityThreshold:Re.levenshteinWorkerOptions?.lengthSimilarityThreshold||.1,partialMatchBonus:Re.levenshteinWorkerOptions?.partialMatchBonus||.1,lengthDiffPenalty:Re.levenshteinWorkerOptions?.lengthDiffPenalty||1,maxResults:void 0,relevanceFieldWeight:Re.levenshteinWorkerOptions?.relevanceFieldWeight||.15}})),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded border ${$.purple} ${Z.purple} px-2 font-medium ${u.purple} ${x} transition-colors ${M.hoverSurface}`,title:n.resetToDefaultsTitle,children:n.reset})]}),pe("div",{className:"grid grid-cols-1 gap-2 @min-[640px]/aqcm-root:grid-cols-2 @min-[1280px]/aqcm-root:grid-cols-3 @min-[1536px]/aqcm-root:grid-cols-4",children:c})]})});Na.displayName="LevenshteinWorkerSettings";import{jsx as ct,jsxs as lt}from"react/jsx-runtime";var qc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},Ea=jc(({searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:i,setOpenEmailsWithGmail:o,activeTab:r,onTabChange:d})=>{let l=ee(),{setScrollableRef:p,onPointerDown:m,onPointerMove:f,onPointerUp:c,onPointerLeave:h,onPointerCancel:b,onClickCapture:S}=Ot();return lt("div",{className:`wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border ${$.blue} ${E.surface} p-1.5 shadow-md transition-colors`,children:[lt("div",{className:`mb-0.5 flex shrink-0 flex-col gap-1 rounded ${Z.blue} px-1.5 py-0.5 transition-colors @min-[640px]/aqcm-root:flex-row @min-[640px]/aqcm-root:items-center @min-[640px]/aqcm-root:justify-between`,children:[lt("h3",{className:`font-semibold ${s.fgSecondary} text-xs transition-colors`,children:["\u2699\uFE0F ",l.searchSettings]}),ct("div",{className:"flex flex-wrap gap-1.5",children:lt("button",{type:"button",onClick:()=>t(T=>mr(T.workerUrls)),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded ${ve.red} px-1.5 ${x} ${s.onPrimary} transition-colors ${Ut.red}`,title:l.settingsResetAllTitle,children:["\u{1F504} ",l.settingsResetAll]})})]}),ct("div",{className:"mb-0 shrink-0",children:lt("div",{ref:p,role:"tablist","aria-label":l.settingsTabsLabel,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-md ${E.muted} p-0.5 transition-colors`,style:qc,onPointerDown:m,onPointerMove:f,onPointerUp:c,onPointerLeave:h,onPointerCancel:b,onClickCapture:S,children:[lt("button",{type:"button",role:"tab","aria-selected":r==="basic",onClick:()=>d("basic"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${r==="basic"?`${ve.blue} ${s.onPrimary}`:`${s.fgMuted} ${M.hoverSurface}`}`,children:["\u{1F527} ",l.settingsBasicTab]}),lt("button",{type:"button",role:"tab","aria-selected":r==="advanced",onClick:()=>d("advanced"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${r==="advanced"?`${ve.orange} ${s.onPrimary}`:`${s.fgMuted} ${M.hoverSurface}`}`,children:["\u26A1 ",l.settingsAdvancedTab]}),lt("button",{type:"button",role:"tab","aria-selected":r==="index",onClick:()=>d("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${r==="index"?`${ve.green} ${s.onPrimary}`:`${s.fgMuted} ${M.hoverSurface}`}`,children:["\u{1F4CA} ",l.indexWorkerName]}),lt("button",{type:"button",role:"tab","aria-selected":r==="levenshtein",onClick:()=>d("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${r==="levenshtein"?`${ve.purple} ${s.onPrimary}`:`${s.fgMuted} ${M.hoverSurface}`}`,children:["\u{1F4CF} ",l.levenshteinWorkerName]})]})}),lt("div",{className:"flex flex-col gap-1",children:[ct("div",{className:`${r==="basic"?"block":"hidden"}`,children:ct(Kr,{searchOptions:e,setSearchOptions:t,enableHighlighting:n,setEnableHighlighting:a,openEmailsWithGmail:i,setOpenEmailsWithGmail:o})}),ct("div",{className:`${r==="advanced"?"block":"hidden"}`,children:ct(Vr,{searchOptions:e,setSearchOptions:t})}),ct("div",{className:`${r==="index"?"block":"hidden"}`,children:ct(xa,{searchOptions:e,setSearchOptions:t})}),ct("div",{className:`${r==="levenshtein"?"block":"hidden"}`,children:ct(Na,{searchOptions:e,setSearchOptions:t})})]})]})});Ea.displayName="SearchOptionsPanel";import{memo as Yc,useCallback as Qc}from"react";zt();ge();ue();Ee();ue();import{memo as Gc}from"react";import{jsxs as Ma}from"react/jsx-runtime";var A=Gc(({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 @min-[640px]/aqcm-root:flex-row @min-[640px]/aqcm-root: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 @min-[640px]/aqcm-root:ml-2`,children:[t,n]})]}));A.displayName="StatItem";zt();ge();ue();Ee();import{memo as Xc}from"react";import{jsx as w,jsxs as te}from"react/jsx-runtime";var Nn=Xc(({kind:e,icon:t,stats:n,color:a})=>{let{locale:i,labels:o}=we(),r=W=>ne(i,W);if(!n)return w("section",{className:`rounded-lg border ${F.borderSubtle} border-dashed ${E.surface} p-3 ${s.fgMuted} text-xs transition-colors`,children:o.statsNoData});let d=n.basic||{},l=n.workerSpecific||{},p=n.analysis||{},m=d.totalSearches??0,f=d.totalProcessingTime??0,c=d.averageSearchTime??0,h=d.lastSearchTime??0,b=d.errorCount??0,S=d.timestamp,T=p.fieldPerformance||{},N=p.performanceInsights||{},U=p.recentHistory||[],O=l.specificMetrics||{},y=l.operationCount??0,g=l.operationDistribution||{},v=e==="index",k=e==="levenshtein",C=v?o.indexWorkerName:o.levenshteinWorkerName,L=O,_=O,V=`flex flex-col gap-1 rounded-lg border ${E.surface} p-3 shadow-sm transition-colors`,Q="text-xs font-semibold transition-colors",Ce=W=>{if(!W)return;let K=new Date(W);return Number.isNaN(K.getTime())?void 0:o.statsTimestamp(K)},q=[];if(q.push(te("div",{className:`${V} ${$.blue} border-l-4`,children:[te("div",{className:`${Q} ${a}`,children:["\u{1F4CA} ",o.statsBasicHeading]}),w(A,{label:o.statTotalSearches,value:r(m),color:a}),w(A,{label:o.statAverageSearchTime,value:c.toFixed(2),unit:"ms",color:a}),w(A,{label:o.statTotalProcessingTime,value:f.toFixed(2),unit:"ms",color:a}),w(A,{label:o.statLastSearchTime,value:h.toFixed(2),unit:"ms",color:a}),w(A,{label:o.statErrorCount,value:b,color:b>0?u.red:a}),Ce(S)&&w(A,{label:o.statUpdatedAt,value:Ce(S),color:s.fgMuted})]},"basic")),y>0||Object.keys(g).length>0){let W=Object.entries(g).sort(([,K],[,G])=>(Number(G)||0)-(Number(K)||0)).slice(0,6);q.push(te("div",{className:`${V} ${$.amber} border-l-4`,children:[te("div",{className:`${Q} ${u.amber}`,children:["\u{1F527} ",o.statsOperationsHeading]}),w(A,{label:o.statTotalOperations,value:r(y),color:u.amber}),W.length>0&&w("div",{className:"mt-1 space-y-1",children:W.map(([K,G])=>w(A,{label:K,value:r(Number(G)),unit:o.timesUnit(r(Number(G))),color:u.amber},K))})]},"operations"))}if(v&&(q.push(te("div",{className:`${V} ${$.green} border-l-4`,children:[te("div",{className:`${Q} ${u.green}`,children:["\u{1F3D7}\uFE0F ",o.statsIndexHeading]}),w(A,{label:o.statIndexBuilds,value:r(L.totalIndexBuilds??0),color:u.green}),w(A,{label:o.statDataSize,value:r(L.currentDataSize??0),unit:o.itemsUnit(r(L.currentDataSize??0)),color:u.green}),w(A,{label:o.statLastBuildTime,value:(L.lastIndexTime??0).toFixed(2),unit:"ms",color:u.green})]},"index-core")),L.cacheSize&&q.push(te("div",{className:`${V} ${$.emerald} border-l-4`,children:[te("div",{className:`${Q} ${u.emerald}`,children:["\u{1F4BE} ",o.statsCacheHeading]}),w(A,{label:o.statCacheNgram,value:r(L.cacheSize.ngram??0),color:u.emerald}),w(A,{label:o.statCacheWord,value:r(L.cacheSize.word??0),color:u.emerald}),w(A,{label:o.statCachePhonetic,value:r(L.cacheSize.phonetic??0),color:u.emerald})]},"index-cache")),L.indexMetadata)){let W=Object.entries(L.indexMetadata).slice(0,6);W.length>0&&q.push(te("div",{className:`${V} ${$.teal} border-l-4`,children:[te("div",{className:`${Q} ${u.teal}`,children:["\u{1F4CB} ",o.statsIndexMetadataHeading]}),W.map(([K,G])=>{let ye;if(typeof G=="number"){let Me=K.toLowerCase();Me.includes("time")&&!Me.includes("timestamp")?ye=`${G.toFixed(2)}ms`:Me.includes("timestamp")||Me.includes("at")?ye=Ce(G)??G.toString():ye=r(G)}else ye=String(G);return w(A,{label:K,value:ye,color:u.teal},K)})]},"index-meta"))}if(k){if(q.push(te("div",{className:`${V} ${$.purple} border-l-4`,children:[te("div",{className:`${Q} ${u.purple}`,children:["\u{1F522} ",o.statsCalculationsHeading]}),w(A,{label:o.statTotalCalculations,value:r(_.totalCalculations??0),color:u.purple}),w(A,{label:o.statDistanceCalculations,value:r(_.totalDistanceCalculations??0),color:u.purple}),w(A,{label:o.statAverageDistance,value:typeof _.averageDistance=="number"?_.averageDistance.toFixed(2):"0.00",color:u.purple}),w(A,{label:o.statMinDistance,value:_.minDistance??o.notAvailable,color:u.purple}),w(A,{label:o.statMaxDistance,value:_.maxDistance??0,color:u.purple})]},"lev-basic")),q.push(te("div",{className:`${V} ${$.fuchsia} border-l-4`,children:[te("div",{className:`${Q} ${u.fuchsia}`,children:["\u{1F3AF} ",o.statsMatchesHeading]}),w(A,{label:o.statPartialMatches,value:r(_.partialMatches??0),color:u.fuchsia}),w(A,{label:o.statPerfectMatches,value:r(_.perfectMatches??0),color:u.fuchsia}),w(A,{label:o.statEarlyTerminations,value:r(_.earlyTerminations??0),color:u.fuchsia})]},"lev-match")),_.similarityThresholds&&q.push(te("div",{className:`${V} ${$.rose} border-l-4`,children:[te("div",{className:`${Q} ${u.rose}`,children:["\u{1F4C8} ",o.statsSimilarityHeading]}),w(A,{label:o.statAbove80,value:r(_.similarityThresholds.above80??0),color:u.emerald}),w(A,{label:o.statAbove60,value:r(_.similarityThresholds.above60??0),color:u.lime}),w(A,{label:o.statAbove40,value:r(_.similarityThresholds.above40??0),color:u.orange}),w(A,{label:o.statBelow40,value:r(_.similarityThresholds.below40??0),color:u.red})]},"lev-similarity")),_.distanceDistribution){let W=Object.entries(_.distanceDistribution).sort(([,K],[,G])=>Number(G)-Number(K)).slice(0,6);W.length>0&&q.push(te("div",{className:`${V} ${$.indigo} border-l-4`,children:[te("div",{className:`${Q} ${u.indigo}`,children:["\u{1F4CA} ",o.statsDistanceHeading]}),W.map(([K,G])=>w(A,{label:o.statDistance(K),value:r(Number(G)),unit:o.timesUnit(r(Number(G))),color:u.indigo},K))]},"lev-distance"))}if(_.queryLengthStats){let W=Object.entries(_.queryLengthStats).sort(([,K],[,G])=>(G.count??0)-(K.count??0)).slice(0,6);W.length>0&&q.push(te("div",{className:`${V} ${$.violet} border-l-4`,children:[te("div",{className:`${Q} ${u.violet}`,children:["\u{1F4CF} ",o.statsQueryLengthHeading]}),W.map(([K,G])=>{let ye=Number(G.count??0),Me=Number(G.averageScore??0);return w(A,{label:o.statQueryLength(K),value:o.statQueryLengthValue({count:ye,averagePercent:(Me*100).toFixed(1)}),color:u.violet},K)})]},"lev-query-length"))}}if(Object.keys(T).length>0){let W=Object.entries(T).sort(([,K],[,G])=>(G.averageScore??0)-(K.averageScore??0)).slice(0,6);q.push(te("div",{className:`${V} ${$.purple} border-l-4`,children:[te("div",{className:`${Q} ${u.purple}`,children:["\u{1F4CB} ",o.statsFieldPerformanceHeading]}),W.map(([K,G])=>{let ye=G;return te("div",{className:`space-y-1 rounded ${Z.purple} p-2 transition-colors`,children:[w("div",{className:`font-semibold ${u.purple} text-xs transition-colors`,children:K}),w(A,{label:o.statAverageScore,value:`${((ye.averageScore??0)*100).toFixed(1)}%`,color:u.purple}),w(A,{label:o.statMatchCount,value:r(ye.matchCount??0),unit:o.itemsUnit(r(ye.matchCount??0)),color:u.purple}),w(A,{label:o.statBestWorstScore,value:`${((ye.bestScore??0)*100).toFixed(1)}% / ${((ye.worstScore??0)*100).toFixed(1)}%`,color:u.purple})]},K)})]},"field-performance"))}if(N.bestPerformingField||N.totalHistoryEntries||N.similarityDistribution){let W=(N.recentAverageResultCount??0).toFixed(1);q.push(te("div",{className:`${V} ${$.blue} border-l-4`,children:[te("div",{className:`${Q} ${u.blue}`,children:["\u{1F50D} ",o.statsInsightsHeading]}),N.bestPerformingField&&w(A,{label:o.statBestField,value:N.bestPerformingField,color:u.blue}),w(A,{label:o.statRecentAverageTime,value:(N.recentAverageProcessingTime??0).toFixed(2),unit:"ms",color:u.blue}),w(A,{label:o.statRecentAverageResults,value:W,unit:o.itemsUnit(W),color:u.blue}),w(A,{label:o.statThroughput,value:(N.throughputPerSecond??0).toFixed(2),unit:o.throughputUnit,color:u.blue}),w(A,{label:o.statCommonQueryLength,value:r(N.mostCommonQueryLength??0),unit:o.charactersUnit(r(N.mostCommonQueryLength??0)),color:u.blue}),w(A,{label:o.statHistoryEntries,value:r(N.totalHistoryEntries??0),color:u.blue}),N.similarityDistribution&&te("div",{className:"mt-1 grid grid-cols-2 gap-1",children:[w(A,{label:o.statHighSimilarity,value:r(N.similarityDistribution.highSimilarity??0),color:u.emerald}),w(A,{label:o.statMediumSimilarity,value:r(N.similarityDistribution.mediumSimilarity??0),color:u.lime}),w(A,{label:o.statLowSimilarity,value:r(N.similarityDistribution.lowSimilarity??0),color:u.orange}),w(A,{label:o.statVeryLowSimilarity,value:r(N.similarityDistribution.veryLowSimilarity??0),color:u.red})]})]},"performance-insights"))}return U.length>0&&q.push(te("div",{className:`${V} ${$.sky} border-l-4`,children:[te("div",{className:`${Q} ${u.sky}`,children:["\u{1F4C8} ",o.statsRecentHistoryHeading]}),U.slice(-3).reverse().map((W,K)=>te("div",{className:`rounded ${Z.sky} p-2 transition-colors`,children:[w("div",{className:`font-medium ${u.sky} transition-colors`,children:W.operationType}),w("div",{className:`${u.sky} text-xs transition-colors`,children:o.statsHistoryEntry({processingTimeMs:W.processingTime.toFixed(2),resultCount:W.resultCount??0})}),Ce(W.timestamp)&&w("div",{className:`${R} ${u.sky} transition-colors`,children:Ce(W.timestamp)})]},`${W.operationType}-${W.timestamp??K}`))]},"recent-history")),te("section",{className:"space-y-2",children:[te("div",{className:`flex items-center gap-2 font-semibold text-xs ${a}`,children:[w("span",{children:t}),w("span",{className:"tracking-wide",children:C})]}),w("div",{className:"grid grid-cols-1 gap-2 @min-[640px]/aqcm-root:grid-cols-2 @min-[1280px]/aqcm-root:grid-cols-3 @min-[1536px]/aqcm-root:grid-cols-4",children:q})]})});Nn.displayName="WorkerStatsSection";import{jsx as He,jsxs as Fe}from"react/jsx-runtime";var Jc={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},La=Yc(({performanceMetrics:e,searchTerm:t,totalDataCount:n,resultsCount:a,resetStats:i,rebuildIndex:o,isIndexBuilding:r,activeTab:d,onTabChange:l})=>{let{locale:p,labels:m}=we(),f=t.trim(),c=f?a:n,{setScrollableRef:h,onPointerDown:b,onPointerMove:S,onPointerUp:T,onPointerLeave:N,onPointerCancel:U,onClickCapture:O}=Ot(),y=d!=="index"||r,g=r?m.statsRebuildingTitle:d!=="index"?m.statsRebuildIndexTabOnlyTitle:m.statsRebuildTitle,v=y?`cursor-not-allowed ${E.muted} ${s.fgMuted}`:`${ve.blue} ${s.onPrimary} ${Ut.blue}`,k=r?`\u23F3 ${m.statsRebuilding}`:`\u{1F3D7}\uFE0F ${m.statsRebuild}`,C=Qc(()=>{o().catch(()=>{})},[o]);return Fe("div",{className:`wrap-break-word flex w-full flex-col gap-1.5 rounded-lg border ${$.blue} ${E.surface} p-1.5 shadow-md transition-colors`,children:[Fe("div",{className:`mb-0.5 flex shrink-0 flex-col gap-1 rounded ${Z.blue} px-1.5 py-0.5 transition-colors @min-[640px]/aqcm-root:flex-row @min-[640px]/aqcm-root:items-center @min-[640px]/aqcm-root:justify-between`,children:[Fe("h3",{className:`font-semibold ${s.fgSecondary} text-xs transition-colors`,children:["\u{1F4CA} ",m.searchStatistics]}),Fe("div",{className:"flex flex-wrap gap-1.5",children:[He("button",{type:"button",onClick:C,disabled:y,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${v}`,title:g,children:k}),Fe("button",{type:"button",onClick:i,className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded ${ve.red} px-1.5 ${x} ${s.onPrimary} transition-colors ${Ut.red}`,title:m.statsResetTitle,children:["\u{1F504} ",m.reset]})]})]}),He("div",{className:"mb-0 shrink-0",children:Fe("div",{ref:h,role:"tablist","aria-label":m.statsTabsLabel,className:`flex space-x-1 overflow-x-auto text-nowrap rounded-md ${E.muted} p-0.5 transition-colors`,style:Jc,onPointerDown:b,onPointerMove:S,onPointerUp:T,onPointerLeave:N,onPointerCancel:U,onClickCapture:O,children:[Fe("button",{type:"button",role:"tab","aria-selected":d==="overview",onClick:()=>l("overview"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${d==="overview"?`${ve.blue} ${s.onPrimary}`:`${s.fgMuted} ${M.hoverSurface}`}`,children:["\u{1F4CB} ",m.statsOverviewTab]}),Fe("button",{type:"button",role:"tab","aria-selected":d==="index",onClick:()=>l("index"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${d==="index"?`${ve.green} ${s.onPrimary}`:`${s.fgMuted} ${M.hoverSurface}`}`,children:["\u{1F4CA} ",m.statsIndexTab]}),Fe("button",{type:"button",role:"tab","aria-selected":d==="levenshtein",onClick:()=>l("levenshtein"),className:`inline-flex min-h-11 min-w-11 items-center justify-center rounded px-1.5 ${x} transition-colors ${d==="levenshtein"?`${ve.purple} ${s.onPrimary}`:`${s.fgMuted} ${M.hoverSurface}`}`,children:["\u{1F4CF} ",m.statsLevenshteinTab]})]})}),Fe("div",{className:"flex flex-col gap-1 pb-0.5",children:[Fe("div",{className:`${d==="overview"?"grid":"hidden"} grid-cols-1 gap-2 pr-1 ${s.fgMuted} text-xs transition-colors @min-[640px]/aqcm-root:grid-cols-2 @min-[1280px]/aqcm-root:grid-cols-3 @min-[1536px]/aqcm-root:grid-cols-4`,children:[He(A,{label:m.statTotalSearches,value:ne(p,e.totalSearches)}),He(A,{label:m.statAverageSearchTime,value:e.averageSearchTime.toFixed(1),unit:"ms"}),He(A,{label:m.statDataCount,value:ne(p,e.itemCount)}),He(A,{label:f?m.statResultCount:m.statDisplayedCount,value:ne(p,c)})]}),He("div",{className:`${d==="index"?"space-y-3":"hidden"} pr-1 ${s.fgMuted} text-xs transition-colors`,children:He(Nn,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:u.green})}),He("div",{className:`${d==="levenshtein"?"space-y-3":"hidden"} pr-1 ${s.fgMuted} text-xs transition-colors`,children:He(Nn,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:u.purple})}),Fe("div",{className:"hidden",children:[He(Nn,{kind:"index",icon:"\u{1F4CA}",stats:e.workerStats?.index,color:u.green}),He(Nn,{kind:"levenshtein",icon:"\u{1F4CF}",stats:e.workerStats?.levenshtein,color:u.purple})]})]})]})});La.displayName="StatisticsPanel";import{Fragment as ii,jsx as le,jsxs as Pe}from"react/jsx-runtime";var id=/[\u200B\uFEFF]/g,Ra=typeof window<"u",li=Ra&&typeof document<"u",ka=(e,t=[],n=!1)=>{let a=si(e);a.current=e,xt(()=>{if(!(!Ra||n&&!li))return a.current()},[n,...t])},ni=(e,t,n)=>{let[a,i]=tt(()=>{let o=ri(r=>r.getItem(e));return o&&t.includes(o)?o:n});return ka(()=>{ri(o=>{o.setItem(e,a)})},[e,a]),[a,i]},ri=e=>{if(!Ra)return null;try{return e(window.sessionStorage)}catch{return null}},ai=(e,t)=>{let[n,a]=tt(e);return xt(()=>{let i=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(i)}},[e,t]),n},sd="contact-map.settings-tab",ld="contact-map.statistics-tab",cd=["basic","advanced","index","levenshtein"],dd=["overview","index","levenshtein"],oi=["full_name","company_name","department","title","email","company_phone_number","mobile_phone_number"],ud={WebkitOverflowScrolling:"touch",msOverflowStyle:"none",scrollbarWidth:"none"},ci=({streamState:e,...t}={})=>e===void 0?le(md,{...t}):le(di,{...t,streamState:e}),md=e=>{let{context:t}=ur();return le(di,{...e,streamState:t})},pd={setting:"ContactMapSearchPage workerUrls",keys:["indexWorker","levenshteinWorker"],hints:{treeWorker:"set treeWorker on ContactMapConfigProvider or ContactMapAppView"}},di=e=>{let{streamState:t,onFooterVisibilityChange:n,children:a}=e,i=Le(e,"workerUrls"),o=Ct(),{locale:r,labels:d}=we(),{contactMapRecords:l,contactMapRecordMap:p,isStreamingComplete:m,isStreamingFailed:f}=t,c=ad(),[h]=od(),b=si(null),[S,T]=tt(!0),[N,U]=tt(o.openEmailsWithGmail??!1),{indexWorker:O,levenshteinWorker:y}=bn(o.workerUrls,i,pd),[g,v]=tt(()=>mr({indexWorker:O,levenshteinWorker:y})),[k,C]=tt(h.get("q")||""),L=ai(k,g.debounceMs??Zc.debounceMs);xt(()=>{let X=h.get("q")||"";C(de=>de!==X?X:de)},[h]),xt(()=>{if(typeof window>"u")return;let X=new URL(window.location.href);(X.searchParams.get("q")||"")!==L&&(L?X.searchParams.set("q",L):X.searchParams.delete("q"),window.history.replaceState(window.history.state,"",X.toString()))},[L]);let[_,V]=rd(),[Q,Ce]=tt("search"),[q,W]=ni(sd,cd,"basic"),[K,G]=ni(ld,dd,"overview"),{setScrollableRef:ye,onPointerDown:Me,onPointerMove:Qt,onPointerUp:Jt,onPointerLeave:Tt,onPointerCancel:Be,onClickCapture:ze}=Ot(),fe=En(()=>{if(!li||da(window))return;let X=b.current;!X||document.activeElement===X||window.requestAnimationFrame(()=>{try{X.focus({preventScroll:!0})}catch{}})},[]),Ue=En(X=>{let de=X;Ce(de),de==="search"&&fe()},[fe]),Nt=$t(()=>({...g,debounceMs:0}),[g]),[dt,J]=tt("union"),se=dt==="intersection",Ae=se?d.operatorAndTitle:d.operatorOrTitle,ut=En(X=>ed(X,dt),[dt]),Hn=$t(()=>({querySetsOf:ut}),[ut]),Bn=ai(l,m?0:800),{searchTerm:be,setSearchTerm:Zt,filteredItems:Wt,resultTerm:en,isSearching:Et,isIndexBuilding:Te,clearSearch:tn,resetStats:zn,performanceMetrics:nt,rebuildIndex:nn,error:Mt}=td(Bn,oi,Nt,Hn),rn=be.trim().length>0,[Ve,It]=tt(""),[Lt,Rr]=tt(()=>be),an=$t(()=>er(k),[k]),kt=$t(()=>er(L),[L]);xt(()=>{L===Ve&&kt===be||V(()=>{It(L),Zt(kt)})},[L,Ve,kt,be,Zt]);let Pr=En(X=>{let je=X.target.value.replace(id,"");C(je)},[]),wr=En(()=>{C(""),It(""),tn(),fe()},[tn,fe]),_r=En(()=>{J(X=>X==="intersection"?"union":"intersection"),fe()},[fe]);ka(()=>{if(!(Q==="search"&&c.state==="idle"&&!_))return;let de=document.activeElement;if(!!!(de?.matches('[role="tab"]')||de?.closest('[role="tablist"]')?.getAttribute("role")==="tablist")&&de&&de!==document.body&&de!==b.current)return;let gt=window.requestAnimationFrame(()=>{fe()});return()=>{window.cancelAnimationFrame(gt)}},[Q,c.state,_,fe],!0),ka(()=>{if(Q!=="search")return;let X=[[document,"visibilitychange",()=>{document.visibilityState==="visible"&&fe()}],[window,"pageshow",()=>{fe()}]];for(let[de,je,gt]of X)de.addEventListener(je,gt);return()=>{for(let[de,je,gt]of X)de.removeEventListener(je,gt)}},[Q,fe],!0),xt(()=>(n&&n(Q==="search"?"mobile-hidden":"visible"),()=>{n&&n("visible")}),[Q,n]),xt(()=>{nt&&st.info("\u{1F4CA} [STATE] \u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u6307\u6A19\u304C\u66F4\u65B0\u3055\u308C\u307E\u3057\u305F:",{totalSearches:nt.totalSearches,averageSearchTime:nt.averageSearchTime,itemCount:nt.itemCount,resultsCount:nt.resultsCount,workersAvailable:!!nt.workerStats})},[nt]);let{isAwaitingDebounce:Ln,isAwaitingSearchTermSync:Ke,isSearchInProgress:mt}=$t(()=>{let X=an!==kt,de=kt!==be,je=be.trim().length>0||an.trim().length>0;return{isAwaitingDebounce:X,isAwaitingSearchTermSync:de,isSearchInProgress:_||Et||en!==be&&Mt===null||je&&Te||X||de||Lt!==be}},[an,kt,be,en,Mt,_,Et,Te,Lt]),[on,Ar]=tt(be);xt(()=>{on!==be&&Ar(be)},[be,on]),xt(()=>{Ln||Ke||_||Et||Te||on===be&&Lt!==be&&Rr(be)},[be,Lt,Ln,Ke,_,Et,Te,on]);let Un=$t(()=>no(Ve,oi),[Ve]),kn=$t(()=>Un(Wt),[Un,Wt]),Rn=$t(()=>({contactMapRecords:l,contactMapRecordMap:p,filteredItems:kn,searchQuery:Ve,searchTerm:be,isSearching:Et,isIndexBuilding:Te,isPending:_,hasSearchTerm:rn,enableHighlighting:S,openEmailsWithGmail:N,isSearchInProgress:mt,isSearchTabActive:Q==="search",errorMessage:Mt??null,isStreamingComplete:m,isStreamingFailed:f}),[l,p,kn,Ve,be,Et,Te,_,rn,S,N,mt,Q,Mt,m,f]),I=rn?Wt.length:l.length,oe=ne(r,l.length),ce=ne(r,Wt.length),Rt=`${`${At} scrollbar-hidden ${E.subtle} ${s.fg}`}${Q==="search"?" h-full min-h-0":""}`;return le("div",{"data-contact-map-search-page":"",className:Rt,children:Pe(or,{value:Q,onValueChange:Ue,className:`flex flex-col${Q==="search"?" h-full min-h-0":""}`,children:[Pe($n,{ref:ye,"data-contact-map-page-tabs":"",style:ud,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 ${E.subtle} transition-colors ${s.fgSecondary}`,onPointerDown:Me,onPointerMove:Qt,onPointerUp:Jt,onPointerLeave:Tt,onPointerCancel:Be,onClickCapture:ze,children:[Pe(Kt,{value:"search",className:`min-h-11 min-w-16 px-2 py-0 ${x} transition-colors @min-[640px]/aqcm-root:min-w-24 @min-[640px]/aqcm-root:px-2.5`,children:["\u{1F50D} ",d.searchTab]}),Pe(Kt,{value:"settings",className:`min-h-11 min-w-16 px-2 py-0 ${x} transition-colors @min-[640px]/aqcm-root:min-w-24 @min-[640px]/aqcm-root:px-2.5`,children:["\u2699\uFE0F ",d.searchSettings]}),Pe(Kt,{value:"statistics",className:`min-h-11 min-w-16 px-2 py-0 ${x} transition-colors @min-[640px]/aqcm-root:min-w-24 @min-[640px]/aqcm-root:px-2.5`,children:["\u{1F4CA} ",d.searchStatistics]})]}),le(jt,{value:"search",className:"mt-0 flex h-full min-h-0 flex-col overflow-hidden",children:Pe("div",{className:"flex min-h-0 flex-1 flex-col",children:[le("div",{className:`rounded-md border ${F.borderSubtle} ${E.surface} shadow-sm transition-colors`,children:Pe("div",{className:"flex flex-col",children:[le("div",{className:"relative",children:Pe("div",{className:"flex items-center gap-1 p-1",children:[Pe("button",{type:"button",onClick:_r,"aria-pressed":se,title:Ae,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 @min-[640px]/aqcm-root:min-w-12 @min-[640px]/aqcm-root:px-2 ${se?`border-transparent ${ve.blue} ${s.onPrimary} ${Ut.blue}`:`${za.amber} ${Z.amber} ${u.amber} ${M.hoverSurface}`}`,children:[le("span",{children:se?d.operatorAnd:d.operatorOr}),le("span",{className:`hidden ${R} @min-[640px]/aqcm-root:inline`,children:se?d.operatorAndHint:d.operatorOrHint})]}),le("input",{ref:b,"data-contact-map-search-field":"",type:"text",value:k,onChange:Pr,placeholder:d.searchPlaceholder,className:`min-h-11 flex-1 rounded border ${F.borderControl} border-solid px-2 pointer-coarse:text-base ${x} shadow-sm transition-colors ${M.focusBorder} focus:ring-1 ${M.focusRing} ${E.surface} ${s.fg}`}),k&&le("button",{type:"button",onClick:wr,className:`flex min-h-11 min-w-11 items-center justify-center gap-1 rounded border ${F.borderControl} px-1.5 ${x} transition-colors ${M.hoverFg} @min-[640px]/aqcm-root:px-2 ${s.fgMuted}`,title:mt?d.searchBusyTitle:d.clearSearch,"aria-label":mt?void 0:d.clearSearch,disabled:mt,children:mt?Pe(ii,{children:[le(nd,{"aria-hidden":"true",className:"h-3 w-3 animate-spin @min-[640px]/aqcm-root:h-3.5 @min-[640px]/aqcm-root:w-3.5"}),le("span",{className:"hidden @min-[640px]/aqcm-root:inline",children:d.searching})]}):"\u2715"})]})}),Pe("p",{className:`px-1.5 py-0.5 ${R} ${s.fgSecondary} transition-colors`,children:[d.registeredCountLabel," ",le("span",{className:`font-semibold ${x} ${s.fg}`,children:oe})," ",d.recordUnit(oe),Te?Pe("span",{className:`ml-1.5 inline-flex items-center rounded ${Z.blue} px-1.5 py-0.2 ${u.blue}`,children:["\u23F3 ",d.rebuildingIndex]}):null,Mt?Pe("span",{className:`ml-1.5 inline-flex items-center rounded ${Z.rose} px-1.5 py-0.2 ${u.rose}`,children:["\u26A0\uFE0F ",d.errorLabel,le("span",{className:"ml-1 break-all font-semibold",children:Mt})]}):null,rn&&Pe("span",{className:`ml-1.5 ${u.blue}`,children:["| ",d.resultCountLabel,mt?le("span",{className:"ml-1 font-semibold",children:d.searching}):Pe(ii,{children:[le("span",{className:`ml-1 font-semibold ${x} ${s.fg}`,children:ce}),le("span",{className:"ml-0.5",children:d.resultUnit(ce)})]})]})]}),le("div",{className:"h-2.5 px-2 pb-1.5",children:Te?le(To,{className:`h-1 ${Pt.progressTrack}`,indicatorClassName:Ge.blue}):null})]})}),a?a(Rn):le(ti,{context:Rn})]})}),le(jt,{value:"settings",className:"mt-0",children:le(Ea,{searchOptions:g,setSearchOptions:v,enableHighlighting:S,setEnableHighlighting:T,openEmailsWithGmail:N,setOpenEmailsWithGmail:U,activeTab:q,onTabChange:W})}),le(jt,{value:"statistics",className:"mt-0",children:le(La,{performanceMetrics:nt,searchTerm:be,totalDataCount:l.length,resultsCount:I,resetStats:zn,rebuildIndex:nn,isIndexBuilding:Te,activeTab:K,onTabChange:G})})]})})};ge();import{memo as fd,useState as gd}from"react";import{jsx as ui,jsxs as yd}from"react/jsx-runtime";var hd=(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:""}}},Pa=fd(({phase:e,loadedCount:t})=>{let n=ee(),[a,i]=gd(()=>({phase:e,status:"",alert:""})),o=a.phase===e?a:hd(e,t,n);return o!==a&&i(o),yd("span",{"data-testid":"contact-map-stream-announcer",className:"sr-only",children:[ui("span",{role:"status",children:o.status}),ui("span",{role:"alert",children:o.alert})]})});Pa.displayName="ContactMapStreamAnnouncer";import{memo as bd,useId as Sd,useLayoutEffect as wa,useRef as kr,useState as Cd}from"react";ge();ue();pn();Ee();import{jsx as Yt,jsxs as Ld}from"react/jsx-runtime";var mi="shrink-0 pb-2",vd=`flex items-center gap-2 rounded-md border ${$.rose} ${Z.rose} px-[11px] py-[3px] ${u.rose} ${x}`,xd=`inline-flex min-h-11 min-w-11 shrink-0 items-center justify-center rounded border ${F.borderControl} ${E.surface} px-[11px] font-semibold ${u.rose} ${x} transition-colors ${M.hoverRoseTint} ${it}`,Td=e=>e==="failed"||ir(e),pi=(e,t)=>{wa(()=>{let n=e.current;return()=>{n?.contains(n.ownerDocument.activeElement)&&(t.current=Co(n))}},[e,t])},Nd=({loadedCount:e,errorMessage:t,onRetry:n,leftWithFocusRef:a})=>{let i=ee(),o=Sd(),r=kr(null);return pi(r,a),Yt("div",{className:mi,children:Ld("div",{ref:r,role:"group","aria-labelledby":o,"data-testid":"contact-map-stream-failure-notice","data-phase":"failed",className:vd,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:xd,children:i.streamRetry})]})})},Ed=(e,t)=>Object.freeze({kind:e,place:"read",deniedSentence:null,retry:t}),Md=({kind:e,onRetry:t,accessFailure:n,leftWithFocusRef:a})=>{let i=kr(null),o=kr(t);wa(()=>{o.current=t});let[r]=Cd(()=>Ed(e,()=>o.current()));return pi(i,a),Yt("div",{ref:i,"data-testid":"contact-map-stream-access-failure","data-phase":e,className:mi,children:n(r)})},_a=bd(({phase:e,accessFailureNumber:t,loadedCount:n,errorMessage:a,onRetry:i,accessFailure:o})=>{sr(o,"ContactMapStreamFailureNotice accessFailure"),lo(t,"ContactMapStreamFailureNotice accessFailureNumber");let r=kr(null);return wa(()=>{let d=r.current;d!==null&&(r.current=null,vo(d))}),Td(e)?e==="failed"?Yt(Nd,{loadedCount:n,errorMessage:a,onRetry:i,leftWithFocusRef:r}):Yt(Md,{kind:e,onRetry:i,accessFailure:o,leftWithFocusRef:r},t):null});_a.displayName="ContactMapStreamFailureNotice";import{jsx as Dt,jsxs as gi}from"react/jsx-runtime";var kd=({accessFailure:e,renderHeader:t,title:n,onFooterVisibilityChange:a})=>{let i=ee(),o=n===void 0?i.appTitle:n,{context:r,retryNow:d}=ur(),l=Dt(ia,{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:`${At} flex h-full w-full flex-col`,children:[Dt(Pa,{phase:r.streamPhase,loadedCount:r.loadedCount}),t?t({title:o,annotation:l}):gi("div",{"data-testid":"contact-map-default-header",className:"mb-2 flex items-center justify-between",children:[Dt("h1",{className:"font-bold text-xl",children:o}),l]}),Dt(_a,{phase:r.streamPhase,accessFailureNumber:r.streamAccessFailureNumber,loadedCount:r.loadedCount,errorMessage:r.errorMessage,onRetry:d,accessFailure:e}),Dt("div",{className:"min-h-0 flex-1",children:Dt(ci,{streamState:r,onFooterVisibilityChange:a})})]})},Hh=e=>{let t=Le(e,"accessFailure");sr(t,"ContactMapAppView accessFailure");let n=Ct(),a=Le(e,"streamEndpoint"),i=Le(e,"workerUrls"),o=Le(e,"locale"),r=Le(e,"labels"),d=fi(()=>({...n,streamEndpoint:a===void 0?n.streamEndpoint:a,workerUrls:bn(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]),l=o!==void 0,p=r!==void 0,m=fi(()=>({locale:l?"ContactMapAppView locale":"locale",labels:p?"ContactMapAppView labels":"labels"}),[l,p]);return Dt(la,{config:d,chromeSurface:m,children:Dt(kd,{...e,accessFailure:t})})};zt();ge();import{createShouldRevalidate as Rd}from"@aiquants/route-revalidation";var Kh=Rd({submissions:"url",query:{ignore:[Sn,"q"]}});export{Vr as AdvancedSearchSettings,Kr as BasicSearchSettings,bt as CONTACT_MAP_LABEL_CATALOGS,wn as CONTACT_MAP_LABEL_KEYS,ro as ContactDetailGrid,yn as ContactDetailPanel,Jn as ContactDetailPopup,Zn as ContactDetailRowLayout,ia as ContactMapAnnotation,Hh as ContactMapAppView,qs as ContactMapConfigProvider,Fo as ContactMapSearchListView,ci as ContactMapSearchPage,ti as ContactMapSearchTabGroup,ei as ContactMapSearchTreeView,Pa as ContactMapStreamAnnouncer,lr as ContactMapStreamClient,_a as ContactMapStreamFailureNotice,xe as HighlightedText,xa as IndexWorkerSettings,Gp as LIST_COLLAPSE_THRESHOLD,Gl as LIST_DETAIL_PANEL_MIN_WIDTH,Xp as LIST_EXPAND_THRESHOLD,ql as LIST_PANEL_MIN_WIDTH,Xl as LIST_RESIZE_HANDLE_THICKNESS,Na as LevenshteinWorkerSettings,To as Progress,Ea as SearchOptionsPanel,A as StatItem,La as StatisticsPanel,br as SwipeOverlay,Of as TREE_COLLAPSE_THRESHOLD,Mc as TREE_DETAIL_PANEL_MIN_WIDTH,$f as TREE_EXPAND_THRESHOLD,Ec as TREE_PANEL_MIN_WIDTH,Lc as TREE_RESIZE_HANDLE_THICKNESS,or as Tabs,jt as TabsContent,$n as TabsList,Kt as TabsTrigger,Mr as TreeWorkerSession,Nn as WorkerStatsSection,cr as assertContactMapStreamEndpoint,po as assertContactMapTreeWorkerUrl,$m as assertContactMapWorkerUrls,$c as composeTreeVirtualScrollOptions,Kh as contactMapShouldRevalidate,il as countContactMapCompanies,Js as deserializeStreamRecord,tl as getContactMapStreamClient,hc as getTreeWorkerSession,bn as layerContactMapWorkerUrls,Jm as resetContactMapStreamClientForTesting,lf as resetTreeWorkerSessionForTesting,Fr as resolveContactMapLabels,Ho as useAnimatedNumber,Ct as useContactMapConfig,ee as useContactMapLabels,ol as useContactMapStream,Ot as useHorizontalDragScroll,gr as useLongPressPopup,sc as useReportPopupVisibility,hr as useResponsiveTwoColumnLayout,ic as useRowPopupRegistry,ur as useStreamedContactMapContext,Ko as useTreeWorker};