PageSourceSearch

https://cubox.pro/web/static/js/async/991.ff89f9c1.js

js cubox.pro collected 2026-10-02 07:50:34 UTC 27,523 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkweb=self.webpackChunkweb||[]).push([["991"],{1287:function(e,t,n){n.d(t,{M:function(){return r}});function r(e,t){let n=[],r=new Map;e.forEach(e=>{if(e.parentGroupId){let t=r.get(e.parentGroupId);t?r.set(e.parentGroupId,[...t,e]):r.set(e.parentGroupId,[e])}else n.push(e)});let a=(e,n,i)=>{var o;e.push({...n,level:i,isLeaf:!1});let l=null===(o=r.get(n.groupId))||void 0===o?void 0:o.sort((e,t)=>e.index-t.index);l?t.includes(n.groupId)&&l.forEach(t=>{a(e,t,i+1)}):e[e.length-1].isLeaf=!0},i=[];return n.forEach(e=>{a(i,e,0)}),i}},4881:function(e,t,n){n.d(t,{C7:function(){return a},EA:function(){return s},TD:function(){return o},a9:function(){return i},dJ:function(){return c},mD:function(){return l},oY:function(){return d}});var r=n(6924);function a(e,t){let n=[],r=new Map;e.forEach(e=>{if(e.parentId){let t=r.get(e.parentId);t?r.set(e.parentId,[...t,e]):r.set(e.parentId,[e])}else n.push(e)});let a=(e,n,i)=>{e.push({...n,level:i,isLeaf:!1});let o=r.get(n.tagId);o?t.includes(n.tagId)&&o.forEach(t=>{a(e,t,i+1)}):e[e.length-1].isLeaf=!0},i=[];return n.forEach(e=>{a(i,e,0)}),i}function i(e){let[t,...n]=e.split("/"),r={name:t},a=r;for(;;){let e=n.shift();if(e){let t={name:e};a.link=t,a=t}else break}return r}function o(e,t){var n;let a=t.split("/").filter(Boolean),i=(null===(n=a[0])||void 0===n?void 0:n.toLowerCase())||"",o=a[a.length-1]||"";return e.filter(e=>{var n,l;if(!e.path){r.cM.warn("search failed. tag.path is empty");return}if("/"===t)return!0;let s=e.path.split("/").filter(Boolean);if(1===a.length)return t.endsWith("/")?s.length>1&&(null===(n=s[0])||void 0===n?void 0:n.toLowerCase())===i:s.some(e=>e.toLowerCase().includes(i));if(a.length>1){if(t.endsWith("/")){let e=s.join("/").toLowerCase().startsWith(a.join("/").toLowerCase()+"/"),t=o.toLowerCase()===(null===(l=s[a.length-1])||void 0===l?void 0:l.toLowerCase());return e&&t}{let e=s.slice(0,a.length-1),t=s.slice(a.length-1),n=e.join("").toLowerCase()===a.slice(0,-1).join("").toLowerCase(),r=(t[0]??"").toLowerCase().includes(null==o?void 0:o.toLowerCase());return n&&r}}return!1})}function l(e,t){let n=e.split("$$"),r=t.split("/").filter(Boolean);if(0===r.length)return n.map(e=>`<span style="color: #cdcdcd">${e}</span>`).join('<span style="color: #cdcdcd">/</span>');if(1===r.length){let e=RegExp(r[0],"gi"),t=n.join("/");return e.test(t)?t.replace(e,e=>`<span class="text-brand-theme">${e}</span>`):`<span style="color: #cdcdcd">${t}</span>`}if(t.endsWith("/")){let e=n.join("/"),t=RegExp(r.join("/"),"gi");return t.test(e)?e.replace(t,e=>`<span style="color: var(--color-theme)">${e}</span>`):`<span style="color: #cdcdcd">${e}</span>`}{let e=n.slice(0,r.length-1),t=n.slice(r.length-1),a=r.pop(),i=r.join("/");return e.join("/").replace(RegExp(i,"gi"),e=>`<span style="color: var(--color-theme)">${e}</span>`)+'<span style="color: var(--color-theme)">/</span>'+t.join("/").replace(RegExp(a,"gi"),e=>`<span style="color: var(--color-theme)">${e}</span>`)}}function s(e){return e.split("/").filter(Boolean).join("/")}function c(e){let t=[],n=e;for(;;)if(t.push(n.name),n.link)n=n.link;else break;return t.join("/")}function d(e){let t=e;for(;;){if(!t.link)return t.tagId||t.tagID;t=t.link}}},6606:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(2983);let a=function(e,t){(0,r.useEffect)(()=>{let n=n=>{if(!(!e.current||e.current.contains(n.target)))t()};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[e,t])}},1733:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(2983);let a=function(){let[e,t]=(0,r.useState)({error:null,text:null});return{state:e,copyToClipboard:(0,r.useCallback)(async e=>{var n;if(!(null===(n=navigator)||void 0===n?void 0:n.clipboard))return t({error:Error("Clipboard not supported"),text:null});navigator.clipboard.writeText(e).then(()=>{t({error:null,text:e})},e=>{t({error:e,text:null})})},[])}}},233:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(2983);let a=function(e){let{totalCount:t,itemDataAttr:n,containerQuerySelector:a,isCircle:i=!1,pause:o=!1}=e,[l,s]=(0,r.useState)(0);return(0,r.useEffect)(()=>
1{if(!o)return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)};function e(e){let{key:n}=e;"ArrowUp"===n&&(e.preventDefault(),s(e=>{let n=e-1;return n<0&&(n=i?t-1:0),n})),"ArrowDown"===n&&(e.preventDefault(),s(e=>{let n=e+1;return n>=t&&(n=i?0:t-1),n}))}},[a,i,n,o,t]),(0,r.useEffect)(()=>{if(!o)return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)};function e(e){if(!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&"Enter"===e.key){e.preventDefault();let t=document.querySelector(`[${n}="${l}"]`);if(t){t.click();let e=new PointerEvent("pointerdown",{bubbles:!0,pointerType:"mouse"});t.dispatchEvent(e)}}}},[n,o,l,t]),(0,r.useEffect)(()=>{!function(e){let{index:t,itemDataAttr:n,containerQuerySelector:r,reachEnd:a}=e;if(a&&r){let e=document.querySelector(r);e&&(e.scrollTop=e.scrollHeight);return}if(0===t&&r){let e=document.querySelector(r);e&&(e.scrollTop=0)}let i=document.querySelector(`[${n}="${t}"]`);i&&i.scrollIntoView({block:"nearest"})}({index:l,itemDataAttr:n,containerQuerySelector:a,reachEnd:l===t-1})},[a,n,l,t]),{selectedItemIndex:l,setSelectedItemIndex:s}}},9150:function(e,t,n){n.d(t,{Z:function(){return u}});var r,a=n(6449),i=n(2913),o=n(3229);let l=(0,a.Ue)(e=>({tagPaths:{},setTagPaths:t=>e({tagPaths:t})})),s=e=>(null==e?void 0:e.length)?e.reduce((e,t)=>({...e,[t.tagId]:t.path}),{}):{},c=new i.z(o.E,{queryKey:["tags"]}),d=s(null===(r=c.getCurrentResult().data)||void 0===r?void 0:r.tagList);l.getState().setTagPaths(d),c.subscribe(e=>{var t;let n=s(null===(t=e.data)||void 0===t?void 0:t.tagList);l.getState().setTagPaths(n)});let u=function(){return l(e=>e.tagPaths)}},1655:function(e,t,n){n.d(t,{F3:function(){return d},Jg:function(){return c},Pk:function(){return i},Xc:function(){return s},cZ:function(){return o},jv:function(){return l}});var r=n(5183),a=n(3764);function i(e){return e?e:r.ZP.tc("wf未分类")}function o(e){let t;let n=/(?:!\[.*?\]\(|\[.*?\]\()?(https?:\/\/[^\s)]+)/g,r=[];for(;null!==(t=n.exec(e));)r.push(t[1]);return r.filter(Boolean)}function l(e){return/^(https?:\/\/)?([\w-]+(\.[\w-]+)+)(:[0-9]{1,5}
1)?(\/[\w\-.~:/?#[\]@!$&'()*+,;=%]*)?$/.test(e)}function s(){return void 0!==document.startViewTransition}function c(e){if(!e)return"";let t=a.Y8?a.gW?"https://test.cubox.pro":"https://test.cubox.cc":a.gW?"https://cubox.pro":"https://cubox.cc";return`${t}/c/filters:no_upscale()?imageUrl=${encodeURIComponent(e)}&valid=false`}function d(e,t){return e.reduce((e,n,r)=>{let a=Math.floor(r/t);return!e[a]&&(e[a]=[]),e[a].push(n),e},[])}},7538:function(e,t,n){n.d(t,{ED:function(){return a},Ll:function(){return u},R1:function(){return d},WB:function(){return l},WH:function(){return i},_R:function(){return p},fL:function(){return c},gQ:function(){return o},ks:function(){return s},oy:function(){return h},vb:function(){return r}});let r=200,a="reader",i="readerScrollContainer",o="readerPopMenuContainer",l="readerNoteEditor",s="searchPanelScroll",c="searchInput",d="cardListSearchInListButton",u="tagEditorDropdownPanel",p="cardListTitle",h=288},5174:function(e,t,n){n.d(t,{DC:function(){return f},MK:function(){return m},Vt:function(){return g},kE:function(){return v}});var r=n(6020),a=n.n(r),i=n(6047),o=n.n(i),l=n(6232),s=n.n(l),c=n(6005),d=n.n(c),u=n(2456),p=n.n(u);n(6718);var h=n(5183);a().extend(o()),a().extend(s()),a().extend(d()),a().extend(p()),a().locale((0,h.a1)()?"en-us":"zh-cn");let x="YYYY-MM-DDTHH:mm:ss:SSSZ";function f(e){let t=a()(e,x),n=a()();return t.isAfter(n.subtract(10,"minute"))?"刚刚":t.fromNow()}function g(e){return a()().to(a()(e))}function m(e){let t=a().duration(e-Date.now()).asDays();return t>0?`${~~t} 天后`:t<0?`${-1*~~t} 天前`:void 0}function v(e){return a()(e,x).format((0,h.a1)()?"MMM DD, YYYY":"YYYY年MM月DD日")}},2159:function(e,t,n){n.d(t,{qM:()=>c,Bc:()=>d,ir:()=>v,Qo:()=>u,qG:()=>m,q4:()=>s});var r=n("163");async function a(e){let t=(0,r.X3)(e,1,{upgrade(e){e.createObjectStore("files")}});async function n(e){return(await t).get("files",e)}async function a(e,n){return(await t).put("files",n,e)}async function i(e){return(await t).delete("files",e)}async function o(){return(await t).clear("files")}async function l(){return(await t).getAllKeys("files")}return{db:t,get:n,set:a,remove:i,clear:o,keys:l}}var i=n("1883"),o=n("2983");let l=new i.EventEmitter;async function s(e){let t=await h(e),n={fontFamily:t,file:e,createdAt:new Date().getTime()};return await g(n),await x(n),t.en}async function c(e){f(e)}async function d(e,t){let n={...e,name:t};await x(n)}async function u(e){return(await p()).some(t=>t.file.name===e)}async function p(){let{keys:e,get:t}=await a("fonts"),n=(await e()).map(e=>t(e));return(await Promise.all(n)).filter(Boolean).sort((e,t)=>e.createdAt-t.createdAt)}async function h(e){let t=await Promise.all([n.e("888"),n.e("881")]).then(n.bind(n,2632));return(await t.load(URL.createObjectURL(e))).names.fontFamily}async function x(e){let{get:t,set:n}=await a("fonts"),r=await t(e.fontFamily.en);n(e.fontFamily.en,e),r?l.emit("Add",e):l.emit("Update",e)}async function f(e){let{get:t,remove:n}=await a("fonts"),r=await t(e);n(e),l.emit("Remove",r)}async function g(e){if(!Array.from(document.fonts.values()).map(e=>e.family).includes(e.fontFamily.en)){let t=await e.file.arrayBuffer(),n=new FontFace(e.fontFamily.en,t);await n.load(),document.fonts.add(n)}}function m(e){return e.name||(e.fontFamily.zh??e.fontFamily.en)}function v(e){let[t,n]=(0,o.useState)([]),{shouldLoadFonts:r=!1}=e||{},a=async e=>{let t=await p();n(t),e&&e.shouldLoadFonts&&t.forEach(e=>{g(e)})},i=(0,o.useCallback)(()=>{a(e)},[]);return(0,o.useEffect)(()=>(a(e).then(()=>{l.emit("Loaded")}),l.addListener("Add",a),l.addListener("Update",a),l.addListener("Remove",a),()=>{l.removeListener("Add",a),l.removeListener("Update",a),l.removeListener("Remove",a)}),[]),[t,i]}},2085:function(e,t,n){n.d(t,{Z:function(){return i}});var r=n(7458),a=n(1203);let i=function(e){let{folderName:t,size:n,className:i}=e;return t?(0,r.jsx)(a.PUC,{currentColor:!0,height:n,width:n,className:i}):(0,r.jsx)(a.mLz,{currentColor:!0,height:n,width:n,className:i})}},9759:function(e,t,n){n.d(t,{Z:function(){return o}});var r=n(7458),a=n(670),i=n(2983);let o=function(e){let{data:t,children:n,expandedNodes:o,idAccessor:l=e=>e.id,itemHeight:s=32}=e,c=(0,i.useRef)(null),[d,u]=(0,i.useState)({}),p=(0,a.MG)({count:t.length,getScrollElement:()=>c.current,estimateSize:e=>d[e]||s,overscan:5}),h=e=>t=>{if(t){let n=t.getBoundingClientRect().height;u(t=>t[e]===n?t:{...t,[e]:n})}};(0,i.useEffect)(()=>{p.measure()},[d,p]);let x=p.getVirtualItems();return(0,r.jsx)("div",{children:(0,r.jsx)("div",{ref:c,style:{height:`${p.getTotalSize()}px`,width:"100%",position:"relative"},children:x.map(e=>{let a=t[e.index],i=o.includes(l(a));return(0,r.jsx)("div",{ref:h(e.index),style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${e.start}px)`}
1,children:n({datum:a,index:e.index,expanded:i})},e.key)})})})}},4613:function(e,t,n){n.d(t,{Z:function(){return h}});var r=n(7458),a=n(1277),i=n(1203),o=n(2983),l=n(1287),s=n(9759),c=n(7848),d=n(2085),u=n(1655),p=n(5183);let h=function(e){let{selectedFolderId:t,onSelect:n,expandAll:h}=e,{data:x}=a.hi.queries.useFolders(),{t:f}=(0,p.YB)("folder"),[g,m]=(0,o.useState)(()=>h&&x?x.map(e=>e.groupId):[]),v=(0,o.useMemo)(()=>(0,l.M)(x??[],g),[x,g]),y=Array.isArray(e.padding)?e.padding[1]:e.padding,w=Array.isArray(e.padding)?e.padding[0]:e.padding,[b,j]=(0,o.useState)(!1),[C,N]=(0,o.useState)(""),I=(0,o.useMemo)(()=>C&&x?x.filter(e=>e.groupName.toLowerCase().includes(C.toLowerCase())):[],[x,C]),L=a.hi.mutations.useCreateFolder(),k=(0,o.useRef)(!1),T=(0,o.useRef)(0),[E,S]=(0,o.useState)(!1),Z=(0,o.useMemo)(()=>!!x&&!!C&&!x.find(e=>e.groupName===C),[x,C]),A=(0,o.useCallback)(async()=>{let e=Date.now();if(!!C&&!k.current&&!E){if(!(e-T.current<500)){T.current=e,k.current=!0,S(!0);try{let e=await L.mutateAsync({groupName:C});n(e)}catch(e){i.Amu.error(f("cj创建文件夹失败"))}finally{setTimeout(()=>{k.current=!1,S(!1)},500)}}}},[C,L,n,f,E]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{style:{paddingTop:w,paddingLeft:y,paddingRight:y},children:(0,r.jsxs)("div",{className:(0,c.Z)("mb-10px h-36px flex items-center gap-6px border-1px rounded-6px bg-bg-card px-14px transition-all",b?"border-brand-theme shadow-[--shadow]":"border-gray-3 "),style:{"--shadow":"0px 0px 0px 2px rgba(44, 70, 241, 0.15)"},children:[(0,r.jsx)(i.PUC,{height:18,width:18,currentColor:!0,className:"text-content-normal"}),(0,r.jsx)("input",{className:"flex-grow-1 bg-transparent text-14px text-content-heavy font-400 line-height-22px caret-brand-theme placeholder-text-content-light",placeholder:f("ss搜索或创建"),onChange:e=>{N(e.target.value)},onFocus:()=>j(!0),onBlur:()=>j(!1),onKeyDown:e=>{"Enter"===e.key&&Z&&A()}}),(0,r.jsx)(i.jVj,{height:18,width:18,currentColor:!0,className:"text-content-normal"})]})}),(0,r.jsxs)(i.xrM,{height:`calc(100% - 46px - ${w||0}px)`,transparentBg:!0,style:{paddingRight:y,paddingLeft:y,paddingBottom:w},children:[C&&(0,r.jsxs)("div",{children:[Z&&(0,r.jsxs)("div",{className:(0,c.Z)("h-32px w-full flex items-center gap-6px rounded-4px px-14px text-14px text-content-normal font-400 line-height-22px",E?"cursor-not-allowed opacity-50":"cursor-pointer hover:bg-gray-2"),onClick:A,children:[(0,r.jsx)(i.etJ,{height:18,width:18,currentColor:!0}),(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("span",{className:"flex-shrink-0",children:f("cj创建")}),(0,r.jsxs)("span",{className:"line-clamp-1 break-words text-brand-theme",children:["\xa0",C,"\xa0"]}),(0,r.jsx)("span",{className:"flex-shrink-0",children:f("by并移入")})]})]}),I.map(e=>(0,r.jsxs)("div",{className:"h-32px w-full flex flex-grow-1 cursor-pointer items-center gap-6px rounded-4px px-14px text-14px text-content-normal font-400 line-height-22px hover:bg-gray-2",onClick:()=>n(e),children:[(0,r.jsx)(i.PUC,{height:18,width:18,currentColor:!0}),(0,r.jsx)("span",{className:"line-clamp-1 break-words",dangerouslySetInnerHTML:{__html:e.groupName.replace(C,`<span class="text-brand-theme">${C}</span>`)}})]},e.groupId))]}),!C&&(0,r.jsx)(s.Z,{data:v,expandedNodes:g,idAccessor:e=>e.groupId,itemHeight:32,children:e=>{let{datum:a,index:o,expanded:l}=e,s=a.groupId===t;return(0,r.jsxs)("div",{className:"position-absolute h-32px w-full flex cursor-pointer items-center rounded-4px hover:bg-gray-2",style:{paddingLeft:10*a.level+2,paddingRight:14},onClick:()=>n(a),children:[(0,r.jsx)("button",{className:"h-full flex items-center text-content-light transition-colors hover:text-content-normal",onClick:e=>{e.stopPropagation(),l?m(g.filter(e=>e!==a.groupId)):m([...g,a.groupId])},children:(0,r.jsx)(i.Cuf,{width:12,currentColor:!0,style:{opacity:a.isLeaf?"0":"100",transform:l?"rotate(90deg)":"rotate(0)"}})}),(0,r.jsxs)("div",{className:"flex items-center gap-6px",style:{width:"calc(100% - 12px)"},children:[(0,r.jsx)(d.Z,{size:18,folderName:a.groupName,className:(0,c.Z)("flex-shrink-0",s?"text-brand-theme":"text-content-normal")}
1),(0,r.jsx)("div",{className:(0,c.Z)("flex-grow-1 text-14px  font-400 line-height-22px line-clamp-1",s?"text-brand-theme":"text-content-heavy"),children:(0,u.Pk)(a.groupName)}),(0,r.jsx)("div",{className:(0,c.Z)("flex-shrink-0 text-12px  font-400 line-height-20px",s?"text-brand-theme":"text-content-light"),children:a.size})]})]})}})]})]})}},9211:function(e,t,n){n.d(t,{Fx:()=>m,mH:()=>f,SP:()=>u,r6:()=>y,zx:()=>x,iz:()=>h,II:()=>d,V1:()=>g,NZ:()=>p,TB:()=>v});var r=n("7458");let a={inputContainer:"inputContainer-Re1zc1",input:"input-g12VIv",copy:"copy-kaKL4z",modalInput:"modalInput-q2trRU",modalInputContainer:"modalInputContainer-TzXYPd",modalInputInput:"modalInputInput-QBAZcX",alertText:"alertText-Yew1aC",modalInputLabel:"modalInputLabel-ss7Rmn",showHidePassword:"showHidePassword-SkAHMh",sectionTitle:"sectionTitle-xSLUB3",sectionTitleText:"sectionTitleText-oDSQd3",helpIcon:"helpIcon-JLADrF",divider:"divider-AWzKyg",button:"button-rsGCmh",pageTitle:"pageTitle-bI3kbC",modal:"modal-OKdtOi",modalTitle:"modalTitle-lcXrPo"};var i=n("1203"),o=n("7848"),l=n("2983"),s=n("1733"),c=n("5183");function d(e){let{value:t,defaultValue:n,disabled:o,placeholder:l,style:d,enableCopy:u}=e,{copyToClipboard:p}=(0,s.Z)(),{tc:h}=(0,c.YB)("settings/integrations");return(0,r.jsxs)(i.Kqy,{className:a.inputContainer,children:[(0,r.jsx)("input",{value:t,className:a.input,disabled:o,defaultValue:n,placeholder:l,style:d}),u&&(0,r.jsxs)("button",{className:a.copy,onClick:()=>{(n||t)&&(p(n||t||""),i.Amu.success(h("yf已复制")))},children:[(0,r.jsx)(i.rjs,{height:18,width:18,currentColor:!0}),(0,r.jsx)("span",{style:{marginLeft:"4px"},children:h("fz复制")})]})]})}function u(e){var t;let{defaultValue:n,label:o,disabled:s,placeholder:c,type:d="text",suffix:u,onChange:p,onFocus:h,onBlur:x,helpTexts:f,maxLength:g}=e,[m,v]=(0,l.useState)(!1),y=(0,l.useRef)(null),[w,b]=(0,l.useState)(!1),j=null==f?void 0:null===(t=f.find(e=>e.show&&w))||void 0===t?void 0:t.text;return(0,r.jsxs)("div",{className:a.modalInput,children:[o&&(0,r.jsx)("div",{className:a.modalInputLabel,children:o}),(0,r.jsxs)("div",{className:a.modalInputContainer,"data-status":j&&"alert",onClick:()=>{var e;null==y||null===(e=y.current)||void 0===e||e.focus()},children:[(0,r.jsx)("input",{ref:y,type:m?"text":d,className:a.modalInputInput,disabled:s,defaultValue:n,placeholder:c,maxLength:g,onChange:e=>{var t;let n=(null==e?void 0:null===(t=e.target)||void 0===t?void 0:t.value)||"";g&&n.length>g&&(n=n.slice(0,g),e.target.value=n),b(!0),null==p||p(n)},onFocus:h,onBlur:x}),"password"===d&&(0,r.jsxs)("button",{className:a.showHidePassword,onClick:()=>{v(!m)},children:[!m&&(0,r.jsx)(i.lLW,{height:18,width:18,currentColor:!0}),m&&(0,r.jsx)(i.bEM,{height:18,width:18,currentColor:!0})]}),u]}),j&&(0,r.jsx)("div",{className:a.alertText,children:j})]})}function p(e){let{children:t,helpText:n}=e;return(0,r.jsxs)("div",{className:a.sectionTitle,children:[(0,r.jsx)("div",{className:a.sectionTitleText,children:t}),n&&(0,r.jsx)(i.ua7,{text:n,side:"bottom",children:(0,r.jsx)("button",{className:a.helpIcon,children:(0,r.jsx)(i.T08,{height:18,width:18,currentColor:!0})})})]})}function h(){return(0,r.jsx)("div",{className:(0,o.Z)(a.divider,"border-gray-3")})}function x(e){let{variant:t="ghost",disabled:n,children:i,onClick:l,className:s,style:c,minWidth:d,px:u,py:p,h,w:x,fontWeight:f,flexGrow:g}=e;return(0,r.jsx)("button",{className:(0,o.Z)(a.button,s),"data-variant":t,onClick:l,disabled:n,style:{minWidth:d,paddingRight:u,paddingLeft:u,paddingTop:p,paddingBottom:p,height:h,width:x,fontWeight:f,flexGrow:g,...c},children:i})}function f(e){let{variant:t="ghost",children:n,onClick:a,className:i,disabled:o}=e;return(0,r.jsx)(x,{className:i,variant:t,onClick:a,px:"0",py:"0",h:"40px",fontWeight:"500",flexGrow:1,disabled:o,children:n})}function g(e){return(0,r.jsx)("div",{className:a.pageTitle,children:e.children})}function m(e){let{t}=(0,c.YB)("settings");return(0,r.jsxs)("a",{href:e.link,target:"_blank",rel:"noreferrer",className:"h-26px w-fit flex cursor-pointer items-center gap-4px border-1px border-gray-4 rounded-4px px-8px text-12px text-content-normal font-500 transition-colors hover:bg-gray-2",children:[(0,r.jsx)(i.T08,{currentColor:!0,height:14,width:14}),t("xx详细了解")]})}function v(e){let{open:t,onOpenChange:n,children:l,className:s,style:c}=e;return(0,r.jsx)(i.u_l,{open:t,onOpenChange:n,className:(0,o.Z)(a.modal,s,"border border-transparent dark:border-gray-2"),style:c,children:l})}function y(e){let{children:t}=e;return(0,r.jsx)("div",{className:a.modalTitle,children:t})}},1306:function(e,t,n){n.d(t,{Z:()=>y});var r=n("7458"),a=n("1203"),i=n("7848"),o=n("2983"),l=n("1277"),s=n("4881"),c=n("9759"),d=n("2721"),u=n("233"),p=n("7538"),h=n("9150"),x=n("5183");let f=function(e){let{selectedTags:t,onAddTag:n,searchTerm:f,clearSearchTerm:g,maxHeight:m}=e,{data:v}=l.hi.queries.useTags(),{t:y,tc:w,tn:b}=(0,x.YB)("tag");function j(e){g(),n(e)}let{data:C}=l.hi.queries.useRecentTags(),N=(0,o.useMemo)(()=>C?null==C?void 0:C.map(e=>{let t=null==v?void 0:v.tagList.find(t=>t.tagId===e.tagId);return t?t:null}
1).filter(Boolean):[],[C,null==v?void 0:v.tagList]),[I,L]=(0,o.useState)([]),k=(0,o.useMemo)(()=>(0,s.C7)((null==v?void 0:v.tagList)??[],I),[v,I]),T=(0,h.Z)(),E=(0,o.useCallback)(e=>{let t=(0,s.EA)(e);return!!Object.values(T).find(e=>e===t)},[T]),S=(0,o.useMemo)(()=>v&&f?(0,s.TD)(v.tagList,f).map(e=>({...e})).filter(e=>!t.find(t=>t.tagId===e.tagId)):[],[v,f,t]),Z=(0,o.useMemo)(()=>f.split("/").filter(Boolean).length>0&&!E(f)&&!t.some(e=>e.path===(0,s.EA)(f)),[E,f,t]),A=Z?1:0,{selectedItemIndex:M,setSelectedItemIndex:R}=(0,u.Z)({totalCount:f?S.length+A:k.length+N.length,itemDataAttr:"data-tag-index",containerQuerySelector:"#"+p.Ll,isCircle:!0});return(0,o.useEffect)(()=>{f&&R(0)},[f,R]),(0,r.jsxs)(a.xrM,{className:"overflow-y-auto px-4px",style:{maxHeight:m||"348px"},id:p.Ll,children:[f&&(0,r.jsxs)("div",{className:"py-4px",children:[Z&&(0,r.jsxs)("div",{className:(0,i.Z)("h-32px flex cursor-pointer select-none items-center rounded-4px px-12px text-14px text-content-heavy font-400 line-height-22px",0===M?"bg-brand-theme-15":"hover:bg-gray-2"),onClick:function(){let e=(0,s.EA)(f);if(null==t?void 0:t.some(t=>t.path===e)){a.Amu.error(y("yy已有相同标签"));return}n({path:e,tagId:"new-"+(0,d.x0)(),parentId:(0,d.x0)(),name:e.split("/").at(-1)||"",rank:0,createTime:"",updateTime:"",state:0,seq:0}),g()},"data-tag-index":0,children:[(0,r.jsxs)("span",{className:"flex-shrink-0",children:[y("cj创建"),' "']}),(0,r.jsx)("span",{className:"line-clamp-1 break-words text-brand-theme",children:(0,s.EA)(f)}),(0,r.jsx)("span",{className:"flex-shrink-0",children:'"'})]}),S.map((e,t)=>{let a=t+A,o=M===a;return(0,r.jsx)("div",{className:(0,i.Z)("h-32px cursor-pointer flex text-nowrap items-center select-none rounded-4px pl-12px pr-2px text-14px text-content-heavy font-400 line-height-22px",o?"bg-brand-theme-15":"hover:bg-gray-2"),dangerouslySetInnerHTML:{__html:(0,s.mD)(e.path,f)},"data-tag-index":a,onClick:()=>{let t=null==v?void 0:v.tagList.find(t=>t.tagId===e.tagId);if(t){var r;r=t,g(),n(r)}}},e.tagId)})]}),!f&&(0,r.jsxs)(r.Fragment,{children:[!!(null==N?void 0:N.length)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"mb-2px mt-8px px-14px text-12px text-content-normal font-400 line-height-20px",children:y("zj最近使用的")}),null==N?void 0:N.map((e,a)=>{let o=t.find(t=>t.tagId===e.tagId),l=M===a;return(0,r.jsx)("div",{className:(0,i.Z)("h-32px w-full flex cursor-pointer select-none items-center rounded-4px px-14px text-14px text-content-heavy font-400 line-height-22px",o&&"!text-content-light",l?"bg-brand-theme-15":"hover:bg-gray-2"),onClick:()=>{if(!o){var t;t=e,g(),n(t)}},"data-tag-index":a,children:(0,r.jsx)("span",{className:"line-clamp-1",children:e.path})},e.tagId)})]}),(0,r.jsx)("div",{className:"mb-2px mt-8px px-14px text-12px text-content-normal font-400 line-height-20px",children:y("sy所有标签")}),(0,r.jsx)("div",{className:"mb-4px",children:(0,r.jsx)(c.Z,{data:k,expandedNodes:I,idAccessor:e=>e.tagId,itemHeight:32,children:e=>{let{datum:o,index:l,expanded:s}=e,c=t.find(e=>e.tagId===o.tagId),d=l+N.length,u=M===d;return(0,r.jsxs)("div",{className:(0,i.Z)("h-32px flex w-full pos-absolute cursor-pointer select-none items-center  rounded-4px text-14px text-content-heavy font-400 line-height-22px",c&&"!text-content-light",u?"bg-brand-theme-15":"hover:bg-gray-2"),style:{paddingLeft:10*o.level+2,paddingRight:2},onClick:()=>{if(!c){var e;e=o,g(),n(e)}},"data-tag-index":d,children:[(0,r.jsx)("button",{className:"h-full flex items-center text-content-light transition-colors hover:text-content-normal",onClick:e=>{e.stopPropagation(),s?L(I.filter(e=>e!==o.tagId)):L([...I,o.tagId])},children:(0,r.jsx)(a.Cuf,{width:12,currentColor:!0,style:{opacity:o.isLeaf?"0":"100",transform:s?"rotate(90deg)":"rotate(0)"}})}),(0,r.jsx)("div",{className:"line-clamp-1",children:o.name})]})}})})]})]})};var g=n("6606"),m=n("2508"),v=n("3651");let y=function(e){let{variant:t="hover",tags:n,setTags:l,onBlur:s,alwayShowBorder:c,onFocus:d,autoFocus:u}=e,[p,h]=(0,o.useState)(!1),[y,w]=(0,o.useState)(""),[b,j]=(0,o.useState)(!1),C=(0,o.useRef)(null),N=(0,o.useRef)(null),{t:I}=(0,x.YB)("tag");function L(e){l(n.filter(t=>t.tagId!==e))}function k(e){l([...n,e])}function T(){var e;
1w(""),(null===(e=N.current)||void 0===e?void 0:e.value)&&(N.current.value="")}(0,o.useEffect)(()=>{if(!u)return;let e=setTimeout(()=>{N.current&&(N.current.focus(),h(!0))},50);return()=>clearTimeout(e)},[u]),(0,g.Z)(C,()=>{p&&(h(!1),s&&(s(),T()))});let E="hover"===t?(0,i.Z)("px-8px py-6px flex flex-wrap gap-6px border-1px  rounded-6px transition-all position-relative select-none",p?"border-brand-theme shadow-[--shadow]":(0,i.Z)(" hover:border-gray-3",c?"border-gray-4":"border-transparent")):(0,i.Z)("px-8px py-6px flex flex-wrap gap-6px border-1px  rounded-6px transition-all position-relative select-none",p?"border-brand-theme shadow-[--shadow]":"border-gray-4 hover:border-gray-3"),S=(0,o.useMemo)(()=>{if(!C.current||!p)return"auto";let e=C.current.getBoundingClientRect(),t=window.innerHeight-e.bottom-5-10;return t>400&&(t=400),t>=50?`${t}px`:"auto"},[p]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:E,onClick:()=>{h(!0),setTimeout(()=>{var e;null===(e=N.current)||void 0===e||e.focus()},50)},style:{"--shadow":"0px 0px 0px 2px rgba(44, 70, 241, 0.15)",..."inline"===t?{maxHeight:"126px",overflowY:"auto"}:{}},ref:C,children:[n.sort((e,t)=>e.seq-t.seq).map((e,t)=>{let o=t===n.length-1&&b;return(0,r.jsxs)("div",{className:(0,i.Z)("h-24px inline-flex cursor-pointer items-center gap-4px rounded-4px px-6px text-12px font-400 line-height-20px transition-colors",o?"bg-brand-theme-15 text-brand-theme":"bg-gray-2 hover:bg-gray-4 text-content-heavy"),onClick:()=>L(e.tagId),children:[(0,r.jsx)("span",{className:"line-clamp-1",children:e.path}),(0,r.jsx)("button",{className:(0,i.Z)("transition-colors",o?"text-brand-theme-30 hover:text-brand-theme":"text-content-light hover:text-content-heavy"),children:(0,r.jsx)(a.Mx,{height:12,width:12,currentColor:!0})})]},e.tagId)}),(0,r.jsx)("input",{ref:N,className:(0,i.Z)("cursor-default h-24px bg-transparent text-12px line-height-20px text-content-heavy font-400 caret-brand-theme placeholder-text-content-light",!p&&n.length&&"hidden"),style:{width:"56px"},placeholder:n.length?"":I("tj添加标签"),onChange:e=>{w(e.target.value);let t=e.target.scrollWidth>280?280:e.target.scrollWidth;e.target.style.width="auto",e.target.style.width=`${t}px`},onKeyDown:e=>{if("Backspace"===e.key&&n.length){if(b){let e=n[n.length-1];e&&L(e.tagId),j(!1)}else!y&&j(!0)}},onFocus:d}),"hover"===t&&(0,r.jsx)(m.M,{children:p&&(0,r.jsx)(v.E.div,{variants:{hidden:{opacity:0,y:-4},visible:{opacity:1,y:0}},initial:"hidden",animate:"visible",exit:"hidden",className:"pos-absolute left-0 right-0 overflow-hidden rounded-8px bg-bg-card shadow-md border border-transparent dark:border-gray-2",style:{top:"calc(100% + 5px)",maxHeight:S},children:(0,r.jsx)(f,{selectedTags:n,searchTerm:y,onAddTag:k,clearSearchTerm:T,maxHeight:S})})})]}),"inline"===t&&(0,r.jsx)("div",{className:"mt-10px",children:(0,r.jsx)(f,{selectedTags:n,searchTerm:y,onAddTag:k,clearSearchTerm:T})})]})}}}]);

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.