"use strict";const t=require("react"),u=require("./index.cjs38.js");require("./index.cjs39.js");require("./index.cjs40.js");require("./index.cjs41.js");require("./index.cjs42.js");require("./index.cjs43.js");require("./index.cjs44.js");require("./index.cjs45.js");require("./index.cjs46.js");require("./index.cjs47.js");require("./index.cjs48.js");require("./index.cjs49.js");require("./index.cjs50.js");require("./index.cjs51.js");require("./index.cjs52.js");require("./index.cjs53.js");require("./index.cjs54.js");require("./index.cjs55.js");require("./index.cjs56.js");require("./index.cjs57.js");require("./index.cjs58.js");require("./index.cjs59.js");require("./index.cjs60.js");require("./index.cjs61.js");require("./index.cjs62.js");require("./index.cjs63.js");require("./index.cjs64.js");require("./index.cjs65.js");const y=require("./index.cjs74.js"),C=q=>{const[r,f]=t.useState(),[n,h]=t.useState({}),[o,m]=t.useState(),[c,l]=t.useState(),i=t.useMemo(()=>y.default.coreCitationStyles,[]),a=t.useCallback(e=>{const s=u.findWhere(i,{name:e});f(e),m(s==null?void 0:s.title)},[i]),S=t.useMemo(()=>({name:r,title:o,xml:c}),[r,o,c]);return t.useEffect(()=>{if(!r){let e;q?e=u.findWhere(i,{name:q}):e=u.findWhere(i,{isDefault:!0}),a(e==null?void 0:e.name)}},[i,q]),t.useEffect(()=>{r&&(u.has(n,r)?l(n[r]):fetch(`https://www.zotero.org/styles/${r}`).then(e=>e.text()).then(e=>{l(e),h(s=>({...s,[r]:e}))}))},[r,n]),{onStyleChange:a,style:S,styles:i}};module.exports=C;
//# sourceMappingURL=index.cjs11.js.map
