1import{g as re}from"./_commonjsHelpers-CqkleIqs.js";import{b as ne,r as i}from"./vendor-react-CtnGRA_e.js";import{r as ae}from"./index-BWj05HMJ.js";var L={exports:{}},F={};var P;function oe(){if(P)return F;P=1;var e=ne(),t=ae();function r(d,c){return d===c&&(d!==0||1/d===1/c)||d!==d&&c!==c}var n=typeof Object.is=="function"?Object.is:r,l=t.useSyncExternalStore,s=e.useRef,b=e.useEffect,a=e.useMemo,m=e.useDebugValue;return F.useSyncExternalStoreWithSelector=function(d,c,f,p,$){var w=s(null);if(w.current===null){var y={hasValue:!1,value:null};w.current=y}else y=w.current;w=a(function(){function h(v){if(!x){if(x=!0,E=v,v=p(v),$!==void 0&&y.hasValue){var W=y.value;if($(W,v))return O=W}return O=v}if(W=O,n(E,v))return W;var R=p(v);return $!==void 0&&$(W,R)?(E=v,W):(E=v,O=R)}var x=!1,E,O,j=f===void 0?null:f;return[function(){return h(c())},j===null?void 0:function(){return h(j())}]},[c,f,p,$]);var S=l(d,w[0],w[1]);return b(function(){y.hasValue=!0,y.value=S},[S]),m(S),S},F}var M;function ue(){return M||(M=1,L.exports=oe()),L.exports}var ie=ue();const Le=re(ie);function X(e,t,r){if(!e)return;if(r(e)===!0)return e;let n=t?e.return:e.child;for(;n;){const l=X(n,t,r);if(l)return l;n=t?null:n.sibling}}function G(e){try{return Object.defineProperties(e,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return e}}const A=G(i.createContext(null));class se extends i.Component{render(){return i.createElement(A.Provider,{value:this._reactInternals},this.props.children)}}function le(){const e=i.useContext(A);if(e===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=i.useId();return i.useMemo(()=>{for(const r of[e,e?.alternate]){if(!r)continue;const n=X(r,!1,l=>{let s=l.memoizedState;for(;s;){if(s.memoizedState===t)return!0;s=s.next}});if(n)return n}},[e,t])}const ce=Symbol.for("react.context"),fe=e=>e!==null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===ce;function he(){const e=le(),[t]=i.useState(()=>new Map);t.clear();let r=e;for(;r;){const n=r.type;fe(n)&&n!==A&&!t.has(n)&&t.set(n,i.use(G(n))),r=r.return}return t}function Fe(){const e=he();return i.useMemo(()=>Array.from(e.keys()).reduce((t,r)=>n=>i.createElement(t,null,i.createElement(r.Provider,{...n,value:e.get(r)})),t=>i.createElement(se,{...t})),[e])}function D(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}function _e({debounce:e,scroll:t,polyfill:r,offsetSize:n}={debounce:0,scroll:!1,offsetSize:!1}){const l=r||(typeof window>"u"?class{}:window.ResizeObserver);if(!l)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,b]=i.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),a=i.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),m=e?typeof e=="number"?e:e.scroll:null,d=e?typeof e=="number"?e:e.resize:null,c=i.useRef(!1);i.useEffect(()=>(c.current=!0,()=>{c.current=!1}));const[f,p,$]=i.useMemo(()=>{const h=()=>{if(!a.current.element)return;const{left:x,top:E,width:O,height:j,bottom:v,right:W,x:R,y:te}=a.current.element.getBoundingClientRect(),z={left:x,top:E,width:O,height:j,bottom:v,right:W,x:R,y:te};a.current.element instanceof HTMLElement&&n&&(z.height=a.current.element.offsetHeight,z.width=a.current.element.offsetWidth),Object.freeze(z),c.current&&!me(a.current.lastBounds,z)&&b(a.current.lastBounds=z)};return[h,d?D(h,d):h,m?D(h,m):h]},[b,n,m,d]);function w(){a.current.scrollContainers&&(a.current.scrollContainers.forEach(h=>h.removeEventListener("scroll",$,!0)),a.current.scrollContainers=null),a.current.resizeObserver&&(a.current.resizeObserver.disconnect(),a.current.resizeObserver=null),a.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",a.current.orientationHandler))}function y(){a.current.element&&(a.current.resizeObserver=new l($),a.current.resizeObserver.observe(a.current.element),t&&a.current.scrollC
vendor: 4,381 bytes, line 1
1ontainers&&a.current.scrollContainers.forEach(h=>h.addEventListener("scroll",$,{capture:!0,passive:!0})),a.current.orientationHandler=()=>{$()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",a.current.orientationHandler))}const S=h=>{!h||h===a.current.element||(w(),a.current.element=h,a.current.scrollContainers=U(h),y())};return $e($,!!t),de(p),i.useEffect(()=>{w(),y()},[t,$,p]),i.useEffect(()=>w,[]),[S,s,f]}function de(e){i.useEffect(()=>{const t=e;return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[e])}function $e(e,t){i.useEffect(()=>{if(t){const r=e;return window.addEventListener("scroll",r,{capture:!0,passive:!0}),()=>{window.removeEventListener("scroll",r,!0)}}},[e,t])}function U(e){const t=[];if(!e||e===document.body)return t;const{overflow:r,overflowX:n,overflowY:l}=window.getComputedStyle(e);return[r,n,l].some(s=>s==="auto"||s==="scroll")&&t.push(e),[...t,...U(e.parentElement)]}const pe=["x","y","top","bottom","left","right","width","height"],me=(e,t)=>pe.every(r=>e[r]===t[r]);function H(){return H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},H.apply(null,arguments)}function u(e){return e&&e.__esModule?e.default:e}var o={};o=JSON.parse('{"architecture":"attention-v3-int8","formatVersion":3,"globalBias":[-0.32877659797668457,0.4370867609977722,-0.05251404270529747,1.3072023391723633,0.0477047860622406,0.24477416276931763,0.009111796505749226,-0.17459993064403534],"globalFeatureInverseStandardDeviation":[10.771836280822754,1.9548665285110474,1.612365484237671],"globalFeatureMean":[0.9198138117790222,-0.49808526039123535,0.03374629095196724],"globalWeights":[101,-4,7,-127,6,-11,3,1,0,-16,-7,8,-8,-1,7,-4,0,0,-12,-3,-13,1,0,2],"headBias":[-0.15895532071590424,0.007501596584916115,-0.47742825746536255,0.01632097363471985,-0.48355796933174133,-0.1052703931927681,-0.8414919376373291,-0.21046382188796997],"headWeights":[-45,-7,-45,-20,7,-13,120,-24,-15,-26,-19,1,27,-48,-4,-10,1,-5,-24,64,91,-1,-68,39,54,39,101,-40,-127,64,-41,-17,-23,-19,3,35,-2,33,3,9,-64,-32,30,42,-112,12,28,-11,15,2,-4,-7,7,-3,-5,1,76,48,-34,-67,103,-40,-26,1,58,-11,46,-41,5,-6,-17,-8,13,17,-35,45,27,-17,-28,7,-53,12,-51,6,-32,-5,58,-9,-28,-21,37,-12,1,20,2,2,11,7,-4,-9,2,-15,-1,-8,16,12,-27,-1,61,-5,-1,4,-7,-2,7,4,1,4,-2,4,-18,-16,28,6,-65,16,3,-3,-5,-2,0,-40,-21,-22,14,30,-21,49,15,-64,43,19,23,18,5,-15,21,21,30,17,-11,-6,22,-38,-20,97,-46,-5,-13,-59,26,-13,11,-2,-10,-8,2,-15,-17,-27,-9,26,7,-7,6,9,-32,5,-9,12,49,17,-1,24,20,35,14,-33,-50,-1,-4,-26,11,11,9,-80,30,9,36,6,-12,-4,-7,39,-10,-30,-49,1,-43,-20,-34,76,-36,-10,15,-8,43,31,38,-42,39,37,-7,7,8,16,28,-83,32,9,23,-13,39,119,23,-127,-24,8,-48,-29,-7,-33,-12,58,-24,-29,-19,12,-55,-90,0,126,26,42,54,22],"keyProjectionWeights":[0,-1,-1,1,1,1,1,1,-64,32,49,23,-25,4,27,-22,0,1,-1,-1,-1,1,1,0,-34,38,64,88,13,-53,-41,58,-7,-4,79,-41,27,26,14,2,-2,1,1,1,-1,-1,1,1,1,-1,-1,-1,-1,-1,1,1,4,-3,126,42,-40,-116,35,20],"name":"residual-attention-v3-50m-qat-int8-epoch-25-zo-278w","outputBias":-0.0005526235327124596,"outputWeights":[11,11,14,-27,9,-22,127,6],"quantization":{"scales":{"globalWeight":0.021090541950849095,"headWeight":0.04935851140909355,"keyWeight":0.1733924937791441,"outputWeight":0.0030087142047955295,"tapInputWeight":0.1096231754049479,"tapOutputWeight":0.017949438644286102,"valueWeight":0.013986751242596301},"scheme":"symmetric-int8-per-tensor","zeroPoint":0},"summaryQueries":[0.0038647791370749474,0.09565000981092453,0.002756686182692647,-0.08183622360229492,-0.15209506452083588,-0.0006105066277086735,0.0010439646430313587,-0.03020688332617283,0.005065929610282183,0.14488759636878967,0.003160916268825531,-0.0855727270245552,-0.3123375475406647,0.00039022407145239413,0.0037786494940519333,0.1451321840286255,-0.002009483054280281,0.0597594790160656,0.0045239729806780815,-0.08765853196382523,-0.13884992897510529,-0.0021647117100656033,0.003985927440226078,0.09727758169174194,0.007170629221946001,0.0786278173327446,0.004103775601834059,-0.1198369711637497,-0.2925199568271637,-0.002055276418104768,0.0030450925696641207,0.14401987195014954],"supportedDen
1oiseSamples":[4,8,16],"tapFeatureInverseStandardDeviation":[2.283243417739868,0.8810898065567017,0.8210930228233337,3.752316474914551,3.6375720500946045,2.670454978942871,10.249449729919434,0.12639354169368744,100],"tapFeatureMean":[0.010318092070519924,0.01364430133253336,0.13411010801792145,-0.004725644364953041,0.10053129494190216,0.8384788632392883,0.9203217625617981,1.7139031887054443,1],"tapInputBias":[0.4780646860599518,-0.45214661955833435,0.289407879114151,0.34804567694664,-0.1320028454065323,0.17722633481025696,0.011480014771223068,-0.26692497730255127],"tapInputWeights":[0,1,7,0,-1,-7,0,31,-2,-1,14,-126,0,0,-1,2,26,-2,0,66,-73,0,0,0,-12,22,-3,0,-76,-90,0,-1,-7,-3,58,-1,0,2,6,0,0,3,4,-40,0,0,3,-13,0,0,1,-7,-13,0,0,-7,10,0,-2,-7,0,-39,-2,0,-13,-19,0,-2,20,-1,3,-1],"tapOutputBias":[-0.3867710530757904,0.1349504142999649,0.35706064105033875,-0.5938405394554138,-0.031154220923781395,1.4079623222351074,-1.9221038818359375,0.6029739379882812],"tapOutputWeights":[18,-4,47,19,74,-94,-21,-9,73,-59,88,-10,-3,71,-7,24,20,74,24,-31,-12,-10,-15,-45,-126,2,-4,27,-5,24,35,-11,-4,9,-8,26,-10,27,26,-20,17,-50,5,-35,0,-5,12,-71,89,-58,22,-83,-115,7,-16,-89,89,22,1,-20,-22,-25,-26,44],"valueProjectionWeights":[-16,-6,40,-17,84,-76,59,51,-10,-2,-10,-1,-23,74,-70,23,-5,4,4,-7,-77,127,20,-48,-36,4,-17,-12,-4,10,29,-27,-2,11,-47,-50,-54,-3,14,11,-23,-1,109,31,4,-100,-33,-36,-19,0,-8,20,-35,-24,79,2,44,2,5,7,22,-70,-67,-35]}');const C=[["tapInputWeight","tapInputWeights",8,9],["tapOutputWeight","tapOutputWeights",8,8],["globalWeight","globalWeights",8,3],["keyWeight","keyProjectionWeights",8,8],["valueWeight","valueProjectionWeights",8,8],["headWeight","headWeights",8,32],["outputWeight","outputWeights",1,8]],T=e=>{const t=u(o).quantization?.scales?.[e];if(!(t>0)||!Number.isFinite(t))throw new Error(`The bundled N8AO neural model has no valid ${e} scale.`);return t};if(u(o).architecture!=="attention-v3-int8"||u(o).formatVersion!==3||u(o).quantization?.scheme!=="symmetric-int8-per-tensor"||u(o).quantization?.zeroPoint!==0||u(o).supportedDenoiseSamples?.join(",")!=="4,8,16"||C.some(([,e,t,r])=>u(o)[e]?.length!==t*r||u(o)[e].some(n=>!Number.isInteger(n)||n<-127||n>127)))throw new Error("The bundled N8AO neural denoise model has an unsupported layout.");const I=e=>{if(!Number.isFinite(e))throw new Error("The bundled N8AO neural model contains a non-finite value.");if(Object.is(e,-0))return"0.0";const t=Number(e).toString();return/[.eE]/.test(t)?t:`${t}.0`},N=["x","y","z","w"],B=e=>[...N.map(t=>`${e}.lo.${t}`),...N.map(t=>`${e}.hi.${t}`)],ve=(e,t)=>e===0?null:e===1?t:e===-1?`(-${t})`:e<0?`(-${I(-e)} * ${t})`:`${I(e)} * ${t}`,ge=(e,t)=>e===0?null:`${I(e)} * ${t}`,Y=e=>e.filter(Boolean).join(" + ")||"0.0",k=(e,t,r,n,l,s)=>{const b=n.map((a,m)=>ve(e[t*r+m],a));return`${I(l)} * (${Y(b)}) + ${I(s[t])}`},g=(e,t=" ")=>`vec4( 2${e.map(r=>`${t} ${r}`).join(`, 3`)} 4${t})`,_=({functionName:e,scaleName:t,weights:r,bias:n,width:l=8,relu:s=!1})=>{const b=B("inputToken"),a=T(t),m=Array.from({length:8},(p,$)=>k(r,$,l,b,a,n)),d=g(m.slice(0,4)),c=g(m.slice(4)),f=p=>s?`max(${p}, vec4(0.0))`:p;return` 5 NeuralToken neural${e[0].toUpperCase()}${e.slice(1)}(NeuralToken inputToken) { 6 return NeuralToken( 7 ${f(d)}, 8 ${f(c)} 9 ); 10 } 11`},J=(e,t,r,n,l,s,b,a={})=>Array.from({length:l},(m,d)=>{let c=t[d];for(let f=0;f<s;f++){const p=e[d*s+f]*b;c-=p*n[f]*r[f],Object.hasOwn(a,f)&&(c+=p*n[f]*a[f])}return c}),K=T("tapInputWeight"),be=J(u(o).tapInputWeights,u(o).tapInputBias,u(o).tapFeatureMean,u(o).tapFeatureInverseStandardDeviation,8,9,K,{8:1}),we=B("scaledInput"),q=Array.from({length:8},(e,t)=>k(u(o).tapInputWeights,t,9,we,K,be)),ye=` 12 NeuralToken neuralTapInput(NeuralToken raw) { 13 NeuralToken scaledInput = NeuralToken( 14 raw.lo * ${g(u(o).tapFeatureInverseStandardDeviation.slice(0,4)," ")}, 15 raw.hi * ${g(u(o).tapFeatureInverseStandardDeviation.slice(4,8)," ")} 16 ); 17 return NeuralToken( 18 max(${g(q.slice(0,4))}, vec4(0.0)), 19 max(${g(q.slice(4))}, vec4(0.0)) 20 ); 21 } 22`,Z=T("globalWeight"),We=J(u(o).globalWeights,u(o).globalBias,u(o).globalFeatureMean,u(o).globalFeatureInverseStandardDeviation,8,3,Z),Se=N.slice(0,3).map(e=>`scaledInput.${e}`),V=Array.from({length:8},(e,t)=>k(u(o).globalWeights,t,3,Se,Z,We)),Ee=` 23 NeuralToken neuralEncodeGlobal(vec4 raw) { 24 vec3 scaledInput = raw.xyz * vec3( 25 ${u(o).globalFeatureInverseStandardDeviation.map(I).join(", ")} 26 ); 27 return NeuralToken( 28 max(${g(V.slice(0,4))}, vec4(0.0)), 29 max(${g(V.slice(4))}, vec4(0.0)) 30 ); 31 } 32`,Oe=B("key"),Ie=Array.from({length:4},(e,t)=>Y(Oe.map((r,n)=>ge(u(o).summaryQueries[t*8+n],r)))),ze=` 33 vec4 neuralQueryScores(NeuralToken key) { 34 return ${g(Ie)}; 35 } 36`,ee=[];for(let e=0;e<4;e++)ee.push(...N.map(t=>`runningSummaryLo[${e}].${t}`),...N.map(t=>`runningSummaryHi[${e}].${t}`));const Ne=T("headWeight"),Q=Array.from({length:8},(e,t)=>k(u(o).headWeights,t,32,ee,Ne,u(o).headBias)),Te=` 37 NeuralToken neuralHead( 38 vec4 runningSummaryLo[4], 39 vec4 runningSummaryHi[4] 40 ) { 41 return NeuralToken( 42 max(${g(Q.slice(0,4))}, vec4(0.0)), 43 max(${g(Q.slice(4))}, vec4(0.0)) 44 ); 45 } 46`,ke=k(u(o).outputWeights,0,8,B("head"),T("outputWeight"),[u(o).outputBias]),xe=` 47 float neuralOutput(NeuralToken head) { 48 return ${ke}; 49 } 50`;[ye,_({functionName:"tapOutput",scaleName:"tapOutputWeight",weights:u(o).tapOutputWeights,bias:u(o).tapOutputBias,relu:!0}),Ee,_({functionName:"keyProject",scaleName:"keyWeight",weights:u(o).keyProjectionWeights,bias:new Array(8).fill(0)}),_({functionName:"valueProject",scaleName:"valueWeight",weights:u(o).valueProjectionWeights,bias:new Array(8).fill(0)}),ze,Te,xe].join(` 51`);C.reduce((e,[,t])=>e+u(o)[t].length,0);C.reduce((e,[,t])=>e+u(o)[t].filter(r=>r!==0).length,0);export{H as _,le as c,X as i,_e as j,se as m,Le as u,Fe as x}; 52//# sourceMappingURL=N8AO-DSJtmV3z.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.