1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([["getBookmarkInstance"],{124:(t,e,o)=>{o.r(e),o.d(e,{getBookmarkInstance:()=>f});var i=Object.defineProperty,n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,s=(t,e,o)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,c=(t,e)=>{for(var o in e||(e={}))r.call(e,o)&&s(t,o,e[o]);if(n)for(var o of n(e))a.call(e,o)&&s(t,o,e[o]);return t};const m={gen:{domain:"gentside.com",apiTrigram:"gen"},omm:{domain:"ohmymag.com",apiTrigram:"omm"},hbr:{domain:"hbrfrance.fr",apiTrigram:"hbr"},cam:{domain:"caminteresse.fr",apiTrigram:"cam"},ctv:{domain:"cesoirtv.com",apiTrigram:"ctv"},cap:{domain:"capital.fr",apiTrigram:"cap"},cac:{domain:"cuisineactuelle.fr",apiTrigram:"cac"},fac:{domain:"femmeactuelle.fr",apiTrigram:"fac"},geo:{domain:"geo.fr",apiTrigram:"geo"},neo:{domain:"neonmag.fr",apiTrigram:"neo"},ptv:{domain:"programme.tv",apiTrigram:"ptv"},tel:{domain:"programme-tv.net",apiTrigram:"tel"},voi:{domain:"voici.fr",apiTrigram:"voi"},pmc:{domain:"prismaconnect.fr",apiTrigram:"pmc"},frgsd:{domain:"maxisciences.com",apiTrigram:"gen"},inf:{domain:"infonity.me",apiTrigram:"inf"},ppr:{domain:"passpresse.me",apiTrigram:"ppr"},hbz:{domain:"harpersbazaar.fr",apiTrigram:"hbz"},frgsg:{domain:"gamesider.com",apiTrigram:"frgsg"},frgss:{domain:"uppercutmma.com",apiTrigram:"frgss"}};class h{constructor({trigram:t,env:e,apiVersion:o,userId:i}){this.apiDomain=this.defineApiUrl(t,e,o),this.isConnected=!!i,this.userId=i}debug(t){localStorage.getItem("pmcDebug")}defineApiUrl(t,e,o){if(!t||!e||!o)throw new Error("Bookmark-Client: Missing parameters");if(!m[t])throw new Error(`Bookmark-Client:Unknown trigram: ${t}`);if(!["prod","prd2","prd","rec2","rec3"].includes(e))throw new Error(`Bookmark-Client: Unknown env: ${e}, Env ;ust be `);return`${`https://${["prod","prd2","prd"].includes(e)?"":`${e}-`}bookmark.${window.document.location.host.endsWith("prismamediadigital.com")?"prismamediadigital.com":m[t].domain}`}/${`v${o}`}/${m[t].apiTrigram}/`}objToQueryString(t){return Object.keys(t).map((function(e){const o=null!==t[e]&&void 0!==t[e]?t[e].toString():"";return`${encodeURIComponent(e)}=${encodeURIComponent(o)}`})).join("&")}transformCommaSeparated(t){return t.split(" ").join("")}headers({method:t="GET",contentType:e}){const o={"Content-Type":`${e}; charset=UTF-8`};return"POST"!==t&&"DELETE"!==t&&"PUT"!==t||(o.Accept=`${e}; charset=UTF-8`),o}getFetchOptions({method:t="GET",body:e,contentType:o="application/x-www-form-urlencoded"}={}){const i={};return i.headers=this.headers({method:t,contentType:o}),i.credentials="include",i.method=t,e&&(i.body=e),i}getBookmarks({type:t,offset:e,limit:o,optionnalFilters:i}){const n=this.objToQueryString(c({bookmark_type:t,offset:e,limit:o},i)),r=`${this.apiDomain}bookmark?${n}`;return new Promise(((t,e)=>{fetch(r,this.getFetchOptions()).then((e=>{t(e)})).catch((t=>{e(t)}))}))}postBookmark({type:t,contentId:e,contentPath:o,options:i={}}){const n=`${this.apiDomain}bookmark`,r=this.objToQueryString(c({bookmark_type:t,content_id:e,content_path:o},i));return new Promise(((t,e)=>{fetch(n,this.getFetchOptions({method:"POST",body:r})).then((e=>{t(e)})).catch((t=>{e(t)}))}))}deleteBookmark({type:t,contentId:e}){const o=this.objToQueryString({bookmark_type:t,content_id:e}),i=`${this.apiDomain}bookmark?${o}`;return new Promise(((t,e)=>{fetch(i,this.getFetchOptions({method:"DELETE"})).then((e=>{t(e)})).catch((t=>{e(t)}))}))}getTopBookmarks({type:t="bookmark",offset:e=0,limit:o=10}={}){const i=this.objToQueryString({bookmark_type:t,offset:e,limit:o}),n=`${this.apiDomain}top?${i}`;return new Promise(((t,e)=>{fetch(n,this.getFetchOptions()).then((e=>{t(e)})).catch((t=>{e(t)}))}))}getBookmarkers({type:t="bookmark",ids:e}){const o=this.objToQueryString({bookmark_type:t,content_ids:this.transformCommaSeparated(e)}),i=`${this.apiDomain}bookmarkers?${o}`;return new Promise(((t,e)=>{fetch(i,this.getFetchOptions()).then((e=>{t(e)})).catch((t=>{e(t)}))}))}getStatus(t){const e=this.objToQueryString({content_ids:this.transformCommaSeparated(t),user_id:this.userId?this.userId:""}),o=`${this.apiDomain}status?${e}`;return new Promise(((t,e)=>{fetch(o,this.getFetchOptions()).then((e=>{t(e)})).catch((t=>{e(t)}))}
1))}getStats(){const t=`${this.apiDomain}stats`;return new Promise(((e,o)=>{fetch(t,this.getFetchOptions()).then((t=>{e(t)})).catch((t=>{o(t)}))}))}getContentsBy(t){const e=this.objToQueryString(t),o=`${this.apiDomain}contents?${e}`;return new Promise(((t,e)=>{fetch(o,this.getFetchOptions()).then((e=>{t(e)})).catch((t=>{e(t)}))}))}getContents(t){return this.debug(["This method is deprecated. Please use getContentsBy instead"]),this.getContentsBy({content_ids:this.transformCommaSeparated(t)})}getCount(t){const e=this.objToQueryString({content_ids:this.transformCommaSeparated(t)}),o=`${this.apiDomain}count?${e}`;return new Promise(((t,e)=>{fetch(o,this.getFetchOptions()).then((e=>{t(e)})).catch((t=>{e(t)}))}))}migrateAlertBookmarks(){const t=`${this.apiDomain}alert/migrate`;return new Promise(((e,o)=>{fetch(t,this.getFetchOptions({method:"POST"})).then((t=>{e(t)})).catch((t=>{o(t)}))}))}putBookmarksEnabled(t){const e=`${this.apiDomain}bookmark/enabled`,o=JSON.stringify({enabled:t,content_ids:{exclude:["redactionPMD"]}});return new Promise(((t,i)=>{fetch(e,this.getFetchOptions({method:"PUT",body:o})).then((e=>{t(e)})).catch((t=>{i(t)}))}))}getConfiguration(){const t=`${this.apiDomain}configuration`;return new Promise(((e,o)=>{fetch(t,this.getFetchOptions()).then((t=>{e(t)})).catch((t=>{o(t)}))}))}postConfiguration(t){const e=`${this.apiDomain}configuration`,o=JSON.stringify({notification:t});return new Promise(((t,i)=>{fetch(e,this.getFetchOptions({method:"POST",body:o})).then((e=>{t(e)})).catch((t=>{i(t)}))}))}postBoard(t,e=!0){const o=`${this.apiDomain}board`,i=JSON.stringify({name:t,deletable:e});return new Promise(((t,e)=>{fetch(o,this.getFetchOptions({method:"POST",body:i,contentType:"application/json"})).then((e=>{t(e)})).catch((t=>{e(t)}))}))}putBoard(t,e){const o=`${this.apiDomain}board/${t}`,i=JSON.stringify({name:e});return new Promise(((t,e)=>{fetch(o,this.getFetchOptions({method:"PUT",body:i,contentType:"application/json"})).then((e=>{t(e)})).catch((t=>{e(t)}))}))}deleteBoard(t){const e=`${this.apiDomain}board/${t}`;return new Promise(((t,o)=>{fetch(e,this.getFetchOptions({method:"DELETE"})).then((e=>{t(e)})).catch((t=>{o(t)}))}))}getBoards(t=0,e=20){const o=this.objToQueryString({offset:t,limit:e}),i=`${this.apiDomain}boards?${o}`;return new Promise(((t,e)=>{fetch(i,this.getFetchOptions()).then((e=>{t(e)})).catch((t=>{e(t)}))}))}getNotReadArticles(){const t=`${this.apiDomain}not-read`;return new Promise(((e,o)=>{fetch(t,this.getFetchOptions()).then((t=>{e(t)})).catch((t=>{o(t)}))}))}}var p=o(1693),d=o(5508);let g;function f(){if(!g){const t={trigram:(new d.A).getTrigram()||"pmc",env:"prod",apiVersion:"2",userId:(0,p.R5)("x-pmc-id")};g=new h(t)}return g}}}]); 2//# sourceMappingURL=getBookmarkInstance.d0faae96.0ef15b04.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.