PageSourceSearch

https://www.tokenworks.ai/assets/Security-Bi4ljpYc.js

js tokenworks.ai collected 2026-10-05 15:54:57 UTC 9,794 bytes, 1 lines download raw bytes

1import{r as e,j as t}from"./react-vendor-3j0hp6R8.js";import{ax as s}from"./vendor-CQdPkgkm.js";import{P as n}from"./components-Cn-udBT4.js";import{Q as r,F as a}from"./icons-vendor-Ct9oFFFD.js";import"./router-vendor-Dg-IODGf.js";import"./charts-vendor-DRVidz11.js";import"./guides-general-CJN1k0im.js";const i={notFound:{kind:"not-found",title:"Security page not found",message:"The requested security page is unavailable or may have moved.",retryable:!1},unavailable:{kind:"unavailable",title:"Security page temporarily unavailable",message:"The security documentation service is temporarily unavailable. Please try again.",retryable:!0},request:{kind:"request",title:"Security page could not be loaded",message:"The service returned an unexpected response. Please try again.",retryable:!0},network:{kind:"network",title:"Connection problem",message:"We could not reach the security documentation service. Check your connection and try again.",retryable:!0}};function o({error:e,onRetry:s}){return t.jsxs("div",{className:"error-state",role:"alert","data-error-kind":e.kind,children:[t.jsx("h1",{children:e.title}),t.jsx("p",{children:e.message}),t.jsxs("div",{className:"trust-error-actions",children:[e.retryable?t.jsx("button",{type:"button",className:"btn-primary",onClick:s,children:"Try again"}):t.jsx("a",{className:"btn-primary",href:"/",children:"Go to home page"}),t.jsx("a",{className:"btn-secondary",href:"mailto:[email protected]?subject=TokenWorks%20Security%20Question",children:"Contact security"})]})]})}function c(e){return Array.from(e).some(e=>{const t=e.codePointAt(0);return t<=31||127===t})}function l(e){let t=e;for(let s=0;s<3;s+=1)try{const e=decodeURIComponent(t);if(e===t)break;t=e}catch{break}return t}function d(e){if(!e||e!==e.trim()||e.length>2048)return!1;const t=l(e);if(c(t)||t.includes("\\"))return!1;if(e.startsWith("#"))return e.length>1;if(e.startsWith("/"))return!e.startsWith("//")&&!t.startsWith("//")&&!t.split(/[/?#]/).some(e=>".."===e);try{const t=new URL(e);return"https:"===t.protocol&&!t.username&&!t.password}catch{return!1}}function u(e){return String(e||"").normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"section"}function h(e){if("string"!=typeof e||!e.startsWith("#")||e.length<=1)return null;const t=l(e.slice(1));if(!t||c(t))return null;const s=document.getElementById(u(t));return s?.matches(".trust-page .page-content h2, .trust-page .page-content h3, .trust-page .page-content h4")?s:null}function p(e){const t=h(e);return!!t&&(t.scrollIntoView({block:"start"}),t.focus({preventScroll:!0}),!0)}function m(e){const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("class","trust-external-link-icon"),t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none"),t.setAttribute("stroke","currentColor"),t.setAttribute("stroke-width","2"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round"),t.setAttribute("aria-hidden","true");for(const n of["M15 3h6v6","M10 14 21 3","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"]){const e=document.createElementNS("http://www.w3.org/2000/svg","path");e.setAttribute("d",n),t.append(e)}const s=document.createElement("span");s.className="sr-only",s.textContent=" (opens in a new tab)",e.append(" ",t,s)}const g=({slug:c})=>{const g=c,f="security"===g?"/security":null,j="security"===g?{title:"Security",description:"Review TokenWorks security practices, controls, and operational safeguards for platform data and access."}:{title:"Trust",description:"Review TokenWorks trust, security, and governance documentation for policy transparency."},[x,b]=e.useState(null),[v,y]=e.useState(!0),[w,N]=e.useState(null),[k,A]=e.useState("");e.useEffect(()=>{S()},[g]),e.useEffect(()=>{if(!x)return;const e=()=>p(window.location.hash),t=window.setTimeout(e,0);return window.addEventListener("hashchange",e),()=>{window.clearTimeout(t),window.removeEventListener("hashchange",e)}},[x]);const $=e=>{const t=e.target.closest?.('a[href^="#"]');if(!t||!e.currentTarget.contains(t))return;const s=t.getAttribute("href")||"";h(s)&&(e.preventDefault(),window.location.hash!==s&&window.history.pushState(null,"",`${window.location.pathname}${window.location.search}${s}`),p(s))},S=async()=>{const e=Boolean(w);try{y(!0),N(null),A("");const t=await fetch(`/api/trust/page/${g}`);if(!t.ok)return void(404===t.status?N(i.notFound):503===t.status?N(i.unavailable):N(i.request));const s=await t.json();b(s),e&&A("Security page loaded.")}
1catch(t){N(i.network)}finally{y(!1)}},T=e=>{if(!e)return"Not available";try{return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}catch(t){return"Invalid date"}};if(v)return t.jsxs("div",{className:"trust-page",children:[t.jsx(n,{title:j.title,description:j.description,canonicalPath:f}),t.jsx("div",{className:"container",children:t.jsxs("div",{className:"loading-state",role:"status","aria-live":"polite",children:[t.jsx("div",{className:"loading-spinner","aria-hidden":"true"}),t.jsx("p",{children:"Loading..."})]})})]});if(w)return t.jsxs("div",{className:"trust-page",children:[t.jsx(n,{title:j.title,description:j.description,canonicalPath:f,robots:"noindex,follow"}),t.jsx("div",{className:"container",children:t.jsx(o,{error:w,onRetry:S})})]});if(!x)return t.jsxs("div",{className:"trust-page",children:[t.jsx(n,{title:j.title,description:j.description,canonicalPath:f,robots:"noindex,follow"}),t.jsx("div",{className:"container",children:t.jsx(o,{error:i.notFound,onRetry:S})})]});const L=function(e){if(!e)return{html:"",sections:[]};const t=e=>e.replace(/\*\*([^*\n]+)\*\*/gim,"<strong>$1</strong>").replace(/\*([^*\n]+)\*/gim,"<em>$1</em>").replace(/\[([^\]]*)\]\(([^)]*)\)/gim,'<a href="$2">$1</a>'),n=[];let r=[],a=null;const i=()=>{r.length&&(n.push(`<p>${t(r.join("\n")).replace(/\n/g,"<br>")}</p>`),r=[])},o=()=>{a&&(n.push(`<${a.tag}>${a.items.map(e=>`<li>${t(e)}</li>`).join("")}</${a.tag}>`),a=null)};for(const s of e.split(/\r?\n/)){const e=s.match(/^(#{1,3}) (.*)$/),c=s.match(/^\s*[-+*]\s+(.+)$/),l=s.match(/^\s*\d+\.\s+(.+)$/);if(e){i(),o();const s=e[1].length+1;n.push(`<h${s}>${t(e[2])}</h${s}>`)}else if(c||l){i();const e=c?"ul":"ol";a&&a.tag!==e&&o(),a||={tag:e,items:[]},a.items.push((c||l)[1])}else s.trim()?(o(),r.push(s)):(i(),o())}i(),o();const c=n.join(""),h=s.sanitize(c,{ALLOWED_TAGS:["a","br","em","h2","h3","h4","li","ol","p","strong","ul"],ALLOWED_ATTR:["href"]}),p=document.createElement("template");p.innerHTML=h;const g=new Set,f=[];for(const s of p.content.querySelectorAll("h2, h3, h4")){const e=u(s.textContent);let t=e,n=2;for(;g.has(t);)t=`${e}-${n}`,n+=1;s.id=t,s.tabIndex=-1,g.add(t),"H2"===s.tagName&&f.push({id:t,label:s.textContent.trim()||"Untitled section"})}for(const s of p.content.querySelectorAll("a")){const e=s.getAttribute("href")||"";if(d(e))if(e.startsWith("#")){const t=u(l(e.slice(1)));if(!g.has(t)){s.replaceWith(...s.childNodes);continue}s.setAttribute("href",`#${t}`),s.removeAttribute("target"),s.removeAttribute("rel")}else if(/^https:/i.test(e)){const t=new URL(e);s.setAttribute("href",t.toString()),s.setAttribute("target","_blank"),s.setAttribute("rel","noopener noreferrer"),m(s)}else s.removeAttribute("target"),s.removeAttribute("rel");else s.replaceWith(...s.childNodes)}return{html:p.innerHTML,sections:f}}(x.content);return t.jsxs("div",{className:"trust-page",children:[t.jsx(n,{title:x?.title||j.title,description:j.description,canonicalPath:f}),t.jsxs("div",{className:"container",children:[k?t.jsx("p",{className:"sr-only",role:"status","aria-live":"polite",children:k}):null,t.jsx("header",{className:"page-header",children:t.jsx("h1",{children:x.title})}),t.jsxs("dl",{className:"trust-evidence-strip","aria-label":"Document evidence",children:[t.jsxs("div",{children:[t.jsx("dt",{children:"Version"}),t.jsx("dd",{children:x.version})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Last updated"}),t.jsx("dd",{children:T(x.updated_at)})]}),t.jsxs("div",{children:[t.jsx("dt",{children:"Publication status"}),t.jsx("dd",{children:"published"===x.status?"Published":"Draft"})]})]}),t.jsx("p",{className:"trust-assurance-note",children:"Publication indicates that TokenWorks has released this content; it does not represent an independent security audit."}),L.sections.length>0?t.jsxs("nav",{className:"trust-page-nav","aria-label":"On this page",onClick:$,children:[t.jsx("h2",{children:"On this page"}),t.jsx("ul",{children:L.sections.map(e=>t.jsx("li",{children:t.jsx("a",{href:`#${e.id}`,children:e.label})},e.id))})]}):null,t.jsx("article",{className:"page-content","aria-label":`${x.title} content`,onClick:$,children:t.jsx("div",{dangerouslySetInnerHTML:{__html:L.html}})}),t.jsxs("footer",{className:"page-footer",children:[t.jsxs("div",{className:"page-status",children:[t.jsx("span",{className:`status-badge status-${x.status}`,children:"published"===x.status?t.jsxs(t.Fragment,{children:[t.jsx(r,{className:"status-icon","aria-hidden":"true"}),"Published"]}):t.jsxs(t.Fragment,{children:[t.jsx(a,{className:"status-icon","aria-hidden":"true"}),"Draft"]})}),x.published_at&&t.jsxs("span",{className:"published-date",children:["Published: ",T(x.published_at)]})]}),x.last_change&&t.jsxs("div",{className:"last-change",children:[t.jsxs("p",{className:"change-summary",children:[t.jsx("strong",{children:"Latest change:"})," ",x.last_change.summary||"Content updated"]}),t.jsx("p",{className:"change-date",children:T(x.last_change.created_at)})]}),t.jsx("div",{className:"contact-info",children:t.jsxs("p",{children:["Questions about this page? Contact us at"," ",t.jsx("a",{href:"mailto:[email protected]",children:"[email protected]"})]})})]})]})]})},f=()=>t.jsx(g,{slug:"security"});export{f as default};

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.