@i.un/libs 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chrome/message.d.ts +7 -2
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +1 -1
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +1 -1
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/chrome/message.d.ts
CHANGED
|
@@ -24,6 +24,11 @@ export interface MessageDefinition {
|
|
|
24
24
|
* 消息协议表类型
|
|
25
25
|
*/
|
|
26
26
|
export type MessageProtocol = Record<string, MessageDefinition>;
|
|
27
|
+
/**
|
|
28
|
+
* 可选 payload 参数类型
|
|
29
|
+
* 当 payload 为 void 或 undefined 时,无需传参
|
|
30
|
+
*/
|
|
31
|
+
export type OptionalPayload<P> = P extends void | undefined ? [] : [P];
|
|
27
32
|
/**
|
|
28
33
|
* 错误响应结构
|
|
29
34
|
*/
|
|
@@ -46,11 +51,11 @@ export interface MessageBus<T extends MessageProtocol> {
|
|
|
46
51
|
/**
|
|
47
52
|
* 发送消息到 background
|
|
48
53
|
*/
|
|
49
|
-
send<K extends keyof T>(type: K, payload: T[K]["payload"]): Promise<T[K]["response"]>;
|
|
54
|
+
send<K extends keyof T>(type: K, ...payload: OptionalPayload<T[K]["payload"]>): Promise<T[K]["response"]>;
|
|
50
55
|
/**
|
|
51
56
|
* 发送消息到指定 Tab
|
|
52
57
|
*/
|
|
53
|
-
sendToTab<K extends keyof T>(tabId: number, type: K, payload: T[K]["payload"]): Promise<T[K]["response"]>;
|
|
58
|
+
sendToTab<K extends keyof T>(tabId: number, type: K, ...payload: OptionalPayload<T[K]["payload"]>): Promise<T[K]["response"]>;
|
|
54
59
|
/**
|
|
55
60
|
* 监听消息
|
|
56
61
|
*/
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=Symbol("undefined");function t(e){return"function"==typeof(null==e?void 0:e.clone)}function n(e){var t=typeof e;return null===e||"string"===t||"number"===t||"boolean"===t||"undefined"===t}function r(e){return n(e)?String(e):JSON.stringify(e,function(e,t){return"object"!=typeof t||null===t||Array.isArray(t)?t:Object.keys(t).sort().reduce(function(e,n){return e[n]=t[n],e},{})})}function o(e){if(null===e||"object"!=typeof e)return e;if(t(e))return e.clone();if(Array.isArray(e))return e.map(function(e){return o(e)});var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=o(e[r]));return n}function i(e){return new Proxy({},{get:function(t,n){return t.hasOwnProperty(n)?t[n]:e}})}var a=i(e),s=i(!1);function c(e){return a[e]}function l(t){return a[t]!==e}var u={timeout:6e4,timeoutResult:{code:408,msg:"请求超时"},identifier:""};function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(null,arguments)}var m=/*#__PURE__*/function(){function e(e){this.storageKey=void 0,this.data={},this.changeCallbacks=[],this.storageKey=e}e.getInstanceKey=function(e){return"memory:"+e},e.getInstance=function(t){var n=this.getInstanceKey(t);return this.instances.has(n)||this.instances.set(n,new e(t)),this.instances.get(n)},e.create=function(e){return this.getInstance(e)},e.clearInstance=function(e){var t=this.getInstanceKey(e),n=this.instances.get(t);n&&n.clearChangeCallbacks(),this.instances.delete(t)},e.clearAllInstances=function(){this.instances.forEach(function(e){e.clearChangeCallbacks()}),this.instances.clear()};var t=e.prototype;return t.set=function(e,t){try{var n,r=this.data[e];this.data=p({},this.data,((n={})[e]=t,n)),this.triggerChange(r,t)}catch(e){throw console.error("MemoryStore.set 失败:",e),e}},t.get=function(e){try{return this.data[e]}catch(e){throw console.error("MemoryStore.get 失败:",e),e}},t.getAll=function(){return p({},this.data)},t.remove=function(e){try{if(e in this.data){var t=this.data[e],n=p({},this.data);delete n[e],this.data=n,this.triggerChange(t,void 0)}}catch(e){throw console.error("MemoryStore.remove 失败:",e),e}},t.clear=function(){try{var e=p({},this.data);this.data={},this.triggerChange(e,{})}catch(e){throw console.error("MemoryStore.clear 失败:",e),e}},t.setMultiple=function(e){try{var t=p({},this.data);this.data=p({},this.data,e),this.triggerChange(t,this.data)}catch(e){throw console.error("MemoryStore.setMultiple 失败:",e),e}},t.onChanged=function(e){this.changeCallbacks.push(e)},t.triggerChange=function(e,t){if(this.changeCallbacks.length>0){var n,r=((n={})[this.storageKey]={oldValue:e,newValue:t},n);this.changeCallbacks.forEach(function(e){try{e(r)}catch(e){console.error("MemoryStore 变化回调执行失败:",e)}})}},t.clearChangeCallbacks=function(){this.changeCallbacks=[]},t.has=function(e){try{return e in this.data}catch(e){return console.error("MemoryStore.has 失败:",e),!1}},t.getSize=function(){try{var e=JSON.stringify(this.data);return new Blob([e]).size}catch(e){return console.error("MemoryStore.getSize 失败:",e),0}},t.getStoreKey=function(){return this.storageKey},t.getStoreType=function(){return"memory"},e}();function f(e,t,n,r){if(void 0===r&&(r=!1),t in e.style)e.style[t]=n;else{var o=r?"important":"";e.style.setProperty(t,String(n),o)}}function v(e){var t=document.createElementNS("http://www.w3.org/2000/svg",e.type);if(e.props)for(var n=0,r=Object.entries(e.props);n<r.length;n++){var o=r[n];t.setAttribute(o[0],o[1])}if("string"==typeof e.children){var i=document.createTextNode(e.children);t.appendChild(i)}else Array.isArray(e.children)&&e.children.forEach(function(e){var n=v(e);t.appendChild(n)});return t}function g(e){var t=(new DOMParser).parseFromString(e,"image/svg+xml").documentElement;if(!(t instanceof SVGElement))throw new Error("解析失败,结果不是有效的 SVG 元素");return t}function y(e){e&&setTimeout(function(){e.scrollTop=e.scrollHeight},0)}m.instances=new Map;var w=/*#__PURE__*/function(){function e(e,t){void 0===t&&(t={}),this.element=void 0,this.options=void 0,this.isDragging=!1,this.startX=0,this.startY=0,this.initialX=0,this.initialY=0,this.threshold=5,this.onMouseMoveHandler=void 0,this.onMouseUpHandler=void 0,this.element=e,this.options=p({coordinate:"tl"},t);var n=getComputedStyle(this.element).position;n&&"static"!==n||(this.element.style.position="absolute"),this.options.position&&(this.element.style.position=this.options.position),this.onMouseMoveHandler=this.onMouseMove.bind(this),this.onMouseUpHandler=this.onMouseUp.bind(this),this.element.addEventListener("mousedown",this.onMouseDown.bind(this))}var t=e.prototype;return t.onMouseDown=function(e){e.preventDefault(),this.startX=e.clientX,this.startY=e.clientY,this.initialX=parseInt(window.getComputedStyle(this.element).left,10)||0,this.initialY=parseInt(window.getComputedStyle(this.element).top,10)||0,document.addEventListener("mousemove",this.onMouseMoveHandler),document.addEventListener("mouseup",this.onMouseUpHandler)},t.getBoundedPosition=function(e,t){var n,r,o=this.element.getBoundingClientRect();if("fixed"===getComputedStyle(this.element).position)n=window.innerWidth-o.width,r=window.innerHeight-o.height;else{var i=(this.element.offsetParent||document.documentElement).getBoundingClientRect();n=i.width-o.width,r=i.height-o.height}return{x:Math.min(Math.max(0,e),n),y:Math.min(Math.max(0,t),r)}},t.onMouseMove=function(e){if(!this.isDragging){var t=e.clientY-this.startY;(Math.abs(e.clientX-this.startX)>this.threshold||Math.abs(t)>this.threshold)&&(this.isDragging=!0,this.options.onDragStart&&this.options.onDragStart(e))}if(this.isDragging){var n=this.getBoundedPosition(this.initialX+(e.clientX-this.startX),this.initialY+(e.clientY-this.startY));this.element.style.right="auto",this.element.style.bottom="auto",this.element.style.left=n.x+"px",this.element.style.top=n.y+"px",this.options.onDrag&&this.options.onDrag(e)}},t.convertCoordinate=function(){var e=this.element.getBoundingClientRect(),t=getComputedStyle(this.element).position,n=null,r=null;if("fixed"===t?(n=null,r=new DOMRect(0,0,window.innerWidth,window.innerHeight)):((n=this.element.offsetParent)||(n=document.documentElement),"static"===getComputedStyle(n).position?(n=null,r=new DOMRect(0,0,window.innerWidth,window.innerHeight)):r=n.getBoundingClientRect()),r){var o,i;if("fixed"===t)o=e.left,i=e.top;else if(o=e.left-r.left,i=e.top-r.top,n instanceof HTMLElement){var a=getComputedStyle(n);o-=parseFloat(a.borderLeftWidth)||0,i-=parseFloat(a.borderTopWidth)||0}else o+=window.scrollX,i+=window.scrollY;switch(this.options.coordinate){case"tr":var s=r.width-o-e.width;this.element.style.left="auto",this.element.style.right=s+"px",this.element.style.top=i+"px",this.element.style.bottom="auto";break;case"bl":var c=r.height-i-e.height;this.element.style.left=o+"px",this.element.style.right="auto",this.element.style.top="auto",this.element.style.bottom=c+"px";break;case"br":var l=r.width-o-e.width,u=r.height-i-e.height;this.element.style.left="auto",this.element.style.right=l+"px",this.element.style.top="auto",this.element.style.bottom=u+"px";break;default:this.element.style.left=o+"px",this.element.style.right="auto",this.element.style.top=i+"px",this.element.style.bottom="auto"}}},t.onMouseUp=function(e){this.isDragging&&(this.options.coordinate&&"tl"!==this.options.coordinate&&this.convertCoordinate(),this.options.onDragEnd&&this.options.onDragEnd(e)),this.isDragging=!1,document.removeEventListener("mousemove",this.onMouseMoveHandler),document.removeEventListener("mouseup",this.onMouseUpHandler)},e}(),b=/*#__PURE__*/function(){function e(e,t){void 0===t&&(t="local"),this.storageKey=void 0,this.storeType=void 0,this.store=void 0,this.storageKey=e,this.storeType=t}e.getInstanceKey=function(e,t){return void 0===t&&(t="local"),t+":"+e},e.getInstance=function(t,n){void 0===n&&(n="local");var r=this.getInstanceKey(t,n);return this.instances.has(r)||this.instances.set(r,new e(t,n)),this.instances.get(r)},e.local=function(e){return this.getInstance(e,"local")},e.session=function(e){return this.getInstance(e,"session")},e.clearInstance=function(e,t){void 0===t&&(t="local");var n=this.getInstanceKey(e,t);this.instances.delete(n)},e.clearAllInstances=function(){this.instances.clear()};var t=e.prototype;return t.getStore=function(){return this.store||(this.store="local"===this.storeType?localStorage:sessionStorage),this.store},t.set=function(e,t){try{var n,r=p({},this.getAll(),((n={})[e]=t,n));this.getStore().setItem(this.storageKey,JSON.stringify(r))}catch(e){throw console.error("WebStore.set 失败:",e),e}},t.get=function(e){try{var t=this.getAll();return null==t?void 0:t[e]}catch(e){throw console.error("WebStore.get 失败:",e),e}},t.getAll=function(){try{var e=this.getStore().getItem(this.storageKey);return e?JSON.parse(e):{}}catch(e){return console.error("WebStore.getAll 失败:",e),{}}},t.remove=function(e){try{var t=this.getAll();t&&e in t&&(delete t[e],this.getStore().setItem(this.storageKey,JSON.stringify(t)))}catch(e){throw console.error("WebStore.remove 失败:",e),e}},t.clear=function(){try{this.getStore().removeItem(this.storageKey)}catch(e){throw console.error("WebStore.clear 失败:",e),e}},t.setMultiple=function(e){try{var t=p({},this.getAll(),e);this.getStore().setItem(this.storageKey,JSON.stringify(t))}catch(e){throw console.error("WebStore.setMultiple 失败:",e),e}},t.onChanged=function(e){var t=this;window.addEventListener("storage",function(n){if(n.key===t.storageKey&&n.storageArea===t.getStore()){var r,o=((r={})[t.storageKey]={oldValue:n.oldValue?JSON.parse(n.oldValue):void 0,newValue:n.newValue?JSON.parse(n.newValue):void 0},r);e(o)}})},t.has=function(e){try{return void 0!==this.get(e)}catch(e){return console.error("WebStore.has 失败:",e),!1}},t.getSize=function(){try{var e=this.getStore().getItem(this.storageKey)||"";return new Blob([e]).size}catch(e){return console.error("WebStore.getSize 失败:",e),0}},t.getStoreKey=function(){return this.storageKey},e}();function x(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}b.instances=new Map;var P=/*#__PURE__*/function(){function e(e,t){void 0===t&&(t="local"),this.storageKey=void 0,this.storeType=void 0,this.store=void 0,this.storageKey=e,this.storeType=t}e.getInstanceKey=function(e,t){return void 0===t&&(t="local"),t+":"+e},e.getInstance=function(t,n){void 0===n&&(n="local");var r=this.getInstanceKey(t,n);return this.instances.has(r)||this.instances.set(r,new e(t,n)),this.instances.get(r)},e.local=function(e){return this.getInstance(e,"local")},e.sync=function(e){return this.getInstance(e,"sync")},e.clearInstance=function(e,t){void 0===t&&(t="local");var n=this.getInstanceKey(e,t);this.instances.delete(n)},e.clearAllInstances=function(){this.instances.clear()};var t=e.prototype;return t.getStore=function(){return this.store||(this.store=chrome.storage[this.storeType]),this.store},t.set=function(e,t){try{var n=this;return Promise.resolve(x(function(){return Promise.resolve(n.getAll()).then(function(r){var o,i,a=p({},r,((o={})[e]=t,o));return Promise.resolve(n.getStore().set((i={},i[n.storageKey]=a,i))).then(function(){})})},function(e){throw console.error("ChromeStore.set 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.get=function(e){try{var t=this;return Promise.resolve(x(function(){return Promise.resolve(t.getAll()).then(function(t){return null==t?void 0:t[e]})},function(e){throw console.error("ChromeStore.get 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.getAll=function(){try{var e=this;return Promise.resolve(x(function(){return Promise.resolve(e.getStore().get(e.storageKey)).then(function(t){return t[e.storageKey]||{}})},function(e){throw console.error("ChromeStore.getAll 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.remove=function(e){try{var t=this;return Promise.resolve(x(function(){return Promise.resolve(t.getAll()).then(function(n){var r=function(){var r;if(n&&e in n)return delete n[e],Promise.resolve(t.getStore().set((r={},r[t.storageKey]=n,r))).then(function(){})}();if(r&&r.then)return r.then(function(){})})},function(e){throw console.error("ChromeStore.remove 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.clear=function(){try{var e=this;return Promise.resolve(x(function(){return Promise.resolve(e.getStore().remove(e.storageKey)).then(function(){})},function(e){throw console.error("ChromeStore.clear 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.setMultiple=function(e){try{var t=this;return Promise.resolve(x(function(){return Promise.resolve(t.getAll()).then(function(n){var r,o=p({},n,e);return Promise.resolve(t.getStore().set((r={},r[t.storageKey]=o,r))).then(function(){})})},function(e){throw console.error("ChromeStore.setMultiple 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.onChanged=function(e){var t=this;chrome.storage.onChanged.addListener(function(n,r){r===t.storeType&&n[t.storageKey]&&e(n)})},t.has=function(e){try{var t=this;return Promise.resolve(x(function(){return Promise.resolve(t.get(e)).then(function(e){return void 0!==e})},function(e){return console.error("ChromeStore.has 失败:",e),!1}))}catch(e){return Promise.reject(e)}},t.getSize=function(){try{var e=this;return Promise.resolve(x(function(){return Promise.resolve(e.getAll()).then(function(e){var t=JSON.stringify(e);return new Blob([t]).size})},function(e){return console.error("ChromeStore.getSize 失败:",e),0}))}catch(e){return Promise.reject(e)}},t.getStoreKey=function(){return this.storageKey},e}();P.instances=new Map;var S="https://www.linkedin.com/voyager/api";function k(e,t){var n,r={"csrf-token":e};return t&&(n="string"==typeof t?t:Object.entries(t).map(function(e){return e[0]+"="+e[1]}).join("; "))&&(r.Cookie=n),r}var C={profilePage:{userPicture:[".pv-top-card__non-self-photo-wrapper img","#recent-activity-top-card img",".pv-top-card__photo-wrapper img",'div[componentkey^="com.linkedin.sdui.profile.card"] div[data-view-name="profile-top-card-member-photo"] img'],userName:['a[href^="/in"] h1',"#recent-activity-top-card h3",'div[data-view-name="profile-top-card-verified-badge"] div[role="button"]'],userOccupation:[".artdeco-entity-lockup .artdeco-entity-lockup__subtitle","#recent-activity-top-card h4"],linkedinProfileCard:[".scaffold-layout__main .artdeco-card:first-child",'div[componentkey^="com.linkedin.sdui.profile.card"]'],privateProfileInfoSection:[".pv-profile-info-section"],howToContainer:["#profile-content, header#global-nav"],companyName:[".top-card-background-hero-image+div .mt2 ul>li span",'div[componentkey^="com.linkedin.sdui.profile.card"] div:has(div[data-view-name="profile-top-card-verified-badge"]) + div div[role="button"] p'],companyLogo:[".top-card-background-hero-image+div .mt2 ul>li img"],campaignsListContainer:[".ui-row.sm.campaigns-list-container"],contactListContainer:[".ui-row.sm.contact-list-container"],location:["#profile-content .artdeco-card .top-card-background-hero-image+div .text-body-small.inline.t-black--light"],campaignsListContainerDisplay:[".ui-col.sm.campaigns-list-container-display"],contactListContainerDisplay:[".ui-col.sm.contact-list-container-display"],mainExperienceContainer:[".artdeco-card:has(#experience) li:first-child",'div[componentkey^="com.linkedin.sdui.profile.card"][componentkey$="ExperienceTopLevelSection"] div:has(h2) + div > div'],experienceCompanyLogo:['[data-field="experience_company_logo"] img','div[componentkey^="com.linkedin.sdui.profile.card"][componentkey$="ExperienceTopLevelSection"] div:has(h2) + div figure[data-view-name="image"] img'],experienceCompanyName:['div:has([data-field="experience_company_logo"])+div .t-normal span:not(.visually-hidden)'],experienceOccupation:['div:has([data-field="experience_company_logo"])+div .t-bold span:not(.visually-hidden)'],experienceMultipleCompany:["li:has([data-view-name=profile-component-entity] .pvs-entity__sub-components .pvs-entity__sub-components) .t-bold span:not(.visually-hidden)"],experienceMultipleOccupation:['[data-view-name="profile-component-entity"] li:first-child .t-bold span:not(.visually-hidden)']},salesNavProfilePage:{profileCardSection:["#profile-card-section"],userName:['#profile-card-section [data-anonymize="person-name"]'],userPicture:['#profile-card-section img[data-anonymize="headshot-photo"]'],userOccupation:['#profile-card-section [data-anonymize="headline"]'],profileUrl:['#profile-card-section a[href^="/sales/lead"]'],linkedinProfileCard:["#profile-card-section"],campaignsListContainer:[".ui-row.sm.campaigns-list-container"],contactListContainer:[".ui-row.sm.contact-list-container"],campaignsListContainerDisplay:[".ui-col.sm.campaigns-list-container-display"],contactListContainerDisplay:[".ui-col.sm.contact-list-container-display"],location:["#profile-card-section>section>div>div:last-child div:has(svg)"],companyName:['#profile-card-section a[data-anonymize="company-name"]'],companyLogo:['#profile-card-section img[data-anonymize="company-logo"]'],moreInfoButton:["#profile-card-section section[data-x--lead-actions-bar] button[data-x--lead-actions-bar-overflow-menu]",'#profile-card-section button[aria-label="Open actions overflow menu"]'],linkedinProfileLinkButton:['#hue-web-menu-outlet a[href^="https://www.linkedin.com/in/"]'],mainExperienceContainer:['[data-sn-view-name="feature-lead-experience"]'],experienceCompanyLogo:['li:first-child img[data-anonymize="company-logo"]'],experienceCompanyName:['li:first-child [data-anonymize="company-name"]'],experienceOccupation:['li:first-child [data-anonymize="job-title"]'],experienceMultipleOccupation:['ul li ul li:first-child [data-anonymize="job-title"]','ul li [data-anonymize="job-title"]'],experienceMultipleCompany:['li:first-child [data-anonymize="company-name"]']},searchPeoplePage:{searchEntityResult:['[data-view-name="search-entity-result-universal-template"]'],linkedinUrl:['a[data-test-app-aware-link][href^="https://www.linkedin.com/in/"]','a[data-view-name="search-result-lockup-title"]'],image:[".presence-entity img","a>div>div>figure>img"],userOccupation:['p:has(a[data-view-name="search-result-lockup-title"]) + p',".entity-result__primary-subtitle",".entity-result__divider > div div:nth-child(2)","div>div>div:nth-child(2)>div>div:nth-child(2)","figure + div p:nth-child(2)"],fullName:[".entity-result__title-text a span>span",".entity-result__title-line a span>span",".entity-result__title-line span>a>span>span","a:has(+.entity-result__badge)>span>span",".linked-area div:nth-child(2) > div:first-child > div.t-roman.t-sans a",'a[data-view-name="search-result-lockup-title"]'],resultList:[".search-results-container>div:has(.reusable-search__result-container)"],actionsDiv:[".entity-result__actions",".linked-area > div > div:last-child","div:has(figure) > div:last-child"],validResult:["[data-chameleon-result-urn] , .reusable-search__result-container"],searchResult:[".search-results-container li:has(>[data-chameleon-result-urn])",'[data-view-name="people-search-result"]'],searchResultsContainer:[".search-results-container",'[role="main"] div:has(>hr[role="presentation"])'],mainLayoutLeft:[".search-marvel-srp",'[role="main"] div:has(hr)>div>div'],howToContainer:[".hasLegacyFeedLineHeight div:has(main)",".authentication-outlet"]},searchAllPage:{peopleButton:["nav ul.search-reusables__filter-list>li>button"],toolbar:[".scaffold-layout-toolbar"]}};function M(e,t,n){switch(n){case"all":var r=e.querySelectorAll(t);return r.length>0?Array.from(r):null;case"closest":return e instanceof HTMLElement?e.closest(t):null;default:return e.querySelector(t)}}function I(e){var t=e.page,n=e.key,r=e.container,o=e.mode;null!=r||(r=document);for(var i,a,s=h(t&&n?C[(i={page:t,key:n}).page][i.key]:[e.selector]);!(a=s()).done;){var c=M(r,a.value,o);if(c)return c}return null}function L(e){if(!e)return"";var t=document.createElement("textarea");return t.innerHTML=e,t.value.trim()}var E={"":0,chrome:1,"chrome-extension":2,"view-source":3,ftp:4,file:5,data:6,blob:7,about:8};function _(e){void 0===e&&(e="");var t="",n=e.split("#")[0].toLocaleLowerCase();return/^https\:\/\/(www|.{2})\.linkedin\.com\/in\/[^/?]+(\/recent-activity\/|\/details\/|\/overlay\/|\/?\?[^/]*|\/?$)/.test(n)||/^https\:\/\/(www|.{2})\.linkedin\.com\/sales\/people\/(.+?),/.test(n)||/^https\:\/\/(www|.{2})\.linkedin\.com\/sales\/(profile|lead)\/([^,]{39}),/.test(n)?t="profile":n.includes("linkedin.com/feed")?t="feed":n.includes("linkedin.com/posts/")?t="post":n.includes("linkedin.com/login")||n.includes("linkedin.com/checkpoint")||n.includes("linkedin.com/authwall")?t="login":n.includes("linkedin.com/company/")?t="company":n.includes("linkedin.com/messaging/thread/")?t="messages":n.includes("linkedin.com/search/results/people/?")||n.includes("linkedin.com/sales/search/people")?t="search-people":n.includes("linkedin.com/search/results/all")?t="search-all":n.includes("linkedin.com/mynetwork/")&&(t="connections"),t}function T(e){var t;void 0===e&&(e="");var n=((e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL).match(/linkedin\.com\/in\/([^?/]+)/)||[])[1]||(e.match(/linkedin\.com\/sales\/people\/(.+?),/)||[])[1]||(e.match(/linkedin\.com\/sales\/(?:profile|lead)\/([^,]{39}),/)||[])[1]||"";return decodeURIComponent(n)}function j(e){var t;void 0===e&&(e="");var n=((e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL).match(/linkedin\.com\/company\/([^?/]+)/)||[])[1]||"";return decodeURIComponent(n)}exports.ChromeStore=P,exports.Draggable=w,exports.MemoryStore=m,exports.RealUndefined=e,exports.WebStore=b,exports.cacheWrapper=function(e,t){void 0===t&&(t=u);var n=function(){var n=[].slice.call(arguments),i=r(n)+e.name+(t.identifier||"");if(l(i))return Promise.resolve(o(c(i)));if(s[i]){var d=Object.assign({},u,t);return new Promise(function(e){var t=Date.now(),n=setInterval(function(){l(i)?(clearInterval(n),e(o(c(i)))):Date.now()-t>d.timeout&&(s[i]=!1,clearInterval(n),e(o(d.timeoutResult)))},100)})}return s[i]=!0,e.apply(this,n).then(function(e){return a[i]=e,o(a[i])}).catch(function(e){throw e}).finally(function(){s[i]=!1})};return Object.defineProperty(n,"name",{value:"cacheWrapper_"+e.name,configurable:!0}),n},exports.cloneDeep=o,exports.createDefaultObject=i,exports.createElement=function e(t){var n=void 0===t?{}:t,r=n.tag,o=n.children,i=void 0===o?[]:o,a=n.props,s=void 0===a?{}:a,c=n.attrs,l=void 0===c?{}:c,u=n.styles,d=void 0===u?{}:u,p=document.createElement(void 0===r?"div":r);Object.assign(p,s);for(var m=0,v=Object.entries(l);m<v.length;m++){var g=v[m],y=g[1];!1!==y&&p.setAttribute(g[0],y)}for(var w=0,b=Object.entries(d);w<b.length;w++){var x=b[w];f(p,x[0],x[1])}for(var P,S=h(Array.isArray(i)?i:[i]);!(P=S()).done;){var k=P.value;k&&("object"==typeof k?k instanceof Element?p.appendChild(k):p.appendChild(e(k)):p.appendChild(document.createTextNode(k)))}return p},exports.createMessageBus=function(e){void 0===e&&(e={});var t=e.debug,n=void 0!==t&&t,r=e.logPrefix,o=void 0===r?"[MessageBus]":r,i=new Map,a=!1;function s(e){var t;n&&(t=console).error.apply(t,[o+" "+e].concat([].slice.call(arguments,1)))}function c(){a||(chrome.runtime.onMessage.addListener(function(e,t,n){if(e&&"string"==typeof e.type){var r=i.get(e.type);if(r)try{var o=r(e.payload,t);return o instanceof Promise?(o.then(n).catch(function(t){s('Error handling "'+String(e.type)+'":',t),n({__error:!0,message:t instanceof Error?t.message:String(t)})}),!0):(n(o),!1)}catch(t){return s('Error handling "'+String(e.type)+'":',t),n({__error:!0,message:t instanceof Error?t.message:String(t)}),!1}}}),a=!0)}return{send:function(e,t){return chrome.runtime.sendMessage({type:e,payload:t})},sendToTab:function(e,t,n){return chrome.tabs.sendMessage(e,{type:t,payload:n})},on:function(e,t){return c(),i.set(e,t),function(){i.delete(e)}},onMany:function(e){c();for(var t=[],n=0,r=Object.entries(e);n<r.length;n++){var o=r[n],a=o[0],s=o[1];s&&(i.set(a,s),t.push(a))}return function(){for(var e=0,n=t;e<n.length;e++)i.delete(n[e])}},hasHandler:function(e){return i.has(e)},getRegisteredTypes:function(){return Array.from(i.keys())},clearAllHandlers:function(){i.clear()}}},exports.createSvg=function(e){return"string"==typeof e?g(e):v(e)},exports.createSvgFromUrl=function(e){try{return Promise.resolve(function(t,n){try{var r=Promise.resolve(fetch(e)).then(function(e){if(!e.ok)throw new Error("网络请求失败: "+e.status+" "+e.statusText);return Promise.resolve(e.text()).then(g)})}catch(e){return n(e)}return r&&r.then?r.then(void 0,n):r}(0,function(e){var t=e instanceof Error?e.message:"未知错误";throw new Error("无法创建 SVG 元素: "+t)}))}catch(e){return Promise.reject(e)}},exports.debounce=function(e,t){var n=null;return function(){var r=arguments,o=this;null!==n&&clearTimeout(n),n=setTimeout(function(){e.apply(o,[].slice.call(r)),n=null},t)}},exports.decodeJWT=function(e){var t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(atob(t).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(n)},exports.delayExecution=function(e,t){void 0===t&&(t=0);var n=[].slice.call(arguments,2);return new Promise(function(r){0===t?r(e.apply(void 0,n)):setTimeout(function(){r(e.apply(void 0,n))},t)})},exports.generateStableUniqueKey=r,exports.getCompanyPublicId=j,exports.getContactInfo=function(){var e,t,n,r,o,i,a,s=window.location.href.includes("linkedin.com/sales")?"salesNavProfilePage":"profilePage";function c(e){return I({page:s,key:e,container:document})}var l=null==(e=c("userName"))?void 0:e.innerText;if(!l)return console.error("extractUserInfos: no userName found"),{};var u,d=null==(t=c("userPicture"))?void 0:t.src,h=null==(n=c("userOccupation"))?void 0:n.innerHTML,p=null==(r=c("companyName"))?void 0:r.innerText,m=null==(o=c("companyLogo"))?void 0:o.src,f=null==(i=c("location"))?void 0:i.innerText;return"salesNavProfilePage"===s&&(u=/linkedin\.com\/sales\/lead/i.test(window.location.href)?window.location.href:null==(a=c("profileUrl"))?void 0:a.href),{name:L(l),profileUrl:u,picture:d,occupation:L(h),companyName:p,companyPicture:m,location:f}},exports.getCookie=function(e,t,n){return void 0===n&&(n=!1),chrome.cookies.get({url:e,name:t}).then(function(e){var t;return n?(null==e||null==(t=e.value)?void 0:t.replace(/"/g,""))||"":null!=e?e:void 0})},exports.getCookies=function(e,t){return void 0===t&&(t=!1),chrome.cookies.getAll({url:e}).then(function(e){return t?function(e){return e.map(function(e){return e.name+"="+e.value}).join("; ")}(e):e})},exports.getElement=I,exports.getExtensionInfo=function(){var e,t,n;return{locale:null==(e=chrome.i18n)?void 0:e.getUILanguage(),extId:null==(t=chrome.runtime)?void 0:t.id,version:null==(n=chrome.runtime)?void 0:n.getManifest().version}},exports.getGlobal=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:this},exports.getLinkedinCompany=function(e,t){var n=t.csrfToken,r=t.cookies;try{var o="string"==typeof e?{universalName:e}:e,i="universalName"in o,a=S+"/organization/companies"+(i?"?q=universalName&universalName="+o.universalName:"/"+o.urn),s=k(n,r);return Promise.resolve(fetch(a,{method:"GET",headers:s}).then(function(e){try{var t,n=function(){if(e.ok)return Promise.resolve(e.json()).then(function(e){if(i){var n,r=(null==(n=e.elements)?void 0:n[0])||null;return t=1,r}return t=1,e})}();return Promise.resolve(n&&n.then?n.then(function(e){return t?e:null}):t?n:null)}catch(e){return Promise.reject(e)}}).catch(function(e){return console.error(e),null}))}catch(e){return Promise.reject(e)}},exports.getLinkedinMe=function(e){var t=e.csrfToken,n=e.cookies;try{var r=S+"/me",o=k(t,n);return Promise.resolve(fetch(r,{method:"GET",headers:o}).then(function(e){try{return Promise.resolve(e.ok?e.json():null)}catch(e){return Promise.reject(e)}}).catch(function(e){return console.error(e),null}))}catch(e){return Promise.reject(e)}},exports.getLinkedinPageType=_,exports.getLinkedinProfile=function(e,t){var n=t.csrfToken,r=t.cookies;try{var o=S+"/identity/dash/profiles?q=memberIdentity&memberIdentity="+e+"&decorationId=com.linkedin.voyager.dash.deco.identity.profile.FullProfileWithEntities-26",i=k(n,r);return Promise.resolve(fetch(o,{method:"GET",headers:i}).then(function(e){try{var t,n=function(){if(e.ok)return Promise.resolve(e.json()).then(function(e){var n,r=(null==(n=e.elements)?void 0:n[0])||null;return t=1,r})}();return Promise.resolve(n&&n.then?n.then(function(e){return t?e:null}):t?n:null)}catch(e){return Promise.reject(e)}}).catch(function(e){return console.error(e),null}))}catch(e){return Promise.reject(e)}},exports.getLinkedinPublicId=function(e){var t;return void 0===e&&(e=""),T(e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL)||j(e)||""},exports.getPageType=function(e){if(void 0===e&&(e=""),!e)return"";var t=Object.keys(E),n=new URL(e).protocol.replace(":","");return t.includes(n)?n:_(e)},exports.getPostPublicId=function(e){var t;void 0===e&&(e="");var n=((e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL).match(/linkedin\.com\/posts\/([^\/]+)\//)||[])[1]||"";return decodeURIComponent(n)},exports.getProfilePublicId=T,exports.isCloneable=t,exports.isErrorResponse=function(e){return"object"==typeof e&&null!==e&&"__error"in e&&!0===e.__error},exports.isLinkedInUrl=function(e){return/^https?:\/\/(www|.{2})\.linkedin\.com/.test(e)},exports.isPrimitive=n,exports.launchWebAuthFlow=function(e){var t=e.clientId,n=e.responseType,r=void 0===n?"code":n,o=e.state,i=e.nonce,a=e.interactive,s=void 0===a||a;try{var c=chrome.identity.getRedirectURL(),l=Array.isArray(r)?r:[r],u=new URL("https://accounts.google.com/o/oauth2/v2/auth");return u.searchParams.set("client_id",t),u.searchParams.set("redirect_uri",c),u.searchParams.set("response_type",l.join(" ")),u.searchParams.set("scope","openid email profile"),i&&u.searchParams.set("nonce",i),o&&u.searchParams.set("state",o),Promise.resolve(chrome.identity.launchWebAuthFlow({url:u.toString(),interactive:s}).then(function(e){if(!e)return Promise.reject(new Error("redirectUrl is null"));var t=e.includes("?")?"?":"#",n=new URLSearchParams(e.split(t)[1]),r={};return n.forEach(function(e,t){r[t]=e}),r}).catch(function(e){return console.log("error",e),Promise.reject(e)}))}catch(e){return Promise.reject(e)}},exports.pageTypeMap=E,exports.scrollToBottom=y,exports.scrollToBottomIfNeeded=function(e){e&&("true"!==e.dataset.isListeningForUserScroll&&(function(e){e&&e.addEventListener("scroll",function(){!function(e,t){e.dataset.userInteracted=t?"true":"false"}(e,e.scrollTop+e.clientHeight<e.scrollHeight-5)})}(e),e.dataset.isListeningForUserScroll="true"),"true"!==e.dataset.userInteracted&&y(e))},exports.singleExecutionWrapper=function(t,n){void 0===n&&(n=0);var r=function(){if(r.isExecuting)return Promise.resolve(e);r.isExecuting=!0;var o=performance.now(),i=t.apply(this,[].slice.call(arguments));return i.finally(function(){var e=performance.now()-o;n&&n>e?setTimeout(function(){r.isExecuting=!1},n-e):r.isExecuting=!1}),i};return r.isExecuting=!1,r};
|
|
1
|
+
var e=Symbol("undefined");function t(e){return"function"==typeof(null==e?void 0:e.clone)}function n(e){var t=typeof e;return null===e||"string"===t||"number"===t||"boolean"===t||"undefined"===t}function r(e){return n(e)?String(e):JSON.stringify(e,function(e,t){return"object"!=typeof t||null===t||Array.isArray(t)?t:Object.keys(t).sort().reduce(function(e,n){return e[n]=t[n],e},{})})}function o(e){if(null===e||"object"!=typeof e)return e;if(t(e))return e.clone();if(Array.isArray(e))return e.map(function(e){return o(e)});var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=o(e[r]));return n}function i(e){return new Proxy({},{get:function(t,n){return t.hasOwnProperty(n)?t[n]:e}})}var a=i(e),s=i(!1);function c(e){return a[e]}function l(t){return a[t]!==e}var u={timeout:6e4,timeoutResult:{code:408,msg:"请求超时"},identifier:""};function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(null,arguments)}var m=/*#__PURE__*/function(){function e(e){this.storageKey=void 0,this.data={},this.changeCallbacks=[],this.storageKey=e}e.getInstanceKey=function(e){return"memory:"+e},e.getInstance=function(t){var n=this.getInstanceKey(t);return this.instances.has(n)||this.instances.set(n,new e(t)),this.instances.get(n)},e.create=function(e){return this.getInstance(e)},e.clearInstance=function(e){var t=this.getInstanceKey(e),n=this.instances.get(t);n&&n.clearChangeCallbacks(),this.instances.delete(t)},e.clearAllInstances=function(){this.instances.forEach(function(e){e.clearChangeCallbacks()}),this.instances.clear()};var t=e.prototype;return t.set=function(e,t){try{var n,r=this.data[e];this.data=p({},this.data,((n={})[e]=t,n)),this.triggerChange(r,t)}catch(e){throw console.error("MemoryStore.set 失败:",e),e}},t.get=function(e){try{return this.data[e]}catch(e){throw console.error("MemoryStore.get 失败:",e),e}},t.getAll=function(){return p({},this.data)},t.remove=function(e){try{if(e in this.data){var t=this.data[e],n=p({},this.data);delete n[e],this.data=n,this.triggerChange(t,void 0)}}catch(e){throw console.error("MemoryStore.remove 失败:",e),e}},t.clear=function(){try{var e=p({},this.data);this.data={},this.triggerChange(e,{})}catch(e){throw console.error("MemoryStore.clear 失败:",e),e}},t.setMultiple=function(e){try{var t=p({},this.data);this.data=p({},this.data,e),this.triggerChange(t,this.data)}catch(e){throw console.error("MemoryStore.setMultiple 失败:",e),e}},t.onChanged=function(e){this.changeCallbacks.push(e)},t.triggerChange=function(e,t){if(this.changeCallbacks.length>0){var n,r=((n={})[this.storageKey]={oldValue:e,newValue:t},n);this.changeCallbacks.forEach(function(e){try{e(r)}catch(e){console.error("MemoryStore 变化回调执行失败:",e)}})}},t.clearChangeCallbacks=function(){this.changeCallbacks=[]},t.has=function(e){try{return e in this.data}catch(e){return console.error("MemoryStore.has 失败:",e),!1}},t.getSize=function(){try{var e=JSON.stringify(this.data);return new Blob([e]).size}catch(e){return console.error("MemoryStore.getSize 失败:",e),0}},t.getStoreKey=function(){return this.storageKey},t.getStoreType=function(){return"memory"},e}();function f(e,t,n,r){if(void 0===r&&(r=!1),t in e.style)e.style[t]=n;else{var o=r?"important":"";e.style.setProperty(t,String(n),o)}}function v(e){var t=document.createElementNS("http://www.w3.org/2000/svg",e.type);if(e.props)for(var n=0,r=Object.entries(e.props);n<r.length;n++){var o=r[n];t.setAttribute(o[0],o[1])}if("string"==typeof e.children){var i=document.createTextNode(e.children);t.appendChild(i)}else Array.isArray(e.children)&&e.children.forEach(function(e){var n=v(e);t.appendChild(n)});return t}function g(e){var t=(new DOMParser).parseFromString(e,"image/svg+xml").documentElement;if(!(t instanceof SVGElement))throw new Error("解析失败,结果不是有效的 SVG 元素");return t}function y(e){e&&setTimeout(function(){e.scrollTop=e.scrollHeight},0)}m.instances=new Map;var w=/*#__PURE__*/function(){function e(e,t){void 0===t&&(t={}),this.element=void 0,this.options=void 0,this.isDragging=!1,this.startX=0,this.startY=0,this.initialX=0,this.initialY=0,this.threshold=5,this.onMouseMoveHandler=void 0,this.onMouseUpHandler=void 0,this.element=e,this.options=p({coordinate:"tl"},t);var n=getComputedStyle(this.element).position;n&&"static"!==n||(this.element.style.position="absolute"),this.options.position&&(this.element.style.position=this.options.position),this.onMouseMoveHandler=this.onMouseMove.bind(this),this.onMouseUpHandler=this.onMouseUp.bind(this),this.element.addEventListener("mousedown",this.onMouseDown.bind(this))}var t=e.prototype;return t.onMouseDown=function(e){e.preventDefault(),this.startX=e.clientX,this.startY=e.clientY,this.initialX=parseInt(window.getComputedStyle(this.element).left,10)||0,this.initialY=parseInt(window.getComputedStyle(this.element).top,10)||0,document.addEventListener("mousemove",this.onMouseMoveHandler),document.addEventListener("mouseup",this.onMouseUpHandler)},t.getBoundedPosition=function(e,t){var n,r,o=this.element.getBoundingClientRect();if("fixed"===getComputedStyle(this.element).position)n=window.innerWidth-o.width,r=window.innerHeight-o.height;else{var i=(this.element.offsetParent||document.documentElement).getBoundingClientRect();n=i.width-o.width,r=i.height-o.height}return{x:Math.min(Math.max(0,e),n),y:Math.min(Math.max(0,t),r)}},t.onMouseMove=function(e){if(!this.isDragging){var t=e.clientY-this.startY;(Math.abs(e.clientX-this.startX)>this.threshold||Math.abs(t)>this.threshold)&&(this.isDragging=!0,this.options.onDragStart&&this.options.onDragStart(e))}if(this.isDragging){var n=this.getBoundedPosition(this.initialX+(e.clientX-this.startX),this.initialY+(e.clientY-this.startY));this.element.style.right="auto",this.element.style.bottom="auto",this.element.style.left=n.x+"px",this.element.style.top=n.y+"px",this.options.onDrag&&this.options.onDrag(e)}},t.convertCoordinate=function(){var e=this.element.getBoundingClientRect(),t=getComputedStyle(this.element).position,n=null,r=null;if("fixed"===t?(n=null,r=new DOMRect(0,0,window.innerWidth,window.innerHeight)):((n=this.element.offsetParent)||(n=document.documentElement),"static"===getComputedStyle(n).position?(n=null,r=new DOMRect(0,0,window.innerWidth,window.innerHeight)):r=n.getBoundingClientRect()),r){var o,i;if("fixed"===t)o=e.left,i=e.top;else if(o=e.left-r.left,i=e.top-r.top,n instanceof HTMLElement){var a=getComputedStyle(n);o-=parseFloat(a.borderLeftWidth)||0,i-=parseFloat(a.borderTopWidth)||0}else o+=window.scrollX,i+=window.scrollY;switch(this.options.coordinate){case"tr":var s=r.width-o-e.width;this.element.style.left="auto",this.element.style.right=s+"px",this.element.style.top=i+"px",this.element.style.bottom="auto";break;case"bl":var c=r.height-i-e.height;this.element.style.left=o+"px",this.element.style.right="auto",this.element.style.top="auto",this.element.style.bottom=c+"px";break;case"br":var l=r.width-o-e.width,u=r.height-i-e.height;this.element.style.left="auto",this.element.style.right=l+"px",this.element.style.top="auto",this.element.style.bottom=u+"px";break;default:this.element.style.left=o+"px",this.element.style.right="auto",this.element.style.top=i+"px",this.element.style.bottom="auto"}}},t.onMouseUp=function(e){this.isDragging&&(this.options.coordinate&&"tl"!==this.options.coordinate&&this.convertCoordinate(),this.options.onDragEnd&&this.options.onDragEnd(e)),this.isDragging=!1,document.removeEventListener("mousemove",this.onMouseMoveHandler),document.removeEventListener("mouseup",this.onMouseUpHandler)},e}(),b=/*#__PURE__*/function(){function e(e,t){void 0===t&&(t="local"),this.storageKey=void 0,this.storeType=void 0,this.store=void 0,this.storageKey=e,this.storeType=t}e.getInstanceKey=function(e,t){return void 0===t&&(t="local"),t+":"+e},e.getInstance=function(t,n){void 0===n&&(n="local");var r=this.getInstanceKey(t,n);return this.instances.has(r)||this.instances.set(r,new e(t,n)),this.instances.get(r)},e.local=function(e){return this.getInstance(e,"local")},e.session=function(e){return this.getInstance(e,"session")},e.clearInstance=function(e,t){void 0===t&&(t="local");var n=this.getInstanceKey(e,t);this.instances.delete(n)},e.clearAllInstances=function(){this.instances.clear()};var t=e.prototype;return t.getStore=function(){return this.store||(this.store="local"===this.storeType?localStorage:sessionStorage),this.store},t.set=function(e,t){try{var n,r=p({},this.getAll(),((n={})[e]=t,n));this.getStore().setItem(this.storageKey,JSON.stringify(r))}catch(e){throw console.error("WebStore.set 失败:",e),e}},t.get=function(e){try{var t=this.getAll();return null==t?void 0:t[e]}catch(e){throw console.error("WebStore.get 失败:",e),e}},t.getAll=function(){try{var e=this.getStore().getItem(this.storageKey);return e?JSON.parse(e):{}}catch(e){return console.error("WebStore.getAll 失败:",e),{}}},t.remove=function(e){try{var t=this.getAll();t&&e in t&&(delete t[e],this.getStore().setItem(this.storageKey,JSON.stringify(t)))}catch(e){throw console.error("WebStore.remove 失败:",e),e}},t.clear=function(){try{this.getStore().removeItem(this.storageKey)}catch(e){throw console.error("WebStore.clear 失败:",e),e}},t.setMultiple=function(e){try{var t=p({},this.getAll(),e);this.getStore().setItem(this.storageKey,JSON.stringify(t))}catch(e){throw console.error("WebStore.setMultiple 失败:",e),e}},t.onChanged=function(e){var t=this;window.addEventListener("storage",function(n){if(n.key===t.storageKey&&n.storageArea===t.getStore()){var r,o=((r={})[t.storageKey]={oldValue:n.oldValue?JSON.parse(n.oldValue):void 0,newValue:n.newValue?JSON.parse(n.newValue):void 0},r);e(o)}})},t.has=function(e){try{return void 0!==this.get(e)}catch(e){return console.error("WebStore.has 失败:",e),!1}},t.getSize=function(){try{var e=this.getStore().getItem(this.storageKey)||"";return new Blob([e]).size}catch(e){return console.error("WebStore.getSize 失败:",e),0}},t.getStoreKey=function(){return this.storageKey},e}();function x(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}b.instances=new Map;var P=/*#__PURE__*/function(){function e(e,t){void 0===t&&(t="local"),this.storageKey=void 0,this.storeType=void 0,this.store=void 0,this.storageKey=e,this.storeType=t}e.getInstanceKey=function(e,t){return void 0===t&&(t="local"),t+":"+e},e.getInstance=function(t,n){void 0===n&&(n="local");var r=this.getInstanceKey(t,n);return this.instances.has(r)||this.instances.set(r,new e(t,n)),this.instances.get(r)},e.local=function(e){return this.getInstance(e,"local")},e.sync=function(e){return this.getInstance(e,"sync")},e.clearInstance=function(e,t){void 0===t&&(t="local");var n=this.getInstanceKey(e,t);this.instances.delete(n)},e.clearAllInstances=function(){this.instances.clear()};var t=e.prototype;return t.getStore=function(){return this.store||(this.store=chrome.storage[this.storeType]),this.store},t.set=function(e,t){try{var n=this;return Promise.resolve(x(function(){return Promise.resolve(n.getAll()).then(function(r){var o,i,a=p({},r,((o={})[e]=t,o));return Promise.resolve(n.getStore().set((i={},i[n.storageKey]=a,i))).then(function(){})})},function(e){throw console.error("ChromeStore.set 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.get=function(e){try{var t=this;return Promise.resolve(x(function(){return Promise.resolve(t.getAll()).then(function(t){return null==t?void 0:t[e]})},function(e){throw console.error("ChromeStore.get 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.getAll=function(){try{var e=this;return Promise.resolve(x(function(){return Promise.resolve(e.getStore().get(e.storageKey)).then(function(t){return t[e.storageKey]||{}})},function(e){throw console.error("ChromeStore.getAll 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.remove=function(e){try{var t=this;return Promise.resolve(x(function(){return Promise.resolve(t.getAll()).then(function(n){var r=function(){var r;if(n&&e in n)return delete n[e],Promise.resolve(t.getStore().set((r={},r[t.storageKey]=n,r))).then(function(){})}();if(r&&r.then)return r.then(function(){})})},function(e){throw console.error("ChromeStore.remove 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.clear=function(){try{var e=this;return Promise.resolve(x(function(){return Promise.resolve(e.getStore().remove(e.storageKey)).then(function(){})},function(e){throw console.error("ChromeStore.clear 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.setMultiple=function(e){try{var t=this;return Promise.resolve(x(function(){return Promise.resolve(t.getAll()).then(function(n){var r,o=p({},n,e);return Promise.resolve(t.getStore().set((r={},r[t.storageKey]=o,r))).then(function(){})})},function(e){throw console.error("ChromeStore.setMultiple 失败:",e),e}))}catch(e){return Promise.reject(e)}},t.onChanged=function(e){var t=this;chrome.storage.onChanged.addListener(function(n,r){r===t.storeType&&n[t.storageKey]&&e(n)})},t.has=function(e){try{var t=this;return Promise.resolve(x(function(){return Promise.resolve(t.get(e)).then(function(e){return void 0!==e})},function(e){return console.error("ChromeStore.has 失败:",e),!1}))}catch(e){return Promise.reject(e)}},t.getSize=function(){try{var e=this;return Promise.resolve(x(function(){return Promise.resolve(e.getAll()).then(function(e){var t=JSON.stringify(e);return new Blob([t]).size})},function(e){return console.error("ChromeStore.getSize 失败:",e),0}))}catch(e){return Promise.reject(e)}},t.getStoreKey=function(){return this.storageKey},e}();P.instances=new Map;var S="https://www.linkedin.com/voyager/api";function k(e,t){var n,r={"csrf-token":e};return t&&(n="string"==typeof t?t:Object.entries(t).map(function(e){return e[0]+"="+e[1]}).join("; "))&&(r.Cookie=n),r}var C={profilePage:{userPicture:[".pv-top-card__non-self-photo-wrapper img","#recent-activity-top-card img",".pv-top-card__photo-wrapper img",'div[componentkey^="com.linkedin.sdui.profile.card"] div[data-view-name="profile-top-card-member-photo"] img'],userName:['a[href^="/in"] h1',"#recent-activity-top-card h3",'div[data-view-name="profile-top-card-verified-badge"] div[role="button"]'],userOccupation:[".artdeco-entity-lockup .artdeco-entity-lockup__subtitle","#recent-activity-top-card h4"],linkedinProfileCard:[".scaffold-layout__main .artdeco-card:first-child",'div[componentkey^="com.linkedin.sdui.profile.card"]'],privateProfileInfoSection:[".pv-profile-info-section"],howToContainer:["#profile-content, header#global-nav"],companyName:[".top-card-background-hero-image+div .mt2 ul>li span",'div[componentkey^="com.linkedin.sdui.profile.card"] div:has(div[data-view-name="profile-top-card-verified-badge"]) + div div[role="button"] p'],companyLogo:[".top-card-background-hero-image+div .mt2 ul>li img"],campaignsListContainer:[".ui-row.sm.campaigns-list-container"],contactListContainer:[".ui-row.sm.contact-list-container"],location:["#profile-content .artdeco-card .top-card-background-hero-image+div .text-body-small.inline.t-black--light"],campaignsListContainerDisplay:[".ui-col.sm.campaigns-list-container-display"],contactListContainerDisplay:[".ui-col.sm.contact-list-container-display"],mainExperienceContainer:[".artdeco-card:has(#experience) li:first-child",'div[componentkey^="com.linkedin.sdui.profile.card"][componentkey$="ExperienceTopLevelSection"] div:has(h2) + div > div'],experienceCompanyLogo:['[data-field="experience_company_logo"] img','div[componentkey^="com.linkedin.sdui.profile.card"][componentkey$="ExperienceTopLevelSection"] div:has(h2) + div figure[data-view-name="image"] img'],experienceCompanyName:['div:has([data-field="experience_company_logo"])+div .t-normal span:not(.visually-hidden)'],experienceOccupation:['div:has([data-field="experience_company_logo"])+div .t-bold span:not(.visually-hidden)'],experienceMultipleCompany:["li:has([data-view-name=profile-component-entity] .pvs-entity__sub-components .pvs-entity__sub-components) .t-bold span:not(.visually-hidden)"],experienceMultipleOccupation:['[data-view-name="profile-component-entity"] li:first-child .t-bold span:not(.visually-hidden)']},salesNavProfilePage:{profileCardSection:["#profile-card-section"],userName:['#profile-card-section [data-anonymize="person-name"]'],userPicture:['#profile-card-section img[data-anonymize="headshot-photo"]'],userOccupation:['#profile-card-section [data-anonymize="headline"]'],profileUrl:['#profile-card-section a[href^="/sales/lead"]'],linkedinProfileCard:["#profile-card-section"],campaignsListContainer:[".ui-row.sm.campaigns-list-container"],contactListContainer:[".ui-row.sm.contact-list-container"],campaignsListContainerDisplay:[".ui-col.sm.campaigns-list-container-display"],contactListContainerDisplay:[".ui-col.sm.contact-list-container-display"],location:["#profile-card-section>section>div>div:last-child div:has(svg)"],companyName:['#profile-card-section a[data-anonymize="company-name"]'],companyLogo:['#profile-card-section img[data-anonymize="company-logo"]'],moreInfoButton:["#profile-card-section section[data-x--lead-actions-bar] button[data-x--lead-actions-bar-overflow-menu]",'#profile-card-section button[aria-label="Open actions overflow menu"]'],linkedinProfileLinkButton:['#hue-web-menu-outlet a[href^="https://www.linkedin.com/in/"]'],mainExperienceContainer:['[data-sn-view-name="feature-lead-experience"]'],experienceCompanyLogo:['li:first-child img[data-anonymize="company-logo"]'],experienceCompanyName:['li:first-child [data-anonymize="company-name"]'],experienceOccupation:['li:first-child [data-anonymize="job-title"]'],experienceMultipleOccupation:['ul li ul li:first-child [data-anonymize="job-title"]','ul li [data-anonymize="job-title"]'],experienceMultipleCompany:['li:first-child [data-anonymize="company-name"]']},searchPeoplePage:{searchEntityResult:['[data-view-name="search-entity-result-universal-template"]'],linkedinUrl:['a[data-test-app-aware-link][href^="https://www.linkedin.com/in/"]','a[data-view-name="search-result-lockup-title"]'],image:[".presence-entity img","a>div>div>figure>img"],userOccupation:['p:has(a[data-view-name="search-result-lockup-title"]) + p',".entity-result__primary-subtitle",".entity-result__divider > div div:nth-child(2)","div>div>div:nth-child(2)>div>div:nth-child(2)","figure + div p:nth-child(2)"],fullName:[".entity-result__title-text a span>span",".entity-result__title-line a span>span",".entity-result__title-line span>a>span>span","a:has(+.entity-result__badge)>span>span",".linked-area div:nth-child(2) > div:first-child > div.t-roman.t-sans a",'a[data-view-name="search-result-lockup-title"]'],resultList:[".search-results-container>div:has(.reusable-search__result-container)"],actionsDiv:[".entity-result__actions",".linked-area > div > div:last-child","div:has(figure) > div:last-child"],validResult:["[data-chameleon-result-urn] , .reusable-search__result-container"],searchResult:[".search-results-container li:has(>[data-chameleon-result-urn])",'[data-view-name="people-search-result"]'],searchResultsContainer:[".search-results-container",'[role="main"] div:has(>hr[role="presentation"])'],mainLayoutLeft:[".search-marvel-srp",'[role="main"] div:has(hr)>div>div'],howToContainer:[".hasLegacyFeedLineHeight div:has(main)",".authentication-outlet"]},searchAllPage:{peopleButton:["nav ul.search-reusables__filter-list>li>button"],toolbar:[".scaffold-layout-toolbar"]}};function M(e,t,n){switch(n){case"all":var r=e.querySelectorAll(t);return r.length>0?Array.from(r):null;case"closest":return e instanceof HTMLElement?e.closest(t):null;default:return e.querySelector(t)}}function I(e){var t=e.page,n=e.key,r=e.container,o=e.mode;null!=r||(r=document);for(var i,a,s=h(t&&n?C[(i={page:t,key:n}).page][i.key]:[e.selector]);!(a=s()).done;){var c=M(r,a.value,o);if(c)return c}return null}function L(e){if(!e)return"";var t=document.createElement("textarea");return t.innerHTML=e,t.value.trim()}var E={"":0,chrome:1,"chrome-extension":2,"view-source":3,ftp:4,file:5,data:6,blob:7,about:8};function _(e){void 0===e&&(e="");var t="",n=e.split("#")[0].toLocaleLowerCase();return/^https\:\/\/(www|.{2})\.linkedin\.com\/in\/[^/?]+(\/recent-activity\/|\/details\/|\/overlay\/|\/?\?[^/]*|\/?$)/.test(n)||/^https\:\/\/(www|.{2})\.linkedin\.com\/sales\/people\/(.+?),/.test(n)||/^https\:\/\/(www|.{2})\.linkedin\.com\/sales\/(profile|lead)\/([^,]{39}),/.test(n)?t="profile":n.includes("linkedin.com/feed")?t="feed":n.includes("linkedin.com/posts/")?t="post":n.includes("linkedin.com/login")||n.includes("linkedin.com/checkpoint")||n.includes("linkedin.com/authwall")?t="login":n.includes("linkedin.com/company/")?t="company":n.includes("linkedin.com/messaging/thread/")?t="messages":n.includes("linkedin.com/search/results/people/?")||n.includes("linkedin.com/sales/search/people")?t="search-people":n.includes("linkedin.com/search/results/all")?t="search-all":n.includes("linkedin.com/mynetwork/")&&(t="connections"),t}function T(e){var t;void 0===e&&(e="");var n=((e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL).match(/linkedin\.com\/in\/([^?/]+)/)||[])[1]||(e.match(/linkedin\.com\/sales\/people\/(.+?),/)||[])[1]||(e.match(/linkedin\.com\/sales\/(?:profile|lead)\/([^,]{39}),/)||[])[1]||"";return decodeURIComponent(n)}function j(e){var t;void 0===e&&(e="");var n=((e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL).match(/linkedin\.com\/company\/([^?/]+)/)||[])[1]||"";return decodeURIComponent(n)}exports.ChromeStore=P,exports.Draggable=w,exports.MemoryStore=m,exports.RealUndefined=e,exports.WebStore=b,exports.cacheWrapper=function(e,t){void 0===t&&(t=u);var n=function(){var n=[].slice.call(arguments),i=r(n)+e.name+(t.identifier||"");if(l(i))return Promise.resolve(o(c(i)));if(s[i]){var d=Object.assign({},u,t);return new Promise(function(e){var t=Date.now(),n=setInterval(function(){l(i)?(clearInterval(n),e(o(c(i)))):Date.now()-t>d.timeout&&(s[i]=!1,clearInterval(n),e(o(d.timeoutResult)))},100)})}return s[i]=!0,e.apply(this,n).then(function(e){return a[i]=e,o(a[i])}).catch(function(e){throw e}).finally(function(){s[i]=!1})};return Object.defineProperty(n,"name",{value:"cacheWrapper_"+e.name,configurable:!0}),n},exports.cloneDeep=o,exports.createDefaultObject=i,exports.createElement=function e(t){var n=void 0===t?{}:t,r=n.tag,o=n.children,i=void 0===o?[]:o,a=n.props,s=void 0===a?{}:a,c=n.attrs,l=void 0===c?{}:c,u=n.styles,d=void 0===u?{}:u,p=document.createElement(void 0===r?"div":r);Object.assign(p,s);for(var m=0,v=Object.entries(l);m<v.length;m++){var g=v[m],y=g[1];!1!==y&&p.setAttribute(g[0],y)}for(var w=0,b=Object.entries(d);w<b.length;w++){var x=b[w];f(p,x[0],x[1])}for(var P,S=h(Array.isArray(i)?i:[i]);!(P=S()).done;){var k=P.value;k&&("object"==typeof k?k instanceof Element?p.appendChild(k):p.appendChild(e(k)):p.appendChild(document.createTextNode(k)))}return p},exports.createMessageBus=function(e){void 0===e&&(e={});var t=e.debug,n=void 0!==t&&t,r=e.logPrefix,o=void 0===r?"[MessageBus]":r,i=new Map,a=!1;function s(e){var t;n&&(t=console).error.apply(t,[o+" "+e].concat([].slice.call(arguments,1)))}function c(){a||(chrome.runtime.onMessage.addListener(function(e,t,n){if(e&&"string"==typeof e.type){var r=i.get(e.type);if(r)try{var o=r(e.payload,t);return o instanceof Promise?(o.then(n).catch(function(t){s('Error handling "'+String(e.type)+'":',t),n({__error:!0,message:t instanceof Error?t.message:String(t)})}),!0):(n(o),!1)}catch(t){return s('Error handling "'+String(e.type)+'":',t),n({__error:!0,message:t instanceof Error?t.message:String(t)}),!1}}}),a=!0)}return{send:function(e){return chrome.runtime.sendMessage({type:e,payload:[].slice.call(arguments,1)[0]})},sendToTab:function(e,t){return chrome.tabs.sendMessage(e,{type:t,payload:[].slice.call(arguments,2)[0]})},on:function(e,t){return c(),i.set(e,t),function(){i.delete(e)}},onMany:function(e){c();for(var t=[],n=0,r=Object.entries(e);n<r.length;n++){var o=r[n],a=o[0],s=o[1];s&&(i.set(a,s),t.push(a))}return function(){for(var e=0,n=t;e<n.length;e++)i.delete(n[e])}},hasHandler:function(e){return i.has(e)},getRegisteredTypes:function(){return Array.from(i.keys())},clearAllHandlers:function(){i.clear()}}},exports.createSvg=function(e){return"string"==typeof e?g(e):v(e)},exports.createSvgFromUrl=function(e){try{return Promise.resolve(function(t,n){try{var r=Promise.resolve(fetch(e)).then(function(e){if(!e.ok)throw new Error("网络请求失败: "+e.status+" "+e.statusText);return Promise.resolve(e.text()).then(g)})}catch(e){return n(e)}return r&&r.then?r.then(void 0,n):r}(0,function(e){var t=e instanceof Error?e.message:"未知错误";throw new Error("无法创建 SVG 元素: "+t)}))}catch(e){return Promise.reject(e)}},exports.debounce=function(e,t){var n=null;return function(){var r=arguments,o=this;null!==n&&clearTimeout(n),n=setTimeout(function(){e.apply(o,[].slice.call(r)),n=null},t)}},exports.decodeJWT=function(e){var t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(atob(t).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(n)},exports.delayExecution=function(e,t){void 0===t&&(t=0);var n=[].slice.call(arguments,2);return new Promise(function(r){0===t?r(e.apply(void 0,n)):setTimeout(function(){r(e.apply(void 0,n))},t)})},exports.generateStableUniqueKey=r,exports.getCompanyPublicId=j,exports.getContactInfo=function(){var e,t,n,r,o,i,a,s=window.location.href.includes("linkedin.com/sales")?"salesNavProfilePage":"profilePage";function c(e){return I({page:s,key:e,container:document})}var l=null==(e=c("userName"))?void 0:e.innerText;if(!l)return console.error("extractUserInfos: no userName found"),{};var u,d=null==(t=c("userPicture"))?void 0:t.src,h=null==(n=c("userOccupation"))?void 0:n.innerHTML,p=null==(r=c("companyName"))?void 0:r.innerText,m=null==(o=c("companyLogo"))?void 0:o.src,f=null==(i=c("location"))?void 0:i.innerText;return"salesNavProfilePage"===s&&(u=/linkedin\.com\/sales\/lead/i.test(window.location.href)?window.location.href:null==(a=c("profileUrl"))?void 0:a.href),{name:L(l),profileUrl:u,picture:d,occupation:L(h),companyName:p,companyPicture:m,location:f}},exports.getCookie=function(e,t,n){return void 0===n&&(n=!1),chrome.cookies.get({url:e,name:t}).then(function(e){var t;return n?(null==e||null==(t=e.value)?void 0:t.replace(/"/g,""))||"":null!=e?e:void 0})},exports.getCookies=function(e,t){return void 0===t&&(t=!1),chrome.cookies.getAll({url:e}).then(function(e){return t?function(e){return e.map(function(e){return e.name+"="+e.value}).join("; ")}(e):e})},exports.getElement=I,exports.getExtensionInfo=function(){var e,t,n;return{locale:null==(e=chrome.i18n)?void 0:e.getUILanguage(),extId:null==(t=chrome.runtime)?void 0:t.id,version:null==(n=chrome.runtime)?void 0:n.getManifest().version}},exports.getGlobal=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:this},exports.getLinkedinCompany=function(e,t){var n=t.csrfToken,r=t.cookies;try{var o="string"==typeof e?{universalName:e}:e,i="universalName"in o,a=S+"/organization/companies"+(i?"?q=universalName&universalName="+o.universalName:"/"+o.urn),s=k(n,r);return Promise.resolve(fetch(a,{method:"GET",headers:s}).then(function(e){try{var t,n=function(){if(e.ok)return Promise.resolve(e.json()).then(function(e){if(i){var n,r=(null==(n=e.elements)?void 0:n[0])||null;return t=1,r}return t=1,e})}();return Promise.resolve(n&&n.then?n.then(function(e){return t?e:null}):t?n:null)}catch(e){return Promise.reject(e)}}).catch(function(e){return console.error(e),null}))}catch(e){return Promise.reject(e)}},exports.getLinkedinMe=function(e){var t=e.csrfToken,n=e.cookies;try{var r=S+"/me",o=k(t,n);return Promise.resolve(fetch(r,{method:"GET",headers:o}).then(function(e){try{return Promise.resolve(e.ok?e.json():null)}catch(e){return Promise.reject(e)}}).catch(function(e){return console.error(e),null}))}catch(e){return Promise.reject(e)}},exports.getLinkedinPageType=_,exports.getLinkedinProfile=function(e,t){var n=t.csrfToken,r=t.cookies;try{var o=S+"/identity/dash/profiles?q=memberIdentity&memberIdentity="+e+"&decorationId=com.linkedin.voyager.dash.deco.identity.profile.FullProfileWithEntities-26",i=k(n,r);return Promise.resolve(fetch(o,{method:"GET",headers:i}).then(function(e){try{var t,n=function(){if(e.ok)return Promise.resolve(e.json()).then(function(e){var n,r=(null==(n=e.elements)?void 0:n[0])||null;return t=1,r})}();return Promise.resolve(n&&n.then?n.then(function(e){return t?e:null}):t?n:null)}catch(e){return Promise.reject(e)}}).catch(function(e){return console.error(e),null}))}catch(e){return Promise.reject(e)}},exports.getLinkedinPublicId=function(e){var t;return void 0===e&&(e=""),T(e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL)||j(e)||""},exports.getPageType=function(e){if(void 0===e&&(e=""),!e)return"";var t=Object.keys(E),n=new URL(e).protocol.replace(":","");return t.includes(n)?n:_(e)},exports.getPostPublicId=function(e){var t;void 0===e&&(e="");var n=((e=e||(null==(t=window.top)?void 0:t.location.href)||document.URL).match(/linkedin\.com\/posts\/([^\/]+)\//)||[])[1]||"";return decodeURIComponent(n)},exports.getProfilePublicId=T,exports.isCloneable=t,exports.isErrorResponse=function(e){return"object"==typeof e&&null!==e&&"__error"in e&&!0===e.__error},exports.isLinkedInUrl=function(e){return/^https?:\/\/(www|.{2})\.linkedin\.com/.test(e)},exports.isPrimitive=n,exports.launchWebAuthFlow=function(e){var t=e.clientId,n=e.responseType,r=void 0===n?"code":n,o=e.state,i=e.nonce,a=e.interactive,s=void 0===a||a;try{var c=chrome.identity.getRedirectURL(),l=Array.isArray(r)?r:[r],u=new URL("https://accounts.google.com/o/oauth2/v2/auth");return u.searchParams.set("client_id",t),u.searchParams.set("redirect_uri",c),u.searchParams.set("response_type",l.join(" ")),u.searchParams.set("scope","openid email profile"),i&&u.searchParams.set("nonce",i),o&&u.searchParams.set("state",o),Promise.resolve(chrome.identity.launchWebAuthFlow({url:u.toString(),interactive:s}).then(function(e){if(!e)return Promise.reject(new Error("redirectUrl is null"));var t=e.includes("?")?"?":"#",n=new URLSearchParams(e.split(t)[1]),r={};return n.forEach(function(e,t){r[t]=e}),r}).catch(function(e){return console.log("error",e),Promise.reject(e)}))}catch(e){return Promise.reject(e)}},exports.pageTypeMap=E,exports.scrollToBottom=y,exports.scrollToBottomIfNeeded=function(e){e&&("true"!==e.dataset.isListeningForUserScroll&&(function(e){e&&e.addEventListener("scroll",function(){!function(e,t){e.dataset.userInteracted=t?"true":"false"}(e,e.scrollTop+e.clientHeight<e.scrollHeight-5)})}(e),e.dataset.isListeningForUserScroll="true"),"true"!==e.dataset.userInteracted&&y(e))},exports.singleExecutionWrapper=function(t,n){void 0===n&&(n=0);var r=function(){if(r.isExecuting)return Promise.resolve(e);r.isExecuting=!0;var o=performance.now(),i=t.apply(this,[].slice.call(arguments));return i.finally(function(){var e=performance.now()-o;n&&n>e?setTimeout(function(){r.isExecuting=!1},n-e):r.isExecuting=!1}),i};return r.isExecuting=!1,r};
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|