diff --git a/assets/schema/derisk.sql b/assets/schema/derisk.sql index 4830425e..562694ab 100644 --- a/assets/schema/derisk.sql +++ b/assets/schema/derisk.sql @@ -9,7 +9,7 @@ use derisk; -- MySQL DDL Script for Derisk -- Version: 0.3.0 -- Generated from SQLAlchemy ORM Models --- Generated: 2026-03-09 22:38:05 +-- Generated: 2026-03-11 00:09:58 -- ============================================================ SET NAMES utf8mb4; diff --git a/packages/derisk-app/src/derisk_app/static/web/404.html b/packages/derisk-app/src/derisk_app/static/web/404.html deleted file mode 100644 index b90a06a2..00000000 --- a/packages/derisk-app/src/derisk_app/static/web/404.html +++ /dev/null @@ -1 +0,0 @@ -
a.x||s.x===a.x&&(i=a,r=s,0>sL(i.prev,i,r.prev)&&0>sL(r.next,i,i.next))))&&(a=s,f=u)),s=s.next}while(s!==c);return a}(e,t);if(!i)return t;var r=sN(i,e);return sC(r,r.next),sC(i,i.next)}(o[a],i);return i}(e,t,d,i)),e.length>80*i){r=s=e[0],a=n=e[1];for(var f=i;f s(t[d],c);)d++;for(;s(t[p],c)>0;)p--}0===s(t[r],c)?sG(t,r,p):sG(t,++p,a),p<=i&&(r=p+1),i<=p&&(a=p-1)}}(n,t,1,o||n.length-1,sH||sX),s[e]=s[e].slice(0,t))}return s}function sH(e,t){return t.area-e.area}function sK(e,t,i){let r=i.patternDependencies,a=!1;for(let i of t){let t=i.paint.get(`${e}-pattern`);t.isConstant()||(a=!0);let s=t.constantOr(null);s&&(a=!0,r[s.to]=!0,r[s.from]=!0)}return a}function sY(e,t,i,r,a){let s=a.patternDependencies;for(let n of t){let t=n.paint.get(`${e}-pattern`).value;if("constant"!==t.kind){let e=t.evaluate({zoom:r-1},i,{},a.availableImages),o=t.evaluate({zoom:r},i,{},a.availableImages),l=t.evaluate({zoom:r+1},i,{},a.availableImages);e=e&&e.name?e.name:e,o=o&&o.name?o.name:o,l=l&&l.name?l.name:l,s[e]=!0,s[o]=!0,s[l]=!0,i.patterns[n.id]={min:e,mid:o,max:l}}}return i}class sJ{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new ay,this.indexArray=new aE,this.indexArray2=new ak,this.programConfigurations=new a1(e.layers,e.zoom),this.segments=new aP,this.segments2=new aP,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,t,i){this.hasPattern=sK("fill",this.layers,t);let r=this.layers[0].layout.get("fill-sort-key"),a=!r.isConstant(),s=[];for(let{feature:n,id:o,index:l,sourceLayerIndex:h}of e){let e=this.layers[0]._featureFilter.needGeometry,u=a4(n,e);if(!this.layers[0]._featureFilter.filter(new rS(this.zoom),u,i))continue;let c=a?r.evaluate(u,{},i,t.availableImages):void 0,d={id:o,properties:n.properties,type:n.type,sourceLayerIndex:h,index:l,geometry:e?u.geometry:a3(n),patterns:{},sortKey:c};s.push(d)}for(let r of(a&&s.sort((e,t)=>e.sortKey-t.sortKey),s)){let{geometry:a,index:s,sourceLayerIndex:n}=r;if(this.hasPattern){let e=sY("fill",this.layers,r,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(r,a,s,i,{});t.featureIndex.insert(e[s].feature,a,s,n,this.index)}}update(e,t,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,i)}addFeatures(e,t,i){for(let e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,sA),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,i,r,a){for(let e of sW(t,500)){let t=0;for(let i of e)t+=i.length;let i=this.segments.prepareSegment(t,this.layoutVertexArray,this.indexArray),r=i.vertexLength,a=[],s=[];for(let t of e){if(0===t.length)continue;t!==e[0]&&s.push(a.length/2);let i=this.segments2.prepareSegment(t.length,this.layoutVertexArray,this.indexArray2),r=i.vertexLength;this.layoutVertexArray.emplaceBack(t[0].x,t[0].y),this.indexArray2.emplaceBack(r+t.length-1,r),a.push(t[0].x),a.push(t[0].y);for(let e=1;ea&&(T="bevel"),"bevel"===T&&(x>2&&(T="flipbevel"),x100)_=u.mult(-1);else{let e=x*h.add(u).mag()/h.sub(u).mag();_._perp()._mult(e*(w?-1:1))}this.addCurrentVertex(n,_,0,0,m),this.addCurrentVertex(n,_.mult(-1),0,0,m)}else if("bevel"===T||"fakeround"===T){let e=-Math.sqrt(x*x-1),t=w?e:0,i=w?0:e;if(o&&this.addCurrentVertex(n,h,t,i,m),"fakeround"===T){let e=Math.round(180*v/Math.PI/20);for(let t=1;tc.d||!c.d)&&(c=r,i&&console.log("found best %d after %d probes",Math.round(1e4*r.d)/1e4,d)),r.max-c.d<=t||(h=r.h/2,u.push(new oj(r.p.x-h,r.p.y-h,h,e)),u.push(new oj(r.p.x+h,r.p.y-h,h,e)),u.push(new oj(r.p.x-h,r.p.y+h,h,e)),u.push(new oj(r.p.x+h,r.p.y+h,h,e)),d+=4)}return i&&(console.log(`num probes: ${d}`),console.log(`best distance: ${c.d}`)),c.p}(e,16);P(e[0],new oz(t.x,t.y,0))}else if("LineString"===i.type)for(let e of i.geometry)P(e,new oz(e[0].x,e[0].y,0));else if("Point"===i.type)for(let e of i.geometry)for(let t of e)P([t],new oz(t.x,t.y,0))}(t.bucket,a,f,_,t.imageMap,s,d,p,g,y,t.canonical)}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()},e.br=nc,e.bs=sJ,e.bt=ni,e.bu=class{constructor(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let e=performance.getEntriesByName(this._marks.measure);return 0===e.length&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),e=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),e}},e.bv=nV,e.bw=s3,e.bx=function(e,t,i,s,n){return b(this,void 0,void 0,function*(){if(z())try{return yield H(e,t,i,s,n)}catch(e){}let o=e.width,l=e.height;r&&a||(a=(r=new OffscreenCanvas(o,l)).getContext("2d",{willReadFrequently:!0})),r.width=o,r.height=l,a.drawImage(e,0,0,o,l);let h=a.getImageData(t,i,s,n);return a.clearRect(0,0,o,l),h.data})},e.by=oT,e.bz=w,e.c=Y,e.d=function(e,t){let i=new Image;i.onload=()=>{t(null,i),URL.revokeObjectURL(i.src),i.onload=null,window.requestAnimationFrame(()=>{i.src=W})},i.onerror=()=>t(Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let r=new Blob([new Uint8Array(e)],{type:"image/png"});i.src=e.byteLength?URL.createObjectURL(r):W},e.e=F,e.f=function(e,t){return ei(F(e,{type:"json"}),t)},e.g=ee,e.h=K,e.i=Z,e.j=el,e.k=eo,e.l=er,e.m=ei,e.n=function(e){return new nV(e).readFields(nN,[])},e.o=function(e,t,i){if(!e.length)return i(null,[]);let r=e.length,a=Array(e.length),s=null;e.forEach((e,n)=>{t(e,(e,t)=>{e&&(s=e),a[n]=t,0==--r&&i(s,a)})})},e.p=nj,e.q=sv,e.r=rF,e.s=ea,e.t=i4,e.u=rn,e.v=eu,e.w=j,e.x=i9,e.y=i1,e.z=function([e,t,i]){return t+=90,{x:e*Math.cos(t*=Math.PI/180)*Math.sin(i*=Math.PI/180),y:e*Math.sin(t)*Math.sin(i),z:e*Math.cos(i)}}}),r(["./shared"],function(e){class t{constructor(e){this.keyCache={},e&&this.replace(e)}replace(e){this._layerConfigs={},this._layers={},this.update(e,[])}update(t,i){for(let i of t){this._layerConfigs[i.id]=i;let t=this._layers[i.id]=e.aC(i);t._featureFilter=e.a6(t.filter),this.keyCache[i.id]&&delete this.keyCache[i.id]}for(let e of i)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];for(let t of(this.familiesBySource={},e.bl(Object.values(this._layerConfigs),this.keyCache))){let e=t.map(e=>this._layers[e.id]),i=e[0];if("none"===i.visibility)continue;let r=i.source||"",a=this.familiesBySource[r];a||(a=this.familiesBySource[r]={});let s=i.sourceLayer||"_geojsonTileLayer",n=a[s];n||(n=a[s]=[]),n.push(e)}}}class i{constructor(t){let i={},r=[];for(let e in t){let a=t[e],s=i[e]={};for(let e in a){let t=a[+e];if(!t||0===t.bitmap.width||0===t.bitmap.height)continue;let i={x:0,y:0,w:t.bitmap.width+2,h:t.bitmap.height+2};r.push(i),s[e]={rect:i,metrics:t.metrics}}}let{w:a,h:s}=e.p(r),n=new e.q({width:a||1,height:s||1});for(let r in t){let a=t[r];for(let t in a){let s=a[+t];if(!s||0===s.bitmap.width||0===s.bitmap.height)continue;let o=i[r][t].rect;e.q.copy(s.bitmap,n,{x:0,y:0},{x:o.x+1,y:o.y+1},s.bitmap)}}this.image=n,this.positions=i}}e.bm("GlyphAtlas",i);class r{constructor(t){this.tileID=new e.O(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.inFlightDependencies=[],this.dependencySentinel=-1}parse(t,r,s,n,o){let l,h,u,c;this.status="parsing",this.data=t,this.collisionBoxArray=new e.a3;let d=new e.bn(Object.keys(t.layers).sort()),p=new e.bo(this.tileID,this.promoteId);p.bucketLayerIDs=[];let f={},m={featureIndex:p,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:s},_=r.familiesBySource[this.source];for(let i in _){let r=t.layers[i];if(!r)continue;1===r.version&&e.w(`Vector tile source "${this.source}" layer "${i}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let n=d.encode(i),o=[];for(let e=0;e=a&&t.y{let i=e.feature,r=t.getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=r});return c}(this.sourceCaches[o],this._layers,n,t,i,r));return this.placement&&s.push(function(e,t,i,r,a,s,n){let o={},l=s.queryRenderedSymbols(r),h=[];for(let e of Object.keys(l).map(Number))h.push(n[e]);for(let i of(h.sort(X),h)){let r=i.featureIndex.lookupSymbolFeatures(l[i.bucketInstanceId],t,i.bucketIndex,i.sourceLayerIndex,a.filter,a.layers,a.availableImages,e);for(let e in r){let t=o[e]=o[e]||[],a=r[e];for(let e of(a.sort((e,t)=>{let r=i.featureSortOrder;if(r){let i=r.indexOf(e.featureIndex);return r.indexOf(t.featureIndex)-i}return t.featureIndex-e.featureIndex}),a))t.push(e)}}for(let t in o)o[t].forEach(r=>{let a=r.feature,s=i[e[t].source].getFeatureState(a.layer["source-layer"],a.id);a.source=a.layer.source,a.layer["source-layer"]&&(a.sourceLayer=a.layer["source-layer"]),a.state=s});return o}(this._layers,n,this.sourceCaches,t,i,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(s)}querySourceFeatures(t,i){i&&i.filter&&this._validate(e.y.filter,"querySourceFeatures.filter",i.filter,null,i);let r=this.sourceCaches[t];return r?function(e,t){let i=e.getRenderableIds().map(t=>e.getTileByID(t)),r=[],a={};for(let e=0;e