Simple
Field
Semantic
IntelX AI Search
Image
Search
Legal
/* Patent Valuation - Start - 20260329 */
patentValuationPatentNumber: '',
validationErrorForPatentValuation: '',
patentValuationFormData: {},
patentValuationLoading: false,
patentValuationStreaming: false,
patentValuationError: '',
patentValuationSessionId: '',
patentValuationResultWindow: null,
patentValuationStreamAbortController: null,
patentValuationStreamBuffer: '',
patentValuationResult: {
patent_number: '',
title: '',
assignee: '',
publication_date: '',
filing_date: '',
family_size: '',
family_id: '',
invention_id: '',
jurisdictions: [],
cpc_codes: [],
independent_claim_count: '',
overall_score: null,
legal_score: null,
novelty_score: null,
market_score: null,
monetization_score: null,
technical_score: null,
risk_score: null,
estimated_value: '',
valuation_range_low: '',
valuation_range_high: '',
overview_summary: '',
novelty_summary: '',
legal_summary: '',
market_summary: '',
monetization_summary: '',
novelty_details: {},
legal_details: {},
market_details: {},
monetization_details: {},
session_id: '',
user_id: '',
status: 'idle',
events: []
},
patentValuationSummary: {
patent_number: '',
title: '',
assignee: '',
family_id: '',
invention_id: '',
jurisdictions: '',
publication_date: '',
filing_date: '',
family_size: '',
cpc_codes: [],
independent_claim_count: ''
},
/* Patent Valuation - End - 20260329 */
legalGenericFilterType: 'General Fields',
legalGenericLists: ['', '', '', '', '', '', ''],
legalGenericActiveListsForInput: ['', '', '', '', '', '', ''],
legalGenericandOr: ['and', 'and', 'and', 'and', 'and', 'and', 'and'],
legalGenericListsWithMappedData: ['', '', '', '', '', '', ''],
legalGenericShowInputTypes: false,
legalGenericselectedIndex: -1,
legalGenericUpdatedRequests: [],
imageSearchFilterType: 'General Fields',
imageSearchLists: ['', '', '', '', '', '', ''],
imageSearchActiveListsForInput: ['', '', '', '', '', '', ''],
imageSearchandOr: ['and', 'and', 'and', 'and', 'and', 'and', 'and'],
imageSearchListsWithMappedData: ['', '', '', '', '', '', ''],
imageSearchShowInputTypes: false,
imageSearchselectedIndex: -1,
imageSearchUpdatedRequests: [],
file: null,
preview: '',
error: '',
uploading: false,
progress: 0,
uploadedUrl: '',
imageSearchMessage: '',
searchId: '',
legalLiFilterType: 'General Fields',
legalLiGenactiveLists: ['', '', '', '', '', '', ''],
legalLiGenactiveListsForInput: ['', '', '', '', '', '', ''],
legalLiGenandOr: ['and', 'and', 'and', 'and', 'and', 'and', 'and'],
legalLiGenactiveListsWithMappedData: ['', '', '', '', '', '', ''],
legalLiGenshowInputTypes: false,
legalLiGenselectedIndex: -1,
legalLiGenupdatedRequets: [],
legalReFilterType: 'General Fields',
legalReGenactiveLists: ['', '', '', '', '', '', ''],
legalReGenactiveListsForInput: ['', '', '', '', '', '', ''],
legalReGenandOr: ['and', 'and', 'and', 'and', 'and', 'and', 'and'],
legalReGenactiveListsWithMappedData: ['', '', '', '', '', '', ''],
legalReGenshowInputTypes: false,
legalReGenselectedIndex: -1,
legalReGenupdatedRequets: [],
legalLicensingFilterType: 'General Fields',
legalLicensingGenactiveLists: ['', '', '', '', '', '', ''],
legalLicensingGenactiveListsForInput: ['', '', '', '', '', '', ''],
legalLicensingGenandOr: ['and', 'and', 'and', 'and', 'and', 'and', 'and'],
legalLicensingGenactiveListsWithMappedData: ['', '', '', '', '', '', ''],
legalLicensingGenshowInputTypes: false,
legalLicensingGenselectedIndex: -1,
legalLicensingGenupdatedRequets: [],
legalAssignmentsFilterType: 'General Fields',
legalAssignmentsGenactiveLists: ['', '', '', '', '', '', ''],
legalAssignmentsGenactiveListsForInput: ['', '', '', '', '', '', ''],
legalAssignmentsGenandOr: ['and', 'and', 'and', 'and', 'and', 'and', 'and'],
legalAssignmentsGenactiveListsWithMappedData: ['', '', '', '', '', '', ''],
legalAssignmentsGenshowInputTypes: false,
legalAssignmentsGenselectedIndex: -1,
legalAssignmentsGenupdatedRequets: [],
legalPledgeFilterType: 'General Fields',
legalPledgeGenactiveLists: ['', '', '', '', '', '', ''],
legalPledgeGenactiveListsForInput: ['', '', '', '', '', '', ''],
legalPledgeGenandOr: ['and', 'and', 'and', 'and', 'and', 'and', 'and'],
legalPledgeGenactiveListsWithMappedData: ['', '', '', '', '', '', ''],
legalPledgeGenshowInputTypes: false,
legalPledgeGenselectedIndex: -1,
legalPledgeGenupdatedRequets: [],
checkedCountries: [],
checkedAssignees: [],
checkedInventors: [],
checkedPatentTypes: [],
summary_title: '',
summary_publicationNumber: '',
summary_currentAssignee: '',
summary_applicationDate: '',
summary_publicationDate: '',
summary_patentAbstract: '',
summary_claims: '',
articleObj: null,
searchResults: [],
isResult: false,
isResultForList: false,
searchQuery: '',
proximity: false,
selectedAuthor: '',
selectedType: '',
selectedStartDate: '',
selectedEndDate: '',
searchType: 'Simple',
primaryView: '',
filterAppliedOnSearchType: '',
patentType: false,
allDatabase: false,
application: false,
patents: false,
utilityModels: false,
designs: false,
text: false,
classification: false,
date: false,
number: false,
legalStatus: '',
darkMode: false,
viewType: 'list',
detailTitle: '',
detailDescription: '',
text_titleAbstract: false,
text_title: false,
text_titleAbstractClaims: false,
text_titleAbstractClaimsDescription: false,
text_abstract: false,
text_claims: false,
text_description: false,
text_technicalField: false,
text_summaryOfInnovation: false,
text_titleAbstract_input: '',
text_title_input: '',
text_titleAbstractClaims_input: '',
text_titleAbstractClaimsDescription_input: '',
text_abstract_input: '',
text_claims_input: '',
text_description_input: '',
text_technicalField_input: '',
text_summaryOfInnovation_input: '',
classification: '',
startDate: '',
endDate: '',
patentNumber: '',
selectedCountry: '',
text_backgroundArt: false,
text_backgroundArt_input: '',
classification_patentClassification: false,
classification_ipc: false,
classification_cpc: false,
classification_patentClassification_input: '',
classification_ipc_input: '',
classification_cpc_input: '',
assignee_input: '',
assignee_all_assignee: '',
assignee_current_assignee: '',
assignee_original_assignee: '',
assignee_first_original_assignee: '',
assignee_first_current_assignee: '',
dateType: '',
num_publication_no: false,
num_app_no: false,
num_priority_no: false,
num_pctPubl_no: false,
num_pctApp_no: false,
num_publication_no_input: '',
num_app_no_input: '',
num_priority_no_input: '',
num_pctPubl_no_input: '',
num_pctApp_no_input: '',
citation_cite_patent: false,
citation_citedBy_patent: false,
citation_simple_family: false,
citation_cite_patent_input: '',
citation_citedBy_patent_input: '',
citation_simple_family_input: '',
inventorName: '',
inventor_name: '',
legal_status: '',
semanticSearchQuery: '',
semanticSearchGranularity: 'high',
errorModalMsg: '',
legalCountries: [
{
"capital": "Washington, D.C.",
"code": "us",
"continent": "North America",
"flag_1x1": "flags/1x1/us.svg",
"flag_4x3": "flags/4x3/us.svg",
"iso": true,
"name": "United States of America",
"type": "IP Countries"
},
],
selectedLegalCountries: ['us'],
countries: countriesData,
similarReads: [],
countryCodes: "",
appNo: '',
totalHits: '',
confidenceSearchData: null,
pageNumber: 1,
patentTypes: [
{
"name": "Patent/Utility Patents",
"value": "Utility Patent"
},
{
"name": "Design",
"value": "Design Patent"
},
{
"name": "Plant Patents",
"value": "Plant Patent"
}
],
totalPages: 1,
noOfResultsInPage: 25,
totalResultsToBeShown: 0,
assignees: [],
fetchedCountries: [],
inventors: [],
fetchedYears: [],
fetchedLiveCountries: [],
fetchedLiveAssignees: [],
fetchedLiveCatchWords: [],
lastSearchType: 'Simple',
lastSearchSubType: 'Legal',
emailNotification: false,
isEmailNotificationClicked: false,
emailNotificationAlias: '',
frequentSearchHistory: [],
lastSearchHistory: [],
companyNameForAlert: '',
cpcIpcForAlert: '',
showSubmittedCreatedAlertText: false,
showSubmittedCreatedAlertButton: false,
selectedPatentTypes: [],
selectedCountries: [],
allDb: false,
updatedRequets: [],
selectedHelperButton: '',
selectedHelperDetails: '',
selectIpCountry: false,
legalTab: 'Legal',
currentResultSearchType: '',
litigationCaseNo: '',
hideActionButtons: false,
litigationModalType: '',
litigationAttorneys: [],
litigationDocuments: [],
litigationPatents: [],
litigationParties: [],
allCountries: ["wo", "us", "ep", "jp", "kr", "wo", "us", "ep", "jp", "kr", "af", "ax", "al", "dz", "as", "ad", "ao", "ai", "aq", "ag", "ar", "am", "aw", "sh-ac", "au", "at", "az", "bs", "bh", "bd", "bb", "es-pv", "by", "be", "bz", "bj", "bm", "bt", "bo", "bq", "ba", "bw", "bv", "br", "io", "bn", "bg", "bf", "bi", "cv", "kh", "cm", "ca", "ic", "es-ct", "ky", "cf", "cefta", "td", "cl", "cn", "cx", "cp", "cc", "co", "km", "ck", "cr", "hr", "cu", "cw", "cy", "cz", "ci", "cd", "dk", "dg", "dj", "dm", "do", "eac", "ec", "eg", "sv", "gb-eng", "gq", "er", "ee", "sz", "et", "eu", "fk", "fo", "fm", "fj", "fi", "fr", "gf", "pf", "tf", "ga", "es-ga", "gm", "ge", "de", "gh", "gi", "gr", "gl", "gd", "gp", "gu", "gt", "gg", "gn", "gw", "gy", "ht", "hm", "va", "hn", "hk", "hu", "is", "in", "id", "ir", "iq", "ie", "im", "il", "it", "jm", "je", "jo", "kz", "ke", "ki", "xk", "kw", "kg", "la", "lv", "arab", "lb", "ls", "lr", "ly", "li", "lt", "lu", "mo", "mg", "mw", "my", "mv", "ml", "mt", "mh", "mq", "mr", "mu", "yt", "mx", "md", "mc", "mn", "me", "ms", "ma", "mz", "mm", "na", "nr", "np", "nl", "nc", "nz", "ni", "ne", "ng", "nu", "nf", "kp", "mk", "gb-nir", "mp", "no", "om", "pc", "pk", "pw", "pa", "pg", "py", "pe", "ph", "pn", "pl", "pt", "pr", "qa", "cg", "ro", "ru", "rw", "re", "bl", "sh-hl", "sh", "kn", "lc", "mf", "pm", "vc", "ws", "sm", "st", "sa", "gb-sct", "sn", "rs", "sc", "sl", "sg", "sx", "sk", "si", "sb", "so", "za", "gs", "ss", "es", "lk", "ps", "sd", "sr", "sj", "se", "ch", "sy", "tw", "tj", "tz", "th", "tl", "tg", "tk", "to", "tt", "sh-ta", "tn", "tm", "tc", "tv", "tr", "ug", "ua", "ae", "gb", "un", "um", "xx", "uy", "uz", "vu", "ve", "vn", "vg", "vi", "gb-wls", "wf", "eh", "ye", "zm", "zw"],
isChecked: false,
selectedAssignees: [],
selectedInventors: [],
noveltySearchKeyword: '',
noveltySearchValidation: false,
gainConfidenceKeyword: '',
gainConfidenceValidation: false,
savedSearches: [],
familyType: '',
createAlertValidationError: false,
refineSearchType: '',
cpcCodesWithDescriprions: [],
showCpcIpc: false,
loadingStatus: {},
appliedFilters: {},
filtersNotToUpdate: [],
alertToDelete : '',
//sort
sortField: "publication-date",
sortOrder: "ASC",
isSortActive : false,
},
computed: {
fileName() {
return this.file ? this.file.name : ''
},
formattedSize() {
if (!this.file) return ''
const kb = Math.round(this.file.size / 1024)
return kb >= 1024 ? (kb / 1024).toFixed(2) + ' MB' : kb + ' KB'
},
filteredResults() {
/*return this.searchResults.filter(({ publicationNumber, currentAssignee, inventor }) => {
return (this.checkedAssignees.length === 0 || (this.checkedAssignees.includes(currentAssignee))) && (this.checkedInventors.length === 0 || (this.checkedInventors.includes(inventor)));
})*/
return this.searchResults;
}
},
mounted() {
var urlParams = new URLSearchParams(window.location.search);
if (urlParams.has('session-id')) {
this.currentSessionId = urlParams.get('session-id');
if (urlParams.has('assignee')) {
this.paramValue = urlParams.get('assignee');
this.getLastSearchDataFromSession(this.currentSessionId, this.paramValue, 'assignee');
}
if (urlParams.has('inventor')) {
this.paramValue = urlParams.get('inventor');
this.getLastSearchDataFromSession(this.currentSessionId, this.paramValue, 'inventor');
}
if (urlParams.has('country')) {
this.paramValue = urlParams.get('country');
this.getLastSearchDataFromSession(this.currentSessionId, this.paramValue, 'country');
}
if (urlParams.has('year')) {
this.paramValue = urlParams.get('year');
this.getLastSearchDataFromSession(this.currentSessionId, this.paramValue, 'year');
}
};
this.startTimer();
//To fix the issue for Browser stuck issue during pagination - Start
//this.getAllCPCCode();
//To fix the issue for Browser stuck issue during pagination - End
this.$nextTick(this.addPatentImgClickListener);
// 🔹 check if query string exists
if (urlParams.has("image-search")) {
this.getImageSearchResultsFromLink(urlParams.get("image-search"))
}
},
updated() {
this.$nextTick(this.addPatentImgClickListener);
},
watch: {
},
ready: function () {
/*var idToken = localStorage.getItem('idToken');
var accessToken = localStorage.getItem('accessToken');
var refreshToken = localStorage.getItem('refreshToken');
console.log('idToken :' +idToken);
console.log('accessToken :' +accessToken);
console.log('idToken :' +idToken);*/
},
beforeMount() {
//this.getUserInfo();
//this.displayUserName();
},
methods: {
//sort
setOrder(order) {
this.sortOrder = order;
this.triggerSort();
},
triggerSort() {
// reset page if needed
this.pageNumber = 1;
// reuse your existing search pipeline
this.filterResultSetWithOtherParameters(null, 'Sort', false);
},
showSortBar() {
this.isSortActive = !this.isSortActive; // toggle
},
/**
* Not being used currently,
*/
showImgEnhanceModal(){
$('#imageModal').modal('show');
},
/**
* Shows compare button for IntelxAi search with US/EP/WO countries or valid familyId
*/
showCompareBtn(elem) {
if (this.searchType !== 'IntelxAi') {
return false;
}
const allowedCountryCodes = ['US', 'EP', 'WO'];
if (allowedCountryCodes.includes(elem.countryCode)) {
return true;
}
return typeof elem.familyId === 'string' && elem.familyId.length > 0;
},
allowUserForNewImageSearch: function () {
this.searchResults = [];
//this.showFieldSearchPanel = true;
// Remove query string without reloading page
if (window.history.replaceState) {
const cleanUrl = window.location.origin + window.location.pathname;
window.history.replaceState({}, document.title, cleanUrl);
}
},
showReportIssueView: function(){
this.searchType = '';
$('.searchTypeButton').removeClass("leftSelectorRadio");
this.primaryView = 'report-issue-view';
},
showAssigneeReportView: function(){
this.searchType = '';
$('.searchTypeButton').removeClass("leftSelectorRadio");
this.primaryView = 'assignee-report-view';
$('.assignee_report').addClass("leftSelectorRadio");
},
/*Image Uploader*/
/* browse() {
this.$refs.fileInput && this.$refs.fileInput.click()
},
validateFile(f) {
this.error = ''
const MAX_SIZE = 5 * 1024 * 1024
if (!f.type.startsWith('image/')) {
this.error = 'Please select an image file.'
return false
}
if (f.size > MAX_SIZE) {
this.error = 'File too large. Max 5 MB.'
return false
}
return true
},
onFileChange(e) {
const f = e.target.files && e.target.files[0]
if (!f) return
this.handleFile(f)
},
onDrop(e) {
const f = e.dataTransfer.files && e.dataTransfer.files[0]
if (!f) return
this.handleFile(f)
},
handleFile(f) {
if (!this.validateFile(f)) {
this.file = null
this.preview = ''
return
}
this.file = f
const reader = new FileReader()
reader.onload = (evt) => {
this.preview = evt.target.result
}
reader.readAsDataURL(f)
},
clear() {
this.file = null
this.preview = ''
this.error = ''
this.progress = 0
this.uploadedUrl = ''
if (this.$refs.fileInput) this.$refs.fileInput.value = null
},
upload() {
if (!this.file) {
this.error = 'No file selected'
return
}
this.uploading = true
this.progress = 0
this.error = ''
this.uploadedUrl = ''
const form = new FormData()
form.append('Image', this.file)
const xhr = new XMLHttpRequest()
xhr.open('POST', '/upload')
xhr.upload.onprogress = (e) => {
if (e.lengthComputable) {
this.progress = Math.round((e.loaded / e.total) * 100)
}
}
xhr.onload = () => {
this.uploading = false
if (xhr.status >= 200 && xhr.status < 300) {
try {
const res = JSON.parse(xhr.responseText)
this.uploadedUrl = res.url || ''
} catch (err) {
this.uploadedUrl = xhr.responseText
}
} else {
this.error = 'Upload failed (' + xhr.status + ')'
}
}
xhr.onerror = () => {
this.uploading = false
this.error = 'Upload error. Check your connection or server.'
}
xhr.send(form)
},*/
//Storing data to perform pagination in view details page (previous search results)
storeDataForPagination: function (payload, curPage, totalPages) {
try {
const data = {
payload: payload,
curPage: curPage,
totalPages: totalPages
};
const jsonString = JSON.stringify(data);
localStorage.setItem("paginationData", jsonString);
} catch (error) {
console.error("Failed to store data:", error);
}
},
// save last search and go to analytics
goToAnalyticsPage: function () {
this.userId = document.getElementById('userIdHolder').innerHTML;
this.partialUserId = this.userId.split('@')[0];
const timestamp = Date.now().toString();
this.sessionId = this.partialUserId + '-intelx-' + timestamp;
if (this.lastSearchType == 'Simple') {
this.searchCriteriaForAnalytics = this.simpleSearchFormData;
} if (this.lastSearchType == 'Semantic') {
this.searchCriteriaForAnalytics = this.semanticSearchFormData;
} else if (this.lastSearchType == 'Field') {
this.searchCriteriaForAnalytics = this.fieldSearchFormData;
}
let formData = {
"sessionId": this.sessionId,
"searchRequest": JSON.stringify(this.searchCriteriaForAnalytics),
};
axios({
method: "post",
url: hostName + pathName + '/user/session/save',
data: formData,
// Authorization header is automatically added by the interceptor
headers: { "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
window.open('analytic.html?session-id=' + this.sessionId, '_blank');
})
.catch(error => {
console.error('Error:', error);
});
},
getLastSearchDataFromSession: function (currentSessionId, paramValue, filterType) {
document.getElementById("loading").style.display = "block";
document.getElementById("mainBody").style.overflowY = "hidden";
axios({
method: "get",
url: hostName + pathName + '/user/session/' + currentSessionId,
/*data: formData,*/
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
this.filteredFormData = response.data;
if (filterType == 'assignee') {
this.filteredFormData.additionalFilter.current_assignee = [paramValue];
this.selectedAssignees = [paramValue];
}
if (filterType == 'inventor') {
this.filteredFormData.additionalFilter.inventor_name = [paramValue];
this.selectedInventors = [paramValue];
}
if (filterType == 'country') {
this.filteredFormData.selectedCountries = [paramValue];
this.selectedCountries = [paramValue];
}
if (filterType == 'year') {
this.filteredFormData.additionalFilter.publication_year = [paramValue];
}
if (this.filteredFormData.searchType == 'Simple') {
this.commonSimpleSearch(this.filteredFormData);
} else if (this.filteredFormData.searchType == 'Field') {
this.commonFieldSearch(this.filteredFormData);
} else if (this.filteredFormData.searchType == 'Semantic') {
this.commonSemanticSearch(this.filteredFormData);
} else {
return;
}
}.bind(this));
},
commonSimpleSearch: function (filteredFormData) {
this.searchQuery = filteredFormData.searchKey;
if (!this.searchQuery) {
this.validationErrorForSimpleSearch = 'Please Enter a Search Keyword';
return;
} else {
document.getElementById("loading").style.display = "block";
document.getElementById("mainBody").style.overflowY = "hidden";
$("#advertisementCards").css({ "display": "none" });
this.userId = document.getElementById('userIdHolder').innerHTML;
this.simpleSearchFormData = filteredFormData;
// maintain proximity setting on every request
this.simpleSearchFormData.proximity = this.proximity;
this.simpleSearchFormData.pageNumber = this.currentPage;
let formData = this.simpleSearchFormData;
/*console.log(formData);*/
axios({
method: "post",
// url: "http://zenx-intelx-dev.us-west-2.elasticbeanstalk.com/intelx/api/legal/search",
url: hostName + pathName + gl_simpleSearch,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
console.log(response.data);
if (!response.data.searchResults) {
this.searchResults = [];
this.noResultsFound = true;
this.lastSearchType = 'Simple';
this.lastSearchSubType = 'Simple';
this.currentResultSearchType = 'Simple';
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
return;
} else {
this.noResultsFound = false;
this.searchResults = response.data.searchResults;
this.totalHits = response.data.totalHits;
this.isResultForList = true;
this.similarReads = this.searchResults;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage);
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
this.lastSearchType = 'Simple';
this.lastSearchSubType = 'Simple';
this.currentResultSearchType = 'Simple';
var previousResults = this.searchResults;
localStorage.setItem('previousResults', JSON.stringify(previousResults));
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
this.removeFilters(['refinedSearch']);
if (this.currentPage === 1) this.pageNumber = 1;
this.currentPage = 1;
this.storeDataForPagination(this.simpleSearchFormData, this.pageNumber, this.totalPages);
// graph data
axios({
method: "post",
url: hostName + pathName + gl_assignees_count_simple,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.assignees = response.data;
// Display fetched data
localStorage.setItem('graphDataForAssignee', JSON.stringify(this.assignees));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_inventors_count_simple,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.inventors = response.data;
// Display fetched data
localStorage.setItem('graphDataForInventors', JSON.stringify(this.inventors));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_countries_count_simple,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedCountries = response.data;
// Display fetched data
// this.selectedCountriesForFilter = this.fetchedCountries.map(item => item.name);
localStorage.setItem('graphDataForCountries', JSON.stringify(this.fetchedCountries));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_years_count_simple,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedYears = response.data;
// Display fetched data
localStorage.setItem('graphDataForYears', JSON.stringify(this.fetchedYears));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_live_countries_count_simple,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedLiveCountries = response.data;
// Display fetched data
localStorage.setItem('graphDataForLiveCountries', JSON.stringify(this.fetchedLiveCountries));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_live_assignee_count_simple,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedLiveAssignees = response.data;
// Display fetched data
localStorage.setItem('graphDataForLiveAssignees', JSON.stringify(this.fetchedLiveAssignees));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_live_catchwords_simple,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedLiveCatchWords = response.data;
// Display fetched data
localStorage.setItem('graphDataForLiveCatchWords', JSON.stringify(this.fetchedLiveCatchWords));
})
.catch(error => {
console.error('Error fetching data:', error);
});
}
}.bind(this));
}
},
commonFieldSearch: function (filteredFormData) {
document.getElementById("loading").style.display = "block";
document.getElementById("mainBody").style.overflowY = "hidden";
$("#advertisementCards").css({ "display": "none" });
this.userId = document.getElementById('userIdHolder').innerHTML;
//this.srcJson =JSON.parse(search.searchParamJson);
this.srcJson = filteredFormData;
// console.log(this.srcJson.advancedSearchFields.length);
for (i = 0; i < this.srcJson.advancedSearchFields.length; i++) {
this.activeListsForInput.unshift(this.srcJson.advancedSearchFields[i].fieldName.replaceAll('-', ' '));
this.andOr.unshift(this.srcJson.advancedSearchFields[i].condition);
this.activeListsWithMappedData.unshift(this.srcJson.advancedSearchFields[i].value);
}
console.log(this.activeListsForInput);
console.log(this.andOr);
console.log(this.activeListsWithMappedData);
//return;
document.getElementById('tab2').click();
this.fieldSearchFormData = filteredFormData;
this.fieldSearchFormData.pageNumber = this.currentPage;
let formData = this.fieldSearchFormData;
/*console.log(formData);*/
axios({
method: "post",
// url: "http://zenx-intelx-dev.us-west-2.elasticbeanstalk.com/intelx/api/legal/search",
url: hostName + pathName + gl_fieldSearch,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
console.log(response.data);
if (!response.data.searchResults) {
this.searchResults = [];
this.noResultsFound = true;
this.showFieldSearchPanel = false;
this.lastSearchType = 'Field';
this.lastSearchSubType = 'Field';
this.currentResultSearchType = 'Field';
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
return;
} else {
this.noResultsFound = false;
this.searchResults = response.data.searchResults;
this.totalHits = response.data.totalHits;
this.isResultForList = true;
this.similarReads = this.searchResults;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage);
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
/*this.assignees = response.data.countOfAssignees;
this.inventors = response.data.countOfInventors;*/
/*this.countries = response.data.countOfCountries;*/
this.showFieldSearchPanel = false;
this.lastSearchType = 'Field';
this.lastSearchSubType = 'Field';
this.currentResultSearchType = 'Field';
if (this.currentPage === 1) this.pageNumber = 1;
this.currentPage = 1;
this.storeDataForPagination(this.fieldSearchFormData, this.pageNumber, this.totalPages);
axios({
method: "post",
url: hostName + pathName + gl_assignees_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
//console.log(response.data);
this.assignees = response.data;
// Display fetched data
localStorage.setItem('graphDataForAssignee', JSON.stringify(this.assignees));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_inventors_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
//console.log(response.data);
this.inventors = response.data;
// Display fetched data
localStorage.setItem('graphDataForInventors', JSON.stringify(this.inventors));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_countries_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
//console.log(response.data);
this.fetchedCountries = response.data;
// this.countries;
/*const r = this.countries.filter(({ code: idv }) => this.fetchedCountries.every(({ name: idc }) => idv !== idc));
const newArr = this.fetchedCountries.concat(r).map((v) => v.count ? v : { ...v, count: null });
console.log(JSON.stringify(newArr));*/
// Display fetched data
// this.selectedCountriesForFilter = this.fetchedCountries.map(item => item.name);
localStorage.setItem('graphDataForCountries', JSON.stringify(this.fetchedCountries));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_years_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedYears = response.data;
// Display fetched data
localStorage.setItem('graphDataForYears', JSON.stringify(this.fetchedYears));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_live_countries_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedLiveCountries = response.data;
// Display fetched data
localStorage.setItem('graphDataForLiveCountries', JSON.stringify(this.fetchedLiveCountries));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_live_assignee_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedLiveAssignees = response.data;
// Display fetched data
localStorage.setItem('graphDataForLiveAssignees', JSON.stringify(this.fetchedLiveAssignees));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_live_catchwords,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedLiveCatchWords = response.data;
// Display fetched data
localStorage.setItem('graphDataForLiveCatchWords', JSON.stringify(this.fetchedLiveCatchWords));
})
.catch(error => {
console.error('Error fetching data:', error);
});
var previousResults = this.searchResults;
localStorage.setItem('previousResults', JSON.stringify(previousResults));
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
}
}.bind(this));
},
commonSemanticSearch: function (filteredFormData) {
this.semanticSearchQuery = filteredFormData.searchKey;
if (!this.semanticSearchQuery) {
this.validationErrorForSemanticSearch = 'Please Enter a Search Criteria';
return;
} else {
document.getElementById("loading").style.display = "block";
document.getElementById("mainBody").style.overflowY = "hidden";
$("#advertisementCards").css({ "display": "none" });
this.userId = document.getElementById('userIdHolder').innerHTML;
this.semanticSearchFormData = filteredFormData;
this.semanticSearchFormData.pageNumber = this.currentPage;
let formData = this.semanticSearchFormData;
document.getElementById('tab4').click();
/*console.log(formData);*/
axios({
method: "post",
// url: "http://zenx-intelx-dev.us-west-2.elasticbeanstalk.com/intelx/api/legal/search",
url: hostName + pathName + gl_semanticSearch,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
console.log(response.data);
if (!response.data.searchResults) {
this.searchResults = [];
this.noResultsFound = true;
this.lastSearchType = 'Semantic';
this.lastSearchSubType = 'Semantic';
this.currentResultSearchType = 'Semantic';
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
return;
} else {
this.noResultsFound = false;
this.searchResults = response.data.searchResults;
this.totalHits = response.data.totalHits;
this.isResultForList = true;
this.similarReads = this.searchResults;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage);
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
/*this.assignees = response.data.countOfAssignees;
this.inventors = response.data.countOfInventors;*/
/*this.countries = response.data.countOfCountries;*/
this.lastSearchType = 'Semantic';
this.lastSearchSubType = 'Semantic';
this.currentResultSearchType = 'Semantic';
var previousResults = this.searchResults;
localStorage.setItem('previousResults', JSON.stringify(previousResults));
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
this.removeFilters(['refinedSearch']);
if (this.currentPage === 1) this.pageNumber = 1;
this.currentPage = 1;
this.storeDataForPagination(this.semanticSearchFormData, this.pageNumber, this.totalPages);
// graph data
axios({
method: "post",
url: hostName + pathName + gl_assignees_count_semantic,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.assignees = response.data;
// Display fetched data
localStorage.setItem('graphDataForAssignee', JSON.stringify(this.assignees));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_inventors_count_semantic,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.inventors = response.data;
// Display fetched data
localStorage.setItem('graphDataForInventors', JSON.stringify(this.inventors));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_countries_count_semantic,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedCountries = response.data;
// Display fetched data
// this.selectedCountriesForFilter = this.fetchedCountries.map(item => item.name);
localStorage.setItem('graphDataForCountries', JSON.stringify(this.fetchedCountries));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_years_count_semantic,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedYears = response.data;
// Display fetched data
localStorage.setItem('graphDataForYears', JSON.stringify(this.fetchedYears));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_live_countries_count_semantic,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedLiveCountries = response.data;
// Display fetched data
localStorage.setItem('graphDataForLiveCountries', JSON.stringify(this.fetchedLiveCountries));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_live_assignee_count_semantic,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedLiveAssignees = response.data;
// Display fetched data
localStorage.setItem('graphDataForLiveAssignees', JSON.stringify(this.fetchedLiveAssignees));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_live_catchwords_semantic,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedLiveCatchWords = response.data;
// Display fetched data
localStorage.setItem('graphDataForLiveCatchWords', JSON.stringify(this.fetchedLiveCatchWords));
})
.catch(error => {
console.error('Error fetching data:', error);
});
}
}.bind(this));
}
},
//ends
showCpcIpcDropdown: function (elementId, value) {
document.getElementById(elementId).style.display = "block";
},
updateValue: function (value, elementId, inputId) {
console.log(value);
console.log(inputId);
document.getElementById(inputId).innerHTML = value;
document.getElementById(elementId).style.display = "none";
},
setGranularity: function (value) {
this.semanticSearchGranularity = value;
console.log('Granularity set to:', value);
},
// get all cpc code
getAllCPCCode: function () {
axios.get(hostName + pathName + gl_all_cpc, { headers: headers })
.then(response => {
console.log(response.data);
this.cpcCodesWithDescriprions = response.data;
// Display fetched data
})
.catch(error => {
console.error('Error fetching data:', error);
});
},
// delete alert
deleteAlert: function () {
this.userId = document.getElementById('userIdHolder').innerHTML;
axios.delete(hostName + pathName + gl_saved_search + this.userId + '/' + this.alertToDelete, { headers: headers })
.then(response => {
/*console.log(response.data);
this.savedSearches = response.data;*/
//this.litigationAttorneys = response.data;
// Display fetched data
$('#deleteModal').modal('hide');
axios.get(hostName + pathName + gl_saved_search + this.userId, { headers: headers })
.then(response => {
console.log(response.data);
this.savedSearches = response.data;
//this.litigationAttorneys = response.data;
// Display fetched data
})
})
.catch(error => {
console.error('Error fetching data:', error);
});
},
// Saved Searches
startTimer() {
setTimeout(() => {
this.getSavedSearches();
}, 3000); // 5000 milliseconds = 5 seconds
},
getSavedSearches: function () {
this.userId = document.getElementById('userIdHolder').innerHTML;
axios.get(hostName + pathName + gl_saved_search + this.userId, { headers: headers })
.then(response => {
console.log(response.data);
this.savedSearches = response.data;
//this.litigationAttorneys = response.data;
// Display fetched data
})
.catch(error => {
console.error('Error fetching data:', error);
});
},
// sorting
// inject sort into current request
applySorting(formData) {
formData.sortField = this.sortField;
formData.sortOrder = this.sortOrder;
},
// filter by Parameters
filterResultSetWithOtherParameters: function (param, type, fetchCounts = true) {
this.setAppliedFiltersData(type);
if (this.lastSearchType == "Field" && this.lastSearchSubType == 'Field') {
this.fieldSearchFormData.saveSearchEnabled = false;
this.fieldSearchFormData.additionalFilter.current_assignee = this.selectedAssignees;
this.fieldSearchFormData.selectedCountries = this.selectedCountriesForFilter;
this.fieldSearchFormData.additionalFilter.inventor_name = this.selectedInventors;
this.fieldSearchFormData.patentTypes = this.checkedPatentTypes;
if (type == 'Refine') {
if (param == 'clear') {
this.fieldSearchFormData.refinedSearchElement = {};
this.fieldSearchFormData.additionalFilter = {};
this.fieldSearchFormData.patentTypes = this.selectedPatentTypes;
this.selectedAssignees = [];
this.selectedInventors = [];
this.removeFilters(['refinedSearch']);
this.refineSearchType = 'Field';
} else {
this.fieldSearchFormData.refinedSearchElement = { value: this.refinedSearchKeyWord, filedNames: this.refinedSearchFilter };
this.fieldSearchFormData.additionalFilter = {};
this.fieldSearchFormData.patentTypes = this.selectedPatentTypes;
this.fieldSearchFormData.pageNumber = this.pageNumber
this.selectedAssignees = [];
this.selectedInventors = [];
}
}
this.applySorting(this.fieldSearchFormData);
this.fieldSearchWithFilter(fetchCounts, this.filtersNotToUpdate);
} else if (this.lastSearchType == "Image" && this.lastSearchSubType == 'Image') {
this.imageSearchFormData.saveSearchEnabled = false;
this.imageSearchFormData.additionalFilter.current_assignee = this.selectedAssignees;
this.imageSearchFormData.selectedCountries = this.selectedCountriesForFilter;
this.imageSearchFormData.additionalFilter.inventor_name = this.selectedInventors;
this.imageSearchFormData.patentTypes = this.checkedPatentTypes;
if (type == 'Refine') {
if (param == 'clear') {
this.imageSearchFormData.refinedSearchElement = {};
this.imageSearchFormData.additionalFilter = {};
this.imageSearchFormData.patentTypes = this.selectedPatentTypes;
this.selectedAssignees = [];
this.selectedInventors = [];
this.removeFilters(['refinedSearch']);
this.refineSearchType = 'Legal';
} else {
this.imageSearchFormData.refinedSearchElement = { value: this.refinedSearchKeyWord, filedNames: this.refinedSearchFilter };
this.imageSearchFormData.additionalFilter = {};
this.imageSearchFormData.patentTypes = this.selectedPatentTypes;
this.selectedAssignees = [];
this.selectedInventors = [];
}
}
this.applySorting(this.imageSearchFormData);
this.imageSearchWithFilter(fetchCounts, this.filtersNotToUpdate);
} else if (this.lastSearchType == "Legal" && this.lastSearchSubType == 'Legal') {
this.legalGenericSearchFormData.saveSearchEnabled = false;
this.legalGenericSearchFormData.additionalFilter.current_assignee = this.selectedAssignees;
this.legalGenericSearchFormData.selectedCountries = this.selectedCountriesForFilter;
this.legalGenericSearchFormData.additionalFilter.inventor_name = this.selectedInventors;
this.legalGenericSearchFormData.patentTypes = this.checkedPatentTypes;
if (type == 'Refine') {
if (param == 'clear') {
this.legalGenericSearchFormData.refinedSearchElement = {};
this.legalGenericSearchFormData.additionalFilter = {};
this.legalGenericSearchFormData.patentTypes = this.selectedPatentTypes;
this.selectedAssignees = [];
this.selectedInventors = [];
this.removeFilters(['refinedSearch']);
this.refineSearchType = 'Legal';
} else {
this.legalGenericSearchFormData.refinedSearchElement = { value: this.refinedSearchKeyWord, filedNames: this.refinedSearchFilter };
this.legalGenericSearchFormData.additionalFilter = {};
this.legalGenericSearchFormData.patentTypes = this.selectedPatentTypes;
this.selectedAssignees = [];
this.selectedInventors = [];
}
}
this.applySorting(this.legalGenericSearchFormData);
this.legalGenericSearchWithFilter(fetchCounts, this.filtersNotToUpdate)
} else if (this.lastSearchType == "Legal" && this.lastSearchSubType == 'Litigation') {
this.legalLitigationSearchFormData.saveSearchEnabled = false;
this.legalLitigationSearchFormData.additionalFilter.current_assignee = this.selectedAssignees;
this.legalLitigationSearchFormData.selectedCountries = this.selectedCountriesForFilter;
this.legalLitigationSearchFormData.additionalFilter.inventor_name = this.selectedInventors;
this.legalLitigationSearchFormData.patentTypes = this.checkedPatentTypes;
if (type == 'Refine') {
if (param == 'clear') {
this.legalLitigationSearchFormData.refinedSearchElement = {};
this.legalLitigationSearchFormData.additionalFilter = {};
this.legalLitigationSearchFormData.patentTypes = this.selectedPatentTypes;
this.selectedAssignees = [];
this.selectedInventors = [];
this.removeFilters(['refinedSearch']);
this.refineSearchType = 'Litigation';
} else {
this.legalLitigationSearchFormData.refinedSearchElement = { value: this.refinedSearchKeyWord, filedNames: this.refinedSearchFilter };
this.legalLitigationSearchFormData.additionalFilter = {};
this.legalLitigationSearchFormData.patentTypes = this.selectedPatentTypes;
this.selectedAssignees = [];
this.selectedInventors = [];
}
}
this.applySorting(this.legalLitigationSearchFormData);
this.legalLitigationSearchWithFilter(fetchCounts, this.filtersNotToUpdate)
} else if (this.lastSearchType == "Simple" && this.lastSearchSubType == 'Simple') {
// make sure proximity stays in form model for refine operations
this.simpleSearchFormData.proximity = this.proximity;
// this.simpleSearchFormData["additionalFilter"] = [];
this.simpleSearchFormData.saveSearchEnabled = false;
this.simpleSearchFormData.additionalFilter.current_assignee = this.selectedAssignees;
this.simpleSearchFormData.selectedCountries = this.selectedCountriesForFilter;
this.simpleSearchFormData.additionalFilter.inventor_name = this.selectedInventors;
this.simpleSearchFormData.patentTypes = this.checkedPatentTypes;
if (type == 'Refine') {
if (param == 'clear') {
this.simpleSearchFormData.refinedSearchElement = {};
this.simpleSearchFormData.additionalFilter = {};
this.simpleSearchFormData.patentTypes = this.selectedPatentTypes;
this.selectedAssignees = [];
this.selectedInventors = [];
this.removeFilters(['refinedSearch']);
this.refineSearchType = 'Simple';
} else {
this.simpleSearchFormData.refinedSearchElement = { value: this.refinedSearchKeyWord, filedNames: this.refinedSearchFilter };
this.simpleSearchFormData.additionalFilter = {};
this.simpleSearchFormData.patentTypes = this.selectedPatentTypes;
this.simpleSearchFormData.pageNumber = this.pageNumber;
this.selectedAssignees = [];
this.selectedInventors = [];
}
}
this.applySorting(this.simpleSearchFormData);
this.simpleSearchWithFilter(fetchCounts, this.filtersNotToUpdate)
} else if (this.lastSearchType == "Semantic" && this.lastSearchSubType == 'Semantic') {
this.semanticSearchFormData.saveSearchEnabled = false;
this.semanticSearchFormData.additionalFilter.current_assignee = this.selectedAssignees;
this.semanticSearchFormData.selectedCountries = this.selectedCountriesForFilter;
this.semanticSearchFormData.additionalFilter.inventor_name = this.selectedInventors;
this.semanticSearchFormData.patentTypes = this.checkedPatentTypes;
if (type == 'Refine') {
if (param == 'clear') {
this.semanticSearchFormData.refinedSearchElement = {};
this.semanticSearchFormData.additionalFilter = {};
this.semanticSearchFormData.patentTypes = this.selectedPatentTypes;
this.selectedAssignees = [];
this.selectedInventors = [];
this.removeFilters(['refinedSearch']);
this.refineSearchType = 'Semantic';
} else {
this.semanticSearchFormData.refinedSearchElement = { value: this.refinedSearchKeyWord, filedNames: this.refinedSearchFilter };
this.semanticSearchFormData.additionalFilter = {};
this.semanticSearchFormData.patentTypes = this.selectedPatentTypes;
this.semanticSearchFormData.pageNumber = this.pageNumber;
this.selectedAssignees = [];
this.selectedInventors = [];
}
}
this.applySorting(this.semanticSearchFormData);
this.semanticSearchWithFilter(fetchCounts, this.filtersNotToUpdate)
} else if (this.lastSearchType == "IntelxAi" && this.lastSearchSubType == 'IntelxAi') {
this.intelxAiSearchFormData.saveSearchEnabled = false;
this.intelxAiSearchFormData.additionalFilter.current_assignee = this.selectedAssignees;
this.intelxAiSearchFormData.selectedCountries = this.selectedCountriesForFilter;
this.intelxAiSearchFormData.additionalFilter.inventor_name = this.selectedInventors;
this.intelxAiSearchFormData.patentTypes = this.checkedPatentTypes;
this.intelxAiSearchFormData.searchKey = '';
if (type == 'Refine') {
if (param == 'clear') {
this.intelxAiSearchFormData.refinedSearchElement = {};
this.intelxAiSearchFormData.additionalFilter = {};
this.intelxAiSearchFormData.patentTypes = this.selectedPatentTypes;
this.selectedAssignees = [];
this.selectedInventors = [];
this.removeFilters(['refinedSearch']);
this.refineSearchType = 'IntelxAi';
} else {
this.intelxAiSearchFormData.refinedSearchElement = { value: this.refinedSearchKeyWord, filedNames: this.refinedSearchFilter };
this.intelxAiSearchFormData.additionalFilter = {};
this.intelxAiSearchFormData.patentTypes = this.selectedPatentTypes;
this.intelxAiSearchFormData.pageNumber = this.pageNumber;
this.selectedAssignees = [];
this.selectedInventors = [];
}
}
this.applySorting(this.intelxAiSearchFormData);
this.intelxAiSearchWithFilter(fetchCounts, this.filtersNotToUpdate)
} else if (this.lastSearchType == "Image" && this.lastSearchSubType == 'Image') {
this.imageSearchFormData.saveSearchEnabled = false;
this.imageSearchFormData.additionalFilter.current_assignee = this.selectedAssignees;
this.imageSearchFormData.selectedCountries = this.selectedCountriesForFilter;
this.imageSearchFormData.additionalFilter.inventor_name = this.selectedInventors;
this.imageSearchFormData.patentTypes = this.checkedPatentTypes;
if (type == 'Refine') {
if (param == 'clear') {
this.imageSearchFormData.refinedSearchElement = {};
this.imageSearchFormData.additionalFilter = {};
this.imageSearchFormData.patentTypes = this.selectedPatentTypes;
this.selectedAssignees = [];
this.selectedInventors = [];
this.removeFilters(['refinedSearch']);
this.refineSearchType = 'Image';
} else {
this.imageSearchFormData.refinedSearchElement = { value: this.refinedSearchKeyWord, filedNames: this.refinedSearchFilter };
this.imageSearchFormData.additionalFilter = {};
this.imageSearchFormData.patentTypes = this.selectedPatentTypes;
this.imageSearchFormData.pageNumber = this.pageNumber;
this.selectedAssignees = [];
this.selectedInventors = [];
}
}
this.applySorting(this.imageSearchFormData);
this.imageSearchWithFilter(fetchCounts, this.filtersNotToUpdate)
} else {
return;
}
},
setAppliedFiltersData(type) {
this.filterAppliedOnSearchType = this.lastSearchType;
if (type == 'Assignee') {
this.appliedFilters["assignee"] = this.selectedAssignees;
if (!this.filtersNotToUpdate.includes("assignee")) {
this.filtersNotToUpdate.push("assignee");
} else {
const index = this.filtersNotToUpdate.indexOf("assignee");
let filtersToUpdate = []
if (this.selectedAssignees.length == 0) {
filtersToUpdate = this.filtersNotToUpdate.splice(index);
} else if (index !== this.filtersNotToUpdate.length - 1) {
filtersToUpdate = this.filtersNotToUpdate.splice(index + 1);
}
this.removeFilters(filtersToUpdate)
}
} else if (type == 'Country') {
this.appliedFilters["country"] = this.selectedCountriesForFilter;
if (!this.filtersNotToUpdate.includes("country")) {
this.filtersNotToUpdate.push("country");
} else {
const index = this.filtersNotToUpdate.indexOf("country");
let filtersToUpdate = []
if (this.selectedCountriesForFilter.length == 0) {
filtersToUpdate = this.filtersNotToUpdate.splice(index);
} else if (index !== this.filtersNotToUpdate.length - 1) {
filtersToUpdate = this.filtersNotToUpdate.splice(index + 1);
}
this.removeFilters(filtersToUpdate)
}
} else if (type == 'Inventor') {
this.appliedFilters["inventor"] = this.selectedInventors;
if (!this.filtersNotToUpdate.includes("inventor")) {
this.filtersNotToUpdate.push("inventor");
} else {
const index = this.filtersNotToUpdate.indexOf("inventor");
let filtersToUpdate = []
if (this.selectedInventors.length == 0) {
filtersToUpdate = this.filtersNotToUpdate.splice(index);
} else if (index !== this.filtersNotToUpdate.length - 1) {
filtersToUpdate = this.filtersNotToUpdate.splice(index + 1);
}
this.removeFilters(filtersToUpdate)
}
}
},
cancelFilter(key, filterProp) {
if (key === 'assignee') {
const index = this.selectedAssignees.indexOf(filterProp);
if (index !== -1) {
this.selectedAssignees.splice(index, 1);
this.filterResultSetWithOtherParameters('', 'Assignee')
}
} else if (key === 'country') {
const index = this.selectedCountriesForFilter.indexOf(filterProp);
if (index !== -1) {
this.selectedCountriesForFilter.splice(index, 1);
this.filterResultSetWithOtherParameters('', 'Country')
}
} else if (key === 'inventor') {
const index = this.selectedInventors.indexOf(filterProp);
if (index !== -1) {
this.selectedInventors.splice(index, 1);
this.filterResultSetWithOtherParameters('', 'Inventor')
}
}
},
getColorByIndex(filterString) {
const index = this.filtersNotToUpdate.indexOf(filterString);
if (index === 0) {
return '#0000CD';
} else if (index === 1) {
return '#6495ED';
} else if (index === 2) {
return '#B0C4DE';
}
return '#3B82F6';
},
/*Simple Family*/
openSimilarFamilyModal: function (famId, lhipId, inventionId) {
let sfLink = hostName + pathName + '/fetch/simple-family?lhipId=' + lhipId;
if (famId) {
sfLink += '&familyId=' + famId;
}
if (inventionId) {
sfLink += '&inventionId=' + inventionId;
}
axios.get(sfLink, { headers: headers })
.then(response => {
console.log(response.data);
this.simpleFamilyResults = response.data.searchResults;
this.familyType = 'Simple';
$('#similarFamilyModal').modal('show');
// Display fetched data
})
.catch(error => {
console.error('Error fetching data:', error);
});
let familyId = famId;
},
openInpadocModal: function (lhipId, inventionId) {
axios.get(hostName + pathName + gl_inpadocFamily + 'lhipid/' + lhipId + '/inventionid/' + inventionId, { headers: headers })
.then(response => {
console.log(response.data);
this.simpleFamilyResults = response.data.searchResults;
this.familyType = 'INPADOC';
$('#similarFamilyModal').modal('show');
// Display fetched data
})
.catch(error => {
console.error('Error fetching data:', error);
});
},
/*excel and pdf download*/
downloadSearchResultAsPdf: function () {
if (this.lastSearchType == 'Legal') {
if (this.lastSearchSubType == 'Legal') {
this.requestForPdf = this.legalGenericSearchFormData;
this.pdfEndpoint = hostName + pathName + exportToPdf;
} else if (this.lastSearchSubType == 'Litigation') {
this.requestForPdf = this.legalLitigationSearchFormData;
this.pdfEndpoint = hostName + pathName + exportToPdf;
} else {
return;
}
} else if (this.lastSearchType == 'Field') {
this.requestForPdf = this.fieldSearchFormData;
this.pdfEndpoint = hostName + pathName + exportToPdf;
} else if (this.searchType == 'Simple') {
this.requestForPdf = this.simpleSearchFormData;
this.pdfEndpoint = hostName + pathName + exportToPdfSimple;
} else if (this.searchType == 'Semantic') {
this.requestForPdf = this.semanticSearchFormData;
this.pdfEndpoint = hostName + pathName + exportToPdfSemantic;
} else if (this.searchType == 'Image') {
this.requestForPdf = this.imageSearchFormData;
this.pdfEndpoint = hostName + pathName + exportToPdfSemantic;
}
else if(this.searchType == 'IntelxAi'){
this.requestForPdf = this.intelxAiSearchFormData;
this.pdfEndpoint = hostName+pathName+exportToPdfSemantic;
}else {
return;
}
axios({
url: this.pdfEndpoint,
method: 'post',
responseType: 'blob', // important
data: this.requestForPdf,
headers: {
"Authorization": `Bearer ${jwtToken}`, 'Accept': 'application/pdf',
'Content-Type': 'application/json'
},
}).then((response) => {
const url = window.URL.createObjectURL(response.data);
const link = document.createElement('a');
link.href = url;
/*link.setAttribute('download', 'search_results.pdf');
document.body.appendChild(link);
link.click();*/
// success popup
$('#downloadSuccessModal').modal('show');
}).catch(async (error) => {
if (error.response && error.response.data instanceof Blob) {
const errorText = await error.response.data.text();
// try {
// const errorJson = JSON.parse(errorText);
// console.error("Error:", errorJson.message || errorJson);
// } catch {
// console.error("Error:", errorText);
// }
this.errorModalMsg = errorText;
$('#errorModal').modal('show');
} else {
console.error("Error:", error.message);
}
});
},
downloadSearchResultAsExcel: function () {
if (this.lastSearchType == 'Legal') {
if (this.lastSearchSubType == 'Legal') {
this.requestForExcel = this.legalGenericSearchFormData;
this.excelEndpoint = hostName + pathName + exportToExcel;
} else if (this.lastSearchSubType == 'Litigation') {
this.requestForExcel = this.legalLitigationSearchFormData;
this.excelEndpoint = hostName + pathName + exportToExcel;
} else {
return;
}
} else if (this.lastSearchType == 'Field') {
this.requestForExcel = this.fieldSearchFormData;
this.excelEndpoint = hostName + pathName + exportToExcel;
} else if (this.searchType == 'Simple') {
this.requestForExcel = this.simpleSearchFormData;
this.excelEndpoint = hostName + pathName + exportToExcelSimple;
} else if (this.searchType == 'Semantic') {
this.requestForExcel = this.semanticSearchFormData;
this.excelEndpoint = hostName + pathName + exportToExcelSemantic;
} else if (this.searchType == 'Image') {
this.requestForExcel = this.imageSearchFormData;
this.excelEndpoint = hostName + pathName + exportToExcelSemantic;
} else if(this.searchType == 'IntelxAi'){
this.requestForExcel = this.intelxAiSearchFormData;
this.excelEndpoint = hostName+pathName+exportToExcelSemantic;
}else {
return;
}
axios({
url: this.excelEndpoint,
method: 'post',
responseType: 'blob', // important
data: this.requestForExcel,
headers: {
"Authorization": `Bearer ${jwtToken}`, 'Accept': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'Content-Type': 'application/json'
},
}).then((response) => {
const url = window.URL.createObjectURL(response.data);
const link = document.createElement('a');
link.href = url;
/*link.setAttribute('download', 'search_results.xlsx');
document.body.appendChild(link);
link.click();*/
$('#downloadSuccessModal').modal('show');
}).catch(async (error) => {
if (error.response && error.response.data instanceof Blob) {
const errorText = await error.response.data.text();
// try {
// const errorJson = JSON.parse(errorText);
// console.error("Error:", errorJson.message || errorJson);
// } catch {
// console.error("Error:", errorText);
// }
this.errorModalMsg = errorText;
$('#errorModal').modal('show');
} else {
console.error("Error:", error.message);
}
});
},
/*ends*/
handleAlertDelete: function(alertName){
this.alertToDelete = alertName;
$('#deleteModal').modal('show');
},
checkIfAllDbSelected: function () {
if (this.allCountries != this.selectedCountries) {
this.allDb = false;
} else {
this.allDb = true;
}
},
changeSearchType: function (searchType) {
$('.searchTypeButton').removeClass("leftSelectorRadio");
var btnClass = '.' + searchType;
$(btnClass).addClass("leftSelectorRadio");
console.log(searchType);
this.searchType = searchType;
this.primaryView = '';
/*if(this.searchType != this.currentResultSearchType){
this.showFieldSearchPanel = true;
}else{
this.showFieldSearchPanel = false;
}*/
this.showFieldSearchPanel = true;
// Remove query string without reloading page
if (window.history.replaceState && this.searchType != 'Image') {
const cleanUrl = window.location.origin + window.location.pathname;
window.history.replaceState({}, document.title, cleanUrl);
}
// Reset everything when changing search types.
this.searchQuery = '';
this.searchResults = [];
this.totalHits = 0;
this.isResultForList = false;
this.currentResultSearchType = ''
this.removeFilters(['all']);
this.activeListsWithMappedData = [];
this.semanticSearchQuery = '';
this.intelxAiSearchKey = '';
},
selectedLegalTab: function (type) {
this.legalTab = type;
console.log(this.legalTab);
$('.legalTabButton').removeClass("selectedLegalTabBtn");
let selectedLegalButtonId = '#' + type + 'Btn';
$(selectedLegalButtonId).addClass("selectedLegalTabBtn");
},
hideOrShowFilterSearchPanel: function () {
if (this.showFieldSearchPanel == true) {
this.showFieldSearchPanel = false;
} else {
this.showFieldSearchPanel = true;
}
},
selectIpCountries: function () {
if (this.selectIpCountry == true) {
this.selectedCountries.push('wo', 'us', 'ep', 'jp', 'kr');
} else {
/* this.selectedCountries.splice('WO','US','EP','JP','KR');*/
var index = this.selectedCountries.indexOf('wo');
if (index > -1) {
this.selectedCountries.splice(index, 1);
}
var index = this.selectedCountries.indexOf('us');
if (index > -1) {
this.selectedCountries.splice(index, 1);
}
var index = this.selectedCountries.indexOf('ep');
if (index > -1) {
this.selectedCountries.splice(index, 1);
}
var index = this.selectedCountries.indexOf('jp');
if (index > -1) {
this.selectedCountries.splice(index, 1);
}
var index = this.selectedCountries.indexOf('kr');
if (index > -1) {
this.selectedCountries.splice(index, 1);
}
}
},
enableInputTypes: function (index) {
// console.log(index);
this.selectedIndex = index;
this.showInputTypes = true;
},
closeFilterSection: function () {
this.showInputTypes = false;
},
addToInputField: function (value) {
// var value = event.target.value;
//console.log(value);
/* var logicalOperator = 'or';
var value = event.target.value;
if (event.target.checked) {*/
this.activeLists[this.selectedIndex] = value;
this.activeListsForInput[this.selectedIndex] = value;
if (value.includes('Date')) {
this.activeListsWithMappedData[this.selectedIndex] = { fromDate: '', toDate: '' };
} else {
this.activeListsWithMappedData[this.selectedIndex] = "";
}
/*this.andOr.push(logicalOperator);*/
/*this.activeListsWithMappedData.push('');*/
this.showInputTypes = false;
/* } else {
var index = this.activeLists.indexOf(value);
if (index > -1) {
this.activeLists.splice(index, 1);
this.activeListsForInput.splice(index, 1);
this.andOr.splice(index, 1);
this.activeListsWithMappedData.splice(index, 1);
}
}*/
},
legalLiGenenableInputTypes: function (index) {
// console.log(index);
this.legalLiGenselectedIndex = index;
this.legalLiGenshowInputTypes = true;
},
legalLiGencloseFilterSection: function () {
this.legalLiGenshowInputTypes = false;
},
legalLiGenaddToInputField: function (value) {
this.legalLiGenactiveLists[this.legalLiGenselectedIndex] = value;
this.legalLiGenactiveListsForInput[this.legalLiGenselectedIndex] = value;
if (value.includes('Date')) {
this.legalLiGenactiveListsWithMappedData[this.legalLiGenselectedIndex] = { from: '', to: '' };
} else {
this.legalLiGenactiveListsWithMappedData[this.legalLiGenselectedIndex] = "";
}
this.legalLiGenshowInputTypes = false;
},
legalLiGenupdateRequestsDetails: function () {
var query = [];
for (var i = 0; i < this.legalLiGenactiveLists.length; i++) {
if (this.legalLiGenactiveListsForInput[i]) {
if (i == 0) {
// query+="("+this.activeListsForInput[i]+"='"+ this.activeListsWithMappedData[i] +"') ";
query.push({ 'type': this.legalLiGenactiveListsForInput[i], 'value': this.legalLiGenactiveListsWithMappedData[i] });
} else {
//query+= this.andOr[i] +" ("+this.activeListsForInput[i]+"='"+ this.activeListsWithMappedData[i] +"') ";
query.push({ 'condition': this.legalLiGenandOr[i], 'type': this.legalLiGenactiveListsForInput[i], 'value': this.legalLiGenactiveListsWithMappedData[i] });
}
}
}
this.legalLiGenupdatedRequets = query;
},
legalLiGendeleteFilterItem: function (index) {
//removes selected item from the list
//this.activeLists.splice(index, 1);
//this.activeLists.splice(this.activeLists.indexOf(index), 1);
//var index = this.activeLists.indexOf(x);
if (index > -1) {
this.legalLiGenactiveLists.splice(index, 1);
this.legalLiGenactiveListsForInput.splice(index, 1);
this.legalLiGenandOr.splice(index, 1);
this.legalLiGenactiveListsWithMappedData.splice(index, 1);
}
this.legalLiGenupdateRequestsDetails();
/*if(this.isResultForList == true){
this.fieldSearch();
}*/
},
legalLiGenaddFilterItem: function (index) {
if (index > -1) {
this.legalLiGenactiveLists.push('');
this.legalLiGenactiveListsForInput.push('');
this.legalLiGenandOr.push('and');
this.legalLiGenactiveListsWithMappedData.push('');
}
},
legalReGenenableInputTypes: function (index) {
// console.log(index);
this.legalReGenselectedIndex = index;
this.legalReGenshowInputTypes = true;
},
legalReGencloseFilterSection: function () {
this.legalReGenshowInputTypes = false;
},
legalReGenaddToInputField: function (value) {
this.legalReGenactiveLists[this.legalReGenselectedIndex] = value;
this.legalReGenactiveListsForInput[this.legalReGenselectedIndex] = value;
if (value.includes('Date')) {
this.legalReGenactiveListsWithMappedData[this.legalReGenselectedIndex] = { fromDate: '', toDate: '' };
} else {
this.legalReGenactiveListsWithMappedData[this.legalReGenselectedIndex] = "";
}
this.legalReGenshowInputTypes = false;
},
legalReGenupdateRequestsDetails: function () {
var query = [];
for (var i = 0; i < this.legalReGenactiveLists.length; i++) {
if (this.legalReGenactiveListsForInput[i]) {
if (i == 0) {
// query+="("+this.activeListsForInput[i]+"='"+ this.activeListsWithMappedData[i] +"') ";
query.push({ 'type': this.legalReGenactiveListsForInput[i], 'value': this.legalReGenactiveListsWithMappedData[i] });
} else {
//query+= this.andOr[i] +" ("+this.activeListsForInput[i]+"='"+ this.activeListsWithMappedData[i] +"') ";
query.push({ 'condition': this.andOr[i], 'type': this.legalReGenactiveListsForInput[i], 'value': this.legalReGenactiveListsWithMappedData[i] });
}
}
}
this.legalReGenupdatedRequets = query;
console.log(this.legalReGenupdatedRequets);
},
legalReGendeleteFilterItem: function (index) {
//removes selected item from the list
//this.activeLists.splice(index, 1);
//this.activeLists.splice(this.activeLists.indexOf(index), 1);
//var index = this.activeLists.indexOf(x);
if (index > -1) {
this.legalReGenactiveLists.splice(index, 1);
this.legalReGenactiveListsForInput.splice(index, 1);
this.legalReGenandOr.splice(index, 1);
this.legalReGenactiveListsWithMappedData.splice(index, 1);
}
/*if(this.isResultForList == true){
this.fieldSearch();
}*/
},
legalReGenaddFilterItem: function (index) {
if (index > -1) {
this.legalReGenactiveLists.push('');
this.legalReGenactiveListsForInput.push('');
this.legalReGenandOr.push('and');
this.legalReGenactiveListsWithMappedData.push('');
}
},
legalLicensingGenenableInputTypes: function (index) {
// console.log(index);
this.legalLicensingGenselectedIndex = index;
this.legalLicensingGenshowInputTypes = true;
},
legalLicensingGencloseFilterSection: function () {
this.legalLicensingGenshowInputTypes = false;
},
legalLicensingGenaddToInputField: function (value) {
this.legalLicensingGenactiveLists[this.legalLicensingGenselectedIndex] = value;
this.legalLicensingGenactiveListsForInput[this.legalLicensingGenselectedIndex] = value;
if (value.includes('Date')) {
this.legalLicensingGenactiveListsWithMappedData[this.legalLicensingGenselectedIndex] = { fromDate: '', toDate: '' };
} else {
this.legalLicensingGenactiveListsWithMappedData[this.legalLicensingGenselectedIndex] = "";
}
this.legalLicensingGenshowInputTypes = false;
},
legalLicensingGenupdateRequestsDetails: function () {
var query = [];
for (var i = 0; i < this.legalLicensingGenactiveLists.length; i++) {
if (this.legalLicensingGenactiveListsForInput[i]) {
if (i == 0) {
// query+="("+this.activeListsForInput[i]+"='"+ this.activeListsWithMappedData[i] +"') ";
query.push({ 'type': this.legalLicensingGenactiveListsForInput[i], 'value': this.legalLicensingGenactiveListsWithMappedData[i] });
} else {
//query+= this.andOr[i] +" ("+this.activeListsForInput[i]+"='"+ this.activeListsWithMappedData[i] +"') ";
query.push({ 'condition': this.andOr[i], 'type': this.legalLicensingGenactiveListsForInput[i], 'value': this.legalLicensingGenactiveListsWithMappedData[i] });
}
}
}
this.legalLicensingGenupdatedRequets = query;
console.log(this.legalLicensingGenupdatedRequets);
},
legalLicensingGendeleteFilterItem: function (index) {
//removes selected item from the list
//this.activeLists.splice(index, 1);
//this.activeLists.splice(this.activeLists.indexOf(index), 1);
//var index = this.activeLists.indexOf(x);
if (index > -1) {
this.legalLicensingGenactiveLists.splice(index, 1);
this.legalLicensingGenactiveListsForInput.splice(index, 1);
this.legalLicensingGenandOr.splice(index, 1);
this.legalLicensingGenactiveListsWithMappedData.splice(index, 1);
}
/*if(this.isResultForList == true){
this.fieldSearch();
}*/
},
legalLicensingGenaddFilterItem: function (index) {
if (index > -1) {
this.legalLicensingGenactiveLists.push('');
this.legalLicensingGenactiveListsForInput.push('');
this.legalLicensingGenandOr.push('and');
this.legalLicensingGenactiveListsWithMappedData.push('');
}
},
legalAssignmentsGenenableInputTypes: function (index) {
// console.log(index);
this.legalAssignmentsGenselectedIndex = index;
this.legalAssignmentsGenshowInputTypes = true;
},
legalAssignmentsGencloseFilterSection: function () {
this.legalAssignmentsGenshowInputTypes = false;
},
legalAssignmentsGenaddToInputField: function (value) {
this.legalAssignmentsGenactiveLists[this.legalAssignmentsGenselectedIndex] = value;
this.legalAssignmentsGenactiveListsForInput[this.legalAssignmentsGenselectedIndex] = value;
if (value.includes('Date')) {
this.legalAssignmentsGenactiveListsWithMappedData[this.legalAssignmentsGenselectedIndex] = { fromDate: '', toDate: '' };
} else {
this.legalAssignmentsGenactiveListsWithMappedData[this.legalAssignmentsGenselectedIndex] = "";
}
this.legalAssignmentsGenshowInputTypes = false;
},
legalAssignmentsGenupdateRequestsDetails: function () {
var query = [];
for (var i = 0; i < this.legalAssignmentsGenactiveLists.length; i++) {
if (this.legalAssignmentsGenactiveListsForInput[i]) {
if (i == 0) {
// query+="("+this.activeListsForInput[i]+"='"+ this.activeListsWithMappedData[i] +"') ";
query.push({ 'type': this.legalAssignmentsGenactiveListsForInput[i], 'value': this.legalAssignmentsGenactiveListsWithMappedData[i] });
} else {
//query+= this.andOr[i] +" ("+this.activeListsForInput[i]+"='"+ this.activeListsWithMappedData[i] +"') ";
query.push({ 'condition': this.andOr[i], 'type': this.legalAssignmentsGenactiveListsForInput[i], 'value': this.legalAssignmentsGenactiveListsWithMappedData[i] });
}
}
}
this.legalAssignmentsGenupdatedRequets = query;
console.log(this.legalAssignmentsGenupdatedRequets);
},
legalAssignmentsGendeleteFilterItem: function (index) {
//removes selected item from the list
//this.activeLists.splice(index, 1);
//this.activeLists.splice(this.activeLists.indexOf(index), 1);
//var index = this.activeLists.indexOf(x);
if (index > -1) {
this.legalAssignmentsGenactiveLists.splice(index, 1);
this.legalAssignmentsGenactiveListsForInput.splice(index, 1);
this.legalAssignmentsGenandOr.splice(index, 1);
this.legalAssignmentsGenactiveListsWithMappedData.splice(index, 1);
}
/*if(this.isResultForList == true){
this.fieldSearch();
}*/
},
legalAssignmentsGenaddFilterItem: function (index) {
if (index > -1) {
this.legalAssignmentsGenactiveLists.push('');
this.legalAssignmentsGenactiveListsForInput.push('');
this.legalAssignmentsGenandOr.push('and');
this.legalAssignmentsGenactiveListsWithMappedData.push('');
}
},
legalPledgeGenenableInputTypes: function (index) {
// console.log(index);
this.legalPledgeGenselectedIndex = index;
this.legalPledgeGenshowInputTypes = true;
},
legalPledgeGencloseFilterSection: function () {
this.legalPledgeGenshowInputTypes = false;
},
legalPledgeGenaddToInputField: function (value) {
this.legalPledgeGenactiveLists[this.legalPledgeGenselectedIndex] = value;
this.legalPledgeGenactiveListsForInput[this.legalPledgeGenselectedIndex] = value;
if (value.includes('Date')) {
this.legalPledgeGenactiveListsWithMappedData[this.legalPledgeGenselectedIndex] = { fromDate: '', toDate: '' };
} else {
this.legalPledgeGenactiveListsWithMappedData[this.legalPledgeGenselectedIndex] = "";
}
this.legalPledgeGenshowInputTypes = false;
},
legalPledgeGenupdateRequestsDetails: function () {
var query = [];
for (var i = 0; i < this.legalPledgeGenactiveLists.length; i++) {
if (this.legalPledgeGenactiveListsForInput[i]) {
if (i == 0) {
// query+="("+this.activeListsForInput[i]+"='"+ this.activeListsWithMappedData[i] +"') ";
query.push({ 'type': this.legalPledgeGenactiveListsForInput[i], 'value': this.legalPledgeGenactiveListsWithMappedData[i] });
} else {
//query+= this.andOr[i] +" ("+this.activeListsForInput[i]+"='"+ this.activeListsWithMappedData[i] +"') ";
query.push({ 'condition': this.andOr[i], 'type': this.legalPledgeGenactiveListsForInput[i], 'value': this.legalPledgeGenactiveListsWithMappedData[i] });
}
}
}
this.legalPledgeGenupdatedRequets = query;
console.log(this.legalPledgeGenupdatedRequets);
},
legalPledgeGendeleteFilterItem: function (index) {
//removes selected item from the list
//this.activeLists.splice(index, 1);
//this.activeLists.splice(this.activeLists.indexOf(index), 1);
//var index = this.activeLists.indexOf(x);
if (index > -1) {
this.legalPledgeGenactiveLists.splice(index, 1);
this.legalPledgeGenactiveListsForInput.splice(index, 1);
this.legalPledgeGenandOr.splice(index, 1);
this.legalPledgeGenactiveListsWithMappedData.splice(index, 1);
}
/*if(this.isResultForList == true){
this.fieldSearch();
}*/
},
legalPledgeGenaddFilterItem: function (index) {
if (index > -1) {
this.legalPledgeGenactiveLists.push('');
this.legalPledgeGenactiveListsForInput.push('');
this.legalPledgeGenandOr.push('and');
this.legalPledgeGenactiveListsWithMappedData.push('');
}
},
legalGenericInputTypes: function (index) {
// console.log(index);
this.legalGenericselectedIndex = index;
this.legalGenericShowInputTypes = true;
},
legalGenericcloseFilterSection: function () {
this.legalGenericShowInputTypes = false;
},
legalGenericaddToInputField: function (value) {
this.legalGenericLists[this.legalGenericselectedIndex] = value;
this.legalGenericActiveListsForInput[this.legalGenericselectedIndex] = value;
if (value.includes('Date')) {
this.legalGenericListsWithMappedData[this.legalGenericselectedIndex] = { fromDate: '', toDate: '' };
} else {
this.legalGenericListsWithMappedData[this.legalGenericselectedIndex] = "";
}
this.legalGenericShowInputTypes = false;
},
legalGenericUpdateRequestsDetails: function () {
var query = [];
for (var i = 0; i < this.legalGenericLists.length; i++) {
if (this.legalGenericActiveListsForInput[i]) {
if (i == 0) {
// query+="("+this.activeListsForInput[i]+"='"+ this.activeListsWithMappedData[i] +"') ";
query.push({ 'type': this.legalGenericActiveListsForInput[i], 'value': this.legalGenericListsWithMappedData[i] });
} else {
//query+= this.andOr[i] +" ("+this.activeListsForInput[i]+"='"+ this.activeListsWithMappedData[i] +"') ";
query.push({ 'condition': this.legalGenericandOr[i], 'type': this.legalGenericActiveListsForInput[i], 'value': this.legalGenericListsWithMappedData[i] });
}
}
}
this.legalGenericUpdatedRequests = query;
console.log(this.legalGenericUpdatedRequests);
},
legalGenericDeleteFilterItem: function (index) {
//removes selected item from the list
//this.activeLists.splice(index, 1);
//this.activeLists.splice(this.activeLists.indexOf(index), 1);
//var index = this.activeLists.indexOf(x);
if (index > -1) {
this.legalGenericLists.splice(index, 1);
this.legalGenericActiveListsForInput.splice(index, 1);
this.legalGenericandOr.splice(index, 1);
this.legalGenericListsWithMappedData.splice(index, 1);
}
this.legalGenericUpdateRequestsDetails();
/*if(this.isResultForList == true){
this.fieldSearch();
}*/
},
legalGenericAddFilterItem: function (index) {
if (index > -1) {
this.legalGenericLists.push('');
this.legalGenericActiveListsForInput.push('');
this.legalGenericandOr.push('and');
this.legalGenericListsWithMappedData.push('');
}
},
/*Image*/
closeImageSearchFilterSection: function (value) {
this.imageSearchShowInputTypes = false;
},
addToImageSearchInputField: function (value) {
this.imageSearchLists[this.imageSearchselectedIndex] = value;
this.imageSearchActiveListsForInput[this.imageSearchselectedIndex] = value;
if (value.includes('Date')) {
this.imageSearchListsWithMappedData[this.imageSearchselectedIndex] = { fromDate: '', toDate: '' };
} else {
this.imageSearchListsWithMappedData[this.imageSearchselectedIndex] = "";
}
this.imageSearchShowInputTypes = false;
},
imageSearchInputTypes: function (index) {
// console.log(index);
this.imageSearchselectedIndex = index;
this.imageSearchShowInputTypes = true;
},
/*imageSearchcloseFilterSection :function(){
this.imageSearchShowInputTypes=false;
},*/
imageSearchaddToInputField: function (value) {
this.imageSearchLists[this.imageSearchselectedIndex] = value;
this.imageSearchActiveListsForInput[this.imageSearchselectedIndex] = value;
if (value.includes('Date')) {
this.imageSearchListsWithMappedData[this.imageSearchselectedIndex] = { fromDate: '', toDate: '' };
} else {
this.imageSearchListsWithMappedData[this.imageSearchselectedIndex] = "";
}
this.imageSearchShowInputTypes = false;
},
imageSearchUpdateRequestsDetails: function () {
var query = [];
for (var i = 0; i < this.imageSearchLists.length; i++) {
if (this.imageSearchActiveListsForInput[i]) {
if (i == 0) {
// query+="("+this.activeListsForInput[i]+"='"+ this.activeListsWithMappedData[i] +"') ";
query.push({ 'type': this.imageSearchActiveListsForInput[i], 'value': this.imageSearchListsWithMappedData[i] });
} else {
//query+= this.andOr[i] +" ("+this.activeListsForInput[i]+"='"+ this.activeListsWithMappedData[i] +"') ";
query.push({ 'condition': this.imageSearchandOr[i], 'type': this.imageSearchActiveListsForInput[i], 'value': this.imageSearchListsWithMappedData[i] });
}
}
}
this.imageSearchUpdatedRequests = query;
console.log(this.imageSearchUpdatedRequests);
},
imageSearchDeleteFilterItem: function (index) {
//removes selected item from the list
//this.activeLists.splice(index, 1);
//this.activeLists.splice(this.activeLists.indexOf(index), 1);
//var index = this.activeLists.indexOf(x);
if (index > -1) {
this.imageSearchLists.splice(index, 1);
this.imageSearchActiveListsForInput.splice(index, 1);
this.imageSearchandOr.splice(index, 1);
this.imageSearchListsWithMappedData.splice(index, 1);
}
this.imageSearchUpdateRequestsDetails();
/*if(this.isResultForList == true){
this.fieldSearch();
}*/
},
imageSearchAddFilterItem: function (index) {
if (index > -1) {
this.imageSearchLists.push('');
this.imageSearchActiveListsForInput.push('');
this.imageSearchandOr.push('and');
this.imageSearchListsWithMappedData.push('');
}
},
/*Ends*/
selectAllDatabase: function () {
if (this.allDb == true) {
for (var i = 0; i < this.countries.length; i++) {
console.log(this.countries[i].code);
this.selectedCountries.push(this.countries[i].code);
}
this.selectIpCountry = true;
} else {
this.selectedCountries = [];
this.selectIpCountry = false;
}
},
deleteFilterItem: function (index) {
//removes selected item from the list
//this.activeLists.splice(index, 1);
//this.activeLists.splice(this.activeLists.indexOf(index), 1);
//var index = this.activeLists.indexOf(x);
if (index > -1) {
this.activeLists.splice(index, 1);
this.activeListsForInput.splice(index, 1);
this.andOr.splice(index, 1);
this.activeListsWithMappedData.splice(index, 1);
}
this.updateRequestsDetails();
if (this.isResultForList == true) {
this.fieldSearch();
}
},
addFilterItem: function (index) {
if (index > -1) {
this.activeLists.push('');
this.activeListsForInput.push('');
this.andOr.push('and');
this.activeListsWithMappedData.push('');
}
},
openPropertyHelperSection: function (property) {
this.selectedHelperButton = property + ' Helper';
this.selectedHelperDetails = '';
if (property == 'Title') {
this.selectedHelperDetails = "This is title helper details";
} else if (property == 'Title') {
this.selectedHelperDetails = "This is abstract helper details";
} else {
this.selectedHelperDetails = "This is other helper details";
}
$('#fieldHelperModal').modal('show');
},
/*openLitigationAssigneeModal :function(caseNo){
this.litigationAssignees = [
{
"id": "1",
"name": "Jane Doe",
},
{
"id": "2",
"name": "John Doe",
}];
this.litigationCaseNo = caseNo;
$('#LitigationAssigneeModal').modal('show');
},*/
openLitigationAttorneysModal: function (caseNo) {
axios.get(hostName + pathName + gl_legalLitigationTriggers + caseNo + '/attorneys', { headers: headers })
.then(response => {
console.log(response.data);
this.litigationAttorneys = response.data;
console.log(this.litigationAttorneys);
// Display fetched data
})
.catch(error => {
console.error('Error fetching data:', error);
});
this.litigationCaseNo = caseNo;
this.litigationModalType = 'Attorneys';
$('#LitigationAssigneeModal').modal('show');
},
openLitigationDocumentsModal: function (caseNo) {
axios.get(hostName + pathName + gl_legalLitigationTriggers + caseNo + '/documents', { headers: headers })
.then(response => {
console.log(response.data);
this.litigationDocuments = response.data;
// Display fetched data
})
.catch(error => {
console.error('Error fetching data:', error);
});
this.litigationCaseNo = caseNo;
this.litigationModalType = 'Documents';
$('#LitigationAssigneeModal').modal('show');
},
openLitigationPatentsModal: function (caseNo) {
axios.get(hostName + pathName + gl_legalLitigationTriggers + caseNo + '/patents', { headers: headers })
.then(response => {
console.log(response.data);
this.litigationPatents = response.data;
// Display fetched data
})
.catch(error => {
console.error('Error fetching data:', error);
});
this.litigationCaseNo = caseNo;
this.litigationModalType = 'Patents';
$('#LitigationAssigneeModal').modal('show');
},
openLitigationPartiesModal: function (caseNo) {
axios.get(hostName + pathName + gl_legalLitigationTriggers + caseNo + '/parties', { headers: headers })
.then(response => {
console.log(response.data);
this.litigationParties = response.data;
// Display fetched data
})
.catch(error => {
console.error('Error fetching data:', error);
});
this.litigationCaseNo = caseNo;
this.litigationModalType = 'Parties';
$('#LitigationAssigneeModal').modal('show');
},
updateRequestsDetails: function () {
var query = [];
for (var i = 0; i < this.activeLists.length; i++) {
if (this.activeListsForInput[i]) {
if (i == 0) {
// query+="("+this.activeListsForInput[i]+"='"+ this.activeListsWithMappedData[i] +"') ";
query.push({ 'type': this.activeListsForInput[i], 'value': this.activeListsWithMappedData[i] });
} else {
//query+= this.andOr[i] +" ("+this.activeListsForInput[i]+"='"+ this.activeListsWithMappedData[i] +"') ";
query.push({ 'condition': this.andOr[i], 'type': this.activeListsForInput[i], 'value': this.activeListsWithMappedData[i] });
}
}
}
this.updatedRequets = query;
},
checkAllDatabase: function (e) {
$('.eachDatabase').addClass('selected');
},
applyFilter: function () {
},
removeSearchQuery: function () {
this.searchQuery = '';
this.isResultForList = false;
this.proximity = false; // also turn off proximity when clearing query
},
showEmailNotification: function () {
if (this.emailNotification == true) {
/*this.isEmailNotificationClicked = true
setTimeout(() => {
this.isEmailNotificationClicked = false;
}, 10000);*/
document.getElementById("createAlertContentForEmail").style.display = "block";
document.getElementById("createAlertSubmitButtonForEmail").style.display = "block";
this.userId = document.getElementById('userIdHolder').innerHTML;
$('#emailNotificationModal').modal('show');
} else {
this.isEmailNotificationClicked = false;
}
},
SwitchOffEmailNotification: function () {
this.emailNotification = false;
},
saveEmailNotification: function () {
this.userId = document.getElementById('userIdHolder').innerHTML;
if (this.lastSearchType == 'Simple' && this.lastSearchSubType == 'Simple') {
/*this.notificationFormData = {
"searchType" :"Simple",
"searchSubType" :"Simple",
"searchKey": this.searchQuery,
"pageNumber": this.pageNumber,
'saveSearchEnabled' : false,
'userId' : this.userId,
"pageSize": this.pageSize,
"totalHits" : this.totalHits,
"emailNotificationAlias" : this.emailNotificationAlias
};*/
this.simpleSearchFormData.saveSearchEnabled = false;
this.simpleSearchFormData.emailNotificationAlias = this.emailNotificationAlias;
this.notificationFormData = this.simpleSearchFormData;
} else if (this.lastSearchType == 'Field' && this.lastSearchSubType == 'Field') {
/*this.notificationFormData = {
"searchType" :"Field",
"searchSubType" :"Field",
"selectedCountries": this.selectedCountries,
"advancedSearchFields": this.fieldSearchQuery,
"pageNumber": this.pageNumber,
'saveSearchEnabled' : false,
'userId' : this.userId,
"pageSize": this.pageSize,
"patentTypes" : this.selectedPatentTypes,
"totalHits" : this.totalHits,
"emailNotificationAlias" : this.emailNotificationAlias
};*/
this.fieldSearchFormData.saveSearchEnabled = false;
this.fieldSearchFormData.emailNotificationAlias = this.emailNotificationAlias;
this.notificationFormData = this.fieldSearchFormData;
} else if (this.lastSearchType == 'Legal' && this.lastSearchSubType == 'Legal') {
/*this.notificationFormData = {
"searchType" :"Legal",
"searchSubType" :"Legal",
"selectedCountries": this.selectedCountries,
"advancedSearchFields": this.legalGenericQuery,
"pageNumber": this.pageNumber,
'saveSearchEnabled' : false,
'userId' : this.userId,
"totalHits" : this.totalHits,
"emailNotificationAlias" : this.emailNotificationAlias
};*/
this.legalGenericSearchFormData.saveSearchEnabled = false;
this.legalGenericSearchFormData.emailNotificationAlias = this.emailNotificationAlias;
this.notificationFormData = this.legalGenericSearchFormData;
} else if (this.lastSearchType == 'Legal' && this.lastSearchSubType == 'Litigation') {
/*this.notificationFormData = {
"searchType" :"Legal",
"searchSubType" :"Litigation",
"selectedCountries": this.selectedLegalCountries,
"advancedSearchFields": this.litigationQuery,
"pageNumber": this.pageNumber,
'saveSearchEnabled' : false,
'userId' : this.userId,
"totalHits" : this.totalHits,
"emailNotificationAlias" : this.emailNotificationAlias
};*/
this.legalLitigationSearchFormData.saveSearchEnabled = false;
this.legalLitigationSearchFormData.emailNotificationAlias = this.emailNotificationAlias;
this.notificationFormData = this.legalLitigationSearchFormData;
} else if (this.lastSearchType == 'Semantic' && this.lastSearchSubType == 'Semantic') {
/*this.notificationFormData = {
"searchType" :"Semantic",
"searchSubType" :"Semantic",
"searchKey": this.semanticSearchQuery,
"pageNumber": this.pageNumber,
'saveSearchEnabled' : false,
'userId' : this.userId,
"pageSize": this.pageSize,
"totalHits" : this.totalHits,
"emailNotificationAlias" : this.emailNotificationAlias
};*/
this.semanticSearchFormData.saveSearchEnabled = false;
this.semanticSearchFormData.emailNotificationAlias = this.emailNotificationAlias;
this.notificationFormData = this.semanticSearchFormData;
} else if (this.lastSearchType == 'Image' && this.lastSearchSubType == 'Image') {
/*this.notificationFormData = {
"searchType" :"Semantic",
"searchSubType" :"Semantic",
"searchKey": this.semanticSearchQuery,
"pageNumber": this.pageNumber,
'saveSearchEnabled' : false,
'userId' : this.userId,
"pageSize": this.pageSize,
"totalHits" : this.totalHits,
"emailNotificationAlias" : this.emailNotificationAlias
};*/
this.imageSearchFormData.saveSearchEnabled = false;
this.imageSearchFormData.emailNotificationAlias = this.emailNotificationAlias;
this.notificationFormData = this.imageSearchFormData;
}
this.notificationFormData.totalHits = this.totalHits;
let formData = this.notificationFormData;
/*console.log(formData);*/
axios({
method: "post",
// url: "http://zenx-intelx-dev.us-west-2.elasticbeanstalk.com/intelx/api/legal/search",
url: hostName + pathName + gl_notification,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
this.isEmailNotificationClicked = true;
this.emailNotificationAlias = '';
document.getElementById("createAlertContentForEmail").style.display = "none";
document.getElementById("createAlertSubmitButtonForEmail").style.display = "none";
this.getSavedSearches();
}.bind(this));
},
createAlert: function () {
/*this.showSubmittedCreatedAlertText = true;
this.showSubmittedCreatedAlertButton = true;
document.getElementById("createAlertConent").style.display = "none";
document.getElementById("createAlertSubmitButton").style.display = "none";*/
if (!this.companyNameForAlert) {
this.createAlertValidationError = true;
return;
} else {
//document.getElementById('tab2').click();
var gainSearchJson = [
{
"fieldName": "current-assignee",
"condition": "and",
"value": this.companyNameForAlert,
}
// {
// "condition": "and",
// "fieldName": "cpc",
// "value": this.cpcIpcForAlert,
// },
];
for (i = 0; i < gainSearchJson.length; i++) {
this.activeListsForInput.unshift(gainSearchJson[i].fieldName.replaceAll('-', ' '));
this.andOr.unshift(gainSearchJson[i].condition);
this.activeListsWithMappedData.unshift(gainSearchJson[i].value);
}
document.getElementById("loading").style.display = "block";
document.getElementById("mainBody").style.overflowY = "hidden";
$("#advertisementCards").css({ "display": "none" });
this.userId = document.getElementById('userIdHolder').innerHTML;
this.fieldSearchFormData = {
"searchType": "Field",
"searchSubType": "Field",
"selectedCountries": this.selectedCountries,
"advancedSearchFields": gainSearchJson,
"pageNumber": this.pageNumber,
'saveSearchEnabled': this.saveSearchEnabled,
'userId': this.userId,
"pageSize": this.pageSize,
"patentTypes": this.selectedPatentTypes,
"additionalFilter": {},
"refinedSearchElement": {}
};
this.fieldSearchFormData.pageNumber = this.currentPage;
let formData = this.fieldSearchFormData;
axios({
method: "post",
// url: "http://zenx-intelx-dev.us-west-2.elasticbeanstalk.com/intelx/api/legal/search",
url: hostName + pathName + gl_fieldSearch,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
// console.log(response.data);
this.searchType = 'Field';
if (!response.data.searchResults) {
this.searchResults = [];
this.noResultsFound = true;
this.showFieldSearchPanel = false;
this.lastSearchType = 'Field';
this.lastSearchSubType = 'Field';
this.currentResultSearchType = 'Field';
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
return;
} else {
this.noResultsFound = false;
this.searchResults = response.data.searchResults;
this.totalHits = response.data.totalHits;
this.isResultForList = true;
this.similarReads = this.searchResults;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage);
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
this.showFieldSearchPanel = false;
this.lastSearchType = 'Field';
this.lastSearchSubType = 'Field';
this.currentResultSearchType = 'Field';
var previousResults = this.searchResults;
localStorage.setItem('previousResults', JSON.stringify(previousResults));
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
if (this.currentPage === 1) this.pageNumber = 1;
this.currentPage = 1;
this.storeDataForPagination(this.fieldSearchFormData, this.pageNumber, this.totalPages);
axios({
method: "post",
url: hostName + pathName + gl_assignees_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
//console.log(response.data);
this.assignees = response.data;
// Display fetched data
localStorage.setItem('graphDataForAssignee', JSON.stringify(this.assignees));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_inventors_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
//console.log(response.data);
this.inventors = response.data;
// Display fetched data
localStorage.setItem('graphDataForInventors', JSON.stringify(this.inventors));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_countries_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
//console.log(response.data);
this.fetchedCountries = response.data;
// this.countries;
// Display fetched data
// this.selectedCountriesForFilter = this.fetchedCountries.map(item => item.name);
localStorage.setItem('graphDataForCountries', JSON.stringify(this.fetchedCountries));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_years_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedYears = response.data;
// Display fetched data
localStorage.setItem('graphDataForYears', JSON.stringify(this.fetchedYears));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_live_countries_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedLiveCountries = response.data;
// Display fetched data
localStorage.setItem('graphDataForLiveCountries', JSON.stringify(this.fetchedLiveCountries));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_live_assignee_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedLiveAssignees = response.data;
// Display fetched data
localStorage.setItem('graphDataForLiveAssignees', JSON.stringify(this.fetchedLiveAssignees));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_live_catchwords,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedLiveCatchWords = response.data;
// Display fetched data
localStorage.setItem('graphDataForLiveCatchWords', JSON.stringify(this.fetchedLiveCatchWords));
})
.catch(error => {
console.error('Error fetching data:', error);
});
}
}.bind(this));
$('#createAlertModal').modal('hide');
}
},
closeCreateAlert: function () {
$('#createAlertModal').modal('hide');
this.showSubmittedCreatedAlertText = false;
this.showSubmittedCreatedAlertButton = false;
document.getElementById("createAlertConent").style.display = "block";
document.getElementById("createAlertSubmitButton").style.display = "block";
},
/*submitSearch: function() {
this.isResultForList = false;
var reqURL = "https://en.wikipedia.org/w/api.php?action=query&generator=search&gsrnamespace=0&exsentences=1&exintro&explaintext&exlimit=max&prop=extracts&gsrlimit=10&gsrsearch="+this.searchQuery+"&format=json";
this.$http.jsonp(reqURL).then(function(response) {
this.articleObj = response.data.query.pages;
this.isResult = true;
}, function(response) {
console.log(response);
});
},*/
lastSearch: function () {
if (this.lastSearchType == 'Simple') {
document.getElementById('tab1').click();
this.simpleSearch();
} else if (this.lastSearchType == 'Field') {
document.getElementById('tab2').click();
this.fieldSearch();
} else if (this.lastSearchType == 'Legal') {
document.getElementById('tab3').click();
this.legalSearch();
} else if (this.lastSearchType == 'Semantic') {
document.getElementById('tab4').click();
this.semanticSearch();
}
},
openFrequentSearchModal: function () {
this.userId = document.getElementById('userIdHolder').innerHTML;
axios.get(hostName + pathName + gl_frequentSearch + this.userId, { headers: headers })
.then(response => {
console.log(response.data);
this.frequentSearchHistory = response.data;
// Display fetched data
})
.catch(error => {
console.error('Error fetching data:', error);
});
$('#frequentSearchModal').modal('show');
},
openLastSearchModal: function () {
this.userId = document.getElementById('userIdHolder').innerHTML;
axios.get(hostName + pathName + gl_lastSearch + this.userId, { headers: headers })
.then(response => {
console.log(response.data);
this.lastSearchHistory = response.data;
// Display fetched data
})
.catch(error => {
console.error('Error fetching data:', error);
});
$('#lastSearchModal').modal('show');
},
openCreateAlertModal: function () {
$('#createAlertModal').modal('show');
},
openExploreItModal: function () {
$('#exploreItModal').modal('show');
},
openSearchItModal: function () {
this.totalHits = 0;
this.searchResults = null;
$('#searchItModal').modal('show');
},
simpleSearchFromHistory: function (search, searchType) {
var params = JSON.parse(search.searchParamJson);
this.searchQuery = params['searchKey'];
// restore proximity if it was saved
this.proximity = params['proximity'] || false;
document.getElementById('tab1').click();
this.simpleSearch();
$('#frequentSearchModal').modal('hide');
$('#lastSearchModal').modal('hide');
},
semanticSearchFromHistory: function (search, searchType) {
this.semanticSearchQuery = JSON.parse(search.searchParamJson)['searchKey']
document.getElementById('tab4').click();
this.semanticSearch();
$('#frequentSearchModal').modal('hide');
$('#lastSearchModal').modal('hide');
},
otherSearchFromHistory: function (search, searchType) {
console.log(search);
if (searchType == 'Field') {
this.srcJson = JSON.parse(search.searchParamJson);
// console.log(this.srcJson.advancedSearchFields.length);
for (i = 0; i < this.srcJson.advancedSearchFields.length; i++) {
this.activeListsForInput.unshift(this.srcJson.advancedSearchFields[i].fieldName.replaceAll('-', ' '));
this.andOr.unshift(this.srcJson.advancedSearchFields[i].condition);
this.activeListsWithMappedData.unshift(this.srcJson.advancedSearchFields[i].value);
}
console.log(this.activeListsForInput);
console.log(this.andOr);
console.log(this.activeListsWithMappedData);
/* this.activeListsForInput = ['hello','','','','','',''];
this.andOr =['and','and','and','and','and','and','and'];
this.activeListsWithMappedData =['hi','','','','','',''];*/
/*this.selectedPatentTypes = this.srcJson.checkedPatentTypes;
this.selectedCountries = this.srcJson.selectedCountries;*/
//return;
document.getElementById('tab2').click();
this.fieldSearchFormData = search.searchParamJson;
this.fieldSearchFormData.pageNumber = this.currentPage;
let formData = this.fieldSearchFormData;
/*console.log(formData);*/
axios({
method: "post",
// url: "http://zenx-intelx-dev.us-west-2.elasticbeanstalk.com/intelx/api/legal/search",
url: hostName + pathName + gl_fieldSearch,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
console.log(response.data);
if (!response.data.searchResults) {
this.searchResults = [];
this.noResultsFound = true;
this.showFieldSearchPanel = false;
this.lastSearchType = 'Field';
this.lastSearchSubType = 'Field';
this.currentResultSearchType = 'Field';
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
return;
} else {
this.noResultsFound = false;
this.searchResults = response.data.searchResults;
this.totalHits = response.data.totalHits;
this.isResultForList = true;
this.similarReads = this.searchResults;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage);
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
/*this.assignees = response.data.countOfAssignees;
this.inventors = response.data.countOfInventors;*/
/*this.countries = response.data.countOfCountries;*/
this.showFieldSearchPanel = false;
this.lastSearchType = 'Field';
this.lastSearchSubType = 'Field';
this.currentResultSearchType = 'Field';
var previousResults = this.searchResults;
localStorage.setItem('previousResults', JSON.stringify(previousResults));
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
if (this.currentPage === 1) this.pageNumber = 1;
this.currentPage = 1;
this.storeDataForPagination(this.fieldSearchFormData, this.pageNumber, this.totalPages);
}
$('#frequentSearchModal').modal('hide');
$('#lastSearchModal').modal('hide');
}.bind(this));
}
},
goToPageNumber: function (id) {
this.pageNumber = id;
this.currentPage = this.pageNumber;
if (this.pageNumber != 1) {
this.saveSearchEnabled = false;
}
this.filterResultSetWithOtherParameters('', '', false);
//To fix the issue for Browser stuck issue during pagination - Start
/*$('html,body').scrollTop(0);*/
this.$nextTick(() => $('html,body').scrollTop(0));
//To fix the issue for Browser stuck issue during pagination - End
},
clearSearch: function () {
location.reload();
this.searchResults = [];
$("#advertisementCards").css({ "display": "block" });
/*clear simple search fields*/
this.searchQuery = '';
/*clear field search fields*/
this.activeLists = ['', '', '', '', '', '', ''];
this.activeListsForInput = ['', '', '', '', '', '', ''];
this.andOr = ['and', 'and', 'and', 'and', 'and', 'and', 'and'];
this.activeListsWithMappedData = ['', '', '', '', '', '', ''];
this.selectedPatentTypes = [];
this.selectedCountries = [];
this.allDb = false;
this.updatedRequets = [];
/*clear legal litigation search fields*/
this.legalLiGenactiveLists = ['', '', '', '', '', '', ''];
this.legalLiGenactiveListsForInput = ['', '', '', '', '', '', ''];
this.legalLiGenandOr = ['and', 'and', 'and', 'and', 'and', 'and', 'and'];
this.legalLiGenactiveListsWithMappedData = ['', '', '', '', '', '', ''];
this.legalLiGenupdatedRequets = [];
/*clear legal generic search*/
this.legalGenericLists = ['', '', '', '', '', '', ''];
this.legalGenericActiveListsForInput = ['', '', '', '', '', '', ''];
this.legalGenericandOr = ['and', 'and', 'and', 'and', 'and', 'and', 'and'];
this.legalGenericListsWithMappedData = ['', '', '', '', '', '', ''];
this.legalGenericUpdatedRequests = [];
/*clear legal generic search*/
this.imageSearchLists = ['', '', '', '', '', '', ''];
this.imageSearchActiveListsForInput = ['', '', '', '', '', '', ''];
this.imageSearchandOr = ['and', 'and', 'and', 'and', 'and', 'and', 'and'];
this.imageSearchListsWithMappedData = ['', '', '', '', '', '', ''];
this.imageSearchUpdatedRequests = [];
this.isResultForList = false;
this.showFieldSearchPanel = true;
window.history.replaceState(null, '', window.location.pathname);
},
simpleSearch: function () {
this.validationErrorForSimpleSearch = '';
if (!this.searchQuery) {
this.validationErrorForSimpleSearch = 'Please Enter a Search Keyword';
return;
} else {
document.getElementById("loading").style.display = "block";
document.getElementById("mainBody").style.overflowY = "hidden";
$("#advertisementCards").css({ "display": "none" });
this.userId = document.getElementById('userIdHolder').innerHTML;
this.removeFilters(['all']);
this.simpleSearchFormData = {
"searchType": "Simple",
"searchSubType": "Simple",
"searchKey": this.searchQuery,
"pageNumber": this.pageNumber,
"proximity": this.proximity,
'saveSearchEnabled': this.saveSearchEnabled,
'userId': this.userId,
"pageSize": this.pageSize,
"additionalFilter": {},
"refinedSearchElement": {}
};
this.simpleSearchFormData.pageNumber = this.currentPage;
let formData = this.simpleSearchFormData;
this.lastSearchType = 'Simple';
this.lastSearchSubType = 'Simple';
/*console.log(formData);*/
axios({
method: "post",
// url: "http://zenx-intelx-dev.us-west-2.elasticbeanstalk.com/intelx/api/legal/search",
url: hostName + pathName + gl_simpleSearch,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
console.log(response.data);
if (!response.data.searchResults) {
this.searchResults = [];
this.noResultsFound = true;
this.lastSearchType = 'Simple';
this.lastSearchSubType = 'Simple';
this.currentResultSearchType = 'Simple';
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
return;
} else {
this.noResultsFound = false;
this.searchResults = response.data.searchResults;
this.totalHits = response.data.totalHits;
this.isResultForList = true;
this.similarReads = this.searchResults;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage);
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
/*this.assignees = response.data.countOfAssignees;
this.inventors = response.data.countOfInventors;*/
/*this.countries = response.data.countOfCountries;*/
this.currentResultSearchType = 'Simple';
var previousResults = this.searchResults;
localStorage.setItem('previousResults', JSON.stringify(previousResults));
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
this.removeFilters(['refinedSearch']);
if (this.currentPage === 1) this.pageNumber = 1;
this.currentPage = 1;
this.storeDataForPagination(this.simpleSearchFormData, this.pageNumber, this.totalPages);
// graph data
}
}.bind(this));
this.fetchAllCounts(formData);
}
},
addPatentImgClickListener: function () {
const imgs = this.$el.querySelectorAll('.api-elem img');
const modal = new bootstrap.Modal(document.getElementById('patentImgModal'));
if (imgs.length == 0) return;
imgs.forEach(img => {
if (!img._isWired) {
img.addEventListener('click', () => {
console.log('in click')
const modalImg = this.$el.querySelector('#patentModalImg')
modalImg.src = img.src
modal.show();
});
img._isWired = true;
}
});
},
removeFilters: function (arr) {
if (!Array.isArray(arr)) {
return;
}
if (arr.includes("all")) {
this.refinedSearchKeyWord = '';
this.refinedSearchFilter = [];
this.selectedAssignees = [];
this.selectedInventors = [];
this.checkedPatentTypes = [];
this.selectedCountriesForFilter = [];
this.$delete(this.appliedFilters, "assignee");
this.$delete(this.appliedFilters, "inventor");
this.$delete(this.appliedFilters, "country");
this.filtersNotToUpdate = [];
return;
}
if (arr.includes("refinedSearch")) {
this.refinedSearchKeyWord = '';
this.refinedSearchFilter = [];
}
if (arr.includes("assignee")) {
this.selectedAssignees = [];
this.$delete(this.appliedFilters, "assignee");
}
if (arr.includes("inventor")) {
this.selectedInventors = [];
this.$delete(this.appliedFilters, "inventor");
}
if (arr.includes("country")) {
this.selectedCountriesForFilter = [];
this.$delete(this.appliedFilters, "country");
}
if (arr.includes("patentType")) {
this.checkedPatentTypes = [];
}
}
,
//Novelty Search
noveltySearch: function () {
if (!this.noveltySearchKeyword) {
this.noveltySearchValidation = true;
return;
} else {
$('#noveltySearch').text('Searching...');
this.semanticSearchQuery = this.noveltySearchKeyword;
// document.getElementById('tab4').click();
this.validationErrorForSemanticSearch = '';
if (!this.semanticSearchQuery) {
this.validationErrorForSemanticSearch = 'Please Enter a Search Criteria';
return;
} else {
// document.getElementById("loading").style.display = "block";
// document.getElementById("mainBody").style.overflowY = "hidden";
// $("#advertisementCards").css({"display":"none"});
this.userId = document.getElementById('userIdHolder').innerHTML;
this.semanticSearchFormData = {
"searchType": "Semantic",
"searchSubType": "Semantic",
"searchKey": this.semanticSearchQuery,
"pageNumber": this.pageNumber,
'saveSearchEnabled': this.saveSearchEnabled,
'userId': this.userId,
"pageSize": this.pageSize,
"additionalFilter": {},
"refinedSearchElement": {},
"granularityLevel": this.semanticSearchGranularity
};
this.semanticSearchFormData.pageNumber = this.currentPage;
let formData = this.semanticSearchFormData;
/*console.log(formData);*/
axios({
method: "post",
// url: "http://zenx-intelx-dev.us-west-2.elasticbeanstalk.com/intelx/api/legal/search",
url: hostName + pathName + gl_semanticSearch,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
$('#noveltySearch').text('Search');
console.log(response.data);
if (!response.data.searchResults) {
this.searchResults = [];
this.noResultsFound = true;
this.lastSearchType = 'Semantic';
this.lastSearchSubType = 'Semantic';
this.currentResultSearchType = 'Semantic';
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
return;
} else {
this.searchResults = response.data.searchResults;
this.totalHits = response.data.totalHits;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage);
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
if (this.currentPage === 1) this.pageNumber = 1;
this.currentPage = 1;
this.storeDataForPagination(this.semanticSearchFormData, this.pageNumber, this.totalPages);
}
}.bind(this));
}
}
// $('#searchItModal').modal('hide');
},
showNoveltySearchResults: function () {
document.getElementById("loading").style.display = "block";
document.getElementById("mainBody").style.overflowY = "hidden";
$("#advertisementCards").css({ "display": "none" });
document.getElementById('tab4').click();
$('#searchItModal').modal('hide');
this.semanticSearch();
},
//Semantic Search
semanticSearch: function () {
this.validationErrorForSemanticSearch = '';
if (!this.semanticSearchQuery) {
this.validationErrorForSemanticSearch = 'Please Enter a Search Criteria';
return;
} else {
document.getElementById("loading").style.display = "block";
document.getElementById("mainBody").style.overflowY = "hidden";
$("#advertisementCards").css({ "display": "none" });
this.userId = document.getElementById('userIdHolder').innerHTML;
this.removeFilters(['all']);
this.semanticSearchFormData = {
"searchType": "Semantic",
"searchSubType": "Semantic",
"searchKey": this.semanticSearchQuery,
"pageNumber": this.pageNumber,
'saveSearchEnabled': this.saveSearchEnabled,
'userId': this.userId,
"pageSize": this.pageSize,
"additionalFilter": {},
"refinedSearchElement": {},
"granularityLevel": this.semanticSearchGranularity
};
this.semanticSearchFormData.pageNumber = this.currentPage;
let formData = this.semanticSearchFormData;
this.lastSearchType = 'Semantic';
this.lastSearchSubType = 'Semantic';
/*console.log(formData);*/
axios({
method: "post",
// url: "http://zenx-intelx-dev.us-west-2.elasticbeanstalk.com/intelx/api/legal/search",
url: hostName + pathName + gl_semanticSearch,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
console.log(response.data);
if (!response.data.searchResults) {
this.searchResults = [];
this.noResultsFound = true;
this.currentResultSearchType = 'Semantic';
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
return;
} else {
this.noResultsFound = false;
this.searchResults = response.data.searchResults;
this.totalHits = response.data.totalHits;
this.isResultForList = true;
this.similarReads = this.searchResults;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage);
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
/*this.assignees = response.data.countOfAssignees;
this.inventors = response.data.countOfInventors;*/
/*this.countries = response.data.countOfCountries;*/
this.currentResultSearchType = 'Semantic';
var previousResults = this.searchResults;
localStorage.setItem('previousResults', JSON.stringify(previousResults));
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
this.removeFilters(['refinedSearch']);
if (this.currentPage === 1) this.pageNumber = 1;
this.currentPage = 1;
this.storeDataForPagination(this.semanticSearchFormData, this.pageNumber, this.totalPages);
// graph data
}
}.bind(this));
this.fetchAllCounts(formData);
}
},
//Semantic Search Ends
/* Patent Valuation - Start - 20260329 */
formatPatentValuationPatentNumber: function (value) {
if (!value) return '';
return String(value).trim().toUpperCase().replace(/\s+/g, '').replace(/-/g, '');
},
generatePatentValuationSessionId: function () {
if (this.userId) {
return this.getUserSessionId(this.userId);
}
return 'pv-' + Date.now() + '-' + Math.random().toString(36).slice(2, 10);
},
getLoggedInUserIdForPatentValuation: function () {
var holder = document.getElementById('userIdHolder');
if (holder && holder.innerHTML && holder.innerHTML.trim()) {
return holder.innerHTML.trim();
}
return this.userId || '';
},
buildPatentValuationInitialPayload: function (patentNumber) {
var userId = this.getLoggedInUserIdForPatentValuation();
return {
patent_number: patentNumber,
title: '',
assignee: '',
publication_date: '',
filing_date: '',
family_size: '',
family_id: '',
invention_id: '',
jurisdictions: [],
cpc_codes: [],
independent_claim_count: '',
overall_score: null,
legal_score: null,
novelty_score: null,
market_score: null,
monetization_score: null,
technical_score: null,
risk_score: null,
estimated_value: '',
valuation_range_low: '',
valuation_range_high: '',
overview_summary: '',
novelty_summary: '',
legal_summary: '',
market_summary: '',
monetization_summary: '',
novelty_details: {},
legal_details: {},
market_details: {},
monetization_details: {},
session_id: this.patentValuationSessionId,
user_id: userId,
status: 'started',
events: []
};
},
resetPatentValuationState: function (patentNumber) {
this.patentValuationError = '';
this.validationErrorForPatentValuation = '';
this.patentValuationLoading = true;
this.patentValuationStreaming = true;
this.patentValuationStreamBuffer = '';
this.patentValuationSummary = {
patent_number: patentNumber || '',
title: '',
assignee: '',
family_id: '',
invention_id: '',
jurisdictions: '',
publication_date: '',
filing_date: '',
family_size: '',
cpc_codes: [],
independent_claim_count: ''
};
this.patentValuationResult = this.buildPatentValuationInitialPayload(patentNumber);
},
persistPatentValuationPayload: function (payload) {
try {
localStorage.setItem('patentValuationResult', JSON.stringify(payload));
} catch (e) {
console.warn('Patent valuation localStorage write failed', e);
}
},
openPatentValuationResultWindow: function (patentNumber) {
var userId = this.getLoggedInUserIdForPatentValuation();
var url = 'patent-valuation-result.html' +
'?patentNumber=' + encodeURIComponent(patentNumber) +
'&sessionId=' + encodeURIComponent(this.patentValuationSessionId || '') +
'&userId=' + encodeURIComponent(userId || '');
this.patentValuationResultWindow = window.open(url, '_blank');
if (!this.patentValuationResultWindow) {
this.patentValuationError = 'Popup blocked by browser. Please allow popups for this site.';
}
},
pushPatentValuationUpdateToResultWindow: function (payload) {
this.persistPatentValuationPayload(payload);
if (this.patentValuationResultWindow && !this.patentValuationResultWindow.closed) {
this.patentValuationResultWindow.postMessage({
type: 'PATENT_VALUATION_RESULT',
payload: payload
}, '*');
}
},
mergePatentValuationPayload: function (incoming) {
var merged = JSON.parse(JSON.stringify(this.patentValuationResult || {}));
if (!incoming || typeof incoming !== 'object') {
return merged;
}
Object.keys(incoming).forEach(function (key) {
var value = incoming[key];
if (value && typeof value === 'object' && !Array.isArray(value) && merged[key] && typeof merged[key] === 'object' && !Array.isArray(merged[key])) {
merged[key] = Object.assign({}, merged[key], value);
} else if (value !== undefined) {
merged[key] = value;
}
});
if (merged.technical_score != null && (merged.novelty_score == null || merged.novelty_score === '')) {
merged.novelty_score = merged.technical_score;
}
if (!merged.session_id) {
merged.session_id = this.patentValuationSessionId;
}
if (!merged.user_id) {
merged.user_id = this.getLoggedInUserIdForPatentValuation();
}
this.patentValuationResult = merged;
this.patentValuationSummary = {
patent_number: merged.patent_number || '',
title: merged.title || '',
assignee: merged.assignee || '',
family_id: merged.family_id || '',
invention_id: merged.invention_id || '',
jurisdictions: Array.isArray(merged.jurisdictions) ? merged.jurisdictions.join(', ') : (merged.jurisdictions || ''),
publication_date: merged.publication_date || '',
filing_date: merged.filing_date || '',
family_size: merged.family_size || '',
cpc_codes: merged.cpc_codes || [],
independent_claim_count: merged.independent_claim_count || merged.no_of_independent_claims || ''
};
return merged;
},
applyPatentValuationEventToState: function (eventObj) {
if (!eventObj || typeof eventObj !== 'object') {
return;
}
this.patentValuationResult.events = this.patentValuationResult.events || [];
this.patentValuationResult.events.push(eventObj);
var payload = {};
if (eventObj.type === 'started') {
payload = { patent_number: eventObj.patent_number || this.patentValuationPatentNumber, status: 'started' };
} else if (eventObj.type === 'retrieval_complete') {
payload = Object.assign({ status: 'retrieval_complete' }, eventObj.data || {});
} else if (eventObj.type === 'legal_score_complete') {
payload = { legal_score: eventObj.data && eventObj.data.score != null ? eventObj.data.score : eventObj.legal_score, legal_summary: eventObj.data && eventObj.data.summary ? eventObj.data.summary : '', legal_details: eventObj.data || {}, status: 'legal_score_complete' };
} else if (eventObj.type === 'novelty_score_complete') {
payload = { novelty_score: eventObj.data && eventObj.data.score != null ? eventObj.data.score : eventObj.novelty_score, novelty_summary: eventObj.data && eventObj.data.summary ? eventObj.data.summary : '', novelty_details: eventObj.data || {}, status: 'novelty_score_complete' };
} else if (eventObj.type === 'technical_score_complete') {
payload = { technical_score: eventObj.data && eventObj.data.score != null ? eventObj.data.score : eventObj.technical_score, novelty_score: eventObj.data && eventObj.data.score != null ? eventObj.data.score : eventObj.technical_score, novelty_summary: eventObj.data && eventObj.data.summary ? eventObj.data.summary : '', novelty_details: eventObj.data || {}, status: 'technical_score_complete' };
} else if (eventObj.type === 'market_score_complete') {
payload = { market_score: eventObj.data && eventObj.data.score != null ? eventObj.data.score : eventObj.market_score, market_summary: eventObj.data && eventObj.data.summary ? eventObj.data.summary : '', market_details: eventObj.data || {}, status: 'market_score_complete' };
} else if (eventObj.type === 'monetization_score_complete') {
payload = { monetization_score: eventObj.data && eventObj.data.score != null ? eventObj.data.score : eventObj.monetization_score, monetization_summary: eventObj.data && eventObj.data.summary ? eventObj.data.summary : '', monetization_details: eventObj.data || {}, status: 'monetization_score_complete' };
} else if (eventObj.type === 'risk_score_complete') {
payload = { risk_score: eventObj.data && eventObj.data.score != null ? eventObj.data.score : eventObj.risk_score, status: 'risk_score_complete' };
} else if (eventObj.type === 'overall_score_complete') {
payload = { overall_score: eventObj.data && eventObj.data.score != null ? eventObj.data.score : (eventObj.data != null ? eventObj.data : eventObj.overall_score), status: 'overall_score_complete' };
} else if (eventObj.type === 'estimated_value_complete') {
payload = Object.assign({ status: 'estimated_value_complete' }, eventObj.data || {});
} else if (eventObj.type === 'completed') {
payload = Object.assign({ status: 'completed' }, eventObj.data || {});
this.patentValuationLoading = false;
this.patentValuationStreaming = false;
document.getElementById("loading").style.display = "none";
document.getElementById("mainBody").style.overflowY = "scroll";
} else if (eventObj.type === 'error') {
this.patentValuationLoading = false;
this.patentValuationStreaming = false;
this.patentValuationError = (eventObj.data && eventObj.data.message) || eventObj.message || 'Patent valuation request failed.';
document.getElementById("loading").style.display = "none";
document.getElementById("mainBody").style.overflowY = "scroll";
payload = { status: 'error', error_message: this.patentValuationError };
} else {
payload = eventObj.data || eventObj;
}
var merged = this.mergePatentValuationPayload(payload);
merged.events = this.patentValuationResult.events;
this.pushPatentValuationUpdateToResultWindow(merged);
},
extractPatentValuationEventsFromChunk: function (chunkText) {
var allText = (this.patentValuationStreamBuffer || '') + (chunkText || '');
var parts = allText.split(/
?
/);
this.patentValuationStreamBuffer = parts.pop() || '';
var events = [];
parts.forEach(function (line) {
var text = line.trim();
if (!text) return;
if (text.indexOf('data:') === 0) text = text.slice(5).trim();
try {
var parsed = JSON.parse(text);
if (parsed) events.push(parsed);
} catch (e) {
console.warn('Unable to parse patent valuation stream line', text);
}
});
return events;
},
finalizePatentValuationResidualBuffer: function () {
var residual = (this.patentValuationStreamBuffer || '').trim();
this.patentValuationStreamBuffer = '';
if (!residual) return [];
if (residual.indexOf('data:') === 0) residual = residual.slice(5).trim();
try { return [JSON.parse(residual)]; } catch (e) { console.warn('Unable to parse residual patent valuation stream buffer', residual); return []; }
},
startPatentValuationStream: async function (patentNumber) {
this.patentValuationLoading = true;
this.patentValuationStreaming = true;
this.patentValuationError = '';
document.getElementById("loading").style.display = "block";
document.getElementById("mainBody").style.overflowY = "hidden";
if (this.patentValuationStreamAbortController) { try { this.patentValuationStreamAbortController.abort(); } catch (e) {} }
this.patentValuationStreamAbortController = new AbortController();
this.applyPatentValuationEventToState({ type: 'started', patent_number: patentNumber });
var userId = this.getLoggedInUserIdForPatentValuation();
this.userId = userId || this.userId;
var requestPayload = {
patent_number: patentNumber,
searchType: 'PatentValuation',
searchSubType: 'PatentValuation',
saveSearchEnabled: this.saveSearchEnabled,
userId: userId,
userSessionId: this.patentValuationSessionId,
session_id: this.patentValuationSessionId
};
this.patentValuationFormData = requestPayload;
var endpoint = (typeof gl_patentValuationStream !== 'undefined') ? gl_patentValuationStream : ((typeof gl_patentValuationSearch !== 'undefined') ? gl_patentValuationSearch : '/patent-valuation/stream');
try {
var response = await fetch(hostName + pathName + endpoint, {
method: 'POST',
headers: {
'Authorization': `Bearer ${jwtToken}`,
'Content-Type': 'application/json',
'Accept': 'text/event-stream, application/json, text/plain'
},
body: JSON.stringify(requestPayload),
signal: this.patentValuationStreamAbortController.signal
});
if (!response.ok) throw new Error('Patent valuation API failed with status ' + response.status);
if (!response.body) throw new Error('Streaming response body is not available.');
var reader = response.body.getReader();
var decoder = new TextDecoder('utf-8');
while (true) {
var readResult = await reader.read();
if (readResult.done) break;
var chunk = decoder.decode(readResult.value, { stream: true });
var events = this.extractPatentValuationEventsFromChunk(chunk);
for (var i = 0; i < events.length; i++) this.applyPatentValuationEventToState(events[i]);
}
var tailEvents = this.finalizePatentValuationResidualBuffer();
for (var j = 0; j < tailEvents.length; j++) this.applyPatentValuationEventToState(tailEvents[j]);
if (this.patentValuationResult.status !== 'completed') {
this.applyPatentValuationEventToState({ type: 'completed', data: { status: 'completed' } });
}
} catch (error) {
if (error && error.name === 'AbortError') {
console.warn('Patent valuation stream aborted');
return;
}
console.error('Patent valuation stream failed', error);
this.applyPatentValuationEventToState({ type: 'error', message: error.message || 'Patent valuation streaming failed.' });
}
},
patentValuationSearch: function () {
this.validationErrorForPatentValuation = '';
this.patentValuationError = '';
if (!this.patentValuationPatentNumber || !this.patentValuationPatentNumber.trim()) {
this.validationErrorForPatentValuation = 'Please enter a patent number';
return;
}
var formattedPatentNumber = this.formatPatentValuationPatentNumber(this.patentValuationPatentNumber);
if (!formattedPatentNumber) {
this.validationErrorForPatentValuation = 'Please enter a valid patent number';
return;
}
this.patentValuationPatentNumber = formattedPatentNumber;
this.userId = this.getLoggedInUserIdForPatentValuation();
this.patentValuationSessionId = this.generatePatentValuationSessionId();
this.resetPatentValuationState(formattedPatentNumber);
this.persistPatentValuationPayload(this.patentValuationResult);
this.openPatentValuationResultWindow(formattedPatentNumber);
this.startPatentValuationStream(formattedPatentNumber);
},
handlePatentValuationEvent: function (eventObj) {
this.applyPatentValuationEventToState(eventObj);
},
/* Patent Valuation - End - 20260329 */
intelxAiSearch: function () {
console.log(`intexai search`)
if (!this.intelxAiSearchKey) {
this.validationErrorForSemanticSearch = 'Please Enter a Search Criteria';
return;
} else {
this.showFullPageLoader("Hold tight—Intelx AI is scanning millions of patents…");
$("#advertisementCards").css({ "display": "none" });
this.userId = document.getElementById('userIdHolder').innerHTML;
this.removeFilters(['all']);
this.intelxAiSearchFormData = {
"searchType": "IntelXAi",
"searchSubType": "IntelXAi",
"searchKey": this.intelxAiSearchKey,
"pageNumber": this.pageNumber,
'saveSearchEnabled': this.saveSearchEnabled,
'userId': this.userId,
"pageSize": this.pageSize,
"additionalFilter": {},
"refinedSearchElement": {},
"userSessionId": this.getUserSessionId(this.userId)
};
this.intelxAiSearchFormData.pageNumber = this.currentPage;
let formData = this.intelxAiSearchFormData;
/*console.log(formData);*/
axios({
method: "post",
url: hostName + pathName + gl_intelxAiSearch,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
console.log(response.data);
if (!response.data.searchResults) {
this.searchResults = [];
this.noResultsFound = true;
this.lastSearchType = 'IntelxAi';
this.lastSearchSubType = 'IntelxAi';
this.currentResultSearchType = 'IntelxAi';
this.hideFullPageLoader();
return;
} else {
this.noResultsFound = false;
this.searchResults = response.data.searchResults;
this.totalHits = response.data.totalHits;
this.isResultForList = true;
this.similarReads = this.searchResults;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage);
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
/*this.assignees = response.data.countOfAssignees;
this.inventors = response.data.countOfInventors;*/
/*this.countries = response.data.countOfCountries;*/
this.lastSearchType = 'IntelxAi';
this.lastSearchSubType = 'IntelxAi';
this.currentResultSearchType = 'IntelxAi';
var previousResults = this.searchResults;
localStorage.setItem('previousResults', JSON.stringify(previousResults));
this.hideFullPageLoader();
this.removeFilters(['refinedSearch']);
if (this.currentPage === 1) this.pageNumber = 1;
this.currentPage = 1;
this.storeDataForPagination(this.intelxAiSearchFormData, this.pageNumber, this.totalPages);
// graph data
this.intelxAiSearchFormData.searchKey = '';
this.fetchAllCounts(formData);
}
}.bind(this)).catch(function (error) {
console.error('API Error:', error);
this.hideFullPageLoader();
this.errorModalMsg = "Request failed! Something went wrong.";
$('#errorModal').modal('show');
if (error.response) {
console.error('Response error:', error.response.status, error.response.data);
} else if (error.request) {
console.error('Network error:', error.request);
} else {
console.error('Request setup error:', error.message);
}
}.bind(this));
}
},
getComparisonData: function (elem,docNumber, userSessionId) {
const endpoint = hostName + pathName + `/ai/compare/docNumber/${docNumber}/sessionId/${userSessionId}`;
this.showFullPageLoader("Intelx AI is mapping similarities and differences between patents…");
axios({
method: "get",
url: endpoint,
headers: {
"Authorization": `Bearer ${jwtToken}`,
"Content-Type": "application/json",
"Accept": "application/json"
}
}).then(function (response) {
console.log(response.data);
this.hideFullPageLoader();
// Handle no results case
if (!response.data) {
return;
} else {
this.comparisonData = response.data;
$('#compareModal').modal('show');
}
}.bind(this)).catch(function (error) {
console.error('API Error:', error);
this.hideFullPageLoader();
this.errorModalMsg = "Request failed! Something went wrong.";
$('#errorModal').modal('show');
if (error.response) {
console.error('Response error:', error.response.status, error.response.data.errorMessage);
this.errorModalMsg = "Request failed! " + error.response.data.errorMessage;
} else if (error.request) {
console.error('Network error:', error.request);
} else {
console.error('Request setup error:', error.message);
}
}.bind(this));
},
async copyComparisonToClipboard() {
try {
let clipboardText = "COMPARISON RESULTS\n";
clipboardText += "==================\n\n";
if (this.comparisonData.similarities && this.comparisonData.similarities.length > 0) {
clipboardText += "SIMILARITIES:\n";
clipboardText += "-------------\n";
this.comparisonData.similarities.forEach((similarity, index) => {
clipboardText += `${index + 1}. ${similarity}\n`;
});
clipboardText += "\n";
}
if (this.comparisonData.differences && this.comparisonData.differences.length > 0) {
clipboardText += "DIFFERENCES:\n";
clipboardText += "------------\n";
this.comparisonData.differences.forEach((difference, index) => {
clipboardText += `${index + 1}. ${difference}\n`;
});
}
await navigator.clipboard.writeText(clipboardText);
this.showCopySuccess();
} catch (error) {
console.error('Failed to copy to clipboard:', error);
}
},
showCopySuccess() {
const copyBtn = document.querySelector('#compareModal .btn-primary');
const originalText = copyBtn.innerHTML;
copyBtn.innerHTML = ' Copied!';
// copyBtn.disabled = true;
setTimeout(() => {
copyBtn.innerHTML = originalText;
copyBtn.disabled = false;
}, 2000);
},
downloadDraftPatent: function (sessionId) {
const url = hostName + pathName + `/ai/draft-patent/sessionId/${sessionId}`;
this.showFullPageLoader('iIntelx AI is assembling your drafted patent package…');
axios.get(url, {
responseType: 'blob'
})
.then(response => {
const blob = new Blob([response.data], { type: 'application/pdf' });
const link = document.createElement('a');
link.href = window.URL.createObjectURL(blob);
link.download = `patent_${sessionId}.docx`;
document.body.appendChild(link);
this.hideFullPageLoader();
link.click();
document.body.removeChild(link);
window.URL.revokeObjectURL(link.href);
})
.catch(error => {
this.hideFullPageLoader();
this.errorModalMsg = "Download failed! Something went wrong.";
$('#errorModal').modal('show');
console.error(error);
});
},
getUserSessionId: function (userId) {
const storageKey = `userSessionId_${userId}`;
const existingSessionId = sessionStorage.getItem(storageKey);
if (existingSessionId) {
return existingSessionId;
}
const timestamp = Math.floor(Date.now() / 1000);
const [userPart, domainPart] = userId.split('@');
const domainName = domainPart.split('.')[0];
const newSessionId = `${userPart}_at_${domainName}_${timestamp}`;
sessionStorage.setItem(storageKey, newSessionId);
return newSessionId;
},
legalLitigationSearch: function () {
var query = [];
/*for (var i = 0 ; i < this.activeLists.length; i++) {
if(this.activeListsForInput[i]){
if(i==0){
query.push({'fieldName':this.activeListsForInput[i].replace(/[^a-z0-9]+/gi,'-').toLowerCase(),'value':this.activeListsWithMappedData[i]});
}else{
query.push({'condition': this.andOr[i] , 'fieldName':this.activeListsForInput[i].replace(/[^a-z0-9]+/gi,'-').toLowerCase(),'value':this.activeListsWithMappedData[i]});
}
}
}*/
var litigationQuery = [];
for (var i = 0; i < this.legalLiGenactiveLists.length; i++) {
if (this.legalLiGenactiveListsForInput[i]) {
if (i == 0) {
if (!this.legalLiGenactiveListsWithMappedData[i]) {
this.validationErrorForLegalLitigation = 'Fields can not be empty.';
return;
} else {
litigationQuery.push({ 'fieldName': this.legalLiGenactiveListsForInput[i].replace(/[^a-z0-9]+/gi, '-').toLowerCase(), 'value': this.legalLiGenactiveListsWithMappedData[i] });
}
} else {
if (!this.legalLiGenactiveListsWithMappedData[i]) {
this.validationErrorForLegalLitigation = 'Fields can not be empty.';
return;
} else {
litigationQuery.push({ 'condition': this.legalLiGenandOr[i], 'fieldName': this.legalLiGenactiveListsForInput[i].replace(/[^a-z0-9]+/gi, '-').toLowerCase(), 'value': this.legalLiGenactiveListsWithMappedData[i] });
}
}
}
}
if (!litigationQuery.length) {
this.validationErrorForLegalLitigation = 'Please select one or more filter(s)';
return;
} else {
document.getElementById("loading").style.display = "block";
document.getElementById("mainBody").style.overflowY = "hidden";
$("#advertisementCards").css({ "display": "none" });
this.userId = document.getElementById('userIdHolder').innerHTML;
this.legalLitigationSearchFormData = {
"searchType": "Legal",
"searchSubType": "Litigation",
"selectedCountries": this.selectedLegalCountries,
"advancedSearchFields": litigationQuery,
"pageNumber": this.pageNumber,
'saveSearchEnabled': this.saveSearchEnabled,
'userId': this.userId,
};
let formData = this.legalLitigationSearchFormData;
console.log(formData);
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
axios({
method: "post",
url: hostName + pathName + gl_legalLitigationSearch,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
console.log(response.data);
if (!response.data.cases) {
this.searchResults = [];
this.noResultsFound = true;
// this.showFieldSearchPanel = false;
this.lastSearchType = 'Legal';
this.lastSearchSubType = 'Litigation';
this.currentResultSearchType = 'Legal';
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
$("html, body").animate({ scrollTop: $(document).height() }, 1000);
return;
} else {
this.noResultsFound = false;
this.searchResults = response.data.cases;
this.totalHits = response.data.totalHits;
this.isResultForList = true;
this.similarReads = this.searchResults;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage);
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
/*this.assignees = response.data.countOfAssignees;
this.inventors = response.data.countOfInventors;*/
// this.countries = response.data.countOfCountries;
this.showFieldSearchPanel = false;
this.lastSearchType = 'Legal';
this.lastSearchSubType = 'Litigation';
this.currentResultSearchType = 'Legal';
var previousResults = this.searchResults;
localStorage.setItem('previousResults', JSON.stringify(previousResults));
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
}
}.bind(this));
}
/*this.noResultsFound = false;
this.totalHits = 2;
this.isResultForList = true;
this.similarReads = this.searchResults;
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
if(this.totalPages > 400){
this.totalPages = 400;
}
this.assignees = [];
this.inventors = [];
// this.countries = response.data.countOfCountries;
this.showFieldSearchPanel = false;
this.lastSearchType = 'Legal';
this.lastSearchSubType = 'Litigation';
this.currentResultSearchType = 'Legal';
var previousResults = this.searchResults;
this.hideActionButtons = true;
this.searchResults = this.tempLitigationResults.cases;
console.log(this.searchResults);*/
},
legalGenericSearch: function () {
var query = [];
/*for (var i = 0 ; i < this.activeLists.length; i++) {
if(this.activeListsForInput[i]){
if(i==0){
query.push({'fieldName':this.activeListsForInput[i].replace(/[^a-z0-9]+/gi,'-').toLowerCase(),'value':this.activeListsWithMappedData[i]});
}else{
query.push({'condition': this.andOr[i] , 'fieldName':this.activeListsForInput[i].replace(/[^a-z0-9]+/gi,'-').toLowerCase(),'value':this.activeListsWithMappedData[i]});
}
}
}*/
var legalGenericQuery = [];
for (var i = 0; i < this.legalGenericLists.length; i++) {
if (this.legalGenericActiveListsForInput[i]) {
if (i == 0) {
if (!this.legalGenericListsWithMappedData[i]) {
this.validationErrorForLegalGeneric = 'Fields can not be empty.';
return;
} else {
if (this.legalGenericActiveListsForInput[i].includes('Date')) {
legalGenericQuery.push({
'fieldName': this.legalGenericActiveListsForInput[i].replace(/[^a-z0-9]+/gi, '-').toLowerCase(),
'dateRangeValue': this.legalGenericListsWithMappedData[i]
});
} else {
legalGenericQuery.push({
'fieldName': this.legalGenericActiveListsForInput[i].replace(/[^a-z0-9]+/gi, '-').toLowerCase(),
'value': this.legalGenericListsWithMappedData[i]
});
}
}
} else {
if (!this.legalGenericListsWithMappedData[i]) {
this.validationErrorForLegalGeneric = 'Fields can not be empty.';
return;
} else {
if (this.legalGenericActiveListsForInput[i].includes('Date')) {
legalGenericQuery.push({ 'condition': this.legalGenericandOr[i], 'fieldName': this.legalGenericActiveListsForInput[i].replace(/[^a-z0-9]+/gi, '-').toLowerCase(), 'dateRangeValue': this.legalGenericListsWithMappedData[i] });
} else {
legalGenericQuery.push({ 'condition': this.legalGenericandOr[i], 'fieldName': this.legalGenericActiveListsForInput[i].replace(/[^a-z0-9]+/gi, '-').toLowerCase(), 'value': this.legalGenericListsWithMappedData[i] });
}
}
}
}
}
if (!legalGenericQuery.length) {
this.validationErrorForLegalGeneric = 'Please select one or more filter(s)';
return;
} else {
document.getElementById("loading").style.display = "block";
document.getElementById("mainBody").style.overflowY = "hidden";
$("#advertisementCards").css({ "display": "none" });
this.userId = document.getElementById('userIdHolder').innerHTML;
this.legalGenericSearchFormData = {
"searchType": "Legal",
"searchSubType": "Legal",
"selectedCountries": this.selectedCountries,
"advancedSearchFields": legalGenericQuery,
"pageNumber": this.pageNumber,
'saveSearchEnabled': this.saveSearchEnabled,
'userId': this.userId,
/*'patentTypes' : this.patentTypes,*/
"additionalFilter": {},
"refinedSearchElement": {}
};
let formData = this.legalGenericSearchFormData;
this.getBaseFormData = formData;
/*console.log(formData);*/
axios({
method: "post",
/*url: "http://zenx-intelx-dev.us-west-2.elasticbeanstalk.com/intelx/api/legal/search",*/
// url: "http://alb-patent-dev-us-west-2-647833147.us-west-2.elb.amazonaws.com/intelx/api/legal/search",
url: hostName + pathName + gl_legalGenericSearch,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
console.log(response.data);
if (!response.data.searchResults) {
this.searchResults = [];
this.noResultsFound = true;
/*this.showFieldSearchPanel = false;*/
this.lastSearchType = 'Legal';
this.lastSearchSubType = 'Legal';
this.currentResultSearchType = 'Legal';
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
$("html, body").animate({ scrollTop: $(document).height() }, 1000);
return;
} else {
this.noResultsFound = false;
this.searchResults = response.data.searchResults;
this.totalHits = response.data.totalHits;
this.isResultForList = true;
this.similarReads = this.searchResults;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage);
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
/*this.assignees = response.data.countOfAssignees;
this.inventors = response.data.countOfInventors;*/
/*this.countries = response.data.countOfCountries;*/
this.showFieldSearchPanel = false;
this.lastSearchType = 'Legal';
this.lastSearchSubType = 'Legal';
this.currentResultSearchType = 'Legal';
var previousResults = this.searchResults;
localStorage.setItem('previousResults', JSON.stringify(previousResults));
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
this.removeFilters(['refinedSearch']);
axios({
method: "post",
url: hostName + pathName + gl_assignees_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.assignees = response.data;
// Display fetched data
localStorage.setItem('graphDataForAssignee', JSON.stringify(this.assignees));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_inventors_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.inventors = response.data;
// Display fetched data
localStorage.setItem('graphDataForInventors', JSON.stringify(this.inventors));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_countries_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedCountries = response.data;
// this.selectedCountriesForFilter = this.fetchedCountries.map(item => item.name);
// Display fetched data
localStorage.setItem('graphDataForCountries', JSON.stringify(this.fetchedCountries));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_years_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedYears = response.data;
// Display fetched data
localStorage.setItem('graphDataForYears', JSON.stringify(this.fetchedYears));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_live_countries_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedLiveCountries = response.data;
// Display fetched data
localStorage.setItem('graphDataForLiveCountries', JSON.stringify(this.fetchedLiveCountries));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_live_assignee_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedLiveAssignees = response.data;
// Display fetched data
localStorage.setItem('graphDataForLiveAssignees', JSON.stringify(this.fetchedLiveAssignees));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_live_catchwords,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedLiveCatchWords = response.data;
// Display fetched data
localStorage.setItem('graphDataForLiveCatchWords', JSON.stringify(this.fetchedLiveCatchWords));
})
.catch(error => {
console.error('Error fetching data:', error);
});
}
}.bind(this));
}
},
/* ---------- Image Uploader ---------- */
browse() {
this.$refs.fileInput && this.$refs.fileInput.click()
},
validateFile(f) {
this.error = ''
const MAX_SIZE = 5 * 1024 * 1024
if (!f.type.startsWith('image/')) {
this.error = 'Please select an image file.'
return false
}
if (f.size > MAX_SIZE) {
this.error = 'File too large. Max 5 MB.'
return false
}
return true
},
onFileChange(e) {
const f = e.target.files && e.target.files[0]
if (!f) return
this.handleFile(f)
},
onDrop(e) {
const f = e.dataTransfer.files && e.dataTransfer.files[0]
if (!f) return
this.handleFile(f)
},
handleFile(f) {
if (!this.validateFile(f)) {
this.file = null
this.preview = ''
return
}
this.file = f
const reader = new FileReader()
reader.onload = (evt) => {
this.preview = evt.target.result
}
reader.readAsDataURL(f)
},
clear() {
this.file = null
this.preview = ''
this.error = ''
this.progress = 0
if (this.$refs.fileInput) this.$refs.fileInput.value = null
},
/* ---------- Image Search ---------- */
/* ---------- Image Search ---------- */
/* ---------- Image Search ---------- */
async imageSearch() {
var imageSearchQuery = []
for (var i = 0; i < this.imageSearchLists.length; i++) {
if (this.imageSearchActiveListsForInput[i]) {
if (!this.imageSearchListsWithMappedData[i]) {
this.validationErrorForimageSearch = 'Fields can not be empty.'
return
}
let fieldObj = {
fieldName: this.imageSearchActiveListsForInput[i].replace(/[^a-z0-9]+/gi, '-').toLowerCase()
}
if (this.imageSearchActiveListsForInput[i].includes('Date')) {
fieldObj.dateRangeValue = this.imageSearchListsWithMappedData[i]
} else {
fieldObj.value = this.imageSearchListsWithMappedData[i]
}
if (i !== 0) fieldObj.condition = this.imageSearchandOr[i]
imageSearchQuery.push(fieldObj)
}
}
if (!imageSearchQuery.length) {
this.validationErrorForimageSearch = 'Please select one or more filter(s)'
return
}
document.getElementById("loading").style.display = "block";
document.getElementById("mainBody").style.overflowY = "hidden";
$("#advertisementCards").css({ "display": "none" });
this.userId = document.getElementById('userIdHolder').innerHTML;
let formDataObj = {
"searchType": "Image",
"searchSubType": "Image",
"selectedCountries": this.selectedCountries,
"advancedSearchFields": imageSearchQuery,
"pageNumber": this.pageNumber,
'saveSearchEnabled': this.saveSearchEnabled,
'userId': this.userId,
"additionalFilter": {},
"refinedSearchElement": {}
}
this.imageSearchFormData = formDataObj
this.getBaseFormData = formDataObj
// ✅ Build multipart form-data correctly
let formData = new FormData()
formData.append(
"metadata",
new Blob([JSON.stringify(formDataObj)], { type: "application/json" })
)
if (this.file) {
formData.append("file", this.file) // backend expects "file"
}
this.uploading = true
this.progress = 0
this.error = ''
try {
const response = await axios.post(
hostName + pathName + gl_imageSearch,
formData,
{
headers: {
"Authorization": `Bearer ${jwtToken}`,
"Content-Type": "multipart/form-data"
},
onUploadProgress: (e) => {
if (e.lengthComputable) {
this.progress = Math.round((e.loaded / e.total) * 100)
}
}
}
)
console.log("Search Response:", response.data)
/* alert(response.data.message);*/
this.imageSearchMessage = response.data.message;
$('#imageSearchMessageModal').modal('show');
this.uploading = false
this.progress = 100
if (!response.data.searchResults) {
this.searchResults = []
// this.noResultsFound = true
this.lastSearchType = 'Image'
this.lastSearchSubType = 'Image'
this.currentResultSearchType = 'Image'
$('#loading').hide()
document.getElementById("mainBody").style.overflowY = "scroll"
$("html, body").animate({ scrollTop: $(document).height() }, 1000)
return
}
this.noResultsFound = false
this.searchResults = response.data.searchResults
this.totalHits = response.data.totalHits
this.isResultForList = true
this.similarReads = this.searchResults
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage)
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1
}
this.showFieldSearchPanel = false
this.lastSearchType = 'Image'
this.lastSearchSubType = 'Image'
this.currentResultSearchType = 'Image'
var previousResults = this.searchResults
localStorage.setItem('previousResults', JSON.stringify(previousResults))
$('#loading').hide()
document.getElementById("mainBody").style.overflowY = "scroll"
this.removeFilters(['refinedSearch'])
} catch (error) {
// reset states
this.uploading = false
this.progress = 0
/* this.error = "Upload/Search error. Check your connection or server."
console.error("Image search error:", error)*/
// always hide loader & restore scroll
$('#loading').hide()
document.getElementById("mainBody").style.overflowY = "scroll"
// 🔹 Show API error response in alert if available
if (error.response && error.response.data) {
const { errorMessage, errorCode } = error.response.data
if (errorMessage) {
this.imageSearchMessage = errorMessage + (errorCode ? ` (${errorCode})` : '');
$('#imageSearchMessageModal').modal('show');
} else {
this.imageSearchMessage = "Something went wrong. Please try again.";
$('#imageSearchMessageModal').modal('show');
}
} else {
/*this.imageSearchMessage = "Network or server error. Please try again.";*/
}
}
},
getImageSearchResultsFromLink: function (searchId) {
this.searchId = searchId;
document.getElementById("loading").style.display = "block";
document.getElementById("mainBody").style.overflowY = "hidden";
this.userId = document.getElementById("userIdHolder").innerHTML;
this.removeFilters(["all"]);
var imageSearchQuery = [];
this.imageSearchFormData = {
searchType: "Image",
searchSubType: "Image",
selectedCountries: this.selectedCountries,
advancedSearchFields: imageSearchQuery,
pageNumber: this.pageNumber,
saveSearchEnabled: this.saveSearchEnabled,
// userId: this.userId,
userId: this.userId,
pageSize: this.pageSize,
patentTypes: this.selectedPatentTypes,
additionalFilter: {},
refinedSearchElement: {},
searchId: this.searchId,
};
this.imageSearchFormData.pageNumber = this.currentPage;
let formData = this.imageSearchFormData;
document.getElementById("tab6").click();
axios({
method: "post",
url: hostName + pathName + gl_imageSearch + "/results",
data: formData,
headers: {
Authorization: `Bearer ${jwtToken}`,
"Content-Type": "application/json",
Accept: "application/json",
},
})
.then(function (response) {
console.log(response.data);
if (!response.data.searchResults) {
this.searchResults = [];
this.noResultsFound = true;
this.lastSearchType = "Image";
this.lastSearchSubType = "Image";
this.currentResultSearchType = "Image";
$("#loading").hide();
document.getElementById("mainBody").style.overflowY = "scroll";
return;
} else {
this.noResultsFound = false;
this.searchResults = response.data.searchResults;
this.totalHits = response.data.totalHits;
this.isResultForList = true;
this.similarReads = this.searchResults;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(
this.totalResultsToBeShown / this.noOfResultsInPage
);
} else {
this.totalPages =
Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
this.lastSearchType = "Image";
this.lastSearchSubType = "Image";
this.currentResultSearchType = "Image";
var previousResults = this.searchResults;
localStorage.setItem("previousResults", JSON.stringify(previousResults));
$("#loading").hide();
document.getElementById("mainBody").style.overflowY = "scroll";
this.removeFilters(["refinedSearch"]);
if (this.currentPage === 1) this.pageNumber = 1;
this.currentPage = 1;
this.storeDataForPagination(
this.imageSearchFormData,
this.pageNumber,
this.totalPages
);
// graph data
this.fetchAllCounts(formData);
}
}.bind(this))
.catch(
function (error) {
$("#loading").hide();
document.getElementById("mainBody").style.overflowY = "scroll";
if (error.response && error.response.data) {
const { errorMessage, errorCode } = error.response.data;
this.imageSearchMessage = errorMessage + (errorCode ? ` (${errorCode})` : "");
$('#imageSearchMessageModal').modal('show');
} else {
/*this.imageSearchMessage = "Network or server error. Please try again.";*/
}
}.bind(this)
);
},
gainConfidenceSearch: function () {
if (!this.gainConfidenceKeyword) {
this.gainConfidenceValidation = true;
return;
} else {
//document.getElementById('tab2').click();
$('#gainConfidenceSearch').text('Searching...');
var gainSearchJson = [
{
"fieldName": "title",
"condition": "or",
"value": this.gainConfidenceKeyword,
},
{
"condition": "or",
"fieldName": "abstract",
"value": this.gainConfidenceKeyword,
},
{
"condition": "or",
"fieldName": "claims",
"value": this.gainConfidenceKeyword,
},
{
"condition": "or",
"fieldName": "description",
"value": this.gainConfidenceKeyword,
}
];
for (i = 0; i < gainSearchJson.length; i++) {
this.activeListsForInput.unshift(gainSearchJson[i].fieldName);
this.andOr.unshift(gainSearchJson[i].condition);
this.activeListsWithMappedData.unshift(gainSearchJson[i].value);
}
// document.getElementById("loading").style.display = "block";
// document.getElementById("mainBody").style.overflowY = "hidden";
// $("#advertisementCards").css({"display":"none"});
this.userId = document.getElementById('userIdHolder').innerHTML;
this.fieldSearchFormData = {
"searchType": "Field",
"searchSubType": "Field",
"selectedCountries": this.selectedCountries,
"advancedSearchFields": gainSearchJson,
"pageNumber": this.pageNumber,
'saveSearchEnabled': this.saveSearchEnabled,
'userId': this.userId,
"pageSize": this.pageSize,
"patentTypes": this.selectedPatentTypes,
"additionalFilter": {},
"refinedSearchElement": {}
};
this.fieldSearchFormData.pageNumber = this.currentPage;
let formData = this.fieldSearchFormData;
axios({
method: "post",
// url: "http://zenx-intelx-dev.us-west-2.elasticbeanstalk.com/intelx/api/legal/search",
url: hostName + pathName + gl_fieldSearch,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
// console.log(response.data);
$('#gainConfidenceSearch').text('Search');
// this.searchType ='Field';
if (!response.data.searchResults) {
this.searchResults = [];
this.noResultsFound = true;
this.showFieldSearchPanel = false;
this.lastSearchType = 'Field';
this.lastSearchSubType = 'Field';
this.currentResultSearchType = 'Field';
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
return;
} else {
// this.noResultsFound = false;
// this.searchResults = response.data.searchResults;
this.totalHits = response.data.totalHits;
this.confidenceSearchData = response.data;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage);
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
if (this.currentPage === 1) this.pageNumber = 1;
this.currentPage = 1;
this.storeDataForPagination(this.fieldSearchFormData, this.pageNumber, this.totalPages);
}
}.bind(this));
console.log('closing modal')
// $('#exploreItModal').modal('hide');
}
},
showConfidenceSearchResults: function (searchData, formData) {
$("#advertisementCards").css({ "display": "none" });
this.searchType = 'Field';
this.noResultsFound = false;
this.searchResults = searchData.searchResults;
//highlighing the search tab
$('.searchTypeButton').removeClass("leftSelectorRadio");
var btnClass = '.' + this.searchType;
$(btnClass).addClass("leftSelectorRadio");
this.isResultForList = true;
this.similarReads = this.searchResults;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage);
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
this.showFieldSearchPanel = false;
this.lastSearchType = 'Field';
this.lastSearchSubType = 'Field';
this.currentResultSearchType = 'Field';
var previousResults = this.searchResults;
localStorage.setItem('previousResults', JSON.stringify(previousResults));
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
this.removeFilters(['all']);
axios({
method: "post",
url: hostName + pathName + gl_assignees_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
//console.log(response.data);
this.assignees = response.data;
// Display fetched data
localStorage.setItem('graphDataForAssignee', JSON.stringify(this.assignees));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_inventors_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
//console.log(response.data);
this.inventors = response.data;
// Display fetched data
localStorage.setItem('graphDataForInventors', JSON.stringify(this.inventors));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_countries_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
//console.log(response.data);
this.fetchedCountries = response.data;
// this.countries;
// Display fetched data
// this.selectedCountriesForFilter = this.fetchedCountries.map(item => item.name);
localStorage.setItem('graphDataForCountries', JSON.stringify(this.fetchedCountries));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_years_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedYears = response.data;
// Display fetched data
localStorage.setItem('graphDataForYears', JSON.stringify(this.fetchedYears));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_live_countries_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedLiveCountries = response.data;
// Display fetched data
localStorage.setItem('graphDataForLiveCountries', JSON.stringify(this.fetchedLiveCountries));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_live_assignee_count,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedLiveAssignees = response.data;
// Display fetched data
localStorage.setItem('graphDataForLiveAssignees', JSON.stringify(this.fetchedLiveAssignees));
})
.catch(error => {
console.error('Error fetching data:', error);
});
axios({
method: "post",
url: hostName + pathName + gl_live_catchwords,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedLiveCatchWords = response.data;
// Display fetched data
localStorage.setItem('graphDataForLiveCatchWords', JSON.stringify(this.fetchedLiveCatchWords));
})
.catch(error => {
console.error('Error fetching data:', error);
});
$('#exploreItModal').modal('hide');
},
fieldSearch: function () {
var fieldSearchQuery = [];
for (var i = 0; i < this.activeLists.length; i++) {
if (this.activeListsForInput[i]) {
if (i == 0) {
if (!this.activeListsWithMappedData[i]) {
this.validationErrorForFieldSearch = 'Fields can not be empty.';
return;
} else {
//fieldSearchQuery.push({'fieldName':this.activeListsForInput[i].replace(/[^a-z0-9]+/gi,'-').toLowerCase(),'value':this.activeListsWithMappedData[i]});
if (this.activeListsForInput[i].includes('Date')) {
fieldSearchQuery.push({
'fieldName': this.activeListsForInput[i].replace(/[^a-z0-9]+/gi, '-').toLowerCase(),
'dateRangeValue': this.activeListsWithMappedData[i]
});
} else {
fieldSearchQuery.push({
'fieldName': this.activeListsForInput[i].replace(/[^a-z0-9]+/gi, '-').toLowerCase(),
'value': this.activeListsWithMappedData[i]
});
}
}
} else {
if (!this.activeListsWithMappedData[i]) {
this.validationErrorForFieldSearch = 'Fields can not be empty.';
return;
} else {
// fieldSearchQuery.push({'condition': this.andOr[i] , 'fieldName':this.activeListsForInput[i].replace(/[^a-z0-9]+/gi,'-').toLowerCase(),'value':this.activeListsWithMappedData[i]});
if (this.activeListsForInput[i].includes('Date')) {
fieldSearchQuery.push({ 'condition': this.andOr[i], 'fieldName': this.activeListsForInput[i].replace(/[^a-z0-9]+/gi, '-').toLowerCase(), 'dateRangeValue': this.activeListsWithMappedData[i] });
} else {
fieldSearchQuery.push({ 'condition': this.andOr[i], 'fieldName': this.activeListsForInput[i].replace(/[^a-z0-9]+/gi, '-').toLowerCase(), 'value': this.activeListsWithMappedData[i] });
}
}
}
}
}
if (!fieldSearchQuery.length) {
this.validationErrorForFieldSearch = 'Please select one or more filter(s)';
return;
} else {
document.getElementById("loading").style.display = "block";
document.getElementById("mainBody").style.overflowY = "hidden";
$("#advertisementCards").css({ "display": "none" });
this.userId = document.getElementById('userIdHolder').innerHTML;
this.removeFilters(['all']);
this.fieldSearchFormData = {
"searchType": "Field",
"searchSubType": "Field",
"selectedCountries": this.selectedCountries,
"advancedSearchFields": fieldSearchQuery,
"pageNumber": this.pageNumber,
'saveSearchEnabled': this.saveSearchEnabled,
'userId': this.userId,
"pageSize": this.pageSize,
"patentTypes": this.selectedPatentTypes,
"additionalFilter": {},
"refinedSearchElement": {}
};
this.fieldSearchFormData.pageNumber = this.currentPage;
let formData = this.fieldSearchFormData;
/*console.log(formData);*/
this.lastSearchType = 'Field';
this.lastSearchSubType = 'Field';
axios({
method: "post",
// url: "http://zenx-intelx-dev.us-west-2.elasticbeanstalk.com/intelx/api/legal/search",
url: hostName + pathName + gl_fieldSearch,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
// console.log(response.data);
if (!response.data.searchResults) {
this.searchResults = [];
this.noResultsFound = true;
this.showFieldSearchPanel = false;
this.currentResultSearchType = 'Field';
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
return;
} else {
this.noResultsFound = false;
this.searchResults = response.data.searchResults;
this.totalHits = response.data.totalHits;
this.isResultForList = true;
this.similarReads = this.searchResults;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage);
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
/*this.assignees = response.data.countOfAssignees;
this.inventors = response.data.countOfInventors;*/
/*this.countries = response.data.countOfCountries;*/
this.showFieldSearchPanel = false;
this.currentResultSearchType = 'Field';
var previousResults = this.searchResults;
localStorage.setItem('previousResults', JSON.stringify(previousResults));
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
this.removeFilters(['refinedSearch']);
if (this.currentPage === 1) this.pageNumber = 1;
this.currentPage = 1;
this.storeDataForPagination(this.fieldSearchFormData, this.pageNumber, this.totalPages);
}
}.bind(this));
this.fetchAllCounts(formData);
}
},
fieldSearchWithFilter(fetchCounts = true, filtersNotToUpdate = []) {
this.fieldSearchFormData.pageNumber = this.currentPage;
this.showFullPageLoader();
let formData = this.fieldSearchFormData
this.userId = document.getElementById('userIdHolder').innerHTML;
this.lastSearchType = 'Field';
this.lastSearchSubType = 'Field';
axios({
method: "post",
url: hostName + pathName + gl_fieldSearch,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
if (!response.data.searchResults) {
this.searchResults = [];
this.noResultsFound = true;
this.showFieldSearchPanel = false;
this.currentResultSearchType = 'Field';
this.hideFullPageLoader();
return;
} else {
this.noResultsFound = false;
this.searchResults = response.data.searchResults;
this.totalHits = response.data.totalHits;
this.isResultForList = true;
this.similarReads = this.searchResults;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage);
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
this.showFieldSearchPanel = false;
this.currentResultSearchType = 'Field';
var previousResults = this.searchResults;
localStorage.setItem('previousResults', JSON.stringify(previousResults));
this.hideFullPageLoader();
if (this.currentPage === 1) this.pageNumber = 1;
this.currentPage = 1;
this.storeDataForPagination(this.fieldSearchFormData, this.pageNumber, this.totalPages);
}
}.bind(this));
if (fetchCounts) {
if (filtersNotToUpdate) {
this.fetchCountsExcept(formData, filtersNotToUpdate);
} else
this.fetchAllCounts(formData)
}
},
simpleSearchWithFilter(fetchCounts = true, filtersNotToUpdate = []) {
this.showFullPageLoader();
this.userId = document.getElementById('userIdHolder').innerHTML;
this.simpleSearchFormData.pageNumber = this.currentPage;
let formData = this.simpleSearchFormData;
this.lastSearchType = 'Simple';
this.lastSearchSubType = 'Simple';
axios({
method: "post",
url: hostName + pathName + gl_simpleSearch,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
console.log(response.data);
if (!response.data.searchResults) {
this.searchResults = [];
this.noResultsFound = true;
this.currentResultSearchType = 'Simple';
this.hideFullPageLoader();
return;
} else {
this.noResultsFound = false;
this.searchResults = response.data.searchResults;
this.totalHits = response.data.totalHits;
this.isResultForList = true;
this.similarReads = this.searchResults;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage);
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
this.currentResultSearchType = 'Simple';
var previousResults = this.searchResults;
localStorage.setItem('previousResults', JSON.stringify(previousResults));
this.hideFullPageLoader();
if (this.currentPage === 1) this.pageNumber = 1;
this.currentPage = 1;
this.storeDataForPagination(this.simpleSearchFormData, this.pageNumber, this.totalPages);
if (fetchCounts) {
if (filtersNotToUpdate) {
this.fetchCountsExcept(formData, filtersNotToUpdate);
} else
this.fetchAllCounts(formData)
}
}
}.bind(this));
if (fetchCounts) {
if (filtersNotToUpdate) {
this.fetchCountsExcept(formData, filtersNotToUpdate);
} else
this.fetchAllCounts(formData)
}
},
semanticSearchWithFilter(fetchCounts = true, filtersNotToUpdate = []) {
this.showFullPageLoader();
this.userId = document.getElementById('userIdHolder').innerHTML;
this.semanticSearchFormData.pageNumber = this.currentPage;
let formData = this.semanticSearchFormData;
this.lastSearchType = 'Semantic';
this.lastSearchSubType = 'Semantic';
axios({
method: "post",
url: hostName + pathName + gl_semanticSearch,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
console.log(response.data);
if (!response.data.searchResults) {
this.searchResults = [];
this.noResultsFound = true;
this.currentResultSearchType = 'Semantic';
this.hideFullPageLoader();
return;
} else {
this.noResultsFound = false;
this.searchResults = response.data.searchResults;
this.totalHits = response.data.totalHits;
this.isResultForList = true;
this.similarReads = this.searchResults;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage);
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
this.currentResultSearchType = 'Semantic';
var previousResults = this.searchResults;
localStorage.setItem('previousResults', JSON.stringify(previousResults));
this.hideFullPageLoader();
if (this.currentPage === 1) this.pageNumber = 1;
this.currentPage = 1;
this.storeDataForPagination(this.semanticSearchFormData, this.pageNumber, this.totalPages);
}
}.bind(this));
if (fetchCounts) {
if (filtersNotToUpdate) {
this.fetchCountsExcept(formData, filtersNotToUpdate);
} else
this.fetchAllCounts(formData)
}
},
intelxAiSearchWithFilter(fetchCounts = true, filtersNotToUpdate = []) {
this.showFullPageLoader();
this.userId = document.getElementById('userIdHolder').innerHTML;
this.intelxAiSearchFormData.pageNumber = this.currentPage;
let formData = this.intelxAiSearchFormData;
axios({
method: "post",
url: hostName + pathName + gl_intelxAiSearch,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
console.log(response.data);
if (!response.data.searchResults) {
this.searchResults = [];
this.noResultsFound = true;
this.lastSearchType = 'IntelxAi';
this.lastSearchSubType = 'IntelxAi';
this.currentResultSearchType = 'IntelxAi';
this.hideFullPageLoader();
return;
} else {
this.noResultsFound = false;
this.searchResults = response.data.searchResults;
this.totalHits = response.data.totalHits;
this.isResultForList = true;
this.similarReads = this.searchResults;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage);
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
this.lastSearchType = 'IntelxAi';
this.lastSearchSubType = 'IntelxAi';
this.currentResultSearchType = 'IntelxAi';
var previousResults = this.searchResults;
localStorage.setItem('previousResults', JSON.stringify(previousResults));
this.hideFullPageLoader();
this.removeFilters(['refinedSearch']);
if (this.currentPage === 1) this.pageNumber = 1;
this.currentPage = 1;
this.storeDataForPagination(this.intelxAiSearchFormData, this.pageNumber, this.totalPages);
if (fetchCounts) {
if (filtersNotToUpdate) {
this.fetchCountsExcept(formData, filtersNotToUpdate);
} else
this.fetchAllCounts(formData)
}
}
}.bind(this));
},
imageSearchWithFilter(fetchCounts = true, filtersNotToUpdate = []) {
this.showFullPageLoader();
this.userId = document.getElementById('userIdHolder').innerHTML;
this.imageSearchFormData.pageNumber = this.currentPage;
let formData = this.imageSearchFormData;
axios({
method: "post",
url: hostName + pathName + gl_imageSearch + '/results',
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
console.log(response.data);
if (!response.data.searchResults) {
this.searchResults = [];
this.noResultsFound = true;
this.lastSearchType = 'Image';
this.lastSearchSubType = 'Image';
this.currentResultSearchType = 'Image';
this.hideFullPageLoader();
return;
} else {
this.noResultsFound = false;
this.searchResults = response.data.searchResults;
this.totalHits = response.data.totalHits;
this.isResultForList = true;
this.similarReads = this.searchResults;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage);
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
this.lastSearchType = 'Image';
this.lastSearchSubType = 'Image';
this.currentResultSearchType = 'Image';
var previousResults = this.searchResults;
localStorage.setItem('previousResults', JSON.stringify(previousResults));
this.hideFullPageLoader();
this.removeFilters(['refinedSearch']);
if (this.currentPage === 1) this.pageNumber = 1;
this.currentPage = 1;
this.storeDataForPagination(this.imageSearchFormData, this.pageNumber, this.totalPages);
if (fetchCounts) {
if (filtersNotToUpdate) {
this.fetchCountsExcept(formData, filtersNotToUpdate);
} else
this.fetchAllCounts(formData)
}
}
}.bind(this));
},
legalGenericSearchWithFilter(fetchCounts = true, filtersNotToUpdate = []) {
this.showFullPageLoader();
this.userId = document.getElementById('userIdHolder').innerHTML;
this.legalGenericSearchFormData.pageNumber = this.currentPage;
let formData = this.legalGenericSearchFormData;
axios({
method: "post",
url: hostName + pathName + gl_legalGenericSearch,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
console.log(response.data);
if (!response.data.searchResults) {
this.searchResults = [];
this.noResultsFound = true;
this.lastSearchType = 'Legal';
this.lastSearchSubType = 'Legal';
this.currentResultSearchType = 'Legal';
this.hideFullPageLoader();
$("html, body").animate({ scrollTop: $(document).height() }, 1000);
return;
} else {
this.noResultsFound = false;
this.searchResults = response.data.searchResults;
this.totalHits = response.data.totalHits;
this.isResultForList = true;
this.similarReads = this.searchResults;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage);
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
this.showFieldSearchPanel = false;
this.lastSearchType = 'Legal';
this.lastSearchSubType = 'Legal';
this.currentResultSearchType = 'Legal';
var previousResults = this.searchResults;
if (this.currentPage === 1) this.pageNumber = 1;
this.currentPage = 1;
localStorage.setItem('previousResults', JSON.stringify(previousResults));
this.storeDataForPagination(this.semanticSearchFormData, this.pageNumber, this.totalPages);
this.hideFullPageLoader();
if (fetchCounts) {
if (filtersNotToUpdate) {
this.fetchCountsExcept(formData, filtersNotToUpdate);
} else
this.fetchAllCounts(formData)
}
}
}.bind(this));
},
legalLitigationSearchWithFilter(fetchCounts = true, filtersNotToUpdate = []) {
this.showFullPageLoader();
this.userId = document.getElementById('userIdHolder').innerHTML;
this.legalLitigationSearchFormData.pageNumber = this.currentPage;
let formData = this.legalLitigationSearchFormData;
axios({
method: "post",
url: hostName + pathName + gl_legalLitigationSearch,
data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(function (response) {
if (!response.data.cases) {
this.searchResults = [];
this.noResultsFound = true;
this.lastSearchType = 'Legal';
this.lastSearchSubType = 'Litigation';
this.currentResultSearchType = 'Legal';
this.hideFullPageLoader();
$("html, body").animate({ scrollTop: $(document).height() }, 1000);
return;
} else {
this.noResultsFound = false;
this.searchResults = response.data.cases;
this.totalHits = response.data.totalHits;
this.isResultForList = true;
this.similarReads = this.searchResults;
if (this.totalHits > 10000) {
this.totalResultsToBeShown = 10000;
this.totalPages = Math.trunc(this.totalResultsToBeShown / this.noOfResultsInPage);
} else {
this.totalPages = Math.trunc(this.totalHits / this.noOfResultsInPage) + 1;
}
this.showFieldSearchPanel = false;
this.lastSearchType = 'Legal';
this.lastSearchSubType = 'Litigation';
this.currentResultSearchType = 'Legal';
var previousResults = this.searchResults;
if (this.currentPage === 1) this.pageNumber = 1;
this.currentPage = 1;
localStorage.setItem('previousResults', JSON.stringify(previousResults));
this.storeDataForPagination(this.semanticSearchFormData, this.pageNumber, this.totalPages);
this.hideFullPageLoader();
if (fetchCounts) {
if (filtersNotToUpdate) {
this.fetchCountsExcept(formData, filtersNotToUpdate);
} else
this.fetchAllCounts(formData)
}
}
}.bind(this));
},
getUrlSuffixes() {
if ((this.lastSearchType == "Field" && this.lastSearchSubType == 'Field') ||
(this.lastSearchType == "Legal" && this.lastSearchSubType == 'Legal') ||
(this.lastSearchType == "Legal" && this.lastSearchSubType == 'Litigation') ||
(this.lastSearchType == "Image" && this.lastSearchSubType == 'Image')) {
return {
assigneesCount: gl_assignees_count,
inventorsCount: gl_inventors_count,
countriesCount: gl_countries_count,
yearsCount: gl_years_count,
liveCountriesCount: gl_live_countries_count,
liveAssigneeCount: gl_live_assignee_count,
liveCatchwords: gl_live_catchwords
};
} else if (this.lastSearchType == "Simple" && this.lastSearchSubType == 'Simple') {
return {
assigneesCount: gl_assignees_count_simple,
inventorsCount: gl_inventors_count_simple,
countriesCount: gl_countries_count_simple,
yearsCount: gl_years_count_simple,
liveCountriesCount: gl_live_countries_count_simple,
liveAssigneeCount: gl_live_assignee_count_simple,
liveCatchwords: gl_live_catchwords_simple
};
} else if ((this.lastSearchType == "Semantic" && this.lastSearchSubType == 'Semantic') || (this.lastSearchType == "IntelxAi" && this.lastSearchSubType == 'IntelxAi')) {
return {
assigneesCount: gl_assignees_count_semantic,
inventorsCount: gl_inventors_count_semantic,
countriesCount: gl_countries_count_semantic,
yearsCount: gl_years_count_semantic,
liveCountriesCount: gl_live_countries_count_semantic,
liveAssigneeCount: gl_live_assignee_count_semantic,
liveCatchwords: gl_live_catchwords_semantic
};
}
return {};
},
fetchAllCounts(payload) {
const baseUrl = hostName + pathName;
const urlSuffixes = this.getUrlSuffixes();
let assigneesCountUrl = baseUrl + (urlSuffixes.assigneesCount || '');
let inventorsCountUrl = baseUrl + (urlSuffixes.inventorsCount || '');
let countriesCountUrl = baseUrl + (urlSuffixes.countriesCount || '');
let yearsCountUrl = baseUrl + (urlSuffixes.yearsCount || '');
let liveCountriesCountUrl = baseUrl + (urlSuffixes.liveCountriesCount || '');
let liveAssigneeCountUrl = baseUrl + (urlSuffixes.liveAssigneeCount || '');
let liveCatchwordsUrl = baseUrl + (urlSuffixes.liveCatchwords || '');
this.fetchAssigneesCount(assigneesCountUrl, payload);
this.fetchInventorsCount(inventorsCountUrl, payload);
this.fetchCountriesCount(countriesCountUrl, payload);
/*if (this.lastSearchType !== 'Semantic' && this.lastSearchType !== 'IntelxAi') {
this.fetchYearsCount(yearsCountUrl, payload);
this.fetchLiveCountriesCount(liveCountriesCountUrl, payload);
this.fetchLiveAssigneeCount(liveAssigneeCountUrl, payload);
this.fetchLiveCatchwords(liveCatchwordsUrl, payload);
}*/
},
fetchCountsExcept(payload, filtersNotToUpdate) {
const baseUrl = hostName + pathName;
const urlSuffixes = this.getUrlSuffixes();
let assigneesCountUrl = baseUrl + (urlSuffixes.assigneesCount || '');
let inventorsCountUrl = baseUrl + (urlSuffixes.inventorsCount || '');
let countriesCountUrl = baseUrl + (urlSuffixes.countriesCount || '');
let yearsCountUrl = baseUrl + (urlSuffixes.yearsCount || '');
let liveCountriesCountUrl = baseUrl + (urlSuffixes.liveCountriesCount || '');
let liveAssigneeCountUrl = baseUrl + (urlSuffixes.liveAssigneeCount || '');
let liveCatchwordsUrl = baseUrl + (urlSuffixes.liveCatchwords || '');
// Conditional calls based on filtersNotToUpdate parameter
if (!filtersNotToUpdate.includes("assignee")) {
this.fetchAssigneesCount(assigneesCountUrl, payload);
}
if (!filtersNotToUpdate.includes("inventor")) {
this.fetchInventorsCount(inventorsCountUrl, payload);
}
if (!filtersNotToUpdate.includes("country")) {
this.fetchCountriesCount(countriesCountUrl, payload);
}
/*if (this.lastSearchType !== 'Semantic' && this.lastSearchType !== 'IntelxAi') {
this.fetchYearsCount(yearsCountUrl, payload);
this.fetchLiveCountriesCount(liveCountriesCountUrl, payload);
this.fetchLiveAssigneeCount(liveAssigneeCountUrl, payload);
this.fetchLiveCatchwords(liveCatchwordsUrl, payload);
}*/
},
fetchAssigneesCount(url, payload) {
this.loadingStatus.isAssigneesCountLoading = true;
axios({
method: "post",
url: url,
data: payload,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
//console.log(response.data);
this.assignees = response.data;
// Display fetched data
localStorage.setItem('graphDataForAssignee', JSON.stringify(this.assignees));
this.loadingStatus = { ...this.loadingStatus, isAssigneesCountLoading: false };
})
.catch(error => {
console.error('Error fetching data:', error);
});
},
fetchInventorsCount(url, payload) {
this.loadingStatus.isInventorsCountLoading = true;
axios({
method: "post",
url: url,
data: payload,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
//console.log(response.data);
this.inventors = response.data;
// Display fetched data
localStorage.setItem('graphDataForInventors', JSON.stringify(this.inventors));
this.loadingStatus = { ...this.loadingStatus, isInventorsCountLoading: false };
})
.catch(error => {
console.error('Error fetching data:', error);
});
},
fetchCountriesCount(url, payload) {
this.loadingStatus.isCountriesCountLoading = true;
axios({
method: "post",
url: url,
data: payload,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
this.fetchedCountries = response.data;
localStorage.setItem('graphDataForCountries', JSON.stringify(this.fetchedCountries));
this.loadingStatus = { ...this.loadingStatus, isCountriesCountLoading: false };
})
.catch(error => {
console.error('Error fetching data:', error);
});
},
fetchYearsCount(url, payload) {
axios({
method: "post",
url: url,
data: payload,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedYears = response.data;
// Display fetched data
localStorage.setItem('graphDataForYears', JSON.stringify(this.fetchedYears));
})
.catch(error => {
console.error('Error fetching data:', error);
});
},
fetchLiveCountriesCount(url, payload) {
axios({
method: "post",
url: url,
data: payload,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedLiveCountries = response.data;
// Display fetched data
localStorage.setItem('graphDataForLiveCountries', JSON.stringify(this.fetchedLiveCountries));
})
.catch(error => {
console.error('Error fetching data:', error);
});
},
fetchLiveAssigneeCount(url, payload) {
axios({
method: "post",
url: url,
data: payload,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedLiveAssignees = response.data;
// Display fetched data
localStorage.setItem('graphDataForLiveAssignees', JSON.stringify(this.fetchedLiveAssignees));
})
.catch(error => {
console.error('Error fetching data:', error);
});
},
fetchLiveCatchwords(url, payload) {
axios({
method: "post",
url: url,
data: payload,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
}).then(response => {
console.log(response.data);
this.fetchedLiveCatchWords = response.data;
// Display fetched data
localStorage.setItem('graphDataForLiveCatchWords', JSON.stringify(this.fetchedLiveCatchWords));
})
.catch(error => {
console.error('Error fetching data:', error);
});
},
//To fix the issue for Browser stuck issue during pagination - Start
// For version management, but not for funnction documentation)
showFullPageLoader(loaderText = '') {
$("#loading").show();
$("#mainBody").css("overflow-y", "hidden");
$(".page-loader > .txt").text(loaderText);
},
hideFullPageLoader() {
$("#loading").hide();
$("#mainBody").css("overflow-y", "auto");
$(".page-loader > .txt").text("");
},
//To fix the issue for Browser stuck issue during pagination - End
preview: function (id, title, extract) {
var id = id;
document.getElementById("titleEvent").innerHTML = title;
document.getElementById("briefDetails").innerHTML = extract;
$('#exampleModalCenter').modal('show');
},
openFullDetails: function (lhipId, inventionId, type, combinedDocNumber) {
var encryptedId = btoa(lhipId);
var encryptedInventionId = btoa(inventionId);
var encryptedType = btoa(type);
var combinedDocNumber = btoa(combinedDocNumber);
window.open("article-details.html?article-id=" + encryptedId + "&invention=" + encryptedInventionId + "&type=" + encryptedType + "&combined-doc-number=" + combinedDocNumber, "_blank");
},
openFullDetailsForLegal: function (id, type) {
var encryptedId = btoa(id);
var encryptedType = btoa(type);
window.open("article-details.html?article-id=" + encryptedId + "&type=" + encryptedType, "_blank");
},
openHelper: function () {
/*$('#helperModal').modal('show');*/
window.open("documentation.html", "_blank");
},
openSummary: function (lhipId, inventionId) {
document.getElementById("loading").style.display = "block";
document.getElementById("mainBody").style.overflowY = "hidden";
axios({
method: "get",
url: hostName + pathName + '/patents/summary/lhipid/' + lhipId + '/inventionid/' + inventionId,
// data: formData,
headers: { "Authorization": `Bearer ${jwtToken}`, "Content-Type": "application/json", "Accept": "application/json" },
})
.then(response => {
console.log(response.data);
this.summary_title = response.data.title;
this.summary_publicationNumber = response.data.publicationNumber;
this.summary_currentAssignee = response.data.currentAssignee;
this.summary_applicationDate = response.data.applicationDate;
this.summary_publicationDate = response.data.publicationDate;
if (response.data.patentAbstract) {
this.summary_patentAbstract = response.data.patentAbstract;
} else {
this.summary_patentAbstract = 'No data available';
}
if (response.data.firstClaim) {
this.summary_claims = response.data.firstClaim.content;
} else {
this.summary_claims = 'No data available';
}
$('#helperModal').modal('show');
$('#loading').hide();
document.getElementById("mainBody").style.overflowY = "scroll";
})
.catch(error => {
console.error('Error fetching data:', error);
});
},
}
});