PageSourceSearch

https://ci-con.ru/_next/static/chunks/pages/admin/insights/templates-acfa8dc070172233.js

js ci-con.ru collected 2026-10-08 16:33:06 UTC 22,858 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29002],{613402:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/insights/templates",function(){return n(810831)}])},810831:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return InsightTemplatesPage}});var r=n(785893),s=n(667294),a=n(809008),i=n.n(a),o=n(731929),c=n(281612),l=n(592485),u=n(579840),d=n(189740),h=n(966291),f=n(565353),p=n(565400),m=n.n(p),g=n(256697),y=n(897538),x=n(151024),j=n(674048),v=n(553740),b=n(570302),S=n(755673),T=n(305789),_=n(111187),k=n(289552),w=n(516373),Z=n(436671),A=n(435297),C=n(328465),P=n(674806),I=n(991633),E=n(794055),R=n(831059),U=n(59361),J=n(432615),z=n(958452),O=n(619702),B=n(252655),F=n(135855),N=n(485317),L=n(340920),M=n(530744),H=n(477017),D=n(704851),Q=n(192167),V=n(693315),W=n(756363),q=n(780793),X=n(894922),G=n(949871),K=n(811163),Y=v.Z.Title,$=v.Z.Text;v.Z.Paragraph;var ee=x.Z.TextArea,et=w.Z.Content,en=C.Z.Dragger,er=window.location.origin,es="".concat(er,"/api");function InsightTemplatesAdmin(){var e,t,n,a,i,o,c,p=(0,K.useRouter)(),v=(0,d._)((0,s.useState)([]),2),C=v[0],er=v[1],ea=(0,d._)((0,s.useState)(!0),2),ei=ea[0],eo=ea[1],ec=(0,d._)((0,s.useState)(!1),2),el=ec[0],eu=ec[1],ed=(0,d._)((0,s.useState)(null),2),eh=ed[0],ef=ed[1],ep=(0,d._)((0,s.useState)(!1),2),em=ep[0],eg=ep[1],ey=(0,d._)(y.Z.useForm(),1)[0],ex=(0,d._)((0,s.useState)(null),2),ej=ex[0],ev=ex[1],eb=(0,d._)((0,s.useState)(!1),2),eS=eb[0],eT=eb[1],e_=(0,d._)((0,s.useState)(!1),2),ek=e_[0],ew=e_[1],eZ=(0,d._)((0,s.useState)(0),2),eA=eZ[0],eC=eZ[1],eP=(0,d._)((0,s.useState)(function(){return new Set}),2),eI=eP[0],eE=eP[1],eR=(0,s.useCallback)((0,l._)(function(){var e,t;return(0,f.Jh)(this,function(n){switch(n.label){case 0:if(n.trys.push([0,4,5,6]),!(e=localStorage.getItem("authToken")))return eT(!0),[2];return[4,(0,X.S)("".concat(es,"/users/me"),{headers:{Authorization:"Bearer ".concat(e)}})];case 1:if(!(t=n.sent()).ok)return[3,3];return[4,t.json()];case 2:ev(n.sent()),n.label=3;case 3:return[3,6];case 4:return n.sent(),[3,6];case 5:return eT(!0),[7];case 6:return[2]}})}),[]),eU=(0,s.useCallback)((0,l._)(function(){var e,t;return(0,f.Jh)(this,function(n){switch(n.label){case 0:return n.trys.push([0,5,6,7]),eo(!0),e=localStorage.getItem("authToken"),[4,(0,X.S)("".concat(es,"/insight-templates?includeCode=1"),{headers:{Authorization:"Bearer ".concat(e)}})];case 1:if(!(t=n.sent()).ok)return[3,3];return[4,t.json()];case 2:return er.apply(void 0,[n.sent()]),[3,4];case 3:_.ZP.error("Не удалось загрузить шаблоны"),n.label=4;case 4:return[3,7];case 5:return n.sent(),_.ZP.error("Ошибка загрузки шаблонов"),[3,7];case 6:return eo(!1),[7];case 7:return[2]}})}),[]),eJ=!!(ej&&(ej.isEmployee||ej.isAdmin)),ez=!!(ej&&!eJ&&ej.isAssociate&&ej.associateClientId);(0,s.useEffect)(function(){eR()},[eR]),(0,s.useEffect)(function(){eS&&ej&&(ej.isEmployee||ej.isAdmin||ej.isAssociate&&ej.associateClientId)&&eU()},[eS,ej,eU]);var eO=(0,s.useCallback)(function(e){ev(e)},[]),eB=(e=(0,l._)(function(e,t){var n,r,s,a,i;return(0,f.Jh)(this,function(o){switch(o.label){case 0:if(r=(n=C.findIndex(function(t){return t.id===e.id}))+t,n<0||r<0||r>=C.length)return[2];a=[(s=(0,h._)(C))[r],s[n]],s[n]=a[0],s[r]=a[1],er(s),o.label=1;case 1:return o.trys.push([1,3,,4]),i=localStorage.getItem("authToken"),[4,(0,X.S)("".concat(es,"/insight-templates/reorder"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(i)},body:JSON.stringify({ids:s.map(function(e){return e.id})})})];case 2:if(!o.sent().ok)throw Error("reorder failed");return[3,4];case 3:return o.sent(),_.ZP.error("Не удалось сохранить порядок"),eU(),[3,4];case 4:return[2]}})}),function(t,n){return e.apply(this,arguments)}),eF=(t=(0,l._)(function(e){var t,n,r;return(0,f.Jh)(this,function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),t=localStorage.getItem("authToken"),[4,(0,X.S)("".concat(es,"/insight-templates/").concat(e.id),{headers:{Authorization:"Bearer ".concat(t)}})];case 1:if(!(n=s.sent()).ok)return[3,3];return[4,n.json()];case 2:ef(r=s.sent()),eu(!0),setTimeout(function(){ey.setFieldsValue({title:r.title,code:r.code,imageUrl:r.imageUrl||"",syncEnabled:!!r.sync_pair_id})},50),s.label=3;case 3:return[3,5];case 4:return s.sent(),_.ZP.error("Не удалось загрузить шаблон"),[3,5];case 5:return[2]}})}),function(e){return t.apply(this,arguments)}),eN=(n=(0,l._)(function(e){var t,n,r,s,a,i,o,c,l,d,h,p;return(0,f.Jh)(this,function(f){switch(f.label){case 0:return f.trys.push([0,10,11,12]),eg(!0),t=localStorage.getItem("authToken"),n=e.syncEnabled,r=(0,u._)(e,["syncEnabled"]),s=eh?"".concat(es,"/insight-templates/").concat(eh.id):"".concat(es,"/insight-templates"),a=eh?"PUT":"POST",[4,(0,X.S)(s,{method:a,headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify(r)})];case 1:if(!(i=f.sent()).ok)return[3,7];return[4,i.json().catch(function(){return null})];case 2:if(o=f.sent(),c=eh?eh.id:null==o?void 0:o.id,l=!!(null==eh?void 0:eh.sync_pair_id),!(c&&!!n!==l))return[3,6];return[4,(0,X.S)("".concat(es,"/insight-templates/").concat(c,"/sync"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify({enabled:!!n})})];case 3:if(!(d=f.sent()).ok)return[3,4];return _.ZP.success(n?"Синхронизация с отчётами включена":"Синхронизация с отчётами выключена"),[3,6];case 4:return[4,d.json().catch(function(){return{}})];case 5:h=f.sent(),_.ZP.error(h.error||"Не удалось изменить синхронизацию"),f.label=6;case 6:return _.ZP.success(eh?"Шаблон обновлён":"Шаблон создан"),eu(!1),eU(),[3,9];case 7:return[4,i.json().catch(function(){return{}})];case 8:p=f.sent(),_.ZP.error(p.error||"Ошибка сохранения"),f.label=9;case 9:return[3,12];case 10:return f.sent(),_.ZP.error("Ошибка сохранения шаблона"),[3,12];case 11:return eg(!1),[7];case 12:return[2]}})}),function(e){return n.apply(this,arguments)}),eL=(a=(0,l._)(function(e){var t;return(0,f.Jh)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),t=localStorage.getItem("authToken"),[4,(0,X.S)("".concat(es,"/insight-templates/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(t)}})];case 1:return n.sent().ok&&(_.ZP.success("Шаблон удалён"),eU()),[3,3];case 2:return n.sent(),_.ZP.error("Ошибка удаления"),[3,3];case 3:return[2]}})}),function(e){return a.apply(this,arguments)}),eM=(i=(0,l._)(function(e){var t;return(0,f.Jh)(this,function(n){switch(n.label){case 0:if(null==(t=null==e?void 0:e.code)||""===t)return _.ZP.error("Не удалось скопировать"),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,(0,G.T)(t)];case 2:return n.sent(),_.ZP.success('Промпт "'.concat(e.title,'" скопирован')),[3,4];case 3:return n.sent(),_.ZP.error("Не удалось скопировать"),[3,4];case 4:return[2]}})}),function(e){return i.apply(this,arguments)}),downloadCode=function(e){var t=null==e?void 0:e.code;if(null==t||""===t){_.ZP.error("Не удалось скачать");return}var n=(e.title||"template").replace(/[\\/:*?"<>|]/g,"_").trim()||"template",r=new Blob([t],{type:"text/plain;charset=utf-8"}),s=URL.createObjectURL(r),a=document.createElement("a");a.href=s,a.download="".concat(n,".txt"),document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(s),_.ZP.success('Промпт "'.concat(e.title,'" скачан'))},eH=(o=(0,l._)(function(e){var t,n,r,s;return(0,f.Jh)(this,function(a){switch(a.label){case 0:if(eI.has(e.id))return[2];if(t=null==e?void 0:e.code,!(null==e?void 0:e.title)||null==t||""===t)return _.ZP.error("Не удалось добавить: пустой шаблон"),[2];eE(function(t){return new Set(t).add(e.id)}),a.label=1;case 1:return a.trys.push([1,6,7,8]),n=localStorage.getItem("authToken"),[4,(0,X.S)("".concat(es,"/rep-templates"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n)},body:JSON.stringify({title:e.title,code:e.code,imageUrl:e.imageUrl||null})})];case 2:if(!(r=a.sent()).ok)return[3,3];return _.ZP.success('Шаблон "'.concat(e.title,'" добавлен в отчёты')),[3,5];case 3:return[4,r.json().catch(function(){return{}})];case 4:s=a.sent(),_.ZP.error(s.error||"Не удалось добавить в отчёты"),a.label=5;case 5:return[3,8];case 6:return a.sent(),_.ZP.error("Ошибка при добавлении в отчёты"),[3,8];case 7:return eE(function(t){var n=new Set(t);return n.delete(e.id),n}),[7];case 8:return[2]}})}),function(e){return o.apply(this,arguments)}),eD=(c=(0,l._)(function(e){var t,n,r,s,a,i;return(0,f.Jh)(this,function(o){switch(o.label){case 0:if(!(null==e?void 0:null===(t=e.type)||void 0===t?void 0:t.startsWith("image/")))return _.ZP.error("Можно загружать только изображения"),[2];ew(!0),eC(0),o.label=1;case 1:return o.trys.push([1,3,4,5]),n=localStorage.getItem("authToken"),(r=new FormData).append("file",e),(s=new XMLHttpRequest).upload.onprogress=function(e){e.lengthComputable&&eC(Math.round(e.loaded/e.total*100))},[4,new Promise(function(e,t){s.onload=function(){if(s.status>=200&&s.status<300)e(JSON.parse(s.responseText));else{var n,r="Upload failed: ".concat(s.status);try{r=(null===(n=JSON.parse(s.responseText))||void 0===n?void 0:n.message)||r}catch(e){}t(Error(r))}},s.onerror=function(){return t(Error("Upload failed"))},s.open("POST","".concat(es,"/insight-templates/upload-image")),s.setRequestHeader("Authorization","Bearer ".concat(n)),s.send(r)})];case 2:return(null==(a=o.sent())?void 0:a.url)?(ey.setFieldsValue({imageUrl:a.url}),_.ZP.success("Изображение загружено в R2")):_.ZP.error("Сервер не вернул ссылку"),[3,5];case 3:return i=o.sent(),_.ZP.error("Ошибка загрузки: "+((null==i?void 0:i.message)||"")),[3,5];case 4:return ew(!1),eC(0),[7];case 5:return[2]}})}),function(e){return c.apply(this,arguments)});return eS?ej?eJ||ez?(0,r.jsxs)(w.Z,{style:{minHeight:"100vh",background:"#f0f2f5"},children:[(0,r.jsx)(q.default,{darkMode:!0,onAuthSuccess:eO}),(0,r.jsxs)(et,{style:{margin:"24px",marginTop:"124px",padding:"0 8px",maxWidth:1200,marginLeft:"auto",marginRight:"auto"},children:[(0,r.jsx)(b.Z,{style:{marginBottom:24,borderRadius:16,boxShadow:"0 2px 12px rgba(0,0,0,0.06)"},children:(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:16},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(Y,{level:2,style:{margin:0},children:"Шаблоны промптов"}),(0,r.jsx)($,{type:"secondary",children:ez?"Общие шаблоны — для просмотра и копирования; шаблоны вашей фирмы можно создавать и править":"Управление шаблонами для генерации инсайтов"})]}),(0,r.jsxs)(j.default,{wrap:!0,children:[(0,r.jsx)(m(),{icon:(0,r.jsx)(N.Z,{}),onClick:function(){return p.push(ez?"/admin/client-insights":"/admin/insights")},children:"К инсайтам"}),(0,r.jsx)(m(),{type:"primary",icon:(0,r.jsx)(J.default,{}),onClick:function(){ef(null),ey.resetFields(),eu(!0)},children:"Создать шаблон"})]})]})}),ei?(0,r.jsx)("div",{style:{textAlign:"center",padding:60},children:(0,r.jsx)(k.default,{size:"large"})}):0===C.length?(0,r.jsx)(b.Z,{style:{borderRadius:16},children:(0,r.jsx)(Z.default,{description:"Нет шаблонов"})}):(0,r.jsx)(S.Z,{gutter:[20,20],children:C.map(function(e,t){return(0,r.jsx)(T.Z,{xs:24,sm:12,md:8,children:(0,r.jsx)(b.Z,{hoverable:!0,style:{borderRadius:12,overflow:"hidden",height:"100%"},cover:e.imageUrl?(0,r.jsx)("div",{style:{height:160,overflow:"hidden",background:"#f5f5f5"},children:(0,r.jsx)("img",{alt:e.title,src:e.imageUrl,style:{width:"100%",height:"100%",objectFit:"cover"}})}):(0,r.jsx)("div",{style:{height:160,background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,r.jsx)(L.default,{style:{fontSize:48,color:"rgba(255,255,255,0.8)"}})}),actions:(0,h._)(eJ?[(0,r.jsx)(E.default,{title:"Выше в списке",children:(0,r.jsx)(V.Z,{style:0===t?{opacity:.25,pointerEvents:"none"}:void 0,onClick:function(){return eB(e,-1)}})},"up"),(0,r.jsx)(E.default,{title:"Ниже в списке",children:(0,r.jsx)(W.Z,{style:t===C.length-1?{opacity:.25,pointerEvents:"none"}:void 0,onClick:function(){return eB(e,1)}})},"down")]:[]).concat([(0,r.jsx)(B.default,{onClick:function(){return eM(e)}},"copy"),(0,r.jsx)(M.default,{onClick:function(){return downloadCode(e)}},"download")],(0,h._)(eJ?[(0,r.jsx)(E.default,{title:"Добавить в отчёты",children:eI.has(e.id)?(0,r.jsx)(D.default,{}):(0,r.jsx)(H.Z,{onClick:function(){return eH(e)}})},"to-reports")]:[]),(0,h._)(eJ||ez&&e.client_id===ej.associateClientId?[(0,r.jsx)(z.default,{onClick:function(){return eF(e)}},"edit"),(0,r.jsx)(A.Z,{title:"Удалить шаблон?",onConfirm:function(){return eL(e.id)},okText:"Да",cancelText:"Нет",children:(0,r.jsx)(O.default,{})}
1,"delete")]:[])),children:(0,r.jsx)(b.Z.Meta,{title:e.title,description:(0,r.jsxs)(j.default,{direction:"vertical",size:2,children:[(0,r.jsx)($,{type:"secondary",style:{fontSize:12},children:new Date(e.createdAt).toLocaleDateString("ru-RU")}),e.client_id?(0,r.jsx)(U.Z,{color:"cyan",style:{marginRight:0},children:ez?"шаблон вашей фирмы":"клиентский шаблон"}):ez?(0,r.jsx)(U.Z,{style:{marginRight:0},children:"общий \xb7 только копирование"}):null,e.sync_pair_id&&eJ?(0,r.jsxs)($,{style:{fontSize:12,color:"#007A92"},children:[(0,r.jsx)(Q.Z,{})," синхронизирован с отчётами"]}):null]})})})},e.id)})})]}),(0,r.jsx)(g.Z,{title:eh?"Редактировать шаблон":"Создать шаблон",open:el,onCancel:function(){return eu(!1)},footer:null,width:800,destroyOnClose:!0,children:(0,r.jsxs)(y.Z,{form:ey,layout:"vertical",onFinish:eN,children:[ez&&!eh?(0,r.jsx)($,{type:"secondary",style:{display:"block",marginBottom:12,fontSize:12},children:"Шаблон будет создан в пуле вашей фирмы — общие шаблоны он не затрагивает"}):null,(0,r.jsx)(y.Z.Item,{name:"title",label:"Название шаблона",rules:[{required:!0,message:"Введите название"}],children:(0,r.jsx)(x.Z,{placeholder:"Например: HTML Промпт"})}),(0,r.jsx)(y.Z.Item,{label:"Картинка",children:(0,r.jsxs)(j.default,{direction:"vertical",style:{width:"100%"},children:[(0,r.jsx)(y.Z.Item,{name:"imageUrl",noStyle:!0,children:(0,r.jsx)(x.Z,{placeholder:"https://..."})}),(0,r.jsx)(en,{multiple:!1,accept:"image/*",showUploadList:!1,disabled:ek,beforeUpload:function(e){return eD(e),!1},style:{padding:"8px 0"},children:ek?(0,r.jsx)(P.default,{percent:eA,size:"small",status:"active"}):(0,r.jsxs)(j.default,{children:[(0,r.jsx)(F.Z,{}),(0,r.jsx)($,{children:"Или загрузите файл"})]})}),(0,r.jsx)(y.Z.Item,{noStyle:!0,shouldUpdate:!0,children:function(){var e=ey.getFieldValue("imageUrl");return e?(0,r.jsx)(I.Z,{src:e,alt:"Preview",style:{maxHeight:100,objectFit:"cover",borderRadius:8},fallback:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mN8/+F9PQAI8wNPvd7POQAAAABJRU5ErkJggg=="}):null}})]})}),(0,r.jsx)(y.Z.Item,{name:"code",label:"Код промпта",rules:[{required:!0,message:"Введите код промпта"}],children:(0,r.jsx)(ee,{rows:16,placeholder:"Текст промпта / шаблон...",style:{fontFamily:"monospace",fontSize:13}})}),!eJ||eh&&eh.client_id?null:(0,r.jsx)(y.Z.Item,{name:"syncEnabled",valuePropName:"checked",style:{marginBottom:12},children:(0,r.jsxs)(R.default,{children:["Синхронизировать с отчётами",(0,r.jsx)($,{type:"secondary",style:{fontSize:12,display:"block"},children:"Пара ищется по названию (иначе создаётся копия); правки в любой из админок обновляют обе"})]})}),(0,r.jsx)(y.Z.Item,{style:{marginBottom:0,textAlign:"right"},children:(0,r.jsxs)(j.default,{children:[(0,r.jsx)(m(),{onClick:function(){return eu(!1)},children:"Отмена"}),(0,r.jsx)(m(),{type:"primary",htmlType:"submit",loading:em,children:eh?"Сохранить":"Создать"})]})})]})})]}):(0,r.jsxs)(w.Z,{style:{minHeight:"100vh",background:"#f0f2f5"},children:[(0,r.jsx)(q.default,{darkMode:!0,onAuthSuccess:eO}),(0,r.jsx)(et,{style:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:124},children:(0,r.jsxs)(b.Z,{style:{textAlign:"center",maxWidth:440},children:[(0,r.jsx)(Y,{level:4,children:"Нет доступа"}),(0,r.jsx)($,{children:"Управление шаблонами доступно сотрудникам, администраторам и ассоциатам клиентов."})]})})]}):(0,r.jsxs)(w.Z,{style:{minHeight:"100vh",background:"#f0f2f5"},children:[(0,r.jsx)(q.default,{darkMode:!0,onAuthSuccess:eO}),(0,r.jsx)(et,{style:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:124},children:(0,r.jsxs)(b.Z,{style:{textAlign:"center",maxWidth:400},children:[(0,r.jsx)(Y,{level:4,children:"Требуется авторизация"}),(0,r.jsx)($,{children:"Войдите для доступа к управлению шаблонами"})]})})]}):(0,r.jsxs)(w.Z,{style:{minHeight:"100vh",background:"#f0f2f5"},children:[(0,r.jsx)(q.default,{darkMode:!0,onAuthSuccess:eO}),(0,r.jsx)(et,{style:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:124},children:(0,r.jsx)(k.default,{size:"large"})})]})}function InsightTemplatesPage(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(i(),{children:[(0,r.jsx)("title",{children:"Шаблоны промптов | CI-CON.RU"}),(0,r.jsx)("meta",{name:"description",content:"Управление шаблонами промптов для генерации инсайтов"}),(0,r.jsx)("meta",{name:"robots",content:"noindex, nofollow"})]}),(0,r.jsx)(o.default,{locale:c.Z,children:(0,r.jsx)(InsightTemplatesAdmin,{})})]})}},894922:function(e,t,n){"use strict";n.d(t,{S:function(){return apiFetch}});var r=n(592485),s=n(677221),a=n(846439),i=n(966291),o=n(565353),c=[],l=!1,u=!1;
1function _tryRefreshToken(){return(_tryRefreshToken=(0,r._)(function(){var e,t,n;return(0,o.Jh)(this,function(r){switch(r.label){case 0:if(!(e=localStorage.getItem("refreshToken")))return[2,!1];if(u)return[2,new Promise(function(e){var t=setInterval(function(){u||(clearInterval(t),e(!!localStorage.getItem("authToken")))},50)})];u=!0,r.label=1;case 1:return r.trys.push([1,4,5,6]),[4,fetch("/api/users/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:e})})];case 2:if(!(t=r.sent()).ok)return localStorage.removeItem("refreshToken"),[2,!1];return[4,t.json()];case 3:return n=r.sent(),localStorage.setItem("authToken",n.token),n.refreshToken&&localStorage.setItem("refreshToken",n.refreshToken),window.dispatchEvent(new Event("authRefresh")),[2,!0];case 4:return r.sent(),[2,!1];case 5:return u=!1,[7];case 6:return[2]}})})).apply(this,arguments)}function _drainQueue(){return(_drainQueue=(0,r._)(function(){var e,t,n,r,l,u,d,h,f,p,m,g;return(0,o.Jh)(this,function(o){switch(o.label){case 0:e=(0,i._)(c),c=[],t=!0,n=!1,r=void 0,o.label=1;case 1:o.trys.push([1,8,9,10]),l=e[Symbol.iterator](),o.label=2;case 2:if(t=(u=l.next()).done)return[3,7];d=u.value,o.label=3;case 3:return o.trys.push([3,5,,6]),h=localStorage.getItem("authToken"),f=(0,s._)({},d.options.headers,h?{Authorization:"Bearer ".concat(h)}:{}),[4,fetch(d.url,(0,a._)((0,s._)({},d.options),{headers:f}))];case 4:return p=o.sent(),d.resolve(p),[3,6];case 5:return m=o.sent(),d.reject(m),[3,6];case 6:return t=!0,[3,2];case 7:return[3,10];case 8:return g=o.sent(),n=!0,r=g,[3,10];case 9:try{t||null==l.return||l.return()}finally{if(n)throw r}return[7];case 10:return[2]}})})).apply(this,arguments)}function apiFetch(e){return _apiFetch.apply(this,arguments)}function _apiFetch(){return(_apiFetch=(0,r._)(function(e){var t,n,r,i,u,d=arguments;return(0,o.Jh)(this,function(o){switch(o.label){case 0:return t=d.length>1&&void 0!==d[1]?d[1]:{},n=localStorage.getItem("authToken"),r=(0,s._)({},t.headers,n?{Authorization:"Bearer ".concat(n)}:{}),[4,fetch(e,(0,a._)((0,s._)({},t),{headers:r}))];case 1:if(401!==(i=o.sent()).status)return[2,i];return[4,function(){return _tryRefreshToken.apply(this,arguments)}()];case 2:if(o.sent())return u=localStorage.getItem("authToken"),[2,fetch(e,(0,a._)((0,s._)({},t),{headers:(0,s._)({},t.headers,u?{Authorization:"Bearer ".concat(u)}:{})}))];return[2,new Promise(function(n,r){if(c.push({url:e,options:t,resolve:n,reject:r}),!l){l=!0,localStorage.removeItem("authToken"),localStorage.removeItem("refreshToken"),localStorage.removeItem("user"),window.dispatchEvent(new CustomEvent("openLoginModal"));var onAuth=function(){l=!1,window.removeEventListener("authSuccess",onAuth),function(){_drainQueue.apply(this,arguments)}()};window.addEventListener("authSuccess",onAuth)}})]}})})).apply(this,arguments)}},949871:function(e,t,n){"use strict";n.d(t,{T:function(){return copyTextToClipboard}});var r=n(592485),s=n(565353);function copyTextToClipboard(e){return _copyTextToClipboard.apply(this,arguments)}function _copyTextToClipboard(){return(_copyTextToClipboard=(0,r._)(function(e){var t;return(0,s.Jh)(this,function(n){switch(n.label){case 0:if("string"!=typeof e)throw TypeError("copyTextToClipboard: expected string");n.label=1;case 1:if(n.trys.push([1,4,,5]),!(null===(t=navigator.clipboard)||void 0===t?void 0:t.writeText))return[3,3];return[4,navigator.clipboard.writeText(e)];case 2:return n.sent(),[2,!0];case 3:return[3,5];case 4:return n.sent(),[3,5];case 5:if(!function(e){var t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.width="1px",t.style.height="1px",t.style.padding="0",t.style.border="none",t.style.outline="none",t.style.boxShadow="none",t.style.background="transparent",document.body.appendChild(t),t.focus(),t.select(),t.setSelectionRange(0,e.length);var n=!1;try{n=document.execCommand("copy")}catch(e){n=!1}return document.body.removeChild(t),n}(e))throw Error("clipboard unavailable");return[2,!0]}})})).apply(this,arguments)}}},function(e){e.O(0,[53740,89552,87412,70302,31059,35297,28465,45038,50123,49774,92888,40179],function(){return e(e.s=613402)}),_N_E=e.O()}]);

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.